.include "asm/macros.s" .include "constants/constants.s" .include "asm/charmap.s" .syntax unified .global Start .text .arm Start: .include "asm/crt0.s" .include "asm/main.s" .include "asm/malloc.s" .include "asm/dma3_manager.s" .include "asm/gpu_reg_manager.s" .include "asm/gpu_bg.s" .include "asm/pixel_buffer.s" .include "asm/window.s" .include "asm/text_renderer.s" .include "asm/gpu_obj.s" 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 ; int decimal_int_to_string(char *dest, int decimal_num, int mode, int max_digits) 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, =gUnknown_082EC7E4 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, =gUnknown_082EC7D4 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 .pool @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, =gUnknown_082EC7E4 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, =gUnknown_082EC7D4 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 .pool @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, =gUnknown_082EC7D4 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 .pool @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 ; char *ExpandTextCodes(char *dest, char *src) 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, =@08008F00 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =@08008F4C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_082EC80C mov r0, sp movs r2, 0x4 bl memcpy add r4, sp, 0x4 ldr r1, =gUnknown_082EC810 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 .pool @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, =0x020223ac bx lr .align 2, 0 .pool thumb_func_end sub_800902C thumb_func_start sub_8009034 sub_8009034: ; 8009034 ldr r0, =0x03005d90 ldr r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8009034 thumb_func_start sub_8009040 sub_8009040: ; 8009040 ldr r0, =0x02021cc4 bx lr .align 2, 0 .pool thumb_func_end sub_8009040 thumb_func_start sub_8009048 sub_8009048: ; 8009048 ldr r0, =0x02021dc4 bx lr .align 2, 0 .pool thumb_func_end sub_8009048 thumb_func_start sub_8009050 sub_8009050: ; 8009050 ldr r0, =0x02021ec4 bx lr .align 2, 0 .pool thumb_func_end sub_8009050 thumb_func_start sub_8009058 sub_8009058: ; 8009058 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 beq @08009070 ldr r0, =gUnknown_085E821A b @08009072 .align 2, 0 .pool @08009070: ldr r0, =gUnknown_085E8219 @08009072: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8009058 thumb_func_start sub_800907C sub_800907C: ; 800907C push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 beq @08009094 ldr r0, =gUnknown_085E8258 b @08009096 .align 2, 0 .pool @08009094: ldr r0, =gUnknown_085E8260 @08009096: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800907C thumb_func_start sub_80090A0 sub_80090A0: ; 80090A0 ldr r0, =gUnknown_085E8229 bx lr .align 2, 0 .pool thumb_func_end sub_80090A0 thumb_func_start sub_80090A8 sub_80090A8: ; 80090A8 ldr r0, =gUnknown_085E8231 bx lr .align 2, 0 .pool thumb_func_end sub_80090A8 thumb_func_start sub_80090B0 sub_80090B0: ; 80090B0 ldr r0, =gUnknown_085E8236 bx lr .align 2, 0 .pool thumb_func_end sub_80090B0 thumb_func_start sub_80090B8 sub_80090B8: ; 80090B8 ldr r0, =gUnknown_085E823C bx lr .align 2, 0 .pool thumb_func_end sub_80090B8 thumb_func_start sub_80090C0 sub_80090C0: ; 80090C0 ldr r0, =gUnknown_085E8243 bx lr .align 2, 0 .pool thumb_func_end sub_80090C0 thumb_func_start sub_80090C8 sub_80090C8: ; 80090C8 ldr r0, =gUnknown_085E8249 bx lr .align 2, 0 .pool thumb_func_end sub_80090C8 thumb_func_start sub_80090D0 sub_80090D0: ; 80090D0 ldr r0, =gUnknown_085E8250 bx lr .align 2, 0 .pool thumb_func_end sub_80090D0 thumb_func_start get_fcode_buffer get_fcode_buffer: ; 80090D8 push {lr} cmp r0, 0xD bhi @080090F0 ldr r1, =gUnknown_082EC818 lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 b @080090F2 .align 2, 0 .pool @080090F0: ldr r0, =gUnknown_085E8218 @080090F2: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end get_fcode_buffer thumb_func_start RepeatChar ; int RepeatChar(char *dest, char c, u16 length) RepeatChar: ; 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 RepeatChar 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, =0x0000ffff 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 .pool 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 RepeatChar 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, =gUnknown_082EC850 adds r0, r1, r0 ldrb r0, [r0] @0800928E: pop {r1} bx r1 .align 2, 0 .pool 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, =0x00008001 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 .pool @080093F4: bl rfu_REQ_stopMode bl rfu_waitREQComplete movs r0, 0x1 @080093FE: pop {r1} bx r1 thumb_func_end sub_80093CC thumb_func_start sub_8009404 sub_8009404: ; 8009404 push {lr} lsls r0, 24 lsrs r0, 24 bl remove_task pop {r0} bx r0 thumb_func_end sub_8009404 thumb_func_start sub_8009414 sub_8009414: ; 8009414 push {r4-r7,lr} mov r7, r8 push {r7} adds r5, r0, 0 ldr r4, [sp, 0x18] lsls r5, 24 lsrs r5, 24 lsls r1, 24 lsrs r1, 24 mov r8, r1 lsls r2, 24 lsrs r6, r2, 24 lsls r3, 24 lsrs r7, r3, 24 lsls r4, 16 lsrs r4, 16 ldr r0, =gUnknown_082ECF20 lsls r1, r5, 4 movs r2, 0x20 bl gpu_pal_apply ldr r3, =0x040000d4 ldr r0, =gUnknown_082ECF40 str r0, [r3] lsls r2, r7, 14 lsls r0, r4, 5 movs r1, 0xC0 lsls r1, 19 adds r0, r1 adds r2, r0 str r2, [r3, 0x4] ldr r0, =0x80000110 str r0, [r3, 0x8] ldr r0, [r3, 0x8] ldr r0, =0x03003130 str r6, [r0] str r5, [r0, 0x4] str r4, [r0, 0x8] mov r0, r8 cmp r0, 0x2 beq @0800949E cmp r0, 0x2 bgt @08009484 cmp r0, 0x1 beq @0800948C b @080094C0 .align 2, 0 .pool @08009484: mov r0, r8 cmp r0, 0x3 beq @080094B0 b @080094C0 @0800948C: lsls r1, r6, 8 movs r0, 0x1 orrs r1, r0 lsls r0, r7, 2 orrs r1, r0 movs r0, 0xA bl 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, =gUnknown_082ECF20 mov r2, r8 lsls r1, r2, 4 movs r2, 0x20 bl gpu_pal_apply ldr r2, =0x040000d4 ldr r0, =gUnknown_082ECF40 str r0, [r2] lsls r0, r5, 14 movs r1, 0xC0 lsls r1, 19 adds r0, r1 str r0, [r2, 0x4] ldr r0, =0x80000110 str r0, [r2, 0x8] ldr r0, [r2, 0x8] ldr r0, =0x03003130 str r4, [r0] mov r1, r8 str r1, [r0, 0x4] movs r1, 0 str r1, [r0, 0x8] ldr r0, =gUnknown_082ED1D0 adds r6, r0 ldrb r0, [r6] lsls r4, 8 lsls r5, 2 orrs r4, r5 adds r1, r4, 0 bl lcd_io_set pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80096BC bl SetVBlankCallback bl sub_800A2E0 ldr r1, =0x020229c6 ldr r2, =0x00001111 adds r0, r2, 0 strh r0, [r1] bl sub_8009734 ldr r0, =0x030022c0 ldrh r0, [r0, 0x24] bl SeedRng movs r4, 0 @080095A0: bl GenerateRandomNumber ldr r1, =0x03005d90 ldr r1, [r1] adds r1, 0xA adds r1, r4 strb r0, [r1] adds r4, 0x1 cmp r4, 0x3 ble @080095A0 movs r4, 0 str r4, [sp] movs r0, 0 movs r1, 0x2 movs r2, 0x4 movs r3, 0 bl sub_8009414 movs r1, 0xAA lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =sub_8009404 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, =0x03000d60 str r4, [r0] bl sub_8009638 ldr r0, =task00_link_test movs r1, 0 bl AddTask ldr r0, =c2_08009A8C bl set_callback2 add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009570 thumb_func_start sub_8009628 sub_8009628: ; 8009628 lsls r0, 24 lsrs r0, 24 ldr r1, =0x020229cc strh r0, [r1, 0x18] bx lr .align 2, 0 .pool thumb_func_end sub_8009628 thumb_func_start sub_8009638 sub_8009638: ; 8009638 push {r4,r5,lr} ldr r5, =0x020229cc ldr r4, =0x03005d90 ldr r1, [r4] ldrb r2, [r1, 0xA] ldrb r0, [r1, 0xB] lsls r0, 8 orrs r2, r0 ldrb r0, [r1, 0xC] lsls r0, 16 orrs r2, r0 ldrb r0, [r1, 0xD] lsls r0, 24 orrs r2, r0 str r2, [r5, 0x4] adds r0, r5, 0 adds r0, 0x8 bl gf_strcpy ldr r0, [r4] ldrb r0, [r0, 0x8] strb r0, [r5, 0x13] ldr r0, =0x020229c6 ldrh r0, [r0] str r0, [r5, 0x14] ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strh r0, [r5, 0x1A] ldr r0, =gUnknown_82E9530 ldrb r0, [r0] movs r2, 0x80 lsls r2, 7 adds r1, r2, 0 adds r0, r1 strh r0, [r5] movs r0, 0x80 lsls r0, 8 strh r0, [r5, 0x2] bl sub_809D42C strb r0, [r5, 0x10] ldr r0, =0x0000087f bl 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 .pool 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, =0x020229c4 ldr r1, =0x03003110 ldr r2, =0x0000efff adds r0, r1, 0 adds r0, 0xE @080096DC: strh r2, [r0] subs r0, 0x2 cmp r0, r1 bge @080096DC movs r0, 0x1 strb r0, [r3] bl sub_800B594 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80096D0 thumb_func_start task02_080097CC task02_080097CC: ; 80096FC push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] lsls r0, 16 asrs r0, 16 cmp r0, 0x5 bne @08009726 ldr r1, =0x03003144 movs r0, 0x1 strb r0, [r1] adds r0, r2, 0 bl remove_task @08009726: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task02_080097CC thumb_func_start sub_8009734 sub_8009734: ; 8009734 push {r4-r6,lr} ldr r0, =0x030030fc ldrb r4, [r0] cmp r4, 0 bne @080097A8 bl sub_800B628 bl sub_80096D0 ldr r1, =0x03003140 ldr r0, =sub_800A824 str r0, [r1] ldr r0, =0x03002748 strb r4, [r0] ldr r0, =0x0300306c strb r4, [r0] ldr r0, =0x030030f8 strb r4, [r0] bl sub_800A5B4 bl sub_800A2E0 ldr r0, =0x03000d54 str r4, [r0] ldr r0, =0x030030e8 strb r4, [r0] ldr r0, =0x030030e4 strb r4, [r0] ldr r0, =0x030030f4 strh r4, [r0] ldr r0, =task02_080097CC movs r1, 0x2 bl AddTask b @080097AC .align 2, 0 .pool @080097A8: bl sub_800E700 @080097AC: ldr r1, =0x03003124 movs r0, 0 strb r0, [r1] movs r1, 0 ldr r6, =0x03003078 movs r2, 0 movs r5, 0x1 ldr r4, =0x030030f0 ldr r3, =0x030030ec @080097BE: adds r0, r1, r6 strb r5, [r0] adds r0, r1, r4 strb r2, [r0] adds r0, r1, r3 strb r2, [r0] adds r1, 0x1 cmp r1, 0x3 ble @080097BE pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009734 thumb_func_start sub_80097E8 sub_80097E8: ; 80097E8 push {r4,lr} ldr r0, =0x03003124 movs r4, 0 strb r4, [r0] ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080097FC bl sub_800EDD4 @080097FC: ldr r0, =0x020229c4 strb r4, [r0] bl sub_800B53C pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80097E8 thumb_func_start sub_8009818 sub_8009818: ; 8009818 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r5, =0x03000d64 ldr r4, =0x03000d10 ldrb r0, [r5] ldrh r1, [r4] cmp r0, r1 beq @0800983C ldrh r0, [r4] movs r1, 0x2 movs r2, 0x3 movs r3, 0x2 bl sub_800A6E8 ldrh r0, [r4] strb r0, [r5] @0800983C: movs r5, 0 ldr r7, =0x03000d20 @08009840: ldr r0, =0x03000d68 adds r6, r5, r0 lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r4, r0, r7 ldrb r0, [r6] ldrh r1, [r4] cmp r0, r1 beq @08009868 ldrh r0, [r4] adds r2, r5, 0x4 lsls r2, 24 lsrs r2, 24 movs r1, 0x2 movs r3, 0x2 bl sub_800A6E8 ldrh r0, [r4] strb r0, [r6] @08009868: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x3 bls @08009840 bl sub_800A550 lsls r0, 24 lsrs r7, r0, 24 cmp r7, 0xF bne @080098CE movs r5, 0 ldr r0, =0x03000d20 mov r9, r0 ldr r1, =0x00000342 mov r8, r1 @08009888: adds r0, r7, 0 asrs r0, r5 movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @080098C4 lsls r0, r5, 8 ldr r1, =0x020223c4 adds r0, r1 lsls r4, r5, 1 adds r1, r4, r5 lsls r1, 2 add r1, r9 ldrh r1, [r1, 0x2] bl sub_800A648 ldr r1, =0x03003148 adds r4, r1 movs r6, 0 strh r0, [r4] adds r0, r5, 0 bl sub_800A5EC ldrh r0, [r4] cmp r0, r8 beq @080098C4 ldr r0, =0x020223bc strb r6, [r0] ldr r0, =0x020223bd strb r6, [r0] @080098C4: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x3 bls @08009888 @080098CE: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009818 thumb_func_start sub_8009900 sub_8009900: ; 8009900 push {r4,r5,lr} sub sp, 0x4 ldr r4, =0x030022c0 ldrh r1, [r4, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08009916 ldr r1, =0x03003144 movs r0, 0x1 strb r0, [r1] @08009916: ldrh r1, [r4, 0x2C] movs r5, 0x2 adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @0800992A ldr r0, =0x02004000 ldr r1, =0x00002004 bl sub_800A2F4 @0800992A: ldrh r1, [r4, 0x2E] movs r0, 0x80 lsls r0, 2 ands r0, r1 cmp r0, 0 beq @08009946 movs r0, 0x1 negs r0, r0 str r5, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl 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, =0x020223bc ldrb r0, [r0] cmp r0, 0 beq @08009996 ldr r2, [r4, 0x24] ldr r0, =0x03002748 ldrb r1, [r0] ldr r0, =0x03003140 ldr r0, [r0] cmp r0, 0 bne @08009990 movs r0, 0x10 orrs r1, r0 @08009990: adds r0, r2, 0 bl sub_800A994 @08009996: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009900 thumb_func_start c2_08009A8C c2_08009A8C: ; 80099BC push {lr} bl sub_8009900 movs r0, 0x1 movs r1, 0x1 movs r2, 0 bl sub_8009818 bl 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, =0x020229c4 ldrb r0, [r0] cmp r0, 0 bne @080099F4 movs r0, 0 b @08009A3C .align 2, 0 .pool @080099F4: movs r1, 0 ldr r5, =0x03003084 ldr r3, =0x03003110 movs r2, 0 @080099FC: lsls r0, r1, 1 adds r0, r3 strh r2, [r0] adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x7 bls @080099FC ldrh r0, [r4] strh r0, [r5] ldr r0, =0x030030e0 ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08009A38 ldr r0, =0x04000128 ldr r0, [r0] lsls r0, 26 lsrs r0, 30 bl sub_8009AA0 ldr r0, =0x03003140 ldr r0, [r0] cmp r0, 0 beq @08009A34 bl _call_via_r0 @08009A34: bl sub_800AEB4 @08009A38: ldr r0, =0x030030e0 ldrh r0, [r0] @08009A3C: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80099E0 thumb_func_start sub_8009A58 sub_8009A58: ; 8009A58 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 movs r5, 0 ldr r1, =0x03003078 adds r0, r1 strb r5, [r0] movs r4, 0 adds r6, r1, 0 b @08009A78 .align 2, 0 .pool @08009A70: adds r0, r4, r6 ldrb r0, [r0] adds r5, r0 adds r4, 0x1 @08009A78: bl sub_800ABAC lsls r0, 24 lsrs r0, 24 cmp r4, r0 blt @08009A70 cmp r5, 0 bne @08009A94 ldr r1, =0x03003124 ldrb r0, [r1] cmp r0, 0 bne @08009A94 movs r0, 0x1 strb r0, [r1] @08009A94: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009A58 thumb_func_start sub_8009AA0 sub_8009AA0: ; 8009AA0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r6, 0 @08009AAE: ldr r0, =0x03003020 lsls r1, r6, 1 adds r3, r1, r0 movs r0, 0 strh r0, [r3] lsls r4, r6, 4 ldr r5, =0x03003090 adds r2, r4, r5 ldrh r0, [r2] mov r12, r1 adds r7, r6, 0x1 str r7, [sp] cmp r0, 0 bne @08009ACC b @08009D6E @08009ACC: ldrh r1, [r2] ldr r0, =0x00005fff cmp r1, r0 bne @08009AD6 b @08009D20 @08009AD6: cmp r1, r0 bgt @08009B24 ldr r0, =0x00004444 cmp r1, r0 bne @08009AE2 b @08009D64 @08009AE2: cmp r1, r0 bgt @08009B10 ldr r0, =0x00002222 cmp r1, r0 beq @08009B68 ldr r0, =0x00002ffe cmp r1, r0 bne @08009AF4 b @08009D28 @08009AF4: b @08009D6E .align 2, 0 .pool @08009B10: ldr r0, =0x00005555 cmp r1, r0 beq @08009BB8 adds r0, 0x11 cmp r1, r0 beq @08009BB8 b @08009D6E .align 2, 0 .pool @08009B24: ldr r0, =0x0000bbbb cmp r1, r0 beq @08009BC4 cmp r1, r0 bgt @08009B4C ldr r0, =0x00008888 cmp r1, r0 beq @08009BF0 ldr r0, =0x0000aaaa cmp r1, r0 bne @08009B3C b @08009D38 @08009B3C: b @08009D6E .align 2, 0 .pool @08009B4C: ldr r0, =0x0000cafe cmp r1, r0 bne @08009B54 b @08009D64 @08009B54: ldr r0, =0x0000cccc cmp r1, r0 bne @08009B5C b @08009D3E @08009B5C: b @08009D6E .align 2, 0 .pool @08009B68: bl sub_8009638 ldr r0, =0x03003030 adds r2, r0, 0 adds r2, 0x10 ldr r1, =0x020229cc ldm r1!, {r3-r5} stm r2!, {r3-r5} ldm r1!, {r3,r6,r7} stm r2!, {r3,r6,r7} ldr r1, [r1] str r1, [r2] ldr r4, =gUnknown_082ED1D4 adds r2, r0, 0 adds r1, r4, 0 ldm r1!, {r5-r7} stm r2!, {r5-r7} ldrh r3, [r1] strh r3, [r2] ldrb r1, [r1, 0x2] strb r1, [r2, 0x2] adds r1, r0, 0 adds r1, 0x2C ldm r4!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldrh r2, [r4] strh r2, [r1] ldrb r2, [r4, 0x2] strb r2, [r1, 0x2] movs r1, 0x3C bl sub_800A2F4 b @08009D6E .align 2, 0 .pool @08009BB8: ldr r1, =0x030030e8 movs r0, 0x1 strb r0, [r1] b @08009D6E .align 2, 0 .pool @08009BC4: mov r7, r12 adds r1, r7, r6 lsls r1, 2 ldr r0, =0x03000d20 adds r1, r0 movs r2, 0 strh r2, [r1] ldr r0, =0x03003090 adds r0, 0x2 adds r0, r4, r0 ldrh r0, [r0] strh r0, [r1, 0x2] ldr r0, =0x03003090 adds r0, 0x4 adds r0, r4, r0 ldrh r0, [r0] strb r0, [r1, 0x9] b @08009D6E .align 2, 0 .pool @08009BF0: mov r3, r12 adds r0, r3, r6 lsls r0, 2 ldr r5, =0x03000d20 adds r3, r0, r5 ldrh r1, [r3, 0x2] movs r0, 0x80 lsls r0, 1 adds r7, r5, 0 mov r10, r7 cmp r1, r0 bls @08009C40 ldr r0, =0x0201c000 mov r8, r0 movs r2, 0 adds r5, r3, 0 ldr r7, =0x03003090 adds r3, r4, 0 @08009C14: ldrh r1, [r5] lsrs r1, 1 adds r1, r2 lsls r1, 1 add r1, r8 adds r2, 0x1 lsls r0, r2, 1 adds r0, r3 adds r0, r7 ldrh r0, [r0] strh r0, [r1] lsls r2, 16 lsrs r2, 16 cmp r2, 0x6 bls @08009C14 b @08009C70 .align 2, 0 .pool @08009C40: movs r2, 0 ldr r1, =0x020223c4 mov r9, r1 adds r7, r3, 0 ldr r3, =0x03003090 mov r8, r3 lsls r5, r6, 8 adds r3, r4, 0 @08009C50: ldrh r1, [r7] lsrs r1, 1 adds r1, r2 lsls r1, 1 adds r1, r5 add r1, r9 adds r2, 0x1 lsls r0, r2, 1 adds r0, r3 add r0, r8 ldrh r0, [r0] strh r0, [r1] lsls r2, 16 lsrs r2, 16 cmp r2, 0x6 bls @08009C50 @08009C70: mov r4, r12 adds r1, r4, r6 lsls r1, 2 add r1, r10 ldrh r0, [r1] adds r0, 0xE movs r3, 0 strh r0, [r1] lsls r0, 16 lsrs r0, 16 ldrh r1, [r1, 0x2] cmp r0, r1 bcc @08009D6E ldr r0, =0x03003078 adds r0, r6, r0 ldrb r0, [r0] cmp r0, 0x1 bne @08009D16 lsls r1, r6, 8 ldr r0, =0x020223c4 adds r1, r0 mov r8, r1 lsls r0, r6, 3 subs r0, r6 lsls r0, 2 ldr r1, =0x020229e8 adds r2, r0, r1 adds r1, r2, 0 mov r0, r8 adds r0, 0x10 ldm r0!, {r4,r5,r7} stm r1!, {r4,r5,r7} ldm r0!, {r4,r5,r7} stm r1!, {r4,r5,r7} ldr r0, [r0] str r0, [r1] ldrb r0, [r2] subs r0, 0x1 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @08009CCA strb r3, [r2, 0x12] strb r3, [r2, 0x11] strb r3, [r2, 0x10] @08009CCA: adds r0, r2, 0 bl sub_800B524 ldr r5, =gUnknown_082ED1D4 mov r0, r8 adds r1, r5, 0 bl strcmp cmp r0, 0 bne @08009CEC mov r0, r8 adds r0, 0x2C adds r1, r5, 0 bl strcmp cmp r0, 0 beq @08009D0C @08009CEC: ldr r0, =c2_800ACD4 bl set_callback2 b @08009D6E .align 2, 0 .pool @08009D0C: lsls r0, r6, 24 lsrs r0, 24 bl sub_8009A58 b @08009D6E @08009D16: lsls r0, r6, 24 lsrs r0, 24 bl sub_800A588 b @08009D6E @08009D20: ldr r0, =0x030030f0 b @08009D2A .align 2, 0 .pool @08009D28: ldr r0, =0x030030ec @08009D2A: adds r0, r6, r0 movs r1, 0x1 strb r1, [r0] b @08009D6E .align 2, 0 .pool @08009D38: bl sub_800A418 b @08009D6E @08009D3E: ldr r3, =gUnknown_082ED1A8 ldr r0, =0x03003090 adds r0, 0x2 adds r0, r4, r0 ldrh r2, [r0] lsls r2, 3 adds r0, r2, r3 ldr r1, [r0] adds r3, 0x4 adds r2, r3 ldrh r2, [r2] movs r0, 0 bl link_0800A448 b @08009D6E .align 2, 0 .pool @08009D64: ldr r0, =0x03003090 adds r0, 0x2 adds r0, r4, r0 ldrh r0, [r0] strh r0, [r3] @08009D6E: ldr r5, [sp] lsls r0, r5, 16 lsrs r6, r0, 16 cmp r6, 0x3 bhi @08009D7A b @08009AAE @08009D7A: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009AA0 thumb_func_start sub_8009D90 sub_8009D90: ; 8009D90 push {lr} lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x00006666 cmp r2, r0 beq @08009E60 cmp r2, r0 bgt @08009DF0 ldr r0, =0x00004444 cmp r2, r0 beq @08009E4C cmp r2, r0 bgt @08009DCC ldr r0, =0x00002222 cmp r2, r0 beq @08009E38 ldr r0, =0x00002ffe @08009DB2: cmp r2, r0 bne @08009DB8 b @08009EE4 @08009DB8: b @08009F06 .align 2, 0 .pool @08009DCC: ldr r0, =0x00005566 cmp r2, r0 bne @08009DD4 b @08009EE4 @08009DD4: cmp r2, r0 bgt @08009DE0 subs r0, 0x11 b @08009DB2 .align 2, 0 .pool @08009DE0: ldr r0, =0x00005fff cmp r2, r0 bne @08009DE8 b @08009ED0 @08009DE8: b @08009F06 .align 2, 0 .pool @08009DF0: ldr r0, =0x0000aaab cmp r2, r0 beq @08009EA8 cmp r2, r0 bgt @08009E10 ldr r0, =0x00007777 cmp r2, r0 beq @08009E6C ldr r0, =0x0000aaaa b @08009DB2 .align 2, 0 .pool @08009E10: ldr r0, =0x0000cafe cmp r2, r0 beq @08009EF0 cmp r2, r0 bgt @08009E2C ldr r0, =0x0000bbbb cmp r2, r0 beq @08009E8C b @08009F06 .align 2, 0 .pool @08009E2C: ldr r0, =0x0000cccc cmp r2, r0 beq @08009EBC b @08009F06 .align 2, 0 .pool @08009E38: ldr r0, =0x03003110 strh r2, [r0] ldr r1, =0x020229c6 ldrh r1, [r1] b @08009F04 .align 2, 0 .pool @08009E4C: ldr r0, =0x03003110 strh r2, [r0] ldr r1, =0x030022c0 ldrh r1, [r1, 0x2C] b @08009F04 .align 2, 0 .pool @08009E60: ldr r0, =0x03003110 movs r1, 0 b @08009F02 .align 2, 0 .pool @08009E6C: ldr r0, =0x03003110 strh r2, [r0] movs r1, 0 adds r3, r0, 0 movs r2, 0xEE @08009E76: adds r1, 0x1 lsls r0, r1, 1 adds r0, r3 strh r2, [r0] lsls r1, 24 lsrs r1, 24 cmp r1, 0x4 bls @08009E76 b @08009F06 .align 2, 0 .pool @08009E8C: ldr r1, =0x03003110 strh r2, [r1] ldr r2, =0x03000d10 ldrh r0, [r2, 0x2] strh r0, [r1, 0x2] ldrb r0, [r2, 0x9] adds r0, 0x80 strh r0, [r1, 0x4] b @08009F06 .align 2, 0 .pool @08009EA8: ldr r0, =0x03003110 strh r2, [r0] ldr r1, =0x0203ce7c ldrh r1, [r1] b @08009F04 .align 2, 0 .pool @08009EBC: ldr r0, =0x03003110 strh r2, [r0] ldr r1, =0x03003150 ldrb r1, [r1] b @08009F04 .align 2, 0 .pool @08009ED0: ldr r0, =0x03003110 strh r2, [r0] ldr r1, =0x030030f4 ldrh r1, [r1] b @08009F04 .align 2, 0 .pool @08009EE4: ldr r0, =0x03003110 strh r2, [r0] b @08009F06 .align 2, 0 .pool @08009EF0: ldr r0, =0x03005da8 ldrh r1, [r0] cmp r1, 0 beq @08009F06 ldr r0, =0x030022b4 ldrb r0, [r0] cmp r0, 0 bne @08009F06 ldr r0, =0x03003110 @08009F02: strh r2, [r0] @08009F04: strh r1, [r0, 0x2] @08009F06: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009D90 thumb_func_start sub_8009F18 sub_8009F18: ; 8009F18 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08009F26 bl sub_800F804 @08009F26: ldr r1, =0x03003140 ldr r0, =sub_8009F70 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009F18 thumb_func_start sub_8009F3C sub_8009F3C: ; 8009F3C push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08009F50 bl sub_800F7E4 b @08009F6A .align 2, 0 .pool @08009F50: ldr r0, =0x03003140 ldr r1, [r0] ldr r0, =sub_8009F70 cmp r1, r0 beq @08009F68 movs r0, 0 b @08009F6A .align 2, 0 .pool @08009F68: movs r0, 0x1 @08009F6A: pop {r1} bx r1 thumb_func_end sub_8009F3C thumb_func_start sub_8009F70 sub_8009F70: ; 8009F70 push {lr} ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 bne @08009F80 ldr r0, =0x0000cafe bl sub_8009D90 @08009F80: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009F70 thumb_func_start sub_8009F8C sub_8009F8C: ; 8009F8C push {lr} ldr r0, =0x030030fc ldrb r1, [r0] cmp r1, 0 beq @08009FA0 bl Rfu_set_zero b @08009FA4 .align 2, 0 .pool @08009FA0: ldr r0, =0x03003140 str r1, [r0] @08009FA4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009F8C thumb_func_start sub_8009FAC sub_8009FAC: ; 8009FAC push {lr} ldr r0, =0x030030fc ldrb r1, [r0] cmp r1, 0 beq @08009FC0 bl Rfu_set_zero b @08009FC4 .align 2, 0 .pool @08009FC0: ldr r0, =0x03003140 str r1, [r0] @08009FC4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8009FAC thumb_func_start sub_8009FCC sub_8009FCC: ; 8009FCC push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08009FEC ldr r0, =0x030030e0 ldr r0, [r0] movs r1, 0x1C ands r0, r1 lsrs r0, 2 b @08009FF4 .align 2, 0 .pool @08009FEC: bl sub_80104F4 lsls r0, 24 lsrs r0, 24 @08009FF4: pop {r1} bx r1 thumb_func_end sub_8009FCC thumb_func_start sub_8009FF8 sub_8009FF8: ; 8009FF8 push {r4-r7,lr} adds r6, r0, 0 adds r5, r1, 0 bl sub_8009FCC lsls r0, 24 lsrs r4, r0, 24 movs r2, 0 cmp r2, r4 bge @0800A030 movs r7, 0xFF ldr r3, =0x020229e8 @0800A010: ldrh r0, [r3] adds r1, r7, 0 ands r1, r0 cmp r1, r6 beq @0800A01E cmp r1, r5 bne @0800A028 @0800A01E: movs r0, 0x1 b @0800A034 .align 2, 0 .pool @0800A028: adds r3, 0x1C adds r2, 0x1 cmp r2, r4 blt @0800A010 @0800A030: movs r0, 0x1 negs r0, r0 @0800A034: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8009FF8 thumb_func_start sub_800A03C sub_800A03C: ; 800A03C movs r0, 0x2 bx lr thumb_func_end sub_800A03C thumb_func_start sub_800A040 sub_800A040: ; 800A040 push {lr} bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bne @0800A05A movs r0, 0x2 movs r1, 0x1 bl sub_8009FF8 cmp r0, 0 bge @0800A05E @0800A05A: movs r0, 0 b @0800A060 @0800A05E: movs r0, 0x1 @0800A060: pop {r1} bx r1 thumb_func_end sub_800A040 thumb_func_start sub_800A064 sub_800A064: ; 800A064 push {lr} movs r0, 0x2 movs r1, 0x1 bl sub_8009FF8 cmp r0, 0 bge @0800A076 movs r0, 0 b @0800A078 @0800A076: movs r0, 0x1 @0800A078: pop {r1} bx r1 thumb_func_end sub_800A064 thumb_func_start sub_800A07C sub_800A07C: ; 800A07C push {lr} movs r0, 0x4 movs r1, 0x5 bl sub_8009FF8 adds r2, r0, 0 cmp r2, 0 blt @0800A0A4 ldr r0, =0x020229e8 lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r0 ldrh r0, [r1, 0x1A] cmp r0, 0x1 bne @0800A0A4 movs r0, 0x1 b @0800A0A6 .align 2, 0 .pool @0800A0A4: movs r0, 0 @0800A0A6: pop {r1} bx r1 thumb_func_end sub_800A07C thumb_func_start sub_800A0AC sub_800A0AC: ; 800A0AC push {lr} ldr r0, =0x03000d5c movs r1, 0 str r1, [r0] ldr r0, =0x020229c8 strh r1, [r0] bl sub_8009734 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A0AC thumb_func_start sub_800A0C8 sub_800A0C8: ; 800A0C8 push {r4-r7,lr} adds r5, r0, 0 adds r6, r1, 0 movs r7, 0 ldr r0, =0x03003124 ldrb r4, [r0] cmp r4, 0x1 beq @0800A0DA b @0800A214 @0800A0DA: bl sub_800ABAC lsls r0, 24 lsrs r0, 24 cmp r5, r0 bgt @0800A0EA cmp r0, r6 ble @0800A0FC @0800A0EA: ldr r1, =0x03000d5c movs r0, 0x6 str r0, [r1] b @0800A22E .align 2, 0 .pool @0800A0FC: bl sub_8009FCC lsls r0, 24 cmp r0, 0 bne @0800A10E ldr r0, =0x0300306c strb r4, [r0] bl sub_80097E8 @0800A10E: movs r6, 0 ldr r4, =0x020229e8 movs r5, 0 b @0800A134 .align 2, 0 .pool @0800A120: adds r0, r4, 0 adds r0, 0x14 adds r0, r5, r0 ldr r1, [r0] ldr r0, [r4, 0x14] cmp r1, r0 bne @0800A130 adds r7, 0x1 @0800A130: adds r5, 0x1C adds r6, 0x1 @0800A134: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r6, r0 blt @0800A120 bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r7, r0 bne @0800A1AC ldr r0, =0x020229e8 ldr r1, [r0, 0x14] ldr r0, =0x00001133 cmp r1, r0 bne @0800A19C bl sub_807A728 cmp r0, 0x1 beq @0800A184 cmp r0, 0x1 bgt @0800A178 cmp r0, 0 beq @0800A19C ldr r3, =0x03000d5c b @0800A22C .align 2, 0 .pool @0800A178: cmp r0, 0x2 beq @0800A190 ldr r3, =0x03000d5c b @0800A22C .align 2, 0 .pool @0800A184: ldr r1, =0x03000d5c movs r0, 0x4 b @0800A1A0 .align 2, 0 .pool @0800A190: ldr r1, =0x03000d5c movs r0, 0x5 b @0800A1A0 .align 2, 0 .pool @0800A19C: ldr r1, =0x03000d5c movs r0, 0x1 @0800A1A0: str r0, [r1] adds r3, r1, 0 b @0800A22C .align 2, 0 .pool @0800A1AC: ldr r6, =0x03000d5c movs r0, 0x3 str r0, [r6] ldr r4, =0x020229e8 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r4, 0x14 adds r1, r4 ldr r5, [r1] bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r4 ldr r1, [r1] ldr r2, =0x00002266 cmp r5, r2 bne @0800A1EA ldr r0, =0x00002277 cmp r1, r0 beq @0800A1F6 @0800A1EA: ldr r0, =0x00002277 adds r3, r6, 0 cmp r5, r0 bne @0800A22C cmp r1, r2 bne @0800A22C @0800A1F6: ldr r1, =0x020375e2 movs r0, 0x3 strh r0, [r1] ldr r3, =0x03000d5c b @0800A22C .align 2, 0 .pool @0800A214: ldr r0, =0x020229c8 ldrh r1, [r0] adds r1, 0x1 strh r1, [r0] lsls r1, 16 movs r0, 0x96 lsls r0, 18 ldr r3, =0x03000d5c cmp r1, r0 bls @0800A22C movs r0, 0x2 str r0, [r3] @0800A22C: ldrb r0, [r3] @0800A22E: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800A0C8 thumb_func_start sub_800A23C sub_800A23C: ; 800A23C push {r4-r6,lr} movs r6, 0 movs r4, 0 ldr r5, =0x020229e8 b @0800A26C .align 2, 0 .pool @0800A24C: lsls r0, r4, 3 subs r0, r4 lsls r0, 2 adds r1, r5, 0 adds r1, 0x14 adds r0, r1 ldr r1, [r0] ldr r0, [r5, 0x14] cmp r1, r0 bne @0800A266 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0800A266: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @0800A26C: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r4, r0 bcc @0800A24C bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r6, r0 bne @0800A290 movs r2, 0x1 ldr r0, =0x03000d5c str r2, [r0] b @0800A298 .align 2, 0 .pool @0800A290: movs r2, 0 ldr r1, =0x03000d5c movs r0, 0x3 str r0, [r1] @0800A298: adds r0, r2, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800A23C thumb_func_start sub_800A2A4 sub_800A2A4: ; 800A2A4 lsls r0, 24 lsrs r0, 24 ldr r2, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r2, 0x4 adds r1, r2 ldr r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_800A2A4 thumb_func_start sub_800A2BC sub_800A2BC: ; 800A2BC push {r4,r5,lr} ldr r5, =0x020229e8 movs r4, 0x4 @0800A2C2: adds r0, r5, 0 movs r1, 0 movs r2, 0x1C bl memset adds r5, 0x1C subs r4, 0x1 cmp r4, 0 bge @0800A2C2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A2BC thumb_func_start sub_800A2E0 sub_800A2E0: ; 800A2E0 ldr r1, =0x03000d10 movs r0, 0 strb r0, [r1, 0x8] strh r0, [r1] strh r0, [r1, 0x2] str r0, [r1, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_800A2E0 thumb_func_start sub_800A2F4 sub_800A2F4: ; 800A2F4 push {r4-r7,lr} adds r7, r0, 0 adds r6, r1, 0 ldr r4, =0x03000d10 ldrb r5, [r4, 0x8] cmp r5, 0 beq @0800A30C movs r0, 0 b @0800A34A .align 2, 0 .pool @0800A30C: bl link_get_multiplayer_id strb r0, [r4, 0x9] movs r0, 0x1 strb r0, [r4, 0x8] strh r6, [r4, 0x2] strh r5, [r4] adds r0, 0xFF cmp r6, r0 bls @0800A324 str r7, [r4, 0x4] b @0800A336 @0800A324: ldr r5, =0x020228c4 cmp r7, r5 beq @0800A334 adds r0, r5, 0 adds r1, r7, 0 adds r2, r6, 0 bl memcpy @0800A334: str r5, [r4, 0x4] @0800A336: ldr r0, =0x0000bbbb bl sub_8009D90 ldr r1, =0x03003140 ldr r0, =sub_800A364 str r0, [r1] ldr r1, =0x03000d50 movs r0, 0 str r0, [r1] movs r0, 0x1 @0800A34A: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800A2F4 thumb_func_start sub_800A364 sub_800A364: ; 800A364 push {lr} ldr r1, =0x03000d50 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x2 bls @0800A378 ldr r1, =0x03003140 ldr r0, =sub_800A388 str r0, [r1] @0800A378: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A364 thumb_func_start sub_800A388 sub_800A388: ; 800A388 push {r4-r6,lr} ldr r0, =0x03000d10 ldr r5, [r0, 0x4] ldr r2, =0x03003110 ldr r1, =0x00008888 strh r1, [r2] movs r3, 0 adds r4, r0, 0 adds r6, r4, 0 adds r2, 0x2 @0800A39C: lsls r0, r3, 1 ldrh r1, [r6] adds r0, r1 adds r0, r5 ldrb r1, [r0, 0x1] lsls r1, 8 ldrb r0, [r0] orrs r0, r1 strh r0, [r2] adds r2, 0x2 adds r3, 0x1 cmp r3, 0x6 ble @0800A39C ldrh r0, [r4] adds r0, 0xE strh r0, [r4] ldrh r1, [r4, 0x2] lsls r0, 16 lsrs r0, 16 cmp r1, r0 bhi @0800A3D0 movs r0, 0 strb r0, [r4, 0x8] ldr r1, =0x03003140 ldr r0, =sub_800A3EC str r0, [r1] @0800A3D0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A388 thumb_func_start sub_800A3EC sub_800A3EC: ; 800A3EC ldr r1, =0x03003140 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_800A3EC thumb_func_start sub_800A3F8 sub_800A3F8: ; 800A3F8 push {lr} bl link_get_multiplayer_id ldr r0, =0x00004444 bl sub_8009D90 ldr r1, =0x020223c0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A3F8 thumb_func_start sub_800A418 sub_800A418: ; 800A418 push {lr} ldr r1, =0x020223c0 movs r0, 0 str r0, [r1] ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @0800A438 bl sub_800F850 b @0800A43E .align 2, 0 .pool @0800A438: ldr r1, =0x03003140 ldr r0, =sub_800A3F8 str r0, [r1] @0800A43E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A418 thumb_func_start sub_800A44C sub_800A44C: ; 800A44C ldr r0, =0x020223c0 ldr r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800A44C thumb_func_start sub_800A458 sub_800A458: ; 800A458 push {lr} ldr r0, =0x0000aaaa bl sub_8009D90 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A458 thumb_func_start link_get_multiplayer_id link_get_multiplayer_id: ; 800A468 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 beq @0800A484 ldr r0, =0x04000128 ldr r0, [r0] lsls r0, 26 lsrs r0, 30 b @0800A48C .align 2, 0 .pool @0800A484: bl rfu_get_multiplayer_id lsls r0, 24 lsrs r0, 24 @0800A48C: pop {r1} bx r1 thumb_func_end link_get_multiplayer_id thumb_func_start bitmask_all_link_players_but_self bitmask_all_link_players_but_self: ; 800A490 push {lr} bl link_get_multiplayer_id adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 movs r0, 0x1 lsls r0, r1 movs r1, 0xF eors r0, r1 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end bitmask_all_link_players_but_self thumb_func_start link_0800A448 link_0800A448: ; 800A4AC push {lr} adds r3, r1, 0 lsls r2, 16 lsrs r1, r2, 16 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 beq @0800A4C8 adds r0, r3, 0 bl sub_800A2F4 b @0800A4CE .align 2, 0 .pool @0800A4C8: adds r0, r3, 0 bl sub_800FE84 @0800A4CE: lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end link_0800A448 thumb_func_start sub_800A4D8 sub_800A4D8: ; 800A4D8 push {lr} lsls r0, 24 lsrs r1, r0, 24 adds r2, r1, 0 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @0800A4F8 adds r0, r1, 0 bl sub_8010100 lsls r0, 24 lsrs r0, 24 b @0800A514 .align 2, 0 .pool @0800A4F8: ldr r0, =0x03003140 ldr r0, [r0] cmp r0, 0 beq @0800A508 movs r0, 0 b @0800A514 .align 2, 0 .pool @0800A508: ldr r0, =0x03003150 strb r2, [r0] ldr r0, =0x0000cccc bl sub_8009D90 movs r0, 0x1 @0800A514: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800A4D8 thumb_func_start sub_800A520 sub_800A520: ; 800A520 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @0800A538 bl sub_8010500 lsls r0, 24 lsrs r0, 24 b @0800A546 .align 2, 0 .pool @0800A538: movs r1, 0 ldr r0, =0x03003140 ldr r0, [r0] cmp r0, 0 bne @0800A544 movs r1, 0x1 @0800A544: adds r0, r1, 0 @0800A546: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800A520 thumb_func_start sub_800A550 sub_800A550: ; 800A550 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 beq @0800A57C ldr r2, =0x0300307c ldrb r0, [r2, 0x3] lsls r0, 3 ldrb r1, [r2, 0x2] lsls r1, 2 orrs r0, r1 ldrb r1, [r2, 0x1] lsls r1, 1 orrs r0, r1 ldrb r1, [r2] orrs r0, r1 b @0800A580 .align 2, 0 .pool @0800A57C: bl sub_800FCD8 @0800A580: lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_800A550 thumb_func_start sub_800A588 sub_800A588: ; 800A588 push {lr} lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @0800A5A4 adds r0, r1, 0 bl sub_800F6FC b @0800A5AC .align 2, 0 .pool @0800A5A4: ldr r0, =0x0300307c adds r0, r1, r0 movs r1, 0x1 strb r1, [r0] @0800A5AC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A588 thumb_func_start sub_800A5B4 sub_800A5B4: ; 800A5B4 push {r4,lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @0800A5D4 movs r4, 0 @0800A5C0: lsls r0, r4, 24 lsrs r0, 24 bl sub_800F728 adds r4, 0x1 cmp r4, 0x4 ble @0800A5C0 b @0800A5E2 .align 2, 0 .pool @0800A5D4: ldr r1, =0x0300307c movs r2, 0 adds r0, r1, 0x3 @0800A5DA: strb r2, [r0] subs r0, 0x1 cmp r0, r1 bge @0800A5DA @0800A5E2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A5B4 thumb_func_start sub_800A5EC sub_800A5EC: ; 800A5EC push {lr} lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @0800A608 adds r0, r1, 0 bl sub_800F728 b @0800A616 .align 2, 0 .pool @0800A608: ldr r0, =0x0300307c adds r1, r0 ldrb r0, [r1] cmp r0, 0 beq @0800A616 movs r0, 0 strb r0, [r1] @0800A616: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A5EC thumb_func_start sub_800A620 sub_800A620: ; 800A620 push {lr} ldr r0, =0x030030e0 ldr r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @0800A63C movs r0, 0x1C ands r1, r0 cmp r1, 0x4 bls @0800A63C ldr r1, =0x03003144 movs r0, 0x1 strb r0, [r1] @0800A63C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A620 thumb_func_start sub_800A648 sub_800A648: ; 800A648 push {r4,lr} adds r4, r0, 0 lsls r1, 16 movs r3, 0 movs r2, 0 lsrs r1, 17 cmp r3, r1 bcs @0800A66E @0800A658: lsls r0, r2, 1 adds r0, r4 ldrh r0, [r0] adds r0, r3, r0 lsls r0, 16 lsrs r3, r0, 16 adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, r1 bcc @0800A658 @0800A66E: adds r0, r3, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_800A648 thumb_func_start sub_800A678 sub_800A678: ; 800A678 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 ldr r4, =0x03003130 ldr r3, [r4] lsls r3, 11 movs r5, 0xC0 lsls r5, 19 adds r3, r5 lsrs r2, 19 adds r2, r1 lsls r2, 1 adds r2, r3 ldr r3, [r4, 0x4] lsls r3, 12 ldr r1, [r4, 0x8] adds r1, 0x1 adds r0, r1 orrs r3, r0 strh r3, [r2] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A678 thumb_func_start sub_800A6B0 sub_800A6B0: ; 800A6B0 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 ldr r4, =0x03003130 ldr r3, [r4] lsls r3, 11 movs r5, 0xC0 lsls r5, 19 adds r3, r5 lsrs r2, 19 adds r2, r1 lsls r2, 1 adds r2, r3 ldr r3, [r4, 0x4] lsls r3, 12 ldr r1, [r4, 0x8] adds r1, r0 orrs r3, r1 strh r3, [r2] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A6B0 thumb_func_start sub_800A6E8 sub_800A6E8: ; 800A6E8 push {r4-r7,lr} sub sp, 0x10 adds r5, r0, 0 lsls r1, 24 lsrs r6, r1, 24 lsls r2, 24 lsrs r7, r2, 24 lsls r3, 24 lsrs r3, 24 movs r4, 0 cmp r4, r3 bge @0800A714 movs r2, 0xF @0800A702: mov r0, sp adds r1, r0, r4 adds r0, r5, 0 ands r0, r2 strb r0, [r1] lsrs r5, 4 adds r4, 0x1 cmp r4, r3 blt @0800A702 @0800A714: subs r4, r3, 0x1 cmp r4, 0 blt @0800A734 @0800A71A: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] adds r1, r6, 0 adds r2, r7, 0 bl sub_800A678 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 subs r4, 0x1 cmp r4, 0 bge @0800A71A @0800A734: add sp, 0x10 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_800A6E8 thumb_func_start sub_800A73C sub_800A73C: ; 800A73C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x14 adds r6, r0, 0 lsls r1, 24 lsrs r7, r1, 24 lsls r2, 24 lsrs r2, 24 mov r9, r2 lsls r3, 24 lsrs r3, 24 mov r8, r3 movs r0, 0x1 negs r0, r0 str r0, [sp, 0x10] cmp r6, 0 bge @0800A768 str r7, [sp, 0x10] negs r6, r6 @0800A768: movs r5, 0 movs r1, 0x1 negs r1, r1 add r1, r8 mov r10, r1 cmp r5, r8 bge @0800A794 @0800A776: mov r0, sp adds r4, r0, r5 adds r0, r6, 0 movs r1, 0xA bl __modsi3 strb r0, [r4] adds r0, r6, 0 movs r1, 0xA bl __divsi3 adds r6, r0, 0 adds r5, 0x1 cmp r5, r8 blt @0800A776 @0800A794: mov r5, r10 cmp r5, 0 blt @0800A7B4 @0800A79A: mov r1, sp adds r0, r1, r5 ldrb r0, [r0] adds r1, r7, 0 mov r2, r9 bl sub_800A678 adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 subs r5, 0x1 cmp r5, 0 bge @0800A79A @0800A7B4: movs r0, 0x1 negs r0, r0 ldr r1, [sp, 0x10] cmp r1, r0 beq @0800A7CA lsls r1, 24 lsrs r1, 24 movs r0, 0xA mov r2, r9 bl sub_800A678 @0800A7CA: add sp, 0x14 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_800A73C thumb_func_start sub_800A7DC sub_800A7DC: ; 800A7DC push {r4-r7,lr} adds r3, r0, 0 lsls r1, 24 lsrs r7, r1, 24 lsls r2, 24 lsrs r2, 24 movs r6, 0 ldrb r0, [r3] cmp r0, 0 beq @0800A81C adds r4, r3, 0 lsls r5, r2, 24 @0800A7F4: ldrb r0, [r4] cmp r0, 0xA bne @0800A804 movs r0, 0x80 lsls r0, 17 adds r5, r0 movs r6, 0 b @0800A814 @0800A804: ldrb r0, [r4] adds r1, r7, r6 lsls r1, 24 lsrs r1, 24 lsrs r2, r5, 24 bl sub_800A6B0 adds r6, 0x1 @0800A814: adds r4, 0x1 ldrb r0, [r4] cmp r0, 0 bne @0800A7F4 @0800A81C: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_800A7DC thumb_func_start sub_800A824 sub_800A824: ; 800A824 push {lr} ldr r0, =0x030030e0 ldr r0, [r0] movs r1, 0x20 ands r0, r1 cmp r0, 0 @0800A830: beq @0800A838 ldr r0, =0x00002222 bl sub_8009D90 @0800A838: ldr r1, =0x03003140 movs r0, 0 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800A824 thumb_func_start task00_link_test task00_link_test: ; 800A850 push {r4-r6,lr} sub sp, 0x20 ldr r1, =gUnknown_082ED1E4 mov r0, sp bl strcat mov r0, sp movs r1, 0x5 movs r2, 0x2 bl sub_800A7DC ldr r0, =0x03003144 ldrb r0, [r0] movs r1, 0x2 movs r2, 0x1 movs r3, 0x2 bl sub_800A6E8 ldr r4, =0x030030e0 ldr r0, [r4] movs r1, 0xF movs r2, 0x1 movs r3, 0x8 bl sub_800A6E8 ldr r0, =0x03003170 ldrb r0, [r0, 0x1] movs r1, 0x2 movs r2, 0xA movs r3, 0x2 bl sub_800A6E8 ldr r0, [r4] movs r1, 0x1C ands r0, r1 lsrs r0, 2 movs r1, 0xF movs r2, 0xA movs r3, 0x2 bl sub_800A6E8 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 movs r1, 0xF movs r2, 0xC movs r3, 0x2 bl sub_800A6E8 ldr r0, =0x03003160 ldrb r0, [r0] movs r1, 0x19 movs r2, 0x1 movs r3, 0x2 bl sub_800A6E8 ldr r0, =0x03004130 ldrb r0, [r0] movs r1, 0x19 movs r2, 0x2 movs r3, 0x2 bl sub_800A6E8 bl sub_800A550 lsls r0, 24 lsrs r0, 24 movs r1, 0xF movs r2, 0x5 movs r3, 0x2 bl sub_800A6E8 ldr r0, =0x0300302c ldr r0, [r0] movs r1, 0x2 movs r2, 0xC movs r3, 0x8 bl sub_800A6E8 ldr r0, =0x03003070 ldr r0, [r0] movs r1, 0x2 movs r2, 0xD movs r3, 0x8 bl sub_800A6E8 bl sub_800B2E8 lsls r0, 24 lsrs r0, 24 movs r1, 0x19 movs r2, 0x5 movs r3, 0x1 bl sub_800A6E8 bl sub_800B2F8 lsls r0, 24 lsrs r0, 24 movs r1, 0x19 movs r2, 0x6 movs r3, 0x1 bl sub_800A6E8 bl sub_800B320 lsls r0, 24 lsrs r0, 24 movs r1, 0x19 movs r2, 0x7 movs r3, 0x1 bl sub_800A6E8 bl sub_800B33C lsls r0, 24 lsrs r0, 24 movs r1, 0x19 movs r2, 0x8 movs r3, 0x1 bl sub_800A6E8 movs r6, 0 movs r5, 0x80 lsls r5, 19 ldr r4, =0x03003148 @0800A94E: ldrh r0, [r4] lsrs r2, r5, 24 movs r1, 0xA movs r3, 0x4 bl sub_800A6E8 movs r0, 0x80 lsls r0, 17 adds r5, r0 adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @0800A94E add sp, 0x20 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task00_link_test thumb_func_start sub_800A994 sub_800A994: ; 800A994 ldr r2, =0x0300302c str r0, [r2] ldr r0, =0x03003070 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800A994 thumb_func_start sub_800A9A8 sub_800A9A8: ; 800A9A8 push {r4,lr} movs r1, 0 movs r2, 0 ldr r0, =0x03003100 ldrb r0, [r0] cmp r1, r0 bge @0800A9CA movs r4, 0x1 adds r3, r0, 0 @0800A9BA: adds r0, r4, 0 lsls r0, r2 orrs r1, r0 lsls r0, r1, 24 lsrs r1, r0, 24 adds r2, 0x1 cmp r2, r3 blt @0800A9BA @0800A9CA: adds r0, r1, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800A9A8 thumb_func_start sub_800A9D8 sub_800A9D8: ; 800A9D8 push {r4-r6,lr} movs r4, 0 movs r5, 0 movs r6, 0x1 b @0800A9EE @0800A9E2: adds r0, r6, 0 lsls r0, r5 orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 adds r5, 0x1 @0800A9EE: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 blt @0800A9E2 adds r0, r4, 0 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_800A9D8 thumb_func_start sub_800AA04 sub_800AA04: ; 800AA04 push {r4-r7,lr} ldr r1, =0x03003100 strb r0, [r1] bl link_get_multiplayer_id ldr r1, =0x03003120 strb r0, [r1] ldr r4, =0x020229e8 ldr r3, =0x02022a74 movs r2, 0x4 @0800AA18: adds r0, r3, 0 adds r1, r4, 0 ldm r1!, {r5-r7} stm r0!, {r5-r7} ldm r1!, {r5-r7} stm r0!, {r5-r7} ldr r1, [r1] str r1, [r0] adds r4, 0x1C adds r3, 0x1C subs r2, 0x1 cmp r2, 0 bge @0800AA18 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AA04 thumb_func_start sub_800AA48 sub_800AA48: ; 800AA48 ldr r0, =0x03003100 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800AA48 thumb_func_start sub_800AA54 sub_800AA54: ; 800AA54 ldr r0, =0x03003120 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800AA54 thumb_func_start sub_800AA60 sub_800AA60: ; 800AA60 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r3, 0 ldr r0, =0x03003100 ldrb r1, [r0] mov r9, r0 cmp r3, r1 bge @0800AAB4 ldr r0, =0x020229e8 mov r12, r0 ldr r0, =0x02022a74 ldr r2, =0x00002288 mov r8, r2 ldr r7, =0x020229c6 mov r6, r12 adds r6, 0x14 adds r5, r0, 0x4 movs r4, 0 adds r2, r1, 0 @0800AA8A: mov r0, r12 adds r0, 0x4 adds r0, r4, r0 ldr r1, [r0] ldr r0, [r5] cmp r1, r0 bne @0800AAA8 ldrh r0, [r7] cmp r0, r8 bne @0800AAA6 adds r1, r0, 0 ldr r0, [r6] cmp r1, r0 bne @0800AAA8 @0800AAA6: adds r3, 0x1 @0800AAA8: adds r6, 0x1C adds r5, 0x1C adds r4, 0x1C subs r2, 0x1 cmp r2, 0 bne @0800AA8A @0800AAB4: mov r0, r9 ldrb r0, [r0] cmp r3, r0 bne @0800AAE4 bl sub_800ABAC lsls r0, 24 lsrs r0, 24 mov r1, r9 ldrb r1, [r1] cmp r0, r1 bne @0800AAE4 movs r0, 0x1 b @0800AAE6 .align 2, 0 .pool @0800AAE4: movs r0, 0 @0800AAE6: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_800AA60 thumb_func_start sub_800AAF4 sub_800AAF4: ; 800AAF4 push {r4,r5,lr} ldr r5, =0x02022a74 movs r4, 0x3 @0800AAFA: adds r0, r5, 0 movs r1, 0 movs r2, 0x1C bl CpuSet adds r5, 0x1C subs r4, 0x1 cmp r4, 0 bge @0800AAFA pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AAF4 thumb_func_start sub_800AB18 sub_800AB18: ; 800AB18 push {r4-r7,lr} mov r7, r8 push {r7} movs r4, 0 ldr r0, =0x03003100 ldrb r0, [r0] cmp r4, r0 bcs @0800AB78 ldr r6, =0x02022a74 ldr r5, =0x020229e8 movs r0, 0x8 adds r0, r6 mov r8, r0 adds r7, r5, 0 adds r7, 0x8 @0800AB36: lsls r0, r4, 3 subs r0, r4 lsls r2, r0, 2 adds r1, r6, 0x4 adds r1, r2, r1 adds r0, r5, 0x4 adds r0, r2, r0 ldr r1, [r1] ldr r0, [r0] cmp r1, r0 bne @0800AB5A mov r1, r8 adds r0, r2, r1 adds r1, r2, r7 bl sub_8008C44 cmp r0, 0 beq @0800AB6A @0800AB5A: ldr r1, =0x0300306c movs r0, 0x1 strb r0, [r1] bl sub_80097E8 ldr r0, =c2_800ACD4 bl set_callback2 @0800AB6A: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x03003100 ldrb r0, [r0] cmp r4, r0 bcc @0800AB36 @0800AB78: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AB18 thumb_func_start sub_800AB98 sub_800AB98: ; 800AB98 ldr r0, =0x03003100 movs r1, 0 strb r1, [r0] ldr r0, =0x03003120 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800AB98 thumb_func_start sub_800ABAC sub_800ABAC: ; 800ABAC ldr r0, =0x030030e0 ldr r0, [r0] movs r1, 0x1C ands r0, r1 lsrs r0, 2 bx lr .align 2, 0 .pool thumb_func_end sub_800ABAC thumb_func_start sub_800ABBC sub_800ABBC: ; 800ABBC push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @0800ABDC ldr r0, =0x030030e0 ldr r0, [r0] lsrs r0, 5 movs r1, 0x1 ands r0, r1 b @0800ABE4 .align 2, 0 .pool @0800ABDC: bl sub_8011AB0 lsls r0, 24 lsrs r0, 24 @0800ABE4: pop {r1} bx r1 thumb_func_end sub_800ABBC thumb_func_start sub_800ABE8 sub_800ABE8: ; 800ABE8 ldr r0, =0x03000d58 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800ABE8 thumb_func_start sub_800ABF4 sub_800ABF4: ; 800ABF4 push {lr} lsls r0, 16 lsrs r3, r0, 16 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @0800AC0C bl task_add_05_task_del_08FA224_when_no_RfuFunc b @0800AC20 .align 2, 0 .pool @0800AC0C: ldr r2, =0x03003140 ldr r1, [r2] cmp r1, 0 bne @0800AC20 ldr r0, =sub_800AC80 str r0, [r2] ldr r0, =0x030030e4 strb r1, [r0] ldr r0, =0x030030f4 strh r3, [r0] @0800AC20: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800ABF4 thumb_func_start sub_800AC34 sub_800AC34: ; 800AC34 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @0800AC48 bl task_add_05_task_del_08FA224_when_no_RfuFunc b @0800AC70 .align 2, 0 .pool @0800AC48: ldr r2, =0x03003140 ldr r1, [r2] cmp r1, 0 beq @0800AC64 ldr r1, =0x02022b08 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0800AC70 .align 2, 0 .pool @0800AC64: ldr r0, =sub_800AC80 str r0, [r2] ldr r0, =0x030030e4 strb r1, [r0] ldr r0, =0x030030f4 strh r1, [r0] @0800AC70: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AC34 thumb_func_start sub_800AC80 sub_800AC80: ; 800AC80 push {lr} ldr r0, =0x03004130 ldrb r0, [r0] cmp r0, 0 bne @0800AC96 ldr r0, =0x00005fff bl sub_8009D90 ldr r1, =0x03003140 ldr r0, =sub_800ACAC str r0, [r1] @0800AC96: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AC80 thumb_func_start sub_800ACAC sub_800ACAC: ; 800ACAC push {r4,lr} bl sub_8009FCC lsls r0, 24 lsrs r2, r0, 24 movs r3, 0 movs r1, 0 cmp r3, r2 bge @0800ACD0 ldr r4, =0x030030f0 @0800ACC0: adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0 beq @0800ACCA adds r3, 0x1 @0800ACCA: adds r1, 0x1 cmp r1, r2 blt @0800ACC0 @0800ACD0: cmp r3, r2 bne @0800ACF4 ldr r2, =0x02022fec ldr r0, [r2] movs r1, 0x21 negs r1, r1 ands r0, r1 str r0, [r2] ldr r0, =0x03002748 movs r4, 0x1 strb r4, [r0] bl sub_80097E8 ldr r1, =0x03003140 movs r0, 0 str r0, [r1] ldr r0, =0x030030e4 strb r4, [r0] @0800ACF4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800ACAC thumb_func_start sub_800AD10 sub_800AD10: ; 800AD10 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @0800AD24 bl task_add_05_task_del_08FA224_when_no_RfuFunc b @0800AD4C .align 2, 0 .pool @0800AD24: ldr r2, =0x03003140 ldr r1, [r2] cmp r1, 0 beq @0800AD40 ldr r1, =0x02022b08 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0800AD4C .align 2, 0 .pool @0800AD40: ldr r0, =sub_800AD5C str r0, [r2] ldr r0, =0x030030e4 strb r1, [r0] ldr r0, =0x030030f4 strh r1, [r0] @0800AD4C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AD10 thumb_func_start sub_800AD5C sub_800AD5C: ; 800AD5C push {lr} ldr r0, =0x03004130 ldrb r0, [r0] cmp r0, 0 bne @0800AD72 ldr r0, =0x00005fff bl sub_8009D90 ldr r1, =0x03003140 ldr r0, =sub_800AD88 str r0, [r1] @0800AD72: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AD5C thumb_func_start sub_800AD88 sub_800AD88: ; 800AD88 push {r4,r5,lr} bl sub_8009FCC lsls r0, 24 lsrs r3, r0, 24 movs r1, 0 movs r2, 0 cmp r1, r3 bge @0800ADB6 ldr r5, =0x030030f0 ldr r4, =0x020229e8 @0800AD9E: ldrh r0, [r4, 0x1A] cmp r0, 0x1 beq @0800ADAC adds r0, r2, r5 ldrb r0, [r0] cmp r0, 0 beq @0800ADAE @0800ADAC: adds r1, 0x1 @0800ADAE: adds r4, 0x1C adds r2, 0x1 cmp r2, r3 blt @0800AD9E @0800ADB6: cmp r1, r3 bne @0800ADDA ldr r2, =0x02022fec ldr r0, [r2] movs r1, 0x21 negs r1, r1 ands r0, r1 str r0, [r2] ldr r0, =0x03002748 movs r4, 0x1 strb r4, [r0] bl sub_80097E8 ldr r1, =0x03003140 movs r0, 0 str r0, [r1] ldr r0, =0x030030e4 strb r4, [r0] @0800ADDA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AD88 thumb_func_start sub_800ADF8 sub_800ADF8: ; 800ADF8 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @0800AE0C bl sub_8010434 b @0800AE1E .align 2, 0 .pool @0800AE0C: ldr r1, =0x03003140 ldr r0, [r1] cmp r0, 0 bne @0800AE18 ldr r0, =sub_800AE30 str r0, [r1] @0800AE18: ldr r1, =0x030030e4 movs r0, 0 strb r0, [r1] @0800AE1E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800ADF8 thumb_func_start sub_800AE30 sub_800AE30: ; 800AE30 push {lr} ldr r0, =0x03004130 ldrb r0, [r0] cmp r0, 0 bne @0800AE46 ldr r0, =0x00002ffe bl sub_8009D90 ldr r1, =0x03003140 ldr r0, =sub_800AE5C str r0, [r1] @0800AE46: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AE30 thumb_func_start sub_800AE5C sub_800AE5C: ; 800AE5C push {r4,lr} bl sub_8009FCC lsls r0, 24 lsrs r2, r0, 24 movs r1, 0 cmp r1, r2 bcs @0800AE86 ldr r3, =0x030030ec ldrb r0, [r3] cmp r0, 0 beq @0800AE86 @0800AE74: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, r2 bcs @0800AE86 adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @0800AE74 @0800AE86: cmp r1, r2 bne @0800AEA4 movs r1, 0 ldr r4, =0x03003140 ldr r3, =0x030030ec movs r2, 0 @0800AE92: adds r0, r1, r3 strb r2, [r0] adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x3 bls @0800AE92 movs r0, 0 str r0, [r4] @0800AEA4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AE5C thumb_func_start sub_800AEB4 sub_800AEB4: ; 800AEB4 push {lr} ldr r0, =0x020229c4 ldrb r0, [r0] cmp r0, 0 beq @0800AEF4 ldr r0, =0x030030e0 ldr r2, [r0] movs r0, 0xFE lsls r0, 11 ands r0, r2 cmp r0, 0 beq @0800AEF4 ldr r0, =0x030030f8 ldrb r0, [r0] cmp r0, 0 bne @0800AEEA ldr r1, =0x02022b00 str r2, [r1] ldr r0, =0x03004130 ldrb r0, [r0] strb r0, [r1, 0x4] ldr r0, =0x03003160 ldrb r0, [r0] strb r0, [r1, 0x5] ldr r0, =c2_800ACD4 bl set_callback2 @0800AEEA: ldr r1, =0x0300306c movs r0, 0x1 strb r0, [r1] bl sub_80097E8 @0800AEF4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800AEB4 thumb_func_start sub_800AF18 sub_800AF18: ; 800AF18 push {r4,lr} ldr r4, =0x02022b00 str r0, [r4] strb r1, [r4, 0x5] strb r2, [r4, 0x4] strb r3, [r4, 0x6] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030075f0 bl MPlayStop_rev01 ldr r0, =0x03007630 bl MPlayStop_rev01 ldr r0, =0x03007800 bl MPlayStop_rev01 ldr r0, =0x02000000 movs r1, 0xE0 lsls r1, 9 bl 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, =0x030030fc ldrb r0, [r1] cmp r0, 0 beq @0800AF8C ldr r0, =0x02022b00 ldrb r0, [r0, 0x6] cmp r0, 0 bne @0800AF88 movs r0, 0x3 strb r0, [r1] @0800AF88: bl sub_800E604 @0800AF8C: ldr r0, =sub_80096BC bl SetVBlankCallback movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_082ED1FC movs r0, 0 movs r2, 0x2 bl bg_vram_setup ldr r4, =0x02022b0c movs r0, 0x80 lsls r0, 4 bl malloc adds r1, r0, 0 str r1, [r4] movs r0, 0x1 bl bg_set_tilemap ldr r0, =gUnknown_082ED204 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, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0x03002700 movs r0, 0 strb r0, [r1] ldr r0, =sub_8009404 movs r1, 0 bl AddTask bl sub_80A2F30 ldr r1, =0x030022c0 movs r0, 0 str r0, [r1] bl run_active_tasks bl call_obj_callbacks bl obj_sync_something bl fade_and_return_progress_probably ldr r0, =sub_800B1A0 bl set_callback2 @0800B03C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_800ACD4 thumb_func_start sub_800B080 sub_800B080: ; 800B080 push {r4,r5,lr} sub sp, 0xC ldr r1, =gUnknown_082ED168 movs r0, 0 movs r2, 0x20 movs r3, 0 bl gpu_copy_bg_tile_pattern_data_to_vram ldr r1, =gUnknown_082EC88C movs r5, 0 str r5, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree ldr r1, =gUnknown_082ECD34 movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map movs r0, 0x1 bl gpu_copy_wram_bg_tilemap_to_vram ldr r0, =gUnknown_082EC86C 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, =gUnknown_082ED224 str r4, [sp] str r5, [sp, 0x4] ldr r0, =gUnknown_085EE4F7 str r0, [sp, 0x8] movs r0, 0 movs r1, 0x3 movs r2, 0x2 movs r3, 0x6 bl box_print str r4, [sp] str r5, [sp, 0x4] ldr r0, =gUnknown_085EE50C str r0, [sp, 0x8] movs r0, 0x2 movs r1, 0x3 movs r2, 0x2 movs r3, 0x1 bl box_print movs r0, 0 bl 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 .pool thumb_func_end sub_800B080 thumb_func_start sub_800B138 sub_800B138: ; 800B138 push {lr} sub sp, 0xC ldr r1, =gUnknown_082ED168 movs r0, 0 movs r2, 0x20 movs r3, 0 bl 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, =gUnknown_082ED224 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] ldr r0, =gUnknown_085EE4A4 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x3 movs r2, 0x2 movs r3, 0 bl box_print movs r0, 0x1 bl 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 .pool thumb_func_end sub_800B138 thumb_func_start sub_800B1A0 sub_800B1A0: ; 800B1A0 push {r4,lr} sub sp, 0xC ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1E beq @0800B20C cmp r0, 0x1E bgt @0800B1C4 cmp r0, 0 beq @0800B1D8 cmp r0, 0x2 beq @0800B1F2 b @0800B260 .align 2, 0 .pool @0800B1C4: cmp r0, 0x5A beq @0800B20C cmp r0, 0x5A bgt @0800B1D2 cmp r0, 0x3C beq @0800B20C b @0800B260 @0800B1D2: cmp r0, 0x82 beq @0800B214 b @0800B260 @0800B1D8: ldr r0, =0x02022b00 ldrb r0, [r0, 0x6] cmp r0, 0 beq @0800B1EC bl sub_800B080 b @0800B260 .align 2, 0 .pool @0800B1EC: bl sub_800B138 b @0800B260 @0800B1F2: movs r0, 0 bl gpu_sync_bg_show ldr r0, =0x02022b00 ldrb r0, [r0, 0x6] cmp r0, 0 beq @0800B260 movs r0, 0x1 bl gpu_sync_bg_show b @0800B260 .align 2, 0 .pool @0800B20C: movs r0, 0x16 bl audio_play b @0800B260 @0800B214: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0x2 bne @0800B244 ldr r0, =gUnknown_082ED224 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] ldr r0, =gUnknown_085EE572 str r0, [sp, 0x8] movs r0, 0 movs r1, 0x3 movs r2, 0x2 movs r3, 0x14 bl box_print b @0800B260 .align 2, 0 .pool @0800B244: cmp r0, 0x1 bne @0800B260 ldr r0, =gUnknown_082ED224 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] ldr r0, =gUnknown_085EE553 str r0, [sp, 0x8] movs r0, 0 movs r1, 0x3 movs r2, 0x2 movs r3, 0x14 bl box_print @0800B260: ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r0, r2 ldrb r1, [r1] cmp r1, 0xA0 bne @0800B2D0 ldr r4, =0x030030fc ldrb r2, [r4] cmp r2, 0x1 bne @0800B2A8 ldrh r0, [r0, 0x2E] ands r2, r0 cmp r2, 0 beq @0800B2C2 movs r0, 0x15 bl audio_play movs r0, 0 strb r0, [r4] ldr r1, =0x02022b00 movs r0, 0 strb r0, [r1, 0x6] bl sub_81700F8 b @0800B2C2 .align 2, 0 .pool @0800B2A8: cmp r2, 0x2 bne @0800B2C2 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0800B2C2 bl rfu_REQ_stopMode bl rfu_waitREQComplete bl do_reset @0800B2C2: ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r0, r2 ldrb r1, [r1] cmp r1, 0xA0 beq @0800B2DC @0800B2D0: movs r2, 0x87 lsls r2, 3 adds r1, r0, r2 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0800B2DC: add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B1A0 thumb_func_start sub_800B2E8 sub_800B2E8: ; 800B2E8 ldr r0, =0x04000128 ldrh r0, [r0] lsrs r0, 2 movs r1, 0x1 ands r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_800B2E8 thumb_func_start sub_800B2F8 sub_800B2F8: ; 800B2F8 push {lr} movs r3, 0 ldr r2, =0x04000128 ldrh r1, [r2] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @0800B314 ldrh r1, [r2] movs r0, 0x4 ands r0, r1 cmp r0, 0 bne @0800B314 movs r3, 0x1 @0800B314: adds r0, r3, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800B2F8 thumb_func_start sub_800B320 sub_800B320: ; 800B320 ldr r0, =0x030030e0 ldr r0, [r0] lsrs r0, 6 movs r1, 0x1 ands r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_800B320 thumb_func_start sub_800B330 sub_800B330: ; 800B330 ldr r1, =0x030030f8 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_800B330 thumb_func_start sub_800B33C sub_800B33C: ; 800B33C ldr r0, =0x0300306c ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800B33C thumb_func_start sub_800B348 sub_800B348: ; 800B348 push {r4-r6,lr} bl sub_8009638 ldr r1, =0x03003030 adds r2, r1, 0 adds r2, 0x10 ldr r0, =0x020229cc ldm r0!, {r3-r5} stm r2!, {r3-r5} ldm r0!, {r3,r4,r6} stm r2!, {r3,r4,r6} ldr r0, [r0] str r0, [r2] ldr r3, =gUnknown_082ED1D4 adds r2, r1, 0 adds r0, r3, 0 ldm r0!, {r4-r6} stm r2!, {r4-r6} ldrh r4, [r0] strh r4, [r2] ldrb r0, [r0, 0x2] strb r0, [r2, 0x2] adds r0, r1, 0 adds r0, 0x2C ldm r3!, {r2,r5,r6} stm r0!, {r2,r5,r6} ldrh r2, [r3] strh r2, [r0] ldrb r2, [r3, 0x2] strb r2, [r0, 0x2] ldr r0, =0x020228c4 movs r2, 0x3C bl memcpy pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B348 thumb_func_start sub_800B3A4 sub_800B3A4: ; 800B3A4 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 lsls r2, r0, 8 ldr r1, =0x020223c4 adds r4, r2, r1 lsls r2, r0, 3 subs r2, r0 lsls r2, 2 ldr r0, =0x020229e8 adds r2, r0 adds r1, r2, 0 adds r0, r4, 0 adds r0, 0x10 ldm r0!, {r3,r5,r6} stm r1!, {r3,r5,r6} ldm r0!, {r3,r5,r6} stm r1!, {r3,r5,r6} ldr r0, [r0] str r0, [r1] adds r0, r2, 0 bl sub_800B524 ldr r5, =gUnknown_082ED1D4 adds r0, r4, 0 adds r1, r5, 0 bl strcmp cmp r0, 0 bne @0800B3EE adds r0, r4, 0 adds r0, 0x2C adds r1, r5, 0 bl strcmp cmp r0, 0 beq @0800B3F4 @0800B3EE: ldr r0, =c2_800ACD4 bl set_callback2 @0800B3F4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B3A4 thumb_func_start sub_800B40C sub_800B40C: ; 800B40C push {r4,r5,lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @0800B45C ldr r0, =0x03003144 ldr r1, =0x03003110 ldr r2, =0x03003090 bl sub_800B638 ldr r4, =0x030030e0 str r0, [r4] ldr r0, =0x030022ec bl sub_80099E0 ldr r0, [r4] movs r1, 0x80 lsls r1, 1 ands r0, r1 cmp r0, 0 beq @0800B480 bl sub_808766C cmp r0, 0x1 bne @0800B480 @0800B43E: movs r0, 0x1 b @0800B482 .align 2, 0 .pool @0800B45C: bl sub_8010EC0 adds r4, r0, 0 bl sub_8010F1C adds r5, r0, 0 bl sub_808766C cmp r0, 0x1 bne @0800B480 cmp r4, 0x1 beq @0800B43E bl sub_800F0B8 cmp r0, 0 bne @0800B43E cmp r5, 0 bne @0800B43E @0800B480: movs r0, 0 @0800B482: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_800B40C thumb_func_start sub_800B488 sub_800B488: ; 800B488 push {lr} ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0800B498 ldr r1, =0x030030fc movs r0, 0x1 strb r0, [r1] @0800B498: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B488 thumb_func_start sub_800B4A4 sub_800B4A4: ; 800B4A4 push {lr} ldr r0, =0x03003124 ldrb r1, [r0] cmp r1, 0 bne @0800B4B2 ldr r0, =0x030030fc strb r1, [r0] @0800B4B2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B4A4 thumb_func_start sub_800B4C0 sub_800B4C0: ; 800B4C0 push {lr} ldr r0, =0x03003124 ldrb r1, [r0] cmp r1, 0 bne @0800B4CE ldr r0, =0x030030fc strb r1, [r0] @0800B4CE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B4C0 thumb_func_start sub_800B4DC sub_800B4DC: ; 800B4DC push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @0800B4FC ldr r0, =0x03003170 ldr r1, =0x00000fbd adds r0, r1 ldrb r0, [r0] b @0800B500 .align 2, 0 .pool @0800B4FC: bl sub_80124D4 @0800B500: pop {r1} bx r1 thumb_func_end sub_800B4DC thumb_func_start sub_800B504 sub_800B504: ; 800B504 push {lr} bl sub_800B4DC cmp r0, 0x2 bhi @0800B512 movs r0, 0 b @0800B514 @0800B512: movs r0, 0x1 @0800B514: pop {r1} bx r1 thumb_func_end sub_800B504 thumb_func_start sub_800B518 sub_800B518: ; 800B518 ldr r0, =0x030030fc ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800B518 thumb_func_start sub_800B524 sub_800B524: ; 800B524 push {lr} ldrb r1, [r0, 0x10] strb r1, [r0, 0x12] adds r2, r0, 0 adds r2, 0x8 ldrb r1, [r0, 0x1A] adds r0, r2, 0 bl 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, =0x04000128 movs r2, 0x80 lsls r2, 6 adds r0, r2, 0 strh r0, [r1] ldr r0, =0x0400010e movs r2, 0 strh r2, [r0] adds r1, 0xDA movs r0, 0xC0 strh r0, [r1] ldr r0, =0x0400012a strh r2, [r0] ldr r2, =0x04000120 movs r0, 0 movs r1, 0 str r0, [r2] str r1, [r2, 0x4] str r0, [sp] ldr r1, =0x03003170 ldr r2, =0x050003f0 mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B53C thumb_func_start sub_800B594 sub_800B594: ; 800B594 push {r4,r5,lr} sub sp, 0x4 movs r0, 0xC0 bl disable_irqs ldr r0, =0x04000134 movs r4, 0 strh r4, [r0] ldr r2, =0x04000128 movs r1, 0x80 lsls r1, 6 adds r0, r1, 0 strh r0, [r2] ldrh r0, [r2] ldr r3, =0x00004003 adds r1, r3, 0 orrs r0, r1 strh r0, [r2] movs r0, 0x80 bl enable_irqs ldr r0, =0x0400012a strh r4, [r0] movs r5, 0 str r5, [sp] ldr r1, =0x03003170 ldr r2, =0x050003f0 mov r0, sp bl CpuSet ldr r0, =0x03000d6c strb r4, [r0] ldr r0, =0x03000d6e strh r5, [r0] ldr r0, =0x03000d70 strh r5, [r0] ldr r0, =0x03000d72 strb r4, [r0] ldr r0, =0x03000d73 strb r4, [r0] ldr r0, =0x03003160 strb r4, [r0] ldr r0, =0x03004130 strb r4, [r0] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B594 thumb_func_start sub_800B628 sub_800B628: ; 800B628 push {lr} bl sub_800B594 bl sub_800B53C pop {r0} bx r0 thumb_func_end sub_800B628 thumb_func_start sub_800B638 sub_800B638: ; 800B638 push {r4-r7,lr} adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 ldr r0, =0x03003170 ldrb r0, [r0, 0x1] cmp r0, 0x4 bhi @0800B6EA lsls r0, 2 ldr r1, =@0800B65C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0800B65C: .4byte @0800B670 .4byte @0800B680 .4byte @0800B698 .4byte @0800B6D4 .4byte @0800B6DE @0800B670: bl sub_800B53C ldr r1, =0x03003170 movs r0, 0x1 strb r0, [r1, 0x1] b @0800B6EA .align 2, 0 .pool @0800B680: ldrb r0, [r4] cmp r0, 0x1 bne @0800B6EA bl sub_800B594 ldr r1, =0x03003170 movs r0, 0x2 strb r0, [r1, 0x1] b @0800B6EA .align 2, 0 .pool @0800B698: ldrb r1, [r4] cmp r1, 0x1 beq @0800B6A8 cmp r1, 0x2 beq @0800B6C0 bl sub_800B764 b @0800B6EA @0800B6A8: ldr r2, =0x03003170 ldrb r0, [r2] cmp r0, 0x8 bne @0800B6EA ldrb r0, [r2, 0x3] cmp r0, 0x1 bls @0800B6EA strb r1, [r2, 0xE] b @0800B6EA .align 2, 0 .pool @0800B6C0: ldr r0, =0x03003170 movs r1, 0 strb r1, [r0, 0x1] ldr r0, =0x0400012a strh r1, [r0] b @0800B6EA .align 2, 0 .pool @0800B6D4: bl sub_800B790 ldr r1, =0x03003170 movs r0, 0x4 strb r0, [r1, 0x1] @0800B6DE: adds r0, r5, 0 bl sub_800B7C0 adds r0, r6, 0 bl sub_800B8A8 @0800B6EA: movs r0, 0 strb r0, [r4] ldr r1, =0x03003170 ldrb r2, [r1, 0x2] ldrb r0, [r1, 0x3] lsls r0, 2 orrs r2, r0 ldrb r0, [r1] cmp r0, 0x8 bne @0800B702 movs r0, 0x20 orrs r2, r0 @0800B702: ldrb r0, [r1, 0xC] lsls r3, r0, 8 ldrb r0, [r1, 0xF] lsls r4, r0, 9 ldrb r0, [r1, 0x10] lsls r5, r0, 12 ldrb r0, [r1, 0x11] lsls r6, r0, 13 ldrb r0, [r1, 0x12] lsls r7, r0, 14 ldrb r0, [r1, 0x1] cmp r0, 0x4 bne @0800B728 movs r0, 0x40 orrs r0, r3 orrs r0, r2 b @0800B72C .align 2, 0 .pool @0800B728: adds r0, r2, 0 orrs r0, r3 @0800B72C: orrs r0, r4 orrs r0, r5 orrs r0, r6 orrs r0, r7 adds r2, r0, 0 ldrb r3, [r1, 0x13] cmp r3, 0x1 bne @0800B742 movs r0, 0x80 lsls r0, 9 orrs r2, r0 @0800B742: ldrb r0, [r1, 0x2] cmp r0, 0x3 bls @0800B74E movs r0, 0x80 lsls r0, 10 orrs r2, r0 @0800B74E: adds r1, r2, 0 cmp r3, 0x2 bne @0800B75A movs r0, 0x80 lsls r0, 11 orrs r1, r0 @0800B75A: adds r0, r1, 0 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_800B638 thumb_func_start sub_800B764 sub_800B764: ; 800B764 push {lr} ldr r0, =0x04000128 ldr r1, [r0] movs r0, 0xC ands r1, r0 ldr r2, =0x03003170 cmp r1, 0x8 bne @0800B788 ldrb r0, [r2, 0x2] cmp r0, 0 bne @0800B788 strb r1, [r2] b @0800B78C .align 2, 0 .pool @0800B788: movs r0, 0 strb r0, [r2] @0800B78C: pop {r0} bx r0 thumb_func_end sub_800B764 thumb_func_start sub_800B790 sub_800B790: ; 800B790 push {lr} ldr r0, =0x03003170 ldrb r0, [r0] cmp r0, 0 beq @0800B7AE ldr r1, =0x0400010c ldr r2, =0x0000ff3b adds r0, r2, 0 strh r0, [r1] adds r1, 0x2 movs r0, 0x41 strh r0, [r1] movs r0, 0x40 bl enable_irqs @0800B7AE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B790 thumb_func_start sub_800B7C0 sub_800B7C0: ; 800B7C0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r3, r0, 0 ldr r2, =0x03004134 ldr r1, =0x04000208 ldrh r0, [r1] strh r0, [r2] movs r0, 0 strh r0, [r1] ldr r1, =0x03003170 ldr r4, =0x00000339 adds r0, r1, r4 ldrb r4, [r0] adds r6, r1, 0 cmp r4, 0x31 bhi @0800B850 movs r1, 0xCE lsls r1, 2 adds r0, r6, r1 ldrb r0, [r0] adds r0, r4, r0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x31 bls @0800B7FE subs r0, 0x32 lsls r0, 24 lsrs r0, 24 @0800B7FE: movs r2, 0 ldr r4, =0x03000d6e mov r9, r4 ldr r1, =0x03003160 mov r10, r1 lsls r5, r0, 1 movs r0, 0x18 adds r0, r6 mov r8, r0 mov r12, r2 movs r7, 0x64 @0800B814: ldrh r0, [r4] ldrh r1, [r3] orrs r0, r1 strh r0, [r4] adds r0, r2, 0 muls r0, r7 adds r0, r5, r0 add r0, r8 strh r1, [r0] mov r1, r12 strh r1, [r3] adds r3, 0x2 adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x7 bls @0800B814 b @0800B85C .align 2, 0 .pool @0800B850: movs r0, 0x1 strb r0, [r6, 0x12] ldr r2, =0x03000d6e mov r9, r2 ldr r4, =0x03003160 mov r10, r4 @0800B85C: mov r1, r9 ldrh r0, [r1] cmp r0, 0 beq @0800B874 ldr r2, =0x00000339 adds r0, r6, r2 ldrb r1, [r0] adds r1, 0x1 movs r2, 0 strb r1, [r0] mov r4, r9 strh r2, [r4] @0800B874: ldr r1, =0x04000208 ldr r2, =0x03004134 ldrh r0, [r2] strh r0, [r1] ldr r4, =0x00000339 adds r0, r6, r4 ldrb r0, [r0] mov r1, r10 strb r0, [r1] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B7C0 thumb_func_start sub_800B8A8 sub_800B8A8: ; 800B8A8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} mov r9, r0 ldr r2, =0x03004134 ldr r1, =0x04000208 ldrh r0, [r1] strh r0, [r2] movs r0, 0 strh r0, [r1] ldr r1, =0x03003170 ldr r3, =0x00000fbd adds r0, r1, r3 ldrb r0, [r0] mov r12, r1 cmp r0, 0 bne @0800B914 movs r3, 0 ldrb r0, [r1, 0x3] cmp r3, r0 bcs @0800B8FA movs r5, 0 adds r6, r0, 0 @0800B8DA: movs r2, 0 lsls r1, r3, 4 adds r4, r3, 0x1 add r1, r9 @0800B8E2: lsls r0, r2, 1 adds r0, r1 strh r5, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x7 bls @0800B8E2 lsls r0, r4, 24 lsrs r3, r0, 24 cmp r3, r6 bcc @0800B8DA @0800B8FA: movs r0, 0x1 mov r7, r12 strb r0, [r7, 0xC] b @0800B990 .align 2, 0 .pool @0800B914: movs r3, 0 mov r0, r12 ldrb r1, [r0, 0x3] cmp r3, r1 bcs @0800B96A ldr r0, =0x00000fbc add r0, r12 ldrb r0, [r0] lsls r6, r0, 1 movs r2, 0xCF lsls r2, 2 add r2, r12 mov r8, r2 mov r10, r1 @0800B930: movs r2, 0 lsls r1, r3, 4 adds r4, r3, 0x1 lsls r0, r3, 1 mov r7, r9 adds r5, r1, r7 adds r0, r3 lsls r0, 3 adds r0, r3 lsls r3, r0, 5 @0800B944: lsls r1, r2, 1 adds r1, r5 movs r7, 0x64 adds r0, r2, 0 muls r0, r7 adds r0, r6, r0 adds r0, r3 add r0, r8 ldrh r0, [r0] strh r0, [r1] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x7 bls @0800B944 lsls r0, r4, 24 lsrs r3, r0, 24 cmp r3, r10 bcc @0800B930 @0800B96A: mov r2, r12 ldr r0, =0x00000fbd adds r1, r2, r0 ldrb r0, [r1] subs r0, 0x1 movs r3, 0 strb r0, [r1] ldr r1, =0x00000fbc adds r2, r1 ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] lsls r0, 24 lsrs r0, 24 cmp r0, 0x31 bls @0800B98C strb r3, [r2] @0800B98C: mov r2, r12 strb r3, [r2, 0xC] @0800B990: ldr r1, =0x04000208 ldr r3, =0x03004134 ldrh r0, [r3] strh r0, [r1] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800B8A8 thumb_func_start sub_800B9B8 sub_800B9B8: ; 800B9B8 push {r4,lr} ldr r3, =0x03003170 ldrb r4, [r3] cmp r4, 0 beq @0800B9F4 ldrb r0, [r3, 0x1] cmp r0, 0x2 beq @0800B9EE cmp r0, 0x4 bne @0800BA1E movs r0, 0xD ldrsb r0, [r3, r0] cmp r0, 0x8 bgt @0800B9E4 ldrb r0, [r3, 0x10] cmp r0, 0x1 beq @0800B9EE movs r0, 0x1 strb r0, [r3, 0x13] b @0800BA1E .align 2, 0 .pool @0800B9E4: ldrb r0, [r3, 0x13] cmp r0, 0x1 beq @0800BA1E movs r0, 0 strb r0, [r3, 0xD] @0800B9EE: bl sub_800BAC0 b @0800BA1E @0800B9F4: ldrb r2, [r3, 0x1] cmp r2, 0x4 beq @0800B9FE cmp r2, 0x2 bne @0800BA1E @0800B9FE: ldr r1, =0x03000d6c ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0xA bls @0800BA1E cmp r2, 0x4 bne @0800BA16 movs r0, 0x2 strb r0, [r3, 0x13] @0800BA16: cmp r2, 0x2 bne @0800BA1E strb r4, [r3, 0x3] strb r4, [r3, 0xF] @0800BA1E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03003170 ldr r0, =0x04000128 ldr r1, [r0] lsls r0, r1, 26 lsrs r0, 30 strb r0, [r4, 0x2] ldrb r0, [r4, 0x1] cmp r0, 0x2 beq @0800BA6C cmp r0, 0x4 bne @0800BA8A lsls r0, r1, 25 lsrs r0, 31 strb r0, [r4, 0x10] bl sub_800BBCC bl sub_800BCE4 bl sub_800BDCC b @0800BA8A .align 2, 0 .pool @0800BA6C: bl sub_800BAD0 lsls r0, 24 cmp r0, 0 beq @0800BA8A ldrb r0, [r4] cmp r0, 0 beq @0800BA86 movs r0, 0x3 strb r0, [r4, 0x1] movs r0, 0x8 strb r0, [r4, 0xD] b @0800BA8A @0800BA86: movs r0, 0x4 strb r0, [r4, 0x1] @0800BA8A: ldr r3, =0x03003170 ldrb r0, [r3, 0xD] adds r0, 0x1 movs r2, 0 strb r0, [r3, 0xD] ldr r1, =0x03000d6c strb r2, [r1] lsls r0, 24 asrs r0, 24 cmp r0, 0x8 bne @0800BAAA ldr r0, =0x03004130 ldr r2, =0x00000fbd adds r1, r3, r2 ldrb r1, [r1] strb r1, [r0] @0800BAAA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800BA38 thumb_func_start sub_800BAC0 sub_800BAC0: ; 800BAC0 ldr r0, =0x04000128 ldrh r1, [r0] movs r2, 0x80 orrs r1, r2 strh r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800BAC0 thumb_func_start sub_800BAD0 sub_800BAD0: ; 800BAD0 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r5, 0 ldr r6, =0x0000ffff ldr r0, =0x03003170 ldrb r1, [r0, 0xE] adds r7, r0, 0 cmp r1, 0x1 bne @0800BAFC ldr r1, =0x0400012a ldr r2, =0x00008fff b @0800BB00 .align 2, 0 .pool @0800BAFC: ldr r1, =0x0400012a ldr r2, =0x0000b9a0 @0800BB00: adds r0, r2, 0 strh r0, [r1] ldr r2, =0x03003174 ldr r3, =0x04000120 ldr r0, [r3] ldr r1, [r3, 0x4] str r0, [r2] str r1, [r2, 0x4] movs r0, 0 movs r1, 0 str r0, [r3] str r1, [r3, 0x4] strb r0, [r2, 0xA] movs r4, 0 ldr r0, =0x03000d73 mov r9, r0 mov r8, r2 ldr r2, =0x00008fff ldr r1, =0x0000ffff mov r12, r1 @0800BB28: lsls r0, r4, 1 add r0, r8 ldrh r3, [r0] movs r0, 0x4 negs r0, r0 ands r0, r3 ldr r1, =0x0000b9a0 cmp r0, r1 beq @0800BB40 adds r0, r3, 0 cmp r0, r2 bne @0800BB70 @0800BB40: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 adds r0, r3, 0 cmp r6, r0 bls @0800BB78 cmp r0, 0 beq @0800BB78 adds r6, r3, 0 b @0800BB78 .align 2, 0 .pool @0800BB70: cmp r0, r12 beq @0800BB82 movs r5, 0 b @0800BB82 @0800BB78: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @0800BB28 @0800BB82: strb r5, [r7, 0x3] adds r0, r5, 0 cmp r0, 0x1 bls @0800BBB2 mov r2, r9 ldrb r2, [r2] cmp r0, r2 bne @0800BBA4 ldrh r1, [r7, 0x4] ldr r0, =0x00008fff cmp r1, r0 bne @0800BBA4 movs r0, 0x1 b @0800BBBE .align 2, 0 .pool @0800BBA4: ldrb r0, [r7, 0x3] cmp r0, 0x1 bls @0800BBB2 movs r0, 0x3 ands r6, r0 adds r0, r6, 0x1 b @0800BBB4 @0800BBB2: movs r0, 0 @0800BBB4: strb r0, [r7, 0xF] ldrb r0, [r7, 0x3] mov r1, r9 strb r0, [r1] movs r0, 0 @0800BBBE: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_800BAD0 thumb_func_start sub_800BBCC sub_800BBCC: ; 800BBCC push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x8 ldr r0, =0x04000120 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] ldr r0, =0x03003170 ldrb r1, [r0, 0x16] adds r6, r0, 0 cmp r1, 0 bne @0800BC30 movs r4, 0 ldr r7, =0x03000d72 ldrb r0, [r6, 0x3] cmp r4, r0 bcs @0800BC1A adds r5, r6, 0 ldrh r1, [r6, 0x14] adds r3, r7, 0 adds r2, r6, 0 @0800BBFA: lsls r0, r4, 1 add r0, sp ldrh r0, [r0] cmp r1, r0 beq @0800BC0E ldrb r0, [r3] cmp r0, 0 beq @0800BC0E movs r0, 0x1 strb r0, [r5, 0x11] @0800BC0E: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 ldrb r0, [r2, 0x3] cmp r4, r0 bcc @0800BBFA @0800BC1A: movs r0, 0 strh r0, [r6, 0x14] movs r0, 0x1 strb r0, [r7] b @0800BCD0 .align 2, 0 .pool @0800BC30: ldr r2, =0x00000fbc adds r1, r6, r2 adds r2, 0x1 adds r0, r6, r2 ldrb r2, [r0] ldrb r1, [r1] adds r0, r2, r1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x31 bls @0800BC4C subs r0, 0x32 lsls r0, 24 lsrs r0, 24 @0800BC4C: cmp r2, 0x31 bhi @0800BCA8 movs r4, 0 ldrb r1, [r6, 0x3] cmp r4, r1 bcs @0800BCAC adds r5, r6, 0 ldr r7, =0x03000d70 lsls r0, 1 mov r12, r0 movs r2, 0xCF lsls r2, 2 adds r2, r6 mov r8, r2 @0800BC68: lsls r1, r4, 1 mov r2, sp adds r0, r2, r1 ldrh r3, [r0] ldrh r2, [r5, 0x14] adds r0, r3, r2 strh r0, [r5, 0x14] ldrh r0, [r7] orrs r0, r3 strh r0, [r7] ldrb r2, [r5, 0x17] movs r0, 0x64 muls r0, r2 add r0, r12 adds r1, r4 lsls r1, 3 adds r1, r4 lsls r1, 5 adds r0, r1 add r0, r8 strh r3, [r0] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 ldrb r0, [r5, 0x3] cmp r4, r0 bcc @0800BC68 b @0800BCAC .align 2, 0 .pool @0800BCA8: movs r0, 0x2 strb r0, [r6, 0x12] @0800BCAC: ldrb r0, [r6, 0x17] adds r0, 0x1 strb r0, [r6, 0x17] lsls r0, 24 lsrs r0, 24 cmp r0, 0x8 bne @0800BCD0 ldr r2, =0x03000d70 ldrh r0, [r2] cmp r0, 0 beq @0800BCD0 ldr r1, =0x00000fbd adds r0, r6, r1 ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] movs r0, 0 strh r0, [r2] @0800BCD0: add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800BBCC thumb_func_start sub_800BCE4 sub_800BCE4: ; 800BCE4 push {r4,lr} ldr r0, =0x03003170 ldrb r1, [r0, 0x16] adds r4, r0, 0 cmp r1, 0x8 bne @0800BD36 ldr r1, =0x0400012a ldrh r0, [r4, 0x14] strh r0, [r1] ldr r1, =0x03000d6d ldrb r2, [r1] cmp r2, 0 bne @0800BD30 ldr r0, =0x00000339 adds r1, r4, r0 ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] movs r0, 0xCE lsls r0, 2 adds r1, r4, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x31 bls @0800BD8C strb r2, [r1] b @0800BD8C .align 2, 0 .pool @0800BD30: movs r0, 0 strb r0, [r1] b @0800BD8C @0800BD36: ldr r1, =0x03000d6d ldrb r0, [r1] cmp r0, 0 bne @0800BD52 ldr r2, =0x00000339 adds r0, r4, r2 ldrb r0, [r0] cmp r0, 0 bne @0800BD4C movs r0, 0x1 strb r0, [r1] @0800BD4C: ldrb r0, [r1] cmp r0, 0 beq @0800BD68 @0800BD52: ldr r1, =0x0400012a movs r0, 0 strh r0, [r1] b @0800BD86 .align 2, 0 .pool @0800BD68: ldr r3, =0x0400012a movs r1, 0xCE lsls r1, 2 adds r0, r4, r1 ldrb r0, [r0] lsls r0, 1 ldrb r2, [r4, 0x16] movs r1, 0x64 muls r1, r2 adds r0, r1 adds r1, r4, 0 adds r1, 0x18 adds r0, r1 ldrh r0, [r0] strh r0, [r3] @0800BD86: ldrb r0, [r4, 0x16] adds r0, 0x1 strb r0, [r4, 0x16] @0800BD8C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800BCE4 thumb_func_start sub_800BD98 sub_800BD98: ; 800BD98 push {lr} ldr r0, =0x03003170 ldrb r0, [r0] cmp r0, 0 beq @0800BDB4 ldr r2, =0x0400010e ldrh r1, [r2] ldr r0, =0x0000ff7f ands r0, r1 strh r0, [r2] ldr r1, =0x0400010c ldr r2, =0x0000ff3b adds r0, r2, 0 strh r0, [r1] @0800BDB4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800BD98 thumb_func_start sub_800BDCC sub_800BDCC: ; 800BDCC push {lr} ldr r1, =0x03003170 ldrb r0, [r1, 0x17] cmp r0, 0x8 bne @0800BDE4 movs r0, 0 strb r0, [r1, 0x16] strb r0, [r1, 0x17] b @0800BDF4 .align 2, 0 .pool @0800BDE4: ldrb r0, [r1] cmp r0, 0 beq @0800BDF4 ldr r0, =0x0400010e ldrh r1, [r0] movs r2, 0x80 orrs r1, r2 strh r1, [r0] @0800BDF4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800BDCC thumb_func_start sub_800BDFC sub_800BDFC: ; 800BDFC push {r4-r6,lr} ldr r1, =0x03003170 ldr r2, =0x00000339 adds r0, r1, r2 movs r2, 0 strb r2, [r0] movs r3, 0xCE lsls r3, 2 adds r0, r1, r3 strb r2, [r0] movs r0, 0 movs r6, 0x64 adds r5, r1, 0 adds r5, 0x18 ldr r4, =0x0000efff @0800BE1A: movs r2, 0 adds r1, r0, 0x1 adds r3, r0, 0 muls r3, r6 @0800BE22: lsls r0, r2, 1 adds r0, r3 adds r0, r5 strh r4, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x31 bls @0800BE22 lsls r0, r1, 24 lsrs r0, 24 cmp r0, 0x7 bls @0800BE1A pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800BDFC thumb_func_start sub_800BE50 sub_800BE50: ; 800BE50 push {r4-r7,lr} ldr r1, =0x03003170 ldr r2, =0x00000fbd adds r0, r1, r2 movs r2, 0 strb r2, [r0] ldr r3, =0x00000fbc adds r0, r1, r3 strb r2, [r0] movs r0, 0x64 mov r12, r0 movs r3, 0xCF lsls r3, 2 adds r7, r1, r3 ldr r6, =0x0000efff @0800BE6E: movs r3, 0 lsls r0, r2, 1 adds r5, r2, 0x1 adds r0, r2 lsls r0, 3 adds r0, r2 lsls r4, r0, 5 @0800BE7C: movs r2, 0 adds r1, r3, 0x1 mov r0, r12 muls r0, r3 adds r3, r0, 0 @0800BE86: lsls r0, r2, 1 adds r0, r3 adds r0, r4 adds r0, r7 strh r6, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x31 bls @0800BE86 lsls r0, r1, 24 lsrs r3, r0, 24 cmp r3, 0x7 bls @0800BE7C lsls r0, r5, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @0800BE6E pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800BE50 thumb_func_start sub_800BEC0 sub_800BEC0: ; 800BEC0 push {r4,lr} bl rfu_REQBN_softReset_and_checkID adds r4, r0, 0 ldr r0, =0x00008001 cmp r4, r0 bne @0800BED4 ldr r1, =0x03004140 movs r0, 0x1 strb r0, [r1, 0x8] @0800BED4: ldr r0, =0x03004140 ldrb r2, [r0, 0x4] adds r1, r0, 0 cmp r2, 0x17 beq @0800BEE8 cmp r2, 0x1 beq @0800BEE8 movs r0, 0 strb r0, [r1, 0x5] strb r0, [r1, 0x4] @0800BEE8: movs r0, 0 strb r0, [r1, 0x7] strb r0, [r1, 0xD] strb r0, [r1, 0x1] strb r0, [r1] movs r0, 0xFF strb r0, [r1, 0x6] bl sub_800D610 adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800BEC0 thumb_func_start rfu_REQ_sendData_wrapper rfu_REQ_sendData_wrapper: ; 800BF0C push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0 bne @0800BF34 ldr r0, =0x03004140 ldrb r0, [r0, 0x2] movs r2, 0 cmp r0, 0x1 bne @0800BF3C movs r2, 0x1 b @0800BF3C .align 2, 0 .pool @0800BF34: ldr r0, =0x03004140 ldrb r1, [r0, 0x3] movs r1, 0 strb r1, [r0, 0x3] @0800BF3C: adds r0, r2, 0 bl rfu_REQ_sendData pop {r0} bx r0 .align 2, 0 .pool thumb_func_end rfu_REQ_sendData_wrapper thumb_func_start sub_800BF4C sub_800BF4C: ; 800BF4C push {r4-r6,lr} sub sp, 0x4 adds r5, r0, 0 adds r6, r1, 0 cmp r5, 0 beq @0800BF94 mov r1, sp movs r0, 0 strh r0, [r1] ldr r4, =0x03004140 ldr r2, =0x01000024 mov r0, sp adds r1, r4, 0 bl CpuSet movs r0, 0xFF strb r0, [r4, 0x6] str r5, [r4, 0x40] str r6, [r4, 0x44] ldr r0, =sub_800CEB0 bl rfu_setMSCCallback ldr r0, =sub_800C7B4 bl rfu_setREQCallback movs r0, 0 b @0800BF96 .align 2, 0 .pool @0800BF94: movs r0, 0x4 @0800BF96: add sp, 0x4 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_800BF4C thumb_func_start sub_800BFA0 sub_800BFA0: ; 800BFA0 push {r4,lr} sub sp, 0x4 mov r1, sp movs r0, 0 strh r0, [r1] ldr r4, =0x03004140 ldr r2, =0x01000020 mov r0, sp adds r1, r4, 0 bl CpuSet movs r0, 0xFF strb r0, [r4, 0x6] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800BFA0 thumb_func_start sub_800BFCC sub_800BFCC: ; 800BFCC push {r4,lr} adds r4, r0, 0 bl sub_800C000 ldr r1, =0x03004140 movs r2, 0x1 strb r2, [r1, 0x4] movs r0, 0x2 strb r0, [r1, 0x5] str r4, [r1, 0x3C] ldrb r0, [r4, 0x11] strb r0, [r1, 0x9] ldrh r0, [r4, 0x12] strh r0, [r1, 0x32] ldrh r0, [r4, 0x14] strh r0, [r1, 0x18] ldrb r0, [r4, 0x10] cmp r0, 0 beq @0800BFF4 strb r2, [r1, 0xB] @0800BFF4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800BFCC thumb_func_start sub_800C000 sub_800C000: ; 800C000 push {r4,r5,lr} ldr r2, =0x03004140 movs r0, 0 strb r0, [r2, 0x5] strb r0, [r2, 0x4] movs r1, 0xFF strb r1, [r2, 0x6] strb r0, [r2, 0x7] strb r0, [r2, 0x10] strb r0, [r2, 0xC] adds r1, r2, 0 adds r1, 0x24 strb r0, [r1] adds r1, 0xC strb r0, [r1] movs r3, 0 adds r5, r2, 0 adds r5, 0x28 movs r4, 0 adds r2, 0x34 @0800C028: lsls r1, r3, 1 adds r0, r1, r5 strh r4, [r0] adds r1, r2 strh r4, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bls @0800C028 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800C000 thumb_func_start sub_800C048 sub_800C048: ; 800C048 ldr r1, =0x03004140 movs r0, 0x15 strb r0, [r1, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_800C048 thumb_func_start sub_800C054 sub_800C054: ; 800C054 push {r4-r7,lr} mov r7, r8 push {r7} adds r6, r3, 0 lsls r0, 24 lsrs r5, r0, 24 lsls r1, 16 lsrs r7, r1, 16 lsls r2, 16 lsrs r2, 16 mov r8, r2 ldr r1, =0x03004140 ldrb r0, [r1, 0x4] cmp r0, 0 beq @0800C090 cmp r0, 0x8 bne @0800C07A cmp r5, 0x1 beq @0800C090 @0800C07A: movs r0, 0x1 strh r0, [r1, 0x14] movs r0, 0xF3 movs r1, 0x1 bl sub_800D30C movs r0, 0x1 b @0800C122 .align 2, 0 .pool @0800C090: bl rfu_getMasterSlave lsls r0, 24 cmp r0, 0 bne @0800C0B0 ldr r1, =0x03004140 movs r0, 0x2 strh r0, [r1, 0x14] movs r0, 0xF3 movs r1, 0x1 bl sub_800D30C movs r0, 0x2 b @0800C122 .align 2, 0 .pool @0800C0B0: movs r2, 0 ldrh r0, [r6] ldr r4, =0x0000ffff adds r1, r6, 0x2 ldr r3, =0x03004140 cmp r0, r4 beq @0800C0D0 @0800C0BE: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xF bhi @0800C0D0 ldrh r0, [r1] adds r1, 0x2 cmp r0, r4 bne @0800C0BE @0800C0D0: cmp r2, 0x10 bne @0800C0EC movs r0, 0x4 strh r0, [r3, 0x14] movs r0, 0xF3 movs r1, 0x1 bl sub_800D30C movs r0, 0x4 b @0800C122 .align 2, 0 .pool @0800C0EC: cmp r5, 0x1 bls @0800C0FA movs r0, 0x1 strb r0, [r3, 0x7] movs r5, 0x1 movs r7, 0 b @0800C0FE @0800C0FA: movs r0, 0 strb r0, [r3, 0x7] @0800C0FE: cmp r5, 0 beq @0800C108 movs r0, 0x5 strb r0, [r3, 0x4] b @0800C116 @0800C108: movs r0, 0x9 strb r0, [r3, 0x4] ldrb r0, [r3, 0xB] cmp r0, 0 beq @0800C116 movs r0, 0x2 strb r0, [r3, 0xB] @0800C116: strb r5, [r3, 0x6] strh r7, [r3, 0x1A] mov r0, r8 strh r0, [r3, 0x26] str r6, [r3, 0x20] movs r0, 0 @0800C122: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_800C054 thumb_func_start 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, =0x03004140 ldrb r0, [r1, 0x4] cmp r0, 0 beq @0800C164 subs r0, 0x9 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bls @0800C164 movs r0, 0x1 strh r0, [r1, 0x14] movs r0, 0xF3 movs r1, 0x1 bl sub_800D30C movs r0, 0x1 b @0800C204 .align 2, 0 .pool @0800C164: bl rfu_getMasterSlave lsls r0, 24 cmp r0, 0 bne @0800C184 ldr r1, =0x03004140 movs r0, 0x2 strh r0, [r1, 0x14] movs r0, 0xF3 movs r1, 0x1 bl sub_800D30C movs r0, 0x2 b @0800C204 .align 2, 0 .pool @0800C184: movs r2, 0 ldr r0, =0x03007890 ldr r1, [r0] ldrb r3, [r1, 0x8] ldr r5, =0x03004140 adds r7, r0, 0 cmp r2, r3 bcs @0800C1B2 ldrh r0, [r1, 0x14] cmp r0, r6 beq @0800C1B2 adds r4, r1, 0 adds r1, r3, 0 @0800C19E: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, r1 bcs @0800C1B2 lsls r0, r2, 5 adds r0, r4, r0 ldrh r0, [r0, 0x14] cmp r0, r6 bne @0800C19E @0800C1B2: ldr r0, [r7] ldrb r0, [r0, 0x8] cmp r0, 0 beq @0800C1BE cmp r2, r0 bne @0800C1D8 @0800C1BE: movs r0, 0x3 strh r0, [r5, 0x14] movs r0, 0xF3 movs r1, 0x1 bl sub_800D30C movs r0, 0x3 b @0800C204 .align 2, 0 .pool @0800C1D8: ldrb r0, [r5, 0x4] cmp r0, 0 beq @0800C1E2 cmp r0, 0x9 bne @0800C1EA @0800C1E2: movs r0, 0xC strb r0, [r5, 0x4] movs r0, 0xD b @0800C1F0 @0800C1EA: movs r0, 0xB strb r0, [r5, 0x4] movs r0, 0xC @0800C1F0: strb r0, [r5, 0x5] strh r6, [r5, 0x1E] mov r0, r8 strh r0, [r5, 0x1A] ldrb r0, [r5, 0x7] cmp r0, 0 beq @0800C202 movs r0, 0x7 strb r0, [r5, 0x7] @0800C202: movs r0, 0 @0800C204: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end mega_func_4 thumb_func_start sub_800C210 sub_800C210: ; 800C210 push {r4-r7,lr} lsls r0, 24 lsrs r1, r0, 24 ldr r6, =0x03004140 adds r3, r6, 0 adds r3, 0x30 ldrb r2, [r3] adds r0, r1, 0 ands r0, r2 cmp r0, 0 beq @0800C26C adds r0, r2, 0 bics r0, r1 strb r0, [r3] movs r4, 0 ldr r7, =0x03007890 movs r5, 0x1 adds r3, 0x4 movs r2, 0 @0800C236: adds r0, r1, 0 asrs r0, r4 ands r0, r5 cmp r0, 0 beq @0800C246 lsls r0, r4, 1 adds r0, r3 strh r2, [r0] @0800C246: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @0800C236 ldr r0, [r7] ldrb r4, [r0, 0x3] ands r4, r1 cmp r4, 0 beq @0800C260 adds r0, r4, 0 bl sub_800D334 @0800C260: ldr r0, =0x03004140 strh r4, [r0, 0x14] movs r0, 0x33 adds r1, r4, 0 bl sub_800D30C @0800C26C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800C210 thumb_func_start sub_800C27C sub_800C27C: ; 800C27C push {r4,r5,lr} lsls r0, 24 movs r2, 0 ldr r1, =0x03004140 strb r2, [r1, 0x7] adds r5, r1, 0 cmp r0, 0 beq @0800C29C bl sub_800C000 movs r0, 0x17 strb r0, [r5, 0x4] b @0800C366 .align 2, 0 .pool @0800C29C: ldrb r0, [r5, 0x4] subs r0, 0x5 cmp r0, 0xD bhi @0800C352 lsls r0, 2 ldr r1, =@0800C2B4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0800C2B4: .4byte @0800C2EC .4byte @0800C2F8 .4byte @0800C2F8 .4byte @0800C358 .4byte @0800C302 .4byte @0800C30C .4byte @0800C30C .4byte @0800C316 .4byte @0800C320 .4byte @0800C320 .4byte @0800C358 .4byte @0800C326 .4byte @0800C34C .4byte @0800C34C @0800C2EC: movs r1, 0 movs r0, 0x8 strb r0, [r5, 0x4] strb r1, [r5, 0x5] movs r2, 0x13 b @0800C358 @0800C2F8: movs r0, 0x7 strb r0, [r5, 0x4] movs r0, 0x8 strb r0, [r5, 0x5] b @0800C358 @0800C302: movs r0, 0 strb r0, [r5, 0x5] strb r0, [r5, 0x4] movs r2, 0x21 b @0800C358 @0800C30C: movs r1, 0 movs r0, 0xB strb r0, [r5, 0x4] strb r1, [r5, 0x5] b @0800C358 @0800C316: movs r0, 0 strb r0, [r5, 0x5] strb r0, [r5, 0x4] movs r2, 0x23 b @0800C358 @0800C320: movs r0, 0xE strb r0, [r5, 0x4] b @0800C358 @0800C326: ldrb r0, [r5, 0x11] strb r0, [r5, 0x4] ldrb r0, [r5, 0x12] strb r0, [r5, 0x5] ldr r4, =0x03007890 ldr r0, [r4] ldrb r0, [r0, 0x3] bl sub_800D334 ldr r0, [r4] ldrb r0, [r0, 0x3] strh r0, [r5, 0x14] movs r0, 0x33 movs r1, 0x1 bl sub_800D30C b @0800C366 .align 2, 0 .pool @0800C34C: movs r0, 0x12 strb r0, [r5, 0x4] b @0800C358 @0800C352: strb r2, [r5, 0x5] strb r2, [r5, 0x4] movs r2, 0x43 @0800C358: ldrb r0, [r5, 0x4] cmp r0, 0 bne @0800C366 adds r0, r2, 0 movs r1, 0 bl sub_800D30C @0800C366: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_800C27C thumb_func_start sub_800C36C sub_800C36C: ; 800C36C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 lsls r0, 16 lsrs r0, 16 movs r1, 0 mov r8, r1 mov r5, sp adds r5, 0x1 mov r4, sp adds r4, 0x2 mov r1, sp adds r2, r5, 0 adds r3, r4, 0 bl rfu_REQBN_watchLink mov r0, sp ldrb r0, [r0] adds r7, r4, 0 cmp r0, 0 beq @0800C43E ldr r1, =0x03004140 mov r0, sp ldrb r0, [r0] strh r0, [r1, 0x14] ldrb r0, [r5] strh r0, [r1, 0x16] ldrb r0, [r1, 0x9] adds r6, r1, 0 cmp r0, 0 beq @0800C426 movs r0, 0x1 strb r0, [r6, 0xA] ldrb r0, [r6, 0x6] cmp r0, 0 bne @0800C3C2 ldrb r0, [r5] cmp r0, 0 bne @0800C3C2 movs r0, 0x4 strb r0, [r6, 0xA] @0800C3C2: ldrb r0, [r6, 0xA] cmp r0, 0x1 bne @0800C40C movs r2, 0 mov r4, sp movs r5, 0x1 mov r12, r6 mov r3, r12 adds r3, 0x30 movs r6, 0x34 add r6, r12 mov r9, r6 @0800C3DA: ldrb r0, [r4] asrs r0, r2 ands r0, r5 cmp r0, 0 beq @0800C3F8 adds r0, r5, 0 lsls r0, r2 ldrb r1, [r3] orrs r0, r1 strb r0, [r3] lsls r0, r2, 1 add r0, r9 mov r6, r12 ldrh r1, [r6, 0x32] strh r1, [r0] @0800C3F8: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @0800C3DA movs r0, 0x31 b @0800C41E .align 2, 0 .pool @0800C40C: movs r0, 0 strb r0, [r6, 0xA] mov r0, sp ldrb r0, [r0] bl sub_800D334 movs r0, 0x1 mov r8, r0 movs r0, 0x33 @0800C41E: movs r1, 0x1 bl sub_800D30C b @0800C43A @0800C426: mov r0, sp ldrb r0, [r0] bl sub_800D334 movs r1, 0x1 mov r8, r1 movs r0, 0x30 movs r1, 0x2 bl sub_800D30C @0800C43A: bl sub_800D610 @0800C43E: ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x1 bne @0800C518 ldrb r0, [r7] cmp r0, 0 beq @0800C49C movs r2, 0 ldr r6, =0x03004140 movs r3, 0x1 adds r4, r6, 0 adds r4, 0x34 adds r6, 0x30 adds r5, r7, 0 @0800C45C: ldrb r0, [r6] asrs r0, r2 ands r0, r3 cmp r0, 0 beq @0800C478 ldrb r0, [r5] asrs r0, r2 ands r0, r3 cmp r0, 0 beq @0800C478 lsls r0, r2, 1 adds r0, r4 movs r1, 0 strh r1, [r0] @0800C478: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @0800C45C ldr r3, =0x03004140 adds r2, r3, 0 adds r2, 0x30 ldrb r1, [r7] ldrb r0, [r2] bics r0, r1 strb r0, [r2] ldrb r0, [r7] strh r0, [r3, 0x14] movs r0, 0x32 movs r1, 0x1 bl sub_800D30C @0800C49C: ldr r0, =0x03004140 adds r3, r0, 0 adds r3, 0x30 ldrb r1, [r3] adds r6, r0, 0 cmp r1, 0 beq @0800C514 movs r4, 0 movs r2, 0 movs r5, 0x1 @0800C4B0: ldrb r0, [r3] asrs r0, r2 ands r0, r5 cmp r0, 0 beq @0800C4E2 lsls r1, r2, 1 adds r0, r6, 0 adds r0, 0x34 adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @0800C4E2 subs r0, 0x1 strh r0, [r1] lsls r0, 16 cmp r0, 0 bne @0800C4E2 adds r0, r5, 0 lsls r0, r2 ldrb r1, [r3] bics r1, r0 strb r1, [r3] orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0800C4E2: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @0800C4B0 cmp r4, 0 beq @0800C506 adds r0, r4, 0 bl sub_800D334 movs r6, 0x1 mov r8, r6 ldr r0, =0x03004140 strh r4, [r0, 0x14] movs r0, 0x33 movs r1, 0x1 bl sub_800D30C @0800C506: ldr r0, =0x03004140 adds r1, r0, 0 adds r1, 0x30 ldrb r1, [r1] adds r6, r0, 0 cmp r1, 0 bne @0800C518 @0800C514: movs r0, 0 strb r0, [r6, 0xA] @0800C518: mov r0, r8 add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800C36C thumb_func_start rfu_syncVBlank_ rfu_syncVBlank_: ; 800C530 push {lr} bl rfu_syncVBlank lsls r0, 16 cmp r0, 0 beq @0800C548 movs r0, 0xF1 movs r1, 0 bl sub_800D30C bl sub_800D610 @0800C548: pop {r0} bx r0 thumb_func_end rfu_syncVBlank_ thumb_func_start sub_800C54C sub_800C54C: ; 800C54C push {r4,lr} adds r3, r0, 0 ldr r1, =0x03004140 ldr r2, [r1, 0x40] cmp r2, 0 bne @0800C568 ldrb r0, [r1, 0x4] cmp r0, 0 beq @0800C568 strb r2, [r1, 0x4] b @0800C736 .align 2, 0 .pool @0800C568: ldr r0, =0x03004140 ldrb r0, [r0, 0x7] cmp r0, 0 beq @0800C576 adds r0, r3, 0 bl sub_800C744 @0800C576: ldr r4, =0x03004140 ldrb r0, [r4, 0x4] cmp r0, 0 bne @0800C580 b @0800C700 @0800C580: bl rfu_waitREQComplete movs r0, 0x1 strb r0, [r4, 0xE] ldrb r0, [r4, 0x4] subs r0, 0x1 cmp r0, 0x16 bls @0800C592 b @0800C6F6 @0800C592: lsls r0, 2 ldr r1, =@0800C5A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0800C5A4: .4byte @0800C624 .4byte @0800C65C .4byte @0800C662 .4byte @0800C678 .4byte @0800C690 .4byte @0800C696 .4byte @0800C69C .4byte @0800C6F6 .4byte @0800C6A2 .4byte @0800C6A8 .4byte @0800C6AE .4byte @0800C6B4 .4byte @0800C6C4 .4byte @0800C6CA .4byte @0800C6F6 .4byte @0800C6D0 .4byte @0800C6E0 .4byte @0800C6E6 .4byte @0800C6EC .4byte @0800C6F6 .4byte @0800C6F2 .4byte @0800C6F6 .4byte @0800C600 @0800C600: bl sub_800BEC0 ldr r1, =0x00008001 movs r2, 0xFF cmp r0, r1 bne @0800C60E movs r2, 0x44 @0800C60E: ldr r1, =0x03004140 movs r0, 0 strb r0, [r1, 0x5] strb r0, [r1, 0x4] adds r0, r2, 0 b @0800C64E .align 2, 0 .pool @0800C624: bl sub_800BEC0 ldr r1, =0x00008001 cmp r0, r1 bne @0800C644 ldr r0, =0x03004140 ldrb r1, [r0, 0x5] strb r1, [r0, 0x4] movs r1, 0x3 strb r1, [r0, 0x5] b @0800C6F6 .align 2, 0 .pool @0800C644: ldr r1, =0x03004140 movs r0, 0 strb r0, [r1, 0x5] strb r0, [r1, 0x4] movs r0, 0xFF @0800C64E: movs r1, 0 bl sub_800D30C b @0800C6F6 .align 2, 0 .pool @0800C65C: bl rfu_REQ_reset b @0800C6F6 @0800C662: ldr r0, =0x03004140 ldr r2, [r0, 0x3C] ldrh r0, [r2, 0x2] ldrb r1, [r2] ldrb r2, [r2, 0x1] bl rfu_REQ_configSystem b @0800C6F6 .align 2, 0 .pool @0800C678: ldr r0, =0x03004140 ldr r3, [r0, 0x3C] ldrb r0, [r3, 0x4] ldrh r1, [r3, 0x6] ldr r2, [r3, 0x8] ldr r3, [r3, 0xC] bl rfu_REQ_configGameData b @0800C6F6 .align 2, 0 .pool @0800C690: bl rfu_REQ_startSearchChild b @0800C6F6 @0800C696: bl rfu_REQ_pollSearchChild b @0800C6F6 @0800C69C: bl rfu_REQ_endSearchChild b @0800C6F6 @0800C6A2: bl rfu_REQ_startSearchParent b @0800C6F6 @0800C6A8: bl rfu_REQ_pollSearchParent b @0800C6F6 @0800C6AE: bl rfu_REQ_endSearchParent b @0800C6F6 @0800C6B4: ldr r0, =0x03004140 ldrh r0, [r0, 0x1E] bl rfu_REQ_startConnectParent b @0800C6F6 .align 2, 0 .pool @0800C6C4: bl rfu_REQ_pollConnectParent b @0800C6F6 @0800C6CA: bl rfu_REQ_endConnectParent b @0800C6F6 @0800C6D0: ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x3] bl rfu_REQ_CHILD_startConnectRecovery b @0800C6F6 .align 2, 0 .pool @0800C6E0: bl rfu_REQ_CHILD_pollConnectRecovery b @0800C6F6 @0800C6E6: bl rfu_REQ_CHILD_endConnectRecovery b @0800C6F6 @0800C6EC: bl rfu_REQ_changeMasterSlave b @0800C6F6 @0800C6F2: bl rfu_REQ_stopMode @0800C6F6: bl rfu_waitREQComplete ldr r1, =0x03004140 movs r0, 0 strb r0, [r1, 0xE] @0800C700: ldr r0, =0x03004140 ldrb r0, [r0, 0x4] subs r0, 0x12 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @0800C710 b @0800C576 @0800C710: ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x1 bne @0800C726 movs r0, 0 bl sub_800C36C lsls r0, 24 cmp r0, 0 bne @0800C736 @0800C726: bl sub_800CF34 bl sub_800D158 bl sub_800D268 bl sub_800D434 @0800C736: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800C54C thumb_func_start sub_800C744 sub_800C744: ; 800C744 push {r4,lr} adds r3, r0, 0 ldr r0, =0x03004140 ldrb r1, [r0, 0x7] adds r4, r0, 0 cmp r1, 0x5 bne @0800C76E movs r2, 0x1 strb r2, [r4, 0x6] strb r1, [r4, 0x4] ldrh r0, [r4, 0x1C] strh r0, [r4, 0x1A] lsls r0, 16 cmp r0, 0 beq @0800C76C movs r0, 0x6 strb r0, [r4, 0x7] b @0800C76E .align 2, 0 .pool @0800C76C: strb r2, [r4, 0x7] @0800C76E: ldrb r0, [r4, 0x7] cmp r0, 0x1 bne @0800C798 strb r0, [r4, 0x6] movs r0, 0x5 strb r0, [r4, 0x4] adds r0, r3, 0 movs r1, 0x8C bl __umodsi3 strh r0, [r4, 0x1A] movs r1, 0x8C subs r1, r0 strh r1, [r4, 0x1C] lsls r0, 16 cmp r0, 0 beq @0800C794 movs r0, 0x2 b @0800C796 @0800C794: movs r0, 0x3 @0800C796: strb r0, [r4, 0x7] @0800C798: ldrb r0, [r4, 0x7] cmp r0, 0x3 bne @0800C7AE movs r0, 0 strb r0, [r4, 0x6] movs r0, 0x28 strh r0, [r4, 0x1A] movs r0, 0x4 strb r0, [r4, 0x7] movs r0, 0x9 strb r0, [r4, 0x4] @0800C7AE: pop {r4} pop {r0} bx r0 thumb_func_end sub_800C744 thumb_func_start sub_800C7B4 sub_800C7B4: ; 800C7B4 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 lsls r0, 16 lsrs r0, 16 mov r8, r0 lsls r1, 16 lsrs r6, r1, 16 ldr r0, =0x03004140 ldrb r1, [r0, 0xE] adds r7, r0, 0 cmp r1, 0 bne @0800C7D2 b @0800CC98 @0800C7D2: movs r0, 0 strb r0, [r7, 0xE] mov r0, r8 subs r0, 0x10 cmp r0, 0x2D bls @0800C7E0 b @0800CC8A @0800C7E0: lsls r0, 2 ldr r1, =@0800C7F4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0800C7F4: .4byte @0800C8AC .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800C8D8 .4byte @0800C8C4 .4byte @0800CC8A .4byte @0800C8EC .4byte @0800C8FC .4byte @0800C920 .4byte @0800C940 .4byte @0800C960 .4byte @0800C9D0 .4byte @0800CA02 .4byte @0800CA18 .4byte @0800CA60 .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CBD8 .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CAD0 .4byte @0800CB1C .4byte @0800CB64 .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC8A .4byte @0800CC78 @0800C8AC: cmp r6, 0 beq @0800C8B2 b @0800CC8A @0800C8B2: ldr r0, =0x03004140 ldrb r1, [r0, 0x5] strb r1, [r0, 0x4] movs r1, 0x4 strb r1, [r0, 0x5] b @0800CC8A .align 2, 0 .pool @0800C8C4: cmp r6, 0 beq @0800C8CA b @0800CC8A @0800C8CA: ldr r0, =0x03004140 ldrb r1, [r0, 0x5] strb r1, [r0, 0x4] strb r6, [r0, 0x5] b @0800CC8A .align 2, 0 .pool @0800C8D8: cmp r6, 0 beq @0800C8DE b @0800CC8A @0800C8DE: ldr r0, =0x03004140 strb r6, [r0, 0x5] strb r6, [r0, 0x4] movs r0, 0 b @0800CBF6 .align 2, 0 .pool @0800C8EC: cmp r6, 0 beq @0800C8F2 b @0800CC8A @0800C8F2: ldr r1, =0x03004140 movs r0, 0x6 b @0800CA0C .align 2, 0 .pool @0800C8FC: ldr r1, =0x03004140 ldrh r0, [r1, 0x1A] cmp r0, 0 bne @0800C906 b @0800CC8A @0800C906: subs r0, 0x1 strh r0, [r1, 0x1A] lsls r0, 16 cmp r0, 0 beq @0800C912 b @0800CC8A @0800C912: movs r0, 0x7 strb r0, [r1, 0x4] movs r0, 0x8 strb r0, [r1, 0x5] b @0800CC8A .align 2, 0 .pool @0800C920: cmp r6, 0 beq @0800C926 b @0800CC8A @0800C926: ldr r0, =0x03004140 ldrb r1, [r0, 0x5] strb r1, [r0, 0x4] strb r6, [r0, 0x5] ldrb r0, [r0, 0x7] cmp r0, 0 beq @0800C936 b @0800CC8A @0800C936: movs r0, 0x13 b @0800CBF6 .align 2, 0 .pool @0800C940: cmp r6, 0 beq @0800C946 b @0800CC8A @0800C946: ldrb r0, [r7, 0xB] cmp r0, 0x1 bne @0800C956 ldrh r0, [r7, 0x1A] cmp r0, 0x1 bls @0800C956 subs r0, 0x1 strh r0, [r7, 0x1A] @0800C956: ldr r1, =0x03004140 movs r0, 0xA b @0800CA0C .align 2, 0 .pool @0800C960: cmp r6, 0 bne @0800C9A6 bl sub_800D294 lsls r0, 24 lsrs r0, 24 mov r1, sp strb r0, [r1] ldr r4, =0x03004140 strh r0, [r4, 0x14] cmp r0, 0 beq @0800C980 movs r0, 0x20 movs r1, 0x1 bl sub_800D30C @0800C980: ldrb r0, [r4, 0xB] cmp r0, 0 beq @0800C9A6 ldrh r0, [r4, 0x1A] cmp r0, 0x1 beq @0800C9A6 ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0x4 bne @0800C9A6 bl rfu_REQ_endSearchParent bl rfu_waitREQComplete movs r0, 0x9 strb r0, [r4, 0x4] movs r0, 0x1 strb r0, [r4, 0xB] @0800C9A6: ldr r1, =0x03004140 ldrh r0, [r1, 0x1A] cmp r0, 0 bne @0800C9B0 b @0800CC8A @0800C9B0: subs r0, 0x1 strh r0, [r1, 0x1A] lsls r0, 16 cmp r0, 0 beq @0800C9BC b @0800CC8A @0800C9BC: movs r0, 0xB strb r0, [r1, 0x4] movs r0, 0 strb r0, [r1, 0x5] b @0800CC8A .align 2, 0 .pool @0800C9D0: cmp r6, 0 beq @0800C9D6 b @0800CC8A @0800C9D6: ldr r2, =0x03004140 ldrb r0, [r2, 0x5] strb r0, [r2, 0x4] ldrb r1, [r2, 0x7] cmp r1, 0 bne @0800C9F4 lsls r0, 24 cmp r0, 0 beq @0800C9EA b @0800CC8A @0800C9EA: movs r0, 0x21 b @0800CBF6 .align 2, 0 .pool @0800C9F4: cmp r1, 0x7 bne @0800C9FA b @0800CC8A @0800C9FA: movs r0, 0x5 strb r0, [r2, 0x4] strb r0, [r2, 0x7] b @0800CC8A @0800CA02: cmp r6, 0 beq @0800CA08 b @0800CC8A @0800CA08: ldr r1, =0x03004140 movs r0, 0xD @0800CA0C: strb r0, [r1, 0x5] strb r0, [r1, 0x4] b @0800CC8A .align 2, 0 .pool @0800CA18: cmp r6, 0 bne @0800CA3C ldr r4, =0x03004150 mov r0, sp adds r1, r4, 0 bl rfu_getConnectParentStatus lsls r0, 16 cmp r0, 0 bne @0800CA3C mov r0, sp ldrb r0, [r0] cmp r0, 0 bne @0800CA3C adds r1, r4, 0 subs r1, 0x10 movs r0, 0xE strb r0, [r1, 0x4] @0800CA3C: ldr r1, =0x03004140 ldrh r0, [r1, 0x1A] cmp r0, 0 bne @0800CA46 b @0800CC8A @0800CA46: subs r0, 0x1 strh r0, [r1, 0x1A] lsls r0, 16 cmp r0, 0 beq @0800CA52 b @0800CC8A @0800CA52: movs r0, 0xE strb r0, [r1, 0x4] b @0800CC8A .align 2, 0 .pool @0800CA60: cmp r6, 0 beq @0800CA66 b @0800CC8A @0800CA66: ldr r4, =0x03004150 mov r0, sp adds r1, r4, 0 bl rfu_getConnectParentStatus lsls r0, 16 cmp r0, 0 beq @0800CA78 b @0800CC8A @0800CA78: mov r0, sp ldrb r0, [r0] cmp r0, 0 bne @0800CA9C adds r1, r4, 0 subs r1, 0x10 movs r0, 0x13 strb r0, [r1, 0x4] movs r0, 0xF strb r0, [r1, 0x5] movs r0, 0x22 strh r0, [r1, 0x1E] ldrb r0, [r1, 0x10] strh r0, [r1, 0x14] b @0800CABC .align 2, 0 .pool @0800CA9C: adds r1, r4, 0 subs r1, 0x10 strb r6, [r1, 0x5] strb r6, [r1, 0x4] movs r0, 0x23 strh r0, [r1, 0x1E] mov r0, sp ldrb r0, [r0] strh r0, [r1, 0x14] ldrb r0, [r1, 0x7] cmp r0, 0 beq @0800CABC movs r0, 0x3 strb r0, [r1, 0x7] movs r0, 0x9 strb r0, [r1, 0x4] @0800CABC: ldr r4, =0x03004140 ldrb r0, [r4, 0x1E] movs r1, 0x1 bl sub_800D30C movs r0, 0 strh r0, [r4, 0x1E] b @0800CC8A .align 2, 0 .pool @0800CAD0: cmp r6, 0 beq @0800CAD6 b @0800CC8A @0800CAD6: ldr r2, =0x03007890 ldr r3, [r2] ldrb r0, [r3, 0x3] movs r1, 0 strh r0, [r7, 0x14] movs r0, 0x11 strb r0, [r7, 0x5] strb r0, [r7, 0x4] strb r1, [r7, 0x10] ldrb r0, [r3, 0x3] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0800CAF4 b @0800CC8A @0800CAF4: adds r1, r7, 0 movs r3, 0x1 @0800CAF8: ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bls @0800CB08 b @0800CC8A @0800CB08: ldr r0, [r2] ldrb r0, [r0, 0x3] ldrb r4, [r7, 0x10] asrs r0, r4 ands r0, r3 cmp r0, 0 beq @0800CAF8 b @0800CC8A .align 2, 0 .pool @0800CB1C: cmp r6, 0 bne @0800CB3A mov r0, sp bl rfu_CHILD_getConnectRecoveryStatus lsls r0, 16 cmp r0, 0 bne @0800CB3A mov r0, sp ldrb r0, [r0] cmp r0, 0x1 bhi @0800CB3A ldr r1, =0x03004140 movs r0, 0x12 strb r0, [r1, 0x4] @0800CB3A: ldr r2, =0x03004140 ldrb r0, [r2, 0x10] lsls r0, 1 adds r1, r2, 0 adds r1, 0x34 adds r1, r0, r1 ldrh r0, [r1] cmp r0, 0 bne @0800CB4E b @0800CC8A @0800CB4E: subs r0, 0x1 strh r0, [r1] lsls r0, 16 cmp r0, 0 beq @0800CB5A b @0800CC8A @0800CB5A: movs r0, 0x12 strb r0, [r2, 0x4] b @0800CC8A .align 2, 0 .pool @0800CB64: cmp r6, 0 beq @0800CB6A b @0800CC8A @0800CB6A: mov r0, sp bl rfu_CHILD_getConnectRecoveryStatus lsls r0, 16 cmp r0, 0 beq @0800CB78 b @0800CC8A @0800CB78: mov r0, sp ldrb r0, [r0] cmp r0, 0 bne @0800CB94 ldr r1, =0x03004140 movs r0, 0x13 strb r0, [r1, 0x4] movs r0, 0x16 strb r0, [r1, 0x5] movs r0, 0x32 strh r0, [r1, 0x1E] b @0800CBA8 .align 2, 0 .pool @0800CB94: ldr r4, =0x03004140 strb r6, [r4, 0x5] strb r6, [r4, 0x4] ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x3] bl sub_800D334 movs r0, 0x33 strh r0, [r4, 0x1E] @0800CBA8: ldr r5, =0x03004140 ldrb r0, [r5, 0x10] lsls r0, 1 adds r1, r5, 0 adds r1, 0x34 adds r0, r1 movs r1, 0 movs r4, 0 strh r4, [r0] adds r0, r5, 0 adds r0, 0x30 strb r1, [r0] strb r1, [r5, 0xA] ldrb r0, [r5, 0x1E] movs r1, 0x1 bl sub_800D30C strh r4, [r5, 0x1E] b @0800CC8A .align 2, 0 .pool @0800CBD8: cmp r6, 0 bne @0800CC8A ldr r5, =0x03004140 ldrb r1, [r5, 0x5] adds r0, r1, 0 cmp r0, 0x16 bne @0800CC04 ldrb r0, [r5, 0x11] strb r0, [r5, 0x4] ldrb r0, [r5, 0x12] strb r0, [r5, 0x5] ldrb r0, [r5, 0x2] movs r0, 0x1 strb r0, [r5, 0x2] movs r0, 0x41 @0800CBF6: movs r1, 0 bl sub_800D30C b @0800CC8A .align 2, 0 .pool @0800CC04: cmp r0, 0xF bne @0800CC8A strb r1, [r5, 0x4] ldrb r0, [r5, 0x2] movs r4, 0x1 strb r4, [r5, 0x2] movs r0, 0x41 movs r1, 0 bl sub_800D30C adds r1, r5, 0 adds r1, 0x24 ldrb r0, [r5, 0x10] lsls r4, r0 ldrb r0, [r1] orrs r4, r0 strb r4, [r1] ldrb r0, [r5, 0x10] lsls r0, 1 adds r1, 0x4 adds r0, r1 ldrh r1, [r5, 0x26] movs r7, 0 strh r1, [r0] ldrb r1, [r5, 0x10] movs r0, 0x4 bl rfu_clearSlot mov r4, sp ldrb r0, [r5, 0x10] movs r1, 0xE bl rfu_NI_CHILD_setSendGameName strb r0, [r4] lsls r0, 24 cmp r0, 0 beq @0800CC8A strb r7, [r5, 0x5] strb r7, [r5, 0x4] bl sub_800D610 ldr r0, =0x03007890 ldr r0, [r0] ldrb r1, [r0, 0x2] ldrb r0, [r0, 0x3] orrs r0, r1 bl sub_800D334 mov r0, sp ldrb r0, [r0] strh r0, [r5, 0x14] movs r0, 0x25 movs r1, 0x1 bl sub_800D30C b @0800CC8A .align 2, 0 .pool @0800CC78: cmp r6, 0 bne @0800CC8A ldr r0, =0x03004140 strb r6, [r0, 0x5] strb r6, [r0, 0x4] movs r0, 0x42 movs r1, 0 bl sub_800D30C @0800CC8A: ldr r1, =0x03004140 movs r0, 0x1 strb r0, [r1, 0xE] b @0800CCE6 .align 2, 0 .pool @0800CC98: cmp r6, 0x3 bne @0800CCE6 ldrb r0, [r7, 0xF] cmp r0, 0 beq @0800CCE6 mov r3, r8 cmp r3, 0x24 beq @0800CCB0 cmp r3, 0x26 beq @0800CCB0 cmp r3, 0x27 bne @0800CCE6 @0800CCB0: bl rfu_REQ_RFUStatus bl rfu_waitREQComplete mov r0, sp bl rfu_getRFUStatus mov r0, sp ldrb r0, [r0] cmp r0, 0 bne @0800CCE6 ldr r4, =0x03007890 ldr r0, [r4] ldrb r0, [r0] cmp r0, 0 bne @0800CCE6 bl rfu_getSTWIRecvBuffer ldr r1, [r4] ldrb r1, [r1, 0x2] strb r1, [r0, 0x4] movs r1, 0x1 strb r1, [r0, 0x5] movs r0, 0x29 bl sub_800C36C movs r6, 0 @0800CCE6: mov r4, r8 cmp r4, 0x26 bne @0800CCEE b @0800CE02 @0800CCEE: cmp r4, 0x26 bgt @0800CD00 cmp r4, 0x10 bne @0800CCF8 b @0800CE20 @0800CCF8: b @0800CE3E .align 2, 0 .pool @0800CD00: mov r0, r8 cmp r0, 0x30 beq @0800CD0E cmp r0, 0x3D bne @0800CD0C b @0800CE20 @0800CD0C: b @0800CE3E @0800CD0E: cmp r6, 0 beq @0800CD14 b @0800CE42 @0800CD14: bl rfu_getSTWIRecvBuffer ldr r4, =0x03004140 ldrb r0, [r0, 0x8] strh r0, [r4, 0x14] bl sub_800D358 adds r2, r4, 0 adds r2, 0x30 ldrb r1, [r2] cmp r1, 0 beq @0800CD6A ldrb r0, [r4, 0x14] adds r3, r1, 0 bics r3, r0 adds r0, r3, 0 strb r0, [r2] movs r3, 0 adds r7, r4, 0 adds r1, r7, 0 movs r5, 0x1 adds r4, r1, 0 adds r4, 0x34 movs r2, 0 @0800CD44: ldrh r0, [r1, 0x14] asrs r0, r3 ands r0, r5 cmp r0, 0 beq @0800CD54 lsls r0, r3, 1 adds r0, r4 strh r2, [r0] @0800CD54: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bls @0800CD44 ldr r1, =0x03004140 ldrb r0, [r1, 0x6] cmp r0, 0 bne @0800CD6A strb r0, [r1, 0x5] strb r0, [r1, 0x4] @0800CD6A: mov r3, sp ldr r1, =0x03004140 ldrb r2, [r1] ldrb r0, [r1, 0x14] ands r0, r2 strb r0, [r3] movs r3, 0 adds r7, r1, 0 ldr r2, =0x03007890 mov r1, sp movs r5, 0x1 adds r4, r7, 0 @0800CD82: ldrb r0, [r1] asrs r0, r3 ands r0, r5 cmp r0, 0 beq @0800CD96 ldrb r0, [r4, 0x1] cmp r0, 0 beq @0800CD96 subs r0, 0x1 strb r0, [r7, 0x1] @0800CD96: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bls @0800CD82 ldrb r1, [r7, 0x14] ldrb r0, [r7] bics r0, r1 strb r0, [r7] ldrb r1, [r7, 0x7] cmp r1, 0 beq @0800CDE0 ldr r0, [r2] ldrb r0, [r0] cmp r0, 0xFF bne @0800CDF2 cmp r1, 0x8 bne @0800CDCC ldrh r0, [r7, 0x1C] strh r0, [r7, 0x1A] movs r0, 0x6 strb r0, [r7, 0x7] b @0800CDDE .align 2, 0 .pool @0800CDCC: ldrb r0, [r7, 0x4] subs r0, 0x6 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @0800CDE0 movs r0, 0x1 strb r0, [r7, 0x7] movs r0, 0x5 @0800CDDE: strb r0, [r7, 0x4] @0800CDE0: ldr r0, [r2] ldrb r0, [r0] cmp r0, 0xFF bne @0800CDF2 ldrb r0, [r7, 0x4] cmp r0, 0 bne @0800CDF2 movs r0, 0xFF strb r0, [r7, 0x6] @0800CDF2: ldrb r0, [r7, 0xE] cmp r0, 0 bne @0800CE3E movs r0, 0x40 movs r1, 0x1 bl sub_800D30C b @0800CE3E @0800CE02: bl sub_800D20C ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0xFF beq @0800CE3E movs r0, 0x50 movs r1, 0 bl sub_800D30C b @0800CE3E .align 2, 0 .pool @0800CE20: cmp r6, 0 bne @0800CE42 ldr r0, =0x03004140 strb r6, [r0, 0xD] strb r6, [r0, 0x1] strb r6, [r0] movs r1, 0xFF strb r1, [r0, 0x6] bl sub_800D610 mov r4, r8 cmp r4, 0x3D bne @0800CE3E bl sub_800BFA0 @0800CE3E: cmp r6, 0 beq @0800CE92 @0800CE42: ldr r7, =0x03004140 mov r0, r8 cmp r0, 0x1C bne @0800CE74 cmp r6, 0 beq @0800CE74 ldrb r0, [r7, 0x7] cmp r0, 0x4 bne @0800CE74 ldr r2, =0x03007890 ldr r1, [r2] movs r0, 0x1 strb r0, [r1] ldr r1, [r2] movs r0, 0xF strb r0, [r1, 0x2] bl sub_800D334 bl rfu_waitREQComplete b @0800CEA4 .align 2, 0 .pool @0800CE74: movs r1, 0 mov r3, r8 strh r3, [r7, 0x14] strh r6, [r7, 0x16] ldrb r0, [r7, 0xE] cmp r0, 0 beq @0800CE86 strb r1, [r7, 0x5] strb r1, [r7, 0x4] @0800CE86: movs r0, 0xF0 movs r1, 0x2 bl sub_800D30C bl sub_800D610 @0800CE92: mov r4, r8 cmp r4, 0xFF bne @0800CEA4 movs r0, 0xF2 movs r1, 0 bl sub_800D30C bl sub_800D610 @0800CEA4: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_800C7B4 thumb_func_start sub_800CEB0 sub_800CEB0: ; 800CEB0 push {r4-r7,lr} sub sp, 0x4 lsls r0, 16 lsrs r6, r0, 16 ldr r4, =0x03004140 ldrb r7, [r4, 0xE] movs r0, 0 strb r0, [r4, 0xE] movs r0, 0x1 strb r0, [r4, 0xF] ldr r0, =0x03007890 ldr r0, [r0] ldrb r5, [r0] cmp r5, 0 bne @0800CEEC adds r0, r6, 0 bl sub_800C36C ldrb r0, [r4, 0x2] cmp r0, 0x1 beq @0800CF04 bl sub_800D610 strb r5, [r4, 0xF] strb r7, [r4, 0xE] b @0800CF28 .align 2, 0 .pool @0800CEEC: mov r0, sp bl rfu_UNI_PARENT_getDRAC_ACK lsls r0, 16 cmp r0, 0 bne @0800CF04 mov r1, sp ldrb r0, [r4, 0x3] ldrb r1, [r1] orrs r0, r1 ldrb r1, [r4, 0x3] strb r0, [r4, 0x3] @0800CF04: ldr r4, =0x03004140 ldr r1, [r4, 0x44] cmp r1, 0 beq @0800CF20 adds r0, r6, 0 bl _call_via_r1 bl rfu_waitREQComplete ldrb r0, [r4, 0x2] cmp r0, 0x2 bne @0800CF20 bl sub_800D610 @0800CF20: ldr r1, =0x03004140 movs r0, 0 strb r0, [r1, 0xF] strb r7, [r1, 0xE] @0800CF28: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800CEB0 thumb_func_start sub_800CF34 sub_800CF34: ; 800CF34 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 ldr r1, =0x03004140 ldrb r0, [r1, 0x4] subs r0, 0x5 lsls r0, 24 lsrs r0, 24 adds r3, r1, 0 cmp r0, 0x3 bls @0800CF52 b @0800D146 @0800CF52: ldr r0, =0x03007890 ldr r2, [r0] ldrb r1, [r2, 0x2] ldrb r0, [r3, 0xC] adds r4, r1, 0 eors r4, r0 ands r4, r1 ldrb r0, [r2, 0x7] bics r4, r0 mov r8, r4 strb r1, [r3, 0xC] cmp r4, 0 beq @0800CF7A strh r4, [r3, 0x14] movs r0, 0x10 movs r1, 0x1 str r3, [sp, 0x4] bl sub_800D30C ldr r3, [sp, 0x4] @0800CF7A: movs r0, 0 str r0, [sp] movs r6, 0 adds r7, r3, 0 movs r1, 0x24 adds r1, r3 mov r9, r1 @0800CF88: movs r0, 0x80 lsls r0, 17 lsls r0, r6 lsrs r4, r0, 24 movs r5, 0 mov r0, r8 ands r0, r4 cmp r0, 0 beq @0800CFDA lsls r1, r6, 1 adds r0, r7, 0 adds r0, 0x28 adds r1, r0 ldrh r0, [r7, 0x26] strh r0, [r1] mov r2, r9 ldrb r1, [r2] adds r0, r4, 0 orrs r0, r1 strb r0, [r2] adds r6, 0x1 mov r10, r6 b @0800D090 .align 2, 0 .pool @0800CFC0: ldrb r1, [r7] adds r0, r4, 0 orrs r0, r1 strb r0, [r7] ldrb r0, [r7, 0x1] adds r0, 0x1 strb r0, [r7, 0x1] ldr r0, [sp] orrs r0, r4 str r0, [sp] movs r0, 0x1 orrs r5, r0 b @0800D024 @0800CFDA: mov r1, r9 ldrb r0, [r1] ands r0, r4 adds r2, r6, 0x1 mov r10, r2 cmp r0, 0 beq @0800D090 ldr r0, =0x03007880 lsls r1, r6, 2 adds r1, r0 ldr r1, [r1] ldrh r0, [r1, 0x34] cmp r0, 0x46 bne @0800D040 adds r0, r1, 0 adds r0, 0x61 ldrb r0, [r0] cmp r0, 0x1 bne @0800D058 movs r5, 0x2 ldr r3, [r3, 0x20] ldrh r2, [r3] ldr r0, =0x0000ffff cmp r2, r0 beq @0800D024 ldr r0, =0x03007890 ldr r0, [r0] lsls r1, r6, 5 adds r0, r1 ldrh r0, [r0, 0x18] ldr r1, =0x0000ffff @0800D018: cmp r0, r2 beq @0800CFC0 adds r3, 0x2 ldrh r2, [r3] cmp r2, r1 bne @0800D018 @0800D024: movs r0, 0x1 ands r0, r5 cmp r0, 0 bne @0800D058 movs r0, 0x4 orrs r5, r0 b @0800D058 .align 2, 0 .pool @0800D040: lsls r1, r6, 1 adds r0, r3, 0 adds r0, 0x28 adds r1, r0 ldrh r0, [r1] subs r0, 0x1 strh r0, [r1] ldr r1, =0x0000ffff ands r0, r1 cmp r0, 0 bne @0800D058 movs r5, 0x6 @0800D058: movs r0, 0x2 ands r0, r5 cmp r0, 0 beq @0800D07E mov r2, r9 ldrb r0, [r2] bics r0, r4 movs r2, 0 mov r1, r9 strb r0, [r1] lsls r0, r6, 1 adds r1, r7, 0 adds r1, 0x28 adds r0, r1 strh r2, [r0] movs r0, 0x8 adds r1, r6, 0 bl rfu_clearSlot @0800D07E: movs r0, 0x4 ands r5, r0 ldr r3, =0x03004140 cmp r5, 0 beq @0800D090 ldrb r1, [r7, 0xD] adds r0, r4, 0 orrs r0, r1 strb r0, [r7, 0xD] @0800D090: mov r2, r10 lsls r0, r2, 24 lsrs r6, r0, 24 cmp r6, 0x3 bhi @0800D09C b @0800CF88 @0800D09C: ldr r4, [sp] cmp r4, 0 beq @0800D0AE ldr r0, =0x03004140 strh r4, [r0, 0x14] movs r0, 0x11 movs r1, 0x1 bl sub_800D30C @0800D0AE: ldr r1, =0x03004140 ldrb r0, [r1, 0xD] cmp r0, 0 beq @0800D0EA movs r5, 0x1 ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x6] cmp r0, 0 beq @0800D0CE ldrb r0, [r1, 0x3] ldrb r1, [r1] ands r0, r1 cmp r0, r1 beq @0800D0CE movs r5, 0 @0800D0CE: cmp r5, 0 beq @0800D0EA ldr r4, =0x03004140 ldrb r0, [r4, 0xD] bl sub_800D334 ldrb r0, [r4, 0xD] movs r1, 0 strh r0, [r4, 0x14] strb r1, [r4, 0xD] movs r0, 0x12 movs r1, 0x1 bl sub_800D30C @0800D0EA: ldr r0, =0x03004140 adds r1, r0, 0 adds r1, 0x24 ldrb r1, [r1] adds r3, r0, 0 cmp r1, 0 bne @0800D146 ldrb r0, [r3, 0x4] cmp r0, 0x8 bne @0800D146 ldrb r0, [r3, 0x7] cmp r0, 0 bne @0800D120 strb r0, [r3, 0x5] strb r0, [r3, 0x4] movs r0, 0x14 movs r1, 0 bl sub_800D30C b @0800D146 .align 2, 0 .pool @0800D120: cmp r0, 0x2 bne @0800D12C movs r0, 0x3 strb r0, [r3, 0x7] movs r0, 0x9 b @0800D132 @0800D12C: movs r0, 0x1 strb r0, [r3, 0x7] movs r0, 0x5 @0800D132: strb r0, [r3, 0x4] ldrb r0, [r3] cmp r0, 0 beq @0800D146 movs r0, 0 strh r0, [r3, 0x1A] movs r0, 0x8 strb r0, [r3, 0x7] movs r0, 0x5 strb r0, [r3, 0x4] @0800D146: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_800CF34 thumb_func_start sub_800D158 sub_800D158: ; 800D158 push {r4-r6,lr} ldr r1, =0x04000208 ldrh r0, [r1] adds r6, r0, 0 movs r0, 0 strh r0, [r1] ldr r4, =0x03004140 ldrb r0, [r4, 0x4] cmp r0, 0xF bne @0800D1BC ldrb r1, [r4, 0x10] lsls r1, 1 adds r5, r4, 0 adds r5, 0x28 adds r1, r5 ldrh r0, [r1] subs r0, 0x1 strh r0, [r1] lsls r0, 16 cmp r0, 0 beq @0800D192 ldr r1, =0x03007880 ldrb r0, [r4, 0x10] lsls r0, 2 adds r0, r1 ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x27 bne @0800D1BC @0800D192: bl sub_800D630 movs r0, 0x18 strb r0, [r4, 0x4] ldrb r1, [r4, 0x10] movs r0, 0x4 bl rfu_clearSlot adds r2, r4, 0 adds r2, 0x24 movs r1, 0x1 ldrb r0, [r4, 0x10] lsls r1, r0 ldrb r0, [r2] bics r0, r1 strb r0, [r2] ldrb r0, [r4, 0x10] lsls r0, 1 adds r0, r5 movs r1, 0 strh r1, [r0] @0800D1BC: ldr r0, =0x04000208 strh r6, [r0] ldr r5, =0x03004140 ldrb r0, [r5, 0x4] cmp r0, 0x18 bne @0800D1F6 ldrb r0, [r5, 0x2] cmp r0, 0x1 bne @0800D1D2 bl sub_800D630 @0800D1D2: ldrb r0, [r5, 0x2] adds r4, r0, 0 cmp r4, 0 bne @0800D1F6 strb r4, [r5, 0x5] strb r4, [r5, 0x4] ldr r0, =0x03007890 ldr r0, [r0] ldrb r1, [r0, 0x2] ldrb r0, [r0, 0x3] orrs r0, r1 bl sub_800D334 strh r4, [r5, 0x14] movs r0, 0x25 movs r1, 0x1 bl sub_800D30C @0800D1F6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D158 thumb_func_start sub_800D20C sub_800D20C: ; 800D20C push {r4,r5,lr} ldr r5, =0x03004140 ldrb r0, [r5, 0x4] cmp r0, 0xF bne @0800D258 ldr r1, =0x03007880 ldrb r2, [r5, 0x10] lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x26 bne @0800D258 movs r4, 0 strb r4, [r5, 0x5] strb r4, [r5, 0x4] movs r0, 0x4 adds r1, r2, 0 bl rfu_clearSlot adds r2, r5, 0 adds r2, 0x24 movs r1, 0x1 ldrb r0, [r5, 0x10] lsls r1, r0 ldrb r0, [r2] bics r0, r1 strb r0, [r2] ldrb r0, [r5, 0x10] lsls r0, 1 adds r1, r5, 0 adds r1, 0x28 adds r0, r1 strh r4, [r0] movs r0, 0x24 movs r1, 0 bl sub_800D30C @0800D258: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D20C thumb_func_start sub_800D268 sub_800D268: ; 800D268 push {lr} ldr r1, =0x03004140 ldrb r0, [r1, 0x6] cmp r0, 0 bne @0800D28C ldrb r0, [r1, 0xA] cmp r0, 0x1 bne @0800D28C ldrb r0, [r1, 0x4] strb r0, [r1, 0x11] ldrb r0, [r1, 0x5] strb r0, [r1, 0x12] movs r0, 0x10 strb r0, [r1, 0x4] movs r0, 0x11 strb r0, [r1, 0x5] movs r0, 0x2 strb r0, [r1, 0xA] @0800D28C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D268 thumb_func_start sub_800D294 sub_800D294: ; 800D294 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r6, 0 movs r5, 0 ldr r1, =0x03007890 ldr r0, [r1] ldrb r0, [r0, 0x8] cmp r6, r0 bcs @0800D2F0 mov r8, r0 ldr r0, =0x03004140 mov r10, r0 mov r9, r1 @0800D2B4: mov r1, r10 ldr r3, [r1, 0x20] ldrh r2, [r3] adds r0, r5, 0x1 mov r12, r0 ldr r1, =0x0000ffff cmp r2, r1 beq @0800D2E6 mov r1, r9 ldr r0, [r1] lsls r1, r5, 5 adds r0, r1 ldrh r4, [r0, 0x18] ldr r7, =0x0000ffff movs r1, 0x1 lsls r1, r5 @0800D2D4: cmp r4, r2 bne @0800D2DE orrs r6, r1 lsls r0, r6, 24 lsrs r6, r0, 24 @0800D2DE: adds r3, 0x2 ldrh r2, [r3] cmp r2, r7 bne @0800D2D4 @0800D2E6: mov r1, r12 lsls r0, r1, 24 lsrs r5, r0, 24 cmp r5, r8 bcc @0800D2B4 @0800D2F0: adds r0, r6, 0 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800D294 thumb_func_start sub_800D30C sub_800D30C: ; 800D30C push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 ldr r4, =0x03004140 ldr r2, [r4, 0x40] cmp r2, 0 beq @0800D322 bl _call_via_r2 @0800D322: movs r0, 0 strh r0, [r4, 0x16] strh r0, [r4, 0x14] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D30C thumb_func_start sub_800D334 sub_800D334: ; 800D334 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r4, =0x03004140 ldrb r5, [r4, 0xE] movs r1, 0x1 strb r1, [r4, 0xE] bl rfu_REQ_disconnect bl rfu_waitREQComplete strb r5, [r4, 0xE] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D334 thumb_func_start sub_800D358 sub_800D358: ; 800D358 push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r0, 0 beq @0800D3A0 movs r4, 0 @0800D36A: ldr r1, =0x03007880 lsls r0, r4, 2 adds r0, r1 ldr r2, [r0] ldrh r0, [r2] movs r3, 0x80 lsls r3, 8 adds r1, r3, 0 ands r0, r1 cmp r0, 0 beq @0800D396 ldrb r1, [r2, 0x1A] adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @0800D396 adds r2, r1, 0 bics r2, r5 movs r0, 0x20 adds r1, r4, 0 bl rfu_changeSendTarget @0800D396: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @0800D36A @0800D3A0: ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x5] cmp r0, 0 beq @0800D3DE movs r4, 0 @0800D3AC: ldr r1, =0x03007880 lsls r0, r4, 2 adds r0, r1 ldr r2, [r0] ldrh r0, [r2, 0x34] movs r3, 0x80 lsls r3, 8 adds r1, r3, 0 ands r0, r1 cmp r0, 0 beq @0800D3D4 adds r0, r2, 0 adds r0, 0x4E ldrb r0, [r0] ands r0, r5 cmp r0, 0 beq @0800D3D4 adds r0, r4, 0 bl rfu_NI_stopReceivingData @0800D3D4: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @0800D3AC @0800D3DE: ldr r0, =0x03007890 ldr r3, [r0] ldrb r2, [r3, 0x6] cmp r2, 0 beq @0800D41C mvns r1, r5 adds r0, r1, 0 ands r0, r2 strb r0, [r3, 0x6] movs r4, 0 ldr r7, =0x03007870 ldr r6, =0x00008024 @0800D3F6: lsls r0, r4, 2 adds r0, r7 ldr r2, [r0] ldrh r0, [r2] cmp r0, r6 bne @0800D412 ldrb r3, [r2, 0x3] adds r0, r5, 0 ands r0, r3 cmp r0, 0 beq @0800D412 adds r0, r1, 0 ands r0, r3 strb r0, [r2, 0x3] @0800D412: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @0800D3F6 @0800D41C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D358 thumb_func_start sub_800D434 sub_800D434: ; 800D434 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 ldr r0, =0x03004140 ldrh r0, [r0, 0x18] cmp r0, 0 beq @0800D510 ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r0, 0 beq @0800D4D4 movs r6, 0 @0800D454: ldr r3, =0x03007880 lsls r2, r6, 2 adds r0, r2, r3 ldr r0, [r0] ldrh r1, [r0] movs r4, 0x80 lsls r4, 8 adds r0, r4, 0 ands r1, r0 adds r7, r2, 0 adds r0, r6, 0x1 mov r9, r0 cmp r1, 0 beq @0800D4CA movs r5, 0 movs r4, 0 movs r1, 0x1 mov r8, r1 mov r10, r3 @0800D47A: adds r0, r7, r3 ldr r0, [r0] ldrb r0, [r0, 0x1A] asrs r0, r4 mov r1, r8 ands r0, r1 cmp r0, 0 beq @0800D4A4 lsls r0, r4, 2 adds r0, r3 ldr r0, [r0] ldr r1, =0x03004140 ldrh r0, [r0, 0x2] ldrh r1, [r1, 0x18] cmp r0, r1 bls @0800D4A4 mov r0, r8 lsls r0, r4 orrs r5, r0 lsls r0, r5, 24 lsrs r5, r0, 24 @0800D4A4: cmp r5, 0 beq @0800D4C0 mov r1, r10 adds r0, r7, r1 ldr r0, [r0] ldrb r0, [r0, 0x1A] adds r2, r5, 0 eors r2, r0 movs r0, 0x20 adds r1, r6, 0 str r3, [sp] bl rfu_changeSendTarget ldr r3, [sp] @0800D4C0: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @0800D47A @0800D4CA: mov r3, r9 lsls r0, r3, 24 lsrs r6, r0, 24 cmp r6, 0x3 bls @0800D454 @0800D4D4: ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x5] cmp r0, 0 beq @0800D510 movs r6, 0 @0800D4E0: ldr r1, =0x03007880 lsls r0, r6, 2 adds r0, r1 ldr r2, [r0] ldrh r0, [r2, 0x34] movs r4, 0x80 lsls r4, 8 adds r1, r4, 0 ands r0, r1 cmp r0, 0 beq @0800D506 ldr r1, =0x03004140 ldrh r0, [r2, 0x36] ldrh r1, [r1, 0x18] cmp r0, r1 bls @0800D506 adds r0, r6, 0 bl rfu_NI_stopReceivingData @0800D506: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x3 bls @0800D4E0 @0800D510: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D434 thumb_func_start sub_800D52C sub_800D52C: ; 800D52C push {lr} ldr r1, =0x03004140 str r0, [r1, 0x44] ldr r0, =sub_800CEB0 bl rfu_setMSCCallback pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D52C thumb_func_start sub_800D544 sub_800D544: ; 800D544 ldr r1, =0x03004140 str r0, [r1, 0x40] bx lr .align 2, 0 .pool thumb_func_end sub_800D544 thumb_func_start sub_800D550 sub_800D550: ; 800D550 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 16 lsrs r5, r1, 16 ldr r0, =0x03004140 ldrb r1, [r0, 0x9] adds r3, r0, 0 cmp r1, 0 beq @0800D578 cmp r4, 0 bne @0800D578 adds r0, 0x30 ldrb r0, [r0] cmp r0, 0 beq @0800D578 movs r0, 0x5 b @0800D588 .align 2, 0 .pool @0800D578: ldr r2, =0x04000208 ldrh r1, [r2] movs r0, 0 strh r0, [r2] strb r4, [r3, 0x9] strh r5, [r3, 0x32] strh r1, [r2] movs r0, 0 @0800D588: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800D550 thumb_func_start sub_800D594 sub_800D594: ; 800D594 push {lr} lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x03007890 ldr r0, [r0] ldrb r1, [r0, 0x4] ldrb r0, [r0, 0x5] orrs r0, r1 cmp r0, 0 bne @0800D5B8 ldr r0, =0x03004140 strh r2, [r0, 0x18] movs r0, 0 b @0800D5C8 .align 2, 0 .pool @0800D5B8: ldr r1, =0x03004140 movs r0, 0x6 strh r0, [r1, 0x14] movs r0, 0xF3 movs r1, 0x1 bl sub_800D30C movs r0, 0x6 @0800D5C8: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800D594 thumb_func_start sub_800D5D0 sub_800D5D0: ; 800D5D0 push {lr} lsls r0, 24 lsrs r2, r0, 24 adds r3, r2, 0 ldr r1, =0x03004140 ldrb r0, [r1, 0x4] subs r0, 0x9 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bhi @0800D5FC movs r0, 0x7 strh r0, [r1, 0x14] movs r0, 0xF3 movs r1, 0x1 bl sub_800D30C movs r0, 0x7 b @0800D60A .align 2, 0 .pool @0800D5FC: cmp r2, 0 beq @0800D606 movs r0, 0x1 strb r0, [r1, 0xB] b @0800D608 @0800D606: strb r3, [r1, 0xB] @0800D608: movs r0, 0 @0800D60A: pop {r1} bx r1 thumb_func_end sub_800D5D0 thumb_func_start sub_800D610 sub_800D610: ; 800D610 push {lr} ldr r1, =0x03004140 ldrb r0, [r1, 0x2] cmp r0, 0 beq @0800D628 ldrb r0, [r1, 0x2] movs r0, 0 strb r0, [r1, 0x2] movs r0, 0x45 movs r1, 0 bl sub_800D30C @0800D628: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D610 thumb_func_start sub_800D630 sub_800D630: ; 800D630 push {lr} ldr r1, =0x03004140 ldrb r0, [r1, 0x2] cmp r0, 0 bne @0800D648 movs r0, 0x45 movs r1, 0 bl sub_800D30C b @0800D654 .align 2, 0 .pool @0800D648: ldrb r0, [r1, 0x2] cmp r0, 0x1 bne @0800D654 ldrb r0, [r1, 0x2] movs r0, 0x2 strb r0, [r1, 0x2] @0800D654: pop {r0} bx r0 thumb_func_end sub_800D630 thumb_func_start sub_800D658 sub_800D658: ; 800D658 push {lr} ldr r0, =0x03004140 ldrb r1, [r0, 0x7] adds r2, r0, 0 cmp r1, 0 beq @0800D6C2 ldrb r0, [r2, 0x4] subs r0, 0x5 cmp r0, 0x6 bhi @0800D6C2 lsls r0, 2 ldr r1, =@0800D680 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0800D680: .4byte @0800D69C .4byte @0800D6A4 .4byte @0800D6AE .4byte @0800D6AE .4byte @0800D6B4 .4byte @0800D6B4 .4byte @0800D6BA @0800D69C: movs r0, 0x3 strb r0, [r2, 0x7] movs r0, 0x9 b @0800D6C0 @0800D6A4: movs r0, 0x2 strb r0, [r2, 0x7] movs r0, 0x1 strh r0, [r2, 0x1A] b @0800D6C2 @0800D6AE: movs r0, 0x2 strb r0, [r2, 0x7] b @0800D6C2 @0800D6B4: movs r0, 0x28 strh r0, [r2, 0x1A] b @0800D6C2 @0800D6BA: movs r0, 0x28 strh r0, [r2, 0x1A] movs r0, 0xA @0800D6C0: strb r0, [r2, 0x4] @0800D6C2: pop {r0} bx r0 thumb_func_end sub_800D658 thumb_func_start sub_800D6C8 sub_800D6C8: ; 800D6C8 push {r4,r5,lr} adds r3, r0, 0 movs r0, 0 movs r4, 0 movs r5, 0x46 @0800D6D2: adds r2, r0, 0x1 movs r1, 0x45 muls r0, r5 adds r0, r3 adds r0, 0x45 @0800D6DC: strb r4, [r0] subs r0, 0x1 subs r1, 0x1 cmp r1, 0 bge @0800D6DC adds r0, r2, 0 cmp r0, 0x1F ble @0800D6D2 movs r1, 0 ldr r2, =0x000008c1 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] movs r2, 0x8C lsls r2, 4 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] ldr r2, =0x000008c2 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] ldr r2, =0x000008c3 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D6C8 thumb_func_start sub_800D724 sub_800D724: ; 800D724 push {r4,lr} adds r3, r0, 0 movs r1, 0 movs r4, 0 @0800D72C: lsls r0, r1, 3 adds r2, r1, 0x1 subs r0, r1 movs r1, 0xD lsls r0, 1 adds r0, r3 adds r0, 0xD @0800D73A: strb r4, [r0] subs r0, 0x1 subs r1, 0x1 cmp r1, 0 bge @0800D73A adds r1, r2, 0 cmp r1, 0x27 ble @0800D72C movs r1, 0 ldr r2, =0x00000231 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] movs r2, 0x8C lsls r2, 2 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] ldr r2, =0x00000232 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] ldr r2, =0x00000233 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D724 thumb_func_start sub_800D780 sub_800D780: ; 800D780 push {r4,lr} adds r3, r0, 0 movs r1, 0 movs r4, 0 @0800D788: lsls r0, r1, 8 adds r2, r1, 0x1 movs r1, 0xFF adds r0, r3 adds r0, 0xFF @0800D792: strb r4, [r0] subs r0, 0x1 subs r1, 0x1 cmp r1, 0 bge @0800D792 adds r1, r2, 0 cmp r1, 0x1 ble @0800D788 movs r1, 0 ldr r2, =0x00000201 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] movs r2, 0x80 lsls r2, 2 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] ldr r2, =0x00000202 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] ldr r2, =0x00000203 adds r0, r3, r2 ldrb r2, [r0] strb r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D780 thumb_func_start sub_800D7D8 sub_800D7D8: ; 800D7D8 push {r4-r7,lr} adds r3, r0, 0 adds r4, r1, 0 ldr r1, =0x000008c2 adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0x1F bhi @0800D874 ldr r0, =0x04000208 ldrh r1, [r0] adds r7, r1, 0 movs r1, 0 strh r1, [r0] movs r5, 0 movs r2, 0 @0800D7F6: adds r1, r4, r2 ldrb r0, [r1] cmp r0, 0 bne @0800D80A ldrb r0, [r1, 0x1] cmp r0, 0 bne @0800D80A adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @0800D80A: adds r2, 0xE cmp r2, 0x45 ble @0800D7F6 cmp r5, 0x5 beq @0800D866 movs r2, 0 movs r0, 0x8C lsls r0, 4 adds r5, r3, r0 movs r6, 0x46 @0800D81E: ldrb r0, [r5] adds r1, r0, 0 muls r1, r6 adds r1, r2, r1 adds r1, r3, r1 adds r0, r4, r2 ldrb r0, [r0] strb r0, [r1] adds r2, 0x1 cmp r2, 0x45 ble @0800D81E movs r0, 0x8C lsls r0, 4 adds r1, r3, r0 ldrb r0, [r1] adds r0, 0x1 ldrb r2, [r1] strb r0, [r1] ldrb r2, [r1] movs r0, 0x1F ands r0, r2 ldrb r2, [r1] strb r0, [r1] ldr r0, =0x000008c2 adds r1, r3, r0 ldrb r0, [r1] adds r0, 0x1 ldrb r2, [r1] strb r0, [r1] movs r1, 0 adds r0, r4, 0 adds r0, 0x45 @0800D85E: strb r1, [r0] subs r0, 0x1 cmp r0, r4 bge @0800D85E @0800D866: ldr r0, =0x04000208 strh r7, [r0] b @0800D87E .align 2, 0 .pool @0800D874: ldr r1, =0x000008c3 adds r0, r3, r1 ldrb r1, [r0] movs r1, 0x1 strb r1, [r0] @0800D87E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D7D8 thumb_func_start sub_800D888 sub_800D888: ; 800D888 push {r4-r7,lr} adds r6, r0, 0 adds r5, r1, 0 ldr r1, =0x00000232 adds r0, r6, r1 ldrb r0, [r0] cmp r0, 0x27 bhi @0800D920 ldr r1, =0x04000208 ldrh r0, [r1] adds r7, r0, 0 movs r0, 0 strh r0, [r1] movs r2, 0 ldrb r0, [r5] cmp r0, 0 bne @0800D8B8 @0800D8AA: adds r2, 0x1 cmp r2, 0xD bgt @0800D8B8 adds r0, r5, r2 ldrb r0, [r0] cmp r0, 0 beq @0800D8AA @0800D8B8: cmp r2, 0xE beq @0800D910 movs r2, 0 movs r0, 0x8C lsls r0, 2 adds r3, r6, r0 @0800D8C4: ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 1 adds r0, r2, r0 adds r0, r6, r0 adds r1, r5, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0xD ble @0800D8C4 movs r1, 0x8C lsls r1, 2 adds r4, r6, r1 ldrb r0, [r4] adds r0, 0x1 ldrb r1, [r4] strb r0, [r4] ldrb r0, [r4] movs r1, 0x28 bl __umodsi3 ldrb r1, [r4] strb r0, [r4] ldr r0, =0x00000232 adds r1, r6, r0 ldrb r0, [r1] adds r0, 0x1 ldrb r2, [r1] strb r0, [r1] movs r1, 0 adds r0, r5, 0 adds r0, 0xD @0800D908: strb r1, [r0] subs r0, 0x1 cmp r0, r5 bge @0800D908 @0800D910: ldr r0, =0x04000208 strh r7, [r0] b @0800D92A .align 2, 0 .pool @0800D920: ldr r1, =0x00000233 adds r0, r6, r1 ldrb r1, [r0] movs r1, 0x1 strb r1, [r0] @0800D92A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800D888 thumb_func_start sub_800D934 sub_800D934: ; 800D934 push {r4-r7,lr} adds r3, r0, 0 adds r4, r1, 0 ldr r1, =0x04000208 ldrh r0, [r1] mov r12, r0 movs r0, 0 strh r0, [r1] movs r1, 0x8C lsls r1, 4 adds r0, r3, r1 ldr r7, =0x000008c1 adds r5, r3, r7 ldrb r1, [r0] ldrb r0, [r5] cmp r1, r0 beq @0800D960 ldr r1, =0x000008c3 adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0 beq @0800D984 @0800D960: movs r1, 0 adds r0, r4, 0 adds r0, 0x45 @0800D966: strb r1, [r0] subs r0, 0x1 cmp r0, r4 bge @0800D966 ldr r0, =0x04000208 mov r7, r12 strh r7, [r0] movs r0, 0 b @0800D9CA .align 2, 0 .pool @0800D984: movs r2, 0 movs r6, 0x46 @0800D988: adds r1, r4, r2 ldrb r0, [r5] adds r7, r0, 0 muls r7, r6 adds r0, r7, 0 adds r0, r2, r0 adds r0, r3, r0 ldrb r0, [r0] strb r0, [r1] adds r2, 0x1 cmp r2, 0x45 ble @0800D988 ldr r0, =0x000008c1 adds r1, r3, r0 ldrb r0, [r1] adds r0, 0x1 ldrb r2, [r1] strb r0, [r1] ldrb r2, [r1] movs r0, 0x1F ands r0, r2 ldrb r2, [r1] strb r0, [r1] ldr r7, =0x000008c2 adds r1, r3, r7 ldrb r0, [r1] subs r0, 0x1 ldrb r2, [r1] strb r0, [r1] ldr r0, =0x04000208 mov r1, r12 strh r1, [r0] movs r0, 0x1 @0800D9CA: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800D934 thumb_func_start sub_800D9DC sub_800D9DC: ; 800D9DC push {r4-r7,lr} adds r5, r0, 0 adds r6, r1, 0 movs r1, 0x8C lsls r1, 2 adds r0, r5, r1 adds r1, 0x1 adds r4, r5, r1 ldrb r1, [r0] ldrb r0, [r4] cmp r1, r0 beq @0800DA00 ldr r1, =0x00000233 adds r0, r5, r1 ldrb r0, [r0] adds r2, r0, 0 cmp r2, 0 beq @0800DA08 @0800DA00: movs r0, 0 b @0800DA54 .align 2, 0 .pool @0800DA08: ldr r1, =0x04000208 ldrh r0, [r1] adds r7, r0, 0 strh r2, [r1] movs r3, 0 @0800DA12: adds r2, r6, r3 ldrb r1, [r4] lsls r0, r1, 3 subs r0, r1 lsls r0, 1 adds r0, r3, r0 adds r0, r5, r0 ldrb r0, [r0] strb r0, [r2] adds r3, 0x1 cmp r3, 0xD ble @0800DA12 ldr r0, =0x00000231 adds r4, r5, r0 ldrb r0, [r4] adds r0, 0x1 ldrb r1, [r4] strb r0, [r4] ldrb r0, [r4] movs r1, 0x28 bl __umodsi3 ldrb r1, [r4] strb r0, [r4] ldr r0, =0x00000232 adds r1, r5, r0 ldrb r0, [r1] subs r0, 0x1 ldrb r2, [r1] strb r0, [r1] ldr r0, =0x04000208 strh r7, [r0] movs r0, 0x1 @0800DA54: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800D9DC thumb_func_start sub_800DA68 sub_800DA68: ; 800DA68 push {r4,lr} adds r2, r0, 0 adds r4, r1, 0 ldrb r0, [r4, 0x1] cmp r0, 0 bne @0800DA7E adds r0, r2, 0 movs r1, 0 bl sub_800DAC8 b @0800DAC0 @0800DA7E: movs r3, 0 @0800DA80: ldrb r1, [r2, 0x1C] lsls r0, r1, 3 subs r0, r1 lsls r0, 1 adds r0, r3, r0 adds r0, r2, r0 adds r1, r4, r3 ldrb r1, [r1] strb r1, [r0] adds r3, 0x1 cmp r3, 0xD ble @0800DA80 ldrb r0, [r2, 0x1C] adds r0, 0x1 ldrb r1, [r2, 0x1C] strb r0, [r2, 0x1C] ldrb r1, [r2, 0x1C] movs r0, 0x1 ands r0, r1 ldrb r1, [r2, 0x1C] strb r0, [r2, 0x1C] ldrb r0, [r2, 0x1E] cmp r0, 0x1 bhi @0800DABA ldrb r0, [r2, 0x1E] adds r0, 0x1 ldrb r1, [r2, 0x1E] strb r0, [r2, 0x1E] b @0800DAC0 @0800DABA: ldrb r0, [r2, 0x1C] ldrb r1, [r2, 0x1D] strb r0, [r2, 0x1D] @0800DAC0: pop {r4} pop {r0} bx r0 thumb_func_end sub_800DA68 thumb_func_start sub_800DAC8 sub_800DAC8: ; 800DAC8 push {r4,r5,lr} adds r3, r0, 0 adds r5, r1, 0 ldrb r0, [r3, 0x1E] cmp r0, 0 bne @0800DAD8 movs r0, 0 b @0800DB12 @0800DAD8: cmp r5, 0 beq @0800DAF6 movs r4, 0 @0800DADE: adds r2, r5, r4 ldrb r1, [r3, 0x1D] lsls r0, r1, 3 subs r0, r1 lsls r0, 1 adds r0, r4, r0 adds r0, r3, r0 ldrb r0, [r0] strb r0, [r2] adds r4, 0x1 cmp r4, 0xD ble @0800DADE @0800DAF6: ldrb r0, [r3, 0x1D] adds r0, 0x1 ldrb r1, [r3, 0x1D] strb r0, [r3, 0x1D] ldrb r1, [r3, 0x1D] movs r0, 0x1 ands r0, r1 ldrb r1, [r3, 0x1D] strb r0, [r3, 0x1D] ldrb r0, [r3, 0x1E] subs r0, 0x1 ldrb r1, [r3, 0x1E] strb r0, [r3, 0x1E] movs r0, 0x1 @0800DB12: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_800DAC8 thumb_func_start sub_800DB18 sub_800DB18: ; 800DB18 push {r4,r5,lr} adds r3, r0, 0 adds r5, r1, 0 ldr r1, =0x00000202 adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0x1 bhi @0800DB70 movs r2, 0 movs r0, 0x80 lsls r0, 2 adds r4, r3, r0 @0800DB30: ldrb r0, [r4] lsls r0, 8 adds r0, r2, r0 adds r0, r3, r0 adds r1, r5, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0xFF ble @0800DB30 movs r0, 0x80 lsls r0, 2 adds r1, r3, r0 ldrb r0, [r1] adds r0, 0x1 ldrb r2, [r1] strb r0, [r1] ldrb r2, [r1] movs r0, 0x1 ands r0, r2 ldrb r2, [r1] strb r0, [r1] ldr r0, =0x00000202 adds r1, r3, r0 ldrb r0, [r1] adds r0, 0x1 ldrb r2, [r1] strb r0, [r1] b @0800DB7A .align 2, 0 .pool @0800DB70: ldr r1, =0x00000203 adds r0, r3, r1 ldrb r1, [r0] movs r1, 0x1 strb r1, [r0] @0800DB7A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800DB18 thumb_func_start sub_800DB84 sub_800DB84: ; 800DB84 push {r4,r5,lr} adds r3, r0, 0 adds r5, r1, 0 movs r1, 0x80 lsls r1, 2 adds r0, r3, r1 adds r1, 0x1 adds r4, r3, r1 ldrb r1, [r0] ldrb r0, [r4] cmp r1, r0 beq @0800DBA6 ldr r1, =0x00000203 adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0 beq @0800DBB0 @0800DBA6: movs r0, 0 b @0800DBEA .align 2, 0 .pool @0800DBB0: movs r2, 0 @0800DBB2: adds r0, r5, r2 ldrb r1, [r4] lsls r1, 8 adds r1, r2, r1 adds r1, r3, r1 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0xFF ble @0800DBB2 ldr r0, =0x00000201 adds r1, r3, r0 ldrb r0, [r1] adds r0, 0x1 ldrb r2, [r1] strb r0, [r1] ldrb r2, [r1] movs r0, 0x1 ands r0, r2 ldrb r2, [r1] strb r0, [r1] ldr r0, =0x00000202 adds r1, r3, r0 ldrb r0, [r1] subs r0, 0x1 ldrb r2, [r1] strb r0, [r1] movs r0, 0x1 @0800DBEA: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800DB84 thumb_func_start sub_800DBF8 sub_800DBF8: ; 800DBF8 push {r4-r7,lr} adds r6, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r1, 0 movs r5, 0 cmp r1, 0x1 beq @0800DC36 cmp r1, 0x1 bgt @0800DC12 cmp r1, 0 beq @0800DC1C b @0800DCAA @0800DC12: cmp r0, 0x2 beq @0800DC56 cmp r0, 0x3 beq @0800DC76 b @0800DCAA @0800DC1C: movs r4, 0 @0800DC1E: adds r0, r6, r4 adds r1, r4, 0x1 strb r1, [r0] lsls r0, r5, 16 asrs r0, 16 adds r0, r1 lsls r0, 16 lsrs r5, r0, 16 adds r4, r1, 0 cmp r4, 0xC7 ble @0800DC1E b @0800DC70 @0800DC36: movs r4, 0 adds r2, r6, 0 adds r2, 0xC8 @0800DC3C: adds r0, r6, r4 adds r1, r4, 0x1 strb r1, [r0] lsls r0, r5, 16 asrs r0, 16 adds r0, r1 lsls r0, 16 lsrs r5, r0, 16 adds r4, r1, 0 cmp r4, 0x63 ble @0800DC3C strh r5, [r2] b @0800DCAA @0800DC56: movs r4, 0 @0800DC58: bl GenerateRandomNumber lsls r0, 24 lsrs r0, 24 adds r1, r6, r4 strb r0, [r1] adds r0, r5, r0 lsls r0, 16 lsrs r5, r0, 16 adds r4, 0x1 cmp r4, 0xC7 ble @0800DC58 @0800DC70: adds r0, r6, r4 strh r5, [r0] b @0800DCAA @0800DC76: movs r4, 0 ldr r3, =0x03000d74 ldrb r1, [r3] ldrb r0, [r3] adds r7, r0, 0x1 adds r2, r1, 0x1 movs r0, 0xFF mov r12, r0 @0800DC86: adds r0, r6, r4 adds r1, r4, 0x1 strb r2, [r0] adds r0, r4, r7 mov r4, r12 ands r0, r4 adds r0, r5, r0 lsls r0, 16 lsrs r5, r0, 16 adds r2, 0x1 adds r4, r1, 0 cmp r1, 0xC7 ble @0800DC86 adds r0, r6, r1 strh r5, [r0] ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] @0800DCAA: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800DBF8 thumb_func_start sub_800DCB4 sub_800DCB4: ; 800DCB4 push {r4,r5,lr} adds r4, r0, 0 movs r3, 0 ldrb r0, [r1] cmp r0, 0xFF beq @0800DCD8 ldr r5, =gUnknown_082ED470 adds r2, r1, 0 @0800DCC4: adds r1, r4, r3 ldrb r0, [r2] adds r0, r5 ldrb r0, [r0] strb r0, [r1] adds r2, 0x1 adds r3, 0x1 ldrb r0, [r2] cmp r0, 0xFF bne @0800DCC4 @0800DCD8: adds r1, r4, r3 movs r0, 0 strb r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800DCB4 thumb_func_start sub_800DCE8 sub_800DCE8: ; 800DCE8 push {r4,r5,lr} adds r4, r0, 0 movs r3, 0 ldrb r0, [r1] cmp r0, 0 beq @0800DD0C ldr r5, =gUnknown_082ED370 adds r2, r1, 0 @0800DCF8: adds r1, r4, r3 ldrb r0, [r2] adds r0, r5 ldrb r0, [r0] strb r0, [r1] adds r2, 0x1 adds r3, 0x1 ldrb r0, [r2] cmp r0, 0 bne @0800DCF8 @0800DD0C: adds r1, r4, r3 movs r0, 0xFF strb r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800DCE8 thumb_func_start sub_800DD1C sub_800DD1C: ; 800DD1C push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 movs r6, 0 ldr r0, =0x03007890 ldr r4, [r0] ldrb r2, [r4, 0x2] ldrb r1, [r4] adds r7, r0, 0 cmp r1, 0x1 bne @0800DD72 movs r3, 0 ands r1, r2 cmp r1, 0 beq @0800DD4E cmp r5, 0x1 bne @0800DD48 ldrb r0, [r4, 0xA] b @0800DD8C .align 2, 0 .pool @0800DD48: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0800DD4E: lsrs r2, 1 adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bhi @0800DD8A movs r0, 0x1 ands r0, r2 cmp r0, 0 beq @0800DD4E adds r0, r6, 0x1 cmp r5, r0 bne @0800DD48 @0800DD68: ldr r0, [r7] adds r0, 0xA adds r0, r3 ldrb r0, [r0] b @0800DD8C @0800DD72: movs r3, 0 movs r1, 0x1 @0800DD76: adds r0, r2, 0 ands r0, r1 cmp r0, 0 bne @0800DD68 lsrs r2, 1 adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bls @0800DD76 @0800DD8A: movs r0, 0 @0800DD8C: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_800DD1C thumb_func_start sub_800DD94 sub_800DD94: ; 800DD94 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r7, r0, 0 lsls r1, 24 lsrs r1, 24 mov r9, r1 movs r4, 0 ldr r0, =0x03005d90 mov r8, r0 adds r6, r7, 0x2 ldr r0, [r0] adds r5, r0, 0 adds r5, 0xA @0800DDB2: adds r0, r6, r4 adds r1, r5, r4 ldrb r1, [r1] strb r1, [r0] adds r4, 0x1 cmp r4, 0x1 ble @0800DDB2 movs r4, 0 lsls r2, 7 mov r12, r2 adds r1, r7, 0x4 @0800DDC8: adds r0, r1, r4 strb r3, [r0] asrs r3, 8 adds r4, 0x1 cmp r4, 0x3 ble @0800DDC8 mov r1, r8 ldr r0, [r1] ldrb r0, [r0, 0x8] movs r6, 0x1 movs r1, 0x1 ands r1, r0 ldrb r2, [r7, 0xB] movs r5, 0x2 negs r5, r5 adds r0, r5, 0 ands r0, r2 orrs r0, r1 strb r0, [r7, 0xB] movs r4, 0x7F mov r1, r9 ands r1, r4 ldrb r2, [r7, 0xA] movs r0, 0x80 negs r0, r0 ands r0, r2 orrs r0, r1 ands r0, r4 mov r1, r12 orrs r0, r1 strb r0, [r7, 0xA] ldrb r0, [r7] movs r1, 0x10 negs r1, r1 ands r1, r0 movs r0, 0x2 orrs r1, r0 ldrb r2, [r7, 0x1] movs r0, 0x3D negs r0, r0 ands r0, r2 movs r2, 0xC orrs r0, r2 strb r0, [r7, 0x1] movs r0, 0x11 negs r0, r0 ands r1, r0 subs r0, 0x10 ands r1, r0 subs r0, 0x20 ands r1, r0 strb r1, [r7] ldr r0, =0x0000087f bl 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, =0x00000864 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 .pool thumb_func_end sub_800DD94 thumb_func_start sub_800DE7C sub_800DE7C: ; 800DE7C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r7, r0, 0 mov r8, r1 lsls r2, 24 lsrs r5, r2, 24 ldr r0, =0x03004140 ldrb r0, [r0, 0x6] cmp r0, 0x1 bne @0800DED8 movs r0, 0x1 mov r9, r0 ldr r6, =0x03007890 ldr r0, [r6] lsls r4, r5, 5 adds r0, r4 ldrh r0, [r0, 0x18] bl sub_8010454 cmp r0, 0 beq @0800DEB8 ldr r1, [r6] ldrb r0, [r1, 0x7] asrs r0, r5 mov r2, r9 ands r0, r2 cmp r0, 0 bne @0800DEF0 @0800DEB8: adds r0, r7, 0 movs r1, 0 movs r2, 0xD bl memset mov r0, r8 movs r1, 0 movs r2, 0x8 bl memset b @0800DF24 .align 2, 0 .pool @0800DED8: movs r0, 0 mov r9, r0 ldr r6, =0x03007890 ldr r0, [r6] lsls r4, r5, 5 adds r0, r4 ldrh r0, [r0, 0x18] bl sub_8010454 cmp r0, 0 beq @0800DF10 ldr r1, [r6] @0800DEF0: adds r1, r4, r1 adds r1, 0x1A adds r0, r7, 0 movs r2, 0xD bl memcpy ldr r1, [r6] adds r1, r4, r1 adds r1, 0x29 mov r0, r8 movs r2, 0x8 bl memcpy b @0800DF24 .align 2, 0 .pool @0800DF10: adds r0, r7, 0 movs r1, 0 movs r2, 0xD bl memset mov r0, r8 movs r1, 0 movs r2, 0x8 bl memset @0800DF24: mov r0, r9 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_800DE7C thumb_func_start sub_800DF34 sub_800DF34: ; 800DF34 push {r4-r7,lr} adds r3, r0, 0 adds r5, r1, 0 lsls r2, 24 movs r7, 0 ldr r6, =0x03007890 ldr r0, [r6] lsrs r4, r2, 19 adds r2, r0, r4 ldrh r1, [r2, 0x18] ldr r0, =0x00007f7d cmp r1, r0 bne @0800DF74 adds r1, r2, 0 adds r1, 0x1A adds r0, r3, 0 movs r2, 0xD bl memcpy ldr r1, [r6] adds r1, r4, r1 adds r1, 0x29 adds r0, r5, 0 movs r2, 0x8 bl memcpy movs r7, 0x1 b @0800DF88 .align 2, 0 .pool @0800DF74: adds r0, r3, 0 movs r1, 0 movs r2, 0xD bl memset adds r0, r5, 0 movs r1, 0 movs r2, 0x8 bl memset @0800DF88: adds r0, r7, 0 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_800DF34 thumb_func_start sub_800DF90 sub_800DF90: ; 800DF90 push {r4,lr} adds r4, r1, 0 ldr r1, =0x02022b14 movs r2, 0xD bl memcpy ldr r1, =0x02022b22 adds r0, r4, 0 movs r2, 0x8 bl memcpy pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800DF90 thumb_func_start sub_800DFB4 sub_800DFB4: ; 800DFB4 push {r4,r5,lr} lsls r0, 24 lsrs r3, r0, 24 lsls r1, 24 lsrs r2, r1, 24 cmp r3, 0 bne @0800DFCA cmp r2, 0 bne @0800DFCA movs r3, 0xE7 movs r2, 0x8 @0800DFCA: ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x1 bne @0800E024 ldr r0, =gUnknown_082ED5F0 adds r1, r3, 0 movs r3, 0 bl obj_add_from_template_forward_search adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r0, =0x02020630 lsls r4, r5, 4 adds r4, r5 lsls r4, 2 adds r4, r0 ldr r0, =0x00001234 strh r0, [r4, 0x3C] ldr r0, =gUnknown_082ED5E0 ldrh r0, [r0, 0x6] bl 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, =0x02022b10 strb r5, [r0] b @0800E06A .align 2, 0 .pool @0800E024: ldr r0, =gUnknown_082ED5F0 adds r1, r3, 0 movs r3, 0 bl obj_add_from_template_forward_search ldr r4, =0x02022b10 strb r0, [r4] ldr r5, =0x02020630 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x00001234 strh r1, [r0, 0x3C] ldr r0, =gUnknown_082ED5E0 ldrh r0, [r0, 0x6] bl 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 .pool thumb_func_end sub_800DFB4 thumb_func_start sub_800E084 sub_800E084: ; 800E084 push {r4,lr} ldr r4, =0x02020630 ldr r3, =0x02022b10 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, r0, r4 movs r0, 0x3C ldrsh r1, [r2, r0] ldr r0, =0x00001234 cmp r1, r0 bne @0800E0CA movs r0, 0 strh r0, [r2, 0x3C] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r3, =0x030022c0 movs r0, 0x84 lsls r0, 3 adds r3, r0 ldr r0, =gUnknown_082EC690 ldr r1, [r0] ldr r2, [r0, 0x4] str r1, [r3] str r2, [r3, 0x4] ldr r1, =0x070003e8 movs r2, 0x4 bl CpuSet @0800E0CA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E084 thumb_func_start sub_800E0E8 sub_800E0E8: ; 800E0E8 push {r4,lr} ldr r4, =gUnknown_082ED5E0 ldrh r0, [r4, 0x6] bl gpu_tile_obj_tag_get_range_start lsls r0, 16 ldr r1, =0xffff0000 cmp r0, r1 bne @0800E100 adds r0, r4, 0 bl gpu_tile_obj_decompress_and_load @0800E100: ldr r0, =gUnknown_082ED5E8 bl gpu_pal_obj_alloc_tag_and_apply ldr r1, =0x02022b10 movs r0, 0xFF strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E0E8 thumb_func_start sub_800E124 sub_800E124: ; 800E124 push {r4,lr} ldr r1, =0x03007890 ldr r0, [r1] ldrb r2, [r0, 0x2] movs r3, 0 movs r4, 0x1 @0800E130: adds r0, r2, 0 ands r0, r4 cmp r0, 0 beq @0800E148 ldr r0, [r1] adds r0, 0xA adds r0, r3 ldrb r0, [r0] b @0800E156 .align 2, 0 .pool @0800E148: lsrs r2, 1 adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bls @0800E130 movs r0, 0 @0800E156: pop {r4} pop {r1} bx r1 thumb_func_end sub_800E124 thumb_func_start sub_800E15C sub_800E15C: ; 800E15C push {lr} adds r2, r0, 0 movs r3, 0x32 ldrsh r0, [r2, r3] cmp r0, r1 beq @0800E170 movs r0, 0 strh r1, [r2, 0x32] strh r0, [r2, 0x34] strh r0, [r2, 0x36] @0800E170: pop {r0} bx r0 thumb_func_end sub_800E15C thumb_func_start sub_800E174 sub_800E174: ; 800E174 push {r4-r7,lr} mov r7, r8 push {r7} ldr r1, =0x02022b10 ldrb r0, [r1] cmp r0, 0xFF bne @0800E184 b @0800E346 @0800E184: ldr r2, =0x02020630 adds r1, r0, 0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, r0, r2 movs r0, 0x3C ldrsh r1, [r2, r0] ldr r0, =0x00001234 cmp r1, r0 beq @0800E19C b @0800E346 @0800E19C: adds r6, r2, 0 movs r5, 0xFF movs r4, 0 ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x1 bne @0800E1F6 adds r7, r6, 0 adds r7, 0x28 movs r1, 0x29 adds r1, r6 mov r8, r1 b @0800E1E6 .align 2, 0 .pool @0800E1C8: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl sub_800DD1C lsls r0, 24 lsrs r0, 24 cmp r5, r0 bcc @0800E1E6 adds r0, r4, 0 bl sub_800DD1C lsls r0, 24 lsrs r5, r0, 24 @0800E1E6: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 subs r0, 0x1 cmp r4, r0 blt @0800E1C8 b @0800E208 @0800E1F6: bl sub_800E124 lsls r0, 24 lsrs r5, r0, 24 adds r7, r6, 0 adds r7, 0x28 movs r2, 0x29 adds r2, r6 mov r8, r2 @0800E208: bl sub_8012224 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0800E218 movs r0, 0x4 b @0800E246 @0800E218: cmp r5, 0x18 bhi @0800E220 movs r0, 0x3 b @0800E246 @0800E220: adds r0, r5, 0 subs r0, 0x19 lsls r0, 24 lsrs r0, 24 cmp r0, 0x65 bhi @0800E230 movs r0, 0x2 b @0800E246 @0800E230: adds r0, r5, 0 subs r0, 0x7F lsls r0, 24 lsrs r0, 24 cmp r0, 0x65 bhi @0800E240 movs r0, 0x1 b @0800E246 @0800E240: cmp r5, 0xE4 bls @0800E248 movs r0, 0 @0800E246: strh r0, [r6, 0x2E] @0800E248: movs r3, 0x2E ldrsh r1, [r6, r3] movs r2, 0x30 ldrsh r0, [r6, r2] cmp r1, r0 beq @0800E25E adds r0, r6, 0 bl sub_800E15C ldrh r0, [r6, 0x2E] strh r0, [r6, 0x30] @0800E25E: movs r0, 0x32 ldrsh r1, [r6, r0] ldr r2, [r6, 0x8] lsls r1, 2 adds r1, r2 movs r3, 0x36 ldrsh r0, [r6, r3] ldr r1, [r1] lsls r0, 2 adds r0, r1 ldr r0, [r0] lsls r0, 10 lsrs r0, 26 movs r3, 0x34 ldrsh r1, [r6, r3] cmp r0, r1 bge @0800E2AC ldrh r0, [r6, 0x36] adds r0, 0x1 movs r3, 0 strh r0, [r6, 0x36] strh r3, [r6, 0x34] movs r1, 0x32 ldrsh r0, [r6, r1] lsls r0, 2 adds r0, r2 movs r2, 0x36 ldrsh r1, [r6, r2] ldr r0, [r0] lsls r1, 2 adds r1, r0 movs r0, 0 ldrsh r1, [r1, r0] movs r0, 0x2 negs r0, r0 cmp r1, r0 bne @0800E2B2 strh r3, [r6, 0x36] b @0800E2B2 @0800E2AC: ldrh r0, [r6, 0x34] adds r0, 0x1 strh r0, [r6, 0x34] @0800E2B2: ldr r4, =0x030022c0 movs r1, 0x84 lsls r1, 3 adds r0, r4, r1 ldr r1, =gUnknown_082ED570 ldr r2, [r1, 0x4] ldr r1, [r1] str r1, [r0] str r2, [r0, 0x4] movs r3, 0x20 ldrsh r2, [r6, r3] movs r1, 0 ldrsb r1, [r7, r1] adds r2, r1 ldr r1, =0x00000422 adds r5, r4, r1 ldr r3, =0x000001ff adds r1, r3, 0 ands r2, r1 ldrh r3, [r5] ldr r1, =0xfffffe00 ands r1, r3 orrs r1, r2 strh r1, [r5] ldrh r1, [r6, 0x22] mov r2, r8 ldrb r2, [r2] adds r1, r2 strb r1, [r0] ldrb r2, [r6, 0x5] ldr r3, =0x00000425 adds r5, r4, r3 lsrs r2, 4 lsls r2, 4 ldrb r3, [r5] movs r1, 0xF ands r1, r3 orrs r1, r2 strb r1, [r5] movs r1, 0x32 ldrsh r2, [r6, r1] ldr r1, [r6, 0x8] lsls r2, 2 adds r2, r1 movs r3, 0x36 ldrsh r1, [r6, r3] ldr r2, [r2] lsls r1, 2 adds r1, r2 ldrh r2, [r1] ldrh r6, [r6, 0x3A] adds r2, r6 ldr r1, =0x00000424 adds r4, r1 ldr r3, =0x000003ff adds r1, r3, 0 ands r2, r1 ldrh r3, [r4] ldr r1, =0xfffffc00 ands r1, r3 orrs r1, r2 strh r1, [r4] ldr r1, =0x070003e8 movs r2, 0x4 bl CpuSet bl sub_8011A74 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0800E346 bl sub_800E084 @0800E346: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030030fc 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 .pool @0800E3D0: lsls r2, r4, 2 mov r0, sp adds r1, r0, r2 movs r0, 0x1 negs r0, r0 str r0, [r1] movs r5, 0 mov r8, r2 lsls r0, r4, 3 adds r1, r4, 0x1 mov r9, r1 subs r0, r4 lsls r0, 2 str r0, [sp, 0x1C] ldr r7, =0x020229f0 mov r10, r7 ldr r6, =0x00003b98 movs r4, 0 mov r0, r10 subs r0, 0x4 ldr r1, [sp, 0x1C] adds r3, r1, r0 @0800E3FC: ldrh r1, [r3] ldr r0, =0x03005d8c ldr r2, [r0] ldr r7, =0x00003b98 adds r0, r2, r7 adds r0, r4 ldr r0, [r0] cmp r1, r0 bne @0800E428 adds r1, r2, r6 adds r1, 0x4 ldr r0, [sp, 0x1C] add r0, r10 str r3, [sp, 0x18] bl 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 .pool @0800E45C: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 cmp r4, r0 beq @0800E4A6 ldr r2, =0x020229e8 adds r0, r5, r2 ldrh r0, [r0, 0x1A] cmp r0, 0x1 beq @0800E4A6 adds r0, r2, 0x4 adds r0, r5, r0 ldrh r1, [r0] adds r2, 0x8 adds r2, r5, r2 adds r0, r6, 0 bl sub_800E378 ldr r2, [r7] cmp r2, 0 blt @0800E4A0 ldr r0, =0x03005d8c ldr r1, [r0] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldr r1, =0x00003b9c adds r0, r1 movs r1, 0 movs r2, 0x8 bl memset @0800E4A0: adds r6, 0xC movs r0, 0x1 add r8, r0 @0800E4A6: adds r7, 0x4 adds r5, 0x1C adds r4, 0x1 @0800E4AC: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r4, r0 blt @0800E45C movs r4, 0 ldr r1, =0x03005d8c mov r9, r1 ldr r6, =0x00003b98 movs r7, 0 mov r1, r8 lsls r0, r1, 1 add r0, r8 lsls r0, 2 ldr r1, [sp, 0x14] adds r5, r0, r1 @0800E4CE: mov r1, r9 ldr r0, [r1] adds r0, r6 adds r0, 0x4 bl sub_800E388 cmp r0, 0 beq @0800E500 mov r0, r9 ldr r2, [r0] ldr r1, =0x00003b98 adds r0, r2, r1 adds r0, r7 ldr r1, [r0] adds r2, r6 adds r2, 0x4 adds r0, r5, 0 bl sub_800E378 adds r5, 0xC movs r0, 0x1 add r8, r0 mov r1, r8 cmp r1, 0x13 bgt @0800E50A @0800E500: adds r6, 0xC adds r7, 0xC adds r4, 0x1 cmp r4, 0x13 ble @0800E4CE @0800E50A: ldr r0, =0x03005d8c ldr r0, [r0] ldr r7, =0x00003b98 adds r0, r7 ldr r1, [sp, 0x14] movs r2, 0xF0 bl memcpy ldr r0, [sp, 0x14] bl free @0800E520: add sp, 0x20 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E3A8 thumb_func_start sub_800E540 sub_800E540: ; 800E540 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} mov r9, r1 lsls r0, 16 lsrs r0, 16 mov r8, r0 movs r7, 0 ldr r6, =0x03005d8c ldr r4, =0x00003b98 movs r5, 0 @0800E558: ldr r0, [r6] adds r0, r4 adds r0, 0x4 mov r1, r9 bl sub_8008C44 cmp r0, 0 bne @0800E584 ldr r0, [r6] ldr r1, =0x00003b98 adds r0, r1 adds r0, r5 ldr r0, [r0] cmp r0, r8 bne @0800E584 movs r0, 0x1 b @0800E59E .align 2, 0 .pool @0800E584: ldr r0, [r6] adds r0, r4 adds r0, 0x4 bl sub_800E388 cmp r0, 0 beq @0800E59C adds r4, 0xC adds r5, 0xC adds r7, 0x1 cmp r7, 0x13 ble @0800E558 @0800E59C: movs r0, 0 @0800E59E: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_800E540 thumb_func_start sub_800E5AC sub_800E5AC: ; 800E5AC push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 ldr r0, =0x00003b98 mov r8, r0 movs r7, 0 mov r6, r8 movs r5, 0 movs r4, 0x13 @0800E5C0: ldr r0, =0x03005d8c ldr r1, [r0] mov r2, r8 adds r0, r1, r2 adds r0, r5 str r7, [r0] mov r0, sp strh r7, [r0] adds r1, r6 adds r1, 0x4 ldr r2, =0x01000004 bl CpuSet adds r6, 0xC adds r5, 0xC subs r4, 0x1 cmp r4, 0 bge @0800E5C0 add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E5AC thumb_func_start nullsub_5 nullsub_5: ; 800E5FC bx lr thumb_func_end nullsub_5 thumb_func_start nullsub_13 nullsub_13: ; 800E600 bx lr thumb_func_end nullsub_13 thumb_func_start sub_800E604 sub_800E604: ; 800E604 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x8 ldr r6, =0x03005000 adds r5, r6, 0 adds r5, 0xEE ldrb r4, [r5] mov r0, sp movs r7, 0 strh r7, [r0] ldr r2, =0x0100067a adds r1, r6, 0 bl CpuSet ldrb r0, [r5] strb r4, [r5] movs r0, 0xFF strb r0, [r6, 0xC] ldrb r0, [r5] cmp r0, 0x4 beq @0800E636 ldrb r0, [r5] strb r7, [r5] @0800E636: mov r7, sp adds r7, 0x2 add r0, sp, 0x4 mov r8, r0 movs r0, 0x6 add r0, sp mov r9, r0 adds r5, r6, 0 adds r5, 0x80 movs r4, 0x4 @0800E64A: adds r0, r5, 0 bl sub_800FCC4 adds r5, 0x14 subs r4, 0x1 cmp r4, 0 bge @0800E64A movs r5, 0 ldr r4, =0x0300506c adds r0, r4, 0 bl sub_800FCC4 adds r0, r4, 0 adds r0, 0xB8 bl sub_800D6C8 ldr r0, =0x0000097c adds r4, r0 adds r0, r4, 0 bl sub_800D724 strh r5, [r7] ldr r1, =0x03003110 ldr r2, =0x01000008 adds r0, r7, 0 bl CpuSet mov r0, r8 strh r5, [r0] ldr r1, =0x03003090 ldr r2, =0x01000028 bl CpuSet mov r0, r9 strh r5, [r0] ldr r1, =0x020229e8 ldr r2, =0x01000046 bl CpuSet add sp, 0x8 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E604 thumb_func_start sub_800E6D0 sub_800E6D0: ; 800E6D0 push {r4-r6,lr} ldr r4, =0x03002710 ldr r5, [r4, 0x4] ldr r6, [r4, 0x8] bl sub_800E700 bl rfu_REQ_stopMode bl rfu_waitREQComplete ldr r1, =0x04000208 movs r0, 0 strh r0, [r1] str r5, [r4, 0x4] str r6, [r4, 0x8] movs r0, 0x1 strh r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E6D0 thumb_func_start sub_800E700 sub_800E700: ; 800E700 push {r4,lr} ldr r0, =0x03004190 ldr r1, =0x00000e64 ldr r4, =0x03002714 adds r2, r4, 0 movs r3, 0x1 bl rfu_initializeAPI lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 bne @0800E732 ldr r0, =0x020229c6 strh r1, [r0] bl sub_800AAF4 movs r0, 0 bl sub_80111B0 bl sub_800E604 adds r1, r4, 0x4 movs r0, 0x3 bl rfu_setTimerInterrupt @0800E732: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E700 thumb_func_start sub_800E748 sub_800E748: ; 800E748 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 bl sub_8010750 ldr r0, =0x03005000 ldrh r0, [r0, 0x4] cmp r0, 0x12 bls @0800E75C b @0800E862 @0800E75C: lsls r0, 2 ldr r1, =@0800E770 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0800E770: .4byte @0800E7BC .4byte @0800E862 .4byte @0800E7E4 .4byte @0800E862 .4byte @0800E814 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E862 .4byte @0800E828 @0800E7BC: ldr r0, =0x02022b2c bl sub_800BFCC ldr r0, =0x03005000 movs r2, 0x1 strh r2, [r0, 0x4] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r2, [r0, 0xA] b @0800E862 .align 2, 0 .pool @0800E7E4: ldr r4, =0x03005000 ldrb r0, [r4, 0xC] ldr r3, =gUnknown_082ED6E0 movs r1, 0 movs r2, 0xF0 bl sub_800C054 movs r0, 0x3 strh r0, [r4, 0x4] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0x6 strh r1, [r0, 0xA] b @0800E862 .align 2, 0 .pool @0800E814: movs r0, 0 bl sub_800C27C ldr r1, =0x03005000 movs r0, 0x5 strh r0, [r1, 0x4] b @0800E862 .align 2, 0 .pool @0800E828: ldr r4, =0x03005000 ldr r0, =0x00000cdb adds r1, r4, r0 ldrb r0, [r1] movs r0, 0 strb r0, [r1] ldr r0, =sub_800EDBC bl sub_800D52C bl sub_800EAB4 bl sub_800EAFC movs r0, 0x14 strh r0, [r4, 0x4] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0x8 strh r1, [r0, 0xA] ldr r0, =sub_801084C movs r1, 0x5 bl AddTask adds r0, r5, 0 bl remove_task @0800E862: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E748 thumb_func_start sub_800E87C sub_800E87C: ; 800E87C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_082ED6A5 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800E87C thumb_func_start sub_800E88C sub_800E88C: ; 800E88C push {r4-r7,lr} adds r2, r0, 0 adds r5, r1, 0 movs r4, 0x1 adds r1, r2, 0 movs r6, 0 movs r0, 0x1 negs r0, r0 cmp r5, r0 bne @0800E8CC movs r3, 0 movs r5, 0x1 ldr r1, =0x03005cde @0800E8A6: adds r0, r2, 0 ands r0, r5 cmp r0, 0 beq @0800E8B8 adds r0, r3, r1 strb r4, [r0] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @0800E8B8: asrs r2, 1 adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bls @0800E8A6 b @0800E942 .align 2, 0 .pool @0800E8CC: movs r3, 0 mvns r0, r1 mov r12, r0 movs r7, 0x1 ldr r4, =0x03005cde @0800E8D6: adds r2, r1, 0 ands r2, r7 cmp r2, 0 bne @0800E8E2 adds r0, r3, r4 strb r2, [r0] @0800E8E2: asrs r1, 1 adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bls @0800E8D6 movs r4, 0x4 ldr r0, =0x03005cde ldrb r7, [r0] @0800E8F4: movs r3, 0 subs r1, r4, 0x1 cmp r7, r4 beq @0800E910 ldr r2, =0x03005cde @0800E8FE: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bhi @0800E910 adds r0, r3, r2 ldrb r0, [r0] cmp r0, r4 bne @0800E8FE @0800E910: cmp r3, 0x4 bne @0800E916 adds r6, r4, 0 @0800E916: lsls r0, r1, 24 lsrs r4, r0, 24 cmp r4, 0 bne @0800E8F4 mov r0, r12 ands r5, r0 movs r3, 0 movs r2, 0x1 ldr r1, =0x03005cde @0800E928: adds r0, r5, 0 ands r0, r2 cmp r0, 0 beq @0800E936 adds r0, r3, r1 strb r6, [r0] adds r6, 0x1 @0800E936: asrs r5, 1 adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bls @0800E928 @0800E942: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E88C thumb_func_start sub_800E94C sub_800E94C: ; 800E94C push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x03005000 ldrh r3, [r0, 0x4] adds r7, r0, 0 cmp r3, 0xC bls @0800E95E b @0800EA9A @0800E95E: lsls r0, r3, 2 ldr r1, =@0800E970 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0800E970: .4byte @0800E9A4 .4byte @0800EA9A .4byte @0800EA9A .4byte @0800EA9A .4byte @0800EA9A .4byte @0800EA9A .4byte @0800E9BC .4byte @0800EA9A .4byte @0800EA9A .4byte @0800E9E4 .4byte @0800EA9A .4byte @0800E9F8 .4byte @0800EA3C @0800E9A4: ldr r0, =gUnknown_082ED608 bl sub_800BFCC ldr r0, =0x03005000 movs r2, 0x1 strh r2, [r0, 0x4] b @0800E9CC .align 2, 0 .pool @0800E9BC: ldrb r0, [r7, 0xC] ldr r3, =gUnknown_082ED6E0 movs r1, 0 movs r2, 0xF0 bl sub_800C054 movs r2, 0x7 strh r2, [r7, 0x4] @0800E9CC: ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 strh r2, [r0, 0xA] b @0800EA9A .align 2, 0 .pool @0800E9E4: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 movs r0, 0xA strh r0, [r1, 0xA] b @0800EA9A .align 2, 0 .pool @0800E9F8: bl sub_80107A0 cmp r0, 0x6 beq @0800EA1C cmp r0, 0x6 bgt @0800EA0A cmp r0, 0x5 beq @0800EA10 b @0800EA9A @0800EA0A: cmp r0, 0x9 beq @0800EA1C b @0800EA9A @0800EA10: ldr r1, =0x03005000 movs r0, 0xC strh r0, [r1, 0x4] b @0800EA9A .align 2, 0 .pool @0800EA1C: bl sub_800D630 ldr r0, =0x03005000 ldr r1, =0x00000ce4 adds r0, r1 movs r1, 0x2 strb r1, [r0] adds r0, r6, 0 bl remove_task b @0800EA9A .align 2, 0 .pool @0800EA3C: ldr r0, =0x00000c3e adds r4, r7, r0 ldrb r0, [r4] movs r5, 0x80 lsls r5, 17 lsls r5, r0 lsrs r5, 24 ldrb r1, [r4] movs r0, 0xC bl rfu_clearSlot ldrb r1, [r4] ldr r0, =0x00000c3f adds r2, r7, r0 movs r0, 0x10 movs r3, 0x46 bl rfu_setRecvBuffer adds r1, r7, 0 adds r1, 0x4C adds r0, r5, 0 movs r2, 0xE bl rfu_UNI_setSendData ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 movs r1, 0x8 strh r1, [r0, 0xA] adds r0, r6, 0 bl remove_task ldr r4, =0x02022b44 ldrb r0, [r4, 0xF] cmp r0, 0 bne @0800EA92 bl sub_801227C ldrb r0, [r4, 0xF] adds r0, 0x1 strb r0, [r4, 0xF] @0800EA92: ldr r0, =sub_801084C movs r1, 0x5 bl AddTask @0800EA9A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800E94C thumb_func_start sub_800EAB4 sub_800EAB4: ; 800EAB4 push {r4,r5,lr} ldr r0, =0x03004140 ldrb r5, [r0] movs r4, 0 @0800EABC: movs r0, 0x1 ands r0, r5 cmp r0, 0 beq @0800EAE0 lsls r2, r4, 3 subs r2, r4 lsls r2, 1 ldr r0, =0x03005014 adds r2, r0 movs r0, 0x10 adds r1, r4, 0 movs r3, 0xE bl rfu_setRecvBuffer movs r0, 0x3 adds r1, r4, 0 bl rfu_clearSlot @0800EAE0: lsrs r5, 1 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @0800EABC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800EAB4 thumb_func_start sub_800EAFC sub_800EAFC: ; 800EAFC push {r4-r6,lr} ldr r0, =0x03004140 ldrb r5, [r0] ldr r4, =0x03005c87 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x46 bl rfu_UNI_setSendData adds r0, r5, 0 bl sub_800E87C ldr r1, =0xfffff379 adds r6, r4, r1 adds r1, r4, 0 adds r1, 0x53 strb r0, [r1] adds r4, 0x5B strb r5, [r4] movs r1, 0x1 negs r1, r1 adds r0, r5, 0 bl sub_800E88C movs r0, 0x1 strb r0, [r6, 0xC] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800EAFC thumb_func_start sub_800EB44 sub_800EB44: ; 800EB44 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 bl sub_800F7DC ldrb r1, [r0, 0xA] movs r0, 0x7F ands r0, r1 cmp r0, 0x54 bne @0800EB78 bl sub_8011A74 lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bne @0800EB78 ldr r0, =0x03004140 ldrb r0, [r0] bl rfu_REQ_disconnect bl rfu_waitREQComplete movs r0, 0 movs r1, 0 bl sub_8011A64 @0800EB78: ldr r0, =0x03005000 ldrh r2, [r0, 0x4] adds r6, r0, 0 cmp r2, 0x12 bls @0800EB84 b @0800ECF4 @0800EB84: lsls r0, r2, 2 ldr r1, =@0800EB9C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0800EB9C: .4byte @0800EBE8 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800ECF4 .4byte @0800EC38 .4byte @0800EC98 .4byte @0800ECF4 .4byte @0800ECAC .4byte @0800EC10 .4byte @0800ECF4 @0800EBE8: ldr r0, =0x02022b2c bl sub_800BFCC ldr r0, =0x03005000 movs r2, 0x1 strh r2, [r0, 0x4] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r2, [r0, 0xA] b @0800ECF4 .align 2, 0 .pool @0800EC10: ldr r3, =gUnknown_082ED6E0 movs r0, 0x2 movs r1, 0 movs r2, 0xF0 bl sub_800C054 ldr r0, =sub_800ED34 bl sub_800D52C ldr r1, =0x03005000 movs r0, 0x12 strh r0, [r1, 0x4] b @0800ECF4 .align 2, 0 .pool @0800EC38: ldr r1, =0x00000c3e adds r0, r6, r1 ldrb r1, [r0] movs r0, 0x80 lsls r0, 17 lsls r0, r1 lsrs r0, 24 adds r1, r6, 0 adds r1, 0x4C movs r2, 0xE bl rfu_UNI_setSendData lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @0800ECF4 strb r0, [r6, 0xC] adds r0, r5, 0 bl remove_task ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 movs r2, 0x16 ldrsh r0, [r1, r2] cmp r0, 0 beq @0800EC88 ldr r0, =sub_8010D0C movs r1, 0x1 bl AddTask b @0800ECF4 .align 2, 0 .pool @0800EC88: ldr r0, =sub_801084C movs r1, 0x5 bl AddTask b @0800ECF4 .align 2, 0 .pool @0800EC98: movs r0, 0 bl sub_800C27C ldr r1, =0x03005000 movs r0, 0xF strh r0, [r1, 0x4] b @0800ECF4 .align 2, 0 .pool @0800ECAC: ldr r0, =0x00000cdb adds r1, r6, r0 ldrb r0, [r1] movs r0, 0 strb r0, [r1] ldr r0, =sub_800EDBC bl sub_800D52C movs r0, 0x1 bl sub_8011068 bl sub_800EAB4 bl sub_800EAFC movs r0, 0x14 strh r0, [r6, 0x4] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0x8 strh r1, [r0, 0xA] movs r4, 0x1 strb r4, [r6, 0xC] ldr r0, =sub_801084C movs r1, 0x5 bl AddTask ldr r1, =0x00000ce8 adds r0, r6, r1 strb r4, [r0] adds r0, r5, 0 bl remove_task @0800ECF4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800EB44 thumb_func_start sub_800ED10 sub_800ED10: ; 800ED10 push {lr} ldr r3, =gUnknown_082ED6E0 movs r0, 0x1 movs r1, 0 movs r2, 0xF0 bl sub_800C054 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800ED10 thumb_func_start sub_800ED28 sub_800ED28: ; 800ED28 push {lr} movs r0, 0 bl sub_800C27C pop {r0} bx r0 thumb_func_end sub_800ED28 thumb_func_start sub_800ED34 sub_800ED34: ; 800ED34 push {r4,lr} ldr r0, =0x03005000 movs r2, 0 movs r1, 0xD adds r0, 0x59 @0800ED3E: strb r2, [r0] subs r0, 0x1 subs r1, 0x1 cmp r1, 0 bge @0800ED3E bl rfu_REQ_recvData bl rfu_waitREQComplete ldr r1, =0x03007870 ldr r3, =0x03005000 ldr r0, =0x00000c3e adds r4, r3, r0 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r0, [r0] ldrb r0, [r0, 0x12] cmp r0, 0 beq @0800ED9A movs r2, 0xCD lsls r2, 4 adds r1, r3, r2 ldrb r0, [r1] adds r0, 0x1 ldrb r2, [r1] strb r0, [r1] movs r1, 0x92 lsls r1, 1 adds r0, r3, r1 ldr r2, =0x00000c3f adds r1, r3, r2 bl sub_800D7D8 ldr r1, =0x02022b44 ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] bl sub_800F048 ldrb r0, [r4] bl rfu_UNI_readySendData ldrb r0, [r4] bl rfu_UNI_clearRecvNewDataFlag @0800ED9A: movs r0, 0x1 bl rfu_REQ_sendData_wrapper pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800ED34 thumb_func_start sub_800EDBC sub_800EDBC: ; 800EDBC ldr r0, =0x03005000 ldr r1, =0x00000cdb adds r0, r1 ldrb r1, [r0] movs r1, 0x1 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_800EDBC thumb_func_start sub_800EDD4 sub_800EDD4: ; 800EDD4 push {r4-r6,lr} bl sub_800C048 ldr r4, =0x03005000 ldrb r0, [r4, 0xC] cmp r0, 0x1 bne @0800EDF0 ldr r0, =sub_800E748 b @0800EDF6 .align 2, 0 .pool @0800EDF0: cmp r0, 0 bne @0800EE18 ldr r0, =sub_800E94C @0800EDF6: bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0800EE38 adds r0, r4, 0 adds r0, 0x67 ldrb r0, [r0] bl remove_task bl sub_800E604 b @0800EE38 .align 2, 0 .pool @0800EE18: cmp r0, 0x2 bne @0800EE38 ldr r0, =sub_800EB44 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0800EE38 adds r0, r4, 0 adds r0, 0x67 ldrb r0, [r0] bl remove_task bl sub_800E604 @0800EE38: movs r5, 0 ldr r6, =gUnknown_082ED7E0 @0800EE3C: lsls r0, r5, 2 adds r0, r6 ldr r4, [r0] adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0800EE5E adds r0, r4, 0 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @0800EE5E: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x2 bls @0800EE3C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800EDD4 thumb_func_start sub_800EE78 sub_800EE78: ; 800EE78 push {lr} ldr r0, =sub_800E748 movs r1, 0x1 bl AddTask ldr r1, =0x03005000 adds r1, 0x67 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800EE78 thumb_func_start sub_800EE94 sub_800EE94: ; 800EE94 push {lr} ldr r1, =0x03005000 ldrh r0, [r1, 0x4] cmp r0, 0x7 bne @0800EEB4 ldr r2, =0x00000ccd adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @0800EEB4 movs r0, 0x1 b @0800EEB6 .align 2, 0 .pool @0800EEB4: movs r0, 0 @0800EEB6: pop {r1} bx r1 thumb_func_end sub_800EE94 thumb_func_start sub_800EEBC sub_800EEBC: ; 800EEBC push {r4,lr} ldr r4, =0x03005000 ldrh r0, [r4, 0x4] cmp r0, 0x7 bne @0800EEF8 ldr r0, =0x03007890 ldr r1, [r0] ldr r2, =0x00000c3d adds r0, r4, r2 ldrb r0, [r0] lsls r0, 5 adds r1, r0 ldrh r0, [r1, 0x14] movs r1, 0xF0 bl 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 .pool @0800EEF8: movs r0, 0 @0800EEFA: pop {r4} pop {r1} bx r1 thumb_func_end sub_800EEBC thumb_func_start sub_800EF00 sub_800EF00: ; 800EF00 push {lr} ldr r0, =sub_800E94C movs r1, 0x1 bl AddTask ldr r1, =0x03005000 adds r1, 0x67 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800EF00 thumb_func_start sub_800EF1C sub_800EF1C: ; 800EF1C push {lr} ldr r0, =0x03004140 ldrb r0, [r0] cmp r0, 0 bne @0800EF30 movs r0, 0 b @0800EF32 .align 2, 0 .pool @0800EF30: movs r0, 0x1 @0800EF32: pop {r1} bx r1 thumb_func_end sub_800EF1C thumb_func_start sub_800EF38 sub_800EF38: ; 800EF38 ldr r1, =0x03005000 movs r0, 0x4 strh r0, [r1, 0x4] ldr r0, =0x03004140 ldrb r0, [r0] ldr r2, =0x00000ce7 adds r1, r2 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_800EF38 thumb_func_start sub_800EF58 sub_800EF58: ; 800EF58 push {lr} adds r1, r0, 0 ldr r2, =0x03005000 ldrh r0, [r2, 0x4] cmp r0, 0x11 beq @0800EF68 cmp r1, 0 beq @0800EF74 @0800EF68: movs r0, 0x12 strh r0, [r2, 0x4] movs r0, 0x1 b @0800EF76 .align 2, 0 .pool @0800EF74: movs r0, 0 @0800EF76: pop {r1} bx r1 thumb_func_end sub_800EF58 thumb_func_start sub_800EF7C sub_800EF7C: ; 800EF7C ldr r1, =0x03005000 movs r0, 0xE strh r0, [r1, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_800EF7C thumb_func_start sub_800EF88 sub_800EF88: ; 800EF88 push {lr} lsls r0, 24 lsrs r1, r0, 24 movs r2, 0 b @0800EF9A @0800EF92: lsrs r1, 1 adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 @0800EF9A: cmp r2, 0x3 bhi @0800EFAC movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0800EF92 adds r0, r2, 0 bl rfu_UNI_readySendData @0800EFAC: pop {r0} bx r0 thumb_func_end sub_800EF88 thumb_func_start sub_800EFB0 sub_800EFB0: ; 800EFB0 push {r4-r7,lr} sub sp, 0x4 movs r2, 0 ldr r7, =0x03003090 ldr r0, =0x03005000 adds r6, r7, 0 ldr r1, =0x00000c87 adds r5, r0, r1 @0800EFC0: movs r3, 0 lsls r0, r2, 3 lsls r1, r2, 4 adds r4, r2, 0x1 subs r0, r2 lsls r0, 1 adds r2, r0, r5 adds r1, r6 @0800EFD0: ldrh r0, [r1] lsrs r0, 8 strb r0, [r2, 0x1] ldrh r0, [r1] strb r0, [r2] adds r2, 0x2 adds r1, 0x2 adds r3, 0x1 cmp r3, 0x6 ble @0800EFD0 adds r2, r4, 0 cmp r2, 0x4 ble @0800EFC0 movs r0, 0 mov r1, sp strh r0, [r1] ldr r2, =0x01000028 mov r0, sp adds r1, r7, 0 bl CpuSet add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800EFB0 thumb_func_start sub_800F014 sub_800F014: ; 800F014 push {lr} ldr r3, =0x03003110 ldr r2, =0x03003090 movs r1, 0x6 @0800F01C: ldrh r0, [r3] strh r0, [r2] adds r3, 0x2 adds r2, 0x2 subs r1, 0x1 cmp r1, 0 bge @0800F01C ldr r1, =0x03003110 movs r2, 0 adds r0, r1, 0 adds r0, 0xC @0800F032: strh r2, [r0] subs r0, 0x2 cmp r0, r1 bge @0800F032 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800F014 thumb_func_start sub_800F048 sub_800F048: ; 800F048 push {r4,r5,lr} ldr r4, =0x03005000 ldr r0, =0x00000c3c adds r5, r4, r0 ldrb r0, [r5] cmp r0, 0 beq @0800F07A ldr r1, =0x00000c1c adds r0, r4, r1 adds r1, r4, 0 adds r1, 0x4C bl sub_800DAC8 lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x00000c3a adds r0, r4, r1 ldrb r0, [r0] adds r1, r0, 0 cmp r1, 0 bne @0800F076 ldrb r0, [r5] strb r1, [r5] @0800F076: cmp r2, 0 bne @0800F09E @0800F07A: ldr r5, =0x03005000 ldr r1, =0x00000c3c adds r0, r5, r1 ldrb r0, [r0] cmp r0, 0 bne @0800F09E ldr r1, =0x000009e8 adds r0, r5, r1 adds r4, r5, 0 adds r4, 0x4C adds r1, r4, 0 bl sub_800D9DC ldr r1, =0x00000c1c adds r0, r5, r1 adds r1, r4, 0 bl sub_800DA68 @0800F09E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800F048 thumb_func_start sub_800F0B8 sub_800F0B8: ; 800F0B8 push {r4,lr} ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x6] cmp r0, 0 bne @0800F0CC @0800F0C4: movs r0, 0 b @0800F0EC .align 2, 0 .pool @0800F0CC: movs r3, 0 ldr r4, =0x03003090 @0800F0D0: movs r2, 0 lsls r0, r3, 4 adds r1, r0, r4 @0800F0D6: ldrh r0, [r1] cmp r0, 0 bne @0800F0C4 adds r1, 0x2 adds r2, 0x1 cmp r2, 0x6 ble @0800F0D6 adds r3, 0x1 cmp r3, 0x4 ble @0800F0D0 movs r0, 0x1 @0800F0EC: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800F0B8 thumb_func_start sub_800F0F8 sub_800F0F8: ; 800F0F8 push {r4-r6,lr} ldr r6, =0x03005000 ldrh r0, [r6, 0x4] cmp r0, 0x13 bhi @0800F118 bl rfu_REQ_recvData bl rfu_waitREQComplete movs r0, 0 bl rfu_REQ_sendData_wrapper b @0800F1D2 .align 2, 0 .pool @0800F118: ldr r0, =0x00000cdb adds r1, r6, r0 ldrb r0, [r1] movs r0, 0 strb r0, [r1] ldr r0, =0x00000ce2 adds r1, r6, r0 ldr r0, =0x03007890 ldr r0, [r0] ldrb r1, [r1] ldrb r0, [r0, 0x2] ands r0, r1 cmp r0, r1 bne @0800F1D2 cmp r0, 0 beq @0800F1D2 ldr r1, =0x00000cdc adds r0, r6, r1 ldrb r0, [r0] adds r5, r0, 0 cmp r5, 0 bne @0800F1C8 ldr r0, =0x00000ce3 adds r4, r6, r0 ldrb r0, [r4] cmp r0, 0 beq @0800F1A8 bl sub_8011D6C strb r5, [r4] ldr r1, =0x00000ce4 adds r0, r6, r1 ldrb r0, [r0] cmp r0, 0x1 bne @0800F18C movs r4, 0x80 lsls r4, 8 movs r0, 0x2 adds r1, r4, 0 bl sub_8011A64 adds r0, r4, 0 bl sub_8011170 b @0800F1D2 .align 2, 0 .pool @0800F18C: ldr r0, =0x03004140 ldrb r4, [r0] cmp r4, 0 bne @0800F1A8 bl sub_800EDD4 ldr r0, =0x03003124 strb r4, [r0] b @0800F1D2 .align 2, 0 .pool @0800F1A8: bl sub_800EFB0 ldr r0, =0x03005000 ldr r1, =0x00000cda adds r0, r1 ldrb r0, [r0] bl rfu_UNI_readySendData movs r0, 0x1 bl rfu_REQ_sendData_wrapper b @0800F1CC .align 2, 0 .pool @0800F1C8: bl rfu_REQ_PARENT_resumeRetransmitAndChange @0800F1CC: ldr r1, =0x03005000 movs r0, 0x1 strb r0, [r1, 0xE] @0800F1D2: movs r0, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800F0F8 thumb_func_start sub_800F1E0 sub_800F1E0: ; 800F1E0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 ldr r0, =0x03005000 ldrh r1, [r0, 0x4] adds r6, r0, 0 cmp r1, 0x13 bhi @0800F1F8 b @0800F45A @0800F1F8: ldrb r0, [r6, 0xE] cmp r0, 0x1 beq @0800F200 b @0800F45A @0800F200: bl rfu_waitREQComplete ldr r0, =0x00000cdb adds r2, r6, r0 ldrb r0, [r2] cmp r0, 0 bne @0800F220 adds r1, r6, 0 adds r1, 0xEE @0800F212: ldrb r0, [r1] cmp r0, 0 beq @0800F21A b @0800F480 @0800F21A: ldrb r0, [r2] cmp r0, 0 beq @0800F212 @0800F220: bl rfu_REQ_recvData bl rfu_waitREQComplete ldr r2, =0x03004140 ldr r4, =0x03005000 ldr r1, =0x00000ce2 adds r0, r4, r1 ldrb r1, [r2, 0x3] ldrb r0, [r0] ands r1, r0 cmp r1, r0 beq @0800F23C b @0800F444 @0800F23C: ldr r6, =0x00000cdc adds r1, r4, r6 ldrb r0, [r1] movs r0, 0 strb r0, [r1] ldr r1, =0x02022b44 ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] ldrb r7, [r2] movs r5, 0 @0800F252: movs r0, 0x1 ands r0, r7 lsrs r1, r7, 1 str r1, [sp, 0x4] adds r2, r5, 0x1 str r2, [sp] cmp r0, 0 bne @0800F264 b @0800F364 @0800F264: ldr r1, =0x03005000 lsls r2, r5, 3 subs r0, r2, r5 lsls r4, r0, 1 adds r0, r1, 0 adds r0, 0x15 adds r0, r4, r0 ldrb r0, [r0] adds r6, r1, 0 adds r3, r2, 0 lsls r1, r5, 24 mov r10, r1 cmp r0, 0 beq @0800F35C ldr r2, =0x00000cee adds r0, r6, r2 adds r1, r5, r0 ldrb r0, [r1] cmp r0, 0xFF beq @0800F2E0 adds r0, r6, 0 adds r0, 0x14 adds r0, r4, r0 ldrb r2, [r0] lsrs r2, 5 ldrb r0, [r1] adds r0, 0x1 movs r1, 0x7 ands r0, r1 cmp r2, r0 beq @0800F2E0 ldr r0, =0x00000cea adds r1, r6, r0 adds r1, r5, r1 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bls @0800F35C movs r0, 0x81 lsls r0, 8 bl sub_8011170 b @0800F35C .align 2, 0 .pool @0800F2E0: ldr r2, =0x03005000 ldr r6, =0x00000cee adds r1, r2, r6 adds r1, r5, r1 subs r3, r5 lsls r3, 1 adds r4, r2, 0 adds r4, 0x14 adds r2, r3, r4 ldrb r0, [r2] lsrs r0, 5 strb r0, [r1] ldr r1, =0x03005000 subs r6, 0x4 adds r0, r1, r6 adds r0, r5, r0 movs r1, 0 strb r1, [r0] ldrb r1, [r2] movs r0, 0x1F ands r0, r1 strb r0, [r2] ldr r2, =0x03005cde adds r0, r5, r2 ldrb r0, [r0] movs r6, 0 lsls r1, r5, 24 mov r10, r1 lsrs r2, r7, 1 str r2, [sp, 0x4] adds r5, 0x1 str r5, [sp] ldr r1, =0x03003090 mov r9, r1 adds r5, r3, 0 adds r7, r4, 0 lsls r0, 4 mov r8, r0 adds r2, r5, 0x1 mov r12, r2 @0800F330: lsls r1, r6, 1 mov r0, r8 adds r4, r1, r0 add r4, r9 mov r2, r12 adds r3, r1, r2 adds r3, r7 ldrb r2, [r3] lsls r2, 8 adds r1, r5 adds r1, r7 ldrb r0, [r1] orrs r0, r2 strh r0, [r4] movs r0, 0 strb r0, [r3] strb r0, [r1] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0x6 bls @0800F330 @0800F35C: mov r1, r10 lsrs r0, r1, 24 bl rfu_UNI_clearRecvNewDataFlag @0800F364: ldr r2, [sp, 0x4] lsls r0, r2, 16 lsrs r7, r0, 16 ldr r6, [sp] lsls r0, r6, 16 lsrs r5, r0, 16 cmp r5, 0x3 bhi @0800F376 b @0800F252 @0800F376: bl sub_800F014 movs r0, 0 bl sub_800F86C bl sub_8010528 ldr r4, =0x03005000 ldr r1, =0x00000ce5 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 beq @0800F452 ldr r2, =0x00000cd9 adds r0, r4, r2 ldrb r2, [r0] cmp r2, 0 bne @0800F452 ldr r0, =0x02022b44 ldrb r1, [r0, 0xE] strb r2, [r0, 0xE] ldr r6, =0x00000cda adds r0, r4, r6 ldrb r1, [r0] movs r0, 0x3 bl rfu_clearSlot movs r5, 0 adds r7, r4, 0 adds r7, 0x14 @0800F3B2: ldr r0, =0x00000ce5 adds r6, r4, r0 ldrb r0, [r6] asrs r0, r5 movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0800F3D6 lsls r1, r5, 24 lsrs r1, 24 lsls r2, r5, 3 subs r2, r5 lsls r2, 1 adds r2, r7 movs r0, 0x10 movs r3, 0xE bl rfu_setRecvBuffer @0800F3D6: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x3 bls @0800F3B2 subs r4, r6, 0x3 ldrb r0, [r4] ldrb r2, [r6] adds r1, r0, 0 orrs r1, r2 bl sub_800E88C ldrb r1, [r6] movs r2, 0 strb r1, [r6, 0x4] ldrb r0, [r4] orrs r0, r1 strb r0, [r4] strb r2, [r6] ldrb r0, [r4] adds r1, r6, 0 subs r1, 0x5E movs r2, 0x46 bl rfu_UNI_setSendData ldrb r0, [r4] bl sub_800E87C adds r1, r6, 0 subs r1, 0xB strb r0, [r1] ldr r0, =sub_8010AAC movs r1, 0 bl AddTask b @0800F452 .align 2, 0 .pool @0800F444: ldr r2, =0x00000cdc adds r1, r4, r2 ldrb r0, [r1] movs r2, 0 movs r0, 0x1 strb r0, [r1] strb r2, [r4, 0xE] @0800F452: ldr r1, =0x03005000 movs r0, 0 strb r0, [r1, 0xE] adds r6, r1, 0 @0800F45A: ldr r1, =0x00000cdc adds r0, r6, r1 ldrb r0, [r0] adds r1, r0, 0 ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x6] cmp r0, 0 beq @0800F484 movs r0, 0x1 ands r0, r1 b @0800F486 .align 2, 0 .pool @0800F480: movs r0, 0 b @0800F486 @0800F484: movs r0, 0 @0800F486: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_800F1E0 thumb_func_start sub_800F498 sub_800F498: ; 800F498 push {r4,r5,lr} adds r4, r0, 0 adds r2, r1, 0 ldrh r1, [r4] cmp r1, 0 beq @0800F4DC ldr r0, =0x03005000 movs r5, 0x81 lsls r5, 1 adds r3, r0, r5 ldrb r0, [r3] lsls r0, 5 orrs r0, r1 strh r0, [r4] ldrb r0, [r3] adds r0, 0x1 movs r1, 0x7 ands r0, r1 strb r0, [r3] adds r3, r4, 0 movs r4, 0x6 @0800F4C2: ldrh r1, [r3] lsrs r0, r1, 8 strb r0, [r2, 0x1] strb r1, [r2] adds r2, 0x2 adds r3, 0x2 subs r4, 0x1 cmp r4, 0 bge @0800F4C2 b @0800F4EA .align 2, 0 .pool @0800F4DC: movs r1, 0 adds r0, r2, 0 adds r0, 0xD @0800F4E2: strb r1, [r0] subs r0, 0x1 cmp r0, r2 bge @0800F4E2 @0800F4EA: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_800F498 thumb_func_start sub_800F4F0 sub_800F4F0: ; 800F4F0 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x58 ldr r0, =0x03005124 mov r1, sp bl sub_800D934 movs r1, 0 ldr r0, =0x03003090 mov r12, r0 @0800F506: movs r4, 0 lsls r0, r1, 3 adds r2, r1, 0x1 mov r8, r2 lsls r6, r1, 4 subs r0, r1 lsls r5, r0, 1 @0800F514: lsls r1, r4, 1 adds r3, r1, r6 add r3, r12 adds r1, r5, r1 adds r0, r1, 0x1 add r0, sp ldrb r2, [r0] lsls r2, 8 mov r7, sp adds r0, r7, r1 ldrb r0, [r0] orrs r0, r2 strh r0, [r3] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x6 bls @0800F514 mov r1, r8 lsls r0, r1, 24 lsrs r1, r0, 24 cmp r1, 0x4 bls @0800F506 movs r0, 0 bl sub_800F86C ldr r0, =0x03004140 ldrb r0, [r0, 0x2] cmp r0, 0 bne @0800F5C0 ldr r0, =0x03005000 ldr r2, =0x00000ce4 adds r0, r2 ldrb r0, [r0] cmp r0, 0 beq @0800F5C0 ldr r0, =0x03007890 ldr r0, [r0] ldrb r1, [r0, 0x2] ldrb r0, [r0, 0x3] orrs r0, r1 bl rfu_REQ_disconnect bl rfu_waitREQComplete bl sub_8011A74 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0800F58C cmp r0, 0x6 beq @0800F58C cmp r0, 0x9 beq @0800F58C movs r1, 0x90 lsls r1, 8 movs r0, 0x2 bl sub_8011A64 @0800F58C: bl rfu_clearAllSlot ldr r1, =0x03003124 movs r0, 0 strb r0, [r1] ldr r0, =0x03005000 movs r5, 0 str r5, [r0] ldr r7, =0x00000ce4 adds r6, r0, r7 ldrb r0, [r6] cmp r0, 0x1 bne @0800F5B8 movs r4, 0x90 lsls r4, 8 movs r0, 0x2 adds r1, r4, 0 bl sub_8011A64 adds r0, r4, 0 bl sub_8011170 @0800F5B8: ldr r0, =0x03004140 strb r5, [r0, 0x5] strb r5, [r0, 0x4] strb r5, [r6] @0800F5C0: ldr r6, =0x03005000 movs r0, 0xCD lsls r0, 4 adds r2, r6, r0 ldrb r0, [r2] cmp r0, 0 beq @0800F604 ldrb r0, [r2] subs r0, 0x1 ldrb r1, [r2] strb r0, [r2] bl sub_8010528 ldr r5, =0x03003110 add r4, sp, 0x48 adds r0, r5, 0 adds r1, r4, 0 bl sub_800F498 ldr r1, =0x000009e8 adds r0, r6, r1 adds r1, r4, 0 bl sub_800D888 movs r1, 0 movs r2, 0 @0800F5F4: lsls r0, r1, 1 adds r0, r5 strh r2, [r0] adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x6 bls @0800F5F4 @0800F604: bl sub_800F0B8 add sp, 0x58 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800F4F0 thumb_func_start sub_800F638 sub_800F638: ; 800F638 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x03005000 ldr r2, [r0, 0x70] mov r10, r2 movs r5, 0 adds r2, r0, 0 adds r2, 0x6E ldrh r3, [r2] cmp r5, r3 bge @0800F6D4 mov r9, r0 ldr r0, =0x03000d90 mov r8, r0 @0800F65A: movs r0, 0x1 ands r0, r1 lsrs r7, r1, 1 adds r6, r5, 0x1 cmp r0, 0 bne @0800F6C8 ldr r1, =0xffff8900 adds r0, r1, 0 adds r1, r5, 0 orrs r1, r0 mov r2, r8 strh r1, [r2] movs r4, 0 lsls r0, r5, 1 ldr r3, =0x03000d80 mov r12, r3 adds r0, r5 lsls r0, 2 mov r1, r10 adds r2, r0, r1 mov r3, r8 adds r3, 0x2 @0800F686: ldrb r1, [r2, 0x1] lsls r1, 8 ldrb r0, [r2] orrs r0, r1 strh r0, [r3] adds r2, 0x2 adds r3, 0x2 adds r4, 0x1 cmp r4, 0x6 ble @0800F686 movs r4, 0 ldr r2, =0x03000d90 ldr r1, =0x03000d80 @0800F6A0: ldrh r0, [r2] lsrs r0, 8 strb r0, [r1, 0x1] ldrh r0, [r2] strb r0, [r1] adds r2, 0x2 adds r1, 0x2 adds r4, 0x1 cmp r4, 0x6 ble @0800F6A0 ldr r0, =0x030059e8 mov r1, r12 bl sub_800D888 movs r1, 0x1 lsls r1, r5 mov r2, r9 ldr r0, [r2, 0x78] orrs r0, r1 str r0, [r2, 0x78] @0800F6C8: adds r1, r7, 0 adds r5, r6, 0 ldr r3, =0x0300506e ldrh r3, [r3] cmp r5, r3 blt @0800F65A @0800F6D4: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800F638 thumb_func_start sub_800F6FC sub_800F6FC: ; 800F6FC push {lr} lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x03005000 ldrb r2, [r0, 0xC] cmp r2, 0x1 bne @0800F71C cmp r1, 0 beq @0800F71C adds r0, 0x61 adds r0, r1, r0 strb r2, [r0] b @0800F724 .align 2, 0 .pool @0800F71C: adds r0, 0x5C adds r0, r1, r0 movs r1, 0x1 strb r1, [r0] @0800F724: pop {r0} bx r0 thumb_func_end sub_800F6FC thumb_func_start sub_800F728 sub_800F728: ; 800F728 lsls r0, 24 lsrs r0, 24 ldr r3, =0x03005000 adds r1, r3, 0 adds r1, 0x5C adds r1, r0, r1 movs r2, 0 strb r2, [r1] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r3 adds r1, 0x92 strb r2, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_800F728 thumb_func_start sub_800F74C sub_800F74C: ; 800F74C push {r4,r5,lr} adds r3, r0, 0 ldr r0, =0x03005000 ldrb r1, [r0, 0xC] adds r5, r0, 0 cmp r1, 0x1 bne @0800F764 movs r0, 0 b @0800F786 .align 2, 0 .pool @0800F764: movs r2, 0 ldr r0, =0x00000cde adds r4, r5, r0 @0800F76A: adds r1, r2, r4 adds r0, r3, r2 ldrb r0, [r0] strb r0, [r1] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @0800F76A ldr r1, =0x00000c3e adds r0, r5, r1 ldrb r0, [r0] adds r0, r3 ldrb r0, [r0] @0800F786: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800F74C thumb_func_start rfu_func_080F97B8 rfu_func_080F97B8: ; 800F794 push {lr} ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0800F7C6 ldr r3, =0x03005da8 ldrh r2, [r3] cmp r2, 0 beq @0800F7C6 ldr r0, =0x030022b4 ldrb r0, [r0] cmp r0, 0x1 beq @0800F7C6 ldr r1, =0x03000d78 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldrb r0, [r1] lsls r0, 8 orrs r0, r2 strh r0, [r3] movs r0, 0xBE lsls r0, 8 bl sub_800FD14 @0800F7C6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end rfu_func_080F97B8 thumb_func_start sub_800F7DC sub_800F7DC: ; 800F7DC ldr r0, =0x02022b14 bx lr .align 2, 0 .pool thumb_func_end sub_800F7DC thumb_func_start sub_800F7E4 sub_800F7E4: ; 800F7E4 push {lr} movs r2, 0 ldr r0, =0x03005000 ldr r1, [r0] ldr r0, =rfu_func_080F97B8 cmp r1, r0 bne @0800F7F4 movs r2, 0x1 @0800F7F4: adds r0, r2, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800F7E4 thumb_func_start sub_800F804 sub_800F804: ; 800F804 ldr r1, =0x03005000 ldr r0, =rfu_func_080F97B8 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_800F804 thumb_func_start Rfu_set_zero Rfu_set_zero: ; 800F814 ldr r1, =0x03005000 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end Rfu_set_zero thumb_func_start sub_800F820 sub_800F820: ; 800F820 push {lr} movs r0, 0x88 lsls r0, 7 bl sub_800FD14 bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @0800F83C bl sub_8082D18 ldr r1, =0x03003110 strh r0, [r1, 0xC] @0800F83C: ldr r1, =0x020223c0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800F820 thumb_func_start sub_800F850 sub_800F850: ; 800F850 push {lr} ldr r1, =0x03005000 ldr r0, [r1] cmp r0, 0 bne @0800F85E ldr r0, =sub_800F820 str r0, [r1] @0800F85E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800F850 thumb_func_start sub_800F86C sub_800F86C: ; 800F86C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r0, 0 mov r8, r0 @0800F87A: mov r1, r8 lsls r0, r1, 4 ldr r2, =0x03003090 adds r1, r0, r2 ldrh r7, [r1] movs r3, 0xFF lsls r3, 8 adds r1, r3, 0 ands r1, r7 movs r2, 0x88 lsls r2, 8 adds r5, r0, 0 cmp r1, r2 beq @0800F960 cmp r1, r2 bgt @0800F8D6 movs r0, 0xCC lsls r0, 7 cmp r1, r0 bne @0800F8A4 b @0800FAE0 @0800F8A4: cmp r1, r0 bgt @0800F8C4 movs r0, 0x88 lsls r0, 7 cmp r1, r0 bne @0800F8B2 b @0800FBF4 @0800F8B2: movs r0, 0xBE lsls r0, 7 cmp r1, r0 bne @0800F8BC b @0800FAD0 @0800F8BC: b @0800FC04 .align 2, 0 .pool @0800F8C4: movs r0, 0xEE lsls r0, 7 cmp r1, r0 beq @0800F920 movs r0, 0xF0 lsls r0, 7 cmp r1, r0 beq @0800F90E b @0800FC04 @0800F8D6: movs r0, 0xBE lsls r0, 8 cmp r1, r0 bne @0800F8E0 b @0800FBF4 @0800F8E0: cmp r1, r0 bgt @0800F8F8 movs r0, 0x89 lsls r0, 8 cmp r1, r0 beq @0800F9C8 movs r0, 0xA1 lsls r0, 8 cmp r1, r0 bne @0800F8F6 b @0800FAAC @0800F8F6: b @0800FC04 @0800F8F8: movs r0, 0xED lsls r0, 8 cmp r1, r0 bne @0800F902 b @0800FB10 @0800F902: movs r0, 0xEE lsls r0, 8 cmp r1, r0 bne @0800F90C b @0800FBB0 @0800F90C: b @0800FC04 @0800F90E: ldr r4, =0x03005000 ldrb r0, [r4, 0xC] cmp r0, 0 bne @0800F920 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0800F920 b @0800FC50 @0800F920: ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0] mov r6, r8 adds r6, 0x1 cmp r0, 0 beq @0800F930 b @0800FC08 @0800F930: ldr r1, =0x03003092 adds r0, r5, r1 ldrh r0, [r0] ldr r2, =0x03005000 strb r0, [r2, 0xD] ldr r3, =0x03003094 adds r0, r5, r3 bl sub_800F74C ldr r4, =0x03005cce strb r0, [r4] b @0800FC08 .align 2, 0 .pool @0800F960: ldr r0, =0x03005000 mov r9, r0 mov r1, r8 lsls r0, r1, 2 add r0, r8 lsls r7, r0, 2 mov r2, r9 adds r3, r7, r2 movs r4, 0x92 adds r4, r3 mov r12, r4 ldrb r4, [r4] mov r6, r8 adds r6, 0x1 cmp r4, 0 beq @0800F982 b @0800FC08 @0800F982: adds r0, r3, 0 adds r0, 0x80 movs r2, 0 strh r4, [r0] ldr r1, =0x03003092 adds r0, r5, r1 ldrh r0, [r0] adds r1, r3, 0 adds r1, 0x82 strh r0, [r1] ldr r1, =0x03003094 adds r0, r5, r1 ldrh r1, [r0] adds r0, r3, 0 adds r0, 0x91 strb r1, [r0] mov r0, r9 adds r0, 0x88 adds r0, r7, r0 str r4, [r0] movs r0, 0x1 mov r3, r12 strb r0, [r3] mov r0, r9 adds r0, 0x5C add r0, r8 strb r2, [r0] b @0800FC08 .align 2, 0 .pool @0800F9C8: ldr r4, =0x03005000 mov r9, r4 mov r0, r8 lsls r1, r0, 2 adds r0, r1, r0 lsls r4, r0, 2 mov r3, r9 adds r2, r4, r3 adds r0, r2, 0 adds r0, 0x92 ldrb r3, [r0] mov r10, r1 mov r6, r8 adds r6, 0x1 cmp r3, 0x1 beq @0800F9EA b @0800FC08 @0800F9EA: movs r0, 0xFF ands r0, r7 adds r2, 0x80 strh r0, [r2] mov r1, r9 adds r1, 0x88 adds r1, r4, r1 lsls r3, r0 ldr r0, [r1] orrs r0, r3 str r0, [r1] movs r4, 0 ldr r0, =0x020223c4 mov r9, r0 mov r12, r2 mov r1, r8 lsls r7, r1, 8 adds r3, r5, 0 @0800FA0E: mov r2, r12 ldrh r0, [r2] lsls r1, r0, 1 adds r1, r0 lsls r1, 1 adds r1, r4 lsls r1, 1 adds r1, r7 add r1, r9 adds r2, r4, 0x1 lsls r0, r2, 1 adds r0, r3 ldr r4, =0x03003090 adds r0, r4 ldrh r0, [r0] strh r0, [r1] lsls r2, 16 lsrs r4, r2, 16 cmp r4, 0x5 bls @0800FA0E ldr r4, =0x03005000 mov r0, r10 add r0, r8 lsls r0, 2 adds r1, r4, 0 adds r1, 0x88 adds r1, r0, r1 adds r2, r0, r4 adds r0, r2, 0 adds r0, 0x82 ldrh r0, [r0] lsls r0, 2 ldr r3, =gUnknown_082ED628 adds r0, r3 ldr r1, [r1] ldr r0, [r0] cmp r1, r0 beq @0800FA5C b @0800FC08 @0800FA5C: adds r1, r2, 0 adds r1, 0x92 movs r0, 0x2 strb r0, [r1] mov r1, r8 lsls r0, r1, 24 lsrs r0, 24 bl sub_800F6FC bl sub_800F7DC ldrb r1, [r0, 0xA] movs r0, 0x7F ands r0, r1 cmp r0, 0x45 beq @0800FA7E b @0800FC08 @0800FA7E: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0800FA88 b @0800FC08 @0800FA88: ldrb r0, [r4, 0xC] cmp r0, 0 beq @0800FA90 b @0800FC08 @0800FA90: ldr r0, =0x020223c4 bl sub_8010A70 b @0800FC08 .align 2, 0 .pool @0800FAAC: ldr r2, =gUnknown_082ED6B8 ldr r3, =0x03003092 adds r0, r5, r3 ldrh r1, [r0] lsls r1, 3 adds r0, r1, r2 ldr r0, [r0] adds r2, 0x4 adds r1, r2 ldrh r1, [r1] bl sub_800FE84 b @0800FC04 .align 2, 0 .pool @0800FAD0: ldr r1, =0x030050e4 add r1, r8 movs r0, 0x1 strb r0, [r1] b @0800FC04 .align 2, 0 .pool @0800FAE0: ldr r2, =0x03005000 movs r4, 0x80 lsls r4, 1 adds r0, r2, r4 ldr r3, =0x03003092 adds r1, r5, r3 ldrh r0, [r0] mov r6, r8 adds r6, 0x1 ldrh r1, [r1] cmp r0, r1 beq @0800FAFA b @0800FC08 @0800FAFA: adds r0, r2, 0 adds r0, 0xE9 add r0, r8 movs r1, 0x1 strb r1, [r0] b @0800FC08 .align 2, 0 .pool @0800FB10: ldr r7, =0x03005000 ldrb r2, [r7, 0xC] cmp r2, 0 bne @0800FB78 ldr r3, =0x03003124 ldrb r0, [r3] mov r6, r8 adds r6, 0x1 cmp r0, 0 beq @0800FC08 ldr r0, =0x03003092 adds r4, r5, r0 ldrh r1, [r4] ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0, 0x2] ands r1, r0 cmp r1, 0 beq @0800FB48 strb r2, [r3] bl sub_800D630 ldr r1, =0x03003094 adds r0, r5, r1 ldrh r1, [r0] ldr r2, =0x00000ce4 adds r0, r7, r2 strb r1, [r0] @0800FB48: ldr r0, =0x03003090 adds r0, 0x6 adds r0, r5, r0 ldrh r0, [r0] strb r0, [r7, 0xD] ldrh r0, [r4] bl sub_80109E8 b @0800FC08 .align 2, 0 .pool @0800FB78: movs r0, 0xEE lsls r0, 8 bl sub_800FD14 ldr r1, =0x03003110 ldr r3, =0x03003092 adds r0, r5, r3 ldrh r0, [r0] strh r0, [r1, 0x2] ldr r4, =0x03003094 adds r0, r5, r4 ldrh r0, [r0] strh r0, [r1, 0x4] ldr r0, =0x03003090 adds r0, 0x6 adds r0, r5, r0 ldrh r0, [r0] strh r0, [r1, 0x6] b @0800FC04 .align 2, 0 .pool @0800FBB0: ldr r4, =0x03005000 ldrb r0, [r4, 0xC] mov r6, r8 adds r6, 0x1 cmp r0, 0x1 bne @0800FC44 ldr r0, =0x00000ce3 adds r2, r4, r0 ldr r1, =0x03003092 adds r3, r5, r1 ldrb r1, [r3] ldrb r0, [r2] orrs r0, r1 strb r0, [r2] ldr r2, =0x03003094 adds r0, r5, r2 ldrh r1, [r0] ldr r2, =0x00000ce4 adds r0, r4, r2 strb r1, [r0] ldrh r0, [r3] bl sub_80109E8 b @0800FC08 .align 2, 0 .pool @0800FBF4: ldr r0, =0x03003020 mov r3, r8 lsls r1, r3, 1 adds r1, r0 ldr r4, =0x03003092 adds r0, r5, r4 ldrh r0, [r0] strh r0, [r1] @0800FC04: mov r6, r8 adds r6, 0x1 @0800FC08: ldr r3, =0x03005000 ldrb r4, [r3, 0xC] cmp r4, 0x1 bne @0800FC44 adds r0, r3, 0 adds r0, 0x61 mov r1, r8 adds r2, r1, r0 ldrb r0, [r2] adds r1, r0, 0 cmp r1, 0 beq @0800FC44 cmp r1, 0x4 bne @0800FC40 adds r0, r3, 0 adds r0, 0x5C add r0, r8 movs r1, 0 strb r4, [r0] strb r1, [r2] b @0800FC44 .align 2, 0 .pool @0800FC40: adds r0, 0x1 strb r0, [r2] @0800FC44: lsls r0, r6, 16 lsrs r0, 16 mov r8, r0 cmp r0, 0x4 bhi @0800FC50 b @0800F87A @0800FC50: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_800F86C thumb_func_start sub_800FC60 sub_800FC60: ; 800FC60 push {lr} movs r2, 0 ldr r0, =0x03005000 adds r1, r0, 0 adds r1, 0x92 @0800FC6A: ldrb r0, [r1] cmp r0, 0 beq @0800FC78 movs r0, 0 b @0800FC82 .align 2, 0 .pool @0800FC78: adds r1, 0x14 adds r2, 0x1 cmp r2, 0x4 ble @0800FC6A movs r0, 0x1 @0800FC82: pop {r1} bx r1 thumb_func_end sub_800FC60 thumb_func_start sub_800FC88 sub_800FC88: ; 800FC88 push {r4,lr} movs r1, 0 ldr r2, =0x03005000 ldrb r0, [r2, 0xD] cmp r1, r0 bge @0800FCBC adds r4, r0, 0 adds r3, r2, 0 adds r3, 0x92 adds r2, 0x5C @0800FC9C: ldrb r0, [r3] cmp r0, 0x2 bne @0800FCAA adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x1 beq @0800FCB4 @0800FCAA: movs r0, 0 b @0800FCBE .align 2, 0 .pool @0800FCB4: adds r3, 0x14 adds r1, 0x1 cmp r1, r4 blt @0800FC9C @0800FCBC: movs r0, 0x1 @0800FCBE: pop {r4} pop {r1} bx r1 thumb_func_end sub_800FC88 thumb_func_start sub_800FCC4 sub_800FCC4: ; 800FCC4 movs r2, 0 movs r1, 0 strh r1, [r0] strh r1, [r0, 0x2] str r1, [r0, 0x4] str r1, [r0, 0x8] strb r2, [r0, 0x10] strb r2, [r0, 0x11] strb r2, [r0, 0x12] bx lr thumb_func_end sub_800FCC4 thumb_func_start sub_800FCD8 sub_800FCD8: ; 800FCD8 push {r4,lr} movs r2, 0 movs r1, 0 ldr r0, =0x03005000 adds r3, r0, 0 adds r3, 0x92 adds r4, r0, 0 adds r4, 0x5C @0800FCE8: ldrb r0, [r3] cmp r0, 0x2 bne @0800FCFE adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0x1 bne @0800FCFE lsls r0, r1 orrs r2, r0 lsls r0, r2, 24 lsrs r2, r0, 24 @0800FCFE: adds r3, 0x14 adds r1, 0x1 cmp r1, 0x4 ble @0800FCE8 adds r0, r2, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800FCD8 thumb_func_start sub_800FD14 sub_800FD14: ; 800FD14 push {r4,r5,lr} lsls r0, 16 lsrs r1, r0, 16 ldr r5, =0x03003110 strh r1, [r5] movs r0, 0xF0 lsls r0, 7 adds r4, r5, 0 cmp r1, r0 beq @0800FDB0 cmp r1, r0 bgt @0800FD62 movs r0, 0xBE lsls r0, 7 cmp r1, r0 beq @0800FE00 cmp r1, r0 bgt @0800FD50 movs r0, 0xBC lsls r0, 6 cmp r1, r0 beq @0800FE20 movs r0, 0x88 lsls r0, 7 cmp r1, r0 beq @0800FE14 b @0800FE46 .align 2, 0 .pool @0800FD50: movs r0, 0xCC lsls r0, 7 cmp r1, r0 beq @0800FE00 movs r0, 0xEE lsls r0, 7 cmp r1, r0 beq @0800FDB0 b @0800FE46 @0800FD62: movs r0, 0xBE lsls r0, 8 cmp r1, r0 beq @0800FE40 cmp r1, r0 bgt @0800FE46 movs r0, 0x88 lsls r0, 8 cmp r1, r0 beq @0800FD80 movs r0, 0xA1 lsls r0, 8 cmp r1, r0 beq @0800FD98 b @0800FE46 @0800FD80: ldr r0, =0x03005000 adds r1, r0, 0 adds r1, 0x6E ldrh r1, [r1] strh r1, [r5, 0x2] adds r0, 0x7D ldrb r0, [r0] adds r0, 0x80 strh r0, [r5, 0x4] b @0800FE46 .align 2, 0 .pool @0800FD98: bl sub_800FC60 lsls r0, 24 cmp r0, 0 beq @0800FE46 ldr r0, =0x03005000 adds r0, 0x5A ldrb r0, [r0] b @0800FE44 .align 2, 0 .pool @0800FDB0: ldr r3, =0x03005000 ldr r1, =0x00000ce2 adds r0, r3, r1 ldr r2, =0x00000ce3 adds r1, r3, r2 ldrb r2, [r0] ldrb r0, [r1] eors r0, r2 ldr r1, =gUnknown_082ED695 adds r0, r1 ldrb r0, [r0] adds r0, 0x1 strb r0, [r3, 0xD] ldrb r0, [r3, 0xD] strh r0, [r4, 0x2] adds r2, r4, 0x4 movs r4, 0 ldr r0, =0x00000cde adds r3, r0 @0800FDD6: adds r1, r2, r4 adds r0, r4, r3 ldrb r0, [r0] strb r0, [r1] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @0800FDD6 b @0800FE46 .align 2, 0 .pool @0800FE00: ldr r0, =0x03005000 movs r1, 0x80 lsls r1, 1 adds r0, r1 ldrh r0, [r0] strh r0, [r4, 0x2] b @0800FE46 .align 2, 0 .pool @0800FE14: strh r1, [r5] ldr r0, =0x030022c0 ldrh r0, [r0, 0x2C] b @0800FE44 .align 2, 0 .pool @0800FE20: movs r4, 0 ldr r3, =0x030050f2 @0800FE24: adds r2, r4, 0x1 lsls r1, r2, 1 adds r1, r5 lsls r0, r4, 1 adds r0, r3 ldrh r0, [r0] strh r0, [r1] lsls r2, 24 lsrs r4, r2, 24 cmp r4, 0x5 bls @0800FE24 b @0800FE46 .align 2, 0 .pool @0800FE40: ldr r0, =0x03005da8 ldrh r0, [r0] @0800FE44: strh r0, [r5, 0x2] @0800FE46: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800FD14 thumb_func_start sub_800FE50 sub_800FE50: ; 800FE50 push {r4,lr} adds r4, r0, 0 ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 bne @0800FE76 bl sub_8011A80 cmp r0, 0 bne @0800FE76 ldr r0, =0x030050f2 adds r1, r4, 0 movs r2, 0xC bl memcpy movs r0, 0xBC lsls r0, 6 bl sub_800FD14 @0800FE76: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005000 ldr r0, [r5] cmp r0, 0 bne @0800FEB8 ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 bne @0800FEB8 movs r0, 0x7C adds r0, r5 mov r9, r0 ldrb r1, [r0] mov r8, r1 cmp r1, 0 beq @0800FEC8 ldr r1, =0x02022b44 adds r1, 0x83 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0800FEB8: movs r0, 0 b @0800FF32 .align 2, 0 .pool @0800FEC8: adds r0, r6, 0 movs r1, 0xC bl __umodsi3 negs r4, r0 orrs r4, r0 lsrs r4, 31 bl link_get_multiplayer_id adds r1, r5, 0 adds r1, 0x7D strb r0, [r1] movs r0, 0x1 mov r1, r9 strb r0, [r1] adds r0, r6, 0 movs r1, 0xC bl __udivsi3 adds r0, r4 adds r1, r5, 0 adds r1, 0x6E strh r0, [r1] adds r0, r5, 0 adds r0, 0x6C mov r1, r8 strh r1, [r0] movs r0, 0x80 lsls r0, 1 cmp r6, r0 bls @0800FF0A str r7, [r5, 0x70] b @0800FF1C @0800FF0A: ldr r4, =0x020228c4 cmp r7, r4 beq @0800FF1A adds r0, r4, 0 adds r1, r7, 0 adds r2, r6, 0 bl memcpy @0800FF1A: str r4, [r5, 0x70] @0800FF1C: movs r0, 0x88 lsls r0, 8 bl sub_800FD14 ldr r0, =0x03005000 ldr r1, =rfufunc_80F9F44 str r1, [r0] adds r0, 0x5B movs r1, 0 strb r1, [r0] movs r0, 0x1 @0800FF32: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_800FE84 thumb_func_start rfufunc_80F9F44 rfufunc_80F9F44: ; 800FF4C push {r4,r5,lr} ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 bne @0800FFA0 movs r5, 0x88 lsls r5, 8 adds r0, r5, 0 bl sub_800FD14 ldr r4, =0x03005000 ldrb r0, [r4, 0xC] cmp r0, 0x1 bne @0800FF84 adds r1, r4, 0 adds r1, 0x5B ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bls @0800FFA0 b @0800FF9C .align 2, 0 .pool @0800FF84: bl link_get_multiplayer_id ldr r1, =0x03003090 lsls r0, 24 lsrs r0, 20 adds r0, r1 ldrh r1, [r0] movs r0, 0xFF lsls r0, 8 ands r0, r1 cmp r0, r5 bne @0800FFA0 @0800FF9C: ldr r0, =sub_800FFB0 str r0, [r4] @0800FFA0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end rfufunc_80F9F44 thumb_func_start sub_800FFB0 sub_800FFB0: ; 800FFB0 push {r4-r6,lr} ldr r0, =0x03005000 mov r12, r0 ldr r5, [r0, 0x70] ldr r3, =0x03003110 mov r2, r12 adds r2, 0x6C ldrh r1, [r2] movs r4, 0x89 lsls r4, 8 adds r0, r4, 0 orrs r0, r1 strh r0, [r3] movs r4, 0 adds r6, r2, 0 adds r3, 0x2 @0800FFD0: lsls r2, r4, 1 ldrh r1, [r6] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, r5 ldrb r1, [r0, 0x1] lsls r1, 8 ldrb r0, [r0] orrs r0, r1 strh r0, [r3] adds r3, 0x2 adds r4, 0x1 cmp r4, 0x6 ble @0800FFD0 mov r0, r12 adds r0, 0x6C ldrh r1, [r0] adds r1, 0x1 strh r1, [r0] adds r0, 0x2 ldrh r0, [r0] lsls r1, 16 lsrs r1, 16 cmp r0, r1 bhi @08010014 mov r0, r12 adds r0, 0x7C movs r1, 0 strb r1, [r0] ldr r0, =rfufunc_80FA020 mov r1, r12 str r0, [r1] @08010014: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_800FFB0 thumb_func_start rfufunc_80FA020 rfufunc_80FA020: ; 8010028 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r5, =0x03005000 ldr r0, [r5, 0x70] mov r8, r0 bl link_get_multiplayer_id lsls r0, 24 lsrs r6, r0, 24 ldrb r0, [r5, 0xC] cmp r0, 0 bne @080100F0 ldr r3, =0x03003110 adds r2, r5, 0 adds r2, 0x6E ldrh r0, [r2] subs r0, 0x1 ldr r4, =0xffff8900 adds r1, r4, 0 orrs r0, r1 strh r0, [r3] movs r4, 0 mov r9, r5 ldr r0, =0x03003090 mov r12, r0 lsls r5, r6, 4 adds r7, r2, 0 adds r3, 0x2 @08010064: lsls r2, r4, 1 ldrh r1, [r7] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 add r0, r8 adds r1, r0, 0 subs r1, 0xB ldrb r1, [r1] lsls r1, 8 subs r0, 0xC ldrb r0, [r0] orrs r0, r1 strh r0, [r3] adds r3, 0x2 adds r4, 0x1 cmp r4, 0x6 ble @08010064 mov r1, r12 adds r0, r5, r1 ldrb r1, [r0] mov r3, r9 adds r0, r3, 0 adds r0, 0x6E ldrh r0, [r0] subs r0, 0x1 cmp r1, r0 bne @080100F4 lsls r0, r6, 2 adds r0, r6 lsls r0, 2 adds r1, r3, 0 adds r1, 0x88 adds r1, r0, r1 ldr r2, =gUnknown_082ED628 adds r0, r3 adds r0, 0x82 ldrh r0, [r0] lsls r0, 2 adds r0, r2 ldr r1, [r1] ldr r0, [r0] cmp r1, r0 beq @080100E8 adds r0, r6, 0 bl sub_800F638 ldr r1, =0x02022b44 adds r1, 0x64 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @080100F4 .align 2, 0 .pool @080100E8: movs r0, 0 mov r4, r9 str r0, [r4] b @080100F4 @080100F0: movs r0, 0 str r0, [r5] @080100F4: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end rfufunc_80FA020 thumb_func_start sub_8010100 sub_8010100: ; 8010100 push {lr} ldr r1, =0x03005000 adds r1, 0x5A strb r0, [r1] movs r0, 0xA1 lsls r0, 8 bl sub_800FD14 movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8010100 thumb_func_start sub_801011C sub_801011C: ; 801011C push {lr} bl rfu_clearAllSlot bl sub_800C048 ldr r1, =0x03003124 movs r0, 0 strb r0, [r1] ldr r2, =0x03005000 adds r3, r2, 0 adds r3, 0xEF movs r1, 0 movs r0, 0x1 strb r0, [r3] str r1, [r2] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801011C thumb_func_start sub_8010148 sub_8010148: ; 8010148 push {lr} ldr r0, =0x03007890 ldr r0, [r0] ldrb r1, [r0, 0x2] ldrb r0, [r0, 0x3] orrs r0, r1 bl rfu_REQ_disconnect bl rfu_waitREQComplete bl sub_801011C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010148 thumb_func_start sub_8010168 sub_8010168: ; 8010168 push {r4,lr} ldr r4, =0x03005000 ldrb r0, [r4, 0xC] cmp r0, 0 bne @08010188 bl sub_800D630 ldr r0, =0x00000ce4 adds r1, r4, r0 movs r0, 0x2 strb r0, [r1] b @0801018C .align 2, 0 .pool @08010188: ldr r0, =sub_8010148 str r0, [r4] @0801018C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010168 thumb_func_start sub_8010198 sub_8010198: ; 8010198 push {lr} bl sub_800D630 ldr r2, =0x03005000 ldr r0, =0x00000ce4 adds r1, r2, r0 movs r0, 0x1 strb r0, [r1] ldr r0, =0x03007890 ldr r1, [r0] ldrb r0, [r1, 0x2] ldrb r1, [r1, 0x3] orrs r0, r1 ldr r1, =0x00000ce3 adds r2, r1 strb r0, [r2] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010198 thumb_func_start sub_80101CC sub_80101CC: ; 80101CC push {r4,r5,lr} ldr r0, =0x03005000 ldrb r5, [r0, 0xD] movs r2, 0 movs r1, 0 adds r3, r0, 0 adds r4, r3, 0 adds r4, 0xE4 @080101DC: adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0 beq @080101E6 adds r2, 0x1 @080101E6: adds r1, 0x1 cmp r1, 0x4 ble @080101DC cmp r2, r5 bne @08010220 ldr r2, =0x02022fec ldr r0, [r2] movs r1, 0x21 negs r1, r1 ands r0, r1 str r0, [r2] ldrb r0, [r3, 0xC] cmp r0, 0 bne @0801021C adds r0, r3, 0 adds r0, 0xEE ldrb r1, [r0] movs r1, 0x3 strb r1, [r0] bl sub_8010168 b @08010220 .align 2, 0 .pool @0801021C: ldr r0, =sub_8010168 str r0, [r3] @08010220: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80101CC thumb_func_start sub_801022C sub_801022C: ; 801022C push {r4,lr} ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 bne @0801024E ldr r4, =0x03005000 ldr r1, =0x00000ce8 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 bne @0801024E movs r0, 0xBE lsls r0, 7 bl sub_800FD14 ldr r0, =sub_80101CC str r0, [r4] @0801024E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801022C thumb_func_start sub_8010264 sub_8010264: ; 8010264 push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x03005000 ldr r0, [r2] cmp r0, 0 bne @08010284 ldr r1, =0x00000cd9 adds r0, r2, r1 movs r1, 0x1 strb r1, [r0] ldr r0, =sub_801022C str r0, [r2] adds r0, r3, 0 bl remove_task @08010284: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010264 thumb_func_start task_add_05_task_del_08FA224_when_no_RfuFunc task_add_05_task_del_08FA224_when_no_RfuFunc: ; 8010294 push {r4,lr} ldr r4, =sub_8010264 adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080102AC adds r0, r4, 0 movs r1, 0x5 bl AddTask @080102AC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_add_05_task_del_08FA224_when_no_RfuFunc thumb_func_start sub_80102B8 sub_80102B8: ; 80102B8 push {r4,r5,lr} bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 beq @080102E6 ldr r1, =0x03005000 ldr r2, =0x000009e6 adds r0, r1, r2 ldrb r0, [r0] adds r4, r0, 0 cmp r4, 0 bne @080102E6 adds r5, r1, 0 adds r5, 0xFE ldrh r0, [r5] cmp r0, 0x3C bls @080102E6 movs r0, 0xCC lsls r0, 7 bl sub_800FD14 strh r4, [r5] @080102E6: bl sub_8009FCC lsls r0, 24 lsrs r2, r0, 24 movs r1, 0 cmp r1, r2 bcs @08010312 ldr r0, =0x03005000 adds r3, r0, 0 adds r3, 0xE9 ldrb r0, [r3] cmp r0, 0 beq @08010312 @08010300: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, r2 bcs @08010312 adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @08010300 @08010312: ldr r4, =0x03005000 cmp r1, r2 bne @0801033E movs r1, 0 adds r3, r4, 0 adds r3, 0xE9 movs r2, 0 @08010320: adds r0, r1, r3 strb r2, [r0] adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x4 bls @08010320 movs r1, 0x80 lsls r1, 1 adds r0, r4, r1 ldrh r1, [r0] adds r1, 0x1 movs r2, 0 strh r1, [r0] str r2, [r4] @0801033E: adds r1, r4, 0 adds r1, 0xFE ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80102B8 thumb_func_start sub_8010358 sub_8010358: ; 8010358 push {r4,lr} ldr r4, =0x03005000 ldr r1, =0x000009e6 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 bne @0801037A ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 bne @0801037A movs r0, 0xCC lsls r0, 7 bl sub_800FD14 ldr r0, =sub_80102B8 str r0, [r4] @0801037A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010358 thumb_func_start sub_8010390 sub_8010390: ; 8010390 push {r4,lr} bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 beq @080103CC ldr r4, =0x03005000 ldr r1, =0x000009e6 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 bne @0801041E ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 bne @0801041E movs r0, 0xCC lsls r0, 7 bl sub_800FD14 ldr r0, =sub_80102B8 b @0801041C .align 2, 0 .pool @080103CC: bl sub_8009FCC lsls r0, 24 lsrs r2, r0, 24 movs r1, 0x1 cmp r1, r2 bcs @080103FA ldr r3, =0x03005000 adds r0, r3, 0 adds r0, 0xEA ldrb r0, [r0] cmp r0, 0 beq @080103FA adds r3, 0xE9 @080103E8: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, r2 bcs @080103FA adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @080103E8 @080103FA: cmp r1, r2 bne @0801041E ldr r4, =0x03005000 ldr r1, =0x000009e6 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 bne @0801041E ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 bne @0801041E movs r0, 0xCC lsls r0, 7 bl sub_800FD14 ldr r0, =sub_8010358 @0801041C: str r0, [r4] @0801041E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010390 thumb_func_start sub_8010434 sub_8010434: ; 8010434 push {lr} ldr r1, =0x03005000 ldr r2, [r1] cmp r2, 0 bne @08010448 ldr r0, =sub_8010390 str r0, [r1] adds r0, r1, 0 adds r0, 0xFE strh r2, [r0] @08010448: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010434 thumb_func_start sub_8010454 sub_8010454: ; 8010454 push {r4,lr} adds r3, r0, 0 ldr r1, =gUnknown_082ED6E0 ldrh r0, [r1] cmp r0, r3 beq @08010482 ldr r4, =0x0000ffff adds r2, r1, 0 @08010464: ldrh r0, [r2] cmp r0, r4 bne @08010478 movs r0, 0 b @08010484 .align 2, 0 .pool @08010478: adds r1, 0x2 adds r2, 0x2 ldrh r0, [r1] cmp r0, r3 bne @08010464 @08010482: movs r0, 0x1 @08010484: pop {r4} pop {r1} bx r1 thumb_func_end sub_8010454 thumb_func_start sub_801048C sub_801048C: ; 801048C push {lr} cmp r0, 0 beq @080104A0 movs r1, 0x96 lsls r1, 2 movs r0, 0x1 bl sub_800D550 movs r0, 0 b @080104AC @080104A0: movs r0, 0 movs r1, 0 bl sub_800D550 lsls r0, 24 lsrs r0, 24 @080104AC: pop {r1} bx r1 thumb_func_end sub_801048C thumb_func_start sub_80104B0 sub_80104B0: ; 80104B0 push {lr} ldr r0, =0x03005000 ldr r1, =0x00000cd9 adds r0, r1 movs r1, 0x1 strb r1, [r0] movs r0, 0 bl sub_800C27C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80104B0 thumb_func_start rfu_get_multiplayer_id rfu_get_multiplayer_id: ; 80104D0 push {lr} ldr r1, =0x03005000 ldrb r0, [r1, 0xC] cmp r0, 0x1 beq @080104EC ldr r2, =0x00000cce adds r0, r1, r2 ldrb r0, [r0] b @080104EE .align 2, 0 .pool @080104EC: movs r0, 0 @080104EE: pop {r1} bx r1 thumb_func_end rfu_get_multiplayer_id thumb_func_start sub_80104F4 sub_80104F4: ; 80104F4 ldr r0, =0x03005000 ldrb r0, [r0, 0xD] bx lr .align 2, 0 .pool thumb_func_end sub_80104F4 thumb_func_start sub_8010500 sub_8010500: ; 8010500 push {lr} ldr r2, =0x03005000 adds r0, r2, 0 adds r0, 0xF1 ldrb r0, [r0] cmp r0, 0x2 bne @08010518 movs r0, 0 b @08010524 .align 2, 0 .pool @08010518: movs r1, 0 ldr r0, [r2] cmp r0, 0 bne @08010522 movs r1, 0x1 @08010522: adds r0, r1, 0 @08010524: pop {r1} bx r1 thumb_func_end sub_8010500 thumb_func_start sub_8010528 sub_8010528: ; 8010528 push {lr} ldr r0, =0x03005000 ldr r0, [r0] cmp r0, 0 beq @08010536 bl _call_via_r0 @08010536: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010528 thumb_func_start sub_8010540 sub_8010540: ; 8010540 push {r4-r7,lr} mov r7, r8 push {r7} movs r7, 0 movs r5, 0 ldr r6, =0x03005000 ldr r0, =0x00000c3e adds r0, r6 mov r8, r0 @08010552: ldr r1, =0x00000cd1 adds r0, r6, r1 adds r4, r5, r0 ldrb r0, [r4] subs r0, 0x5 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @080105DA ldr r1, =0x03007880 lsls r0, r5, 2 adds r0, r1 ldr r0, [r0] ldrh r0, [r0, 0x34] cmp r0, 0x46 beq @08010576 cmp r0, 0x48 bne @080105C0 @08010576: ldr r2, =0x00000cd5 adds r0, r6, r2 adds r1, r5, r0 ldrb r0, [r1] cmp r0, 0x8 bne @080105DA movs r0, 0x9 strb r0, [r4] movs r0, 0xA strb r0, [r1] lsls r1, r5, 24 lsrs r1, 24 movs r0, 0x8 bl rfu_clearSlot movs r0, 0x80 lsls r0, 17 lsls r0, r5 lsrs r0, 24 movs r1, 0x8 adds r2, r4, 0 movs r3, 0x1 bl rfu_NI_setSendData movs r7, 0x1 b @080105DA .align 2, 0 .pool @080105C0: mov r2, r8 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r0, [r0] ldrh r0, [r0, 0x34] cmp r0, 0x47 bne @080105DA lsls r1, r5, 24 lsrs r1, 24 movs r0, 0x8 bl rfu_clearSlot @080105DA: adds r5, 0x1 cmp r5, 0x3 ble @08010552 adds r0, r7, 0 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8010540 thumb_func_start sub_80105EC sub_80105EC: ; 80105EC push {r4-r6,lr} movs r3, 0 movs r1, 0 ldr r5, =0x03005cd5 movs r6, 0x1 movs r4, 0 @080105F8: adds r2, r1, r5 ldrb r0, [r2] cmp r0, 0xB bne @0801060C adds r0, r6, 0 lsls r0, r1 orrs r3, r0 lsls r0, r3, 24 lsrs r3, r0, 24 strb r4, [r2] @0801060C: adds r1, 0x1 cmp r1, 0x3 ble @080105F8 cmp r3, 0 beq @08010620 adds r0, r3, 0 bl rfu_REQ_disconnect bl rfu_waitREQComplete @08010620: movs r1, 0 ldr r2, =0x03005cd5 @08010624: adds r0, r1, r2 ldrb r0, [r0] subs r0, 0xA lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @0801063C movs r0, 0x1 b @08010644 .align 2, 0 .pool @0801063C: adds r1, 0x1 cmp r1, 0x3 ble @08010624 movs r0, 0 @08010644: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_80105EC thumb_func_start sub_801064C sub_801064C: ; 801064C push {lr} adds r2, r0, 0 adds r0, r1, 0 lsls r2, 16 lsrs r2, 16 adds r1, r2, 0 bl sub_8011CE4 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0xFF beq @08010680 ldr r0, =0x03005000 ldr r2, =0x00000cd1 adds r0, r2 adds r0, r1, r0 ldrb r0, [r0] cmp r0, 0x9 beq @08010680 movs r0, 0 b @08010682 .align 2, 0 .pool @08010680: movs r0, 0x1 @08010682: pop {r1} bx r1 thumb_func_end sub_801064C thumb_func_start sub_8010688 sub_8010688: ; 8010688 push {r4-r6,lr} adds r6, r0, 0 adds r0, r2, 0 lsls r6, 24 lsrs r6, 24 lsls r1, 16 lsrs r1, 16 bl sub_8011CE4 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r5, =0x03005000 ldr r0, =0x00000cd1 adds r5, r0 adds r5, r4, r5 strb r6, [r5] movs r0, 0x4 adds r1, r4, 0 bl rfu_clearSlot movs r0, 0x80 lsls r0, 17 lsls r0, r4 lsrs r0, 24 movs r1, 0x8 adds r2, r5, 0 movs r3, 0x1 bl rfu_NI_setSendData pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010688 thumb_func_start sub_80106D4 sub_80106D4: ; 80106D4 push {r4,r5,lr} ldr r4, =0x03005000 ldr r0, =0x00000c85 adds r5, r4, r0 movs r0, 0x8 strb r0, [r5] ldr r0, =0x00000c3e adds r4, r0 ldrb r1, [r4] movs r0, 0x4 bl rfu_clearSlot ldrb r1, [r4] movs r0, 0x80 lsls r0, 17 lsls r0, r1 lsrs r0, 24 movs r1, 0x8 adds r2, r5, 0 movs r3, 0x1 bl rfu_NI_setSendData pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80106D4 thumb_func_start sub_8010714 sub_8010714: ; 8010714 push {lr} adds r2, r0, 0 adds r0, r1, 0 lsls r2, 16 lsrs r2, 16 adds r1, r2, 0 bl sub_8011CE4 lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @08010730 movs r0, 0x2 b @0801074A @08010730: ldr r1, =0x03007880 lsls r0, 2 adds r0, r1 ldr r0, [r0] ldrh r0, [r0] cmp r0, 0 beq @08010748 movs r0, 0 b @0801074A .align 2, 0 .pool @08010748: movs r0, 0x1 @0801074A: pop {r1} bx r1 thumb_func_end sub_8010714 thumb_func_start sub_8010750 sub_8010750: ; 8010750 push {r4,r5,lr} bl sub_8010540 movs r4, 0 ldr r0, =0x03005000 ldr r1, =0x00000cd5 adds r5, r0, r1 @0801075E: ldr r1, =0x03007880 lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] ldrh r0, [r0] subs r0, 0x26 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @08010788 adds r1, r4, r5 ldrb r0, [r1] cmp r0, 0xA bne @0801077E movs r0, 0xB strb r0, [r1] @0801077E: lsls r1, r4, 24 lsrs r1, 24 movs r0, 0x4 bl rfu_clearSlot @08010788: adds r4, 0x1 cmp r4, 0x3 ble @0801075E pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010750 thumb_func_start sub_80107A0 sub_80107A0: ; 80107A0 push {r4,r5,lr} movs r4, 0 ldr r1, =0x03005000 ldr r2, =0x00000c85 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x8 bne @080107DA ldr r2, =0x03007880 ldr r0, =0x00000c3e adds r1, r0 ldrb r0, [r1] lsls r0, 2 adds r0, r2 ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x26 beq @080107D2 ldrb r0, [r1] lsls r0, 2 adds r0, r2 ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x27 bne @080107DA @080107D2: ldrb r1, [r1] movs r0, 0x4 bl rfu_clearSlot @080107DA: ldr r2, =0x03007880 ldr r5, =0x03005000 ldr r0, =0x00000c3e adds r1, r5, r0 ldrb r0, [r1] lsls r0, 2 adds r0, r2 ldr r0, [r0] ldrh r0, [r0, 0x34] cmp r0, 0x46 beq @080107FE ldrb r0, [r1] lsls r0, 2 adds r0, r2 ldr r0, [r0] ldrh r0, [r0, 0x34] cmp r0, 0x48 bne @0801082C @080107FE: ldrb r1, [r1] movs r0, 0x8 bl rfu_clearSlot ldr r2, =0x00000c86 adds r4, r5, r2 ldrb r0, [r4] movs r1, 0 bl sub_8011A64 ldrb r4, [r4] b @08010844 .align 2, 0 .pool @0801082C: ldrb r0, [r1] lsls r0, 2 adds r0, r2 ldr r0, [r0] ldrh r0, [r0, 0x34] cmp r0, 0x47 bne @08010844 ldrb r1, [r1] movs r0, 0x8 bl rfu_clearSlot movs r4, 0x6 @08010844: adds r0, r4, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80107A0 thumb_func_start sub_801084C sub_801084C: ; 801084C push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 ldr r5, =0x03005000 adds r0, r5, 0 adds r0, 0xF1 ldrb r0, [r0] subs r0, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @08010872 ldr r0, =0x00000ce8 adds r1, r5, r0 movs r0, 0 strb r0, [r1] adds r0, r6, 0 bl remove_task @08010872: ldr r2, =0x03005e00 lsls r1, r6, 2 adds r0, r1, r6 lsls r0, 3 adds r4, r0, r2 movs r2, 0x8 ldrsh r0, [r4, r2] adds r7, r1, 0 cmp r0, 0x3 beq @0801091C cmp r0, 0x3 bgt @080108A4 cmp r0, 0x1 beq @080108CC cmp r0, 0x1 bgt @08010918 cmp r0, 0 beq @080108B6 b @080109D2 .align 2, 0 .pool @080108A4: cmp r0, 0x5 beq @08010950 cmp r0, 0x5 blt @0801093E cmp r0, 0x6 beq @08010984 cmp r0, 0x65 beq @08010904 b @080109D2 @080108B6: bl sub_800FC60 lsls r0, 24 cmp r0, 0 bne @080108C2 b @080109D2 @080108C2: bl sub_800A5B4 bl sub_800B348 b @08010948 @080108CC: ldrb r0, [r5, 0xC] cmp r0, 0x1 bne @0801090C ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080108E8 movs r0, 0xF0 lsls r0, 7 bl sub_800FD14 b @080108F0 .align 2, 0 .pool @080108E8: movs r0, 0xEE lsls r0, 7 bl sub_800FD14 @080108F0: ldr r0, =0x03005e00 adds r1, r7, r6 lsls r1, 3 adds r1, r0 movs r0, 0x65 strh r0, [r1, 0x8] b @080109D2 .align 2, 0 .pool @08010904: ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 bne @080109D2 @0801090C: movs r0, 0x2 strh r0, [r4, 0x8] b @080109D2 .align 2, 0 .pool @08010918: ldrb r0, [r5, 0xD] b @08010944 @0801091C: ldrb r0, [r5, 0xC] cmp r0, 0x1 bne @08010948 bl sub_800FC60 lsls r0, 24 cmp r0, 0 beq @080109D2 adds r1, r5, 0 adds r1, 0x5A movs r0, 0 strb r0, [r1] movs r0, 0xA1 lsls r0, 8 bl sub_800FD14 b @08010948 @0801093E: bl sub_800FC88 lsls r0, 24 @08010944: cmp r0, 0 beq @080109D2 @08010948: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @080109D2 @08010950: movs r4, 0 ldrb r0, [r5, 0xD] cmp r4, r0 bge @0801096E @08010958: adds r0, r4, 0 bl sub_800B3A4 lsls r0, r4, 24 lsrs r0, 24 bl sub_800F728 adds r4, 0x1 ldrb r2, [r5, 0xD] cmp r4, r2 blt @08010958 @0801096E: ldr r0, =0x03005e00 adds r1, r7, r6 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @080109D2 .align 2, 0 .pool @08010984: adds r0, r6, 0 bl remove_task ldr r1, =0x03003124 movs r0, 0x1 strb r0, [r1] ldr r0, =0x00000ce8 adds r1, r5, r0 movs r0, 0 strb r0, [r1] movs r1, 0x96 lsls r1, 2 movs r0, 0x1 bl sub_800D550 ldr r2, =0x00000ce6 adds r1, r5, r2 ldrb r0, [r1] cmp r0, 0 beq @080109D2 movs r4, 0 adds r2, r1, 0 movs r3, 0x1 ldr r0, =0x00000ce5 adds r5, r0 @080109B6: ldrb r0, [r2] asrs r0, r4 ands r0, r3 cmp r0, 0 beq @080109CC adds r0, r3, 0 lsls r0, r4 strb r0, [r5] ldrb r1, [r2] eors r0, r1 strb r0, [r2] @080109CC: adds r4, 0x1 cmp r4, 0x3 ble @080109B6 @080109D2: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801084C thumb_func_start sub_80109E8 sub_80109E8: ; 80109E8 push {r4,r5,lr} lsls r0, 16 lsrs r2, r0, 16 movs r1, 0 movs r5, 0x1 ldr r4, =0x03005cde movs r3, 0 @080109F6: adds r0, r2, 0 asrs r0, r1 ands r0, r5 cmp r0, 0 beq @08010A04 adds r0, r1, r4 strb r3, [r0] @08010A04: adds r1, 0x1 cmp r1, 0x3 ble @080109F6 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80109E8 thumb_func_start sub_8010A14 sub_8010A14: ; 8010A14 push {r4-r7,lr} adds r2, r0, 0 ldr r1, =0x03005000 ldrb r0, [r2, 0xF] strb r0, [r1, 0xD] movs r4, 0 ldr r0, =0x00000cde adds r5, r1, r0 adds r3, r2, 0 adds r3, 0x10 @08010A28: adds r0, r4, r5 adds r1, r3, r4 ldrb r1, [r1] strb r1, [r0] adds r4, 0x1 cmp r4, 0x3 ble @08010A28 adds r6, r2, 0 ldr r5, =0x020229e8 movs r4, 0x4 @08010A3C: adds r0, r5, 0 adds r1, r6, 0 adds r1, 0x14 ldm r1!, {r2,r3,r7} stm r0!, {r2,r3,r7} ldm r1!, {r2,r3,r7} stm r0!, {r2,r3,r7} ldr r1, [r1] str r1, [r0] adds r0, r5, 0 bl sub_800B524 adds r6, 0x1C adds r5, 0x1C subs r4, 0x1 cmp r4, 0 bge @08010A3C pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010A14 thumb_func_start sub_8010A70 sub_8010A70: ; 8010A70 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 ldr r0, =gUnknown_082ED7EC adds r1, r4, 0 bl strcmp adds r5, r0, 0 cmp r5, 0 bne @08010A9C adds r0, r4, 0 bl sub_8010A14 mov r0, sp strh r5, [r0] ldr r2, =0x0100007e adds r1, r4, 0 bl CpuSet movs r0, 0 bl sub_800A5EC @08010A9C: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010A70 thumb_func_start sub_8010AAC sub_8010AAC: ; 8010AAC push {r4-r7,lr} sub sp, 0x4 lsls r0, 24 lsrs r6, r0, 24 ldr r3, =0x03005000 ldr r2, =gUnknown_082ED68C ldr r1, =0x00000ce9 adds r0, r3, r1 ldrb r1, [r0] adds r1, r2 ldr r2, =0x00000cde adds r0, r3, r2 ldrb r1, [r1] adds r0, r1 ldrb r4, [r0] adds r0, r3, 0 adds r0, 0xF1 ldrb r0, [r0] subs r0, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @08010AE8 ldr r5, =0x00000ce8 adds r1, r3, r5 movs r0, 0 strb r0, [r1] adds r0, r6, 0 bl remove_task @08010AE8: ldr r0, =0x03005e00 lsls r2, r6, 2 adds r1, r2, r6 lsls r1, 3 adds r1, r0 movs r3, 0x8 ldrsh r1, [r1, r3] adds r3, r0, 0 adds r7, r2, 0 cmp r1, 0x5 bls @08010B00 b @08010CF0 @08010B00: lsls r0, r1, 2 ldr r1, =@08010B28 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08010B28: .4byte @08010B40 .4byte @08010B60 .4byte @08010B78 .4byte @08010BC0 .4byte @08010C0A .4byte @08010C94 @08010B40: ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 beq @08010B4A b @08010CF0 @08010B4A: adds r0, r4, 0 bl sub_800A5EC movs r0, 0xF0 lsls r0, 7 bl sub_800FD14 b @08010C4A .align 2, 0 .pool @08010B60: ldr r0, =0x03003110 ldrh r0, [r0] cmp r0, 0 beq @08010B6A b @08010CF0 @08010B6A: adds r1, r7, r6 lsls r1, 3 adds r1, r3 b @08010C52 .align 2, 0 .pool @08010B78: bl sub_800A550 lsls r0, 24 lsrs r0, 24 asrs r0, r4 movs r1, 0x1 ands r0, r1 cmp r0, 0 bne @08010B8C b @08010CF0 @08010B8C: adds r0, r4, 0 bl sub_800A5EC lsls r2, r4, 8 ldr r0, =0x020223c4 adds r2, r0 ldr r1, =0x020229e8 lsls r0, r4, 3 subs r0, r4 lsls r0, 2 adds r0, r1 adds r1, r0, 0 adds r2, 0x10 ldm r2!, {r3-r5} stm r1!, {r3-r5} ldm r2!, {r3-r5} stm r1!, {r3-r5} ldr r2, [r2] str r2, [r1] bl sub_800B524 b @08010C4A .align 2, 0 .pool @08010BC0: ldr r5, =0x020228c4 adds r1, r5, 0 ldr r0, =gUnknown_082ED7EC ldm r0!, {r2-r4} stm r1!, {r2-r4} ldrh r2, [r0] strh r2, [r1] ldrb r0, [r0, 0x2] strb r0, [r1, 0x2] ldr r1, =0x03005000 ldrb r0, [r1, 0xD] strb r0, [r5, 0xF] movs r2, 0 adds r4, r5, 0 adds r4, 0x10 ldr r0, =0x00000cde adds r3, r1, r0 @08010BE2: adds r0, r4, r2 adds r1, r2, r3 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x3 ble @08010BE2 ldr r1, =0x020229e8 adds r0, r5, 0 adds r0, 0x14 movs r2, 0x8C bl memcpy ldr r0, =0x03005e00 adds r1, r7, r6 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @08010C0A: ldr r5, =0x020228c4 ldr r1, =0x03005000 ldrb r0, [r1, 0xD] strb r0, [r5, 0xF] movs r2, 0 ldr r3, =0x020229e8 mov r12, r3 adds r4, r5, 0 adds r4, 0x10 ldr r0, =0x00000cde adds r3, r1, r0 @08010C20: adds r0, r4, r2 adds r1, r2, r3 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x3 ble @08010C20 adds r0, r5, 0 adds r0, 0x14 mov r1, r12 movs r2, 0x8C bl memcpy ldr r1, =0x020228c4 movs r0, 0 movs r2, 0xA0 bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @08010CF0 @08010C4A: ldr r0, =0x03005e00 adds r1, r7, r6 lsls r1, 3 adds r1, r0 @08010C52: ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @08010CF0 .align 2, 0 .pool @08010C74: adds r0, r3, 0 lsls r0, r2 ldr r2, =0x00000ce5 adds r1, r5, r2 strb r0, [r1] ldrb r1, [r4] eors r0, r1 strb r0, [r4] ldr r4, =0x00000ce8 adds r0, r5, r4 strb r3, [r0] b @08010CEA .align 2, 0 .pool @08010C94: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08010CF0 bl sub_800A550 movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @08010CF0 mov r0, sp movs r4, 0 strh r4, [r0] ldr r1, =0x020223c4 ldr r2, =0x0100007e bl CpuSet movs r0, 0 bl sub_800A5EC ldr r1, =0x03005000 ldr r5, =0x00000ce8 adds r0, r1, r5 strb r4, [r0] ldr r0, =0x00000ce6 adds r3, r1, r0 ldrb r0, [r3] cmp r0, 0 beq @08010CEA movs r2, 0 adds r5, r1, 0 adds r4, r3, 0 ldrb r1, [r4] movs r3, 0x1 @08010CDA: adds r0, r1, 0 asrs r0, r2 ands r0, r3 cmp r0, 0 bne @08010C74 adds r2, 0x1 cmp r2, 0x3 ble @08010CDA @08010CEA: adds r0, r6, 0 bl remove_task @08010CF0: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010AAC thumb_func_start sub_8010D0C sub_8010D0C: ; 8010D0C push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r6, =0x03005000 adds r0, r6, 0 adds r0, 0xF1 ldrb r0, [r0] subs r0, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @08010D2A adds r0, r5, 0 bl remove_task @08010D2A: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x1 beq @08010D70 cmp r0, 0x1 bgt @08010D50 cmp r0, 0 beq @08010D56 b @08010DA6 .align 2, 0 .pool @08010D50: cmp r0, 0x2 beq @08010D82 b @08010DA6 @08010D56: ldrb r0, [r6, 0xD] cmp r0, 0 beq @08010DA6 bl sub_800B348 ldr r1, =0x020228c4 movs r0, 0 movs r2, 0x3C bl link_0800A448 b @08010D7A .align 2, 0 .pool @08010D70: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08010DA6 @08010D7A: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @08010DA6 @08010D82: bl sub_800A550 movs r4, 0x1 adds r1, r4, 0 ands r1, r0 cmp r1, 0 beq @08010DA6 ldr r0, =0x020223c4 bl sub_8010A14 movs r0, 0 bl sub_800A5EC ldr r0, =0x03003124 strb r4, [r0] adds r0, r5, 0 bl remove_task @08010DA6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010D0C thumb_func_start sub_8010DB4 sub_8010DB4: ; 8010DB4 push {r4-r7,lr} ldr r0, =0x03005000 adds r1, r0, 0 adds r1, 0xEE ldrb r1, [r1] adds r3, r0, 0 cmp r1, 0x1 bne @08010E5C ldr r2, =0x03004140 ldrb r0, [r2, 0x2] cmp r0, 0 bne @08010E5C ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8018438 cmp r1, r0 beq @08010DDE ldr r0, [r2, 0x3C] ldrb r0, [r0, 0x4] cmp r0, 0 beq @08010DE4 @08010DDE: ldr r1, =0x030030fc movs r0, 0x2 strb r0, [r1] @08010DE4: ldr r4, =c2_800ACD4 adds r0, r4, 0 bl set_callback2 ldr r0, =0x030022c0 str r4, [r0, 0x8] ldr r5, =0x03005000 ldrh r0, [r5, 0xA] lsls r4, r0, 16 ldrh r0, [r5, 0x10] lsls r0, 8 orrs r4, r0 ldrh r0, [r5, 0x12] orrs r4, r0 ldr r1, =0x000009e6 adds r0, r5, r1 ldrb r0, [r0] adds r7, r0, 0 ldr r1, =0x00000c1a adds r0, r5, r1 ldrb r0, [r0] adds r6, r0, 0 bl sub_8011A74 movs r3, 0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08010E20 movs r3, 0x1 @08010E20: adds r0, r4, 0 adds r1, r7, 0 adds r2, r6, 0 bl sub_800AF18 adds r0, r5, 0 adds r0, 0xEE ldrb r1, [r0] movs r1, 0x2 strb r1, [r0] bl sub_80097E8 b @08010E8E .align 2, 0 .pool @08010E5C: ldr r1, =0x00000c1b adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0x1 beq @08010E70 ldr r1, =0x000009e7 adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0x1 bne @08010E8E @08010E70: ldr r0, =0x03004140 ldrb r0, [r0, 0x2] cmp r0, 0 beq @08010E7C bl sub_800D630 @08010E7C: movs r4, 0xE0 lsls r4, 7 movs r0, 0x1 adds r1, r4, 0 bl sub_8011A64 adds r0, r4, 0 bl sub_8011170 @08010E8E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010DB4 thumb_func_start rfu_REQ_recvData_then_sendData rfu_REQ_recvData_then_sendData: ; 8010EA0 push {lr} ldr r0, =0x03004140 ldrb r0, [r0, 0x6] cmp r0, 0x1 bne @08010EB8 bl rfu_REQ_recvData bl rfu_waitREQComplete movs r0, 0 bl rfu_REQ_sendData_wrapper @08010EB8: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end rfu_REQ_recvData_then_sendData thumb_func_start sub_8010EC0 sub_8010EC0: ; 8010EC0 push {r4,r5,lr} movs r5, 0 ldr r4, =0x03005000 ldr r1, =0x00000ccd adds r0, r4, r1 strb r5, [r0] bl GenerateRandomNumber2 lsls r0, 16 lsrs r0, 16 bl sub_800C54C adds r0, r4, 0 adds r0, 0xEF ldrb r0, [r0] cmp r0, 0 bne @08010F14 ldrb r0, [r4, 0xC] cmp r0, 0x1 beq @08010F02 cmp r0, 0x1 bgt @08010EFC cmp r0, 0 beq @08010F08 b @08010F14 .align 2, 0 .pool @08010EFC: cmp r0, 0x2 beq @08010F10 b @08010F14 @08010F02: bl sub_800F0F8 b @08010F14 @08010F08: bl sub_800F4F0 adds r5, r0, 0 b @08010F14 @08010F10: bl rfu_REQ_recvData_then_sendData @08010F14: adds r0, r5, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8010EC0 thumb_func_start sub_8010F1C sub_8010F1C: ; 8010F1C push {r4,lr} movs r4, 0 ldr r1, =0x03005000 adds r0, r1, 0 adds r0, 0xEF ldrb r0, [r0] cmp r0, 0 bne @08010F3C ldrb r0, [r1, 0xC] cmp r0, 0x1 bne @08010F38 bl sub_800F1E0 adds r4, r0, 0 @08010F38: bl sub_8010DB4 @08010F3C: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8010F1C thumb_func_start sub_8010F48 sub_8010F48: ; 8010F48 push {lr} ldr r0, =0x02022b22 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010F48 thumb_func_start sub_8010F60 sub_8010F60: ; 8010F60 push {r4,lr} ldr r4, =0x02022b14 adds r0, r4, 0 movs r1, 0 movs r2, 0xD bl memset adds r0, r4, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl sub_800DD94 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010F60 thumb_func_start sub_8010F84 sub_8010F84: ; 8010F84 push {r4,lr} adds r4, r0, 0 adds r3, r1, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x02022b14 adds r1, r4, 0 bl sub_800DD94 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010F84 thumb_func_start sub_8010FA0 sub_8010FA0: ; 8010FA0 push {r4,r5,lr} ldr r5, =0x02022b14 movs r4, 0x1 ands r0, r4 lsls r0, 4 ldrb r3, [r5] movs r2, 0x11 negs r2, r2 ands r2, r3 orrs r2, r0 ands r1, r4 lsls r1, 5 movs r0, 0x21 negs r0, r0 ands r2, r0 orrs r2, r1 strb r2, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010FA0 thumb_func_start sub_8010FCC sub_8010FCC: ; 8010FCC push {r4,r5,lr} ldr r5, =0x02022b14 lsls r0, 2 ldrb r4, [r5, 0x9] movs r3, 0x3 ands r3, r4 orrs r3, r0 strb r3, [r5, 0x9] ldr r3, =0x000003ff adds r0, r3, 0 ands r1, r0 ldrh r3, [r5, 0x8] ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r1 strh r0, [r5, 0x8] lsls r2, 1 ldrb r1, [r5, 0xB] movs r0, 0x1 ands r0, r1 orrs r0, r2 strb r0, [r5, 0xB] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8010FCC thumb_func_start sub_801100C sub_801100C: ; 801100C push {r4,lr} movs r4, 0x80 ldr r3, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r0, r1, r3 ldrb r2, [r0, 0x13] lsls r2, 3 orrs r2, r4 adds r3, 0x4 adds r1, r3 ldr r0, [r1] movs r1, 0x7 ands r0, r1 orrs r0, r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801100C thumb_func_start sub_801103C sub_801103C: ; 801103C push {r4,r5,lr} ldr r5, =0x02022b14 movs r4, 0x1 b @08011054 .align 2, 0 .pool @08011048: adds r0, r4, 0 bl sub_801100C adds r1, r5, r4 strb r0, [r1, 0x3] adds r4, 0x1 @08011054: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r4, r0 blt @08011048 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801103C thumb_func_start sub_8011068 sub_8011068: ; 8011068 push {lr} lsls r0, 24 ldr r2, =0x02022b14 lsrs r0, 17 ldrb r3, [r2, 0xA] movs r1, 0x7F ands r1, r3 orrs r1, r0 strb r1, [r2, 0xA] ldr r3, =0x02022b22 movs r0, 0 movs r1, 0x2 bl rfu_REQ_configGameData pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011068 thumb_func_start sub_8011090 sub_8011090: ; 8011090 push {lr} lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @0801109E bl sub_8010F84 @0801109E: ldr r2, =0x02022b14 ldr r3, =0x02022b22 movs r0, 0 movs r1, 0x2 bl rfu_REQ_configGameData pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011090 thumb_func_start sub_80110B8 sub_80110B8: ; 80110B8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} mov r9, r0 bl sub_800F7DC ldrb r1, [r0, 0xA] movs r0, 0x7F ands r0, r1 cmp r0, 0x45 bne @0801114C movs r5, 0 movs r7, 0 ldr r3, =0x03005000 ldr r1, =0x00000ce2 adds r0, r3, r1 ldr r2, =0x00000ce3 adds r1, r3, r2 ldrb r2, [r0] ldrb r0, [r1] adds r1, r0, 0 eors r1, r2 mov r8, r1 movs r4, 0 movs r6, 0x1 ldr r2, =0x020229e8 mov r12, r2 ldr r0, =0x00000cde adds r0, r3 mov r10, r0 mov r3, r12 adds r3, 0x4 @080110FC: mov r0, r8 asrs r0, r4 ands r0, r6 cmp r0, 0 beq @0801113C mov r1, r10 adds r0, r4, r1 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 mov r2, r12 adds r1, r0, r2 ldrb r1, [r1, 0x13] adds r2, r6, 0 ands r2, r1 lsls r2, 3 adds r0, r3 ldr r1, [r0] movs r0, 0x7 ands r1, r0 movs r0, 0x80 orrs r1, r0 orrs r2, r1 lsls r0, r5, 3 lsls r2, r0 orrs r7, r2 adds r5, 0x1 mov r0, r9 subs r0, 0x1 cmp r5, r0 beq @08011142 @0801113C: adds r4, 0x1 cmp r4, 0x3 ble @080110FC @08011142: movs r0, 0x45 adds r1, r7, 0 movs r2, 0 bl sub_8011090 @0801114C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80110B8 thumb_func_start sub_8011170 sub_8011170: ; 8011170 push {r4,lr} adds r4, r0, 0 ldr r2, =0x03005000 adds r3, r2, 0 adds r3, 0xEE ldrb r0, [r3] cmp r0, 0 bne @08011192 ldr r1, =0x03004140 ldrh r0, [r1, 0x14] strh r0, [r2, 0x10] ldrh r0, [r1, 0x16] strh r0, [r2, 0x12] strh r4, [r2, 0xA] ldrb r0, [r3] movs r0, 0x1 strb r0, [r3] @08011192: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011170 thumb_func_start sub_80111A0 sub_80111A0: ; 80111A0 ldr r0, =0x03005000 adds r0, 0xEE ldrb r1, [r0] movs r1, 0 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80111A0 thumb_func_start sub_80111B0 sub_80111B0: ; 80111B0 push {lr} adds r2, r0, 0 cmp r2, 0 bne @080111C8 ldr r0, =0x03005000 adds r0, 0xEE ldrb r1, [r0] strb r2, [r0] b @080111D2 .align 2, 0 .pool @080111C8: ldr r0, =0x03005000 adds r0, 0xEE ldrb r1, [r0] movs r1, 0x4 strb r1, [r0] @080111D2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80111B0 thumb_func_start sub_80111DC sub_80111DC: ; 80111DC push {lr} ldr r0, =0x03004140 ldrb r0, [r0] movs r1, 0x1 bl sub_8011E94 ldr r1, =0x03005000 movs r0, 0 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80111DC thumb_func_start sub_80111FC sub_80111FC: ; 80111FC ldr r1, =0x03005000 ldr r0, =sub_80111DC str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80111FC thumb_func_start sub_801120C sub_801120C: ; 801120C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r4, r0, 24 movs r6, 0 cmp r4, 0x32 bne @08011222 b @08011360 @08011222: cmp r4, 0x32 bgt @08011252 cmp r4, 0x13 bgt @08011240 cmp r4, 0x12 blt @08011230 b @080113EE @08011230: cmp r4, 0x10 bne @08011236 b @080113EE @08011236: cmp r4, 0x10 bgt @0801128C cmp r4, 0 beq @0801127E b @080113EE @08011240: cmp r4, 0x30 bne @08011246 b @0801136C @08011246: cmp r4, 0x30 ble @0801124C b @08011354 @0801124C: cmp r4, 0x14 beq @08011328 b @080113EE @08011252: cmp r4, 0x44 bgt @08011264 cmp r4, 0x42 blt @0801125C b @080113EE @0801125C: cmp r4, 0x33 bne @08011262 b @0801136C @08011262: b @080113EE @08011264: cmp r4, 0xF3 bne @0801126A b @080113BA @0801126A: cmp r4, 0xF3 bgt @08011276 cmp r4, 0xF0 bge @08011274 b @080113EE @08011274: b @080113D4 @08011276: cmp r4, 0xFF bne @0801127C b @080113D4 @0801127C: b @080113EE @0801127E: ldr r1, =0x03005000 movs r0, 0x2 strh r0, [r1, 0x4] b @080113EE .align 2, 0 .pool @0801128C: ldr r0, =0x03004140 ldrh r0, [r0, 0x14] bl sub_80115EC movs r5, 0 movs r0, 0x1 mov r8, r0 ldr r1, =0x03005000 mov r9, r1 ldr r3, =0x00000cd5 add r3, r9 mov r10, r3 movs r7, 0x7F @080112A6: ldr r0, =0x03004140 ldrh r0, [r0, 0x14] asrs r0, r5 mov r1, r8 ands r0, r1 cmp r0, 0 beq @0801130E ldr r0, =0x03007890 lsls r1, r5, 5 adds r1, 0x14 ldr r0, [r0] adds r0, r1 ldrb r0, [r0, 0x10] adds r4, r7, 0 ands r4, r0 bl sub_800F7DC ldrb r1, [r0, 0xA] adds r0, r7, 0 ands r0, r1 cmp r4, r0 bne @08011304 ldr r0, =0x00000cd1 add r0, r9 adds r0, r5, r0 movs r1, 0 strb r1, [r0] mov r3, r10 adds r2, r5, r3 strb r1, [r2] movs r0, 0x20 adds r1, r5, 0 movs r3, 0x1 bl rfu_setRecvBuffer b @0801130E .align 2, 0 .pool @08011304: mov r0, r8 lsls r0, r5 orrs r6, r0 lsls r0, r6, 24 lsrs r6, r0, 24 @0801130E: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x3 bls @080112A6 cmp r6, 0 beq @080113EE adds r0, r6, 0 bl rfu_REQ_disconnect bl rfu_waitREQComplete b @080113EE @08011328: ldr r4, =0x03005000 ldr r1, =0x00000ce7 adds r0, r4, r1 ldr r1, =0x03004140 ldrb r2, [r0] ldrb r0, [r1] cmp r2, r0 beq @08011342 eors r0, r2 bl rfu_REQ_disconnect bl rfu_waitREQComplete @08011342: movs r0, 0x11 strh r0, [r4, 0x4] b @080113EE .align 2, 0 .pool @08011354: ldr r0, =0x03005000 adds r0, 0xF0 b @080113EA .align 2, 0 .pool @08011360: ldr r0, =0x03005000 adds r0, 0xF0 movs r1, 0x3 b @080113EC .align 2, 0 .pool @0801136C: ldr r1, =0x03005000 adds r2, r1, 0 adds r2, 0xF0 movs r0, 0x4 strb r0, [r2] ldr r3, =0x00000ce2 adds r1, r3 ldr r0, =0x03004140 ldrb r2, [r0, 0x14] ldrb r0, [r1] adds r3, r0, 0 bics r3, r2 adds r2, r3, 0 strb r2, [r1] ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 bne @080113B0 cmp r2, 0 bne @080113AC adds r0, r4, 0 bl sub_8011170 b @080113B0 .align 2, 0 .pool @080113AC: bl sub_80111FC @080113B0: movs r0, 0x2 adds r1, r4, 0 bl sub_8011A64 b @080113EE @080113BA: movs r0, 0x1 movs r1, 0xF3 bl sub_8011A64 movs r0, 0xF3 bl sub_8011170 ldr r0, =0x03005000 adds r0, 0xEF b @080113EA .align 2, 0 .pool @080113D4: adds r0, r4, 0 bl sub_8011170 movs r0, 0x1 adds r1, r4, 0 bl sub_8011A64 ldr r0, =0x03005000 ldr r1, =0x00000cdb adds r0, r1 ldrb r1, [r0] @080113EA: movs r1, 0x1 @080113EC: strb r1, [r0] @080113EE: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801120C thumb_func_start sub_8011404 sub_8011404: ; 8011404 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x31 bne @08011410 b @08011570 @08011410: cmp r4, 0x31 bgt @0801143E cmp r4, 0x22 beq @08011494 cmp r4, 0x22 bgt @0801142C cmp r4, 0x20 beq @0801147C cmp r4, 0x20 ble @08011426 b @080115DE @08011426: cmp r4, 0 beq @0801146E b @080115DE @0801142C: cmp r4, 0x24 beq @080114BA cmp r4, 0x24 blt @080114B0 cmp r4, 0x25 beq @08011504 cmp r4, 0x30 beq @0801150E b @080115DE @0801143E: cmp r4, 0x44 bgt @08011454 cmp r4, 0x42 blt @08011448 b @080115DE @08011448: cmp r4, 0x33 beq @08011522 cmp r4, 0x33 bge @08011452 b @0801158C @08011452: b @080115DE @08011454: cmp r4, 0xF3 bne @0801145A b @080115AC @0801145A: cmp r4, 0xF3 bgt @08011466 cmp r4, 0xF0 bge @08011464 b @080115DE @08011464: b @080115C4 @08011466: cmp r4, 0xFF bne @0801146C b @080115C4 @0801146C: b @080115DE @0801146E: ldr r1, =0x03005000 movs r0, 0x6 strh r0, [r1, 0x4] b @080115DE .align 2, 0 .pool @0801147C: ldr r0, =0x03005000 ldr r1, =0x03004140 ldrh r1, [r1, 0x14] ldr r2, =0x00000ccd adds r0, r2 b @080115DC .align 2, 0 .pool @08011494: ldr r0, =0x03005000 ldr r1, =0x03004140 ldrh r1, [r1, 0x14] ldr r2, =0x00000c3e adds r0, r2 ldrb r2, [r0] b @080115DC .align 2, 0 .pool @080114B0: movs r0, 0x2 adds r1, r4, 0 bl sub_8011A64 b @080115DE @080114BA: ldr r4, =0x03005000 movs r1, 0 movs r0, 0xB strh r0, [r4, 0x4] ldr r2, =0x00000c85 adds r0, r4, r2 strb r1, [r0] ldr r0, =0x00000c86 adds r2, r4, r0 strb r1, [r2] ldr r1, =0x00000c3e adds r5, r4, r1 ldrb r1, [r5] movs r0, 0x20 movs r3, 0x1 bl rfu_setRecvBuffer ldrb r1, [r5] ldr r2, =0x00000c3f adds r4, r2 movs r0, 0x10 adds r2, r4, 0 movs r3, 0x46 bl rfu_setRecvBuffer b @080115DE .align 2, 0 .pool @08011504: movs r0, 0x2 movs r1, 0x25 bl sub_8011A64 b @080115DE @0801150E: ldr r0, =0x03005000 adds r2, r0, 0 adds r2, 0xF0 movs r1, 0x2 strb r1, [r2] ldr r1, =0x00000c86 adds r0, r1 ldrb r0, [r0] cmp r0, 0x6 beq @080115DE @08011522: ldr r2, =0x03005000 adds r1, r2, 0 adds r1, 0xF0 ldrb r0, [r1] cmp r0, 0x2 beq @08011532 movs r0, 0x4 strb r0, [r1] @08011532: ldr r1, =0x00000c86 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x9 beq @08011544 movs r0, 0x2 adds r1, r4, 0 bl sub_8011A64 @08011544: ldr r0, =gUnknown_082ED7FC movs r1, 0x5 movs r2, 0x5 bl nullsub_5 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 bne @080115DE adds r0, r4, 0 bl sub_8011170 b @080115DE .align 2, 0 .pool @08011570: ldr r0, =0x03005000 adds r0, 0xF0 movs r1, 0x1 strb r1, [r0] ldr r0, =gUnknown_082ED814 movs r1, 0x5 movs r2, 0x5 bl nullsub_5 b @080115DE .align 2, 0 .pool @0801158C: ldr r1, =0x03005000 adds r2, r1, 0 adds r2, 0xF0 movs r0, 0x3 strb r0, [r2] ldr r2, =0x00000c3c adds r1, r2 ldrb r0, [r1] movs r0, 0x1 strb r0, [r1] b @080115DE .align 2, 0 .pool @080115AC: movs r0, 0x1 movs r1, 0xF3 bl sub_8011A64 movs r0, 0xF3 bl sub_8011170 ldr r0, =0x03005000 adds r0, 0xEF b @080115DA .align 2, 0 .pool @080115C4: movs r0, 0x1 adds r1, r4, 0 bl sub_8011A64 adds r0, r4, 0 bl sub_8011170 ldr r0, =0x03005000 ldr r1, =0x00000cdb adds r0, r1 ldrb r1, [r0] @080115DA: movs r1, 0x1 @080115DC: strb r1, [r0] @080115DE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011404 thumb_func_start sub_80115EC sub_80115EC: ; 80115EC push {r4-r6,lr} adds r3, r0, 0 movs r2, 0 movs r6, 0x1 ldr r0, =0x03005000 ldr r4, =0x00000cea adds r1, r0, r4 movs r5, 0 movs r4, 0xFF @080115FE: adds r0, r3, 0 asrs r0, r2 ands r0, r6 cmp r0, 0 beq @08011610 strb r5, [r1] ldrb r0, [r1, 0x4] orrs r0, r4 strb r0, [r1, 0x4] @08011610: adds r1, 0x1 adds r2, 0x1 cmp r2, 0x3 ble @080115FE pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80115EC thumb_func_start sub_8011628 sub_8011628: ; 8011628 push {r4-r7,lr} adds r5, r0, 0 movs r3, 0 movs r2, 0 movs r4, 0x1 ldr r6, =0x03007890 movs r7, 0x7F @08011636: adds r0, r5, 0 asrs r0, r2 ands r0, r4 cmp r0, 0 beq @0801165C lsls r1, r2, 5 adds r1, 0x14 ldr r0, [r6] adds r0, r1 ldrb r1, [r0, 0x10] adds r0, r7, 0 ands r0, r1 cmp r0, 0x45 bne @0801165C adds r0, r4, 0 lsls r0, r2 orrs r3, r0 lsls r0, r3, 24 lsrs r3, r0, 24 @0801165C: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @08011636 adds r0, r3, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8011628 thumb_func_start sub_8011674 sub_8011674: ; 8011674 push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x25 bne @08011680 b @080118EC @08011680: cmp r4, 0x25 bgt @080116C2 cmp r4, 0x14 bne @0801168A b @08011804 @0801168A: cmp r4, 0x14 bgt @080116A2 cmp r4, 0x11 beq @08011722 cmp r4, 0x11 ble @08011698 b @08011A42 @08011698: cmp r4, 0 beq @0801170C cmp r4, 0x10 beq @08011718 b @08011A42 @080116A2: cmp r4, 0x22 bne @080116A8 b @08011868 @080116A8: cmp r4, 0x22 bgt @080116B4 cmp r4, 0x20 bne @080116B2 b @08011850 @080116B2: b @08011A42 @080116B4: cmp r4, 0x23 bne @080116BA b @08011884 @080116BA: cmp r4, 0x24 bne @080116C0 b @080118BA @080116C0: b @08011A42 @080116C2: cmp r4, 0x44 bgt @080116F2 cmp r4, 0x42 blt @080116CC b @08011A42 @080116CC: cmp r4, 0x32 bne @080116D2 b @08011914 @080116D2: cmp r4, 0x32 bgt @080116E4 cmp r4, 0x30 bne @080116DC b @08011940 @080116DC: cmp r4, 0x31 bne @080116E2 b @080118F6 @080116E2: b @08011A42 @080116E4: cmp r4, 0x33 bne @080116EA b @08011948 @080116EA: cmp r4, 0x40 bne @080116F0 b @080119FC @080116F0: b @08011A42 @080116F2: cmp r4, 0xF3 bne @080116F8 b @08011A0C @080116F8: cmp r4, 0xF3 bgt @08011704 cmp r4, 0xF0 bge @08011702 b @08011A42 @08011702: b @08011A28 @08011704: cmp r4, 0xFF bne @0801170A b @08011A28 @0801170A: b @08011A42 @0801170C: ldr r1, =0x03005000 movs r0, 0x11 strh r0, [r1, 0x4] b @08011A42 .align 2, 0 .pool @08011718: movs r0, 0x4 movs r1, 0 bl sub_8011A64 b @08011A42 @08011722: bl sub_800F7DC ldrb r1, [r0, 0xA] movs r0, 0x7F ands r0, r1 cmp r0, 0x45 bne @080117DC ldr r5, =0x03005000 ldr r1, =0x00000cd9 adds r0, r5, r1 ldrb r0, [r0] cmp r0, 0 bne @080117DC ldr r0, =0x03004140 ldrh r0, [r0, 0x14] bl sub_8011628 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @080117A6 adds r0, r4, 0 bl sub_800E87C movs r2, 0x1 mov r12, r2 mov r1, r12 lsls r1, r0 lsls r1, 24 lsrs r1, 24 ldr r7, =0x00000ce6 adds r6, r5, r7 ldrb r2, [r6] cmp r2, 0 bne @08011798 ldr r0, =0x00000ce8 adds r3, r5, r0 ldrb r0, [r3] cmp r0, 0 bne @08011798 subs r7, 0x1 adds r0, r5, r7 strb r1, [r0] eors r1, r4 orrs r1, r2 strb r1, [r6] mov r0, r12 strb r0, [r3] b @080117A6 .align 2, 0 .pool @08011798: ldr r0, =0x03005000 ldr r1, =0x00000ce6 adds r0, r1 ldrb r2, [r0] adds r1, r4, 0 orrs r1, r2 strb r1, [r0] @080117A6: ldr r0, =0x03004140 ldrh r1, [r0, 0x14] cmp r4, r1 beq @080117F6 ldr r2, =0x03005000 ldr r7, =0x00000ce3 adds r3, r2, r7 adds r0, r4, 0 eors r0, r1 ldrb r1, [r3] orrs r0, r1 strb r0, [r3] ldr r0, =0x00000ce4 adds r2, r0 movs r0, 0x2 strb r0, [r2] b @080117F6 .align 2, 0 .pool @080117DC: bl sub_800F7DC ldrb r1, [r0, 0xA] movs r0, 0x7F ands r0, r1 cmp r0, 0x54 bne @080117F6 ldr r0, =0x03004140 ldrb r0, [r0] bl rfu_REQ_disconnect bl rfu_waitREQComplete @080117F6: ldr r0, =0x03004140 ldrh r0, [r0, 0x14] bl sub_80115EC b @08011A42 .align 2, 0 .pool @08011804: bl sub_800F7DC ldrb r1, [r0, 0xA] movs r0, 0x7F ands r0, r1 cmp r0, 0x45 beq @08011836 ldr r4, =0x03004140 ldrb r0, [r4, 0x1] cmp r0, 0x1 bls @08011836 ldrb r0, [r4, 0x14] bl sub_800E87C movs r1, 0x80 lsls r1, 17 lsls r1, r0 lsrs r1, 24 ldrb r0, [r4] eors r1, r0 adds r0, r1, 0 bl rfu_REQ_disconnect bl rfu_waitREQComplete @08011836: ldr r1, =0x03005000 ldrh r0, [r1, 0x4] cmp r0, 0xF beq @08011840 b @08011A42 @08011840: movs r0, 0x10 strh r0, [r1, 0x4] b @08011A42 .align 2, 0 .pool @08011850: ldr r0, =0x03005000 ldr r1, =0x03004140 ldrh r1, [r1, 0x14] ldr r2, =0x00000ccd adds r0, r2 b @08011A40 .align 2, 0 .pool @08011868: ldr r0, =0x03005000 ldr r1, =0x03004140 ldrh r1, [r1, 0x14] ldr r7, =0x00000c3e adds r0, r7 ldrb r2, [r0] b @08011A40 .align 2, 0 .pool @08011884: ldr r1, =0x03005000 movs r0, 0x12 strh r0, [r1, 0x4] ldr r0, =0x00000ccf adds r1, r0 ldrb r0, [r1] cmp r0, 0x1 bhi @080118B0 adds r0, 0x1 strb r0, [r1] ldr r0, =sub_801209C movs r1, 0x2 bl AddTask b @08011A42 .align 2, 0 .pool @080118B0: movs r0, 0x2 movs r1, 0x23 bl sub_8011A64 b @08011A42 @080118BA: ldr r4, =0x03005000 movs r0, 0xD strh r0, [r4, 0x4] movs r0, 0x3 movs r1, 0 bl sub_8011A64 ldr r1, =0x00000c3e adds r0, r4, r1 ldrb r1, [r0] ldr r2, =0x00000c3f adds r4, r2 movs r0, 0x10 adds r2, r4, 0 movs r3, 0x46 bl rfu_setRecvBuffer b @08011A42 .align 2, 0 .pool @080118EC: movs r0, 0x2 movs r1, 0x25 bl sub_8011A64 b @08011A42 @080118F6: ldr r0, =0x03004140 ldrb r1, [r0] ldrh r0, [r0, 0x14] ands r1, r0 cmp r1, 0 bne @08011904 b @08011A42 @08011904: ldr r0, =0x03005000 adds r0, 0xF0 movs r1, 0x1 b @08011A40 .align 2, 0 .pool @08011914: ldr r2, =0x03005000 adds r1, r2, 0 adds r1, 0xF0 movs r0, 0x3 strb r0, [r1] ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0 beq @0801192A b @08011A42 @0801192A: ldr r7, =0x00000c3c adds r0, r2, r7 ldrb r1, [r0] movs r1, 0x1 b @08011A40 .align 2, 0 .pool @08011940: ldr r0, =0x03005000 adds r0, 0xF0 movs r1, 0x2 strb r1, [r0] @08011948: ldr r2, =0x03005000 adds r1, r2, 0 adds r1, 0xF0 ldrb r0, [r1] cmp r0, 0x2 beq @08011958 movs r0, 0x4 strb r0, [r1] @08011958: ldrb r0, [r2, 0xC] cmp r0, 0x1 bne @08011996 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 bne @080119B4 ldr r0, =0x00000ce2 adds r2, r0 ldr r0, =0x03004140 ldrb r1, [r0, 0x14] ldrb r0, [r2] bics r0, r1 strb r0, [r2] cmp r0, 0 bne @08011990 adds r0, r4, 0 bl sub_8011170 b @080119B4 .align 2, 0 .pool @08011990: bl sub_80111FC b @080119B4 @08011996: ldr r1, =0x00000ce4 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x2 beq @080119B4 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 bne @080119B4 adds r0, r4, 0 bl sub_8011170 movs r0, 0 bl sub_800C27C @080119B4: ldr r0, =0x03007890 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0xFF bne @080119DA ldr r0, =0x03004140 ldrb r0, [r0, 0x7] cmp r0, 0 bne @080119DA ldr r0, =sub_800EB44 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080119DA ldr r1, =0x03005000 movs r0, 0x11 strh r0, [r1, 0x4] @080119DA: movs r0, 0x2 adds r1, r4, 0 bl sub_8011A64 b @08011A42 .align 2, 0 .pool @080119FC: ldr r0, =0x03005000 ldr r2, =0x00000ce3 adds r0, r2 b @08011A3E .align 2, 0 .pool @08011A0C: movs r0, 0x1 movs r1, 0xF3 bl sub_8011A64 movs r0, 0xF3 bl sub_8011170 ldr r0, =0x03005000 adds r0, 0xEF movs r1, 0x1 b @08011A40 .align 2, 0 .pool @08011A28: adds r0, r4, 0 bl sub_8011170 movs r0, 0x1 adds r1, r4, 0 bl sub_8011A64 ldr r0, =0x03005000 ldr r7, =0x00000cdb adds r0, r7 ldrb r1, [r0] @08011A3E: movs r1, 0 @08011A40: strb r1, [r0] @08011A42: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011674 thumb_func_start sub_8011A50 sub_8011A50: ; 8011A50 ldr r0, =0x03005000 ldr r1, =0x00000ce4 adds r0, r1 movs r1, 0x2 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8011A50 thumb_func_start sub_8011A64 sub_8011A64: ; 8011A64 ldr r2, =0x03005000 adds r3, r2, 0 adds r3, 0xF1 strb r0, [r3] strh r1, [r2, 0xA] bx lr .align 2, 0 .pool thumb_func_end sub_8011A64 thumb_func_start sub_8011A74 sub_8011A74: ; 8011A74 ldr r0, =0x03005000 adds r0, 0xF1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8011A74 thumb_func_start sub_8011A80 sub_8011A80: ; 8011A80 push {lr} bl sub_8011A74 lsls r0, 24 lsrs r0, 24 subs r0, 0x1 cmp r0, 0x1 bls @08011A94 movs r0, 0 b @08011A96 @08011A94: movs r0, 0x1 @08011A96: pop {r1} bx r1 thumb_func_end sub_8011A80 thumb_func_start sub_8011A9C sub_8011A9C: ; 8011A9C ldr r0, =0x03005000 ldr r1, =0x00000ce8 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8011A9C thumb_func_start sub_8011AB0 sub_8011AB0: ; 8011AB0 ldr r0, =0x03005000 ldrb r0, [r0, 0xC] bx lr .align 2, 0 .pool thumb_func_end sub_8011AB0 thumb_func_start rfu_syncVBlank__ rfu_syncVBlank__: ; 8011ABC push {lr} bl rfu_syncVBlank_ pop {r0} bx r0 thumb_func_end rfu_syncVBlank__ thumb_func_start sub_8011AC8 sub_8011AC8: ; 8011AC8 push {lr} sub sp, 0x4 movs r0, 0 str r0, [sp] ldr r1, =0x03003090 ldr r2, =0x05000014 mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8011AE8 bl SetVBlankCallback bl sub_80093CC lsls r0, 24 cmp r0, 0 beq @08011B70 ldr r1, =0x020229c6 ldr r2, =0x00001111 adds r0, r2, 0 strh r0, [r1] bl sub_800B488 bl sub_8009734 ldr r0, =0x030022c0 ldrh r0, [r0, 0x24] bl SeedRng movs r4, 0 @08011B38: bl GenerateRandomNumber ldr r1, =0x03005d90 ldr r1, [r1] adds r1, 0xA adds r1, r4 strb r0, [r1] adds r4, 0x1 cmp r4, 0x3 ble @08011B38 movs r1, 0xAA lsls r1, 5 movs r0, 0 bl 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, =sub_8011BF8 bl set_callback2 @08011B70: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011AFC thumb_func_start sub_8011B90 sub_8011B90: ; 8011B90 push {lr} ldr r0, =sub_800EB44 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8011B90 thumb_func_start sub_8011BA4 sub_8011BA4: ; 8011BA4 push {r4,lr} ldr r4, =nullsub_89 adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @08011BC2 adds r0, r4, 0 movs r1, 0 bl AddTask ldr r1, =0x03005000 adds r1, 0x66 strb r0, [r1] @08011BC2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011BA4 thumb_func_start sub_8011BD0 sub_8011BD0: ; 8011BD0 push {lr} ldr r0, =nullsub_89 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08011BEA ldr r0, =0x03005000 adds r0, 0x66 ldrb r0, [r0] bl remove_task @08011BEA: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005000 movs r0, 0x1 strb r0, [r1, 0xC] bl sub_8010F48 ldr r0, =sub_801120C movs r1, 0 bl sub_800BF4C ldr r2, =0x02022b2c adds r1, r2, 0 ldr r0, =gUnknown_082ED608 ldm r0!, {r3,r5,r6} stm r1!, {r3,r5,r6} ldm r0!, {r3,r5,r6} stm r1!, {r3,r5,r6} ldr r0, =gUnknown_082ED620 subs r4, 0x1 adds r4, r0 ldrb r0, [r4] strh r0, [r2, 0x2] bl sub_800EE78 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011C10 thumb_func_start sub_8011C5C sub_8011C5C: ; 8011C5C push {lr} ldr r1, =0x03005000 movs r0, 0 strb r0, [r1, 0xC] bl sub_8010F48 ldr r0, =sub_8011404 ldr r1, =sub_800ED34 bl sub_800BF4C bl sub_800EF00 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011C5C thumb_func_start sub_8011C84 sub_8011C84: ; 8011C84 push {r4-r7,lr} ldr r4, =0x03005000 movs r5, 0 movs r0, 0x2 strb r0, [r4, 0xC] bl sub_8010F48 ldr r0, =sub_8011674 movs r1, 0 bl sub_800BF4C ldr r2, =0x02022b2c adds r1, r2, 0 ldr r0, =gUnknown_082ED608 ldm r0!, {r3,r6,r7} stm r1!, {r3,r6,r7} ldm r0!, {r3,r6,r7} stm r1!, {r3,r6,r7} strb r5, [r2, 0x11] movs r0, 0x96 lsls r0, 2 strh r0, [r2, 0x12] ldr r0, =sub_800EB44 movs r1, 0x1 bl AddTask adds r4, 0x67 strb r0, [r4] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011C84 thumb_func_start sub_8011CD8 sub_8011CD8: ; 8011CD8 ldrb r1, [r0, 0x1] lsls r1, 8 ldrb r0, [r0] orrs r0, r1 bx lr thumb_func_end sub_8011CD8 thumb_func_start sub_8011CE4 sub_8011CE4: ; 8011CE4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 str r0, [sp] lsls r1, 16 lsrs r1, 16 mov r10, r1 movs r0, 0xFF mov r9, r0 movs r7, 0 ldr r1, =0x03007890 mov r8, r1 @08011D02: lsls r4, r7, 5 adds r5, r4, 0 adds r5, 0x14 mov r1, r8 ldr r0, [r1] adds r0, r5 adds r0, 0x8 bl sub_8011CD8 lsls r0, 16 lsrs r6, r0, 16 mov r1, r8 ldr r0, [r1] adds r0, r4 ldrh r0, [r0, 0x18] bl sub_8010454 cmp r0, 0 beq @08011D4C mov r0, r8 ldr r1, [r0] adds r1, r5 adds r1, 0x15 ldr r0, [sp] bl 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 .pool thumb_func_end sub_8011CE4 thumb_func_start sub_8011D6C sub_8011D6C: ; 8011D6C push {r4-r6,lr} adds r6, r0, 0 lsls r0, r6, 24 lsrs r0, 24 bl rfu_REQ_disconnect bl rfu_waitREQComplete ldr r4, =0x03005000 ldr r0, =0x00000ce2 adds r5, r4, r0 ldrb r0, [r5] bics r0, r6 strb r0, [r5] ldr r1, =0x00000cda adds r6, r4, r1 ldrb r1, [r6] movs r0, 0x1 bl rfu_clearSlot ldrb r0, [r5] ldr r1, =0x00000c87 adds r4, r1 adds r1, r4, 0 movs r2, 0x46 bl rfu_UNI_setSendData ldrb r0, [r5] bl sub_800E87C strb r0, [r6] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011D6C thumb_func_start sub_8011DC0 sub_8011DC0: ; 8011DC0 push {lr} lsls r1, 16 lsrs r1, 16 bl sub_8011CE4 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0xFF beq @08011DDA movs r0, 0x1 lsls r0, r1 bl sub_8011D6C @08011DDA: pop {r0} bx r0 thumb_func_end sub_8011DC0 thumb_func_start sub_8011DE0 sub_8011DE0: ; 8011DE0 push {r4-r6,lr} adds r4, r0, 0 cmp r4, 0 beq @08011E20 movs r3, 0 movs r2, 0 ldr r5, =0x03005cde adds r6, r5, 0x4 @08011DF0: adds r0, r2, r5 ldrb r0, [r0] cmp r0, r4 bne @08011E0E ldrb r0, [r6] asrs r0, r2 movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08011E0E adds r0, r1, 0 lsls r0, r2 orrs r3, r0 lsls r0, r3, 24 lsrs r3, r0, 24 @08011E0E: adds r2, 0x1 cmp r2, 0x3 ble @08011DF0 cmp r3, 0 beq @08011E20 adds r0, r3, 0 movs r1, 0x2 bl sub_8011E94 @08011E20: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011DE0 thumb_func_start sub_8011E2C sub_8011E2C: ; 8011E2C push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r6, =0x03003110 ldrh r0, [r6] cmp r0, 0 bne @08011E7A ldr r5, =0x03005000 ldr r1, =0x00000ce8 adds r0, r5, r1 ldrb r0, [r0] cmp r0, 0 bne @08011E7A movs r0, 0xED lsls r0, 8 bl sub_800FD14 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldrh r1, [r0, 0x8] strh r1, [r6, 0x2] ldrh r1, [r0, 0xA] strh r1, [r6, 0x4] ldr r1, =gUnknown_082ED695 movs r2, 0x8 ldrsh r0, [r0, r2] adds r0, r1 ldrb r1, [r5, 0xD] ldrb r0, [r0] subs r1, r0 strb r1, [r5, 0xD] ldrb r0, [r5, 0xD] strh r0, [r6, 0x6] adds r0, r4, 0 bl remove_task @08011E7A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011E2C thumb_func_start sub_8011E94 sub_8011E94: ; 8011E94 push {r4-r6,lr} adds r4, r0, 0 adds r6, r1, 0 ldr r5, =sub_8011E2C adds r0, r5, 0 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF bne @08011ECC adds r0, r5, 0 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 strh r4, [r0, 0x8] b @08011EDC .align 2, 0 .pool @08011ECC: ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] orrs r4, r0 strh r4, [r1, 0x8] @08011EDC: ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 strh r6, [r0, 0xA] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011E94 thumb_func_start sub_8011EF4 sub_8011EF4: ; 8011EF4 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 bl sub_800EE94 lsls r0, 24 cmp r0, 0 beq @08011FA4 adds r0, r4, 0 adds r0, 0x10 bl sub_8011CD8 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_8011CE4 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @08011F8C ldr r0, =0x03007890 ldr r0, [r0] lsls r1, r2, 5 adds r0, r1 ldrb r0, [r0, 0x16] cmp r0, 0xFF beq @08011F5C ldr r0, =0x03005000 ldr r1, =0x00000c3d adds r0, r1 strb r2, [r0] bl sub_800EEBC cmp r0, 0 beq @08011FAA b @08011F84 .align 2, 0 .pool @08011F5C: bl sub_800F7DC ldrb r1, [r0, 0xA] movs r5, 0x7F adds r0, r5, 0 ands r0, r1 cmp r0, 0x15 beq @08011FA4 bl sub_800F7DC ldrb r1, [r0, 0xA] adds r0, r5, 0 ands r0, r1 cmp r0, 0x16 beq @08011FA4 movs r1, 0xE0 lsls r1, 7 movs r0, 0x2 bl sub_8011A64 @08011F84: adds r0, r6, 0 bl remove_task b @08011FAA @08011F8C: ldrh r0, [r4, 0x1E] adds r0, 0x1 strh r0, [r4, 0x1E] ldr r0, =0x03005000 ldr r1, =0x00000c3d adds r0, r1 strb r2, [r0] b @08011FAA .align 2, 0 .pool @08011FA4: ldrh r0, [r4, 0x1E] adds r0, 0x1 strh r0, [r4, 0x1E] @08011FAA: movs r1, 0x1E ldrsh r0, [r4, r1] cmp r0, 0xF0 ble @08011FC2 movs r1, 0xE0 lsls r1, 7 movs r0, 0x2 bl sub_8011A64 adds r0, r6, 0 bl remove_task @08011FC2: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8011EF4 thumb_func_start sub_8011FC8 sub_8011FC8: ; 8011FC8 push {r4-r6,lr} adds r6, r0, 0 lsls r5, r1, 16 lsrs r5, 16 ldr r0, =0x03005000 adds r0, 0xF1 movs r1, 0 strb r1, [r0] ldr r0, =sub_8011EF4 movs r1, 0x3 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 adds r0, r4, 0 adds r1, r6, 0 bl gf_strcpy strh r5, [r4, 0x10] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8011FC8 thumb_func_start sub_801200C sub_801200C: ; 801200C push {r4,r5,lr} adds r4, r1, 0 lsls r0, 16 lsrs r5, r0, 16 bl sub_800F7DC ldrb r1, [r0, 0xA] movs r2, 0x7F adds r0, r2, 0 ands r0, r1 cmp r0, 0x45 bne @08012032 ldrb r1, [r4, 0xA] adds r0, r2, 0 ands r0, r1 cmp r0, 0x45 beq @08012092 @0801202E: movs r0, 0x1 b @08012094 @08012032: ldrb r1, [r4, 0xA] adds r0, r2, 0 ands r0, r1 cmp r0, 0x40 bne @0801202E cmp r5, 0x44 bne @08012092 ldr r5, =0x0300510a ldrh r0, [r5, 0x8] ldr r3, =0x000003ff adds r2, r3, 0 ands r2, r0 movs r0, 0xCE lsls r0, 1 cmp r2, r0 bne @08012068 ldrh r1, [r4, 0x8] adds r0, r3, 0 ands r0, r1 cmp r0, r2 beq @08012092 b @0801202E .align 2, 0 .pool @08012068: ldrh r1, [r4, 0x8] adds r0, r3, 0 ands r0, r1 cmp r0, r2 bne @0801202E ldrb r2, [r4, 0xB] movs r0, 0xFE ldrb r3, [r5, 0xB] adds r1, r0, 0 ands r1, r2 ands r0, r3 cmp r1, r0 bne @0801202E ldrb r2, [r4, 0x9] movs r0, 0xFC ldrb r3, [r5, 0x9] adds r1, r0, 0 ands r1, r2 ands r0, r3 cmp r1, r0 bne @0801202E @08012092: movs r0, 0 @08012094: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_801200C thumb_func_start sub_801209C sub_801209C: ; 801209C push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r5, r0, 24 mov r8, r5 ldr r6, =0x03005000 adds r0, r6, 0 adds r0, 0xF1 ldrb r0, [r0] cmp r0, 0x4 bne @080120BA adds r0, r5, 0 bl remove_task @080120BA: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] lsls r0, 16 movs r1, 0x96 lsls r1, 17 cmp r0, r1 ble @080120E4 movs r1, 0xE0 lsls r1, 7 movs r0, 0x2 bl sub_8011A64 adds r0, r5, 0 bl remove_task @080120E4: ldr r1, =0x00000ccd adds r0, r6, r1 ldrb r0, [r0] cmp r0, 0 beq @0801217C ldr r0, =0x03004140 ldrb r0, [r0, 0x6] cmp r0, 0 bne @0801217C movs r2, 0x86 lsls r2, 1 adds r0, r6, r2 bl sub_8011CD8 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 ldr r2, =0x00000119 adds r0, r6, r2 bl sub_8011CE4 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @0801217C movs r1, 0xA ldrsh r0, [r4, r1] ldr r7, =0x03007890 lsls r4, r2, 5 adds r2, r4, 0 adds r2, 0x14 ldr r1, [r7] adds r1, r2 adds r1, 0x6 bl sub_801200C cmp r0, 0 bne @0801216C ldr r0, [r7] adds r1, r0, r4 ldrb r0, [r1, 0x16] cmp r0, 0xFF beq @0801217C ldrh r0, [r1, 0x14] movs r1, 0x5A bl 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 .pool @0801216C: movs r1, 0xE0 lsls r1, 7 movs r0, 0x2 bl sub_8011A64 mov r0, r8 bl remove_task @0801217C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_801209C thumb_func_start sub_8012188 sub_8012188: ; 8012188 push {r4-r7,lr} adds r3, r0, 0 adds r5, r1, 0 lsls r4, r2, 24 lsrs r4, 24 ldr r6, =0x03005000 ldr r1, =0x00000ccf adds r0, r6, r1 movs r7, 0 strb r7, [r0] adds r0, r6, 0 adds r0, 0xF1 strb r7, [r0] ldr r1, =0x00000119 adds r0, r6, r1 adds r1, r3, 0 bl 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, =sub_801209C movs r1, 0x2 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r5, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r5 strh r4, [r1, 0xA] ldr r0, =sub_800EB44 bl get_task_id_by_function lsls r0, 24 lsrs r1, r0, 24 adds r2, r1, 0 cmp r4, 0x45 bne @08012210 cmp r1, 0xFF beq @0801221E lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r1, 0x1 strh r1, [r0, 0x16] b @0801221E .align 2, 0 .pool @08012210: cmp r2, 0xFF beq @0801221E lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r5 strh r7, [r0, 0x16] @0801221E: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8012188 thumb_func_start sub_8012224 sub_8012224: ; 8012224 push {lr} ldr r0, =0x03005000 adds r0, 0xF0 ldrb r0, [r0] cmp r0, 0x1 beq @08012238 movs r0, 0 b @0801223A .align 2, 0 .pool @08012238: movs r0, 0x1 @0801223A: pop {r1} bx r1 thumb_func_end sub_8012224 thumb_func_start sub_8012240 sub_8012240: ; 8012240 push {r4,lr} movs r1, 0 ldr r0, =0x03004140 ldrb r2, [r0] ldr r4, =0x03005cd1 movs r3, 0x1 @0801224C: adds r0, r2, 0 asrs r0, r1 ands r0, r3 cmp r0, 0 beq @0801226C adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0 bne @0801226C movs r0, 0 b @08012274 .align 2, 0 .pool @0801226C: adds r1, 0x1 cmp r1, 0x3 ble @0801224C movs r0, 0x1 @08012274: pop {r4} pop {r1} bx r1 thumb_func_end sub_8012240 thumb_func_start sub_801227C sub_801227C: ; 801227C push {r4,lr} movs r4, 0 @08012280: lsls r2, r4, 24 lsrs r2, 24 ldr r0, =gUnknown_082ED82C movs r1, 0 bl nullsub_5 adds r4, 0x1 cmp r4, 0x13 ble @08012280 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801227C thumb_func_start sub_801229C sub_801229C: ; 801229C push {r4-r7,lr} mov r7, r8 push {r7} bl sub_800A550 lsls r0, 24 lsrs r0, 24 movs r1, 0x1C movs r2, 0x13 movs r3, 0x2 bl nullsub_13 ldr r4, =0x03007890 ldr r0, [r4] ldrb r0, [r0, 0x2] movs r1, 0x14 movs r2, 0x1 movs r3, 0x1 bl nullsub_13 ldr r0, [r4] ldrb r0, [r0, 0x3] movs r1, 0x17 movs r2, 0x1 movs r3, 0x1 bl nullsub_13 ldr r0, =0x03005000 ldrb r0, [r0, 0xC] cmp r0, 0x1 bne @08012378 movs r6, 0 adds r7, r4, 0 movs r5, 0x14 @080122E0: ldr r2, [r7] ldrb r0, [r2, 0x7] asrs r0, r6 movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0801231E lsls r0, r6, 5 adds r0, r2, r0 ldrh r0, [r0, 0x18] adds r4, r6, 0x3 lsls r4, 24 lsrs r4, 24 adds r2, r4, 0 movs r3, 0x4 bl nullsub_13 ldr r0, [r7] adds r0, r5 adds r0, 0x6 movs r1, 0x6 adds r2, r4, 0 bl nullsub_5 ldr r0, [r7] adds r0, r5 adds r0, 0x15 movs r1, 0x16 adds r2, r4, 0 bl nullsub_5 @0801231E: adds r5, 0x20 adds r6, 0x1 cmp r6, 0x3 ble @080122E0 movs r6, 0 ldr r0, =0x03005000 mov r8, r0 @0801232C: movs r5, 0 adds r7, r6, 0x1 lsls r0, r6, 3 adds r2, r6, 0 adds r2, 0xB subs r0, r6 lsls r0, 1 mov r1, r8 adds r1, 0x14 adds r4, r0, r1 lsls r6, r2, 24 @08012342: ldrb r0, [r4] lsls r1, r5, 25 lsrs r1, 24 lsrs r2, r6, 24 movs r3, 0x2 bl nullsub_13 adds r4, 0x1 adds r5, 0x1 cmp r5, 0xD ble @08012342 adds r6, r7, 0 cmp r6, 0x3 ble @0801232C ldr r0, =gUnknown_082ED868 movs r1, 0x1 movs r2, 0xF bl nullsub_5 b @080124AA .align 2, 0 .pool @08012378: ldr r1, [r4] ldrb r0, [r1, 0x2] cmp r0, 0 beq @08012414 ldrb r0, [r1, 0x7] cmp r0, 0 beq @08012414 movs r6, 0 movs r5, 0xC0 lsls r5, 18 @0801238C: lsrs r4, r5, 24 movs r0, 0 movs r1, 0x1 adds r2, r4, 0 movs r3, 0x4 bl nullsub_13 ldr r0, =gUnknown_082ED84B movs r1, 0x6 adds r2, r4, 0 bl nullsub_5 ldr r0, =gUnknown_082ED85B movs r1, 0x16 adds r2, r4, 0 bl nullsub_5 movs r1, 0x80 lsls r1, 17 adds r5, r1 adds r6, 0x1 cmp r6, 0x3 ble @0801238C ldr r5, =0x03007890 ldr r1, [r5] ldr r4, =0x03005000 ldr r0, =0x00000c3e adds r4, r0 ldrb r0, [r4] lsls r0, 5 adds r1, r0 ldrh r0, [r1, 0x18] movs r1, 0x1 movs r2, 0x3 movs r3, 0x4 bl nullsub_13 ldrb r1, [r4] lsls r1, 5 adds r1, 0x14 ldr r0, [r5] adds r0, r1 adds r0, 0x6 movs r1, 0x6 movs r2, 0x3 bl nullsub_5 ldrb r1, [r4] lsls r1, 5 adds r1, 0x14 ldr r0, [r5] adds r0, r1 adds r0, 0x15 movs r1, 0x16 movs r2, 0x3 bl nullsub_5 b @080124AA .align 2, 0 .pool @08012414: movs r6, 0 ldr r1, =0x03007890 ldr r0, [r1] ldrb r0, [r0, 0x8] cmp r6, r0 bge @08012470 adds r7, r1, 0 movs r1, 0x14 mov r8, r1 @08012426: ldr r0, [r7] lsls r5, r6, 5 adds r1, r0, r5 ldrb r0, [r1, 0x16] cmp r0, 0xFF beq @08012462 ldrh r0, [r1, 0x18] adds r4, r6, 0x3 lsls r4, 24 lsrs r4, 24 movs r1, 0x1 adds r2, r4, 0 movs r3, 0x4 bl nullsub_13 ldr r0, [r7] adds r0, r5 ldrh r0, [r0, 0x14] movs r1, 0x6 adds r2, r4, 0 movs r3, 0x4 bl nullsub_13 ldr r0, [r7] add r0, r8 adds r0, 0x15 movs r1, 0x16 adds r2, r4, 0 bl nullsub_5 @08012462: movs r0, 0x20 add r8, r0 adds r6, 0x1 ldr r0, [r7] ldrb r0, [r0, 0x8] cmp r6, r0 blt @08012426 @08012470: cmp r6, 0x3 bgt @080124AA lsls r0, r6, 24 movs r1, 0xC0 lsls r1, 18 adds r5, r0, r1 @0801247C: lsrs r4, r5, 24 movs r0, 0 movs r1, 0x1 adds r2, r4, 0 movs r3, 0x4 bl nullsub_13 ldr r0, =gUnknown_082ED84B movs r1, 0x6 adds r2, r4, 0 bl nullsub_5 ldr r0, =gUnknown_082ED85B movs r1, 0x16 adds r2, r4, 0 bl nullsub_5 movs r0, 0x80 lsls r0, 17 adds r5, r0 adds r6, 0x1 cmp r6, 0x3 ble @0801247C @080124AA: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801229C thumb_func_start sub_80124C0 sub_80124C0: ; 80124C0 ldr r0, =0x03005000 ldr r1, =0x00000c1a adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80124C0 thumb_func_start sub_80124D4 sub_80124D4: ; 80124D4 ldr r0, =0x03005000 ldr r1, =0x000009e6 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80124D4 thumb_func_start nullsub_89 nullsub_89: ; 80124E8 bx lr thumb_func_end nullsub_89 thumb_func_start sub_80124EC sub_80124EC: ; 80124EC push {r4-r6,lr} sub sp, 0x8 adds r4, r1, 0 lsls r0, 24 lsrs r6, r0, 24 lsls r4, 24 lsrs r4, 24 lsls r2, 24 lsrs r5, r2, 24 adds r0, r6, 0 movs r1, 0x11 bl 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, =gUnknown_082EDB60 subs r0, r5, 0x1 lsls r0, 2 b @0801256C .align 2, 0 .pool @08012544: ldr r1, =gUnknown_082EDB60 subs r0, r5, 0x1 lsls r0, 2 adds r1, 0x14 b @0801256C .align 2, 0 .pool @08012554: ldr r1, =gUnknown_082EDB60 subs r0, r5, 0x1 lsls r0, 2 adds r1, 0x28 b @0801256C .align 2, 0 .pool @08012564: ldr r1, =gUnknown_082EDB60 subs r0, r5, 0x1 lsls r0, 2 adds r1, 0x3C @0801256C: adds r0, r1 ldr r2, [r0] movs r0, 0x1 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] adds r0, r6, 0 movs r1, 0x1 movs r3, 0 bl sub_80173E0 b @080125A6 .align 2, 0 .pool @08012588: ldr r1, =gUnknown_082EDB60 subs r0, r5, 0x1 lsls r0, 2 adds r1, 0x50 adds r0, r1 ldr r2, [r0] movs r0, 0x1 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] adds r0, r6, 0 movs r1, 0x1 movs r3, 0 bl sub_80173E0 @080125A6: adds r0, r6, 0 movs r1, 0x2 bl Window_CopyToVram add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80124EC thumb_func_start sub_80125BC sub_80125BC: ; 80125BC push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x28 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r6, =0x03005d90 ldr r2, [r6] movs r0, 0x1 str r0, [sp] movs r0, 0 mov r8, r0 str r0, [sp, 0x4] adds r0, r4, 0 movs r1, 0x1 movs r3, 0 bl sub_80173E0 ldr r1, =gUnknown_082ED8CC add r0, sp, 0x8 bl 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 .pool thumb_func_end sub_80125BC thumb_func_start sub_801262C sub_801262C: ; 801262C push {lr} lsls r1, 24 lsrs r1, 24 subs r0, r1, 0x1 cmp r0, 0x1B bhi @080126C0 lsls r0, 2 ldr r1, =@08012648 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08012648: .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 .4byte @080126C0 .4byte @080126C0 .4byte @080126C0 .4byte @080126C0 .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 .4byte @080126C0 .4byte @080126C0 .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 .4byte @080126C0 .4byte @080126C0 .4byte @080126C0 .4byte @080126C0 .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 .4byte @080126B8 @080126B8: ldr r0, =0x02021fc4 ldr r1, =gUnknown_082ED960 bl ExpandTextCodes @080126C0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801262C thumb_func_start sub_80126CC sub_80126CC: ; 80126CC push {lr} subs r0, 0x9 cmp r0, 0x12 bhi @08012734 lsls r0, 2 ldr r1, =@080126E4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080126E4: .4byte @08012730 .4byte @08012730 .4byte @08012730 .4byte @08012734 .4byte @08012734 .4byte @08012734 .4byte @08012730 .4byte @08012730 .4byte @08012734 .4byte @08012734 .4byte @08012734 .4byte @08012734 .4byte @08012734 .4byte @08012734 .4byte @08012730 .4byte @08012730 .4byte @08012730 .4byte @08012730 .4byte @08012730 @08012730: movs r0, 0x1 b @08012736 @08012734: movs r0, 0 @08012736: pop {r1} bx r1 thumb_func_end sub_80126CC thumb_func_start sub_801273C sub_801273C: ; 801273C push {lr} ldr r0, =sub_8012780 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x02022c30 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r1, r0 str r1, [r2] ldr r0, =0x03000da0 str r1, [r0] movs r0, 0 strb r0, [r1, 0xC] strb r0, [r1, 0xD] ldr r1, =0x020375f0 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022c30 ldr r6, [r0] ldrb r0, [r6, 0xC] cmp r0, 0x1E bls @0801279A bl @08012F50 @0801279A: lsls r0, 2 ldr r1, =@080127AC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080127AC: .4byte @08012828 .4byte @08012F50 .4byte @08012F50 .4byte @080128A0 .4byte @080129C8 .4byte @08012A50 .4byte @08012A6C .4byte @08012B8C .4byte @08012F50 .4byte @08012AFC .4byte @08012B14 .4byte @08012BA8 .4byte @08012C5C .4byte @08012D5A .4byte @08012D78 .4byte @08012D8A .4byte @08012DA8 .4byte @08012E62 .4byte @08012E78 .4byte @08012DF2 .4byte @08012E10 .4byte @08012ED0 .4byte @08012EFC .4byte @08012ED0 .4byte @08012EE6 .4byte @08012F50 .4byte @08012F14 .4byte @08012F50 .4byte @08012F50 .4byte @08012B54 .4byte @08012EB6 @08012828: ldr r0, =0x020375e0 ldrh r2, [r0] adds r3, r0, 0 cmp r2, 0x14 bne @08012848 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r1, [r0] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @08012848 adds r0, r2, 0x1 strh r0, [r3] @08012848: ldr r2, =0x02022c2c ldr r1, =gUnknown_082F00C4 ldrh r0, [r3] lsls r0, 2 adds r0, r1 ldr r0, [r0] strb r0, [r2] ldr r4, =0x02022c2d ldrh r0, [r3] lsls r0, 2 adds r0, r1 ldr r0, [r0] lsrs r0, 8 strb r0, [r4] ldrb r0, [r2] movs r1, 0 movs r2, 0 bl sub_8010F84 bl sub_800B488 bl sub_8009734 ldrb r1, [r4] movs r0, 0xF ands r0, r1 bl sub_8011C10 movs r0, 0x3 strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @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, =gUnknown_082F00BC bl Window_AddFromTemplate strb r0, [r6, 0x10] ldr r0, =0x02022c2d ldrb r0, [r0] movs r1, 0xF ands r1, r0 cmp r1, 0x2 blt @08012938 cmp r1, 0x4 ble @08012928 cmp r1, 0x5 beq @08012930 b @08012938 .align 2, 0 .pool @08012928: ldr r0, =gUnknown_082F011C b @08012932 .align 2, 0 .pool @08012930: ldr r0, =gUnknown_082F0124 @08012932: bl Window_AddFromTemplate strb r0, [r6, 0xF] @08012938: ldr r0, =gUnknown_082F012C bl Window_AddFromTemplate strb r0, [r6, 0x11] ldrb r0, [r6, 0x10] movs r1, 0x22 bl Window_FastFillPixels ldrb r0, [r6, 0x10] ldr r2, =gUnknown_082EDBC4 movs r3, 0x1 mov r8, r3 str r3, [sp] movs r4, 0x4 str r4, [sp, 0x4] movs r1, 0 movs r3, 0x8 bl sub_80173E0 ldrb r0, [r6, 0x10] bl Window_WriteStandardTileMap ldrb r0, [r6, 0x10] movs r1, 0x2 bl Window_CopyToVram ldrb r0, [r6, 0xF] movs r1, 0 bl sub_81973FC ldr r0, =0x03006310 adds r2, r0, 0 ldr r1, =gUnknown_082F015C ldm r1!, {r3,r5,r7} stm r2!, {r3,r5,r7} ldm r1!, {r3,r5,r7} stm r2!, {r3,r5,r7} ldrb r1, [r6, 0xF] strb r1, [r0, 0x10] movs r1, 0 movs r2, 0 bl 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 .pool @080129C8: ldr r0, =0x02021cc4 ldr r2, =gUnknown_082F0048 ldr r4, =0x02022c2c ldrb r1, [r4] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r0, =0x02022c2d ldrb r2, [r0] lsrs r0, r2, 4 cmp r0, 0 beq @08012A2C ldrb r1, [r6, 0x13] subs r0, 0x1 cmp r1, r0 ble @08012A18 movs r0, 0xF ands r0, r2 cmp r0, 0 beq @08012A18 ldr r0, =0x02021fc4 ldr r1, =gUnknown_082ED990 bl ExpandTextCodes b @08012A34 .align 2, 0 .pool @08012A18: ldr r0, =0x02021fc4 ldr r1, =gUnknown_082ED960 bl ExpandTextCodes b @08012A34 .align 2, 0 .pool @08012A2C: ldr r0, =0x02021fc4 ldrb r1, [r4] bl sub_801262C @08012A34: ldrb r0, [r6, 0x11] ldr r1, =0x02022c2d ldrb r1, [r1] ldrb r2, [r6, 0x13] bl sub_80124EC movs r0, 0x5 strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012A50: adds r0, r6, 0 adds r0, 0xD ldr r1, =0x02021fc4 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08012A62 b @08012F50 @08012A62: movs r0, 0x6 strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012A6C: adds r0, r6, 0 movs r1, 0x7 movs r2, 0xA bl sub_801320C ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08012AA8 ldrb r0, [r6, 0x13] cmp r0, 0x1 bne @08012A90 movs r0, 0x17 b @08012AA6 .align 2, 0 .pool @08012A90: ldr r0, =0x02022c2d ldrb r1, [r0] movs r0, 0xF0 ands r0, r1 cmp r0, 0 beq @08012AA4 movs r0, 0x1E b @08012AA6 .align 2, 0 .pool @08012AA4: movs r0, 0x13 @08012AA6: strb r0, [r6, 0xC] @08012AA8: ldr r0, =0x02022c2d ldrb r2, [r0] lsrs r0, r2, 4 cmp r0, 0 beq @08012ADE ldrb r1, [r6, 0x13] subs r0, 0x1 cmp r1, r0 ble @08012ADE movs r4, 0xF adds r0, r4, 0 ands r0, r2 cmp r0, 0 beq @08012ADE bl sub_8012240 cmp r0, 0 beq @08012ADE ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @08012ADE strb r4, [r6, 0xC] bl sub_800EF38 @08012ADE: ldrb r0, [r6, 0xC] cmp r0, 0x6 beq @08012AE6 b @08012F50 @08012AE6: bl sub_80105EC cmp r0, 0 bne @08012AF0 b @08012F50 @08012AF0: b @08012C56 .align 2, 0 .pool @08012AFC: bl sub_80105EC cmp r0, 0 beq @08012B06 b @08012F50 @08012B06: movs r0, 0x6 strb r0, [r6, 0xC] ldr r0, [r6] bl sub_8013398 strb r0, [r6, 0x13] b @08012F50 @08012B14: movs r3, 0 ldr r0, =0x02022c2c ldrb r1, [r0] movs r0, 0xF ands r0, r1 cmp r0, 0x2 bne @08012B24 movs r3, 0x1 @08012B24: adds r0, r6, 0 adds r0, 0xD ldr r2, =gUnknown_082EDDC4 lsls r1, r3, 2 adds r1, r2 ldr r1, [r1] bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08012B3C b @08012F50 @08012B3C: ldr r0, [r6] bl sub_8013398 strb r0, [r6, 0x13] ldrb r0, [r6, 0x12] bl sub_81AE70C b @08012E5C .align 2, 0 .pool @08012B54: ldr r0, =0x02022c2d ldrb r0, [r0] movs r1, 0xF ands r1, r0 movs r0, 0x2 eors r1, r0 negs r0, r1 orrs r0, r1 lsrs r3, r0, 31 adds r0, r6, 0 adds r0, 0xD ldr r2, =gUnknown_082EDDC4 lsls r1, r3, 2 adds r1, r2 ldr r1, [r1] bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08012B7E b @08012F50 @08012B7E: movs r0, 0x15 strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012B8C: adds r0, r6, 0 adds r0, 0xD ldr r1, =0x02021fc4 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08012B9E b @08012F50 @08012B9E: movs r0, 0xB strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012BA8: adds r4, r6, 0 adds r4, 0xD ldrb r1, [r6, 0x13] lsls r1, 5 ldr r0, [r6] adds r0, r1 adds r0, 0x2 bl sub_8015658 lsls r0, 16 lsrs r0, 16 ldrb r2, [r6, 0x13] lsls r2, 5 ldr r1, [r6] adds r1, r2 adds r1, 0x10 bl sub_801064C adds r1, r0, 0 adds r0, r4, 0 bl sub_80170B8 lsls r0, 24 asrs r1, r0, 24 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08012C28 cmp r1, r0 bgt @08012BEC subs r0, 0x2 cmp r1, r0 beq @08012C56 b @08012F50 @08012BEC: cmp r1, 0 beq @08012BF6 cmp r1, 0x1 beq @08012C28 b @08012F50 @08012BF6: bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 movs r0, 0x5 strb r0, [r6, 0x19] ldrb r1, [r6, 0x13] lsls r1, 5 ldr r0, [r6] adds r0, r1 adds r0, 0x2 bl sub_8015658 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 ldrb r0, [r6, 0x13] lsls r0, 5 ldr r2, [r6] adds r2, r0 adds r2, 0x10 movs r0, 0x5 b @08012C4C @08012C28: movs r0, 0x6 strb r0, [r6, 0x19] ldrb r1, [r6, 0x13] lsls r1, 5 ldr r0, [r6] adds r0, r1 adds r0, 0x2 bl sub_8015658 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 ldrb r0, [r6, 0x13] lsls r0, 5 ldr r2, [r6] adds r2, r0 adds r2, 0x10 movs r0, 0x6 @08012C4C: bl sub_8010688 movs r0, 0xC strb r0, [r6, 0xC] b @08012F50 @08012C56: movs r0, 0x9 strb r0, [r6, 0xC] b @08012F50 @08012C5C: ldrb r1, [r6, 0x13] lsls r1, 5 ldr r0, [r6] adds r0, r1 adds r0, 0x2 bl sub_8015658 lsls r0, 16 lsrs r0, 16 ldrb r2, [r6, 0x13] lsls r2, 5 ldr r1, [r6] adds r1, r2 adds r1, 0x10 bl sub_8010714 cmp r0, 0x1 bne @08012D4A ldrb r0, [r6, 0x19] cmp r0, 0x5 bne @08012D04 ldr r1, [r6] ldrb r0, [r6, 0x13] lsls r0, 5 adds r1, r0 movs r0, 0 strb r0, [r1, 0x1B] ldrb r0, [r6, 0x12] bl sub_81AE70C ldrb r0, [r6, 0x13] adds r0, 0x1 strb r0, [r6, 0x13] ldr r1, =0x02022c2d ldrb r1, [r1] movs r3, 0xF lsls r0, 24 lsrs r2, r0, 24 adds r0, r3, 0 ands r0, r1 cmp r2, r0 bne @08012D40 movs r0, 0xF0 ands r0, r1 cmp r0, 0 bne @08012CBC cmp r2, 0x4 bne @08012CC4 @08012CBC: strb r3, [r6, 0xC] b @08012CE0 .align 2, 0 .pool @08012CC4: ldr r0, =0x02021cc4 ldrb r2, [r6, 0x13] lsls r2, 5 subs r2, 0x20 ldr r1, [r6] adds r1, r2 bl sub_8018404 ldr r0, =0x02021fc4 ldr r1, =gUnknown_082EDC9C bl ExpandTextCodes movs r0, 0xD strb r0, [r6, 0xC] @08012CE0: bl sub_800EF38 ldrb r0, [r6, 0x11] ldr r1, =0x02022c2d ldrb r1, [r1] ldrb r2, [r6, 0x13] bl sub_80124EC b @08012D44 .align 2, 0 .pool @08012D04: ldrb r1, [r6, 0x13] lsls r1, 5 ldr r0, [r6] adds r0, r1 adds r4, r0, 0 adds r4, 0x10 adds r0, 0x2 bl sub_8015658 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_8011DC0 ldr r1, [r6] ldrb r0, [r6, 0x13] lsls r0, 5 adds r1, r0 ldrb r2, [r1, 0x1A] movs r0, 0x4 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1A] ldr r0, [r6] bl sub_8013398 ldrb r0, [r6, 0x12] bl sub_81AE70C @08012D40: movs r0, 0x4 strb r0, [r6, 0xC] @08012D44: movs r0, 0 strb r0, [r6, 0x19] b @08012F50 @08012D4A: cmp r0, 0x2 beq @08012D50 b @08012F50 @08012D50: movs r0, 0 movs r1, 0 bl sub_8011A64 b @08012E5C @08012D5A: adds r0, r6, 0 adds r0, 0xD ldr r1, =0x02021fc4 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08012D6C b @08012F50 @08012D6C: movs r0, 0xE strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012D78: ldrb r0, [r6, 0xE] adds r0, 0x1 strb r0, [r6, 0xE] lsls r0, 24 lsrs r0, 24 cmp r0, 0x78 bhi @08012D88 b @08012F50 @08012D88: b @08012DCE @08012D8A: adds r0, r6, 0 adds r0, 0xD ldr r1, =gUnknown_082EDC5C bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08012D9C b @08012F50 @08012D9C: movs r0, 0x10 strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012DA8: adds r0, r6, 0 adds r0, 0xD movs r1, 0 bl sub_80170B8 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @08012DCE cmp r1, 0 bgt @08012DC8 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08012DD4 b @08012F50 @08012DC8: cmp r1, 0x1 beq @08012DD4 b @08012F50 @08012DCE: movs r0, 0x11 strb r0, [r6, 0xC] b @08012F50 @08012DD4: ldr r0, =0x02022c2d ldrb r1, [r0] movs r0, 0xF0 ands r0, r1 cmp r0, 0 beq @08012DEC movs r0, 0x1E strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012DEC: movs r0, 0x13 strb r0, [r6, 0xC] b @08012F50 @08012DF2: adds r0, r6, 0 adds r0, 0xD ldr r1, =gUnknown_082EDC78 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08012E04 b @08012F50 @08012E04: movs r0, 0x14 strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012E10: adds r0, r6, 0 adds r0, 0xD movs r1, 0 bl sub_80170B8 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @08012EC6 cmp r1, 0 bgt @08012E30 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08012E36 b @08012F50 @08012E30: cmp r1, 0x1 beq @08012E36 b @08012F50 @08012E36: ldr r0, =0x02022c2d ldrb r2, [r0] movs r0, 0xF0 ands r0, r2 cmp r0, 0 beq @08012E4C movs r0, 0xF strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012E4C: movs r3, 0xF ldrb r1, [r6, 0x13] adds r0, r3, 0 ands r0, r2 cmp r1, r0 bne @08012E5C strb r3, [r6, 0xC] b @08012F50 @08012E5C: movs r0, 0x4 strb r0, [r6, 0xC] b @08012F50 @08012E62: adds r0, r6, 0 movs r1, 0x7 movs r2, 0x1D bl sub_801320C lsls r0, 24 cmp r0, 0 bne @08012F50 movs r0, 0x12 strb r0, [r6, 0xC] b @08012F50 @08012E78: bl sub_800EF1C lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @08012EAE movs r0, 0 bl sub_800EF58 cmp r0, 0 beq @08012E94 movs r0, 0x1A strb r0, [r6, 0xC] b @08012F50 @08012E94: ldrh r0, [r6, 0x1A] adds r0, 0x1 strh r0, [r6, 0x1A] lsls r0, 16 movs r1, 0x96 lsls r1, 17 cmp r0, r1 bls @08012F50 movs r0, 0x1D strb r0, [r6, 0xC] movs r0, 0 strb r0, [r6, 0xD] b @08012F50 @08012EAE: movs r0, 0x1D strb r0, [r6, 0xC] strb r1, [r6, 0xD] b @08012F50 @08012EB6: adds r0, r6, 0 adds r0, 0xD ldr r1, =gUnknown_082EDD58 bl sub_8017064 lsls r0, 24 cmp r0, 0 beq @08012F50 @08012EC6: movs r0, 0x17 strb r0, [r6, 0xC] b @08012F50 .align 2, 0 .pool @08012ED0: bl sub_800E084 bl sub_800EDD4 adds r0, r6, 0 bl sub_8012F64 ldrb r0, [r6, 0xC] adds r0, 0x1 strb r0, [r6, 0xC] b @08012F50 @08012EE6: bl script_env_2_enable_and_set_ctx_running adds r0, r4, 0 bl remove_task ldr r1, =0x020375f0 movs r0, 0x5 strh r0, [r1] b @08012F50 .align 2, 0 .pool @08012EFC: bl script_env_2_enable_and_set_ctx_running adds r0, r4, 0 bl remove_task ldr r1, =0x020375f0 movs r0, 0x8 strh r0, [r1] b @08012F50 .align 2, 0 .pool @08012F14: bl sub_8011A80 cmp r0, 0 beq @08012F22 movs r0, 0x1D strb r0, [r6, 0xC] b @08012F50 @08012F22: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08012F50 ldr r0, =0x02022c2c ldrb r0, [r0] bl sub_80126CC cmp r0, 0 beq @08012F3A bl sub_801103C @08012F3A: movs r0, 0x1 bl sub_8011068 bl sub_80149C4 adds r0, r6, 0 bl sub_8012F64 adds r0, r4, 0 bl remove_task @08012F50: add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8012780 thumb_func_start sub_8012F64 sub_8012F64: ; 8012F64 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4, 0x11] bl 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, =@08012FE0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08012FE0: .4byte @08013050 .4byte @08013050 .4byte @08013068 .4byte @08013050 .4byte @08013070 .4byte @08013070 .4byte @08013070 .4byte @08013070 .4byte @08013068 .4byte @08013068 .4byte @08013068 .4byte @08013070 .4byte @08013070 .4byte @08013050 .4byte @08013068 .4byte @08013068 .4byte @08013070 .4byte @08013070 .4byte @08013070 .4byte @08013070 .4byte @08013058 .4byte @08013058 .4byte @08013068 .4byte @08013068 .4byte @08013068 .4byte @08013068 .4byte @08013068 .4byte @08013050 @08013050: ldr r1, =gUnknown_082EDBE8 b @0801305A .align 2, 0 .pool @08013058: ldr r1, =gUnknown_082EDC0C @0801305A: adds r0, r2, 0 bl ExpandTextCodes b @08013070 .align 2, 0 .pool @08013068: ldr r1, =gUnknown_082EDC34 adds r0, r2, 0 bl ExpandTextCodes @08013070: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8012FC4 thumb_func_start sub_8013078 sub_8013078: ; 8013078 push {lr} lsls r1, 24 lsrs r1, 24 adds r2, r1, 0 cmp r1, 0x44 beq @08013098 cmp r1, 0x44 bgt @0801308E cmp r1, 0x41 beq @08013098 b @080130AA @0801308E: cmp r2, 0x45 beq @080130A4 cmp r2, 0x48 beq @080130A4 b @080130AA @08013098: ldr r1, =gUnknown_082EE560 bl ExpandTextCodes b @080130AA .align 2, 0 .pool @080130A4: ldr r1, =gUnknown_082EE57C bl ExpandTextCodes @080130AA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8013078 thumb_func_start sub_80130B4 sub_80130B4: ; 80130B4 push {lr} adds r2, r0, 0 lsls r1, 24 lsrs r1, 24 subs r0, r1, 0x1 cmp r0, 0x1B bhi @08013158 lsls r0, 2 ldr r1, =@080130D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080130D0: .4byte @08013140 .4byte @08013140 .4byte @08013150 .4byte @08013140 .4byte @08013158 .4byte @08013158 .4byte @08013158 .4byte @08013158 .4byte @08013150 .4byte @08013150 .4byte @08013150 .4byte @08013158 .4byte @08013158 .4byte @08013140 .4byte @08013150 .4byte @08013150 .4byte @08013158 .4byte @08013158 .4byte @08013158 .4byte @08013158 .4byte @08013140 .4byte @08013140 .4byte @08013150 .4byte @08013150 .4byte @08013150 .4byte @08013150 .4byte @08013150 .4byte @08013140 @08013140: ldr r1, =gUnknown_082EFC3C adds r0, r2, 0 bl ExpandTextCodes b @08013158 .align 2, 0 .pool @08013150: ldr r1, =gUnknown_082EFC54 adds r0, r2, 0 bl ExpandTextCodes @08013158: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80130B4 thumb_func_start sub_8013160 sub_8013160: ; 8013160 push {lr} adds r2, r0, 0 lsls r1, 24 lsrs r1, 24 subs r0, r1, 0x1 cmp r0, 0x1B bhi @08013204 lsls r0, 2 ldr r1, =@0801317C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801317C: .4byte @080131EC .4byte @080131EC .4byte @080131FC .4byte @080131EC .4byte @08013204 .4byte @08013204 .4byte @08013204 .4byte @08013204 .4byte @080131FC .4byte @080131FC .4byte @080131FC .4byte @08013204 .4byte @08013204 .4byte @080131EC .4byte @080131FC .4byte @080131FC .4byte @08013204 .4byte @08013204 .4byte @08013204 .4byte @08013204 .4byte @080131EC .4byte @080131EC .4byte @080131FC .4byte @080131FC .4byte @080131FC .4byte @080131FC .4byte @080131FC .4byte @080131EC @080131EC: ldr r1, =gUnknown_082EDDF4 adds r0, r2, 0 bl ExpandTextCodes b @08013204 .align 2, 0 .pool @080131FC: ldr r1, =gUnknown_082EDE0C adds r0, r2, 0 bl ExpandTextCodes @08013204: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8013160 thumb_func_start sub_801320C sub_801320C: ; 801320C push {r4-r6,lr} adds r4, r0, 0 adds r6, r1, 0 adds r5, r2, 0 ldr r0, [r4] bl sub_80132D4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08013228 cmp r0, 0x2 beq @0801325C b @08013270 @08013228: movs r0, 0x2 bl audio_play ldrb r0, [r4, 0x12] bl sub_81AE70C ldr r0, =0x02021dc4 ldrb r2, [r4, 0x13] lsls r2, 5 ldr r1, [r4] adds r1, r2 bl sub_8018404 ldr r0, =0x02021fc4 ldr r1, =0x02022c2c ldrb r1, [r1] bl sub_8012FC4 strb r6, [r4, 0xC] b @08013270 .align 2, 0 .pool @0801325C: movs r0, 0 movs r1, 0 bl sub_8011A64 ldrb r0, [r4, 0x12] bl sub_81AE70C strb r5, [r4, 0xC] movs r0, 0x1 b @08013272 @08013270: movs r0, 0 @08013272: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_801320C thumb_func_start sub_8013278 sub_8013278: ; 8013278 push {r4-r6,lr} sub sp, 0x8 adds r4, r1, 0 lsls r0, 24 lsrs r5, r0, 24 lsls r2, 24 lsrs r6, r2, 24 ldr r0, =0x02022c30 ldr r3, [r0] movs r2, 0 ldr r1, [r3] lsls r0, r4, 5 adds r1, r0 ldrb r0, [r1, 0x1A] lsls r0, 30 lsrs r0, 30 cmp r0, 0x1 beq @080132A8 cmp r0, 0x2 beq @080132B2 b @080132B4 .align 2, 0 .pool @080132A8: ldrb r0, [r1, 0x1B] cmp r0, 0 beq @080132B4 movs r2, 0x2 b @080132B4 @080132B2: movs r2, 0x1 @080132B4: lsls r0, r4, 5 ldr r3, [r3] adds r3, r0 str r2, [sp] lsls r0, r4, 24 lsrs r0, 24 str r0, [sp, 0x4] adds r0, r5, 0 movs r1, 0 adds r2, r6, 0 bl sub_80178A0 add sp, 0x8 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8013278 thumb_func_start sub_80132D4 sub_80132D4: ; 80132D4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 ldr r0, =0x02022c30 ldr r5, [r0] movs r0, 0 mov r8, r0 movs r3, 0x1 @080132E8: ldr r0, [r5] lsls r6, r3, 5 adds r2, r0, r6 ldrb r0, [r2, 0x1A] lsls r0, 30 lsrs r0, 30 mov r9, r0 cmp r0, 0x1 bne @08013348 ldr r1, [r5, 0x4] adds r0, r2, 0 str r3, [sp] bl sub_80176E4 adds r4, r0, 0 ldr r3, [sp] cmp r4, 0xFF beq @08013330 ldr r1, [r5] ldr r0, [r5, 0x4] lsls r2, r4, 3 subs r2, r4 lsls r2, 2 adds r1, r6 adds r0, r2 ldm r0!, {r2,r4,r7} stm r1!, {r2,r4,r7} ldm r0!, {r2,r4,r7} stm r1!, {r2,r4,r7} ldr r0, [r5] adds r0, r6 mov r1, r9 strh r1, [r0, 0x18] b @08013348 .align 2, 0 .pool @08013330: ldr r2, [r5] adds r2, r6 ldrb r1, [r2, 0x1A] movs r4, 0x4 negs r4, r4 adds r0, r4, 0 ands r1, r0 movs r0, 0x2 orrs r1, r0 strb r1, [r2, 0x1A] movs r7, 0x2 mov r8, r7 @08013348: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x4 bls @080132E8 movs r6, 0 movs r4, 0x3 @08013356: ldr r0, [r5] ldr r1, [r5, 0x4] adds r1, r6 movs r2, 0x5 bl sub_8017734 adds r6, 0x1C subs r4, 0x1 ldr r0, [r5] cmp r4, 0 bge @08013356 mov r1, r8 cmp r1, 0x2 beq @08013388 adds r1, r0, 0 movs r4, 0x4 @08013376: ldrb r0, [r1, 0x1B] cmp r0, 0 beq @08013380 movs r2, 0x1 mov r8, r2 @08013380: adds r1, 0x20 subs r4, 0x1 cmp r4, 0 bge @08013376 @08013388: mov r0, r8 add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80132D4 thumb_func_start sub_8013398 sub_8013398: ; 8013398 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x02022c30 ldr r4, [r0] movs r3, 0 @080133A8: ldr r0, [r4, 0x8] lsls r2, r3, 5 ldr r1, [r4] adds r0, r2 adds r1, r2 ldm r1!, {r2,r5,r6} stm r0!, {r2,r5,r6} ldm r1!, {r2,r5,r7} stm r0!, {r2,r5,r7} ldm r1!, {r6,r7} stm r0!, {r6,r7} adds r3, 0x1 ldr r0, [r4, 0x8] ldr r1, [r4] cmp r3, 0x4 ble @080133A8 movs r5, 0 mov r8, r1 mov r9, r0 movs r3, 0x4 @080133D0: mov r1, r9 ldrb r0, [r1, 0x1A] lsls r0, 30 lsrs r0, 30 cmp r0, 0x1 bne @080133F2 lsls r0, r5, 5 add r0, r8 ldm r1!, {r2,r6,r7} stm r0!, {r2,r6,r7} ldm r1!, {r2,r6,r7} stm r0!, {r2,r6,r7} ldm r1!, {r2,r6} stm r0!, {r2,r6} adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @080133F2: movs r7, 0x20 add r9, r7 subs r3, 0x1 cmp r3, 0 bge @080133D0 mov r10, r5 cmp r5, 0x4 bhi @08013454 ldr r0, =gUnknown_082F045C mov r9, r0 movs r1, 0 mov r12, r1 movs r2, 0x4 negs r2, r2 mov r8, r2 @08013410: ldr r1, [r4] lsls r3, r5, 5 adds r1, r3 mov r0, r9 ldm r0!, {r2,r6,r7} stm r1!, {r2,r6,r7} ldm r0!, {r2,r6,r7} stm r1!, {r2,r6,r7} ldr r0, [r4] adds r0, r3 movs r1, 0 strh r1, [r0, 0x18] ldr r1, [r4] adds r1, r3 ldrb r2, [r1, 0x1A] mov r0, r8 ands r0, r2 strb r0, [r1, 0x1A] ldr r1, [r4] adds r1, r3 ldrb r2, [r1, 0x1A] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1A] ldr r0, [r4] adds r0, r3 mov r6, r12 strb r6, [r0, 0x1B] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x4 bls @08013410 @08013454: movs r3, 0 ldr r1, [r4] ldrb r0, [r1, 0x1A] lsls r0, 30 lsrs r0, 30 cmp r0, 0x1 bne @08013474 ldrb r0, [r1, 0x1B] cmp r0, 0x40 bne @08013474 mov r10, r3 b @08013494 .align 2, 0 .pool @08013474: adds r3, 0x1 cmp r3, 0x4 bgt @08013494 lsls r0, r3, 5 adds r2, r1, r0 ldrb r0, [r2, 0x1A] lsls r0, 30 lsrs r0, 30 cmp r0, 0x1 bne @08013474 ldrb r0, [r2, 0x1B] cmp r0, 0x40 bne @08013474 lsls r0, r3, 24 lsrs r0, 24 mov r10, r0 @08013494: mov r0, r10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8013398 thumb_func_start sub_80134A4 sub_80134A4: ; 80134A4 push {lr} ldr r0, =sub_80134E8 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x02022c30 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r1, r0 str r1, [r2] ldr r0, =0x03000da4 str r1, [r0] movs r0, 0 strb r0, [r1, 0x8] strb r0, [r1, 0x9] ldr r1, =0x020375f0 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022c30 ldr r6, [r0] ldrb r0, [r6, 0x8] cmp r0, 0x17 bls @080134FC b @08013B82 @080134FC: lsls r0, 2 ldr r1, =@08013510 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08013510: .4byte @08013570 .4byte @080135E0 .4byte @0801360C .4byte @080136D8 .4byte @08013B82 .4byte @08013788 .4byte @080137C4 .4byte @08013A10 .4byte @08013A2C .4byte @08013A7A .4byte @08013A8C .4byte @08013B14 .4byte @08013A8C .4byte @08013AE4 .4byte @08013A8C .4byte @08013B24 .4byte @08013B82 .4byte @08013B82 .4byte @08013A8C .4byte @08013B44 .4byte @08013A8C .4byte @08013B78 .4byte @08013B82 .4byte @08013B68 @08013570: ldr r0, =0x020375e0 ldrh r2, [r0] adds r3, r0, 0 cmp r2, 0x14 bne @08013590 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r1, [r0] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @08013590 adds r0, r2, 0x1 strh r0, [r3] @08013590: ldr r2, =0x02022c2c ldr r1, =gUnknown_082F0530 ldrh r0, [r3] adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldrb r0, [r2] movs r1, 0 movs r2, 0 bl sub_8010F84 bl sub_800B488 bl sub_8009734 bl sub_8011C5C movs r0, 0x70 bl 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 .pool @080135E0: adds r0, r6, 0 adds r0, 0x9 ldr r2, =gUnknown_082EFB70 ldr r1, =0x020375e0 ldrh r1, [r1] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @080135FC b @08013B82 @080135FC: movs r0, 0x2 strb r0, [r6, 0x8] b @08013B82 .align 2, 0 .pool @0801360C: ldr r0, [r6, 0x4] movs r1, 0x4 bl sub_80175EC ldr r0, [r6] movs r1, 0x10 bl sub_8017580 ldr r0, [r6, 0x4] ldr r1, =0x020375e0 ldrh r1, [r1] bl sub_8016FC0 movs r4, 0 strb r0, [r6, 0x11] ldr r0, =gUnknown_082F00BC bl Window_AddFromTemplate strb r0, [r6, 0xC] ldr r0, =gUnknown_082F0174 bl Window_AddFromTemplate strb r0, [r6, 0xB] ldr r0, =gUnknown_082F017C bl Window_AddFromTemplate strb r0, [r6, 0xD] ldrb r0, [r6, 0xC] movs r1, 0x22 bl Window_FastFillPixels ldrb r0, [r6, 0xC] ldr r2, =gUnknown_082EF7DC movs r1, 0x1 str r1, [sp] movs r1, 0x4 str r1, [sp, 0x4] movs r1, 0 movs r3, 0x8 bl sub_80173E0 ldrb r0, [r6, 0xC] bl Window_WriteStandardTileMap ldrb r0, [r6, 0xC] movs r1, 0x2 bl Window_CopyToVram ldrb r0, [r6, 0xB] movs r1, 0 bl sub_81973FC ldr r0, =0x03006310 adds r2, r0, 0 ldr r1, =gUnknown_082F0204 ldm r1!, {r3,r5,r7} stm r2!, {r3,r5,r7} ldm r1!, {r3,r5,r7} stm r2!, {r3,r5,r7} ldrb r1, [r6, 0xB] strb r1, [r0, 0x10] movs r1, 0 movs r2, 0 bl 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 .pool @080136D8: bl sub_8013E44 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @080136F2 cmp r4, 0x1 beq @080136EA b @08013A72 @080136EA: movs r0, 0x2 bl audio_play b @08013A72 @080136F2: ldrb r0, [r6, 0xE] bl sub_81AE604 adds r4, r0, 0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08013770 movs r0, 0x1 negs r0, r0 cmp r4, r0 beq @08013770 ldr r0, [r6] lsls r1, r4, 5 adds r0, r1 ldrb r1, [r0, 0xA] ldrb r0, [r0, 0x1A] lsls r0, 30 lsrs r0, 30 cmp r0, 0x1 bne @08013768 lsrs r0, r1, 7 cmp r0, 0 bne @08013768 adds r0, r6, 0 adds r1, r4, 0 bl sub_8013B8C adds r1, r0, 0 cmp r1, 0 bne @08013744 adds r0, r6, 0 adds r1, r4, 0 bl sub_8013BD8 movs r0, 0x5 b @08013756 .align 2, 0 .pool @08013744: ldr r0, =0x02021fc4 ldr r2, =gUnknown_082EDD50 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 .pool @08013768: movs r0, 0x7 bl audio_play b @08013B82 @08013770: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0801377E b @08013B82 @0801377E: movs r0, 0xA strb r0, [r6, 0x8] b @08013B82 .align 2, 0 .pool @08013788: ldr r4, =0x02021fc4 ldr r0, =0x02022c2c ldrb r1, [r0] adds r0, r4, 0 bl sub_80130B4 adds r0, r6, 0 adds r0, 0x9 adds r1, r4, 0 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @080137A6 b @08013B82 @080137A6: ldr r0, =0x02021cc4 ldrb r2, [r6, 0xF] lsls r2, 5 ldr r1, [r6] adds r1, r2 bl sub_8018404 b @08013A86 .align 2, 0 .pool @080137C4: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0801387A ldr r4, =0x02022c2c ldr r1, [r6] ldrb r0, [r6, 0xF] lsls r0, 5 adds r1, r0 ldrb r0, [r1, 0xA] lsls r0, 25 lsrs r0, 25 strb r0, [r4] movs r0, 0 movs r1, 0 bl sub_8011A64 ldrb r0, [r4] subs r0, 0x1 cmp r0, 0x1B bhi @0801387A lsls r0, 2 ldr r1, =@08013804 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08013804: .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @0801387A .4byte @0801387A .4byte @0801387A .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @0801387A .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @0801387A .4byte @0801387A .4byte @0801387A .4byte @0801387A .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @08013874 .4byte @08013874 @08013874: movs r0, 0x14 strb r0, [r6, 0x8] b @08013B82 @0801387A: bl sub_8011A74 lsls r0, 24 lsrs r0, 24 subs r0, 0x1 cmp r0, 0x8 bls @0801388A b @080139EC @0801388A: lsls r0, 2 ldr r1, =@08013898 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08013898: .4byte @080138BC .4byte @080138C2 .4byte @080139EC .4byte @080139EC .4byte @080138C8 .4byte @080138C2 .4byte @08013934 .4byte @080139EC .4byte @080138C2 @080138BC: movs r0, 0xC strb r0, [r6, 0x8] b @080139EC @080138C2: movs r0, 0xE strb r0, [r6, 0x8] b @080139EC @080138C8: ldr r5, =0x02021fc4 ldr r4, =0x02022c2c ldrb r1, [r4] adds r0, r5, 0 bl sub_8013160 adds r0, r6, 0 adds r0, 0x9 adds r1, r5, 0 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @080138E6 b @080139EC @080138E6: ldrb r0, [r4] cmp r0, 0x1C beq @080138F0 cmp r0, 0xE bne @08013904 @080138F0: movs r0, 0xC movs r1, 0 bl sub_8011A64 b @080139EC .align 2, 0 .pool @08013904: movs r0, 0x7 movs r1, 0 bl sub_8011A64 ldr r0, =0x02021cc4 ldr r2, =gUnknown_082F0048 ldrb r1, [r4] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r1, =gUnknown_082EDE48 adds r0, r5, 0 bl ExpandTextCodes b @080139EC .align 2, 0 .pool @08013934: ldrb r0, [r6, 0x15] adds r2, r0, 0 cmp r2, 0xF0 bls @0801395C adds r0, r6, 0 adds r0, 0x9 ldr r1, =0x02021fc4 bl sub_8017064 lsls r0, 24 cmp r0, 0 beq @080139EC movs r0, 0xC movs r1, 0 bl sub_8011A64 movs r0, 0 b @080139EA .align 2, 0 .pool @0801395C: ldr r0, =0x02022c2c ldrb r0, [r0] subs r0, 0x1 cmp r0, 0x1B bhi @080139E8 lsls r0, 2 ldr r1, =@08013978 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08013978: .4byte @080139EC .4byte @080139EC .4byte @080139E8 .4byte @080139EC .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139EC .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139E8 .4byte @080139EC @080139E8: adds r0, r2, 0x1 @080139EA: strb r0, [r6, 0x15] @080139EC: bl sub_8011A74 lsls r0, 24 cmp r0, 0 beq @080139F8 b @08013B82 @080139F8: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08013A06 b @08013B82 @08013A06: movs r0, 0x7 strb r0, [r6, 0x8] b @08013B82 .align 2, 0 .pool @08013A10: adds r0, r6, 0 adds r0, 0x9 ldr r1, =gUnknown_082EDE64 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08013A22 b @08013B82 @08013A22: movs r0, 0x8 strb r0, [r6, 0x8] b @08013B82 .align 2, 0 .pool @08013A2C: adds r4, r6, 0 adds r4, 0x9 bl sub_8011A74 adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_80170B8 lsls r0, 24 asrs r1, r0, 24 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08013A6A cmp r1, r0 bgt @08013A58 subs r0, 0x2 cmp r1, r0 beq @08013A6E b @08013B82 @08013A58: cmp r1, 0 beq @08013A62 cmp r1, 0x1 beq @08013A6A b @08013B82 @08013A62: bl sub_80106D4 movs r0, 0x9 b @08013A70 @08013A6A: movs r0, 0x5 b @08013A70 @08013A6E: movs r0, 0x6 @08013A70: strb r0, [r6, 0x8] @08013A72: ldrb r0, [r6, 0xE] bl sub_81AE70C b @08013B82 @08013A7A: bl sub_8011A74 lsls r0, 24 cmp r0, 0 bne @08013A86 b @08013B82 @08013A86: movs r0, 0x6 strb r0, [r6, 0x8] b @08013B82 @08013A8C: ldrb r0, [r6, 0xD] bl 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, =gUnknown_082EDE9C bl sub_8011A74 lsls r0, 24 lsrs r0, 22 adds r0, r4 ldr r1, [r0] adds r0, r5, 0 bl sub_8017064 lsls r0, 24 cmp r0, 0 beq @08013B82 ldr r0, =0x020375f0 movs r1, 0x6 b @08013B58 .align 2, 0 .pool @08013B14: bl sub_800E084 ldr r0, =0x020375f0 movs r1, 0x5 b @08013B58 .align 2, 0 .pool @08013B24: bl sub_800E084 adds r5, r6, 0 adds r5, 0x9 ldr r4, =gUnknown_082EDE9C bl sub_8011A74 lsls r0, 24 lsrs r0, 22 adds r0, r4 ldr r1, [r0] adds r0, r5, 0 b @08013B4A .align 2, 0 .pool @08013B44: adds r0, r6, 0 adds r0, 0x9 ldr r1, =0x02021fc4 @08013B4A: bl sub_8017064 lsls r0, 24 cmp r0, 0 beq @08013B82 ldr r0, =0x020375f0 movs r1, 0x8 @08013B58: strh r1, [r0] movs r0, 0x17 strb r0, [r6, 0x8] b @08013B82 .align 2, 0 .pool @08013B68: adds r0, r4, 0 bl remove_task bl sub_80173D4 bl sub_800EDD4 b @08013B82 @08013B78: bl sub_80149C4 adds r0, r4, 0 bl remove_task @08013B82: add sp, 0x8 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80134E8 thumb_func_start sub_8013B8C sub_8013B8C: ; 8013B8C push {lr} lsls r1, 5 ldr r0, [r0] adds r3, r0, r1 ldr r0, =0x02022c2c ldrb r0, [r0] cmp r0, 0x4 bne @08013BCE ldrb r1, [r3, 0x1] movs r0, 0x3C ands r0, r1 cmp r0, 0xC beq @08013BCE ldr r0, =0x03005d90 ldr r0, [r0] ldrb r1, [r0, 0x9] movs r2, 0x80 adds r0, r2, 0 ands r0, r1 cmp r0, 0 bne @08013BC4 movs r0, 0x1 b @08013BD4 .align 2, 0 .pool @08013BC4: ldrb r1, [r3] adds r0, r2, 0 ands r0, r1 cmp r0, 0 beq @08013BD2 @08013BCE: movs r0, 0 b @08013BD4 @08013BD2: movs r0, 0x2 @08013BD4: pop {r1} bx r1 thumb_func_end sub_8013B8C thumb_func_start sub_8013BD8 sub_8013BD8: ; 8013BD8 push {r4,lr} adds r4, r0, 0 strb r1, [r4, 0xF] bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 ldrb r0, [r4, 0xE] bl sub_81AE70C ldr r0, =0x02021cc4 ldrb r2, [r4, 0xF] lsls r2, 5 ldr r1, [r4] adds r1, r2 bl sub_8018404 ldr r1, =gUnknown_082F0530 ldr r0, =0x020375e0 ldrh r0, [r0] adds r0, r1 ldrb r0, [r0] movs r1, 0 movs r2, 0x1 bl sub_8011090 ldrb r1, [r4, 0xF] lsls r1, 5 ldr r0, [r4] adds r0, r1 adds r4, r0, 0 adds r4, 0x10 adds r0, 0x2 bl sub_8015658 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_8011FC8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8013BD8 thumb_func_start sub_8013C40 sub_8013C40: ; 8013C40 push {lr} ldr r0, =sub_8013C7C movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r3, =0x02022c30 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r2, =0x03005e08 adds r1, r2 str r1, [r3] movs r2, 0 strb r2, [r1, 0x8] strb r2, [r1, 0x9] ldr r2, =0x03000da4 str r1, [r2] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8013C40 thumb_func_start sub_8013C7C sub_8013C7C: ; 8013C7C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02022c30 ldr r4, [r0] ldrb r0, [r4, 0x8] cmp r0, 0xB bhi @08013D80 lsls r0, 2 ldr r1, =@08013CA0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08013CA0: .4byte @08013CD0 .4byte @08013D80 .4byte @08013D04 .4byte @08013D28 .4byte @08013D80 .4byte @08013D80 .4byte @08013D80 .4byte @08013D80 .4byte @08013D80 .4byte @08013D80 .4byte @08013D58 .4byte @08013D76 @08013CD0: movs r0, 0 movs r1, 0 movs r2, 0 bl sub_8010F84 bl sub_800B488 bl sub_8009734 bl sub_8011C5C movs r0, 0x1 bl sub_80111B0 movs r0, 0x70 bl 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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 movs r2, 0x26 ldrsh r0, [r1, r2] cmp r0, 0xFF bne @08013D80 movs r0, 0xA strb r0, [r4, 0x8] b @08013D80 .align 2, 0 .pool @08013D58: ldrb r0, [r4, 0x11] bl remove_task ldr r0, [r4] bl free ldr r0, [r4, 0x4] bl free bl sub_800EDD4 ldrb r0, [r4, 0x8] adds r0, 0x1 strb r0, [r4, 0x8] b @08013D80 @08013D76: bl sub_800EDD4 adds r0, r5, 0 bl remove_task @08013D80: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8013C7C thumb_func_start sub_8013D88 sub_8013D88: ; 8013D88 push {lr} adds r2, r0, 0 cmp r1, 0xFF bne @08013D94 @08013D90: movs r0, 0x1 b @08013DB8 @08013D94: cmp r1, 0x16 bhi @08013DB6 ldr r0, =gUnknown_082F04D8 lsls r1, 2 adds r1, r0 ldr r1, [r1] b @08013DB0 .align 2, 0 .pool @08013DA8: ldrb r0, [r1] cmp r0, r2 beq @08013D90 adds r1, 0x1 @08013DB0: ldrb r0, [r1] cmp r0, 0xFF bne @08013DA8 @08013DB6: movs r0, 0 @08013DB8: pop {r1} bx r1 thumb_func_end sub_8013D88 thumb_func_start sub_8013DBC sub_8013DBC: ; 8013DBC push {lr} ldr r0, [r0] lsls r1, 5 adds r1, r0, r1 ldrb r2, [r1, 0x1A] lsls r0, r2, 30 lsrs r0, 30 cmp r0, 0x1 bne @08013DEE ldrb r0, [r1, 0xA] lsrs r0, 7 cmp r0, 0 beq @08013DDA movs r0, 0x3 b @08013DF0 @08013DDA: lsls r0, r2, 29 cmp r0, 0 bge @08013DE4 movs r0, 0x1 b @08013DF0 @08013DE4: ldrb r0, [r1, 0x1B] cmp r0, 0 beq @08013DEE movs r0, 0x2 b @08013DF0 @08013DEE: movs r0, 0 @08013DF0: pop {r1} bx r1 thumb_func_end sub_8013DBC thumb_func_start sub_8013DF4 sub_8013DF4: ; 8013DF4 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x8 adds r5, r0, 0 adds r4, r1, 0 adds r6, r2, 0 lsls r5, 24 lsrs r5, 24 lsls r6, 24 lsrs r6, 24 ldr r0, =0x02022c30 ldr r0, [r0] mov r8, r0 bl sub_8013DBC lsls r0, 24 lsrs r0, 24 lsls r1, r4, 5 mov r2, r8 ldr r3, [r2] adds r3, r1 str r0, [sp] lsls r4, 24 lsrs r4, 24 str r4, [sp, 0x4] adds r0, r5, 0 movs r1, 0x8 adds r2, r6, 0 bl sub_80177B8 add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8013DF4 thumb_func_start sub_8013E44 sub_8013E44: ; 8013E44 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 ldr r0, =0x02022c30 ldr r6, [r0] movs r7, 0 movs r3, 0 @08013E54: ldr r0, [r6] lsls r5, r3, 5 adds r2, r0, r5 ldrb r0, [r2, 0x1A] lsls r0, 30 mov r8, r5 cmp r0, 0 beq @08013F20 ldr r1, [r6, 0x4] adds r0, r2, 0 str r3, [sp] bl sub_80176E4 adds r4, r0, 0 ldr r3, [sp] cmp r4, 0xFF beq @08013EEE ldr r0, [r6] adds r2, r0, r5 ldrb r1, [r2, 0x1A] lsls r0, r1, 30 lsrs r0, 30 cmp r0, 0x1 bne @08013ECC lsls r0, r4, 3 subs r0, r4 lsls r4, r0, 2 ldr r1, [r6, 0x4] adds r1, r4 adds r0, r2, 0 bl sub_8017678 ldr r3, [sp] cmp r0, 0 beq @08013EB0 ldr r1, [r6] ldr r0, [r6, 0x4] adds r1, r5 adds r0, r4 ldm r0!, {r2,r4,r7} stm r1!, {r2,r4,r7} ldm r0!, {r2,r4,r7} stm r1!, {r2,r4,r7} b @08013EDA .align 2, 0 .pool @08013EB0: ldr r0, [r6] adds r1, r0, r5 ldrb r0, [r1, 0x1B] cmp r0, 0 beq @08013EE4 subs r0, 0x1 strb r0, [r1, 0x1B] ldr r0, [r6] adds r0, r5 ldrb r0, [r0, 0x1B] cmp r0, 0 bne @08013EE4 movs r7, 0x2 b @08013EE4 @08013ECC: movs r4, 0x4 negs r4, r4 adds r0, r4, 0 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x1A] @08013EDA: ldr r0, [r6] adds r0, r5 movs r1, 0x40 strb r1, [r0, 0x1B] movs r7, 0x1 @08013EE4: ldr r0, [r6] add r0, r8 movs r1, 0 strh r1, [r0, 0x18] b @08013F20 @08013EEE: ldr r0, [r6] adds r1, r0, r5 ldrb r0, [r1, 0x1A] lsls r0, 30 lsrs r0, 30 cmp r0, 0x2 beq @08013F20 ldrh r0, [r1, 0x18] adds r0, 0x1 strh r0, [r1, 0x18] ldr r0, [r6] adds r2, r0, r5 ldrh r1, [r2, 0x18] ldr r0, =0x0000012b cmp r1, r0 bls @08013F20 ldrb r0, [r2, 0x1A] movs r7, 0x4 negs r7, r7 adds r1, r7, 0 ands r0, r1 movs r1, 0x2 orrs r0, r1 strb r0, [r2, 0x1A] movs r7, 0x2 @08013F20: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0xF bls @08013E54 movs r5, 0 movs r4, 0x3 @08013F2E: ldr r0, [r6] ldr r1, [r6, 0x4] adds r1, r5 movs r2, 0x10 bl sub_8017734 lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @08013F44 movs r7, 0x1 @08013F44: adds r5, 0x1C subs r4, 0x1 cmp r4, 0 bge @08013F2E adds r0, r7, 0 add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8013E44 thumb_func_start sub_8013F60 sub_8013F60: ; 8013F60 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 bl sub_80773AC adds r0, r4, 0 bl remove_task pop {r4} pop {r0} bx r0 thumb_func_end sub_8013F60 thumb_func_start sub_8013F78 sub_8013F78: ; 8013F78 push {lr} ldr r0, =sub_8013F60 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8013F78 thumb_func_start sub_8013F90 sub_8013F90: ; 8013F90 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x02022c40 mov r8, r0 bl link_get_multiplayer_id adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_8018120 adds r7, r0, 0 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r5, r0, r1 movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0x1 beq @08013FFC cmp r0, 0x1 bgt @08013FD4 cmp r0, 0 beq @08013FDE b @080140BC .align 2, 0 .pool @08013FD4: cmp r0, 0x2 beq @08014038 cmp r0, 0x3 beq @08014070 b @080140BC @08013FDE: ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 movs r0, 0 movs r2, 0x64 bl link_0800A448 b @080140BC .align 2, 0 .pool @08013FFC: bl sub_800A550 lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bne @080140BC bl link_get_multiplayer_id adds r1, r0, 0 ldr r0, =0x02024744 movs r2, 0x1 eors r1, r2 lsls r1, 24 lsrs r1, 16 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x64 bl memcpy movs r0, 0x32 bl sav12_xor_increment bl sub_800A5B4 b @0801405A .align 2, 0 .pool @08014038: ldr r4, =0x020228c4 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00002be0 adds r1, r0 adds r0, r4, 0 movs r2, 0xDC bl memcpy movs r0, 0 adds r1, r4, 0 movs r2, 0xDC bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @080140BC @0801405A: ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] b @080140BC .align 2, 0 .pool @08014070: bl sub_800A550 lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bne @080140BC ldr r4, =0x020321c0 bl link_get_multiplayer_id adds r1, r0, 0 movs r0, 0x1 eors r1, r0 lsls r1, 24 lsrs r1, 16 ldr r0, =0x020223c4 adds r1, r0 adds r0, r4, 0 movs r2, 0xD8 bl memcpy bl sub_800A5B4 ldr r1, =0x02032298 strb r7, [r1] movs r0, 0x6 strb r0, [r1, 0x1] ldr r1, =0x030022c0 ldr r0, =c2_exit_to_overworld_2_switch str r0, [r1, 0x8] ldr r0, =sub_807AE50 bl 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 .pool thumb_func_end sub_8013F90 thumb_func_start sub_80140E0 sub_80140E0: ; 80140E0 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @08014104 cmp r0, 0x1 beq @0801411C b @0801419E .align 2, 0 .pool @08014104: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @08014114 movs r0, 0x2 bl sub_800A4D8 @08014114: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @0801419E @0801411C: bl sub_800A550 adds r4, r0, 0 bl sub_800A9D8 lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @0801419E movs r4, 0 ldr r5, =0x020229e8 b @08014152 .align 2, 0 .pool @08014138: lsls r1, r4, 8 ldr r0, =0x020223c4 adds r3, r1, r0 movs r0, 0x64 muls r0, r4 ldr r1, =0x02039b58 adds r0, r1 ldrb r2, [r5] adds r1, r3, 0 bl sub_80C3120 adds r5, 0x1C adds r4, 0x1 @08014152: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r4, r0 blt @08014138 bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08014190 bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 16 ldr r1, =0x020223c4 adds r3, r0, r1 adds r0, r3, 0 adds r0, 0x60 ldrh r0, [r0] bl sub_801B94C b @08014194 .align 2, 0 .pool @08014190: bl sub_801B940 @08014194: bl sub_800A5B4 adds r0, r6, 0 bl remove_task @0801419E: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_80140E0 thumb_func_start sub_80141A4 sub_80141A4: ; 80141A4 push {r4,lr} ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r4, r0, r1 ldrb r0, [r4] cmp r0, 0 beq @080141C0 cmp r0, 0x1 beq @080141D4 b @080141F2 .align 2, 0 .pool @080141C0: ldr r0, =sub_80140E0 movs r1, 0x5 bl AddTask ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @080141F2 .align 2, 0 .pool @080141D4: ldr r0, =sub_80140E0 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080141F2 bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 ldr r1, =c2_exit_to_overworld_2_switch bl sub_80C4E74 @080141F2: bl run_active_tasks bl run_remoboxes bl call_obj_callbacks bl obj_sync_something pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80141A4 thumb_func_start sub_8014210 sub_8014210: ; 8014210 push {r4-r6,lr} adds r6, r0, 0 lsls r6, 16 lsrs r6, 16 bl sp000_heal_pokemon bl copy_player_party_to_sav1 bl sub_8076ECC ldr r5, =0x020229e8 ldr r0, =0x00002211 str r0, [r5, 0x14] bl link_get_multiplayer_id adds r4, r0, 0 bl link_get_multiplayer_id lsls r4, 24 lsrs r4, 24 lsls r1, r4, 3 subs r1, r4 lsls r1, 2 adds r1, r5 lsls r0, 24 lsrs r0, 24 strh r0, [r1, 0x18] bl link_get_multiplayer_id adds r4, r0, 0 bl link_get_multiplayer_id movs r2, 0x1 eors r4, r2 lsls r4, 24 lsrs r4, 24 lsls r1, r4, 3 subs r1, r4 lsls r1, 2 adds r1, r5 eors r0, r2 lsls r0, 24 lsrs r0, 24 strh r0, [r1, 0x18] ldr r1, =0x030022c0 ldr r0, =sub_80B360C str r0, [r1, 0x8] ldr r0, =0x02022fec str r6, [r0] bl sub_806E64C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8014210 thumb_func_start sub_8014290 sub_8014290: ; 8014290 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x8 adds r3, r0, 0 adds r4, r1, 0 adds r5, r2, 0 lsls r3, 16 lsrs r3, 16 lsls r4, 16 lsrs r4, 16 lsls r5, 16 lsrs r5, 16 ldr r0, =0x00004087 adds r1, r3, 0 bl var_set ldr r6, =0x03005d8c ldr r1, [r6] movs r0, 0x4 ldrsb r0, [r1, r0] ldrb r1, [r1, 0x5] lsls r1, 24 asrs r1, 24 movs r2, 0x1 negs r2, r2 mov r8, r2 lsls r4, 24 asrs r4, 24 lsls r5, 24 asrs r5, 24 str r5, [sp] adds r3, r4, 0 bl warp1_set ldr r0, [r6] movs r1, 0x4 ldrsb r1, [r0, r1] movs r2, 0x5 ldrsb r2, [r0, r2] str r4, [sp] str r5, [sp, 0x4] movs r0, 0 mov r3, r8 bl saved_warp2_set_2 bl warp_in add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8014290 thumb_func_start sub_8014304 sub_8014304: ; 8014304 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 mov r8, r2 adds r6, r3, 0 ldr r1, [sp, 0x18] lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 lsls r1, 16 lsrs r1, 16 ldr r0, =0x020375e0 strh r1, [r0] ldr r0, =0x00004087 bl var_set bl sub_8009FCC ldr r1, =0x03005db8 strb r0, [r1] bl link_get_multiplayer_id ldr r1, =0x03005db4 strb r0, [r1] bl sub_809D2BC lsls r4, 24 asrs r4, 24 lsls r5, 24 asrs r5, 24 movs r2, 0x1 negs r2, r2 mov r0, r8 lsls r0, 24 asrs r0, 24 mov r8, r0 lsls r6, 24 asrs r6, 24 str r6, [sp] adds r0, r4, 0 adds r1, r5, 0 mov r3, r8 bl warp1_set bl warp_in add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8014304 thumb_func_start sub_8014384 sub_8014384: ; 8014384 push {r4,lr} ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r4, r0, r1 ldrb r0, [r4] cmp r0, 0 beq @080143A0 cmp r0, 0x1 beq @080143B4 b @080143C6 .align 2, 0 .pool @080143A0: ldr r0, =sub_80140E0 movs r1, 0x5 bl AddTask ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @080143C6 .align 2, 0 .pool @080143B4: ldr r0, =sub_80140E0 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080143C6 ldr r0, =sub_8086074 bl 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 .pool thumb_func_end sub_8014384 thumb_func_start sub_80143E4 sub_80143E4: ; 80143E4 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80C30A4 cmp r5, 0 beq @080143FE bl sub_801B39C adds r1, r4, 0 adds r1, 0x60 strh r0, [r1] b @08014404 @080143FE: adds r0, r4, 0 adds r0, 0x60 strh r5, [r0] @08014404: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_80143E4 thumb_func_start sub_801440C sub_801440C: ; 801440C push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 bl sub_801B940 ldr r0, =0x02022c2c ldrb r0, [r0] subs r0, 0x1 cmp r0, 0xE bhi @08014474 lsls r0, 2 ldr r1, =@08014434 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08014434: .4byte @08014470 .4byte @08014470 .4byte @08014470 .4byte @08014470 .4byte @08014474 .4byte @08014474 .4byte @08014474 .4byte @08014474 .4byte @08014470 .4byte @08014470 .4byte @08014470 .4byte @08014474 .4byte @08014470 .4byte @08014474 .4byte @08014470 @08014470: bl sub_800E3A8 @08014474: ldr r0, =0x02022c2c ldrb r0, [r0] subs r0, 0x1 cmp r0, 0x50 bls @08014480 b @08014764 @08014480: lsls r0, 2 ldr r1, =@08014494 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08014494: .4byte @080145F4 .4byte @08014620 .4byte @0801464C .4byte @08014678 .4byte @080146D8 .4byte @08014764 .4byte @08014764 .4byte @080146FC .4byte @08014714 .4byte @08014734 .4byte @0801474C .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014698 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @080145D8 .4byte @08014764 .4byte @08014764 .4byte @080146C4 .4byte @080146D8 .4byte @08014764 .4byte @08014764 .4byte @080146FC .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @08014764 .4byte @080145D8 @080145D8: bl overworld_free_bg_tilemaps ldr r1, =0x030022c0 ldr r0, =sub_801AC54 str r0, [r1, 0x8] movs r0, 0x3 bl sub_81B8518 b @08014764 .align 2, 0 .pool @080145F4: bl overworld_free_bg_tilemaps ldr r0, =0x020228c4 movs r1, 0x1 bl sub_80143E4 bl sp000_heal_pokemon bl copy_player_party_to_sav1 bl 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 .pool @08014620: bl overworld_free_bg_tilemaps bl sp000_heal_pokemon bl copy_player_party_to_sav1 bl sub_8076ECC ldr r0, =0x020228c4 movs r1, 0x1 bl sub_80143E4 movs r0, 0x2 str r0, [sp] movs r0, 0x19 movs r1, 0x18 movs r2, 0x6 movs r3, 0x8 b @080146B0 .align 2, 0 .pool @0801464C: bl overworld_free_bg_tilemaps bl sp000_heal_pokemon bl copy_player_party_to_sav1 bl sub_8076ECC ldr r0, =0x020228c4 movs r1, 0x1 bl sub_80143E4 movs r0, 0x5 str r0, [sp] movs r0, 0x19 movs r1, 0x1B movs r2, 0x5 movs r3, 0x8 b @080146B0 .align 2, 0 .pool @08014678: ldr r0, =0x020228c4 movs r1, 0x1 bl sub_80143E4 bl overworld_free_bg_tilemaps movs r0, 0x3 str r0, [sp] movs r0, 0x19 movs r1, 0x19 movs r2, 0x5 movs r3, 0x8 b @080146B0 .align 2, 0 .pool @08014698: ldr r0, =0x020228c4 movs r1, 0x1 bl sub_80143E4 bl overworld_free_bg_tilemaps movs r0, 0x4 str r0, [sp] movs r0, 0x19 movs r1, 0x1A movs r2, 0x8 movs r3, 0x9 @080146B0: bl sub_8014304 ldr r0, =sub_8014384 bl set_callback2 b @08014764 .align 2, 0 .pool @080146C4: bl overworld_free_bg_tilemaps ldr r0, =sub_8013F90 movs r1, 0 bl AddTask b @08014764 .align 2, 0 .pool @080146D8: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @080146E8 bl sub_800ED10 b @080146F6 @080146E8: bl sub_800ED28 movs r0, 0x45 movs r1, 0 movs r2, 0x1 bl sub_8010F84 @080146F6: bl sub_801DD98 b @08014764 @080146FC: ldr r0, =0x020228c4 movs r1, 0 bl sub_80143E4 ldr r0, =sub_80141A4 bl set_callback2 b @08014764 .align 2, 0 .pool @08014714: movs r0, 0x8 movs r1, 0x5 movs r2, 0x1 bl sub_8014290 bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 ldr r1, =c2_load_new_map bl sub_802A9A8 b @08014764 .align 2, 0 .pool @08014734: movs r0, 0x7 movs r1, 0x9 movs r2, 0x1 bl sub_8014290 ldr r0, =c2_load_new_map bl sub_8020C70 b @08014764 .align 2, 0 .pool @0801474C: movs r0, 0x8 movs r1, 0x5 movs r2, 0x1 bl sub_8014290 bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 ldr r1, =c2_load_new_map bl sub_802493C @08014764: adds r0, r4, 0 bl remove_task ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] ldr r0, =0x02022c2c ldrb r0, [r0] cmp r0, 0x44 beq @0801477C bl script_env_2_disable @0801477C: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801440C thumb_func_start sub_8014790 sub_8014790: ; 8014790 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e08 adds r7, r0, r1 ldr r0, =0x020228c4 mov r9, r0 movs r1, 0 ldrsh r0, [r7, r1] mov r2, r9 cmp r0, 0x8 bls @080147B6 b @080149B2 @080147B6: lsls r0, 2 ldr r1, =@080147CC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080147CC: .4byte @080147F0 .4byte @080148CC .4byte @080148E4 .4byte @0801491E .4byte @08014934 .4byte @0801494A .4byte @08014986 .4byte @08014992 .4byte @0801499C @080147F0: ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] ldr r0, =0x02022c2c ldrb r0, [r0] subs r0, 0xE cmp r0, 0xE bhi @080148C2 lsls r0, 2 ldr r1, =@08014818 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08014818: .4byte @08014854 .4byte @080148C2 .4byte @080148B8 .4byte @080148C2 .4byte @080148C2 .4byte @080148C2 .4byte @080148C2 .4byte @080148C2 .4byte @080148C2 .4byte @080148B8 .4byte @080148B8 .4byte @080148B8 .4byte @080148B8 .4byte @080148B8 .4byte @08014854 @08014854: ldr r1, =0x020229e8 ldr r0, =0x00002211 str r0, [r1, 0x14] movs r2, 0 mov r8, r2 mov r0, r8 strh r0, [r1, 0x18] movs r0, 0x2 strh r0, [r1, 0x34] ldr r6, =0x0203cef8 ldrb r0, [r6] movs r5, 0x64 muls r0, r5 ldr r4, =0x02024488 adds r0, r4 movs r1, 0xB bl pokemon_getattr mov r1, r9 strh r0, [r1] ldrb r0, [r6, 0x1] muls r0, r5 adds r0, r4 movs r1, 0xB movs r2, 0 bl pokemon_getattr mov r2, r9 strh r0, [r2, 0x2] ldr r0, =0x030022c0 mov r1, r8 str r1, [r0, 0x8] movs r0, 0x4 strh r0, [r7] bl sub_800E3A8 bl sub_800A5B4 b @080149B2 .align 2, 0 .pool @080148B8: bl sub_800E3A8 adds r0, r4, 0 bl remove_task @080148C2: bl script_env_2_enable_and_set_ctx_running movs r0, 0x1 strh r0, [r7] b @080149B2 @080148CC: bl script_env_context_is_running lsls r0, 24 cmp r0, 0 bne @080149B2 movs r0, 0x1 movs r1, 0 bl fade_screen movs r0, 0x2 strh r0, [r7] b @080149B2 @080148E4: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080149B2 ldr r0, =0x02022c2c ldrb r0, [r0] cmp r0, 0x1D bne @08014914 adds r0, r4, 0 bl remove_task ldr r0, =sub_80773AC bl set_callback2 b @080149B2 .align 2, 0 .pool @08014914: bl sub_800ADF8 movs r0, 0x3 strh r0, [r7] b @080149B2 @0801491E: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080149B2 adds r0, r4, 0 bl remove_task bl sub_80149D8 b @080149B2 @08014934: movs r0, 0 adds r1, r2, 0 movs r2, 0xE bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @080149B2 movs r0, 0x5 strh r0, [r7] b @080149B2 @0801494A: bl sub_800A550 lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bne @080149B2 bl sub_800A5B4 ldr r0, =0x020223c4 movs r2, 0x80 lsls r2, 1 adds r1, r0, r2 bl sub_80B2AF4 cmp r0, 0 beq @08014980 ldr r0, =0x020375f0 movs r1, 0xB strh r1, [r0] movs r0, 0x7 strh r0, [r7] b @080149B2 .align 2, 0 .pool @08014980: movs r0, 0x6 strh r0, [r7] b @080149B2 @08014986: bl script_env_2_enable_and_set_ctx_running adds r0, r4, 0 bl remove_task b @080149B2 @08014992: bl sub_800AC34 movs r0, 0x8 strh r0, [r7] b @080149B2 @0801499C: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080149B2 bl sub_800E084 bl script_env_2_enable_and_set_ctx_running adds r0, r4, 0 bl remove_task @080149B2: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8014790 thumb_func_start sub_80149C4 sub_80149C4: ; 80149C4 push {lr} ldr r0, =sub_8014790 movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80149C4 thumb_func_start sub_80149D8 sub_80149D8: ; 80149D8 push {lr} ldr r0, =sub_801440C movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80149D8 thumb_func_start sub_8014A00 sub_8014A00: ; 8014A00 push {r4,lr} adds r4, r0, 0 ldr r0, =sub_8014A40 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x02022c30 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r1, r0 str r1, [r2] movs r2, 0 strb r2, [r1, 0xC] strb r2, [r1, 0xD] strb r4, [r1, 0x18] ldr r0, =0x020375f0 strh r2, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8014A00 thumb_func_start sub_8014A40 sub_8014A40: ; 8014A40 push {r4-r6,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02022c30 ldr r5, [r0] ldrb r0, [r5, 0xC] cmp r0, 0x11 bls @08014A54 b @08014EF2 @08014A54: lsls r0, 2 ldr r1, =@08014A68 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08014A68: .4byte @08014AB0 .4byte @08014AEC .4byte @08014BBC .4byte @08014BEC .4byte @08014BFC .4byte @08014C4C .4byte @08014C24 .4byte @08014C52 .4byte @08014CF2 .4byte @08014DBC .4byte @08014DCC .4byte @08014DE2 .4byte @08014DFA .4byte @08014E16 .4byte @08014E4E .4byte @08014E74 .4byte @08014EA8 .4byte @08014EE2 @08014AB0: ldr r1, =0x02022c2c ldrb r0, [r5, 0x18] strb r0, [r1] ldr r1, =0x02022c2d movs r0, 0x2 strb r0, [r1] ldrb r0, [r5, 0x18] movs r1, 0 movs r2, 0 bl sub_8010F84 movs r0, 0 movs r1, 0 bl sub_8010FA0 bl sub_800B488 bl sub_8009734 movs r0, 0x2 bl sub_8011C10 movs r0, 0x1 strb r0, [r5, 0xC] b @08014EF2 .align 2, 0 .pool @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, =gUnknown_082F011C ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] bl sub_8019930 lsls r0, 16 ldr r2, =0x0000ffff ldr r1, [sp, 0x4] ands r1, r2 orrs r1, r0 ldr r0, =0xffff00ff ands r1, r0 movs r0, 0xC0 lsls r0, 4 orrs r1, r0 str r1, [sp, 0x4] mov r0, sp bl Window_AddFromTemplate strb r0, [r5, 0xF] ldrb r0, [r5, 0xF] bl sub_8018784 ldr r0, =0x03006310 adds r2, r0, 0 ldr r1, =gUnknown_082F015C ldm r1!, {r3,r4,r6} stm r2!, {r3,r4,r6} ldm r1!, {r3,r4,r6} stm r2!, {r3,r4,r6} ldrb r1, [r5, 0xF] strb r1, [r0, 0x10] movs r1, 0 movs r2, 0 bl 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 .pool @08014BBC: ldr r0, =0x02021cc4 ldr r2, =gUnknown_082F0048 ldr r4, =0x02022c2c ldrb r1, [r4] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r0, =0x02021fc4 ldrb r1, [r4] bl sub_801262C movs r0, 0x3 strb r0, [r5, 0xC] b @08014EF2 .align 2, 0 .pool @08014BEC: ldr r0, =0x02021fc4 bl sub_8018884 movs r0, 0x4 strb r0, [r5, 0xC] b @08014EF2 .align 2, 0 .pool @08014BFC: adds r0, r5, 0 movs r1, 0x5 movs r2, 0x6 bl sub_801320C ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08014C14 b @08014EF2 @08014C14: movs r0, 0xD strb r0, [r5, 0xC] bl sub_800E084 b @08014EF2 .align 2, 0 .pool @08014C24: adds r0, r5, 0 adds r0, 0xD ldr r1, =gUnknown_082EDF40 bl mevent_0814257C cmp r0, 0 bne @08014C34 b @08014EF2 @08014C34: ldr r0, [r5] bl sub_8013398 strb r0, [r5, 0x13] ldrb r0, [r5, 0x12] bl sub_81AE70C @08014C42: movs r0, 0x2 strb r0, [r5, 0xC] b @08014EF2 .align 2, 0 .pool @08014C4C: movs r0, 0x7 strb r0, [r5, 0xC] b @08014EF2 @08014C52: adds r0, r5, 0 adds r0, 0xD adds r1, r5, 0 adds r1, 0x14 ldr r3, =0x02021fc4 movs r2, 0 bl sub_8018B08 lsls r0, 24 asrs r4, r0, 24 cmp r4, 0 beq @08014C82 cmp r4, 0 bgt @08014C7C movs r0, 0x1 negs r0, r0 cmp r4, r0 beq @08014CC4 b @08014EF2 .align 2, 0 .pool @08014C7C: cmp r4, 0x1 beq @08014CC4 b @08014EF2 @08014C82: bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 ldr r1, [r5] ldrb r0, [r5, 0x13] lsls r0, 5 adds r1, r0 strb r4, [r1, 0x1B] ldrb r0, [r5, 0x12] bl sub_81AE70C movs r0, 0x5 strb r0, [r5, 0x19] ldrb r1, [r5, 0x13] lsls r1, 5 ldr r0, [r5] adds r0, r1 adds r0, 0x2 bl sub_8015658 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 ldrb r0, [r5, 0x13] lsls r0, 5 ldr r2, [r5] adds r2, r0 adds r2, 0x10 movs r0, 0x5 b @08014CE8 @08014CC4: movs r0, 0x6 strb r0, [r5, 0x19] ldrb r1, [r5, 0x13] lsls r1, 5 ldr r0, [r5] adds r0, r1 adds r0, 0x2 bl sub_8015658 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 ldrb r0, [r5, 0x13] lsls r0, 5 ldr r2, [r5] adds r2, r0 adds r2, 0x10 movs r0, 0x6 @08014CE8: bl sub_8010688 movs r0, 0x8 strb r0, [r5, 0xC] b @08014EF2 @08014CF2: ldrb r1, [r5, 0x13] lsls r1, 5 ldr r0, [r5] adds r0, r1 adds r0, 0x2 bl sub_8015658 lsls r0, 16 lsrs r0, 16 ldrb r2, [r5, 0x13] lsls r2, 5 ldr r1, [r5] adds r1, r2 adds r1, 0x10 bl sub_8010714 adds r4, r0, 0 cmp r4, 0x1 bne @08014DAA ldrb r0, [r5, 0x19] cmp r0, 0x5 bne @08014D64 ldr r1, [r5] ldrb r0, [r5, 0x13] lsls r0, 5 adds r1, r0 movs r0, 0 strb r0, [r1, 0x1B] ldrb r0, [r5, 0x12] bl sub_81AE70C ldrb r0, [r5, 0x13] adds r0, 0x1 strb r0, [r5, 0x13] ldr r0, =0x02021cc4 ldrb r2, [r5, 0x13] lsls r2, 5 subs r2, 0x20 ldr r1, [r5] adds r1, r2 bl sub_8018404 ldr r0, =0x02021fc4 ldr r1, =gUnknown_082EDC9C bl ExpandTextCodes movs r0, 0x9 strb r0, [r5, 0xC] bl sub_800EF38 b @08014DA4 .align 2, 0 .pool @08014D64: ldrb r1, [r5, 0x13] lsls r1, 5 ldr r0, [r5] adds r0, r1 adds r4, r0, 0 adds r4, 0x10 adds r0, 0x2 bl sub_8015658 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_8011DC0 ldr r1, [r5] ldrb r0, [r5, 0x13] lsls r0, 5 adds r1, r0 ldrb r2, [r1, 0x1A] movs r0, 0x4 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1A] ldr r0, [r5] bl sub_8013398 ldrb r0, [r5, 0x12] bl sub_81AE70C movs r0, 0x2 strb r0, [r5, 0xC] @08014DA4: movs r0, 0 strb r0, [r5, 0x19] b @08014EF2 @08014DAA: cmp r4, 0x2 beq @08014DB0 b @08014EF2 @08014DB0: movs r0, 0 movs r1, 0 bl sub_8011A64 strb r4, [r5, 0xC] b @08014EF2 @08014DBC: ldr r0, =0x02021fc4 bl sub_8018884 movs r0, 0xA strb r0, [r5, 0xC] b @08014EF2 .align 2, 0 .pool @08014DCC: ldrb r0, [r5, 0xE] adds r0, 0x1 strb r0, [r5, 0xE] lsls r0, 24 lsrs r0, 24 cmp r0, 0x78 bhi @08014DDC b @08014EF2 @08014DDC: movs r0, 0xB strb r0, [r5, 0xC] b @08014EF2 @08014DE2: adds r0, r5, 0 movs r1, 0x5 movs r2, 0x6 bl sub_801320C lsls r0, 24 cmp r0, 0 beq @08014DF4 b @08014EF2 @08014DF4: movs r0, 0xC strb r0, [r5, 0xC] b @08014EF2 @08014DFA: bl sub_800EF1C lsls r0, 24 cmp r0, 0 beq @08014E10 movs r0, 0 bl sub_800EF58 movs r0, 0xF strb r0, [r5, 0xC] b @08014EF2 @08014E10: movs r0, 0x6 strb r0, [r5, 0xC] b @08014EF2 @08014E16: bl sub_800E084 bl sub_800EDD4 ldrb r0, [r5, 0x12] movs r1, 0 movs r2, 0 bl sub_81AE6C8 movs r0, 0 bl 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, =gUnknown_082ED8D0 bl mevent_0814257C cmp r0, 0 beq @08014EF2 adds r0, r4, 0 bl remove_task ldr r1, =0x020375f0 movs r0, 0x5 strh r0, [r1] b @08014EF2 .align 2, 0 .pool @08014E74: bl sub_8011A74 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08014E8C bl sub_8011A74 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08014E92 @08014E8C: movs r0, 0xD strb r0, [r5, 0xC] b @08014EF2 @08014E92: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08014EF2 movs r0, 0x1 bl sub_8011068 b @08014EDA .align 2, 0 .pool @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, =sub_8014F48 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x02022c30 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r1, r0 str r1, [r2] ldr r0, =0x03000da4 str r1, [r0] movs r2, 0 strb r2, [r1, 0x8] strb r2, [r1, 0x9] subs r4, 0x15 strb r4, [r1, 0x12] ldr r0, =0x020375f0 strh r2, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8014EFC thumb_func_start sub_8014F48 sub_8014F48: ; 8014F48 push {r4-r7,lr} sub sp, 0x10 lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x02022c30 ldr r7, [r0] ldrb r0, [r7, 0x8] cmp r0, 0xC bls @08014F5C b @080152A0 @08014F5C: lsls r0, 2 ldr r1, =@08014F70 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08014F70: .4byte @08014FA4 .4byte @08014FD8 .4byte @08014FE8 .4byte @080150B8 .4byte @08015180 .4byte @080151A4 .4byte @08015204 .4byte @08015260 .4byte @08015204 .4byte @0801523A .4byte @08015204 .4byte @08015284 .4byte @08015290 @08014FA4: ldrb r0, [r7, 0x12] adds r0, 0x15 lsls r0, 24 lsrs r0, 24 movs r1, 0 movs r2, 0 bl sub_8010F84 bl sub_800B488 bl sub_8009734 bl sub_8011C5C movs r0, 0x70 bl 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, =gUnknown_082EF7F8 bl sub_8018884 movs r0, 0x2 strb r0, [r7, 0x8] b @080152A0 .align 2, 0 .pool @08014FE8: ldr r0, [r7, 0x4] movs r1, 0x4 bl sub_80175EC ldr r0, [r7] movs r1, 0x10 bl sub_8017580 ldr r0, [r7, 0x4] ldrb r1, [r7, 0x12] adds r1, 0x7 bl sub_8016FC0 movs r6, 0 strb r0, [r7, 0x11] ldr r0, =gUnknown_082F0174 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] bl sub_8019930 lsls r0, 16 ldr r2, =0x0000ffff ldr r1, [sp, 0x4] ands r1, r2 orrs r1, r0 ldr r5, =0xffff00ff ands r1, r5 movs r4, 0xC0 lsls r4, 4 orrs r1, r4 str r1, [sp, 0x4] mov r0, sp bl Window_AddFromTemplate strb r0, [r7, 0xB] ldr r0, =gUnknown_082F017C ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x8] str r1, [sp, 0xC] add r0, sp, 0x8 ldr r1, [r0, 0x4] ands r1, r5 orrs r1, r4 str r1, [r0, 0x4] bl Window_AddFromTemplate strb r0, [r7, 0xD] ldrb r0, [r7, 0xB] bl sub_8018784 ldr r0, =0x03006310 adds r2, r0, 0 ldr r1, =gUnknown_082F0204 ldm r1!, {r3-r5} stm r2!, {r3-r5} ldm r1!, {r3-r5} stm r2!, {r3-r5} ldrb r1, [r7, 0xB] strb r1, [r0, 0x10] movs r1, 0 movs r2, 0 bl 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 .pool @080150B8: bl sub_8013E44 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 beq @080150D6 cmp r2, 0x1 bne @080150CE movs r0, 0x2 bl audio_play @080150CE: ldrb r0, [r7, 0xE] bl sub_81AE70C b @080152A0 @080150D6: ldrb r0, [r7, 0xE] bl sub_81AE604 adds r2, r0, 0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08015168 movs r0, 0x1 negs r0, r0 cmp r2, r0 beq @08015168 ldr r0, [r7] lsls r1, r2, 5 adds r0, r1 ldrb r1, [r0, 0xA] ldrb r0, [r0, 0x1A] lsls r0, 30 lsrs r0, 30 cmp r0, 0x1 bne @08015160 lsrs r0, r1, 7 cmp r0, 0 bne @08015160 strb r2, [r7, 0xF] bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 ldrb r0, [r7, 0xE] bl sub_81AE70C ldr r0, =0x02021cc4 ldrb r2, [r7, 0xF] lsls r2, 5 ldr r1, [r7] adds r1, r2 bl sub_8018404 ldrb r1, [r7, 0xF] lsls r1, 5 ldr r0, [r7] adds r0, r1 adds r4, r0, 0 adds r4, 0x10 adds r0, 0x2 bl sub_8015658 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_8011FC8 movs r0, 0x6E bl audio_play movs r0, 0x4 strb r0, [r7, 0x8] b @080152A0 .align 2, 0 .pool @08015160: movs r0, 0x7 bl audio_play b @080152A0 @08015168: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08015176 b @080152A0 @08015176: movs r0, 0x6 strb r0, [r7, 0x8] b @080152A0 .align 2, 0 .pool @08015180: ldr r0, =gUnknown_082EFC3C bl sub_8018884 ldr r0, =0x02021cc4 ldrb r2, [r7, 0xF] lsls r2, 5 ldr r1, [r7] adds r1, r2 bl sub_8018404 movs r0, 0x5 strb r0, [r7, 0x8] b @080152A0 .align 2, 0 .pool @080151A4: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080151C2 ldr r2, =0x02022c2c ldr r1, [r7] ldrb r0, [r7, 0xF] lsls r0, 5 adds r1, r0 ldrb r0, [r1, 0xA] lsls r0, 25 lsrs r0, 25 strb r0, [r2] movs r0, 0xA strb r0, [r7, 0x8] @080151C2: bl sub_8011A74 lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 beq @080151EE cmp r0, 0x5 bgt @080151E4 cmp r0, 0x2 bgt @080152A0 cmp r0, 0x1 blt @080152A0 b @080151E8 .align 2, 0 .pool @080151E4: cmp r0, 0x6 bne @080152A0 @080151E8: movs r0, 0x8 strb r0, [r7, 0x8] b @080152A0 @080151EE: ldr r0, =gUnknown_082EDDF4 bl sub_8018884 movs r0, 0 movs r1, 0 bl sub_8011A64 b @080152A0 .align 2, 0 .pool @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, =gUnknown_082EDF80 bl sub_8011A74 lsls r0, 24 lsrs r0, 22 adds r0, r4 ldr r1, [r0] adds r0, r5, 0 bl mevent_0814257C cmp r0, 0 beq @080152A0 bl sub_800E084 b @0801526A .align 2, 0 .pool @08015260: bl sub_800E084 ldr r0, =gUnknown_082ED8D0 bl sub_8018884 @0801526A: adds r0, r6, 0 bl remove_task bl sub_800EDD4 ldr r1, =0x020375f0 movs r0, 0x5 strh r0, [r1] b @080152A0 .align 2, 0 .pool @08015284: ldrb r0, [r7, 0x8] adds r0, 0x1 strb r0, [r7, 0x8] bl sub_800ADF8 b @080152A0 @08015290: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080152A0 adds r0, r6, 0 bl remove_task @080152A0: add sp, 0x10 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8014F48 thumb_func_start sub_80152A8 sub_80152A8: ; 80152A8 push {r4,lr} adds r4, r0, 0 ldr r0, =task00_081182DC movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x02022c30 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r1, r0 str r1, [r2] ldr r0, =0x03000da4 str r1, [r0] movs r2, 0 strb r2, [r1, 0x8] strb r2, [r1, 0x9] subs r4, 0x15 strb r4, [r1, 0x12] ldr r0, =0x020375f0 strh r2, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80152A8 thumb_func_start task00_081182DC task00_081182DC: ; 80152F4 push {r4-r6,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02022c30 ldr r5, [r0] ldrb r0, [r5, 0x8] cmp r0, 0xE bls @08015308 b @08015604 @08015308: lsls r0, 2 ldr r1, =@0801531C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801531C: .4byte @08015358 .4byte @08015386 .4byte @08015398 .4byte @08015420 .4byte @080154E0 .4byte @08015504 .4byte @08015564 .4byte @080155A8 .4byte @08015564 .4byte @0801559A .4byte @08015564 .4byte @080155B4 .4byte @08015564 .4byte @080155E8 .4byte @080155F4 @08015358: movs r0, 0 movs r1, 0 movs r2, 0 bl sub_8010F84 bl sub_800B488 bl sub_8009734 bl sub_8011C5C movs r0, 0x70 bl 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, =gUnknown_082EFBC8 bl sub_8018884 movs r0, 0x2 strb r0, [r5, 0x8] b @08015604 .align 2, 0 .pool @08015398: ldr r0, [r5, 0x4] movs r1, 0x4 bl sub_80175EC ldr r0, [r5] movs r1, 0x10 bl sub_8017580 ldr r0, [r5, 0x4] ldrb r1, [r5, 0x12] adds r1, 0x7 bl sub_8016FF0 strb r0, [r5, 0x11] ldrb r0, [r5, 0x13] cmp r0, 0 beq @08015404 ldr r0, =gUnknown_082F0174 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] bl sub_8019930 lsls r0, 16 ldr r2, =0x0000ffff ldr r1, [sp, 0x4] ands r1, r2 orrs r1, r0 str r1, [sp, 0x4] mov r0, sp bl Window_AddFromTemplate strb r0, [r5, 0xB] ldrb r0, [r5, 0xB] bl sub_8018784 ldr r0, =0x03006310 adds r2, r0, 0 ldr r1, =gUnknown_082F0204 ldm r1!, {r3,r4,r6} stm r2!, {r3,r4,r6} ldm r1!, {r3,r4,r6} stm r2!, {r3,r4,r6} ldrb r1, [r5, 0xB] strb r1, [r0, 0x10] movs r1, 0 movs r2, 0 bl 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 .pool @08015420: bl sub_8013E44 lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @08015446 cmp r0, 0x1 bne @08015436 movs r0, 0x2 bl audio_play @08015436: ldrb r0, [r5, 0x13] cmp r0, 0 bne @0801543E b @08015604 @0801543E: ldrb r0, [r5, 0xE] bl sub_81AE70C b @08015604 @08015446: ldrb r0, [r5, 0x13] cmp r0, 0 beq @08015452 ldrb r0, [r5, 0xE] bl 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080154D4 movs r1, 0 movs r0, 0x6 strb r0, [r5, 0x8] strb r1, [r5, 0x14] @080154D4: ldrb r0, [r5, 0x14] adds r0, 0x1 strb r0, [r5, 0x14] b @08015604 .align 2, 0 .pool @080154E0: ldr r0, =gUnknown_082EFC90 bl sub_8018884 ldr r0, =0x02021cc4 ldrb r2, [r5, 0xF] lsls r2, 5 ldr r1, [r5] adds r1, r2 bl sub_8018404 movs r0, 0x5 strb r0, [r5, 0x8] b @08015604 .align 2, 0 .pool @08015504: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08015522 ldr r2, =0x02022c2c ldr r1, [r5] ldrb r0, [r5, 0xF] lsls r0, 5 adds r1, r0 ldrb r0, [r1, 0xA] lsls r0, 25 lsrs r0, 25 strb r0, [r2] movs r0, 0xC strb r0, [r5, 0x8] @08015522: bl sub_8011A74 lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 beq @0801554E cmp r0, 0x5 bgt @08015544 cmp r0, 0x2 bgt @08015604 cmp r0, 0x1 blt @08015604 b @08015548 .align 2, 0 .pool @08015544: cmp r0, 0x6 bne @08015604 @08015548: movs r0, 0x8 strb r0, [r5, 0x8] b @08015604 @0801554E: ldr r0, =gUnknown_082EDEC4 bl sub_8018884 movs r0, 0 movs r1, 0 bl sub_8011A64 b @08015604 .align 2, 0 .pool @08015564: ldrb r0, [r5, 0x13] cmp r0, 0 beq @08015580 ldrb r0, [r5, 0xE] movs r1, 0 movs r2, 0 bl sub_81AE6C8 movs r0, 0 bl 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, =gUnknown_082EDF04 b @080155C2 .align 2, 0 .pool @080155A8: adds r0, r5, 0 adds r0, 0x9 ldr r1, =gUnknown_082ED8F8 b @080155C2 .align 2, 0 .pool @080155B4: adds r0, r5, 0 adds r0, 0x9 ldr r2, =gUnknown_082EFD58 ldrb r1, [r5, 0x12] lsls r1, 2 adds r1, r2 ldr r1, [r1] @080155C2: bl mevent_0814257C cmp r0, 0 beq @08015604 bl sub_800E084 adds r0, r4, 0 bl remove_task bl sub_800EDD4 ldr r1, =0x020375f0 movs r0, 0x5 strh r0, [r1] b @08015604 .align 2, 0 .pool @080155E8: ldrb r0, [r5, 0x8] adds r0, 0x1 strb r0, [r5, 0x8] bl sub_800ADF8 b @08015604 @080155F4: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08015604 adds r0, r4, 0 bl remove_task @08015604: add sp, 0x8 pop {r4-r6} pop {r0} bx r0 thumb_func_end task00_081182DC thumb_func_start sub_801560C sub_801560C: ; 801560C push {r4,lr} bl sub_8010F60 ldr r0, =sub_80156E0 movs r1, 0xA bl AddTask ldr r4, =0x02022c30 movs r0, 0x9B lsls r0, 2 bl malloc_and_clear str r0, [r4] ldr r1, =0x03000da8 str r0, [r1] movs r1, 0 strb r1, [r0, 0x14] strb r1, [r0, 0x16] strh r1, [r0, 0x10] strh r1, [r0, 0x12] ldr r0, =0x020375f0 strh r1, [r0] movs r0, 0xD0 movs r1, 0x1 bl sub_819A2BC pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022c30 ldr r2, [r1] movs r1, 0x8 strb r1, [r2, 0x14] strb r0, [r2, 0x15] ldr r0, =0x02021fc4 cmp r3, r0 beq @0801567E adds r1, r3, 0 bl ExpandTextCodes @0801567E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8015664 thumb_func_start sub_801568C sub_801568C: ; 801568C push {lr} adds r2, r0, 0 ldr r0, =0x02022c30 ldr r1, [r0] movs r0, 0x1A strb r0, [r1, 0x14] ldr r0, =0x02021fc4 cmp r2, r0 beq @080156A4 adds r1, r2, 0 bl ExpandTextCodes @080156A4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801568C thumb_func_start sub_80156B0 sub_80156B0: ; 80156B0 push {lr} ldr r3, =0x0201ff00 ldr r1, [r0] movs r2, 0x80 lsls r2, 1 adds r0, r3, 0 bl memcpy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80156B0 thumb_func_start sub_80156C8 sub_80156C8: ; 80156C8 push {lr} ldr r0, [r0] ldr r1, =0x0201ff00 movs r2, 0x80 lsls r2, 1 bl memcpy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80156C8 thumb_func_start sub_80156E0 sub_80156E0: ; 80156E0 push {r4-r7,lr} sub sp, 0xC lsls r0, 24 lsrs r4, r0, 24 movs r5, 0 ldr r0, =0x02022c30 ldr r6, [r0] lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e08 adds r7, r0, r1 ldrb r0, [r6, 0x14] cmp r0, 0x38 bls @08015702 bl @08016878 @08015702: lsls r0, 2 ldr r1, =@08015718 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08015718: .4byte @080157FC .4byte @08015854 .4byte @08015878 .4byte @080158C8 .4byte @080159A6 .4byte @08015E5C .4byte @08015C54 .4byte @08015E5C .4byte @08016864 .4byte @080161C8 .4byte @080162D4 .4byte @080160AC .4byte @080160C6 .4byte @08016324 .4byte @08016348 .4byte @08016350 .4byte @08016360 .4byte @0801638E .4byte @080163A2 .4byte @08015F32 .4byte @08015FB8 .4byte @08015FD6 .4byte @0801604A .4byte @08015ADA .4byte @08015B00 .4byte @08015B78 .4byte @08016838 .4byte @08015D4C .4byte @08015D34 .4byte @08015DD0 .4byte @08015C2A .4byte @08015DA6 .4byte @08015D9C .4byte @08016158 .4byte @08016178 .4byte @080161B8 .4byte @080162DC .4byte @08016318 .4byte @08015BF4 .4byte @08016104 .4byte @08015E94 .4byte @08015EC4 .4byte @080163CC .4byte @0801645C .4byte @080165A8 .4byte @08016610 .4byte @0801662C .4byte @08016478 .4byte @08016634 .4byte @08016738 .4byte @0801676C .4byte @080167F4 .4byte @0801652C .4byte @080164E0 .4byte @080164F4 .4byte @0801658C .4byte @080165DC @080157FC: movs r0, 0x70 bl 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, =0x02022c2c movs r0, 0x40 strb r0, [r1] ldr r0, [r6, 0xC] ldr r1, [r6, 0x4] movs r2, 0x9 bl sub_8016DF0 adds r1, r6, 0 adds r1, 0x20 strb r0, [r1] adds r0, r6, 0 adds r0, 0xA0 bl sub_8019BA8 bl sub_8019F2C movs r0, 0x1 bl @08016876 .align 2, 0 .pool @08015854: adds r0, r6, 0 adds r0, 0x21 movs r2, 0 ldrsh r1, [r7, r2] bl sub_8019E70 ldrh r0, [r7] adds r0, 0x1 strh r0, [r7] lsls r0, 16 asrs r0, 16 cmp r0, 0x8 beq @08015872 bl @08016878 @08015872: movs r0, 0x2 bl @08016876 @08015878: movs r0, 0x40 movs r1, 0 movs r2, 0 bl sub_8010F84 ldr r2, =0x02022c40 ldrh r0, [r2, 0x2] ldrh r1, [r2, 0xA] ldrh r2, [r2, 0xC] bl sub_8010FCC bl sub_800B488 bl sub_8009734 bl sub_8011C84 ldr r0, [r6, 0x8] movs r1, 0x1 bl sub_8017580 ldr r0, [r6, 0x4] movs r1, 0x4 bl sub_80175EC ldr r0, [r6, 0xC] movs r1, 0x4 bl sub_80175EC ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] movs r0, 0x3 bl @08016876 .align 2, 0 .pool @080158C8: bl sub_81B1360 lsls r0, 24 lsrs r0, 24 cmp r0, 0x8 beq @080158E0 bl sub_81B1360 lsls r0, 24 lsrs r0, 24 cmp r0, 0x9 bne @080159A0 @080158E0: ldr r4, =0x02022c40 ldrh r0, [r4] cmp r0, 0 beq @080159A0 bl brm_get_pokemon_selection lsls r0, 24 lsrs r5, r0, 24 ldrh r0, [r4] cmp r0, 0x1 beq @08015900 cmp r0, 0x2 beq @08015950 b @0801598E .align 2, 0 .pool @08015900: movs r0, 0x54 movs r1, 0 movs r2, 0x1 bl sub_8011090 cmp r5, 0x5 bls @0801592C adds r0, r4, 0 bl sub_801807C movs r0, 0 movs r1, 0 movs r2, 0 bl sub_8010FCC ldr r0, =gUnknown_082EF4FC bl sub_801568C b @0801598E .align 2, 0 .pool @0801592C: bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 bl sub_80180A0 cmp r0, 0 bne @0801594C ldr r1, =gUnknown_082EF47C movs r0, 0x34 bl sub_8015664 b @0801598E .align 2, 0 .pool @0801594C: movs r0, 0x37 b @0801598C @08015950: adds r0, r6, 0 bl sub_80156C8 ldrb r0, [r4, 0x8] strh r0, [r7, 0x2] cmp r5, 0x5 bls @0801596C ldr r0, =gUnknown_082EF544 bl sub_801568C b @0801598E .align 2, 0 .pool @0801596C: movs r0, 0x54 movs r1, 0 movs r2, 0x1 bl sub_8011090 ldr r1, =0x02022c2c movs r0, 0x44 strb r0, [r1] bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 bl sub_80180E8 movs r0, 0x33 @0801598C: strb r0, [r6, 0x14] @0801598E: ldr r1, =0x02022c40 movs r0, 0 strh r0, [r1] bl @08016878 .align 2, 0 .pool @080159A0: movs r0, 0x4 bl @08016876 @080159A6: ldr r4, =0x020375f0 ldrh r0, [r4] cmp r0, 0 beq @08015A0A cmp r0, 0x9 bne @080159E0 movs r0, 0x54 movs r1, 0 movs r2, 0x1 bl sub_8011090 movs r0, 0x2 bl audio_play ldr r0, =0x02021cc4 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy movs r1, 0 movs r0, 0x2A b @08015A02 .align 2, 0 .pool @080159E0: cmp r0, 0xB bne @080159F4 movs r0, 0x54 movs r1, 0 movs r2, 0x1 bl sub_8011090 movs r1, 0 movs r0, 0x17 b @08015A02 @080159F4: movs r0, 0 strh r0, [r7] ldrh r0, [r4] subs r0, 0x1 strh r0, [r7, 0x2] movs r1, 0 movs r0, 0x18 @08015A02: strb r0, [r6, 0x14] strh r1, [r4] bl @08016878 @08015A0A: bl script_env_2_is_enabled lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08015A1A bl @08016878 @08015A1A: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08015A80 ldr r0, [r6] adds r2, r7, 0x2 adds r3, r6, 0 adds r3, 0x21 adds r1, r7, 0 bl sub_801A2A8 cmp r0, 0 beq @08015A4C movs r0, 0x5 bl audio_play bl sub_80181CC movs r0, 0x18 bl @08016876 .align 2, 0 .pool @08015A4C: bl sub_8017940 cmp r0, 0 beq @08015A80 movs r0, 0x54 movs r1, 0 movs r2, 0x1 bl sub_8011090 movs r0, 0x2 bl audio_play bl sub_80181CC ldr r0, =0x02021cc4 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy movs r0, 0x2D bl @08016876 .align 2, 0 .pool @08015A80: bl sub_8016B00 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 beq @08015AA2 cmp r0, 0x2 bgt @08015A96 cmp r0, 0x1 beq @08015A9C b @08015AD0 @08015A96: cmp r0, 0x4 beq @08015AAA b @08015AD0 @08015A9C: movs r0, 0x2 bl audio_play @08015AA2: adds r0, r6, 0 bl sub_801A274 b @08015AD0 @08015AAA: movs r0, 0xB strb r0, [r6, 0x14] bl sub_80181CC movs r0, 0 movs r1, 0 movs r2, 0 bl sub_8010FCC adds r0, r6, 0 bl sub_80181DC adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 movs r0, 0x53 movs r2, 0 bl sub_8011090 @08015AD0: adds r0, r6, 0 bl sub_801A284 bl @08016878 @08015ADA: ldr r0, =sub_809FA34 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @08015AEA bl @08016878 @08015AEA: movs r0, 0x40 movs r1, 0 movs r2, 0 bl sub_8011090 movs r0, 0x4 bl @08016876 .align 2, 0 .pool @08015B00: bl sub_801704C movs r3, 0x2 ldrsh r0, [r7, r3] ldr r1, [r6] bl sub_8017CF8 adds r4, r0, 0 movs r0, 0x54 movs r1, 0 movs r2, 0x1 bl sub_8011090 ldr r0, [r6] ldrb r1, [r7] ldrb r2, [r7, 0x2] adds r3, r4, 0 bl sub_80179D4 cmp r0, 0x1 beq @08015B44 cmp r0, 0x1 bgt @08015B36 cmp r0, 0 beq @08015B3E bl @08016878 @08015B36: cmp r0, 0x2 beq @08015B68 bl @08016878 @08015B3E: movs r0, 0x1A bl @08016876 @08015B44: movs r1, 0x2 ldrsh r0, [r7, r1] lsls r0, 5 ldr r1, [r6] adds r1, r0 adds r0, r1, 0 adds r0, 0x10 ldr r2, =0x02022c2c ldrb r2, [r2] bl sub_8012188 strh r5, [r6, 0x12] movs r0, 0x19 bl @08016876 .align 2, 0 .pool @08015B68: ldr r1, =0x02021fc4 movs r0, 0x13 bl sub_8015664 bl @08016878 .align 2, 0 .pool @08015B78: bl sub_801704C bl sub_8011A74 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x1 blt @08015BBE cmp r4, 0x2 ble @08015B9A cmp r4, 0x4 bne @08015BBE movs r0, 0x1 bl sub_801818C strb r4, [r6, 0x14] b @08015BBE @08015B9A: bl sub_8011B90 cmp r0, 0x1 bne @08015BB0 ldr r0, =gUnknown_082EE6C8 bl sub_801568C b @08015BB8 .align 2, 0 .pool @08015BB0: ldr r1, =gUnknown_082EE6C8 movs r0, 0x1E bl sub_8015664 @08015BB8: ldr r1, =0x02022c2c movs r0, 0x40 strb r0, [r1] @08015BBE: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08015BCA bl @08016878 @08015BCA: ldr r0, =0x020228c4 movs r1, 0x1 bl sub_80143E4 ldr r0, =sub_80140E0 movs r1, 0x5 bl AddTask movs r0, 0x26 bl @08016876 .align 2, 0 .pool @08015BF4: ldr r0, =sub_80140E0 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @08015C04 bl @08016878 @08015C04: ldr r0, =0x02022c2c ldrb r0, [r0] cmp r0, 0x44 bne @08015C24 ldr r1, =gUnknown_082EE004 movs r0, 0x1F bl sub_8015664 bl @08016878 .align 2, 0 .pool @08015C24: movs r0, 0x5 bl @08016876 @08015C2A: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08015C36 bl @08016878 @08015C36: movs r0, 0 bl sub_801818C movs r2, 0 ldrsh r0, [r7, r2] movs r3, 0x2 ldrsh r1, [r7, r3] ldr r2, [r6] bl sub_801A3D0 movs r0, 0x2 bl @08016876 .align 2, 0 .pool @08015C54: adds r0, r6, 0 adds r0, 0x16 adds r1, r6, 0 adds r1, 0x1B adds r2, r6, 0 adds r2, 0x1C ldr r3, =gUnknown_082F021C ldr r4, =gUnknown_082F0244 str r4, [sp] bl sub_8017178 adds r5, r0, 0 movs r0, 0x1 negs r0, r0 cmp r5, r0 bne @08015C78 bl @08016878 @08015C78: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08015C94 movs r0, 0x1C bl @08016876 .align 2, 0 .pool @08015C94: adds r1, r6, 0 adds r1, 0x98 movs r0, 0 strh r0, [r1] movs r2, 0x2 ldrsh r0, [r7, r2] ldr r1, [r6] bl sub_8017CF8 movs r0, 0x2 negs r0, r0 cmp r5, r0 beq @08015CB2 cmp r5, 0x40 bne @08015CE4 @08015CB2: adds r0, r6, 0 adds r0, 0x4C movs r1, 0x40 strh r1, [r0] bl sub_800FE50 ldr r0, =0x02021fc4 ldr r2, =gUnknown_082EEB80 ldr r1, =0x020229e8 ldrb r1, [r1, 0x13] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy movs r0, 0x20 bl @08016876 .align 2, 0 .pool @08015CE4: ldr r0, =0x02022c2c strb r5, [r0] ldr r1, =0x02022c2d lsrs r0, r5, 8 strb r0, [r1] lsls r0, r5, 24 lsrs r0, 24 cmp r0, 0x41 bne @08015D18 bl sub_8018024 cmp r0, 0 bne @08015D18 ldr r1, =gUnknown_082EEBD0 movs r0, 0x5 bl sub_8015664 bl @08016878 .align 2, 0 .pool @08015D18: ldr r0, =0x02022c2c ldrb r0, [r0] movs r1, 0x40 orrs r1, r0 adds r0, r6, 0 adds r0, 0x4C strh r1, [r0] bl sub_800FE50 movs r0, 0x1B bl @08016876 .align 2, 0 .pool @08015D34: ldr r0, =0x02021fc4 ldr r1, =gUnknown_082EEB88 bl gf_strcpy movs r0, 0x24 bl @08016876 .align 2, 0 .pool @08015D4C: adds r0, r6, 0 bl sub_8017FD8 movs r3, 0x2 ldrsh r0, [r7, r3] ldr r1, [r6] bl sub_8017CF8 adds r4, r0, 0 adds r0, r6, 0 adds r0, 0x4C ldrh r1, [r0] movs r0, 0x3F ands r0, r1 bl sub_8017984 adds r5, r0, 0 adds r0, r6, 0 adds r0, 0x16 ldr r3, =gUnknown_082EE82C lsls r1, r5, 2 lsls r2, r4, 4 adds r1, r2 adds r1, r3 ldr r1, [r1] bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08015D8C bl @08016878 @08015D8C: movs r0, 0 strh r0, [r7, 0x6] movs r0, 0x1D bl @08016876 .align 2, 0 .pool @08015D9C: bl sub_800AC34 movs r0, 0x24 bl @08016876 @08015DA6: adds r0, r6, 0 adds r0, 0x4C movs r1, 0x44 strh r1, [r0] ldr r2, =0x02022c40 ldrh r1, [r2, 0xE] adds r3, r6, 0 adds r3, 0x4E strh r1, [r3] ldrh r2, [r2, 0x10] adds r1, r6, 0 adds r1, 0x50 strh r2, [r1] bl sub_800FE50 movs r0, 0x1D bl @08016876 .align 2, 0 .pool @08015DD0: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08015DF4 ldr r0, =0x02021fc4 ldr r1, =gUnknown_082EEB88 bl gf_strcpy movs r0, 0x1C bl @08016876 .align 2, 0 .pool @08015DF4: adds r0, r6, 0 bl sub_8017FD8 adds r0, r6, 0 adds r0, 0x98 ldrh r0, [r0] cmp r0, 0x51 bne @08015E2A ldr r0, =0x02022c2c ldrb r0, [r0] cmp r0, 0x8 bne @08015E24 ldr r0, =0x02021fc4 adds r1, r6, 0 movs r2, 0 bl sub_8018220 movs r0, 0x28 bl @08016876 .align 2, 0 .pool @08015E24: movs r0, 0xD bl @08016876 @08015E2A: cmp r0, 0x52 beq @08015E32 bl @08016878 @08015E32: movs r5, 0 movs r0, 0x20 strb r0, [r6, 0x14] ldr r0, =0x02021fc4 ldr r4, =0x02022c2c ldrb r2, [r4] movs r1, 0x40 orrs r1, r2 ldr r2, =0x020229e8 ldrb r2, [r2, 0x13] bl sub_8017D9C strb r5, [r4] bl @08016878 .align 2, 0 .pool @08015E5C: movs r0, 0x2 ldrsh r1, [r7, r0] lsls r1, 5 ldr r0, [r6] adds r0, r1 bl sub_80179AC adds r5, r0, 0 movs r1, 0x2 ldrsh r0, [r7, r1] ldr r1, [r6] bl sub_8017CF8 adds r4, r0, 0 ldr r2, =gUnknown_082EE24C lsls r0, r4, 2 lsls r1, r5, 3 adds r0, r1 adds r0, r2 ldr r1, [r0] movs r0, 0x6 bl sub_8015664 bl @08016878 .align 2, 0 .pool @08015E94: adds r0, r6, 0 adds r0, 0x16 ldr r1, =0x02021fc4 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08015EA8 bl @08016878 @08015EA8: movs r4, 0 movs r0, 0x29 strb r0, [r6, 0x14] bl sub_800ADF8 adds r0, r6, 0 adds r0, 0x98 strh r4, [r0] adds r0, 0x2 strh r4, [r0] bl @08016878 .align 2, 0 .pool @08015EC4: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @08015ED2 bl @08016878 @08015ED2: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @08015F2C ldr r5, =0x02021cc4 bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r4, =0x020229f0 adds r1, r4 adds r0, r5, 0 bl gf_strcpy ldrh r0, [r4, 0x18] adds r4, 0x1C adds r1, r4, 0 bl sub_800E540 adds r5, r0, 0 ldr r0, =0x02021fc4 ldr r2, =gUnknown_082EE378 lsls r1, r5, 2 adds r1, r2 ldr r1, [r1] bl ExpandTextCodes movs r0, 0x21 bl @08016876 .align 2, 0 .pool @08015F2C: movs r0, 0x7 bl @08016876 @08015F32: adds r0, r6, 0 adds r0, 0x16 movs r1, 0 bl sub_80170B8 lsls r0, 24 asrs r5, r0, 24 cmp r5, 0 beq @08015F5C cmp r5, 0 bgt @08015F54 movs r0, 0x1 negs r0, r0 cmp r5, r0 beq @08015F98 bl @08016878 @08015F54: cmp r5, 0x1 beq @08015F98 bl @08016878 @08015F5C: movs r0, 0 bl gpu_copy_wram_bg_tilemap_to_vram ldr r4, =0x02022c2c movs r0, 0x45 strb r0, [r4] movs r0, 0x45 movs r1, 0 movs r2, 0x1 bl sub_8011090 movs r2, 0x2 ldrsh r0, [r7, r2] lsls r0, 5 ldr r1, [r6] adds r1, r0 adds r0, r1, 0 adds r0, 0x10 ldrb r2, [r4] bl sub_8012188 ldrh r0, [r7, 0x2] strh r0, [r6, 0x12] movs r0, 0x14 strb r0, [r6, 0x14] strh r5, [r7, 0x6] bl @08016878 .align 2, 0 .pool @08015F98: movs r3, 0x2 ldrsh r0, [r7, r3] ldr r1, [r6] bl sub_8017CF8 adds r4, r0, 0 ldr r1, =gUnknown_082EEC9C lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] bl sub_801568C bl @08016878 .align 2, 0 .pool @08015FB8: ldrh r0, [r7, 0x4] adds r0, 0x1 strh r0, [r7, 0x4] lsls r0, 16 asrs r0, 16 cmp r0, 0x3C bgt @08015FCA bl @08016878 @08015FCA: movs r1, 0 movs r0, 0x15 strb r0, [r6, 0x14] strh r1, [r7, 0x4] bl @08016878 @08015FD6: bl sub_8011A74 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 beq @0801603C cmp r4, 0x3 ble @08015FF4 cmp r4, 0x4 bne @08016040 movs r0, 0x1 bl sub_801818C strb r4, [r6, 0x14] b @08016040 @08015FF4: cmp r4, 0x1 blt @08016040 movs r1, 0x2 ldrsh r0, [r7, r1] ldr r1, [r6] bl sub_8017CF8 adds r4, r0, 0 movs r0, 0x54 movs r1, 0 movs r2, 0x1 bl sub_8011090 bl sub_8011B90 cmp r0, 0x1 bne @08016028 ldr r0, =gUnknown_082EED3C lsls r1, r4, 2 adds r1, r0 ldr r0, [r1] bl sub_801568C b @08016040 .align 2, 0 .pool @08016028: ldr r0, =gUnknown_082EED3C lsls r1, r4, 2 adds r1, r0 ldr r1, [r1] movs r0, 0x1E bl sub_8015664 b @08016040 .align 2, 0 .pool @0801603C: movs r0, 0x16 strb r0, [r6, 0x14] @08016040: ldrh r0, [r7, 0x6] adds r0, 0x1 strh r0, [r7, 0x6] bl @08016878 @0801604A: bl sub_8011A80 cmp r0, 0 beq @08016092 movs r2, 0x2 ldrsh r0, [r7, r2] ldr r1, [r6] bl sub_8017CF8 adds r4, r0, 0 movs r0, 0x54 movs r1, 0 movs r2, 0x1 bl sub_8011090 bl sub_8011B90 cmp r0, 0x1 bne @08016084 ldr r0, =gUnknown_082EED3C lsls r1, r4, 2 adds r1, r0 ldr r0, [r1] bl sub_801568C b @08016092 .align 2, 0 .pool @08016084: ldr r0, =gUnknown_082EED3C lsls r1, r4, 2 adds r1, r0 ldr r1, [r1] movs r0, 0x1E bl sub_8015664 @08016092: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0801609E bl @08016878 @0801609E: movs r0, 0x10 bl @08016876 .align 2, 0 .pool @080160AC: movs r0, 0x49 bl audio_play bl sub_800EF7C movs r0, 0 movs r1, 0xC strb r1, [r6, 0x14] adds r1, r6, 0 adds r1, 0x9A strh r0, [r1] bl @08016878 @080160C6: bl sub_8011A80 cmp r0, 0 beq @080160DA movs r0, 0 bl sub_801818C movs r0, 0x2 bl @08016876 @080160DA: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080160E4 b @08016878 @080160E4: ldr r0, =0x020228c4 movs r1, 0x1 bl sub_80143E4 ldr r0, =sub_80140E0 movs r1, 0x5 bl AddTask movs r0, 0x27 b @08016876 .align 2, 0 .pool @08016104: adds r0, r6, 0 bl sub_801689C ldr r0, =sub_80140E0 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @08016118 b @08016878 @08016118: movs r0, 0x21 strb r0, [r6, 0x14] ldr r0, =0x02021cc4 ldr r4, =0x02022a0c adds r1, r4, 0 bl 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, =0x02021fc4 ldr r2, =gUnknown_082EE324 lsls r1, r5, 2 adds r1, r2 ldr r1, [r1] bl ExpandTextCodes b @08016878 .align 2, 0 .pool @08016158: adds r0, r6, 0 bl sub_801689C adds r0, r6, 0 adds r0, 0x16 ldr r1, =0x02021fc4 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08016170 b @08016878 @08016170: movs r0, 0x22 b @08016876 .align 2, 0 .pool @08016178: adds r0, r6, 0 bl sub_801689C adds r0, r6, 0 bl sub_80168DC cmp r0, 0 bne @0801618A b @08016878 @0801618A: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08016198 b @08016878 @08016198: movs r0, 0x1 bl sub_8011DE0 ldr r0, =0x02021fc4 ldr r1, =gUnknown_082EE598 bl gf_strcpy movs r0, 0x24 b @08016876 .align 2, 0 .pool @080161B8: ldr r1, =0x02021fc4 movs r0, 0x9 bl sub_8015664 b @08016878 .align 2, 0 .pool @080161C8: adds r0, r6, 0 adds r0, 0x16 movs r1, 0 bl sub_80170B8 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @080161EE cmp r1, 0 bgt @080161E8 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @080162AE b @08016878 @080161E8: cmp r1, 0x1 beq @080162AE b @08016878 @080161EE: adds r0, r6, 0 adds r0, 0x4C movs r1, 0x51 strh r1, [r0] ldr r1, =0x02022c2c ldrb r1, [r1] adds r5, r0, 0 cmp r1, 0x45 bne @08016220 movs r4, 0x40 orrs r4, r1 movs r0, 0x1 bl sub_801100C adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 movs r2, 0 bl sub_8011090 b @0801623E .align 2, 0 .pool @08016220: movs r0, 0x40 adds r4, r1, 0 orrs r4, r0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 bl sub_801100C adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 movs r2, 0x1 bl sub_8011090 @0801623E: ldr r1, [r6, 0x8] movs r0, 0 strb r0, [r1, 0x1B] strh r0, [r7, 0x6] ldr r0, =0x02022c2c ldrb r0, [r0] cmp r0, 0x41 bne @08016286 bl sub_8018024 cmp r0, 0 bne @0801627C movs r0, 0x52 strh r0, [r5] adds r0, r5, 0 bl sub_800FE50 movs r0, 0xA strb r0, [r6, 0x14] ldr r0, =0x02021fc4 ldr r1, =gUnknown_082EEC14 bl gf_strcpy b @08016878 .align 2, 0 .pool @0801627C: adds r0, r5, 0 bl sub_800FE50 movs r0, 0xD b @08016876 @08016286: cmp r0, 0x48 bne @080162A4 adds r0, r5, 0 bl sub_800FE50 ldr r0, =0x02021fc4 adds r1, r6, 0 movs r2, 0x1 bl sub_8018220 movs r0, 0x28 b @08016876 .align 2, 0 .pool @080162A4: adds r0, r5, 0 bl sub_800FE50 movs r0, 0xD b @08016876 @080162AE: adds r0, r6, 0 adds r0, 0x4C movs r1, 0x52 strh r1, [r0] bl sub_800FE50 movs r0, 0xA strb r0, [r6, 0x14] ldr r0, =0x02021fc4 ldr r1, =0x02022c2c ldrb r1, [r1] bl sub_8013078 b @08016878 .align 2, 0 .pool @080162D4: bl sub_800AC34 movs r0, 0x24 b @08016876 @080162DC: ldr r0, =0x03003124 ldrb r4, [r0] cmp r4, 0 beq @080162E6 b @08016878 @080162E6: ldr r1, =0x02022c2c movs r0, 0x40 strb r0, [r1] ldr r1, =0x02021fc4 movs r0, 0x25 bl sub_8015664 adds r0, r6, 0 adds r0, 0x4C movs r1, 0 movs r2, 0xC bl memset adds r0, r6, 0 adds r0, 0x9A strh r4, [r0] subs r0, 0x2 strh r4, [r0] b @08016878 .align 2, 0 .pool @08016318: movs r0, 0x2 strb r0, [r6, 0x14] movs r0, 0 bl sub_801818C b @08016878 @08016324: ldr r4, =0x02021fc4 ldr r0, =0x02022c2c ldrb r0, [r0] movs r1, 0x40 orrs r1, r0 adds r0, r4, 0 bl sub_8017E00 movs r0, 0xE adds r1, r4, 0 bl sub_8015664 b @08016878 .align 2, 0 .pool @08016348: bl sub_800ADF8 movs r0, 0xF b @08016876 @08016350: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @0801635C b @08016878 @0801635C: movs r0, 0x10 b @08016876 @08016360: ldr r0, [r6, 0x8] bl free ldr r0, [r6] bl free ldr r0, [r6, 0xC] bl free ldr r0, [r6, 0x4] bl free adds r0, r6, 0 adds r0, 0x20 ldrb r0, [r0] bl remove_task adds r0, r6, 0 adds r0, 0x21 bl sub_8019F04 movs r0, 0x11 b @08016876 @0801638E: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl 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, =0x02022c30 ldr r0, [r0] bl free bl sub_80149D8 b @08016878 .align 2, 0 .pool @080163CC: bl sub_800F7DC ldrh r1, [r0, 0x8] ldr r4, =0x000003ff adds r0, r4, 0 ands r0, r1 cmp r0, 0 bne @080163E4 movs r0, 0x2B b @08016876 .align 2, 0 .pool @080163E4: bl sub_800F7DC ldrh r1, [r0, 0x8] adds r0, r4, 0 ands r0, r1 movs r1, 0xCE lsls r1, 1 cmp r0, r1 bne @08016408 ldr r0, =0x02021fc4 ldr r1, =gUnknown_082EF590 bl gf_strcpy b @0801643E .align 2, 0 .pool @08016408: ldr r4, =0x02021cc4 bl sub_800F7DC ldrh r0, [r0, 0x8] lsls r0, 22 lsrs r0, 22 movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 bl gf_strcpy ldr r4, =0x02021dc4 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, =0x02021fc4 ldr r1, =gUnknown_082EF564 bl ExpandTextCodes @0801643E: ldr r1, =0x02021fc4 movs r0, 0x2C bl sub_8015664 b @08016878 .align 2, 0 .pool @0801645C: adds r0, r6, 0 adds r0, 0x16 ldr r1, =gUnknown_082EF20C bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @0801646E b @08016878 @0801646E: movs r0, 0x2F b @08016876 .align 2, 0 .pool @08016478: adds r0, r6, 0 adds r0, 0x16 adds r1, r6, 0 adds r1, 0x1D adds r2, r6, 0 adds r2, 0x1E ldr r3, =gUnknown_082F025C ldr r4, =gUnknown_082F027C str r4, [sp] bl sub_8017178 adds r5, r0, 0 movs r0, 0x1 negs r0, r0 cmp r5, r0 bne @0801649A b @08016878 @0801649A: subs r0, 0x1 cmp r5, r0 beq @080164A4 cmp r5, 0x3 bne @080164B8 @080164A4: movs r0, 0x4 strb r0, [r6, 0x14] movs r0, 0x1 bl sub_801818C b @08016878 .align 2, 0 .pool @080164B8: cmp r5, 0x1 beq @080164C2 cmp r5, 0x2 beq @080164D0 b @08016878 @080164C2: ldr r1, =gUnknown_082EF4C4 movs r0, 0x35 bl sub_8015664 b @08016878 .align 2, 0 .pool @080164D0: ldr r1, =gUnknown_082EF298 movs r0, 0x2F bl sub_8015664 b @08016878 .align 2, 0 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08016502 b @08016878 @08016502: ldr r1, =0x02022c40 movs r0, 0x1 strh r0, [r1] ldr r1, =0x03005dac ldr r0, =sub_80AF128 str r0, [r1] ldr r1, =c2_exit_to_overworld_2_switch movs r0, 0x8 bl sub_81B8904 b @08016878 .align 2, 0 .pool @0801652C: adds r0, r6, 0 adds r0, 0x16 adds r1, r6, 0 adds r1, 0x1D adds r2, r6, 0 adds r2, 0x1E ldr r3, =gUnknown_082F0294 ldr r4, =gUnknown_082F032C str r4, [sp] bl sub_8017178 adds r5, r0, 0 movs r0, 0x1 negs r0, r0 cmp r5, r0 bne @0801654E b @08016878 @0801654E: subs r0, 0x1 cmp r5, r0 beq @08016558 cmp r5, 0x12 bne @08016580 @08016558: ldr r0, =0x02022c40 bl sub_801807C movs r0, 0 movs r1, 0 movs r2, 0 bl sub_8010FCC ldr r0, =gUnknown_082EF4FC bl sub_801568C b @08016878 .align 2, 0 .pool @08016580: ldr r0, =0x02022c40 strh r5, [r0, 0x2] movs r0, 0x37 b @08016876 .align 2, 0 .pool @0801658C: ldr r2, =0x02022c40 ldrh r0, [r2, 0x2] ldrh r1, [r2, 0xA] ldrh r2, [r2, 0xC] bl sub_8010FCC ldr r0, =gUnknown_082EF520 bl sub_801568C b @08016878 .align 2, 0 .pool @080165A8: adds r0, r6, 0 adds r0, 0x16 movs r1, 0 bl sub_80170B8 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @080165CE cmp r1, 0 bgt @080165C8 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @080165D2 b @08016878 @080165C8: cmp r1, 0x1 beq @080165D2 b @08016878 @080165CE: movs r0, 0x38 b @08016876 @080165D2: movs r0, 0x1 bl sub_801818C movs r0, 0x4 b @08016876 @080165DC: adds r0, r6, 0 adds r0, 0x16 ldr r1, =gUnknown_082EF5B8 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @080165EE b @08016878 @080165EE: movs r0, 0 movs r1, 0 movs r2, 0 bl sub_8010FCC ldr r0, =0x02022c40 bl sub_801807C movs r0, 0x1 bl sub_801818C movs r0, 0x4 b @08016876 .align 2, 0 .pool @08016610: adds r0, r6, 0 adds r0, 0x16 ldr r1, =gUnknown_082EF1EC bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @08016622 b @08016878 @08016622: movs r0, 0x2E b @08016876 .align 2, 0 .pool @0801662C: bl sub_80173B0 movs r0, 0x30 b @08016876 @08016634: adds r0, r6, 0 adds r0, 0x16 adds r1, r6, 0 adds r1, 0x1D adds r2, r6, 0 adds r2, 0x4A adds r3, r6, 0 adds r3, 0x1E ldr r4, =gUnknown_082F034C str r4, [sp] ldr r4, =gUnknown_082F03A4 str r4, [sp, 0x4] ldr r4, [r6] str r4, [sp, 0x8] bl sub_80172A0 adds r5, r0, 0 movs r0, 0x1 negs r0, r0 cmp r5, r0 bne @08016660 b @08016878 @08016660: subs r0, 0x1 cmp r5, r0 beq @0801666A cmp r5, 0x8 bne @0801667C @0801666A: movs r0, 0x1 bl sub_801818C movs r0, 0x4 b @08016876 .align 2, 0 .pool @0801667C: bl sub_80173B0 ldr r1, [r6] lsls r4, r5, 5 adds r1, r4 ldrb r0, [r1, 0x9] lsrs r0, 2 ldrh r1, [r1, 0x8] lsls r1, 22 lsrs r1, 22 bl sub_8017D04 cmp r0, 0x1 beq @080166C8 cmp r0, 0x1 bgt @080166A2 cmp r0, 0 beq @080166A8 b @08016878 @080166A2: cmp r0, 0x2 beq @080166FC b @08016878 @080166A8: ldr r0, =0x02021cc4 ldr r1, [r6] adds r1, r4 bl sub_8018404 ldr r1, =gUnknown_082EF65C movs r0, 0x31 bl sub_8015664 strh r5, [r7, 0x2] b @08016878 .align 2, 0 .pool @080166C8: ldr r0, =0x02021cc4 ldr r1, [r6] adds r1, r4 bl sub_8018404 ldr r0, =0x02021dc4 ldr r1, [r6] adds r1, r4 ldrb r2, [r1, 0x9] lsrs r2, 2 lsls r1, r2, 3 subs r1, r2 ldr r2, =gTypeNames adds r1, r2 bl gf_strcpy ldr r1, =gUnknown_082EF6E4 b @0801671E .align 2, 0 .pool @080166FC: ldr r0, =0x02021cc4 ldr r1, [r6] adds r1, r4 bl sub_8018404 ldr r0, =0x02021dc4 ldr r1, [r6] adds r1, r4 ldrb r2, [r1, 0x9] lsrs r2, 2 lsls r1, r2, 3 subs r1, r2 ldr r2, =gTypeNames adds r1, r2 bl gf_strcpy ldr r1, =gUnknown_082EF718 @0801671E: movs r0, 0x2E bl sub_8015664 b @08016878 .align 2, 0 .pool @08016738: adds r0, r6, 0 adds r0, 0x16 movs r1, 0 bl sub_80170B8 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @0801675E cmp r1, 0 bgt @08016758 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08016762 b @08016878 @08016758: cmp r1, 0x1 beq @08016762 b @08016878 @0801675E: movs r0, 0x32 b @08016876 @08016762: movs r0, 0x1 bl sub_801818C movs r0, 0x4 b @08016876 @0801676C: adds r0, r6, 0 adds r0, 0x16 ldr r1, =gUnknown_082EF4C4 bl sub_8017064 lsls r0, 24 cmp r0, 0 bne @0801677E b @08016878 @0801677E: ldr r4, =0x02022c40 movs r0, 0x2 strh r0, [r4] ldr r2, =0x02022c38 movs r3, 0x2 ldrsh r0, [r7, r3] ldr r1, [r6] lsls r0, 5 adds r0, r1 ldr r0, [r0] str r0, [r2] ldr r2, =0x02022c3e ldr r1, [r6] movs r3, 0x2 ldrsh r0, [r7, r3] lsls r0, 5 adds r1, r0 ldrb r0, [r1, 0x9] lsrs r0, 2 strb r0, [r2] ldr r2, =0x02022c3c ldr r1, [r6] movs r3, 0x2 ldrsh r0, [r7, r3] lsls r0, 5 adds r1, r0 ldrh r0, [r1, 0x8] lsls r0, 22 lsrs r0, 22 strh r0, [r2] ldr r1, =0x03005dac ldr r0, =sub_80AF128 str r0, [r1] ldr r1, =c2_exit_to_overworld_2_switch movs r0, 0x9 bl sub_81B8904 adds r0, r6, 0 bl sub_80156B0 ldrh r0, [r7, 0x2] strb r0, [r4, 0x8] b @08016878 .align 2, 0 .pool @080167F4: ldr r1, =0x02022c2c movs r0, 0x44 strb r0, [r1] movs r1, 0x2 ldrsh r0, [r7, r1] lsls r0, 5 ldr r1, [r6] adds r1, r0 adds r0, r1, 0 adds r0, 0x10 movs r2, 0x44 bl sub_8012188 ldr r0, =0x02021cc4 movs r3, 0x2 ldrsh r2, [r7, r3] lsls r2, 5 ldr r1, [r6] adds r1, r2 bl sub_8018404 ldr r0, =gUnknown_082EE17C ldr r0, [r0, 0x8] bl sub_8017020 movs r0, 0x19 b @08016876 .align 2, 0 .pool @08016838: adds r0, r6, 0 adds r0, 0x16 ldr r1, =0x02021fc4 bl sub_8017064 lsls r0, 24 cmp r0, 0 beq @08016878 movs r0, 0x1 bl sub_801818C movs r1, 0 ldrsh r0, [r7, r1] movs r2, 0x2 ldrsh r1, [r7, r2] ldr r2, [r6] bl sub_801A3D0 movs r0, 0x4 b @08016876 .align 2, 0 .pool @08016864: adds r0, r6, 0 adds r0, 0x16 ldr r1, =0x02021fc4 bl sub_8017064 lsls r0, 24 cmp r0, 0 beq @08016878 ldrb r0, [r6, 0x15] @08016876: strb r0, [r6, 0x14] @08016878: add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375f0 movs r0, 0xB strh r0, [r1] @08016894: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end var_800D_set_xB thumb_func_start sub_801689C sub_801689C: ; 801689C push {r4,r5,lr} adds r2, r0, 0 ldr r3, =0x03003090 ldrh r5, [r3, 0x12] adds r4, r5, 0 cmp r4, 0 beq @080168D0 ldrh r0, [r3, 0x10] movs r1, 0xFF lsls r1, 8 ands r1, r0 movs r0, 0xBC lsls r0, 6 cmp r1, r0 bne @080168D0 adds r0, r2, 0 adds r0, 0x9A strh r5, [r0] cmp r4, 0x44 bne @080168D0 ldrh r1, [r3, 0x14] adds r0, 0x2 strh r1, [r0] ldrh r1, [r3, 0x16] adds r0, 0x2 strh r1, [r0] @080168D0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801689C thumb_func_start sub_80168DC sub_80168DC: ; 80168DC push {r4,r5,lr} adds r4, r0, 0 adds r5, r4, 0 adds r5, 0x9A ldrh r0, [r5] cmp r0, 0 beq @0801692C ldr r0, =0x02021fc4 ldr r1, =0x020229e8 adds r1, 0x2F ldrb r1, [r1] adds r2, r5, 0 adds r3, r4, 0 bl sub_8017EA0 cmp r0, 0 beq @0801692C cmp r0, 0x1 bne @0801691C movs r0, 0x23 strb r0, [r4, 0x14] ldr r1, =0x02022c2c ldrh r0, [r5] strb r0, [r1] movs r0, 0 b @0801692E .align 2, 0 .pool @0801691C: cmp r0, 0x2 bne @0801692C movs r0, 0x24 strb r0, [r4, 0x14] bl sub_800AC34 movs r0, 0 b @0801692E @0801692C: movs r0, 0x1 @0801692E: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80168DC thumb_func_start sub_8016934 sub_8016934: ; 8016934 push {r4,r5,lr} ldr r5, =0x02022c20 movs r0, 0xFF strb r0, [r5] ldr r0, =task00_081199FC movs r1, 0 bl AddTask ldr r4, =0x02022c30 movs r0, 0x9B lsls r0, 2 bl malloc_and_clear str r0, [r4] ldr r1, =0x03000da8 str r0, [r1] movs r1, 0 strb r1, [r0, 0x14] strb r1, [r0, 0x16] strh r1, [r0, 0x10] strh r1, [r0, 0x12] movs r0, 0x1 negs r0, r0 strb r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8016934 thumb_func_start task00_081199FC task00_081199FC: ; 801697C push {r4-r6,lr} sub sp, 0x20 lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02022c30 ldr r5, [r0] ldrb r0, [r5, 0x14] cmp r0, 0x4 bls @08016990 b @08016AC8 @08016990: lsls r0, 2 ldr r1, =@080169A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080169A4: .4byte @080169B8 .4byte @080169BE .4byte @080169E0 .4byte @08016A30 .4byte @08016A94 @080169B8: movs r0, 0x1 strb r0, [r5, 0x14] b @08016AC8 @080169BE: movs r0, 0xC movs r1, 0 movs r2, 0 bl sub_8010F84 bl sub_800B488 bl sub_8009734 bl sub_8011C84 movs r0, 0x1 bl sub_80111B0 movs r0, 0x2 strb r0, [r5, 0x14] b @08016AC8 @080169E0: movs r0, 0x70 bl 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, =0x02022c20 ldrb r0, [r0] cmp r0, 0xFF bne @08016AC8 movs r6, 0 @08016A4A: ldr r0, [r5] lsls r4, r6, 5 adds r1, r0, r4 ldrb r0, [r1, 0x1A] lsls r0, 30 lsrs r0, 30 cmp r0, 0x1 bne @08016A78 mov r0, sp bl sub_8018404 ldr r0, [r5] adds r0, r4 adds r0, 0x2 bl sub_8015658 lsls r0, 16 lsrs r0, 16 mov r1, sp bl sub_800E540 cmp r0, 0 bne @08016A84 @08016A78: adds r6, 0x1 cmp r6, 0x7 ble @08016A4A b @08016AC8 .align 2, 0 .pool @08016A84: ldr r0, =0x02022c20 mov r1, sp bl gf_strcpy b @08016AC8 .align 2, 0 .pool @08016A94: ldr r0, [r5, 0x8] bl free ldr r0, [r5] bl free ldr r0, [r5, 0xC] bl free ldr r0, [r5, 0x4] bl free adds r0, r5, 0 adds r0, 0x20 ldrb r0, [r0] bl remove_task ldr r0, =0x02022c30 ldr r0, [r0] bl free bl sub_800EDD4 adds r0, r4, 0 bl remove_task @08016AC8: add sp, 0x20 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task00_081199FC thumb_func_start sp182_move_string sp182_move_string: ; 8016AD4 push {r4,lr} ldr r4, =0x02022c20 ldrb r0, [r4] cmp r0, 0xFF bne @08016AE8 movs r0, 0 b @08016AF6 .align 2, 0 .pool @08016AE8: ldr r0, =0x02021cc4 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 .pool thumb_func_end sp182_move_string thumb_func_start sub_8016B00 sub_8016B00: ; 8016B00 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x02022c30 ldr r4, [r0] movs r7, 0 movs r6, 0 movs r5, 0 @08016B12: ldr r0, [r4, 0xC] adds r0, r5 ldr r1, =gUnknown_082F045C bl sub_8017630 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x1 bne @08016B5C ldr r1, [r4, 0xC] ldr r0, [r4, 0x8] adds r1, r5 ldm r1!, {r2,r5,r6} stm r0!, {r2,r5,r6} ldm r1!, {r2,r5,r6} stm r0!, {r2,r5,r6} ldr r1, [r4, 0x8] movs r0, 0 strh r0, [r1, 0x18] ldr r2, [r4, 0x8] ldrb r1, [r2, 0x1A] movs r5, 0x4 negs r5, r5 adds r0, r5, 0 ands r1, r0 movs r0, 0x1 orrs r1, r0 strb r1, [r2, 0x1A] ldr r0, [r4, 0x8] strb r3, [r0, 0x1B] movs r0, 0x4 b @08016C90 .align 2, 0 .pool @08016B5C: adds r5, 0x1C adds r6, 0x1 cmp r6, 0x3 ble @08016B12 movs r6, 0 mov r9, r6 @08016B68: ldr r0, [r4] mov r1, r9 lsls r5, r1, 5 adds r2, r0, r5 ldrb r0, [r2, 0x1A] lsls r0, 30 mov r8, r5 cmp r0, 0 beq @08016C5C ldr r1, [r4, 0x4] adds r0, r2, 0 bl sub_80176E4 adds r6, r0, 0 cmp r6, 0xFF beq @08016C02 ldr r0, [r4] adds r2, r0, r5 ldrb r1, [r2, 0x1A] lsls r0, r1, 30 lsrs r0, 30 cmp r0, 0x1 bne @08016BE0 lsls r0, r6, 3 subs r0, r6 lsls r6, r0, 2 ldr r1, [r4, 0x4] adds r1, r6 adds r0, r2, 0 bl sub_8017678 cmp r0, 0 beq @08016BC6 ldr r1, [r4] ldr r0, [r4, 0x4] adds r1, r5 adds r0, r6 ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} ldr r0, [r4] adds r0, r5 movs r1, 0x40 strb r1, [r0, 0x1B] movs r7, 0x1 b @08016BF8 @08016BC6: ldr r0, [r4] adds r1, r0, r5 ldrb r0, [r1, 0x1B] cmp r0, 0 beq @08016BF8 subs r0, 0x1 strb r0, [r1, 0x1B] ldr r0, [r4] adds r0, r5 ldrb r0, [r0, 0x1B] cmp r0, 0 bne @08016BF8 b @08016BF6 @08016BE0: movs r3, 0x4 negs r3, r3 adds r0, r3, 0 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x1A] ldr r0, [r4] adds r0, r5 movs r1, 0 strb r1, [r0, 0x1B] @08016BF6: movs r7, 0x2 @08016BF8: ldr r0, [r4] add r0, r8 movs r1, 0 strh r1, [r0, 0x18] b @08016C5C @08016C02: ldr r0, [r4] adds r1, r0, r5 ldrb r0, [r1, 0x1A] lsls r2, r0, 30 lsrs r0, r2, 30 cmp r0, 0x2 beq @08016C3C ldrh r0, [r1, 0x18] adds r0, 0x1 strh r0, [r1, 0x18] ldr r0, [r4] adds r2, r0, r5 ldrh r1, [r2, 0x18] ldr r0, =0x00000257 cmp r1, r0 bls @08016C5C ldrb r0, [r2, 0x1A] movs r5, 0x4 negs r5, r5 adds r1, r5, 0 ands r0, r1 movs r1, 0x2 orrs r0, r1 strb r0, [r2, 0x1A] movs r7, 0x2 b @08016C5C .align 2, 0 .pool @08016C3C: lsrs r0, r2, 30 cmp r0, 0x2 bne @08016C5C ldrh r0, [r1, 0x18] adds r0, 0x1 strh r0, [r1, 0x18] ldr r0, [r4] adds r2, r0, r5 ldrh r1, [r2, 0x18] ldr r0, =0x00000383 cmp r1, r0 bls @08016C5C adds r0, r2, 0 movs r1, 0x1 bl sub_8017580 @08016C5C: mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 cmp r0, 0x7 bhi @08016C6C b @08016B68 @08016C6C: movs r5, 0 movs r6, 0x3 @08016C70: ldr r0, [r4] ldr r1, [r4, 0x4] adds r1, r5 movs r2, 0x8 bl sub_8017734 lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @08016C86 movs r7, 0x1 @08016C86: adds r5, 0x1C subs r6, 0x1 cmp r6, 0 bge @08016C70 adds r0, r7, 0 @08016C90: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8016B00 thumb_func_start sub_8016CA0 sub_8016CA0: ; 8016CA0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x20 lsls r0, 24 lsrs r0, 24 mov r10, r0 lsls r0, 2 add r0, r10 lsls r0, 3 ldr r1, =0x03005e08 adds r6, r0, r1 movs r7, 0 mov r0, sp adds r0, 0x10 str r0, [sp, 0x18] @08016CC4: lsls r2, r7, 24 lsrs r2, 24 mov r0, sp ldr r1, [sp, 0x18] bl sub_800DE7C lsls r0, 24 lsrs r4, r0, 24 mov r0, sp ldrb r0, [r0, 0xA] lsls r0, 25 lsrs r0, 25 mov r2, r10 lsls r1, r2, 2 add r1, r10 lsls r1, 3 ldr r3, =0x03005e00 adds r1, r3 movs r5, 0x10 ldrsh r1, [r1, r5] bl sub_8013D88 cmp r0, 0 bne @08016D00 mov r1, sp ldr r0, =gUnknown_082F045C ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} @08016D00: mov r0, sp ldrb r1, [r0] movs r0, 0xF ands r0, r1 cmp r0, 0x1 bne @08016D18 mov r1, sp ldr r0, =gUnknown_082F045C ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} @08016D18: cmp r4, 0 bne @08016D9C lsls r0, r7, 3 mov r8, r0 adds r1, r7, 0x1 mov r9, r1 cmp r7, 0 ble @08016D58 movs r2, 0 str r2, [sp, 0x1C] adds r4, r7, 0 @08016D2E: ldr r0, [r6, 0x4] ldr r3, [sp, 0x1C] adds r0, r3 mov r1, sp bl sub_8017630 lsls r0, 24 cmp r0, 0 bne @08016D4C mov r1, sp ldr r0, =gUnknown_082F045C ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} @08016D4C: ldr r5, [sp, 0x1C] adds r5, 0x1C str r5, [sp, 0x1C] subs r4, 0x1 cmp r4, 0 bne @08016D2E @08016D58: ldr r1, [r6, 0x4] mov r0, r8 subs r4, r0, r7 lsls r4, 2 adds r1, r4 mov r0, sp ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldr r0, [r6, 0x4] adds r0, r4 ldr r1, =gUnknown_082F045C bl sub_8017630 ldr r3, [r6, 0x4] adds r3, r4 movs r2, 0x1 ands r2, r0 ldrb r0, [r3, 0x18] movs r4, 0x2 negs r4, r4 adds r1, r4, 0 ands r0, r1 orrs r0, r2 strb r0, [r3, 0x18] b @08016DD4 .align 2, 0 .pool @08016D9C: ldr r1, [r6] lsls r4, r7, 3 subs r4, r7 lsls r4, 2 adds r1, r4 mov r0, sp ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldr r0, [r6] adds r0, r4 ldr r1, =gUnknown_082F045C bl sub_8017630 ldr r3, [r6] adds r3, r4 movs r2, 0x1 ands r2, r0 ldrb r0, [r3, 0x18] movs r4, 0x2 negs r4, r4 adds r1, r4, 0 ands r0, r1 orrs r0, r2 strb r0, [r3, 0x18] adds r7, 0x1 mov r9, r7 @08016DD4: mov r7, r9 cmp r7, 0x3 bgt @08016DDC b @08016CC4 @08016DDC: add sp, 0x20 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8016CA0 thumb_func_start sub_8016DF0 sub_8016DF0: ; 8016DF0 push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 ldr r0, =sub_8016CA0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r2, =0x03005e08 adds r3, r1, r2 str r4, [r3] str r5, [r3, 0x4] adds r2, r1 strh r6, [r2, 0x8] pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8016DF0 thumb_func_start sub_8016E24 sub_8016E24: ; 8016E24 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC lsls r0, 24 lsrs r0, 24 mov r10, r0 lsls r0, 2 add r0, r10 lsls r0, 3 ldr r1, =0x03005e08 adds r6, r0, r1 movs r3, 0 @08016E42: lsls r4, r3, 3 subs r0, r4, r3 lsls r5, r0, 2 ldr r0, [r6] adds r0, r5 adds r1, r0, 0 adds r1, 0x10 lsls r2, r3, 24 lsrs r2, 24 str r3, [sp] bl sub_800DE7C ldr r0, [r6] adds r0, r5 ldrb r0, [r0, 0xA] lsls r0, 25 lsrs r0, 25 mov r2, r10 lsls r1, r2, 2 add r1, r10 lsls r1, 3 ldr r7, =0x03005e00 adds r1, r7 movs r2, 0xC ldrsh r1, [r1, r2] bl sub_8013D88 mov r8, r4 ldr r3, [sp] cmp r0, 0 bne @08016E8E ldr r1, [r6] adds r1, r5 ldr r0, =gUnknown_082F045C ldm r0!, {r2,r4,r7} stm r1!, {r2,r4,r7} ldm r0!, {r2,r4,r7} stm r1!, {r2,r4,r7} @08016E8E: adds r4, r3, 0x1 mov r9, r4 cmp r3, 0 ble @08016ED2 str r5, [sp, 0x4] movs r5, 0 str r5, [sp, 0x8] adds r4, r3, 0 @08016E9E: ldr r1, [r6] ldr r7, [sp, 0x8] adds r0, r1, r7 ldr r2, [sp, 0x4] adds r1, r2 str r3, [sp] bl sub_8017630 lsls r0, 24 ldr r3, [sp] cmp r0, 0 bne @08016EC6 ldr r1, [r6] ldr r5, [sp, 0x4] adds r1, r5 ldr r0, =gUnknown_082F045C ldm r0!, {r2,r5,r7} stm r1!, {r2,r5,r7} ldm r0!, {r2,r5,r7} stm r1!, {r2,r5,r7} @08016EC6: ldr r7, [sp, 0x8] adds r7, 0x1C str r7, [sp, 0x8] subs r4, 0x1 cmp r4, 0 bne @08016E9E @08016ED2: mov r0, r8 subs r4, r0, r3 lsls r4, 2 ldr r0, [r6] adds r0, r4 ldr r1, =gUnknown_082F045C bl sub_8017630 ldr r3, [r6] adds r3, r4 movs r2, 0x1 ands r2, r0 ldrb r0, [r3, 0x18] movs r4, 0x2 negs r4, r4 adds r1, r4, 0 ands r0, r1 orrs r0, r2 strb r0, [r3, 0x18] mov r3, r9 cmp r3, 0x3 ble @08016E42 add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8016E24 thumb_func_start sub_8016F1C sub_8016F1C: ; 8016F1C push {lr} lsls r1, 16 asrs r1, 16 cmp r1, 0x7 bne @08016F2C ldrb r1, [r0] movs r0, 0x20 b @08016F34 @08016F2C: cmp r1, 0x8 bne @08016F3E ldrb r1, [r0] movs r0, 0x10 @08016F34: ands r0, r1 cmp r0, 0 beq @08016F3E movs r0, 0x1 b @08016F40 @08016F3E: movs r0, 0 @08016F40: pop {r1} bx r1 thumb_func_end sub_8016F1C thumb_func_start sub_8016F44 sub_8016F44: ; 8016F44 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r4, r1, r0 movs r6, 0 subs r0, 0x8 movs r5, 0 adds r1, r0 mov r8, r1 @08016F62: ldr r0, [r4] adds r0, r5 adds r1, r0, 0 adds r1, 0x10 lsls r2, r6, 24 lsrs r2, 24 bl sub_800DF34 lsls r0, 24 cmp r0, 0 beq @08016F86 ldr r0, [r4] adds r0, r5 mov r2, r8 movs r3, 0xC ldrsh r1, [r2, r3] bl sub_8016F1C @08016F86: ldr r0, [r4] adds r0, r5 ldr r1, =gUnknown_082F045C bl sub_8017630 ldr r3, [r4] adds r3, r5 movs r2, 0x1 ands r2, r0 ldrb r0, [r3, 0x18] movs r7, 0x2 negs r7, r7 adds r1, r7, 0 ands r0, r1 orrs r0, r2 strb r0, [r3, 0x18] adds r5, 0x1C adds r6, 0x1 cmp r6, 0x3 ble @08016F62 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8016F44 thumb_func_start sub_8016FC0 sub_8016FC0: ; 8016FC0 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldr r0, =sub_8016E24 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 ldr r1, =0x03005e08 adds r3, r2, r1 str r4, [r3] adds r1, r2 strh r5, [r1, 0x4] pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8016FC0 thumb_func_start sub_8016FF0 sub_8016FF0: ; 8016FF0 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldr r0, =sub_8016F44 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 ldr r1, =0x03005e08 adds r3, r2, r1 str r4, [r3] adds r1, r2 strh r5, [r1, 0x4] pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8016FF0 thumb_func_start sub_8017020 sub_8017020: ; 8017020 push {r4,lr} adds r4, r0, 0 bl sub_81973A4 movs r0, 0 movs r1, 0x1 bl sub_81973C4 ldr r0, =0x02021fc4 adds r1, r4, 0 bl ExpandTextCodes movs r0, 0 movs r1, 0x1 bl sub_819735C movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8017020 thumb_func_start sub_801704C sub_801704C: ; 801704C push {lr} bl sub_8197224 lsls r0, 16 cmp r0, 0 beq @0801705C movs r0, 0 b @0801705E @0801705C: movs r0, 0x1 @0801705E: pop {r1} bx r1 thumb_func_end sub_801704C thumb_func_start sub_8017064 sub_8017064: ; 8017064 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4] cmp r0, 0 beq @08017076 cmp r0, 0x1 beq @0801709C b @080170AE @08017076: bl sub_81973A4 movs r0, 0 movs r1, 0x1 bl sub_81973C4 ldr r0, =0x02021fc4 adds r1, r5, 0 bl ExpandTextCodes movs r0, 0x1 bl sub_8197310 ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @080170AE .align 2, 0 .pool @0801709C: bl sub_8197224 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @080170AE strb r0, [r4] movs r0, 0x1 b @080170B0 @080170AE: movs r0, 0 @080170B0: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8017064 thumb_func_start sub_80170B8 sub_80170B8: ; 80170B8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4] cmp r0, 0 beq @080170CA cmp r0, 0x1 beq @080170E0 b @0801710C @080170CA: cmp r5, 0 beq @080170D4 movs r0, 0x3 negs r0, r0 b @08017110 @080170D4: bl sub_8197930 ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @0801710C @080170E0: cmp r5, 0 beq @080170F2 bl sub_8198C78 movs r0, 0 strb r0, [r4] movs r0, 0x3 negs r0, r0 b @08017110 @080170F2: bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 movs r2, 0x80 lsls r2, 17 adds r0, r2 lsrs r0, 24 cmp r0, 0x2 bhi @0801710C strb r5, [r4] adds r0, r1, 0 b @08017110 @0801710C: movs r0, 0x2 negs r0, r0 @08017110: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80170B8 thumb_func_start sub_8017118 sub_8017118: ; 8017118 push {r4,lr} sub sp, 0x8 bl 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, =gUnknown_082EFD94 movs r0, 0x1 str r0, [sp] movs r0, 0x6 str r0, [sp, 0x4] adds r0, r4, 0 movs r1, 0x1 movs r3, 0x8 bl sub_80173E0 adds r0, r4, 0 movs r1, 0x2 bl 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 .pool 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, =0x00ffffff ands r0, r2 orrs r0, r1 str r0, [sp] @080171B6: ldr r2, [sp] lsrs r0, r2, 8 lsls r0, 24 lsrs r0, 24 lsrs r1, r2, 24 adds r0, r1 cmp r0, 0x1D ble @080171DC movs r0, 0x1D subs r0, r1 cmp r0, 0 bge @080171D0 movs r0, 0 @080171D0: lsls r1, r0, 24 lsrs r1, 16 ldr r0, =0xffff00ff ands r0, r2 orrs r0, r1 str r0, [sp] @080171DC: mov r0, sp bl Window_AddFromTemplate strb r0, [r5] ldrb r0, [r5] movs r1, 0 bl sub_81973FC ldr r0, =0x03006310 adds r2, r0, 0 ldr r1, [sp, 0x24] ldm r1!, {r3,r4,r6} stm r2!, {r3,r4,r6} ldm r1!, {r3,r4,r6} stm r2!, {r3,r4,r6} ldrb r1, [r5] strb r1, [r0, 0x10] movs r1, 0 movs r2, 0 bl 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 .pool @08017228: mov r3, r9 ldrb r0, [r3] bl sub_81AE604 mov r8, r0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] ands r4, r1 cmp r4, 0 beq @08017264 mov r4, r9 ldrb r0, [r4] movs r1, 0 movs r2, 0 bl sub_81AE6C8 ldrb r0, [r5] movs r1, 0x1 bl sub_819746C ldrb r0, [r5] bl Window_Remove movs r0, 0 strb r0, [r7] mov r0, r8 b @08017292 .align 2, 0 .pool @08017264: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0801728E mov r6, r9 ldrb r0, [r6] movs r1, 0 movs r2, 0 bl sub_81AE6C8 ldrb r0, [r5] movs r1, 0x1 bl sub_819746C ldrb r0, [r5] bl 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, =gUnknown_082F0344 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, =0x03006310 adds r2, r0, 0 ldr r1, [sp, 0x24] ldm r1!, {r3,r4,r7} stm r2!, {r3,r4,r7} ldm r1!, {r3,r4,r7} stm r2!, {r3,r4,r7} ldrb r1, [r6] strb r1, [r0, 0x10] movs r1, 0 movs r2, 0x1 bl calls_per_item_funcs_in_list_outer mov r1, r10 strb r0, [r1] b @08017314 .align 2, 0 .pool @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, =0x030022c0 ldrh r2, [r0, 0x2E] movs r0, 0x3 ands r0, r2 cmp r0, 0 beq @0801739C cmp r1, 0x8 beq @0801733E ands r4, r2 mov r8, r4 cmp r4, 0 beq @08017368 @0801733E: mov r4, r10 ldrb r0, [r4] movs r1, 0 movs r2, 0 bl sub_81AE6C8 ldrb r0, [r6] bl 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 .pool @08017368: ldr r0, [sp, 0x28] bl sub_8017CB0 adds r4, r0, 0 cmp r4, 0 blt @08017396 mov r1, r10 ldrb r0, [r1] movs r1, 0 movs r2, 0 bl sub_81AE6C8 ldrb r0, [r6] bl 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, =0x03003014 ldrb r1, [r2] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r2] cmp r4, 0x6 bls @08017422 b @0801756E @08017422: lsls r0, r4, 2 ldr r1, =@08017434 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08017434: .4byte @08017450 .4byte @0801747C .4byte @080174A8 .4byte @080174D4 .4byte @08017500 .4byte @0801752C .4byte @08017544 @08017450: mov r0, sp movs r1, 0 strb r1, [r0, 0xA] strb r1, [r0, 0xB] mov r2, sp ldrb r1, [r2, 0xC] movs r3, 0xF adds r0, r3, 0 ands r0, r1 movs r1, 0x20 orrs r0, r1 strb r0, [r2, 0xC] ldrb r1, [r2, 0xD] movs r0, 0x10 negs r0, r0 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0xD] ands r0, r3 movs r1, 0x30 b @0801756A @0801747C: mov r0, sp movs r1, 0 strb r1, [r0, 0xA] strb r1, [r0, 0xB] mov r2, sp ldrb r1, [r2, 0xC] movs r3, 0xF adds r0, r3, 0 ands r0, r1 movs r1, 0x40 orrs r0, r1 strb r0, [r2, 0xC] ldrb r1, [r2, 0xD] movs r0, 0x10 negs r0, r0 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0xD] ands r0, r3 movs r1, 0x50 b @0801756A @080174A8: mov r0, sp movs r1, 0 strb r1, [r0, 0xA] strb r1, [r0, 0xB] mov r2, sp ldrb r1, [r2, 0xC] movs r3, 0xF adds r0, r3, 0 ands r0, r1 movs r1, 0x60 orrs r0, r1 strb r0, [r2, 0xC] ldrb r1, [r2, 0xD] movs r0, 0x10 negs r0, r0 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0xD] ands r0, r3 movs r1, 0x70 b @0801756A @080174D4: mov r0, sp movs r1, 0 strb r1, [r0, 0xA] strb r1, [r0, 0xB] mov r2, sp ldrb r1, [r2, 0xC] movs r3, 0xF adds r0, r3, 0 ands r0, r1 movs r1, 0x10 orrs r0, r1 strb r0, [r2, 0xC] ldrb r1, [r2, 0xD] movs r0, 0x10 negs r0, r0 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0xD] ands r0, r3 movs r1, 0x30 b @0801756A @08017500: mov r0, sp movs r1, 0 strb r1, [r0, 0xA] strb r1, [r0, 0xB] mov r2, sp ldrb r1, [r2, 0xC] movs r3, 0xF adds r0, r3, 0 ands r0, r1 movs r1, 0x10 orrs r0, r1 strb r0, [r2, 0xC] ldrb r1, [r2, 0xD] movs r0, 0x10 negs r0, r0 ands r0, r1 movs r1, 0x2 orrs r0, r1 strb r0, [r2, 0xD] ands r0, r3 movs r1, 0x30 b @0801756A @0801752C: mov r0, sp movs r1, 0 strb r1, [r0, 0xA] strb r1, [r0, 0xB] mov r2, sp ldrb r1, [r2, 0xC] movs r4, 0xF movs r3, 0xF adds r0, r3, 0 ands r0, r1 movs r1, 0x70 b @0801755A @08017544: mov r0, sp movs r1, 0 strb r1, [r0, 0xA] strb r1, [r0, 0xB] mov r2, sp ldrb r1, [r2, 0xC] movs r4, 0xF movs r3, 0xF adds r0, r3, 0 ands r0, r1 movs r1, 0xE0 @0801755A: orrs r0, r1 strb r0, [r2, 0xC] mov r1, sp ldrb r0, [r1, 0xD] orrs r0, r4 strb r0, [r1, 0xD] ands r0, r3 movs r1, 0x90 @0801756A: orrs r0, r1 strb r0, [r2, 0xD] @0801756E: mov r0, sp movs r1, 0xFF movs r2, 0 bl 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, =gUnknown_082F045C mov r8, r2 movs r5, 0 mov r9, r5 movs r6, 0x4 negs r6, r6 mov r12, r6 adds r2, r0, 0 adds r2, 0x18 adds r4, r0, 0 movs r7, 0xFF mov r10, r7 adds r3, r1, 0 @080175AC: adds r1, r4, 0 mov r0, r8 ldm r0!, {r5-r7} stm r1!, {r5-r7} ldm r0!, {r5-r7} stm r1!, {r5-r7} mov r0, r10 strh r0, [r2] ldrb r1, [r2, 0x2] mov r0, r12 ands r0, r1 movs r1, 0x5 negs r1, r1 ands r0, r1 strb r0, [r2, 0x2] mov r5, r9 strb r5, [r2, 0x3] adds r2, 0x20 adds r4, 0x20 subs r3, 0x1 cmp r3, 0 bne @080175AC @080175D8: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8017580 thumb_func_start sub_80175EC sub_80175EC: ; 80175EC push {r4-r7,lr} mov r7, r8 push {r7} ldr r1, =gUnknown_082F045C mov r12, r1 movs r5, 0x2 negs r5, r5 mov r8, r5 adds r2, r0, 0 adds r2, 0x18 adds r3, r0, 0 movs r4, 0x3 @08017604: adds r1, r3, 0 mov r0, r12 ldm r0!, {r5-r7} stm r1!, {r5-r7} ldm r0!, {r5-r7} stm r1!, {r5-r7} ldrb r1, [r2] mov r0, r8 ands r0, r1 strb r0, [r2] adds r2, 0x1C adds r3, 0x1C subs r4, 0x1 cmp r4, 0 bge @08017604 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80175EC thumb_func_start sub_8017630 sub_8017630: ; 8017630 push {r4-r6,lr} adds r5, r0, 0 adds r6, r1, 0 movs r2, 0 adds r4, r5, 0x2 adds r3, r6, 0x2 @0801763C: adds r0, r4, r2 adds r1, r3, r2 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bne @08017664 adds r2, 0x1 cmp r2, 0x1 ble @0801763C movs r2, 0 adds r4, r5, 0 adds r4, 0x10 adds r3, r6, 0 adds r3, 0x10 @08017658: adds r0, r4, r2 adds r1, r3, r2 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 beq @08017668 @08017664: movs r0, 0x1 b @08017670 @08017668: adds r2, 0x1 cmp r2, 0x7 ble @08017658 movs r0, 0 @08017670: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8017630 thumb_func_start sub_8017678 sub_8017678: ; 8017678 push {r4-r6,lr} adds r5, r0, 0 adds r6, r1, 0 ldrb r3, [r5, 0xA] movs r0, 0x7F ldrb r2, [r6, 0xA] adds r1, r0, 0 ands r1, r3 ands r0, r2 cmp r1, r0 bne @080176DC movs r0, 0x80 adds r1, r0, 0 ands r1, r3 ands r0, r2 cmp r1, r0 bne @080176DC movs r2, 0 adds r4, r5, 0x4 adds r3, r6, 0x4 @080176A0: adds r0, r4, r2 adds r1, r3, r2 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bne @080176DC adds r2, 0x1 cmp r2, 0x3 ble @080176A0 ldrh r2, [r5, 0x8] ldr r0, =0x000003ff ldrh r3, [r6, 0x8] adds r1, r0, 0 ands r1, r2 ands r0, r3 cmp r1, r0 bne @080176DC ldrb r2, [r5, 0x9] movs r0, 0xFC ldrb r3, [r6, 0x9] adds r1, r0, 0 ands r1, r2 ands r0, r3 cmp r1, r0 bne @080176DC movs r0, 0 b @080176DE .align 2, 0 .pool @080176DC: movs r0, 0x1 @080176DE: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8017678 thumb_func_start sub_80176E4 sub_80176E4: ; 80176E4 push {r4-r7,lr} mov r7, r8 push {r7} mov r8, r0 movs r7, 0xFF movs r6, 0 adds r4, r1, 0 adds r4, 0x18 adds r5, r1, 0 @080176F6: ldrb r1, [r4] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0801771E mov r0, r8 adds r1, r5, 0 bl sub_8017630 lsls r0, 24 cmp r0, 0 bne @0801771E lsls r0, r6, 24 lsrs r7, r0, 24 ldrb r0, [r4] movs r2, 0x2 negs r2, r2 adds r1, r2, 0 ands r0, r1 strb r0, [r4] @0801771E: adds r4, 0x1C adds r5, 0x1C adds r6, 0x1 cmp r6, 0x3 ble @080176F6 adds r0, r7, 0 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80176E4 thumb_func_start sub_8017734 sub_8017734: ; 8017734 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r3, r0, 0 mov r8, r1 lsls r2, 24 lsrs r6, r2, 24 ldrb r1, [r1, 0x18] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080177A8 movs r5, 0 cmp r5, r6 bge @080177A8 movs r0, 0x4 negs r0, r0 mov r9, r0 movs r1, 0x2 negs r1, r1 mov r12, r1 adds r2, r3, 0 adds r2, 0x18 adds r1, r3, 0 @08017766: ldrb r0, [r2, 0x2] movs r3, 0x3 ands r3, r0 cmp r3, 0 bne @0801779E mov r0, r8 ldm r0!, {r4,r6,r7} stm r1!, {r4,r6,r7} ldm r0!, {r4,r6,r7} stm r1!, {r4,r6,r7} strh r3, [r2] ldrb r1, [r2, 0x2] mov r0, r9 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x2] movs r0, 0x40 strb r0, [r2, 0x3] mov r0, r8 ldrb r1, [r0, 0x18] mov r0, r12 ands r0, r1 mov r1, r8 strb r0, [r1, 0x18] lsls r0, r5, 24 lsrs r0, 24 b @080177AA @0801779E: adds r2, 0x20 adds r1, 0x20 adds r5, 0x1 cmp r5, r6 blt @08017766 @080177A8: movs r0, 0xFF @080177AA: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8017734 thumb_func_start sub_80177B8 sub_80177B8: ; 80177B8 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x10 adds r4, r1, 0 adds r6, r3, 0 ldr r3, [sp, 0x2C] ldr r1, [sp, 0x30] lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r4, 24 lsrs r4, 24 lsls r2, 24 lsrs r7, r2, 24 lsls r3, 24 lsrs r3, 24 mov r9, r3 lsls r1, 24 lsrs r1, 24 ldr r5, =0x02021fc4 adds r1, 0x1 adds r0, r5, 0 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r1, =gUnknown_082ED8C8 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, =gUnknown_082ED8CC 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 .pool thumb_func_end sub_80177B8 thumb_func_start sub_80178A0 sub_80178A0: ; 80178A0 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x10 adds r5, r3, 0 ldr r3, [sp, 0x2C] lsls r0, 24 lsrs r0, 24 mov r9, r0 lsls r1, 24 lsrs r6, r1, 24 lsls r2, 24 lsrs r2, 24 mov r8, r2 lsls r3, 24 lsrs r7, r3, 24 ldrb r1, [r5, 0x1A] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @0801792A ldr r4, =0x02021fc4 adds r0, r4, 0 adds r1, r5, 0 bl sub_8018404 mov r0, r8 str r0, [sp] str r7, [sp, 0x4] mov r0, r9 movs r1, 0x1 adds r2, r4, 0 adds r3, r6, 0 bl sub_80173E0 ldrb r1, [r5, 0x2] ldrb r0, [r5, 0x3] lsls r0, 8 orrs r1, r0 add r0, sp, 0x8 movs r2, 0x2 movs r3, 0x5 bl decimal_int_to_string ldr r1, =gUnknown_082ED8CC 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 .pool thumb_func_end sub_80178A0 thumb_func_start sub_8017940 sub_8017940: ; 8017940 push {r4,lr} sub sp, 0x4 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl 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, =0x02037590 ldrb r0, [r0, 0x3] cmp r0, 0x2 beq @0801796E cmp r0, 0 bne @08017978 @0801796E: movs r0, 0x1 b @0801797A .align 2, 0 .pool @08017978: movs r0, 0 @0801797A: add sp, 0x4 pop {r4} pop {r1} bx r1 thumb_func_end sub_8017940 thumb_func_start sub_8017984 sub_8017984: ; 8017984 push {lr} cmp r0, 0x4 beq @0801799C cmp r0, 0x4 ble @080179A4 cmp r0, 0x5 beq @08017998 cmp r0, 0x8 beq @080179A0 b @080179A4 @08017998: movs r0, 0x1 b @080179A6 @0801799C: movs r0, 0x2 b @080179A6 @080179A0: movs r0, 0x3 b @080179A6 @080179A4: movs r0, 0 @080179A6: pop {r1} bx r1 thumb_func_end sub_8017984 thumb_func_start sub_80179AC sub_80179AC: ; 80179AC push {r4,lr} sub sp, 0x20 adds r4, r0, 0 mov r0, sp adds r1, r4, 0 bl sub_8018404 adds r4, 0x2 adds r0, r4, 0 bl sub_8015658 lsls r0, 16 lsrs r0, 16 mov r1, sp bl sub_800E540 add sp, 0x20 pop {r4} pop {r1} bx r1 thumb_func_end sub_80179AC thumb_func_start sub_80179D4 sub_80179D4: ; 80179D4 push {r4-r6,lr} adds r6, r3, 0 lsls r1, 24 lsrs r4, r1, 24 lsls r2, 24 lsrs r2, 19 adds r5, r0, r2 ldrb r1, [r5, 0xA] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08017A4C cmp r4, 0 bne @08017A4C ldr r4, =0x02021cc4 adds r0, r4, 0 adds r1, r5, 0 bl sub_8018404 adds r0, r5, 0x2 bl sub_8015658 lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 bl sub_800E540 adds r2, r0, 0 ldrb r1, [r5, 0xA] movs r0, 0x7F ands r0, r1 cmp r0, 0x45 bne @08017A38 ldr r0, =0x02021fc4 ldr r3, =gUnknown_082EE6B8 lsls r1, r6, 2 lsls r2, 3 adds r1, r2 adds r1, r3 ldr r1, [r1] bl ExpandTextCodes movs r0, 0x2 b @08017B2A .align 2, 0 .pool @08017A38: ldr r0, =gUnknown_082EE17C lsls r1, r2, 2 adds r1, r0 ldr r0, [r1] bl sub_8017020 movs r0, 0x1 b @08017B2A .align 2, 0 .pool @08017A4C: ldr r0, =0x02021cc4 adds r1, r5, 0 bl sub_8018404 cmp r4, 0 beq @08017A62 adds r0, r5, r4 ldrb r0, [r0, 0x3] lsrs r6, r0, 3 movs r0, 0x1 ands r6, r0 @08017A62: ldrb r0, [r5, 0xA] lsls r0, 25 lsrs r0, 25 movs r1, 0x3F ands r1, r0 cmp r1, 0x4 beq @08017AB0 cmp r1, 0x4 bgt @08017A80 cmp r1, 0x1 beq @08017A8A b @08017B20 .align 2, 0 .pool @08017A80: cmp r1, 0x5 beq @08017AD0 cmp r1, 0x8 beq @08017AF4 b @08017B20 @08017A8A: ldr r5, =0x02021fc4 ldr r4, =gUnknown_082EEEAC bl GenerateRandomNumber lsls r0, 16 movs r1, 0xC0 lsls r1, 10 ands r1, r0 lsrs r1, 14 lsls r0, r6, 4 adds r1, r0 adds r1, r4 ldr r1, [r1] b @08017B0E .align 2, 0 .pool @08017AB0: ldr r5, =0x02021fc4 ldr r4, =gUnknown_082EF1CC bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x1 ands r0, r1 lsls r0, 2 lsls r1, r6, 4 b @08017B08 .align 2, 0 .pool @08017AD0: ldr r5, =0x02021fc4 ldr r4, =gUnknown_082EF010 bl GenerateRandomNumber lsls r0, 16 movs r1, 0xC0 lsls r1, 10 ands r1, r0 lsrs r1, 14 lsls r0, r6, 4 adds r1, r0 adds r1, r4 ldr r1, [r1] b @08017B0E .align 2, 0 .pool @08017AF4: ldr r5, =0x02021fc4 ldr r4, =gUnknown_082EF100 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x1 ands r0, r1 lsls r0, 2 lsls r1, r6, 3 @08017B08: adds r0, r1 adds r0, r4 ldr r1, [r0] @08017B0E: adds r0, r5, 0 bl ExpandTextCodes b @08017B28 .align 2, 0 .pool @08017B20: ldr r0, =0x02021fc4 ldr r1, =gUnknown_082EE6C8 bl ExpandTextCodes @08017B28: movs r0, 0 @08017B2A: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80179D4 thumb_func_start nullsub_14 nullsub_14: ; 8017B38 bx lr thumb_func_end nullsub_14 thumb_func_start sub_8017B3C sub_8017B3C: ; 8017B3C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0xC ldr r4, [sp, 0x28] lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r5, r1, 24 lsls r4, 24 lsrs r4, 24 ldrh r0, [r2, 0x8] lsls r0, 22 lsrs r0, 22 mov r8, r0 ldrb r0, [r2, 0x9] lsrs r7, r0, 2 ldrb r0, [r2, 0xB] lsrs r0, 1 mov r9, r0 str r5, [sp] str r4, [sp, 0x4] adds r0, r6, 0 movs r1, 0x1 adds r2, r3, 0 movs r3, 0x8 bl sub_80173E0 movs r0, 0xCE lsls r0, 1 cmp r8, r0 bne @08017B94 ldr r2, =gUnknown_082EF7D0 str r5, [sp] str r4, [sp, 0x4] adds r0, r6, 0 movs r1, 0x1 movs r3, 0x44 bl sub_80173E0 b @08017BD4 .align 2, 0 .pool @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, =gSpeciesNames adds r2, r0 str r5, [sp] str r4, [sp, 0x4] adds r0, r6, 0 movs r1, 0x1 movs r3, 0x76 bl sub_80173E0 add r0, sp, 0x8 mov r1, r9 movs r2, 0x1 movs r3, 0x3 bl 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 .pool thumb_func_end sub_8017B3C thumb_func_start sub_8017BE8 sub_8017BE8: ; 8017BE8 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x10 adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 mov r9, r0 lsls r2, 24 lsrs r7, r2, 24 ldr r0, =0x02022c30 ldr r0, [r0] mov r8, r0 movs r0, 0x3 negs r0, r0 cmp r4, r0 bne @08017C6C ldr r0, =gUnknown_082F03A4 ldrb r0, [r0, 0x14] lsls r0, 28 lsrs r0, 28 cmp r7, r0 bne @08017C6C bl sub_800F7DC adds r2, r0, 0 ldrh r1, [r2, 0x8] ldr r0, =0x000003ff ands r0, r1 cmp r0, 0 beq @08017CA0 ldr r0, =0x03005d90 ldr r3, [r0] movs r0, 0x5 str r0, [sp] mov r0, r9 adds r1, r7, 0 bl sub_8017B3C b @08017CA0 .align 2, 0 .pool @08017C4C: mov r0, r12 adds r1, r0, r4 add r0, sp, 0x4 bl sub_8018404 mov r0, r8 ldr r2, [r0] adds r2, r4 movs r0, 0x6 str r0, [sp] mov r0, r9 adds r1, r7, 0 add r3, sp, 0x4 bl sub_8017B3C b @08017CA0 @08017C6C: movs r5, 0 movs r1, 0 mov r2, r8 ldr r2, [r2] mov r12, r2 adds r2, 0x8 movs r3, 0 adds r6, r4, 0x1 @08017C7C: ldrb r0, [r2, 0x12] lsls r0, 30 lsrs r0, 30 adds r4, r3, 0 cmp r0, 0x1 bne @08017C92 ldrh r0, [r2] lsls r0, 22 cmp r0, 0 beq @08017C92 adds r5, 0x1 @08017C92: cmp r5, r6 beq @08017C4C adds r2, 0x20 adds r3, 0x20 adds r1, 0x1 cmp r1, 0x7 ble @08017C7C @08017CA0: add sp, 0x10 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8017BE8 thumb_func_start sub_8017CB0 sub_8017CB0: ; 8017CB0 push {r4-r7,lr} movs r4, 0 movs r3, 0 movs r7, 0x3 ldr r6, =0x000003ff adds r2, r0, 0 adds r2, 0x8 adds r5, r1, 0x1 @08017CC0: ldrb r1, [r2, 0x12] adds r0, r7, 0 ands r0, r1 cmp r0, 0x1 bne @08017CD6 ldrh r1, [r2] adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @08017CD6 adds r4, 0x1 @08017CD6: cmp r4, r5 bne @08017CE4 adds r0, r3, 0 b @08017CF0 .align 2, 0 .pool @08017CE4: adds r2, 0x20 adds r3, 0x1 cmp r3, 0x7 ble @08017CC0 movs r0, 0x1 negs r0, r0 @08017CF0: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8017CB0 thumb_func_start sub_8017CF8 sub_8017CF8: ; 8017CF8 lsls r0, 5 adds r0, r1 ldrb r0, [r0, 0xB] lsls r0, 31 lsrs r0, 31 bx lr thumb_func_end sub_8017CF8 thumb_func_start sub_8017D04 sub_8017D04: ; 8017D04 push {r4-r6,lr} adds r5, r0, 0 movs r0, 0xCE lsls r0, 1 cmp r1, r0 bne @08017D44 movs r4, 0 b @08017D2E @08017D14: movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x41 bl pokemon_getattr adds r1, r0, 0 movs r0, 0xCE lsls r0, 1 cmp r1, r0 beq @08017D74 adds r4, 0x1 @08017D2E: ldr r0, =0x020244e9 ldrb r0, [r0] cmp r4, r0 blt @08017D14 movs r0, 0x2 b @08017D90 .align 2, 0 .pool @08017D44: movs r4, 0 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r4, r0 bge @08017D8E ldr r6, =gBaseStats @08017D50: movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x41 bl pokemon_getattr adds r1, r0, 0 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r1, r0, r6 ldrb r0, [r1, 0x6] cmp r0, r5 beq @08017D74 ldrb r0, [r1, 0x7] cmp r0, r5 bne @08017D84 @08017D74: movs r0, 0 b @08017D90 .align 2, 0 .pool @08017D84: adds r4, 0x1 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r4, r0 blt @08017D50 @08017D8E: movs r0, 0x1 @08017D90: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8017D04 thumb_func_start sub_8017D9C sub_8017D9C: ; 8017D9C push {lr} adds r3, r0, 0 cmp r1, 0x44 beq @08017DD8 cmp r1, 0x44 bgt @08017DAE cmp r1, 0x41 beq @08017DB8 b @08017DF6 @08017DAE: cmp r1, 0x45 beq @08017DC8 cmp r1, 0x48 beq @08017DE8 b @08017DF6 @08017DB8: ldr r0, =gUnknown_082EEA68 lsls r1, r2, 2 adds r1, r0 ldr r1, [r1] b @08017DDA .align 2, 0 .pool @08017DC8: ldr r0, =gUnknown_082EED3C lsls r1, r2, 2 adds r1, r0 ldr r1, [r1] b @08017DDA .align 2, 0 .pool @08017DD8: ldr r1, =gUnknown_082EF7B0 @08017DDA: adds r0, r3, 0 bl ExpandTextCodes b @08017DF6 .align 2, 0 .pool @08017DE8: ldr r0, =gUnknown_082EEB08 lsls r1, r2, 2 adds r1, r0 ldr r1, [r1] adds r0, r3, 0 bl ExpandTextCodes @08017DF6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8017D9C thumb_func_start sub_8017E00 sub_8017E00: ; 8017E00 push {r4-r6,lr} adds r5, r0, 0 lsls r1, 24 lsrs r4, r1, 24 adds r6, r4, 0 bl link_get_multiplayer_id lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x020229e8 movs r0, 0x1 adds r1, r3, 0 eors r1, r0 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x13] cmp r4, 0x44 beq @08017E54 cmp r4, 0x44 bgt @08017E38 cmp r4, 0x41 beq @08017E3E b @08017E94 .align 2, 0 .pool @08017E38: cmp r6, 0x45 beq @08017E78 b @08017E94 @08017E3E: ldr r2, =gUnknown_082EE984 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 lsls r0, r3, 1 adds r0, r3 lsls r0, 3 adds r1, r0 b @08017E66 .align 2, 0 .pool @08017E54: ldr r2, =gUnknown_082EE984 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 lsls r0, r3, 1 adds r0, r3 lsls r0, 3 adds r1, r0 adds r2, 0x8 @08017E66: adds r1, r2 ldr r1, [r1] adds r0, r5, 0 bl gf_strcpy b @08017E94 .align 2, 0 .pool @08017E78: ldr r2, =gUnknown_082EE984 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 lsls r0, r3, 1 adds r0, r3 lsls r0, 3 adds r1, r0 adds r2, 0x4 adds r1, r2 ldr r1, [r1] adds r0, r5, 0 bl gf_strcpy @08017E94: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8017E00 thumb_func_start sub_8017EA0 sub_8017EA0: ; 8017EA0 push {r4-r7,lr} mov r7, r8 push {r7} adds r7, r0, 0 adds r5, r2, 0 adds r6, r3, 0 movs r2, 0 mov r8, r2 ldrh r0, [r5] subs r0, 0x40 cmp r0, 0x8 bls @08017EBA b @08017FC6 @08017EBA: lsls r0, 2 ldr r1, =@08017EC8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08017EC8: .4byte @08017FBC .4byte @08017EEC .4byte @08017FC6 .4byte @08017FC6 .4byte @08017EFC .4byte @08017EF4 .4byte @08017FC6 .4byte @08017FC6 .4byte @08017FAC @08017EEC: ldr r1, =gUnknown_082EE3DC b @08017FAE .align 2, 0 .pool @08017EF4: ldr r1, =gUnknown_082EE430 b @08017FAE .align 2, 0 .pool @08017EFC: adds r0, r6, 0 adds r0, 0x58 ldr r4, =0x02022c40 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, =gSpeciesNames adds r1, r2 bl gf_strcpy movs r4, 0 b @08017F2E .align 2, 0 .pool @08017F2C: adds r4, 0x1 @08017F2E: cmp r4, 0x3 bgt @08017F64 ldr r0, =0x03007890 ldr r0, [r0] lsls r1, r4, 5 adds r0, r1 ldrh r0, [r0, 0x18] cmp r0, 0x2 bne @08017F2C ldrh r1, [r5, 0x4] adds r0, r6, 0 adds r0, 0x78 movs r2, 0 movs r3, 0x3 bl decimal_int_to_string ldrh r1, [r5, 0x2] movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames 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, =gUnknown_082EE4F0 adds r0, r7, 0 bl gf_strcpy b @08017FB4 .align 2, 0 .pool @08017F84: movs r4, 0 adds r5, r6, 0 adds r5, 0x58 @08017F8A: lsls r0, r4, 24 lsrs r0, 24 adds r1, r5, 0 bl sub_81AFC0C adds r5, 0x10 adds r4, 0x1 cmp r4, 0x3 ble @08017F8A ldr r1, =gUnknown_082EE47C adds r0, r7, 0 bl sub_81AFC28 b @08017FB4 .align 2, 0 .pool @08017FAC: ldr r1, =gUnknown_082EE380 @08017FAE: adds r0, r7, 0 bl ExpandTextCodes @08017FB4: movs r2, 0x1 b @08017FC6 .align 2, 0 .pool @08017FBC: ldr r1, =gUnknown_082EE544 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 .pool thumb_func_end sub_8017EA0 thumb_func_start sub_8017FD8 sub_8017FD8: ; 8017FD8 push {lr} adds r2, r0, 0 ldr r0, =0x03003090 ldrh r1, [r0, 0x2] cmp r1, 0 beq @08017FFC cmp r1, 0x51 beq @08017FEC cmp r1, 0x52 bne @08017FFC @08017FEC: adds r0, r2, 0 adds r0, 0x98 strh r1, [r0] movs r0, 0x1 b @08017FFE .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00003c19 cmp r1, r0 bne @08018016 movs r2, 0x1 @08018016: adds r0, r2, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x020244e9 ldrb r0, [r0] cmp r6, r0 bge @08018064 @08018032: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr cmp r0, 0x1E bhi @0801805A adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @0801805A adds r6, 0x1 @0801805A: adds r5, 0x1 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r5, r0 blt @08018032 @08018064: cmp r6, 0x1 bgt @08018074 movs r0, 0 b @08018076 .align 2, 0 .pool @08018074: movs r0, 0x1 @08018076: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8018024 thumb_func_start sub_801807C sub_801807C: ; 801807C movs r1, 0 strh r1, [r0] strh r1, [r0, 0x2] str r1, [r0, 0x4] strh r1, [r0, 0xA] strh r1, [r0, 0xC] strh r1, [r0, 0xE] strh r1, [r0, 0x10] str r1, [r0, 0x14] bx lr thumb_func_end sub_801807C thumb_func_start sub_8018090 sub_8018090: ; 8018090 push {lr} ldr r0, =0x02022c40 bl sub_801807C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8018090 thumb_func_start sub_80180A0 sub_80180A0: ; 80180A0 push {r4,r5,lr} adds r5, r1, 0 movs r1, 0x64 adds r4, r0, 0 muls r4, r1 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr strh r0, [r5, 0xA] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr strh r0, [r5, 0xC] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [r5, 0x4] ldrh r1, [r5, 0xA] movs r0, 0xCE lsls r0, 1 cmp r1, r0 beq @080180E0 movs r0, 0 b @080180E2 .align 2, 0 .pool @080180E0: movs r0, 0x1 @080180E2: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80180A0 thumb_func_start sub_80180E8 sub_80180E8: ; 80180E8 push {r4,r5,lr} adds r5, r1, 0 movs r1, 0x64 adds r4, r0, 0 muls r4, r1 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr strh r0, [r5, 0xE] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr strh r0, [r5, 0x10] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [r5, 0x14] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80180E8 thumb_func_start sub_8018120 sub_8018120: ; 8018120 push {r4-r7,lr} mov r7, r8 push {r7} lsls r1, 24 movs r2, 0 mov r8, r2 cmp r1, 0 bne @0801813E ldrh r7, [r0, 0xA] ldr r6, [r0, 0x4] b @08018142 @08018136: lsls r0, r5, 16 lsrs r0, 16 mov r8, r0 b @08018176 @0801813E: ldrh r7, [r0, 0xE] ldr r6, [r0, 0x14] @08018142: movs r5, 0 b @0801816E @08018146: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0 bl pokemon_getattr cmp r0, r6 bne @0801816C adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 cmp r0, r7 beq @08018136 @0801816C: adds r5, 0x1 @0801816E: ldr r0, =0x020244e9 ldrb r0, [r0] cmp r5, r0 blt @08018146 @08018176: mov r0, r8 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8018120 thumb_func_start sub_801818C sub_801818C: ; 801818C push {r4,lr} adds r4, r0, 0 bl sub_80173B0 bl script_env_2_disable bl sub_8098524 ldr r1, =0x02022c2c movs r0, 0 strb r0, [r1] cmp r4, 0 beq @080181BC ldr r2, =0x02022c40 ldrh r0, [r2, 0x2] ldrh r1, [r2, 0xA] ldrh r2, [r2, 0xC] bl sub_8010FCC movs r0, 0x40 movs r1, 0 movs r2, 0 bl sub_8011090 @080181BC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801818C thumb_func_start sub_80181CC sub_80181CC: ; 80181CC push {lr} bl script_env_2_enable bl sub_80983E8 pop {r0} bx r0 thumb_func_end sub_80181CC thumb_func_start sub_80181DC sub_80181DC: ; 80181DC push {r4,lr} movs r3, 0x80 movs r2, 0 ldr r4, [r0, 0xC] @080181E4: lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r1, r4, r0 ldrb r0, [r1, 0x18] lsls r0, 31 cmp r0, 0 beq @0801820C ldrb r0, [r1, 0xB] lsls r0, 31 lsrs r0, 31 lsls r0, 3 orrs r3, r0 ldrb r1, [r1, 0x2] movs r0, 0x7 ands r0, r1 orrs r3, r0 lsls r0, r3, 24 lsrs r3, r0, 24 b @08018216 @0801820C: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @080181E4 @08018216: adds r0, r3, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_80181DC thumb_func_start sub_8018220 sub_8018220: ; 8018220 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 mov r9, r1 lsls r2, 24 lsrs r2, 24 str r2, [sp] bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r1, r0 ldr r0, =0x02039b58 adds r1, r0 mov r8, r1 bl sub_81AFBF0 mov r6, r9 adds r6, 0xC0 bl sub_8068BB0 lsls r0, 16 lsrs r0, 16 movs r1, 0xD muls r1, r0 ldr r0, =gTrainerClassNames adds r1, r0 adds r0, r6, 0 bl 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, =gUnknown_082EFF50 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, =gUnknown_082EFF64 adds r0, r4, 0 bl sub_81AFC28 ldr r0, =0x02021fc4 adds r1, r4, 0 bl gf_strcpy mov r0, r8 ldrh r1, [r0, 0x14] ldr r4, =0x0000270f cmp r1, r4 ble @0801830C adds r1, r4, 0 @0801830C: adds r0, r6, 0 movs r2, 0 movs r3, 0x4 bl 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, =gUnknown_082EFFA4 adds r0, r4, 0 bl sub_81AFC28 ldr r5, =0x02021fc4 adds r0, r5, 0 adds r1, r4, 0 bl gf_strcat ldr r0, [sp] cmp r0, 0x1 bne @080183D0 ldr r1, =gUnknown_082F0020 adds r0, r4, 0 bl sub_81AFC28 adds r0, r5, 0 adds r1, r4, 0 bl gf_strcat b @080183F0 .align 2, 0 .pool @080183D0: ldr r2, [sp] cmp r2, 0 bne @080183F0 ldr r0, =gUnknown_082F0018 mov r2, r8 ldrb r1, [r2] lsls r1, 2 adds r1, r0 ldr r1, [r1] adds r0, r4, 0 bl sub_81AFC28 adds r0, r5, 0 adds r1, r4, 0 bl 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 .pool thumb_func_end sub_8018220 thumb_func_start sub_8018404 sub_8018404: ; 8018404 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 adds r1, 0x10 bl 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, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r6, r0, r1 ldrb r0, [r6] cmp r0, 0x1 bne @08018466 b @08018574 @08018466: cmp r0, 0x1 bgt @08018474 cmp r0, 0 beq @08018482 b @08018644 .align 2, 0 .pool @08018474: cmp r0, 0x2 bne @0801847A b @080185F8 @0801847A: cmp r0, 0x3 bne @08018480 b @08018618 @08018480: b @08018644 @08018482: movs r0, 0 bl SetVBlankCallback bl sub_80A1A74 bl 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, =gUnknown_082F0598 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, =gUnknown_082F05A8 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 .pool @08018574: ldr r0, =gUnknown_082F0548 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply movs r0, 0x2 bl stdpal_get movs r1, 0xD0 movs r2, 0x20 bl gpu_pal_apply movs r0, 0xC0 bl sub_81978B0 movs r0, 0 movs r1, 0xA movs r2, 0xE0 bl sub_809882C movs r0, 0 movs r1, 0x1 movs r2, 0xF0 bl box_border_load_tiles_and_pal movs r4, 0x20 str r4, [sp] str r4, [sp, 0x4] movs r5, 0x11 str r5, [sp, 0x8] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl 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 .pool @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, =0x0000021d bl song_play_for_text ldr r0, =sub_8018424 bl SetVBlankCallback movs r0, 0xC5 bl enable_irqs movs r0, 0x1 b @08018646 .align 2, 0 .pool @08018644: movs r0, 0 @08018646: add sp, 0xC pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8018450 thumb_func_start c2_mystery_gift c2_mystery_gift: ; 8018650 push {lr} movs r0, 0 bl sub_8018450 cmp r0, 0 beq @0801866C ldr r0, =sub_8018438 bl set_callback2 ldr r1, =0x02022c60 movs r0, 0 strb r0, [r1] bl task_add_00_mystery_gift @0801866C: bl run_active_tasks pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_mystery_gift thumb_func_start sub_801867C sub_801867C: ; 801867C push {lr} movs r0, 0x1 bl sub_8018450 cmp r0, 0 beq @08018698 ldr r0, =sub_8018438 bl set_callback2 ldr r1, =0x02022c60 movs r0, 0x1 strb r0, [r1] bl sub_81D5014 @08018698: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801867C thumb_func_start sub_80186A4 sub_80186A4: ; 80186A4 push {lr} ldr r1, =0x02022c60 movs r0, 0 strb r0, [r1] bl 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, =c2_title_screen_1 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80186A4 thumb_func_start sub_80186EC sub_80186EC: ; 80186EC push {r4-r7,lr} sub sp, 0x14 adds r4, r0, 0 adds r5, r1, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0 movs r1, 0 bl Window_FastFillPixels cmp r4, 0 bne @0801871C ldr r0, =gUnknown_085EF654 ldr r7, =gUnknown_085EF678 cmp r5, 0 bne @08018720 ldr r7, =gUnknown_085EF664 b @08018720 .align 2, 0 .pool @0801871C: ldr r0, =gUnknown_085EDFBF ldr r7, =gUnknown_085EDFC9 @08018720: movs r4, 0 str r4, [sp] str r4, [sp, 0x4] ldr r6, =gUnknown_082F0720 str r6, [sp, 0x8] movs r5, 0x1 negs r5, r5 str r5, [sp, 0xC] str r0, [sp, 0x10] movs r0, 0 movs r1, 0x1 movs r2, 0x4 movs r3, 0x1 bl 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 .pool thumb_func_end sub_80186EC thumb_func_start sub_8018784 sub_8018784: ; 8018784 push {lr} lsls r0, 24 lsrs r0, 24 movs r1, 0x1 movs r2, 0xF bl sub_8098858 pop {r0} bx r0 thumb_func_end sub_8018784 thumb_func_start sub_8018798 sub_8018798: ; 8018798 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC adds r4, r0, 0 movs r0, 0 mov r9, r0 lsls r4, 24 lsrs r0, r4, 24 movs r1, 0x20 str r1, [sp] movs r1, 0x2 str r1, [sp, 0x4] movs r1, 0x11 str r1, [sp, 0x8] movs r1, 0x3 movs r2, 0 movs r3, 0 bl 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, =0x02021fc4 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, =gUnknown_082F0728 str r0, [sp, 0x8] str r1, [sp, 0xC] str r4, [sp, 0x10] movs r0, 0x1 movs r1, 0x1 movs r2, 0 movs r3, 0x1 bl 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 .pool thumb_func_end sub_8018884 thumb_func_start sub_80188DC sub_80188DC: ; 80188DC push {lr} movs r0, 0x1 bl rbox_fill_rectangle movs r0, 0x1 bl 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, =0x02022c58 str r0, [sp, 0x4] adds r0, 0x1 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0xD0 movs r2, 0x14 movs r3, 0x1 bl draw_bouncing_down_arrow_2 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @08018980 @08018944: ldrb r0, [r4] adds r0, 0x1 b @0801897E .align 2, 0 .pool @08018954: movs r0, 0x1 str r0, [sp] ldr r0, =0x02022c58 str r0, [sp, 0x4] adds r0, 0x1 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0xD0 movs r2, 0x14 movs r3, 0x1 bl draw_bouncing_down_arrow_2 movs r0, 0 strb r0, [r4] bl sub_80188DC movs r0, 0x1 b @08018982 .align 2, 0 .pool @0801897C: movs r0, 0x2 @0801897E: strb r0, [r4] @08018980: movs r0, 0 @08018982: add sp, 0xC pop {r4} pop {r1} bx r1 thumb_func_end mevent_0814257C thumb_func_start sub_801898C sub_801898C: ; 801898C push {lr} sub sp, 0xC movs r0, 0 str r0, [sp] ldr r0, =0x02022c58 str r0, [sp, 0x4] adds r0, 0x1 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0xD0 movs r2, 0x14 movs r3, 0x1 bl draw_bouncing_down_arrow_2 add sp, 0xC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801898C thumb_func_start sub_80189B4 sub_80189B4: ; 80189B4 push {lr} sub sp, 0xC movs r0, 0x1 str r0, [sp] ldr r0, =0x02022c58 str r0, [sp, 0x4] adds r0, 0x1 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0xD0 movs r2, 0x14 movs r3, 0x1 bl draw_bouncing_down_arrow_2 add sp, 0xC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80189B4 thumb_func_start sub_80189DC sub_80189DC: ; 80189DC push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0 beq @080189EC cmp r0, 0x1 beq @08018A08 b @08018A14 @080189EC: bl sub_801898C ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @08018A14 ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @08018A14 .align 2, 0 .pool @08018A08: bl sub_80189B4 movs r0, 0 strb r0, [r4] movs r0, 0x1 b @08018A16 @08018A14: movs r0, 0 @08018A16: pop {r4} pop {r1} bx r1 thumb_func_end sub_80189DC thumb_func_start sub_8018A1C sub_8018A1C: ; 8018A1C push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0 bne @08018A2C adds r0, r1, 0 bl sub_8018884 @08018A2C: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] lsls r0, 24 lsrs r0, 24 cmp r0, 0x78 bhi @08018A3E movs r0, 0 b @08018A48 @08018A3E: movs r0, 0 strb r0, [r4] bl sub_80188DC movs r0, 0x1 @08018A48: pop {r4} pop {r1} bx r1 thumb_func_end sub_8018A1C thumb_func_start sub_8018A50 sub_8018A50: ; 8018A50 push {r4,r5,lr} sub sp, 0x24 lsls r2, 24 add r1, sp, 0x4 ldr r0, =gUnknown_082F0638 ldm r0!, {r3-r5} stm r1!, {r3-r5} ldm r0!, {r3-r5} stm r1!, {r3-r5} ldr r0, =gUnknown_082F05E0 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x1C] str r1, [sp, 0x20] cmp r2, 0 bne @08018A80 ldr r0, =gUnknown_082F0608 b @08018A82 .align 2, 0 .pool @08018A80: ldr r0, =gUnknown_082F0620 @08018A82: str r0, [sp, 0x4] add r0, sp, 0x4 bl sub_81DB41C adds r3, r0, 0 movs r0, 0x1 ands r0, r3 cmp r0, 0 beq @08018A96 adds r3, 0x1 @08018A96: lsls r1, r3, 24 ldr r0, =0x00ffffff ldr r2, [sp, 0x1C] ands r2, r0 orrs r2, r1 str r2, [sp, 0x1C] cmp r3, 0x1D bgt @08018ACC movs r0, 0x1E subs r0, r3 lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 lsls r0, 24 lsrs r0, 16 ldr r1, =0xffff00ff ands r1, r2 orrs r1, r0 str r1, [sp, 0x1C] b @08018AD2 .align 2, 0 .pool @08018ACC: ldr r0, =0xffff00ff ands r2, r0 str r2, [sp, 0x1C] @08018AD2: add r0, sp, 0x1C movs r1, 0xE0 str r1, [sp] add r1, sp, 0x4 movs r2, 0x1 movs r3, 0xA bl 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 .pool thumb_func_end sub_8018A50 thumb_func_start sub_8018B08 sub_8018B08: ; 8018B08 push {r4-r6,lr} sub sp, 0x1C adds r5, r0, 0 adds r4, r1, 0 adds r1, r3, 0 lsls r2, 24 lsrs r6, r2, 24 ldrb r0, [r5] cmp r0, 0x1 beq @08018B98 cmp r0, 0x1 bgt @08018B26 cmp r0, 0 beq @08018B30 b @08018C3E @08018B26: cmp r0, 0x2 beq @08018BE4 cmp r0, 0xFF beq @08018C1A b @08018C3E @08018B30: ldr r0, =0x02021fc4 bl ExpandTextCodes cmp r6, 0 bne @08018B48 ldr r0, =gUnknown_082F05C8 b @08018B4A .align 2, 0 .pool @08018B48: ldr r0, =gUnknown_082F05D0 @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, =gUnknown_082F0728 str r1, [sp, 0x8] str r2, [sp, 0xC] ldr r1, =0x02021fc4 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 .pool @08018B98: ldr r0, =gUnknown_082F05E8 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x14] str r1, [sp, 0x18] cmp r6, 0 bne @08018BBC ldr r0, =0xff00ffff ldr r1, [sp, 0x14] ands r1, r0 movs r0, 0x90 lsls r0, 12 b @08018BC6 .align 2, 0 .pool @08018BBC: ldr r0, =0xff00ffff ldr r1, [sp, 0x14] ands r1, r0 movs r0, 0xF0 lsls r0, 12 @08018BC6: orrs r1, r0 str r1, [sp, 0x14] add r0, sp, 0x14 movs r1, 0xA movs r2, 0xE movs r3, 0 bl sub_81996C0 @08018BD6: ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] b @08018C3E .align 2, 0 .pool @08018BE4: bl sub_8198C58 lsls r0, 24 asrs r6, r0, 24 movs r1, 0x80 lsls r1, 17 adds r0, r1 lsrs r0, 24 cmp r0, 0x2 bhi @08018C3E movs r0, 0 strb r0, [r5] ldrb r0, [r4] bl rbox_fill_rectangle ldrb r0, [r4] bl 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, =0x02021fc4 ldr r1, =gUnknown_085EF2FC bl ExpandTextCodes b @08018C8C .align 2, 0 .pool @08018C84: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EF330 bl ExpandTextCodes @08018C8C: ldr r0, =gUnknown_082F05D8 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, =gUnknown_082F0728 str r1, [sp, 0x8] str r2, [sp, 0xC] ldr r1, =0x02021fc4 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 .pool @08018CE8: cmp r3, 0 beq @08018D10 cmp r2, 0 bne @08018D00 ldr r0, =gUnknown_082F05F8 ldr r1, =gUnknown_082F06C8 b @08018D28 .align 2, 0 .pool @08018D00: ldr r0, =gUnknown_082F0600 ldr r1, =gUnknown_082F06F8 b @08018D28 .align 2, 0 .pool @08018D10: cmp r2, 0 bne @08018D24 ldr r0, =gUnknown_082F05F0 ldr r1, =gUnknown_082F06B0 b @08018D28 .align 2, 0 .pool @08018D24: ldr r0, =gUnknown_082F05F8 ldr r1, =gUnknown_082F06E0 @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 .pool @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, =gUnknown_085EF55C b @08018E62 .align 2, 0 .pool @08018E60: ldr r3, =gUnknown_085EF520 @08018E62: movs r2, 0x1 bl sub_8018B08 lsls r0, 24 asrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8018E50 thumb_func_start mevent_message_was_thrown_away mevent_message_was_thrown_away: ; 8018E74 push {lr} cmp r1, 0 beq @08018E84 ldr r1, =gUnknown_085EF630 b @08018E86 .align 2, 0 .pool @08018E84: ldr r1, =gUnknown_085EF60C @08018E86: bl mevent_0814257C pop {r1} bx r1 .align 2, 0 .pool thumb_func_end mevent_message_was_thrown_away thumb_func_start mevent_save_game mevent_save_game: ; 8018E94 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0x4 bhi @08018F04 lsls r0, 2 ldr r1, =@08018EAC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08018EAC: .4byte @08018EC0 .4byte @08018ECC .4byte @08018ED4 .4byte @08018EE0 .4byte @08018EF8 @08018EC0: ldr r0, =gUnknown_085EF5BC bl sub_8018884 b @08018EEC .align 2, 0 .pool @08018ECC: movs r0, 0 bl save_game_when_memory_present b @08018EEC @08018ED4: ldr r0, =gUnknown_085EF5E0 bl sub_8018884 b @08018EEC .align 2, 0 .pool @08018EE0: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @08018F04 @08018EEC: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @08018F04 .align 2, 0 .pool @08018EF8: movs r0, 0 strb r0, [r4] bl sub_80188DC movs r0, 0x1 b @08018F06 @08018F04: movs r0, 0 @08018F06: pop {r4} pop {r1} bx r1 thumb_func_end mevent_save_game thumb_func_start mevent_message mevent_message: ; 8018F0C push {r4-r6,lr} adds r4, r0, 0 lsls r1, 24 lsrs r6, r1, 24 lsls r2, 24 lsrs r5, r2, 24 movs r2, 0 str r2, [r4] cmp r3, 0xE bls @08018F22 b @08019034 @08018F22: lsls r0, r3, 2 ldr r1, =@08018F30 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08018F30: .4byte @08018F6C .4byte @08018F78 .4byte @08018F84 .4byte @08018F9C .4byte @08018FB4 .4byte @08018FC0 .4byte @08018FCC .4byte @08018FD8 .4byte @08018FE4 .4byte @08018FF0 .4byte @08018FFC .4byte @08019014 .4byte @08019020 .4byte @0801902C .4byte @08019030 @08018F6C: movs r0, 0 str r0, [r4] ldr r2, =gUnknown_085EF2E4 b @08019034 .align 2, 0 .pool @08018F78: movs r0, 0 str r0, [r4] ldr r2, =gUnknown_085EF244 b @08019034 .align 2, 0 .pool @08018F84: movs r0, 0x1 str r0, [r4] ldr r2, =gUnknown_085EF0C8 cmp r5, 0 bne @08019034 ldr r2, =gUnknown_085EF124 b @08019034 .align 2, 0 .pool @08018F9C: movs r0, 0x1 str r0, [r4] ldr r2, =gUnknown_085EF0F4 cmp r5, 0 bne @08019034 ldr r2, =gUnknown_085EF14C b @08019034 .align 2, 0 .pool @08018FB4: movs r0, 0x1 str r0, [r4] ldr r2, =gUnknown_085EF178 b @08019034 .align 2, 0 .pool @08018FC0: movs r0, 0 str r0, [r4] ldr r2, =gUnknown_085EF1B4 b @08019034 .align 2, 0 .pool @08018FCC: movs r0, 0 str r0, [r4] ldr r2, =gUnknown_085EF200 b @08019034 .align 2, 0 .pool @08018FD8: movs r0, 0 str r0, [r4] ldr r2, =gUnknown_085EF1D8 b @08019034 .align 2, 0 .pool @08018FE4: movs r0, 0 str r0, [r4] ldr r2, =gUnknown_085EF21C b @08019034 .align 2, 0 .pool @08018FF0: movs r0, 0 str r0, [r4] ldr r2, =gUnknown_085EF02C b @08019034 .align 2, 0 .pool @08018FFC: movs r0, 0 str r0, [r4] ldr r2, =gUnknown_085EF2B4 cmp r6, 0 bne @08019034 ldr r2, =gUnknown_085EF280 b @08019034 .align 2, 0 .pool @08019014: movs r0, 0 str r0, [r4] ldr r2, =gUnknown_085EF014 b @08019034 .align 2, 0 .pool @08019020: movs r0, 0x1 str r0, [r4] ldr r2, =gUnknown_085EF198 b @08019034 .align 2, 0 .pool @0801902C: movs r0, 0x1 b @08019032 @08019030: movs r0, 0 @08019032: str r0, [r4] @08019034: adds r0, r2, 0 pop {r4-r6} pop {r1} bx r1 thumb_func_end mevent_message thumb_func_start mevent_08142CE8 mevent_08142CE8: ; 801903C push {r4-r6,lr} adds r6, r0, 0 adds r0, r1, 0 adds r5, r2, 0 ldrb r4, [r6] cmp r4, 0x1 beq @0801906E cmp r4, 0x1 bgt @08019054 cmp r4, 0 beq @0801905A b @0801909A @08019054: cmp r4, 0x2 beq @08019084 b @0801909A @0801905A: cmp r0, 0 beq @08019062 bl sub_8018884 @08019062: movs r0, 0xB9 lsls r0, 1 bl fanfare_play strh r4, [r5] b @0801907C @0801906E: ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] lsls r0, 16 lsrs r0, 16 cmp r0, 0xF0 bls @0801909A @0801907C: ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] b @0801909A @08019084: bl task_is_not_running_overworld_fanfare lsls r0, 24 cmp r0, 0 beq @0801909A movs r0, 0 strb r0, [r6] bl sub_80188DC movs r0, 0x1 b @0801909C @0801909A: movs r0, 0 @0801909C: pop {r4-r6} pop {r1} bx r1 thumb_func_end mevent_08142CE8 thumb_func_start mevent_message_stamp_card_etc_send_status mevent_message_stamp_card_etc_send_status: ; 80190A4 push {r4,lr} adds r3, r0, 0 ldr r1, =gUnknown_085EF014 movs r0, 0 str r0, [r3] adds r4, r1, 0 cmp r2, 0xE bhi @08019166 lsls r0, r2, 2 ldr r1, =@080190C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080190C8: .4byte @08019104 .4byte @0801910C .4byte @08019114 .4byte @0801911C .4byte @08019128 .4byte @08019130 .4byte @08019138 .4byte @08019140 .4byte @08019148 .4byte @08019150 .4byte @08019164 .4byte @08019158 .4byte @0801915C .4byte @0801915C .4byte @08019164 @08019104: ldr r1, =gUnknown_085EF2E4 b @08019166 .align 2, 0 .pool @0801910C: ldr r1, =gUnknown_085EF244 b @08019166 .align 2, 0 .pool @08019114: ldr r1, =gUnknown_085EF39C b @0801911E .align 2, 0 .pool @0801911C: ldr r1, =gUnknown_085EF3C4 @0801911E: movs r0, 0x1 str r0, [r3] b @08019166 .align 2, 0 .pool @08019128: ldr r1, =gUnknown_085EF3F0 b @08019166 .align 2, 0 .pool @08019130: ldr r1, =gUnknown_085EF42C b @08019166 .align 2, 0 .pool @08019138: ldr r1, =gUnknown_085EF494 b @08019166 .align 2, 0 .pool @08019140: ldr r1, =gUnknown_085EF460 b @08019166 .align 2, 0 .pool @08019148: ldr r1, =gUnknown_085EF21C b @08019166 .align 2, 0 .pool @08019150: ldr r1, =gUnknown_085EF4C4 b @08019166 .align 2, 0 .pool @08019158: adds r1, r4, 0 b @08019166 @0801915C: ldr r1, =gUnknown_085EF410 b @08019166 .align 2, 0 .pool @08019164: ldr r1, =gUnknown_085EF4F0 @08019166: adds r0, r1, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end mevent_message_stamp_card_etc_send_status thumb_func_start sub_8019174 sub_8019174: ; 8019174 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 adds r1, r2, 0 adds r2, r3, 0 lsls r1, 24 lsrs r1, 24 mov r0, sp bl mevent_message_stamp_card_etc_send_status adds r1, r0, 0 ldr r0, [sp] cmp r0, 0 bne @0801919A adds r0, r4, 0 bl mevent_0814257C b @080191A2 @0801919A: adds r0, r4, 0 adds r2, r5, 0 bl mevent_08142CE8 @080191A2: add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8019174 thumb_func_start task_add_00_mystery_gift task_add_00_mystery_gift: ; 80191AC push {r4,lr} ldr r0, =task00_mystery_gift movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 movs r0, 0 strb r0, [r4, 0x8] strb r0, [r4, 0x9] strb r0, [r4, 0xA] strb r0, [r4, 0xB] strb r0, [r4, 0xC] strb r0, [r4, 0xD] movs r1, 0 strh r0, [r4] strh r0, [r4, 0x2] strh r0, [r4, 0x4] strh r0, [r4, 0x6] strb r1, [r4, 0xE] movs r0, 0x40 bl malloc_and_clear str r0, [r4, 0x10] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_add_00_mystery_gift thumb_func_start task00_mystery_gift task00_mystery_gift: ; 80191F4 push {r4,r5,lr} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 ldrb r0, [r5, 0x8] cmp r0, 0x25 bls @0801920E b @08019922 @0801920E: lsls r0, 2 ldr r1, =@08019220 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08019220: .4byte @080192B8 .4byte @080192BE .4byte @08019300 .4byte @08019338 .4byte @0801935C .4byte @080193AC .4byte @0801940C .4byte @08019444 .4byte @08019454 .4byte @080194CC .4byte @080194F0 .4byte @08019508 .4byte @08019538 .4byte @08019574 .4byte @0801958C .4byte @080195BC .4byte @080198EC .4byte @0801961A .4byte @0801962A .4byte @08019922 .4byte @0801963C .4byte @08019688 .4byte @080196FE .4byte @0801972E .4byte @08019764 .4byte @0801977E .4byte @08019792 .4byte @0801979E .4byte @080197B2 .4byte @080197C6 .4byte @080197F8 .4byte @0801982C .4byte @08019870 .4byte @08019884 .4byte @080198A0 .4byte @080198B8 .4byte @080198EC .4byte @0801990C @080192B8: movs r0, 0x1 strb r0, [r5, 0x8] b @08019922 @080192BE: adds r0, r5, 0 adds r0, 0x9 adds r1, r5, 0 movs r2, 0 bl sub_8018A50 adds r1, r0, 0 cmp r1, 0x1 beq @080192E8 cmp r1, 0x1 bcc @080192DE movs r0, 0x2 negs r0, r0 cmp r1, r0 beq @080192FA b @08019922 @080192DE: movs r0, 0 strb r0, [r5, 0xC] bl sub_801B27C b @080192EE @080192E8: strb r1, [r5, 0xC] bl sub_801B0CC @080192EE: cmp r0, 0x1 bne @080192F4 b @08019820 @080192F4: movs r0, 0x2 strb r0, [r5, 0x8] b @08019922 @080192FA: movs r0, 0x25 strb r0, [r5, 0x8] b @08019922 @08019300: ldrb r0, [r5, 0xC] cmp r0, 0 bne @08019314 adds r0, r5, 0 adds r0, 0x9 ldr r1, =gUnknown_085EEEF0 b @0801931A .align 2, 0 .pool @08019314: adds r0, r5, 0 adds r0, 0x9 ldr r1, =gUnknown_085EEF2C @0801931A: bl mevent_0814257C cmp r0, 0 bne @08019324 b @08019922 @08019324: movs r0, 0x3 strb r0, [r5, 0x8] movs r0, 0 movs r1, 0x1 bl sub_80186EC b @08019922 .align 2, 0 .pool @08019338: ldrb r0, [r5, 0xC] cmp r0, 0 bne @0801934C ldr r0, =gUnknown_085EEF68 bl sub_8018884 b @08019352 .align 2, 0 .pool @0801934C: ldr r0, =gUnknown_085EEF94 bl sub_8018884 @08019352: movs r0, 0x4 strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @0801935C: adds r0, r5, 0 adds r0, 0x9 adds r1, r5, 0 movs r2, 0x1 bl sub_8018A50 adds r4, r0, 0 cmp r4, 0x1 beq @0801938A cmp r4, 0x1 bcc @0801937C movs r0, 0x2 negs r0, r0 cmp r4, r0 beq @08019396 b @08019922 @0801937C: bl sub_80188DC movs r1, 0 movs r0, 0x5 strb r0, [r5, 0x8] strb r1, [r5, 0xD] b @08019922 @0801938A: bl sub_80188DC movs r0, 0x5 strb r0, [r5, 0x8] strb r4, [r5, 0xD] b @08019922 @08019396: bl sub_80188DC ldrb r0, [r5, 0xC] bl sub_8018D98 cmp r0, 0 beq @080193A6 b @08019820 @080193A6: strb r0, [r5, 0x8] movs r0, 0 b @080198FE @080193AC: ldr r0, =0x02021cc4 movs r1, 0xFF strb r1, [r0] ldr r0, =0x02021dc4 strb r1, [r0] ldr r0, =0x02021ec4 strb r1, [r0] ldrb r0, [r5, 0xC] cmp r0, 0 beq @080193D4 cmp r0, 0x1 beq @080193EE b @08019406 .align 2, 0 .pool @080193D4: ldrb r0, [r5, 0xD] cmp r0, 0x1 bne @080193E2 movs r0, 0x15 bl sub_8014EFC b @08019406 @080193E2: cmp r0, 0 bne @08019406 movs r0, 0x15 bl sub_80152A8 b @08019406 @080193EE: ldrb r0, [r5, 0xD] cmp r0, 0x1 bne @080193FC movs r0, 0x16 bl sub_8014EFC b @08019406 @080193FC: cmp r0, 0 bne @08019406 movs r0, 0x16 bl sub_80152A8 @08019406: movs r0, 0x6 strb r0, [r5, 0x8] b @08019922 @0801940C: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0801942C movs r0, 0x1 bl sub_8018838 movs r0, 0x7 strb r0, [r5, 0x8] ldrb r0, [r5, 0xC] bl sub_801D484 b @08019922 .align 2, 0 .pool @0801942C: ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0x5 beq @08019436 b @08019922 @08019436: movs r0, 0x1 bl sub_8018838 b @080197C0 .align 2, 0 .pool @08019444: ldr r0, =gUnknown_085EEFE8 bl sub_8018884 movs r0, 0x8 strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @08019454: adds r0, r5, 0 bl sub_801D4A8 subs r0, 0x2 cmp r0, 0x4 bls @08019462 b @08019922 @08019462: lsls r0, 2 ldr r1, =@08019470 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08019470: .4byte @080194AE .4byte @080194A8 .4byte @080194B4 .4byte @08019492 .4byte @08019484 @08019484: bl task_add_05_task_del_08FA224_when_no_RfuFunc ldrh r0, [r5] strb r0, [r5, 0xE] movs r0, 0xD strb r0, [r5, 0x8] b @08019922 @08019492: ldr r4, [r5, 0x10] bl sub_801D4F4 adds r1, r0, 0 adds r0, r4, 0 movs r2, 0x40 bl memcpy bl sub_801D4E4 b @08019922 @080194A8: movs r0, 0xA strb r0, [r5, 0x8] b @08019922 @080194AE: movs r0, 0x9 strb r0, [r5, 0x8] b @08019922 @080194B4: movs r0, 0xB strb r0, [r5, 0x8] ldr r0, =0x02021cc4 ldr r1, =0x020229f0 bl gf_strcpy b @08019922 .align 2, 0 .pool @080194CC: adds r4, r5, 0 adds r4, 0x9 bl sub_801D4F4 adds r3, r0, 0 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 bl sub_8018B08 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0x1 beq @08019564 cmp r1, 0x1 bcs @08019552 movs r0, 0 b @08019566 @080194F0: adds r4, r5, 0 adds r4, 0x9 bl sub_801D4F4 adds r1, r0, 0 adds r0, r4, 0 bl mevent_0814257C cmp r0, 0 bne @08019506 b @08019922 @08019506: b @0801956A @08019508: adds r0, r5, 0 adds r0, 0x9 ldr r3, =gUnknown_085EF050 adds r1, r5, 0 movs r2, 0 bl sub_8018B08 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0x1 beq @08019564 cmp r1, 0x1 bcs @08019552 bl sub_801B3F8 cmp r0, 0x1 bne @08019534 movs r0, 0xC strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @08019534: movs r0, 0 b @08019566 @08019538: adds r0, r5, 0 adds r0, 0x9 ldr r3, =gUnknown_085EF084 adds r1, r5, 0 movs r2, 0 bl sub_8018B08 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0x1 beq @08019564 cmp r1, 0x1 bcc @08019560 @08019552: movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08019564 b @08019922 .align 2, 0 .pool @08019560: movs r0, 0 b @08019566 @08019564: movs r0, 0x1 @08019566: bl sub_801D500 @0801956A: bl sub_801D4E4 movs r0, 0x7 strb r0, [r5, 0x8] b @08019922 @08019574: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0801957E b @08019922 @0801957E: bl sub_800E084 movs r0, 0xE strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @0801958C: adds r0, r5, 0 adds r0, 0x9 ldr r1, =gUnknown_085EEFF8 bl sub_8018A1C cmp r0, 0 bne @0801959C b @08019922 @0801959C: ldrb r0, [r5, 0xD] cmp r0, 0x1 bne @080195AA ldr r0, =0x02021cc4 ldr r1, =0x020229f0 bl gf_strcpy @080195AA: movs r0, 0xF strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @080195BC: ldrb r1, [r5, 0xC] ldrb r2, [r5, 0xD] ldrb r3, [r5, 0xE] mov r0, sp bl mevent_message adds r1, r0, 0 cmp r1, 0 bne @080195D0 ldr r1, [r5, 0x10] @080195D0: ldr r0, [sp] cmp r0, 0 beq @080195E2 adds r0, r5, 0 adds r0, 0x9 adds r2, r5, 0 bl mevent_08142CE8 b @080195EA @080195E2: adds r0, r5, 0 adds r0, 0x9 bl mevent_0814257C @080195EA: adds r1, r0, 0 cmp r1, 0 bne @080195F2 b @08019922 @080195F2: ldrb r0, [r5, 0xE] cmp r0, 0x3 bne @0801960C ldrb r0, [r5, 0xD] cmp r0, 0x1 bne @08019606 movs r0, 0x1 bl sub_801DB68 b @0801960C @08019606: movs r0, 0x2 bl sub_801DB68 @0801960C: ldr r0, [sp] cmp r0, 0 beq @08019614 b @080198DC @08019614: strb r0, [r5, 0x8] movs r0, 0 b @080198FE @0801961A: adds r0, r5, 0 adds r0, 0x9 bl mevent_save_game cmp r0, 0 bne @08019628 b @08019922 @08019628: b @08019820 @0801962A: adds r0, r5, 0 adds r0, 0x9 ldrb r1, [r5, 0xC] bl sub_8018DAC cmp r0, 0 bne @0801963A b @08019922 @0801963A: b @080196F8 @0801963C: ldrb r0, [r5, 0xC] cmp r0, 0 bne @08019664 ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08019652 movs r0, 0x15 strb r0, [r5, 0x8] @08019652: ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0801965E b @08019922 @0801965E: b @08019682 .align 2, 0 .pool @08019664: ldr r0, =0x030022c0 ldrh r0, [r0, 0x2E] bl sub_801CCD0 cmp r0, 0 beq @0801967C cmp r0, 0x1 beq @08019682 b @08019922 .align 2, 0 .pool @0801967C: bl sub_801CC38 b @0801975E @08019682: movs r0, 0x1B strb r0, [r5, 0x8] b @08019922 @08019688: ldrb r0, [r5, 0xC] cmp r0, 0 bne @080196A2 bl sub_801B308 cmp r0, 0 beq @080196B6 adds r0, r5, 0 adds r0, 0x9 ldrb r2, [r5, 0xC] adds r1, r5, 0 movs r3, 0 b @080196C0 @080196A2: bl sub_801B128 cmp r0, 0 beq @080196B6 adds r0, r5, 0 adds r0, 0x9 ldrb r2, [r5, 0xC] adds r1, r5, 0 movs r3, 0 b @080196C0 @080196B6: adds r0, r5, 0 adds r0, 0x9 ldrb r2, [r5, 0xC] adds r1, r5, 0 movs r3, 0x1 @080196C0: bl sub_8018C4C adds r1, r0, 0 cmp r1, 0x1 beq @080196E2 cmp r1, 0x1 bcc @080196DC cmp r1, 0x2 beq @080196E8 movs r0, 0x2 negs r0, r0 cmp r1, r0 beq @080196EE b @08019922 @080196DC: movs r0, 0x1C strb r0, [r5, 0x8] b @08019922 @080196E2: movs r0, 0x1D strb r0, [r5, 0x8] b @08019922 @080196E8: movs r0, 0x16 strb r0, [r5, 0x8] b @08019922 @080196EE: ldrb r0, [r5, 0xC] cmp r0, 0x1 bne @080196F8 bl sub_801CC80 @080196F8: movs r0, 0x14 strb r0, [r5, 0x8] b @08019922 @080196FE: adds r0, r5, 0 adds r0, 0x9 ldrb r2, [r5, 0xC] adds r1, r5, 0 bl sub_8018E50 adds r1, r0, 0 cmp r1, 0 beq @0801971A cmp r1, 0 ble @08019748 cmp r1, 0x1 beq @0801975E b @08019922 @0801971A: ldrb r0, [r5, 0xC] cmp r0, 0 bne @08019758 bl sub_801B3F8 cmp r0, 0x1 bne @08019758 movs r0, 0x17 strb r0, [r5, 0x8] b @08019922 @0801972E: adds r0, r5, 0 adds r0, 0x9 ldr r3, =gUnknown_085EF584 adds r1, r5, 0 movs r2, 0x1 bl sub_8018B08 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0x1 beq @0801975E cmp r1, 0x1 bcc @08019758 @08019748: movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0801975E b @08019922 .align 2, 0 .pool @08019758: movs r0, 0x18 strb r0, [r5, 0x8] b @08019922 @0801975E: movs r0, 0x15 strb r0, [r5, 0x8] b @08019922 @08019764: ldrb r0, [r5, 0xC] movs r1, 0x1 bl sub_8018E20 cmp r0, 0 bne @08019772 b @08019922 @08019772: ldrb r0, [r5, 0xC] bl sub_8018E08 movs r0, 0x19 strb r0, [r5, 0x8] b @08019922 @0801977E: adds r0, r5, 0 adds r0, 0x9 bl mevent_save_game cmp r0, 0 bne @0801978C b @08019922 @0801978C: movs r0, 0x1A strb r0, [r5, 0x8] b @08019922 @08019792: adds r0, r5, 0 adds r0, 0x9 ldrb r1, [r5, 0xC] bl mevent_message_was_thrown_away b @080198F6 @0801979E: ldrb r0, [r5, 0xC] movs r1, 0 bl sub_8018E20 cmp r0, 0 bne @080197AC b @08019922 @080197AC: movs r0, 0 strb r0, [r5, 0x8] b @08019922 @080197B2: ldrb r0, [r5, 0xC] movs r1, 0x1 bl sub_8018E20 cmp r0, 0 bne @080197C0 b @08019922 @080197C0: movs r0, 0x3 strb r0, [r5, 0x8] b @08019922 @080197C6: ldrb r0, [r5, 0xC] movs r1, 0x1 bl sub_8018E20 cmp r0, 0 bne @080197D4 b @08019922 @080197D4: ldrb r0, [r5, 0xC] cmp r0, 0 beq @080197E0 cmp r0, 0x1 beq @080197E8 b @080197EE @080197E0: movs r0, 0x15 bl sub_8014A00 b @080197EE @080197E8: movs r0, 0x16 bl sub_8014A00 @080197EE: movs r0, 0x1 strb r0, [r5, 0xD] movs r0, 0x1E strb r0, [r5, 0x8] b @08019922 @080197F8: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08019810 movs r0, 0x1 bl sub_8018838 movs r0, 0x1F strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @08019810: ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0x5 beq @0801981A b @08019922 @0801981A: movs r0, 0x1 bl sub_8018838 @08019820: movs r0, 0x12 strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @0801982C: ldr r0, =0x02021cc4 movs r1, 0xFF strb r1, [r0] ldr r0, =0x02021dc4 strb r1, [r0] ldr r0, =0x02021ec4 strb r1, [r0] ldrb r0, [r5, 0xC] cmp r0, 0 bne @0801985C ldr r0, =gUnknown_085EF360 bl sub_8018884 bl sub_801D0A0 b @08019866 .align 2, 0 .pool @0801985C: ldr r0, =gUnknown_085EF37C bl sub_8018884 bl sub_801D07C @08019866: movs r0, 0x20 strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @08019870: adds r0, r5, 0 bl sub_801D0C4 cmp r0, 0x3 bne @08019922 ldrh r0, [r5] strb r0, [r5, 0xE] movs r0, 0x21 strb r0, [r5, 0x8] b @08019922 @08019884: bl task_add_05_task_del_08FA224_when_no_RfuFunc ldr r0, =0x02021cc4 ldr r1, =0x02022a0c bl gf_strcpy movs r0, 0x22 strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @080198A0: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08019922 bl sub_800E084 movs r0, 0x23 strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @080198B8: adds r0, r5, 0 adds r0, 0x9 ldrb r2, [r5, 0xD] ldrb r3, [r5, 0xE] adds r1, r5, 0 bl sub_8019174 cmp r0, 0 beq @08019922 ldr r0, [r5, 0xC] ldr r1, =0x00ffff00 ands r0, r1 ldr r1, =0x00030100 cmp r0, r1 bne @080198FA movs r0, 0x3 bl sub_801DB68 @080198DC: movs r0, 0x11 strb r0, [r5, 0x8] b @08019922 .align 2, 0 .pool @080198EC: adds r0, r5, 0 adds r0, 0x9 ldr r1, =gUnknown_085EF014 bl mevent_0814257C @080198F6: cmp r0, 0 beq @08019922 @080198FA: movs r0, 0 strb r0, [r5, 0x8] @080198FE: movs r1, 0 bl sub_80186EC b @08019922 .align 2, 0 .pool @0801990C: bl sub_80097E8 ldr r0, [r5, 0x10] bl free adds r0, r4, 0 bl remove_task ldr r0, =sub_80186A4 bl set_callback2 @08019922: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task00_mystery_gift thumb_func_start sub_8019930 sub_8019930: ; 8019930 ldr r0, =0x000001a9 bx lr .align 2, 0 .pool thumb_func_end sub_8019930 thumb_func_start bgid_upload_textbox_1 bgid_upload_textbox_1: ; 8019938 push {lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_082F0568 movs r2, 0x80 lsls r2, 1 movs r3, 0 str r3, [sp] bl copy_decompressed_tile_data_to_vram_autofree add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bgid_upload_textbox_1 thumb_func_start is_walking_or_running is_walking_or_running: ; 8019958 push {lr} ldr r0, =0x02037590 ldrb r0, [r0, 0x3] cmp r0, 0x2 beq @08019966 cmp r0, 0 bne @08019970 @08019966: movs r0, 0x1 b @08019972 .align 2, 0 .pool @08019970: movs r0, 0 @08019972: pop {r1} bx r1 thumb_func_end is_walking_or_running thumb_func_start sub_8019978 sub_8019978: ; 8019978 ldr r3, =gUnknown_082F072C movs r2, 0x7 ands r2, r1 lsls r1, r0, 2 adds r1, r0 lsls r1, 1 adds r2, r1 adds r2, r3 ldrb r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_8019978 thumb_func_start sub_8019990 sub_8019990: ; 8019990 push {r4-r6,lr} mov r6, r8 push {r6} ldr r4, =gUnknown_082F0740 mov r8, r4 lsls r0, 2 adds r4, r0, r4 movs r6, 0 ldrsh r5, [r4, r6] ldr r6, =gUnknown_082F0760 lsls r1, 1 adds r4, r1, r6 ldrb r4, [r4] lsls r4, 24 asrs r4, 24 adds r5, r4 adds r5, 0x7 str r5, [r2] movs r2, 0x2 add r8, r2 add r0, r8 movs r4, 0 ldrsh r0, [r0, r4] adds r6, 0x1 adds r1, r6 ldrb r1, [r1] lsls r1, 24 asrs r1, 24 adds r0, r1 adds r0, 0x7 str r0, [r3] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8019990 thumb_func_start sub_80199E0 sub_80199E0: ; 80199E0 push {r4-r7,lr} mov r12, r3 ldr r7, =gUnknown_082F0740 lsls r5, r0, 2 adds r0, r5, r7 movs r4, 0 ldrsh r3, [r0, r4] ldr r6, =gUnknown_082F0760 lsls r4, r1, 1 adds r0, r4, r6 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 adds r3, r0 adds r3, 0x7 cmp r3, r2 bne @08019A28 adds r0, r7, 0x2 adds r0, r5, r0 movs r2, 0 ldrsh r1, [r0, r2] adds r0, r6, 0x1 adds r0, r4, r0 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 adds r1, r0 adds r1, 0x7 cmp r1, r12 bne @08019A28 movs r0, 0x1 b @08019A2A .align 2, 0 .pool @08019A28: movs r0, 0 @08019A2A: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80199E0 thumb_func_start sub_8019A30 sub_8019A30: ; 8019A30 push {lr} ldr r1, =0x000002bf adds r0, r1 lsls r0, 16 lsrs r0, 16 bl flag_check lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8019A30 thumb_func_start flag_set_x63 flag_set_x63: ; 8019A4C push {lr} ldr r1, =0x000002bf adds r0, r1 lsls r0, 16 lsrs r0, 16 bl flag_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end flag_set_x63 thumb_func_start flag_clear_x63 flag_clear_x63: ; 8019A64 push {lr} ldr r1, =0x000002bf adds r0, r1 lsls r0, 16 lsrs r0, 16 bl flag_clear pop {r0} bx r0 .align 2, 0 .pool thumb_func_end flag_clear_x63 thumb_func_start sub_8019A7C sub_8019A7C: ; 8019A7C push {lr} ldr r2, =0x00004010 adds r0, r2 lsls r0, 16 lsrs r0, 16 lsls r1, 16 lsrs r1, 16 bl var_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8019A7C thumb_func_start sub_8019A98 sub_8019A98: ; 8019A98 push {lr} ldr r1, =gUnknown_082F0774 adds r0, r1 ldrb r0, [r0] ldr r1, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl show_sprite pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8019A98 thumb_func_start sub_8019AB8 sub_8019AB8: ; 8019AB8 push {lr} ldr r1, =gUnknown_082F0774 adds r0, r1 ldrb r0, [r0] ldr r1, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl npc_hide_by_local_id_and_map pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8019AB8 thumb_func_start sub_8019AD8 sub_8019AD8: ; 8019AD8 push {r4,r5,lr} sub sp, 0x4 adds r5, r1, 0 ldr r1, =gUnknown_082F0774 adds r0, r1 ldrb r0, [r0] ldr r1, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] mov r3, sp bl 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, =0x02037350 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 .pool @08019B30: movs r0, 0 @08019B32: add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8019AD8 thumb_func_start sub_8019B3C sub_8019B3C: ; 8019B3C push {r4,lr} sub sp, 0x4 ldr r1, =gUnknown_082F0774 adds r0, r1 ldrb r0, [r0] ldr r1, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] mov r3, sp bl 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, =0x02037350 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 .pool @08019B84: bl script_env_2_is_enabled lsls r0, 24 cmp r0, 0 bne @08019B96 adds r0, r4, 0 bl npc_sync_anim_pause_bits b @08019B9C @08019B96: adds r0, r4, 0 bl sub_8097404 @08019B9C: movs r0, 0x1 @08019B9E: add sp, 0x4 pop {r4} pop {r1} bx r1 thumb_func_end sub_8019B3C thumb_func_start sub_8019BA8 sub_8019BA8: ; 8019BA8 push {lr} ldr r2, =0x02022c68 movs r1, 0 str r1, [r2] ldr r1, =0x02022c64 str r0, [r1] movs r1, 0 movs r2, 0x7 @08019BB8: strb r1, [r0] strb r1, [r0, 0x1] strb r1, [r0, 0x2] strb r1, [r0, 0x3] adds r0, 0x4 subs r2, 0x1 cmp r2, 0 bge @08019BB8 bl sub_8019DF4 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8019BA8 thumb_func_start sub_8019BDC sub_8019BDC: ; 8019BDC push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 movs r0, 0 ldrsb r0, [r5, r0] cmp r0, 0 beq @08019BF0 cmp r0, 0x1 beq @08019C10 b @08019C2E @08019BF0: ldr r1, =gUnknown_082F078C adds r0, r4, 0 bl sub_8019AD8 cmp r0, 0x1 bne @08019C2E adds r0, r4, 0 bl flag_set_x63 ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] b @08019C2E .align 2, 0 .pool @08019C10: adds r0, r4, 0 bl sub_8019B3C cmp r0, 0 beq @08019C2E adds r0, r4, 0 bl sub_8019AB8 adds r0, r4, 0 bl flag_set_x63 movs r0, 0 strb r0, [r5] movs r0, 0x1 b @08019C30 @08019C2E: movs r0, 0 @08019C30: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8019BDC thumb_func_start sub_8019C38 sub_8019C38: ; 8019C38 push {r4-r7,lr} sub sp, 0x4 adds r6, r0, 0 adds r5, r1, 0 adds r7, r2, 0 movs r0, 0 ldrsb r0, [r6, r0] cmp r0, 0x2 beq @08019CD4 cmp r0, 0x2 bgt @08019C54 cmp r0, 0 beq @08019C5A b @08019CE6 @08019C54: cmp r0, 0x3 beq @08019CBC b @08019CE6 @08019C5A: bl is_walking_or_running cmp r0, 0 beq @08019CE6 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl 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, =gUnknown_082F078E adds r0, r5, 0 bl sub_8019AD8 cmp r0, 0x1 bne @08019CE6 ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] b @08019CE6 .align 2, 0 .pool @08019CD4: adds r0, r5, 0 bl sub_8019B3C cmp r0, 0 beq @08019CE6 movs r0, 0 strb r0, [r6] movs r0, 0x1 b @08019CE8 @08019CE6: movs r0, 0 @08019CE8: add sp, 0x4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8019C38 thumb_func_start sub_8019CF0 sub_8019CF0: ; 8019CF0 push {r4,lr} ldr r3, =0x02022c64 lsls r0, 2 ldr r4, [r3] adds r4, r0 movs r0, 0x1 strb r0, [r4, 0x3] adds r0, r1, 0 adds r1, r2, 0 bl sub_8019978 strb r0, [r4, 0x1] ldrb r0, [r4] cmp r0, 0 beq @08019D18 movs r0, 0 b @08019D1A .align 2, 0 .pool @08019D18: movs r0, 0x1 @08019D1A: pop {r4} pop {r1} bx r1 thumb_func_end sub_8019CF0 thumb_func_start AGBAssert AGBAssert: ; 8019D20 push {lr} ldr r1, =0x02022c64 lsls r0, 2 ldr r1, [r1] adds r1, r0 movs r0, 0x2 strb r0, [r1, 0x3] ldrb r0, [r1] cmp r0, 0x1 beq @08019D3C movs r0, 0 b @08019D3E .align 2, 0 .pool @08019D3C: movs r0, 0x1 @08019D3E: pop {r1} bx r1 thumb_func_end AGBAssert thumb_func_start sub_8019D44 sub_8019D44: ; 8019D44 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 ldrb r1, [r4] cmp r1, 0x1 beq @08019DA6 cmp r1, 0x1 bgt @08019D5A cmp r1, 0 beq @08019D64 b @08019DC6 @08019D5A: cmp r1, 0x2 beq @08019D70 cmp r1, 0x3 beq @08019DB4 b @08019DC6 @08019D64: ldrb r0, [r4, 0x3] cmp r0, 0x1 bne @08019DC6 movs r0, 0x2 strb r0, [r4] strb r1, [r4, 0x2] @08019D70: adds r0, r5, 0 movs r1, 0 bl sub_8019F8C adds r1, r0, 0 cmp r1, 0 bne @08019D96 ldrb r0, [r4, 0x3] cmp r0, 0x2 bne @08019D96 strb r1, [r4] strb r1, [r4, 0x2] adds r0, r5, 0 bl sub_8019AB8 adds r0, r5, 0 bl flag_set_x63 b @08019DC6 @08019D96: adds r0, r4, 0x2 adds r1, r5, 0 adds r2, r4, 0 bl sub_8019C38 cmp r0, 0x1 bne @08019DC6 b @08019DC4 @08019DA6: ldrb r0, [r4, 0x3] cmp r0, 0x2 bne @08019DC6 movs r1, 0 movs r0, 0x3 strb r0, [r4] strb r1, [r4, 0x2] @08019DB4: adds r0, r4, 0x2 adds r1, r5, 0 adds r2, r4, 0 bl sub_8019BDC cmp r0, 0x1 bne @08019DC6 movs r0, 0 @08019DC4: strb r0, [r4] @08019DC6: movs r0, 0 strb r0, [r4, 0x3] pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8019D44 thumb_func_start sub_8019DD0 sub_8019DD0: ; 8019DD0 push {r4,r5,lr} movs r4, 0 ldr r5, =0x02022c64 @08019DD6: lsls r0, r4, 2 ldr r1, [r5] adds r1, r0 adds r0, r4, 0 bl sub_8019D44 adds r4, 0x1 cmp r4, 0x7 ble @08019DD6 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8019DD0 thumb_func_start sub_8019DF4 sub_8019DF4: ; 8019DF4 push {r4,lr} ldr r4, =sub_8019DD0 adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08019E18 adds r0, r4, 0 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 b @08019E1A .align 2, 0 .pool @08019E18: movs r0, 0x10 @08019E1A: pop {r4} pop {r1} bx r1 thumb_func_end sub_8019DF4 thumb_func_start sub_8019E20 sub_8019E20: ; 8019E20 push {lr} ldr r0, =sub_8019DD0 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 cmp r0, 0xF bhi @08019E34 bl remove_task @08019E34: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8019E20 thumb_func_start sub_8019E3C sub_8019E3C: ; 8019E3C push {r4,lr} movs r4, 0 @08019E40: adds r0, r4, 0 bl sub_8019A30 cmp r0, 0 bne @08019E56 adds r0, r4, 0 bl sub_8019AB8 adds r0, r4, 0 bl flag_set_x63 @08019E56: adds r4, 0x1 cmp r4, 0x7 ble @08019E40 ldr r1, =0x02022c64 movs r0, 0 str r0, [r1] bl sub_8019E20 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8019E3C thumb_func_start sub_8019E70 sub_8019E70: ; 8019E70 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 str r0, [sp, 0x8] mov r9, r1 movs r7, 0 mov r0, r9 lsls r0, 2 mov r8, r0 ldr r0, =gUnknown_082F0740 mov r2, r8 adds r1, r2, r0 ldrh r1, [r1] mov r2, sp strh r1, [r2, 0xC] adds r0, 0x2 add r0, r8 ldrh r0, [r0] mov r10, r0 ldr r6, =gUnknown_082F0760 @08019E9E: mov r5, r8 add r5, r9 adds r5, r7 adds r4, r5, 0 subs r4, 0x38 lsls r4, 24 lsrs r4, 24 movs r2, 0 ldrsb r2, [r6, r2] mov r0, sp ldrh r0, [r0, 0xC] adds r2, r0, r2 lsls r2, 16 asrs r2, 16 movs r3, 0x1 ldrsb r3, [r6, r3] add r3, r10 lsls r3, 16 asrs r3, 16 movs r0, 0x3 str r0, [sp] movs r0, 0x1 str r0, [sp, 0x4] movs r0, 0x41 adds r1, r4, 0 bl sprite_new ldr r1, [sp, 0x8] adds r5, r1, r5 strb r0, [r5] adds r0, r4, 0 movs r1, 0x1 bl sub_8097C44 adds r6, 0x2 adds r7, 0x1 cmp r7, 0x4 ble @08019E9E add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8019E70 thumb_func_start sub_8019F04 sub_8019F04: ; 8019F04 push {r4-r6,lr} adds r5, r0, 0 movs r4, 0 ldr r6, =0x02020630 @08019F0C: adds r0, r5, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 bl obj_delete_and_free_tiles adds r4, 0x1 cmp r4, 0x27 ble @08019F0C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8019F04 thumb_func_start sub_8019F2C sub_8019F2C: ; 8019F2C push {r4-r7,lr} sub sp, 0x8 movs r5, 0 add r7, sp, 0x4 @08019F34: movs r4, 0 adds r6, r5, 0x1 @08019F38: adds r0, r5, 0 adds r1, r4, 0 mov r2, sp adds r3, r7, 0 bl sub_8019990 ldr r0, [sp] ldr r1, [sp, 0x4] movs r2, 0 bl sub_8088B94 adds r4, 0x1 cmp r4, 0x4 ble @08019F38 adds r5, r6, 0 cmp r5, 0x7 ble @08019F34 add sp, 0x8 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8019F2C thumb_func_start sub_8019F64 sub_8019F64: ; 8019F64 push {lr} adds r1, r0, 0 cmp r1, 0 beq @08019F78 ldr r0, =gUnknown_082F076F adds r0, r1, r0 ldrb r0, [r0] b @08019F88 .align 2, 0 .pool @08019F78: ldrb r1, [r2, 0xA] movs r0, 0x7F ands r0, r1 cmp r0, 0x45 beq @08019F86 movs r0, 0x4 b @08019F88 @08019F86: movs r0, 0x1 @08019F88: pop {r1} bx r1 thumb_func_end sub_8019F64 thumb_func_start sub_8019F8C sub_8019F8C: ; 8019F8C push {lr} adds r2, r0, 0 lsls r0, r2, 2 adds r0, r2 adds r0, r1 subs r0, 0x38 lsls r0, 24 lsrs r0, 24 bl sub_8097C8C pop {r1} bx r1 thumb_func_end sub_8019F8C thumb_func_start sub_8019FA4 sub_8019FA4: ; 8019FA4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x8 adds r5, r0, 0 adds r6, r1, 0 mov r9, r3 lsls r2, 24 lsrs r2, 24 mov r8, r2 lsls r0, r5, 2 adds r0, r5 adds r7, r0, r6 adds r0, r5, 0 bl sub_8019F8C cmp r0, 0x1 bne @08019FE2 adds r4, r7, 0 subs r4, 0x38 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 movs r1, 0 bl sub_8097C44 adds r0, r4, 0 movs r1, 0x1 bl sub_8097CC4 @08019FE2: adds r0, r7, 0 subs r0, 0x38 lsls r0, 24 lsrs r0, 24 mov r1, r8 bl sub_8097BB4 adds r0, r6, 0 adds r1, r5, 0 mov r2, r9 bl sub_8019F64 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r6, 0 adds r1, r5, 0 bl sub_801A3B0 add r3, sp, 0x4 adds r0, r5, 0 adds r1, r6, 0 mov r2, sp bl sub_8019990 ldr r0, [sp] ldr r1, [sp, 0x4] movs r2, 0x1 bl sub_8088B94 add sp, 0x8 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8019FA4 thumb_func_start sub_801A02C sub_801A02C: ; 801A02C push {r4,r5,lr} sub sp, 0x8 adds r4, r0, 0 adds r5, r1, 0 lsls r0, r4, 2 adds r0, r4 adds r0, r5 subs r0, 0x38 lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl sub_8097CC4 add r3, sp, 0x4 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_8019990 ldr r0, [sp] ldr r1, [sp, 0x4] movs r2, 0 bl sub_8088B94 add sp, 0x8 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801A02C thumb_func_start sub_801A064 sub_801A064: ; 801A064 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 adds r7, r0, 0 mov r8, r1 mov r6, sp adds r6, 0x2 mov r0, sp adds r1, r6, 0 bl 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, =@0801A18C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801A18C: .4byte @0801A1E0 .4byte @0801A200 .4byte @0801A20E .4byte @0801A20E .4byte @0801A200 .4byte @0801A200 .4byte @0801A20E .4byte @0801A20E .4byte @0801A200 .4byte @0801A20E .4byte @0801A20E .4byte @0801A20E .4byte @0801A20E .4byte @0801A20E .4byte @0801A20E .4byte @0801A20E .4byte @0801A20E .4byte @0801A200 .4byte @0801A200 .4byte @0801A200 .4byte @0801A1E0 @0801A1E0: ldrb r1, [r4, 0xB] lsls r1, 31 lsrs r1, 31 ldrb r2, [r4, 0x2] adds r0, r5, 0 bl sub_8019CF0 movs r4, 0 @0801A1F0: adds r0, r5, 0 adds r1, r4, 0 bl sub_801A02C adds r4, 0x1 cmp r4, 0x4 bls @0801A1F0 b @0801A20E @0801A200: adds r0, r5, 0 bl AGBAssert adds r0, r5, 0 adds r1, r4, 0 bl sub_801A064 @0801A20E: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801A16C thumb_func_start sub_801A214 sub_801A214: ; 801A214 push {r4,r5,lr} adds r5, r0, 0 bl AGBAssert movs r4, 0 @0801A21E: adds r0, r5, 0 adds r1, r4, 0 bl sub_801A02C adds r4, 0x1 cmp r4, 0x4 ble @0801A21E pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801A214 thumb_func_start sub_801A234 sub_801A234: ; 801A234 push {r4,r5,lr} ldr r2, =0x02022c68 movs r1, 0 str r1, [r2] movs r5, 0 ldr r4, [r0] @0801A240: ldrb r0, [r4, 0x1A] movs r1, 0x3 ands r1, r0 cmp r1, 0x1 bne @0801A258 adds r0, r5, 0 adds r1, r4, 0 bl sub_801A16C b @0801A264 .align 2, 0 .pool @0801A258: cmp r1, 0x2 bne @0801A264 adds r0, r5, 0 adds r1, r4, 0 bl sub_801A214 @0801A264: adds r4, 0x20 adds r5, 0x1 cmp r5, 0x7 ble @0801A240 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801A234 thumb_func_start sub_801A274 sub_801A274: ; 801A274 ldr r1, =0x02022c68 movs r0, 0x96 lsls r0, 1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_801A274 thumb_func_start sub_801A284 sub_801A284: ; 801A284 push {lr} adds r2, r0, 0 ldr r0, =0x02022c68 ldr r1, [r0] adds r1, 0x1 str r1, [r0] movs r0, 0x96 lsls r0, 1 cmp r1, r0 bls @0801A29E adds r0, r2, 0 bl sub_801A234 @0801A29E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801A284 thumb_func_start sub_801A2A8 sub_801A2A8: ; 801A2A8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 adds r5, r0, 0 str r1, [sp, 0x4] str r2, [sp, 0x8] bl is_walking_or_running cmp r0, 0 bne @0801A2F0 b @0801A396 @0801A2C4: ldr r4, =gUnknown_082F076A bl player_get_direction__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 .pool @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, =gUnknown_082F0740 adds r7, r5, 0 movs r1, 0 mov r10, r1 adds r2, r0, 0x2 str r2, [sp, 0x10] str r0, [sp, 0x14] @0801A30E: movs r6, 0 ldr r4, [sp, 0x14] movs r0, 0 ldrsh r4, [r4, r0] mov r9, r4 ldr r1, [sp, 0x10] mov r8, r1 ldr r5, =gUnknown_082F0760 @0801A31E: mov r2, r10 adds r3, r2, r6 mov r0, sp movs r4, 0 ldrsh r1, [r0, r4] movs r0, 0 ldrsb r0, [r5, r0] add r0, r9 adds r0, 0x7 cmp r1, r0 bne @0801A372 mov r1, sp movs r2, 0x2 ldrsh r0, [r1, r2] mov r4, r8 movs r2, 0 ldrsh r1, [r4, r2] movs r2, 0x1 ldrsb r2, [r5, r2] adds r1, r2 adds r1, 0x7 cmp r0, r1 bne @0801A372 adds r0, r3, 0 subs r0, 0x38 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl sub_8097C8C cmp r0, 0 bne @0801A372 adds r0, r4, 0 bl sub_8097D9C cmp r0, 0 bne @0801A372 ldrb r1, [r7, 0x1A] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 beq @0801A2C4 @0801A372: adds r5, 0x2 adds r6, 0x1 cmp r6, 0x4 ble @0801A31E adds r7, 0x20 movs r4, 0x5 add r10, r4 ldr r0, [sp, 0x10] adds r0, 0x4 str r0, [sp, 0x10] ldr r1, [sp, 0x14] adds r1, 0x4 str r1, [sp, 0x14] ldr r2, [sp, 0xC] adds r2, 0x1 str r2, [sp, 0xC] cmp r2, 0x7 ble @0801A30E @0801A396: movs r0, 0 @0801A398: add sp, 0x18 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801A2A8 thumb_func_start sub_801A3B0 sub_801A3B0: ; 801A3B0 push {r4,lr} adds r4, r0, 0 adds r3, r1, 0 lsls r1, r2, 24 lsrs r1, 24 lsls r0, r3, 2 adds r0, r3 subs r0, 0x38 adds r0, r4 lsls r0, 24 lsrs r0, 24 bl sub_8097B78 pop {r4} pop {r0} bx r0 thumb_func_end sub_801A3B0 thumb_func_start sub_801A3D0 sub_801A3D0: ; 801A3D0 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 lsls r3, r4, 5 adds r3, r2 adds r2, r3, 0 bl sub_8019F64 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r5, 0 adds r1, r4, 0 bl sub_801A3B0 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801A3D0 thumb_func_start sub_801A3F4 sub_801A3F4: ; 801A3F4 push {lr} bl 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, =sub_801A43C bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801A42C thumb_func_start sub_801A43C sub_801A43C: ; 801A43C push {r4,r5,lr} sub sp, 0xC movs r0, 0 movs r1, 0 bl lcd_io_set ldr r5, =0x03000dac 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, =gUnknown_082F0D34 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, =gUnknown_082F0990 movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree ldr r1, =gUnknown_082F0BA0 movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r0, =gUnknown_082F0D3C 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, =sub_801A418 bl SetVBlankCallback ldr r0, =sub_801A6C0 movs r1, 0 bl AddTask ldr r1, [r5] adds r1, 0x60 strb r0, [r1] bl sub_8013C40 ldr r1, [r5] adds r1, 0x61 strb r0, [r1] ldr r1, [r5] movs r0, 0x1 str r0, [r1, 0x1C] movs r0, 0 movs r1, 0 movs r2, 0 bl 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, =gUnknown_082F0790 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply movs r0, 0xF0 bl sub_81978B0 bl sub_81AFBF0 movs r0, 0x20 str r0, [sp] str r0, [sp, 0x4] movs r0, 0xF str r0, [sp, 0x8] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl Bg_FillWramTileMapRectWithTileAndPalette movs r0, 0x1 bl gpu_copy_wram_bg_tilemap_to_vram ldr r0, =sub_801A3F4 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 .pool 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, =0x03000dac ldr r0, [r0] bl free ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801A584 thumb_func_start sub_801A5BC sub_801A5BC: ; 801A5BC push {lr} adds r2, r0, 0 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] lsls r0, 16 asrs r0, 16 cmp r0, 0x5 ble @0801A5E4 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] lsls r0, 16 asrs r0, 16 cmp r0, 0xE bne @0801A5E0 movs r0, 0 strh r0, [r1] @0801A5E0: movs r0, 0 strh r0, [r2] @0801A5E4: movs r2, 0 ldrsh r0, [r1, r2] adds r0, 0x2 lsls r0, 5 ldr r1, =gUnknown_082F0790 adds r0, r1 movs r1, 0 movs r2, 0x10 bl gpu_pal_apply pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801A5BC thumb_func_start sub_801A600 sub_801A600: ; 801A600 push {r4,r5,lr} sub sp, 0x8 movs r0, 0 movs r1, 0 bl Window_FastFillPixels movs r0, 0x1 movs r1, 0 bl Window_FastFillPixels movs r0, 0x2 movs r1, 0 bl Window_FastFillPixels ldr r5, =gUnknown_082F0D5C 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, =gUnknown_082F0D5C adds r0, r4, 0x1 lsls r0, 2 adds r0, r1 ldr r2, [r0] lsls r0, r4, 4 subs r0, r4 lsls r0, 25 movs r1, 0x80 lsls r1, 20 adds r0, r1 lsrs r0, 24 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 movs r1, 0x1 movs r3, 0 bl sub_801A8B0 movs r0, 0 bl 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 .pool thumb_func_end sub_801A600 thumb_func_start sub_801A6C0 sub_801A6C0: ; 801A6C0 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x8 lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r2, 0x8 ldrsh r0, [r0, r2] adds r2, r1, 0 cmp r0, 0x5 bls @0801A6E2 b @0801A89C @0801A6E2: lsls r0, 2 ldr r1, =@0801A6F4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801A6F4: .4byte @0801A70C .4byte @0801A728 .4byte @0801A74C .4byte @0801A768 .4byte @0801A85C .4byte @0801A884 @0801A70C: bl sub_801A600 ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0801A89C .align 2, 0 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0801A75A b @0801A89C @0801A75A: lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r2 b @0801A876 .align 2, 0 .pool @0801A768: ldr r0, =0x03000dac ldr r0, [r0] adds r1, r0, 0 adds r1, 0x10 adds r2, r0, 0 adds r2, 0x20 adds r3, r0, 0 adds r3, 0x61 ldrb r3, [r3] bl sub_801AA30 lsls r1, r5, 2 mov r8, r1 cmp r0, 0 beq @0801A7F8 movs r0, 0x2 movs r1, 0 bl Window_FastFillPixels movs r4, 0 ldr r6, =0x02021fc4 movs r7, 0x80 lsls r7, 20 @0801A796: ldr r0, =0x03000dac ldr r0, [r0] lsls r1, r4, 2 adds r0, r1 ldr r1, [r0] adds r0, r6, 0 movs r2, 0x1 movs r3, 0x2 bl 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 .pool @0801A7CC: movs r0, 0x62 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r1, 0x1 adds r2, r6, 0 movs r3, 0xC bl sub_801A8B0 @0801A7DE: movs r2, 0xF0 lsls r2, 21 adds r7, r2 adds r4, 0x1 cmp r4, 0x3 ble @0801A796 movs r0, 0x2 bl Window_WriteStandardTileMap movs r0, 0x2 movs r1, 0x3 bl Window_CopyToVram @0801A7F8: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0801A80C movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0801A836 @0801A80C: movs r0, 0x5 bl audio_play ldr r2, =0x03005e00 ldr r0, =0x03000dac ldr r0, [r0] adds r0, 0x61 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 movs r1, 0xFF strh r1, [r0, 0x26] mov r0, r8 adds r1, r0, r5 lsls r1, 3 adds r1, r2 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0801A836: mov r2, r8 adds r1, r2, r5 lsls r1, 3 ldr r0, =0x03005e08 adds r1, r0 adds r0, r1, 0 adds r0, 0xE adds r1, 0x10 bl sub_801A5BC b @0801A89C .align 2, 0 .pool @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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 @0801A876: ldrh r1, [r0, 0x8] adds r1, 0x1 strh r1, [r0, 0x8] b @0801A89C .align 2, 0 .pool @0801A884: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0801A89C ldr r0, =sub_801A584 bl 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 .pool thumb_func_end sub_801A6C0 thumb_func_start sub_801A8B0 sub_801A8B0: ; 801A8B0 push {r4-r7,lr} sub sp, 0x18 mov r12, r2 ldr r2, [sp, 0x2C] ldr r4, [sp, 0x30] lsls r0, 24 lsrs r7, r0, 24 lsls r1, 24 lsrs r6, r1, 24 lsls r3, 24 lsrs r5, r3, 24 lsls r2, 24 lsrs r3, r2, 24 lsls r4, 24 lsrs r0, r4, 24 cmp r0, 0x4 bhi @0801A93A lsls r0, 2 ldr r1, =@0801A8E0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801A8E0: .4byte @0801A8F4 .4byte @0801A902 .4byte @0801A910 .4byte @0801A91E .4byte @0801A92C @0801A8F4: add r1, sp, 0x14 movs r0, 0 strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] movs r0, 0x3 b @0801A938 @0801A902: add r1, sp, 0x14 movs r0, 0 strb r0, [r1] movs r0, 0x1 strb r0, [r1, 0x1] movs r0, 0x3 b @0801A938 @0801A910: add r1, sp, 0x14 movs r0, 0 strb r0, [r1] movs r0, 0x4 strb r0, [r1, 0x1] movs r0, 0x5 b @0801A938 @0801A91E: add r1, sp, 0x14 movs r0, 0 strb r0, [r1] movs r0, 0x7 strb r0, [r1, 0x1] movs r0, 0x6 b @0801A938 @0801A92C: add r1, sp, 0x14 movs r0, 0 strb r0, [r1] movs r0, 0x1 strb r0, [r1, 0x1] movs r0, 0x2 @0801A938: strb r0, [r1, 0x2] @0801A93A: movs r0, 0 str r0, [sp] str r0, [sp, 0x4] add r0, sp, 0x14 str r0, [sp, 0x8] movs r0, 0x1 negs r0, r0 str r0, [sp, 0xC] mov r0, r12 str r0, [sp, 0x10] adds r0, r7, 0 adds r1, r6, 0 adds r2, r5, 0 bl 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, =gUnknown_082F0D70 mov r9, r0 movs r1, 0x1 add r1, r9 mov r10, r1 mov r3, r12 adds r3, 0x4 str r3, [sp] @0801A98A: lsls r0, r4, 1 adds r2, r0, r4 mov r3, r9 adds r1, r2, r3 adds r5, r0, 0 adds r6, r4, 0x1 ldrb r1, [r1] cmp r8, r1 bne @0801A9EE mov r0, r12 ldrb r1, [r0, 0x1A] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @0801A9EE mov r0, r9 adds r0, 0x2 adds r3, r2, r0 ldrb r0, [r3] cmp r0, 0 bne @0801A9DC movs r2, 0 movs r1, 0 ldr r3, [sp] @0801A9BA: adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0 beq @0801A9C4 adds r2, 0x1 @0801A9C4: adds r1, 0x1 cmp r1, 0x3 ble @0801A9BA adds r2, 0x1 adds r0, r5, r4 add r0, r10 ldrb r1, [r0] lsls r1, 2 adds r1, r7 b @0801A9E8 .align 2, 0 .pool @0801A9DC: mov r1, r10 adds r0, r2, r1 ldrb r1, [r0] lsls r1, 2 adds r1, r7 ldrb r2, [r3] @0801A9E8: ldr r0, [r1] adds r0, r2 str r0, [r1] @0801A9EE: adds r4, r6, 0 cmp r4, 0x1E bls @0801A98A mov r0, r8 add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_801A960 thumb_func_start sub_801AA08 sub_801AA08: ; 801AA08 push {r4,lr} movs r4, 0 adds r3, r1, 0 adds r2, r0, 0 @0801AA10: ldr r1, [r2] ldr r0, [r3] cmp r1, r0 beq @0801AA1C movs r0, 0x1 b @0801AA28 @0801AA1C: adds r3, 0x4 adds r2, 0x4 adds r4, 0x1 cmp r4, 0x3 ble @0801AA10 movs r0, 0 @0801AA28: pop {r4} pop {r1} bx r1 thumb_func_end sub_801AA08 thumb_func_start sub_801AA30 sub_801AA30: ; 801AA30 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x10 adds r6, r0, 0 mov r9, r1 adds r5, r2, 0 lsls r4, r3, 24 lsrs r4, 24 movs r0, 0 mov r8, r0 mov r0, sp movs r1, 0 movs r2, 0x10 bl memset lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e08 adds r7, r0, r1 movs r4, 0 @0801AA5E: lsls r1, r4, 5 ldr r0, [r7] adds r0, r1 mov r1, sp bl sub_801A960 adds r1, r0, 0 ldr r0, [r5] cmp r1, r0 beq @0801AA78 str r1, [r5] movs r2, 0x1 mov r8, r2 @0801AA78: adds r5, 0x4 adds r4, 0x1 cmp r4, 0xF ble @0801AA5E mov r0, sp mov r1, r9 bl sub_801AA08 cmp r0, 0 bne @0801AA9C mov r3, r8 cmp r3, 0x1 beq @0801AAC4 movs r0, 0 b @0801AAC6 .align 2, 0 .pool @0801AA9C: adds r1, r6, 0 mov r0, sp ldm r0!, {r2-r4} stm r1!, {r2-r4} ldr r0, [r0] str r0, [r1] mov r1, r9 mov r0, sp ldm r0!, {r2-r4} stm r1!, {r2-r4} ldr r0, [r0] str r0, [r1] ldr r0, [r6] ldr r1, [r6, 0x4] adds r0, r1 ldr r1, [r6, 0x8] adds r0, r1 ldr r1, [r6, 0xC] adds r0, r1 str r0, [r6, 0xC] @0801AAC4: movs r0, 0x1 @0801AAC6: add sp, 0x10 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_801AA30 thumb_func_start sub_801AAD4 sub_801AAD4: ; 801AAD4 push {r4-r7,lr} movs r0, 0xA bl sub_8014210 movs r4, 0 movs r7, 0x64 ldr r6, =0x020244ec ldr r5, =0x02024744 @0801AAE4: ldr r0, =0x0203cef8 adds r0, r4, r0 ldrb r0, [r0] subs r0, 0x1 adds r1, r0, 0 muls r1, r7 adds r1, r6 adds r0, r5, 0 movs r2, 0x64 bl memcpy adds r5, 0x64 adds r4, 0x1 cmp r4, 0x1 ble @0801AAE4 ldr r4, =0x020244ec movs r0, 0xFA lsls r0, 1 adds r5, r4, r0 @0801AB0A: adds r0, r4, 0 bl zero_pokemon_struct adds r4, 0x64 cmp r4, r5 ble @0801AB0A ldr r4, =0x020244ec movs r5, 0 adds r6, r4, 0 adds r6, 0x64 @0801AB1E: ldr r1, =0x02024744 adds r1, r5, r1 adds r0, r4, 0 movs r2, 0x64 bl memcpy adds r4, 0x64 adds r5, 0x64 cmp r4, r6 ble @0801AB1E movs r0, 0x32 bl sav12_xor_increment bl calc_player_party_count ldr r0, =0x02038bca movs r2, 0xC0 lsls r2, 4 adds r1, r2, 0 strh r1, [r0] ldr r0, =sub_8036760 bl set_callback2 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801AAD4 thumb_func_start sub_801AB68 sub_801AB68: ; 801AB68 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 adds r5, r0, 0 adds r7, r1, 0 adds r6, r2, 0 ldr r4, [sp, 0x38] lsls r5, 24 lsrs r5, 24 lsls r6, 24 lsrs r6, 24 lsls r3, 24 lsrs r3, 24 movs r0, 0 mov r9, r0 movs r1, 0x1 mov r10, r1 ldr r0, =gUnknown_082F0DE4 mov r8, r0 ldrb r0, [r0] lsls r1, r0, 4 orrs r1, r0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 str r3, [sp, 0x14] bl 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 .pool thumb_func_end sub_801AB68 thumb_func_start sub_801ABDC sub_801ABDC: ; 801ABDC push {r4-r6,lr} sub sp, 0x4 adds r4, r0, 0 adds r6, r1, 0 adds r5, r2, 0 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0 beq @0801ABF4 cmp r0, 0x1 beq @0801AC22 b @0801AC36 @0801ABF4: movs r0, 0 movs r1, 0x1 movs r2, 0xD bl sub_8098858 str r5, [sp] movs r0, 0 adds r1, r6, 0 movs r2, 0 movs r3, 0x1 bl sub_801AB68 movs r0, 0 bl 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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0x33 bls @0801AC6A b @0801AFAE @0801AC6A: lsls r0, 2 ldr r1, =@0801AC7C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801AC7C: .4byte @0801AD4C .4byte @0801ADFC .4byte @0801AE24 .4byte @0801AE48 .4byte @0801AE98 .4byte @0801AFAE .4byte @0801AF7C .4byte @0801AF58 .4byte @0801AF7C .4byte @0801AF98 .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AFAE .4byte @0801AF24 .4byte @0801AF40 @0801AD4C: movs r0, 0 movs r1, 0 bl lcd_io_set ldr r4, =0x02022c6c 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, =gUnknown_082F0DD0 movs r0, 0 movs r2, 0x1 bl bg_vram_setup bl reset_temp_tile_data_buffers ldr r0, =gUnknown_082F0DD4 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, =sub_801AC40 bl SetVBlankCallback ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0801AF8A .align 2, 0 .pool @0801ADFC: ldr r0, =0x02022c6c ldr r0, [r0] ldr r1, =gUnknown_085EFBD2 movs r2, 0 bl sub_801ABDC cmp r0, 0 bne @0801AE0E b @0801AFAE @0801AE0E: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @0801AF8A .align 2, 0 .pool @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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0801AF8A .align 2, 0 .pool @0801AE48: bl fade_and_return_progress_probably lsls r0, 24 cmp r0, 0 beq @0801AE54 b @0801AFAE @0801AE54: ldr r4, =0x020228c4 adds r0, r4, 0 movs r1, 0 movs r2, 0x20 bl memset ldr r0, =0x0203cef8 ldrb r1, [r0] ldrb r0, [r0, 0x1] cmn r1, r0 bne @0801AE78 movs r0, 0x52 b @0801AE7A .align 2, 0 .pool @0801AE78: movs r0, 0x51 @0801AE7A: strb r0, [r4] ldr r1, =0x020228c4 movs r0, 0 movs r2, 0x20 bl link_0800A448 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @0801AF8A .align 2, 0 .pool @0801AE98: bl sub_800A550 lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 beq @0801AEA6 b @0801AFAE @0801AEA6: ldr r1, =0x020223c4 ldrh r0, [r1] cmp r0, 0x51 bne @0801AEE0 movs r2, 0x80 lsls r2, 1 adds r0, r1, r2 ldrh r0, [r0] cmp r0, 0x51 bne @0801AEE0 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x32 b @0801AF16 .align 2, 0 .pool @0801AEE0: bl sub_800AC34 ldr r4, =0x020223c4 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 16 adds r0, r4 ldrh r0, [r0] cmp r0, 0x52 bne @0801AF0C ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x6 b @0801AF16 .align 2, 0 .pool @0801AF0C: ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x8 @0801AF16: strb r1, [r0] bl sub_800A5B4 b @0801AFAE .align 2, 0 .pool @0801AF24: bl fade_and_return_progress_probably lsls r0, 24 cmp r0, 0 bne @0801AFAE bl sub_800ADF8 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @0801AF8A .align 2, 0 .pool @0801AF40: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801AFAE ldr r0, =sub_801AAD4 bl set_callback2 b @0801AFAE .align 2, 0 .pool @0801AF58: ldr r0, =0x02022c6c ldr r0, [r0] ldr r1, =gUnknown_085EFC27 movs r2, 0x1 bl sub_801ABDC cmp r0, 0 beq @0801AFAE ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 b @0801AFAE .align 2, 0 .pool @0801AF7C: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0801AFAE movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 @0801AF8A: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0801AFAE .align 2, 0 .pool @0801AF98: ldr r0, =0x02022c6c ldr r0, [r0] ldr r1, =gUnknown_085EFC0C movs r2, 0x1 bl sub_801ABDC cmp r0, 0 beq @0801AFAE ldr r0, =c2_exit_to_overworld_2_switch bl 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 .pool thumb_func_end sub_801AC54 thumb_func_start sub_801AFD8 sub_801AFD8: ; 801AFD8 push {lr} sub sp, 0x4 movs r0, 0 str r0, [sp] ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x0000322c adds r1, r0 ldr r2, =0x050000db mov r0, sp bl CpuSet bl sub_801B180 bl sub_811F8BC add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801AFD8 thumb_func_start sub_801B00C sub_801B00C: ; 801B00C ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003230 adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_801B00C thumb_func_start sav1_get_mevent_buffer_1 sav1_get_mevent_buffer_1: ; 801B020 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sav1_get_mevent_buffer_1 thumb_func_start sav1_get_mevent_buffer_2 sav1_get_mevent_buffer_2: ; 801B034 ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0xD5 lsls r1, 6 adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sav1_get_mevent_buffer_2 thumb_func_start sub_801B044 sub_801B044: ; 801B044 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000356c adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_801B044 thumb_func_start sub_801B058 sub_801B058: ; 801B058 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003564 adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_801B058 thumb_func_start sub_801B06C sub_801B06C: ; 801B06C push {lr} bl sub_801B14C pop {r0} bx r0 thumb_func_end sub_801B06C thumb_func_start sub_801B078 sub_801B078: ; 801B078 push {r4-r7,lr} adds r7, r0, 0 bl sub_801B114 cmp r0, 0 beq @0801B0C4 bl sub_801B14C ldr r4, =0x03005d8c ldr r0, [r4] ldr r5, =0x00003230 adds r0, r5 movs r6, 0xDE lsls r6, 1 adds r1, r7, 0 adds r2, r6, 0 bl memcpy ldr r0, [r4] adds r0, r5 adds r1, r6, 0 bl sub_806F928 ldr r1, [r4] ldr r2, =0x0000322c adds r1, r2 lsls r0, 16 lsrs r0, 16 str r0, [r1] movs r0, 0x1 b @0801B0C6 .align 2, 0 .pool @0801B0C4: movs r0, 0 @0801B0C6: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_801B078 thumb_func_start sub_801B0CC sub_801B0CC: ; 801B0CC push {r4,lr} ldr r4, =0x03005d8c ldr r0, [r4] ldr r1, =0x00003230 adds r0, r1 movs r1, 0xDE lsls r1, 1 bl sub_806F928 lsls r0, 16 lsrs r0, 16 ldr r4, [r4] ldr r2, =0x0000322c adds r1, r4, r2 ldr r1, [r1] cmp r0, r1 bne @0801B10C ldr r1, =0x00003230 adds r0, r4, r1 bl sub_801B114 cmp r0, 0 beq @0801B10C movs r0, 0x1 b @0801B10E .align 2, 0 .pool @0801B10C: movs r0, 0 @0801B10E: pop {r4} pop {r1} bx r1 thumb_func_end sub_801B0CC thumb_func_start sub_801B114 sub_801B114: ; 801B114 push {lr} ldrh r0, [r0] cmp r0, 0 beq @0801B120 movs r0, 0x1 b @0801B122 @0801B120: movs r0, 0 @0801B122: pop {r1} bx r1 thumb_func_end sub_801B114 thumb_func_start sub_801B128 sub_801B128: ; 801B128 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003230 adds r0, r1 ldrb r0, [r0, 0x2] cmp r0, 0 beq @0801B144 movs r0, 0x1 b @0801B146 .align 2, 0 .pool @0801B144: movs r0, 0 @0801B146: pop {r1} bx r1 thumb_func_end sub_801B128 thumb_func_start sub_801B14C sub_801B14C: ; 801B14C push {r4,lr} sub sp, 0x4 movs r4, 0 str r4, [sp] bl sub_801B00C adds r1, r0, 0 ldr r2, =0x0500006f mov r0, sp bl CpuSet ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000322c adds r0, r1 str r4, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801B14C thumb_func_start sub_801B180 sub_801B180: ; 801B180 push {lr} sub sp, 0x4 movs r0, 0 str r0, [sp] bl sub_801B044 adds r1, r0, 0 ldr r2, =0x05000001 mov r0, sp bl CpuSet bl sub_801DBC0 add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801B180 thumb_func_start sub_801B1A4 sub_801B1A4: ; 801B1A4 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003230 adds r4, r0, r1 bl sub_801B0CC cmp r0, 0 bne @0801B1C4 @0801B1B8: movs r0, 0 b @0801B1DC .align 2, 0 .pool @0801B1C4: movs r2, 0 ldr r3, =0x000001bb @0801B1C8: adds r0, r4, r2 adds r1, r5, r2 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bne @0801B1B8 adds r2, 0x1 cmp r2, r3 bls @0801B1C8 movs r0, 0x1 @0801B1DC: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801B1A4 thumb_func_start sub_801B1E8 sub_801B1E8: ; 801B1E8 push {lr} bl sub_801B330 bl sub_801B368 bl sub_801B9F8 bl killram bl sub_809D4D8 bl sub_809D570 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bec adds r0, r1 bl sub_816534C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801B1E8 thumb_func_start sub_801B21C sub_801B21C: ; 801B21C push {r4-r7,lr} adds r7, r0, 0 bl sub_801B2CC cmp r0, 0 beq @0801B274 bl sub_801B1E8 ldr r4, =0x03005d8c ldr r0, [r4] ldr r5, =0x000033f0 adds r0, r5 movs r6, 0xA6 lsls r6, 1 adds r1, r7, 0 adds r2, r6, 0 bl memcpy ldr r0, [r4] adds r0, r5 adds r1, r6, 0 bl sub_806F928 ldr r1, [r4] ldr r3, =0x000033ec adds r2, r1, r3 lsls r0, 16 lsrs r0, 16 str r0, [r2] movs r0, 0xD5 lsls r0, 6 adds r2, r1, r0 adds r1, r5 ldrh r0, [r1, 0x2] strh r0, [r2, 0x6] movs r0, 0x1 b @0801B276 .align 2, 0 .pool @0801B274: movs r0, 0 @0801B276: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_801B21C thumb_func_start sub_801B27C sub_801B27C: ; 801B27C push {r4,r5,lr} ldr r5, =0x03005d8c ldr r0, [r5] ldr r1, =0x000033ec adds r4, r0, r1 adds r1, 0x4 adds r0, r1 movs r1, 0xA6 lsls r1, 1 bl sub_806F928 lsls r0, 16 lsrs r0, 16 ldr r1, [r4] cmp r1, r0 bne @0801B2C4 ldr r0, [r5] ldr r1, =0x000033f0 adds r0, r1 bl sub_801B2CC cmp r0, 0 beq @0801B2C4 bl sub_80991F8 cmp r0, 0 beq @0801B2C4 movs r0, 0x1 b @0801B2C6 .align 2, 0 .pool @0801B2C4: movs r0, 0 @0801B2C6: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_801B27C thumb_func_start sub_801B2CC sub_801B2CC: ; 801B2CC push {lr} adds r2, r0, 0 ldrh r0, [r2] cmp r0, 0 beq @0801B302 ldrb r1, [r2, 0x8] lsls r0, r1, 30 lsrs r0, 30 cmp r0, 0x2 bhi @0801B302 movs r0, 0xC0 ands r0, r1 cmp r0, 0 beq @0801B2F0 cmp r0, 0x40 beq @0801B2F0 cmp r0, 0x80 bne @0801B302 @0801B2F0: lsls r0, r1, 26 lsrs r0, 28 cmp r0, 0x7 bhi @0801B302 ldrb r0, [r2, 0x9] cmp r0, 0x7 bhi @0801B302 movs r0, 0x1 b @0801B304 @0801B302: movs r0, 0 @0801B304: pop {r1} bx r1 thumb_func_end sub_801B2CC thumb_func_start sub_801B308 sub_801B308: ; 801B308 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0xC0 ands r0, r1 cmp r0, 0 beq @0801B328 movs r0, 0x1 b @0801B32A .align 2, 0 .pool @0801B328: movs r0, 0 @0801B32A: pop {r1} bx r1 thumb_func_end sub_801B308 thumb_func_start sub_801B330 sub_801B330: ; 801B330 push {r4,r5,lr} sub sp, 0x4 movs r5, 0 str r5, [sp] ldr r4, =0x03005d8c ldr r1, [r4] ldr r0, =0x000033f0 adds r1, r0 ldr r2, =0x05000053 mov r0, sp bl CpuSet ldr r0, [r4] ldr r1, =0x000033ec adds r0, r1 str r5, [r0] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801B330 thumb_func_start sub_801B368 sub_801B368: ; 801B368 push {r4,lr} sub sp, 0x4 movs r4, 0 str r4, [sp] bl sav1_get_mevent_buffer_2 adds r1, r0, 0 ldr r2, =0x05000009 mov r0, sp bl CpuSet ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000353c adds r0, r1 str r4, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801B368 thumb_func_start sub_801B39C sub_801B39C: ; 801B39C push {lr} bl sub_801B27C cmp r0, 0 bne @0801B3AA movs r0, 0 b @0801B3B4 @0801B3AA: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 ldrh r0, [r0] @0801B3B4: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801B39C thumb_func_start sub_801B3C0 sub_801B3C0: ; 801B3C0 push {lr} adds r2, r0, 0 ldrb r1, [r2, 0x8] movs r0, 0xC0 ands r0, r1 cmp r0, 0x40 bne @0801B3D4 movs r0, 0x3F ands r0, r1 strb r0, [r2, 0x8] @0801B3D4: pop {r0} bx r0 thumb_func_end sub_801B3C0 thumb_func_start sub_801B3D8 sub_801B3D8: ; 801B3D8 push {lr} lsls r0, 16 ldr r1, =0xfc180000 adds r0, r1 lsrs r0, 16 cmp r0, 0x13 bls @0801B3F0 movs r0, 0 b @0801B3F2 .align 2, 0 .pool @0801B3F0: movs r0, 0x1 @0801B3F2: pop {r1} bx r1 thumb_func_end sub_801B3D8 thumb_func_start sub_801B3F8 sub_801B3F8: ; 801B3F8 push {r4,lr} bl sub_801B39C lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 bl sub_801B3D8 cmp r0, 0 beq @0801B430 ldr r1, =gUnknown_082F0DE8 ldr r2, =0xfffffc18 adds r0, r4, r2 lsls r0, 1 adds r0, r1 ldrh r0, [r0] bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0801B430 movs r0, 0x1 b @0801B432 .align 2, 0 .pool @0801B430: movs r0, 0 @0801B432: pop {r4} pop {r1} bx r1 thumb_func_end sub_801B3F8 thumb_func_start sub_801B438 sub_801B438: ; 801B438 push {lr} movs r3, 0 cmp r3, r1 bge @0801B45A adds r2, r0, 0 adds r2, 0x8 @0801B444: ldrh r0, [r2, 0xE] cmp r0, 0 beq @0801B452 ldrh r0, [r2] cmp r0, 0 beq @0801B452 adds r3, 0x1 @0801B452: adds r2, 0x2 subs r1, 0x1 cmp r1, 0 bne @0801B444 @0801B45A: adds r0, r3, 0 pop {r1} bx r1 thumb_func_end sub_801B438 thumb_func_start sub_801B460 sub_801B460: ; 801B460 push {r4-r7,lr} adds r5, r0, 0 adds r4, r1, 0 movs r1, 0 cmp r1, r2 bge @0801B49A ldrh r6, [r4, 0x2] movs r0, 0x16 adds r0, r5 mov r12, r0 @0801B474: lsls r3, r1, 1 mov r7, r12 ldrh r0, [r7] cmp r0, r6 beq @0801B48C adds r0, r5, 0 adds r0, 0x8 adds r0, r3 ldrh r0, [r0] ldrh r3, [r4] cmp r0, r3 bne @0801B490 @0801B48C: movs r0, 0x1 b @0801B49C @0801B490: movs r7, 0x2 add r12, r7 adds r1, 0x1 cmp r1, r2 blt @0801B474 @0801B49A: movs r0, 0 @0801B49C: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_801B460 thumb_func_start sub_801B4A4 sub_801B4A4: ; 801B4A4 push {lr} adds r1, r0, 0 ldrh r0, [r1, 0x2] cmp r0, 0 beq @0801B4C4 ldrh r1, [r1] cmp r1, 0 beq @0801B4C4 ldr r0, =0x0000019b cmp r1, r0 bhi @0801B4C4 movs r0, 0x1 b @0801B4C6 .align 2, 0 .pool @0801B4C4: movs r0, 0 @0801B4C6: pop {r1} bx r1 thumb_func_end sub_801B4A4 thumb_func_start sub_801B4CC sub_801B4CC: ; 801B4CC push {lr} bl sub_801B27C cmp r0, 0 beq @0801B500 ldr r0, =0x03005d8c ldr r3, [r0] ldr r0, =0x000033f0 adds r2, r3, r0 ldrb r1, [r2, 0x8] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @0801B500 movs r1, 0xD5 lsls r1, 6 adds r0, r3, r1 ldrb r1, [r2, 0x9] bl sub_801B438 b @0801B502 .align 2, 0 .pool @0801B500: movs r0, 0 @0801B502: pop {r1} bx r1 thumb_func_end sub_801B4CC thumb_func_start sub_801B508 sub_801B508: ; 801B508 push {r4-r6,lr} adds r5, r0, 0 ldr r6, =0x03005d8c ldr r0, [r6] ldr r1, =0x000033f0 adds r0, r1 ldrb r4, [r0, 0x9] adds r0, r5, 0 bl sub_801B4A4 cmp r0, 0 beq @0801B572 ldr r0, [r6] movs r1, 0xD5 lsls r1, 6 adds r0, r1 adds r1, r5, 0 adds r2, r4, 0 bl sub_801B460 cmp r0, 0 beq @0801B54C b @0801B572 .align 2, 0 .pool @0801B540: ldrh r0, [r5, 0x2] strh r0, [r1] ldrh r0, [r5] strh r0, [r2] movs r0, 0x1 b @0801B574 @0801B54C: movs r3, 0 cmp r3, r4 bge @0801B572 ldr r0, [r6] ldr r6, =0x00003548 adds r2, r0, r6 adds r6, 0xE adds r1, r0, r6 @0801B55C: ldrh r0, [r2, 0xE] cmp r0, 0 bne @0801B568 ldrh r0, [r2] cmp r0, 0 beq @0801B540 @0801B568: adds r2, 0x2 adds r1, 0x2 adds r3, 0x1 cmp r3, r4 blt @0801B55C @0801B572: movs r0, 0 @0801B574: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801B508 thumb_func_start sub_801B580 sub_801B580: ; 801B580 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 adds r5, r0, 0 adds r4, r1, 0 movs r0, 0 str r0, [sp] ldr r2, =0x05000019 mov r0, sp adds r1, r5, 0 bl CpuSet ldr r0, =0x00000101 str r0, [r5] movs r0, 0x1 strh r0, [r5, 0x4] str r0, [r5, 0x8] cmp r4, 0 beq @0801B5C0 movs r0, 0x5 strh r0, [r5, 0xC] ldr r0, =0x00000201 b @0801B5C8 .align 2, 0 .pool @0801B5C0: movs r0, 0x4 strh r0, [r5, 0xC] movs r0, 0x80 lsls r0, 2 @0801B5C8: str r0, [r5, 0x10] bl sub_801B27C cmp r0, 0 beq @0801B5FC bl sav1_get_mevent_buffer_1 ldrh r0, [r0] strh r0, [r5, 0x14] bl sav1_get_mevent_buffer_2 adds r1, r5, 0 adds r1, 0x20 ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2-r4} stm r1!, {r2-r4} bl sav1_get_mevent_buffer_1 ldrb r1, [r0, 0x9] adds r0, r5, 0 adds r0, 0x44 strb r1, [r0] b @0801B5FE @0801B5FC: strh r0, [r5, 0x14] @0801B5FE: adds r4, r5, 0 adds r4, 0x4C ldr r0, =0x03005d90 mov r8, r0 adds r6, r5, 0 adds r6, 0x45 adds r7, r5, 0 adds r7, 0x50 movs r1, 0x5C adds r1, r5 mov r9, r1 movs r2, 0x60 adds r2, r5 mov r10, r2 ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00003564 adds r2, r0, r3 adds r1, r5, 0 adds r1, 0x16 movs r3, 0x3 @0801B628: ldrh r0, [r2] strh r0, [r1] adds r2, 0x2 adds r1, 0x2 subs r3, 0x1 cmp r3, 0 bge @0801B628 mov r0, r8 ldr r1, [r0] adds r1, 0xA adds r0, r4, 0 bl sub_80842F4 mov r2, r8 ldr r1, [r2] adds r0, r6, 0 bl gf_strcpy ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00002bb0 adds r2, r0, r3 adds r1, r7, 0 movs r3, 0x5 @0801B658: ldrh r0, [r2] strh r0, [r1] adds r2, 0x2 adds r1, 0x2 subs r3, 0x1 cmp r3, 0 bge @0801B658 ldr r1, =RomHeaderGameCode mov r0, r9 movs r2, 0x4 bl memcpy ldr r0, =RomHeaderSoftwareVersion ldrb r0, [r0] mov r4, r10 strb r0, [r4] add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801B580 thumb_func_start sub_801B6A0 sub_801B6A0: ; 801B6A0 push {r4,lr} adds r2, r0, 0 adds r4, r1, 0 ldr r1, [r2] ldr r0, =0x00000101 cmp r1, r0 bne @0801B6DC ldrh r1, [r2, 0x4] movs r3, 0x1 adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @0801B6DC ldr r0, [r2, 0x8] ands r0, r3 cmp r0, 0 beq @0801B6DC cmp r4, 0 bne @0801B6E4 ldrh r1, [r2, 0xC] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0801B6DC ldr r0, [r2, 0x10] movs r1, 0xE0 lsls r1, 2 ands r0, r1 cmp r0, 0 bne @0801B6E4 @0801B6DC: movs r0, 0 b @0801B6E6 .align 2, 0 .pool @0801B6E4: movs r0, 0x1 @0801B6E6: pop {r4} pop {r1} bx r1 thumb_func_end sub_801B6A0 thumb_func_start sub_801B6EC sub_801B6EC: ; 801B6EC push {lr} ldrh r1, [r1, 0x14] cmp r1, 0 bne @0801B6F8 movs r0, 0 b @0801B704 @0801B6F8: ldrh r0, [r0] cmp r0, r1 beq @0801B702 movs r0, 0x2 b @0801B704 @0801B702: movs r0, 0x1 @0801B704: pop {r1} bx r1 thumb_func_end sub_801B6EC thumb_func_start sub_801B708 sub_801B708: ; 801B708 push {r4-r6,lr} adds r6, r0, 0 adds r4, r1, 0 adds r5, r4, 0 adds r5, 0x20 adds r4, 0x44 ldrb r1, [r4] adds r0, r5, 0 bl sub_801B438 ldrb r2, [r4] subs r4, r2, r0 cmp r4, 0 bne @0801B728 movs r0, 0x1 b @0801B742 @0801B728: adds r0, r5, 0 adds r1, r6, 0 bl sub_801B460 cmp r0, 0 beq @0801B738 movs r0, 0x3 b @0801B742 @0801B738: cmp r4, 0x1 beq @0801B740 movs r0, 0x2 b @0801B742 @0801B740: movs r0, 0x4 @0801B742: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_801B708 thumb_func_start sub_801B748 sub_801B748: ; 801B748 push {r4,lr} movs r3, 0 adds r2, r0, 0 adds r2, 0x16 @0801B750: ldrh r0, [r2] ldrh r4, [r1] cmp r0, r4 beq @0801B75C movs r0, 0 b @0801B768 @0801B75C: adds r1, 0x2 adds r2, 0x2 adds r3, 0x1 cmp r3, 0x3 ble @0801B750 movs r0, 0x1 @0801B768: pop {r4} pop {r1} bx r1 thumb_func_end sub_801B748 thumb_func_start sub_801B770 sub_801B770: ; 801B770 push {lr} adds r2, r0, 0 adds r2, 0x20 adds r0, 0x44 ldrb r1, [r0] adds r0, r2, 0 bl sub_801B438 pop {r1} bx r1 thumb_func_end sub_801B770 thumb_func_start sub_801B784 sub_801B784: ; 801B784 push {lr} adds r2, r0, 0 cmp r1, 0x4 bhi @0801B7D0 lsls r0, r1, 2 ldr r1, =@0801B79C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801B79C: .4byte @0801B7B0 .4byte @0801B7B4 .4byte @0801B7B8 .4byte @0801B7BC .4byte @0801B7C8 @0801B7B0: ldrh r0, [r2, 0x20] b @0801B7D2 @0801B7B4: ldrh r0, [r2, 0x22] b @0801B7D2 @0801B7B8: ldrh r0, [r2, 0x24] b @0801B7D2 @0801B7BC: adds r0, r2, 0 bl sub_801B770 lsls r0, 16 lsrs r0, 16 b @0801B7D2 @0801B7C8: adds r0, r2, 0 adds r0, 0x44 ldrb r0, [r0] b @0801B7D2 @0801B7D0: movs r0, 0 @0801B7D2: pop {r1} bx r1 thumb_func_end sub_801B784 thumb_func_start sub_801B7D8 sub_801B7D8: ; 801B7D8 push {r4,lr} adds r4, r0, 0 ldr r2, =0x03005d8c ldr r0, [r2] ldr r1, =0x000033f0 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0x3 ands r0, r1 adds r3, r2, 0 cmp r0, 0x2 bne @0801B850 movs r2, 0 cmp r4, 0x4 bhi @0801B83A lsls r0, r4, 2 ldr r1, =@0801B80C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801B80C: .4byte @0801B820 .4byte @0801B828 .4byte @0801B834 .4byte @0801B83A .4byte @0801B83A @0801B820: ldr r0, [r3] movs r1, 0xD5 lsls r1, 6 b @0801B838 @0801B828: ldr r0, [r3] ldr r1, =0x00003542 b @0801B838 .align 2, 0 .pool @0801B834: ldr r0, [r3] ldr r1, =0x00003544 @0801B838: adds r2, r0, r1 @0801B83A: cmp r2, 0 beq @0801B850 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] lsls r0, 16 lsrs r0, 16 ldr r1, =0x000003e7 cmp r0, r1 bls @0801B850 strh r1, [r2] @0801B850: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801B7D8 thumb_func_start mevent_081445C0 mevent_081445C0: ; 801B860 push {lr} cmp r0, 0x4 bhi @0801B938 lsls r0, 2 ldr r1, =@0801B874 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801B874: .4byte @0801B888 .4byte @0801B8AC .4byte @0801B8D0 .4byte @0801B8F4 .4byte @0801B918 @0801B888: ldr r0, =0x03005d8c ldr r2, [r0] ldr r1, =0x000033f0 adds r0, r2, r1 ldrb r1, [r0, 0x8] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 bne @0801B938 movs r1, 0xD5 lsls r1, 6 adds r0, r2, r1 ldrh r0, [r0] b @0801B93A .align 2, 0 .pool @0801B8AC: ldr r0, =0x03005d8c ldr r2, [r0] ldr r1, =0x000033f0 adds r0, r2, r1 ldrb r1, [r0, 0x8] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 bne @0801B938 movs r1, 0xD5 lsls r1, 6 adds r0, r2, r1 ldrh r0, [r0, 0x2] b @0801B93A .align 2, 0 .pool @0801B8D0: ldr r0, =0x03005d8c ldr r2, [r0] ldr r1, =0x000033f0 adds r0, r2, r1 ldrb r1, [r0, 0x8] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 bne @0801B938 movs r1, 0xD5 lsls r1, 6 adds r0, r2, r1 ldrh r0, [r0, 0x4] b @0801B93A .align 2, 0 .pool @0801B8F4: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @0801B938 bl sub_801B4CC lsls r0, 16 lsrs r0, 16 b @0801B93A .align 2, 0 .pool @0801B918: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000033f0 adds r2, r0, r1 ldrb r1, [r2, 0x8] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @0801B938 ldrb r0, [r2, 0x9] b @0801B93A .align 2, 0 .pool @0801B938: movs r0, 0 @0801B93A: pop {r1} bx r1 thumb_func_end mevent_081445C0 thumb_func_start sub_801B940 sub_801B940: ; 801B940 ldr r1, =0x02022c70 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_801B940 thumb_func_start sub_801B94C sub_801B94C: ; 801B94C push {r4,r5,lr} lsls r0, 16 lsrs r0, 16 adds r4, r0, 0 ldr r5, =0x02022c70 movs r0, 0 str r0, [r5] cmp r4, 0 beq @0801B98A bl sub_801B27C cmp r0, 0 beq @0801B988 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000033f0 adds r0, r1 ldrh r0, [r0] cmp r0, r4 bne @0801B988 movs r0, 0x1 str r0, [r5] b @0801B98A .align 2, 0 .pool @0801B988: movs r0, 0 @0801B98A: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_801B94C thumb_func_start sub_801B990 sub_801B990: ; 801B990 push {lr} adds r2, r0, 0 ldr r0, =0x02022c70 ldr r0, [r0] cmp r0, 0 beq @0801B9EC cmp r2, 0x1 beq @0801B9DC cmp r2, 0x1 bcc @0801B9C0 cmp r2, 0x2 bne @0801B9EC ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, =0x00003584 adds r2, r0 movs r0, 0x2 b @0801B9CA .align 2, 0 .pool @0801B9C0: ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, =0x00003570 adds r2, r0 movs r0, 0 @0801B9CA: movs r3, 0x5 bl sub_801BA8C b @0801B9EC .align 2, 0 .pool @0801B9DC: ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, =0x00003570 adds r2, r0 movs r0, 0x1 movs r3, 0x5 bl sub_801BA8C @0801B9EC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801B990 thumb_func_start sub_801B9F8 sub_801B9F8: ; 801B9F8 push {lr} sub sp, 0x4 movs r0, 0 str r0, [sp] ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003570 adds r1, r0 ldr r2, =0x0500000a mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801B9F8 thumb_func_start sub_801BA24 sub_801BA24: ; 801BA24 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 movs r1, 0 cmp r1, r2 bge @0801BA46 ldr r0, [r4] cmp r0, r5 beq @0801BA46 adds r3, r4, 0 @0801BA38: adds r3, 0x4 adds r1, 0x1 cmp r1, r2 bge @0801BA46 ldr r0, [r3] cmp r0, r5 bne @0801BA38 @0801BA46: cmp r1, r2 bne @0801BA68 subs r3, r1, 0x1 cmp r3, 0 ble @0801BA62 lsls r0, r3, 2 subs r0, 0x4 adds r2, r0, r4 @0801BA56: ldr r0, [r2] str r0, [r2, 0x4] subs r2, 0x4 subs r3, 0x1 cmp r3, 0 bgt @0801BA56 @0801BA62: str r5, [r4] movs r0, 0x1 b @0801BA84 @0801BA68: adds r3, r1, 0 cmp r3, 0 ble @0801BA80 lsls r0, r3, 2 subs r0, 0x4 adds r2, r0, r4 @0801BA74: ldr r0, [r2] str r0, [r2, 0x4] subs r2, 0x4 subs r3, 0x1 cmp r3, 0 bgt @0801BA74 @0801BA80: str r5, [r4] movs r0, 0 @0801BA84: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_801BA24 thumb_func_start sub_801BA8C sub_801BA8C: ; 801BA8C push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 adds r1, r2, 0 adds r2, r3, 0 bl sub_801BA24 cmp r0, 0 beq @0801BAA4 adds r0, r4, 0 bl sub_801B7D8 @0801BAA4: pop {r4} pop {r0} bx r0 thumb_func_end sub_801BA8C thumb_func_start sub_801BAAC sub_801BAAC: ; 801BAAC push {r4-r7,lr} adds r5, r0, 0 adds r6, r1, 0 cmp r5, 0 beq @0801BAC8 cmp r6, 0 beq @0801BAC8 ldr r7, =0x02022c74 ldr r0, =0x0000145c bl malloc_and_clear str r0, [r7] cmp r0, 0 bne @0801BAD4 @0801BAC8: movs r0, 0 b @0801BB3E .align 2, 0 .pool @0801BAD4: movs r4, 0xA6 lsls r4, 1 adds r1, r5, 0 adds r2, r4, 0 bl memcpy ldr r1, [r7] adds r1, r4 adds r0, r6, 0 ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2-r4} stm r1!, {r2-r4} ldr r2, [r7] ldrb r1, [r2, 0x8] lsls r0, r1, 26 lsrs r0, 28 cmp r0, 0x7 bls @0801BB06 movs r0, 0x3D negs r0, r0 ands r0, r1 strb r0, [r2, 0x8] @0801BB06: ldr r2, [r7] ldrb r1, [r2, 0x8] lsls r0, r1, 30 lsrs r0, 30 cmp r0, 0x2 bls @0801BB1A movs r0, 0x4 negs r0, r0 ands r0, r1 strb r0, [r2, 0x8] @0801BB1A: ldr r1, [r7] ldrb r0, [r1, 0x9] cmp r0, 0x7 bls @0801BB26 movs r0, 0 strb r0, [r1, 0x9] @0801BB26: ldr r0, [r7] movs r1, 0xB8 lsls r1, 1 adds r2, r0, r1 ldrb r0, [r0, 0x8] lsls r0, 26 lsrs r0, 28 lsls r0, 4 ldr r1, =gUnknown_082F1D60 adds r0, r1 str r0, [r2] movs r0, 0x1 @0801BB3E: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801BAAC thumb_func_start sub_801BB48 sub_801BB48: ; 801BB48 push {r4,lr} ldr r4, =0x02022c74 ldr r0, [r4] cmp r0, 0 beq @0801BB64 ldr r2, =0x0000145c movs r1, 0 bl memset ldr r0, [r4] bl free movs r0, 0 str r0, [r4] @0801BB64: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801BB48 thumb_func_start sub_801BB74 sub_801BB74: ; 801BB74 push {r4-r6,lr} sub sp, 0x24 ldr r5, =0x02022c74 ldr r0, [r5] cmp r0, 0 bne @0801BB8C movs r0, 0x1 negs r0, r0 b @0801BD98 .align 2, 0 .pool @0801BB8C: movs r4, 0xBA lsls r4, 1 adds r0, r4 ldrb r0, [r0] cmp r0, 0x7 bls @0801BB9A b @0801BD70 @0801BB9A: lsls r0, 2 ldr r1, =@0801BBA8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801BBA8: .4byte @0801BBC8 .4byte @0801BBDA .4byte @0801BBE8 .4byte @0801BC8C .4byte @0801BD14 .4byte @0801BD1A .4byte @0801BD34 .4byte @0801BD3A @0801BBC8: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl 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, =0x02022c74 ldr r0, [r5] movs r1, 0xB8 lsls r1, 1 adds r0, r1 ldr r0, [r0] ldr r1, [r0, 0x4] movs r0, 0 str r0, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0x8 bl decompress_and_copy_tile_data_to_vram ldr r4, =gUnknown_082F0E1C adds r0, r4, 0 bl 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 .pool @0801BC8C: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 beq @0801BC9A b @0801BD96 @0801BC9A: movs r0, 0x1 bl stdpal_get movs r1, 0x20 movs r2, 0x20 bl gpu_pal_apply ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] ldr r5, =0x02022c74 ldr r0, [r5] movs r4, 0xB8 lsls r4, 1 adds r0, r4 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x10 movs r2, 0x20 bl gpu_pal_apply ldr r1, [r5] adds r4, r1, r4 ldr r0, [r4] ldr r0, [r0, 0x8] ldr r4, =0x0000045c adds r1, r4 bl LZ77UnCompWram ldr r1, [r5] adds r1, r4 movs r2, 0x1E str r2, [sp] movs r0, 0x14 str r0, [sp, 0x4] str r6, [sp, 0x8] str r6, [sp, 0xC] str r2, [sp, 0x10] str r0, [sp, 0x14] movs r0, 0x1 str r0, [sp, 0x18] movs r0, 0x8 str r0, [sp, 0x1C] str r6, [sp, 0x20] movs r0, 0x2 movs r2, 0 movs r3, 0 bl bg_copy_tilemap_rect movs r0, 0x2 bl gpu_copy_wram_bg_tilemap_to_vram b @0801BD86 .align 2, 0 .pool @0801BD14: bl sub_801BEF8 b @0801BD86 @0801BD1A: movs r0, 0 bl sub_801C178 movs r0, 0x1 bl sub_801C178 movs r0, 0x2 bl sub_801C178 movs r0, 0x1 bl 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, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] bl sub_801C4C0 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 bl fade_and_return_progress_probably b @0801BD86 .align 2, 0 .pool @0801BD70: bl fade_and_return_progress_probably lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @0801BD96 ldr r0, [r5] adds r0, r4 strb r1, [r0] movs r0, 0x1 b @0801BD98 @0801BD86: ldr r0, =0x02022c74 ldr r1, [r0] movs r0, 0xBA lsls r0, 1 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0801BD96: movs r0, 0 @0801BD98: add sp, 0x24 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801BB74 thumb_func_start sub_801BDA4 sub_801BDA4: ; 801BDA4 push {r4,r5,lr} sub sp, 0x8 adds r2, r0, 0 ldr r5, =0x02022c74 ldr r0, [r5] cmp r0, 0 bne @0801BDBC movs r0, 0x1 negs r0, r0 b @0801BEEC .align 2, 0 .pool @0801BDBC: movs r4, 0xBA lsls r4, 1 adds r0, r4 ldrb r0, [r0] cmp r0, 0x5 bls @0801BDCA b @0801BEC4 @0801BDCA: lsls r0, 2 ldr r1, =@0801BDD8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801BDD8: .4byte @0801BDF0 .4byte @0801BE02 .4byte @0801BE0E .4byte @0801BE56 .4byte @0801BE94 .4byte @0801BE9E @0801BDF0: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl 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, =0x02022c74 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 .pool @0801BE94: bl sub_801C61C bl sub_80D2F9C b @0801BEDA @0801BE9E: ldr r0, =0x02022c60 ldrb r0, [r0] adds r1, r2, 0 bl sub_80186EC movs r0, 0 bl 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 .pool @0801BEC4: bl fade_and_return_progress_probably lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @0801BEEA ldr r0, [r5] adds r0, r4 strb r1, [r0] movs r0, 0x1 b @0801BEEC @0801BEDA: ldr r0, =0x02022c74 ldr r1, [r0] movs r0, 0xBA lsls r0, 1 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0801BEEA: movs r0, 0 @0801BEEC: add sp, 0x8 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801BDA4 thumb_func_start sub_801BEF8 sub_801BEF8: ; 801BEF8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 movs r5, 0 mov r0, sp movs r1, 0 movs r2, 0x6 bl memset ldr r4, =0x02022c74 ldr r1, [r4] ldr r2, =0x0000018b adds r0, r1, r2 adds r1, 0xA movs r2, 0x28 bl memcpy ldr r0, [r4] ldr r3, =0x000001b3 adds r1, r0, r3 movs r0, 0xFF strb r0, [r1] ldr r1, [r4] movs r2, 0xDA lsls r2, 1 adds r0, r1, r2 adds r1, 0x32 movs r2, 0x28 bl memcpy ldr r0, [r4] movs r3, 0xEE lsls r3, 1 adds r0, r3 movs r1, 0x1 negs r1, r1 strb r1, [r0] ldr r1, [r4] ldr r0, [r1, 0x4] ldr r2, =0x000f423f cmp r0, r2 bls @0801BF54 str r2, [r1, 0x4] @0801BF54: ldr r1, [r4] ldr r2, =0x000001dd adds r0, r1, r2 ldr r1, [r1, 0x4] movs r2, 0 movs r3, 0x6 bl 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, =0x02022c74 ldr r1, [r6] movs r3, 0xA2 lsls r3, 2 adds r0, r1, r3 adds r1, 0xFA movs r2, 0x28 bl memcpy ldr r0, [r6] movs r4, 0xAC lsls r4, 2 adds r0, r4 movs r1, 0x1 negs r1, r1 adds r4, r1, 0 movs r1, 0xFF strb r1, [r0] ldr r1, [r6] ldrb r0, [r1, 0x8] lsls r0, 30 lsrs r0, 30 cmp r0, 0x1 beq @0801C018 cmp r0, 0x1 bgt @0801BFF0 cmp r0, 0 beq @0801BFF6 b @0801C168 .align 2, 0 .pool @0801BFF0: cmp r0, 0x2 beq @0801C028 b @0801C168 @0801BFF6: ldr r2, =0x000002b1 adds r0, r1, r2 movs r3, 0x91 lsls r3, 1 adds r1, r3 movs r2, 0x28 bl memcpy ldr r1, [r6] ldr r0, =0x000002d9 adds r1, r0 b @0801C01C .align 2, 0 .pool @0801C018: ldr r2, =0x000002b1 adds r1, r2 @0801C01C: ldrb r0, [r1] orrs r0, r4 strb r0, [r1] b @0801C168 .align 2, 0 .pool @0801C028: ldr r3, =0x000002b1 adds r0, r1, r3 ldrb r1, [r0] orrs r1, r7 strb r1, [r0] mov r3, sp ldr r1, [r6] movs r4, 0xA6 lsls r4, 1 adds r0, r1, r4 ldrh r0, [r0] ldr r2, =0x000003e7 cmp r0, r2 bls @0801C046 adds r0, r2, 0 @0801C046: strh r0, [r3] mov r3, sp movs r4, 0xA7 lsls r4, 1 adds r0, r1, r4 ldrh r0, [r0] cmp r0, r2 bls @0801C058 adds r0, r2, 0 @0801C058: strh r0, [r3, 0x2] mov r3, sp movs r4, 0xA8 lsls r4, 1 adds r0, r1, r4 ldrh r0, [r0] cmp r0, r2 bls @0801C06A adds r0, r2, 0 @0801C06A: strh r0, [r3, 0x4] movs r5, 0 @0801C06E: lsls r4, r5, 1 adds r4, r5 lsls r4, 4 movs r0, 0xB7 lsls r0, 2 adds r4, r0 ldr r0, [r6] adds r0, r4 adds r0, 0x2A movs r1, 0xFF movs r2, 0x4 bl memset ldr r0, [r6] adds r0, r4 adds r0, 0x1 movs r1, 0xFF movs r2, 0x29 bl memset adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x7 bls @0801C06E movs r5, 0 movs r6, 0 ldr r1, =0x02022c74 mov r8, r1 movs r2, 0x91 lsls r2, 1 mov r10, r2 ldr r7, =0x00000175 movs r3, 0xB7 lsls r3, 2 mov r9, r3 @0801C0B6: mov r4, r8 ldr r2, [r4] mov r0, r10 adds r1, r2, r0 adds r0, r1, r5 ldrb r3, [r0] cmp r3, 0xF7 beq @0801C0F8 ldr r1, =0x00000175 adds r0, r2, r1 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 4 adds r0, r6, r0 ldr r4, =0x000002dd adds r1, r2, r4 adds r1, r0 strb r3, [r1] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 b @0801C15E .align 2, 0 .pool @0801C0F8: adds r0, r5, 0x1 adds r0, r1, r0 ldrb r3, [r0] cmp r3, 0x2 bls @0801C108 adds r0, r5, 0x2 lsls r0, 16 b @0801C15C @0801C108: adds r0, r2, r7 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 4 add r0, r9 adds r0, r2, r0 adds r0, 0x2A lsls r1, r3, 1 add r1, sp ldrh r1, [r1] movs r2, 0x2 movs r3, 0x3 bl 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, =0x02022c74 ldr r0, [r7] lsls r1, r4, 1 movs r2, 0xBB lsls r2, 1 adds r0, r2 adds r0, r1 ldrh r0, [r0] lsls r6, r0, 24 lsrs r5, r6, 24 adds r0, r5, 0 bl 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 .pool @0801C1C4: mov r0, r8 cmp r0, 0x2 bne @0801C1CC b @0801C304 @0801C1CC: mov r9, r6 b @0801C498 @0801C1D0: ldr r2, [r7] movs r1, 0xB8 lsls r1, 1 mov r10, r1 adds r0, r2, r1 ldr r0, [r0] ldrb r0, [r0] lsls r0, 28 lsrs r0, 28 lsls r1, r0, 1 adds r1, r0 ldr r0, =gUnknown_082F0E10 mov r8, r0 add r1, r8 str r1, [sp] ldr r1, [sp, 0xC] str r1, [sp, 0x4] ldr r0, =0x0000018b adds r2, r0 str r2, [sp, 0x8] adds r0, r5, 0 movs r1, 0x3 movs r2, 0 movs r3, 0x1 bl box_print ldr r4, [r7] movs r1, 0xDA lsls r1, 1 mov r9, r1 add r4, r9 movs r0, 0x3 movs r1, 0x2 bl 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, =0x000001dd adds r0, r2, r1 str r0, [sp, 0x8] adds r0, r5, 0 movs r1, 0x1 movs r2, 0xA6 movs r3, 0x11 bl box_print b @0801C498 .align 2, 0 .pool @0801C2A0: mov r9, r6 @0801C2A2: ldr r2, [sp, 0xC] lsls r4, r2, 24 asrs r4, 24 lsls r3, r4, 4 adds r3, 0x2 lsls r3, 24 lsrs r3, 24 ldr r0, =0x02022c74 ldr r2, [r0] movs r1, 0xB8 lsls r1, 1 adds r0, r2, r1 ldr r0, [r0] ldrb r0, [r0] lsrs r0, 4 lsls r1, r0, 1 adds r1, r0 ldr r0, =gUnknown_082F0E10 adds r1, r0 str r1, [sp] movs r0, 0 str r0, [sp, 0x4] lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r4 movs r1, 0xF2 lsls r1, 1 adds r0, r1 adds r2, r0 str r2, [sp, 0x8] mov r2, r9 lsrs r0, r2, 24 movs r1, 0x3 movs r2, 0 bl box_print adds r4, 0x1 lsls r4, 24 lsrs r0, r4, 24 str r0, [sp, 0xC] asrs r4, 24 cmp r4, 0x3 ble @0801C2A2 b @0801C498 .align 2, 0 .pool @0801C304: ldr r4, =gUnknown_082F0E18 ldr r2, [r7] ldrb r0, [r2, 0x8] lsls r0, 30 lsrs r0, 30 adds r0, r4 ldrb r3, [r0] movs r1, 0xB8 lsls r1, 1 adds r0, r2, r1 ldr r0, [r0] ldrb r0, [r0, 0x1] lsls r0, 28 lsrs r0, 28 lsls r1, r0, 1 adds r1, r0 ldr r0, =gUnknown_082F0E10 mov r10, r0 add r1, r10 str r1, [sp] ldr r1, [sp, 0xC] str r1, [sp, 0x4] movs r1, 0xA2 lsls r1, 2 adds r0, r2, r1 str r0, [sp, 0x8] adds r0, r5, 0 movs r1, 0x3 movs r2, 0 bl box_print ldr r2, [r7] ldrb r1, [r2, 0x8] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 beq @0801C398 lsls r0, r1, 30 lsrs r0, 30 adds r0, r4 ldrb r3, [r0] adds r3, 0x10 lsls r3, 24 lsrs r3, 24 movs r1, 0xB8 lsls r1, 1 adds r0, r2, r1 ldr r0, [r0] ldrb r1, [r0, 0x1] lsls r1, 28 lsrs r1, 28 lsls r0, r1, 1 adds r0, r1 add r0, r10 str r0, [sp] ldr r0, [sp, 0xC] str r0, [sp, 0x4] ldr r1, =0x000002b1 adds r0, r2, r1 str r0, [sp, 0x8] adds r0, r5, 0 movs r1, 0x3 movs r2, 0 bl box_print mov r9, r6 b @0801C498 .align 2, 0 .pool @0801C398: movs r2, 0 mov r8, r2 lsls r0, r1, 30 lsrs r0, 30 adds r0, r4 ldrb r0, [r0] adds r4, r0, 0 adds r4, 0x10 movs r0, 0x3 movs r1, 0x2 bl fbox_get_field lsls r0, 24 lsrs r2, r0, 24 ldr r0, [r7] ldr r1, =0x00000175 adds r0, r1 mov r9, r6 ldr r1, [sp, 0xC] ldrb r0, [r0] cmp r1, r0 bge @0801C498 str r5, [sp, 0x10] lsls r0, r4, 24 lsrs r0, 24 str r0, [sp, 0x14] mov r10, r2 @0801C3CE: mov r0, r8 lsls r2, r0, 24 lsrs r2, 24 ldr r3, [r7] movs r1, 0xB8 lsls r1, 1 adds r0, r3, r1 ldr r0, [r0] ldrb r1, [r0, 0x1] lsls r1, 28 lsrs r1, 28 lsls r0, r1, 1 adds r0, r1 ldr r1, =gUnknown_082F0E10 adds r0, r1 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] ldr r1, [sp, 0xC] lsls r0, r1, 24 asrs r6, r0, 24 lsls r0, r6, 1 adds r0, r6 lsls r5, r0, 4 movs r0, 0xB7 lsls r0, 2 adds r4, r5, r0 adds r3, r4 adds r3, 0x1 str r3, [sp, 0x8] ldr r0, [sp, 0x10] movs r1, 0x3 ldr r3, [sp, 0x14] bl box_print ldr r1, [r7] adds r0, r1, r5 ldr r2, =0x00000306 adds r0, r2 ldrb r0, [r0] cmp r0, 0xFF beq @0801C482 adds r1, r4 adds r1, 0x1 movs r0, 0x3 mov r2, r10 bl 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, =gUnknown_082F0E10 adds r0, r1 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] adds r3, r4 adds r3, 0x2A str r3, [sp, 0x8] ldr r0, [sp, 0x10] movs r1, 0x3 ldr r3, [sp, 0x14] bl box_print ldr r1, [r7] adds r1, r4 adds r1, 0x2A movs r0, 0x3 mov r2, r10 bl 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, =0x00000175 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 .pool thumb_func_end sub_801C178 thumb_func_start sub_801C4C0 sub_801C4C0: ; 801C4C0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 movs r7, 0 ldr r4, =0x02022c74 ldr r0, [r4] movs r1, 0xBE lsls r1, 1 adds r0, r1 movs r1, 0xFF strb r1, [r0] ldr r0, [r4] movs r2, 0xA9 lsls r2, 1 adds r1, r0, r2 ldrh r0, [r1] cmp r0, 0 beq @0801C52C bl sub_80D2E84 lsls r0, 16 lsrs r0, 16 ldr r1, =nullsub_12 str r7, [sp] str r7, [sp, 0x4] movs r2, 0xDC movs r3, 0x14 bl sub_80D2D78 ldr r1, [r4] movs r2, 0xBE lsls r2, 1 adds r1, r2 strb r0, [r1] ldr r2, =0x02020630 ldr r0, [r4] movs r1, 0xBE lsls r1, 1 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r2, [r0, 0x5] movs r1, 0xD negs r1, r1 ands r1, r2 movs r2, 0x8 orrs r1, r2 strb r1, [r0, 0x5] @0801C52C: ldr r1, [r4] ldrb r0, [r1, 0x9] cmp r0, 0 beq @0801C5EE ldrb r1, [r1, 0x8] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @0801C5EE ldr r0, =gUnknown_082F1D00 bl 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, =gUnknown_082F1D08 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, =0x0000017d mov r10, r0 movs r1, 0 mov r9, r1 movs r2, 0xFF mov r8, r2 @0801C572: ldr r1, [r6] lsls r4, r7, 1 add r1, r10 adds r1, r4 ldrb r0, [r1] mov r2, r8 orrs r0, r2 strb r0, [r1] ldr r1, [r6] movs r0, 0xBF lsls r0, 1 adds r1, r0 adds r1, r4 ldrb r0, [r1] orrs r0, r2 strb r0, [r1] lsls r1, r7, 5 movs r0, 0xD8 subs r5, r0, r1 ldr r0, =gUnknown_082F1D48 adds r1, r5, 0 movs r2, 0x90 movs r3, 0x8 bl 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, =nullsub_12 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 .pool thumb_func_end sub_801C4C0 thumb_func_start sub_801C61C sub_801C61C: ; 801C61C push {r4-r7,lr} movs r5, 0 ldr r4, =0x02022c74 ldr r0, [r4] movs r2, 0xBE lsls r2, 1 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @0801C640 adds r1, r0, 0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl sub_80D2EF8 @0801C640: ldr r0, [r4] ldrb r2, [r0, 0x9] cmp r2, 0 beq @0801C6B4 ldrb r1, [r0, 0x8] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @0801C6B4 cmp r5, r2 bcs @0801C6A4 adds r6, r4, 0 ldr r7, =0x02020630 @0801C65A: ldr r0, [r6] lsls r4, r5, 1 ldr r1, =0x0000017d adds r0, r1 adds r1, r0, r4 ldrb r0, [r1] cmp r0, 0xFF beq @0801C678 adds r1, r0, 0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 bl 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 .pool thumb_func_end sub_801C61C thumb_func_start sub_801C6C8 sub_801C6C8: ; 801C6C8 push {r4-r6,lr} adds r4, r0, 0 cmp r4, 0 beq @0801C6DE ldr r5, =0x02022c78 ldr r0, =0x000013a4 bl malloc_and_clear str r0, [r5] cmp r0, 0 bne @0801C6EC @0801C6DE: movs r0, 0 b @0801C71C .align 2, 0 .pool @0801C6EC: movs r6, 0xDE lsls r6, 1 adds r1, r4, 0 adds r2, r6, 0 bl memcpy ldr r1, [r5] ldrb r0, [r1, 0x3] cmp r0, 0x7 bls @0801C704 movs r0, 0 strb r0, [r1, 0x3] @0801C704: ldr r2, [r5] adds r3, r2, r6 ldrb r0, [r2, 0x3] lsls r0, 4 ldr r1, =gUnknown_082F24C8 adds r0, r1 str r0, [r3] ldr r0, =0x000001c1 adds r1, r2, r0 movs r0, 0xFF strb r0, [r1] movs r0, 0x1 @0801C71C: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801C6C8 thumb_func_start sub_801C72C sub_801C72C: ; 801C72C push {r4,lr} ldr r4, =0x02022c78 ldr r0, [r4] cmp r0, 0 beq @0801C748 ldr r2, =0x000013a4 movs r1, 0 bl memset ldr r0, [r4] bl free movs r0, 0 str r0, [r4] @0801C748: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801C72C thumb_func_start sub_801C758 sub_801C758: ; 801C758 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x24 ldr r5, =0x02022c78 ldr r0, [r5] cmp r0, 0 bne @0801C778 movs r0, 0x1 negs r0, r0 b @0801CA3A .align 2, 0 .pool @0801C778: movs r4, 0xE0 lsls r4, 1 adds r0, r4 ldrb r0, [r0] lsrs r0, 1 cmp r0, 0x6 bls @0801C788 b @0801CA04 @0801C788: lsls r0, 2 ldr r1, =@0801C798 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801C798: .4byte @0801C7B4 .4byte @0801C7C6 .4byte @0801C82C .4byte @0801C8D4 .4byte @0801C990 .4byte @0801C996 .4byte @0801C9A8 @0801C7B4: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl 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, =0x00001a98 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 .pool @0801C82C: movs r5, 0x1E str r5, [sp] movs r4, 0x14 str r4, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =0x02022c78 ldr r0, [r5] movs r1, 0xDE lsls r1, 1 adds r0, r1 ldr r0, [r0] ldr r1, [r0, 0x4] movs r0, 0 str r0, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0x8 bl decompress_and_copy_tile_data_to_vram ldr r4, =gUnknown_082F1DE8 adds r0, r4, 0 bl 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 .pool @0801C8D4: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r7, r0, 24 cmp r7, 0 beq @0801C8E2 b @0801CA38 @0801C8E2: movs r0, 0x1 bl stdpal_get movs r1, 0x20 movs r2, 0x20 bl gpu_pal_apply ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] ldr r0, =0x02022c78 mov r8, r0 ldr r0, [r0] movs r4, 0xDE lsls r4, 1 adds r0, r4 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x10 movs r2, 0x20 bl gpu_pal_apply mov r2, r8 ldr r1, [r2] adds r4, r1, r4 ldr r0, [r4] ldr r0, [r0, 0x8] movs r6, 0xE9 lsls r6, 2 adds r1, r6 bl LZ77UnCompWram mov r3, r8 ldr r1, [r3] adds r1, r6 movs r4, 0x1E str r4, [sp] movs r5, 0x3 str r5, [sp, 0x4] str r7, [sp, 0x8] str r7, [sp, 0xC] str r4, [sp, 0x10] str r5, [sp, 0x14] movs r0, 0x1 mov r10, r0 str r0, [sp, 0x18] movs r2, 0x8 mov r9, r2 str r2, [sp, 0x1C] str r7, [sp, 0x20] movs r2, 0 movs r3, 0 bl 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 .pool @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, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] ldr r4, =0x02022c78 ldr r1, [r4] movs r3, 0xE5 lsls r3, 2 adds r0, r1, r3 movs r2, 0xE3 lsls r2, 1 adds r1, r2 bl sub_81AF380 ldr r1, [r4] ldr r3, =0x000001c1 adds r2, r1, r3 movs r1, 0 strb r0, [r2] movs r0, 0x1 negs r0, r0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 bl fade_and_return_progress_probably b @0801CA1E .align 2, 0 .pool @0801CA04: bl fade_and_return_progress_probably lsls r0, 24 cmp r0, 0 bne @0801CA38 ldr r0, [r5] adds r0, r4 ldrb r2, [r0] movs r1, 0x1 ands r1, r2 strb r1, [r0] movs r0, 0x1 b @0801CA3A @0801CA1E: ldr r0, =0x02022c78 ldr r2, [r0] movs r0, 0xE0 lsls r0, 1 adds r2, r0 ldrb r3, [r2] lsrs r1, r3, 1 adds r1, 0x1 lsls r1, 1 movs r0, 0x1 ands r0, r3 orrs r0, r1 strb r0, [r2] @0801CA38: movs r0, 0 @0801CA3A: add sp, 0x24 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801C758 thumb_func_start sub_801CA50 sub_801CA50: ; 801CA50 push {r4,r5,lr} sub sp, 0x8 adds r2, r0, 0 ldr r5, =0x02022c78 ldr r0, [r5] cmp r0, 0 bne @0801CA68 movs r0, 0x1 negs r0, r0 b @0801CC2A .align 2, 0 .pool @0801CA68: movs r4, 0xE0 lsls r4, 1 adds r0, r4 ldrb r0, [r0] lsrs r0, 1 cmp r0, 0x5 bls @0801CA78 b @0801CBF4 @0801CA78: lsls r0, 2 ldr r1, =@0801CA88 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801CA88: .4byte @0801CAA0 .4byte @0801CAB2 .4byte @0801CAF4 .4byte @0801CB54 .4byte @0801CB84 .4byte @0801CBC0 @0801CAA0: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl 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, =0x02022c78 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 .pool @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, =0x02022c78 ldr r0, [r4] ldr r2, =0x000001c1 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @0801CC0E bl sub_81AF620 ldr r0, [r4] ldr r2, =0x000001c1 adds r1, r0, r2 movs r0, 0xFF strb r0, [r1] b @0801CC0E .align 2, 0 .pool @0801CBC0: ldr r0, =0x02022c60 ldrb r0, [r0] adds r1, r2, 0 bl sub_80186EC movs r0, 0x3 bl sub_8018798 movs r0, 0 bl 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 .pool @0801CBF4: bl fade_and_return_progress_probably lsls r0, 24 cmp r0, 0 bne @0801CC28 ldr r0, [r5] adds r0, r4 ldrb r2, [r0] movs r1, 0x1 ands r1, r2 strb r1, [r0] movs r0, 0x1 b @0801CC2A @0801CC0E: ldr r0, =0x02022c78 ldr r2, [r0] movs r0, 0xE0 lsls r0, 1 adds r2, r0 ldrb r3, [r2] lsrs r1, r3, 1 adds r1, 0x1 lsls r1, 1 movs r0, 0x1 ands r0, r3 orrs r0, r1 strb r0, [r2] @0801CC28: movs r0, 0 @0801CC2A: add sp, 0x8 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801CA50 thumb_func_start sub_801CC38 sub_801CC38: ; 801CC38 push {r4,r5,lr} ldr r4, =0x02022c78 ldr r2, [r4] movs r5, 0xE0 lsls r5, 1 adds r0, r2, r5 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0801CC72 ldr r0, =0x000001c1 adds r1, r2, r0 ldrb r0, [r1] cmp r0, 0xFF beq @0801CC72 bl sub_81AF620 ldr r0, [r4] ldr r2, =0x000001c1 adds r1, r0, r2 movs r0, 0xFF strb r0, [r1] ldr r1, [r4] adds r1, r5 ldrb r0, [r1] movs r2, 0x1 orrs r0, r2 strb r0, [r1] @0801CC72: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801CC38 thumb_func_start sub_801CC80 sub_801CC80: ; 801CC80 push {r4,lr} ldr r4, =0x02022c78 ldr r2, [r4] movs r1, 0xE0 lsls r1, 1 adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0801CCC0 movs r3, 0xE5 lsls r3, 2 adds r0, r2, r3 movs r3, 0xE3 lsls r3, 1 adds r1, r2, r3 bl sub_81AF380 ldr r1, [r4] ldr r2, =0x000001c1 adds r1, r2 strb r0, [r1] ldr r1, [r4] movs r3, 0xE0 lsls r3, 1 adds r1, r3 ldrb r2, [r1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1] @0801CCC0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801CC80 thumb_func_start sub_801CCD0 sub_801CCD0: ; 801CCD0 push {r4-r6,lr} lsls r0, 16 lsrs r4, r0, 16 adds r3, r4, 0 ldr r2, =0x02022c78 ldr r0, [r2] mov r12, r0 movs r0, 0xE1 lsls r0, 1 add r0, r12 ldrb r1, [r0] movs r5, 0x1 adds r0, r5, 0 ands r0, r1 adds r6, r2, 0 cmp r0, 0 beq @0801CD00 bl sub_801CFA4 @0801CCF6: movs r0, 0xFF b @0801CDC6 .align 2, 0 .pool @0801CD00: cmp r4, 0x2 beq @0801CD1C cmp r4, 0x2 bgt @0801CD0E cmp r4, 0x1 beq @0801CD18 b @0801CCF6 @0801CD0E: cmp r3, 0x40 beq @0801CD20 cmp r3, 0x80 beq @0801CD50 b @0801CCF6 @0801CD18: movs r0, 0 b @0801CDC6 @0801CD1C: movs r0, 0x1 b @0801CDC6 @0801CD20: movs r0, 0xE3 lsls r0, 1 add r0, r12 ldrh r0, [r0] cmp r0, 0 beq @0801CCF6 movs r0, 0xE0 lsls r0, 1 add r0, r12 ldrb r1, [r0] adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @0801CCF6 ldr r2, =0x000001c3 add r2, r12 ldrb r1, [r2] movs r0, 0x2 negs r0, r0 ands r0, r1 b @0801CD7E .align 2, 0 .pool @0801CD50: movs r0, 0xE3 lsls r0, 1 add r0, r12 movs r1, 0xE2 lsls r1, 1 add r1, r12 ldrh r0, [r0] ldrh r1, [r1] cmp r0, r1 beq @0801CCF6 movs r0, 0xE0 lsls r0, 1 add r0, r12 ldrb r1, [r0] adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @0801CCF6 ldr r2, =0x000001c3 add r2, r12 ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 @0801CD7E: strb r0, [r2] ldr r2, [r6] movs r4, 0xE1 lsls r4, 1 adds r2, r4 ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r3, [r6] adds r3, r4 ldrb r1, [r3] movs r2, 0x1 adds r0, r2, 0 ands r0, r1 movs r1, 0x4 orrs r0, r1 strb r0, [r3] ldr r1, [r6] adds r4, 0x1 adds r1, r4 ldrb r3, [r1] adds r0, r2, 0 ands r0, r3 strb r0, [r1] ldr r0, [r6] adds r0, r4 ldrb r0, [r0] ands r2, r0 cmp r2, 0 beq @0801CDC4 movs r0, 0x3 b @0801CDC6 .align 2, 0 .pool @0801CDC4: movs r0, 0x2 @0801CDC6: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_801CCD0 thumb_func_start sub_801CDCC sub_801CDCC: ; 801CDCC push {r4-r6,lr} movs r5, 0 ldr r4, =0x02022c78 ldr r1, [r4] movs r2, 0xE7 lsls r2, 1 adds r0, r1, r2 adds r1, 0x4 movs r2, 0x28 bl memcpy ldr r0, [r4] movs r3, 0xFB lsls r3, 1 adds r1, r0, r3 movs r0, 0xFF strb r0, [r1] adds r6, r4, 0 @0801CDF0: ldr r2, [r6] lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r4, r1, r5 adds r0, r4, r2 ldr r3, =0x000001f7 adds r0, r3 adds r1, r2 adds r1, 0x2C movs r2, 0x28 bl memcpy ldr r0, [r6] ldr r1, =0x0000021f adds r0, r1 adds r0, r4 movs r1, 0xFF strb r1, [r0] cmp r5, 0x7 bls @0801CE34 ldr r1, [r6] ldr r2, =0x000001f7 adds r0, r1, r2 adds r0, r4 ldrb r0, [r0] cmp r0, 0xFF beq @0801CE34 movs r3, 0xE2 lsls r3, 1 adds r1, r3 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0801CE34: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x9 bls @0801CDF0 ldr r2, =0x02022c78 ldr r1, [r2] movs r4, 0xE5 lsls r4, 2 adds r1, r4 ldr r0, =gUnknown_082F1DF8 ldm r0!, {r3-r5} stm r1!, {r3-r5} ldr r0, [r0] str r0, [r1] ldr r2, [r2] movs r5, 0xE2 lsls r5, 1 adds r0, r2, r5 ldrh r1, [r0] movs r3, 0xE7 lsls r3, 2 adds r0, r2, r3 strh r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801CDCC thumb_func_start sub_801CE7C sub_801CE7C: ; 801CE7C push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0xC movs r5, 0 ldr r6, =0x02022c78 ldr r0, [r6] movs r7, 0xE4 lsls r7, 1 adds r0, r7 ldrb r0, [r0] bl 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, =gUnknown_082F1DE0 adds r3, r1 str r3, [sp] str r5, [sp, 0x4] add r4, r8 str r4, [sp, 0x8] movs r1, 0x3 movs r3, 0x6 bl box_print @0801CF1C: ldr r6, =0x02022c78 ldr r4, [r6] movs r1, 0xE5 lsls r1, 1 adds r0, r4, r1 ldrb r0, [r0] lsls r3, r5, 4 adds r3, 0x2 lsls r3, 24 lsrs r3, 24 movs r2, 0xDE lsls r2, 1 adds r1, r4, r2 ldr r1, [r1] ldrb r1, [r1] lsrs r1, 4 lsls r2, r1, 1 adds r2, r1 ldr r1, =gUnknown_082F1DE0 adds r2, r1 str r2, [sp] movs r1, 0 str r1, [sp, 0x4] lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r5 ldr r2, =0x000001f7 adds r1, r2 adds r4, r1 str r4, [sp, 0x8] movs r1, 0x3 movs r2, 0 bl box_print adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x9 bls @0801CF1C ldr r0, [r6] movs r3, 0xE4 lsls r3, 1 adds r0, r3 ldrb r0, [r0] movs r1, 0x3 bl 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 .pool thumb_func_end sub_801CE7C thumb_func_start sub_801CFA4 sub_801CFA4: ; 801CFA4 push {r4-r6,lr} ldr r0, =0x02022c78 ldr r1, [r0] movs r2, 0xE1 lsls r2, 1 adds r0, r1, r2 ldrb r0, [r0] lsrs r4, r0, 1 lsls r4, 8 ldr r6, =0x000001c3 adds r0, r1, r6 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0801CFE4 movs r0, 0x2 adds r1, r4, 0 movs r2, 0x1 bl bg_change_y_offset movs r0, 0x3 adds r1, r4, 0 movs r2, 0x1 bl bg_change_y_offset b @0801CFF8 .align 2, 0 .pool @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, =0x02022c78 ldr r0, [r3] ldr r2, =0x000001c3 adds r5, r0, r2 ldrb r4, [r5] lsrs r1, r4, 1 movs r6, 0xE1 lsls r6, 1 adds r0, r6 ldrb r0, [r0] lsrs r0, 1 adds r1, r0 lsls r1, 1 movs r6, 0x1 adds r0, r6, 0 ands r0, r4 orrs r0, r1 strb r0, [r5] ldr r1, [r3] adds r2, r1, r2 ldrb r2, [r2] lsrs r0, r2, 1 cmp r0, 0xF bls @0801D070 adds r0, r6, 0 ands r0, r2 cmp r0, 0 beq @0801D044 movs r0, 0xE3 lsls r0, 1 adds r1, r0 ldrh r0, [r1] adds r0, 0x1 b @0801D04E .align 2, 0 .pool @0801D044: movs r2, 0xE3 lsls r2, 1 adds r1, r2 ldrh r0, [r1] subs r0, 0x1 @0801D04E: strh r0, [r1] ldr r0, [r3] movs r6, 0xE1 lsls r6, 1 adds r2, r0, r6 ldrb r1, [r2] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2] ldr r0, [r3] ldr r1, =0x000001c3 adds r2, r0, r1 ldrb r1, [r2] movs r0, 0x1 ands r0, r1 strb r0, [r2] @0801D070: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801CFA4 thumb_func_start sub_801D07C sub_801D07C: ; 801D07C push {r4,lr} ldr r4, =0x02022c7c movs r0, 0x60 bl malloc_and_clear str r0, [r4] ldr r1, =gUnknown_082F298C movs r2, 0 movs r3, 0x1 bl mevent_srv_init_common pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801D07C thumb_func_start sub_801D0A0 sub_801D0A0: ; 801D0A0 push {r4,lr} ldr r4, =0x02022c7c movs r0, 0x60 bl malloc_and_clear str r0, [r4] ldr r1, =gUnknown_082F29EC movs r2, 0 movs r3, 0x1 bl mevent_srv_init_common pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801D0A0 thumb_func_start sub_801D0C4 sub_801D0C4: ; 801D0C4 push {r4-r6,lr} adds r6, r0, 0 ldr r4, =0x02022c7c ldr r0, [r4] cmp r0, 0 bne @0801D0D8 movs r0, 0x3 b @0801D0F8 .align 2, 0 .pool @0801D0D8: bl mevent_dispatch_08145600 adds r5, r0, 0 cmp r5, 0x3 bne @0801D0F6 ldr r0, [r4] ldr r1, [r0, 0x4] strh r1, [r6] bl mevent_srv_free_resources ldr r0, [r4] bl free movs r0, 0 str r0, [r4] @0801D0F6: adds r0, r5, 0 @0801D0F8: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_801D0C4 thumb_func_start mevent_srv_init_common mevent_srv_init_common: ; 801D100 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} adds r4, r0, 0 adds r6, r1, 0 mov r8, r2 mov r9, r3 movs r5, 0 str r5, [r4] str r5, [r4, 0x8] movs r0, 0xA6 lsls r0, 1 bl 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, =@0801D21C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801D21C: .4byte @0801D298 .4byte @0801D2A2 .4byte @0801D2A8 .4byte @0801D2E2 .4byte @0801D2D8 .4byte @0801D2BA .4byte @0801D2C6 .4byte @0801D2EC .4byte @0801D300 .4byte @0801D308 .4byte @0801D31E .4byte @0801D32E .4byte @0801D33A .4byte @0801D360 .4byte @0801D348 .4byte @0801D390 .4byte @0801D378 .4byte @0801D3DC .4byte @0801D3A8 .4byte @0801D3C0 .4byte @0801D3CE .4byte @0801D406 .4byte @0801D3EA .4byte @0801D3F8 .4byte @0801D40E .4byte @0801D418 .4byte @0801D422 .4byte @0801D43C .4byte @0801D450 .4byte @0801D458 .4byte @0801D2CC @0801D298: movs r0, 0x1 str r0, [r5, 0x8] ldr r0, [r3, 0x4] str r0, [r5, 0x4] b @0801D464 @0801D2A2: movs r0, 0x3 str r0, [r5, 0x8] b @0801D464 @0801D2A8: adds r0, r5, 0 adds r0, 0x38 ldr r1, [r3, 0x4] ldr r2, [r5, 0x14] bl sub_801D928 movs r0, 0x2 str r0, [r5, 0x8] b @0801D464 @0801D2BA: ldr r0, [r5, 0x20] ldr r1, [r5, 0x14] movs r2, 0x64 bl memcpy b @0801D464 @0801D2C6: ldr r0, [r5, 0x20] movs r1, 0 b @0801D2D0 @0801D2CC: ldr r0, [r5, 0x20] movs r1, 0x1 @0801D2D0: bl sub_801B6A0 str r0, [r5, 0x4] b @0801D464 @0801D2D8: ldr r1, [r5, 0x4] ldr r0, [r3, 0x4] cmp r1, r0 beq @0801D2E2 b @0801D464 @0801D2E2: movs r0, 0 str r0, [r5, 0xC] ldr r0, [r3, 0x8] str r0, [r5, 0x10] b @0801D464 @0801D2EC: ldr r0, [r3, 0x8] ldr r1, [r5, 0x18] bl sub_801D188 adds r2, r0, 0 ldr r1, [r5, 0x20] bl sub_801B6EC str r0, [r5, 0x4] b @0801D464 @0801D300: ldr r0, [r5, 0x14] ldr r0, [r0] str r0, [r5, 0x4] b @0801D464 @0801D308: ldr r0, [r3, 0x8] adds r1, r5, 0 adds r1, 0x34 bl sub_801D188 adds r2, r0, 0 ldr r1, [r5, 0x20] bl sub_801B708 str r0, [r5, 0x4] b @0801D464 @0801D31E: ldr r0, [r5, 0x20] ldr r1, [r3, 0x4] bl sub_801B784 lsls r0, 16 lsrs r0, 16 str r0, [r5, 0x4] b @0801D464 @0801D32E: ldr r0, [r5, 0x20] ldr r1, [r3, 0x8] bl sub_801B748 str r0, [r5, 0x4] b @0801D464 @0801D33A: ldr r0, [r3, 0x8] ldr r1, [r5, 0x14] ldr r1, [r1] bl sub_801D194 str r0, [r5, 0x4] b @0801D464 @0801D348: ldr r0, [r3, 0x8] ldr r1, [r5, 0x1C] bl sub_801D188 adds r2, r0, 0 movs r3, 0xDE lsls r3, 1 adds r0, r5, 0 movs r1, 0x17 bl mevent_srv_814501C b @0801D464 @0801D360: ldr r0, [r3, 0x8] ldr r1, [r5, 0x18] bl sub_801D188 adds r2, r0, 0 movs r3, 0xA6 lsls r3, 1 adds r0, r5, 0 movs r1, 0x16 bl mevent_srv_814501C b @0801D464 @0801D378: ldr r0, [r3, 0x8] adds r1, r5, 0 adds r1, 0x34 bl sub_801D188 adds r2, r0, 0 adds r0, r5, 0 movs r1, 0x18 movs r3, 0x4 bl mevent_srv_814501C b @0801D464 @0801D390: ldr r2, [r3, 0x8] cmp r2, 0 bne @0801D39C ldr r2, [r5, 0x24] ldr r3, [r5, 0x28] b @0801D39E @0801D39C: ldr r3, [r3, 0x4] @0801D39E: adds r0, r5, 0 movs r1, 0x19 bl mevent_srv_814501C b @0801D464 @0801D3A8: ldr r2, [r3, 0x8] cmp r2, 0 bne @0801D3B4 ldr r2, [r5, 0x2C] ldr r3, [r5, 0x30] b @0801D3B6 @0801D3B4: ldr r3, [r3, 0x4] @0801D3B6: adds r0, r5, 0 movs r1, 0x10 bl mevent_srv_814501C b @0801D464 @0801D3C0: ldr r2, [r3, 0x8] adds r0, r5, 0 movs r1, 0x1A movs r3, 0xBC bl mevent_srv_814501C b @0801D464 @0801D3CE: ldr r2, [r3, 0x8] ldr r3, [r3, 0x4] adds r0, r5, 0 movs r1, 0x15 bl mevent_srv_814501C b @0801D464 @0801D3DC: ldr r2, [r3, 0x8] ldr r3, [r3, 0x4] adds r0, r5, 0 movs r1, 0x1C bl mevent_srv_814501C b @0801D464 @0801D3EA: ldr r0, [r5, 0x18] ldr r1, [r3, 0x8] movs r2, 0xA6 lsls r2, 1 bl memcpy b @0801D464 @0801D3F8: ldr r0, [r5, 0x1C] ldr r1, [r3, 0x8] movs r2, 0xDE lsls r2, 1 bl memcpy b @0801D464 @0801D406: ldr r0, [r3, 0x8] ldr r0, [r0] str r0, [r5, 0x34] b @0801D464 @0801D40E: ldr r0, [r3, 0x8] str r0, [r5, 0x24] ldr r0, [r3, 0x4] str r0, [r5, 0x28] b @0801D464 @0801D418: ldr r0, [r3, 0x8] str r0, [r5, 0x2C] ldr r0, [r3, 0x4] str r0, [r5, 0x30] b @0801D464 @0801D422: ldr r4, [r5, 0x18] bl sav1_get_mevent_buffer_1 adds r1, r0, 0 movs r2, 0xA6 lsls r2, 1 adds r0, r4, 0 bl memcpy ldr r0, [r5, 0x18] bl sub_801B3C0 b @0801D464 @0801D43C: ldr r4, [r5, 0x1C] bl sub_801B00C adds r1, r0, 0 movs r2, 0xDE lsls r2, 1 adds r0, r4, 0 bl memcpy b @0801D464 @0801D450: bl sub_8099244 str r0, [r5, 0x24] b @0801D464 @0801D458: ldr r2, [r3, 0x8] ldr r3, [r3, 0x4] adds r0, r5, 0 movs r1, 0x1B bl mevent_srv_814501C @0801D464: movs r0, 0x1 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_801D1F0 thumb_func_start mevent_dispatch_08145600 mevent_dispatch_08145600: ; 801D46C push {lr} ldr r2, =gUnknown_082F2548 ldr r1, [r0, 0x8] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl _call_via_r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end mevent_dispatch_08145600 thumb_func_start sub_801D484 sub_801D484: ; 801D484 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02022c80 movs r0, 0x50 bl 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 .pool thumb_func_end sub_801D484 thumb_func_start sub_801D4A8 sub_801D4A8: ; 801D4A8 push {r4-r6,lr} adds r6, r0, 0 ldr r4, =0x02022c80 ldr r0, [r4] cmp r0, 0 bne @0801D4BC movs r0, 0x6 b @0801D4DC .align 2, 0 .pool @0801D4BC: bl mevent_srv_ish_exec adds r5, r0, 0 cmp r5, 0x6 bne @0801D4DA ldr r0, [r4] ldr r1, [r0, 0x4] strh r1, [r6] bl sub_801D55C ldr r0, [r4] bl free movs r0, 0 str r0, [r4] @0801D4DA: adds r0, r5, 0 @0801D4DC: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_801D4A8 thumb_func_start sub_801D4E4 sub_801D4E4: ; 801D4E4 ldr r0, =0x02022c80 ldr r1, [r0] ldr r0, [r1, 0xC] adds r0, 0x1 str r0, [r1, 0xC] bx lr .align 2, 0 .pool thumb_func_end sub_801D4E4 thumb_func_start sub_801D4F4 sub_801D4F4: ; 801D4F4 ldr r0, =0x02022c80 ldr r0, [r0] ldr r0, [r0, 0x20] bx lr .align 2, 0 .pool thumb_func_end sub_801D4F4 thumb_func_start sub_801D500 sub_801D500: ; 801D500 ldr r1, =0x02022c80 ldr r1, [r1] str r0, [r1, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_801D500 thumb_func_start mevent_srv_ish_init mevent_srv_ish_init: ; 801D50C push {r4-r6,lr} mov r6, r8 push {r6} adds r4, r0, 0 adds r6, r1, 0 mov r8, r2 movs r0, 0 str r0, [r4] str r0, [r4, 0x8] str r0, [r4, 0xC] movs r5, 0x80 lsls r5, 3 adds r0, r5, 0 bl 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, =0x05000100 mov r0, sp bl CpuSet ldr r2, [r4, 0x14] str r5, [r2] adds r4, 0x24 adds r0, r4, 0 adds r1, r6, 0 movs r3, 0x4 bl sub_801D904 add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801D59C thumb_func_start sub_801D5D0 sub_801D5D0: ; 801D5D0 push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0x1C] ldr r1, =gUnknown_082F2598 movs r2, 0x80 lsls r2, 3 bl memcpy movs r1, 0 str r1, [r4, 0x10] movs r0, 0x4 str r0, [r4, 0x8] str r1, [r4, 0xC] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801D5D0 thumb_func_start sub_801D5F8 sub_801D5F8: ; 801D5F8 movs r0, 0x6 bx lr thumb_func_end sub_801D5F8 thumb_func_start sub_801D5FC sub_801D5FC: ; 801D5FC push {r4,lr} adds r4, r0, 0 adds r0, 0x24 bl sub_801D8C0 cmp r0, 0 beq @0801D612 movs r0, 0x4 str r0, [r4, 0x8] movs r0, 0 str r0, [r4, 0xC] @0801D612: movs r0, 0x1 pop {r4} pop {r1} bx r1 thumb_func_end sub_801D5FC thumb_func_start sub_801D61C sub_801D61C: ; 801D61C push {r4,lr} adds r4, r0, 0 adds r0, 0x24 bl sub_801D8CC cmp r0, 0 beq @0801D632 movs r0, 0x4 str r0, [r4, 0x8] movs r0, 0 str r0, [r4, 0xC] @0801D632: movs r0, 0x1 pop {r4} pop {r1} bx r1 thumb_func_end sub_801D61C thumb_func_start sub_801D63C sub_801D63C: ; 801D63C push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0x10] lsls r2, r0, 3 ldr r1, [r4, 0x1C] adds r2, r1, r2 adds r0, 0x1 str r0, [r4, 0x10] ldr r0, [r2] cmp r0, 0x15 bls @0801D654 b @0801D804 @0801D654: lsls r0, 2 ldr r1, =@0801D664 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801D664: .4byte @0801D804 .4byte @0801D6BC .4byte @0801D6C4 .4byte @0801D6D4 .4byte @0801D70E .4byte @0801D716 .4byte @0801D6FE .4byte @0801D708 .4byte @0801D764 .4byte @0801D790 .4byte @0801D788 .4byte @0801D72C .4byte @0801D742 .4byte @0801D758 .4byte @0801D77C .4byte @0801D7B8 .4byte @0801D7BC .4byte @0801D7C4 .4byte @0801D7D0 .4byte @0801D6EA .4byte @0801D6D8 .4byte @0801D7F0 @0801D6BC: ldr r0, [r2, 0x4] str r0, [r4, 0x4] movs r0, 0x1 b @0801D7FE @0801D6C4: adds r0, r4, 0 adds r0, 0x24 ldr r1, [r2, 0x4] ldr r2, [r4, 0x18] bl sub_801D928 movs r0, 0x2 b @0801D7FE @0801D6D4: movs r0, 0x3 b @0801D7FE @0801D6D8: adds r0, r4, 0 adds r0, 0x24 ldr r2, [r4, 0x14] movs r1, 0x14 movs r3, 0 bl sub_801D904 movs r0, 0x3 b @0801D7FE @0801D6EA: ldrb r0, [r2, 0x4] bl sub_80847F8 adds r2, r0, 0 adds r0, r4, 0 movs r1, 0x12 bl sub_801D59C movs r0, 0x3 b @0801D7FE @0801D6FE: ldr r0, [r4, 0x4] cmp r0, 0 beq @0801D706 b @0801D804 @0801D706: b @0801D70E @0801D708: ldr r0, [r4, 0x4] cmp r0, 0x1 bne @0801D804 @0801D70E: adds r0, r4, 0 bl sub_801D580 b @0801D804 @0801D716: ldr r0, [r4, 0x20] ldr r1, [r4, 0x18] movs r2, 0x40 bl memcpy movs r0, 0x5 str r0, [r4, 0x8] movs r0, 0 str r0, [r4, 0xC] movs r0, 0x2 b @0801D806 @0801D72C: ldr r0, [r4, 0x20] ldr r1, [r4, 0x18] movs r2, 0x40 bl memcpy movs r0, 0x5 str r0, [r4, 0x8] movs r0, 0 str r0, [r4, 0xC] movs r0, 0x3 b @0801D806 @0801D742: ldr r0, [r4, 0x20] ldr r1, [r4, 0x18] movs r2, 0x40 bl memcpy movs r0, 0x5 str r0, [r4, 0x8] movs r0, 0 str r0, [r4, 0xC] movs r0, 0x5 b @0801D806 @0801D758: movs r0, 0x5 str r0, [r4, 0x8] movs r0, 0 str r0, [r4, 0xC] movs r0, 0x4 b @0801D806 @0801D764: ldr r0, [r4, 0x14] ldr r1, [r4, 0x4C] bl sub_801B580 adds r0, r4, 0 adds r0, 0x24 ldr r2, [r4, 0x14] movs r1, 0x11 movs r3, 0x64 bl sub_801D904 b @0801D804 @0801D77C: ldr r2, [r4, 0x4] adds r0, r4, 0 movs r1, 0x13 bl sub_801D59C b @0801D804 @0801D788: ldr r0, [r4, 0x18] bl sub_801B21C b @0801D804 @0801D790: ldr r0, [r4, 0x18] bl sub_801B1A4 cmp r0, 0 bne @0801D7AC ldr r0, [r4, 0x18] bl sub_801B078 adds r0, r4, 0 movs r1, 0x13 movs r2, 0 bl sub_801D59C b @0801D804 @0801D7AC: adds r0, r4, 0 movs r1, 0x13 movs r2, 0x1 bl sub_801D59C b @0801D804 @0801D7B8: movs r0, 0x6 b @0801D7FE @0801D7BC: ldr r0, [r4, 0x18] bl sub_801B508 b @0801D804 @0801D7C4: ldr r0, [r4, 0x18] movs r1, 0xFA lsls r1, 2 bl sub_80992A0 b @0801D804 @0801D7D0: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bec adds r0, r1 ldr r1, [r4, 0x18] movs r2, 0xBC bl memcpy bl sub_81652B4 b @0801D804 .align 2, 0 .pool @0801D7F0: ldr r0, =0x0201c000 ldr r1, [r4, 0x18] movs r2, 0x80 lsls r2, 3 bl memcpy movs r0, 0x7 @0801D7FE: str r0, [r4, 0x8] movs r0, 0 str r0, [r4, 0xC] @0801D804: movs r0, 0x1 @0801D806: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801D63C thumb_func_start sub_801D810 sub_801D810: ; 801D810 push {lr} adds r1, r0, 0 ldr r0, [r1, 0xC] cmp r0, 0 beq @0801D822 movs r0, 0x4 str r0, [r1, 0x8] movs r0, 0 str r0, [r1, 0xC] @0801D822: movs r0, 0x1 pop {r1} bx r1 thumb_func_end sub_801D810 thumb_func_start sub_801D828 sub_801D828: ; 801D828 push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0xC] cmp r0, 0 beq @0801D838 cmp r0, 0x1 beq @0801D846 b @0801D858 @0801D838: ldr r0, [r4, 0x18] bl sub_8153870 ldr r0, [r4, 0xC] adds r0, 0x1 str r0, [r4, 0xC] b @0801D858 @0801D846: adds r0, r4, 0x4 bl sub_8153884 adds r1, r0, 0 cmp r1, 0 bne @0801D858 movs r0, 0x4 str r0, [r4, 0x8] str r1, [r4, 0xC] @0801D858: movs r0, 0x1 pop {r4} pop {r1} bx r1 thumb_func_end sub_801D828 thumb_func_start sub_801D860 sub_801D860: ; 801D860 push {r4,lr} adds r4, r0, 0 ldr r3, =0x0201c000 adds r0, r4, 0x4 ldr r1, =0x03005d90 ldr r1, [r1] ldr r2, =0x03005d8c ldr r2, [r2] bl _call_via_r3 cmp r0, 0x1 bne @0801D880 movs r0, 0x4 str r0, [r4, 0x8] movs r0, 0 str r0, [r4, 0xC] @0801D880: movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801D860 thumb_func_start mevent_srv_ish_exec mevent_srv_ish_exec: ; 801D894 push {r4,r5,lr} sub sp, 0x20 mov r2, sp ldr r1, =gUnknown_082F255C ldm r1!, {r3-r5} stm r2!, {r3-r5} ldm r1!, {r3-r5} stm r2!, {r3-r5} ldm r1!, {r3,r4} stm r2!, {r3,r4} ldr r1, [r0, 0x8] lsls r1, 2 add r1, sp ldr r1, [r1] bl _call_via_r1 add sp, 0x20 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end mevent_srv_ish_exec thumb_func_start sub_801D8C0 sub_801D8C0: ; 801D8C0 push {lr} ldr r1, [r0, 0x20] bl _call_via_r1 pop {r1} bx r1 thumb_func_end sub_801D8C0 thumb_func_start sub_801D8CC sub_801D8CC: ; 801D8CC push {lr} ldr r1, [r0, 0x24] bl _call_via_r1 pop {r1} bx r1 thumb_func_end sub_801D8CC thumb_func_start sub_801D8D8 sub_801D8D8: ; 801D8D8 movs r3, 0 strb r1, [r0, 0x4] strb r2, [r0, 0x5] str r3, [r0] strh r3, [r0, 0x12] strh r3, [r0, 0x14] strh r3, [r0, 0x10] strh r3, [r0, 0xA] strh r3, [r0, 0xC] strh r3, [r0, 0x8] str r3, [r0, 0x1C] str r3, [r0, 0x18] ldr r1, =sub_801DA5C str r1, [r0, 0x24] ldr r1, =sub_801D988 str r1, [r0, 0x20] bx lr .align 2, 0 .pool thumb_func_end sub_801D8D8 thumb_func_start sub_801D904 sub_801D904: ; 801D904 push {r4,lr} adds r4, r0, 0 movs r0, 0 str r0, [r4] strh r1, [r4, 0xE] strh r0, [r4, 0x10] strh r0, [r4, 0x12] cmp r3, 0 beq @0801D91A strh r3, [r4, 0x14] b @0801D920 @0801D91A: movs r0, 0x80 lsls r0, 3 strh r0, [r4, 0x14] @0801D920: str r2, [r4, 0x1C] pop {r4} pop {r0} bx r0 thumb_func_end sub_801D904 thumb_func_start sub_801D928 sub_801D928: ; 801D928 movs r3, 0 str r3, [r0] strh r1, [r0, 0x6] strh r3, [r0, 0x8] strh r3, [r0, 0xA] strh r3, [r0, 0xC] str r2, [r0, 0x18] bx lr thumb_func_end sub_801D928 thumb_func_start sub_801D938 sub_801D938: ; 801D938 push {lr} adds r3, r0, 0 adds r0, r1, 0 lsls r3, 8 ldr r1, =0x020223c4 adds r3, r1 adds r1, r3, 0 bl memcpy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801D938 thumb_func_start sub_801D954 sub_801D954: ; 801D954 push {r4,lr} adds r4, r0, 0 bl sub_800A550 lsls r0, 24 lsrs r0, 24 asrs r0, r4 movs r1, 0x1 ands r0, r1 cmp r0, 0 bne @0801D96E movs r0, 0 b @0801D970 @0801D96E: movs r0, 0x1 @0801D970: pop {r4} pop {r1} bx r1 thumb_func_end sub_801D954 thumb_func_start sub_801D978 sub_801D978: ; 801D978 push {lr} lsls r0, 24 lsrs r0, 24 bl sub_800A5EC pop {r0} bx r0 thumb_func_end sub_801D978 thumb_func_start sub_801D988 sub_801D988: ; 801D988 push {r4-r6,lr} sub sp, 0x8 adds r5, r0, 0 ldr r6, [r5] cmp r6, 0x1 beq @0801D9EC cmp r6, 0x1 bgt @0801D99E cmp r6, 0 beq @0801D9A4 b @0801DA52 @0801D99E: cmp r6, 0x2 beq @0801DA38 b @0801DA52 @0801D9A4: ldrb r0, [r5, 0x5] bl sub_801D954 cmp r0, 0 beq @0801DA52 ldrb r0, [r5, 0x5] mov r4, sp mov r1, sp movs r2, 0x8 bl sub_801D938 ldrh r1, [r4, 0x4] strh r1, [r5, 0xC] ldrh r0, [r4, 0x2] strh r0, [r5, 0xA] lsls r1, 16 movs r0, 0x80 lsls r0, 19 cmp r1, r0 bls @0801D9D2 @0801D9CC: bl sub_8010198 b @0801DA52 @0801D9D2: mov r1, sp ldrh r0, [r5, 0x6] ldrh r1, [r1] cmp r0, r1 bne @0801D9CC strh r6, [r5, 0x8] ldrb r0, [r5, 0x5] bl sub_801D978 ldr r0, [r5] adds r0, 0x1 str r0, [r5] b @0801DA52 @0801D9EC: ldrb r0, [r5, 0x5] bl sub_801D954 cmp r0, 0 beq @0801DA52 ldrh r0, [r5, 0x8] lsls r1, r0, 6 subs r1, r0 lsls r3, r1, 2 ldrh r0, [r5, 0xC] subs r2, r0, r3 cmp r2, 0xFC bhi @0801DA1E ldrb r0, [r5, 0x5] ldr r1, [r5, 0x18] adds r1, r3 bl sub_801D938 ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] ldr r0, [r5] adds r0, 0x1 str r0, [r5] b @0801DA30 @0801DA1E: ldrb r0, [r5, 0x5] ldr r1, [r5, 0x18] adds r1, r3 movs r2, 0xFC bl sub_801D938 ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @0801DA30: ldrb r0, [r5, 0x5] bl sub_801D978 b @0801DA52 @0801DA38: ldr r0, [r5, 0x18] ldrh r1, [r5, 0xC] bl sub_806F928 lsls r0, 16 lsrs r0, 16 ldrh r1, [r5, 0xA] cmp r0, r1 bne @0801D9CC movs r0, 0 str r0, [r5] movs r0, 0x1 b @0801DA54 @0801DA52: movs r0, 0 @0801DA54: add sp, 0x8 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_801D988 thumb_func_start sub_801DA5C sub_801DA5C: ; 801DA5C push {r4,r5,lr} sub sp, 0x8 adds r4, r0, 0 ldr r5, [r4] cmp r5, 0x1 beq @0801DAC8 cmp r5, 0x1 bgt @0801DA72 cmp r5, 0 beq @0801DA7C b @0801DB5E @0801DA72: cmp r5, 0x2 beq @0801DB1C cmp r5, 0x3 beq @0801DB46 b @0801DB5E @0801DA7C: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801DB5E ldrh r1, [r4, 0xE] ldr r2, =0xffff0000 ldr r0, [sp] ands r0, r2 orrs r0, r1 str r0, [sp] ldrh r1, [r4, 0x14] ldr r0, [sp, 0x4] ands r0, r2 orrs r0, r1 str r0, [sp, 0x4] ldr r0, [r4, 0x1C] bl sub_806F928 lsls r0, 16 ldr r2, =0x0000ffff ldr r1, [sp] ands r1, r2 orrs r1, r0 str r1, [sp] lsrs r1, 16 strh r1, [r4, 0x12] strh r5, [r4, 0x10] movs r0, 0 mov r1, sp movs r2, 0x8 bl link_0800A448 b @0801DB3E .align 2, 0 .pool @0801DAC8: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801DB5E ldrb r0, [r4, 0x4] bl sub_801D954 cmp r0, 0 beq @0801DB5E ldrb r0, [r4, 0x4] bl sub_801D978 ldrh r1, [r4, 0x10] lsls r0, r1, 6 subs r0, r1 lsls r3, r0, 2 ldrh r0, [r4, 0x14] subs r0, r3 cmp r0, 0xFC bhi @0801DB08 ldr r1, [r4, 0x1C] adds r1, r3 lsls r2, r0, 16 lsrs r2, 16 movs r0, 0 bl link_0800A448 ldrh r0, [r4, 0x10] adds r0, 0x1 strh r0, [r4, 0x10] b @0801DB3E @0801DB08: ldr r1, [r4, 0x1C] adds r1, r3 movs r0, 0 movs r2, 0xFC bl link_0800A448 ldrh r0, [r4, 0x10] adds r0, 0x1 strh r0, [r4, 0x10] b @0801DB5E @0801DB1C: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801DB5E ldr r0, [r4, 0x1C] ldrh r1, [r4, 0x14] bl sub_806F928 lsls r0, 16 lsrs r0, 16 ldrh r1, [r4, 0x12] cmp r0, r1 beq @0801DB3E bl sub_8010198 b @0801DB5E @0801DB3E: ldr r0, [r4] adds r0, 0x1 str r0, [r4] b @0801DB5E @0801DB46: ldrb r0, [r4, 0x4] bl sub_801D954 cmp r0, 0 beq @0801DB5E ldrb r0, [r4, 0x4] bl sub_801D978 movs r0, 0 str r0, [r4] movs r0, 0x1 b @0801DB60 @0801DB5E: movs r0, 0 @0801DB60: add sp, 0x8 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_801DA5C thumb_func_start sub_801DB68 sub_801DB68: ; 801DB68 push {r4,r5,lr} adds r4, r0, 0 bl sub_801B044 adds r5, r0, 0 movs r0, 0x3 adds r1, r4, 0 ands r1, r0 ldrb r2, [r5] movs r0, 0x4 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5] cmp r4, 0x2 bhi @0801DB8E cmp r4, 0x1 bcs @0801DB94 b @0801DBB8 @0801DB8E: cmp r4, 0x3 beq @0801DBA6 b @0801DBB8 @0801DB94: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xF bl __umodsi3 adds r0, 0x10 b @0801DBB6 @0801DBA6: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xF bl __umodsi3 adds r0, 0x1 @0801DBB6: strb r0, [r5, 0x1] @0801DBB8: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801DB68 thumb_func_start sub_801DBC0 sub_801DBC0: ; 801DBC0 push {lr} bl sub_801B044 movs r1, 0 strb r1, [r0] strb r1, [r0, 0x1] ldr r0, =0x0000402e bl var_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801DBC0 thumb_func_start sub_801DBDC sub_801DBDC: ; 801DBDC push {r4,lr} ldr r0, =0x0000402e 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, =0x01f30000 cmp r0, r1 bls @0801DC10 ldrb r0, [r2] movs r1, 0x1F ands r1, r0 strb r1, [r2] movs r0, 0 strh r0, [r4] @0801DC10: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801DBDC thumb_func_start sub_801DC20 sub_801DC20: ; 801DC20 push {r4-r6,lr} ldr r6, =0x020375f0 bl sub_801B044 adds r4, r0, 0 bl sub_809D490 cmp r0, 0 beq @0801DC3A bl sub_801B0CC cmp r0, 0 bne @0801DC44 @0801DC3A: movs r0, 0 b @0801DCA6 .align 2, 0 .pool @0801DC44: adds r0, r4, 0 bl sub_801DD44 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x6 bhi @0801DCA4 lsls r0, r5, 2 ldr r1, =@0801DC60 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801DC60: .4byte @0801DCA4 .4byte @0801DC7C .4byte @0801DC7C .4byte @0801DCA4 .4byte @0801DC86 .4byte @0801DC96 .4byte @0801DCA4 @0801DC7C: adds r0, r4, 0 bl sub_801DCAC strh r0, [r6] b @0801DCA4 @0801DC86: adds r0, r4, 0 bl sub_801DCAC strh r0, [r6] adds r0, r4, 0 bl sub_801DCD8 b @0801DCA4 @0801DC96: adds r0, r4, 0 bl sub_801DCAC strh r0, [r6] adds r0, r4, 0 bl sub_801DCCC @0801DCA4: adds r0, r5, 0 @0801DCA6: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_801DC20 thumb_func_start sub_801DCAC sub_801DCAC: ; 801DCAC push {r4,lr} ldrb r2, [r0] movs r1, 0x4 negs r1, r1 ands r1, r2 strb r1, [r0] ldrb r4, [r0, 0x1] adds r4, 0x84 movs r1, 0 strb r1, [r0, 0x1] bl sub_801DD10 adds r0, r4, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_801DCAC thumb_func_start sub_801DCCC sub_801DCCC: ; 801DCCC ldrb r2, [r0] movs r1, 0x1D negs r1, r1 ands r1, r2 strb r1, [r0] bx lr thumb_func_end sub_801DCCC thumb_func_start sub_801DCD8 sub_801DCD8: ; 801DCD8 push {r4,lr} adds r3, r0, 0 ldr r0, [r3] lsls r0, 27 lsrs r0, 29 adds r0, 0x1 movs r1, 0x7 ands r0, r1 lsls r0, 2 ldrb r1, [r3] movs r4, 0x1D negs r4, r4 adds r2, r4, 0 ands r2, r1 orrs r2, r0 strb r2, [r3] ldr r0, [r3] lsls r0, 27 lsrs r0, 29 cmp r0, 0x4 bls @0801DD0A ands r2, r4 movs r0, 0x10 orrs r2, r0 strb r2, [r3] @0801DD0A: pop {r4} pop {r0} bx r0 thumb_func_end sub_801DCD8 thumb_func_start sub_801DD10 sub_801DD10: ; 801DD10 push {r4,lr} adds r3, r0, 0 ldr r0, [r3] lsls r0, 24 lsrs r0, 29 adds r0, 0x1 lsls r0, 5 ldrb r1, [r3] movs r4, 0x1F adds r2, r4, 0 ands r2, r1 orrs r2, r0 strb r2, [r3] ldr r0, [r3] lsls r0, 24 lsrs r0, 29 cmp r0, 0x5 bls @0801DD3C ands r2, r4 movs r0, 0xA0 orrs r2, r0 strb r2, [r3] @0801DD3C: pop {r4} pop {r0} bx r0 thumb_func_end sub_801DD10 thumb_func_start sub_801DD44 sub_801DD44: ; 801DD44 push {lr} adds r2, r0, 0 ldrb r1, [r2] movs r0, 0xE0 ands r0, r1 cmp r0, 0xA0 bne @0801DD56 movs r0, 0x6 b @0801DD92 @0801DD56: ldr r1, [r2] lsls r0, r1, 30 lsrs r0, 30 cmp r0, 0x1 beq @0801DD78 cmp r0, 0x1 bgt @0801DD6A cmp r0, 0 beq @0801DD74 b @0801DD90 @0801DD6A: cmp r0, 0x2 beq @0801DD7C cmp r0, 0x3 beq @0801DD80 b @0801DD90 @0801DD74: movs r0, 0x3 b @0801DD92 @0801DD78: movs r0, 0x1 b @0801DD92 @0801DD7C: movs r0, 0x2 b @0801DD92 @0801DD80: lsls r0, r1, 27 lsrs r0, 29 cmp r0, 0x2 bhi @0801DD8C movs r0, 0x4 b @0801DD92 @0801DD8C: movs r0, 0x5 b @0801DD92 @0801DD90: movs r0, 0 @0801DD92: pop {r1} bx r1 thumb_func_end sub_801DD44 thumb_func_start sub_801DD98 sub_801DD98: ; 801DD98 push {r4,lr} ldr r4, =0x02022c84 movs r0, 0xDE lsls r0, 1 bl malloc str r0, [r4] bl sub_801DDD0 ldr r1, =0x030022b0 movs r0, 0x14 strh r0, [r1] movs r0, 0 bl SetVBlankCallback ldr r0, =c2_081284E0 bl set_callback2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801DD98 thumb_func_start sub_801DDD0 sub_801DDD0: ; 801DDD0 push {r4-r7,lr} adds r4, r0, 0 movs r5, 0 movs r0, 0 strh r0, [r4, 0x4] strh r0, [r4, 0x6] strb r5, [r4, 0x10] strb r5, [r4, 0x11] strb r5, [r4, 0x12] strb r5, [r4, 0x14] strb r5, [r4, 0x15] strb r5, [r4, 0x16] movs r0, 0xFF strb r0, [r4, 0x1A] bl sub_8009FCC strb r0, [r4, 0xD] bl link_get_multiplayer_id strb r0, [r4, 0x13] strb r5, [r4, 0x17] strb r5, [r4, 0x18] movs r1, 0xC8 lsls r1, 1 adds r0, r4, r1 bl sub_801EF1C ldr r7, =0x03005d8c ldr r6, =0x00003c88 adds r4, 0xB9 movs r5, 0x9 @0801DE0E: ldr r1, [r7] adds r1, r6 adds r0, r4, 0 bl 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 .pool thumb_func_end sub_801DDD0 thumb_func_start sub_801DE30 sub_801DE30: ; 801DE30 push {r4,lr} ldr r4, =0x02022c84 ldr r0, [r4] ldrb r0, [r0, 0xE] bl remove_task ldr r0, [r4] ldrb r0, [r0, 0xF] bl remove_task ldr r0, [r4] bl free pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801DE30 thumb_func_start c2_081284E0 c2_081284E0: ; 801DE54 push {r4-r6,lr} sub sp, 0x4 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r6, r0, r1 ldrb r0, [r6] cmp r0, 0x1 beq @0801DE8C cmp r0, 0x1 bgt @0801DE74 cmp r0, 0 beq @0801DE7A b @0801DF04 .align 2, 0 .pool @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, =sub_801DF20 bl SetVBlankCallback @0801DEBC: ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] b @0801DF04 .align 2, 0 .pool @0801DEC8: bl fade_and_return_progress_probably ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0801DF04 ldr r0, =sub_801DF38 bl set_callback2 ldr r0, =sub_801DF54 movs r1, 0x8 bl AddTask ldr r4, =0x02022c84 ldr r1, [r4] strb r0, [r1, 0xE] ldr r0, =sub_801F2B4 movs r1, 0x7 bl AddTask ldr r1, [r4] strb r0, [r1, 0xF] bl sub_800E0E8 movs r0, 0xE8 movs r1, 0x96 bl sub_800DFB4 @0801DF04: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_081284E0 thumb_func_start sub_801DF20 sub_801DF20: ; 801DF20 push {lr} bl copy_pal_bg_faded_to_pal_ram bl 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, =0x02022c84 ldr r0, [r4] ldrb r0, [r0, 0x17] cmp r0, 0x2 beq @0801DF7A cmp r0, 0x2 bgt @0801DF70 cmp r0, 0x1 beq @0801DF76 b @0801DF8A .align 2, 0 .pool @0801DF70: cmp r0, 0x3 beq @0801DF7E b @0801DF8A @0801DF76: movs r0, 0x6 b @0801DF80 @0801DF7A: movs r0, 0x7 b @0801DF80 @0801DF7E: movs r0, 0x8 @0801DF80: bl sub_801EBD4 ldr r1, [r4] movs r0, 0 strb r0, [r1, 0x17] @0801DF8A: ldr r1, =gUnknown_082F2A7C ldr r0, =0x02022c84 ldr r0, [r0] ldrh r0, [r0, 0x4] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801DF54 thumb_func_start sub_801DFAC sub_801DFAC: ; 801DFAC push {r4,lr} ldr r4, =0x02022c84 ldr r0, [r4] ldrh r1, [r0, 0x6] cmp r1, 0x1 beq @0801DFE0 cmp r1, 0x1 bgt @0801DFC8 cmp r1, 0 beq @0801DFCE b @0801E028 .align 2, 0 .pool @0801DFC8: cmp r1, 0x2 beq @0801E018 b @0801E028 @0801DFCE: movs r1, 0xC8 lsls r1, 1 adds r0, r1 bl sub_801EF24 ldr r1, [r4] ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] @0801DFE0: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801E028 bl sub_8011A9C cmp r0, 0 bne @0801E028 ldr r4, =0x02022c84 ldr r1, [r4] movs r0, 0xC8 lsls r0, 1 adds r1, r0 movs r0, 0 movs r2, 0x28 bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @0801E028 ldr r1, [r4] ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] b @0801E028 .align 2, 0 .pool @0801E018: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801E028 movs r0, 0x1 bl sub_801EBD4 @0801E028: pop {r4} pop {r0} bx r0 thumb_func_end sub_801DFAC thumb_func_start sub_801E030 sub_801E030: ; 801E030 push {r4,r5,lr} ldr r5, =0x02022c84 ldr r3, [r5] ldrh r0, [r3, 0x6] cmp r0, 0 beq @0801E048 cmp r0, 0x1 beq @0801E0F6 b @0801E118 .align 2, 0 .pool @0801E048: ldr r1, =0x030022c0 ldrh r2, [r1, 0x2E] movs r0, 0x8 ands r0, r2 cmp r0, 0 beq @0801E068 ldrb r0, [r3, 0x15] cmp r0, 0 beq @0801E118 movs r0, 0x4 bl sub_801EBD4 b @0801E118 .align 2, 0 .pool @0801E068: movs r0, 0x4 ands r0, r2 cmp r0, 0 beq @0801E078 movs r0, 0x2 bl sub_801EBD4 b @0801E118 @0801E078: ldrh r1, [r1, 0x30] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0801E0A4 ldrb r0, [r3, 0x15] cmp r0, 0 beq @0801E09C bl sub_801ED68 movs r0, 0x8 movs r1, 0 bl sub_801F5EC ldr r1, [r5] movs r0, 0x1 strh r0, [r1, 0x6] b @0801E118 @0801E09C: movs r0, 0x3 bl sub_801EBD4 b @0801E118 @0801E0A4: movs r4, 0x1 adds r0, r4, 0 ands r0, r2 cmp r0, 0 beq @0801E0C0 bl sub_801EC94 movs r0, 0x8 movs r1, 0 bl sub_801F5EC movs r0, 0x2 movs r1, 0x1 b @0801E0EC @0801E0C0: movs r0, 0x80 lsls r0, 1 ands r0, r2 cmp r0, 0 beq @0801E0E0 ldrb r0, [r3, 0x10] cmp r0, 0x3 beq @0801E0D8 bl sub_801ED94 movs r0, 0x8 b @0801E0EA @0801E0D8: movs r0, 0x5 bl sub_801EBD4 b @0801E118 @0801E0E0: bl sub_801EBE4 cmp r0, 0 beq @0801E118 movs r0, 0x1 @0801E0EA: movs r1, 0 @0801E0EC: bl sub_801F5EC ldr r0, [r5] strh r4, [r0, 0x6] b @0801E118 @0801E0F6: movs r0, 0 bl sub_801F644 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 bl sub_801F644 lsls r0, 24 lsrs r1, r0, 24 cmp r4, 0 bne @0801E118 cmp r1, 0 bne @0801E118 ldr r0, [r5] strh r1, [r0, 0x6] @0801E118: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801E030 thumb_func_start sub_801E120 sub_801E120: ; 801E120 push {r4-r6,lr} ldr r0, =0x02022c84 ldr r0, [r0] ldrh r0, [r0, 0x6] cmp r0, 0x4 bls @0801E12E b @0801E23A @0801E12E: lsls r0, 2 ldr r1, =@0801E140 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801E140: .4byte @0801E154 .4byte @0801E15E .4byte @0801E17C .4byte @0801E208 .4byte @0801E21C @0801E154: movs r0, 0x3 movs r1, 0 bl sub_801F5EC b @0801E16A @0801E15E: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E23A @0801E16A: ldr r0, =0x02022c84 ldr r1, [r0] ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] b @0801E23A .align 2, 0 .pool @0801E17C: bl ProcessMenuInput lsls r0, 24 asrs r0, 8 lsrs r6, r0, 16 asrs r4, r0, 16 movs r0, 0x2 negs r0, r0 cmp r4, r0 beq @0801E1B4 adds r0, 0x1 cmp r4, r0 beq @0801E1D4 movs r0, 0x4 movs r1, 0 bl sub_801F5EC ldr r5, =0x02022c84 ldr r2, [r5] ldrb r0, [r2, 0x10] cmp r0, r4 beq @0801E1DC cmp r4, 0x3 ble @0801E1EC b @0801E1DC .align 2, 0 .pool @0801E1B4: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0801E23A movs r0, 0x5 bl audio_play movs r0, 0x1 bl MoveMenuCursor b @0801E23A .align 2, 0 .pool @0801E1D4: movs r0, 0x4 movs r1, 0 bl sub_801F5EC @0801E1DC: ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x3 strh r0, [r1, 0x6] b @0801E23A .align 2, 0 .pool @0801E1EC: movs r1, 0 strb r1, [r2, 0x11] ldr r0, [r5] strb r1, [r0, 0x12] movs r0, 0x5 movs r1, 0x1 bl sub_801F5EC ldr r0, [r5] strb r6, [r0, 0x10] ldr r1, [r5] movs r0, 0x4 strh r0, [r1, 0x6] b @0801E23A @0801E208: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E23A movs r0, 0x1 bl sub_801EBD4 b @0801E23A @0801E21C: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E23A movs r0, 0x1 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E23A movs r0, 0x1 bl sub_801EBD4 @0801E23A: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_801E120 thumb_func_start sub_801E240 sub_801E240: ; 801E240 push {r4,r5,lr} ldr r1, =0x02022c84 ldr r0, [r1] ldrh r0, [r0, 0x6] adds r2, r1, 0 cmp r0, 0xA bls @0801E250 b @0801E458 @0801E250: lsls r0, 2 ldr r1, =@0801E264 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801E264: .4byte @0801E290 .4byte @0801E2A8 .4byte @0801E2C4 .4byte @0801E322 .4byte @0801E3D4 .4byte @0801E424 .4byte @0801E458 .4byte @0801E458 .4byte @0801E378 .4byte @0801E338 .4byte @0801E35C @0801E290: movs r0, 0x6 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x1 strh r0, [r1, 0x6] b @0801E458 .align 2, 0 .pool @0801E2A8: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 beq @0801E2B6 b @0801E458 @0801E2B6: ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x2 strh r0, [r1, 0x6] b @0801E458 .align 2, 0 .pool @0801E2C4: bl sub_801FF08 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @0801E2E6 cmp r1, 0 bgt @0801E2DE movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0801E396 b @0801E458 @0801E2DE: cmp r1, 0x1 beq @0801E2E4 b @0801E458 @0801E2E4: b @0801E396 @0801E2E6: ldr r4, =0x02022c84 ldr r1, [r4] ldrb r0, [r1, 0x13] cmp r0, 0 bne @0801E310 movs r2, 0xC8 lsls r2, 1 adds r0, r1, r2 bl sub_801EFD0 movs r0, 0x7 movs r1, 0 bl sub_801F5EC ldr r1, [r4] movs r0, 0x9 strh r0, [r1, 0x6] b @0801E458 .align 2, 0 .pool @0801E310: movs r2, 0xC8 lsls r2, 1 adds r0, r1, r2 bl sub_801EF7C ldr r1, [r4] movs r0, 0x4 strh r0, [r1, 0x6] b @0801E458 @0801E322: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 beq @0801E330 b @0801E458 @0801E330: movs r0, 0x1 bl sub_801EBD4 b @0801E458 @0801E338: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 beq @0801E346 b @0801E458 @0801E346: movs r0, 0x14 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0xA strh r0, [r1, 0x6] b @0801E458 .align 2, 0 .pool @0801E35C: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 beq @0801E36A b @0801E458 @0801E36A: ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x8 strh r0, [r1, 0x6] b @0801E458 .align 2, 0 .pool @0801E378: bl sub_801FF08 lsls r0, 24 asrs r5, r0, 24 cmp r5, 0 beq @0801E3AC cmp r5, 0 bgt @0801E392 movs r0, 0x1 negs r0, r0 cmp r5, r0 beq @0801E396 b @0801E458 @0801E392: cmp r5, 0x1 bne @0801E458 @0801E396: movs r0, 0x7 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x3 strh r0, [r1, 0x6] b @0801E458 .align 2, 0 .pool @0801E3AC: bl sub_80104B0 ldr r4, =0x02022c84 ldr r0, [r4] movs r1, 0xC8 lsls r1, 1 adds r0, r1 bl sub_801EFD0 ldr r0, [r4] movs r1, 0x4 strh r1, [r0, 0x6] movs r2, 0xDC lsls r2, 1 adds r0, r2 strh r5, [r0] b @0801E458 .align 2, 0 .pool @0801E3D4: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801E414 bl sub_8011A9C cmp r0, 0 bne @0801E414 ldr r4, =0x02022c84 ldr r1, [r4] movs r0, 0xC8 lsls r0, 1 adds r1, r0 movs r0, 0 movs r2, 0x28 bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @0801E414 ldr r1, [r4] ldrb r0, [r1, 0x13] cmp r0, 0 bne @0801E410 movs r0, 0x6 b @0801E412 .align 2, 0 .pool @0801E410: movs r0, 0x5 @0801E412: strh r0, [r1, 0x6] @0801E414: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0801E458 b @0801E42C .align 2, 0 .pool @0801E424: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0801E438 @0801E42C: movs r0, 0x9 bl sub_801EBD4 b @0801E458 .align 2, 0 .pool @0801E438: ldr r3, [r2] movs r1, 0xDC lsls r1, 1 adds r2, r3, r1 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] lsls r0, 16 movs r1, 0x96 lsls r1, 17 cmp r0, r1 bls @0801E458 movs r0, 0 strh r0, [r2] movs r0, 0x4 strh r0, [r3, 0x6] @0801E458: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801E240 thumb_func_start sub_801E460 sub_801E460: ; 801E460 push {r4,lr} ldr r1, =0x02022c84 ldr r0, [r1] ldrh r0, [r0, 0x6] adds r2, r1, 0 cmp r0, 0x7 bls @0801E470 b @0801E5BC @0801E470: lsls r0, 2 ldr r1, =@0801E484 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801E484: .4byte @0801E4A4 .4byte @0801E4C8 .4byte @0801E4E8 .4byte @0801E50C .4byte @0801E540 .4byte @0801E560 .4byte @0801E584 .4byte @0801E5A8 @0801E4A4: ldr r0, =sub_801F2B4 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @0801E4B2 b @0801E5BC @0801E4B2: movs r0, 0x7 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] b @0801E59A .align 2, 0 .pool @0801E4C8: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E5BC movs r0, 0x12 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] b @0801E59A .align 2, 0 .pool @0801E4E8: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E5BC ldr r4, =0x02022c84 ldr r0, [r4] movs r1, 0xC8 lsls r1, 1 adds r0, r1 bl sub_801EFA8 ldr r1, [r4] b @0801E59A .align 2, 0 .pool @0801E50C: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801E5BC bl sub_8011A9C cmp r0, 0 bne @0801E5BC ldr r4, =0x02022c84 ldr r1, [r4] movs r0, 0xC8 lsls r0, 1 adds r1, r0 movs r0, 0 movs r2, 0x28 bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @0801E5BC ldr r1, [r4] b @0801E59A .align 2, 0 .pool @0801E540: bl sub_800A550 movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @0801E5BC bl sub_8011A9C cmp r0, 0 bne @0801E5BC ldr r0, =0x02022c84 ldr r1, [r0] b @0801E59A .align 2, 0 .pool @0801E560: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801E5BC bl sub_8011A9C adds r4, r0, 0 cmp r4, 0 bne @0801E5BC bl sub_800AC34 ldr r0, =0x02022c84 ldr r1, [r0] strh r4, [r1, 0xA] b @0801E59A .align 2, 0 .pool @0801E584: ldr r1, [r2] ldrh r0, [r1, 0xA] cmp r0, 0x95 bhi @0801E590 adds r0, 0x1 strh r0, [r1, 0xA] @0801E590: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0801E5BC ldr r1, [r2] @0801E59A: ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] b @0801E5BC .align 2, 0 .pool @0801E5A8: ldr r1, [r2] ldrh r0, [r1, 0xA] cmp r0, 0x95 bls @0801E5B8 movs r0, 0x9 bl sub_801EBD4 b @0801E5BC @0801E5B8: adds r0, 0x1 strh r0, [r1, 0xA] @0801E5BC: pop {r4} pop {r0} bx r0 thumb_func_end sub_801E460 thumb_func_start sub_801E5C4 sub_801E5C4: ; 801E5C4 push {r4,r5,lr} ldr r5, =0x02022c84 ldr r1, [r5] ldrh r0, [r1, 0x6] cmp r0, 0x1 beq @0801E604 cmp r0, 0x1 bgt @0801E5E0 cmp r0, 0 beq @0801E5EA b @0801E662 .align 2, 0 .pool @0801E5E0: cmp r0, 0x2 beq @0801E62E cmp r0, 0x3 beq @0801E650 b @0801E662 @0801E5EA: ldr r0, =sub_801F2B4 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @0801E662 movs r0, 0x7 movs r1, 0 bl sub_801F5EC b @0801E640 .align 2, 0 .pool @0801E604: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E662 bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801E662 bl sub_8011A9C adds r4, r0, 0 cmp r4, 0 bne @0801E662 bl sub_800AC34 ldr r1, [r5] strh r4, [r1, 0xA] b @0801E642 @0801E62E: ldrh r0, [r1, 0xA] cmp r0, 0x95 bhi @0801E638 adds r0, 0x1 strh r0, [r1, 0xA] @0801E638: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0801E662 @0801E640: ldr r1, [r5] @0801E642: ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] b @0801E662 .align 2, 0 .pool @0801E650: ldrh r0, [r1, 0xA] cmp r0, 0x95 bls @0801E65E movs r0, 0x9 bl sub_801EBD4 b @0801E662 @0801E65E: adds r0, 0x1 strh r0, [r1, 0xA] @0801E662: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_801E5C4 thumb_func_start sub_801E668 sub_801E668: ; 801E668 push {r4,lr} ldr r1, =0x02022c84 ldr r0, [r1] ldrh r0, [r0, 0x6] adds r2, r1, 0 cmp r0, 0x4 bhi @0801E75C lsls r0, 2 ldr r1, =@0801E688 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801E688: .4byte @0801E69C .4byte @0801E6C8 .4byte @0801E6F0 .4byte @0801E724 .4byte @0801E748 @0801E69C: ldr r0, =sub_801F2B4 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @0801E75C ldr r4, =0x02022c84 ldr r0, [r4] ldrb r0, [r0, 0x13] cmp r0, 0 beq @0801E6BA movs r0, 0x7 movs r1, 0 bl sub_801F5EC @0801E6BA: ldr r1, [r4] b @0801E73A .align 2, 0 .pool @0801E6C8: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E75C ldr r4, =0x02022c84 ldr r0, [r4] ldrb r0, [r0, 0x13] cmp r0, 0 beq @0801E6E6 movs r0, 0x13 movs r1, 0 bl sub_801F5EC @0801E6E6: ldr r1, [r4] b @0801E73A .align 2, 0 .pool @0801E6F0: movs r0, 0 bl sub_801F644 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0801E75C bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801E75C bl sub_8011A9C adds r4, r0, 0 cmp r4, 0 bne @0801E75C bl sub_800AC34 ldr r0, =0x02022c84 ldr r1, [r0] strh r4, [r1, 0xA] b @0801E73A .align 2, 0 .pool @0801E724: ldr r1, [r2] ldrh r0, [r1, 0xA] cmp r0, 0x95 bhi @0801E730 adds r0, 0x1 strh r0, [r1, 0xA] @0801E730: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0801E75C ldr r1, [r2] @0801E73A: ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] b @0801E75C .align 2, 0 .pool @0801E748: ldr r1, [r2] ldrh r0, [r1, 0xA] cmp r0, 0x95 bls @0801E758 movs r0, 0x9 bl sub_801EBD4 b @0801E75C @0801E758: adds r0, 0x1 strh r0, [r1, 0xA] @0801E75C: pop {r4} pop {r0} bx r0 thumb_func_end sub_801E668 thumb_func_start sub_801E764 sub_801E764: ; 801E764 push {r4,lr} ldr r1, =0x02022c84 ldr r0, [r1] ldrh r0, [r0, 0x6] adds r4, r1, 0 cmp r0, 0x4 bhi @0801E830 lsls r0, 2 ldr r1, =@0801E784 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801E784: .4byte @0801E798 .4byte @0801E7C0 .4byte @0801E7F4 .4byte @0801E802 .4byte @0801E820 @0801E798: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0801E7AC movs r0, 0x1 bl sub_801EBD4 b @0801E830 .align 2, 0 .pool @0801E7AC: ldr r0, [r4] movs r1, 0xC8 lsls r1, 1 adds r0, r1 bl sub_801EF4C ldr r1, [r4] ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] @0801E7C0: bl sub_800A520 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0801E830 bl sub_8011A9C cmp r0, 0 bne @0801E830 ldr r4, =0x02022c84 ldr r1, [r4] movs r0, 0xC8 lsls r0, 1 adds r1, r0 movs r0, 0 movs r2, 0x28 bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @0801E830 ldr r1, [r4] b @0801E812 .align 2, 0 .pool @0801E7F4: bl sub_801EE10 movs r0, 0x8 movs r1, 0 bl sub_801F5EC b @0801E80E @0801E802: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E830 @0801E80E: ldr r0, =0x02022c84 ldr r1, [r0] @0801E812: ldrh r0, [r1, 0x6] adds r0, 0x1 strh r0, [r1, 0x6] b @0801E830 .align 2, 0 .pool @0801E820: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0801E830 movs r0, 0x1 bl sub_801EBD4 @0801E830: pop {r4} pop {r0} bx r0 thumb_func_end sub_801E764 thumb_func_start sub_801E838 sub_801E838: ; 801E838 push {r4,lr} ldr r0, =0x02022c84 ldr r0, [r0] ldrh r0, [r0, 0x6] cmp r0, 0x6 bls @0801E846 b @0801E968 @0801E846: lsls r0, 2 ldr r1, =@0801E858 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801E858: .4byte @0801E874 .4byte @0801E8A4 .4byte @0801E8F8 .4byte @0801E910 .4byte @0801E920 .4byte @0801E934 .4byte @0801E94C @0801E874: bl sub_801EDC4 cmp r0, 0 beq @0801E890 movs r0, 0x9 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x2 b @0801E966 .align 2, 0 .pool @0801E890: movs r0, 0xD movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x5 b @0801E966 .align 2, 0 .pool @0801E8A4: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0801E8CC bl sub_801EDE0 movs r0, 0xB movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x3 b @0801E966 .align 2, 0 .pool @0801E8CC: movs r4, 0x2 adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @0801E8DA movs r0, 0xA b @0801E95A @0801E8DA: bl sub_801EBE4 cmp r0, 0 beq @0801E968 movs r0, 0x1 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r0, [r0] strh r4, [r0, 0x6] b @0801E968 .align 2, 0 .pool @0801E8F8: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E968 ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x1 b @0801E966 .align 2, 0 .pool @0801E910: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E968 movs r0, 0xA b @0801E95A @0801E920: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E968 movs r0, 0x1 bl sub_801EBD4 b @0801E968 @0801E934: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801E968 ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x6 b @0801E966 .align 2, 0 .pool @0801E94C: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @0801E968 movs r0, 0x7 @0801E95A: movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x4 @0801E966: strh r0, [r1, 0x6] @0801E968: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801E838 thumb_func_start sub_801E978 sub_801E978: ; 801E978 push {r4,lr} sub sp, 0x4 ldr r1, =0x02022c84 ldr r0, [r1] ldrh r0, [r0, 0x6] adds r4, r1, 0 cmp r0, 0xD bls @0801E98A b @0801EBC2 @0801E98A: lsls r0, 2 ldr r1, =@0801E99C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801E99C: .4byte @0801E9D4 .4byte @0801E9EE .4byte @0801EA14 .4byte @0801EA58 .4byte @0801EA7C .4byte @0801EA98 .4byte @0801EADC .4byte @0801EB04 .4byte @0801EB28 .4byte @0801EB40 .4byte @0801EB64 .4byte @0801EB72 .4byte @0801EB88 .4byte @0801EBA8 @0801E9D4: ldr r1, [r4] ldrb r0, [r1, 0x18] cmp r0, 0 bne @0801E9DE b @0801EB82 @0801E9DE: movs r0, 0x7 movs r1, 0 bl sub_801F5EC ldr r1, [r4] movs r0, 0x1 strh r0, [r1, 0x6] b @0801EBC2 @0801E9EE: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 beq @0801E9FC b @0801EBC2 @0801E9FC: movs r0, 0xE movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x2 strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EA14: bl sub_801FF08 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @0801EA40 cmp r1, 0 bgt @0801EA2E movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0801EA34 b @0801EBC2 @0801EA2E: cmp r1, 0x1 beq @0801EA34 b @0801EBC2 @0801EA34: ldr r0, =0x02022c84 ldr r1, [r0] b @0801EB82 .align 2, 0 .pool @0801EA40: movs r0, 0x7 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x3 strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EA58: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 beq @0801EA66 b @0801EBC2 @0801EA66: movs r0, 0xF movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x4 strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EA7C: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 beq @0801EA8A b @0801EBC2 @0801EA8A: ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x5 strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EA98: bl sub_801FF08 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @0801EAC4 cmp r1, 0 bgt @0801EAB2 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0801EAB8 b @0801EBC2 @0801EAB2: cmp r1, 0x1 beq @0801EAB8 b @0801EBC2 @0801EAB8: ldr r0, =0x02022c84 ldr r1, [r0] b @0801EB82 .align 2, 0 .pool @0801EAC4: movs r0, 0x7 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x6 strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EADC: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801EBC2 movs r0, 0x10 movs r1, 0 bl sub_801F5EC bl sub_801EE2C ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x7 strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EB04: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801EBC2 bl sub_8076D5C movs r0, 0 bl save_game_when_memory_present ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x8 strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EB28: movs r0, 0x11 movs r1, 0 bl sub_801F5EC ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x9 strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EB40: movs r0, 0 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801EBC2 movs r0, 0x37 bl audio_play bl sav2_gender2_inplace_and_xFE ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0xA strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EB64: ldr r1, [r4] movs r0, 0 strb r0, [r1, 0x19] ldr r1, [r4] movs r0, 0xB strh r0, [r1, 0x6] b @0801EBC2 @0801EB72: ldr r0, [r4] ldrb r1, [r0, 0x19] adds r1, 0x1 strb r1, [r0, 0x19] ldr r1, [r4] ldrb r0, [r1, 0x19] cmp r0, 0x78 bls @0801EBC2 @0801EB82: movs r0, 0xC strh r0, [r1, 0x6] b @0801EBC2 @0801EB88: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0xD strh r0, [r1, 0x6] b @0801EBC2 .align 2, 0 .pool @0801EBA8: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0801EBC2 bl sub_801F544 bl sub_801DE30 ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 @0801EBC2: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801E978 thumb_func_start sub_801EBD4 sub_801EBD4: ; 801EBD4 ldr r1, =0x02022c84 ldr r1, [r1] movs r2, 0 strh r0, [r1, 0x4] strh r2, [r1, 0x6] bx lr .align 2, 0 .pool thumb_func_end sub_801EBD4 thumb_func_start sub_801EBE4 sub_801EBE4: ; 801EBE4 push {lr} ldr r0, =0x030022c0 ldrh r2, [r0, 0x30] movs r0, 0x40 ands r0, r2 lsls r0, 16 lsrs r3, r0, 16 cmp r3, 0 bne @0801EC6E movs r0, 0x80 ands r0, r2 cmp r0, 0 beq @0801EC24 ldr r0, =0x02022c84 ldr r2, [r0] ldr r1, =gUnknown_082F2AA4 ldrb r0, [r2, 0x10] adds r0, r1 ldrb r1, [r2, 0x12] ldrb r0, [r0] cmp r1, r0 bcs @0801EC20 adds r0, r1, 0x1 b @0801EC88 .align 2, 0 .pool @0801EC20: strb r3, [r2, 0x12] b @0801EC8A @0801EC24: ldr r0, =0x02022c84 ldr r1, [r0] ldrb r0, [r1, 0x10] cmp r0, 0x3 beq @0801EC6A movs r0, 0x20 ands r0, r2 lsls r0, 16 lsrs r3, r0, 16 cmp r3, 0 beq @0801EC52 ldrb r0, [r1, 0x11] cmp r0, 0 beq @0801EC4C subs r0, 0x1 strb r0, [r1, 0x11] b @0801EC8A .align 2, 0 .pool @0801EC4C: movs r0, 0x4 strb r0, [r1, 0x11] b @0801EC8A @0801EC52: movs r0, 0x10 ands r0, r2 cmp r0, 0 beq @0801EC6A ldrb r0, [r1, 0x11] cmp r0, 0x3 bhi @0801EC66 adds r0, 0x1 strb r0, [r1, 0x11] b @0801EC8A @0801EC66: strb r3, [r1, 0x11] b @0801EC8A @0801EC6A: movs r0, 0 b @0801EC8C @0801EC6E: ldr r0, =0x02022c84 ldr r2, [r0] ldrb r0, [r2, 0x12] cmp r0, 0 beq @0801EC80 subs r0, 0x1 b @0801EC88 .align 2, 0 .pool @0801EC80: ldr r0, =gUnknown_082F2AA4 ldrb r1, [r2, 0x10] adds r1, r0 ldrb r0, [r1] @0801EC88: strb r0, [r2, 0x12] @0801EC8A: movs r0, 0x1 @0801EC8C: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801EBE4 thumb_func_start sub_801EC94 sub_801EC94: ; 801EC94 push {r4-r6,lr} sub sp, 0x18 ldr r0, =0x02022c84 ldr r5, [r0] ldrb r0, [r5, 0x10] cmp r0, 0x3 beq @0801ECDC ldr r3, =gUnknown_082F2BA8 ldrb r1, [r5, 0x12] lsls r1, 2 adds r2, r0, 0 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r1, r0 adds r1, r3 ldr r4, [r1] ldrb r0, [r5, 0x11] cmp r0, 0 beq @0801ECCE adds r1, r0, 0 @0801ECBE: ldrb r0, [r4] cmp r0, 0xF9 bne @0801ECC6 adds r4, 0x1 @0801ECC6: adds r4, 0x1 subs r1, 0x1 cmp r1, 0 bne @0801ECBE @0801ECCE: movs r5, 0x1 b @0801ED02 .align 2, 0 .pool @0801ECDC: ldrb r0, [r5, 0x12] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r0 adds r1, 0xB9 adds r1, r5, r1 mov r0, sp bl 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, =0x02022c84 ldr r1, [r6] ldrb r0, [r1, 0x15] strb r0, [r1, 0x14] cmp r4, 0 beq @0801ED5A bl sub_801EE84 adds r2, r0, 0 subs r5, 0x1 movs r0, 0x1 negs r0, r0 cmp r5, r0 beq @0801ED56 ldr r0, [r6] ldrb r0, [r0, 0x15] cmp r0, 0xE bhi @0801ED56 adds r3, r6, 0 @0801ED28: ldrb r0, [r4] cmp r0, 0xF9 bne @0801ED34 strb r0, [r2] adds r4, 0x1 adds r2, 0x1 @0801ED34: ldrb r0, [r4] strb r0, [r2] adds r4, 0x1 adds r2, 0x1 ldr r1, [r3] ldrb r0, [r1, 0x15] adds r0, 0x1 strb r0, [r1, 0x15] subs r5, 0x1 movs r0, 0x1 negs r0, r0 cmp r5, r0 beq @0801ED56 ldr r0, [r3] ldrb r0, [r0, 0x15] cmp r0, 0xE bls @0801ED28 @0801ED56: movs r0, 0xFF strb r0, [r2] @0801ED5A: add sp, 0x18 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801EC94 thumb_func_start sub_801ED68 sub_801ED68: ; 801ED68 push {r4,lr} ldr r4, =0x02022c84 ldr r1, [r4] ldrb r0, [r1, 0x15] strb r0, [r1, 0x14] ldr r0, [r4] ldrb r0, [r0, 0x15] cmp r0, 0 beq @0801ED8A bl sub_801EEA8 movs r1, 0xFF strb r1, [r0] ldr r1, [r4] ldrb r0, [r1, 0x15] subs r0, 0x1 strb r0, [r1, 0x15] @0801ED8A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801ED68 thumb_func_start sub_801ED94 sub_801ED94: ; 801ED94 push {lr} ldr r0, =0x02022c84 ldr r1, [r0] ldrb r0, [r1, 0x15] subs r0, 0x1 strb r0, [r1, 0x14] bl sub_801EEA8 adds r2, r0, 0 ldrb r0, [r2] cmp r0, 0xF9 beq @0801EDB8 ldr r1, =gUnknown_082F2AA8 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @0801EDB8 strb r0, [r2] @0801EDB8: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801ED94 thumb_func_start sub_801EDC4 sub_801EDC4: ; 801EDC4 push {lr} ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x15] cmp r0, 0 bne @0801EDD8 movs r0, 0 b @0801EDDA .align 2, 0 .pool @0801EDD8: movs r0, 0x1 @0801EDDA: pop {r1} bx r1 thumb_func_end sub_801EDC4 thumb_func_start sub_801EDE0 sub_801EDE0: ; 801EDE0 push {r4,lr} bl sub_801F114 adds r1, r0, 0 ldr r4, =0x02022c84 ldr r0, [r4] ldrb r3, [r0, 0x12] lsls r2, r3, 2 adds r2, r3 lsls r2, 2 adds r2, r3 adds r2, 0xB9 adds r0, r2 bl gf_strcpy ldr r1, [r4] movs r0, 0x1 strb r0, [r1, 0x18] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801EDE0 thumb_func_start sub_801EE10 sub_801EE10: ; 801EE10 ldr r1, =0x02022c84 ldr r2, [r1] movs r0, 0xFF strb r0, [r2, 0x1A] ldr r2, [r1] movs r3, 0 movs r0, 0xF strb r0, [r2, 0x14] ldr r0, [r1] strb r3, [r0, 0x15] bx lr .align 2, 0 .pool thumb_func_end sub_801EE10 thumb_func_start sub_801EE2C sub_801EE2C: ; 801EE2C push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x03005d8c mov r8, r0 ldr r7, =0x02022c84 movs r6, 0xB9 ldr r5, =0x00003c88 movs r4, 0x9 @0801EE3E: mov r1, r8 ldr r0, [r1] adds r0, r5 ldr r1, [r7] adds r1, r6 bl 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 .pool thumb_func_end sub_801EE2C thumb_func_start sub_801EE6C sub_801EE6C: ; 801EE6C ldr r2, =0x02022c84 lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r0 adds r1, 0xB9 ldr r0, [r2] adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_801EE6C thumb_func_start sub_801EE84 sub_801EE84: ; 801EE84 push {lr} ldr r0, =0x02022c84 ldr r0, [r0] adds r1, r0, 0 adds r1, 0x1A ldrb r0, [r0, 0x1A] cmp r0, 0xFF beq @0801EE9C @0801EE94: adds r1, 0x1 ldrb r0, [r1] cmp r0, 0xFF bne @0801EE94 @0801EE9C: adds r0, r1, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801EE84 thumb_func_start sub_801EEA8 sub_801EEA8: ; 801EEA8 push {lr} ldr r0, =0x02022c84 ldr r0, [r0] adds r2, r0, 0 adds r2, 0x1A adds r1, r2, 0 ldrb r0, [r0, 0x1A] cmp r0, 0xFF beq @0801EECC @0801EEBA: adds r2, r1, 0 ldrb r0, [r2] cmp r0, 0xF9 bne @0801EEC4 adds r1, r2, 0x1 @0801EEC4: adds r1, 0x1 ldrb r0, [r1] cmp r0, 0xFF bne @0801EEBA @0801EECC: adds r0, r2, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801EEA8 thumb_func_start sub_801EED8 sub_801EED8: ; 801EED8 push {r4,lr} ldr r4, =0x02022c84 ldr r0, [r4] adds r0, 0x1A bl 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 .pool thumb_func_end sub_801EED8 thumb_func_start sub_801EF1C sub_801EF1C: ; 801EF1C movs r1, 0 strb r1, [r0] bx lr thumb_func_end sub_801EF1C thumb_func_start sub_801EF24 sub_801EF24: ; 801EF24 push {r4,lr} adds r4, r0, 0 movs r0, 0x2 strb r0, [r4] adds r0, r4, 0x1 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x13] strb r0, [r4, 0x9] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801EF24 thumb_func_start sub_801EF4C sub_801EF4C: ; 801EF4C push {r4,lr} adds r4, r0, 0 movs r0, 0x1 strb r0, [r4] adds r0, r4, 0x1 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy adds r4, 0x9 ldr r0, =0x02022c84 ldr r1, [r0] adds r1, 0x1A adds r0, r4, 0 bl gf_strcpy pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801EF4C thumb_func_start sub_801EF7C sub_801EF7C: ; 801EF7C push {r4,lr} adds r4, r0, 0 movs r0, 0x3 strb r0, [r4] adds r0, r4, 0x1 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x13] strb r0, [r4, 0x9] bl sub_8011A50 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801EF7C thumb_func_start sub_801EFA8 sub_801EFA8: ; 801EFA8 push {r4,lr} adds r4, r0, 0 movs r0, 0x4 strb r0, [r4] adds r0, r4, 0x1 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x13] strb r0, [r4, 0x9] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801EFA8 thumb_func_start sub_801EFD0 sub_801EFD0: ; 801EFD0 push {r4,lr} adds r4, r0, 0 movs r0, 0x5 strb r0, [r4] adds r0, r4, 0x1 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x13] strb r0, [r4, 0x9] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801EFD0 thumb_func_start sub_801EFF8 sub_801EFF8: ; 801EFF8 push {r4-r6,lr} adds r6, r0, 0 adds r5, r1, 0 ldrb r0, [r5] adds r1, r0, 0 adds r4, r5, 0x1 adds r5, r4, 0 adds r5, 0x8 cmp r0, 0x2 beq @0801F020 cmp r0, 0x2 bgt @0801F016 cmp r0, 0x1 beq @0801F044 b @0801F0A8 @0801F016: cmp r1, 0x3 beq @0801F07A cmp r1, 0x5 beq @0801F06E b @0801F0A8 @0801F020: ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x13] ldrb r1, [r4, 0x8] cmp r0, r1 beq @0801F0A8 bl sub_81AFBF0 movs r0, 0 adds r1, r4, 0 bl sub_81AFC0C ldr r1, =gUnknown_085ED2A9 b @0801F094 .align 2, 0 .pool @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, =0x02022c84 ldr r0, [r0] adds r0, 0x79 adds r1, r4, 0 bl gf_strcpy @0801F07A: ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x13] ldrb r5, [r5] cmp r0, r5 beq @0801F0A8 bl sub_81AFBF0 movs r0, 0 adds r1, r4, 0 bl sub_81AFC0C ldr r1, =gUnknown_085ED2BD @0801F094: adds r0, r6, 0 bl sub_81AFC28 movs r0, 0x1 b @0801F0AA .align 2, 0 .pool @0801F0A8: movs r0, 0 @0801F0AA: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_801EFF8 thumb_func_start sub_801F0B0 sub_801F0B0: ; 801F0B0 ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x10] bx lr .align 2, 0 .pool thumb_func_end sub_801F0B0 thumb_func_start sub_801F0BC sub_801F0BC: ; 801F0BC ldr r2, =0x02022c84 ldr r3, [r2] ldrb r2, [r3, 0x11] strb r2, [r0] ldrb r0, [r3, 0x12] strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_801F0BC thumb_func_start sub_801F0D0 sub_801F0D0: ; 801F0D0 ldr r0, =0x02022c84 ldr r0, [r0] adds r0, 0x1A bx lr .align 2, 0 .pool 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, =0x02022c84 ldr r0, [r0] ldrb r3, [r0, 0x15] ldrb r2, [r0, 0x14] subs r0, r3, r2 cmp r0, 0 bge @0801F108 negs r0, r0 str r3, [r4] b @0801F10A .align 2, 0 .pool @0801F108: str r2, [r4] @0801F10A: str r0, [r1] pop {r4} pop {r0} bx r0 thumb_func_end sub_801F0EC thumb_func_start sub_801F114 sub_801F114: ; 801F114 push {lr} bl sub_801EED8 lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x02022c84 ldr r0, [r0] adds r1, r0, 0 adds r1, 0x1A cmp r2, 0 beq @0801F13A @0801F12A: ldrb r0, [r1] cmp r0, 0xF9 bne @0801F132 adds r1, 0x1 @0801F132: adds r1, 0x1 subs r2, 0x1 cmp r2, 0 bne @0801F12A @0801F13A: adds r0, r1, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801F114 thumb_func_start sub_801F144 sub_801F144: ; 801F144 push {r4,lr} bl sub_801EED8 lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x02022c84 ldr r0, [r0] adds r1, r0, 0 adds r1, 0x1A movs r2, 0 movs r3, 0 cmp r2, r4 bcs @0801F174 @0801F15E: ldrb r0, [r1] cmp r0, 0xF9 bne @0801F166 adds r1, 0x1 @0801F166: adds r1, 0x1 adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 adds r3, 0x1 cmp r3, r4 bcc @0801F15E @0801F174: adds r0, r2, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_801F144 thumb_func_start sub_801F180 sub_801F180: ; 801F180 ldr r0, =0x02022c84 ldr r0, [r0] adds r0, 0x39 bx lr .align 2, 0 .pool thumb_func_end sub_801F180 thumb_func_start sub_801F18C sub_801F18C: ; 801F18C ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x16] bx lr .align 2, 0 .pool thumb_func_end sub_801F18C thumb_func_start sub_801F198 sub_801F198: ; 801F198 ldr r0, =0x02022c84 ldr r0, [r0] ldrb r0, [r0, 0x15] bx lr .align 2, 0 .pool thumb_func_end sub_801F198 thumb_func_start sub_801F1A4 sub_801F1A4: ; 801F1A4 push {lr} bl sub_801EEA8 ldrb r1, [r0] cmp r1, 0xFF bhi @0801F1BE ldr r0, =gUnknown_082F2AA8 adds r0, r1, r0 ldrb r0, [r0] cmp r0, r1 beq @0801F1BE cmp r0, 0 bne @0801F1C8 @0801F1BE: movs r0, 0x3 b @0801F1CA .align 2, 0 .pool @0801F1C8: movs r0, 0 @0801F1CA: pop {r1} bx r1 thumb_func_end sub_801F1A4 thumb_func_start sub_801F1D0 sub_801F1D0: ; 801F1D0 ldr r0, =0x02022c84 ldr r0, [r0] adds r0, 0x79 bx lr .align 2, 0 .pool thumb_func_end sub_801F1D0 thumb_func_start copy_strings_to_sav1 copy_strings_to_sav1: ; 801F1DC push {r4,lr} ldr r4, =0x03005d8c ldr r0, [r4] ldr r1, =0x00003c88 adds r0, r1 ldr r1, =gUnknown_085ED40F bl gf_strcpy ldr r0, [r4] ldr r1, =0x00003c9d adds r0, r1 ldr r1, =gUnknown_085ED415 bl gf_strcpy ldr r0, [r4] ldr r1, =0x00003cb2 adds r0, r1 ldr r1, =gUnknown_085ED41D bl gf_strcpy ldr r0, [r4] ldr r1, =0x00003cc7 adds r0, r1 ldr r1, =gUnknown_085ED423 bl gf_strcpy ldr r0, [r4] ldr r1, =0x00003cdc adds r0, r1 ldr r1, =gUnknown_085ED42A bl gf_strcpy ldr r0, [r4] ldr r1, =0x00003cf1 adds r0, r1 ldr r1, =gUnknown_085ED430 bl gf_strcpy ldr r0, [r4] ldr r1, =0x00003d06 adds r0, r1 ldr r1, =gUnknown_085ED434 bl gf_strcpy ldr r0, [r4] ldr r1, =0x00003d1b adds r0, r1 ldr r1, =gUnknown_085ED43A bl gf_strcpy ldr r0, [r4] ldr r1, =0x00003d30 adds r0, r1 ldr r1, =gUnknown_085ED440 bl gf_strcpy ldr r0, [r4] ldr r1, =0x00003d45 adds r0, r1 ldr r1, =gUnknown_085ED44A bl gf_strcpy pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end copy_strings_to_sav1 thumb_func_start sub_801F2B4 sub_801F2B4: ; 801F2B4 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0x7 bls @0801F2CE b @0801F4C4 @0801F2CE: lsls r0, 2 ldr r1, =@0801F2E0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801F2E0: .4byte @0801F300 .4byte @0801F30E .4byte @0801F4A8 .4byte @0801F35C .4byte @0801F448 .4byte @0801F480 .4byte @0801F494 .4byte @0801F438 @0801F300: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0801F30A b @0801F49C @0801F30A: movs r0, 0x1 strh r0, [r4] @0801F30E: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 adds r2, r0, 0 strh r0, [r4, 0x8] ldr r3, =0x02022c84 ldr r0, [r3] ldrb r1, [r0, 0xD] movs r5, 0x8 ldrsh r0, [r4, r5] cmp r1, r0 beq @0801F33C movs r0, 0x2 strh r0, [r4] ldr r0, [r3] strb r2, [r0, 0xD] b @0801F4C4 .align 2, 0 .pool @0801F33C: bl sub_800A550 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x6] cmp r0, 0 bne @0801F354 bl sub_8011A9C cmp r0, 0 beq @0801F354 b @0801F4C4 @0801F354: movs r0, 0 strh r0, [r4, 0x2] movs r0, 0x3 strh r0, [r4] @0801F35C: movs r1, 0x2 ldrsh r0, [r4, r1] cmp r0, 0x4 bgt @0801F396 movs r2, 0x6 ldrsh r0, [r4, r2] movs r3, 0x2 ldrsh r1, [r4, r3] asrs r0, r1 movs r1, 0x1 ands r0, r1 cmp r0, 0 bne @0801F396 movs r2, 0x1 @0801F378: ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] lsls r0, 16 asrs r0, 16 cmp r0, 0x4 bgt @0801F396 movs r5, 0x6 ldrsh r0, [r4, r5] movs r3, 0x2 ldrsh r1, [r4, r3] asrs r0, r1 ands r0, r2 cmp r0, 0 beq @0801F378 @0801F396: ldrh r1, [r4, 0x2] movs r5, 0x2 ldrsh r0, [r4, r5] cmp r0, 0x5 bne @0801F3A2 b @0801F4C0 @0801F3A2: strh r1, [r4, 0x4] lsls r0, r1, 24 lsrs r0, 24 bl sub_800A5EC movs r1, 0x2 ldrsh r0, [r4, r1] lsls r0, 8 ldr r1, =0x020223c4 adds r0, r1 ldrb r0, [r0] subs r0, 0x1 cmp r0, 0x4 bhi @0801F3E4 lsls r0, 2 ldr r1, =@0801F3D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801F3D0: .4byte @0801F3E4 .4byte @0801F3E8 .4byte @0801F3EC .4byte @0801F3F0 .4byte @0801F3F4 @0801F3E4: movs r0, 0x3 b @0801F3F6 @0801F3E8: movs r0, 0x3 b @0801F3F6 @0801F3EC: movs r0, 0x4 b @0801F3F6 @0801F3F0: movs r0, 0x5 b @0801F3F6 @0801F3F4: movs r0, 0x6 @0801F3F6: strh r0, [r4, 0xA] ldr r5, =0x02022c84 ldr r0, [r5] adds r0, 0x39 movs r2, 0x2 ldrsh r1, [r4, r2] lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 bl sub_801EFF8 cmp r0, 0 beq @0801F42C ldr r0, [r5] ldrh r1, [r4, 0x2] strb r1, [r0, 0x16] movs r0, 0xC movs r1, 0x2 bl sub_801F5EC movs r0, 0x7 b @0801F42E .align 2, 0 .pool @0801F42C: ldrh r0, [r4, 0xA] @0801F42E: strh r0, [r4] ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] b @0801F4C4 @0801F438: movs r0, 0x2 bl sub_801F644 lsls r0, 24 cmp r0, 0 bne @0801F4C4 ldrh r0, [r4, 0xA] b @0801F4C2 @0801F448: ldr r6, =0x02022c84 ldr r0, [r6] ldrb r0, [r0, 0x13] cmp r0, 0 bne @0801F47C movs r3, 0x4 ldrsh r0, [r4, r3] cmp r0, 0 beq @0801F47C bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @0801F474 bl sub_80104B0 ldr r1, [r6] movs r0, 0x1 b @0801F49A .align 2, 0 .pool @0801F474: movs r5, 0x4 ldrsh r0, [r4, r5] bl sub_8011DE0 @0801F47C: movs r0, 0x3 b @0801F4C2 @0801F480: ldr r0, =0x02022c84 ldr r1, [r0] ldrb r0, [r1, 0x13] cmp r0, 0 beq @0801F49C movs r0, 0x2 b @0801F49A .align 2, 0 .pool @0801F494: ldr r0, =0x02022c84 ldr r1, [r0] movs r0, 0x3 @0801F49A: strb r0, [r1, 0x17] @0801F49C: adds r0, r5, 0 bl remove_task b @0801F4C4 .align 2, 0 .pool @0801F4A8: bl sub_8011A9C cmp r0, 0 bne @0801F4C4 ldr r0, =0x02022c84 ldr r1, [r0] ldrb r0, [r1, 0x13] cmp r0, 0 bne @0801F4C0 ldrb r0, [r1, 0xD] bl sub_80110B8 @0801F4C0: movs r0, 0x1 @0801F4C2: strh r0, [r4] @0801F4C4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801F2B4 thumb_func_start sub_801F4D0 sub_801F4D0: ; 801F4D0 push {r4,lr} ldr r4, =0x02022c88 ldr r0, =0x00002168 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, =gUnknown_082F2C60 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r0, =gUnknown_082F2C70 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 .pool @0801F52C: movs r0, 0 @0801F52E: pop {r4} pop {r1} bx r1 thumb_func_end sub_801F4D0 thumb_func_start sub_801F534 sub_801F534: ; 801F534 push {lr} movs r0, 0 bl sub_801F644 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_801F534 thumb_func_start sub_801F544 sub_801F544: ; 801F544 push {r4,lr} bl sub_80208D0 ldr r4, =0x02022c88 ldr r0, [r4] cmp r0, 0 beq @0801F55A bl free movs r0, 0 str r0, [r4] @0801F55A: bl Window_FreeMemory ldr r1, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801F544 thumb_func_start sub_801F574 sub_801F574: ; 801F574 movs r2, 0 movs r1, 0xFF strh r1, [r0, 0x18] strh r1, [r0, 0x1E] strh r2, [r0, 0x1A] bx lr thumb_func_end sub_801F574 thumb_func_start sub_801F580 sub_801F580: ; 801F580 push {r4,r5,lr} ldr r1, =0x02022c88 ldr r0, [r1] cmp r0, 0 beq @0801F5A8 movs r2, 0 adds r4, r1, 0 ldr r5, =sub_801FDD8 movs r3, 0 @0801F592: ldr r0, [r4] lsls r1, r2, 3 adds r0, r1 str r5, [r0] strb r3, [r0, 0x4] ldr r0, [r4] adds r0, r1 strb r3, [r0, 0x5] adds r2, 0x1 cmp r2, 0x2 ble @0801F592 @0801F5A8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801F580 thumb_func_start sub_801F5B8 sub_801F5B8: ; 801F5B8 push {r4-r6,lr} ldr r1, =0x02022c88 ldr r0, [r1] cmp r0, 0 beq @0801F5E0 movs r5, 0 adds r6, r1, 0 @0801F5C6: ldr r1, [r6] lsls r4, r5, 3 adds r1, r4 adds r0, r1, 0x5 ldr r1, [r1] bl _call_via_r1 ldr r1, [r6] adds r1, r4 strb r0, [r1, 0x4] adds r5, 0x1 cmp r5, 0x2 ble @0801F5C6 @0801F5E0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801F5B8 thumb_func_start sub_801F5EC sub_801F5EC: ; 801F5EC push {r4-r7,lr} lsls r0, 16 lsrs r6, r0, 16 lsls r1, 24 ldr r3, =0x02022c88 ldr r0, [r3] lsrs r1, 21 adds r0, r1 ldr r2, =sub_801FDD8 str r2, [r0] movs r4, 0 adds r5, r3, 0 adds r3, r1, 0 mov r12, r4 ldr r1, =gUnknown_082F2C98 movs r7, 0x1 adds r2, r1, 0x4 @0801F60E: ldrh r0, [r1] cmp r0, r6 bne @0801F634 ldr r1, [r5] adds r1, r3 ldr r0, [r2] str r0, [r1] strb r7, [r1, 0x4] ldr r0, [r5] adds r0, r3 mov r1, r12 strb r1, [r0, 0x5] b @0801F63E .align 2, 0 .pool @0801F634: adds r1, 0x8 adds r2, 0x8 adds r4, 0x1 cmp r4, 0x14 bls @0801F60E @0801F63E: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_801F5EC thumb_func_start sub_801F644 sub_801F644: ; 801F644 lsls r0, 24 ldr r1, =0x02022c88 ldr r1, [r1] lsrs r0, 21 adds r1, r0 ldrb r0, [r1, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_801F644 thumb_func_start sub_801F658 sub_801F658: ; 801F658 push {r4,lr} adds r4, r0, 0 bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0801F6EE ldrb r0, [r4] cmp r0, 0x6 bhi @0801F6E4 lsls r0, 2 ldr r1, =@0801F67C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801F67C: .4byte @0801F698 .4byte @0801F6A2 .4byte @0801F6A8 .4byte @0801F6AE .4byte @0801F6B4 .4byte @0801F6BA .4byte @0801F6CC @0801F698: bl sub_8020480 bl sub_8020538 b @0801F6E8 @0801F6A2: bl sub_8020584 b @0801F6E8 @0801F6A8: bl sub_80205B4 b @0801F6E8 @0801F6AE: bl task_tutorial_story_unknown b @0801F6E8 @0801F6B4: bl sub_8020680 b @0801F6E8 @0801F6BA: bl sub_80206A4 bl sub_80206D0 bl sub_8020740 bl sub_80206E8 b @0801F6E8 @0801F6CC: bl 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, =0x02022c88 ldr r0, [r0] ldrb r0, [r0, 0x1E] movs r1, 0x3 bl Window_CopyToVram b @0801F81E .align 2, 0 .pool @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, =0x02022c88 ldr r0, [r0] ldrb r0, [r0, 0x1E] movs r1, 0x3 bl Window_CopyToVram b @0801F972 .align 2, 0 .pool @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, =0x02022c88 ldr r0, [r0] ldrb r0, [r0, 0x1E] movs r1, 0x3 bl Window_CopyToVram b @0801FA1A .align 2, 0 .pool @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, =@0801FA80 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0801FA80: .4byte @0801FA94 .4byte @0801FAC0 .4byte @0801FAF0 .4byte @0801FB14 .4byte @0801FADE @0801FA94: ldr r0, =0x02022c88 ldr r0, [r0] ldrh r5, [r0, 0x1A] bl sub_801F180 adds r4, r0, 0 bl sub_801F18C adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r5, 0 adds r1, r4, 0 bl sub_8020420 movs r0, 0 movs r1, 0x2 bl Window_CopyToVram b @0801FB34 .align 2, 0 .pool @0801FAC0: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 bne @0801FB3A ldr r0, =0x02022c88 ldr r1, [r0] ldrh r0, [r1, 0x1A] cmp r0, 0x8 bhi @0801FAE8 adds r0, 0x1 strh r0, [r1, 0x1A] movs r0, 0x4 strb r0, [r6] @0801FADE: movs r0, 0 b @0801FB3C .align 2, 0 .pool @0801FAE8: strh r2, [r1, 0x1C] ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] @0801FAF0: movs r0, 0 movs r1, 0 movs r2, 0x5 movs r3, 0x11 bl Window_ScrollVertically movs r0, 0 movs r1, 0x2 bl Window_CopyToVram ldr r0, =0x02022c88 ldr r1, [r0] ldrh r0, [r1, 0x1C] adds r0, 0x1 strh r0, [r1, 0x1C] ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] @0801FB14: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @0801FB3A ldr r0, =0x02022c88 ldr r0, [r0] ldrh r0, [r0, 0x1C] cmp r0, 0x2 bhi @0801FB34 ldrb r0, [r6] subs r0, 0x1 b @0801FB38 .align 2, 0 .pool @0801FB34: ldrb r0, [r6] adds r0, 0x1 @0801FB38: strb r0, [r6] @0801FB3A: movs r0, 0x1 @0801FB3C: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_801FA68 thumb_func_start sub_801FB44 sub_801FB44: ; 801FB44 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0 beq @0801FB54 cmp r0, 0x1 beq @0801FB60 b @0801FB66 @0801FB54: bl sub_80209E0 ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @0801FB66 @0801FB60: bl sub_8020A1C b @0801FB68 @0801FB66: movs r0, 0x1 @0801FB68: pop {r4} pop {r1} bx r1 thumb_func_end sub_801FB44 thumb_func_start sub_801FB70 sub_801FB70: ; 801FB70 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0 beq @0801FB80 cmp r0, 0x1 beq @0801FBA0 b @0801FBAA @0801FB80: movs r0, 0x3 movs r1, 0x10 bl sub_801FF18 ldr r0, =0x02022c88 ldr r0, [r0] ldrb r0, [r0, 0x1E] movs r1, 0x3 bl Window_CopyToVram ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @0801FBAA .align 2, 0 .pool @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, =0x02022c88 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 .pool @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, =0x02022c88 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 .pool @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, =0x02022c88 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 .pool @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, =0x02022c88 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 .pool @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, =0x02022c88 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 .pool @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, =0x03005d90 ldr r1, [r0] movs r0, 0 bl sub_81AFC0C movs r0, 0x9 movs r1, 0 bl sub_801FF18 ldr r0, =0x02022c88 ldr r0, [r0] ldrb r0, [r0, 0x1E] movs r1, 0x3 bl Window_CopyToVram ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @0801FD7E .align 2, 0 .pool @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, =0x02022c88 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 .pool @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, =0xffffff00 ldr r2, [sp, 0xC] ands r2, r4 lsrs r0, 16 ldr r3, =0xffff00ff ands r2, r3 orrs r2, r0 lsrs r1, 8 ldr r0, =0xff00ffff ands r2, r0 orrs r2, r1 ldr r0, =0x00ffffff ands r2, r0 movs r0, 0xC0 lsls r0, 19 orrs r2, r0 str r2, [sp, 0xC] ldr r0, [sp, 0x10] ands r0, r4 movs r1, 0x4 orrs r0, r1 ands r0, r3 movs r1, 0xE0 lsls r1, 4 orrs r0, r1 ldr r1, =0x0000ffff ands r0, r1 movs r1, 0xA4 lsls r1, 15 orrs r0, r1 str r0, [sp, 0x10] add r0, sp, 0xC bl Window_AddFromTemplate adds r1, r0, 0 ldr r5, =0x02022c88 ldr r0, [r5] movs r6, 0 strh r1, [r0, 0x18] lsls r0, r1, 16 lsrs r0, 16 cmp r0, 0xFF beq @0801FE94 lsls r0, r1, 24 lsrs r0, 24 movs r1, 0x11 bl Window_FastFillPixels ldr r0, [r5] ldrb r0, [r0, 0x18] bl Window_WriteStandardTileMap ldr r0, [r5] ldrb r0, [r0, 0x18] ldr r2, =gUnknown_085EAE62 movs r1, 0x1 str r1, [sp] movs r4, 0xFF str r4, [sp, 0x4] str r6, [sp, 0x8] movs r3, 0x8 bl Print ldr r0, [r5] ldrb r0, [r0, 0x18] ldr r2, =gUnknown_085EAE66 movs r1, 0x11 str r1, [sp] str r4, [sp, 0x4] str r6, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 bl Print ldr r0, [r5] ldrb r0, [r0, 0x18] movs r1, 0x1 movs r2, 0xD bl sub_8098858 ldr r0, [r5] ldrb r0, [r0, 0x18] movs r1, 0x2 adds r2, r7, 0 bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed @0801FE94: add sp, 0x14 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801FDDC thumb_func_start sub_801FEBC sub_801FEBC: ; 801FEBC push {r4,lr} ldr r4, =0x02022c88 ldr r0, [r4] ldrh r0, [r0, 0x18] cmp r0, 0xFF beq @0801FEDA lsls r0, 24 lsrs r0, 24 movs r1, 0 bl sub_8198070 ldr r0, [r4] ldrb r0, [r0, 0x18] bl Window_FillTileMap @0801FEDA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801FEBC thumb_func_start sub_801FEE4 sub_801FEE4: ; 801FEE4 push {r4,lr} ldr r4, =0x02022c88 ldr r0, [r4] ldrh r0, [r0, 0x18] cmp r0, 0xFF beq @0801FEFE lsls r0, 24 lsrs r0, 24 bl Window_Remove ldr r1, [r4] movs r0, 0xFF strh r0, [r1, 0x18] @0801FEFE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801FEE4 thumb_func_start sub_801FF08 sub_801FF08: ; 801FF08 push {lr} bl ProcessMenuInput lsls r0, 24 asrs r0, 24 pop {r1} bx r1 thumb_func_end sub_801FF08 thumb_func_start sub_801FF18 sub_801FF18: ; 801FF18 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x1C adds r7, r0, 0 lsls r1, 16 lsrs r1, 16 mov r9, r1 ldr r1, =0xffffff00 ldr r3, [sp, 0x14] ands r3, r1 ldr r2, =0xffff00ff ands r3, r2 movs r0, 0x80 lsls r0, 4 orrs r3, r0 ldr r0, =0xff00ffff ands r3, r0 movs r0, 0x80 lsls r0, 13 orrs r3, r0 ldr r5, =0x00ffffff ands r3, r5 movs r0, 0xA8 lsls r0, 21 orrs r3, r0 str r3, [sp, 0x14] ldr r0, [sp, 0x18] ands r0, r1 movs r1, 0x4 orrs r0, r1 ands r0, r2 movs r1, 0xE0 lsls r1, 4 orrs r0, r1 ldr r1, =0x0000ffff ands r0, r1 movs r1, 0xD4 lsls r1, 15 orrs r0, r1 str r0, [sp, 0x18] ldr r1, =gUnknown_082F2D40 lsls r0, r7, 1 adds r0, r7 lsls r0, 2 adds r4, r0, r1 ldrb r0, [r4, 0xA] cmp r0, 0 beq @0801FF98 lsls r0, r3, 16 movs r1, 0xF9 lsls r1, 24 adds r0, r1 lsrs r0, 16 ands r2, r3 orrs r2, r0 lsrs r1, r2, 24 adds r1, 0x7 lsls r1, 24 adds r0, r5, 0 ands r0, r2 orrs r0, r1 str r0, [sp, 0x14] @0801FF98: add r0, sp, 0x14 bl Window_AddFromTemplate ldr r5, =0x02022c88 ldr r1, [r5] strh r0, [r1, 0x1E] ldrh r0, [r1, 0x1E] mov r8, r0 cmp r0, 0xFF beq @08020082 ldrb r0, [r4, 0x9] cmp r0, 0 beq @0801FFE0 adds r0, r1, 0 adds r0, 0x22 ldr r1, [r4] bl sub_81AFC28 ldr r0, [r5] adds r6, r0, 0 adds r6, 0x22 b @0801FFE2 .align 2, 0 .pool @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, =gUnknown_082F2D40 lsls r0, r7, 1 adds r0, r7 lsls r0, 2 adds r4, r0, r1 ldrb r0, [r4, 0x4] cmp r0, 0x1 bne @08020050 adds r0, r5, 0 movs r1, 0xA movs r2, 0x2 bl sub_80989E0 ldrb r3, [r4, 0x5] adds r3, 0x8 lsls r3, 24 lsrs r3, 24 ldrb r0, [r4, 0x6] adds r0, 0x8 lsls r0, 24 lsrs r0, 24 str r0, [sp] movs r0, 0xFF str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] ldrb r0, [r4, 0x7] str r0, [sp, 0xC] ldrb r0, [r4, 0x8] str r0, [sp, 0x10] adds r0, r5, 0 movs r1, 0x1 adds r2, r6, 0 bl sub_8199F74 b @0802007A .align 2, 0 .pool @08020050: adds r0, r5, 0 movs r1, 0xA movs r2, 0x2 bl sub_8098858 ldrb r3, [r4, 0x5] ldrb r0, [r4, 0x6] str r0, [sp] movs r0, 0xFF str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] ldrb r0, [r4, 0x7] str r0, [sp, 0xC] ldrb r0, [r4, 0x8] str r0, [sp, 0x10] adds r0, r5, 0 movs r1, 0x1 adds r2, r6, 0 bl sub_8199F74 @0802007A: ldr r0, =0x02022c88 ldr r0, [r0] mov r1, r8 strh r1, [r0, 0x1E] @08020082: add sp, 0x1C pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_801FF18 thumb_func_start sub_8020094 sub_8020094: ; 8020094 push {r4,lr} ldr r4, =0x02022c88 ldr r0, [r4] ldrh r0, [r0, 0x1E] cmp r0, 0xFF beq @080200B2 lsls r0, 24 lsrs r0, 24 movs r1, 0 bl sub_8198070 ldr r0, [r4] ldrb r0, [r0, 0x1E] bl 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 .pool thumb_func_end sub_8020094 thumb_func_start sub_80200C8 sub_80200C8: ; 80200C8 push {r4,lr} ldr r4, =0x02022c88 ldr r0, [r4] ldrh r0, [r0, 0x1E] cmp r0, 0xFF beq @080200E2 lsls r0, 24 lsrs r0, 24 bl Window_Remove ldr r1, [r4] movs r0, 0xFF strh r0, [r1, 0x1E] @080200E2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80200C8 thumb_func_start sub_80200EC sub_80200EC: ; 80200EC push {lr} sub sp, 0x8 adds r3, r0, 0 lsls r2, 24 lsrs r2, 24 lsls r3, 19 lsrs r3, 16 lsls r1, 19 lsrs r1, 16 str r1, [sp] movs r0, 0xE str r0, [sp, 0x4] movs r0, 0x1 adds r1, r2, 0 adds r2, r3, 0 movs r3, 0x1 bl 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, =gUnknown_082F2BA8 adds r0, r2 lsls r0, 3 adds r4, r0, r1 ldr r0, [sp, 0x40] lsls r5, r0, 24 @080201FE: ldr r1, [r4] cmp r1, 0 bne @08020206 b @0802030C @08020206: mov r0, sp adds r0, 0x13 bl 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 .pool @08020240: movs r1, 0x4 str r1, [sp, 0x40] movs r7, 0 movs r6, 0 @08020248: adds r0, r7, 0 bl sub_801EE6C adds r5, r0, 0 movs r0, 0 adds r1, r5, 0 movs r2, 0 bl 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, =gUnknown_082F2DC4 str r0, [sp, 0x8] movs r0, 0x2 movs r1, 0 adds r3, r4, 0 bl box_print @08020300: ldr r7, [sp, 0x48] mov r4, r10 lsls r0, r4, 16 lsrs r6, r0, 16 cmp r7, 0x9 ble @08020248 @0802030C: add sp, 0x4C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80201A4 thumb_func_start sub_8020320 sub_8020320: ; 8020320 push {r4,lr} ldr r1, =0x02022c88 ldr r2, [r1] ldrh r3, [r2, 0x20] movs r4, 0x20 ldrsh r0, [r2, r4] cmp r0, 0x37 bgt @08020354 adds r0, r3, 0 adds r0, 0xC strh r0, [r2, 0x20] lsls r0, 16 asrs r0, 16 cmp r0, 0x37 ble @08020348 movs r0, 0x38 strh r0, [r2, 0x20] b @08020354 .align 2, 0 .pool @08020348: movs r1, 0x20 ldrsh r0, [r2, r1] bl sub_80207C0 movs r0, 0x1 b @08020360 @08020354: ldr r0, [r1] movs r4, 0x20 ldrsh r0, [r0, r4] bl sub_8020818 movs r0, 0 @08020360: pop {r4} pop {r1} bx r1 thumb_func_end sub_8020320 thumb_func_start sub_8020368 sub_8020368: ; 8020368 push {r4,lr} ldr r1, =0x02022c88 ldr r2, [r1] ldrh r3, [r2, 0x20] movs r4, 0x20 ldrsh r0, [r2, r4] cmp r0, 0 ble @0802039C adds r0, r3, 0 subs r0, 0xC strh r0, [r2, 0x20] lsls r0, 16 cmp r0, 0 bgt @08020390 movs r0, 0 strh r0, [r2, 0x20] b @0802039C .align 2, 0 .pool @08020390: movs r1, 0x20 ldrsh r0, [r2, r1] bl sub_80207C0 movs r0, 0x1 b @080203A8 @0802039C: ldr r0, [r1] movs r4, 0x20 ldrsh r0, [r0, r4] bl sub_8020818 movs r0, 0 @080203A8: pop {r4} pop {r1} bx r1 thumb_func_end sub_8020368 thumb_func_start sub_80203B0 sub_80203B0: ; 80203B0 push {r4,r5,lr} sub sp, 0xC movs r0, 0x3 movs r1, 0x11 bl 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, =gUnknown_082F2DC8 str r0, [sp, 0x8] movs r0, 0x3 movs r1, 0x2 movs r2, 0x8 movs r3, 0x1 bl PrintTextArray bl sub_801F0B0 lsls r0, 24 lsrs r0, 24 str r5, [sp] str r4, [sp, 0x4] str r0, [sp, 0x8] movs r0, 0x3 movs r1, 0x2 movs r2, 0 movs r3, 0x1 bl sub_81983AC movs r0, 0x3 bl Window_WriteStandardTileMap add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80203B0 thumb_func_start sub_802040C sub_802040C: ; 802040C push {lr} movs r0, 0x3 movs r1, 0 bl sub_8198070 movs r0, 0x3 bl 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, =0x000040f0 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 .pool thumb_func_end sub_8020480 thumb_func_start sub_8020538 sub_8020538: ; 8020538 push {r4,lr} ldr r4, =0x02022c88 ldr r1, [r4] movs r0, 0x94 lsls r0, 1 adds r1, r0 movs r0, 0 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00000928 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001128 adds r1, r0 movs r0, 0x3 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001928 adds r1, r0 movs r0, 0x2 bl bg_set_tilemap pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020538 thumb_func_start sub_8020584 sub_8020584: ; 8020584 push {lr} sub sp, 0x8 movs r1, 0xC0 lsls r1, 19 movs r0, 0 movs r2, 0x20 movs r3, 0x1 bl RequestDma3Fill movs r0, 0x20 str r0, [sp] str r0, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =gUnknown_08DD4BD0 movs r1, 0x70 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_08DD4BB0 movs r1, 0xC0 movs r2, 0x20 bl gpu_pal_apply ldr r1, =gUnknown_08DD4BF0 movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_08DD4C4C movs r0, 0x1 movs r2, 0 movs r3, 0 bl 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 .pool thumb_func_end sub_80205B4 thumb_func_start task_tutorial_story_unknown task_tutorial_story_unknown: ; 8020604 push {r4,r5,lr} sub sp, 0x4 ldr r0, =gUnknown_08DD4860 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r1, =gUnknown_08DD4880 movs r0, 0 str r0, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram adds r5, r0, 0 cmp r5, 0 beq @0802064E movs r1, 0x88 lsls r1, 2 adds r0, r5, r1 ldr r4, =0x02022c88 ldr r1, [r4] ldr r2, =0x00002128 adds r1, r2 movs r2, 0x8 bl CpuFastSet movs r1, 0x84 lsls r1, 3 adds r0, r5, r1 ldr r1, [r4] ldr r2, =0x00002148 adds r1, r2 movs r2, 0x8 bl CpuFastSet @0802064E: ldr r1, =gUnknown_08DD4AB8 movs r0, 0x2 movs r2, 0 movs r3, 0 bl 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 .pool thumb_func_end task_tutorial_story_unknown thumb_func_start sub_8020680 sub_8020680: ; 8020680 push {lr} ldr r0, =gUnknown_082F2C20 movs r1, 0x80 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0x06004020 movs r0, 0 movs r2, 0x20 movs r3, 0x1 bl RequestDma3Fill pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020680 thumb_func_start sub_80206A4 sub_80206A4: ; 80206A4 push {lr} ldr r0, =gUnknown_082F2C40 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply movs r0, 0 bl 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 .pool 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, =0x02022c88 ldr r1, [r0] ldr r0, =0x00002128 adds r1, r0 lsls r2, r4, 19 lsrs r2, 16 movs r0, 0x8 str r0, [sp] movs r0, 0x10 str r0, [sp, 0x4] movs r0, 0x1 movs r3, 0 bl 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 .pool 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, =gUnknown_0860F074 movs r1, 0xE0 movs r2, 0x20 bl gpu_pal_apply pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020740 thumb_func_start sub_8020770 sub_8020770: ; 8020770 push {lr} sub sp, 0x10 ldr r0, =0xa2600001 str r0, [sp, 0x4] ldr r0, =0x04000014 str r0, [sp] mov r2, sp movs r1, 0 movs r0, 0x1 strb r0, [r2, 0x8] mov r0, sp strb r1, [r0, 0x9] ldr r0, =0x02022c88 ldr r0, [r0] strh r1, [r0, 0x20] str r1, [sp, 0xC] add r0, sp, 0xC ldr r1, =0x02038c28 ldr r2, =0x010003c0 bl CpuFastSet ldr r0, [sp] ldr r1, [sp, 0x4] ldr r2, [sp, 0x8] bl sub_80BA038 add sp, 0x10 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020770 thumb_func_start sub_80207C0 sub_80207C0: ; 80207C0 push {r4,r5,lr} sub sp, 0x4 lsls r0, 16 lsrs r0, 16 mov r1, sp strh r0, [r1] ldr r5, =0x02039b28 ldrb r0, [r5, 0x14] lsls r1, r0, 4 subs r1, r0 lsls r1, 7 ldr r4, =0x02038c28 adds r1, r4 ldr r2, =0x01000090 mov r0, sp bl CpuSet mov r0, sp adds r0, 0x2 movs r1, 0 strh r1, [r0] ldrb r2, [r5, 0x14] lsls r1, r2, 4 subs r1, r2 lsls r1, 7 movs r2, 0x90 lsls r2, 1 adds r4, r2 adds r1, r4 ldr r2, =0x01000010 bl CpuSet add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80207C0 thumb_func_start sub_8020818 sub_8020818: ; 8020818 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x8 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, sp strh r4, [r0] ldr r5, =0x02038c28 ldr r0, =0x01000090 mov r9, r0 mov r0, sp adds r1, r5, 0 mov r2, r9 bl CpuSet mov r0, sp adds r0, 0x2 movs r6, 0 strh r6, [r0] movs r2, 0x90 lsls r2, 1 adds r1, r5, r2 ldr r2, =0x01000010 mov r8, r2 bl CpuSet add r0, sp, 0x4 strh r4, [r0] movs r2, 0xF0 lsls r2, 3 adds r1, r5, r2 mov r2, r9 bl CpuSet mov r0, sp adds r0, 0x6 strh r6, [r0] movs r1, 0x8A lsls r1, 4 adds r5, r1 adds r1, r5, 0 mov r2, r8 bl CpuSet add sp, 0x8 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020818 thumb_func_start sub_8020890 sub_8020890: ; 8020890 push {r4,r5,lr} movs r5, 0 ldr r4, =gUnknown_082F3134 @08020896: adds r0, r4, 0 bl gpu_tile_obj_decompress_and_load adds r4, 0x8 adds r5, 0x1 cmp r5, 0x4 bls @08020896 ldr r0, =gUnknown_082F315C bl gpu_pal_obj_alloc_tag_and_apply ldr r4, =0x02022c8c movs r0, 0x18 bl malloc str r0, [r4] cmp r0, 0 beq @080208C8 movs r0, 0x1 b @080208CA .align 2, 0 .pool @080208C8: movs r0, 0 @080208CA: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8020890 thumb_func_start sub_80208D0 sub_80208D0: ; 80208D0 push {lr} ldr r0, =0x02022c8c ldr r0, [r0] cmp r0, 0 beq @080208DE bl free @080208DE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80208D0 thumb_func_start sub_80208E8 sub_80208E8: ; 80208E8 push {lr} ldr r0, =gUnknown_082F319C movs r1, 0xA movs r2, 0x18 movs r3, 0 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022c8c ldr r2, [r1] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 adds r1, r0 str r1, [r2] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80208E8 thumb_func_start sub_802091C sub_802091C: ; 802091C ldr r1, =0x02022c8c ldr r1, [r1] ldr r2, [r1] adds r2, 0x3E movs r1, 0x1 ands r0, r1 lsls r0, 2 ldrb r3, [r2] movs r1, 0x5 negs r1, r1 ands r1, r3 orrs r1, r0 strb r1, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_802091C thumb_func_start sub_802093C sub_802093C: ; 802093C push {r4,r5,lr} sub sp, 0x4 bl sub_801F0B0 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 mov r5, sp adds r5, 0x1 mov r0, sp adds r1, r5, 0 bl sub_801F0BC cmp r4, 0x3 beq @0802097C ldr r4, =0x02022c8c ldr r0, [r4] ldr r0, [r0] movs r1, 0 bl 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 .pool @0802097C: ldr r4, =0x02022c8c 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 .pool thumb_func_end sub_802093C thumb_func_start sub_80209AC sub_80209AC: ; 80209AC push {r4,lr} adds r4, r0, 0 lsls r4, 2 ldr r0, =gUnknown_082F2DF2 adds r4, r0 movs r0, 0 bl gpu_pal_tags_index_of adds r1, r0, 0 lsls r1, 24 lsrs r1, 4 ldr r0, =0x01010000 adds r1, r0 lsrs r1, 16 adds r0, r4, 0 movs r2, 0x4 bl gpu_pal_apply pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80209AC thumb_func_start sub_80209E0 sub_80209E0: ; 80209E0 push {lr} bl sub_801F0B0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 beq @08020A00 ldr r0, =0x02022c8c ldr r0, [r0] ldr r0, [r0] movs r1, 0x1 bl obj_anim_image_start b @08020A0C .align 2, 0 .pool @08020A00: ldr r0, =0x02022c8c ldr r0, [r0] ldr r0, [r0] movs r1, 0x3 bl obj_anim_image_start @08020A0C: ldr r0, =0x02022c8c ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x14] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80209E0 thumb_func_start sub_8020A1C sub_8020A1C: ; 8020A1C push {r4,lr} ldr r4, =0x02022c8c ldr r1, [r4] ldrh r0, [r1, 0x14] cmp r0, 0x3 bls @08020A30 @08020A28: movs r0, 0 b @08020A62 .align 2, 0 .pool @08020A30: adds r0, 0x1 strh r0, [r1, 0x14] lsls r0, 16 lsrs r0, 16 cmp r0, 0x3 bls @08020A60 bl sub_801F0B0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 beq @08020A54 ldr r0, [r4] ldr r0, [r0] movs r1, 0 bl 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, =gUnknown_082F31BC movs r1, 0x4C movs r2, 0x98 movs r3, 0x2 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r5, =0x02022c8c ldr r2, [r5] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r4, =0x02020630 adds r1, r4 str r1, [r2, 0x8] ldr r0, =gUnknown_082F31D4 movs r1, 0x40 movs r2, 0x98 movs r3, 0x1 bl 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 .pool thumb_func_end sub_8020A68 thumb_func_start sub_8020ABC sub_8020ABC: ; 8020ABC push {r4,lr} adds r4, r0, 0 bl sub_801F198 adds r3, r0, 0 cmp r3, 0xF bne @08020AD8 adds r0, r4, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] b @08020AEC @08020AD8: adds r2, r4, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x5 negs r1, r1 ands r1, r0 strb r1, [r2] lsls r0, r3, 3 adds r0, 0x4C strh r0, [r4, 0x20] @08020AEC: pop {r4} pop {r0} bx r0 thumb_func_end sub_8020ABC thumb_func_start sub_8020AF4 sub_8020AF4: ; 8020AF4 push {lr} adds r1, r0, 0 ldrh r0, [r1, 0x2E] adds r0, 0x1 movs r2, 0 strh r0, [r1, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0x4 ble @08020B1A strh r2, [r1, 0x2E] ldrh r0, [r1, 0x24] adds r0, 0x1 strh r0, [r1, 0x24] lsls r0, 16 asrs r0, 16 cmp r0, 0x4 ble @08020B1A strh r2, [r1, 0x24] @08020B1A: pop {r0} bx r0 thumb_func_end sub_8020AF4 thumb_func_start sub_8020B20 sub_8020B20: ; 8020B20 push {r4,r5,lr} ldr r0, =gUnknown_082F322C movs r1, 0x8 movs r2, 0x98 movs r3, 0x3 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r5, =0x02022c8c ldr r2, [r5] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r4, =0x02020630 adds r1, r4 str r1, [r2, 0xC] ldr r0, =gUnknown_082F3244 movs r1, 0x20 movs r2, 0x98 movs r3, 0x4 bl 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 .pool thumb_func_end sub_8020B20 thumb_func_start sub_8020B80 sub_8020B80: ; 8020B80 push {r4,lr} bl sub_801F0B0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bne @08020BB8 bl sub_801F0DC cmp r0, 0 beq @08020BC2 ldr r3, =0x02022c8c ldr r0, [r3] ldr r1, [r0, 0x10] adds r1, 0x3E ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r0, [r3] ldr r0, [r0, 0x10] movs r1, 0x3 bl obj_anim_image_start b @08020BF6 .align 2, 0 .pool @08020BB8: bl sub_801F1A4 adds r4, r0, 0 cmp r4, 0x3 bne @08020BD8 @08020BC2: ldr r0, =0x02022c8c ldr r0, [r0] ldr r1, [r0, 0x10] adds r1, 0x3E ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] b @08020BF6 .align 2, 0 .pool @08020BD8: ldr r3, =0x02022c8c ldr r0, [r3] ldr r1, [r0, 0x10] adds r1, 0x3E ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r0, [r3] ldr r0, [r0, 0x10] lsls r1, r4, 24 lsrs r1, 24 bl obj_anim_image_start @08020BF6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020B80 thumb_func_start sub_8020C00 sub_8020C00: ; 8020C00 ldr r0, =0x02022c90 ldr r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8020C00 thumb_func_start sub_8020C0C sub_8020C0C: ; 8020C0C push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x02022c90 ldr r0, [r5] cmp r0, 0 bne @08020C20 movs r0, 0x2 b @08020C5C .align 2, 0 .pool @08020C20: cmp r4, 0 bne @08020C26 ldr r4, [r0] @08020C26: ldrb r0, [r0, 0xA] bl remove_task ldr r0, [r5] bl free movs r0, 0 str r0, [r5] adds r0, r4, 0 bl set_callback2 ldr r0, =c2_exit_to_overworld_2_switch cmp r4, r0 bne @08020C5A ldr r2, =0x03003014 ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] movs r0, 0xC8 lsls r0, 1 bl current_map_music_set ldr r0, =c1_overworld bl set_callback1 @08020C5A: movs r0, 0 @08020C5C: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8020C0C thumb_func_start sub_8020C70 sub_8020C70: ; 8020C70 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0xC adds r4, r0, 0 movs r0, 0 mov r8, r0 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08020C8E ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08020CAC @08020C8E: adds r0, r4, 0 bl set_callback2 ldr r0, =0x03005000 mov r1, r8 strh r1, [r0, 0x10] strh r1, [r0, 0x12] b @08020CF8 .align 2, 0 .pool @08020CAC: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 mov r8, r0 bl link_get_multiplayer_id lsls r0, 24 lsrs r7, r0, 24 mov r0, r8 cmp r0, 0x1 bls @08020CC8 cmp r7, r8 bcc @08020CDC @08020CC8: adds r0, r4, 0 bl set_callback2 ldr r0, =0x03005000 movs r1, 0 strh r1, [r0, 0x10] strh r1, [r0, 0x12] b @08020CF8 .align 2, 0 .pool @08020CDC: ldr r6, =0x02022c90 ldr r0, =0x000041c0 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, =0x03005000 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 .pool @08020D10: str r4, [r5] movs r4, 0 strb r7, [r5, 0x8] ldr r0, [r6] mov r1, r8 strb r1, [r0, 0x9] ldr r0, [r6] bl sub_8020FC4 ldr r1, [r6] movs r2, 0x1 movs r0, 0x1 strh r0, [r1, 0x12] strb r2, [r1, 0xE] ldr r1, [r6] movs r0, 0x6 strb r0, [r1, 0xF] ldr r0, [r6] adds r0, 0x36 movs r2, 0x1 negs r2, r2 movs r1, 0x10 str r1, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl sub_8024604 ldr r2, [r6] adds r2, 0x36 movs r0, 0x4 movs r1, 0x1 bl sub_8022BEC ldr r0, =sub_8020F88 bl set_callback2 ldr r0, =sub_8020FA0 movs r1, 0x8 bl AddTask ldr r1, [r6] strb r0, [r1, 0xA] ldr r2, =0x03003014 ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] @08020D74: add sp, 0xC pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020C70 thumb_func_start sub_8020D8C sub_8020D8C: ; 8020D8C push {r4,lr} sub sp, 0xC ldr r1, =0x0203ce7c ldrh r0, [r1] subs r0, 0x85 lsls r0, 16 lsrs r0, 16 cmp r0, 0x2B bls @08020DA8 movs r0, 0x85 strh r0, [r1] b @08020DB0 .align 2, 0 .pool @08020DA8: ldrh r0, [r1] movs r1, 0x1 bl sub_80D6AA4 @08020DB0: ldr r4, =0x02022c90 ldr r2, [r4] ldrb r0, [r2, 0x8] lsls r0, 5 adds r0, r2, r0 ldr r1, =0x0203ce7c ldrh r1, [r1] subs r1, 0x85 adds r0, 0xA4 movs r3, 0 strh r1, [r0] movs r0, 0x1 strb r0, [r2, 0xE] ldr r1, [r4] movs r0, 0x9 strb r0, [r1, 0xF] ldr r0, [r4] adds r0, 0x36 movs r2, 0x1 negs r2, r2 movs r1, 0x10 str r1, [sp] str r3, [sp, 0x4] str r3, [sp, 0x8] movs r1, 0 bl sub_8024604 ldr r2, [r4] adds r2, 0x36 movs r0, 0x4 movs r1, 0x1 bl sub_8022BEC ldr r0, =sub_8020FA0 movs r1, 0x8 bl AddTask ldr r1, [r4] strb r0, [r1, 0xA] ldr r0, =sub_8020F88 bl set_callback2 add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020D8C thumb_func_start sub_8020E1C sub_8020E1C: ; 8020E1C push {lr} ldr r0, =0x02022c90 ldr r0, [r0] ldrb r0, [r0, 0xA] bl remove_task ldr r0, =sub_8020D8C bl sub_81AABF0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020E1C thumb_func_start sub_8020E3C sub_8020E3C: ; 8020E3C push {lr} ldr r0, =sub_8020F74 bl SetVBlankCallback pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020E3C thumb_func_start sub_8020E4C sub_8020E4C: ; 8020E4C push {lr} movs r0, 0 bl SetVBlankCallback pop {r0} bx r0 thumb_func_end sub_8020E4C thumb_func_start sub_8020E58 sub_8020E58: ; 8020E58 push {r4-r6,lr} ldr r4, =0x02022c90 ldr r0, [r4] adds r0, 0x6C ldrh r2, [r0] lsls r2, 8 movs r1, 0xF0 lsls r1, 6 adds r0, r2, 0 bl sub_81515FC adds r2, r0, 0 ldr r0, [r4] adds r0, 0x72 ldrh r3, [r0] lsls r3, 8 adds r0, r3, 0 adds r1, r2, 0 bl sub_81515FC adds r3, r0, 0 ldr r0, =0x0000ffff ands r3, r0 ldr r2, [r4] strh r3, [r2, 0x16] ldrb r0, [r2, 0x9] cmp r0, 0x3 beq @08020EDC cmp r0, 0x3 bgt @08020EA4 cmp r0, 0x2 beq @08020EAE b @08020F48 .align 2, 0 .pool @08020EA4: cmp r0, 0x4 beq @08020EEC cmp r0, 0x5 beq @08020F20 b @08020F48 @08020EAE: ldr r5, =0x03005d90 ldr r1, [r5] movs r0, 0xF6 lsls r0, 1 adds r1, r0 lsls r0, r3, 16 lsrs r0, 16 ldrh r1, [r1] cmp r0, r1 bls @08020F48 adds r2, 0x25 ldrb r0, [r2] movs r1, 0x2 orrs r0, r1 strb r0, [r2] ldr r0, [r5] ldr r1, [r4] ldrh r1, [r1, 0x16] movs r2, 0xF6 lsls r2, 1 b @08020F14 .align 2, 0 .pool @08020EDC: ldr r5, =0x03005d90 ldr r0, [r5] movs r6, 0xF7 lsls r6, 1 b @08020F28 .align 2, 0 .pool @08020EEC: ldr r5, =0x03005d90 ldr r1, [r5] movs r0, 0xF8 lsls r0, 1 adds r1, r0 lsls r0, r3, 16 lsrs r0, 16 ldrh r1, [r1] cmp r0, r1 bls @08020F48 adds r2, 0x25 ldrb r0, [r2] movs r1, 0x2 orrs r0, r1 strb r0, [r2] ldr r0, [r5] ldr r1, [r4] ldrh r1, [r1, 0x16] movs r2, 0xF8 lsls r2, 1 @08020F14: adds r0, r2 strh r1, [r0] b @08020F48 .align 2, 0 .pool @08020F20: ldr r5, =0x03005d90 ldr r0, [r5] movs r6, 0xF9 lsls r6, 1 @08020F28: adds r1, r0, r6 lsls r0, r3, 16 lsrs r0, 16 ldrh r1, [r1] cmp r0, r1 bls @08020F48 adds r2, 0x25 ldrb r0, [r2] movs r1, 0x2 orrs r0, r1 strb r0, [r2] ldr r1, [r5] ldr r0, [r4] ldrh r0, [r0, 0x16] adds r1, r6 strh r0, [r1] @08020F48: ldr r4, =0x02022c90 ldr r1, [r4] ldr r0, [r1, 0x68] str r0, [r1, 0x1C] bl sub_8024700 lsls r0, 24 cmp r0, 0 bne @08020F66 ldr r0, [r4] adds r0, 0x25 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] @08020F66: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020E58 thumb_func_start sub_8020F74 sub_8020F74: ; 8020F74 push {lr} bl copy_pal_bg_faded_to_pal_ram bl 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, =0x02022c90 ldr r0, [r4] ldr r2, [r0, 0x4] cmp r2, 0 beq @08020FB4 adds r1, r0, 0 adds r1, 0x36 bl _call_via_r2 @08020FB4: ldr r0, [r4] bl sub_8021450 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8020FA0 thumb_func_start sub_8020FC4 sub_8020FC4: ; 8020FC4 push {r4-r6,lr} adds r6, r0, 0 movs r5, 0 b @08020FE6 @08020FCC: lsls r0, r5, 5 adds r0, 0x98 adds r0, r6, r0 lsls r1, r5, 3 subs r1, r5 lsls r1, 2 ldr r2, =0x020229f0 adds r1, r2 bl 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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x14] lsls r0, 29 lsrs r0, 29 cmp r0, 0x1 beq @0802103E cmp r0, 0x1 bgt @08021034 cmp r0, 0 beq @0802103A b @08021046 .align 2, 0 .pool @08021034: cmp r0, 0x2 beq @08021042 b @08021046 @0802103A: movs r0, 0x8 b @08021044 @0802103E: movs r0, 0x4 b @08021044 @08021042: movs r0, 0x1 @08021044: strb r0, [r6, 0xB] @08021046: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8020FC4 thumb_func_start sub_802104C sub_802104C: ; 802104C push {r4,r5,lr} sub sp, 0xC bl sub_8020C00 adds r5, r0, 0 cmp r5, 0 bne @08021060 movs r0, 0x1 negs r0, r0 b @08021304 @08021060: ldrb r0, [r5, 0xC] cmp r0, 0x9 bls @08021068 b @080212FC @08021068: lsls r0, 2 ldr r1, =@08021078 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08021078: .4byte @080210A0 .4byte @080210BE .4byte @080210E4 .4byte @080210F2 .4byte @08021178 .4byte @080211BE .4byte @080211EC .4byte @0802121C .4byte @08021278 .4byte @080212B4 @080210A0: movs r0, 0 bl SetVBlankCallback movs r0, 0 bl SetHBlankCallback movs r0, 0 movs r1, 0 bl 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, =0x01000200 bl CpuSet ldr r0, =0x0300301c strb r4, [r0] movs r0, 0x3 bl sub_8034C54 b @080212FC .align 2, 0 .pool @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, =gUnknown_082F32C8 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 .pool @08021178: movs r4, 0x20 str r4, [sp] str r4, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =gUnknown_08DE34B8 movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram b @080212FC .align 2, 0 .pool @080211EC: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 beq @080211F8 b @08021302 @080211F8: bl sub_81971D0 bl sub_8197200 adds r0, r5, 0 bl sub_8022588 adds r0, r5, 0 bl sub_8022600 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x8] movs r2, 0x80 orrs r1, r2 strb r1, [r0, 0x8] b @080212FC .align 2, 0 .pool @0802121C: ldr r0, =gUnknown_08DE3398 movs r2, 0xC0 lsls r2, 1 movs r1, 0 bl gpu_pal_apply ldr r1, =gUnknown_082F3C8C movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r1, =gUnknown_082F3DBC movs r0, 0x2 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r1, =gUnknown_082F3F54 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 .pool @08021278: bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 adds r0, r5, 0 bl sub_8022730 ldr r0, =0x02021bbe ldrh r1, [r0] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x16 bl 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 .pool @080212B4: ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 movs r0, 0 bl 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 .pool @080212FC: ldrb r0, [r5, 0xC] adds r0, 0x1 strb r0, [r5, 0xC] @08021302: movs r0, 0 @08021304: add sp, 0xC pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_802104C thumb_func_start sub_802130C sub_802130C: ; 802130C push {r4,r5,lr} sub sp, 0x8 bl sub_8020C00 adds r5, r0, 0 cmp r5, 0 bne @08021320 movs r0, 0x1 negs r0, r0 b @08021446 @08021320: ldrb r0, [r5, 0xC] cmp r0, 0x7 bls @08021328 b @0802143E @08021328: lsls r0, 2 ldr r1, =@08021338 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08021338: .4byte @08021358 .4byte @0802135E .4byte @08021368 .4byte @0802137E .4byte @0802138A .4byte @080213E6 .4byte @08021426 .4byte @08021436 @08021358: bl sub_8010434 b @0802143E @0802135E: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08021444 @08021368: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl 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, =0x02021bbe ldrh r1, [r4, 0x2C] ldrh r2, [r4, 0x2A] adds r1, r2 strh r1, [r0] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x16 bl 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 .pool thumb_func_end sub_8021450 thumb_func_start sub_8021488 sub_8021488: ; 8021488 movs r1, 0 ldr r2, =0x0000ff98 strh r2, [r0, 0x2A] strh r1, [r0, 0x2C] ldr r0, =0x02021bbc strh r1, [r0] ldr r0, =0x02021bbe strh r2, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8021488 thumb_func_start sub_80214A8 sub_80214A8: ; 80214A8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 mov r10, r0 str r1, [sp] movs r0, 0 mov r9, r0 mov r1, r10 ldrb r1, [r1, 0x9] cmp r9, r1 bcc @080214C6 b @080215E4 @080214C6: ldr r1, =gUnknown_082F41E8 mov r2, r9 lsls r0, r2, 1 adds r0, r1 ldrh r2, [r0] mov r1, r9 lsls r0, r1, 5 add r0, r10 adds r0, 0xA4 ldrh r3, [r0] adds r3, 0x85 lsls r3, 16 lsrs r3, 16 ldr r0, =gUnknown_082F436C adds r1, r2, 0 bl 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, =0x02020630 adds r1, r0 str r1, [r6] ldrb r0, [r1, 0x5] movs r2, 0xC orrs r0, r2 strb r0, [r1, 0x5] ldr r2, [r6] adds r2, 0x2C ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] ldr r1, [r6] ldr r0, [sp] adds r0, 0xC adds r0, r3 mov r8, r0 ldr r0, [r0] ldrh r0, [r0, 0x8] adds r0, 0x78 strh r0, [r1, 0x20] ldr r1, [r6] ldr r0, =0x0000fff0 strh r0, [r1, 0x22] ldr r3, [r6] adds r5, r3, 0 adds r5, 0x2E movs r0, 0x80 lsls r0, 2 strh r0, [r5, 0x2] movs r0, 0x20 strh r0, [r5, 0x4] movs r0, 0x70 strh r0, [r5, 0xE] mov r2, r8 ldr r1, [r2] ldrh r0, [r1, 0xA] ldrh r1, [r1, 0x8] subs r0, r1 lsls r0, 16 asrs r1, r0, 16 adds r0, r1, 0 cmp r1, 0 bge @08021558 adds r0, r1, 0x3 @08021558: asrs r0, 2 strh r0, [r5, 0xC] lsls r0, r1, 23 lsrs r7, r0, 16 movs r2, 0x80 lsls r2, 2 adds r2, 0x20 lsrs r2, 1 movs r0, 0x7 movs r1, 0xFE lsls r1, 6 str r3, [sp, 0x4] bl sub_81515D4 adds r4, r0, 0 ldr r0, [r6] ldrh r0, [r0, 0x20] lsls r0, 7 ldr r3, [sp, 0x4] strh r0, [r3, 0x2E] lsls r1, r7, 16 asrs r1, 16 lsls r4, 16 asrs r4, 16 movs r0, 0x7 adds r2, r4, 0 bl sub_81515D4 strh r0, [r5, 0x6] movs r0, 0x7 adds r1, r4, 0 movs r2, 0x55 bl sub_8151550 adds r2, r0, 0 movs r0, 0 strh r0, [r5, 0x8] lsls r2, 16 asrs r2, 16 movs r0, 0x7 movs r1, 0xFE lsls r1, 6 bl sub_81515D4 strh r0, [r5, 0xA] ldrh r0, [r5, 0xE] ldr r2, =0xffff8000 adds r1, r2, 0 orrs r0, r1 strh r0, [r5, 0xE] mov r1, r8 ldr r0, [r1] movs r2, 0x8 ldrsh r0, [r0, r2] cmp r0, 0 bge @080215D0 ldr r0, [r6] movs r1, 0x1 bl 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 .pool thumb_func_end sub_80214A8 thumb_func_start sub_8021608 sub_8021608: ; 8021608 push {r4-r6,lr} adds r5, r0, 0 adds r4, r5, 0 adds r4, 0x2E ldrh r0, [r4, 0x4] ldrh r1, [r4, 0x2] adds r0, r1 strh r0, [r4, 0x2] lsls r0, 16 asrs r0, 24 ldrh r2, [r5, 0x26] adds r0, r2 strh r0, [r5, 0x26] movs r1, 0xE ldrsh r0, [r4, r1] movs r6, 0x80 lsls r6, 8 ands r0, r6 cmp r0, 0 beq @0802166E ldrh r0, [r4, 0x6] ldrh r2, [r5, 0x2E] adds r0, r2 strh r0, [r5, 0x2E] ldrh r0, [r4, 0xA] ldrh r1, [r4, 0x8] adds r0, r1 strh r0, [r4, 0x8] lsls r0, 16 asrs r0, 23 movs r2, 0xC ldrsh r1, [r4, r2] bl sine strh r0, [r5, 0x24] movs r1, 0xE ldrsh r0, [r4, r1] ands r0, r6 cmp r0, 0 beq @0802166E ldrh r0, [r4, 0x8] lsls r0, 16 asrs r0, 23 cmp r0, 0x7E ble @0802166E movs r0, 0 strh r0, [r5, 0x24] ldrh r1, [r4, 0xE] ldr r0, =0x00007fff ands r0, r1 strh r0, [r4, 0xE] @0802166E: ldrh r0, [r4] lsls r0, 16 asrs r0, 23 strh r0, [r5, 0x20] movs r2, 0x22 ldrsh r1, [r5, r2] movs r2, 0x26 ldrsh r0, [r5, r2] adds r1, r0 ldrh r2, [r4, 0xE] ldr r0, =0x00007fff ands r0, r2 cmp r1, r0 blt @0802169A ldr r0, =nullsub_12 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 .pool thumb_func_end sub_8021608 thumb_func_start sub_80216A8 sub_80216A8: ; 80216A8 push {r4-r7,lr} adds r6, r0, 0 movs r5, 0 ldrb r0, [r6, 0x9] cmp r5, r0 bcs @080216D4 ldr r7, =gUnknown_082F41E8 @080216B6: lsls r0, r5, 1 adds r0, r7 ldrh r4, [r0] adds r0, r4, 0 bl 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 .pool thumb_func_end sub_80216A8 thumb_func_start sub_80216E0 sub_80216E0: ; 80216E0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 adds r6, r0, 0 str r1, [sp] movs r0, 0 str r0, [sp, 0x4] movs r1, 0x4E adds r1, r6 mov r10, r1 mov r9, r0 ldrb r2, [r6, 0x9] cmp r0, r2 bcs @080217AE ldr r7, =gUnknown_082F41CC @08021704: mov r3, r10 ldrh r0, [r3, 0xA] mov r4, r9 lsls r1, r4, 1 add r1, r9 asrs r0, r1 lsls r0, 16 movs r1, 0xE0 lsls r1, 11 ands r1, r0 lsrs r1, 16 mov r8, r1 cmp r1, 0 beq @0802179E ldr r0, [sp, 0x4] adds r0, 0x1 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08021748 lsls r4, 2 ldr r5, [sp] adds r5, 0x24 adds r0, r5, r4 ldr r0, [r0] movs r1, 0x1 bl obj_anim_image_start b @0802175A .align 2, 0 .pool @08021748: mov r0, r9 lsls r4, r0, 2 ldr r5, [sp] adds r5, 0x24 adds r0, r5, r4 ldr r0, [r0] movs r1, 0 bl 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, =gUnknown_082F41CD adds r1, r3 movs r0, 0 ldrsb r0, [r1, r0] strh r0, [r2, 0x26] @0802179E: mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 ldrb r4, [r6, 0x9] cmp r9, r4 bcc @08021704 @080217AE: ldr r0, [sp, 0x4] cmp r0, 0 bne @080217C0 adds r2, r6, 0 adds r2, 0x25 ldrb r1, [r2] b @0802189C .align 2, 0 .pool @080217C0: ldrh r0, [r6, 0x28] movs r1, 0x3 bl __umodsi3 lsls r0, 24 lsrs r0, 24 mov r8, r0 mov r1, r8 str r1, [sp, 0x8] movs r2, 0 mov r9, r2 mov r3, r10 ldrh r1, [r3, 0xC] lsls r0, r1, 1 adds r0, 0x3 adds r6, 0x25 str r6, [sp, 0xC] adds r3, r1, 0 cmp r9, r0 bge @08021890 @080217E8: mov r4, r9 lsls r1, r4, 2 ldr r0, [sp] adds r0, 0x4C adds r7, r0, r1 ldr r2, [r7] adds r0, r2, 0 adds r0, 0x3E ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0802187E ldr r0, =sub_8022B28 str r0, [r2, 0x1C] lsls r1, r4, 1 ldr r3, =gUnknown_082F41D2 adds r0, r1, r3 movs r4, 0 ldrsb r4, [r0, r4] adds r0, r4, 0 adds r0, 0x78 strh r0, [r2, 0x20] ldr r2, [r7] ldr r0, =gUnknown_082F41D3 adds r1, r0 movs r6, 0 ldrsb r6, [r1, r6] mov r1, r8 lsls r0, r1, 2 subs r0, 0x88 subs r0, r6, r0 strh r0, [r2, 0x22] ldr r5, [r7] ldr r2, [sp, 0x8] lsls r1, r2, 2 adds r0, r4, 0 bl __divsi3 adds r4, r0 strh r4, [r5, 0x24] ldr r0, [r7] strh r6, [r0, 0x26] mov r3, r10 ldrb r1, [r3, 0x4] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08021860 ldr r0, [r7] movs r1, 0x1 bl obj_anim_image_start b @08021868 .align 2, 0 .pool @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, =gUnknown_082F334C movs r4, 0x1 @08021990: mov r0, r12 subs r1, r0, r2 adds r0, r3, 0 asrs r0, r1 ands r0, r4 cmp r0, 0 beq @080219A6 lsls r0, r2, 2 adds r0, r5 ldr r0, [r0] adds r7, r0 @080219A6: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x7 bls @08021990 ldr r1, =0x000f4240 adds r0, r7, 0 bl __udivsi3 strh r0, [r6, 0x8] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8021944 thumb_func_start sub_80219C8 sub_80219C8: ; 80219C8 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0xC adds r6, r0, 0 adds r4, r1, 0 adds r5, r2, 0 mov r8, r3 lsls r6, 24 lsrs r6, 24 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 movs r2, 0x1 negs r2, r2 movs r0, 0x2 mov r1, r8 bl 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, =gUnknown_082F32D8 adds r0, r1 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] mov r0, r8 str r0, [sp, 0x8] adds r0, r6, 0 movs r1, 0x2 adds r2, r4, 0 movs r3, 0 bl box_print add sp, 0xC pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80219C8 thumb_func_start sub_8021A28 sub_8021A28: ; 8021A28 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x2C str r0, [sp, 0xC] lsls r1, 24 lsrs r1, 24 str r1, [sp, 0x10] lsls r2, 24 lsrs r2, 24 str r2, [sp, 0x14] lsls r3, 24 movs r0, 0 str r0, [sp, 0x18] movs r1, 0 str r1, [sp, 0x1C] ldr r2, [sp, 0xC] adds r2, 0x68 str r2, [sp, 0x20] movs r4, 0xF0 lsls r4, 24 adds r3, r4 lsrs r3, 24 ldr r0, [sp, 0x10] cmp r0, 0x2 bne @08021A68 adds r0, r3, 0 subs r0, 0x2A lsls r0, 24 lsrs r3, r0, 24 @08021A68: ldr r2, [sp, 0xC] ldrb r1, [r2, 0x9] lsls r0, r1, 3 subs r0, r1 lsls r0, 1 subs r6, r3, r0 cmp r6, 0 ble @08021A84 lsrs r0, r6, 31 adds r0, r6, r0 asrs r0, 1 adds r6, r0, 0 adds r6, 0x10 b @08021A86 @08021A84: movs r6, 0x10 @08021A86: movs r5, 0 ldr r3, [sp, 0xC] ldrb r3, [r3, 0x9] cmp r5, r3 bcc @08021A92 b @08021D14 @08021A92: ldr r4, [sp, 0x10] lsls r4, 2 str r4, [sp, 0x24] @08021A98: bl sub_81AFBF0 ldr r0, [sp, 0x10] cmp r0, 0x1 beq @08021B48 cmp r0, 0x1 bgt @08021AC0 cmp r0, 0 beq @08021ADE ldr r4, [sp, 0x14] subs r4, 0x4 lsls r1, r6, 24 mov r10, r1 ldr r2, [sp, 0x1C] adds r2, 0xA2 mov r9, r2 ldr r3, [sp, 0x18] lsls r3, 5 mov r8, r3 b @08021C5A @08021AC0: ldr r4, [sp, 0x10] cmp r4, 0x2 bne @08021AC8 b @08021C1C @08021AC8: ldr r4, [sp, 0x14] subs r4, 0x4 lsls r0, r6, 24 mov r10, r0 ldr r1, [sp, 0x1C] adds r1, 0xA2 mov r9, r1 ldr r2, [sp, 0x18] lsls r2, 5 mov r8, r2 b @08021C5A @08021ADE: ldr r0, [sp, 0x20] adds r0, 0x20 adds r0, r5 ldrb r0, [r0] str r0, [sp, 0x18] lsls r3, r5, 1 ldr r2, [sp, 0x20] adds r2, 0xC cmp r5, 0 beq @08021B04 adds r0, r2, r3 subs r1, r5, 0x1 lsls r1, 1 adds r1, r2, r1 ldrh r0, [r0] ldrh r1, [r1] cmp r0, r1 beq @08021B04 str r5, [sp, 0x1C] @08021B04: ldr r4, [sp, 0x24] ldr r1, [sp, 0x10] adds r0, r4, r1 lsls r0, 1 adds r0, r3, r0 adds r0, r2, r0 ldrh r1, [r0] ldr r0, =0x02021fc4 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r0, =gUnknown_082F43B4 adds r0, r4, r0 ldr r1, [r0] ldr r0, =0x02021fc4 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 .pool @08021B48: ldr r1, [sp, 0x20] adds r0, r1, r5 adds r0, 0x28 ldrb r0, [r0] str r0, [sp, 0x18] lsls r3, r5, 1 adds r2, r1, 0 adds r2, 0xC cmp r5, 0 beq @08021B72 adds r0, r3, 0 adds r0, 0xA adds r0, r2, r0 adds r1, r3, 0 adds r1, 0x8 adds r1, r2, r1 ldrh r0, [r0] ldrh r1, [r1] cmp r0, r1 beq @08021B72 str r5, [sp, 0x1C] @08021B72: ldr r0, [sp, 0x24] ldr r1, [sp, 0x10] adds r4, r0, r1 lsls r4, 1 adds r4, r3, r4 adds r4, r2, r4 ldrh r1, [r4] lsrs r1, 4 ldr r0, =0x02021cc4 movs r2, 0x1 movs r3, 0x3 bl 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, =gUnknown_082F334C mov r12, r1 @08021BB8: movs r0, 0x3 subs r1, r0, r2 adds r0, r3, 0 asrs r0, r1 movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08021BD0 lsls r0, r2, 2 add r0, r12 ldr r0, [r0] adds r7, r0 @08021BD0: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @08021BB8 adds r0, r7, 0 ldr r1, =0x000f4240 bl __udivsi3 lsls r0, 24 lsrs r3, r0, 24 ldr r0, =0x02021dc4 adds r1, r3, 0 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r0, =gUnknown_082F43B4 ldr r2, [sp, 0x28] adds r0, r2, r0 ldr r1, [r0] ldr r0, =0x02021fc4 bl ExpandTextCodes b @08021C5E .align 2, 0 .pool @08021C1C: str r5, [sp, 0x18] str r5, [sp, 0x1C] lsls r7, r5, 5 ldr r3, [sp, 0xC] adds r0, r3, r7 adds r0, 0xA4 ldrb r2, [r0] cmp r2, 0x2B bls @08021C30 movs r2, 0 @08021C30: lsls r1, r2, 3 subs r1, r2 lsls r1, 2 ldr r0, =gBerries adds r1, r0 ldr r0, =0x02021cc4 bl gf_strcpy ldr r0, =gUnknown_082F43B4 ldr r1, [r0, 0x8] ldr r0, =0x02021fc4 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, =0x02021fc4 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, =gUnknown_082F32D8 str r1, [sp] movs r4, 0 str r4, [sp, 0x4] ldr r1, =0x02021fc4 str r1, [sp, 0x8] movs r1, 0x2 bl box_print ldr r3, [sp, 0x18] ldr r2, [sp, 0xC] ldrb r2, [r2, 0x8] cmp r3, r2 bne @08021CC0 ldr r0, =0x02021ec4 ldr r1, =gUnknown_085ED7D4 bl gf_strcpy b @08021CC8 .align 2, 0 .pool @08021CC0: ldr r0, =0x02021ec4 ldr r1, =gUnknown_085ED7E0 bl gf_strcpy @08021CC8: ldr r4, =0x02021ec4 mov r3, r9 strb r3, [r4] mov r1, r8 adds r1, 0x98 ldr r0, [sp, 0xC] adds r1, r0, r1 movs r0, 0 bl sub_81AFC0C ldr r0, =0x02021fc4 adds r1, r4, 0 bl sub_81AFC28 ldr r1, [sp, 0xC] movs r2, 0xDD lsls r2, 1 adds r0, r1, r2 ldrb r0, [r0] mov r4, r10 lsrs r3, r4, 24 ldr r1, =gUnknown_082F32D8 str r1, [sp] movs r1, 0 str r1, [sp, 0x4] ldr r2, =0x02021fc4 str r2, [sp, 0x8] movs r1, 0x2 movs r2, 0x4 bl box_print lsls r0, r5, 24 lsrs r5, r0, 24 ldr r3, [sp, 0xC] ldrb r3, [r3, 0x9] cmp r5, r3 bcs @08021D14 b @08021A98 @08021D14: add sp, 0x2C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8021A28 thumb_func_start sub_8021D34 sub_8021D34: ; 8021D34 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x1C mov r8, r0 movs r0, 0 mov r10, r0 movs r6, 0 movs r1, 0 str r1, [sp, 0xC] mov r2, r8 adds r2, 0x68 str r2, [sp, 0x10] movs r4, 0xDD lsls r4, 1 add r4, r8 mov r9, r4 ldrb r0, [r4] movs r1, 0x4 bl 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, =gUnknown_082F32D8 str r4, [sp] str r6, [sp, 0x4] ldr r1, =gUnknown_085ED808 str r1, [sp, 0x8] movs r1, 0x2 movs r2, 0 adds r3, r7, 0 bl box_print ldr r4, =gUnknown_085ED840 movs r0, 0x2 adds r1, r4, 0 movs r2, 0x1 negs r2, r2 bl 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, =gUnknown_082F32D8 str r1, [sp] mov r2, r10 str r2, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 bl box_print movs r0, 0x9F lsls r0, 1 add r0, r8 movs r4, 0 ldrsh r1, [r0, r4] ldr r0, =0x02021cc4 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r0, =0x02021dc4 movs r1, 0xA0 lsls r1, 1 add r1, r8 movs r2, 0 ldrsh r1, [r1, r2] movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r5, =0x02021fc4 ldr r1, =gUnknown_085ED838 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, =gUnknown_082F32D8 str r1, [sp] mov r2, r10 str r2, [sp, 0x4] str r5, [sp, 0x8] movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 bl box_print ldr r4, =gUnknown_085ED830 movs r0, 0x2 adds r1, r4, 0 movs r2, 0x1 negs r2, r2 bl font_get_width_of_string subs r0, r6, r0 lsls r0, 24 lsrs r6, r0, 24 mov r1, r9 ldrb r0, [r1] ldr r2, =gUnknown_082F32D8 str r2, [sp] mov r1, r10 str r1, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 bl box_print movs r0, 0x9E lsls r0, 1 add r0, r8 movs r2, 0 ldrsh r1, [r0, r2] ldr r0, =0x02021cc4 movs r2, 0x2 movs r3, 0x1 bl decimal_int_to_string ldr r1, =gUnknown_085ED82C 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, =gUnknown_082F32D8 str r1, [sp] mov r2, r10 str r2, [sp, 0x4] str r5, [sp, 0x8] movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 bl box_print adds r0, r7, 0 adds r0, 0xE lsls r0, 24 lsrs r7, r0, 24 ldrb r0, [r4] ldr r4, =gUnknown_082F32D8 str r4, [sp] mov r1, r10 str r1, [sp, 0x4] ldr r1, =gUnknown_085ED810 str r1, [sp, 0x8] movs r1, 0x2 movs r2, 0 adds r3, r7, 0 bl box_print ldr r4, =gUnknown_085ED850 movs r0, 0x2 adds r1, r4, 0 movs r2, 0x1 negs r2, r2 bl 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, =gUnknown_082F32D8 str r2, [sp] mov r1, r10 str r1, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 bl box_print mov r4, r8 ldrb r2, [r4, 0x16] ldrh r0, [r4, 0x16] mov r12, r0 movs r1, 0x7 mov r9, r1 movs r5, 0x1 ldr r3, =gUnknown_082F334C @08021EEC: mov r4, r9 mov r0, r10 subs r1, r4, r0 adds r0, r2, 0 asrs r0, r1 ands r0, r5 cmp r0, 0 beq @08021F0A mov r1, r10 lsls r0, r1, 2 adds r0, r3 ldr r0, [r0] ldr r4, [sp, 0xC] adds r4, r0 str r4, [sp, 0xC] @08021F0A: mov r0, r10 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r10, r0 cmp r0, 0x7 bls @08021EEC ldr r0, =0x02021cc4 mov r2, r12 lsrs r1, r2, 8 movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r4, =0x02021dc4 ldr r1, =0x000f4240 ldr r0, [sp, 0xC] bl __udivsi3 adds r1, r0, 0 adds r0, r4, 0 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085ED848 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, =gUnknown_082F32E7 str r1, [sp] movs r1, 0 str r1, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 bl box_print b @08021FDE .align 2, 0 .pool @08021FC4: movs r0, 0xDD lsls r0, 1 add r0, r8 ldrb r0, [r0] ldr r1, =gUnknown_082F32D8 str r1, [sp] str r2, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 bl box_print @08021FDE: adds r0, r7, 0 adds r0, 0xE lsls r0, 24 lsrs r7, r0, 24 movs r4, 0xDD lsls r4, 1 add r8, r4 mov r1, r8 ldrb r0, [r1] ldr r2, =gUnknown_082F32D8 mov r9, r2 str r2, [sp] movs r5, 0 str r5, [sp, 0x4] ldr r1, =gUnknown_085ED820 str r1, [sp, 0x8] movs r1, 0x2 movs r2, 0 adds r3, r7, 0 bl box_print ldr r0, =0x02021cc4 ldr r4, [sp, 0x10] ldrh r1, [r4, 0x8] movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085ED85C 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 .pool thumb_func_end sub_8021D34 thumb_func_start sub_8022070 sub_8022070: ; 8022070 push {r4-r6,lr} sub sp, 0x8 adds r4, r0, 0 adds r6, r1, 0 adds r0, r6, 0 adds r0, 0x80 ldrb r0, [r0] cmp r0, 0x5 bls @08022084 b @08022218 @08022084: lsls r0, 2 ldr r1, =@08022094 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08022094: .4byte @080220AC .4byte @080220F8 .4byte @0802210C .4byte @08022130 .4byte @080221F8 .4byte @08022200 @080220AC: ldrb r0, [r4, 0x9] subs r0, 0x2 lsls r0, 24 lsrs r5, r0, 24 adds r0, r6, 0 bl sub_8022554 ldrh r0, [r4, 0x12] lsls r0, 3 ldr r2, =gUnknown_082F32CC mov r1, sp adds r0, r2 ldm r0!, {r2,r3} stm r1!, {r2,r3} ldrh r0, [r4, 0x12] cmp r0, 0xD bne @080220DC ldr r0, =gUnknown_082F3344 adds r0, 0x4 b @080220DE .align 2, 0 .pool @080220DC: ldr r0, =gUnknown_082F3344 @080220DE: adds r0, r5, r0 ldrb r1, [r0] mov r0, sp strb r1, [r0, 0x4] mov r0, sp bl Window_AddFromTemplate adds r1, r6, 0 adds r1, 0x82 strb r0, [r1] b @08022218 .align 2, 0 .pool @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, =0x0000021d adds r1, r4, 0 movs r2, 0xD0 bl box_border_load_tiles_and_pal ldrb r0, [r5] movs r1, 0 adds r2, r4, 0 movs r3, 0xD bl SetWindowBorderStyle b @08022218 .align 2, 0 .pool @08022130: ldrb r0, [r4, 0x9] subs r0, 0x2 lsls r0, 24 lsrs r5, r0, 24 ldrh r0, [r4, 0x12] cmp r0, 0xC beq @08022184 cmp r0, 0xC bgt @08022148 cmp r0, 0xB beq @0802214E b @08022218 @08022148: cmp r0, 0xD beq @080221C8 b @08022218 @0802214E: adds r0, r6, 0 adds r0, 0x82 ldrb r0, [r0] ldr r3, =gUnknown_085ED860 movs r1, 0x14 movs r2, 0x3 bl sub_80219C8 ldr r0, =gUnknown_082F3344 adds r0, r5, r0 ldrb r3, [r0] lsls r3, 27 lsrs r3, 24 adds r0, r4, 0 movs r1, 0 movs r2, 0xA0 bl sub_8021A28 adds r1, r6, 0 adds r1, 0x80 movs r0, 0x5 b @08022220 .align 2, 0 .pool @08022184: adds r0, r6, 0 adds r0, 0x82 ldrb r0, [r0] ldr r2, =gUnknown_082F43B4 adds r1, r4, 0 adds r1, 0x8F ldrb r1, [r1] adds r1, 0x3 lsls r1, 2 adds r1, r2 ldr r3, [r1] movs r1, 0x14 movs r2, 0x4 bl sub_80219C8 ldr r0, =gUnknown_082F3344 adds r0, r5, r0 ldrb r3, [r0] lsls r3, 27 lsrs r3, 24 adds r0, r4, 0 movs r1, 0x1 movs r2, 0xA0 bl sub_8021A28 adds r1, r6, 0 adds r1, 0x80 movs r0, 0x5 b @08022220 .align 2, 0 .pool @080221C8: adds r0, r6, 0 adds r0, 0x82 ldrb r0, [r0] ldr r3, =gUnknown_085ED878 movs r1, 0x16 movs r2, 0x3 bl sub_80219C8 ldr r0, =gUnknown_082F3344 adds r0, 0x4 adds r0, r5, r0 ldrb r3, [r0] lsls r3, 27 lsrs r3, 24 adds r0, r4, 0 movs r1, 0x2 movs r2, 0xB0 bl sub_8021A28 b @08022218 .align 2, 0 .pool @080221F8: adds r0, r4, 0 bl sub_8021D34 b @08022218 @08022200: adds r0, r6, 0 adds r0, 0x82 ldrb r0, [r0] movs r1, 0x3 bl 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, =0x03005e08 adds r6, r0, r1 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0x1 beq @080222D0 cmp r0, 0x1 bgt @08022288 cmp r0, 0 beq @08022296 b @080224BA .align 2, 0 .pool @08022288: cmp r0, 0x2 bne @0802228E b @08022480 @0802228E: cmp r0, 0x3 bne @08022294 b @08022494 @08022294: b @080224BA @08022296: ldr r0, =gUnknown_082F32EC bl 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, =0x0000021d adds r1, r4, 0 movs r2, 0xD0 bl box_border_load_tiles_and_pal ldrb r0, [r6, 0x2] movs r1, 0 adds r2, r4, 0 movs r3, 0xD bl SetWindowBorderStyle b @080224BA .align 2, 0 .pool @080222D0: ldr r0, =gUnknown_085ED8D0 mov r10, r0 movs r1, 0x1 negs r1, r1 mov r8, r1 movs r0, 0x1 mov r1, r10 mov r2, r8 bl 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, =gUnknown_082F32E1 str r5, [sp] mov r1, r9 str r1, [sp, 0x4] mov r1, r10 str r1, [sp, 0x8] movs r1, 0x1 adds r2, r7, 0 movs r3, 0x1 bl box_print ldr r0, =gUnknown_085ED8DC mov r10, r0 movs r0, 0x1 mov r1, r10 mov r2, r8 bl 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, =0x02021cc4 movs r2, 0 movs r3, 0x1 bl decimal_int_to_string ldr r0, =0x02021fc4 ldr r1, =gUnknown_085ED8F4 bl ExpandTextCodes ldrb r0, [r6, 0x2] ldr r1, =gUnknown_082F32D8 str r1, [sp] movs r1, 0 str r1, [sp, 0x4] ldr r1, =0x02021fc4 str r1, [sp, 0x8] movs r1, 0x1 movs r2, 0 mov r3, r10 bl box_print movs r0, 0x1 ldr r1, =gUnknown_085ED850 movs r2, 0x1 negs r2, r2 bl font_get_width_of_string movs r1, 0xC0 subs r1, r0 lsls r1, 24 lsrs r7, r1, 24 ldrb r0, [r6, 0x2] ldr r1, =gUnknown_082F32D8 str r1, [sp] movs r1, 0 str r1, [sp, 0x4] ldr r1, =gUnknown_085ED850 str r1, [sp, 0x8] movs r1, 0x1 adds r2, r7, 0 mov r3, r10 bl box_print movs r2, 0 mov r0, r9 lsls r4, r0, 1 mov r1, r10 adds r1, 0x10 str r1, [sp, 0x10] movs r0, 0x1 add r9, r0 adds r0, r4, r6 ldrb r3, [r0, 0x4] movs r1, 0x7 mov r12, r1 movs r0, 0x1 mov r8, r0 ldr r5, =gUnknown_082F334C @080223AE: mov r0, r12 subs r1, r0, r2 adds r0, r3, 0 asrs r0, r1 mov r1, r8 ands r0, r1 cmp r0, 0 beq @080223CA lsls r0, r2, 2 adds r0, r5 ldr r0, [r0] ldr r1, [sp, 0xC] adds r1, r0 str r1, [sp, 0xC] @080223CA: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x7 bls @080223AE adds r0, r4, r6 ldrh r1, [r0, 0x4] lsrs r1, 8 ldr r0, =0x02021cc4 movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r0, [sp, 0xC] ldr r1, =0x000f4240 bl __udivsi3 adds r1, r0, 0 ldr r0, =0x02021dc4 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r0, =0x02021fc4 ldr r1, =gUnknown_085ED848 bl ExpandTextCodes movs r0, 0x1 ldr r1, =0x02021fc4 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, =gUnknown_082F32D8 str r1, [sp] movs r1, 0 str r1, [sp, 0x4] ldr r1, =0x02021fc4 str r1, [sp, 0x8] movs r1, 0x1 adds r2, r7, 0 mov r3, r10 bl box_print ldr r1, [sp, 0x10] lsls r0, r1, 24 lsrs r0, 24 mov r10, r0 movs r0, 0 str r0, [sp, 0xC] mov r1, r9 lsls r0, r1, 24 lsrs r0, 24 mov r9, r0 cmp r0, 0x3 bhi @08022444 b @08022336 @08022444: ldrb r0, [r6, 0x2] movs r1, 0x3 bl Window_CopyToVram b @080224BA .align 2, 0 .pool @08022480: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @080224BA b @080224C0 .align 2, 0 .pool @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, =sub_8022250 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =0x03005d90 ldr r2, [r0] movs r3, 0xF6 lsls r3, 1 adds r0, r2, r3 ldrh r0, [r0] strh r0, [r1, 0xC] adds r3, 0x2 adds r0, r2, r3 ldrh r0, [r0] strh r0, [r1, 0xE] adds r3, 0x2 adds r0, r2, r3 ldrh r0, [r0] strh r0, [r1, 0x10] adds r3, 0x2 adds r0, r2, r3 ldrh r0, [r0] strh r0, [r1, 0x12] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80224D0 thumb_func_start sub_8022524 sub_8022524: ; 8022524 push {r4,lr} adds r4, r0, 0 lsls r1, 16 lsrs r1, 16 bl sub_8021944 movs r0, 0x4 ldrsh r1, [r4, r0] movs r0, 0 bl sub_8035044 movs r0, 0x6 ldrsh r1, [r4, r0] movs r0, 0x1 bl sub_8035044 movs r0, 0x8 ldrsh r1, [r4, r0] movs r0, 0x2 bl sub_8035044 pop {r4} pop {r0} bx r0 thumb_func_end sub_8022524 thumb_func_start sub_8022554 sub_8022554: ; 8022554 push {lr} ldr r2, [r0, 0x78] adds r2, 0x3E ldrb r1, [r2] movs r3, 0x4 orrs r1, r3 strb r1, [r2] ldr r1, [r0, 0x7C] adds r1, 0x3E ldrb r0, [r1] orrs r0, r3 strb r0, [r1] movs r0, 0x2 movs r1, 0x1 bl sub_803547C movs r0, 0x1 movs r1, 0x1 bl sub_803547C movs r0, 0 movs r1, 0x1 bl sub_803547C pop {r0} bx r0 thumb_func_end sub_8022554 thumb_func_start sub_8022588 sub_8022588: ; 8022588 push {r4-r7,lr} adds r5, r0, 0 movs r6, 0 ldrb r0, [r5, 0x9] cmp r6, r0 bcs @080225E8 ldr r7, =gUnknown_082F417C @08022596: lsls r0, r6, 2 movs r1, 0xA2 lsls r1, 1 adds r2, r5, r1 adds r2, r0 ldrb r1, [r5, 0x9] subs r1, 0x2 lsls r0, r1, 2 adds r0, r1 adds r0, r6, r0 adds r0, r7 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_082F4190 adds r0, r1 str r0, [r2] ldrb r0, [r0] lsls r0, 3 ldr r1, =gUnknown_082F32F4 adds r0, r1 bl Window_AddFromTemplate ldr r1, =0x000001bb 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 .pool thumb_func_end sub_8022588 thumb_func_start sub_8022600 sub_8022600: ; 8022600 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x14 adds r6, r0, 0 movs r7, 0 ldrb r0, [r6, 0x9] cmp r7, r0 bcs @080226B6 movs r1, 0 mov r8, r1 @08022616: ldr r1, =0x000001bb adds r0, r6, r1 adds r5, r0, r7 ldrb r0, [r5] bl 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, =gUnknown_082F32DB 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 .pool @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, =gUnknown_082F32DE 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, =0x000001bb 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 .pool thumb_func_end sub_8022600 thumb_func_start sub_80226D0 sub_80226D0: ; 80226D0 push {r4-r6,lr} sub sp, 0x8 adds r6, r0, 0 movs r5, 0 ldr r0, =gUnknown_08DE3FD4 ldr r4, =0x0201c000 adds r1, r4, 0 bl LZ77UnCompWram b @0802271A .align 2, 0 .pool @080226EC: lsls r1, r5, 2 movs r2, 0xA2 lsls r2, 1 adds r0, r6, r2 adds r0, r1 ldr r3, [r0] ldrb r0, [r3] lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r4, r1 ldrb r2, [r3, 0x1] ldrb r3, [r3, 0x2] movs r0, 0xA str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x3 bl 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, =0x0000ff98 strh r0, [r6, 0x2A] strh r5, [r6, 0x2C] ldr r1, =0x02021bbc strh r5, [r1] ldr r1, =0x02021bbe strh r0, [r1] ldr r4, =gUnknown_082F41F4 @08022746: lsls r0, r5, 3 adds r0, r4 bl gpu_tile_obj_decompress_and_load adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x3 bls @08022746 ldr r0, =gUnknown_082F421C bl gpu_pal_obj_alloc_and_load_multiple ldr r0, =gUnknown_082F430C 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, =0x02020630 adds r0, r1 str r0, [r3] ldrb r1, [r0, 0x5] movs r2, 0xC orrs r1, r2 strb r1, [r0, 0x5] ldr r1, [r3] adds r1, 0x3E ldrb r0, [r1] movs r2, 0x2 orrs r0, r2 strb r0, [r1] ldr r1, [r3] adds r1, 0x2C ldrb r0, [r1] movs r2, 0x40 orrs r0, r2 strb r0, [r1] movs r5, 0 ldrb r1, [r6, 0x9] cmp r5, r1 bcs @08022822 movs r7, 0x4 @080227AA: lsls r4, r5, 2 movs r3, 0xA2 lsls r3, 1 adds r0, r6, r3 adds r0, r4 ldr r0, [r0] ldrh r1, [r0, 0x4] adds r1, 0x78 lsls r1, 16 asrs r1, 16 ldrh r2, [r0, 0x6] adds r2, 0x20 lsls r2, 16 asrs r2, 16 ldr r0, =gUnknown_082F4324 movs r3, 0 bl 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, =0x02020630 adds r1, r0 str r1, [r3] ldrb r0, [r1, 0x5] movs r4, 0xD negs r4, r4 adds r2, r4, 0 ands r0, r2 orrs r0, r7 strb r0, [r1, 0x5] ldr r1, [r3] adds r1, 0x3E ldrb r0, [r1] orrs r0, r7 strb r0, [r1] ldr r2, [r3] adds r2, 0x3E ldrb r0, [r2] movs r1, 0x2 orrs r0, r1 strb r0, [r2] ldr r2, [r3] adds r2, 0x2C ldrb r0, [r2] movs r1, 0x40 orrs r0, r1 strb r0, [r2] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 ldrb r0, [r6, 0x9] cmp r5, r0 bcc @080227AA @08022822: movs r5, 0 ldr r4, =gUnknown_082F41D2 adds r7, r4, 0x1 @08022828: lsls r2, r5, 1 adds r0, r2, r4 movs r1, 0 ldrsb r1, [r0, r1] adds r1, 0x78 adds r2, r7 ldrb r2, [r2] lsls r2, 24 asrs r2, 24 adds r2, 0x88 ldr r0, =gUnknown_082F433C movs r3, 0x6 bl 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, =0x02020630 adds r0, r1 str r0, [r3] ldrb r1, [r0, 0x5] movs r2, 0xC orrs r1, r2 strb r1, [r0, 0x5] ldr r2, [r3] adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] ldr r2, [r3] adds r2, 0x2C ldrb r0, [r2] movs r1, 0x40 orrs r0, r1 strb r0, [r2] ldr r0, [r3] strh r5, [r0, 0x2E] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0xA bls @08022828 movs r5, 0 @0802288E: lsls r1, r5, 1 adds r1, r5 lsls r1, 19 movs r3, 0xB0 lsls r3, 16 adds r1, r3 asrs r1, 16 ldr r0, =gUnknown_082F4354 movs r2, 0x8 movs r3, 0 bl 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, =0x02020630 adds r0, r1 str r0, [r3] ldrb r1, [r0, 0x5] movs r4, 0xD negs r4, r4 adds r2, r4, 0 ands r1, r2 strb r1, [r0, 0x5] ldr r2, [r3] adds r2, 0x3E ldrb r0, [r2] adds r4, 0x8 adds r1, r4, 0 ands r0, r1 strb r0, [r2] ldr r2, [r3] adds r2, 0x2C ldrb r0, [r2] movs r3, 0x41 negs r3, r3 adds r1, r3, 0 ands r0, r1 strb r0, [r2] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x1 bls @0802288E ldr r4, =gUnknown_082F4384 movs r0, 0 movs r1, 0 adds r2, r4, 0 bl sub_8034D14 adds r2, r4, 0 adds r2, 0x10 movs r0, 0x1 movs r1, 0 bl sub_8034D14 adds r4, 0x20 movs r0, 0x2 movs r1, 0 adds r2, r4, 0 bl sub_8034D14 ldrh r0, [r6, 0x12] cmp r0, 0x1 bne @08022928 movs r4, 0x9C lsls r4, 1 adds r0, r6, r4 bl sub_8022554 @08022928: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8022730 thumb_func_start sub_8022960 sub_8022960: ; 8022960 push {r4-r6,lr} adds r5, r0, 0 movs r4, 0 movs r0, 0x4 bl 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, =nullsub_12 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 .pool thumb_func_end sub_8022A4C thumb_func_start sub_8022A94 sub_8022A94: ; 8022A94 push {r4-r6,lr} adds r5, r0, 0 adds r4, r5, 0 adds r4, 0x2E ldrh r0, [r4, 0x4] ldrh r1, [r4, 0x2] adds r0, r1 strh r0, [r4, 0x2] lsls r0, 16 asrs r0, 24 ldrh r2, [r5, 0x26] adds r0, r2 strh r0, [r5, 0x26] movs r1, 0xE ldrsh r0, [r4, r1] movs r6, 0x80 lsls r6, 8 ands r0, r6 cmp r0, 0 beq @08022AFA ldrh r0, [r4, 0x6] ldrh r2, [r5, 0x2E] adds r0, r2 strh r0, [r5, 0x2E] ldrh r0, [r4, 0xA] ldrh r1, [r4, 0x8] adds r0, r1 strh r0, [r4, 0x8] lsls r0, 16 asrs r0, 23 movs r2, 0xC ldrsh r1, [r4, r2] bl sine strh r0, [r5, 0x24] movs r1, 0xE ldrsh r0, [r4, r1] ands r0, r6 cmp r0, 0 beq @08022AFA ldrh r0, [r4, 0x8] lsls r0, 16 asrs r0, 23 cmp r0, 0x7E ble @08022AFA movs r0, 0 strh r0, [r5, 0x24] ldrh r1, [r4, 0xE] ldr r0, =0x00007fff ands r0, r1 strh r0, [r4, 0xE] @08022AFA: ldrh r0, [r4] lsls r0, 16 asrs r0, 23 strh r0, [r5, 0x20] movs r2, 0x22 ldrsh r1, [r5, r2] movs r2, 0x26 ldrsh r0, [r5, r2] adds r1, r0 ldrh r2, [r4, 0xE] ldr r0, =0x00007fff ands r0, r2 cmp r1, r0 ble @08022B1A ldr r0, =sub_8022A4C str r0, [r5, 0x1C] @08022B1A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8022A94 thumb_func_start sub_8022B28 sub_8022B28: ; 8022B28 push {r4-r7,lr} mov r7, r8 push {r7} adds r6, r0, 0 adds r7, r6, 0 adds r7, 0x2E movs r0, 0 mov r8, r0 movs r2, 0xA0 lsls r2, 2 strh r2, [r7, 0x2] movs r0, 0x20 strh r0, [r7, 0x4] movs r1, 0xA8 strh r1, [r7, 0xE] movs r0, 0x24 ldrsh r4, [r6, r0] lsls r4, 23 lsrs r4, 16 ldrh r0, [r6, 0x22] subs r1, r0 lsls r1, 23 asrs r1, 16 adds r2, 0x20 asrs r2, 1 movs r0, 0x7 bl sub_81515D4 adds r5, r0, 0 ldrh r0, [r6, 0x20] lsls r0, 7 strh r0, [r6, 0x2E] lsls r4, 16 asrs r4, 16 lsls r5, 16 asrs r5, 16 movs r0, 0x7 adds r1, r4, 0 adds r2, r5, 0 bl sub_81515D4 strh r0, [r7, 0x6] movs r0, 0x7 adds r1, r5, 0 movs r2, 0x55 bl sub_8151550 adds r2, r0, 0 mov r1, r8 strh r1, [r7, 0x8] movs r1, 0xFE lsls r1, 6 lsls r2, 16 asrs r2, 16 movs r0, 0x7 bl sub_81515D4 strh r0, [r7, 0xA] movs r2, 0x24 ldrsh r0, [r6, r2] cmp r0, 0 bge @08022BA6 adds r0, 0x3 @08022BA6: asrs r0, 2 strh r0, [r7, 0xC] ldrh r0, [r7, 0xE] ldr r2, =0xffff8000 adds r1, r2, 0 orrs r0, r1 strh r0, [r7, 0xE] mov r0, r8 strh r0, [r6, 0x26] strh r0, [r6, 0x24] ldr r0, =sub_8022A94 str r0, [r6, 0x1C] adds r2, r6, 0 adds r2, 0x2C ldrb r1, [r2] movs r0, 0x41 negs r0, r0 ands r0, r1 strb r0, [r2] adds r2, 0x12 ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8022B28 thumb_func_start sub_8022BEC sub_8022BEC: ; 8022BEC push {r4-r7,lr} mov r7, r8 push {r7} adds r7, r2, 0 lsls r0, 16 lsrs r5, r0, 16 lsls r1, 24 lsrs r4, r1, 24 mov r8, r4 bl sub_8020C00 adds r6, r0, 0 cmp r5, 0x19 bls @08022C0A movs r5, 0 @08022C0A: cmp r4, 0 beq @08022C14 cmp r4, 0x1 beq @08022C40 b @08022C4A @08022C14: cmp r5, 0 beq @08022C28 ldr r0, =gUnknown_082F43CC lsls r1, r5, 2 adds r1, r0 ldr r2, [r1] adds r0, r6, 0 adds r1, r7, 0 bl _call_via_r2 @08022C28: ldrb r0, [r6, 0xE] cmp r0, 0x19 bls @08022C32 mov r0, r8 strb r0, [r6, 0xE] @08022C32: ldr r0, =gUnknown_082F43CC ldrb r1, [r6, 0xE] lsls r1, 2 b @08022C44 .align 2, 0 .pool @08022C40: ldr r0, =gUnknown_082F43CC lsls r1, r5, 2 @08022C44: adds r1, r0 ldr r0, [r1] str r0, [r6, 0x4] @08022C4A: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8022BEC thumb_func_start sub_8022C58 sub_8022C58: ; 8022C58 push {r4-r6,lr} sub sp, 0x4 adds r6, r0, 0 ldrb r2, [r1] ldrb r3, [r1, 0x1] lsls r3, 8 orrs r2, r3 ldrb r3, [r1, 0x2] lsls r3, 16 orrs r2, r3 ldrb r3, [r1, 0x3] lsls r3, 24 adds r0, r2, 0 orrs r0, r3 ldrb r2, [r1, 0x9] strb r2, [r1] ldrb r4, [r1, 0x8] lsls r4, 8 ldrb r2, [r1, 0x7] orrs r4, r2 ldr r5, =0x02037fd4 ldrb r3, [r5, 0x8] movs r2, 0x7F ands r2, r3 strb r2, [r5, 0x8] movs r5, 0x4 ldrsb r5, [r1, r5] ldrb r2, [r1, 0x5] ldrb r3, [r1, 0x6] str r4, [sp] adds r1, r5, 0 bl 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 .pool thumb_func_end sub_8022C58 thumb_func_start sub_8022CB0 sub_8022CB0: ; 8022CB0 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0xC] cmp r0, 0x1 beq @08022CE4 cmp r0, 0x1 bgt @08022CC6 cmp r0, 0 beq @08022CD0 b @08022D06 @08022CC6: cmp r0, 0x2 beq @08022CEA cmp r0, 0x3 beq @08022CF6 b @08022D06 @08022CD0: bl fade_and_return_progress_probably lsls r0, 24 cmp r0, 0 bne @08022D0C ldrb r0, [r5] cmp r0, 0 bne @08022D06 movs r0, 0x3 b @08022D0A @08022CE4: bl sub_8010434 b @08022D06 @08022CEA: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @08022D06 b @08022D0C @08022CF6: ldrb r0, [r4, 0xF] movs r1, 0x1 movs r2, 0 bl sub_8022BEC movs r0, 0 strb r0, [r4, 0xC] b @08022D0E @08022D06: ldrb r0, [r4, 0xC] adds r0, 0x1 @08022D0A: strb r0, [r4, 0xC] @08022D0C: movs r0, 0 @08022D0E: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8022CB0 thumb_func_start sub_8022D14 sub_8022D14: ; 8022D14 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x10 adds r7, r0, 0 adds r5, r1, 0 ldrb r4, [r5, 0x3] lsls r4, 8 ldrb r0, [r5, 0x2] orrs r4, r0 ldrb r6, [r7, 0xC] cmp r6, 0x1 beq @08022DC0 cmp r6, 0x1 bgt @08022D38 cmp r6, 0 beq @08022D42 b @08022E08 @08022D38: cmp r6, 0x2 beq @08022DD8 cmp r6, 0x3 beq @08022DE8 b @08022E08 @08022D42: movs r0, 0 movs r1, 0 bl sub_81973C4 ldrb r1, [r5, 0x1] movs r0, 0x2 mov r8, r0 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @08022D90 ldr r4, =0x02021fc4 ldr r1, =gUnknown_082F32A4 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 bl 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 .pool @08022D90: ldr r1, =gUnknown_082F32A4 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r2, [r0] ldrb r3, [r7, 0xB] str r4, [sp] mov r0, r8 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 bl text_box_related_one @08022DB2: movs r0, 0 movs r1, 0x3 bl Window_CopyToVram b @08022E08 .align 2, 0 .pool @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, =0x030022c0 ldrh r0, [r0, 0x2E] ands r4, r0 cmp r4, 0 bne @08022E08 b @08022E0E .align 2, 0 .pool @08022DE8: ldrb r1, [r5, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08022DFA movs r0, 0 movs r1, 0x1 bl sub_8197434 @08022DFA: ldrb r0, [r7, 0xE] movs r1, 0x1 movs r2, 0 bl sub_8022BEC ldrb r0, [r5, 0x4] b @08022E0C @08022E08: ldrb r0, [r7, 0xC] adds r0, 0x1 @08022E0C: strb r0, [r7, 0xC] @08022E0E: movs r0, 0 add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8022D14 thumb_func_start sub_8022E1C sub_8022E1C: ; 8022E1C push {r4,lr} adds r4, r0, 0 bl sub_802104C cmp r0, 0 beq @08022E34 ldrb r0, [r4, 0xE] adds r2, r4, 0 adds r2, 0x36 movs r1, 0 bl sub_8022BEC @08022E34: movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_8022E1C thumb_func_start sub_8022E3C sub_8022E3C: ; 8022E3C push {r4,lr} adds r4, r0, 0 bl sub_802130C cmp r0, 0 beq @08022E54 ldrb r0, [r4, 0xE] adds r2, r4, 0 adds r2, 0x36 movs r1, 0 bl sub_8022BEC @08022E54: movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_8022E3C thumb_func_start sub_8022E5C sub_8022E5C: ; 8022E5C push {r4,lr} adds r4, r0, 0 ldrb r0, [r4, 0xC] cmp r0, 0 beq @08022E6C cmp r0, 0x1 beq @08022E72 b @08022E9C @08022E6C: bl sub_8010434 b @08022E9C @08022E72: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08022EA2 ldr r0, =0x000001e5 bl current_map_music_set movs r0, 0x7 movs r1, 0x1 movs r2, 0 bl sub_8022BEC movs r1, 0 movs r0, 0x3 strh r0, [r4, 0x12] strb r1, [r4, 0xC] b @08022EA2 .align 2, 0 .pool @08022E9C: ldrb r0, [r4, 0xC] adds r0, 0x1 strb r0, [r4, 0xC] @08022EA2: movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_8022E5C thumb_func_start sub_8022EAC sub_8022EAC: ; 8022EAC push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0xC] cmp r0, 0 beq @08022EC2 cmp r0, 0x1 beq @08022EE8 adds r0, 0x1 b @08022EF8 @08022EC2: adds r0, r4, 0 bl sub_8024578 movs r0, 0x1 str r0, [sp] adds r0, r5, 0 movs r1, 0 movs r2, 0x1 movs r3, 0 bl sub_8024644 movs r0, 0x7 strb r0, [r4, 0xE] movs r0, 0x3 movs r1, 0x1 movs r2, 0 bl sub_8022BEC b @08022EFA @08022EE8: movs r0, 0x8 strb r0, [r4, 0xE] movs r0, 0x5 movs r1, 0x1 movs r2, 0 bl sub_8022BEC movs r0, 0x2 @08022EF8: strb r0, [r4, 0xC] @08022EFA: movs r0, 0 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8022EAC thumb_func_start sub_8022F04 sub_8022F04: ; 8022F04 push {lr} movs r1, 0 str r1, [r0, 0x4] ldr r0, =sub_8020E1C bl set_callback2 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8022F04 thumb_func_start sub_8022F1C sub_8022F1C: ; 8022F1C push {r4-r7,lr} sub sp, 0x4 adds r5, r0, 0 adds r2, r1, 0 ldrb r0, [r5, 0xC] cmp r0, 0x5 bls @08022F2C b @08023060 @08022F2C: lsls r0, 2 ldr r1, =@08022F3C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08022F3C: .4byte @08022F54 .4byte @08022F74 .4byte @08022F7A .4byte @08022FAA .4byte @08022FBA .4byte @08023044 @08022F54: movs r0, 0x1 str r0, [sp] adds r0, r2, 0 movs r1, 0x1 movs r2, 0 movs r3, 0 bl sub_8024644 movs r0, 0x9 strb r0, [r5, 0xE] movs r0, 0x3 movs r1, 0x1 movs r2, 0 bl sub_8022BEC b @08023066 @08022F74: bl sub_8010434 b @08023060 @08022F7A: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08023066 adds r4, r5, 0 adds r4, 0x42 adds r0, r4, 0 movs r1, 0 movs r2, 0xC bl memset ldrb r0, [r5, 0x8] lsls r0, 5 adds r0, r5, r0 adds r0, 0xA4 ldrh r0, [r0] strh r0, [r4] movs r0, 0 adds r1, r4, 0 movs r2, 0x2 bl link_0800A448 b @08023060 @08022FAA: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08023066 movs r0, 0 strh r0, [r5, 0x10] b @08023060 @08022FBA: bl sub_800A550 ldr r2, =gUnknown_082F4448 ldrb r4, [r5, 0x9] subs r1, r4, 0x2 adds r1, r2 lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bne @08023066 movs r3, 0 cmp r3, r4 bcs @0802301E ldr r7, =0x020223c4 movs r6, 0 ldr r4, =gUnknown_0858AB24 @08022FDC: lsls r0, r3, 5 adds r0, r5, r0 lsls r1, r3, 8 adds r1, r7 ldrh r1, [r1] adds r2, r0, 0 adds r2, 0xA4 strh r1, [r2] lsls r1, 16 lsrs r1, 16 cmp r1, 0xB0 bls @08022FF6 strh r6, [r2] @08022FF6: ldrh r1, [r2] lsls r1, 2 adds r1, r4 ldrh r0, [r5, 0x18] ldrb r1, [r1] adds r0, r1 strh r0, [r5, 0x18] ldrh r0, [r2] lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x2] ldr r0, [r5, 0x1C] adds r0, r1 str r0, [r5, 0x1C] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 ldrb r0, [r5, 0x9] cmp r3, r0 bcc @08022FDC @0802301E: movs r0, 0 strh r0, [r5, 0x10] bl sub_800A5B4 movs r1, 0x18 ldrsh r0, [r5, r1] lsls r0, 8 movs r1, 0x80 lsls r1, 6 bl sub_81515FC str r0, [r5, 0x20] b @08023060 .align 2, 0 .pool @08023044: movs r0, 0 movs r1, 0x1 bl sub_8197434 movs r0, 0xA movs r1, 0x1 movs r2, 0 bl sub_8022BEC movs r1, 0 movs r0, 0x4 strh r0, [r5, 0x12] strb r1, [r5, 0xC] b @08023066 @08023060: ldrb r0, [r5, 0xC] adds r0, 0x1 strb r0, [r5, 0xC] @08023066: movs r0, 0 add sp, 0x4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8022F1C thumb_func_start sub_8023070 sub_8023070: ; 8023070 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4, 0xC] cmp r0, 0x6 bls @0802307C b @080231A8 @0802307C: lsls r0, 2 ldr r1, =@0802308C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802308C: .4byte @080230A8 .4byte @080230BA .4byte @080230E8 .4byte @08023120 .4byte @08023150 .4byte @08023172 .4byte @08023184 @080230A8: movs r0, 0x9C lsls r0, 1 adds r1, r4, r0 adds r0, r4, 0 bl sub_80214A8 bl sub_8010434 b @080231A8 @080230BA: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080231AE movs r2, 0x9C lsls r2, 1 adds r1, r4, r2 movs r0, 0 strb r0, [r1] ldr r3, =0x00000139 adds r1, r4, r3 strb r0, [r1] adds r2, 0x2 adds r1, r4, r2 strb r0, [r1] adds r3, 0x2 adds r1, r4, r3 strb r0, [r1] b @080231A8 .align 2, 0 .pool @080230E8: movs r0, 0x9C lsls r0, 1 adds r3, r4, r0 ldrb r0, [r3] lsls r0, 2 movs r2, 0xB8 lsls r2, 1 adds r1, r4, r2 adds r0, r1, r0 ldr r2, [r0] ldr r0, =sub_8021608 str r0, [r2, 0x1C] ldrb r0, [r3] lsls r0, 2 adds r1, r0 ldr r1, [r1] adds r1, 0x2C ldrb r2, [r1] movs r0, 0x7F ands r0, r2 strb r0, [r1] movs r0, 0x3D bl audio_play b @080231A8 .align 2, 0 .pool @08023120: movs r3, 0x9C lsls r3, 1 adds r2, r4, r3 ldrb r0, [r2] lsls r0, 2 adds r3, 0x38 adds r1, r4, r3 adds r3, r1, r0 ldr r0, [r3] ldr r1, [r0, 0x1C] ldr r0, =sub_8021608 cmp r1, r0 beq @080231AE movs r0, 0 str r0, [r3] ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] bl sub_8010434 b @080231A8 .align 2, 0 .pool @08023150: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080231AE movs r0, 0x9C lsls r0, 1 adds r1, r4, r0 ldrb r0, [r1] ldrb r2, [r4, 0x9] cmp r0, r2 bcs @0802316C movs r0, 0x2 b @080231AC @0802316C: movs r0, 0 strb r0, [r1] b @080231A8 @08023172: movs r3, 0x9C lsls r3, 1 adds r1, r4, r3 adds r0, r4, 0 bl sub_80216A8 bl sub_8010434 b @080231A8 @08023184: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080231AE movs r0, 0x2B bl audio_play movs r0, 0xB movs r1, 0x1 movs r2, 0 bl sub_8022BEC movs r1, 0 movs r0, 0x5 strh r0, [r4, 0x12] strb r1, [r4, 0xC] b @080231AE @080231A8: ldrb r0, [r4, 0xC] adds r0, 0x1 @080231AC: strb r0, [r4, 0xC] @080231AE: movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_8023070 thumb_func_start sub_80231B8 sub_80231B8: ; 80231B8 push {r4-r7,lr} adds r4, r0, 0 ldrb r1, [r4, 0xC] cmp r1, 0x1 beq @0802321C cmp r1, 0x1 bgt @080231CC cmp r1, 0 beq @080231D6 b @080232DC @080231CC: cmp r1, 0x2 beq @0802329C cmp r1, 0x3 beq @080232BE b @080232DC @080231D6: ldrh r0, [r4, 0x2A] adds r0, 0x4 strh r0, [r4, 0x2A] lsls r0, 16 cmp r0, 0 bge @080231E4 b @080232E2 @080231E4: strh r1, [r4, 0x2A] ldr r0, =0x00000139 adds r3, r4, r0 movs r0, 0x4 strb r0, [r3] movs r2, 0x9C lsls r2, 1 adds r1, r4, r2 movs r0, 0 strb r0, [r1] ldr r2, =gUnknown_082F326C ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 adds r0, r2 ldrb r0, [r0] movs r2, 0x9D lsls r2, 1 adds r1, r4, r2 strb r0, [r1] movs r0, 0xD6 bl audio_play b @080232DC .align 2, 0 .pool @0802321C: ldr r7, =gUnknown_082F326C movs r0, 0x9C lsls r0, 1 adds r6, r4, r0 ldr r1, =0x00000139 adds r5, r4, r1 ldrb r1, [r5] lsls r0, r1, 3 subs r0, r1 ldrb r2, [r6] adds r0, r2 adds r0, r7 movs r1, 0 ldrsb r1, [r0, r1] strh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x12 bl 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 .pool @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, =0x00000139 adds r1, r4, r2 strb r0, [r1] adds r2, 0x1 adds r1, r4, r2 strb r0, [r1] adds r2, 0x1 adds r1, r4, r2 strb r0, [r1] strh r0, [r4, 0x10] ldrb r0, [r4, 0x8] cmp r0, 0 bne @08023378 movs r0, 0xD movs r1, 0x1 movs r2, 0 bl sub_8022BEC b @08023382 .align 2, 0 .pool @08023378: movs r0, 0xE movs r1, 0x1 movs r2, 0 bl sub_8022BEC @08023382: movs r1, 0 movs r0, 0x7 strh r0, [r4, 0x12] strb r1, [r4, 0xC] b @08023392 @0802338C: ldrb r0, [r4, 0xC] adds r0, 0x1 strb r0, [r4, 0xC] @08023392: movs r0, 0 add sp, 0x4 pop {r4} pop {r1} bx r1 thumb_func_end sub_80232EC thumb_func_start sub_802339C sub_802339C: ; 802339C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r4, r0, 0 movs r0, 0 mov r8, r0 movs r2, 0 adds r7, r2, 0 ldrb r1, [r4, 0x9] cmp r7, r1 bcs @080234AA movs r2, 0x5E adds r2, r4 mov r9, r2 ldr r3, =gUnknown_082F325C mov r10, r3 @080233C0: lsls r0, r7, 4 ldr r1, =0x03003090 adds r2, r0, r1 ldrh r1, [r2] movs r0, 0xFF lsls r0, 8 ands r0, r1 movs r3, 0xBC lsls r3, 6 cmp r0, r3 bne @0802349E ldrh r0, [r2, 0x2] cmp r0, 0x2 bne @0802349E ldrb r1, [r2, 0x4] movs r0, 0x4 ands r0, r1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @08023496 mov r0, r9 ldrb r2, [r0] lsrs r1, r2, 3 mov r3, r10 adds r0, r7, r3 ldrb r0, [r0] orrs r1, r0 lsls r1, 3 movs r0, 0x7 ands r0, r2 orrs r0, r1 mov r1, r9 strb r0, [r1] lsls r2, r7, 5 adds r3, r4, r2 mov r12, r3 mov r1, r12 adds r1, 0xB5 movs r0, 0x1 strb r0, [r1] subs r1, 0x7 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] mov r0, r8 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r8, r0 subs r1, 0x8 ldrh r0, [r4, 0x28] ldrh r1, [r1] subs r0, r1 lsls r0, 16 lsrs r3, r0, 16 mov r5, r12 adds r5, 0xAA ldrh r1, [r5] subs r0, r1, 0x1 adds r6, r2, 0 cmp r3, r0 blt @08023468 adds r0, r1, 0x1 cmp r3, r0 bgt @08023468 mov r1, r12 adds r1, 0xA8 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] strh r3, [r5] mov r0, r12 adds r0, 0xAC ldrh r1, [r1] ldrh r2, [r0] cmp r1, r2 bls @08023476 strh r1, [r0] b @08023476 .align 2, 0 .pool @08023468: adds r0, r4, r6 adds r2, r0, 0 adds r2, 0xA8 movs r1, 0 strh r1, [r2] adds r0, 0xAA strh r3, [r0] @08023476: adds r1, r4, r6 ldrh r0, [r4, 0x28] adds r3, r1, 0 adds r3, 0xA6 movs r2, 0 strh r0, [r3] adds r1, 0xB4 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bls @0802349E strb r2, [r1] b @0802349E @08023496: lsls r0, r7, 5 adds r0, r4, r0 adds r0, 0xB5 strb r1, [r0] @0802349E: adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 ldrb r3, [r4, 0x9] cmp r7, r3 bcc @080233C0 @080234AA: mov r0, r8 cmp r0, 0x1 bls @080234E0 movs r7, 0 ldrb r1, [r4, 0x9] cmp r7, r1 bcs @080234E0 movs r3, 0x2 @080234BA: lsls r0, r7, 5 adds r1, r4, r0 adds r2, r1, 0 adds r2, 0xB5 ldrb r0, [r2] cmp r0, 0 beq @080234D4 orrs r0, r3 strb r0, [r2] adds r1, 0xB0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @080234D4: adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 ldrb r2, [r4, 0x9] cmp r7, r2 bcc @080234BA @080234E0: mov r3, r8 cmp r3, 0 beq @08023548 ldrh r0, [r4, 0x2E] add r0, r8 strh r0, [r4, 0x2E] ldr r1, =gUnknown_082F3264 mov r0, r8 subs r0, 0x1 adds r0, r1 ldrb r0, [r0] add r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldrh r0, [r4, 0x34] add r0, r8 strh r0, [r4, 0x34] ldrh r0, [r4, 0x1A] add r0, r8 strh r0, [r4, 0x1A] movs r1, 0x18 ldrsh r0, [r4, r1] movs r3, 0x1A ldrsh r2, [r4, r3] subs r0, r2 cmp r0, 0 ble @08023534 lsls r2, 8 ldr r1, [r4, 0x20] adds r0, r2, 0 bl sub_81515FC adds r2, r0, 0 asrs r2, 8 adds r0, r4, 0 adds r0, 0x24 strb r2, [r0] b @08023548 .align 2, 0 .pool @08023534: adds r1, r4, 0 adds r1, 0x24 movs r0, 0x20 strb r0, [r1] adds r2, r4, 0 adds r2, 0x5E ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] @08023548: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_802339C thumb_func_start sub_8023558 sub_8023558: ; 8023558 push {r4-r6,lr} adds r3, r0, 0 movs r6, 0 movs r1, 0 adds r4, r1, 0 ldrb r0, [r3, 0x9] cmp r4, r0 bcs @080235B0 adds r5, r3, 0 adds r5, 0x64 @0802356C: lsls r0, r4, 5 adds r1, r3, r0 adds r0, r1, 0 adds r0, 0xB5 ldrb r2, [r0] cmp r2, 0 beq @080235A4 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 adds r0, r1, 0 adds r0, 0xB4 ldrb r0, [r0] adds r1, r0, 0x1 movs r0, 0x2 ands r0, r2 cmp r0, 0 beq @08023594 movs r0, 0x4 orrs r1, r0 @08023594: lsls r0, r4, 1 adds r0, r4 lsls r1, r0 lsls r0, r1, 16 lsrs r1, r0, 16 ldrh r0, [r5] orrs r1, r0 strh r1, [r5] @080235A4: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 ldrb r1, [r3, 0x9] cmp r4, r1 bcc @0802356C @080235B0: adds r0, r3, 0 adds r0, 0x24 ldrb r1, [r0] adds r0, 0x3C strh r1, [r0] cmp r6, 0 bne @080235D4 ldr r2, =0x0000013b adds r0, r3, r2 ldrb r0, [r0] cmp r0, 0 beq @080236A0 movs r4, 0x9C lsls r4, 1 adds r1, r3, r4 b @08023612 .align 2, 0 .pool @080235D4: ldr r5, =0x0000013b adds r2, r3, r5 ldrb r0, [r2] cmp r0, 0 beq @0802361A ldr r0, =0x00000139 adds r1, r3, r0 ldrb r2, [r1] cmp r6, r2 beq @0802360C subs r0, r6, 0x1 strb r0, [r1] ldr r1, =gUnknown_082F3290 lsls r0, 2 adds r0, r1 ldrb r0, [r0] movs r4, 0x9D lsls r4, 1 adds r1, r3, r4 strb r0, [r1] b @08023640 .align 2, 0 .pool @0802360C: movs r5, 0x9C lsls r5, 1 adds r1, r3, r5 @08023612: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08023640 @0802361A: movs r0, 0x9C lsls r0, 1 adds r1, r3, r0 movs r0, 0 strb r0, [r1] subs r0, r6, 0x1 ldr r4, =0x00000139 adds r1, r3, r4 strb r0, [r1] ldr r1, =gUnknown_082F3290 lsls r0, 2 adds r0, r1 ldrb r0, [r0] movs r5, 0x9D lsls r5, 1 adds r1, r3, r5 strb r0, [r1] movs r0, 0x1 strb r0, [r2] @08023640: ldr r0, =0x0000013b adds r4, r3, r0 ldrb r0, [r4] cmp r0, 0 beq @080236A0 movs r2, 0x9C lsls r2, 1 adds r1, r3, r2 movs r5, 0x9D lsls r5, 1 adds r2, r3, r5 ldrb r0, [r1] ldrb r5, [r2] cmp r0, r5 bcc @0802367C movs r0, 0 strb r0, [r1] ldr r5, =0x00000139 adds r1, r3, r5 strb r0, [r1] strb r0, [r2] strb r0, [r4] movs r1, 0 b @08023690 .align 2, 0 .pool @0802367C: ldr r2, =gUnknown_082F3290 ldrb r1, [r1] ldr r4, =0x00000139 adds r0, r3, r4 ldrb r0, [r0] lsls r0, 2 adds r0, 0x1 adds r1, r0 adds r1, r2 ldrb r1, [r1] @08023690: adds r0, r3, 0 adds r0, 0x5F strb r1, [r0] b @080236A8 .align 2, 0 .pool @080236A0: adds r1, r3, 0 adds r1, 0x5F movs r0, 0 strb r0, [r1] @080236A8: ldrh r1, [r3, 0x26] adds r0, r3, 0 adds r0, 0x62 strh r1, [r0] pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8023558 thumb_func_start sub_80236B8 sub_80236B8: ; 80236B8 push {r4-r7,lr} mov r7, r8 push {r7} adds r5, r0, 0 ldr r3, =0x030022c0 ldrh r1, [r3, 0x2E] movs r4, 0x1 adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @080236DA adds r2, r5, 0 adds r2, 0x5E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] @080236DA: ldrh r1, [r3, 0x2C] adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @080236FA ldrb r0, [r5, 0x8] lsls r0, 5 adds r0, r5, r0 adds r1, r0, 0 adds r1, 0xB2 ldrh r0, [r1] ldrh r2, [r5, 0x28] cmp r0, r2 bcs @080236FA adds r0, 0x1 strh r0, [r1] @080236FA: ldrb r0, [r5, 0x8] adds r7, r5, 0 adds r7, 0x5E cmp r0, 0 beq @08023710 ldrb r1, [r7] movs r0, 0x4 ands r0, r1 cmp r0, 0 bne @08023710 b @0802384C @08023710: adds r4, r5, 0 adds r4, 0x5C movs r0, 0x2 strh r0, [r4] ldrh r0, [r5, 0x28] movs r1, 0x1E bl __umodsi3 lsls r0, 16 mov r8, r4 adds r6, r5, 0 adds r6, 0x25 cmp r0, 0 bne @08023768 movs r0, 0x2E ldrsh r2, [r5, r0] ldr r1, =gUnknown_082F4444 ldrb r0, [r5, 0x9] subs r0, 0x2 adds r0, r1 ldrb r0, [r0] cmp r2, r0 ble @08023754 ldrh r0, [r5, 0x30] adds r0, 0x1 strh r0, [r5, 0x30] ldrb r0, [r6] movs r1, 0x10 orrs r0, r1 b @0802375C .align 2, 0 .pool @08023754: ldrb r1, [r6] movs r0, 0x11 negs r0, r0 ands r0, r1 @0802375C: strb r0, [r6] movs r0, 0 strh r0, [r5, 0x2E] ldrh r0, [r5, 0x32] adds r0, 0x1 strh r0, [r5, 0x32] @08023768: ldrh r0, [r5, 0x28] movs r1, 0xF bl __umodsi3 lsls r0, 16 cmp r0, 0 bne @080237DE movs r0, 0x34 ldrsh r2, [r5, r0] ldr r3, =gUnknown_082F4434 ldrb r0, [r5, 0x9] subs r0, 0x2 lsls r1, r0, 2 adds r0, r1, r3 ldrb r0, [r0] cmp r2, r0 bge @08023798 ldrb r1, [r6] movs r0, 0x1F ands r0, r1 strb r0, [r6] b @080237D8 .align 2, 0 .pool @08023798: adds r0, r3, 0x1 adds r0, r1, r0 ldrb r0, [r0] cmp r2, r0 bge @080237AC ldrb r0, [r6] movs r1, 0x1F ands r1, r0 movs r0, 0x20 b @080237D4 @080237AC: adds r0, r3, 0x2 adds r0, r1, r0 ldrb r0, [r0] cmp r2, r0 bge @080237BC movs r0, 0x2 strh r0, [r5, 0x34] b @080237D8 @080237BC: adds r0, r3, 0x3 adds r0, r1, r0 ldrb r0, [r0] cmp r2, r0 bge @080237CC movs r0, 0x3 strh r0, [r5, 0x34] b @080237D8 @080237CC: ldrb r0, [r6] movs r1, 0x1F ands r1, r0 movs r0, 0x80 @080237D4: orrs r1, r0 strb r1, [r6] @080237D8: movs r0, 0 strh r0, [r5, 0x34] b @0802380A @080237DE: ldrh r0, [r5, 0x10] adds r0, 0x1 strh r0, [r5, 0x10] lsls r0, 16 lsrs r0, 16 cmp r0, 0x3C bls @0802380A cmp r0, 0x46 bls @080237FA bl sub_8011AC8 movs r0, 0 strh r0, [r5, 0x10] b @0802380A @080237FA: ldrb r0, [r7] movs r4, 0xF8 ands r4, r0 cmp r4, 0 bne @0802380A bl sub_8011AC8 strh r4, [r5, 0x10] @0802380A: ldrh r1, [r5, 0x28] ldr r0, =0x00008c9f cmp r1, r0 bls @0802381A ldrb r0, [r7] movs r1, 0x1 orrs r0, r1 strb r0, [r7] @0802381A: ldrb r1, [r6] lsls r1, 27 lsrs r1, 31 lsls r1, 1 ldrb r2, [r7] movs r0, 0x3 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r7] ldrb r0, [r6] lsrs r0, 5 adds r2, r5, 0 adds r2, 0x66 strh r0, [r2] adds r4, r5, 0 adds r4, 0x42 adds r0, r4, 0 mov r1, r8 movs r2, 0xC bl memcpy adds r0, r4, 0 bl sub_800FE50 @0802384C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80236B8 thumb_func_start sub_802385C sub_802385C: ; 802385C push {r4,r5,lr} adds r5, r0, 0 movs r4, 0 ldr r3, =0x03003090 ldrb r0, [r5, 0x9] cmp r4, r0 bcs @08023880 movs r1, 0 @0802386C: lsls r0, r4, 5 adds r0, r5, r0 adds r0, 0xB5 strb r1, [r0] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 ldrb r0, [r5, 0x9] cmp r4, r0 bcc @0802386C @08023880: adds r2, r3, 0 ldrh r0, [r2] movs r1, 0xFF lsls r1, 8 ands r1, r0 movs r0, 0xBC lsls r0, 6 cmp r1, r0 bne @08023898 ldrh r0, [r2, 0x2] cmp r0, 0x2 beq @080238AC @08023898: adds r2, r5, 0 adds r2, 0x25 ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] b @080238EA .align 2, 0 .pool @080238AC: adds r4, r5, 0 adds r4, 0x4E adds r0, r4, 0 adds r1, r3, 0 movs r2, 0xE bl memcpy ldrh r0, [r4, 0x6] strh r0, [r5, 0x2A] movs r0, 0x5 ldrsb r0, [r4, r0] strh r0, [r5, 0x2C] ldrh r0, [r4, 0x8] strh r0, [r5, 0x28] movs r0, 0x9C lsls r0, 1 adds r1, r5, r0 adds r0, r5, 0 bl sub_80216E0 ldrb r1, [r4, 0x4] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080238EA adds r0, r5, 0 adds r0, 0x25 ldrb r1, [r0] movs r2, 0x8 orrs r1, r2 strb r1, [r0] @080238EA: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_802385C thumb_func_start sub_80238F0 sub_80238F0: ; 80238F0 push {r4,lr} adds r4, r0, 0 adds r0, 0x5C movs r1, 0 movs r2, 0xC bl memset adds r0, r4, 0 adds r0, 0x4E movs r1, 0 movs r2, 0xE bl memset adds r0, r4, 0 bl sub_802385C ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x12 bl 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, =0x00008c9f cmp r1, r0 bls @08023964 adds r0, 0x1 strh r0, [r4, 0x28] movs r0, 0x10 movs r1, 0x1 movs r2, 0 bl sub_8022BEC b @0802396E .align 2, 0 .pool @08023964: movs r0, 0xF movs r1, 0x1 movs r2, 0 bl sub_8022BEC @0802396E: movs r1, 0 movs r0, 0 strh r0, [r4, 0x10] strb r1, [r4, 0xC] b @08023992 @08023978: ldrh r0, [r4, 0x26] adds r0, 0x1 strh r0, [r4, 0x26] adds r0, r4, 0 bl sub_802339C adds r0, r4, 0 bl sub_8023558 adds r0, r4, 0 bl sub_80236B8 movs r0, 0 @08023992: pop {r4} pop {r1} bx r1 thumb_func_end sub_80238F0 thumb_func_start sub_8023998 sub_8023998: ; 8023998 push {r4,lr} adds r4, r0, 0 adds r0, 0x5C movs r1, 0 movs r2, 0xC bl memset adds r0, r4, 0 adds r0, 0x4E movs r1, 0 movs r2, 0xE bl memset adds r0, r4, 0 bl sub_802385C ldrh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x12 bl 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, =0x00008c9f cmp r1, r0 bls @08023A0C adds r0, 0x1 strh r0, [r4, 0x28] movs r0, 0x10 movs r1, 0x1 movs r2, 0 bl sub_8022BEC b @08023A16 .align 2, 0 .pool @08023A0C: movs r0, 0xF movs r1, 0x1 movs r2, 0 bl sub_8022BEC @08023A16: movs r1, 0 movs r0, 0 strh r0, [r4, 0x10] strb r1, [r4, 0xC] b @08023A28 @08023A20: adds r0, r4, 0 bl sub_80236B8 movs r0, 0 @08023A28: pop {r4} pop {r1} bx r1 thumb_func_end sub_8023998 thumb_func_start sub_8023A30 sub_8023A30: ; 8023A30 push {r4-r7,lr} adds r4, r0, 0 ldrb r0, [r4, 0xC] cmp r0, 0x5 bls @08023A3C b @08023BB2 @08023A3C: lsls r0, 2 ldr r1, =@08023A4C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08023A4C: .4byte @08023A64 .4byte @08023A8C .4byte @08023ADC .4byte @08023B5C .4byte @08023B7A .4byte @08023B94 @08023A64: movs r0, 0x8 strh r0, [r4, 0x12] movs r0, 0xD6 bl audio_play movs r0, 0x1 negs r0, r0 ldr r2, =0x000003ff movs r1, 0x8 bl sub_80A2A20 movs r0, 0x9C lsls r0, 1 adds r1, r4, r0 movs r0, 0x2 strb r0, [r1] b @08023BB2 .align 2, 0 .pool @08023A8C: movs r1, 0x9C lsls r1, 1 adds r5, r4, r1 ldrb r0, [r5] subs r0, 0x1 strb r0, [r5] lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @08023AA2 b @08023BB8 @08023AA2: movs r0, 0x1 negs r0, r0 ldr r2, =0x000003ff movs r1, 0 bl sub_80A2A20 ldr r2, =0x00000139 adds r1, r4, r2 movs r0, 0x4 strb r0, [r1] movs r0, 0 strb r0, [r5] ldr r2, =gUnknown_082F326C ldrb r1, [r1] lsls r0, r1, 3 subs r0, r1 adds r0, r2 ldrb r0, [r0] movs r2, 0x9D lsls r2, 1 adds r1, r4, r2 strb r0, [r1] b @08023BB2 .align 2, 0 .pool @08023ADC: ldr r7, =gUnknown_082F326C movs r0, 0x9C lsls r0, 1 adds r6, r4, r0 ldr r1, =0x00000139 adds r5, r4, r1 ldrb r1, [r5] lsls r0, r1, 3 subs r0, r1 ldrb r2, [r6] adds r0, r2 adds r0, r7 movs r1, 0 ldrsb r1, [r0, r1] strh r1, [r4, 0x2C] negs r1, r1 lsls r1, 16 lsrs r1, 16 movs r0, 0x12 bl 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 .pool @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, =0x02021cc4 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 .pool @08023C9C: ldrb r0, [r5, 0xC] adds r0, 0x1 @08023CA0: strb r0, [r5, 0xC] @08023CA2: movs r0, 0 add sp, 0x4 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8023BC0 thumb_func_start sub_8023CAC sub_8023CAC: ; 8023CAC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 adds r7, r0, 0 ldrb r0, [r7, 0xC] cmp r0, 0x7 bls @08023CC2 b @0802402E @08023CC2: lsls r0, 2 ldr r1, =@08023CD0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08023CD0: .4byte @08023CF0 .4byte @08023D2A .4byte @08023D38 .4byte @08023DA0 .4byte @08023F20 .4byte @08023FD0 .4byte @08023FDC .4byte @08024010 @08023CF0: adds r4, r7, 0 adds r4, 0x42 adds r0, r4, 0 movs r1, 0 movs r2, 0x4 bl memset ldrb r0, [r7, 0x8] lsls r0, 5 adds r0, r7, r0 adds r2, r0, 0 adds r2, 0xB2 ldrh r1, [r7, 0x28] ldrh r0, [r2] cmp r0, r1 bls @08023D12 strh r1, [r2] @08023D12: ldrb r0, [r7, 0x8] lsls r0, 5 adds r0, r7, r0 adds r0, 0xB2 ldrh r0, [r0] strh r0, [r4] movs r0, 0 adds r1, r4, 0 movs r2, 0x2 bl link_0800A448 b @0802402E @08023D2A: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @08023D36 b @08024034 @08023D36: b @08024004 @08023D38: bl sub_800A550 ldr r2, =gUnknown_082F4448 ldrb r3, [r7, 0x9] subs r1, r3, 0x2 adds r1, r2 lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 beq @08023D50 b @08024034 @08023D50: movs r0, 0 mov r8, r0 adds r4, r7, 0 adds r4, 0x42 cmp r8, r3 bcs @08023D7E ldr r2, =0x020223c4 @08023D5E: mov r3, r8 lsls r1, r3, 5 adds r1, r7, r1 lsls r0, r3, 8 adds r0, r2 ldrh r0, [r0] adds r1, 0xB2 strh r0, [r1] mov r0, r8 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldrb r6, [r7, 0x9] cmp r8, r6 bcc @08023D5E @08023D7E: movs r0, 0 strh r0, [r7, 0x10] strh r0, [r4] bl sub_800A5B4 ldrb r0, [r7, 0x8] cmp r0, 0 bne @08023D9C movs r0, 0x3 b @08024032 .align 2, 0 .pool @08023D9C: movs r0, 0x6 b @08024032 @08023DA0: adds r0, r7, 0 adds r0, 0x68 movs r1, 0 movs r2, 0x30 bl memset ldrh r1, [r7, 0x28] adds r0, r7, 0 adds r0, 0x6C strh r1, [r0] movs r0, 0x18 ldrsh r4, [r7, r0] ldrh r0, [r7, 0x28] movs r1, 0x3C bl __udivsi3 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl __divsi3 adds r1, r7, 0 adds r1, 0x6E strh r0, [r1] movs r1, 0x30 ldrsh r0, [r7, r1] lsls r0, 8 movs r4, 0xC8 lsls r4, 6 adds r1, r4, 0 bl sub_8151574 adds r2, r0, 0 movs r3, 0x32 ldrsh r1, [r7, r3] lsls r1, 8 bl sub_81515FC adds r2, r0, r4 asrs r2, 8 movs r1, 0x7F adds r0, r2, 0 ands r0, r1 adds r1, r7, 0 adds r1, 0x70 strh r0, [r1] lsls r2, 8 movs r1, 0xC8 lsls r1, 7 adds r0, r2, 0 bl sub_81515FC adds r2, r0, 0 ldrb r1, [r7, 0x9] ldr r0, [r7, 0x1C] muls r0, r1 lsls r4, r0, 8 adds r0, r4, 0 adds r1, r2, 0 bl sub_8151574 adds r4, r0, 0 asrs r0, r4, 8 str r0, [r7, 0x68] bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 adds r1, r7, 0 adds r1, 0x8F strb r0, [r1] movs r6, 0 mov r8, r6 mov r9, r1 ldrb r0, [r7, 0x9] cmp r8, r0 bcc @08023E44 b @0802402E @08023E44: adds r0, r7, 0 adds r0, 0x88 add r0, r8 mov r1, r8 strb r1, [r0] adds r0, r7, 0 adds r0, 0x90 add r0, r8 strb r1, [r0] mov r3, r8 lsls r2, r3, 1 adds r1, r7, 0 adds r1, 0x74 adds r1, r2 lsls r0, r3, 5 adds r3, r7, r0 adds r5, r3, 0 adds r5, 0xAE ldrh r0, [r5] strh r0, [r1] adds r1, r7, 0 adds r1, 0x72 ldrh r6, [r1] adds r0, r6 strh r0, [r1] mov r1, r9 ldrb r0, [r1] adds r6, r2, 0 cmp r0, 0x1 beq @08023EAE cmp r0, 0x1 bgt @08023E8A cmp r0, 0 beq @08023E90 b @08023F04 @08023E8A: cmp r0, 0x2 beq @08023ECC b @08023F04 @08023E90: ldrh r0, [r5] cmp r0, 0 beq @08023ED2 adds r0, r3, 0 adds r0, 0xAC ldrh r2, [r0] lsls r2, 8 adds r0, r2, 0 movs r1, 0xC8 lsls r1, 7 bl sub_8151574 adds r2, r0, 0 ldrh r4, [r5] b @08023EFA @08023EAE: ldrh r0, [r5] cmp r0, 0 beq @08023ED2 adds r0, r3, 0 adds r0, 0xB0 ldrh r2, [r0] lsls r2, 8 adds r0, r2, 0 movs r1, 0xC8 lsls r1, 7 bl sub_8151574 adds r2, r0, 0 ldrh r4, [r5] b @08023EFA @08023ECC: ldrh r0, [r5] cmp r0, 0 bne @08023ED6 @08023ED2: movs r4, 0 b @08023F04 @08023ED6: adds r1, r3, 0 adds r1, 0xB2 ldrh r0, [r1] ldrh r2, [r7, 0x28] cmp r0, r2 bcc @08023EE8 movs r4, 0xC8 lsls r4, 7 b @08023F04 @08023EE8: ldrh r2, [r1] lsls r2, 8 adds r0, r2, 0 movs r1, 0xC8 lsls r1, 7 bl sub_8151574 adds r2, r0, 0 ldrh r4, [r7, 0x28] @08023EFA: lsls r4, 8 adds r1, r4, 0 bl sub_81515FC adds r4, r0, 0 @08023F04: asrs r4, 4 adds r0, r7, 0 adds r0, 0x7E adds r0, r6 strh r4, [r0] mov r0, r8 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldrb r3, [r7, 0x9] cmp r8, r3 bcc @08023E44 b @0802402E @08023F20: movs r6, 0 mov r8, r6 ldrb r0, [r7, 0x9] subs r0, 0x1 adds r1, r7, 0 adds r1, 0x68 str r1, [sp, 0xC] cmp r8, r0 bge @08023FC4 @08023F32: ldrb r0, [r7, 0x9] subs r0, 0x1 lsls r0, 24 lsrs r4, r0, 24 mov r2, r8 adds r2, 0x1 str r2, [sp, 0x8] cmp r4, r8 bls @08023FB4 adds r3, r7, 0 adds r3, 0x74 str r3, [sp] adds r6, r7, 0 adds r6, 0x88 str r6, [sp, 0x4] movs r0, 0x90 adds r0, r7 mov r10, r0 movs r1, 0x7E adds r1, r7 mov r9, r1 @08023F5C: subs r2, r4, 0x1 mov r12, r2 lsls r6, r2, 1 ldr r0, [sp] adds r3, r0, r6 lsls r5, r4, 1 adds r1, r0, r5 ldrh r2, [r3] ldrh r0, [r1] cmp r2, r0 bcs @08023F86 ldrh r0, [r1] strh r2, [r1] strh r0, [r3] ldr r1, [sp, 0x4] adds r2, r1, r4 ldrb r3, [r2] add r1, r12 ldrb r0, [r1] strb r0, [r2] strb r3, [r1] @08023F86: mov r2, r9 adds r3, r2, r6 adds r1, r2, r5 ldrh r2, [r3] ldrh r6, [r1] cmp r2, r6 bcs @08023FAA ldrh r0, [r1] strh r2, [r1] strh r0, [r3] mov r0, r10 adds r2, r0, r4 ldrb r3, [r2] mov r1, r10 add r1, r12 ldrb r0, [r1] strb r0, [r2] strb r3, [r1] @08023FAA: mov r1, r12 lsls r0, r1, 24 lsrs r4, r0, 24 cmp r4, r8 bhi @08023F5C @08023FB4: ldr r2, [sp, 0x8] lsls r0, r2, 24 lsrs r0, 24 mov r8, r0 ldrb r0, [r7, 0x9] subs r0, 0x1 cmp r8, r0 blt @08023F32 @08023FC4: movs r0, 0 ldr r1, [sp, 0xC] movs r2, 0x30 bl link_0800A448 b @0802402E @08023FD0: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08024034 b @08024004 @08023FDC: bl sub_800A550 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08024034 adds r4, r7, 0 adds r4, 0x68 adds r0, r4, 0 movs r1, 0 movs r2, 0x30 bl memset ldr r1, =0x020223c4 adds r0, r4, 0 movs r2, 0x30 bl memcpy bl sub_800A5B4 @08024004: movs r0, 0 strh r0, [r7, 0x10] b @0802402E .align 2, 0 .pool @08024010: bl sub_8020E58 movs r0, 0x12 movs r1, 0x1 movs r2, 0 bl sub_8022BEC movs r0, 0 movs r1, 0xB strh r1, [r7, 0x12] strb r0, [r7, 0xC] adds r1, r7, 0 adds r1, 0x24 strb r0, [r1] b @08024034 @0802402E: ldrb r0, [r7, 0xC] adds r0, 0x1 @08024032: strb r0, [r7, 0xC] @08024034: movs r0, 0 add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8023CAC thumb_func_start sub_8024048 sub_8024048: ; 8024048 push {r4-r6,lr} sub sp, 0x4 adds r5, r0, 0 adds r6, r1, 0 ldrb r0, [r5, 0xC] cmp r0, 0x4 bhi @08024124 lsls r0, 2 ldr r1, =@08024064 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08024064: .4byte @08024078 .4byte @0802408A .4byte @0802409C .4byte @080240CC .4byte @080240DC @08024078: movs r0, 0x9C lsls r0, 1 adds r1, r5, r0 adds r0, r5, 0 bl sub_8022070 cmp r0, 0 bne @08024124 b @0802412A @0802408A: movs r0, 0 bl 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0802412A movs r0, 0x5 bl audio_play adds r0, r5, 0 bl sub_802222C b @08024124 .align 2, 0 .pool @080240CC: ldrh r0, [r5, 0x12] cmp r0, 0xC bhi @08024124 adds r0, 0x1 movs r1, 0 strh r0, [r5, 0x12] strb r1, [r5, 0xC] b @0802412A @080240DC: ldr r0, =0x02021cc4 ldr r1, [r5, 0x1C] movs r2, 0 movs r3, 0x6 bl decimal_int_to_string ldr r4, =0x02021dc4 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 .pool @08024124: ldrb r0, [r5, 0xC] adds r0, 0x1 strb r0, [r5, 0xC] @0802412A: movs r0, 0 add sp, 0x4 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8024048 thumb_func_start sub_8024134 sub_8024134: ; 8024134 push {r4,r5,lr} sub sp, 0x10 adds r5, r0, 0 adds r4, r1, 0 ldrb r0, [r5, 0xC] cmp r0, 0x4 bhi @08024218 lsls r0, 2 ldr r1, =@08024150 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08024150: .4byte @08024164 .4byte @080241A0 .4byte @080241A6 .4byte @080241F0 .4byte @08024204 @08024164: ldrh r1, [r5, 0x28] ldr r0, =0x00008c9f cmp r1, r0 bls @08024176 movs r1, 0x9C lsls r1, 1 adds r0, r5, r1 bl sub_8022554 @08024176: movs r0, 0x1 str r0, [sp] adds r0, r4, 0 movs r1, 0x8 movs r2, 0 movs r3, 0 bl sub_8024644 movs r4, 0 movs r0, 0x13 strb r0, [r5, 0xE] movs r0, 0x3 movs r1, 0x1 movs r2, 0 bl sub_8022BEC strb r4, [r5, 0xC] b @0802421E .align 2, 0 .pool @080241A0: bl sub_8010434 b @08024218 @080241A6: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0802421E movs r0, 0 movs r1, 0 bl sub_81973C4 ldr r2, =gUnknown_082C8959 movs r0, 0 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 movs r3, 0 bl text_box_related_one movs r0, 0 movs r1, 0x3 bl Window_CopyToVram ldr r0, =sub_8153688 movs r1, 0 bl AddTask b @08024218 .align 2, 0 .pool @080241F0: ldr r0, =sub_8153688 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @08024218 b @0802421E .align 2, 0 .pool @08024204: movs r0, 0x14 movs r1, 0x1 movs r2, 0 bl sub_8022BEC movs r1, 0 movs r0, 0xF strh r0, [r5, 0x12] strb r1, [r5, 0xC] b @0802421E @08024218: ldrb r0, [r5, 0xC] adds r0, 0x1 strb r0, [r5, 0xC] @0802421E: movs r0, 0 add sp, 0x10 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8024134 thumb_func_start sub_8024228 sub_8024228: ; 8024228 push {r4-r6,lr} sub sp, 0x4 adds r5, r0, 0 adds r6, r1, 0 ldrb r0, [r5, 0xC] cmp r0, 0x1 beq @0802426A cmp r0, 0x1 bgt @08024240 cmp r0, 0 beq @08024246 b @080242D0 @08024240: cmp r0, 0x2 beq @08024270 b @080242D0 @08024246: movs r0, 0x1 str r0, [sp] adds r0, r6, 0 movs r1, 0x4 movs r2, 0 movs r3, 0 bl sub_8024644 movs r0, 0x14 strb r0, [r5, 0xE] movs r0, 0x3 movs r1, 0x1 movs r2, 0 bl sub_8022BEC movs r0, 0 strb r0, [r5, 0xC] b @080242D8 @0802426A: bl sub_8197930 b @080242D0 @08024270: bl sub_8198C58 lsls r0, 24 asrs r4, r0, 24 movs r0, 0x2 negs r0, r0 cmp r4, r0 beq @080242D6 adds r0, r5, 0 adds r0, 0x42 movs r1, 0 movs r2, 0xC bl memset cmp r4, 0 bne @080242A2 bl sub_80D67C4 lsls r0, 24 cmp r0, 0 beq @0802429E strh r4, [r5, 0x14] b @080242A6 @0802429E: movs r0, 0x3 b @080242A4 @080242A2: movs r0, 0x1 @080242A4: strh r0, [r5, 0x14] @080242A6: movs r0, 0 movs r1, 0x1 bl sub_8197434 movs r4, 0 str r4, [sp] adds r0, r6, 0 movs r1, 0x8 movs r2, 0 movs r3, 0 bl sub_8024644 movs r0, 0x15 strb r0, [r5, 0xE] movs r0, 0x3 movs r1, 0x1 movs r2, 0 bl sub_8022BEC strb r4, [r5, 0xC] b @080242D6 @080242D0: ldrb r0, [r5, 0xC] adds r0, 0x1 strb r0, [r5, 0xC] @080242D6: movs r0, 0 @080242D8: add sp, 0x4 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8024228 thumb_func_start sub_80242E0 sub_80242E0: ; 80242E0 push {r4-r7,lr} adds r4, r0, 0 movs r5, 0 ldrb r0, [r4, 0xC] cmp r0, 0x1 beq @08024306 cmp r0, 0x1 bgt @080242F6 cmp r0, 0 beq @08024300 b @080243AC @080242F6: cmp r0, 0x2 beq @08024328 cmp r0, 0x3 beq @08024336 b @080243AC @08024300: bl sub_8010434 b @080243AC @08024306: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080243B2 ldrh r0, [r4, 0x14] adds r1, r4, 0 adds r1, 0x42 strh r0, [r1] adds r0, r4, 0 adds r0, 0x4E strh r5, [r0] movs r0, 0 movs r2, 0x2 bl link_0800A448 b @080243AC @08024328: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080243B2 strh r5, [r4, 0x10] b @080243AC @08024336: bl sub_800A550 ldr r2, =gUnknown_082F4448 ldrb r3, [r4, 0x9] subs r1, r3, 0x2 adds r1, r2 lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bne @080243B2 adds r7, r4, 0 adds r7, 0x42 adds r6, r4, 0 adds r6, 0x4E cmp r5, r3 bcs @08024374 adds r1, r6, 0 ldr r2, =0x020223c4 @0802435C: lsls r0, r5, 8 adds r0, r2 ldrh r0, [r0] ldrh r3, [r1] adds r0, r3 strh r0, [r1] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 ldrb r0, [r4, 0x9] cmp r5, r0 bcc @0802435C @08024374: ldrh r0, [r6] cmp r0, 0 beq @08024390 movs r0, 0x17 movs r1, 0x1 movs r2, 0 bl sub_8022BEC b @0802439A .align 2, 0 .pool @08024390: movs r0, 0x16 movs r1, 0x1 movs r2, 0 bl sub_8022BEC @0802439A: bl sub_800A5B4 movs r1, 0 movs r0, 0 strh r0, [r7] strh r0, [r6] strh r0, [r4, 0x10] strb r1, [r4, 0xC] b @080243B4 @080243AC: ldrb r0, [r4, 0xC] adds r0, 0x1 strb r0, [r4, 0xC] @080243B2: movs r0, 0 @080243B4: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80242E0 thumb_func_start sub_80243BC sub_80243BC: ; 80243BC push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 ldrb r4, [r5, 0xC] cmp r4, 0x1 beq @080243EA cmp r4, 0x1 bgt @080243D2 cmp r4, 0 beq @080243DC b @08024434 @080243D2: cmp r4, 0x2 beq @080243F6 cmp r4, 0x3 beq @0802441A b @08024434 @080243DC: movs r0, 0x1 negs r0, r0 str r4, [sp] movs r1, 0x1 movs r2, 0 movs r3, 0x10 b @08024410 @080243EA: bl fade_and_return_progress_probably lsls r0, 24 cmp r0, 0 beq @08024434 b @0802443A @080243F6: movs r0, 0 movs r1, 0x1 bl sub_8197434 adds r0, r5, 0 bl sub_8021488 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 @08024410: bl 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, =gUnknown_082F32A4 ldr r2, [r0, 0x14] ldrb r3, [r5, 0xB] str r4, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] str r1, [sp, 0xC] movs r0, 0 movs r1, 0x1 bl text_box_related_one b @080244AC .align 2, 0 .pool @08024490: ldr r0, =gUnknown_082F32A4 ldr r2, [r0, 0x18] ldrb r3, [r5, 0xB] str r4, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 bl text_box_related_one @080244AC: movs r0, 0 movs r1, 0x3 bl Window_CopyToVram b @080244F6 .align 2, 0 .pool @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, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0802455E movs r0, 0x19 strb r0, [r5, 0xE] movs r0, 0x5 movs r1, 0x1 movs r2, 0 bl sub_8022BEC strb r4, [r5, 0xC] b @0802455E .align 2, 0 .pool @08024558: ldrb r0, [r5, 0xC] adds r0, 0x1 strb r0, [r5, 0xC] @0802455E: movs r0, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8024508 thumb_func_start sub_8024568 sub_8024568: ; 8024568 push {lr} movs r0, 0 bl sub_8020C0C movs r0, 0 pop {r1} bx r1 thumb_func_end sub_8024568 thumb_func_start sub_8024578 sub_8024578: ; 8024578 push {r4-r6,lr} adds r4, r0, 0 movs r5, 0 movs r0, 0x33 bl sav12_xor_increment strb r5, [r4, 0xD] movs r1, 0 strh r5, [r4, 0x10] movs r0, 0x2 strh r0, [r4, 0x12] strh r5, [r4, 0x14] str r5, [r4, 0x1C] strh r5, [r4, 0x18] strh r5, [r4, 0x1A] str r5, [r4, 0x20] adds r0, r4, 0 adds r0, 0x24 strb r1, [r0] adds r1, r4, 0 adds r1, 0x25 movs r0, 0 strb r0, [r1] strh r5, [r4, 0x26] strh r5, [r4, 0x28] strh r5, [r4, 0x2E] ldr r0, =0x0000ffff strh r0, [r4, 0x32] strh r5, [r4, 0x30] strh r5, [r4, 0x34] movs r6, 0 movs r3, 0 @080245B8: lsls r0, r5, 5 adds r2, r4, r0 adds r1, r2, 0 adds r1, 0xA4 ldr r0, =0x0000ffff strh r0, [r1] adds r0, r2, 0 adds r0, 0xA6 strh r3, [r0] adds r0, 0x2 strh r3, [r0] adds r1, 0x6 movs r0, 0x1 strh r0, [r1] adds r0, r2, 0 adds r0, 0xAC strh r3, [r0] adds r0, 0x2 strh r3, [r0] adds r0, 0x2 strh r3, [r0] adds r0, 0x2 strh r3, [r0] adds r0, 0x2 strb r6, [r0] adds r0, 0x1 strb r6, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x4 bls @080245B8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8024578 thumb_func_start sub_8024604 sub_8024604: ; 8024604 push {r4-r6,lr} sub sp, 0x8 str r2, [sp, 0x4] ldr r5, [sp, 0x18] ldr r6, [sp, 0x1C] ldr r4, [sp, 0x20] mov r2, sp strh r4, [r2] add r4, sp, 0x4 ldrb r2, [r4] strb r2, [r0] ldrb r2, [r4, 0x1] strb r2, [r0, 0x1] ldrb r2, [r4, 0x2] strb r2, [r0, 0x2] ldrb r2, [r4, 0x3] strb r2, [r0, 0x3] strb r3, [r0, 0x4] strb r5, [r0, 0x5] strb r6, [r0, 0x6] mov r2, sp ldrb r2, [r2] strb r2, [r0, 0x7] mov r2, sp ldrb r2, [r2, 0x1] strb r2, [r0, 0x8] strb r1, [r0, 0x9] add sp, 0x8 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8024604 thumb_func_start sub_8024644 sub_8024644: ; 8024644 push {r4,r5,lr} sub sp, 0x4 ldr r5, [sp, 0x10] mov r4, sp strh r3, [r4] strb r1, [r0] strb r2, [r0, 0x1] mov r1, sp ldrb r1, [r1] strb r1, [r0, 0x2] mov r1, sp ldrb r1, [r1, 0x1] strb r1, [r0, 0x3] strb r5, [r0, 0x4] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8024644 thumb_func_start sub_8024668 sub_8024668: ; 8024668 ldr r1, =0x03005d90 ldr r1, [r1] adds r1, 0xAC ldr r0, [r0] ldr r1, [r1] eors r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_8024668 thumb_func_start sub_802467C sub_802467C: ; 802467C ldr r2, =0x03005d90 ldr r2, [r2] adds r2, 0xAC ldr r2, [r2] eors r2, r1 str r2, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_802467C thumb_func_start sub_8024690 sub_8024690: ; 8024690 push {lr} adds r1, r0, 0 ldr r0, =0x03005d90 ldr r0, [r0] movs r2, 0xFA lsls r2, 1 adds r0, r2 bl apply_u32_xor_crypto pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8024690 thumb_func_start sub_80246AC sub_80246AC: ; 80246AC push {r4,lr} adds r4, r0, 0 ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0xFA lsls r1, 1 adds r0, r1 bl sub_8024668 cmp r0, r4 bcc @080246CC movs r0, 0x1 b @080246CE .align 2, 0 .pool @080246CC: movs r0, 0 @080246CE: pop {r4} pop {r1} bx r1 thumb_func_end sub_80246AC thumb_func_start sub_80246D4 sub_80246D4: ; 80246D4 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0xFA lsls r1, 1 adds r0, r1 bl sub_8024668 ldr r1, =0x020375e0 ldrh r1, [r1] cmp r0, r1 bcc @080246F8 movs r0, 0x1 b @080246FA .align 2, 0 .pool @080246F8: movs r0, 0 @080246FA: pop {r1} bx r1 thumb_func_end sub_80246D4 thumb_func_start sub_8024700 sub_8024700: ; 8024700 push {r4,r5,lr} adds r4, r0, 0 ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0xFA lsls r1, 1 adds r5, r0, r1 adds r0, r5, 0 bl sub_8024668 adds r1, r0, r4 ldr r2, =0x0001869f cmp r1, r2 bhi @08024730 adds r0, r5, 0 bl sub_802467C movs r0, 0x1 b @0802473A .align 2, 0 .pool @08024730: adds r0, r5, 0 adds r1, r2, 0 bl sub_802467C movs r0, 0 @0802473A: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8024700 thumb_func_start sub_8024740 sub_8024740: ; 8024740 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0xFA lsls r1, 1 adds r4, r0, r1 adds r0, r5, 0 bl sub_80246AC lsls r0, 24 cmp r0, 0 beq @08024774 adds r0, r4, 0 bl sub_8024668 adds r1, r0, 0 subs r1, r5 adds r0, r4, 0 bl sub_802467C movs r0, 0x1 b @08024776 .align 2, 0 .pool @08024774: movs r0, 0 @08024776: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8024740 thumb_func_start sub_802477C sub_802477C: ; 802477C push {r4,r5,lr} ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0xFA lsls r1, 1 adds r4, r0, r1 ldr r5, =0x020375e0 ldrh r0, [r5] bl sub_80246AC lsls r0, 24 cmp r0, 0 beq @080247B4 adds r0, r4, 0 bl sub_8024668 adds r1, r0, 0 ldrh r0, [r5] subs r1, r0 adds r0, r4, 0 bl sub_802467C movs r0, 0x1 b @080247B6 .align 2, 0 .pool @080247B4: movs r0, 0 @080247B6: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_802477C thumb_func_start sub_80247BC sub_80247BC: ; 80247BC push {lr} ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0xFA lsls r1, 1 adds r0, r1 bl sub_8024668 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80247BC thumb_func_start sub_80247D4 sub_80247D4: ; 80247D4 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0xC adds r6, r0, 0 mov r8, r2 adds r4, r3, 0 ldr r5, [sp, 0x24] lsls r6, 24 lsrs r6, 24 mov r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 ldr r0, =0x02021cc4 mov r9, r0 movs r2, 0x1 movs r3, 0x5 bl 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 .pool thumb_func_end sub_80247D4 thumb_func_start sub_802482C sub_802482C: ; 802482C push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0xC adds r6, r0, 0 adds r4, r1, 0 adds r5, r2, 0 mov r8, r3 lsls r6, 24 lsrs r6, 24 lsls r4, 16 lsrs r4, 16 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 movs r1, 0 adds r2, r4, 0 adds r3, r5, 0 bl SetWindowBorderStyle ldr r2, =gUnknown_085EDCDE movs r0, 0x1 str r0, [sp] movs r0, 0xFF str r0, [sp, 0x4] movs r4, 0 str r4, [sp, 0x8] adds r0, r6, 0 movs r1, 0x1 movs r3, 0 bl Print str r4, [sp] adds r0, r6, 0 mov r1, r8 movs r2, 0x1A movs r3, 0x11 bl sub_80247D4 add sp, 0xC pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802482C thumb_func_start sub_802488C sub_802488C: ; 802488C push {lr} sub sp, 0x4 bl sub_80247BC adds r1, r0, 0 ldr r0, =0x02022c94 ldrb r0, [r0] movs r2, 0 str r2, [sp] movs r2, 0x1A movs r3, 0x11 bl sub_80247D4 add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802488C thumb_func_start sub_80248B0 sub_80248B0: ; 80248B0 push {r4,r5,lr} sub sp, 0x18 movs r0, 0x7 str r0, [sp] movs r0, 0x4 str r0, [sp, 0x4] movs r0, 0xF str r0, [sp, 0x8] movs r0, 0x1C str r0, [sp, 0xC] add r0, sp, 0x10 movs r1, 0 movs r2, 0x1 movs r3, 0x1 bl rbox_template_set ldr r4, =0x02022c94 add r0, sp, 0x10 bl 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, =0x0000021d adds r1, r5, 0 movs r2, 0xD0 bl box_border_load_tiles_and_pal ldrb r4, [r4] bl sub_80247BC adds r3, r0, 0 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0xD bl sub_802482C add sp, 0x18 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80248B0 thumb_func_start sub_8024918 sub_8024918: ; 8024918 push {r4,lr} ldr r4, =0x02022c94 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 .pool thumb_func_end sub_8024918 thumb_func_start sub_802493C sub_802493C: ; 802493C push {r4-r6,lr} adds r5, r1, 0 lsls r0, 16 lsrs r6, r0, 16 ldr r1, =0x03000db0 movs r0, 0 str r0, [r1] ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08024A10 ldr r4, =0x02022c98 ldr r0, =0x00003330 bl 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, =0x000032cc adds r0, r1, r2 adds r2, r1, 0 adds r2, 0x28 ldrb r3, [r2] lsls r2, r3, 4 subs r2, r3 lsls r2, 2 adds r1, r2 ldr r2, =0x000031a0 adds r1, r2 movs r2, 0x3C bl memcpy ldr r0, [r4] adds r1, r0, 0 adds r1, 0x28 ldrb r1, [r1] lsls r1, 2 ldr r2, =0x0000318c adds r1, r2 adds r0, r1 movs r1, 0x64 muls r1, r6 ldr r2, =0x020244ec adds r1, r2 bl sub_80261F8 ldr r0, =sub_8024BC8 movs r1, 0x1 bl AddTask ldr r0, =sub_80261CC bl 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, =0x0000021e bl current_map_music_set b @08024A16 .align 2, 0 .pool @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, =0x02022c98 ldr r0, [r0] ldrb r0, [r0, 0xC] cmp r0, 0x7 bls @08024BDC b @08024D34 @08024BDC: lsls r0, 2 ldr r1, =@08024BF0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08024BF0: .4byte @08024C10 .4byte @08024C24 .4byte @08024C4C .4byte @08024C5A .4byte @08024C80 .4byte @08024CD4 .4byte @08024CE6 .4byte @08024D10 @08024C10: movs r0, 0 bl SetVBlankCallback ldr r0, =sub_8025910 movs r1, 0x4 bl sub_802620C b @08024D20 .align 2, 0 .pool @08024C24: ldr r0, =sub_8025910 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @08024C32 b @08024D40 @08024C32: ldr r4, =0x02022c98 ldr r0, [r4] movs r1, 0xB0 lsls r1, 1 adds r0, r1 bl sub_8029274 ldr r1, [r4] b @08024D24 .align 2, 0 .pool @08024C4C: bl sub_802A770 cmp r0, 0 bne @08024D40 bl sub_8010434 b @08024D20 @08024C5A: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08024D40 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08024D20 bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 b @08024D20 .align 2, 0 .pool @08024C80: ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x24 ldrb r5, [r0] bl sub_80283A8 movs r4, 0 cmp r4, r5 bcs @08024CBA @08024C92: ldr r0, =0x02022c98 ldr r1, [r0] adds r0, r1, 0 adds r0, 0x34 adds r0, r4 ldrb r2, [r0] lsls r0, r2, 2 ldr r3, =0x0000318c adds r0, r3 adds r0, r1, r0 adds r1, 0x24 ldrb r3, [r1] adds r1, r4, 0 bl sub_8028408 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @08024C92 @08024CBA: ldr r4, =0x02022c98 ldr r0, [r4] adds r0, 0x24 ldrb r1, [r0] movs r0, 0 bl sub_802868C ldr r1, [r4] b @08024D24 .align 2, 0 .pool @08024CD4: bl sub_8028A34 bl sub_8028A88 bl sub_8028D44 bl sub_8028734 b @08024D20 @08024CE6: movs r4, 0x1 negs r4, r4 adds r0, r4, 0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =sub_80261E4 bl SetVBlankCallback b @08024D20 .align 2, 0 .pool @08024D10: bl fade_and_return_progress_probably ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08024D40 @08024D20: ldr r0, =0x02022c98 ldr r1, [r0] @08024D24: ldrb r0, [r1, 0xC] adds r0, 0x1 strb r0, [r1, 0xC] b @08024D40 .align 2, 0 .pool @08024D34: adds r0, r1, 0 bl remove_task ldr r0, =sub_802589C bl sub_802621C @08024D40: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8024BC8 thumb_func_start sub_8024D4C sub_8024D4C: ; 8024D4C push {lr} bl sub_8025D04 ldr r1, =gUnknown_082F7AC4 ldr r0, =0x02022c98 ldr r0, [r0] ldrb r0, [r0, 0x18] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x03000db0 ldr r0, [r0] cmp r0, 0 bne @08024D70 bl sub_8026AF4 @08024D70: bl sub_8025D50 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8024D4C thumb_func_start sub_8024D84 sub_8024D84: ; 8024D84 push {lr} bl sub_8025E0C ldr r1, =gUnknown_082F7AF4 ldr r0, =0x02022c98 ldr r0, [r0] ldrb r0, [r0, 0x18] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x03000db0 ldr r0, [r0] cmp r0, 0 bne @08024DA8 bl sub_8026B28 @08024DA8: bl sub_8025ED8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8024D84 thumb_func_start sub_8024DBC sub_8024DBC: ; 8024DBC push {r4,lr} ldr r4, =0x02022c98 ldr r0, [r4] ldrb r0, [r0, 0x10] cmp r0, 0 beq @08024DD4 cmp r0, 0x1 beq @08024DEA b @08024DF8 .align 2, 0 .pool @08024DD4: movs r0, 0x1 bl sub_8028504 movs r0, 0x1 bl sub_80292E0 ldr r1, [r4] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @08024DF8 @08024DEA: bl sub_802A770 cmp r0, 0 bne @08024DF8 movs r0, 0x1 bl sub_8026240 @08024DF8: pop {r4} pop {r0} bx r0 thumb_func_end sub_8024DBC thumb_func_start sub_8024E00 sub_8024E00: ; 8024E00 push {r4,lr} ldr r4, =0x02022c98 ldr r1, [r4] ldrb r0, [r1, 0x10] cmp r0, 0 bne @08024E20 bl sub_80262C0 ldr r1, [r4] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @08024E30 .align 2, 0 .pool @08024E20: movs r0, 0x8C lsls r0, 1 adds r1, r0 movs r0, 0x1 str r0, [r1] movs r0, 0x2 bl sub_8026240 @08024E30: pop {r4} pop {r0} bx r0 thumb_func_end sub_8024E00 thumb_func_start sub_8024E38 sub_8024E38: ; 8024E38 push {r4,lr} sub sp, 0x4 ldr r1, =0x02022c98 ldr r0, [r1] ldrb r0, [r0, 0x10] adds r4, r1, 0 cmp r0, 0x5 bhi @08024F08 lsls r0, 2 ldr r1, =@08024E5C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08024E5C: .4byte @08024E74 .4byte @08024E90 .4byte @08024EA0 .4byte @08024EC4 .4byte @08024ED8 .4byte @08024EF8 @08024E74: movs r0, 0 str r0, [sp] movs r0, 0x7 movs r1, 0x8 movs r2, 0x78 movs r3, 0x50 bl sub_802EB24 ldr r0, =0x02022c98 ldr r1, [r0] b @08024EF0 .align 2, 0 .pool @08024E90: bl sub_8010434 ldr r0, =0x02022c98 ldr r1, [r0] b @08024EF0 .align 2, 0 .pool @08024EA0: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08024F08 ldr r2, =0x02022c98 ldr r1, [r2] ldrb r0, [r1, 0x10] adds r0, 0x1 movs r3, 0 strb r0, [r1, 0x10] ldr r0, [r2] adds r0, 0x30 strb r3, [r0] b @08024F08 .align 2, 0 .pool @08024EC4: bl sub_802EB84 cmp r0, 0 bne @08024F08 ldr r0, =0x02022c98 ldr r1, [r0] b @08024EF0 .align 2, 0 .pool @08024ED8: ldr r1, [r4] adds r1, 0x30 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 bls @08024F08 bl sub_8010434 ldr r1, [r4] @08024EF0: ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @08024F08 @08024EF8: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08024F08 movs r0, 0x3 bl sub_8026240 @08024F08: add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end sub_8024E38 thumb_func_start sub_8024F10 sub_8024F10: ; 8024F10 push {lr} ldr r0, =0x02022c98 ldr r1, [r0] ldrb r0, [r1, 0x10] cmp r0, 0 bne @08024F2E movs r2, 0x8E lsls r2, 1 adds r0, r1, r2 ldr r0, [r0] cmp r0, 0 beq @08024F2E movs r0, 0x4 bl sub_8026240 @08024F2E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8024F10 thumb_func_start sub_8024F38 sub_8024F38: ; 8024F38 push {r4,lr} ldr r4, =0x02022c98 ldr r2, [r4] ldrb r0, [r2, 0x10] cmp r0, 0 bne @08024FF6 adds r0, r2, 0 adds r0, 0x40 ldrb r0, [r0] cmp r0, 0x9 bhi @08024FE8 adds r0, r2, 0 adds r0, 0xA8 ldrb r0, [r0] cmp r0, 0 bne @08024FEE ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @08024F88 ldr r1, =0x000031cc adds r0, r2, r1 ldrb r1, [r0] cmp r1, 0 bne @08024FEE ldr r3, =0x000031d0 adds r0, r2, r3 strb r1, [r0] movs r0, 0x2 b @08024FC2 .align 2, 0 .pool @08024F88: movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08024FA8 ldr r3, =0x000031cc adds r0, r2, r3 ldrb r1, [r0] cmp r1, 0 bne @08024FEE adds r3, 0x4 adds r0, r2, r3 strb r1, [r0] movs r0, 0x1 b @08024FC2 .align 2, 0 .pool @08024FA8: movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @08024FD4 ldr r3, =0x000031cc adds r0, r2, r3 ldrb r1, [r0] cmp r1, 0 bne @08024FEE adds r3, 0x4 adds r0, r2, r3 strb r1, [r0] movs r0, 0x3 @08024FC2: bl sub_8027518 ldr r1, [r4] ldr r2, =0x000031cc adds r1, r2 strb r0, [r1] b @08024FEE .align 2, 0 .pool @08024FD4: movs r0, 0 bl sub_8027518 ldr r1, [r4] ldr r3, =0x000031cc adds r1, r3 strb r0, [r1] b @08024FEE .align 2, 0 .pool @08024FE8: movs r0, 0xB bl sub_8026240 @08024FEE: bl sub_802671C bl sub_8025F48 @08024FF6: pop {r4} pop {r0} bx r0 thumb_func_end sub_8024F38 thumb_func_start sub_8024FFC sub_8024FFC: ; 8024FFC push {lr} ldr r0, =0x02022c98 ldr r2, [r0] adds r0, r2, 0 adds r0, 0x40 ldrb r0, [r0] cmp r0, 0x9 bhi @080250C4 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0802504C adds r0, r2, 0 adds r0, 0x28 ldrb r1, [r0] lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r0, r2, r0 ldr r1, =0x000031cc adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080250CA ldr r3, =0x000032f8 adds r1, r2, r3 movs r0, 0x2 strb r0, [r1] b @080250CA .align 2, 0 .pool @0802504C: movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08025080 adds r0, r2, 0 adds r0, 0x28 ldrb r1, [r0] lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r0, r2, r0 ldr r1, =0x000031cc adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080250CA ldr r3, =0x000032f8 adds r1, r2, r3 movs r0, 0x1 strb r0, [r1] b @080250CA .align 2, 0 .pool @08025080: movs r0, 0x20 ands r0, r1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @080250B8 adds r0, r2, 0 adds r0, 0x28 ldrb r1, [r0] lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r0, r2, r0 ldr r1, =0x000031cc adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080250CA ldr r3, =0x000032f8 adds r1, r2, r3 movs r0, 0x3 strb r0, [r1] b @080250CA .align 2, 0 .pool @080250B8: ldr r3, =0x000032f8 adds r0, r2, r3 strb r1, [r0] b @080250CA .align 2, 0 .pool @080250C4: movs r0, 0xB bl sub_8026240 @080250CA: bl sub_8026044 pop {r0} bx r0 thumb_func_end sub_8024FFC thumb_func_start sub_80250D4 sub_80250D4: ; 80250D4 push {r4,r5,lr} bl sub_802671C bl sub_8025F48 bl sub_8026C50 cmp r0, 0x1 bne @080250F2 bl sub_80272A4 movs r0, 0x5 bl sub_8026240 b @08025150 @080250F2: ldr r0, =0x02022c98 ldr r2, [r0] movs r1, 0x96 lsls r1, 1 adds r4, r2, r1 movs r1, 0x1 str r1, [r4] movs r3, 0x1 adds r1, r2, 0 adds r1, 0x24 adds r5, r0, 0 ldrb r1, [r1] cmp r3, r1 bcs @08025150 movs r1, 0x9A lsls r1, 1 adds r0, r2, r1 ldr r0, [r0] cmp r0, 0x1 beq @08025124 movs r0, 0 str r0, [r4] b @08025150 .align 2, 0 .pool @08025124: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 ldr r2, [r5] adds r0, r2, 0 adds r0, 0x24 ldrb r0, [r0] cmp r3, r0 bcs @08025150 lsls r0, r3, 2 movs r4, 0x98 lsls r4, 1 adds r1, r2, r4 adds r1, r0 ldr r0, [r1] cmp r0, 0x1 beq @08025124 movs r0, 0x96 lsls r0, 1 adds r1, r2, r0 movs r0, 0 str r0, [r1] @08025150: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_80250D4 thumb_func_start sub_8025158 sub_8025158: ; 8025158 push {lr} bl sub_8026044 bl sub_8026C90 cmp r0, 0x1 bne @0802516C movs r0, 0x5 bl sub_8026240 @0802516C: pop {r0} bx r0 thumb_func_end sub_8025158 thumb_func_start sub_8025170 sub_8025170: ; 8025170 push {r4,lr} bl sub_800A550 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 bl sub_800A9D8 lsls r0, 24 lsrs r0, 24 cmp r4, r0 beq @0802518C movs r0, 0 b @08025192 @0802518C: bl sub_800A5B4 movs r0, 0x1 @08025192: pop {r4} pop {r1} bx r1 thumb_func_end sub_8025170 thumb_func_start sub_8025198 sub_8025198: ; 8025198 push {r4,r5,lr} ldr r5, =0x02022c98 ldr r1, [r5] ldrb r4, [r1, 0x10] cmp r4, 0x1 beq @080251D0 cmp r4, 0x1 bgt @080251B4 cmp r4, 0 beq @080251BA b @0802520C .align 2, 0 .pool @080251B4: cmp r4, 0x2 beq @080251DC b @0802520C @080251BA: adds r1, 0x4A movs r0, 0 movs r2, 0x3C bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @08025226 ldr r0, [r5] strb r4, [r0, 0x8] b @08025202 @080251D0: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08025226 b @08025202 @080251DC: bl sub_8025170 cmp r0, 0 beq @080251EE ldr r0, [r5] adds r1, r0, 0 adds r1, 0x24 ldrb r1, [r1] strb r1, [r0, 0x8] @080251EE: ldr r2, [r5] adds r1, r2, 0 adds r1, 0x24 ldrb r0, [r2, 0x8] ldrb r1, [r1] cmp r0, r1 bcc @08025226 ldrb r0, [r2, 0x14] adds r0, 0x1 strb r0, [r2, 0x14] @08025202: ldr r1, [r5] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @08025226 @0802520C: movs r0, 0x1 bl ducking_tick lsls r0, 24 cmp r0, 0 beq @08025226 movs r0, 0x6 bl sub_8026240 ldr r0, =0x0000020b movs r1, 0x4 bl sub_80A2F88 @08025226: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8025198 thumb_func_start sub_8025230 sub_8025230: ; 8025230 push {r4,r5,lr} ldr r5, =0x02022c98 ldr r2, [r5] ldrb r4, [r2, 0x10] cmp r4, 0x1 beq @08025274 cmp r4, 0x1 bgt @0802524C cmp r4, 0 beq @08025252 b @080252DC .align 2, 0 .pool @0802524C: cmp r4, 0x2 beq @08025282 b @080252DC @08025252: ldrb r0, [r2, 0x14] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, 0x4A adds r1, r2, r1 movs r0, 0 movs r2, 0x3C bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @08025316 ldr r0, [r5] strb r4, [r0, 0x8] ldr r1, [r5] b @080252CC @08025274: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08025316 ldr r1, [r5] b @080252CC @08025282: bl sub_8025170 cmp r0, 0 beq @080252B4 movs r4, 0 b @080252AA @0802528E: ldr r0, [r5] adds r0, 0x4A ldr r1, =0x020223c4 movs r2, 0x3C bl memcpy ldr r1, [r5] adds r0, r1, 0 adds r0, 0x24 ldrb r0, [r0] strb r0, [r1, 0x8] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @080252AA: ldr r0, [r5] adds r0, 0x24 ldrb r0, [r0] cmp r4, r0 bcc @0802528E @080252B4: ldr r3, =0x02022c98 ldr r2, [r3] adds r1, r2, 0 adds r1, 0x24 ldrb r0, [r2, 0x8] ldrb r1, [r1] cmp r0, r1 bcc @08025316 ldrb r0, [r2, 0x14] adds r0, 0x1 strb r0, [r2, 0x14] ldr r1, [r3] @080252CC: ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @08025316 .align 2, 0 .pool @080252DC: movs r0, 0x1 bl ducking_tick lsls r0, 24 cmp r0, 0 beq @08025316 ldr r0, =0x02022c98 ldr r2, [r0] adds r0, r2, 0 adds r0, 0x28 ldrb r0, [r0] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r0, r2, 0 adds r0, 0x54 adds r0, r1 ldrh r1, [r0] movs r3, 0x8A lsls r3, 1 adds r0, r2, r3 strh r1, [r0] movs r0, 0x6 bl sub_8026240 ldr r0, =0x0000020b movs r1, 0x4 bl sub_80A2F88 @08025316: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8025230 thumb_func_start sub_8025324 sub_8025324: ; 8025324 push {r4,r5,lr} sub sp, 0x4 movs r1, 0x1 mov r0, sp strb r1, [r0] ldr r0, =0x02022c98 ldr r0, [r0] ldrb r0, [r0, 0x10] cmp r0, 0x4 bls @0802533A b @08025458 @0802533A: lsls r0, 2 ldr r1, =@0802534C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802534C: .4byte @08025360 .4byte @08025384 .4byte @0802539C .4byte @080253BC .4byte @080253DC @08025360: bl sub_802749C movs r0, 0x1 bl sub_80289E8 bl sub_8028DFC movs r0, 0x1 bl sub_8028EC8 movs r0, 0x2 bl sub_80292E0 ldr r0, =0x02022c98 ldr r1, [r0] b @08025448 .align 2, 0 .pool @08025384: bl sub_802A770 cmp r0, 0 bne @08025466 movs r0, 0x5 bl sub_80292E0 ldr r0, =0x02022c98 ldr r1, [r0] b @08025448 .align 2, 0 .pool @0802539C: bl sub_802A794 mov r1, sp strb r0, [r1] movs r0, 0 movs r2, 0x1 bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @08025466 ldr r0, =0x02022c98 ldr r1, [r0] b @08025448 .align 2, 0 .pool @080253BC: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08025466 ldr r3, =0x02022c98 ldr r1, [r3] ldrb r0, [r1, 0x10] adds r0, 0x1 movs r2, 0 strb r0, [r1, 0x10] ldr r0, [r3] strb r2, [r0, 0x8] b @08025466 .align 2, 0 .pool @080253DC: bl sub_8025170 cmp r0, 0 beq @08025422 movs r2, 0 ldr r1, =0x02022c98 ldr r0, [r1] adds r0, 0x24 ldrb r0, [r0] cmp r2, r0 bcs @08025422 adds r3, r1, 0 movs r5, 0x86 lsls r5, 1 ldr r4, =0x020223c4 @080253FA: ldr r1, [r3] adds r1, r2, r1 adds r1, r5 lsls r0, r2, 8 adds r0, r4 ldrb r0, [r0] strb r0, [r1] ldr r1, [r3] adds r0, r1, 0 adds r0, 0x24 ldrb r0, [r0] strb r0, [r1, 0x8] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 ldr r0, [r3] adds r0, 0x24 ldrb r0, [r0] cmp r2, r0 bcc @080253FA @08025422: ldr r4, =0x02022c98 ldr r2, [r4] adds r1, r2, 0 adds r1, 0x24 ldrb r0, [r2, 0x8] ldrb r1, [r1] cmp r0, r1 bcc @08025466 ldrb r0, [r2, 0x14] adds r0, 0x1 strb r0, [r2, 0x14] lsls r0, 24 lsrs r0, 24 cmp r0, 0x77 bls @08025466 movs r0, 0x6 bl sub_80292E0 ldr r1, [r4] @08025448: ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @08025466 .align 2, 0 .pool @08025458: bl sub_802A770 cmp r0, 0 bne @08025466 movs r0, 0x7 bl sub_8026240 @08025466: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8025324 thumb_func_start sub_8025470 sub_8025470: ; 8025470 push {r4,r5,lr} sub sp, 0x4 ldr r4, =0x02022c98 ldr r0, [r4] ldrb r0, [r0, 0x10] cmp r0, 0x7 bls @08025480 b @08025606 @08025480: lsls r0, 2 ldr r1, =@08025494 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08025494: .4byte @080254B4 .4byte @080254D4 .4byte @080254F0 .4byte @08025504 .4byte @08025520 .4byte @0802553C .4byte @08025564 .4byte @08025578 @080254B4: bl sub_8027748 ldr r1, =0x00000bb7 cmp r0, r1 bls @080254C4 movs r0, 0x4 bl sub_80292E0 @080254C4: ldr r0, =0x02022c98 ldr r1, [r0] b @080255E8 .align 2, 0 .pool @080254D4: bl sub_802A770 cmp r0, 0 beq @080254DE b @0802563C @080254DE: movs r0, 0x3 bl sub_80292E0 ldr r0, =0x02022c98 ldr r1, [r0] b @080255E8 .align 2, 0 .pool @080254F0: bl sub_8028FCC bl sub_80272E8 ldr r0, =0x02022c98 ldr r1, [r0] b @080255E8 .align 2, 0 .pool @08025504: bl sub_802A794 lsls r0, 24 lsrs r0, 24 mov r1, sp strb r0, [r1] cmp r0, 0 bne @08025516 b @0802563C @08025516: ldr r0, =0x02022c98 ldr r1, [r0] b @080255E8 .align 2, 0 .pool @08025520: bl sub_802A770 cmp r0, 0 beq @0802552A b @0802563C @0802552A: movs r0, 0x5 bl sub_80292E0 ldr r0, =0x02022c98 ldr r1, [r0] b @080255E8 .align 2, 0 .pool @0802553C: bl sub_802A794 mov r1, sp strb r0, [r1] movs r0, 0 movs r2, 0x1 bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @0802563C ldr r2, =0x02022c98 ldr r1, [r2] movs r0, 0 strb r0, [r1, 0x8] ldr r1, [r2] b @080255E8 .align 2, 0 .pool @08025564: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0802563C ldr r0, =0x02022c98 ldr r1, [r0] b @080255E8 .align 2, 0 .pool @08025578: bl sub_8025170 cmp r0, 0 beq @080255BE movs r2, 0 ldr r1, =0x02022c98 ldr r0, [r1] adds r0, 0x24 ldrb r0, [r0] cmp r2, r0 bcs @080255BE adds r3, r1, 0 movs r5, 0x86 lsls r5, 1 ldr r4, =0x020223c4 @08025596: ldr r1, [r3] adds r1, r2, r1 adds r1, r5 lsls r0, r2, 8 adds r0, r4 ldrb r0, [r0] strb r0, [r1] ldr r1, [r3] adds r0, r1, 0 adds r0, 0x24 ldrb r0, [r0] strb r0, [r1, 0x8] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 ldr r0, [r3] adds r0, 0x24 ldrb r0, [r0] cmp r2, r0 bcc @08025596 @080255BE: ldr r4, =0x02022c98 ldr r2, [r4] adds r1, r2, 0 adds r1, 0x24 ldrb r0, [r2, 0x8] ldrb r1, [r1] cmp r0, r1 bcc @080255F8 ldrb r0, [r2, 0x14] adds r0, 0x1 strb r0, [r2, 0x14] lsls r0, 24 lsrs r0, 24 cmp r0, 0x77 bls @0802563C bl sub_8027608 movs r0, 0x6 bl sub_80292E0 ldr r1, [r4] @080255E8: ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @0802563C .align 2, 0 .pool @080255F8: bl sub_8027554 b @0802563C @080255FE: movs r0, 0x8 bl sub_8026240 b @0802563C @08025606: bl sub_802A770 cmp r0, 0 bne @0802563C movs r2, 0 ldr r1, [r4] adds r0, r1, 0 adds r0, 0x24 ldrb r0, [r0] cmp r2, r0 bcs @08025636 movs r4, 0x86 lsls r4, 1 adds r3, r1, r4 adds r1, r0, 0 @08025624: adds r0, r3, r2 ldrb r0, [r0] cmp r0, 0x2 beq @080255FE adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, r1 bcc @08025624 @08025636: movs r0, 0xA bl sub_8026240 @0802563C: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8025470 thumb_func_start sub_8025644 sub_8025644: ; 8025644 push {r4,lr} ldr r4, =0x02022c98 ldr r0, [r4] ldrb r0, [r0, 0x10] cmp r0, 0x1 beq @08025672 cmp r0, 0x1 bgt @08025660 cmp r0, 0 beq @08025666 b @08025692 .align 2, 0 .pool @08025660: cmp r0, 0x2 beq @0802567C b @08025692 @08025666: bl sub_800AC34 movs r0, 0x7 bl sub_80292E0 b @08025688 @08025672: bl sub_802A770 cmp r0, 0 bne @080256A0 b @08025688 @0802567C: bl sub_802A794 lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 bne @080256A0 @08025688: ldr r1, [r4] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @080256A0 @08025692: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080256A0 movs r0, 0x9 bl sub_8026240 @080256A0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8025644 thumb_func_start sub_80256AC sub_80256AC: ; 80256AC push {r4,lr} sub sp, 0x4 ldr r4, =0x02022c98 ldr r0, [r4] ldrb r1, [r0, 0x10] cmp r1, 0x1 beq @080256E0 cmp r1, 0x1 bgt @080256C8 cmp r1, 0 beq @080256CE b @08025728 .align 2, 0 .pool @080256C8: cmp r1, 0x2 beq @080256F8 b @08025728 @080256CE: movs r0, 0x1 negs r0, r0 str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @0802571A @080256E0: bl fade_and_return_progress_probably ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0802574C b @0802571A .align 2, 0 .pool @080256F8: bl sub_8028B80 bl sub_80287E4 ldr r0, [r4] adds r0, 0x24 ldrb r0, [r0] bl sub_8028614 bl sub_8028E84 ldr r1, =0x03000db0 movs r0, 0x1 str r0, [r1] movs r0, 0x8 bl sub_80292E0 @0802571A: ldr r1, [r4] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @0802574C .align 2, 0 .pool @08025728: bl sub_802A770 cmp r0, 0 bne @0802574C ldr r4, =0x02022c98 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 .pool thumb_func_end sub_80256AC thumb_func_start sub_8025758 sub_8025758: ; 8025758 push {r4,lr} sub sp, 0x4 ldr r4, =0x02022c98 ldr r1, [r4] ldrb r0, [r1, 0x10] cmp r0, 0x6 bls @08025768 b @0802585C @08025768: lsls r0, 2 ldr r1, =@0802577C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802577C: .4byte @08025798 .4byte @08025838 .4byte @080257B0 .4byte @08025802 .4byte @08025808 .4byte @08025818 .4byte @08025838 @08025798: movs r0, 0x9 bl sub_80292E0 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl 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, =0x0000021e bl current_map_music_set bl sub_8028E4C b @08025848 .align 2, 0 .pool @08025818: movs r4, 0x1 negs r4, r4 adds r0, r4, 0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 b @08025848 @08025838: bl fade_and_return_progress_probably ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0802588C @08025848: ldr r0, =0x02022c98 ldr r1, [r0] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @0802588C .align 2, 0 .pool @0802585C: ldrb r0, [r1, 0x4] bl remove_task ldr r0, =sub_802589C bl sub_802621C bl sub_802903C ldr r0, [r4] bl sub_8024A30 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08025882 ldr r0, [r4] adds r0, 0x24 movs r1, 0x1 strb r1, [r0] @08025882: bl sub_80273F0 movs r0, 0 bl sub_8028EC8 @0802588C: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8025758 thumb_func_start sub_802589C sub_802589C: ; 802589C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x02022c98 ldr r0, [r1] ldrb r0, [r0, 0x10] adds r4, r1, 0 cmp r0, 0x1 beq @080258C8 cmp r0, 0x1 bgt @080258BC cmp r0, 0 beq @080258C2 b @080258E0 .align 2, 0 .pool @080258BC: cmp r0, 0x2 beq @080258CE b @080258E0 @080258C2: bl sub_8026264 b @080258D2 @080258C8: bl sub_80286E4 b @080258D6 @080258CE: bl sub_8028828 @080258D2: cmp r0, 0x1 bne @08025904 @080258D6: ldr r1, [r4] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] b @08025904 @080258E0: ldr r0, [r4] adds r0, 0x20 ldrb r0, [r0] cmp r0, 0 beq @080258F8 ldr r0, =sub_8024D4C bl sub_802621C b @080258FE .align 2, 0 .pool @080258F8: ldr r0, =sub_8024D84 bl sub_802621C @080258FE: adds r0, r5, 0 bl remove_task @08025904: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802589C thumb_func_start sub_8025910 sub_8025910: ; 8025910 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 movs r0, 0 ldrsh r4, [r5, r0] cmp r4, 0x1 beq @0802596C cmp r4, 0x1 bgt @08025938 cmp r4, 0 beq @0802593E b @080259E8 .align 2, 0 .pool @08025938: cmp r4, 0x2 beq @0802597E b @080259E8 @0802593E: ldr r6, =0x02022c98 ldr r1, [r6] adds r0, r1, 0 adds r0, 0x28 ldrb r0, [r0] lsls r0, 2 ldr r2, =0x0000318c adds r0, r2 adds r1, r0 movs r0, 0 movs r2, 0x1 bl link_0800A448 lsls r0, 24 cmp r0, 0 beq @080259E8 ldr r0, [r6] strb r4, [r0, 0x8] b @08025976 .align 2, 0 .pool @0802596C: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080259E8 @08025976: ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] b @080259E8 @0802597E: bl sub_8025170 cmp r0, 0 beq @080259C4 movs r2, 0 ldr r1, =0x02022c98 ldr r0, [r1] adds r0, 0x24 ldrb r0, [r0] cmp r2, r0 bcs @080259C4 adds r3, r1, 0 ldr r5, =0x020223c4 ldr r4, =0x0000318c @0802599A: ldr r0, [r3] lsls r1, r2, 2 adds r1, r0 adds r1, r4 lsls r0, r2, 8 adds r0, r5 ldrb r0, [r0] strb r0, [r1] ldr r1, [r3] adds r0, r1, 0 adds r0, 0x24 ldrb r0, [r0] strb r0, [r1, 0x8] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 ldr r0, [r3] adds r0, 0x24 ldrb r0, [r0] cmp r2, r0 bcc @0802599A @080259C4: ldr r4, =0x02022c98 ldr r0, [r4] adds r1, r0, 0 adds r1, 0x24 ldrb r0, [r0, 0x8] ldrb r1, [r1] cmp r0, r1 bcc @080259E8 adds r0, r6, 0 bl remove_task movs r0, 0x6 bl sub_80292E0 ldr r1, [r4] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] @080259E8: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8025910 thumb_func_start sub_80259FC sub_80259FC: ; 80259FC push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x18 ldr r6, =0x02022c98 ldr r0, [r6] adds r1, r0, 0 adds r1, 0x24 ldrb r7, [r1] ldr r2, =0x000031a0 adds r1, r0, r2 ldr r3, =0x000031cc adds r2, r0, r3 ldr r4, =0x00003208 adds r3, r0, r4 ldr r5, =0x00003244 adds r4, r0, r5 str r4, [sp] adds r5, 0x3C adds r4, r0, r5 str r4, [sp, 0x4] adds r5, 0x3C adds r4, r0, r5 str r4, [sp, 0x8] adds r4, r0, 0 adds r4, 0x40 str r4, [sp, 0xC] movs r5, 0x90 lsls r5, 1 adds r4, r0, r5 str r4, [sp, 0x10] movs r4, 0x96 lsls r4, 1 adds r0, r4 str r0, [sp, 0x14] movs r0, 0 bl sub_8028164 ldr r1, [r6] ldr r5, =0x000031b0 adds r2, r1, r5 str r0, [r2] movs r0, 0x94 lsls r0, 1 adds r1, r0 movs r0, 0x1 strb r0, [r1] movs r5, 0x1 cmp r5, r7 bcs @08025AA4 @08025A60: ldr r1, [r6] adds r0, r1, 0 adds r0, 0xA8 adds r0, r5 ldrb r0, [r0] cmp r0, 0 bne @08025A9A lsls r0, r5, 4 subs r0, r5 lsls r4, r0, 2 adds r1, r4, r1 ldr r2, =0x000031cc adds r1, r2 adds r0, r5, 0 bl sub_8028318 adds r1, r0, 0 cmp r1, 0 bne @08025A9A ldr r0, [r6] adds r0, r4 ldr r3, =0x000031cc adds r0, r3 strb r1, [r0] ldr r0, [r6] movs r4, 0x94 lsls r4, 1 adds r0, r4 strb r1, [r0] @08025A9A: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, r7 bcc @08025A60 @08025AA4: ldr r5, =0x02022c98 ldr r1, [r5] movs r6, 0x92 lsls r6, 1 adds r1, r6 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x3B bls @08025B02 ldr r1, [r5] movs r2, 0x94 lsls r2, 1 adds r0, r1, r2 ldrb r4, [r0] cmp r4, 0 beq @08025AF0 bl sub_8011AC8 ldr r0, [r5] adds r0, r6 movs r1, 0 strb r1, [r0] b @08025B02 .align 2, 0 .pool @08025AF0: adds r0, r1, r6 ldrb r0, [r0] cmp r0, 0x46 bls @08025B02 bl sub_8011AC8 ldr r0, [r5] adds r0, r6 strb r4, [r0] @08025B02: movs r5, 0 cmp r5, r7 bcs @08025BF6 ldr r3, =0x000031cc mov r12, r3 ldr r4, =0x02022c98 mov r8, r4 @08025B10: mov r6, r8 ldr r2, [r6] lsls r0, r5, 4 subs r1, r0, r5 lsls r1, 2 adds r1, r2, r1 add r1, r12 ldrb r1, [r1] adds r6, r0, 0 cmp r1, 0 beq @08025B36 adds r0, r2, 0 adds r0, 0xA8 adds r1, r0, r5 ldrb r0, [r1] cmp r0, 0 bne @08025B36 movs r0, 0x1 strb r0, [r1] @08025B36: adds r3, r4, 0 ldr r1, [r3] adds r0, r1, 0 adds r0, 0xA8 adds r0, r5 ldrb r0, [r0] cmp r0, 0x3 bgt @08025B54 cmp r0, 0x1 bge @08025B5A b @08025BEC .align 2, 0 .pool @08025B54: cmp r0, 0x4 beq @08025BA8 b @08025BEC @08025B5A: adds r1, 0xB0 adds r1, r5 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 bls @08025BEC ldr r0, [r3] adds r0, 0xB0 adds r0, r5 strb r2, [r0] ldr r0, [r3] adds r0, 0xA8 adds r0, r5 strb r2, [r0] ldr r0, [r3] subs r1, r6, r5 lsls r1, 2 adds r0, r1 add r0, r12 strb r2, [r0] ldr r0, [r3] adds r0, r1 ldr r6, =0x000031d0 adds r0, r6 strb r2, [r0] ldr r0, [r3] adds r0, r1 ldr r1, =0x000031d4 adds r0, r1 b @08025BEA .align 2, 0 .pool @08025BA8: adds r1, 0xB0 adds r1, r5 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x27 bls @08025BEC ldr r0, [r4] adds r0, 0xB0 adds r0, r5 strb r2, [r0] ldr r0, [r4] adds r0, 0xA8 adds r0, r5 strb r2, [r0] ldr r0, [r4] subs r1, r6, r5 lsls r1, 2 adds r0, r1 add r0, r12 strb r2, [r0] ldr r0, [r4] adds r0, r1 ldr r3, =0x000031d0 adds r0, r3 strb r2, [r0] ldr r0, [r4] adds r0, r1 ldr r6, =0x000031d4 adds r0, r6 @08025BEA: strb r2, [r0] @08025BEC: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, r7 bcc @08025B10 @08025BF6: add sp, 0x18 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80259FC thumb_func_start sub_8025C0C sub_8025C0C: ; 8025C0C push {r4-r7,lr} sub sp, 0x18 ldr r5, =0x02022c98 ldr r0, [r5] adds r1, r0, 0 adds r1, 0x24 ldrb r6, [r1] ldr r2, =0x000031a0 adds r1, r0, r2 ldr r3, =0x000031cc adds r2, r0, r3 ldr r4, =0x00003208 adds r3, r0, r4 ldr r7, =0x00003244 adds r4, r0, r7 str r4, [sp] adds r7, 0x3C adds r4, r0, r7 str r4, [sp, 0x4] adds r7, 0x3C adds r4, r0, r7 str r4, [sp, 0x8] adds r4, r0, 0 adds r4, 0x40 str r4, [sp, 0xC] movs r7, 0x90 lsls r7, 1 adds r4, r0, r7 str r4, [sp, 0x10] movs r4, 0x96 lsls r4, 1 adds r0, r4 str r0, [sp, 0x14] movs r0, 0 bl sub_8028164 ldr r1, [r5] ldr r7, =0x000031b0 adds r2, r1, r7 str r0, [r2] movs r0, 0x94 lsls r0, 1 adds r1, r0 movs r0, 0x1 strb r0, [r1] movs r4, 0x1 cmp r4, r6 bcs @08025C9C @08025C6C: adds r0, r4, 0 bl sub_8028374 cmp r0, 0 beq @08025C92 ldr r0, =0x02022c98 ldr r2, [r0] lsls r1, r4, 2 movs r3, 0x98 lsls r3, 1 adds r0, r2, r3 adds r0, r1 movs r1, 0x1 str r1, [r0] movs r7, 0x94 lsls r7, 1 adds r1, r2, r7 movs r0, 0 strb r0, [r1] @08025C92: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r6 bcc @08025C6C @08025C9C: ldr r5, =0x02022c98 ldr r1, [r5] movs r6, 0x92 lsls r6, 1 adds r1, r6 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x3B bls @08025CFA ldr r1, [r5] movs r2, 0x94 lsls r2, 1 adds r0, r1, r2 ldrb r4, [r0] cmp r4, 0 beq @08025CE8 bl sub_8011AC8 ldr r0, [r5] adds r0, r6 movs r1, 0 strb r1, [r0] b @08025CFA .align 2, 0 .pool @08025CE8: adds r0, r1, r6 ldrb r0, [r0] cmp r0, 0x46 bls @08025CFA bl sub_8011AC8 ldr r0, [r5] adds r0, r6 strb r4, [r0] @08025CFA: add sp, 0x18 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8025C0C thumb_func_start sub_8025D04 sub_8025D04: ; 8025D04 push {r4,r5,lr} ldr r5, =0x02022c98 ldr r0, [r5] ldrb r0, [r0, 0x18] cmp r0, 0x4 beq @08025D40 cmp r0, 0x4 bgt @08025D20 cmp r0, 0x3 beq @08025D26 b @08025D4A .align 2, 0 .pool @08025D20: cmp r0, 0xB beq @08025D46 b @08025D4A @08025D26: bl sub_8026BB8 adds r4, r0, 0 cmp r4, 0x1 bne @08025D4A bl sub_8026C28 ldr r0, [r5] movs r1, 0x8E lsls r1, 1 adds r0, r1 str r4, [r0] b @08025D4A @08025D40: bl sub_80259FC b @08025D4A @08025D46: bl sub_8025C0C @08025D4A: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8025D04 thumb_func_start sub_8025D50 sub_8025D50: ; 8025D50 push {r4-r6,lr} sub sp, 0x14 ldr r0, =0x02022c98 ldr r5, [r0] ldrb r0, [r5, 0x18] cmp r0, 0x4 beq @08025D68 cmp r0, 0xB beq @08025DB8 b @08025DF4 .align 2, 0 .pool @08025D68: ldr r1, =0x000032cc adds r0, r5, r1 ldr r2, =0x000031cc adds r1, r5, r2 ldr r3, =0x00003208 adds r2, r5, r3 ldr r4, =0x00003244 adds r3, r5, r4 movs r6, 0xCA lsls r6, 6 adds r4, r5, r6 str r4, [sp] adds r6, 0x3C adds r4, r5, r6 str r4, [sp, 0x4] adds r4, r5, 0 adds r4, 0x40 ldrb r4, [r4] str r4, [sp, 0x8] movs r6, 0x90 lsls r6, 1 adds r4, r5, r6 ldr r4, [r4] str r4, [sp, 0xC] adds r6, 0xC adds r4, r5, r6 ldr r4, [r4] str r4, [sp, 0x10] bl sub_8027E30 b @08025DF4 .align 2, 0 .pool @08025DB8: ldr r1, =0x000032cc adds r0, r5, r1 ldr r2, =0x000031cc adds r1, r5, r2 ldr r3, =0x00003208 adds r2, r5, r3 ldr r4, =0x00003244 adds r3, r5, r4 movs r6, 0xCA lsls r6, 6 adds r4, r5, r6 str r4, [sp] adds r6, 0x3C adds r4, r5, r6 str r4, [sp, 0x4] adds r4, r5, 0 adds r4, 0x40 ldrb r4, [r4] str r4, [sp, 0x8] movs r6, 0x90 lsls r6, 1 adds r4, r5, r6 ldr r4, [r4] str r4, [sp, 0xC] adds r6, 0xC adds r4, r5, r6 ldr r4, [r4] str r4, [sp, 0x10] bl sub_8027E30 @08025DF4: add sp, 0x14 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8025D50 thumb_func_start sub_8025E0C sub_8025E0C: ; 8025E0C push {r4-r6,lr} sub sp, 0x18 ldr r0, =0x02022c98 ldr r5, [r0] ldrb r0, [r5, 0x18] cmp r0, 0x4 beq @08025E24 cmp r0, 0xB beq @08025E7C b @08025EC0 .align 2, 0 .pool @08025E24: adds r0, r5, 0 adds r0, 0x28 ldrb r0, [r0] lsls r1, r0, 4 subs r1, r0 lsls r1, 2 ldr r2, =0x000031a0 adds r1, r2 adds r1, r5, r1 ldr r3, =0x000031cc adds r2, r5, r3 ldr r4, =0x00003208 adds r3, r5, r4 ldr r6, =0x00003244 adds r4, r5, r6 str r4, [sp] adds r6, 0x3C adds r4, r5, r6 str r4, [sp, 0x4] adds r6, 0x3C adds r4, r5, r6 str r4, [sp, 0x8] adds r4, r5, 0 adds r4, 0x40 str r4, [sp, 0xC] movs r6, 0x90 lsls r6, 1 adds r4, r5, r6 str r4, [sp, 0x10] adds r6, 0xC adds r4, r5, r6 str r4, [sp, 0x14] bl sub_8028164 b @08025EC0 .align 2, 0 .pool @08025E7C: adds r0, r5, 0 adds r0, 0x28 ldrb r0, [r0] lsls r1, r0, 4 subs r1, r0 lsls r1, 2 ldr r2, =0x000031a0 adds r1, r2 adds r1, r5, r1 ldr r3, =0x000031cc adds r2, r5, r3 ldr r4, =0x00003208 adds r3, r5, r4 ldr r6, =0x00003244 adds r4, r5, r6 str r4, [sp] adds r6, 0x3C adds r4, r5, r6 str r4, [sp, 0x4] adds r6, 0x3C adds r4, r5, r6 str r4, [sp, 0x8] adds r4, r5, 0 adds r4, 0x40 str r4, [sp, 0xC] movs r6, 0x90 lsls r6, 1 adds r4, r5, r6 str r4, [sp, 0x10] adds r6, 0xC adds r4, r5, r6 str r4, [sp, 0x14] bl sub_8028164 @08025EC0: add sp, 0x18 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8025E0C thumb_func_start sub_8025ED8 sub_8025ED8: ; 8025ED8 push {r4,lr} ldr r4, =0x02022c98 ldr r1, [r4] ldrb r0, [r1, 0x18] cmp r0, 0x4 beq @08025F0E cmp r0, 0x4 bgt @08025EF4 cmp r0, 0x3 beq @08025EFA b @08025F40 .align 2, 0 .pool @08025EF4: cmp r0, 0xB beq @08025F24 b @08025F40 @08025EFA: movs r0, 0x1 bl sub_8027DD0 ldr r0, [r4] movs r1, 0x8E lsls r1, 1 adds r0, r1 movs r1, 0x1 str r1, [r0] b @08025F40 @08025F0E: ldr r2, =0x000032f8 adds r1, r2 ldrb r0, [r1] cmp r0, 0 beq @08025F40 bl sub_80282EC b @08025F40 .align 2, 0 .pool @08025F24: movs r2, 0x90 lsls r2, 1 adds r0, r1, r2 ldr r0, [r0] cmp r0, 0 bne @08025F40 adds r2, 0xC adds r0, r1, r2 ldr r0, [r0] cmp r0, 0 bne @08025F40 movs r0, 0x1 bl sub_8028350 @08025F40: pop {r4} pop {r0} bx r0 thumb_func_end sub_8025ED8 thumb_func_start sub_8025F48 sub_8025F48: ; 8025F48 push {r4-r6,lr} ldr r6, =0x02022c98 ldr r2, [r6] adds r0, r2, 0 adds r0, 0x28 ldrb r1, [r0] lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r1, r2, r0 ldr r3, =0x000031cc adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @08025F88 bl mplay_has_finished_maybe lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08025FEA ldr r0, [r6] movs r2, 0xA2 lsls r2, 1 adds r0, r2 strb r1, [r0] b @08025FEA .align 2, 0 .pool @08025F88: ldr r3, =0x000031d0 adds r0, r1, r3 ldrb r4, [r0] cmp r4, 0x1 bne @08025FB8 movs r1, 0xA2 lsls r1, 1 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0 bne @08025FEA movs r0, 0x1F bl m4aSongNumStop movs r0, 0x1F bl audio_play ldr r0, [r6] movs r2, 0xA2 lsls r2, 1 adds r0, r2 b @08025FE8 .align 2, 0 .pool @08025FB8: ldr r3, =0x000031d4 adds r0, r1, r3 ldrb r4, [r0] cmp r4, 0x1 bne @08025FEA movs r5, 0xA2 lsls r5, 1 adds r0, r2, r5 ldrb r0, [r0] cmp r0, 0 bne @08025FEA bl mplay_has_finished_maybe lsls r0, 24 cmp r0, 0 bne @08025FEA movs r0, 0x16 bl audio_play movs r0, 0x1 bl sub_80284CC ldr r0, [r6] adds r0, r5 @08025FE8: strb r4, [r0] @08025FEA: ldr r0, =0x02022c98 ldr r2, [r0] movs r5, 0xAA lsls r5, 1 adds r1, r2, r5 ldrb r1, [r1] adds r4, r0, 0 cmp r1, 0 bne @0802601C adds r0, r2, 0 adds r0, 0x40 ldrb r0, [r0] cmp r0, 0x9 bls @0802601C bl sub_80A2F30 ldr r0, [r4] adds r0, r5 movs r1, 0x1 b @0802603A .align 2, 0 .pool @0802601C: ldr r0, [r4] movs r1, 0xAA lsls r1, 1 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @0802603C movs r0, 0xB bl pause_music_for_sound_maybe ldr r0, [r4] movs r2, 0xAA lsls r2, 1 adds r0, r2 movs r1, 0x2 @0802603A: strb r1, [r0] @0802603C: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8025F48 thumb_func_start sub_8026044 sub_8026044: ; 8026044 push {r4-r7,lr} mov r7, r8 push {r7} ldr r6, =0x02022c98 ldr r2, [r6] adds r0, r2, 0 adds r0, 0x44 ldrb r0, [r0] mov r8, r0 adds r0, r2, 0 adds r0, 0x48 ldrb r7, [r0] subs r0, 0x20 ldrb r1, [r0] lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r1, r2, r0 ldr r3, =0x000031cc adds r0, r1, r3 ldrb r3, [r0] cmp r3, 0 bne @0802609C ldr r4, =0x000031d0 adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0x1 beq @080260FE adds r4, 0x4 adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0x1 beq @080260FE movs r1, 0xA2 lsls r1, 1 adds r0, r2, r1 strb r3, [r0] b @080260FE .align 2, 0 .pool @0802609C: ldr r3, =0x000031d0 adds r0, r1, r3 ldrb r4, [r0] cmp r4, 0x1 bne @080260CC movs r1, 0xA2 lsls r1, 1 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0 bne @080260FE movs r0, 0x1F bl m4aSongNumStop movs r0, 0x1F bl audio_play ldr r0, [r6] movs r3, 0xA2 lsls r3, 1 adds r0, r3 b @080260FC .align 2, 0 .pool @080260CC: ldr r4, =0x000031d4 adds r0, r1, r4 ldrb r4, [r0] cmp r4, 0x1 bne @080260FE movs r5, 0xA2 lsls r5, 1 adds r0, r2, r5 ldrb r0, [r0] cmp r0, 0 bne @080260FE bl mplay_has_finished_maybe lsls r0, 24 cmp r0, 0 bne @080260FE movs r0, 0x16 bl audio_play movs r0, 0x1 bl sub_80284CC ldr r0, [r6] adds r0, r5 @080260FC: strb r4, [r0] @080260FE: mov r4, r8 cmp r4, r7 bcs @08026172 ldr r5, =0x02022c98 @08026106: ldr r2, [r5] adds r0, r2, 0 adds r0, 0x28 ldrb r1, [r0] lsls r0, r1, 4 subs r0, r1 lsls r0, 2 ldr r1, =0x000031a0 adds r0, r1 adds r0, r2, r0 adds r1, r0, 0 adds r1, 0x14 adds r0, 0x1F adds r0, r4 ldrb r0, [r0] cmp r0, 0x9 bls @0802615C movs r3, 0xA4 lsls r3, 1 adds r0, r2, r3 adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @08026168 adds r0, r1, r4 ldrb r0, [r0] adds r0, 0x4A bl audio_play ldr r0, [r5] movs r1, 0xA4 lsls r1, 1 adds r0, r1 adds r0, r4 movs r1, 0x1 b @08026166 .align 2, 0 .pool @0802615C: movs r3, 0xA4 lsls r3, 1 adds r0, r2, r3 adds r0, r4 movs r1, 0 @08026166: strb r1, [r0] @08026168: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r7 bcc @08026106 @08026172: ldr r0, =0x02022c98 ldr r2, [r0] movs r5, 0xAA lsls r5, 1 adds r1, r2, r5 ldrb r1, [r1] adds r4, r0, 0 cmp r1, 0 bne @080261A0 adds r0, r2, 0 adds r0, 0x40 ldrb r0, [r0] cmp r0, 0x9 bls @080261A0 bl sub_80A2F30 ldr r0, [r4] adds r0, r5 movs r1, 0x1 b @080261BE .align 2, 0 .pool @080261A0: ldr r0, [r4] movs r1, 0xAA lsls r1, 1 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @080261C0 movs r0, 0xB bl pause_music_for_sound_maybe ldr r0, [r4] movs r3, 0xAA lsls r3, 1 adds r0, r3 movs r1, 0x2 @080261BE: strb r1, [r0] @080261C0: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8026044 thumb_func_start sub_80261CC sub_80261CC: ; 80261CC push {lr} bl 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, =0x02022c98 ldr r3, [r1] movs r2, 0 strb r0, [r3, 0x4] ldr r0, [r1] strb r2, [r0, 0x10] ldr r0, [r1] strb r2, [r0, 0xC] ldr r0, [r1] strb r2, [r0, 0x14] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802621C thumb_func_start sub_8026240 sub_8026240: ; 8026240 push {r4,lr} ldr r2, =0x02022c98 ldr r1, [r2] ldrb r3, [r1, 0x18] movs r4, 0 strb r3, [r1, 0x1C] ldr r1, [r2] strb r0, [r1, 0x18] ldr r0, [r2] strb r4, [r0, 0x10] ldr r0, [r2] strb r4, [r0, 0x14] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8026240 thumb_func_start sub_8026264 sub_8026264: ; 8026264 push {r4,lr} ldr r3, =0x02022c98 ldr r1, [r3] ldrb r0, [r1, 0x14] lsrs r2, r0, 2 adds r0, 0x1 strb r0, [r1, 0x14] cmp r2, 0 beq @080262B8 ldr r3, [r3] ldrb r0, [r3, 0x14] movs r1, 0x3 ands r0, r1 cmp r0, 0 bne @080262B8 ldr r1, =gUnknown_082F7A94 adds r0, r3, 0 adds r0, 0x24 ldrb r0, [r0] subs r0, 0x1 adds r0, r1 ldrb r0, [r0] cmp r2, r0 bcc @080262A0 movs r0, 0x1 b @080262BA .align 2, 0 .pool @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, =0x02022c98 ldr r0, [r2] adds r1, r0, 0 adds r1, 0x44 adds r0, 0x48 ldrb r5, [r0] ldrb r1, [r1] cmp r1, r5 bcs @0802630C mov r8, r2 ldr r0, =0x000032e0 mov r12, r0 movs r7, 0 movs r6, 0x1 @080262E2: mov r2, r8 ldr r0, [r2] mov r2, r12 adds r4, r0, r2 ldr r2, =0x000032eb adds r0, r2 adds r2, r0, r1 movs r3, 0 adds r0, r1, 0 ands r0, r6 cmp r0, 0 bne @080262FC movs r3, 0x1 @080262FC: strb r3, [r2] adds r0, r4, r1 strb r7, [r0] adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, r5 bcc @080262E2 @0802630C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80262C0 thumb_func_start sub_8026324 sub_8026324: ; 8026324 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 ldr r0, =0x02022c98 ldr r1, [r0] adds r0, r1, 0 adds r0, 0x44 ldrb r0, [r0] str r0, [sp] adds r0, r1, 0 adds r0, 0x48 ldrb r0, [r0] str r0, [sp, 0x4] adds r0, r1, 0 adds r0, 0x24 ldrb r0, [r0] str r0, [sp, 0x8] adds r0, r1, 0 adds r0, 0x40 ldrb r0, [r0] cmp r0, 0x9 bls @08026358 b @08026614 @08026358: movs r6, 0 ldr r0, [sp, 0x8] cmp r6, r0 bcs @08026440 @08026360: ldr r3, =0x02022c98 lsls r0, r6, 4 subs r1, r0, r6 lsls r1, 2 ldr r2, [r3] adds r1, r2 ldr r4, =0x000031cc adds r4, r1 mov r8, r4 ldrb r1, [r4] mov r9, r0 adds r0, r6, 0x1 str r0, [sp, 0xC] cmp r1, 0 beq @08026434 adds r0, r2, 0 adds r0, 0xA8 adds r0, r6 ldrb r0, [r0] cmp r0, 0x1 bne @08026434 ldr r1, [sp] mov r10, r1 ldr r2, [sp, 0x4] cmp r10, r2 bcs @08026434 adds r7, r3, 0 @08026396: ldr r0, =gUnknown_082F449C add r0, r10 ldrb r5, [r0] ldr r1, [r7] lsls r4, r5, 1 adds r0, r1, 0 adds r0, 0xF4 adds r0, r4 ldrb r0, [r0] cmp r0, r6 beq @08026434 adds r0, r1, 0 adds r0, 0xF5 adds r0, r4 ldrb r0, [r0] cmp r0, r6 beq @08026434 mov r0, r8 ldrb r1, [r0] adds r0, r6, 0 adds r2, r5, 0 bl sub_8026634 cmp r0, 0x1 bne @08026410 movs r2, 0 ldr r3, =0x02022c98 mov r8, r4 @080263CE: ldr r0, [r3] mov r4, r8 adds r1, r2, r4 adds r0, 0xF4 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0xFF bne @08026404 strb r6, [r1] ldr r0, [r3] adds r0, 0xA8 adds r0, r6 movs r1, 0x2 strb r1, [r0] ldr r0, [r3] adds r0, 0xC4 adds r0, r5 movs r1, 0x1 strb r1, [r0] b @08026434 .align 2, 0 .pool @08026404: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x1 bls @080263CE b @08026434 @08026410: ldr r0, [r7] mov r2, r9 subs r1, r2, r6 lsls r1, 2 adds r0, r1 ldr r4, =0x000031d4 adds r0, r4 ldrb r0, [r0] cmp r0, 0x1 beq @08026434 mov r0, r10 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r0, [sp, 0x4] cmp r10, r0 bcc @08026396 @08026434: ldr r1, [sp, 0xC] lsls r0, r1, 24 lsrs r6, r0, 24 ldr r2, [sp, 0x8] cmp r6, r2 bcc @08026360 @08026440: ldr r4, [sp] mov r10, r4 ldr r0, [sp, 0x4] cmp r10, r0 bcc @0802644C b @08026614 @0802644C: ldr r1, =0x02022c98 mov r9, r1 @08026450: movs r6, 0xFF ldr r0, =gUnknown_082F449C add r0, r10 ldrb r5, [r0] mov r2, r9 ldr r0, [r2] adds r0, 0xC4 adds r0, r5 ldrb r0, [r0] cmp r0, 0x1 beq @08026468 b @08026602 @08026468: adds r0, r5, 0 bl sub_8026D8C mov r1, r9 ldr r4, [r1] lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 adds r1, 0x90 adds r1, r0 ldrb r0, [r1] movs r1, 0x7 bl __udivsi3 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x1 bls @0802648E movs r3, 0x2 @0802648E: ldr r2, =gUnknown_082F7A88 ldr r0, =0x000031b4 adds r1, r4, r0 adds r1, r5 lsls r0, r3, 1 adds r0, r3 ldrb r1, [r1] adds r0, r1 adds r0, r2 ldrb r1, [r0] adds r0, r4, 0 adds r0, 0xD0 adds r0, r5 ldrb r0, [r0] subs r2, r1, r0 cmp r2, 0x5 bgt @080264BC adds r1, r4, 0 adds r1, 0x9C adds r1, r5 ldrb r0, [r1] adds r0, r2 strb r0, [r1] @080264BC: mov r2, r9 ldr r1, [r2] adds r1, 0x9C adds r1, r5 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] movs r4, 0xFF ands r0, r4 cmp r0, 0x5 bhi @080264D6 b @08026602 @080264D6: mov r1, r9 ldr r0, [r1] adds r0, 0x9C adds r0, r5 strb r2, [r0] ldr r3, [r1] lsls r1, r5, 1 adds r0, r3, 0 adds r0, 0xF4 adds r2, r0, r1 ldrb r0, [r2] mov r8, r1 cmp r0, 0xFF bne @08026518 adds r0, r3, 0 adds r0, 0xF5 add r0, r8 ldrb r0, [r0] cmp r0, 0xFF bne @08026500 b @08026602 @08026500: b @08026528 .align 2, 0 .pool @08026518: adds r0, r3, 0 adds r0, 0xF5 add r0, r8 ldrb r0, [r0] cmp r0, 0xFF bne @08026528 ldrb r4, [r2] b @0802654E @08026528: mov r2, r9 ldr r1, [r2] adds r0, r1, 0 adds r0, 0xF4 add r0, r8 ldrb r7, [r0] adds r1, 0xF5 add r1, r8 ldrb r6, [r1] bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 bne @0802654A adds r4, r7, 0 b @0802654E @0802654A: adds r4, r6, 0 adds r6, r7, 0 @0802654E: mov r1, r9 ldr r0, [r1] ldr r2, =0x000032eb adds r0, r2 adds r0, r5 movs r1, 0x7 strb r1, [r0] mov r1, r9 ldr r0, [r1] adds r0, 0xC4 adds r0, r5 movs r1, 0x2 strb r1, [r0] mov r2, r9 ldr r0, [r2] adds r0, 0xA8 adds r0, r4 movs r1, 0x3 strb r1, [r0] ldr r0, [r2] adds r0, 0xB8 adds r0, r5 strb r4, [r0] ldr r1, [r2] lsls r0, r4, 4 subs r0, r4 lsls r0, 2 adds r1, r0 ldr r2, =0x000031d0 adds r1, r2 movs r0, 0x1 strb r0, [r1] mov r2, r9 ldr r1, [r2] lsls r0, r6, 4 subs r0, r6 lsls r0, 2 adds r1, r0 ldr r0, =0x000031d4 adds r1, r0 movs r2, 0x1 strb r2, [r1] mov r0, r9 ldr r1, [r0] lsls r0, r4, 1 adds r1, 0x86 adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] movs r0, 0 adds r1, r5, 0 adds r2, r4, 0 bl sub_8026F1C movs r0, 0x1 bl sub_8027234 adds r0, r4, 0 bl sub_8026D1C mov r1, r9 ldr r0, [r1] adds r1, r0, 0 adds r1, 0xE8 adds r1, r5 ldr r2, =0x000032e0 adds r0, r2 adds r0, r5 ldrb r0, [r0] strb r0, [r1] mov r4, r9 ldr r0, [r4] adds r0, r2 adds r0, r5 movs r1, 0x3 strb r1, [r0] ldr r1, [r4] adds r1, 0xF4 add r1, r8 ldrb r0, [r1] movs r2, 0xFF orrs r0, r2 strb r0, [r1] ldr r1, [r4] adds r1, 0xF5 add r1, r8 ldrb r0, [r1] orrs r0, r2 strb r0, [r1] @08026602: mov r0, r10 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r4, [sp, 0x4] cmp r10, r4 bcs @08026614 b @08026450 @08026614: add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8026324 thumb_func_start sub_8026634 sub_8026634: ; 8026634 push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 lsrs r3, r1, 24 lsls r2, 24 lsrs r6, r2, 24 movs r7, 0 ldr r2, =0x02022c98 ldr r1, [r2] adds r0, r1, 0 adds r0, 0x24 ldrb r0, [r0] subs r0, 0x1 lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x000032e0 adds r1, r0 mov r12, r2 cmp r3, 0x2 beq @08026670 cmp r3, 0x2 bgt @08026676 cmp r3, 0x1 beq @08026674 b @08026676 .align 2, 0 .pool @08026670: movs r7, 0x1 b @08026676 @08026674: movs r7, 0x2 @08026676: adds r0, r1, 0 adds r0, 0xB adds r0, r6 ldrb r0, [r0] subs r0, 0x6 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @080266D4 ldr r0, =gUnknown_082F45AF lsls r1, r4, 1 adds r1, r4 adds r1, r7, r1 lsls r2, r5, 4 subs r2, r5 adds r1, r2 adds r1, r0 ldrb r1, [r1] cmp r6, r1 bne @0802670A mov r0, r12 ldr r1, [r0] adds r0, r1, 0 adds r0, 0xC4 adds r0, r6 ldrb r0, [r0] subs r0, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @080266D0 lsls r0, r4, 4 subs r0, r4 lsls r0, 2 adds r0, r1, r0 ldr r1, =0x000031d4 adds r0, r1 movs r1, 0x1 strb r1, [r0] b @0802670A .align 2, 0 .pool @080266D0: movs r0, 0x1 b @0802670C @080266D4: ldr r0, =gUnknown_082F45AF lsls r1, r4, 1 adds r1, r4 adds r1, r7, r1 lsls r2, r5, 4 subs r2, r5 adds r1, r2 adds r1, r0 ldrb r1, [r1] cmp r6, r1 bne @0802670A mov r1, r12 ldr r0, [r1] adds r0, 0xA8 adds r0, r4 movs r1, 0x4 strb r1, [r0] mov r0, r12 ldr r1, [r0] lsls r0, r4, 4 subs r0, r4 lsls r0, 2 adds r1, r0 ldr r0, =0x000031d4 adds r1, r0 movs r0, 0x1 strb r0, [r1] @0802670A: movs r0, 0 @0802670C: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8026634 thumb_func_start sub_802671C sub_802671C: ; 802671C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r2, =0x02022c98 ldr r4, [r2] adds r0, r4, 0 adds r0, 0x44 ldrb r1, [r0] adds r0, 0x4 ldrb r0, [r0] mov r9, r0 movs r3, 0 mov r10, r3 movs r5, 0x90 lsls r5, 1 adds r0, r4, r5 str r3, [r0] adds r5, r1, 0 mov r0, r9 subs r0, 0x1 cmp r5, r0 blt @0802674E b @08026974 @0802674E: mov r8, r2 @08026750: mov r0, r8 ldr r4, [r0] adds r0, r4, 0 adds r0, 0xC4 adds r0, r5 ldrb r0, [r0] cmp r0, 0x1 bls @08026762 b @0802686C @08026762: movs r1, 0x90 lsls r1, 1 adds r0, r4, r1 movs r2, 0x1 str r2, [r0] ldr r1, =0x000032eb adds r0, r4, r1 adds r6, r0, r5 ldrb r0, [r6] cmp r0, 0x9 bls @080267FC movs r7, 0 movs r0, 0xA strb r0, [r6] mov r1, r8 ldr r0, [r1] adds r0, 0xC4 adds r0, r5 movs r1, 0x3 strb r1, [r0] mov r1, r8 ldr r0, [r1] movs r6, 0xA4 lsls r6, 1 adds r0, r6 adds r1, r0, r5 ldrb r0, [r1] cmp r0, 0 bne @080267AC strb r2, [r1] ldr r2, =0x000032e0 adds r0, r4, r2 adds r0, r5 ldrb r0, [r0] adds r0, 0x4A bl audio_play @080267AC: mov r0, r8 ldr r1, [r0] adds r0, r1, 0 adds r0, 0x40 ldrb r0, [r0] cmp r0, 0x9 bls @080267C2 mov r2, r10 cmp r2, 0x1 beq @080267C2 b @08026964 @080267C2: movs r0, 0x1 mov r10, r0 adds r0, r1, r6 adds r0, r5 strb r7, [r0] mov r1, r8 ldr r0, [r1] adds r1, r0, 0 adds r1, 0x40 ldrb r0, [r1] cmp r0, 0x9 bhi @080267DE adds r0, 0x1 strb r0, [r1] @080267DE: movs r0, 0x3 adds r1, r5, 0 movs r2, 0 bl sub_8026F1C movs r0, 0 bl sub_8027234 b @08026964 .align 2, 0 .pool @080267FC: adds r0, r5, 0 bl sub_8026D8C mov r2, r8 ldr r7, [r2] lsls r0, 24 lsrs r0, 24 adds r1, r7, 0 adds r1, 0x90 adds r1, r0 ldrb r0, [r1] movs r1, 0x7 bl __udivsi3 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x1 bls @08026822 movs r3, 0x2 @08026822: ldr r2, =gUnknown_082F7A88 ldr r0, =0x000032e0 adds r1, r4, r0 adds r1, r5 lsls r0, r3, 1 adds r0, r3 ldrb r1, [r1] adds r0, r1 adds r0, r2 ldrb r2, [r0] adds r1, r7, 0 adds r1, 0xD0 adds r1, r5 ldrb r0, [r1] adds r0, 0x1 movs r3, 0 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, r2 bcc @0802685C ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] mov r1, r8 ldr r0, [r1] adds r0, 0xD0 adds r0, r5 strb r3, [r0] @0802685C: bl sub_8026324 b @08026964 .align 2, 0 .pool @0802686C: cmp r0, 0x2 bne @080268F4 movs r2, 0x90 lsls r2, 1 adds r0, r4, r2 movs r6, 0x1 str r6, [r0] adds r1, r4, 0 adds r1, 0xDC adds r1, r5 ldrb r0, [r1] adds r0, 0x1 movs r3, 0 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x13 bls @08026964 mov r0, r8 ldr r2, [r0] adds r0, r2, 0 adds r0, 0xB8 adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r2, r0 ldr r1, =0x000031d0 adds r2, r1 strb r3, [r2] mov r2, r8 ldr r0, [r2] adds r0, 0xDC adds r0, r5 strb r3, [r0] ldr r0, [r2] adds r0, 0xD0 adds r0, r5 strb r3, [r0] ldr r0, [r2] adds r0, 0xC4 adds r0, r5 strb r3, [r0] ldr r1, =0x000032eb adds r0, r4, r1 adds r0, r5 strb r6, [r0] adds r0, r5, 0 bl sub_8026D8C lsls r0, 24 lsrs r0, 24 adds r1, r5, 0 bl sub_8026DB0 ldr r2, =0x000032e0 adds r1, r4, r2 adds r1, r5 strb r0, [r1] b @08026964 .align 2, 0 .pool @080268F4: cmp r0, 0x3 bne @08026964 adds r1, r4, 0 adds r1, 0xDC adds r1, r5 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x13 bls @08026964 mov r0, r8 ldr r1, [r0] adds r0, r1, 0 adds r0, 0x40 ldrb r0, [r0] cmp r0, 0x9 bhi @08026964 adds r0, r1, 0 adds r0, 0xDC adds r0, r5 strb r2, [r0] mov r1, r8 ldr r0, [r1] adds r0, 0xD0 adds r0, r5 strb r2, [r0] ldr r0, [r1] adds r0, 0xC4 adds r0, r5 strb r2, [r0] ldr r2, =0x000032eb adds r0, r4, r2 adds r0, r5 movs r1, 0x1 strb r1, [r0] mov r0, r8 ldr r1, [r0] adds r1, 0xE8 adds r1, r5 subs r2, 0xB adds r4, r2 adds r4, r5 ldrb r0, [r4] strb r0, [r1] adds r0, r5, 0 bl sub_8026D8C lsls r0, 24 lsrs r0, 24 adds r1, r5, 0 bl sub_8026DB0 strb r0, [r4] @08026964: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 mov r0, r9 subs r0, 0x1 cmp r5, r0 bge @08026974 b @08026750 @08026974: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802671C thumb_func_start sub_8026988 sub_8026988: ; 8026988 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x02022c98 ldr r0, [r0] adds r1, r0, 0 adds r1, 0x44 adds r0, 0x48 ldrb r0, [r0] mov r8, r0 ldrb r6, [r1] cmp r6, r8 bcs @08026A7A ldr r0, =gUnknown_082F449C mov r9, r0 @080269A8: ldr r0, =0x02022c98 ldr r3, [r0] adds r0, r3, 0 adds r0, 0x28 ldrb r1, [r0] lsls r0, r1, 4 subs r0, r1 lsls r0, 2 ldr r2, =0x000031a0 adds r0, r2 adds r7, r3, r0 movs r0, 0xB adds r2, r1, 0 muls r2, r0 adds r2, r6, r2 adds r3, 0x24 ldrb r1, [r3] subs r1, 0x1 lsls r0, r1, 3 subs r0, r1 lsls r0, 3 subs r0, r1 adds r2, r0 add r2, r9 ldrb r4, [r2] adds r0, r7, 0 adds r0, 0x1F adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @080269FC adds r0, r6, 0 movs r1, 0 bl sub_8028BF8 b @08026A04 .align 2, 0 .pool @080269FC: adds r0, r6, 0 movs r1, 0x1 bl sub_8028BF8 @08026A04: adds r0, r7, 0 adds r0, 0x1F adds r5, r0, r4 ldrb r0, [r5] cmp r0, 0x9 bls @08026A30 adds r0, r7, 0 adds r0, 0x14 adds r0, r4 ldrb r1, [r0] adds r1, 0x3 lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 bl sub_8028CA4 ldrb r1, [r5] lsls r1, 25 movs r0, 0xFF lsls r0, 24 adds r1, r0 b @08026A52 @08026A30: adds r0, r7, 0 adds r0, 0x14 adds r3, r0, r4 ldrb r0, [r3] cmp r0, 0x3 bne @08026A5C movs r0, 0x7 strb r0, [r5] adds r0, r6, 0 movs r1, 0x6 bl sub_8028CA4 ldrb r1, [r5] lsls r1, 25 movs r2, 0xFF lsls r2, 24 adds r1, r2 @08026A52: lsrs r1, 24 adds r0, r6, 0 bl sub_8028C7C b @08026A70 @08026A5C: ldrb r1, [r3] adds r0, r6, 0 bl sub_8028CA4 ldrb r1, [r5] lsls r1, 25 lsrs r1, 24 adds r0, r6, 0 bl sub_8028C7C @08026A70: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, r8 bcc @080269A8 @08026A7A: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8026988 thumb_func_start sub_8026A88 sub_8026A88: ; 8026A88 push {r4-r6,lr} ldr r1, =0x02022c98 ldr r0, [r1] adds r0, 0x24 ldrb r5, [r0] movs r4, 0 cmp r4, r5 bcs @08026ABA adds r6, r1, 0 @08026A9A: lsls r0, r4, 4 subs r0, r4 lsls r0, 2 ldr r1, [r6] adds r0, r1 ldr r1, =0x000031cc adds r0, r1 ldrb r1, [r0] adds r0, r4, 0 bl sub_80286B4 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @08026A9A @08026ABA: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8026A88 thumb_func_start sub_8026AC8 sub_8026AC8: ; 8026AC8 push {r4,r5,lr} ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x24 ldrb r5, [r0] movs r4, 0 cmp r4, r5 bcs @08026AEA @08026AD8: adds r0, r4, 0 movs r1, 0x4 bl sub_80286B4 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @08026AD8 @08026AEA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8026AC8 thumb_func_start sub_8026AF4 sub_8026AF4: ; 8026AF4 push {lr} bl sub_8026988 ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x40 ldrb r0, [r0] cmp r0, 0x9 bls @08026B10 bl sub_8026AC8 b @08026B14 .align 2, 0 .pool @08026B10: bl sub_8026A88 @08026B14: ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x40 ldrb r0, [r0] bl sub_80288D4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8026AF4 thumb_func_start sub_8026B28 sub_8026B28: ; 8026B28 push {lr} bl sub_8026988 ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x40 ldrb r0, [r0] cmp r0, 0x9 bls @08026B44 bl sub_8026AC8 b @08026B48 .align 2, 0 .pool @08026B44: bl sub_8026A88 @08026B48: ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x40 ldrb r0, [r0] bl sub_80288D4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8026B28 thumb_func_start sub_8026B5C sub_8026B5C: ; 8026B5C push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r0, 24 subs r0, 0x1 cmp r0, 0x4 bhi @08026BB4 lsls r0, 2 ldr r1, =@08026B78 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08026B78: .4byte @08026B8C .4byte @08026B94 .4byte @08026B9C .4byte @08026BA4 .4byte @08026BAC @08026B8C: movs r0, 0x4 strb r0, [r3] movs r0, 0x7 b @08026BB2 @08026B94: movs r0, 0x3 strb r0, [r3] movs r0, 0x8 b @08026BB2 @08026B9C: movs r0, 0x2 strb r0, [r3] movs r0, 0x9 b @08026BB2 @08026BA4: movs r0, 0x1 strb r0, [r3] movs r0, 0xA b @08026BB2 @08026BAC: movs r0, 0 strb r0, [r3] movs r0, 0xB @08026BB2: strb r0, [r2] @08026BB4: pop {r0} bx r0 thumb_func_end sub_8026B5C thumb_func_start sub_8026BB8 sub_8026BB8: ; 8026BB8 push {r4-r6,lr} ldr r1, =0x02022c98 ldr r0, [r1] adds r0, 0x24 ldrb r5, [r0] movs r4, 0x1 cmp r4, r5 bcs @08026C1E adds r6, r1, 0 @08026BCA: ldr r0, [r6] movs r1, 0xAC lsls r1, 1 adds r0, r1 adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @08026BEC adds r0, r4, 0 bl sub_8027DFC ldr r1, [r6] movs r2, 0xAC lsls r2, 1 adds r1, r2 adds r1, r4 strb r0, [r1] @08026BEC: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @08026BCA cmp r4, r5 bcs @08026C1E ldr r0, =0x02022c98 ldr r0, [r0] movs r2, 0xAC lsls r2, 1 adds r1, r0, r2 @08026C04: adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0 bne @08026C14 movs r0, 0 b @08026C20 .align 2, 0 .pool @08026C14: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @08026C04 @08026C1E: movs r0, 0x1 @08026C20: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8026BB8 thumb_func_start sub_8026C28 sub_8026C28: ; 8026C28 push {r4,lr} movs r1, 0 ldr r4, =0x02022c98 movs r3, 0xAC lsls r3, 1 movs r2, 0 @08026C34: ldr r0, [r4] adds r0, r3 adds r0, r1 strb r2, [r0] adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x4 bls @08026C34 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8026C28 thumb_func_start sub_8026C50 sub_8026C50: ; 8026C50 push {r4,lr} ldr r3, =0x02022c98 ldr r1, [r3] adds r2, r1, 0 adds r2, 0x40 ldrb r0, [r2] cmp r0, 0x9 bls @08026C88 movs r4, 0x90 lsls r4, 1 adds r0, r1, r4 ldr r0, [r0] cmp r0, 0 bne @08026C88 movs r0, 0xA strb r0, [r2] ldr r0, [r3] movs r1, 0x96 lsls r1, 1 adds r0, r1 ldr r0, [r0] cmp r0, 0 beq @08026C88 movs r0, 0x1 b @08026C8A .align 2, 0 .pool @08026C88: movs r0, 0 @08026C8A: pop {r4} pop {r1} bx r1 thumb_func_end sub_8026C50 thumb_func_start sub_8026C90 sub_8026C90: ; 8026C90 push {r4-r6,lr} ldr r4, =0x02022c98 ldr r1, [r4] adds r2, r1, 0 adds r2, 0x40 ldrb r0, [r2] cmp r0, 0x9 bls @08026D14 adds r0, r1, 0 adds r0, 0x44 ldrb r3, [r0] adds r0, 0x4 ldrb r5, [r0] movs r0, 0xA strb r0, [r2] ldr r4, [r4] mov r12, r4 movs r0, 0x96 lsls r0, 1 add r0, r12 ldr r0, [r0] cmp r0, 0 beq @08026D14 adds r4, r3, 0 cmp r4, r5 bcs @08026D04 mov r0, r12 adds r0, 0x28 ldrb r3, [r0] lsls r1, r3, 4 subs r1, r3 lsls r1, 2 ldr r6, =gUnknown_082F449C subs r0, 0x4 ldrb r2, [r0] subs r2, 0x1 add r1, r12 movs r0, 0xB muls r3, r0 lsls r0, r2, 3 subs r0, r2 lsls r0, 3 subs r2, r0, r2 ldr r0, =0x000031bf adds r1, r0 @08026CEA: adds r0, r4, r3 adds r0, r2 adds r0, r6 ldrb r0, [r0] adds r0, r1, r0 ldrb r0, [r0] cmp r0, 0xA bne @08026D14 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @08026CEA @08026D04: movs r0, 0x1 b @08026D16 .align 2, 0 .pool @08026D14: movs r0, 0 @08026D16: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8026C90 thumb_func_start sub_8026D1C sub_8026D1C: ; 8026D1C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r0, =gUnknown_082F7A9C mov r8, r0 ldr r0, =0x02022c98 ldr r6, [r0] adds r0, r6, 0 adds r0, 0x90 adds r0, r5 mov r9, r0 ldrb r7, [r0] adds r0, r7, 0 movs r1, 0x7 bl __umodsi3 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 add r4, r8 adds r0, r7, 0 movs r1, 0x7 bl __udivsi3 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r0, r1 ldrb r4, [r4] adds r0, r4 lsls r0, 24 lsls r5, 1 adds r6, 0x86 adds r6, r5 ldrh r1, [r6] lsrs r0, 24 cmp r1, r0 bcc @08026D76 adds r0, r7, 0x1 mov r1, r9 strb r0, [r1] @08026D76: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8026D1C thumb_func_start sub_8026D8C sub_8026D8C: ; 8026D8C lsls r0, 24 lsrs r0, 24 ldr r3, =gUnknown_082F4648 ldr r1, =0x02022c98 ldr r1, [r1] adds r1, 0x24 ldrb r1, [r1] subs r1, 0x1 movs r2, 0xB muls r1, r2 adds r0, r1 adds r0, r3 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8026D8C thumb_func_start sub_8026DB0 sub_8026DB0: ; 8026DB0 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r5, r1, 24 ldr r4, =0x02022c98 ldr r1, [r4] adds r1, 0x24 ldrb r2, [r1] subs r2, 0x1 lsls r2, 24 lsrs r2, 24 ldr r3, =gUnknown_082F45FA lsls r1, r0, 1 adds r1, r0 lsls r0, r2, 4 subs r0, r2 adds r1, r0 adds r0, r1, r3 ldrb r0, [r0] mov r12, r0 adds r0, r3, 0x1 adds r0, r1, r0 ldrb r7, [r0] adds r3, 0x2 adds r1, r3 ldrb r1, [r1] mov r8, r1 movs r3, 0 ldr r1, =gUnknown_082F467F lsls r0, r2, 2 adds r2, r0, r2 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0 beq @08026E18 adds r6, r1, 0 @08026DFE: adds r0, r3, r2 adds r0, r6 ldrb r0, [r0] cmp r5, r0 beq @08026E3C adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 adds r0, r3, r2 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @08026DFE @08026E18: ldr r0, [r4] adds r0, 0x90 mov r1, r12 adds r2, r0, r1 adds r1, r0, r7 ldrb r0, [r2] ldrb r3, [r1] cmp r0, r3 bls @08026E46 adds r1, r0, 0 b @08026E48 .align 2, 0 .pool @08026E3C: ldr r0, [r4] adds r0, 0x90 adds r0, r7 ldrb r0, [r0] b @08026E5A @08026E46: ldrb r1, [r1] @08026E48: ldr r0, [r4] adds r0, 0x90 mov r2, r8 adds r4, r0, r2 ldrb r0, [r4] cmp r0, r1 bls @08026E58 adds r1, r0, 0 @08026E58: adds r0, r1, 0 @08026E5A: adds r1, r5, 0 bl sub_8026E70 lsls r0, 24 lsrs r0, 24 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8026DB0 thumb_func_start sub_8026E70 sub_8026E70: ; 8026E70 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 ldr r2, =0x02022c98 ldr r2, [r2] adds r2, 0xE8 adds r2, r1 ldrb r4, [r2] movs r1, 0x7 bl __umodsi3 lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 bhi @08026EDE lsls r0, 2 ldr r1, =@08026EA4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08026EA4: .4byte @08026EDE .4byte @08026ED6 .4byte @08026EE2 .4byte @08026EC0 .4byte @08026EC6 .4byte @08026ECC .4byte @08026ED2 @08026EC0: cmp r4, 0 beq @08026ED6 b @08026EDE @08026EC6: cmp r4, 0 beq @08026EE2 b @08026EDE @08026ECC: cmp r4, 0x2 beq @08026ED6 b @08026EE2 @08026ED2: cmp r4, 0 bne @08026EDA @08026ED6: movs r0, 0x1 b @08026EE4 @08026EDA: cmp r4, 0x1 beq @08026EE2 @08026EDE: movs r0, 0 b @08026EE4 @08026EE2: movs r0, 0x2 @08026EE4: pop {r4} pop {r1} bx r1 thumb_func_end sub_8026E70 thumb_func_start sub_8026EEC sub_8026EEC: ; 8026EEC push {r4-r6,lr} movs r6, 0 movs r5, 0 adds r4, r0, 0 b @08026EFE @08026EF6: ldrh r0, [r4, 0x6] adds r6, r0 adds r4, 0xC adds r5, 0x1 @08026EFE: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 blt @08026EF6 cmp r6, 0xA bgt @08026F12 movs r0, 0 b @08026F14 @08026F12: movs r0, 0x1 @08026F14: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8026EEC thumb_func_start sub_8026F1C sub_8026F1C: ; 8026F1C push {r4-r6,lr} lsls r0, 24 lsrs r3, r0, 24 lsls r1, 24 lsrs r4, r1, 24 lsls r2, 24 lsrs r2, 24 ldr r6, =0x02022c98 ldr r1, [r6] adds r0, r1, 0 adds r0, 0x24 ldrb r5, [r0] cmp r3, 0 bge @08026F3A b @0802722C @08026F3A: cmp r3, 0x2 ble @08026F48 cmp r3, 0x3 beq @08026F78 b @0802722C .align 2, 0 .pool @08026F48: ldr r3, =0x000031b4 adds r0, r1, r3 adds r0, r4 ldrb r4, [r0] lsls r4, 1 lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r4, r0 adds r0, r1, 0 adds r0, 0x4A adds r0, r4 ldrh r0, [r0] ldr r1, =0x00004e20 bl sub_8027A28 ldr r1, [r6] adds r1, 0x4A adds r1, r4 b @0802722A .align 2, 0 .pool @08026F78: adds r0, r1, 0 adds r0, 0x4A bl sub_8026EEC cmp r0, 0 beq @08026F86 b @0802722C @08026F86: cmp r5, 0x3 bne @08026F8C b @08027154 @08026F8C: cmp r5, 0x3 bgt @08026F98 cmp r5, 0x2 bne @08026F96 b @080271E8 @08026F96: b @0802722C @08026F98: cmp r5, 0x4 bne @08026F9E b @08027090 @08026F9E: cmp r5, 0x5 beq @08026FA4 b @0802722C @08026FA4: cmp r4, 0x9 bls @08026FAA b @0802722C @08026FAA: lsls r0, r4, 2 ldr r1, =@08026FB8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08026FB8: .4byte @08026FE0 .4byte @08026FF8 .4byte @08027004 .4byte @0802701C .4byte @08027028 .4byte @08027040 .4byte @0802704C .4byte @08027060 .4byte @0802706C .4byte @08027084 @08026FE0: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x68 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] adds r1, 0x74 b @08027226 .align 2, 0 .pool @08026FF8: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x74 b @08027226 .align 2, 0 .pool @08027004: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x74 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] adds r1, 0x80 b @08027226 .align 2, 0 .pool @0802701C: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x80 b @08027226 .align 2, 0 .pool @08027028: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x80 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] adds r1, 0x50 b @08027226 .align 2, 0 .pool @08027040: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x50 b @08027226 .align 2, 0 .pool @0802704C: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x50 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] b @08027224 .align 2, 0 .pool @08027060: ldr r0, =0x02022c98 ldr r1, [r0] b @08027224 .align 2, 0 .pool @0802706C: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x5C ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] adds r1, 0x68 b @08027226 .align 2, 0 .pool @08027084: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x68 b @08027226 .align 2, 0 .pool @08027090: subs r0, r4, 0x1 cmp r0, 0x7 bls @08027098 b @0802722C @08027098: lsls r0, 2 ldr r1, =@080270A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080270A8: .4byte @080270C8 .4byte @080270E0 .4byte @080270EC .4byte @08027104 .4byte @08027110 .4byte @08027124 .4byte @08027130 .4byte @08027148 @080270C8: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x68 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] adds r1, 0x74 b @08027226 .align 2, 0 .pool @080270E0: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x74 b @08027226 .align 2, 0 .pool @080270EC: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x74 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] adds r1, 0x50 b @08027226 .align 2, 0 .pool @08027104: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x50 b @08027226 .align 2, 0 .pool @08027110: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x50 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] b @08027224 .align 2, 0 .pool @08027124: ldr r0, =0x02022c98 ldr r1, [r0] b @08027224 .align 2, 0 .pool @08027130: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x5C ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] adds r1, 0x68 b @08027226 .align 2, 0 .pool @08027148: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x68 b @08027226 .align 2, 0 .pool @08027154: subs r0, r4, 0x2 cmp r0, 0x5 bhi @0802722C lsls r0, 2 ldr r1, =@08027168 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08027168: .4byte @08027180 .4byte @08027198 .4byte @080271A4 .4byte @080271BC .4byte @080271C8 .4byte @080271DC @08027180: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x5C ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] adds r1, 0x68 b @08027226 .align 2, 0 .pool @08027198: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x68 b @08027226 .align 2, 0 .pool @080271A4: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x68 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] adds r1, 0x50 b @08027226 .align 2, 0 .pool @080271BC: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x50 b @08027226 .align 2, 0 .pool @080271C8: ldr r0, =0x02022c98 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x50 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] b @08027224 .align 2, 0 .pool @080271DC: ldr r0, =0x02022c98 ldr r1, [r0] b @08027224 .align 2, 0 .pool @080271E8: cmp r4, 0x4 beq @0802720E cmp r4, 0x4 bgt @080271F6 cmp r4, 0x3 beq @08027200 b @0802722C @080271F6: cmp r4, 0x5 beq @08027214 cmp r4, 0x6 beq @08027222 b @0802722C @08027200: ldr r1, [r6] adds r2, r1, 0 adds r2, 0x50 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] b @08027224 @0802720E: ldr r1, [r6] adds r1, 0x50 b @08027226 @08027214: ldr r1, [r6] adds r2, r1, 0 adds r2, 0x50 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] b @08027224 @08027222: ldr r1, [r6] @08027224: adds r1, 0x5C @08027226: ldrh r0, [r1] adds r0, 0x1 @0802722A: strh r0, [r1] @0802722C: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8026F1C thumb_func_start sub_8027234 sub_8027234: ; 8027234 push {r4,r5,lr} adds r1, r0, 0 ldr r4, =0x02022c98 ldr r3, [r4] adds r0, r3, 0 adds r0, 0x24 ldrb r0, [r0] cmp r0, 0x5 bne @0802729E cmp r1, 0x1 bne @08027280 movs r5, 0x89 lsls r5, 1 adds r1, r3, r5 ldrh r0, [r1] adds r2, r0, 0x1 strh r2, [r1] movs r0, 0x8A lsls r0, 1 adds r1, r3, r0 lsls r0, r2, 16 lsrs r0, 16 ldrh r3, [r1] cmp r0, r3 bls @08027268 strh r2, [r1] @08027268: ldr r0, [r4] adds r2, r0, r5 ldrh r0, [r2] ldr r1, =0x0000270f cmp r0, r1 bls @0802729E strh r1, [r2] b @0802729E .align 2, 0 .pool @08027280: movs r2, 0x89 lsls r2, 1 adds r0, r3, r2 movs r5, 0x8A lsls r5, 1 adds r1, r3, r5 ldrh r0, [r0] ldrh r3, [r1] cmp r0, r3 bls @08027296 strh r0, [r1] @08027296: ldr r0, [r4] adds r0, r2 movs r1, 0 strh r1, [r0] @0802729E: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8027234 thumb_func_start sub_80272A4 sub_80272A4: ; 80272A4 push {r4,r5,lr} movs r3, 0 ldr r2, =0x02022c98 ldr r0, [r2] adds r0, 0x24 ldrb r0, [r0] cmp r3, r0 bcs @080272DC adds r5, r2, 0 movs r4, 0x8A lsls r4, 1 @080272BA: ldr r2, [r5] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r1, r2, 0 adds r1, 0x54 adds r1, r0 adds r0, r2, r4 ldrh r0, [r0] strh r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 adds r2, 0x24 ldrb r2, [r2] cmp r3, r2 bcc @080272BA @080272DC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80272A4 thumb_func_start sub_80272E8 sub_80272E8: ; 80272E8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r5, 0 ldr r7, =0x02022c98 movs r4, 0 ldr r0, =0x000031bf mov r10, r0 @080272FC: movs r2, 0 lsls r6, r5, 4 lsls r1, r5, 1 mov r8, r1 lsls r0, r5, 3 mov r12, r0 adds r1, r5, 0x1 mov r9, r1 subs r0, r6, r5 lsls r3, r0, 2 @08027310: ldr r0, [r7] adds r1, r2, r3 add r0, r10 adds r0, r1 strb r4, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xA bls @08027310 ldr r0, [r7] subs r1, r6, r5 lsls r1, 2 adds r0, r1 ldr r2, =0x000031cc adds r0, r2 strb r4, [r0] ldr r0, [r7] adds r0, r1 ldr r1, =0x000031d0 adds r0, r1 strb r4, [r0] ldr r0, [r7] adds r0, 0x90 adds r0, r5 strb r4, [r0] ldr r1, [r7] adds r0, r1, 0 adds r0, 0x86 add r0, r8 strh r4, [r0] add r1, r12 ldr r2, =0x00003308 adds r1, r2 strb r4, [r1] ldr r2, [r7] ldr r1, =0x0000330c adds r0, r2, r1 add r0, r12 str r4, [r0] mov r0, r8 adds r1, r0, r5 lsls r1, 2 adds r0, r2, 0 adds r0, 0x4A adds r0, r1 strh r4, [r0] adds r0, r2, 0 adds r0, 0x4C adds r0, r1 strh r4, [r0] adds r0, r2, 0 adds r0, 0x4E adds r0, r1 strh r4, [r0] adds r0, r2, 0 adds r0, 0x50 adds r0, r1 strh r4, [r0] adds r0, r2, 0 adds r0, 0x52 adds r0, r1 strh r4, [r0] adds r0, r2, 0 adds r0, 0x54 adds r0, r1 strh r4, [r0] mov r1, r9 lsls r0, r1, 24 lsrs r5, r0, 24 cmp r5, 0x4 bls @080272FC ldr r2, =0x02022c98 ldr r0, [r2] movs r1, 0xAA lsls r1, 1 adds r0, r1 movs r2, 0 strb r2, [r0] ldr r1, =0x02022c98 ldr r0, [r1] movs r1, 0x89 lsls r1, 1 adds r3, r0, r1 movs r1, 0 strh r2, [r3] adds r0, 0x40 strb r1, [r0] bl sub_8026A88 bl sub_8026988 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80272E8 thumb_func_start sub_80273F0 sub_80273F0: ; 80273F0 push {r4,r5,lr} movs r4, 0 ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x24 ldrb r0, [r0] cmp r0, 0x4 beq @0802740C cmp r0, 0x5 beq @08027410 b @08027412 .align 2, 0 .pool @0802740C: movs r4, 0x1 b @08027412 @08027410: movs r4, 0x2 @08027412: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xA bl __umodsi3 lsls r0, 24 lsrs r0, 24 movs r3, 0 lsls r1, r4, 2 ldr r5, =0x02022c98 ldr r2, =gUnknown_082F7AA4 adds r1, r4 lsls r1, 1 adds r0, r1 adds r0, r2 ldrb r2, [r0] @08027436: ldr r1, [r5] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r1, 0x52 adds r1, r0 strh r2, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x4 bls @08027436 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80273F0 thumb_func_start sub_802745C sub_802745C: ; 802745C push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022c98 ldr r2, [r1] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r0, r2, 0 adds r0, 0x4A adds r0, r1 ldrh r3, [r0] adds r0, r2, 0 adds r0, 0x4C adds r0, r1 ldrh r0, [r0] adds r2, 0x4E adds r2, r1 adds r3, r0 ldrh r2, [r2] adds r0, r3, r2 ldr r1, =0x0000270f cmp r0, r1 bls @0802748E adds r0, r1, 0 @0802748E: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802745C thumb_func_start sub_802749C sub_802749C: ; 802749C push {r4-r6,lr} ldr r5, =0x02022c98 ldr r0, [r5] adds r0, 0x28 ldrb r0, [r0] bl sub_802745C ldr r1, =0x0000270f bl sub_8027A38 adds r4, r0, 0 ldr r0, [r5] adds r0, 0x28 ldrb r0, [r0] bl sub_80276C0 ldr r1, =0x000f4236 bl sub_8027A38 adds r2, r0, 0 ldr r3, =0x03005d90 ldr r0, [r3] movs r6, 0x83 lsls r6, 2 adds r1, r0, r6 ldr r0, [r1] cmp r0, r2 bcs @080274D6 str r2, [r1] @080274D6: ldr r0, [r3] movs r2, 0x84 lsls r2, 2 adds r1, r0, r2 ldrh r0, [r1] cmp r0, r4 bcs @080274E6 strh r4, [r1] @080274E6: ldr r0, [r3] ldr r6, =0x00000212 adds r2, r0, r6 ldr r0, [r5] movs r1, 0x8A lsls r1, 1 adds r0, r1 ldrh r1, [r0] ldrh r0, [r2] cmp r0, r1 bcs @080274FE strh r1, [r2] @080274FE: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802749C thumb_func_start sub_8027518 sub_8027518: ; 8027518 push {r4-r7,lr} lsls r0, 24 lsrs r7, r0, 24 ldr r1, =0x02022c98 ldr r0, [r1] adds r0, 0x9B ldrb r6, [r0] movs r3, 0x3 adds r5, r1, 0 adds r4, r5, 0 @0802752C: ldr r0, [r4] adds r0, 0x98 adds r2, r0, r3 subs r1, r3, 0x1 adds r0, r1 ldrb r0, [r0] strb r0, [r2] lsls r1, 24 lsrs r3, r1, 24 cmp r3, 0 bne @0802752C ldr r0, [r5] adds r0, 0x98 strb r7, [r0] adds r0, r6, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8027518 thumb_func_start sub_8027554 sub_8027554: ; 8027554 push {r4,lr} ldr r4, =0x02022c98 ldr r3, [r4] adds r0, r3, 0 adds r0, 0x28 ldrb r1, [r0] adds r0, 0x88 adds r2, r0, r1 ldrb r0, [r2] cmp r0, 0 bne @080275FC ldr r0, =0x030022c0 ldrh r2, [r0, 0x2E] movs r0, 0x40 ands r0, r2 cmp r0, 0 beq @08027594 lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r0, r3, r0 ldr r1, =0x000031cc adds r0, r1 movs r1, 0x2 b @080275CA .align 2, 0 .pool @08027594: movs r0, 0x20 ands r0, r2 cmp r0, 0 beq @080275B0 lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r0, r3, r0 ldr r1, =0x000031cc adds r0, r1 movs r1, 0x3 b @080275CA .align 2, 0 .pool @080275B0: movs r0, 0x10 ands r0, r2 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0 beq @080275E8 lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r0, r3, r0 ldr r1, =0x000031cc adds r0, r1 movs r1, 0x1 @080275CA: strb r1, [r0] ldr r0, [r4] adds r1, r0, 0 adds r1, 0x28 adds r0, 0xB0 ldrb r1, [r1] adds r0, r1 movs r1, 0x6 strb r1, [r0] movs r0, 0xD4 bl audio_play b @08027600 .align 2, 0 .pool @080275E8: lsls r0, r1, 4 subs r0, r1 lsls r0, 2 adds r0, r3, r0 ldr r1, =0x000031cc adds r0, r1 strb r2, [r0] b @08027600 .align 2, 0 .pool @080275FC: subs r0, 0x1 strb r0, [r2] @08027600: pop {r4} pop {r0} bx r0 thumb_func_end sub_8027554 thumb_func_start sub_8027608 sub_8027608: ; 8027608 ldr r0, =0x02022c98 ldr r1, [r0] adds r0, r1, 0 adds r0, 0x28 ldrb r2, [r0] lsls r0, r2, 4 subs r0, r2 lsls r0, 2 adds r1, r0 ldr r0, =0x000031cc adds r1, r0 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8027608 thumb_func_start sub_802762C sub_802762C: ; 802762C ldr r0, =0x02022c98 ldr r1, [r0] adds r0, r1, 0 adds r0, 0x28 ldrb r2, [r0] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r1, 0x52 adds r1, r0 ldrh r0, [r1] adds r0, 0x85 lsls r0, 16 lsrs r0, 16 bx lr .align 2, 0 .pool thumb_func_end sub_802762C thumb_func_start sub_8027650 sub_8027650: ; 8027650 ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x24 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8027650 thumb_func_start sub_8027660 sub_8027660: ; 8027660 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0802768C ldr r0, =0x02022c98 lsls r1, r2, 4 subs r1, r2 lsls r1, 2 ldr r2, =0x000031a0 adds r1, r2 ldr r0, [r0] b @08027694 .align 2, 0 .pool @0802768C: lsls r0, r2, 3 subs r0, r2 lsls r0, 2 ldr r1, =0x020229f0 @08027694: adds r0, r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8027660 thumb_func_start sub_80276A0 sub_80276A0: ; 80276A0 lsls r0, 24 lsrs r0, 24 lsls r1, 24 ldr r2, =0x02022c98 ldr r3, [r2] lsrs r1, 23 lsls r2, r0, 1 adds r2, r0 lsls r2, 2 adds r1, r2 adds r3, 0x4A adds r3, r1 ldrh r0, [r3] bx lr .align 2, 0 .pool thumb_func_end sub_80276A0 thumb_func_start sub_80276C0 sub_80276C0: ; 80276C0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 movs r5, 0 movs r3, 0 ldr r0, =0x02022c98 mov r9, r0 ldr r2, =gUnknown_082F7B24 mov r10, r2 ldr r2, [r0] lsls r1, r4, 1 adds r0, r1, r4 lsls r0, 2 str r0, [sp] adds r6, r2, 0 adds r6, 0x4A mov r12, r1 mov r8, r10 @080276EE: lsls r1, r3, 1 ldr r7, [sp] adds r0, r1, r7 adds r0, r6, r0 ldrh r2, [r0] add r1, r8 movs r7, 0 ldrsh r0, [r1, r7] muls r0, r2 adds r5, r0 adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x2 bls @080276EE mov r0, r9 ldr r1, [r0] mov r2, r12 adds r0, r2, r4 lsls r0, 2 adds r1, 0x50 adds r1, r0 ldrh r1, [r1] mov r3, r10 movs r7, 0x6 ldrsh r0, [r3, r7] muls r0, r1 cmp r5, r0 bls @08027734 subs r0, r5, r0 b @08027736 .align 2, 0 .pool @08027734: movs r0, 0 @08027736: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80276C0 thumb_func_start sub_8027748 sub_8027748: ; 8027748 push {r4-r6,lr} ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x24 ldrb r6, [r0] movs r0, 0 bl sub_80276C0 adds r5, r0, 0 movs r4, 0x1 cmp r4, r6 bcs @08027776 @08027760: adds r0, r4, 0 bl sub_80276C0 cmp r0, r5 bls @0802776C adds r5, r0, 0 @0802776C: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r6 bcc @08027760 @08027776: ldr r1, =0x000f4236 adds r0, r5, 0 bl sub_8027A38 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8027748 thumb_func_start sub_802778C sub_802778C: ; 802778C push {r4,r5,lr} lsls r0, 24 ldr r1, =0x02022c98 ldr r2, [r1] adds r1, r2, 0 adds r1, 0x24 ldrb r5, [r1] lsrs r4, r0, 23 adds r2, 0x4A adds r0, r2, r4 ldrh r3, [r0] movs r1, 0 cmp r1, r5 bcs @080277C4 @080277A8: lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r4, r0 adds r0, r2, r0 ldrh r0, [r0] cmp r0, r3 bls @080277BA adds r3, r0, 0 @080277BA: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, r5 bcc @080277A8 @080277C4: adds r0, r3, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802778C thumb_func_start sub_80277D0 sub_80277D0: ; 80277D0 push {r4-r7,lr} sub sp, 0x14 lsls r0, 24 lsrs r7, r0, 24 movs r6, 0x1 ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x24 ldrb r5, [r0] movs r4, 0 cmp r4, r5 bcs @080277FE @080277E8: adds r0, r4, 0 bl sub_80276C0 lsls r1, r4, 2 add r1, sp str r0, [r1] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @080277E8 @080277FE: lsls r7, 2 mov r12, r7 cmp r6, 0 beq @08027838 subs r7, r5, 0x1 @08027808: movs r6, 0 movs r4, 0 cmp r6, r7 bge @08027834 adds r5, r7, 0 @08027812: lsls r0, r4, 2 mov r2, sp adds r1, r2, r0 adds r4, 0x1 lsls r0, r4, 2 adds r3, r2, r0 ldr r0, [r1] ldr r2, [r3] cmp r0, r2 bcs @0802782C str r2, [r1] str r0, [r3] movs r6, 0x1 @0802782C: lsls r0, r4, 24 lsrs r4, r0, 24 cmp r4, r5 blt @08027812 @08027834: cmp r6, 0 bne @08027808 @08027838: mov r0, sp add r0, r12 ldr r0, [r0] add sp, 0x14 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80277D0 thumb_func_start sub_802784C sub_802784C: ; 802784C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r0, 0 mov r10, r0 mov r8, r0 mov r9, r0 ldr r6, =0x02022c98 ldr r0, [r6] adds r0, 0x24 ldrb r5, [r0] bl sub_8027748 bl sub_8027748 cmp r0, 0 bne @080278A0 movs r4, 0 cmp r9, r5 bcs @080278A0 adds r2, r6, 0 ldr r1, =0x00003308 mov r12, r1 movs r7, 0 movs r6, 0x4 ldr r3, =0x0000330c @08027884: ldr r0, [r2] lsls r1, r4, 3 adds r0, r1 add r0, r12 strb r6, [r0] ldr r0, [r2] adds r0, r3 adds r0, r1 str r7, [r0] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @08027884 @080278A0: movs r4, 0 cmp r4, r5 bcs @080278CA @080278A6: adds r0, r4, 0 bl sub_80276C0 ldr r1, =0x000f4236 bl sub_8027A38 ldr r1, =0x02022c98 ldr r1, [r1] lsls r2, r4, 3 ldr r3, =0x0000330c adds r1, r3 adds r1, r2 str r0, [r1] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @080278A6 @080278CA: mov r0, r10 bl sub_80277D0 adds r6, r0, 0 mov r3, r8 movs r4, 0 cmp r4, r5 bcs @08027916 ldr r7, =0x02022c98 mov r10, r7 @080278DE: mov r0, r10 ldr r2, [r0] lsls r1, r4, 3 ldr r7, =0x0000330c adds r0, r2, r7 adds r0, r1 ldr r0, [r0] cmp r6, r0 bne @0802790C adds r0, r2, r1 ldr r1, =0x00003308 adds r0, r1 strb r3, [r0] mov r0, r8 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r8, r0 mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @0802790C: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @080278DE @08027916: mov r10, r8 cmp r9, r5 bcc @080278CA movs r0, 0 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802784C thumb_func_start sub_802793C sub_802793C: ; 802793C lsls r1, 24 ldr r2, =0x02022c98 ldr r2, [r2] lsrs r1, 21 ldr r3, =0x00003308 adds r2, r3 adds r2, r1 ldr r1, [r2] ldr r2, [r2, 0x4] str r1, [r0] str r2, [r0, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_802793C thumb_func_start sub_802795C sub_802795C: ; 802795C push {r4-r7,lr} sub sp, 0x14 lsls r0, 24 lsrs r6, r0, 24 movs r7, 0 ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x24 ldrb r5, [r0] mov r0, sp movs r1, 0 movs r2, 0x14 bl memset movs r4, 0 cmp r7, r5 bcs @08027994 @0802797E: adds r0, r4, 0 bl sub_80276C0 lsls r1, r4, 2 add r1, sp str r0, [r1] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @0802797E @08027994: lsls r0, r6, 2 add r0, sp ldr r1, [r0] movs r4, 0 @0802799C: cmp r4, r6 beq @080279B0 lsls r0, r4, 2 add r0, sp ldr r0, [r0] cmp r1, r0 bcs @080279B0 adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 @080279B0: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x4 bls @0802799C adds r0, r7, 0 add sp, 0x14 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802795C thumb_func_start sub_80279C8 sub_80279C8: ; 80279C8 push {r4-r6,lr} ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x28 ldrb r4, [r0] bl sub_802762C lsls r0, 16 lsrs r5, r0, 16 adds r6, r5, 0 adds r0, r4, 0 bl sub_80276C0 adds r4, r0, 0 bl sub_8027748 cmp r4, r0 beq @080279F4 movs r0, 0x3 b @08027A22 .align 2, 0 .pool @080279F4: adds r0, r5, 0 movs r1, 0x1 bl sub_80D6800 lsls r0, 24 cmp r0, 0 bne @08027A06 movs r0, 0x2 b @08027A22 @08027A06: adds r0, r6, 0 movs r1, 0x1 bl bag_add_item adds r0, r6, 0 movs r1, 0x1 bl sub_80D6800 lsls r0, 24 cmp r0, 0 beq @08027A20 movs r0, 0 b @08027A22 @08027A20: movs r0, 0x1 @08027A22: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_80279C8 thumb_func_start sub_8027A28 sub_8027A28: ; 8027A28 push {lr} adds r2, r0, 0 adds r0, r1, 0 cmp r2, r0 bcs @08027A34 adds r0, r2, 0x1 @08027A34: pop {r1} bx r1 thumb_func_end sub_8027A28 thumb_func_start sub_8027A38 sub_8027A38: ; 8027A38 push {lr} adds r2, r0, 0 adds r0, r1, 0 cmp r2, r0 bcs @08027A44 adds r0, r2, 0 @08027A44: pop {r1} bx r1 thumb_func_end sub_8027A38 thumb_func_start sub_8027A48 sub_8027A48: ; 8027A48 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022c98 ldr r1, [r1] adds r1, 0x34 adds r1, r0 ldrb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8027A48 thumb_func_start sub_8027A5C sub_8027A5C: ; 8027A5C push {r4-r6,lr} movs r5, 0 ldr r6, =0x020375f0 @08027A62: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 bl pokemon_getattr cmp r0, 0 beq @08027A94 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0x55 bne @08027A94 movs r0, 0x1 strh r0, [r6] b @08027AA0 .align 2, 0 .pool @08027A94: adds r5, 0x1 cmp r5, 0x5 ble @08027A62 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] @08027AA0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8027A5C thumb_func_start sub_8027AAC sub_8027AAC: ; 8027AAC push {r4,lr} ldr r4, =sub_8027ACC adds r0, r4, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 bl _call_via_r4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8027AAC thumb_func_start sub_8027ACC sub_8027ACC: ; 8027ACC push {r4-r7,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e08 adds r7, r0, r1 movs r1, 0 ldrsh r0, [r7, r1] cmp r0, 0x1 beq @08027B94 cmp r0, 0x1 bgt @08027AF4 cmp r0, 0 beq @08027AFE b @08027BE2 .align 2, 0 .pool @08027AF4: cmp r0, 0x2 beq @08027BA0 cmp r0, 0x3 beq @08027BC8 b @08027BE2 @08027AFE: ldr r0, =gUnknown_082F7B2C ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] ldr r1, =gUnknown_085EDCE5 movs r0, 0x1 movs r2, 0 bl font_get_width_of_string adds r4, r0, 0 movs r6, 0 ldr r5, =gUnknown_082F7B34 @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, =0xffff00ff ldr r0, [sp] ands r0, r2 orrs r0, r1 lsls r2, r4, 24 ldr r1, =0x00ffffff ands r0, r1 orrs r0, r2 str r0, [sp] mov r0, sp bl 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 .pool @08027B94: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @08027BE2 b @08027BBA @08027BA0: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @08027BE2 ldrb r0, [r7, 0x2] bl rbox_fill_rectangle ldrb r0, [r7, 0x2] movs r1, 0x1 @08027BB6: bl Window_CopyToVram @08027BBA: ldrh r0, [r7] adds r0, 0x1 strh r0, [r7] b @08027BE2 .align 2, 0 .pool @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, =0x03005d90 ldr r1, [r0] movs r2, 0x84 lsls r2, 2 adds r0, r1, r2 ldrh r0, [r0] str r0, [sp, 0xC] subs r2, 0x4 adds r0, r1, r2 ldr r0, [r0] str r0, [sp, 0x10] ldr r0, =0x00000212 adds r1, r0 ldrh r0, [r1] str r0, [sp, 0x14] ldr r4, =0x0000021d adds r0, r7, 0 adds r1, r4, 0 movs r2, 0xD0 bl box_border_load_tiles_and_pal adds r0, r7, 0 adds r1, r4, 0 movs r2, 0xD bl sub_8098858 adds r0, r7, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r4, =gUnknown_085EDCE5 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, =0x02021cc4 mov r8, r2 movs r0, 0xFF mov r10, r0 mov r9, r6 mov r2, sp adds r2, 0xC str r2, [sp, 0x1C] @08027C76: lsls r4, r6, 2 ldr r0, [sp, 0x1C] ldm r0!, {r1} str r0, [sp, 0x1C] ldr r0, =gUnknown_082F7B40 adds r0, r6, r0 ldrb r3, [r0] mov r0, r8 movs r2, 0 bl 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, =gUnknown_082F7B34 adds r4, r0 ldr r2, [r4] ldr r0, =gUnknown_082F7B44 lsls r4, r6, 1 adds r0, r4, r0 ldrb r0, [r0] str r0, [sp] mov r0, r10 str r0, [sp, 0x4] mov r0, r9 str r0, [sp, 0x8] adds r0, r7, 0 movs r1, 0x1 movs r3, 0 bl Print ldr r2, [sp, 0x18] lsls r3, r2, 3 subs r3, r5 lsls r3, 24 lsrs r3, 24 ldr r0, =gUnknown_082F7B4A adds r4, r0 ldrb r0, [r4] str r0, [sp] mov r0, r10 str r0, [sp, 0x4] mov r2, r9 str r2, [sp, 0x8] adds r0, r7, 0 movs r1, 0x1 mov r2, r8 bl Print adds r6, 0x1 cmp r6, 0x2 ble @08027C76 adds r0, r7, 0 bl 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 .pool thumb_func_end sub_8027BEC thumb_func_start sub_8027D20 sub_8027D20: ; 8027D20 push {lr} bl sub_8009FCC ldr r1, =0x02022c98 ldr r1, [r1] adds r1, 0x24 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8027D20 thumb_func_start sub_8027D38 sub_8027D38: ; 8027D38 push {r4-r7,lr} ldr r0, =0x02022c98 ldr r0, [r0] adds r0, 0x24 ldrb r4, [r0] cmp r4, 0x4 bhi @08027D66 ldr r5, =gUnknown_082F7B90 @08027D48: lsls r0, r4, 3 subs r0, r4 lsls r0, 2 ldr r1, =0x020229f0 adds r0, r1 lsls r1, r4, 2 adds r1, r5 ldr r1, [r1] bl gf_strcpy adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x4 bls @08027D48 @08027D66: ldr r0, =0x02022c98 ldr r1, [r0] adds r1, 0x24 movs r2, 0x5 strb r2, [r1] movs r1, 0 mov r12, r0 @08027D74: movs r4, 0 mov r2, r12 ldr r0, [r2] adds r0, 0x24 adds r5, r1, 0x1 ldrb r0, [r0] cmp r4, r0 bcs @08027DB2 ldr r7, =0x02022c98 lsls r3, r1, 1 ldr r6, =gUnknown_082F7B50 @08027D8A: ldr r2, [r7] lsls r0, r4, 1 adds r0, r4 lsls r0, 2 adds r0, r3, r0 adds r1, r2, 0 adds r1, 0x4A adds r1, r0 lsls r0, r4, 3 adds r0, r3, r0 adds r0, r6 ldrh r0, [r0] strh r0, [r1] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 adds r2, 0x24 ldrb r2, [r2] cmp r4, r2 bcc @08027D8A @08027DB2: lsls r0, r5, 24 lsrs r1, r0, 24 cmp r1, 0x3 bls @08027D74 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8027D38 thumb_func_start sub_8027DD0 sub_8027DD0: ; 8027DD0 push {lr} sub sp, 0x8 ldr r3, =0xffffff00 ldr r1, [sp] ands r1, r3 movs r2, 0x1 orrs r1, r2 str r1, [sp] lsls r0, 24 lsrs r0, 24 ldr r1, [sp, 0x4] ands r1, r3 orrs r1, r0 str r1, [sp, 0x4] mov r0, sp bl sub_800FE50 add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8027DD0 thumb_func_start sub_8027DFC sub_8027DFC: ; 8027DFC push {lr} adds r2, r0, 0 ldr r3, =0x03003090 ldrh r0, [r3] movs r1, 0xFF lsls r1, 8 ands r1, r0 movs r0, 0xBC lsls r0, 6 cmp r1, r0 bne @08027E1E lsls r0, r2, 4 adds r1, r3, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0x1 beq @08027E28 @08027E1E: movs r0, 0 b @08027E2A .align 2, 0 .pool @08027E28: ldrb r0, [r1, 0x4] @08027E2A: pop {r1} bx r1 thumb_func_end sub_8027DFC thumb_func_start sub_8027E30 sub_8027E30: ; 8027E30 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x20 ldr r4, [sp, 0x48] lsls r4, 24 str r4, [sp, 0x1C] movs r4, 0x14 adds r4, r0 mov r9, r4 mov r5, sp movs r4, 0x2 strb r4, [r5] mov r10, sp mov r5, r9 ldrb r4, [r5, 0xB] movs r7, 0xF adds r5, r7, 0 ands r5, r4 mov r6, r10 ldrb r6, [r6, 0x1] mov r8, r6 movs r4, 0x10 negs r4, r4 mov r6, r8 ands r4, r6 orrs r4, r5 mov r5, r10 strb r4, [r5, 0x1] mov r8, sp mov r6, r9 ldrb r5, [r6, 0xC] lsls r5, 4 ands r4, r7 orrs r4, r5 mov r5, r8 strb r4, [r5, 0x1] ldrb r5, [r6, 0xD] movs r6, 0xF ands r5, r6 mov r4, r10 ldrb r4, [r4, 0x2] mov r8, r4 movs r4, 0x10 negs r4, r4 mov r6, r8 ands r4, r6 orrs r4, r5 mov r5, r10 strb r4, [r5, 0x2] mov r8, sp mov r6, r9 ldrb r5, [r6, 0xE] lsls r5, 4 ands r4, r7 orrs r4, r5 mov r5, r8 strb r4, [r5, 0x2] ldrb r5, [r6, 0xF] movs r6, 0xF ands r5, r6 mov r4, r10 ldrb r4, [r4, 0x3] mov r8, r4 movs r4, 0x10 negs r4, r4 mov r6, r8 ands r4, r6 orrs r4, r5 mov r5, r10 strb r4, [r5, 0x3] mov r8, sp mov r6, r9 ldrb r5, [r6, 0x10] lsls r5, 4 ands r4, r7 orrs r4, r5 mov r5, r8 strb r4, [r5, 0x3] ldrb r5, [r6, 0x11] movs r6, 0xF ands r5, r6 mov r4, r10 ldrb r4, [r4, 0x4] mov r8, r4 movs r4, 0x10 negs r4, r4 mov r6, r8 ands r4, r6 orrs r4, r5 mov r5, r10 strb r4, [r5, 0x4] mov r8, sp mov r6, r9 ldrb r5, [r6, 0x12] lsls r5, 4 ands r4, r7 orrs r4, r5 mov r5, r8 strb r4, [r5, 0x4] ldrb r4, [r6, 0x13] movs r6, 0xF ands r4, r6 mov r6, r8 ldrb r5, [r6, 0x5] movs r6, 0x10 negs r6, r6 ands r6, r5 orrs r6, r4 str r6, [sp, 0xC] mov r4, r8 strb r6, [r4, 0x5] mov r5, sp mov r6, r9 ldrb r4, [r6, 0x14] lsls r4, 4 ldr r6, [sp, 0xC] ands r6, r7 orrs r6, r4 strb r6, [r5, 0x5] mov r7, sp movs r4, 0x3 mov r8, r4 ldrb r0, [r0, 0x14] mov r5, r8 ands r0, r5 ldrb r5, [r7, 0x6] movs r6, 0x4 negs r6, r6 mov r10, r6 mov r4, r10 ands r4, r5 orrs r4, r0 strb r4, [r7, 0x6] mov r5, r9 ldrb r0, [r5, 0x1] mov r6, r8 ands r0, r6 lsls r0, 2 movs r5, 0xD negs r5, r5 ands r5, r4 orrs r5, r0 strb r5, [r7, 0x6] mov r0, r9 ldrb r4, [r0, 0x2] ands r4, r6 lsls r4, 4 movs r0, 0x31 negs r0, r0 ands r0, r5 orrs r0, r4 strb r0, [r7, 0x6] mov r5, sp mov r6, r9 ldrb r4, [r6, 0x3] lsls r4, 6 movs r6, 0x3F ands r0, r6 orrs r0, r4 strb r0, [r5, 0x6] mov r4, r9 ldrb r0, [r4, 0x4] mov r5, r8 ands r0, r5 ldrb r5, [r7, 0x7] mov r4, r10 ands r4, r5 orrs r4, r0 strb r4, [r7, 0x7] mov r6, r9 ldrb r0, [r6, 0x5] mov r5, r8 ands r0, r5 lsls r0, 2 movs r5, 0xD negs r5, r5 ands r5, r4 orrs r5, r0 strb r5, [r7, 0x7] ldrb r4, [r6, 0x6] mov r6, r8 ands r4, r6 lsls r4, 4 movs r0, 0x31 negs r0, r0 ands r0, r5 orrs r0, r4 strb r0, [r7, 0x7] mov r5, sp mov r6, r9 ldrb r4, [r6, 0x7] lsls r4, 6 movs r6, 0x3F ands r0, r6 orrs r0, r4 strb r0, [r5, 0x7] mov r8, sp mov r0, r9 ldrb r4, [r0, 0x8] movs r7, 0x3 adds r0, r7, 0 ands r0, r4 mov r4, r8 ldrb r5, [r4, 0x8] mov r4, r10 ands r4, r5 orrs r4, r0 mov r5, r8 strb r4, [r5, 0x8] mov r6, r9 ldrb r5, [r6, 0x9] adds r0, r7, 0 ands r0, r5 lsls r0, 2 movs r5, 0xD negs r5, r5 ands r5, r4 orrs r5, r0 mov r0, r8 strb r5, [r0, 0x8] ldrb r0, [r1] adds r4, r7, 0 ands r4, r0 lsls r4, 4 movs r0, 0x31 negs r0, r0 ands r0, r5 orrs r0, r4 mov r4, r8 strb r0, [r4, 0x8] mov r5, sp ldrb r4, [r2] lsls r4, 6 movs r6, 0x3F ands r0, r6 orrs r0, r4 strb r0, [r5, 0x8] ldrb r4, [r3] adds r0, r7, 0 ands r0, r4 ldrb r4, [r5, 0x9] mov r6, r10 ands r6, r4 orrs r6, r0 mov r10, r6 strb r6, [r5, 0x9] ldr r0, [sp, 0x40] ldrb r4, [r0] adds r0, r7, 0 ands r0, r4 lsls r0, 2 movs r4, 0xD negs r4, r4 ands r6, r4 orrs r6, r0 str r6, [sp, 0x10] strb r6, [r5, 0x9] mov r4, sp ldr r5, [sp, 0x44] ldrb r0, [r5] adds r6, r7, 0 ands r6, r0 lsls r0, r6, 4 subs r7, 0x34 ldr r5, [sp, 0x10] ands r7, r5 orrs r7, r0 strb r7, [r4, 0x9] mov r5, sp ldrb r0, [r1, 0x4] movs r6, 0x1 mov r12, r6 mov r4, r12 ands r4, r0 lsls r4, 6 movs r0, 0x41 negs r0, r0 mov r10, r0 ands r0, r7 orrs r0, r4 strb r0, [r5, 0x9] ldrb r4, [r2, 0x4] lsls r4, 7 movs r5, 0x7F ands r0, r5 orrs r0, r4 mov r4, r8 strb r0, [r4, 0x9] ldrb r4, [r3, 0x4] mov r0, r12 ands r0, r4 mov r5, r8 ldrb r4, [r5, 0xA] movs r7, 0x2 negs r7, r7 adds r5, r7, 0 ands r5, r4 orrs r5, r0 mov r6, r8 strb r5, [r6, 0xA] mov r9, sp ldr r4, [sp, 0x40] ldrb r0, [r4, 0x4] mov r4, r12 ands r4, r0 lsls r4, 1 movs r6, 0x3 negs r6, r6 mov r8, r6 mov r0, r8 ands r0, r5 orrs r0, r4 mov r4, r9 strb r0, [r4, 0xA] ldr r6, [sp, 0x44] ldrb r5, [r6, 0x4] mov r4, r12 ands r4, r5 lsls r4, 2 movs r5, 0x5 negs r5, r5 ands r0, r5 orrs r0, r4 mov r4, r9 strb r0, [r4, 0xA] mov r4, sp ldrb r1, [r1, 0x8] mov r0, r12 ands r0, r1 lsls r0, 2 ldrb r1, [r4, 0xB] ands r5, r1 orrs r5, r0 strb r5, [r4, 0xB] ldrb r1, [r2, 0x8] mov r0, r12 ands r0, r1 lsls r0, 3 movs r1, 0x9 negs r1, r1 ands r1, r5 orrs r1, r0 strb r1, [r4, 0xB] ldrb r2, [r3, 0x8] mov r0, r12 ands r0, r2 lsls r0, 4 movs r2, 0x11 negs r2, r2 ands r2, r1 orrs r2, r0 strb r2, [r4, 0xB] mov r3, sp ldr r5, [sp, 0x40] ldrb r0, [r5, 0x8] mov r1, r12 ands r1, r0 lsls r1, 5 movs r0, 0x21 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3, 0xB] mov r2, sp ldrb r1, [r6, 0x8] mov r6, r12 ands r6, r1 lsls r1, r6, 6 mov r3, r10 ands r0, r3 orrs r0, r1 strb r0, [r2, 0xB] ldr r4, [sp, 0x1C] lsrs r3, r4, 21 ldrb r1, [r2, 0xA] movs r0, 0x7 ands r0, r1 orrs r0, r3 strb r0, [r2, 0xA] mov r1, sp ldr r5, [sp, 0x4C] movs r6, 0x1 ands r5, r6 lsls r2, r5, 1 ldrb r0, [r1, 0xB] mov r3, r8 ands r3, r0 orrs r3, r2 mov r8, r3 strb r3, [r1, 0xB] mov r0, sp ldr r4, [sp, 0x50] ands r4, r6 mov r5, r8 ands r5, r7 orrs r5, r4 strb r5, [r0, 0xB] bl sub_800FE50 add sp, 0x20 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8027E30 thumb_func_start sub_8028164 sub_8028164: ; 8028164 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r7, r1, 0 adds r5, r2, 0 adds r6, r3, 0 ldr r0, [sp, 0x1C] mov r12, r0 ldr r1, [sp, 0x20] mov r8, r1 ldr r0, [sp, 0x24] mov r9, r0 adds r2, r7, 0 adds r2, 0x14 ldr r4, =0x03003090 ldrh r0, [r4] movs r1, 0xFF lsls r1, 8 ands r1, r0 movs r0, 0xBC lsls r0, 6 cmp r1, r0 bne @0802819C adds r3, r4, 0x2 ldrb r0, [r4, 0x2] cmp r0, 0x2 beq @080281A4 @0802819C: movs r0, 0 b @080282DE .align 2, 0 .pool @080281A4: ldrb r0, [r3, 0x1] lsls r0, 28 lsrs r0, 28 strb r0, [r2, 0xB] ldrb r0, [r3, 0x1] lsrs r0, 4 strb r0, [r2, 0xC] ldrb r0, [r3, 0x2] lsls r0, 28 lsrs r0, 28 strb r0, [r2, 0xD] ldrb r0, [r3, 0x2] lsrs r0, 4 strb r0, [r2, 0xE] ldrb r0, [r3, 0x3] lsls r0, 28 lsrs r0, 28 strb r0, [r2, 0xF] ldrb r0, [r3, 0x3] lsrs r0, 4 strb r0, [r2, 0x10] ldrb r0, [r3, 0x4] lsls r0, 28 lsrs r0, 28 strb r0, [r2, 0x11] ldrb r0, [r3, 0x4] lsrs r0, 4 strb r0, [r2, 0x12] ldrb r0, [r3, 0x5] lsls r0, 28 lsrs r0, 28 strb r0, [r2, 0x13] ldrb r0, [r3, 0x5] lsrs r0, 4 strb r0, [r2, 0x14] ldrb r0, [r3, 0x1] lsls r0, 28 lsrs r0, 28 strb r0, [r2, 0x15] ldrb r0, [r3, 0x6] lsls r0, 30 lsrs r0, 30 strb r0, [r7, 0x14] ldrb r0, [r3, 0x6] lsls r0, 28 lsrs r0, 30 strb r0, [r2, 0x1] ldrb r0, [r3, 0x6] lsls r0, 26 lsrs r0, 30 strb r0, [r2, 0x2] ldrb r0, [r3, 0x6] lsrs r0, 6 strb r0, [r2, 0x3] ldrb r0, [r3, 0x7] lsls r0, 30 lsrs r0, 30 strb r0, [r2, 0x4] ldrb r0, [r3, 0x7] lsls r0, 28 lsrs r0, 30 strb r0, [r2, 0x5] ldrb r0, [r3, 0x7] lsls r0, 26 lsrs r0, 30 strb r0, [r2, 0x6] ldrb r0, [r3, 0x7] lsrs r0, 6 strb r0, [r2, 0x7] ldrb r0, [r3, 0x8] lsls r0, 30 lsrs r0, 30 strb r0, [r2, 0x8] ldrb r0, [r3, 0x8] lsls r0, 28 lsrs r0, 30 strb r0, [r2, 0x9] ldrb r0, [r3, 0x6] lsls r0, 30 lsrs r0, 30 strb r0, [r2, 0xA] ldrb r0, [r3, 0x8] lsls r0, 26 lsrs r0, 30 strb r0, [r5] ldrb r0, [r3, 0x9] lsls r0, 25 lsrs r0, 31 strb r0, [r5, 0x4] ldrb r0, [r3, 0xB] lsls r0, 29 lsrs r0, 31 strb r0, [r5, 0x8] ldrb r0, [r3, 0x8] lsrs r0, 6 strb r0, [r6] ldrb r0, [r3, 0x9] lsrs r0, 7 strb r0, [r6, 0x4] ldrb r0, [r3, 0xB] lsls r0, 28 lsrs r0, 31 strb r0, [r6, 0x8] ldrb r0, [r3, 0x9] lsls r0, 30 lsrs r0, 30 mov r1, r12 strb r0, [r1] ldrb r0, [r3, 0xA] lsls r0, 31 lsrs r0, 31 strb r0, [r1, 0x4] ldrb r0, [r3, 0xB] lsls r0, 27 lsrs r0, 31 strb r0, [r1, 0x8] ldrb r0, [r3, 0x9] lsls r0, 28 lsrs r0, 30 mov r1, r8 strb r0, [r1] ldrb r0, [r3, 0xA] lsls r0, 30 lsrs r0, 31 strb r0, [r1, 0x4] ldrb r0, [r3, 0xB] lsls r0, 26 lsrs r0, 31 strb r0, [r1, 0x8] ldrb r0, [r3, 0x9] lsls r0, 26 lsrs r0, 30 mov r1, r9 strb r0, [r1] ldrb r0, [r3, 0xA] lsls r0, 29 lsrs r0, 31 strb r0, [r1, 0x4] ldrb r0, [r3, 0xB] lsls r0, 25 lsrs r0, 31 strb r0, [r1, 0x8] ldrb r0, [r3, 0xA] lsrs r0, 3 ldr r1, [sp, 0x28] strb r0, [r1] ldrb r0, [r3, 0xB] lsls r0, 30 lsrs r0, 31 ldr r1, [sp, 0x2C] str r0, [r1] ldrb r0, [r3, 0xB] lsls r0, 31 lsrs r0, 31 ldr r1, [sp, 0x30] str r0, [r1] movs r0, 0x1 @080282DE: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8028164 thumb_func_start sub_80282EC sub_80282EC: ; 80282EC push {lr} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 ldr r3, =0xffffff00 ldr r1, [sp] ands r1, r3 movs r2, 0x3 orrs r1, r2 str r1, [sp] ldr r1, [sp, 0x4] ands r1, r3 orrs r1, r0 str r1, [sp, 0x4] mov r0, sp bl sub_800FE50 add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80282EC thumb_func_start sub_8028318 sub_8028318: ; 8028318 push {r4,lr} adds r2, r0, 0 adds r4, r1, 0 ldr r3, =0x03003090 ldrh r0, [r3] movs r1, 0xFF lsls r1, 8 ands r1, r0 movs r0, 0xBC lsls r0, 6 cmp r1, r0 bne @0802833C lsls r0, r2, 4 adds r1, r3, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0x3 beq @08028344 @0802833C: movs r0, 0 b @0802834A .align 2, 0 .pool @08028344: ldrb r0, [r1, 0x4] strb r0, [r4] movs r0, 0x1 @0802834A: pop {r4} pop {r1} bx r1 thumb_func_end sub_8028318 thumb_func_start sub_8028350 sub_8028350: ; 8028350 push {lr} sub sp, 0x8 ldr r2, =0xffffff00 ldr r1, [sp] ands r1, r2 movs r2, 0x4 orrs r1, r2 str r1, [sp] str r0, [sp, 0x4] mov r0, sp bl sub_800FE50 add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8028350 thumb_func_start sub_8028374 sub_8028374: ; 8028374 push {lr} adds r2, r0, 0 ldr r3, =0x03003090 ldrh r0, [r3] movs r1, 0xFF lsls r1, 8 ands r1, r0 movs r0, 0xBC lsls r0, 6 cmp r1, r0 bne @08028396 lsls r0, r2, 4 adds r1, r3, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0x4 beq @080283A0 @08028396: movs r0, 0 b @080283A2 .align 2, 0 .pool @080283A0: ldr r0, [r1, 0x4] @080283A2: pop {r1} bx r1 thumb_func_end sub_8028374 thumb_func_start sub_80283A8 sub_80283A8: ; 80283A8 push {r4,r5,lr} sub sp, 0x18 movs r5, 0xC0 lsls r5, 6 adds r0, r5, 0 bl malloc_and_clear adds r4, r0, 0 ldr r0, =gUnknown_082FB2D8 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x8] str r1, [sp, 0xC] ldr r0, =gUnknown_082FB2E0 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x10] str r1, [sp, 0x14] ldr r0, =gUnknown_082F98BC adds r1, r4, 0 bl LZ77UnCompWram cmp r4, 0 beq @080283E8 str r4, [sp] str r5, [sp, 0x4] mov r0, sp bl 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 .pool thumb_func_end sub_80283A8 thumb_func_start sub_8028408 sub_8028408: ; 8028408 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x30 adds r6, r1, 0 mov r8, r2 adds r5, r3, 0 lsls r6, 24 lsrs r6, 24 mov r1, r8 lsls r1, 24 lsrs r1, 24 mov r8, r1 lsls r5, 24 lsrs r5, 24 add r1, sp, 0x18 movs r3, 0 strh r3, [r1] ldrb r2, [r0] mov r0, sp adds r0, 0x1A strh r2, [r0] ldr r0, =gUnknown_082FB1E0 str r0, [sp, 0x1C] ldr r0, =gUnknown_082FB228 str r0, [sp, 0x20] str r3, [sp, 0x24] ldr r0, =gUnknown_082EC6A8 str r0, [sp, 0x28] ldr r0, =sub_80284A8 str r0, [sp, 0x2C] mov r0, sp movs r2, 0x18 bl memcpy movs r0, 0x4 bl malloc_and_clear ldr r1, =0x02022c9c mov r2, r8 lsls r4, r2, 2 adds r4, r1 str r0, [r4] adds r0, r6, 0 adds r1, r5, 0 bl sub_8028F14 adds r1, r0, 0 lsls r1, 16 asrs r1, 16 mov r0, sp movs r2, 0x88 movs r3, 0x3 bl 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 .pool thumb_func_end sub_8028408 thumb_func_start sub_80284A8 sub_80284A8: ; 80284A8 push {lr} movs r2, 0x2E ldrsh r1, [r0, r2] cmp r1, 0x1 beq @080284BC cmp r1, 0x1 ble @080284C6 cmp r1, 0x2 beq @080284C2 b @080284C6 @080284BC: bl sub_802853C b @080284C6 @080284C2: bl sub_80285AC @080284C6: pop {r0} bx r0 thumb_func_end sub_80284A8 thumb_func_start sub_80284CC sub_80284CC: ; 80284CC push {lr} bl link_get_multiplayer_id ldr r1, =0x02022c9c lsls r0, 24 lsrs r0, 22 adds r0, r1 ldr r0, [r0] ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r2, 0 movs r1, 0x1 strh r1, [r0, 0x2E] strh r2, [r0, 0x30] strh r2, [r0, 0x32] strh r2, [r0, 0x34] strh r2, [r0, 0x36] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80284CC thumb_func_start sub_8028504 sub_8028504: ; 8028504 push {lr} bl link_get_multiplayer_id ldr r1, =0x02022c9c lsls r0, 24 lsrs r0, 22 adds r0, r1 ldr r0, [r0] ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r2, 0 movs r1, 0x2 strh r1, [r0, 0x2E] strh r2, [r0, 0x30] strh r2, [r0, 0x32] strh r2, [r0, 0x34] strh r2, [r0, 0x36] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8028504 thumb_func_start sub_802853C sub_802853C: ; 802853C push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x30] adds r0, 0x1 strh r0, [r4, 0x30] lsls r0, 16 asrs r2, r0, 16 lsrs r0, 31 adds r0, r2, r0 asrs r1, r0, 1 adds r0, r1, 0 cmp r1, 0 bge @08028558 adds r0, r1, 0x3 @08028558: asrs r0, 2 lsls r0, 2 subs r0, r1, r0 lsls r0, 24 lsrs r0, 24 cmp r2, 0x2 ble @080285A2 cmp r0, 0x2 bgt @0802856E cmp r0, 0x1 bge @08028572 @0802856E: movs r0, 0x1 b @08028574 @08028572: movs r0, 0xFF @08028574: lsls r0, 24 asrs r0, 24 ldrh r1, [r4, 0x20] adds r0, r1 strh r0, [r4, 0x20] ldrh r0, [r4, 0x30] adds r0, 0x1 strh r0, [r4, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x27 ble @080285A2 movs r0, 0 strh r0, [r4, 0x2E] bl sub_8027650 adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 movs r0, 0 bl sub_8028F14 strh r0, [r4, 0x20] @080285A2: movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_802853C thumb_func_start sub_80285AC sub_80285AC: ; 80285AC push {r4,r5,lr} adds r5, r0, 0 ldrh r0, [r5, 0x30] adds r0, 0x1 strh r0, [r5, 0x30] lsls r0, 16 asrs r0, 16 movs r1, 0xD bl __divsi3 lsls r0, 16 asrs r1, r0, 16 adds r0, r1, 0 cmp r1, 0 bge @080285CC adds r0, r1, 0x3 @080285CC: asrs r0, 2 lsls r0, 2 subs r0, r1, r0 lsls r0, 24 lsrs r4, r0, 24 movs r1, 0x30 ldrsh r0, [r5, r1] movs r1, 0xD bl __modsi3 lsls r0, 16 cmp r0, 0 bne @080285F0 cmp r4, 0 beq @080285F0 movs r0, 0xD4 bl audio_play @080285F0: movs r1, 0x30 ldrsh r0, [r5, r1] cmp r0, 0x67 ble @080285FE movs r0, 0 strh r0, [r5, 0x2E] movs r4, 0 @080285FE: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 bl sub_80286B4 movs r0, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80285AC thumb_func_start sub_8028614 sub_8028614: ; 8028614 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 cmp r4, r5 bcs @08028646 ldr r6, =0x02022c9c @08028622: lsls r0, r4, 2 adds r0, r6 ldr r0, [r0] ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 cmp r0, 0 beq @0802863C bl 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 .pool thumb_func_end sub_8028614 thumb_func_start sub_8028654 sub_8028654: ; 8028654 lsls r0, 24 lsrs r0, 24 lsls r1, 24 ldr r3, =0x02020630 ldr r2, =0x02022c9c lsrs r1, 22 adds r1, r2 ldr r1, [r1] ldrh r1, [r1] lsls r2, r1, 4 adds r2, r1 lsls r2, 2 adds r2, r3 adds r2, 0x3E movs r1, 0x1 ands r0, r1 lsls r0, 2 ldrb r3, [r2] movs r1, 0x5 negs r1, r1 ands r1, r3 orrs r1, r0 strb r1, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_8028654 thumb_func_start sub_802868C sub_802868C: ; 802868C push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r5, r1, 24 movs r4, 0 cmp r4, r5 bcs @080286AE @0802869C: adds r0, r6, 0 adds r1, r4, 0 bl sub_8028654 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @0802869C @080286AE: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_802868C thumb_func_start sub_80286B4 sub_80286B4: ; 80286B4 push {lr} lsls r0, 24 lsls r1, 24 lsrs r1, 24 ldr r2, =0x02022c9c lsrs r0, 22 adds r0, r2 ldr r0, [r0] ldrh r2, [r0] lsls r0, r2, 4 adds r0, r2 lsls r0, 2 ldr r2, =0x02020630 adds r0, r2 bl obj_anim_image_start pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80286B4 thumb_func_start nullsub_15 nullsub_15: ; 80286E0 bx lr thumb_func_end nullsub_15 thumb_func_start sub_80286E4 sub_80286E4: ; 80286E4 push {r4-r7,lr} movs r4, 0 ldr r0, =0x02020630 mov r12, r0 movs r6, 0 ldr r5, =0x02022cf4 @080286F0: ldr r3, [r5] lsls r1, r4, 1 adds r0, r3, 0 adds r0, 0x2A adds r0, r1 ldrh r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 add r1, r12 lsls r0, r4, 4 adds r0, 0x30 strh r0, [r1, 0x20] lsls r2, r4, 3 movs r7, 0x8 negs r7, r7 adds r0, r7, 0 subs r0, r2 strh r0, [r1, 0x22] adds r3, 0xC adds r3, r4 strb r6, [r3] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x9 bls @080286F0 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80286E4 thumb_func_start sub_8028734 sub_8028734: ; 8028734 push {r4-r6,lr} sub sp, 0x28 movs r4, 0xC0 lsls r4, 1 adds r0, r4, 0 bl malloc_and_clear adds r6, r0, 0 ldr r0, =gUnknown_082FB2E8 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x20] str r1, [sp, 0x24] ldr r0, =gUnknown_082F96E0 adds r1, r6, 0 bl LZ77UnCompWram cmp r6, 0 beq @080287C4 str r6, [sp, 0x18] add r5, sp, 0x18 movs r0, 0x80 lsls r0, 9 orrs r0, r4 str r0, [r5, 0x4] mov r1, sp ldr r0, =gUnknown_082FB2F0 ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2-r4} stm r1!, {r2-r4} ldr r4, =0x02022cf4 movs r0, 0x40 bl 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, =0x02022cf4 ldr r1, [r1] lsls r2, r4, 1 adds r1, 0x2A adds r1, r2 lsls r0, 24 lsrs r0, 24 strh r0, [r1] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x9 bls @0802878A @080287C4: adds r0, r6, 0 bl free add sp, 0x28 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8028734 thumb_func_start sub_80287E4 sub_80287E4: ; 80287E4 push {r4,r5,lr} movs r4, 0 @080287E8: ldr r5, =0x02022cf4 ldr r0, [r5] lsls r1, r4, 1 adds r0, 0x2A adds r0, r1 ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 cmp r0, 0 beq @08028806 bl 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 .pool thumb_func_end sub_80287E4 thumb_func_start sub_8028828 sub_8028828: ; 8028828 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 movs r3, 0 movs r6, 0 ldr r0, =0x02022cf4 mov r9, r0 @0802883A: mov r7, r9 ldr r2, [r7] lsls r5, r6, 1 adds r0, r2, 0 adds r0, 0x2A adds r0, r5 ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r4, r0, r1 adds r0, r2, 0 adds r0, 0x16 adds r0, r5 movs r1, 0x2 strh r1, [r0] adds r0, r2, 0 adds r0, 0xC adds r2, r0, r6 ldrb r1, [r2] cmp r1, 0 beq @08028870 movs r7, 0x22 ldrsh r0, [r4, r7] cmp r0, 0x8 beq @080288A6 @08028870: movs r3, 0x1 movs r7, 0x22 ldrsh r0, [r4, r7] cmp r0, 0x8 bne @08028896 cmp r1, 0 bne @080288A6 strb r3, [r2] mov r1, r9 ldr r0, [r1] adds r0, 0x16 adds r0, r5 ldr r1, =0x0000fff0 strh r1, [r0] movs r0, 0x24 str r3, [sp] bl audio_play ldr r3, [sp] @08028896: mov r7, r9 ldr r0, [r7] adds r0, 0x16 adds r0, r5 ldrh r0, [r0] ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x22] @080288A6: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x9 bls @0802883A cmp r3, 0 bne @080288C4 movs r0, 0x1 b @080288C6 .align 2, 0 .pool @080288C4: movs r0, 0 @080288C6: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8028828 thumb_func_start sub_80288D4 sub_80288D4: ; 80288D4 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0xA bls @08028910 movs r4, 0 @080288E0: ldr r0, =0x02022cf4 ldr r0, [r0] lsls r1, r4, 1 adds r0, 0x2A adds r0, r1 ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x1 bl 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 .pool @08028910: movs r4, 0 movs r0, 0xA subs r0, r5 cmp r4, r0 bge @080289D6 ldr r6, =0x02020630 @0802891C: cmp r5, 0x6 bls @08028984 ldr r0, =0x02022cf4 ldr r2, [r0] ldr r1, =0x0000fffa adds r0, r1, 0 ldrh r1, [r2, 0x3E] adds r0, r1 adds r0, r5 movs r1, 0 strh r0, [r2, 0x3E] lsls r0, 16 lsrs r0, 16 cmp r0, 0x1E bls @0802894C strh r1, [r2, 0x3E] b @0802899E .align 2, 0 .pool @0802894C: cmp r0, 0xA bls @0802896A lsls r1, r4, 1 adds r0, r2, 0 adds r0, 0x2A adds r0, r1 ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 movs r1, 0x2 bl 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, =0x02022cf4 ldr r0, [r0] lsls r1, r4, 1 adds r0, 0x2A adds r0, r1 ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 movs r1, 0 bl 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 .pool @080289B4: ldr r0, =0x02022cf4 ldr r0, [r0] lsls r1, r4, 1 adds r0, 0x2A adds r0, r1 ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x1 bl 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 .pool thumb_func_end sub_80288D4 thumb_func_start sub_80289E8 sub_80289E8: ; 80289E8 push {r4-r7,lr} lsls r0, 24 lsrs r0, 24 movs r3, 0 ldr r7, =0x02020630 movs r1, 0x1 ands r0, r1 lsls r4, r0, 2 movs r6, 0x5 negs r6, r6 ldr r5, =0x02022cf4 @080289FE: ldr r0, [r5] lsls r1, r3, 1 adds r0, 0x2A adds r0, r1 ldrh r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r7 adds r1, 0x3E ldrb r2, [r1] adds r0, r6, 0 ands r0, r2 orrs r0, r4 strb r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x9 bls @080289FE pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80289E8 thumb_func_start sub_8028A34 sub_8028A34: ; 8028A34 push {r4,r5,lr} sub sp, 0x10 movs r5, 0x90 lsls r5, 3 adds r0, r5, 0 bl malloc_and_clear adds r4, r0, 0 ldr r0, =gUnknown_082FB314 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x8] str r1, [sp, 0xC] ldr r0, =gUnknown_082F7EB0 adds r1, r4, 0 bl LZ77UnCompWram cmp r4, 0 beq @08028A6A str r4, [sp] movs r0, 0x80 lsls r0, 10 orrs r0, r5 str r0, [sp, 0x4] mov r0, sp bl 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 .pool thumb_func_end sub_8028A34 thumb_func_start sub_8028A88 sub_8028A88: ; 8028A88 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x30 mov r1, sp ldr r0, =gUnknown_082FB324 ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} add r2, sp, 0x18 adds r1, r2, 0 ldr r0, =gUnknown_082FB33C ldm r0!, {r3-r5} stm r1!, {r3-r5} ldm r0!, {r3-r5} stm r1!, {r3-r5} movs r5, 0 mov r9, r2 @08028AB0: movs r0, 0x4 bl malloc_and_clear ldr r1, =0x02022cb8 lsls r4, r5, 2 adds r4, r1 str r0, [r4] lsls r0, r5, 3 lsls r1, r5, 4 adds r1, r0 mov r0, sp movs r2, 0x8 movs r3, 0x1 bl 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, =0x02022ce4 ldr r4, =gUnknown_082FB31C 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 .pool @08028B2C: lsls r0, r5, 1 add r0, r8 movs r3, 0 ldrsh r1, [r0, r3] mov r0, r9 movs r2, 0x34 movs r3, 0 bl 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, =0x02020630 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 .pool thumb_func_end sub_8028A88 thumb_func_start sub_8028B80 sub_8028B80: ; 8028B80 push {r4-r6,lr} movs r5, 0 ldr r6, =0x02022cb8 @08028B86: lsls r0, r5, 2 adds r4, r0, r6 ldr r0, [r4] ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 cmp r0, 0 beq @08028BA0 bl 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, =0x02022ce4 @08028BB8: lsls r0, r5, 2 adds r4, r0, r6 ldr r0, [r4] ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 cmp r0, 0 beq @08028BD2 bl 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 .pool thumb_func_end sub_8028B80 thumb_func_start sub_8028BF8 sub_8028BF8: ; 8028BF8 lsls r0, 24 lsls r1, 24 lsrs r1, 24 ldr r3, =0x02020630 ldr r2, =0x02022cb8 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ldrh r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 adds r2, 0x3E movs r0, 0x1 ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_8028BF8 thumb_func_start sub_8028C30 sub_8028C30: ; 8028C30 push {r4-r7,lr} lsls r0, 24 lsrs r0, 24 movs r3, 0 ldr r7, =0x02020630 ldr r6, =0x02022ce4 movs r1, 0x1 ands r0, r1 lsls r4, r0, 2 movs r5, 0x5 negs r5, r5 @08028C46: lsls r0, r3, 2 adds r0, r6 ldr r0, [r0] ldrh r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r7 adds r1, 0x3E ldrb r2, [r1] adds r0, r5, 0 ands r0, r2 orrs r0, r4 strb r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3 bls @08028C46 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8028C30 thumb_func_start sub_8028C7C sub_8028C7C: ; 8028C7C lsls r0, 24 lsls r1, 24 ldr r3, =0x02020630 ldr r2, =0x02022cb8 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ldrh r2, [r0] lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r3 lsrs r1, 21 strh r1, [r0, 0x22] bx lr .align 2, 0 .pool thumb_func_end sub_8028C7C thumb_func_start sub_8028CA4 sub_8028CA4: ; 8028CA4 push {lr} lsls r0, 16 lsls r1, 24 lsrs r1, 24 ldr r2, =0x02022cb8 lsrs r0, 14 adds r0, r2 ldr r0, [r0] ldrh r2, [r0] lsls r0, r2, 4 adds r0, r2 lsls r0, 2 ldr r2, =0x02020630 adds r0, r2 bl obj_anim_image_start pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8028CA4 thumb_func_start sub_8028CD0 sub_8028CD0: ; 8028CD0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02020630 lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r1 lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, 0x32 strh r1, [r2, 0x20] movs r0, 0x32 strh r0, [r2, 0x22] bx lr .align 2, 0 .pool thumb_func_end sub_8028CD0 thumb_func_start sub_8028CF4 sub_8028CF4: ; 8028CF4 push {r4-r7,lr} adds r4, r0, 0 adds r0, 0x42 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x1 beq @08028D36 movs r3, 0 ldr r7, =gUnknown_082FB354 ldr r6, =0x02022cb0 movs r5, 0 @08028D0A: lsls r0, r3, 2 adds r2, r0, r6 ldr r1, [r2] ldrh r0, [r1, 0x2] adds r0, 0x1 strh r0, [r1, 0x2] adds r1, r3, r7 lsls r0, 16 lsrs r0, 16 ldrb r1, [r1] cmp r0, r1 bls @08028D2C ldrh r0, [r4, 0x20] subs r0, 0x1 strh r0, [r4, 0x20] ldr r0, [r2] strh r5, [r0, 0x2] @08028D2C: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x1 bls @08028D0A @08028D36: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8028CF4 thumb_func_start sub_8028D44 sub_8028D44: ; 8028D44 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x28 movs r4, 0x80 lsls r4, 3 adds r0, r4, 0 bl malloc_and_clear adds r6, r0, 0 ldr r0, =gUnknown_082FB360 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x20] str r1, [sp, 0x24] ldr r0, =gUnknown_082F9774 adds r1, r6, 0 bl LZ77UnCompWram cmp r6, 0 beq @08028DD2 str r6, [sp, 0x18] add r0, sp, 0x18 movs r1, 0xA0 lsls r1, 11 orrs r1, r4 str r1, [r0, 0x4] mov r2, sp ldr r1, =gUnknown_082FB368 ldm r1!, {r3-r5} stm r2!, {r3-r5} ldm r1!, {r3-r5} stm r2!, {r3-r5} bl 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, =gUnknown_082FB356 adds r0, r7, 0x2 mov r9, r0 ldr r1, =0x02022cb0 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 .pool thumb_func_end sub_8028D44 thumb_func_start sub_8028DFC sub_8028DFC: ; 8028DFC push {r4-r7,lr} movs r3, 0 ldr r0, =0x02022cb0 mov r12, r0 ldr r4, =gUnknown_082FB356 adds r7, r4, 0x2 ldr r6, =0x02020630 movs r5, 0x1 @08028E0C: lsls r2, r3, 2 mov r1, r12 adds r0, r2, r1 ldr r0, [r0] ldrh r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r6 adds r0, r1, 0 adds r0, 0x42 strh r5, [r0] adds r0, r2, r4 ldrh r0, [r0] strh r0, [r1, 0x20] adds r2, r7 ldrh r0, [r2] strh r0, [r1, 0x22] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x1 bls @08028E0C pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8028DFC thumb_func_start sub_8028E4C sub_8028E4C: ; 8028E4C push {r4,r5,lr} movs r2, 0 ldr r5, =0x02022cb0 ldr r4, =0x02020630 movs r3, 0 @08028E56: lsls r0, r2, 2 adds r0, r5 ldr r0, [r0] ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x42 strh r3, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x1 bls @08028E56 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8028E4C thumb_func_start sub_8028E84 sub_8028E84: ; 8028E84 push {r4-r6,lr} movs r5, 0 ldr r6, =0x02022cb0 @08028E8A: lsls r0, r5, 2 adds r4, r0, r6 ldr r0, [r4] ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 cmp r0, 0 beq @08028EA4 bl 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 .pool thumb_func_end sub_8028E84 thumb_func_start sub_8028EC8 sub_8028EC8: ; 8028EC8 push {r4-r7,lr} lsls r0, 24 lsrs r0, 24 movs r3, 0 ldr r7, =0x02020630 ldr r6, =0x02022cb0 movs r1, 0x1 ands r0, r1 lsls r4, r0, 2 movs r5, 0x5 negs r5, r5 @08028EDE: lsls r0, r3, 2 adds r0, r6 ldr r0, [r0] ldrh r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r7 adds r1, 0x3E ldrb r2, [r1] adds r0, r5, 0 ands r0, r2 orrs r0, r4 strb r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x1 bls @08028EDE pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8028EC8 thumb_func_start sub_8028F14 sub_8028F14: ; 8028F14 push {lr} lsls r0, 24 lsrs r2, r0, 24 lsls r1, 24 lsrs r1, 24 movs r3, 0 subs r0, r1, 0x1 cmp r0, 0x4 bhi @08028FC6 lsls r0, 2 ldr r1, =@08028F34 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08028F34: .4byte @08028FB4 .4byte @08028F48 .4byte @08028F52 .4byte @08028F66 .4byte @08028F8E @08028F48: cmp r2, 0 beq @08028F7E cmp r2, 0x1 bne @08028FC6 b @08028F82 @08028F52: cmp r2, 0x1 beq @08028FB8 cmp r2, 0x1 bgt @08028F60 cmp r2, 0 beq @08028FB4 b @08028FC6 @08028F60: cmp r2, 0x2 bne @08028FC6 b @08028FC4 @08028F66: cmp r2, 0x1 beq @08028F82 cmp r2, 0x1 bgt @08028F74 cmp r2, 0 beq @08028F7E b @08028FC6 @08028F74: cmp r2, 0x2 beq @08028F86 cmp r2, 0x3 beq @08028F8A b @08028FC6 @08028F7E: movs r3, 0xC b @08028FC6 @08028F82: movs r3, 0x12 b @08028FC6 @08028F86: movs r3, 0x18 b @08028FC6 @08028F8A: movs r3, 0x6 b @08028FC6 @08028F8E: cmp r2, 0x4 bhi @08028FC6 lsls r0, r2, 2 ldr r1, =@08028FA0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08028FA0: .4byte @08028FB4 .4byte @08028FB8 .4byte @08028FBC .4byte @08028FC0 .4byte @08028FC4 @08028FB4: movs r3, 0xF b @08028FC6 @08028FB8: movs r3, 0x15 b @08028FC6 @08028FBC: movs r3, 0x1B b @08028FC6 @08028FC0: movs r3, 0x3 b @08028FC6 @08028FC4: movs r3, 0x9 @08028FC6: lsls r0, r3, 3 pop {r1} bx r1 thumb_func_end sub_8028F14 thumb_func_start sub_8028FCC sub_8028FCC: ; 8028FCC push {r4,lr} movs r4, 0 @08028FD0: adds r0, r4, 0 movs r1, 0x1 bl sub_8028BF8 adds r0, r4, 0 movs r1, 0x1 bl sub_8028C7C adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xA bls @08028FD0 movs r0, 0 bl sub_80289E8 pop {r4} pop {r0} bx r0 thumb_func_end sub_8028FCC thumb_func_start sub_8028FF8 sub_8028FF8: ; 8028FF8 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 bl sub_8098758 ldr r1, [r0] movs r2, 0x90 lsls r2, 1 movs r0, 0 movs r3, 0x1 bl 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, =0x02022cf8 ldr r0, [r3] movs r2, 0xC0 lsls r2, 6 adds r1, r0, r2 movs r2, 0 str r2, [r1] ldr r1, =0x00003014 adds r0, r1 strb r2, [r0] ldr r0, [r3] adds r1, 0x4 adds r0, r1 strb r2, [r0] ldr r0, [r3] adds r1, 0x8 adds r0, r1 strb r2, [r0] ldr r0, [r3] adds r1, 0x4 adds r0, r1 strb r2, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_802903C thumb_func_start sub_8029074 sub_8029074: ; 8029074 push {r4-r6,lr} sub sp, 0xC adds r4, r0, 0 movs r6, 0xA ldrb r2, [r4, 0x1] subs r2, 0x1 lsls r2, 24 lsrs r2, 24 ldrb r3, [r4, 0x2] subs r3, 0x1 lsls r3, 24 lsrs r3, 24 movs r5, 0x1 str r5, [sp] str r5, [sp, 0x4] str r6, [sp, 0x8] movs r0, 0 movs r1, 0x1 bl 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, =0x02022cf8 str r0, [r4] movs r2, 0xC0 lsls r2, 6 adds r1, r0, r2 movs r2, 0 str r2, [r1] ldr r3, =0x00003014 adds r1, r0, r3 strb r2, [r1] ldr r1, =0x00003018 adds r0, r1 strb r2, [r0] ldr r0, [r4] adds r3, 0xC adds r0, r3 strb r2, [r0] ldr r0, [r4] adds r1, 0xC adds r0, r1 strb r2, [r0] ldr r0, =sub_8029314 movs r1, 0x3 bl AddTask ldr r1, [r4] ldr r2, =0x00003004 adds r1, r2 strb r0, [r1] ldr r0, =sub_8029338 bl sub_802A72C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_082FB40C adds r7, r5, 0x4 @080292EC: lsls r1, r4, 3 adds r0, r1, r5 ldrb r0, [r0] cmp r0, r6 bne @080292FE adds r0, r1, r7 ldr r0, [r0] bl sub_802A72C @080292FE: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x9 bls @080292EC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80292E0 thumb_func_start sub_8029314 sub_8029314: ; 8029314 push {lr} ldr r0, =0x02022cf8 ldr r0, [r0] movs r1, 0xC0 lsls r1, 6 adds r0, r1 ldr r0, [r0] cmp r0, 0 bne @0802932E bl sub_802A75C bl _call_via_r0 @0802932E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8029314 thumb_func_start sub_8029338 sub_8029338: ; 8029338 push {lr} ldr r0, =0x02022cf8 ldr r1, [r0] ldr r2, =0x00003014 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x4 bhi @08029430 lsls r0, 2 ldr r1, =@08029360 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08029360: .4byte @08029374 .4byte @0802937A .4byte @08029394 .4byte @080293D8 .4byte @08029404 @08029374: bl sub_802A7A8 b @08029414 @0802937A: bl sub_802A8E8 cmp r0, 0x1 bne @0802943A ldr r0, =0x02022cf8 ldr r1, [r0] ldr r2, =0x00003014 adds r1, r2 b @0802941C .align 2, 0 .pool @08029394: ldr r1, =gUnknown_082FAAD8 movs r0, 0x3 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r1, =gUnknown_082FAF94 movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r1, =gUnknown_082FAD44 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 .pool @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, =0x02022cf8 ldr r1, [r0] ldr r2, =0x00003014 adds r1, r2 b @0802941C .align 2, 0 .pool @08029404: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x14] lsrs r0, 3 bl sub_8028FF8 bl sub_802902C @08029414: ldr r0, =0x02022cf8 ldr r1, [r0] ldr r0, =0x00003014 adds r1, r0 @0802941C: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0802943A .align 2, 0 .pool @08029430: movs r2, 0xC0 lsls r2, 6 adds r1, r2 movs r0, 0x1 str r0, [r1] @0802943A: pop {r0} bx r0 thumb_func_end sub_8029338 thumb_func_start sub_8029440 sub_8029440: ; 8029440 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x1C ldr r4, =0x02022cf8 ldr r0, [r4] ldr r2, =0x00003014 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0 beq @08029488 cmp r0, 0x1 bne @08029460 b @080295EC @08029460: adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0xB4 bhi @0802946E b @0802968E @0802946E: bl sub_8027650 lsls r0, 24 lsrs r7, r0, 24 movs r6, 0 cmp r6, r7 bcc @0802947E b @08029666 @0802947E: b @08029640 .align 2, 0 .pool @08029488: bl sub_8027650 lsls r0, 24 lsrs r7, r0, 24 ldr r1, =gUnknown_082FB3C8 subs r0, r7, 0x1 lsls r0, 2 adds r0, r1 ldr r5, [r0] ldr r2, =0xffffff00 ldr r0, [sp, 0xC] ands r0, r2 ldr r1, =0x00ffffff ands r0, r1 movs r1, 0xE0 lsls r1, 19 orrs r0, r1 str r0, [sp, 0xC] ldr r0, [sp, 0x10] ands r0, r2 movs r1, 0x2 orrs r0, r1 ldr r1, =0xffff00ff ands r0, r1 movs r1, 0xD0 lsls r1, 4 orrs r0, r1 ldr r1, =0x0000ffff ands r0, r1 movs r1, 0x98 lsls r1, 13 orrs r0, r1 str r0, [sp, 0x10] movs r6, 0 cmp r6, r7 bcs @080295B8 mov r3, sp adds r3, 0xC str r3, [sp, 0x18] mov r10, r4 ldr r0, =0x00003008 mov r9, r0 @080294DC: movs r1, 0 mov r8, r1 adds r0, r6, 0 bl sub_8027A48 lsls r0, 24 lsrs r0, 24 adds r4, r0, 0 bl sub_8027660 adds r1, r0, 0 movs r0, 0x1 movs r2, 0x1 negs r2, r2 bl 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, =0xffff00ff ldr r1, [sp, 0xC] ands r1, r2 orrs r1, r0 str r1, [sp, 0xC] ldrb r2, [r5, 0x1] lsls r2, 16 ldr r0, =0xff00ffff ands r0, r1 orrs r0, r2 str r0, [sp, 0xC] add r0, sp, 0xC bl 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, =gUnknown_082FB380 adds r1, r3 str r1, [sp] movs r1, 0x1 negs r1, r1 str r1, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0x1 bl box_print mov r2, r10 ldr r0, [r2] add r0, r9 adds r0, r6 ldrb r0, [r0] movs r1, 0x2 bl 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, =0x02022cf8 ldr r1, [r0] ldr r0, =0x00003014 adds r1, r0 b @0802962A .align 2, 0 .pool @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, =0x00003008 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, =0x02022cf8 ldr r1, [r0] ldr r2, =0x00003014 adds r1, r2 @0802962A: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0802968E .align 2, 0 .pool @08029640: ldr r5, =0x02022cf8 ldr r0, [r5] ldr r4, =0x00003008 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, =0x02022cf8 ldr r0, [r0] movs r3, 0xC0 lsls r3, 6 adds r0, r3 movs r1, 0x1 str r1, [r0] @0802968E: add sp, 0x1C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8029440 thumb_func_start sub_80296A8 sub_80296A8: ; 80296A8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x6C lsls r0, 24 movs r1, 0 mov r8, r1 movs r6, 0 lsrs r7, r0, 24 add r4, sp, 0x2C ldr r1, =gUnknown_082FB45C adds r0, r4, 0 movs r2, 0x5 bl memcpy movs r5, 0 cmp r5, r7 bcs @080296F8 add r4, sp, 0x34 @080296D2: mov r0, sp adds r0, r5 adds r0, 0x2C strb r5, [r0] add r0, sp, 0x5C adds r1, r5, 0 bl sub_802793C lsls r2, r5, 3 adds r2, r4, r2 ldr r0, [sp, 0x5C] ldr r1, [sp, 0x60] str r0, [r2] str r1, [r2, 0x4] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, r7 bcc @080296D2 @080296F8: bl sub_8027748 cmp r0, 0 beq @0802972E @08029700: movs r5, 0 cmp r5, r7 bcs @08029728 add r2, sp, 0x34 add r1, sp, 0x2C @0802970A: lsls r0, r5, 3 adds r0, r2, r0 ldrb r0, [r0] cmp r0, r8 bne @0802971E adds r0, r1, r6 strb r5, [r0] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0802971E: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, r7 bcc @0802970A @08029728: mov r8, r6 cmp r6, r7 bcc @08029700 @0802972E: movs r5, 0 ldr r4, =gUnknown_085EDE5D cmp r5, r7 bcs @08029754 add r1, sp, 0x34 add r6, sp, 0x38 subs r3, r7, 0x1 @0802973C: lsls r2, r5, 3 adds r0, r6, r2 ldr r0, [r0] cmp r0, 0 bne @0802974A adds r0, r1, r2 strb r3, [r0] @0802974A: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, r7 bcc @0802973C @08029754: movs r0, 0x1 adds r1, r4, 0 movs r2, 0 bl 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, =0x00003009 mov r10, r3 @08029774: movs r0, 0 mov r8, r0 mov r0, sp adds r0, r5 adds r0, 0x2C ldrb r0, [r0] adds r4, r0, 0 lsls r1, r4, 3 add r0, sp, 0x38 adds r0, r1 ldr r0, [r0] mov r9, r0 ldr r2, =0x02022cf8 ldr r0, [r2] add r0, r10 ldrb r0, [r0] ldr r2, =gUnknown_082FB3DC ldr r3, [sp, 0x68] adds r1, r3, r1 ldrb r1, [r1] lsls r1, 2 adds r1, r2 ldr r2, [r1] ldr r3, =gUnknown_082FB402 lsls r1, r5, 1 adds r1, r3 ldrb r6, [r1] str r6, [sp] movs r1, 0xFF str r1, [sp, 0x4] mov r3, r8 str r3, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 bl Print bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 cmp r4, r0 bne @080297CC movs r0, 0x2 mov r8, r0 @080297CC: adds r0, r4, 0 bl sub_8027660 adds r3, r0, 0 ldr r1, =0x02022cf8 ldr r0, [r1] add r0, r10 ldrb r0, [r0] mov r2, r8 lsls r1, r2, 1 add r1, r8 ldr r2, =gUnknown_082FB380 adds r1, r2 str r1, [sp] movs r1, 0x1 negs r1, r1 str r1, [sp, 0x4] str r3, [sp, 0x8] movs r1, 0x1 movs r2, 0x1C adds r3, r6, 0 bl box_print add r0, sp, 0xC mov r1, r9 movs r2, 0 movs r3, 0x7 bl 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, =0x02022cf8 ldr r0, [r2] add r0, r10 ldrb r0, [r0] ldr r1, [sp, 0x64] subs r3, r1, r3 lsls r3, 24 lsrs r3, 24 str r6, [sp] movs r2, 0xFF str r2, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 add r2, sp, 0xC bl Print ldr r2, =0x02022cf8 ldr r0, [r2] add r0, r10 ldrb r0, [r0] ldr r1, [sp, 0x64] lsls r3, r1, 24 str r6, [sp] movs r2, 0xFF str r2, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 ldr r2, =gUnknown_085EDE5D lsrs r3, 24 bl Print adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, r7 bcc @08029774 @08029860: add sp, 0x6C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80296A8 thumb_func_start sub_802988C sub_802988C: ; 802988C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x14 bl sub_8027650 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0xC] ldr r6, =0x02022cf8 ldr r1, [r6] ldr r2, =0x00003014 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0xB bls @080298B2 b @08029FA8 @080298B2: lsls r0, 2 ldr r1, =@080298C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080298C8: .4byte @080298F8 .4byte @08029914 .4byte @0802996C .4byte @08029B6C .4byte @08029BB8 .4byte @08029BFC .4byte @08029C60 .4byte @08029C9C .4byte @08029CE0 .4byte @08029DA0 .4byte @08029F08 .4byte @08029F5C @080298F8: bl sub_802784C ldr r0, =0x02022cf8 ldr r1, [r0] ldr r0, =0x0000301c adds r2, r1, r0 movs r0, 0 strh r0, [r2] b @08029F8A .align 2, 0 .pool @08029914: ldr r6, =gUnknown_082F7BBC adds r0, r6, 0 bl Window_AddFromTemplate ldr r4, =0x02022cf8 ldr r1, [r4] ldr r2, =0x00003008 mov r8, r2 add r1, r8 strb r0, [r1] movs r0, 0x8 adds r0, r6 mov r9, r0 bl Window_AddFromTemplate ldr r1, [r4] ldr r5, =0x00003009 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 .pool @0802996C: ldr r4, =0x02022cf8 ldr r0, [r4] ldr r5, =0x00003008 adds r0, r5 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, [r4] ldr r1, =0x00003009 mov r9, r1 add r0, r9 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r2, =gUnknown_085EDD49 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, =gUnknown_085EDD6B movs r1, 0x11 str r1, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] movs r1, 0x1 movs r3, 0x44 bl Print mov r9, r5 ldr r0, [sp, 0xC] cmp r9, r0 bcc @080299E2 b @08029B2A @080299E2: movs r4, 0 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 cmp r9, r0 bne @080299F2 movs r4, 0x2 @080299F2: mov r0, r9 bl sub_8027660 adds r6, r0, 0 ldr r0, =0x02022cf8 ldr r0, [r0] ldr r1, =0x00003009 adds r0, r1 ldrb r0, [r0] mov r2, r9 lsls r5, r2, 1 ldr r2, =gUnknown_082FB3F8 adds r1, r5, r2 ldrb r3, [r1] lsls r1, r4, 1 adds r1, r4 ldr r2, =gUnknown_082FB380 adds r1, r2 str r1, [sp] movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] str r6, [sp, 0x8] movs r1, 0x1 movs r2, 0 bl box_print movs r7, 0 mov r8, r5 mov r0, r9 adds r0, 0x1 str r0, [sp, 0x10] ldr r1, =0x02021fc4 mov r10, r1 @08029A36: mov r0, r9 adds r1, r7, 0 bl sub_80276A0 lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000270f bl sub_8027A38 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r7, 0 bl sub_802778C ldr r1, =0x0000270f bl sub_8027A38 lsls r0, 16 lsrs r6, r0, 16 mov r0, r10 adds r1, r4, 0 movs r2, 0 movs r3, 0x4 bl 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, =0x02022cf8 ldr r0, [r0] ldr r2, =0x00003009 adds r0, r2 ldrb r0, [r0] lsls r1, r7, 1 ldr r2, =gUnknown_082FB3F0 adds r1, r2 ldrb r2, [r1] subs r2, r5 lsls r2, 24 lsrs r2, 24 ldr r1, =gUnknown_082FB3F8 add r1, r8 ldrb r3, [r1] ldr r1, =gUnknown_082FB383 str r1, [sp] movs r1, 0x1 negs r1, r1 str r1, [sp, 0x4] mov r1, r10 str r1, [sp, 0x8] movs r1, 0x1 bl box_print b @08029B10 .align 2, 0 .pool @08029AE0: ldr r0, =0x02022cf8 ldr r0, [r0] ldr r2, =0x00003009 adds r0, r2 ldrb r0, [r0] lsls r1, r7, 1 ldr r2, =gUnknown_082FB3F0 adds r1, r2 ldrb r3, [r1] subs r3, r5 lsls r3, 24 lsrs r3, 24 ldr r1, =gUnknown_082FB3F8 add r1, r8 ldrb r1, [r1] str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 ldr r2, =0x02021fc4 bl Print @08029B10: adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 cmp r7, 0x3 bls @08029A36 ldr r1, [sp, 0x10] lsls r0, r1, 24 lsrs r0, 24 mov r9, r0 ldr r2, [sp, 0xC] cmp r9, r2 bcs @08029B2A b @080299E2 @08029B2A: ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x00003008 adds r0, r1 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r0, [r4] ldr r2, =0x00003009 adds r0, r2 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r1, [r4] ldr r0, =0x00003014 adds r1, r0 b @08029F8E .align 2, 0 .pool @08029B6C: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @08029B90 ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x00003008 adds r0, r1 ldrb r0, [r0] bl Window_WriteStandardTileMap ldr r0, [r4] ldr r2, =0x00003009 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, =0x02022cf8 ldr r1, [r0] ldr r0, =0x00003014 adds r1, r0 b @08029F8E .align 2, 0 .pool @08029BB8: ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x0000301c adds r2, r0, r1 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] lsls r0, 16 lsrs r0, 16 cmp r0, 0x1D bhi @08029BD0 b @08029FF8 @08029BD0: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08029BDE b @08029FF8 @08029BDE: movs r0, 0 strh r0, [r2] movs r0, 0x5 bl audio_play movs r0, 0x1 bl sub_8028C30 b @08029F88 .align 2, 0 .pool @08029BFC: ldr r4, =0x02022cf8 ldr r0, [r4] ldr r5, =0x00003008 adds r0, r5 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, [r4] ldr r1, =0x00003009 adds r0, r1 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r6, =gUnknown_085EDD86 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 .pool @08029C60: ldr r0, [sp, 0xC] bl sub_80296A8 ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x00003008 adds r0, r1 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r0, [r4] ldr r2, =0x00003009 adds r0, r2 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r1, [r4] ldr r0, =0x00003014 adds r1, r0 b @08029F8E .align 2, 0 .pool @08029C9C: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @08029CC0 ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x00003008 adds r0, r1 ldrb r0, [r0] bl Window_WriteStandardTileMap ldr r0, [r4] ldr r2, =0x00003009 adds r0, r2 ldrb r0, [r0] bl Window_WriteStandardTileMap @08029CC0: movs r0, 0 bl gpu_copy_wram_bg_tilemap_to_vram ldr r0, =0x02022cf8 ldr r1, [r0] ldr r0, =0x00003014 adds r1, r0 b @08029F8E .align 2, 0 .pool @08029CE0: ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x0000301c adds r2, r0, r1 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] lsls r0, 16 lsrs r0, 16 cmp r0, 0x1D bhi @08029CF8 b @08029FF8 @08029CF8: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08029D06 b @08029FF8 @08029D06: movs r0, 0 strh r0, [r2] movs r0, 0x5 bl audio_play bl sub_8027748 ldr r1, =0x00000bb7 cmp r0, r1 bhi @08029D3C ldr r0, [r4] ldr r2, =0x00003014 adds r0, r2 movs r1, 0x7F strb r1, [r0] b @08029D4C .align 2, 0 .pool @08029D3C: bl sub_80A2F30 ldr r1, [r4] ldr r0, =0x00003014 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @08029D4C: movs r0, 0x1E str r0, [sp] movs r0, 0xF str r0, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0x5 bl bg_fill_tilemap_rect ldr r5, =0x02022cf8 ldr r0, [r5] ldr r4, =0x00003009 adds r0, r4 ldrb r0, [r0] bl Window_Remove ldr r6, =gUnknown_082F7BCC 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 .pool @08029DA0: ldr r0, =0x0000016f bl current_map_music_set ldr r4, =0x02022cf8 ldr r0, [r4] ldr r6, =0x00003008 adds r0, r6 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, [r4] ldr r1, =0x00003009 mov r10, r1 add r0, r10 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r5, =gUnknown_085EDD9B 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, =0x02021cc4 adds r1, r5, 0 bl itemid_get_name movs r0, 0 adds r1, r5, 0 bl sub_81AFC0C ldr r7, =0x02021fc4 ldr r1, =gUnknown_085EDDBD adds r0, r7, 0 bl sub_81AFC28 ldr r0, [r4] add r0, r10 ldrb r0, [r0] mov r2, r9 str r2, [sp] mov r1, r8 str r1, [sp, 0x4] str r6, [sp, 0x8] movs r1, 0x1 adds r2, r7, 0 movs r3, 0 bl Print bl sub_80279C8 lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 cmp r4, 0 beq @08029EC8 cmp r4, 0x3 beq @08029EC8 bl sub_81AFBF0 bl sub_802762C lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 bl itemid_get_name movs r0, 0 adds r1, r5, 0 bl sub_81AFC0C cmp r4, 0x2 bne @08029E9C ldr r1, =gUnknown_085EDDE2 adds r0, r7, 0 bl sub_81AFC28 b @08029EA8 .align 2, 0 .pool @08029E9C: cmp r6, 0x1 bne @08029EA8 ldr r1, =gUnknown_085EDDFB adds r0, r7, 0 bl sub_81AFC28 @08029EA8: ldr r0, =0x02022cf8 ldr r0, [r0] ldr r2, =0x00003009 adds r0, r2 ldrb r0, [r0] ldr r2, =0x02021fc4 movs r1, 0x29 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print @08029EC8: ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x00003008 adds r0, r1 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r0, [r4] ldr r2, =0x00003009 adds r0, r2 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r1, [r4] ldr r0, =0x00003014 adds r1, r0 b @08029F8E .align 2, 0 .pool @08029F08: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @08029F2C ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x00003008 adds r0, r1 ldrb r0, [r0] bl Window_WriteStandardTileMap ldr r0, [r4] ldr r2, =0x00003009 adds r0, r2 ldrb r0, [r0] bl Window_WriteStandardTileMap @08029F2C: movs r0, 0 bl gpu_copy_wram_bg_tilemap_to_vram ldr r0, =0x0000020b movs r1, 0x14 movs r2, 0xA bl sub_80A2FBC ldr r0, =0x02022cf8 ldr r1, [r0] ldr r0, =0x00003014 adds r1, r0 b @08029F8E .align 2, 0 .pool @08029F5C: ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x0000301c adds r2, r0, r1 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] lsls r0, 16 lsrs r0, 16 cmp r0, 0x1D bls @08029FF8 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08029FF8 movs r0, 0 strh r0, [r2] movs r0, 0x5 bl audio_play @08029F88: ldr r1, [r4] @08029F8A: ldr r2, =0x00003014 adds r1, r2 @08029F8E: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08029FF8 .align 2, 0 .pool @08029FA8: ldr r5, =0x00003008 adds r0, r1, r5 ldrb r0, [r0] bl Window_FillTileMap ldr r0, [r6] ldr r4, =0x00003009 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 .pool thumb_func_end sub_802988C thumb_func_start sub_802A010 sub_802A010: ; 802A010 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 ldr r1, =0x02022cf8 ldr r2, [r1] ldr r3, =0x00003014 adds r0, r2, r3 ldrb r6, [r0] adds r7, r1, 0 cmp r6, 0x1 beq @0802A0CC cmp r6, 0x1 bgt @0802A040 cmp r6, 0 beq @0802A04E b @0802A2FC .align 2, 0 .pool @0802A040: cmp r6, 0x2 bne @0802A046 b @0802A194 @0802A046: cmp r6, 0x3 bne @0802A04C b @0802A1D0 @0802A04C: b @0802A2FC @0802A04E: ldr r0, =gUnknown_082F7BD4 mov r9, r0 bl Window_AddFromTemplate ldr r1, [r7] ldr r4, =0x00003008 adds r1, r4 strb r0, [r1] movs r1, 0x8 add r1, r9 mov r8, r1 mov r0, r8 bl Window_AddFromTemplate ldr r1, [r7] ldr r2, =0x00003009 adds r1, r2 strb r0, [r1] ldr r0, [r7] adds r0, r4 ldrb r0, [r0] bl Window_FillTileMap ldr r0, [r7] ldr r3, =0x00003009 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, =0x00003014 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r7] ldr r1, =0x00003020 adds r0, r1 strb r6, [r0] ldr r0, [r7] ldr r2, =0x00003024 adds r0, r2 strb r6, [r0] b @0802A35E .align 2, 0 .pool @0802A0CC: ldr r3, =0x00003008 mov r8, r3 adds r0, r2, r3 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, [r7] ldr r1, =0x00003009 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, =gUnknown_085EDE18 movs r1, 0x5 str r1, [sp] movs r3, 0xFF mov r9, r3 str r3, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r7] add r0, r10 ldrb r0, [r0] ldr r2, =gUnknown_085EAE62 str r6, [sp] mov r3, r9 str r3, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 bl Print ldr r0, [r7] add r0, r10 ldrb r0, [r0] ldr r2, =gUnknown_085EAE66 movs r1, 0x11 str r1, [sp] mov r3, r9 str r3, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 bl Print ldr r0, [r7] add r0, r10 ldrb r0, [r0] ldr r2, =gUnknown_085E8D60 str r6, [sp] mov r3, r9 str r3, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r7] add r0, r8 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r0, [r7] add r0, r10 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r1, [r7] ldr r2, =0x00003014 adds r1, r2 b @0802A2EA .align 2, 0 .pool @0802A194: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @0802A1B6 ldr r0, [r7] ldr r3, =0x00003008 adds r0, r3 ldrb r0, [r0] bl Window_WriteStandardTileMap ldr r0, [r7] ldr r1, =0x00003009 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, =0x00003014 adds r1, r2 b @0802A2EA .align 2, 0 .pool @0802A1D0: ldr r3, =0x00003020 adds r0, r2, r3 ldrb r5, [r0] cmp r5, 0 bne @0802A1DC movs r5, 0x1 @0802A1DC: ldr r0, =0x00003009 mov r8, r0 adds r0, r2, r0 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, [r7] add r0, r8 ldrb r0, [r0] ldr r2, =gUnknown_085EAE62 movs r1, 0x1 str r1, [sp] movs r3, 0xFF mov r10, r3 str r3, [sp, 0x4] movs r1, 0 mov r9, r1 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 bl Print ldr r0, [r7] add r0, r8 ldrb r0, [r0] ldr r2, =gUnknown_085EAE66 movs r1, 0x11 str r1, [sp] mov r3, r10 str r3, [sp, 0x4] mov r1, r9 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x8 bl Print ldr r0, [r7] add r0, r8 ldrb r0, [r0] ldr r2, =gUnknown_085E8D60 subs r1, r5, 0x1 lsls r1, 4 adds r1, 0x1 lsls r1, 24 lsrs r1, 24 str r1, [sp] mov r3, r10 str r3, [sp, 0x4] mov r1, r9 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r7] add r0, r8 ldrb r0, [r0] movs r1, 0x3 bl Window_CopyToVram ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r5, 0x1 movs r2, 0x1 ands r2, r1 cmp r2, 0 beq @0802A294 movs r0, 0x5 bl audio_play ldr r0, [r7] ldr r3, =0x00003020 adds r1, r0, r3 ldrb r0, [r1] cmp r0, 0 bne @0802A2E4 strb r5, [r1] b @0802A2E4 .align 2, 0 .pool @0802A294: movs r0, 0xC0 ands r0, r1 cmp r0, 0 beq @0802A2CC movs r0, 0x5 bl audio_play ldr r0, [r7] ldr r2, =0x00003020 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0x1 beq @0802A2C2 cmp r0, 0x1 bgt @0802A2BC cmp r0, 0 beq @0802A2C2 b @0802A35E .align 2, 0 .pool @0802A2BC: cmp r0, 0x2 beq @0802A2C8 b @0802A35E @0802A2C2: movs r0, 0x2 strb r0, [r1] b @0802A35E @0802A2C8: strb r5, [r1] b @0802A35E @0802A2CC: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0802A35E movs r0, 0x5 bl audio_play ldr r0, [r7] ldr r3, =0x00003020 adds r0, r3 movs r1, 0x2 strb r1, [r0] @0802A2E4: ldr r1, [r7] ldr r0, =0x00003014 adds r1, r0 @0802A2EA: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0802A35E .align 2, 0 .pool @0802A2FC: ldr r0, [r7] ldr r2, =0x00003020 adds r1, r0, r2 ldrb r1, [r1] ldr r3, =0x00003024 adds r0, r3 strb r1, [r0] ldr r0, [r7] ldr r6, =0x00003008 adds r0, r6 ldrb r0, [r0] bl Window_FillTileMap ldr r0, [r7] ldr r1, =0x00003009 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, =0x00003009 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 .pool thumb_func_end sub_802A010 thumb_func_start sub_802A380 sub_802A380: ; 802A380 push {r4-r6,lr} sub sp, 0x10 ldr r5, =0x02022cf8 ldr r0, [r5] ldr r6, =0x00003014 adds r0, r6 ldrb r4, [r0] cmp r4, 0x1 beq @0802A3D8 cmp r4, 0x1 bgt @0802A3A4 cmp r4, 0 beq @0802A3AE b @0802A420 .align 2, 0 .pool @0802A3A4: cmp r4, 0x2 beq @0802A3EC cmp r4, 0x3 beq @0802A404 b @0802A420 @0802A3AE: movs r0, 0 movs r1, 0 bl sub_81973C4 ldr r2, =gUnknown_082C8959 str r4, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 movs r3, 0 bl text_box_related_one b @0802A410 .align 2, 0 .pool @0802A3D8: movs r0, 0 movs r1, 0x3 bl Window_CopyToVram ldr r1, [r5] ldr r0, =0x00003014 adds r1, r0 b @0802A414 .align 2, 0 .pool @0802A3EC: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @0802A448 ldr r0, =sub_8153688 movs r1, 0 bl AddTask b @0802A410 .align 2, 0 .pool @0802A404: ldr r0, =sub_8153688 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @0802A448 @0802A410: ldr r1, [r5] adds r1, r6 @0802A414: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0802A448 .align 2, 0 .pool @0802A420: movs r0, 0x1E str r0, [sp] movs r0, 0x14 str r0, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl bg_fill_tilemap_rect movs r0, 0 bl gpu_copy_wram_bg_tilemap_to_vram ldr r0, =0x02022cf8 ldr r0, [r0] movs r1, 0xC0 lsls r1, 6 adds r0, r1 movs r1, 0x1 str r1, [r0] @0802A448: add sp, 0x10 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802A380 thumb_func_start sub_802A454 sub_802A454: ; 802A454 push {r4-r6,lr} sub sp, 0xC ldr r1, =0x02022cf8 ldr r2, [r1] ldr r6, =0x00003014 adds r0, r2, r6 ldrb r0, [r0] adds r5, r1, 0 cmp r0, 0x1 beq @0802A4AC cmp r0, 0x1 bgt @0802A47C cmp r0, 0 beq @0802A482 b @0802A520 .align 2, 0 .pool @0802A47C: cmp r0, 0x2 beq @0802A4F4 b @0802A520 @0802A482: ldr r4, =gUnknown_082F7BEC adds r0, r4, 0 bl Window_AddFromTemplate ldr r1, [r5] ldr r2, =0x00003008 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 .pool @0802A4AC: ldr r4, =0x00003008 adds r0, r2, r4 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, [r5] adds r0, r4 ldrb r0, [r0] ldr r2, =gUnknown_085EDE65 movs r1, 0x5 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r5] adds r0, r4 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r1, [r5] ldr r0, =0x00003014 adds r1, r0 b @0802A514 .align 2, 0 .pool @0802A4F4: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @0802A50A ldr r0, [r5] ldr r1, =0x00003008 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 .pool @0802A520: ldr r0, [r5] movs r1, 0xC0 lsls r1, 6 adds r0, r1 movs r1, 0x1 str r1, [r0] @0802A52C: add sp, 0xC pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_802A454 thumb_func_start sub_802A534 sub_802A534: ; 802A534 push {r4,r5,lr} sub sp, 0x8 ldr r5, =0x02022cf8 ldr r0, [r5] ldr r4, =0x00003008 adds r0, r4 ldrb r0, [r0] bl 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 .pool thumb_func_end sub_802A534 thumb_func_start sub_802A588 sub_802A588: ; 802A588 push {r4-r7,lr} sub sp, 0xC ldr r0, =0x02022cf8 ldr r1, [r0] ldr r7, =0x00003014 adds r2, r1, r7 ldrb r5, [r2] adds r6, r0, 0 cmp r5, 0x1 beq @0802A610 cmp r5, 0x1 bgt @0802A5B0 cmp r5, 0 beq @0802A5BA b @0802A6A4 .align 2, 0 .pool @0802A5B0: cmp r5, 0x2 beq @0802A658 cmp r5, 0x3 beq @0802A684 b @0802A6A4 @0802A5BA: ldr r4, =gUnknown_082F7BE4 adds r0, r4, 0 bl Window_AddFromTemplate ldr r1, [r6] ldr r2, =0x00003008 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, =0x0000301c adds r1, r0, r2 movs r2, 0 strh r5, [r1] ldr r1, =0x00003020 adds r0, r1 strb r2, [r0] ldr r0, [r6] adds r1, 0x4 adds r0, r1 strb r2, [r0] b @0802A6EA .align 2, 0 .pool @0802A610: ldr r4, =0x00003008 adds r0, r1, r4 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, [r6] adds r0, r4 ldrb r0, [r0] ldr r2, =gUnknown_085EDE2C movs r1, 0x5 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r6] adds r0, r4 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram ldr r1, [r6] ldr r2, =0x00003014 adds r1, r2 b @0802A678 .align 2, 0 .pool @0802A658: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @0802A66E ldr r0, [r6] ldr r1, =0x00003008 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 .pool @0802A684: ldr r0, =0x0000301c adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] lsls r0, 16 lsrs r0, 16 cmp r0, 0x77 bls @0802A6EA ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] b @0802A6EA .align 2, 0 .pool @0802A6A4: ldr r0, [r6] ldr r1, =0x00003024 adds r0, r1 movs r1, 0x5 strb r1, [r0] ldr r0, [r6] ldr r4, =0x00003008 adds r0, r4 ldrb r0, [r0] bl 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 .pool thumb_func_end sub_802A588 thumb_func_start unused_0 unused_0: ; 802A6FC push {r4,lr} ldr r4, =0x02022cf8 ldr r0, [r4] ldr r1, =0x00003004 adds r0, r1 ldrb r0, [r0] bl remove_task ldr r0, [r4] movs r1, 0xC0 lsls r1, 6 adds r0, r1 movs r1, 0x1 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end unused_0 thumb_func_start nullsub_16 nullsub_16: ; 802A728 bx lr thumb_func_end nullsub_16 thumb_func_start sub_802A72C sub_802A72C: ; 802A72C push {r4,lr} ldr r2, =0x02022cf8 ldr r1, [r2] ldr r3, =0x00003014 adds r1, r3 movs r3, 0 strb r3, [r1] ldr r1, [r2] movs r4, 0xC0 lsls r4, 6 adds r2, r1, r4 str r3, [r2] ldr r2, =0x00003028 adds r1, r2 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802A72C thumb_func_start sub_802A75C sub_802A75C: ; 802A75C ldr r0, =0x02022cf8 ldr r0, [r0] ldr r1, =0x00003028 adds r0, r1 ldr r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_802A75C thumb_func_start sub_802A770 sub_802A770: ; 802A770 push {lr} ldr r0, =0x02022cf8 ldr r0, [r0] movs r1, 0xC0 lsls r1, 6 adds r0, r1 ldr r0, [r0] cmp r0, 0x1 beq @0802A78C movs r0, 0x1 b @0802A78E .align 2, 0 .pool @0802A78C: movs r0, 0 @0802A78E: pop {r1} bx r1 thumb_func_end sub_802A770 thumb_func_start sub_802A794 sub_802A794: ; 802A794 ldr r0, =0x02022cf8 ldr r0, [r0] ldr r1, =0x00003024 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_802A794 thumb_func_start sub_802A7A8 sub_802A7A8: ; 802A7A8 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x8 movs r3, 0xC0 lsls r3, 19 movs r4, 0xC0 lsls r4, 9 add r0, sp, 0x4 mov r8, r0 mov r2, sp movs r6, 0 ldr r1, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 movs r0, 0x81 lsls r0, 24 mov r12, r0 @0802A7CE: strh r6, [r2] mov r0, sp str r0, [r1] str r3, [r1, 0x4] str r7, [r1, 0x8] ldr r0, [r1, 0x8] adds r3, r5 subs r4, r5 cmp r4, r5 bhi @0802A7CE strh r6, [r2] mov r2, sp str r2, [r1] str r3, [r1, 0x4] lsrs r0, r4, 1 mov r2, r12 orrs r0, r2 str r0, [r1, 0x8] ldr r0, [r1, 0x8] movs r0, 0xE0 lsls r0, 19 movs r3, 0x80 lsls r3, 3 movs r4, 0 str r4, [sp, 0x4] ldr r2, =0x040000d4 mov r1, r8 str r1, [r2] str r0, [r2, 0x4] lsrs r0, r3, 2 movs r1, 0x85 lsls r1, 24 orrs r0, r1 str r0, [r2, 0x8] ldr r0, [r2, 0x8] movs r1, 0xA0 lsls r1, 19 mov r0, sp strh r4, [r0] str r0, [r2] str r1, [r2, 0x4] lsrs r3, 1 movs r0, 0x81 lsls r0, 24 orrs r3, r0 str r3, [r2, 0x8] ldr r0, [r2, 0x8] movs r0, 0 movs r1, 0 bl lcd_io_set movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_082F7BA4 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, =0x02022cf8 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 .pool thumb_func_end sub_802A7A8 thumb_func_start sub_802A8E8 sub_802A8E8: ; 802A8E8 push {lr} sub sp, 0x4 ldr r0, =0x02022cf8 ldr r0, [r0] ldr r2, =0x00003018 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0x5 bhi @0802A982 lsls r0, 2 ldr r1, =@0802A910 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802A910: .4byte @0802A928 .4byte @0802A938 .4byte @0802A93E .4byte @0802A94C .4byte @0802A964 .4byte @0802A972 @0802A928: ldr r0, =gUnknown_082F7DF0 movs r1, 0 movs r2, 0x40 bl gpu_pal_apply b @0802A98A .align 2, 0 .pool @0802A938: bl reset_temp_tile_data_buffers b @0802A98A @0802A93E: ldr r1, =gUnknown_082F8084 movs r0, 0 str r0, [sp] movs r0, 0x3 b @0802A954 .align 2, 0 .pool @0802A94C: ldr r1, =gUnknown_082F8914 movs r0, 0 str r0, [sp] movs r0, 0x1 @0802A954: movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram b @0802A98A .align 2, 0 .pool @0802A964: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0802A98A b @0802A998 @0802A972: movs r0, 0x3 bl stdpal_get movs r1, 0xD0 movs r2, 0x20 bl gpu_pal_apply b @0802A98A @0802A982: movs r0, 0 strb r0, [r1] movs r0, 0x1 b @0802A99A @0802A98A: ldr r0, =0x02022cf8 ldr r1, [r0] ldr r0, =0x00003018 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0802A998: movs r0, 0 @0802A99A: add sp, 0x4 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802A8E8 thumb_func_start sub_802A9A8 sub_802A9A8: ; 802A9A8 push {r4-r7,lr} adds r6, r1, 0 lsls r0, 16 lsrs r7, r0, 16 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0802AA3C ldr r5, =0x02022cfc ldr r0, =0x000083b0 bl malloc str r0, [r5] cmp r0, 0 beq @0802AA3C bl clear_tasks ldr r0, =sub_802ACA0 movs r1, 0x1 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, [r5] movs r1, 0 strh r1, [r0, 0x8] str r6, [r0] strb r4, [r0, 0x4] bl link_get_multiplayer_id ldr r1, [r5] strb r0, [r1, 0x6] ldr r0, [r5] ldrb r2, [r0, 0x6] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 ldr r2, =0x000082a8 adds r1, r2 adds r0, r1 movs r1, 0x64 muls r1, r7 ldr r2, =0x020244ec adds r1, r2 bl sub_802AC2C ldr r0, [r5] bl sub_802AA60 ldr r2, [r5] adds r0, r4, 0 movs r1, 0x2 bl set_word_task_arg ldr r0, =sub_802AC6C bl set_callback2 b @0802AA42 .align 2, 0 .pool @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, =0x02022cfc ldr r0, [r0] bl free pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802AA48 thumb_func_start sub_802AA60 sub_802AA60: ; 802AA60 push {r4,lr} adds r4, r0, 0 bl sub_8009FCC movs r2, 0 strb r0, [r4, 0x5] adds r1, r4, 0 adds r1, 0x70 movs r0, 0x5 strb r0, [r1] adds r0, r4, 0 adds r0, 0x72 strh r2, [r0] bl sub_802AB20 adds r0, r4, 0 bl sub_802AA94 ldrb r0, [r4, 0x5] cmp r0, 0x5 bne @0802AA8E bl sub_802E3A8 @0802AA8E: pop {r4} pop {r0} bx r0 thumb_func_end sub_802AA60 thumb_func_start sub_802AA94 sub_802AA94: ; 802AA94 push {r4-r6,lr} adds r4, r0, 0 movs r0, 0x6 str r0, [r4, 0x14] str r0, [r4, 0x18] adds r0, r4, 0 adds r0, 0x4A movs r6, 0 movs r5, 0 strh r5, [r0] str r5, [r4, 0x1C] str r5, [r4, 0x5C] bl link_get_multiplayer_id movs r1, 0 lsls r0, 24 cmp r0, 0 bne @0802AABA movs r1, 0x1 @0802AABA: adds r0, r4, 0 adds r0, 0x47 strb r1, [r0] strh r5, [r4, 0x8] strh r5, [r4, 0xA] strh r5, [r4, 0xC] strh r5, [r4, 0xE] str r5, [r4, 0x58] strh r5, [r4, 0x3A] subs r0, 0x3 strb r6, [r0] str r5, [r4, 0x54] adds r0, 0x2 strb r6, [r0] adds r0, 0x3 strb r6, [r0] subs r0, 0x1 movs r1, 0x1 strb r1, [r0] str r5, [r4, 0x78] adds r0, 0x29 strb r6, [r0] adds r0, 0x3 strh r5, [r0] str r1, [r4, 0x60] subs r0, 0x27 strb r6, [r0] str r5, [r4, 0x68] str r5, [r4, 0x64] str r5, [r4, 0x2C] str r5, [r4, 0x30] bl sub_802AB98 bl sub_802C0E8 movs r2, 0 adds r5, r4, 0 adds r5, 0x7C movs r3, 0 adds r1, r4, 0 adds r1, 0x9A @0802AB0C: adds r0, r5, r2 strb r3, [r0] strh r3, [r1] adds r1, 0x2 adds r2, 0x1 cmp r2, 0x4 ble @0802AB0C pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_802AA94 thumb_func_start sub_802AB20 sub_802AB20: ; 802AB20 push {r4-r7,lr} mov r7, r8 push {r7} ldr r7, =0x02022cfc movs r6, 0 movs r5, 0 ldr r0, =gUnknown_082FB464 mov r8, r0 movs r4, 0x4 @0802AB32: ldr r0, [r7] adds r0, r5 ldr r1, =0x000082a8 adds r0, r1 ldrh r0, [r0] bl sub_802AC00 lsls r0, 16 ldr r1, [r7] adds r1, r6 asrs r0, 14 add r0, r8 ldrh r0, [r0, 0x2] ldr r2, =0x000082f0 adds r1, r2 strh r0, [r1] adds r6, 0x28 adds r5, 0xC subs r4, 0x1 cmp r4, 0 bge @0802AB32 ldr r0, =0x02022cfc ldr r1, [r0] ldr r0, =0x000083ac adds r3, r1, r0 ldrb r2, [r1, 0x6] lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r2, =0x000082e4 adds r0, r2 adds r1, r0 str r1, [r3] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802AB20 thumb_func_start sub_802AB98 sub_802AB98: ; 802AB98 push {r4-r7,lr} movs r5, 0 ldr r6, =0x02022cfc movs r4, 0 movs r3, 0 @0802ABA2: ldr r2, [r6] adds r1, r2, r3 ldr r7, =0x000082f2 adds r0, r1, r7 strh r4, [r0] adds r7, 0x2 adds r0, r1, r7 strh r4, [r0] ldr r0, =0x000082f6 adds r1, r0 strh r4, [r1] ldr r1, =0x000082e4 adds r0, r2, r1 adds r0, r3 str r4, [r0] subs r7, 0xC adds r0, r2, r7 adds r0, r3 ldr r1, =0x7fffffff str r1, [r0] ldr r1, =0x000082f8 adds r0, r2, r1 adds r0, r3 str r4, [r0] adds r2, 0x8B adds r2, r5 movs r0, 0x9 strb r0, [r2] adds r3, 0x28 adds r5, 0x1 cmp r5, 0x4 ble @0802ABA2 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802AB98 thumb_func_start sub_802AC00 sub_802AC00: ; 802AC00 push {lr} lsls r0, 16 lsrs r3, r0, 16 movs r1, 0 ldr r2, =gUnknown_082FB464 @0802AC0A: ldrh r0, [r2] cmp r0, r3 bne @0802AC1C lsls r0, r1, 16 asrs r0, 16 b @0802AC28 .align 2, 0 .pool @0802AC1C: adds r2, 0x4 adds r1, 0x1 cmp r1, 0x63 bls @0802AC0A movs r0, 0x1 negs r0, r0 @0802AC28: pop {r1} bx r1 thumb_func_end sub_802AC00 thumb_func_start sub_802AC2C sub_802AC2C: ; 802AC2C push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr strh r0, [r5] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr str r0, [r5, 0x4] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [r5, 0x8] pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_802AC2C thumb_func_start sub_802AC58 sub_802AC58: ; 802AC58 push {lr} bl copy_pal_bg_faded_to_pal_ram bl 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, =0x02022cfc ldr r1, [r2] movs r3, 0 strb r0, [r1, 0x4] ldr r0, [r2] strh r3, [r0, 0x8] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802AC84 thumb_func_start sub_802ACA0 sub_802ACA0: ; 802ACA0 push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x02022cfc ldr r0, [r1] ldrh r0, [r0, 0x8] adds r2, r1, 0 cmp r0, 0x5 bls @0802ACB6 b @0802AE08 @0802ACB6: lsls r0, 2 ldr r1, =@0802ACC8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_802BD84 movs r1, 0x5 bl sub_802BE60 movs r0, 0x4 bl sub_80A2F50 ldr r0, =0x02022cfc ldr r1, [r0] b @0802ADC0 .align 2, 0 .pool @0802AD0C: ldr r0, =sub_802BD84 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @0802AE08 ldr r4, =0x02022cfc ldr r0, [r4] adds r0, 0xA4 bl sub_802D074 bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 ldr r1, [r4] b @0802ADC0 .align 2, 0 .pool @0802AD3C: bl sub_802D0F0 cmp r0, 0 bne @0802AE08 bl sub_80A303C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0802AE08 ldr r0, =0x0000021a movs r1, 0x8 bl sub_80A2F88 ldr r0, =0x02022cfc ldr r1, [r0] b @0802ADC0 .align 2, 0 .pool @0802AD68: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0802AE08 movs r4, 0x1 negs r4, r4 adds r0, r4, 0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 movs r0, 0 str r0, [sp] adds r0, r4, 0 adds r1, r4, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =sub_802AC58 bl SetVBlankCallback ldr r0, =0x02022cfc ldr r1, [r0] b @0802ADC0 .align 2, 0 .pool @0802ADA4: bl fade_and_return_progress_probably ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 bne @0802AE08 ldr r1, =0x02022cfc ldr r0, [r1] strb r2, [r0, 0x7] ldr r1, [r1] @0802ADC0: ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0802AE08 .align 2, 0 .pool @0802ADD0: ldr r0, [r2] ldrb r1, [r0, 0x7] adds r1, 0x1 strb r1, [r0, 0x7] ldr r1, [r2] ldrb r0, [r1, 0x7] cmp r0, 0x13 bls @0802AE08 adds r0, r1, 0 adds r0, 0x47 ldrb r0, [r0] cmp r0, 0 beq @0802ADF8 ldr r0, =sub_802AF80 bl sub_802AC84 b @0802ADFE .align 2, 0 .pool @0802ADF8: ldr r0, =sub_802B194 bl sub_802AC84 @0802ADFE: bl sub_802BE80 adds r0, r4, 0 bl remove_task @0802AE08: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802ACA0 thumb_func_start sub_802AE14 sub_802AE14: ; 802AE14 push {lr} adds r1, r0, 0 cmp r1, 0 bne @0802AE34 ldr r0, =0x02022cfc ldr r1, [r0] ldr r0, =0x00001111 str r0, [r1, 0x30] movs r0, 0x1 str r0, [r1, 0x2C] b @0802AE46 .align 2, 0 .pool @0802AE34: ldr r0, =0x02022cfc ldr r2, [r0] subs r1, 0x1 movs r0, 0x1 lsls r0, r1 subs r0, 0x1 str r0, [r2, 0x30] movs r0, 0 str r0, [r2, 0x2C] @0802AE46: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802AE14 thumb_func_start sub_802AE50 sub_802AE50: ; 802AE50 push {r4-r6,lr} ldr r4, =0x02022cfc ldr r1, [r4] adds r1, 0x70 movs r2, 0 strb r0, [r1] ldr r0, [r4] movs r3, 0 strh r2, [r0, 0x8] strh r2, [r0, 0xA] adds r0, 0x48 movs r1, 0x1 strb r1, [r0] ldr r0, [r4] adds r0, 0x49 strb r3, [r0] movs r3, 0x1 ldr r0, [r4] ldrb r0, [r0, 0x5] cmp r3, r0 bge @0802AE94 adds r6, r4, 0 ldr r5, =0x000082fc movs r4, 0 movs r2, 0x28 @0802AE82: ldr r1, [r6] adds r0, r1, r5 adds r0, r2 str r4, [r0] adds r2, 0x28 adds r3, 0x1 ldrb r1, [r1, 0x5] cmp r3, r1 blt @0802AE82 @0802AE94: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802AE50 thumb_func_start sub_802AEA4 sub_802AEA4: ; 802AEA4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 movs r4, 0x1 movs r0, 0 str r0, [sp, 0x4] ldr r7, =0x02022cfc ldr r0, [r7] ldrb r0, [r0, 0x5] cmp r4, r0 bge @0802AF48 adds r1, r7, 0 mov r10, r1 movs r2, 0x2 add r2, sp mov r8, r2 ldr r3, =0x0000830c mov r9, r3 movs r6, 0x28 @0802AED0: mov r1, r10 ldr r0, [r1] adds r1, r0, r6 ldr r2, =0x000082f4 adds r1, r2 ldrh r5, [r1] add r0, r9 adds r1, r4, 0 mov r2, sp mov r3, r8 bl sub_802E264 cmp r0, 0 beq @0802AF10 ldr r2, [r7] lsls r1, r4, 1 adds r0, r2, 0 adds r0, 0x90 adds r0, r1 mov r3, r8 ldrh r1, [r3] strh r1, [r0] adds r2, 0x8B adds r2, r4 mov r0, sp ldrb r0, [r0] strb r0, [r2] ldr r0, [r7] adds r0, r6 ldr r1, =0x000082f6 adds r0, r1 strh r5, [r0] @0802AF10: mov r2, r10 ldr r1, [r2] ldr r3, =0x000082fc adds r0, r1, r3 adds r0, r6 ldr r0, [r0] cmp r0, 0 beq @0802AF36 adds r0, r1, 0 adds r0, 0x8B adds r0, r4 adds r1, 0x70 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bne @0802AF36 ldr r0, [sp, 0x4] adds r0, 0x1 str r0, [sp, 0x4] @0802AF36: movs r1, 0x28 add r9, r1 adds r6, 0x28 adds r4, 0x1 ldr r7, =0x02022cfc ldr r0, [r7] ldrb r0, [r0, 0x5] cmp r4, r0 blt @0802AED0 @0802AF48: ldr r2, =0x02022cfc ldr r1, [r2] ldrb r0, [r1, 0x5] subs r0, 0x1 ldr r3, [sp, 0x4] cmp r3, r0 bne @0802AF5C adds r1, 0x49 movs r0, 0x1 strb r0, [r1] @0802AF5C: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802AEA4 thumb_func_start sub_802AF80 sub_802AF80: ; 802AF80 push {r4,r5,lr} bl sub_802AEA4 bl sub_802C43C ldr r0, =0x02022cfc ldr r1, [r0] adds r0, r1, 0 adds r0, 0x48 ldrb r0, [r0] cmp r0, 0 bne @0802AFB2 adds r0, r1, 0 adds r0, 0x49 ldrb r0, [r0] cmp r0, 0 beq @0802AFB2 adds r0, r1, 0 adds r0, 0x4C ldrb r0, [r0] bl sub_802AE50 movs r0, 0x3 bl sub_802AE14 @0802AFB2: ldr r4, =0x02022cfc ldr r2, [r4] adds r0, r2, 0 adds r0, 0x48 ldrb r5, [r0] cmp r5, 0x1 bne @0802AFEE ldr r1, =gUnknown_082FB5F4 adds r0, 0x28 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 adds r1, r0, 0 cmp r1, 0 bne @0802AFEE ldr r0, [r4] adds r0, 0x48 strb r1, [r0] ldr r1, [r4] ldrb r2, [r1, 0x6] lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r2, =0x000082fc adds r1, r2 adds r1, r0 str r5, [r1] @0802AFEE: bl sub_802C1DC bl sub_802B008 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802AF80 thumb_func_start sub_802B008 sub_802B008: ; 802B008 push {r4,lr} ldr r4, =0x02022cfc ldr r1, [r4] ldr r0, [r1, 0x2C] cmp r0, 0 bne @0802B01E ldr r2, =0x000082e4 adds r0, r1, r2 adds r1, 0x70 bl sub_802E138 @0802B01E: ldr r1, [r4] ldr r2, [r1, 0x30] ldr r0, =0x00001111 cmp r2, r0 beq @0802B030 ldr r0, [r1, 0x2C] adds r0, 0x1 ands r0, r2 str r0, [r1, 0x2C] @0802B030: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802B008 thumb_func_start sub_802B044 sub_802B044: ; 802B044 ldr r2, =0x02022cfc ldr r1, [r2] adds r1, 0x70 movs r3, 0 strb r0, [r1] ldr r0, [r2] strh r3, [r0, 0x8] strh r3, [r0, 0xA] adds r0, 0x48 movs r1, 0x1 strb r1, [r0] ldr r1, [r2] ldrb r2, [r1, 0x6] lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r2, =0x000082fc adds r1, r2 adds r1, r0 str r3, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_802B044 thumb_func_start sub_802B078 sub_802B078: ; 802B078 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x10 ldr r4, =0x02022cfc ldr r0, [r4] ldr r2, =0x000082f4 adds r1, r0, r2 ldrh r1, [r1] mov r8, r1 ldr r3, =0x000082e4 adds r0, r3 mov r1, sp bl sub_802E1BC cmp r0, 0 beq @0802B128 ldr r2, [r4] ldrb r0, [r2, 0x6] lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r3, =0x000082fc adds r0, r2, r3 adds r0, r1 ldr r0, [r0] cmp r0, 0x1 bne @0802B0C6 mov r0, sp adds r1, r2, 0 adds r1, 0x70 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 beq @0802B0C6 mov r0, sp ldrb r0, [r0] bl sub_802B044 @0802B0C6: ldr r3, =0x02022cfc ldr r2, [r3] ldr r0, [r2, 0x78] ldr r1, [sp, 0x8] cmp r0, r1 beq @0802B108 str r1, [r2, 0x78] movs r4, 0x1 str r4, [r2, 0x5C] mov r0, sp ldrb r1, [r0, 0x1] adds r0, r2, 0 adds r0, 0x71 strb r1, [r0] ldr r0, [r3] adds r1, r0, 0 adds r1, 0x71 ldrb r1, [r1] cmp r1, 0 beq @0802B104 adds r0, 0x4D strb r4, [r0] b @0802B108 .align 2, 0 .pool @0802B104: adds r0, 0x4D strb r1, [r0] @0802B108: ldr r0, =0x02022cfc ldr r1, [r0] mov r0, sp ldrh r0, [r0, 0x2] adds r2, r1, 0 adds r2, 0x72 strh r0, [r2] mov r0, sp ldrh r2, [r0, 0x4] adds r0, r1, 0 adds r0, 0x74 strh r2, [r0] ldr r0, =0x000082f6 adds r1, r0 mov r2, r8 strh r2, [r1] @0802B128: movs r4, 0x1 ldr r2, =0x02022cfc ldr r0, [r2] ldrb r0, [r0, 0x5] cmp r4, r0 bge @0802B176 adds r7, r2, 0 ldr r6, =0x0000830c movs r5, 0x28 @0802B13A: ldr r1, [r7] ldrb r3, [r1, 0x6] cmp r4, r3 beq @0802B168 adds r0, r1, r5 ldr r3, =0x000082f4 adds r0, r3 ldrh r0, [r0] mov r8, r0 adds r0, r1, r6 adds r1, r4, 0 str r2, [sp, 0xC] bl sub_802E2D0 ldr r2, [sp, 0xC] cmp r0, 0 beq @0802B168 ldr r0, [r7] adds r0, r5 ldr r1, =0x000082f6 adds r0, r1 mov r3, r8 strh r3, [r0] @0802B168: adds r6, 0x28 adds r5, 0x28 adds r4, 0x1 ldr r0, [r2] ldrb r0, [r0, 0x5] cmp r4, r0 blt @0802B13A @0802B176: add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802B078 thumb_func_start sub_802B194 sub_802B194: ; 802B194 push {r4,lr} bl sub_802B078 ldr r4, =0x02022cfc ldr r2, [r4] adds r0, r2, 0 adds r0, 0x48 ldrb r0, [r0] cmp r0, 0 beq @0802B1E0 ldr r1, =gUnknown_082FB618 adds r0, r2, 0 adds r0, 0x70 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 adds r1, r0, 0 cmp r1, 0 bne @0802B1E0 ldr r0, [r4] adds r0, 0x48 strb r1, [r0] ldr r1, [r4] ldrb r2, [r1, 0x6] lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r2, =0x000082fc adds r1, r2 adds r1, r0 movs r0, 0x1 str r0, [r1] movs r0, 0x3 bl sub_802AE14 @0802B1E0: bl sub_802C1DC bl sub_802B1FC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802B194 thumb_func_start sub_802B1FC sub_802B1FC: ; 802B1FC push {r4,lr} ldr r4, =0x02022cfc ldr r2, [r4] ldr r0, [r2, 0x2C] cmp r0, 0 bne @0802B224 ldrb r1, [r2, 0x6] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =0x000082e4 adds r0, r1 adds r0, r2, r0 adds r1, r2, 0 adds r1, 0x70 ldrb r1, [r1] adds r2, 0x42 ldrh r2, [r2] bl sub_802E234 @0802B224: ldr r1, [r4] ldr r2, [r1, 0x30] ldr r0, =0x00001111 cmp r2, r0 beq @0802B236 ldr r0, [r1, 0x2C] adds r0, 0x1 ands r0, r2 str r0, [r1, 0x2C] @0802B236: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802B1FC thumb_func_start sub_802B248 sub_802B248: ; 802B248 push {r4,lr} ldr r4, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0x8] cmp r0, 0 beq @0802B260 cmp r0, 0x1 beq @0802B26E b @0802B294 .align 2, 0 .pool @0802B260: movs r0, 0x3 bl sub_802AE14 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0802B26E: bl sub_802B7E0 cmp r0, 0 bne @0802B294 ldr r0, =0x02022cfc ldr r1, [r0] adds r0, r1, 0 adds r0, 0x4A ldrh r0, [r0] adds r2, r1, 0 adds r2, 0x72 strh r0, [r2] adds r1, 0x4C movs r0, 0x1 strb r0, [r1] movs r0, 0 b @0802B296 .align 2, 0 .pool @0802B294: movs r0, 0x1 @0802B296: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B248 thumb_func_start sub_802B29C sub_802B29C: ; 802B29C push {r4,lr} ldr r4, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0x8] cmp r0, 0 beq @0802B2B4 cmp r0, 0x1 beq @0802B2CA movs r0, 0x1 b @0802B2CE .align 2, 0 .pool @0802B2B4: movs r0, 0 bl sub_802AE14 ldr r1, [r4] adds r0, r1, 0 adds r0, 0x72 ldrh r0, [r0] str r0, [r1, 0x24] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0802B2CA: bl sub_802B7E0 @0802B2CE: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B29C thumb_func_start sub_802B2D4 sub_802B2D4: ; 802B2D4 push {r4,lr} ldr r4, =0x02022cfc ldr r1, [r4] ldrh r0, [r1, 0x8] cmp r0, 0 beq @0802B2EC cmp r0, 0x1 beq @0802B300 b @0802B314 .align 2, 0 .pool @0802B2EC: bl sub_802C0E8 movs r0, 0x5 bl sub_802AE14 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0802B314 @0802B300: adds r0, r1, 0 adds r0, 0x49 ldrb r0, [r0] cmp r0, 0 beq @0802B314 adds r1, 0x4C movs r0, 0x2 strb r0, [r1] movs r0, 0 b @0802B316 @0802B314: movs r0, 0x1 @0802B316: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B2D4 thumb_func_start sub_802B31C sub_802B31C: ; 802B31C push {r4,lr} ldr r4, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0x8] cmp r0, 0 beq @0802B334 cmp r0, 0x1 beq @0802B352 b @0802B35E .align 2, 0 .pool @0802B334: bl sub_802C0E8 movs r0, 0 bl sub_802AE14 ldr r1, [r4] adds r0, r1, 0 adds r0, 0x72 ldrh r0, [r0] adds r2, r1, 0 adds r2, 0x4A strh r0, [r2] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0802B352: bl sub_802C70C cmp r0, 0 beq @0802B35E movs r0, 0 b @0802B360 @0802B35E: movs r0, 0x1 @0802B360: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B31C thumb_func_start sub_802B368 sub_802B368: ; 802B368 push {lr} bl sub_802B8CC cmp r0, 0 bne @0802B390 ldr r0, =0x02022cfc ldr r1, [r0] adds r0, r1, 0 adds r0, 0x4A ldrh r0, [r0] adds r2, r1, 0 adds r2, 0x72 strh r0, [r2] adds r1, 0x4C movs r0, 0x1 strb r0, [r1] b @0802B3AA .align 2, 0 .pool @0802B390: bl sub_802C538 cmp r0, 0 beq @0802B39C movs r0, 0x1 b @0802B3AC @0802B39C: bl sub_802C0B8 ldr r0, =0x02022cfc ldr r0, [r0] adds r0, 0x4C movs r1, 0x3 strb r1, [r0] @0802B3AA: movs r0, 0 @0802B3AC: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802B368 thumb_func_start sub_802B3B4 sub_802B3B4: ; 802B3B4 push {lr} bl sub_802B8CC cmp r0, 0 beq @0802B3CE bl sub_802C538 cmp r0, 0 beq @0802B3CA movs r0, 0x1 b @0802B3D0 @0802B3CA: bl sub_802C0B8 @0802B3CE: movs r0, 0 @0802B3D0: pop {r1} bx r1 thumb_func_end sub_802B3B4 thumb_func_start sub_802B3D4 sub_802B3D4: ; 802B3D4 push {r4,lr} ldr r4, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0x8] cmp r0, 0x1 beq @0802B40C cmp r0, 0x1 bgt @0802B3F0 cmp r0, 0 beq @0802B3F6 b @0802B468 .align 2, 0 .pool @0802B3F0: cmp r0, 0x2 beq @0802B460 b @0802B468 @0802B3F6: bl sub_802C538 bl sub_802C5DC cmp r0, 0 beq @0802B468 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0802B468 @0802B40C: bl sub_802B964 cmp r0, 0 bne @0802B468 bl sub_802C7BC cmp r0, 0 beq @0802B42E bl sub_802C7E0 ldr r1, [r4] adds r2, r1, 0 adds r2, 0x72 strh r0, [r2] adds r1, 0x4C movs r0, 0x7 b @0802B454 @0802B42E: ldr r1, [r4] adds r0, r1, 0 adds r0, 0x74 ldrh r0, [r0] cmp r0, 0xC7 bls @0802B448 ldrh r0, [r1, 0xE] adds r2, r1, 0 adds r2, 0x72 strh r0, [r2] adds r1, 0x4C movs r0, 0x8 b @0802B454 @0802B448: ldrh r0, [r1, 0xE] adds r2, r1, 0 adds r2, 0x72 strh r0, [r2] adds r1, 0x4C movs r0, 0x4 @0802B454: strb r0, [r1] ldr r0, =0x02022cfc ldr r1, [r0] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0802B460: movs r0, 0 b @0802B46A .align 2, 0 .pool @0802B468: movs r0, 0x1 @0802B46A: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B3D4 thumb_func_start sub_802B470 sub_802B470: ; 802B470 push {r4,lr} ldr r4, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0x8] cmp r0, 0x1 beq @0802B4B0 cmp r0, 0x1 bgt @0802B48C cmp r0, 0 beq @0802B492 b @0802B4C4 .align 2, 0 .pool @0802B48C: cmp r0, 0x2 beq @0802B4C0 b @0802B4C4 @0802B492: bl sub_802C538 cmp r0, 0 bne @0802B49E bl sub_802C0B8 @0802B49E: bl sub_802C5DC cmp r0, 0 beq @0802B4C4 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0802B4C4 @0802B4B0: bl sub_802B964 cmp r0, 0 bne @0802B4C4 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0802B4C0: movs r0, 0 b @0802B4C6 @0802B4C4: movs r0, 0x1 @0802B4C6: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B470 thumb_func_start sub_802B4CC sub_802B4CC: ; 802B4CC push {r4,lr} ldr r4, =0x02022cfc ldr r0, [r4] ldrh r1, [r0, 0x8] cmp r1, 0x1 beq @0802B500 cmp r1, 0x1 bgt @0802B4E8 cmp r1, 0 beq @0802B4F2 b @0802B560 .align 2, 0 .pool @0802B4E8: cmp r1, 0x2 beq @0802B52C cmp r1, 0x3 beq @0802B556 b @0802B560 @0802B4F2: movs r0, 0x4 bl sub_802AE14 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0802B500: bl sub_802BB84 cmp r0, 0 bne @0802B560 ldr r4, =0x02022cfc ldr r2, [r4] ldr r0, [r2, 0x78] adds r1, r2, 0 adds r1, 0x74 ldrh r1, [r1] adds r2, 0x72 ldrh r2, [r2] bl sub_802E354 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0802B560 .align 2, 0 .pool @0802B52C: adds r0, 0x49 ldrb r0, [r0] cmp r0, 0 beq @0802B560 bl sub_802C650 cmp r0, 0 beq @0802B544 ldr r0, [r4] adds r0, 0x4C movs r1, 0x5 b @0802B54A @0802B544: ldr r0, [r4] adds r0, 0x4C movs r1, 0x6 @0802B54A: strb r1, [r0] ldr r0, =0x02022cfc ldr r1, [r0] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0802B556: movs r0, 0 b @0802B562 .align 2, 0 .pool @0802B560: movs r0, 0x1 @0802B562: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B4CC thumb_func_start sub_802B568 sub_802B568: ; 802B568 push {r4,lr} ldr r4, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0x8] cmp r0, 0 beq @0802B580 cmp r0, 0x1 beq @0802B58E b @0802B5C0 .align 2, 0 .pool @0802B580: movs r0, 0 bl sub_802AE14 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0802B58E: bl sub_802BB84 cmp r0, 0 bne @0802B5C0 ldr r4, =0x02022cfc ldr r2, [r4] ldr r0, [r2, 0x78] adds r1, r2, 0 adds r1, 0x74 ldrh r1, [r1] adds r2, 0x72 ldrh r2, [r2] bl sub_802E354 ldr r0, [r4] adds r1, r0, 0 adds r1, 0x45 ldrb r1, [r1] adds r0, 0x42 strh r1, [r0] movs r0, 0 b @0802B5C2 .align 2, 0 .pool @0802B5C0: movs r0, 0x1 @0802B5C2: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B568 thumb_func_start sub_802B5C8 sub_802B5C8: ; 802B5C8 push {r4,lr} ldr r4, =0x02022cfc ldr r1, [r4] ldrh r0, [r1, 0x8] cmp r0, 0 beq @0802B5E0 cmp r0, 0x1 beq @0802B5F2 b @0802B61E .align 2, 0 .pool @0802B5E0: bl sub_802BD30 cmp r0, 0 bne @0802B61E ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0802B61E @0802B5F2: adds r0, r1, 0 adds r0, 0x49 ldrb r0, [r0] cmp r0, 0 beq @0802B61E adds r0, r1, 0 bl sub_802AA94 bl GenerateRandomNumber ldr r1, [r4] lsls r0, 16 lsrs r0, 16 str r0, [r1, 0x24] adds r3, r1, 0 adds r3, 0x72 movs r2, 0 strh r0, [r3] adds r1, 0x4C strb r2, [r1] movs r0, 0 b @0802B620 @0802B61E: movs r0, 0x1 @0802B620: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B5C8 thumb_func_start sub_802B628 sub_802B628: ; 802B628 push {r4,lr} ldr r4, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0x8] cmp r0, 0 beq @0802B640 cmp r0, 0x1 beq @0802B656 b @0802B65A .align 2, 0 .pool @0802B640: bl sub_802BD30 cmp r0, 0 bne @0802B65A ldr r0, [r4] bl sub_802AA94 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0802B656: movs r0, 0 b @0802B65C @0802B65A: movs r0, 0x1 @0802B65C: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B628 thumb_func_start sub_802B664 sub_802B664: ; 802B664 push {r4,lr} ldr r4, =0x02022cfc ldr r1, [r4] ldrh r0, [r1, 0x8] cmp r0, 0x1 beq @0802B68C cmp r0, 0x1 bgt @0802B680 cmp r0, 0 beq @0802B686 b @0802B6B0 .align 2, 0 .pool @0802B680: cmp r0, 0x2 beq @0802B69C b @0802B6B0 @0802B686: movs r0, 0x1 strh r0, [r1, 0x8] b @0802B6B0 @0802B68C: movs r0, 0 bl sub_802AE14 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0802B6B0 @0802B69C: bl sub_802BC60 cmp r0, 0 bne @0802B6B0 ldr r0, [r4] ldr r0, [r0] bl 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, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0x8] cmp r0, 0 beq @0802B6D0 cmp r0, 0x1 beq @0802B6E0 b @0802B6FC .align 2, 0 .pool @0802B6D0: movs r0, 0x4 bl sub_802AE14 ldr r1, [r4] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0802B6FC @0802B6E0: bl sub_802BA58 cmp r0, 0 bne @0802B6FC ldr r0, [r4] ldrh r1, [r0, 0xE] adds r2, r0, 0 adds r2, 0x72 strh r1, [r2] adds r0, 0x4C movs r1, 0x8 strb r1, [r0] movs r0, 0 b @0802B6FE @0802B6FC: movs r0, 0x1 @0802B6FE: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B6B8 thumb_func_start sub_802B704 sub_802B704: ; 802B704 push {lr} movs r0, 0 bl sub_802AE14 bl sub_802BA58 cmp r0, 0 beq @0802B718 movs r0, 0x1 b @0802B71A @0802B718: movs r0, 0 @0802B71A: pop {r1} bx r1 thumb_func_end sub_802B704 thumb_func_start sub_802B720 sub_802B720: ; 802B720 push {r4,lr} ldr r1, =0x02022cfc ldr r0, [r1] ldrh r0, [r0, 0x8] adds r4, r1, 0 cmp r0, 0x4 bhi @0802B7D8 lsls r0, 2 ldr r1, =@0802B740 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802B740: .4byte @0802B754 .4byte @0802B770 .4byte @0802B780 .4byte @0802B798 .4byte @0802B7BC @0802B754: ldr r2, [r4] ldr r0, [r2, 0x78] adds r1, r2, 0 adds r1, 0x74 ldrh r1, [r1] adds r2, 0x72 ldrh r2, [r2] bl sub_802E354 movs r0, 0x5 bl sub_802D0C8 ldr r1, [r4] b @0802B7AC @0802B770: bl sub_802D0F0 cmp r0, 0 bne @0802B7D8 movs r0, 0 bl sub_802AE14 b @0802B7A8 @0802B780: bl sub_802C70C cmp r0, 0 beq @0802B7D8 ldr r0, =sub_8153688 movs r1, 0x6 bl AddTask b @0802B7A8 .align 2, 0 .pool @0802B798: ldr r0, =sub_8153688 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @0802B7D8 bl sub_802DA14 @0802B7A8: ldr r0, =0x02022cfc ldr r1, [r0] @0802B7AC: ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0802B7D8 .align 2, 0 .pool @0802B7BC: bl sub_802DA44 cmp r0, 0 bne @0802B7D8 ldr r0, =0x02022cfc ldr r0, [r0] adds r0, 0x4C movs r1, 0x4 strb r1, [r0] movs r0, 0 b @0802B7DA .align 2, 0 .pool @0802B7D8: movs r0, 0x1 @0802B7DA: pop {r4} pop {r1} bx r1 thumb_func_end sub_802B720 thumb_func_start sub_802B7E0 sub_802B7E0: ; 802B7E0 push {r4,r5,lr} ldr r1, =0x02022cfc ldr r0, [r1] ldrh r0, [r0, 0xA] adds r4, r1, 0 cmp r0, 0x7 bhi @0802B8C4 lsls r0, 2 ldr r1, =@0802B800 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802B800: .4byte @0802B820 .4byte @0802B82C .4byte @0802B84C .4byte @0802B866 .4byte @0802B878 .4byte @0802B880 .4byte @0802B8A0 .4byte @0802B8BA @0802B820: movs r0, 0x2 bl sub_802D0C8 bl sub_802DDE0 b @0802B890 @0802B82C: bl sub_802D0F0 adds r5, r0, 0 cmp r5, 0 bne @0802B8C4 ldr r4, =0x02022cfc ldr r0, [r4] ldrb r0, [r0, 0x6] bl sub_802DDF4 ldr r1, [r4] strh r5, [r1, 0x3C] b @0802B894 .align 2, 0 .pool @0802B84C: ldr r1, [r4] ldrh r0, [r1, 0x3C] adds r0, 0x1 strh r0, [r1, 0x3C] lsls r0, 16 lsrs r0, 16 cmp r0, 0x78 bls @0802B8C4 movs r0, 0x3 bl sub_802D0C8 ldr r1, [r4] b @0802B894 @0802B866: bl sub_802D0F0 cmp r0, 0x1 beq @0802B8C4 bl sub_802DE08 cmp r0, 0x1 beq @0802B8C4 b @0802B890 @0802B878: movs r0, 0x9 bl sub_802D0C8 b @0802B890 @0802B880: bl sub_802D0F0 cmp r0, 0 bne @0802B8C4 bl sub_802C260 bl sub_802D764 @0802B890: ldr r0, =0x02022cfc ldr r1, [r0] @0802B894: ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] b @0802B8C4 .align 2, 0 .pool @0802B8A0: bl sub_802D788 cmp r0, 0 bne @0802B8C4 bl sub_802C270 bl sub_802BEA0 ldr r0, =0x02022cfc ldr r1, [r0] ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] @0802B8BA: movs r0, 0 b @0802B8C6 .align 2, 0 .pool @0802B8C4: movs r0, 0x1 @0802B8C6: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_802B7E0 thumb_func_start sub_802B8CC sub_802B8CC: ; 802B8CC push {r4,r5,lr} bl sub_802BEE4 ldr r5, =0x02022cfc ldr r1, [r5] ldrh r4, [r1, 0x36] cmp r4, 0 beq @0802B8E8 movs r0, 0 strh r0, [r1, 0x36] b @0802B95C .align 2, 0 .pool @0802B8E8: ldrh r0, [r1, 0xA] cmp r0, 0x1 beq @0802B914 cmp r0, 0x1 bgt @0802B8F8 cmp r0, 0 beq @0802B902 b @0802B95A @0802B8F8: cmp r0, 0x2 beq @0802B938 cmp r0, 0x3 beq @0802B94C b @0802B95A @0802B902: movs r0, 0 bl sub_802C130 cmp r0, 0 beq @0802B95A ldr r1, [r5] ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] @0802B914: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0802B95A bl sub_802C164 movs r0, 0x3 bl sub_802AE14 ldr r0, =0x02022cfc ldr r1, [r0] b @0802B944 .align 2, 0 .pool @0802B938: movs r0, 0x1 bl sub_802C130 cmp r0, 0x1 bne @0802B95A ldr r1, [r5] @0802B944: ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] b @0802B95A @0802B94C: movs r0, 0 bl sub_802C130 cmp r0, 0x1 bne @0802B95A ldr r0, [r5] strh r4, [r0, 0xA] @0802B95A: movs r0, 0x1 @0802B95C: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_802B8CC thumb_func_start sub_802B964 sub_802B964: ; 802B964 push {r4-r6,lr} ldr r1, =0x02022cfc ldr r0, [r1] ldrh r0, [r0, 0xA] adds r5, r1, 0 cmp r0, 0x4 bhi @0802BA50 lsls r0, 2 ldr r1, =@0802B984 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802B984: .4byte @0802B998 .4byte @0802B9BC .4byte @0802BA00 .4byte @0802BA24 .4byte @0802BA46 @0802B998: movs r4, 0 ldr r0, [r5] ldrb r0, [r0, 0x5] cmp r4, r0 bge @0802B9B8 adds r6, r5, 0 @0802B9A4: adds r0, r4, 0 bl sub_802DDB8 cmp r0, 0x1 beq @0802BA50 adds r4, 0x1 ldr r0, [r6] ldrb r0, [r0, 0x5] cmp r4, r0 blt @0802B9A4 @0802B9B8: ldr r1, [r5] b @0802BA1C @0802B9BC: movs r4, 0 ldr r0, [r5] ldrb r0, [r0, 0x5] cmp r4, r0 bge @0802B9EC adds r6, r5, 0 movs r5, 0 @0802B9CA: ldr r0, [r6] adds r0, r5 ldr r1, =0x000082f4 adds r0, r1 ldrh r0, [r0] cmp r0, 0x2 bne @0802B9E0 lsls r0, r4, 24 lsrs r0, 24 bl sub_802DDA0 @0802B9E0: adds r5, 0x28 adds r4, 0x1 ldr r0, [r6] ldrb r0, [r0, 0x5] cmp r4, r0 blt @0802B9CA @0802B9EC: movs r0, 0x1 bl sub_802D0C8 ldr r0, =0x02022cfc ldr r1, [r0] b @0802BA18 .align 2, 0 .pool @0802BA00: ldr r1, [r5] ldrh r0, [r1, 0x3C] adds r0, 0x1 strh r0, [r1, 0x3C] lsls r0, 16 lsrs r0, 16 cmp r0, 0x64 bls @0802BA50 movs r0, 0x3 bl sub_802D0C8 ldr r1, [r5] @0802BA18: movs r0, 0 strh r0, [r1, 0x3C] @0802BA1C: ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] b @0802BA50 @0802BA24: bl sub_802D0F0 adds r5, r0, 0 cmp r5, 0 bne @0802BA50 bl sub_802DDCC ldr r4, =0x02022cfc ldr r0, [r4] adds r0, 0x71 strb r5, [r0] bl sub_802C114 ldr r1, [r4] ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] @0802BA46: movs r0, 0 b @0802BA52 .align 2, 0 .pool @0802BA50: movs r0, 0x1 @0802BA52: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_802B964 thumb_func_start sub_802BA58 sub_802BA58: ; 802BA58 push {r4,lr} ldr r1, =0x02022cfc ldr r0, [r1] ldrh r0, [r0, 0xA] adds r4, r1, 0 cmp r0, 0x6 bls @0802BA68 b @0802BB7C @0802BA68: lsls r0, 2 ldr r1, =@0802BA7C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802BA7C: .4byte @0802BA98 .4byte @0802BAB8 .4byte @0802BAD0 .4byte @0802BB00 .4byte @0802BAB8 .4byte @0802BAD0 .4byte @0802BB70 @0802BA98: ldr r2, [r4] adds r0, r2, 0 adds r0, 0x72 ldrh r0, [r0] adds r1, r2, 0 adds r1, 0x3E adds r2, 0x40 bl sub_802C808 ldr r1, [r4] ldrh r0, [r1, 0x3E] adds r1, 0x40 ldrh r1, [r1] bl sub_802D7E8 b @0802BAF0 @0802BAB8: bl sub_802D974 adds r2, r0, 0 cmp r2, 0 bne @0802BB7C ldr r0, =0x02022cfc ldr r1, [r0] strh r2, [r1, 0x3C] b @0802BAF2 .align 2, 0 .pool @0802BAD0: ldr r1, [r4] ldrh r0, [r1, 0x3C] adds r2, r0, 0x1 strh r2, [r1, 0x3C] ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @0802BAEC lsls r0, r2, 16 lsrs r0, 16 cmp r0, 0xB4 bls @0802BB7C @0802BAEC: bl sub_802DA14 @0802BAF0: ldr r1, [r4] @0802BAF2: ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] b @0802BB7C .align 2, 0 .pool @0802BB00: bl sub_802DA44 cmp r0, 0 bne @0802BB7C ldr r4, =0x02022cfc ldr r1, [r4] ldrh r0, [r1, 0x3E] adds r1, 0x40 ldrh r1, [r1] bl sub_802C880 ldr r1, [r4] adds r2, r1, 0 adds r2, 0x40 strh r0, [r2] lsls r0, 16 cmp r0, 0 beq @0802BB58 ldrh r0, [r1, 0x3E] ldrh r1, [r2] bl bag_add_item lsls r0, 24 cmp r0, 0 beq @0802BB58 ldr r0, [r4] ldrh r0, [r0, 0x3E] movs r1, 0x1 bl sub_80D6800 lsls r0, 24 cmp r0, 0 bne @0802BB50 ldr r0, [r4] ldrh r0, [r0, 0x3E] bl sub_802D884 b @0802BB62 .align 2, 0 .pool @0802BB50: ldr r1, [r4] movs r0, 0x6 strh r0, [r1, 0xA] b @0802BB7C @0802BB58: ldr r4, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0x3E] bl sub_802D8FC @0802BB62: ldr r1, [r4] movs r0, 0x4 strh r0, [r1, 0xA] b @0802BB7C .align 2, 0 .pool @0802BB70: bl sub_802DA44 cmp r0, 0 bne @0802BB7C movs r0, 0 b @0802BB7E @0802BB7C: movs r0, 0x1 @0802BB7E: pop {r4} pop {r1} bx r1 thumb_func_end sub_802BA58 thumb_func_start sub_802BB84 sub_802BB84: ; 802BB84 push {r4,lr} ldr r0, =0x02022cfc ldr r0, [r0] ldrh r0, [r0, 0xA] cmp r0, 0x6 bhi @0802BC58 lsls r0, 2 ldr r1, =@0802BBA4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802BBA4: .4byte @0802BBC0 .4byte @0802BBC4 .4byte @0802BBCE .4byte @0802BC1C .4byte @0802BC26 .4byte @0802BC3C .4byte @0802BC4E @0802BBC0: movs r0, 0x4 b @0802BC28 @0802BBC4: bl sub_802D0F0 cmp r0, 0 bne @0802BC58 b @0802BC2C @0802BBCE: bl sub_802DA8C lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @0802BC04 cmp r1, 0 bgt @0802BBE8 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0802BBEC b @0802BC58 @0802BBE8: cmp r1, 0x1 bne @0802BC58 @0802BBEC: ldr r4, =0x02022cfc ldr r0, [r4] adds r0, 0x45 movs r1, 0x1 strb r1, [r0] movs r0, 0x6 bl sub_802D0C8 ldr r1, [r4] b @0802BC30 .align 2, 0 .pool @0802BC04: ldr r4, =0x02022cfc ldr r0, [r4] adds r0, 0x45 movs r1, 0x2 strb r1, [r0] movs r0, 0x6 bl sub_802D0C8 ldr r1, [r4] b @0802BC30 .align 2, 0 .pool @0802BC1C: bl sub_802D0F0 cmp r0, 0 bne @0802BC58 b @0802BC2C @0802BC26: movs r0, 0x8 @0802BC28: bl sub_802D0C8 @0802BC2C: ldr r0, =0x02022cfc ldr r1, [r0] @0802BC30: ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] b @0802BC58 .align 2, 0 .pool @0802BC3C: bl sub_802D0F0 cmp r0, 0 bne @0802BC58 ldr r0, =0x02022cfc ldr r1, [r0] ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] @0802BC4E: movs r0, 0 b @0802BC5A .align 2, 0 .pool @0802BC58: movs r0, 0x1 @0802BC5A: pop {r4} pop {r1} bx r1 thumb_func_end sub_802BB84 thumb_func_start sub_802BC60 sub_802BC60: ; 802BC60 push {r4,lr} sub sp, 0x4 ldr r1, =0x02022cfc ldr r0, [r1] ldrh r0, [r0, 0xA] adds r4, r1, 0 cmp r0, 0x5 bhi @0802BD24 lsls r0, 2 ldr r1, =@0802BC84 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802BC84: .4byte @0802BC9C .4byte @0802BCA2 .4byte @0802BCB2 .4byte @0802BCC8 .4byte @0802BCEE .4byte @0802BD14 @0802BC9C: bl sub_802DA14 b @0802BCFE @0802BCA2: bl sub_802DA44 cmp r0, 0 bne @0802BD24 movs r0, 0x7 bl sub_802D0C8 b @0802BCFE @0802BCB2: bl sub_802D0F0 adds r2, r0, 0 cmp r2, 0 bne @0802BD24 ldr r0, =0x02022cfc ldr r1, [r0] strh r2, [r1, 0x3C] b @0802BD02 .align 2, 0 .pool @0802BCC8: ldr r1, [r4] ldrh r0, [r1, 0x3C] adds r0, 0x1 strh r0, [r1, 0x3C] lsls r0, 16 lsrs r0, 16 cmp r0, 0x78 bls @0802BD24 movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, [r4] b @0802BD02 @0802BCEE: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0802BD24 bl sub_800AC34 @0802BCFE: ldr r0, =0x02022cfc ldr r1, [r0] @0802BD02: ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] b @0802BD24 .align 2, 0 .pool @0802BD14: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0802BD24 movs r0, 0 b @0802BD26 .align 2, 0 .pool @0802BD24: movs r0, 0x1 @0802BD26: add sp, 0x4 pop {r4} pop {r1} bx r1 thumb_func_end sub_802BC60 thumb_func_start sub_802BD30 sub_802BD30: ; 802BD30 push {r4,lr} ldr r4, =0x02022cfc ldr r0, [r4] ldrh r0, [r0, 0xA] cmp r0, 0x1 beq @0802BD66 cmp r0, 0x1 bgt @0802BD4C cmp r0, 0 beq @0802BD52 b @0802BD7A .align 2, 0 .pool @0802BD4C: cmp r0, 0x2 beq @0802BD76 b @0802BD7A @0802BD52: bl sub_802DA14 movs r0, 0 bl sub_802DD64 ldr r1, [r4] ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] b @0802BD7A @0802BD66: bl sub_802DA44 cmp r0, 0 bne @0802BD7A ldr r1, [r4] ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] @0802BD76: movs r0, 0 b @0802BD7C @0802BD7A: movs r0, 0x1 @0802BD7C: pop {r4} pop {r1} bx r1 thumb_func_end sub_802BD30 thumb_func_start sub_802BD84 sub_802BD84: ; 802BD84 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 mov r10, r0 lsls r0, 2 add r0, r10 lsls r0, 3 ldr r1, =0x03005e08 adds r6, r0, r1 mov r0, r10 movs r1, 0xE bl get_word_task_arg mov r8, r0 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 beq @0802BDC8 cmp r0, 0x1 beq @0802BDDC b @0802BE48 .align 2, 0 .pool @0802BDBC: bl sub_802AB20 mov r0, r10 bl remove_task b @0802BE48 @0802BDC8: movs r1, 0 adds r0, r6, 0 adds r0, 0x8 @0802BDCE: strh r1, [r0, 0x4] subs r0, 0x2 cmp r0, r6 bge @0802BDCE ldrh r0, [r6] adds r0, 0x1 strh r0, [r6] @0802BDDC: mov r3, r8 ldrb r1, [r3, 0x6] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r4, =0x000082a8 adds r0, r4 add r0, r8 bl sub_802E0AC movs r2, 0 adds r5, r6, 0x4 mov r9, r2 movs r7, 0x83 lsls r7, 8 add r7, r8 add r4, r8 @0802BDFE: movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0 bne @0802BE38 adds r0, r2, 0 adds r1, r4, 0 str r2, [sp] bl sub_802E0D0 ldr r2, [sp] cmp r0, 0 beq @0802BE38 ldr r1, =0x020229f0 add r1, r9 adds r0, r7, 0 bl 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 .pool thumb_func_end sub_802BD84 thumb_func_start sub_802BE60 sub_802BE60: ; 802BE60 push {lr} lsls r1, 24 lsrs r1, 24 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022cfc ldr r2, [r1] movs r1, 0xE bl set_word_task_arg pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802BE60 thumb_func_start sub_802BE80 sub_802BE80: ; 802BE80 ldr r0, =0x02022cfc ldr r2, [r0] adds r0, r2, 0 adds r0, 0x4A movs r1, 0 strh r1, [r0] movs r0, 0x6 str r0, [r2, 0x14] strh r1, [r2, 0x34] str r1, [r2, 0x1C] strh r1, [r2, 0x36] str r1, [r2, 0x10] bx lr .align 2, 0 .pool thumb_func_end sub_802BE80 thumb_func_start sub_802BEA0 sub_802BEA0: ; 802BEA0 push {r4,lr} ldr r3, =0x02022cfc ldr r0, [r3] adds r1, r0, 0 adds r1, 0x4A movs r4, 0 movs r2, 0 strh r2, [r1] ldr r1, =0x000006ff strh r1, [r0, 0x34] movs r1, 0x7 str r1, [r0, 0x14] strh r2, [r0, 0x36] str r2, [r0, 0x10] adds r0, 0x51 strb r4, [r0] ldr r0, [r3] adds r0, 0x50 strb r4, [r0] ldr r0, [r3] str r2, [r0, 0x20] adds r1, r0, 0 adds r1, 0x4E strh r2, [r1] str r2, [r0, 0x6C] bl sub_802BF7C pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802BEA0 thumb_func_start sub_802BEE4 sub_802BEE4: ; 802BEE4 push {r4,lr} ldr r4, =0x02022cfc ldr r1, [r4] adds r0, r1, 0 adds r0, 0x46 ldrb r0, [r0] cmp r0, 0 beq @0802BF34 adds r1, 0x4A ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] bl sub_802BF48 ldr r3, [r4] ldrh r1, [r3, 0x34] adds r2, r1, r0 strh r2, [r3, 0x34] lsls r1, r2, 16 ldr r0, =0x09fe0000 cmp r1, r0 bls @0802BF16 ldr r1, =0xfffff601 adds r0, r2, r1 strh r0, [r3, 0x34] @0802BF16: ldr r1, [r4] ldr r2, [r1, 0x14] str r2, [r1, 0x18] ldrh r0, [r1, 0x34] lsrs r0, 8 str r0, [r1, 0x14] cmp r0, 0x6 bls @0802BF34 cmp r2, 0x6 bhi @0802BF34 ldrh r0, [r1, 0x36] adds r0, 0x1 strh r0, [r1, 0x36] bl sub_802BF7C @0802BF34: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802BEE4 thumb_func_start sub_802BF48 sub_802BF48: ; 802BF48 push {lr} ldr r0, =0x02022cfc ldr r2, [r0] ldr r0, [r2, 0x10] cmp r0, 0 beq @0802BF5C movs r0, 0 b @0802BF72 .align 2, 0 .pool @0802BF5C: ldr r3, [r2, 0x1C] ldrh r1, [r2, 0x34] ldr r0, =0x000005ff cmp r1, r0 bhi @0802BF70 ldr r0, [r2, 0x20] adds r0, 0x50 str r0, [r2, 0x20] lsrs r0, 8 adds r3, r0 @0802BF70: adds r0, r3, 0 @0802BF72: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802BF48 thumb_func_start sub_802BF7C sub_802BF7C: ; 802BF7C push {r4,lr} ldr r4, =0x02022cfc ldr r3, [r4] movs r0, 0 str r0, [r3, 0x20] adds r1, r3, 0 adds r1, 0x4E ldrh r0, [r1] cmp r0, 0 beq @0802BFC0 subs r0, 0x1 strh r0, [r1] ldr r0, [r3, 0x6C] cmp r0, 0 beq @0802C08A bl sub_802C098 movs r1, 0x3 ands r1, r0 cmp r1, 0 beq @0802BFB0 ldr r1, [r4] b @0802C086 .align 2, 0 .pool @0802BFB0: ldr r1, [r4] ldr r0, [r1, 0x28] cmp r0, 0x36 bls @0802BFBC movs r0, 0x1E b @0802C088 @0802BFBC: movs r0, 0x52 b @0802C088 @0802BFC0: adds r2, r3, 0 adds r2, 0x50 ldrb r1, [r2] movs r0, 0x8 ands r0, r1 cmp r0, 0 bne @0802C014 ldr r0, =gUnknown_082FB63C ldrb r1, [r2] lsls r1, 1 adds r1, r0 adds r0, r3, 0 adds r0, 0x51 ldrb r2, [r0] lsls r0, r2, 3 subs r0, r2 ldrh r1, [r1] adds r0, r1 str r0, [r3, 0x28] bl sub_802C098 ldr r2, [r4] ldr r3, =gUnknown_082FB64C movs r1, 0x3 ands r1, r0 lsls r1, 1 adds r1, r3 ldrh r0, [r1] adds r0, 0x2 adds r1, r2, 0 adds r1, 0x4E strh r0, [r1] adds r2, 0x50 ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] b @0802C082 .align 2, 0 .pool @0802C014: lsls r0, r1, 24 lsrs r0, 24 cmp r0, 0x8 bne @0802C030 adds r1, r3, 0 adds r1, 0x51 ldrb r0, [r1] cmp r0, 0x2 bhi @0802C02C adds r0, 0x1 strb r0, [r1] b @0802C030 @0802C02C: movs r0, 0x1 str r0, [r3, 0x6C] @0802C030: ldr r2, =gUnknown_082FB63C ldr r4, =0x02022cfc ldr r0, [r4] mov r12, r0 mov r3, r12 adds r3, 0x50 ldrb r0, [r3] movs r1, 0xF subs r1, r0 lsls r1, 1 adds r1, r2 mov r0, r12 adds r0, 0x51 ldrb r2, [r0] lsls r0, r2, 3 subs r0, r2 ldrh r1, [r1] adds r0, r1 mov r1, r12 str r0, [r1, 0x28] ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] lsls r0, 24 lsrs r0, 24 cmp r0, 0xF bls @0802C082 bl sub_802C098 movs r1, 0x3 ands r1, r0 cmp r1, 0 bne @0802C07A ldr r1, [r4] ldr r0, [r1, 0x28] subs r0, 0x5 str r0, [r1, 0x28] @0802C07A: ldr r0, [r4] adds r0, 0x50 movs r1, 0 strb r1, [r0] @0802C082: ldr r0, =0x02022cfc ldr r1, [r0] @0802C086: ldr r0, [r1, 0x28] @0802C088: str r0, [r1, 0x1C] @0802C08A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802BF7C thumb_func_start sub_802C098 sub_802C098: ; 802C098 ldr r0, =0x02022cfc ldr r2, [r0] ldr r1, [r2, 0x24] ldr r0, =0x41c64e6d muls r0, r1 ldr r1, =0x00006073 adds r0, r1 str r0, [r2, 0x24] lsrs r0, 16 bx lr .align 2, 0 .pool thumb_func_end sub_802C098 thumb_func_start sub_802C0B8 sub_802C0B8: ; 802C0B8 push {lr} ldr r0, =0x02022cfc ldr r1, [r0] movs r0, 0x1 str r0, [r1, 0x10] movs r0, 0x6 str r0, [r1, 0x14] ldr r0, =0x000005ff strh r0, [r1, 0x34] bl sub_802C270 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C0B8 thumb_func_start sub_802C0DC sub_802C0DC: ; 802C0DC ldr r0, =0x02022cfc ldr r0, [r0] ldr r0, [r0, 0x10] bx lr .align 2, 0 .pool thumb_func_end sub_802C0DC thumb_func_start sub_802C0E8 sub_802C0E8: ; 802C0E8 push {r4,r5,lr} ldr r5, =0x02022cfc ldr r4, =0x000082f8 movs r3, 0 movs r2, 0 movs r1, 0x4 @0802C0F4: ldr r0, [r5] adds r0, r4 adds r0, r2 str r3, [r0] adds r2, 0x28 subs r1, 0x1 cmp r1, 0 bge @0802C0F4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C0E8 thumb_func_start sub_802C114 sub_802C114: ; 802C114 ldr r0, =0x02022cfc ldr r0, [r0] ldr r1, =0x000083ac adds r0, r1 ldr r1, [r0] movs r2, 0 strh r2, [r1, 0x10] ldr r0, [r0] strh r2, [r0, 0x12] bx lr .align 2, 0 .pool thumb_func_end sub_802C114 thumb_func_start sub_802C130 sub_802C130: ; 802C130 push {lr} lsls r0, 16 lsrs r0, 16 ldr r1, =0x02022cfc ldr r2, [r1] ldrb r3, [r2, 0x6] lsls r1, r3, 2 adds r1, r3 lsls r1, 3 adds r2, r1 ldr r1, =0x000082f4 adds r2, r1 ldrh r1, [r2] cmp r1, r0 beq @0802C15C movs r0, 0 b @0802C15E .align 2, 0 .pool @0802C15C: movs r0, 0x1 @0802C15E: pop {r1} bx r1 thumb_func_end sub_802C130 thumb_func_start sub_802C164 sub_802C164: ; 802C164 ldr r0, =0x02022cfc ldr r0, [r0] ldr r1, =0x000083ac adds r2, r0, r1 ldr r1, [r2] adds r0, 0x4A ldrh r0, [r0] strh r0, [r1, 0xE] ldr r1, [r2] ldrh r0, [r1, 0x10] strh r0, [r1, 0x12] ldr r1, [r2] movs r0, 0x1 strh r0, [r1, 0x10] bx lr .align 2, 0 .pool thumb_func_end sub_802C164 thumb_func_start sub_802C18C sub_802C18C: ; 802C18C push {r4,lr} ldr r0, =0x02022cfc ldr r2, [r0] ldr r0, =0x000083ac adds r3, r2, r0 ldr r1, [r3] ldrh r0, [r1, 0x10] strh r0, [r1, 0x12] ldr r0, [r3] movs r4, 0x2 strh r4, [r0, 0x10] ldr r1, [r3] adds r2, 0x4A ldrh r0, [r2] strh r0, [r1, 0xE] ldr r0, [r3] str r4, [r0, 0x14] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C18C thumb_func_start sub_802C1BC sub_802C1BC: ; 802C1BC ldr r0, =0x02022cfc ldr r0, [r0] ldr r1, =0x000083ac adds r0, r1 ldr r1, [r0] ldrh r2, [r1, 0x10] movs r3, 0 strh r2, [r1, 0x12] ldr r0, [r0] strh r3, [r0, 0x10] bx lr .align 2, 0 .pool thumb_func_end sub_802C1BC thumb_func_start sub_802C1DC sub_802C1DC: ; 802C1DC push {r4,r5,lr} ldr r4, =0x02022cfc ldr r1, [r4] ldr r0, [r1, 0x5C] cmp r0, 0 beq @0802C21C ldr r0, [r1, 0x78] bl sub_802DD64 ldr r1, [r4] movs r5, 0 str r5, [r1, 0x5C] adds r0, r1, 0 adds r0, 0x4D ldrb r0, [r0] cmp r0, 0 beq @0802C21C adds r0, r1, 0 adds r0, 0x71 ldrb r0, [r0] bl sub_802DCCC ldr r1, =gUnknown_082FB654 subs r0, 0x2 lsls r0, 1 adds r0, r1 ldrh r0, [r0] bl audio_play ldr r0, [r4] adds r0, 0x4D strb r5, [r0] @0802C21C: ldr r0, =0x02022cfc ldr r0, [r0] adds r0, 0x74 ldrh r0, [r0] bl sub_802DD74 bl sub_802C280 bl sub_802C240 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C1DC thumb_func_start sub_802C240 sub_802C240: ; 802C240 push {lr} ldr r0, =0x02022cfc ldr r1, [r0] adds r0, r1, 0 adds r0, 0x46 ldrb r0, [r0] cmp r0, 0 beq @0802C256 ldr r0, [r1, 0x14] bl sub_802DC9C @0802C256: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C240 thumb_func_start sub_802C260 sub_802C260: ; 802C260 ldr r0, =0x02022cfc ldr r0, [r0] adds r0, 0x46 movs r1, 0 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_802C260 thumb_func_start sub_802C270 sub_802C270: ; 802C270 ldr r0, =0x02022cfc ldr r0, [r0] adds r0, 0x46 movs r1, 0x1 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_802C270 thumb_func_start sub_802C280 sub_802C280: ; 802C280 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r6, 0 ldr r2, =0x02022cfc ldr r0, [r2] ldrb r0, [r0, 0x5] mov r9, r0 movs r5, 0 cmp r6, r9 bge @0802C360 mov r10, r2 mov r8, r5 movs r7, 0 @0802C2A2: mov r0, r10 ldr r3, [r0] adds r1, r3, r7 ldr r2, =0x000082f4 adds r0, r1, r2 ldrh r2, [r0] cmp r2, 0x1 beq @0802C2D4 cmp r2, 0x1 bgt @0802C2C4 cmp r2, 0 beq @0802C2CA b @0802C354 .align 2, 0 .pool @0802C2C4: cmp r2, 0x2 beq @0802C338 b @0802C354 @0802C2CA: adds r0, r5, 0 movs r1, 0 bl sub_802DC80 b @0802C354 @0802C2D4: ldr r0, =0x000082f6 adds r4, r1, r0 ldrh r0, [r4] cmp r0, 0x1 bne @0802C2F6 ldr r0, =0x000082f2 adds r0, r1 adds r1, r3, 0 adds r1, 0x9A add r1, r8 str r1, [sp] ldrh r1, [r0] mov r12, r1 ldr r0, [sp] ldrh r0, [r0] cmp r12, r0 beq @0802C31E @0802C2F6: ldrb r3, [r3, 0x6] cmp r5, r3 bne @0802C2FE strh r2, [r4] @0802C2FE: orrs r6, r2 mov r1, r10 ldr r2, [r1] ldr r1, =0x000082e8 adds r0, r2, r1 adds r0, r7 ldr r1, =0x7fffffff str r1, [r0] adds r1, r2, 0 adds r1, 0x9A add r1, r8 adds r2, r7 ldr r0, =0x000082f2 adds r2, r0 ldrh r0, [r2] strh r0, [r1] @0802C31E: adds r0, r5, 0 bl sub_802C398 b @0802C354 .align 2, 0 .pool @0802C338: ldr r0, =0x000082f6 adds r1, r0 ldrh r0, [r1] cmp r0, 0x2 beq @0802C354 ldrb r3, [r3, 0x6] cmp r5, r3 bne @0802C34A strh r2, [r1] @0802C34A: orrs r6, r2 lsls r0, r5, 24 lsrs r0, 24 bl sub_802DD88 @0802C354: movs r1, 0x2 add r8, r1 adds r7, 0x28 adds r5, 0x1 cmp r5, r9 blt @0802C2A2 @0802C360: movs r0, 0x2 ands r0, r6 cmp r0, 0 beq @0802C378 movs r0, 0x83 lsls r0, 1 bl audio_play b @0802C386 .align 2, 0 .pool @0802C378: movs r0, 0x1 ands r6, r0 cmp r6, 0 beq @0802C386 movs r0, 0xA bl audio_play @0802C386: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_802C280 thumb_func_start sub_802C398 sub_802C398: ; 802C398 push {r4-r6,lr} adds r6, r0, 0 ldr r0, =0x02022cfc ldr r2, [r0] ldr r0, [r2, 0x68] cmp r0, 0 bne @0802C432 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x000082e4 adds r0, r1 adds r5, r2, r0 ldr r1, [r5, 0x4] ldr r0, =0x7fffffff cmp r1, r0 beq @0802C3D0 adds r0, r1, 0x1 str r0, [r5, 0x4] adds r3, r0, 0 b @0802C3E8 .align 2, 0 .pool @0802C3D0: adds r0, r2, 0 adds r0, 0x4A ldrh r1, [r0] ldrh r0, [r5, 0xE] subs r3, r1, r0 ldr r0, =0x0000fde7 cmp r3, r0 ble @0802C3E6 ldr r0, =0xffff0218 adds r3, r0 adds r3, r1 @0802C3E6: str r3, [r5, 0x4] @0802C3E8: cmp r3, 0x3 ble @0802C432 subs r3, 0x4 cmp r3, 0x2F bgt @0802C414 ldr r2, =gUnknown_082FB65C ldrh r1, [r5, 0xC] lsls r0, r1, 1 adds r0, r1 lsls r0, 4 adds r0, r3, r0 adds r0, r2 movs r4, 0 ldrsb r4, [r0, r4] b @0802C416 .align 2, 0 .pool @0802C414: movs r4, 0 @0802C416: adds r1, r4, 0 adds r0, r6, 0 bl sub_802DC80 cmp r4, 0 bne @0802C430 ldr r0, =0x02022cfc ldr r0, [r0] ldrb r0, [r0, 0x6] cmp r6, r0 bne @0802C430 bl sub_802C1BC @0802C430: str r4, [r5] @0802C432: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C398 thumb_func_start sub_802C43C sub_802C43C: ; 802C43C push {r4,r5,lr} ldr r5, =0x02022cfc ldr r1, [r5] ldr r0, [r1, 0x14] cmp r0, 0x8 bne @0802C4CE ldr r0, [r1, 0x18] cmp r0, 0x7 bne @0802C4CE ldr r4, [r1, 0x58] cmp r4, 0 bne @0802C46C bl sub_802C780 ldr r0, [r5] str r4, [r0, 0x54] movs r1, 0x1 str r1, [r0, 0x58] adds r0, 0x71 strb r4, [r0] b @0802C4CE .align 2, 0 .pool @0802C46C: ldr r0, [r1, 0x54] cmp r0, 0x5 bne @0802C480 ldrh r0, [r1, 0xC] adds r0, 0x1 strh r0, [r1, 0xC] ldrh r0, [r1, 0xC] bl sub_802C7A0 b @0802C484 @0802C480: movs r0, 0 strh r0, [r1, 0xC] @0802C484: ldr r4, =0x02022cfc ldr r1, [r4] ldr r0, [r1, 0x54] cmp r0, 0x1 ble @0802C49E movs r0, 0x1 str r0, [r1, 0x64] adds r0, r1, 0 adds r0, 0x86 adds r1, 0x81 movs r2, 0x5 bl memcpy @0802C49E: bl sub_802C780 ldr r0, [r4] movs r2, 0 str r2, [r0, 0x54] movs r1, 0x1 str r1, [r0, 0x58] adds r0, 0x71 strb r2, [r0] ldr r0, [r4] adds r2, r0, 0 adds r2, 0x74 ldrh r1, [r2] ldr r0, =0x0000270e cmp r1, r0 bhi @0802C4C2 adds r0, r1, 0x1 strh r0, [r2] @0802C4C2: movs r0, 0xA bl sub_802C688 movs r0, 0x3 bl sub_802AE14 @0802C4CE: ldr r4, =0x02022cfc ldr r0, [r4] ldr r0, [r0, 0x64] cmp r0, 0 beq @0802C504 bl sub_802C618 cmp r0, 0x1 beq @0802C4E8 ldr r0, [r4] ldr r0, [r0, 0x14] cmp r0, 0 bne @0802C504 @0802C4E8: ldr r0, [r4] adds r0, 0x86 bl sub_802C73C bl sub_802C790 bl sub_802C688 movs r0, 0x3 bl sub_802AE14 ldr r1, [r4] movs r0, 0 str r0, [r1, 0x64] @0802C504: ldr r4, =0x02022cfc ldr r0, [r4] ldr r0, [r0, 0x58] cmp r0, 0 beq @0802C52A bl sub_802C6B0 adds r2, r0, 0 ldr r1, [r4] ldr r0, [r1, 0x54] cmp r2, r0 ble @0802C52A str r2, [r1, 0x54] adds r0, r1, 0 adds r0, 0x81 adds r1, 0x7C movs r2, 0x5 bl memcpy @0802C52A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C43C thumb_func_start sub_802C538 sub_802C538: ; 802C538 push {r4,r5,lr} ldr r5, =0x02022cfc ldr r1, [r5] ldr r0, [r1, 0x14] cmp r0, 0x6 bne @0802C582 ldr r4, =0x000083ac adds r0, r1, r4 ldr r1, [r0] ldr r0, [r1] cmp r0, 0 bne @0802C582 ldrh r0, [r1, 0x12] cmp r0, 0x1 bne @0802C578 bl sub_802C0DC adds r1, r0, 0 cmp r1, 0x1 bne @0802C578 ldr r0, [r5] adds r0, r4 ldr r0, [r0] str r1, [r0, 0x14] b @0802C582 .align 2, 0 .pool @0802C574: movs r0, 0 b @0802C5CA @0802C578: bl sub_802C18C movs r0, 0x3 bl sub_802AE14 @0802C582: ldr r0, =0x02022cfc ldr r1, [r0] ldr r0, [r1, 0x14] cmp r0, 0x7 bne @0802C5A8 ldr r0, [r1, 0x18] cmp r0, 0x6 bne @0802C5A8 ldr r2, =0x000083ac adds r0, r1, r2 ldr r1, [r0] ldrh r0, [r1, 0x10] cmp r0, 0x2 beq @0802C5A8 movs r0, 0x1 str r0, [r1, 0x14] movs r0, 0x3 bl sub_802AE14 @0802C5A8: movs r2, 0 ldr r0, =0x02022cfc ldr r0, [r0] ldrb r1, [r0, 0x5] cmp r2, r1 bge @0802C5C8 adds r3, r1, 0 ldr r4, =0x000082f4 adds r1, r0, r4 @0802C5BA: ldrh r0, [r1] cmp r0, 0x2 beq @0802C574 adds r1, 0x28 adds r2, 0x1 cmp r2, r3 blt @0802C5BA @0802C5C8: movs r0, 0x1 @0802C5CA: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802C538 thumb_func_start sub_802C5DC sub_802C5DC: ; 802C5DC push {r4,lr} ldr r0, =0x02022cfc ldr r0, [r0] ldrb r3, [r0, 0x5] movs r4, 0 cmp r4, r3 bge @0802C600 ldr r1, =0x000082f8 adds r2, r0, r1 adds r1, r3, 0 @0802C5F0: ldr r0, [r2] cmp r0, 0 beq @0802C5F8 adds r4, 0x1 @0802C5F8: adds r2, 0x28 subs r1, 0x1 cmp r1, 0 bne @0802C5F0 @0802C600: movs r0, 0 cmp r4, r3 bne @0802C608 movs r0, 0x1 @0802C608: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802C5DC thumb_func_start sub_802C618 sub_802C618: ; 802C618 push {r4,lr} movs r2, 0 ldr r0, =0x02022cfc ldr r0, [r0] ldrb r1, [r0, 0x5] cmp r2, r1 bge @0802C648 adds r3, r1, 0 ldr r4, =0x000082f8 adds r1, r0, r4 @0802C62C: ldr r0, [r1] cmp r0, 0x1 beq @0802C640 movs r0, 0 b @0802C64A .align 2, 0 .pool @0802C640: adds r1, 0x28 adds r2, 0x1 cmp r2, r3 blt @0802C62C @0802C648: movs r0, 0x1 @0802C64A: pop {r4} pop {r1} bx r1 thumb_func_end sub_802C618 thumb_func_start sub_802C650 sub_802C650: ; 802C650 push {lr} ldr r0, =0x02022cfc ldr r1, [r0] adds r0, r1, 0 adds r0, 0x45 ldrb r0, [r0] cmp r0, 0x1 bne @0802C668 @0802C660: movs r0, 0 b @0802C684 .align 2, 0 .pool @0802C668: movs r2, 0x1 ldrb r0, [r1, 0x5] cmp r2, r0 bge @0802C682 adds r3, r0, 0 adds r1, 0x92 @0802C674: ldrh r0, [r1] cmp r0, 0x1 beq @0802C660 adds r1, 0x2 adds r2, 0x1 cmp r2, r3 blt @0802C674 @0802C682: movs r0, 0x1 @0802C684: pop {r1} bx r1 thumb_func_end sub_802C650 thumb_func_start sub_802C688 sub_802C688: ; 802C688 push {lr} ldr r1, =0x02022cfc ldr r2, [r1] ldr r1, [r2, 0x78] adds r1, r0 str r1, [r2, 0x78] movs r0, 0x1 str r0, [r2, 0x5C] ldr r0, =0x00018695 cmp r1, r0 bls @0802C6A2 adds r0, 0x1 str r0, [r2, 0x78] @0802C6A2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C688 thumb_func_start sub_802C6B0 sub_802C6B0: ; 802C6B0 push {r4-r7,lr} movs r5, 0 ldr r1, =0x02022cfc ldr r0, [r1] ldrb r4, [r0, 0x5] movs r2, 0 cmp r5, r4 bge @0802C702 mov r12, r1 movs r3, 0 ldr r7, =0x000082e4 movs r6, 0x1E negs r6, r6 @0802C6CA: mov r0, r12 ldr r1, [r0] adds r0, r1, r7 adds r0, r3 ldr r0, [r0] cmp r0, r6 bne @0802C6F0 adds r0, r1, 0 adds r0, 0x7C adds r0, r2 movs r1, 0x1 strb r1, [r0] adds r5, 0x1 b @0802C6FA .align 2, 0 .pool @0802C6F0: adds r0, r1, 0 adds r0, 0x7C adds r0, r2 movs r1, 0 strb r1, [r0] @0802C6FA: adds r3, 0x28 adds r2, 0x1 cmp r2, r4 blt @0802C6CA @0802C702: adds r0, r5, 0 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_802C6B0 thumb_func_start sub_802C70C sub_802C70C: ; 802C70C push {lr} movs r2, 0 ldr r1, =0x03005000 ldr r3, =0x000009e6 adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @0802C728 ldr r3, =0x00000c1a adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @0802C728 movs r2, 0x1 @0802C728: adds r0, r2, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802C70C thumb_func_start sub_802C73C sub_802C73C: ; 802C73C push {r4-r6,lr} adds r4, r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 ldr r6, =0x02022cfc movs r5, 0x1 @0802C74A: adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 beq @0802C75A adds r0, r5, 0 lsls r0, r1 orrs r2, r0 adds r3, 0x1 @0802C75A: adds r1, 0x1 cmp r1, 0x4 ble @0802C74A ldr r0, [r6] adds r0, 0x71 strb r2, [r0] cmp r2, 0 beq @0802C772 ldr r0, [r6] adds r0, 0x4D movs r1, 0x1 strb r1, [r0] @0802C772: adds r0, r3, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802C73C thumb_func_start sub_802C780 sub_802C780: ; 802C780 ldr r0, =0x02022cfc ldr r0, [r0] adds r0, 0x44 movs r1, 0 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_802C780 thumb_func_start sub_802C790 sub_802C790: ; 802C790 ldr r1, =gUnknown_082FB6EC lsls r0, 2 adds r0, r1 ldr r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_802C790 thumb_func_start sub_802C7A0 sub_802C7A0: ; 802C7A0 push {lr} lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x02022cfc ldr r0, [r0] ldrh r2, [r0, 0xE] cmp r1, r2 bls @0802C7B2 strh r1, [r0, 0xE] @0802C7B2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C7A0 thumb_func_start sub_802C7BC sub_802C7BC: ; 802C7BC push {lr} ldr r0, =0x02022cfc ldr r0, [r0] ldr r1, =gUnknown_082FB714 ldr r2, [r0, 0x78] ldr r0, [r1] cmp r2, r0 bcs @0802C7D8 movs r0, 0 b @0802C7DA .align 2, 0 .pool @0802C7D8: movs r0, 0x1 @0802C7DA: pop {r1} bx r1 thumb_func_end sub_802C7BC thumb_func_start sub_802C7E0 sub_802C7E0: ; 802C7E0 push {r4,lr} bl sub_802C818 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl sub_802C838 lsls r0, 16 lsrs r0, 4 ldr r1, =0x00000fff ands r4, r1 orrs r0, r4 lsls r0, 16 lsrs r0, 16 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802C7E0 thumb_func_start sub_802C808 sub_802C808: ; 802C808 lsls r0, 16 lsrs r3, r0, 28 strh r3, [r2] lsls r0, 4 lsrs r0, 20 strh r0, [r1] bx lr thumb_func_end sub_802C808 thumb_func_start sub_802C818 sub_802C818: ; 802C818 push {lr} bl GenerateRandomNumber lsls r0, 16 movs r1, 0xE0 lsls r1, 11 ands r1, r0 ldr r0, =gUnknown_082FB704 lsrs r1, 15 adds r1, r0 ldrh r0, [r1] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802C818 thumb_func_start sub_802C838 sub_802C838: ; 802C838 push {r4-r6,lr} movs r5, 0 movs r4, 0 ldr r3, =0x02022cfc ldr r0, [r3] ldr r2, =gUnknown_082FB714 ldr r1, [r0, 0x78] ldr r0, [r2] cmp r1, r0 bcc @0802C874 ldr r5, [r2, 0x4] adds r6, r3, 0 adds r3, r2, 0x4 @0802C852: adds r3, 0x8 adds r2, 0x8 adds r4, 0x1 cmp r4, 0x4 bhi @0802C874 ldr r0, [r6] ldr r1, [r0, 0x78] ldr r0, [r2] cmp r1, r0 bcc @0802C874 ldr r5, [r3] b @0802C852 .align 2, 0 .pool @0802C874: lsls r0, r5, 16 lsrs r0, 16 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_802C838 thumb_func_start sub_802C880 sub_802C880: ; 802C880 push {r4,r5,lr} lsls r0, 16 lsrs r5, r0, 16 lsls r1, 16 lsrs r4, r1, 16 b @0802C892 @0802C88C: subs r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 @0802C892: cmp r4, 0 beq @0802C8A4 adds r0, r5, 0 adds r1, r4, 0 bl sub_80D6800 lsls r0, 24 cmp r0, 0 beq @0802C88C @0802C8A4: adds r0, r4, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_802C880 thumb_func_start sub_802C8AC sub_802C8AC: ; 802C8AC push {lr} bl sub_8009FCC lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_802C8AC thumb_func_start sub_802C8BC sub_802C8BC: ; 802C8BC ldr r0, =0x02022cfc ldr r0, [r0] ldrb r0, [r0, 0x6] bx lr .align 2, 0 .pool thumb_func_end sub_802C8BC thumb_func_start sub_802C8C8 sub_802C8C8: ; 802C8C8 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02022cfc lsls r1, r0, 1 adds r1, r0 lsls r1, 2 ldr r0, =0x000082a8 adds r1, r0 ldr r0, [r2] adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_802C8C8 thumb_func_start sub_802C8E8 sub_802C8E8: ; 802C8E8 adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r2, =0x02022cfc lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, [r2] adds r0, r1 movs r1, 0x83 lsls r1, 8 adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_802C8E8 thumb_func_start sub_802C908 sub_802C908: ; 802C908 push {lr} lsls r0, 16 lsrs r0, 16 bl sub_802AC00 lsls r0, 16 asrs r0, 16 mvns r0, r0 lsrs r0, 31 pop {r1} bx r1 thumb_func_end sub_802C908 thumb_func_start sub_802C920 sub_802C920: ; 802C920 push {r4,r5,lr} movs r5, 0 @0802C924: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 bl pokemon_getattr cmp r0, 0 beq @0802C95C adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 bl sub_802C908 cmp r0, 0 beq @0802C95C ldr r1, =0x020375f0 movs r0, 0x1 b @0802C966 .align 2, 0 .pool @0802C95C: adds r5, 0x1 cmp r5, 0x5 ble @0802C924 ldr r1, =0x020375f0 movs r0, 0 @0802C966: strh r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C920 thumb_func_start sub_802C974 sub_802C974: ; 802C974 push {r4-r6,lr} adds r6, r0, 0 movs r4, 0 ldr r5, =gUnknown_082FBE08 @0802C97C: adds r0, r5, 0 bl gpu_tile_obj_decompress_and_load adds r5, 0x8 adds r4, 0x1 cmp r4, 0x4 bls @0802C97C movs r4, 0 ldr r5, =gUnknown_082FBE30 @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 .pool thumb_func_end sub_802C974 thumb_func_start sub_802C9BC sub_802C9BC: ; 802C9BC push {lr} movs r2, 0 movs r1, 0x7 adds r0, 0x3C @0802C9C4: strh r2, [r0] subs r0, 0x2 subs r1, 0x1 cmp r1, 0 bge @0802C9C4 pop {r0} bx r0 thumb_func_end sub_802C9BC thumb_func_start sub_802C9D4 sub_802C9D4: ; 802C9D4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x34 mov r9, r0 adds r7, r1, 0 ldr r0, [sp, 0x54] lsls r2, 16 lsrs r2, 16 str r2, [sp, 0x28] lsls r3, 16 lsrs r3, 16 str r3, [sp, 0x2C] lsls r0, 24 lsrs r6, r0, 24 mov r1, sp ldr r0, =gUnknown_082FBE40 ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2-r4} stm r1!, {r2-r4} movs r0, 0x80 lsls r0, 6 bl 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 .pool @0802CA2C: adds r0, r6, 0x4 lsls r0, 24 lsrs r0, 24 @0802CA32: str r0, [sp, 0x30] mov r1, r8 cmp r1, 0 beq @0802CAF4 mov r2, r10 cmp r2, 0 beq @0802CAF4 ldrh r2, [r7] lsls r0, r2, 3 ldr r1, =gMonStillFrontPicTable adds r0, r1 ldr r3, [r7, 0x8] mov r1, r8 bl sub_8034628 mov r3, r8 str r3, [sp, 0x18] adds r4, r6, 0 add r0, sp, 0x18 ldr r5, =0xffff0000 lsls r1, r4, 16 movs r2, 0x80 lsls r2, 4 orrs r1, r2 str r1, [r0, 0x4] bl 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, =0x000081a8 add r2, r9 adds r2, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 str r0, [r2] ldr r0, =0x000081fc add r0, r9 adds r0, r6 add r1, sp, 0x30 ldrb r1, [r1] strb r1, [r0] b @0802CB00 .align 2, 0 .pool @0802CAF4: lsls r0, r6, 2 ldr r1, =0x000081a8 add r1, r9 adds r1, r0 movs r0, 0 str r0, [r1] @0802CB00: add sp, 0x34 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802C9D4 thumb_func_start sub_802CB14 sub_802CB14: ; 802CB14 push {r4-r6,lr} adds r4, r0, 0 lsls r6, r1, 2 ldr r0, =0x000081bc adds r5, r4, r0 adds r5, r6 ldr r0, [r5] bl sub_802C9BC ldr r2, [r5] ldr r0, =0x000081a8 adds r4, r0 adds r4, r6 ldr r1, [r4] ldr r0, =0x02020630 subs r1, r0 lsls r0, r1, 4 subs r0, r1 lsls r1, r0, 8 adds r0, r1 lsls r1, r0, 16 adds r0, r1 negs r0, r0 asrs r0, 2 strh r0, [r2, 0x3C] ldr r1, [r5] adds r1, 0x3E ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, [r5] movs r0, 0x60 strh r0, [r1, 0x22] ldr r0, [r5] ldr r1, =sub_802CB7C str r1, [r0, 0x1C] movs r1, 0x1 bl obj_anim_image_start pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CB14 thumb_func_start sub_802CB7C sub_802CB7C: ; 802CB7C push {lr} adds r2, r0, 0 movs r1, 0x2E ldrsh r0, [r2, r1] cmp r0, 0x1 beq @0802CBA8 cmp r0, 0x1 bgt @0802CB92 cmp r0, 0 beq @0802CB98 b @0802CBE6 @0802CB92: cmp r0, 0x2 beq @0802CBC8 b @0802CBE6 @0802CB98: adds r0, r2, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @0802CBE6 b @0802CBD6 @0802CBA8: ldrh r1, [r2, 0x22] subs r1, 0x1 strh r1, [r2, 0x22] ldrh r0, [r2, 0x30] adds r0, 0x1 strh r0, [r2, 0x30] lsls r1, 16 asrs r1, 16 cmp r1, 0x48 bgt @0802CBE6 movs r0, 0x48 strh r0, [r2, 0x22] ldrh r0, [r2, 0x2E] adds r0, 0x1 strh r0, [r2, 0x2E] b @0802CBE6 @0802CBC8: ldrh r0, [r2, 0x30] adds r0, 0x1 strh r0, [r2, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x2F ble @0802CBE6 @0802CBD6: adds r3, r2, 0 adds r3, 0x3E ldrb r0, [r3] movs r1, 0x4 orrs r0, r1 strb r0, [r3] ldr r0, =nullsub_12 str r0, [r2, 0x1C] @0802CBE6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CB7C thumb_func_start sub_802CBF0 sub_802CBF0: ; 802CBF0 push {lr} lsls r1, 2 ldr r2, =0x000081a8 adds r0, r2 adds r0, r1 ldr r2, [r0] ldr r1, =sub_802CC40 str r1, [r2, 0x1C] movs r1, 0 strh r1, [r2, 0x26] ldr r0, [r0] bl sub_802C9BC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CBF0 thumb_func_start sub_802CC18 sub_802CC18: ; 802CC18 push {lr} movs r2, 0 lsls r1, 2 ldr r3, =0x000081a8 adds r0, r3 adds r0, r1 ldr r0, [r0] ldr r1, [r0, 0x1C] ldr r0, =sub_802CC40 cmp r1, r0 bne @0802CC30 movs r2, 0x1 @0802CC30: adds r0, r2, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802CC18 thumb_func_start sub_802CC40 sub_802CC40: ; 802CC40 push {lr} adds r2, r0, 0 ldrh r0, [r2, 0x30] adds r0, 0x1 strh r0, [r2, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x1 ble @0802CC6C ldrh r0, [r2, 0x32] adds r0, 0x1 strh r0, [r2, 0x32] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0802CC64 movs r0, 0x2 b @0802CC66 @0802CC64: ldr r0, =0x0000fffe @0802CC66: strh r0, [r2, 0x26] movs r0, 0 strh r0, [r2, 0x30] @0802CC6C: movs r1, 0x32 ldrsh r0, [r2, r1] cmp r0, 0xC ble @0802CC7C movs r0, 0 strh r0, [r2, 0x26] ldr r0, =nullsub_12 str r0, [r2, 0x1C] @0802CC7C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CC40 thumb_func_start sub_802CC88 sub_802CC88: ; 802CC88 push {r4,lr} adds r4, r0, 0 lsls r1, 2 ldr r0, =0x000081a8 adds r4, r0 adds r4, r1 ldr r0, [r4] bl sub_802C9BC ldr r1, [r4] ldr r0, =sub_802CD08 str r0, [r1, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CC88 thumb_func_start sub_802CCB0 sub_802CCB0: ; 802CCB0 push {r4-r7,lr} adds r4, r0, 0 bl sub_802C8AC lsls r0, 16 lsrs r0, 16 cmp r0, 0 beq @0802CCF4 movs r1, 0x5 negs r1, r1 mov r12, r1 ldr r1, =0x000081a8 adds r3, r4, r1 ldr r7, =sub_802CD08 ldr r6, =nullsub_12 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 .pool thumb_func_end sub_802CCB0 thumb_func_start sub_802CD08 sub_802CD08: ; 802CD08 push {lr} adds r3, r0, 0 ldrh r0, [r3, 0x2E] adds r0, 0x1 strh r0, [r3, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0x3 ble @0802CD36 movs r0, 0 strh r0, [r3, 0x2E] adds r3, 0x3E ldrb r2, [r3] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r0, 0x5 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] @0802CD36: pop {r0} bx r0 thumb_func_end sub_802CD08 thumb_func_start sub_802CD3C sub_802CD3C: ; 802CD3C push {r4,r5,lr} adds r4, r0, 0 bl sub_802C8AC lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 cmp r2, r3 bge @0802CD66 ldr r0, =0x000081fc adds r5, r4, r0 subs r0, 0x54 adds r4, r0 @0802CD56: ldm r4!, {r0} adds r1, r5, r2 ldrb r1, [r1] adds r0, 0x43 strb r1, [r0] adds r2, 0x1 cmp r2, r3 blt @0802CD56 @0802CD66: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CD3C thumb_func_start sub_802CD70 sub_802CD70: ; 802CD70 push {r4,lr} adds r4, r0, 0 lsls r1, 2 ldr r0, =0x000081a8 adds r4, r0 adds r4, r1 ldr r0, [r4] bl sub_802C9BC ldr r1, [r4] ldr r0, =sub_802CDD4 str r0, [r1, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CD70 thumb_func_start sub_802CD98 sub_802CD98: ; 802CD98 push {r4,r5,lr} adds r4, r0, 0 bl sub_802C8AC lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 cmp r2, r3 bge @0802CDCC ldr r5, =sub_802CDD4 ldr r0, =0x000081a8 adds r1, r4, r0 @0802CDB0: ldr r0, [r1] ldr r0, [r0, 0x1C] cmp r0, r5 bne @0802CDC4 movs r0, 0x1 b @0802CDCE .align 2, 0 .pool @0802CDC4: adds r1, 0x4 adds r2, 0x1 cmp r2, r3 blt @0802CDB0 @0802CDCC: movs r0, 0 @0802CDCE: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_802CD98 thumb_func_start sub_802CDD4 sub_802CDD4: ; 802CDD4 push {r4,r5,lr} adds r5, r0, 0 movs r0, 0x2E ldrsh r4, [r5, r0] cmp r4, 0 beq @0802CDE6 cmp r4, 0x1 beq @0802CDF4 b @0802CE3C @0802CDE6: movs r0, 0x22 bl audio_play strh r4, [r5, 0x30] ldrh r0, [r5, 0x2E] adds r0, 0x1 strh r0, [r5, 0x2E] @0802CDF4: ldrh r0, [r5, 0x30] adds r0, 0x4 strh r0, [r5, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x7F ble @0802CE06 movs r0, 0 strh r0, [r5, 0x30] @0802CE06: ldr r1, =gUnknown_08329F40 movs r2, 0x30 ldrsh r0, [r5, r2] lsls r0, 1 adds r0, r1 ldrh r0, [r0] lsls r0, 16 asrs r0, 19 negs r0, r0 strh r0, [r5, 0x26] movs r0, 0x30 ldrsh r1, [r5, r0] cmp r1, 0 bne @0802CE3C ldrh r0, [r5, 0x32] adds r0, 0x1 strh r0, [r5, 0x32] lsls r0, 16 asrs r0, 16 cmp r0, 0x1 bgt @0802CE38 strh r1, [r5, 0x2E] b @0802CE3C .align 2, 0 .pool @0802CE38: ldr r0, =nullsub_12 str r0, [r5, 0x1C] @0802CE3C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CDD4 thumb_func_start sub_802CE48 sub_802CE48: ; 802CE48 push {r4,r5,lr} adds r5, r0, 0 lsls r3, 24 lsrs r4, r3, 24 ldr r0, =gUnknown_082FC00C lsls r1, 16 asrs r1, 16 lsls r2, 16 asrs r2, 16 movs r3, 0x1 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x40 beq @0802CE88 ldr r0, =0x02020630 lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r0 adds r3, r1, 0 adds r3, 0x3E ldrb r0, [r3] movs r2, 0x4 orrs r0, r2 strb r0, [r3] lsls r2, r4, 2 ldr r3, =0x000081bc adds r0, r5, r3 adds r0, r2 str r1, [r0] @0802CE88: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CE48 thumb_func_start sub_802CE9C sub_802CE9C: ; 802CE9C push {r4-r7,lr} adds r7, r0, 0 movs r5, 0 movs r4, 0 ldr r6, =gUnknown_082FBE58 @0802CEA6: ldr r1, =gUnknown_082FBEB8 lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] ldr r2, =gUnknown_082FBEA8 lsls r1, r5, 1 adds r1, r2 movs r2, 0 ldrsh r1, [r1, r2] movs r3, 0 ldrsh r2, [r6, r3] movs r3, 0x2 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r1, r0, 24 lsls r0, r5, 2 ldr r3, =0x000081d0 adds r2, r7, r3 adds r2, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 str r0, [r2] adds r5, 0x1 adds r6, 0x14 adds r4, 0x1 cmp r4, 0x3 ble @0802CEA6 movs r4, 0x3 movs r6, 0x3C @0802CEE8: ldr r1, =gUnknown_082FBEB8 lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] ldr r2, =gUnknown_082FBEA8 lsls r1, r5, 1 adds r1, r2 movs r2, 0 ldrsh r1, [r1, r2] ldr r2, =gUnknown_082FBE58 adds r2, r6, r2 movs r3, 0 ldrsh r2, [r2, r3] movs r3, 0x2 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r1, r0, 24 lsls r0, r5, 2 ldr r3, =0x000081d0 adds r2, r7, r3 adds r2, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 str r0, [r2] adds r0, 0x3F ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] adds r5, 0x1 subs r6, 0x14 subs r4, 0x1 cmp r4, 0 bge @0802CEE8 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802CE9C thumb_func_start sub_802CF50 sub_802CF50: ; 802CF50 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC str r0, [sp, 0x8] cmp r1, 0x5 ble @0802CF70 movs r0, 0xA subs r1, r0, r1 movs r0, 0x3 str r0, [sp] ldr r2, [sp, 0x8] ldrb r0, [r2, 0xF] b @0802CF78 @0802CF70: movs r3, 0x2 str r3, [sp] ldr r7, [sp, 0x8] ldrb r0, [r7, 0xE] @0802CF78: movs r6, 0 lsls r2, r1, 1 str r2, [sp, 0x4] lsls r0, 4 mov r9, r0 lsls r1, 24 mov r8, r1 ldr r0, =gUnknown_082FBE58 adds r4, r2, r0 ldr r3, [sp] lsls r3, 2 mov r10, r3 movs r5, 0x3 @0802CF92: lsls r0, r6, 2 ldr r7, [sp, 0x8] ldr r1, =0x000081d0 adds r2, r7, r1 adds r2, r0 ldr r1, [r2] ldrh r0, [r4] strh r0, [r1, 0x22] ldr r3, [r2] ldrb r0, [r3, 0x5] movs r7, 0xD negs r7, r7 adds r1, r7, 0 ands r0, r1 mov r1, r10 orrs r0, r1 strb r0, [r3, 0x5] ldr r3, [r2] ldrb r1, [r3, 0x5] movs r0, 0xF ands r0, r1 mov r7, r9 orrs r0, r7 strb r0, [r3, 0x5] ldr r0, [r2] mov r2, r8 lsrs r1, r2, 24 bl obj_anim_image_start adds r6, 0x1 adds r4, 0x14 subs r5, 0x1 cmp r5, 0 bge @0802CF92 movs r5, 0x3 ldr r0, =gUnknown_082FBE58 ldr r3, [sp, 0x4] adds r0, r3, r0 adds r4, r0, 0 adds r4, 0x3C ldr r7, [sp] lsls r7, 2 mov r10, r7 @0802CFE8: lsls r0, r6, 2 ldr r1, [sp, 0x8] ldr r3, =0x000081d0 adds r2, r1, r3 adds r2, r0 ldr r1, [r2] ldrh r0, [r4] strh r0, [r1, 0x22] ldr r3, [r2] ldrb r0, [r3, 0x5] movs r7, 0xD negs r7, r7 adds r1, r7, 0 ands r0, r1 mov r1, r10 orrs r0, r1 strb r0, [r3, 0x5] ldr r3, [r2] ldrb r1, [r3, 0x5] movs r0, 0xF ands r0, r1 mov r7, r9 orrs r0, r7 strb r0, [r3, 0x5] ldr r0, [r2] mov r2, r8 lsrs r1, r2, 24 bl 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 .pool thumb_func_end sub_802CF50 thumb_func_start sub_802D044 sub_802D044: ; 802D044 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 movs r0, 0 str r0, [sp] movs r0, 0x9 movs r1, 0x7 movs r2, 0x78 movs r3, 0x50 bl sub_802EB24 adds r0, r4, 0 bl sub_802CD3C add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end sub_802D044 thumb_func_start sub_802D068 sub_802D068: ; 802D068 push {lr} bl sub_802EB84 pop {r1} bx r1 thumb_func_end sub_802D068 thumb_func_start sub_802D074 sub_802D074: ; 802D074 push {r4,lr} ldr r4, =0x02022d00 str r0, [r4] bl sub_802D0BC ldr r0, =sub_802D12C movs r1, 0x3 bl AddTask ldr r1, [r4] strb r0, [r1, 0x6] ldr r2, [r4] ldrb r0, [r2, 0x6] movs r1, 0x2 bl set_word_task_arg ldr r0, =sub_802D150 bl sub_802D108 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_082FE18C @0802D0D0: ldr r0, [r4] cmp r0, r6 bne @0802D0DC ldr r0, [r4, 0x4] bl sub_802D108 @0802D0DC: adds r4, 0x8 adds r5, 0x1 cmp r5, 0x9 bls @0802D0D0 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802D0C8 thumb_func_start sub_802D0F0 sub_802D0F0: ; 802D0F0 ldr r0, =0x02022d00 ldr r0, [r0] ldr r1, [r0] movs r0, 0x1 eors r1, r0 negs r0, r1 orrs r0, r1 lsrs r0, 31 bx lr .align 2, 0 .pool thumb_func_end sub_802D0F0 thumb_func_start sub_802D108 sub_802D108: ; 802D108 push {r4,lr} adds r2, r0, 0 ldr r4, =0x02022d00 ldr r0, [r4] ldrb r0, [r0, 0x6] movs r1, 0 bl set_word_task_arg ldr r1, [r4] movs r0, 0 strh r0, [r1, 0x4] str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802D108 thumb_func_start sub_802D12C sub_802D12C: ; 802D12C push {lr} lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x02022d00 ldr r0, [r0] ldr r0, [r0] cmp r0, 0 bne @0802D148 adds r0, r1, 0 movs r1, 0 bl get_word_task_arg bl _call_via_r0 @0802D148: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802D12C thumb_func_start sub_802D150 sub_802D150: ; 802D150 push {r4-r6,lr} sub sp, 0x8 ldr r6, =0x02022d00 ldr r1, [r6] ldrh r5, [r1, 0x4] cmp r5, 0x1 bne @0802D160 b @0802D298 @0802D160: cmp r5, 0x1 bgt @0802D170 cmp r5, 0 beq @0802D178 b @0802D2DA .align 2, 0 .pool @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, =gUnknown_082FE164 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r0, =gUnknown_082FE174 bl Window_InitFromTemplates bl reset_temp_tile_data_buffers ldr r0, [r6] bl sub_802C974 bl sub_802DD08 ldr r0, =gUnknown_082FC044 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r1, =gUnknown_082FC064 str r5, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_082FC290 movs r4, 0x1 str r4, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r0, =gUnknown_082FC440 movs r1, 0x30 movs r2, 0x20 bl gpu_pal_apply ldr r1, =gUnknown_082FC460 str r5, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_082FCDB0 str r4, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r0, =gUnknown_082FD168 movs r1, 0x10 movs r2, 0x20 bl gpu_pal_apply ldr r1, =gUnknown_082FD188 str r5, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_082FDC38 str r4, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r0, =gUnknown_082FC024 movs r1, 0x20 movs r2, 0x20 bl gpu_pal_apply ldr r1, [r6] movs r0, 0xD3 lsls r0, 1 adds r1, r0 movs r0, 0 bl 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 .pool @0802D298: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @0802D2DA bl sub_802DBF8 ldr r0, [r6] bl sub_802CE9C ldr r0, [r6] movs r1, 0x6 bl sub_802CF50 movs r0, 0x3 bl 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, =0x02022d00 ldr r0, [r4] ldrh r0, [r0, 0x4] cmp r0, 0x1 beq @0802D310 cmp r0, 0x1 bgt @0802D300 cmp r0, 0 beq @0802D30A b @0802D34A .align 2, 0 .pool @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, =0x02022d00 ldr r0, [r4] ldrh r0, [r0, 0x4] cmp r0, 0x1 beq @0802D37C cmp r0, 0x1 bgt @0802D36C cmp r0, 0 beq @0802D376 b @0802D3B6 .align 2, 0 .pool @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, =0x02022d00 ldr r0, [r0] ldrh r0, [r0, 0x4] cmp r0, 0 beq @0802D3DC cmp r0, 0x1 beq @0802D410 b @0802D43E .align 2, 0 .pool @0802D3DC: movs r4, 0 cmp r4, r5 bge @0802D3F8 @0802D3E2: ldr r0, =0x02022d00 ldr r0, [r0] lsls r1, r4, 1 adds r0, 0x1C adds r0, r1 ldrb r0, [r0] bl Window_FillTileMap adds r4, 0x1 cmp r4, r5 blt @0802D3E2 @0802D3F8: movs r0, 0 bl gpu_copy_wram_bg_tilemap_to_vram ldr r0, =0x02022d00 ldr r1, [r0] ldrh r0, [r1, 0x4] adds r0, 0x1 strh r0, [r1, 0x4] b @0802D43E .align 2, 0 .pool @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, =0x02022d00 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, =0x02022d00 ldr r1, [r0] movs r0, 0x1 str r0, [r1] @0802D43E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802D3BC thumb_func_start sub_802D448 sub_802D448: ; 802D448 push {r4,r5,lr} sub sp, 0xC ldr r5, =0x02022d00 ldr r0, [r5] ldrh r4, [r0, 0x4] cmp r4, 0x1 beq @0802D4A4 cmp r4, 0x1 bgt @0802D464 cmp r4, 0 beq @0802D46A b @0802D4EC .align 2, 0 .pool @0802D464: cmp r4, 0x2 beq @0802D4DC b @0802D4EC @0802D46A: movs r0, 0x1 movs r1, 0x8 movs r2, 0x14 movs r3, 0x2 bl sub_802DA9C ldr r1, [r5] strh r0, [r1, 0x12] lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_085EDF2A movs r1, 0x1 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 bl Window_CopyToVram b @0802D4D2 .align 2, 0 .pool @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, =0x02022d00 ldr r0, [r5] ldrh r4, [r0, 0x4] cmp r4, 0x1 beq @0802D550 cmp r4, 0x1 bgt @0802D510 cmp r4, 0 beq @0802D516 b @0802D58E .align 2, 0 .pool @0802D510: cmp r4, 0x2 beq @0802D57E b @0802D58E @0802D516: movs r0, 0x2 movs r1, 0x7 movs r2, 0x1A movs r3, 0x4 bl sub_802DA9C ldr r1, [r5] strh r0, [r1, 0x12] lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_082C8959 movs r1, 0x1 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 bl Window_CopyToVram b @0802D574 .align 2, 0 .pool @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, =0x02022d00 ldr r0, [r5] ldrh r4, [r0, 0x4] cmp r4, 0 beq @0802D5B0 cmp r4, 0x1 beq @0802D5C8 b @0802D5DE .align 2, 0 .pool @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, =0x02022d00 ldr r0, [r5] ldrh r4, [r0, 0x4] cmp r4, 0x1 beq @0802D640 cmp r4, 0x1 bgt @0802D600 cmp r4, 0 beq @0802D606 b @0802D67E .align 2, 0 .pool @0802D600: cmp r4, 0x2 beq @0802D66E b @0802D67E @0802D606: movs r0, 0x2 movs r1, 0x8 movs r2, 0x16 movs r3, 0x4 bl sub_802DA9C ldr r1, [r5] strh r0, [r1, 0x12] lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_085EDF3E movs r1, 0x1 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 bl Window_CopyToVram b @0802D664 .align 2, 0 .pool @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, =0x02022d00 ldr r0, [r5] ldrh r4, [r0, 0x4] cmp r4, 0x1 beq @0802D6E4 cmp r4, 0x1 bgt @0802D6A4 cmp r4, 0 beq @0802D6AA b @0802D722 .align 2, 0 .pool @0802D6A4: cmp r4, 0x2 beq @0802D712 b @0802D722 @0802D6AA: movs r0, 0x7 movs r1, 0xA movs r2, 0x10 movs r3, 0x2 bl sub_802DA9C ldr r1, [r5] strh r0, [r1, 0x12] lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_085EDF6F movs r1, 0x1 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 bl Window_CopyToVram b @0802D708 .align 2, 0 .pool @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, =0x02022d00 ldr r0, [r5] ldrh r4, [r0, 0x4] cmp r4, 0 beq @0802D744 cmp r4, 0x1 beq @0802D752 b @0802D75E .align 2, 0 .pool @0802D744: bl sub_802D044 ldr r1, [r5] ldrh r0, [r1, 0x4] adds r0, 0x1 strh r0, [r1, 0x4] b @0802D75E @0802D752: bl sub_802D068 cmp r0, 0 bne @0802D75E ldr r0, [r5] str r4, [r0] @0802D75E: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_802D72C thumb_func_start sub_802D764 sub_802D764: ; 802D764 push {lr} ldr r1, =0x02022d00 ldr r0, [r1] movs r2, 0 strb r2, [r0, 0xA] ldr r0, [r1] strb r2, [r0, 0xB] ldr r2, [r1] movs r0, 0x6 strb r0, [r2, 0xC] ldr r0, [r1] ldrb r0, [r0, 0xC] bl sub_802DC9C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802D764 thumb_func_start sub_802D788 sub_802D788: ; 802D788 push {r4,lr} ldr r0, =0x02022d00 ldr r2, [r0] ldrb r3, [r2, 0xA] adds r4, r0, 0 cmp r3, 0 beq @0802D7A0 cmp r3, 0x1 beq @0802D7DA b @0802D7DE .align 2, 0 .pool @0802D7A0: ldrb r0, [r2, 0xB] adds r0, 0x1 strb r0, [r2, 0xB] ldr r1, [r4] ldrb r0, [r1, 0xB] cmp r0, 0xA bls @0802D7CA strb r3, [r1, 0xB] ldr r0, [r4] ldrb r1, [r0, 0xC] adds r1, 0x1 strb r1, [r0, 0xC] ldr r1, [r4] ldrb r0, [r1, 0xC] cmp r0, 0x9 bls @0802D7CA strb r3, [r1, 0xC] ldr r1, [r4] ldrb r0, [r1, 0xA] adds r0, 0x1 strb r0, [r1, 0xA] @0802D7CA: ldr r0, [r4] ldrb r0, [r0, 0xC] bl sub_802DC9C ldr r0, [r4] ldrb r0, [r0, 0xC] cmp r0, 0x7 bne @0802D7DE @0802D7DA: movs r0, 0 b @0802D7E0 @0802D7DE: movs r0, 0x1 @0802D7E0: pop {r4} pop {r1} bx r1 thumb_func_end sub_802D788 thumb_func_start sub_802D7E8 sub_802D7E8: ; 802D7E8 push {r4,r5,lr} sub sp, 0xC adds r4, r1, 0 lsls r0, 16 lsrs r0, 16 lsls r4, 16 lsrs r4, 16 ldr r5, =0x02022d00 ldr r1, [r5] adds r1, 0x26 adds r2, r4, 0 bl sub_80D6660 ldr r0, [r5] adds r0, 0x66 adds r1, r4, 0 movs r2, 0 movs r3, 0x1 bl 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, =gUnknown_085EDED3 bl sub_81AFC28 movs r0, 0x4 movs r1, 0x8 movs r2, 0x16 movs r3, 0x4 bl sub_802DA9C ldr r2, [r5] movs r4, 0 movs r3, 0 strh r0, [r2, 0x12] lsls r0, 24 lsrs r0, 24 adds r2, 0xA6 movs r1, 0x1 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] str r3, [sp, 0x8] movs r1, 0x1 bl Print ldr r0, [r5] ldrb r0, [r0, 0x12] movs r1, 0x2 bl Window_CopyToVram ldr r1, [r5] ldr r0, =0x0000016f strh r0, [r1, 0x14] strb r4, [r1, 0xD] add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802D7E8 thumb_func_start sub_802D884 sub_802D884: ; 802D884 push {r4-r6,lr} sub sp, 0xC lsls r0, 16 lsrs r0, 16 ldr r4, =0x02022d00 ldr r1, [r4] adds r1, 0x26 bl itemid_get_name bl sub_81AFBF0 ldr r1, [r4] adds r1, 0x26 movs r0, 0 bl sub_81AFC0C ldr r0, [r4] adds r0, 0xA6 ldr r1, =gUnknown_085EDEF4 bl sub_81AFC28 movs r0, 0x4 movs r1, 0x8 movs r2, 0x16 movs r3, 0x4 bl sub_802DA9C ldr r2, [r4] movs r6, 0 movs r5, 0 strh r0, [r2, 0x12] lsls r0, 24 lsrs r0, 24 adds r2, 0xA6 movs r1, 0x1 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] str r5, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r4] ldrb r0, [r0, 0x12] movs r1, 0x2 bl 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 .pool thumb_func_end sub_802D884 thumb_func_start sub_802D8FC sub_802D8FC: ; 802D8FC push {r4-r6,lr} sub sp, 0xC lsls r0, 16 lsrs r0, 16 ldr r4, =0x02022d00 ldr r1, [r4] adds r1, 0x26 bl itemid_get_name bl sub_81AFBF0 ldr r1, [r4] adds r1, 0x26 movs r0, 0 bl sub_81AFC0C ldr r0, [r4] adds r0, 0xA6 ldr r1, =gUnknown_085EDF11 bl sub_81AFC28 movs r0, 0x4 movs r1, 0x9 movs r2, 0x16 movs r3, 0x2 bl sub_802DA9C ldr r2, [r4] movs r6, 0 movs r5, 0 strh r0, [r2, 0x12] lsls r0, 24 lsrs r0, 24 adds r2, 0xA6 movs r1, 0x1 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] str r5, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print ldr r0, [r4] ldrb r0, [r0, 0x12] movs r1, 0x2 bl 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 .pool thumb_func_end sub_802D8FC thumb_func_start sub_802D974 sub_802D974: ; 802D974 push {r4,lr} ldr r4, =0x02022d00 ldr r0, [r4] ldrb r0, [r0, 0xD] cmp r0, 0x1 beq @0802D9C8 cmp r0, 0x1 bgt @0802D990 cmp r0, 0 beq @0802D99A b @0802DA0C .align 2, 0 .pool @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, =0x02022d00 ldr r1, [r0] ldrb r0, [r1, 0xD] adds r0, 0x1 @0802DA00: strb r0, [r1, 0xD] @0802DA02: movs r0, 0 b @0802DA0E .align 2, 0 .pool @0802DA0C: movs r0, 0x1 @0802DA0E: pop {r4} pop {r1} bx r1 thumb_func_end sub_802D974 thumb_func_start sub_802DA14 sub_802DA14: ; 802DA14 push {r4,lr} ldr r4, =0x02022d00 ldr r0, [r4] ldrh r0, [r0, 0x12] cmp r0, 0xFF beq @0802DA38 lsls r0, 24 lsrs r0, 24 bl rbox_fill_rectangle ldr r0, [r4] ldrb r0, [r0, 0x12] movs r1, 0x1 bl Window_CopyToVram ldr r1, [r4] movs r0, 0 strb r0, [r1, 0xD] @0802DA38: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DA14 thumb_func_start sub_802DA44 sub_802DA44: ; 802DA44 push {r4,lr} ldr r4, =0x02022d00 ldr r1, [r4] ldrh r0, [r1, 0x12] cmp r0, 0xFF bne @0802DA58 @0802DA50: movs r0, 0 b @0802DA84 .align 2, 0 .pool @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, =0xffffff00 ldr r4, [sp] ands r4, r6 lsls r0, 24 lsrs r0, 16 ldr r5, =0xffff00ff ands r4, r5 orrs r4, r0 lsls r1, 24 lsrs r1, 8 ldr r0, =0xff00ffff ands r4, r0 orrs r4, r1 lsls r2, 24 ldr r0, =0x00ffffff ands r4, r0 orrs r4, r2 str r4, [sp] lsls r3, 24 lsrs r3, 24 ldr r0, [sp, 0x4] ands r0, r6 orrs r0, r3 ands r0, r5 movs r1, 0xF0 lsls r1, 4 orrs r0, r1 ldr r1, =0x0000ffff ands r0, r1 movs r1, 0x86 lsls r1, 15 orrs r0, r1 str r0, [sp, 0x4] mov r0, sp bl 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 .pool thumb_func_end sub_802DA9C thumb_func_start sub_802DB18 sub_802DB18: ; 802DB18 push {r4,r5,lr} sub sp, 0x8 adds r3, r2, 0 lsls r3, 24 lsrs r3, 24 ldr r5, =0xffffff00 ldr r2, [sp] ands r2, r5 lsls r0, 24 lsrs r0, 16 ldr r4, =0xffff00ff ands r2, r4 orrs r2, r0 lsls r1, 24 lsrs r1, 8 ldr r0, =0xff00ffff ands r2, r0 orrs r2, r1 ldr r0, =0x00ffffff ands r2, r0 movs r0, 0xC0 lsls r0, 19 orrs r2, r0 str r2, [sp] ldr r0, [sp, 0x4] ands r0, r5 movs r1, 0x4 orrs r0, r1 ands r0, r4 movs r1, 0x80 lsls r1, 2 orrs r0, r1 ldr r1, =0x0000ffff ands r0, r1 movs r1, 0xAC lsls r1, 14 orrs r0, r1 str r0, [sp, 0x4] mov r0, sp movs r1, 0x1 movs r2, 0xD bl sub_81996C0 add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DB18 thumb_func_start sub_802DB8C sub_802DB8C: ; 802DB8C push {r4,lr} sub sp, 0x10 ldr r1, =gUnknown_082FE1DC add r0, sp, 0xC movs r2, 0x3 bl memcpy movs r0, 0 bl 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, =gUnknown_085EDE7C str r0, [sp, 0x8] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0x1 bl box_print add r0, sp, 0xC str r0, [sp] str r4, [sp, 0x4] ldr r0, =gUnknown_085EDE84 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0x1 bl box_print add sp, 0x10 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DB8C thumb_func_start sub_802DBF8 sub_802DBF8: ; 802DBF8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 bl sub_802C8AC lsls r0, 16 lsrs r0, 16 mov r10, r0 ldr r1, =gUnknown_082FE260 subs r0, 0x2 lsls r0, 2 adds r0, r1 ldr r5, [r0] movs r6, 0 cmp r6, r10 bge @0802DC62 ldr r0, =gUnknown_08300D38 mov r9, r0 ldr r1, =0x02022d00 mov r8, r1 @0802DC26: lsls r4, r6, 24 lsrs r4, 24 adds r0, r4, 0 bl sub_802C8C8 adds r1, r0, 0 ldrh r0, [r1] lsls r0, 2 add r0, r9 ldrb r3, [r0, 0x1] mov r2, r8 ldr r0, [r2] movs r7, 0 ldrsh r2, [r5, r7] adds r3, 0x70 str r4, [sp] bl sub_802C9D4 mov r1, r8 ldr r0, [r1] movs r2, 0 ldrsh r1, [r5, r2] movs r2, 0x70 adds r3, r4, 0 bl sub_802CE48 adds r5, 0x2 adds r6, 0x1 cmp r6, r10 blt @0802DC26 @0802DC62: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DBF8 thumb_func_start sub_802DC80 sub_802DC80: ; 802DC80 ldr r2, =0x02022d00 ldr r2, [r2] lsls r0, 2 ldr r3, =0x000081a8 adds r2, r3 adds r2, r0 ldr r0, [r2] strh r1, [r0, 0x26] bx lr .align 2, 0 .pool thumb_func_end sub_802DC80 thumb_func_start sub_802DC9C sub_802DC9C: ; 802DC9C push {r4,lr} adds r4, r0, 0 ldr r0, =0x02022d00 ldr r0, [r0] adds r1, r4, 0 bl sub_802CF50 ldr r0, =gUnknown_082FE1DF adds r4, r0 ldrb r0, [r4] lsls r1, r0, 2 adds r1, r0 lsls r1, 13 movs r0, 0x2 movs r2, 0 bl bg_change_y_offset pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DC9C thumb_func_start sub_802DCCC sub_802DCCC: ; 802DCCC push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 movs r5, 0 movs r6, 0 @0802DCD6: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @0802DCEA ldr r0, =0x02022d00 ldr r0, [r0] adds r1, r5, 0 bl sub_802CB14 adds r6, 0x1 @0802DCEA: lsrs r4, 1 adds r5, 0x1 cmp r5, 0x4 ble @0802DCD6 subs r0, r6, 0x2 lsls r0, 24 lsrs r0, 24 bl sub_802E00C adds r0, r6, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802DCCC thumb_func_start sub_802DD08 sub_802DD08: ; 802DD08 push {r4,lr} sub sp, 0x10 mov r1, sp movs r0, 0x40 strb r0, [r1] movs r0, 0x5 strb r0, [r1, 0x1] movs r0, 0x8 strb r0, [r1, 0x2] movs r0, 0x6C strh r0, [r1, 0x4] movs r4, 0x6 strh r4, [r1, 0x6] ldr r0, =gUnknown_082FE1EC str r0, [sp, 0x8] ldr r0, =gUnknown_082FE1F4 str r0, [sp, 0xC] movs r0, 0x2 bl sub_8034C54 movs r0, 0 movs r1, 0 mov r2, sp bl sub_8034D14 mov r1, sp movs r0, 0x4 strb r0, [r1, 0x1] movs r0, 0x1E strh r0, [r1, 0x4] mov r0, sp strh r4, [r0, 0x6] movs r0, 0x1 movs r1, 0 mov r2, sp bl sub_8034D14 add sp, 0x10 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DD08 thumb_func_start sub_802DD64 sub_802DD64: ; 802DD64 push {lr} adds r1, r0, 0 movs r0, 0 bl sub_8035044 pop {r0} bx r0 thumb_func_end sub_802DD64 thumb_func_start sub_802DD74 sub_802DD74: ; 802DD74 push {lr} adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 movs r0, 0x1 bl sub_8035044 pop {r0} bx r0 thumb_func_end sub_802DD74 thumb_func_start sub_802DD88 sub_802DD88: ; 802DD88 push {lr} adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r0, =0x02022d00 ldr r0, [r0] bl sub_802CBF0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DD88 thumb_func_start sub_802DDA0 sub_802DDA0: ; 802DDA0 push {lr} adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r0, =0x02022d00 ldr r0, [r0] bl sub_802CC88 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DDA0 thumb_func_start sub_802DDB8 sub_802DDB8: ; 802DDB8 push {lr} adds r1, r0, 0 ldr r0, =0x02022d00 ldr r0, [r0] bl sub_802CC18 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802DDB8 thumb_func_start sub_802DDCC sub_802DDCC: ; 802DDCC push {lr} ldr r0, =0x02022d00 ldr r0, [r0] bl sub_802CCB0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DDCC thumb_func_start sub_802DDE0 sub_802DDE0: ; 802DDE0 push {lr} ldr r0, =0x02022d00 ldr r0, [r0] bl sub_802CD3C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DDE0 thumb_func_start sub_802DDF4 sub_802DDF4: ; 802DDF4 push {lr} adds r1, r0, 0 ldr r0, =0x02022d00 ldr r0, [r0] bl sub_802CD70 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802DDF4 thumb_func_start sub_802DE08 sub_802DE08: ; 802DE08 push {lr} ldr r0, =0x02022d00 ldr r0, [r0] bl sub_802CD98 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802DE08 thumb_func_start sub_802DE1C sub_802DE1C: ; 802DE1C push {r4-r7,lr} sub sp, 0x8 bl sub_802C8AC lsls r0, 16 lsrs r7, r0, 16 ldr r1, =gUnknown_082FE234 subs r0, r7, 0x2 lsls r0, 2 adds r0, r1 ldr r4, [r0] ldr r2, =0xffffff00 ldr r0, [sp] ands r0, r2 ldr r1, =0x00ffffff ands r0, r1 movs r1, 0x80 lsls r1, 20 orrs r0, r1 str r0, [sp] ldr r0, [sp, 0x4] ands r0, r2 movs r1, 0x2 orrs r0, r1 ldr r1, =0xffff00ff ands r0, r1 movs r1, 0x80 lsls r1, 2 orrs r0, r1 ldr r1, =0x0000ffff ands r0, r1 movs r1, 0xAC lsls r1, 14 orrs r0, r1 str r0, [sp, 0x4] movs r5, 0 cmp r5, r7 bge @0802DEAC mov r6, sp @0802DE6A: ldrb r0, [r4] lsls r0, 8 ldr r2, =0xffff00ff ldr r1, [sp] ands r1, r2 orrs r1, r0 str r1, [sp] ldrb r2, [r4, 0x2] lsls r2, 16 ldr r0, =0xff00ffff ands r0, r1 orrs r0, r2 str r0, [sp] mov r0, sp bl Window_AddFromTemplate ldr r1, =0x02022d00 ldr r1, [r1] lsls r2, r5, 1 adds r1, 0x1C adds r1, r2 strh r0, [r1] lsls r0, 24 lsrs r0, 24 bl 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 .pool thumb_func_end sub_802DE1C thumb_func_start sub_802DED8 sub_802DED8: ; 802DED8 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x10 adds r5, r0, 0 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 add r0, sp, 0xC strb r1, [r0] strb r2, [r0, 0x1] strb r3, [r0, 0x2] ldr r6, =0x02022d00 ldr r0, [r6] lsls r1, r5, 1 mov r8, r1 adds r0, 0x1C add r0, r8 ldrb r0, [r0] movs r1, 0 bl 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 .pool thumb_func_end sub_802DED8 thumb_func_start sub_802DF70 sub_802DF70: ; 802DF70 push {r4-r6,lr} adds r4, r0, 0 bl sub_802C8AC lsls r0, 16 lsrs r5, r0, 16 cmp r4, 0 bne @0802DF9A movs r4, 0 cmp r4, r5 bge @0802DFCC @0802DF86: adds r0, r4, 0 movs r1, 0 movs r2, 0x2 movs r3, 0x3 bl sub_802DED8 adds r4, 0x1 cmp r4, r5 blt @0802DF86 b @0802DFCC @0802DF9A: bl sub_802C8BC lsls r0, 16 lsrs r6, r0, 16 movs r4, 0 cmp r4, r5 bge @0802DFCC @0802DFA8: cmp r6, r4 beq @0802DFBA adds r0, r4, 0 movs r1, 0 movs r2, 0x2 movs r3, 0x3 bl sub_802DED8 b @0802DFC6 @0802DFBA: adds r0, r4, 0 movs r1, 0 movs r2, 0x4 movs r3, 0x5 bl sub_802DED8 @0802DFC6: adds r4, 0x1 cmp r4, r5 blt @0802DFA8 @0802DFCC: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_802DF70 thumb_func_start sub_802DFD4 sub_802DFD4: ; 802DFD4 push {r4,r5,lr} bl sub_802C8AC lsls r0, 16 lsrs r5, r0, 16 movs r4, 0 cmp r4, r5 bge @0802DFFA @0802DFE4: ldr r0, =0x02022d00 ldr r0, [r0] lsls r1, r4, 1 adds r0, 0x1C adds r0, r1 ldrb r0, [r0] bl 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 .pool thumb_func_end sub_802DFD4 thumb_func_start sub_802E00C sub_802E00C: ; 802E00C push {r4,lr} adds r1, r0, 0 lsls r1, 24 lsrs r4, r1, 24 ldr r0, =0x02022d00 ldr r2, [r0] movs r0, 0 str r0, [r2, 0x18] lsrs r1, 25 lsls r1, 16 movs r0, 0x1 movs r2, 0 bl 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, =sub_802E090 movs r1, 0x4 bl AddTask pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802E00C thumb_func_start sub_802E058 sub_802E058: ; 802E058 push {r4,lr} ldr r4, =0x02022d00 ldr r0, [r4] ldr r0, [r0, 0x18] cmp r0, 0x1F bls @0802E06C movs r0, 0 b @0802E08A .align 2, 0 .pool @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, =0x03003090 lsls r2, r0, 4 adds r0, r2, r3 ldrh r1, [r0] movs r0, 0xFF lsls r0, 8 ands r0, r1 movs r1, 0xBC lsls r1, 6 cmp r0, r1 bne @0802E100 adds r1, r3, 0x2 adds r1, r2, r1 mov r0, sp movs r2, 0xC bl memcpy mov r0, sp ldrb r0, [r0] cmp r0, 0x1 beq @0802E108 @0802E100: movs r0, 0 b @0802E118 .align 2, 0 .pool @0802E108: mov r0, sp ldrh r0, [r0, 0x2] strh r0, [r4] ldr r0, [sp, 0x8] str r0, [r4, 0x4] ldr r0, [sp, 0x4] str r0, [r4, 0x8] movs r0, 0x1 @0802E118: add sp, 0xC pop {r4} pop {r1} bx r1 thumb_func_end sub_802E0D0 thumb_func_start sub_802E120 sub_802E120: ; 802E120 push {lr} sub sp, 0xC mov r2, sp movs r1, 0x2 strb r1, [r2] str r0, [sp, 0x4] mov r0, sp bl sub_800FE50 add sp, 0xC pop {r0} bx r0 thumb_func_end sub_802E120 thumb_func_start sub_802E138 sub_802E138: ; 802E138 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0xC mov r3, sp movs r2, 0x3 strb r2, [r3] ldr r3, [r1, 0x8] lsls r3, 15 ldr r2, [sp, 0x8] ldr r4, =0x00007fff mov r8, r4 ands r2, r4 orrs r2, r3 str r2, [sp, 0x8] mov r6, sp ldrb r2, [r1, 0x1] movs r5, 0x1F adds r3, r5, 0 ands r3, r2 ldrb r4, [r6, 0x3] movs r2, 0x20 negs r2, r2 ands r2, r4 orrs r2, r3 strb r2, [r6, 0x3] mov r3, sp ldrb r2, [r1] strb r2, [r3, 0x1] ldrh r2, [r1, 0x2] strh r2, [r3, 0x6] mov r4, sp ldrh r2, [r1, 0x4] mov r1, r8 ands r2, r1 ldrh r3, [r4, 0x8] ldr r1, =0xffff8000 ands r1, r3 orrs r1, r2 strh r1, [r4, 0x8] mov r2, sp ldrh r1, [r0, 0x10] strb r1, [r2, 0x2] mov r3, sp ldr r1, [r0, 0x14] lsls r1, 5 ldrb r2, [r3, 0x3] ands r5, r2 orrs r5, r1 strb r5, [r3, 0x3] mov r1, sp ldrh r0, [r0, 0xE] strh r0, [r1, 0x4] mov r0, sp bl sub_800FE50 add sp, 0xC pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802E138 thumb_func_start sub_802E1BC sub_802E1BC: ; 802E1BC push {r4,r5,lr} sub sp, 0xC adds r5, r0, 0 adds r4, r1, 0 ldr r2, =0x03003090 ldrh r0, [r2] movs r1, 0xFF lsls r1, 8 ands r1, r0 movs r0, 0xBC lsls r0, 6 cmp r1, r0 bne @0802E228 adds r1, r2, 0x2 mov r0, sp movs r2, 0xC bl memcpy mov r0, sp ldrb r0, [r0] cmp r0, 0x3 bne @0802E228 ldr r0, [sp, 0x8] lsrs r0, 15 str r0, [r4, 0x8] mov r0, sp ldrb r1, [r0, 0x3] lsls r0, r1, 27 lsrs r0, 27 strb r0, [r4, 0x1] mov r0, sp ldrb r0, [r0, 0x1] strb r0, [r4] mov r0, sp ldrh r0, [r0, 0x6] strh r0, [r4, 0x2] mov r0, sp ldrh r0, [r0, 0x8] lsls r0, 17 lsrs r0, 17 strh r0, [r4, 0x4] mov r0, sp ldrb r0, [r0, 0x2] strh r0, [r5, 0x10] lsls r1, 24 lsrs r1, 29 str r1, [r5, 0x14] mov r0, sp ldrh r0, [r0, 0x4] strh r0, [r5, 0xE] movs r0, 0x1 b @0802E22A .align 2, 0 .pool @0802E228: movs r0, 0 @0802E22A: add sp, 0xC pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_802E1BC thumb_func_start sub_802E234 sub_802E234: ; 802E234 push {r4,lr} sub sp, 0xC mov r4, sp movs r3, 0x4 strb r3, [r4] ldrh r3, [r0, 0x10] strb r3, [r4, 0x1] ldr r3, [r0, 0x14] strb r3, [r4, 0x2] ldr r3, [r0, 0x18] strb r3, [r4, 0x3] mov r3, sp ldrh r0, [r0, 0xE] strh r0, [r3, 0x4] mov r0, sp strb r1, [r0, 0x6] strh r2, [r0, 0x8] bl sub_800FE50 add sp, 0xC pop {r4} pop {r0} bx r0 thumb_func_end sub_802E234 thumb_func_start sub_802E264 sub_802E264: ; 802E264 push {r4-r6,lr} sub sp, 0xC adds r4, r0, 0 adds r5, r2, 0 adds r6, r3, 0 ldr r3, =0x03003090 lsls r2, r1, 4 adds r0, r2, r3 ldrh r1, [r0] movs r0, 0xFF lsls r0, 8 ands r0, r1 movs r1, 0xBC lsls r1, 6 cmp r0, r1 bne @0802E2C4 adds r1, r3, 0x2 adds r1, r2, r1 mov r0, sp movs r2, 0xC bl memcpy mov r0, sp ldrb r0, [r0] cmp r0, 0x4 bne @0802E2C4 mov r0, sp ldrb r0, [r0, 0x1] strh r0, [r4, 0x10] mov r0, sp ldrb r0, [r0, 0x2] str r0, [r4, 0x14] mov r0, sp ldrb r0, [r0, 0x3] str r0, [r4, 0x18] mov r0, sp ldrh r0, [r0, 0x4] strh r0, [r4, 0xE] mov r0, sp ldrb r0, [r0, 0x6] strb r0, [r5] mov r0, sp ldrh r0, [r0, 0x8] strh r0, [r6] movs r0, 0x1 b @0802E2C6 .align 2, 0 .pool @0802E2C4: movs r0, 0 @0802E2C6: add sp, 0xC pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_802E264 thumb_func_start sub_802E2D0 sub_802E2D0: ; 802E2D0 push {r4,lr} sub sp, 0xC adds r4, r0, 0 ldr r3, =0x03003090 lsls r2, r1, 4 adds r0, r2, r3 ldrh r1, [r0] movs r0, 0xFF lsls r0, 8 ands r0, r1 movs r1, 0xBC lsls r1, 6 cmp r0, r1 bne @0802E320 adds r1, r3, 0x2 adds r1, r2, r1 mov r0, sp movs r2, 0xC bl memcpy mov r0, sp ldrb r0, [r0] cmp r0, 0x4 bne @0802E320 mov r0, sp ldrb r0, [r0, 0x1] strh r0, [r4, 0x10] mov r0, sp ldrb r0, [r0, 0x2] str r0, [r4, 0x14] mov r0, sp ldrb r0, [r0, 0x3] str r0, [r4, 0x18] mov r0, sp ldrh r0, [r0, 0x4] strh r0, [r4, 0xE] movs r0, 0x1 b @0802E322 .align 2, 0 .pool @0802E320: movs r0, 0 @0802E322: add sp, 0xC pop {r4} pop {r1} bx r1 thumb_func_end sub_802E2D0 thumb_func_start sub_802E32C sub_802E32C: ; 802E32C ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0xFE lsls r1, 1 adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_802E32C thumb_func_start sub_802E33C sub_802E33C: ; 802E33C push {lr} bl sub_802E32C movs r1, 0 strh r1, [r0] str r1, [r0, 0xC] strh r1, [r0, 0x4] strh r1, [r0, 0x6] str r1, [r0, 0x8] strh r1, [r0, 0x2] pop {r0} bx r0 thumb_func_end sub_802E33C thumb_func_start sub_802E354 sub_802E354: ; 802E354 push {r4-r6,lr} adds r4, r0, 0 lsls r1, 16 lsrs r5, r1, 16 lsls r2, 16 lsrs r6, r2, 16 bl sub_802E32C adds r1, r0, 0 movs r2, 0 ldr r0, [r1, 0xC] cmp r0, r4 bcs @0802E378 ldr r0, =0x00018696 cmp r4, r0 bhi @0802E378 str r4, [r1, 0xC] movs r2, 0x1 @0802E378: ldrh r0, [r1] cmp r0, r5 bcs @0802E388 ldr r0, =0x0000270f cmp r5, r0 bhi @0802E388 strh r5, [r1] movs r2, 0x1 @0802E388: ldrh r0, [r1, 0x4] cmp r0, r6 bcs @0802E398 ldr r0, =0x0000270f cmp r6, r0 bhi @0802E398 strh r6, [r1, 0x4] movs r2, 0x1 @0802E398: adds r0, r2, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802E354 thumb_func_start sub_802E3A8 sub_802E3A8: ; 802E3A8 push {lr} bl sub_802E32C adds r2, r0, 0 ldrh r1, [r2, 0x6] ldr r0, =0x0000270e cmp r1, r0 bhi @0802E3BC adds r0, r1, 0x1 strh r0, [r2, 0x6] @0802E3BC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802E3A8 thumb_func_start sub_802E3C4 sub_802E3C4: ; 802E3C4 push {r4,lr} ldr r4, =sub_802E3E4 adds r0, r4, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 bl _call_via_r4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802E3C4 thumb_func_start sub_802E3E4 sub_802E3E4: ; 802E3E4 push {r4-r7,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e08 adds r7, r0, r1 movs r1, 0 ldrsh r0, [r7, r1] cmp r0, 0x1 beq @0802E4A8 cmp r0, 0x1 bgt @0802E40C cmp r0, 0 beq @0802E416 b @0802E4F6 .align 2, 0 .pool @0802E40C: cmp r0, 0x2 beq @0802E4B4 cmp r0, 0x3 beq @0802E4DC b @0802E4F6 @0802E416: ldr r0, =gUnknown_082FE270 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] ldr r1, =gUnknown_085EDE8D movs r0, 0x1 movs r2, 0 bl font_get_width_of_string adds r4, r0, 0 movs r6, 0 ldr r5, =gUnknown_082FE278 @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, =0xffff00ff ldr r0, [sp] ands r0, r2 orrs r0, r1 lsls r2, r4, 24 ldr r1, =0x00ffffff ands r0, r1 orrs r0, r2 str r0, [sp] mov r0, sp bl 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 .pool @0802E4A8: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @0802E4F6 b @0802E4CE @0802E4B4: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @0802E4F6 ldrb r0, [r7, 0x2] bl rbox_fill_rectangle ldrb r0, [r7, 0x2] movs r1, 0x1 @0802E4CA: bl Window_CopyToVram @0802E4CE: ldrh r0, [r7] adds r0, 0x1 strh r0, [r7] b @0802E4F6 .align 2, 0 .pool @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, =0x0000021d adds r0, r4, 0 adds r1, r5, 0 movs r2, 0xD0 bl box_border_load_tiles_and_pal adds r0, r4, 0 adds r1, r5, 0 movs r2, 0xD bl sub_8098858 adds r0, r4, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r5, =gUnknown_085EDE8D 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, =0x02021cc4 @0802E58A: ldr r1, =gUnknown_082FE278 lsls r0, r6, 2 adds r0, r1 ldr r2, [r0] mov r1, r8 lsrs r4, r1, 24 str r4, [sp] mov r0, r10 str r0, [sp, 0x4] mov r1, r9 str r1, [sp, 0x8] adds r0, r7, 0 movs r1, 0x1 movs r3, 0 bl Print ldr r0, [sp, 0x20] ldm r0!, {r1} str r0, [sp, 0x20] adds r0, r5, 0 movs r2, 0 movs r3, 0x5 bl 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 .pool thumb_func_end sub_802E500 thumb_func_start sub_802E620 sub_802E620: ; 802E620 push {lr} adds r1, r0, 0 b @0802E628 @0802E626: adds r1, 0x1 @0802E628: ldrb r0, [r1] cmp r0, 0xFF beq @0802E636 cmp r0, 0 bne @0802E626 movs r0, 0xFF strb r0, [r1] @0802E636: pop {r0} bx r0 thumb_func_end sub_802E620 thumb_func_start sub_802E63C sub_802E63C: ; 802E63C push {r4,r5,lr} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 lsls r1, 24 lsrs r1, 24 ldr r0, =sub_802E6D0 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e00 adds r0, r1 movs r1, 0x1 strh r1, [r0, 0x8] strh r5, [r0, 0xA] ldr r0, =gUnknown_082FE748 lsls r5, 4 adds r5, r0 ldr r1, [r5] adds r0, r4, 0 bl _call_via_r1 adds r0, r4, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802E63C thumb_func_start sub_802E688 sub_802E688: ; 802E688 push {lr} ldr r0, =sub_802E6D0 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @0802E6B4 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 movs r0, 0x2 strh r0, [r1, 0x8] movs r0, 0x1 b @0802E6B6 .align 2, 0 .pool @0802E6B4: movs r0, 0 @0802E6B6: pop {r1} bx r1 thumb_func_end sub_802E688 thumb_func_start sub_802E6BC sub_802E6BC: ; 802E6BC push {lr} ldr r0, =sub_802E6D0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802E6BC thumb_func_start sub_802E6D0 sub_802E6D0: ; 802E6D0 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0x3 beq @0802E71C cmp r0, 0x3 bgt @0802E6F8 cmp r0, 0x2 beq @0802E6FE b @0802E752 .align 2, 0 .pool @0802E6F8: cmp r0, 0x4 beq @0802E738 b @0802E752 @0802E6FE: ldr r1, =gUnknown_082FE748 movs r2, 0x2 ldrsh r0, [r4, r2] lsls r0, 4 adds r1, 0x8 adds r0, r1 ldr r1, [r0] adds r0, r5, 0 bl _call_via_r1 movs r0, 0x3 strh r0, [r4] b @0802E752 .align 2, 0 .pool @0802E71C: ldr r0, =gUnknown_082FE748 movs r2, 0x2 ldrsh r1, [r4, r2] lsls r1, 4 adds r0, 0xC adds r1, r0 ldr r1, [r1] adds r0, r5, 0 bl _call_via_r1 b @0802E752 .align 2, 0 .pool @0802E738: ldr r0, =gUnknown_082FE748 movs r2, 0x2 ldrsh r1, [r4, r2] lsls r1, 4 adds r0, 0x4 adds r1, r0 ldr r1, [r1] adds r0, r5, 0 bl _call_via_r1 adds r0, r5, 0 bl remove_task @0802E752: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802E6D0 thumb_func_start sub_802E75C sub_802E75C: ; 802E75C push {r4-r7,lr} mov r7, r8 push {r7} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r1, 0x6 ldrsh r0, [r4, r1] lsls r0, 3 ldr r1, =gUnknown_082FE6C8 adds r0, r1 bl gpu_tile_obj_decompress_and_load movs r2, 0x8 ldrsh r0, [r4, r2] lsls r0, 3 ldr r1, =gUnknown_082FE6D8 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, =gUnknown_082FE730 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, =0x02020630 @0802E7D8: lsls r0, r5, 1 adds r0, r4 movs r1, 0x1A ldrsh r0, [r0, r1] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r6 ldrb r1, [r4, 0xC] ands r1, r7 lsls r1, 2 ldrb r3, [r2, 0x5] mov r0, r12 ands r0, r3 orrs r0, r1 strb r0, [r2, 0x5] adds r3, r2, 0 adds r3, 0x3E ldrb r0, [r3] movs r1, 0x4 orrs r0, r1 strb r0, [r3] ldrh r0, [r4, 0xA] strh r0, [r2, 0x30] mov r3, r8 strh r3, [r2, 0x34] strh r5, [r2, 0x36] ldrh r0, [r4, 0x1A] strh r0, [r2, 0x38] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 movs r1, 0x10 ldrsh r0, [r4, r1] cmp r5, r0 blt @0802E7D8 @0802E820: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802E75C thumb_func_start sub_802E83C sub_802E83C: ; 802E83C push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r1, =0x03005e08 adds r4, r1 movs r5, 0 strh r5, [r4, 0x4] strh r5, [r4, 0x6] strh r5, [r4, 0x8] movs r1, 0x3C strh r1, [r4, 0xA] strh r5, [r4, 0xC] strh r5, [r4, 0xE] movs r1, 0x3 strh r1, [r4, 0x10] movs r1, 0x78 strh r1, [r4, 0x12] movs r1, 0x58 strh r1, [r4, 0x14] adds r1, r4, 0 bl sub_802E75C movs r0, 0x1C ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 movs r1, 0x4 bl 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, =0x0000ffe0 strh r1, [r0, 0x24] movs r0, 0x1E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x5 bl 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 .pool thumb_func_end sub_802E83C thumb_func_start sub_802E8C8 sub_802E8C8: ; 802E8C8 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 movs r5, 0 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r4, r1, r0 b @0802E8FC .align 2, 0 .pool @0802E8E0: lsls r0, r5, 1 adds r0, r4 movs r2, 0x1A ldrsh r1, [r0, r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl 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, =gUnknown_082FE6C8 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, =gUnknown_082FE6D8 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 .pool thumb_func_end sub_802E8C8 thumb_func_start sub_802E938 sub_802E938: ; 802E938 push {r4-r6,lr} adds r6, r0, 0 movs r0, 0x34 ldrsh r1, [r6, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 movs r1, 0x16 ldrsh r0, [r5, r1] movs r2, 0xA ldrsh r1, [r5, r2] bl __modsi3 cmp r0, 0 bne @0802EA4A ldrh r2, [r5, 0x16] movs r3, 0x16 ldrsh r1, [r5, r3] movs r3, 0x14 ldrsh r0, [r5, r3] cmp r1, r0 beq @0802EA4A strh r2, [r5, 0x14] movs r1, 0x32 ldrsh r0, [r6, r1] cmp r0, 0x4 bhi @0802EA44 lsls r0, 2 ldr r1, =@0802E984 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802E984: .4byte @0802E998 .4byte @0802E9A6 .4byte @0802E9A6 .4byte @0802E9BA .4byte @0802EA04 @0802E998: adds r2, r6, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] @0802E9A6: movs r0, 0x38 bl audio_play ldrh r1, [r6, 0x32] lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 bl 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, =0x02020630 movs r2, 0x1C ldrsh r0, [r5, r2] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 adds r1, 0x3E ldrb r3, [r1] movs r2, 0x5 negs r2, r2 adds r0, r2, 0 ands r0, r3 strb r0, [r1] movs r3, 0x1E ldrsh r1, [r5, r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] ands r2, r1 strb r2, [r0] b @0802EA44 .align 2, 0 .pool @0802EA04: adds r1, r6, 0 adds r1, 0x3E ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] ldr r3, =0x02020630 movs r0, 0x1C ldrsh r1, [r5, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r1, [r0] orrs r1, r2 strb r1, [r0] movs r0, 0x1E ldrsh r1, [r5, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r1, [r0] orrs r1, r2 strb r1, [r0] movs r0, 0x4 strh r0, [r5] b @0802EA4A .align 2, 0 .pool @0802EA44: ldrh r0, [r6, 0x32] adds r0, 0x1 strh r0, [r6, 0x32] @0802EA4A: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_802E938 thumb_func_start sub_802EA50 sub_802EA50: ; 802EA50 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r5, =0x03005e08 adds r6, r4, r5 movs r0, 0x38 bl audio_play ldr r2, =0x02020630 movs r0, 0x1A ldrsh r1, [r6, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r2, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_802E938 str r1, [r0] movs r0, 0x1A ldrsh r1, [r6, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] subs r5, 0x8 adds r4, r5 movs r0, 0x3 strh r0, [r4, 0x8] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802EA50 thumb_func_start sub_802EAB0 sub_802EAB0: ; 802EAB0 push {r4,r5,lr} sub sp, 0xC lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r4, r1, r0 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0802EB14 ldr r1, =0x03003090 ldrh r0, [r1, 0x2] ldr r5, =0x00007fff cmp r0, r5 bne @0802EAD8 ldrh r0, [r1, 0x4] strh r0, [r4, 0x16] @0802EAD8: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @0802EB1A ldrh r0, [r4, 0x18] adds r0, 0x1 strh r0, [r4, 0x18] mov r0, sp movs r1, 0 movs r2, 0xC bl memset mov r0, sp strh r5, [r0] mov r1, sp ldrh r0, [r4, 0x18] strh r0, [r1, 0x2] mov r0, sp bl sub_800FE50 b @0802EB1A .align 2, 0 .pool @0802EB14: ldrh r0, [r4, 0x16] adds r0, 0x1 strh r0, [r4, 0x16] @0802EB1A: add sp, 0xC pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_802EAB0 thumb_func_start sub_802EB24 sub_802EB24: ; 802EB24 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 ldr r0, [sp, 0x18] lsls r4, 16 lsrs r4, 16 lsls r5, 16 lsrs r5, 16 lsls r6, 16 lsrs r6, 16 lsls r3, 16 lsrs r3, 16 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r0, =sub_802EB98 movs r1, 0x50 str r3, [sp] bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xC] strh r5, [r1, 0xE] strh r6, [r1, 0x10] ldr r3, [sp] strh r3, [r1, 0x12] mov r0, r8 strh r0, [r1, 0x14] add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802EB24 thumb_func_start sub_802EB84 sub_802EB84: ; 802EB84 push {lr} ldr r0, =sub_802EB98 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802EB84 thumb_func_start sub_802EB98 sub_802EB98: ; 802EB98 push {r4-r6,lr} sub sp, 0xC lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0x1 beq @0802EC08 cmp r0, 0x1 bgt @0802EBC0 cmp r0, 0 beq @0802EBC6 b @0802EC8A .align 2, 0 .pool @0802EBC0: cmp r0, 0x2 beq @0802EC4C b @0802EC8A @0802EBC6: ldrh r0, [r5, 0x4] ldrh r1, [r5, 0x6] bl sub_802EF50 ldrh r0, [r5, 0x4] ldrh r1, [r5, 0x6] movs r3, 0x8 ldrsh r2, [r5, r3] movs r4, 0xA ldrsh r3, [r5, r4] ldrb r4, [r5, 0xC] str r4, [sp] bl sub_802EFA8 lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0xE] ldrh r0, [r5, 0x4] ldrh r1, [r5, 0x6] movs r3, 0x8 ldrsh r2, [r5, r3] movs r4, 0xA ldrsh r3, [r5, r4] ldrb r4, [r5, 0xC] str r4, [sp] adds r4, r5, 0 adds r4, 0x10 str r4, [sp, 0x4] adds r4, 0x2 str r4, [sp, 0x8] bl sub_802EFFC b @0802EC3E @0802EC08: ldrb r0, [r5, 0xE] bl sub_802EC98 cmp r0, 0 bne @0802EC8A ldrb r0, [r5, 0xE] ldrb r1, [r5, 0x10] ldrb r2, [r5, 0x12] bl sub_802EDCC movs r0, 0xE ldrsh r1, [r5, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry movs r3, 0xE ldrsh r1, [r5, r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles @0802EC3E: ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] b @0802EC8A .align 2, 0 .pool @0802EC4C: ldrb r0, [r5, 0x10] bl sub_802EE30 cmp r0, 0 bne @0802EC8A movs r4, 0x10 ldrsh r1, [r5, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl 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 .pool thumb_func_end sub_802EB98 thumb_func_start sub_802EC98 sub_802EC98: ; 802EC98 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 adds r4, r1, r0 movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0x7 bls @0802ECB2 b @0802EDC4 @0802ECB2: lsls r0, 2 ldr r1, =@0802ECC4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802ECC4: .4byte @0802ECE4 .4byte @0802ECF6 .4byte @0802ED1C .4byte @0802ED2C .4byte @0802ED4E .4byte @0802ED86 .4byte @0802EDAC .4byte @0802ED82 @0802ECE4: movs r1, 0x80 lsls r1, 4 adds r0, r4, 0 movs r2, 0x1A bl sub_8007E18 ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] @0802ECF6: movs r2, 0x32 ldrsh r0, [r4, r2] cmp r0, 0 bne @0802ED04 movs r0, 0x39 bl audio_play @0802ED04: ldrh r0, [r4, 0x32] adds r0, 0x1 strh r0, [r4, 0x32] lsls r0, 16 asrs r0, 16 cmp r0, 0x13 ble @0802EDC4 movs r0, 0 strh r0, [r4, 0x32] adds r0, r4, 0 movs r1, 0x1 b @0802EDA2 @0802ED1C: adds r0, r4, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @0802EDC4 b @0802EDA6 @0802ED2C: ldrh r0, [r4, 0x32] adds r0, 0x1 strh r0, [r4, 0x32] lsls r0, 16 asrs r0, 16 cmp r0, 0x3 ble @0802EDC4 movs r0, 0 strh r0, [r4, 0x32] ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] adds r0, r4, 0 movs r1, 0x2 bl 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, =0x02020630 mov r8, r0 lsls r4, r1, 4 adds r4, r1 lsls r4, 2 adds r5, r4, r0 ldr r0, =0x0000ffd8 strh r0, [r5, 0x26] lsls r3, r2, 4 adds r3, r2 lsls r3, 2 mov r1, r8 adds r2, r3, r1 strh r0, [r2, 0x26] adds r5, 0x3E ldrb r6, [r5] movs r1, 0x5 negs r1, r1 adds r0, r1, 0 ands r0, r6 strb r0, [r5] adds r2, 0x3E ldrb r0, [r2] ands r1, r0 strb r1, [r2] movs r0, 0x1C add r8, r0 add r4, r8 ldr r0, =sub_802EE5C str r0, [r4] add r3, r8 str r0, [r3] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802EDCC thumb_func_start sub_802EE30 sub_802EE30: ; 802EE30 push {lr} lsls r0, 24 lsrs r0, 24 movs r3, 0 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r2, 0x1C adds r1, r2 ldr r1, [r1] ldr r0, =sub_802EE5C cmp r1, r0 bne @0802EE4E movs r3, 0x1 @0802EE4E: adds r0, r3, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_802EE30 thumb_func_start sub_802EE5C sub_802EE5C: ; 802EE5C push {r4,r5,lr} adds r5, r0, 0 adds r4, r5, 0 adds r4, 0x2E movs r1, 0x2E ldrsh r0, [r5, r1] cmp r0, 0x4 bhi @0802EF46 lsls r0, 2 ldr r1, =@0802EE7C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0802EE7C: .4byte @0802EE90 .4byte @0802EEA0 .4byte @0802EEC8 .4byte @0802EEFC .4byte @0802EF34 @0802EE90: movs r0, 0x40 strh r0, [r4, 0x8] ldrh r0, [r5, 0x26] lsls r0, 4 strh r0, [r4, 0xA] ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @0802EEA0: ldrh r1, [r4, 0x8] ldrh r2, [r4, 0xA] adds r0, r1, r2 strh r0, [r4, 0xA] adds r1, 0x1 strh r1, [r4, 0x8] lsls r0, 16 asrs r0, 20 strh r0, [r5, 0x26] cmp r0, 0 blt @0802EF46 movs r0, 0x39 bl audio_play movs r0, 0 strh r0, [r5, 0x26] ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] b @0802EF46 @0802EEC8: ldrh r0, [r4, 0x2] adds r0, 0xC strh r0, [r4, 0x2] lsls r0, 16 asrs r0, 16 cmp r0, 0x7F ble @0802EEE6 movs r0, 0x39 bl audio_play movs r0, 0 strh r0, [r4, 0x2] ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @0802EEE6: ldr r0, =gUnknown_08329F40 movs r2, 0x2 ldrsh r1, [r4, r2] lsls r1, 1 adds r1, r0 movs r2, 0 ldrsh r0, [r1, r2] asrs r0, 4 b @0802EF2A .align 2, 0 .pool @0802EEFC: ldrh r0, [r4, 0x2] adds r0, 0x10 strh r0, [r4, 0x2] lsls r0, 16 asrs r0, 16 cmp r0, 0x7F ble @0802EF1A movs r0, 0x39 bl audio_play movs r0, 0 strh r0, [r4, 0x2] ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @0802EF1A: ldr r1, =gUnknown_08329F40 movs r2, 0x2 ldrsh r0, [r4, r2] lsls r0, 1 adds r0, r1 ldrh r0, [r0] lsls r0, 16 asrs r0, 21 @0802EF2A: negs r0, r0 strh r0, [r5, 0x26] b @0802EF46 .align 2, 0 .pool @0802EF34: ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] lsls r0, 16 asrs r0, 16 cmp r0, 0x28 ble @0802EF46 ldr r0, =nullsub_12 str r0, [r5, 0x1C] @0802EF46: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802EE5C thumb_func_start sub_802EF50 sub_802EF50: ; 802EF50 push {r4,lr} sub sp, 0x10 lsls r1, 16 lsrs r1, 16 ldr r2, =gUnknown_082FEBCC ldr r3, [r2, 0x4] ldr r2, [r2] str r2, [sp] str r3, [sp, 0x4] ldr r2, =gUnknown_082FEBD4 ldr r3, [r2, 0x4] ldr r2, [r2] str r2, [sp, 0x8] str r3, [sp, 0xC] lsls r0, 16 ldr r3, =0x0000ffff ldr r2, [sp, 0x4] ands r2, r3 orrs r2, r0 str r2, [sp, 0x4] ldr r2, =0xffff0000 add r4, sp, 0x8 ldr r0, [r4, 0x4] ands r0, r2 orrs r0, r1 str r0, [r4, 0x4] mov r0, sp bl 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 .pool thumb_func_end sub_802EF50 thumb_func_start sub_802EFA8 sub_802EFA8: ; 802EFA8 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x18 mov r12, r3 ldr r3, [sp, 0x30] lsls r1, 16 lsrs r1, 16 lsls r3, 24 lsrs r3, 24 mov r8, r3 mov r5, sp ldr r4, =gUnknown_082FEC90 ldm r4!, {r3,r6,r7} stm r5!, {r3,r6,r7} ldm r4!, {r3,r6,r7} stm r5!, {r3,r6,r7} mov r4, sp strh r0, [r4] mov r0, sp strh r1, [r0, 0x2] lsls r2, 16 asrs r2, 16 mov r0, r12 lsls r6, r0, 16 asrs r6, 16 mov r0, sp adds r1, r2, 0 adds r2, r6, 0 mov r3, r8 bl 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 .pool thumb_func_end sub_802EFA8 thumb_func_start sub_802EFFC sub_802EFFC: ; 802EFFC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 mov r12, r3 ldr r6, [sp, 0x38] ldr r3, [sp, 0x3C] mov r9, r3 ldr r4, [sp, 0x40] mov r8, r4 lsls r1, 16 lsrs r1, 16 lsls r6, 24 lsrs r6, 24 mov r10, r6 mov r4, sp ldr r3, =gUnknown_082FECA8 ldm r3!, {r5-r7} stm r4!, {r5-r7} ldm r3!, {r5-r7} stm r4!, {r5-r7} mov r3, sp strh r0, [r3] mov r0, sp strh r1, [r0, 0x2] lsls r2, 16 asrs r4, r2, 16 ldr r0, =0xffe00000 adds r2, r0 asrs r2, 16 mov r1, r12 lsls r5, r1, 16 asrs r5, 16 mov r0, sp adds r1, r2, 0 adds r2, r5, 0 mov r3, r10 bl 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, =0x02020630 mov r5, r9 movs r6, 0 ldrsh r1, [r5, r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r1, [r0] movs r3, 0x4 orrs r1, r3 strb r1, [r0] movs r7, 0 ldrsh r1, [r4, r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r1, [r0] orrs r1, r3 strb r1, [r0] movs r0, 0 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 bl 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 .pool thumb_func_end sub_802EFFC thumb_func_start sub_802F0CC sub_802F0CC: ; 802F0CC ldr r2, =0x03000dce ldr r1, =0x04000208 ldrh r0, [r1] strh r0, [r2] movs r0, 0 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_802F0CC thumb_func_start sub_802F0E4 sub_802F0E4: ; 802F0E4 ldr r0, =0x04000208 ldr r1, =0x03000dce ldrh r1, [r1] strh r1, [r0] bx lr .align 2, 0 .pool 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, =0x0000016d 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, =gUnknown_082FECCC 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 .pool 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, =0x03000db8 movs r0, 0 strh r0, [r5] bl sub_802F0CC bl sub_82E2150 bl sub_82E2180 ldr r4, =0x03000dcc 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 .pool @0802F250: movs r0, 0xF0 ands r0, r4 cmp r0, 0 beq @0802F25A movs r0, 0x2 @0802F25A: strh r0, [r5] ldr r4, =0x03000dc0 adds r0, r4, 0 bl sub_802F2E8 adds r0, r4, 0 bl sub_802F2FC ldr r1, =0x03000db8 strh r0, [r1] @0802F26E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_802F21C thumb_func_start sub_802F27C sub_802F27C: ; 802F27C ldr r0, =0x03000db8 ldrh r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_802F27C thumb_func_start sub_802F288 sub_802F288: ; 802F288 push {r4,lr} adds r2, r0, 0 ldr r0, =0x03000db8 ldrh r1, [r0] movs r0, 0xFF lsls r0, 4 ands r0, r1 cmp r0, 0 beq @0802F2AC adds r1, r2, 0 ldr r0, =gUnknown_082FECC0 ldm r0!, {r2-r4} stm r1!, {r2-r4} b @0802F2B2 .align 2, 0 .pool @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, =gUnknown_082FECCC ldr r1, [r1, 0x4] adds r0, r1 b @0802F38E .align 2, 0 .pool @0802F384: ldr r0, =gUnknown_082FECCC 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 .pool 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, =0x03000dc0 ldrb r1, [r3, 0x4] ldrb r2, [r3, 0x5] ldrb r3, [r3, 0x6] bl sub_802F444 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03000dc0 adds r0, r4, 0 bl sub_802F288 ldr r1, =0x03005cf8 ldr r0, =0x03005d90 ldr r2, [r0] adds r2, 0x98 adds r0, r4, 0 bl sub_802F504 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005cf8 strh r0, [r4] strb r1, [r4, 0x2] strb r2, [r4, 0x3] strb r3, [r4, 0x4] ldr r5, =0x03000dc0 adds r0, r5, 0 bl sub_802F288 ldr r0, =0x03005d90 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 .pool 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, =0x03000dc0 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 .pool thumb_func_end sub_802F664 thumb_func_start sub_802F69C sub_802F69C: ; 802F69C push {lr} ldr r0, =0x03000dc0 bl sub_802F1E0 lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool 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 ; void 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 ; void 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 ; void init_title_menu(int useless_param) 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, =0x040000d4 add r0, sp, 0x4 str r0, [r1] movs r0, 0xC0 lsls r0, 19 str r0, [r1, 0x4] ldr r0, =0x8100c000 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, =0x85000100 str r0, [r1, 0x8] ldr r0, [r1, 0x8] add r0, sp, 0x4 strh r5, [r0] str r0, [r1] ldr r0, =0x05000002 str r0, [r1, 0x4] ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] bl sub_80A1A74 ldr r0, =gUnknown_082FF0A0 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_082FF0C0 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 .pool @0802F7EC: movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff 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, =gUnknown_082FF0E8 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, =gUnknown_082FF038 bl Window_InitFromTemplates bl TextBox_ResetSomeField ldr r1, =0x000001d5 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, =sub_802F6C8 bl SetVBlankCallback ldr r0, =c2_title_menu_3 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, =task_init_title_menu_graphics movs r1, 0 bl AddTask movs r0, 0 add sp, 0xC pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end init_title_menu thumb_func_start task_init_title_menu_graphics ; void task_init_title_menu_graphics(int task_id) 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, =0x03005e08 mov r8, r0 adds r4, r7, r0 ldr r0, =0x02037fd4 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, =0x03006210 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 .pool @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, =task_init_title_menu_graphics_2 b @0802F9FC .align 2, 0 .pool @0802F990: ldr r0, =gUnknown_085E8405 bl draw_text_box strh r5, [r4] mov r0, r8 subs r0, 0x8 adds r0, r7, r0 b @0802F9FA .align 2, 0 .pool @0802F9A4: ldr r0, =gUnknown_085E83C2 bl draw_text_box mov r0, r8 subs r0, 0x8 adds r0, r7, r0 ldr r1, =task_init_title_menu_save_file_corrupt 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 .pool @0802F9D0: movs r0, 0 strh r0, [r4] ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =task_init_title_menu_graphics_2 b @0802F9FC .align 2, 0 .pool @0802F9EC: ldr r0, =gUnknown_085E8440 bl draw_text_box mov r0, r8 subs r0, 0x8 adds r0, r7, r0 strh r5, [r0, 0x8] @0802F9FA: ldr r1, =task_init_title_menu_save_file_corrupt @0802F9FC: str r1, [r0] @0802F9FE: ldr r2, =0x02022d06 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 .pool @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, =0x00007fff 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 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0802FA98 movs r0, 0x7 bl Window_FillTileMap ldr r0, =gUnknown_082FF070 bl sub_8032250 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_init_title_menu_graphics_2 str r1, [r0] @0802FA98: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =task_init_title_menu_graphics_3 str r0, [r1] b @0802FB3C .align 2, 0 .pool @0802FB28: ldr r0, =gUnknown_085E8453 bl draw_text_box ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =task_init_title_menu_battery_dry str r1, [r0] @0802FB3C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0802FB8C movs r0, 0x7 bl Window_FillTileMap ldr r0, =gUnknown_082FF070 bl sub_8032250 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_init_title_menu_graphics_3 str r1, [r0] @0802FB8C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_init_title_menu_battery_dry thumb_func_start task_init_title_menu_graphics_3 ; void task_init_title_menu_graphics_3(int task_id) 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, =0x03005e08 adds r6, r0, r1 ldr r0, =0x02037fd4 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, =0x00007fff 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, =0x0000318c 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, =0x0000675a adds r0, r2, 0 strh r0, [r1] adds r0, r1, 0 movs r1, 0xFC movs r2, 0x2 bl gpu_pal_apply ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @0802FC84 add r1, sp, 0xC ldr r2, =0x00007e04 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 .pool @0802FC84: add r1, sp, 0xC ldr r2, =0x0000547f adds r0, r2, 0 strh r0, [r1] adds r0, r1, 0 movs r1, 0xF1 movs r2, 0x2 bl gpu_pal_apply @0802FC96: ldr r0, =0x03005e00 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, =gUnknown_082FF0E0 str r5, [sp] movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] ldr r0, =gUnknown_085E827C 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, =gUnknown_085E828E 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, =gUnknown_082FF038 ldr r5, =0x000001d5 adds r0, r4, 0 adds r1, r5, 0 bl write_textbox_border_to_bg_tilemap adds r4, 0x8 b @0802FED4 .align 2, 0 .pool @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, =gUnknown_082FF0E0 str r5, [sp] movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] ldr r0, =gUnknown_085E8285 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, =gUnknown_085E827C 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, =gUnknown_085E828E 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, =gUnknown_082FF048 ldr r5, =0x000001d5 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 .pool @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, =gUnknown_082FF0E0 str r5, [sp] movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] ldr r0, =gUnknown_085E8285 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, =gUnknown_085E827C 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, =gUnknown_085E8295 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, =gUnknown_085E828E 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, =gUnknown_082FF048 ldr r5, =0x000001d5 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 .pool @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, =gUnknown_082FF0E0 str r5, [sp] movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] ldr r0, =gUnknown_085E8285 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, =gUnknown_085E827C 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, =gUnknown_085E82A2 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, =gUnknown_085E82AF 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, =gUnknown_085E828E 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, =gUnknown_082FF048 ldr r4, =0x000001d5 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, =gUnknown_082FF0F4 ldr r4, =0x02022d06 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, =sub_81AF59C 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, =0x03005e00 mov r2, r9 adds r1, r2, r7 lsls r1, 3 adds r1, r0 ldr r0, =task_title_menu_highlight_selected_menu_items 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 .pool thumb_func_end task_init_title_menu_graphics_3 thumb_func_start task_title_menu_highlight_selected_menu_items ; void task_title_menu_highlight_selected_menu_items(int task_id) task_title_menu_highlight_selected_menu_items: ; 80300B0 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 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, =task_title_menu_handle_input str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r5, r4, r7 ldr r1, =0x030022c0 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, =title_menu_handle_keypad_a_pressed str r1, [r0] b @08030240 .align 2, 0 .pool @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, =0x0000ffff 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, =sub_8030544 str r1, [r0] b @08030240 .align 2, 0 .pool @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, =0x03005e00 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, =0x02022d06 strh r0, [r1] movs r0, 0x1 b @08030242 .align 2, 0 .pool @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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =task_title_menu_highlight_selected_menu_items str r0, [r1] @0803026C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_title_menu_handle_input thumb_func_start title_menu_handle_keypad_a_pressed ; void title_menu_handle_keypad_a_pressed(int task_id) title_menu_handle_keypad_a_pressed: ; 803027C push {r4-r7,lr} sub sp, 0x4 lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08030292 b @08030536 @08030292: ldr r2, =0x03005e00 lsls r1, r6, 2 adds r0, r1, r6 lsls r0, 3 adds r4, r0, r2 movs r2, 0x8 ldrsh r0, [r4, r2] adds r7, r1, 0 cmp r0, 0x3 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 .pool @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, =@08030370 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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 .pool @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, =0x03005e00 adds r1, r7, r6 lsls r1, 3 adds r1, r0 movs r0, 0x2 strh r0, [r1, 0x8] b @080303DA .align 2, 0 .pool @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, =@08030400 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08030400: .4byte @0803041C .4byte @08030444 .4byte @08030460 .4byte @08030478 .4byte @08030480 .4byte @08030488 .4byte @0803049C @0803041C: ldr r0, =0x02037714 movs r1, 0 strh r1, [r0] ldr r0, =0x02037b14 strh r1, [r0] ldr r1, =0x03005e00 adds r0, r7, r6 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_1 str r1, [r0] b @08030514 .align 2, 0 .pool @08030444: ldr r0, =0x02037714 movs r1, 0 strh r1, [r0] ldr r0, =0x02037b14 strh r1, [r0] ldr r0, =sub_8086230 b @0803048A .align 2, 0 .pool @08030460: ldr r0, =0x030022c0 ldr r1, =c2_title_menu_2_dupe str r1, [r0, 0x8] ldr r0, =c2_options_menu b @0803048A .align 2, 0 .pool @08030478: ldr r0, =c2_mystery_gift b @0803048A .align 2, 0 .pool @08030480: ldr r0, =sub_8178974 b @0803048A .align 2, 0 .pool @08030488: ldr r0, =sub_801867C @0803048A: bl set_callback2 adds r0, r6, 0 bl remove_task b @08030514 .align 2, 0 .pool @0803049C: ldr r1, =0x03005e00 adds r0, r7, r6 lsls r0, 3 adds r0, r1 movs r4, 0 strh r4, [r0, 0xA] ldr r1, =sub_80305A4 str r1, [r0] ldr r0, =0x02037714 movs r2, 0xF1 lsls r2, 1 adds r0, r2 ldr r1, =0x00007fff strh r1, [r0] ldr r0, =0x02037b14 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 .pool @08030514: bl Window_FreeMemory cmp r5, 0x2 beq @08030528 ldr r1, =0x02022d06 movs r0, 0 strh r0, [r1] b @08030536 .align 2, 0 .pool @08030528: ldr r0, =0x02022d06 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @0803058C ldr r0, =0x03005e00 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, =0x02022d06 strh r4, [r0] bl Window_FreeMemory ldr r0, =c2_title_screen_1 bl set_callback2 adds r0, r5, 0 bl remove_task @0803058C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_085E82BE bl draw_text_box b @08030622 .align 2, 0 .pool @08030610: ldr r0, =gUnknown_085E82E5 bl draw_text_box b @08030622 .align 2, 0 .pool @0803061C: ldr r0, =gUnknown_085E8328 bl draw_text_box @08030622: ldr r0, =0x03005e00 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 .pool @0803063C: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 b @08030658 .align 2, 0 .pool @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, =0x030022c0 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, =sub_8030544 str r0, [r4] @08030688: add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80305A4 thumb_func_start title_menu_highlight_selected_menu_items ; void title_menu_highlight_selected_menu_items(u8 a1, u8 selected_menu_item, u16 a3) 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, =0x000009e7 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, =0x0000011f b @0803078E .align 2, 0 .pool @080306D4: ldr r1, =0x0000213f b @0803078E .align 2, 0 .pool @080306DC: cmp r4, 0x1 beq @080306F0 cmp r4, 0x1 ble @080306E8 cmp r4, 0x2 beq @080306F8 @080306E8: ldr r1, =0x0000013f b @0803078E .align 2, 0 .pool @080306F0: ldr r1, =0x0000415f b @0803078E .align 2, 0 .pool @080306F8: ldr r1, =0x0000617f b @0803078E .align 2, 0 .pool @08030700: cmp r4, 0x1 beq @08030718 cmp r4, 0x1 ble @08030710 cmp r4, 0x2 beq @08030720 cmp r4, 0x3 beq @0803078C @08030710: ldr r1, =0x0000013f b @0803078E .align 2, 0 .pool @08030718: ldr r1, =0x0000415f b @0803078E .align 2, 0 .pool @08030720: ldr r1, =0x0000617f b @0803078E .align 2, 0 .pool @08030728: cmp r4, 0x4 bhi @08030750 lsls r0, r4, 2 ldr r1, =@0803073C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0803073C: .4byte @08030750 .4byte @08030758 .4byte @0803076C .4byte @08030780 .4byte @0803079C @08030750: ldr r1, =0x0000013f b @0803078E .align 2, 0 .pool @08030758: cmp r6, 0 beq @08030764 ldr r1, =0x0000213f b @0803078E .align 2, 0 .pool @08030764: ldr r1, =0x0000415f b @0803078E .align 2, 0 .pool @0803076C: cmp r6, 0 beq @08030778 ldr r1, =0x0000415f b @0803078E .align 2, 0 .pool @08030778: ldr r1, =0x0000617f b @0803078E .align 2, 0 .pool @08030780: cmp r6, 0 beq @0803078C ldr r1, =0x0000617f b @0803078E .align 2, 0 .pool @0803078C: ldr r1, =0x0000819f @0803078E: movs r0, 0x44 bl lcd_io_set b @080307A4 .align 2, 0 .pool @0803079C: ldr r1, =0x0000819f movs r0, 0x44 bl lcd_io_set @080307A4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end title_menu_highlight_selected_menu_items thumb_func_start task_new_game_prof_birch_speech_1 ; void task_new_game_prof_birch_speech_1(int task_id) 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, =gUnknown_082FF0F0 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, =gUnknown_082FED3C movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_082FEEF0 ldr r1, =0x06003800 bl LZ77UnCompVram ldr r0, =gUnknown_082FECFC movs r1, 0 movs r2, 0x40 bl gpu_pal_apply ldr r0, =gUnknown_082FF028 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 strh r5, [r0, 0x10] ldr r1, =task_new_game_prof_birch_speech_2 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 .pool 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, =0x03005e00 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 .pool @080308D4: ldrb r0, [r4, 0x18] ldr r2, =0x02020630 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, =task_new_game_prof_birch_speech_3 str r0, [r4] @0803091A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_new_game_prof_birch_speech_2 thumb_func_start task_new_game_prof_birch_speech_3 ; int 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, =0x03005e00 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, =0x02020630 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 .pool @08030970: ldr r0, =gUnknown_082FF080 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, =0x02021fc4 ldr r1, =gUnknown_082C897B bl ExpandTextCodes movs r0, 0x1 bl get_map_name ldr r0, =task_new_game_prof_birch_speech_4 str r0, [r4] @080309B6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_5 str r1, [r0] ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E8692 bl ExpandTextCodes ldr r1, =sub_80323A0 movs r0, 0x1 bl sub_8197A9C ldr r0, =0x03000dd0 strb r4, [r0] @08030A0A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_082C8A1F bl ExpandTextCodes movs r0, 0x1 bl get_map_name ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_6 str r1, [r0] @08030A58: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 ldr r0, =0x03000dd0 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, =0x02020630 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, =0x0000ffff str r2, [sp, 0xC] ldr r2, =0x00000127 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, =sub_8030B14 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 .pool 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, =0x03005e08 adds r5, r0, r1 subs r1, 0x8 mov r8, r1 ldr r2, =0x03000dd0 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, =0x02020630 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 .pool @08030B64: ldr r1, [r3, 0x1C] ldr r0, =nullsub_12 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 .pool @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, =0x03005e00 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, =0x00003fff 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 .pool 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, =0x02022d04 strb r1, [r0] ldr r0, =0x02021fc4 ldr r1, =gUnknown_082C8BD0 bl ExpandTextCodes movs r0, 0x1 bl get_map_name ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_7 str r1, [r0] @08030BFE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r0, =0x03005e00 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, =task_new_game_prof_birch_speech_8 str r0, [r4] @08030C7C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08030CC0: ldr r0, =0x0000ffc4 strh r0, [r2, 0x10] ldr r0, =task_new_game_prof_birch_speech_9 str r0, [r2] @08030CC8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @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, =task_new_game_prof_birch_speech_10 str r0, [r4] @08030D7A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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, =task_new_game_prof_birch_speech_11 str r0, [r3] @08030DB8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_082C8BDD bl ExpandTextCodes movs r0, 0x1 bl get_map_name ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_12 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =task_new_game_prof_birch_speech_13 str r0, [r1] @08030E2A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r0] strb r4, [r0, 0x8] movs r0, 0x1 movs r1, 0x1 bl sub_80322E0 ldr r1, =0x03005e00 lsls r2, r5, 2 adds r0, r2, r5 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_14 str r1, [r0] adds r4, r2, 0 @08030E76: bl GetMenuCursorPos lsls r0, 24 lsrs r3, r0, 24 ldr r1, =0x03005e00 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, =0x02020630 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, =sub_8030ED4 str r0, [r4] @08030EB8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @08030F0C: ldr r3, =0x02020630 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 .pool @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, =sub_8030F7C str r0, [r4] @08030F72: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8030ED4 thumb_func_start sub_8030F7C sub_8030F7C: ; 8030F7C push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r3, r1, r2 ldrb r1, [r3, 0xC] ldr r2, =0x02020630 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 .pool @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, =task_new_game_prof_birch_speech_13 str r0, [r3] @08030FCA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_082C8BFF bl ExpandTextCodes movs r0, 0x1 bl get_map_name ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_15 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =task_new_game_prof_birch_speech_16 str r0, [r1] @08031032: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_17 str r1, [r0] @0803107A: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e00 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, =0x03005d90 ldr r1, [r0] ldrb r2, [r1, 0x8] str r5, [sp] ldr r0, =new_game_prof_birch_speech_part2_start 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 .pool 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, =0x02021fc4 ldr r1, =gUnknown_082C8C1C bl ExpandTextCodes movs r0, 0x1 bl get_map_name ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_part2_3 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_new_game_prof_birch_speech_part2_4 str r1, [r0] @08031178: add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r0, =0x03005e00 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, =task_new_game_prof_birch_speech_part2_5 str r0, [r4] b @08031210 .align 2, 0 .pool @080311FC: movs r0, 0x5 bl audio_play ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =task_new_game_prof_birch_speech_11 str r0, [r1] @08031210: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @0803124C: ldr r0, =task_new_game_prof_birch_speech_part2_6 str r0, [r1] @08031250: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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, =0x02021fc4 ldr r1, =gUnknown_082C8C2A bl ExpandTextCodes movs r0, 0x1 bl get_map_name ldr r0, =task_new_game_prof_birch_speech_part2_7 str r0, [r7] @08031320: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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, =task_new_game_prof_birch_speech_part2_8 str r0, [r4] @080313D2: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @08031444: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 beq @08031458 ldrb r5, [r4, 0x1E] b @0803145A .align 2, 0 .pool @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, =0x02021fc4 ldr r1, =gUnknown_082C8C7A bl ExpandTextCodes movs r0, 0x1 bl get_map_name ldr r0, =task_new_game_prof_birch_speech_part2_9 str r0, [r4] @080314B0: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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, =gUnknown_082FF114 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, =sub_80318D8 str r0, [r4] ldr r0, =0x0000ffff 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, =task_new_game_prof_birch_speech_part2_10 str r0, [r6] @0803155C: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r3, r1, r2 ldrb r1, [r3, 0xC] ldr r2, =0x02020630 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, =task_new_game_prof_birch_speech_part2_11 str r0, [r3] @080315AA: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0803160A ldr r0, =0x03005e00 lsls r4, r2, 2 adds r4, r2 lsls r4, 3 adds r4, r0 ldrb r2, [r4, 0xC] ldr r1, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r1, 0x1C adds r0, r1 ldr r1, =nullsub_11 str r1, [r0] movs r1, 0x82 lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =0xffff0000 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =task_new_game_prof_birch_speech_part2_12 str r0, [r4] @0803160A: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08031666 bl Window_FreeMemory ldr r1, =0x03005e00 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, =c2_new_game bl set_callback2 adds r0, r4, 0 bl remove_task @08031666: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_082FF0E8 movs r0, 0 movs r2, 0x2 bl bg_vram_setup ldr r0, =gUnknown_082FF0F0 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, =0x040000d4 str r0, [r1] movs r4, 0xC0 lsls r4, 19 str r4, [r1, 0x4] ldr r0, =0x8100c000 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, =0x85000100 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, =0x81000200 str r0, [r1, 0x8] ldr r0, [r1, 0x8] bl sub_80A1A74 ldr r0, =gUnknown_082FED3C adds r1, r4, 0 bl LZ77UnCompVram ldr r0, =gUnknown_082FEEF0 ldr r1, =0x06003800 bl LZ77UnCompVram ldr r0, =gUnknown_082FECFC movs r1, 0 movs r2, 0x40 bl gpu_pal_apply ldr r0, =gUnknown_082FF01A movs r1, 0x1 movs r2, 0x10 bl gpu_pal_apply bl clear_tasks ldr r0, =task_new_game_prof_birch_speech_part2_1 movs r1, 0 bl AddTask lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r0, 0x5 strh r0, [r4, 0x16] ldr r0, =0x0000ffc4 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, =0x03005d90 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 .pool @080317DC: strh r0, [r4, 0x14] ldrb r3, [r4, 0x1C] @080317E0: ldr r0, =0x02020630 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r3, [r0, 0xC] ldr r1, =0x0000ffc4 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, =0x04000208 ldrh r2, [r3] strh r4, [r3] ldr r4, =0x04000200 ldrh r0, [r4] movs r1, 0x1 orrs r0, r1 strh r0, [r4] strh r2, [r3] ldr r0, =sub_802F6C8 bl SetVBlankCallback ldr r0, =c2_title_menu_3 bl set_callback2 ldr r0, =gUnknown_082FF080 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 .pool 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, =0x00000127 str r0, [sp] str r1, [sp, 0x4] movs r0, 0xE str r0, [sp, 0x8] ldr r0, =0x0000ffff 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 .pool 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, =0x02020630 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, =nullsub_11 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, =0x03005e00 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, =0x0201c000 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, =0x0201c000 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 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 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, =waterfall_4_check_if_can_continue 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 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 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, =sub_8031B3C 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 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_082FF018 adds r0, r1 movs r1, 0x1 movs r2, 0x10 bl gpu_pal_apply @08031C7C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8031C1C movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh 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 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_082FF018 adds r0, r1 movs r1, 0x1 movs r2, 0x10 bl gpu_pal_apply @08031D28: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8031CC8 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] 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 .pool thumb_func_end sub_8031D34 thumb_func_start sub_8031D74 sub_8031D74: ; 8031D74 push {lr} ldr r0, =gUnknown_082FF088 movs r1, 0xF3 bl write_textbox_border_to_bg_tilemap movs r0, 0x1 movs r1, 0x11 bl Window_FastFillPixels ldr r2, =gUnknown_082FF118 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 .pool 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 ; void set_default_player_name(int name_id) set_default_player_name: ; 8031DC4 push {r4,r5,lr} lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005d90 ldr r0, [r1] ldrb r0, [r0, 0x8] adds r5, r1, 0 cmp r0, 0 bne @08031DE4 ldr r1, =gUnknown_082FF128 b @08031DE6 .align 2, 0 .pool @08031DE4: ldr r1, =gUnknown_082FF178 @08031DE6: lsls r0, r2, 2 adds r0, r1 ldr r3, [r0] movs r2, 0 ldr r4, =0x03005d90 @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 .pool thumb_func_end set_default_player_name thumb_func_start draw_text_box ; void draw_text_box(void *text_ptr) 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, =gUnknown_082FF070 ldr r1, =0x000001d5 bl write_textbox_border_to_bg_tilemap ldr r1, =0x000009e7 movs r0, 0x40 bl lcd_io_set ldr r1, =0x0000719f movs r0, 0x44 bl lcd_io_set add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_085EDCC3 adds r0, r4, 0 bl ExpandTextCodes ldr r6, =gUnknown_082FF0E3 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, =0x03005d90 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 .pool thumb_func_end fmt_time thumb_func_start fmt_player fmt_player: ; 8031EF8 push {r4-r6,lr} sub sp, 0x2C ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EDCCA adds r0, r4, 0 bl ExpandTextCodes ldr r6, =gUnknown_082FF0E3 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, =0x03005d90 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 .pool thumb_func_end fmt_player thumb_func_start fmt_pokedex fmt_pokedex: ; 8031F7C push {r4-r7,lr} sub sp, 0x2C ldr r0, =0x00000861 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 .pool @08031FA4: movs r0, 0x1 bl sub_80C0844 @08031FAA: lsls r0, 16 lsrs r7, r0, 16 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EDCCF adds r0, r4, 0 bl ExpandTextCodes ldr r6, =gUnknown_082FF0E3 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 .pool 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, =0x00000867 @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, =0x0000086e cmp r4, r0 bls @0803201C ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EDCD7 adds r0, r4, 0 bl ExpandTextCodes ldr r6, =gUnknown_082FF0E3 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 .pool 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, =0x03005d90 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 .pool thumb_func_end unknown_title_pattern_data_to_vram thumb_func_start write_textbox_border_to_bg_tilemap ; void write_textbox_border_to_bg_tilemap(struct rbox_template *box, int base_tile_num) 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, =sub_8032298 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 .pool 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, =0x02022d04 ldrb r0, [r1] cmp r0, 0 bne @080323C0 movs r0, 0x1 strb r0, [r1] ldr r0, =sub_8030A70 movs r1, 0 bl AddTask @080323C0: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8032474 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 .pool 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, =0x00000101 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, =0x00000103 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, =0x00000105 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, =0x000008fd 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, =0x000008ff 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, =0x00000901 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, =0x00000902 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 .pool 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, =0x03005e00 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, =task_new_game_prof_birch_speech_part2_2 str r0, [r4] @08032644: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @08032686 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @0803266E bl sub_800B488 @0803266E: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0803267A bl sub_8009734 @0803267A: ldr r0, =task00_08081A90 movs r1, 0 bl AddTask bl sub_8033244 @08032686: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end battle_wireless_setup_if_required_maybe thumb_func_start sub_803269C sub_803269C: ; 803269C push {r4-r7,lr} sub sp, 0x14 ldr r0, =0x03005d04 ldr r1, =nullsub_20 str r1, [r0] movs r0, 0 str r0, [sp, 0x10] movs r1, 0 ldr r7, =0x03005d60 ldr r6, =0x020244ac movs r2, 0 ldr r5, =0x020244b0 ldr r4, =nullsub_21 ldr r3, =0x02024076 @080326B8: lsls r0, r1, 2 adds r0, r7 str r4, [r0] adds r1, r3 movs r0, 0xFF strb r0, [r1] ldr r0, [sp, 0x10] adds r0, r6 strb r2, [r0] ldr r0, [sp, 0x10] adds r0, r5 strb r2, [r0] ldr r0, [sp, 0x10] adds r0, 0x1 str r0, [sp, 0x10] adds r1, r0, 0 cmp r1, 0x3 ble @080326B8 bl battle_wireless_setup_if_required_maybe ldr r0, =0x02024068 movs r5, 0 str r5, [r0] bl sub_80A3934 bl sub_806E414 movs r0, 0xF bl sub_81308C8 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x10 ands r0, r1 cmp r0, 0 beq @08032728 bl zero_enemy_party_data ldr r4, =0x02024744 movs r1, 0x90 lsls r1, 1 str r5, [sp] str r5, [sp, 0x4] str r5, [sp, 0x8] str r5, [sp, 0xC] adds r0, r4, 0 movs r2, 0x2 movs r3, 0x20 bl create_pokemon_set_level str r5, [sp, 0x10] adds r0, r4, 0 movs r1, 0xC add r2, sp, 0x10 bl pokemon_setattr @08032728: ldr r0, =0x02022ff4 str r5, [r0] ldr r0, =0x0202428c strb r5, [r0] add sp, 0x14 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803269C thumb_func_start sub_8032768 sub_8032768: ; 8032768 push {r4,r5,lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne @08032784 movs r0, 0x1 bl sub_8184DA4 b @0803278A .align 2, 0 .pool @08032784: movs r0, 0x2 bl sub_8184DA4 @0803278A: ldr r4, =0x02022fec ldr r0, [r4] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne @0803279C bl sub_8185EB8 @0803279C: ldr r0, [r4] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @080327B0 bl b_setup_bx_link b @080327B4 .align 2, 0 .pool @080327B0: bl b_setup_bx @080327B4: bl sub_8033050 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @080327E2 movs r4, 0 ldr r0, =0x0202406c ldrb r1, [r0] cmp r4, r1 bge @080327E2 adds r5, r0, 0 @080327D0: lsls r0, r4, 24 lsrs r0, 24 movs r1, 0 bl sub_81B8D64 adds r4, 0x1 ldrb r0, [r5] cmp r4, r0 blt @080327D0 @080327E2: movs r4, 0 ldr r3, =0x0202449c movs r2, 0xD2 lsls r2, 1 movs r1, 0 @080327EC: ldr r0, [r3] adds r0, r4, r0 adds r0, r2 strb r1, [r0] adds r4, 0x1 cmp r4, 0x5F bls @080327EC movs r4, 0 ldr r3, =0x0202449c movs r2, 0x81 lsls r2, 2 movs r1, 0 @08032804: ldr r0, [r3] adds r0, r4, r0 adds r0, r2 strb r1, [r0] adds r4, 0x1 cmp r4, 0x67 bls @08032804 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8032768 thumb_func_start b_setup_bx b_setup_bx: ; 8032824 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x02022fec ldr r3, [r0] movs r5, 0x80 lsls r5, 15 ands r5, r3 cmp r5, 0 beq @080328E4 ldr r1, =0x03005d04 ldr r0, =sub_8039ECC str r0, [r1] movs r4, 0x80 lsls r4, 17 ands r4, r3 cmp r4, 0 beq @08032874 ldr r2, =0x03005d60 ldr r0, =sub_818994C str r0, [r2] ldr r1, =0x02024076 movs r0, 0 strb r0, [r1] b @0803287E .align 2, 0 .pool @08032874: ldr r2, =0x03005d60 ldr r0, =sub_805745C str r0, [r2] ldr r1, =0x02024076 strb r4, [r1] @0803287E: ldr r3, =sub_805F164 str r3, [r2, 0x4] movs r0, 0x1 strb r0, [r1, 0x1] ldr r0, =sub_81BADF4 str r0, [r2, 0x8] movs r0, 0x2 strb r0, [r1, 0x2] str r3, [r2, 0xC] movs r0, 0x3 strb r0, [r1, 0x3] ldr r1, =0x0202406c movs r0, 0x4 strb r0, [r1] movs r0, 0 movs r1, 0 bl sub_81B8D64 movs r0, 0x1 movs r1, 0 bl sub_81B8D64 movs r0, 0x2 movs r1, 0x1 bl sub_81B8D64 movs r0, 0x3 movs r1, 0x1 bl sub_81B8D64 ldr r0, =0x0202406e movs r1, 0 strh r1, [r0] strh r1, [r0, 0x2] movs r1, 0x3 b @08032A76 .align 2, 0 .pool @080328E4: movs r7, 0x1 adds r0, r3, 0 ands r0, r7 cmp r0, 0 beq @080328F0 b @080329E0 @080328F0: ldr r0, =0x03005d04 ldr r2, =sub_8039ECC str r2, [r0] movs r1, 0x80 ands r1, r3 mov r12, r2 cmp r1, 0 beq @08032918 ldr r1, =0x03005d60 ldr r0, =sub_815936C b @08032934 .align 2, 0 .pool @08032918: movs r0, 0x80 lsls r0, 2 ands r3, r0 cmp r3, 0 beq @08032930 ldr r1, =0x03005d60 ldr r0, =bx_goto_buffer_A_ch0_tbl3 b @08032934 .align 2, 0 .pool @08032930: ldr r1, =0x03005d60 ldr r0, =sub_805745C @08032934: str r0, [r1] mov r10, r1 ldr r4, =0x02024076 movs r0, 0 mov r9, r0 mov r1, r9 strb r1, [r4] mov r5, r10 ldr r2, =sub_805F164 mov r8, r2 str r2, [r5, 0x4] movs r6, 0x1 strb r6, [r4, 0x1] ldr r2, =0x0202406c movs r7, 0x2 strb r7, [r2] ldr r0, =0x02022fec ldr r3, [r0] movs r0, 0x80 lsls r0, 17 ands r0, r3 cmp r0, 0 bne @08032964 b @08032CB2 @08032964: movs r1, 0x80 lsls r1, 18 ands r1, r3 cmp r1, 0 beq @080329CC movs r1, 0x80 lsls r1, 24 ands r1, r3 cmp r1, 0 beq @080329B4 mov r1, r12 ldr r0, =0x03005d04 str r1, [r0] ldr r0, =sub_818994C str r0, [r5] mov r1, r9 strb r1, [r4] ldr r0, =sub_81864EC str r0, [r5, 0x4] strb r6, [r4, 0x1] strb r7, [r2] b @08032CB2 .align 2, 0 .pool @080329B4: ldr r0, =sub_818994C str r0, [r5, 0x4] strb r1, [r4, 0x1] ldr r0, =sub_81864EC str r0, [r5] strb r6, [r4] strb r7, [r2] b @08032CB2 .align 2, 0 .pool @080329CC: ldr r0, =sub_818994C mov r2, r10 str r0, [r2] strb r1, [r4] mov r0, r8 str r0, [r2, 0x4] strb r6, [r4, 0x1] b @08032CB2 .align 2, 0 .pool @080329E0: ldr r1, =sub_8039ECC ldr r2, =0x03005d04 str r1, [r2] ldr r2, =0x03005d60 ldr r0, =sub_805745C str r0, [r2] ldr r4, =0x02024076 strb r5, [r4] ldr r6, =sub_805F164 str r6, [r2, 0x4] strb r7, [r4, 0x1] str r0, [r2, 0x8] movs r0, 0x2 mov r12, r0 mov r1, r12 strb r1, [r4, 0x2] str r6, [r2, 0xC] movs r0, 0x3 mov r8, r0 mov r1, r8 strb r1, [r4, 0x3] ldr r0, =0x0202406c mov r10, r0 movs r1, 0x4 mov r9, r1 strb r1, [r0] movs r0, 0x80 lsls r0, 17 ands r0, r3 cmp r0, 0 bne @08032A20 b @08032CB2 @08032A20: movs r1, 0xA0 lsls r1, 1 adds r0, r3, 0 ands r0, r1 cmp r0, r1 bne @08032AA0 ldr r0, =sub_8039ECC ldr r1, =0x03005d04 str r0, [r1] ldr r0, =sub_818994C str r0, [r2] strb r5, [r4] str r6, [r2, 0x4] strb r7, [r4, 0x1] str r0, [r2, 0x8] mov r0, r12 strb r0, [r4, 0x2] str r6, [r2, 0xC] mov r1, r8 strb r1, [r4, 0x3] mov r0, r9 mov r2, r10 strb r0, [r2] movs r0, 0 movs r1, 0 bl sub_81B8D64 movs r0, 0x1 movs r1, 0 bl sub_81B8D64 movs r0, 0x2 movs r1, 0x1 bl sub_81B8D64 movs r0, 0x3 movs r1, 0x1 bl sub_81B8D64 ldr r0, =0x0202406e strh r5, [r0] strh r5, [r0, 0x2] mov r1, r8 @08032A76: strh r1, [r0, 0x4] strh r1, [r0, 0x6] b @08032CB2 .align 2, 0 .pool @08032AA0: movs r5, 0x40 ands r5, r3 cmp r5, 0 bne @08032AAA b @08032C3C @08032AAA: ldr r0, =0x0203c7b4 ldrb r5, [r0] movs r0, 0 mov r10, r0 ldr r1, =0x020229e8 mov r12, r1 adds r7, r4, 0 mov r8, r0 ldr r6, =0x0202406e movs r4, 0 movs r2, 0x3 mov r9, r2 @08032AC2: mov r1, r12 adds r0, r4, r1 ldrh r0, [r0, 0x18] cmp r0, 0x2 bgt @08032AE4 cmp r0, 0x1 bge @08032AFC cmp r0, 0 beq @08032AE8 b @08032B06 .align 2, 0 .pool @08032AE4: cmp r0, 0x3 bne @08032B06 @08032AE8: ldr r0, =0x020229e8 adds r0, r4, r0 ldrb r0, [r0, 0x18] movs r1, 0 bl sub_81B8D64 b @08032B06 .align 2, 0 .pool @08032AFC: lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl sub_81B8D64 @08032B06: cmp r10, r5 bne @08032B56 ldr r0, =0x020229e8 adds r3, r4, r0 ldrh r1, [r3, 0x18] lsls r1, 2 ldr r2, =0x03005d60 adds r1, r2 ldr r2, =sub_818994C str r2, [r1] ldrh r1, [r3, 0x18] mov r12, r0 cmp r1, 0x2 bgt @08032B38 cmp r1, 0x1 bge @08032B4C cmp r1, 0 beq @08032B3C b @08032C2C .align 2, 0 .pool @08032B38: cmp r1, 0x3 bne @08032C2C @08032B3C: mov r1, r12 adds r0, r4, r1 ldrh r1, [r0, 0x18] adds r1, r7 mov r2, r8 strb r2, [r1] ldrh r0, [r0, 0x18] b @08032C12 @08032B4C: adds r1, r7 movs r0, 0x2 strb r0, [r1] ldrh r0, [r3, 0x18] b @08032C24 @08032B56: ldr r2, =0x020229e8 adds r0, r4, r2 ldrh r1, [r0, 0x18] movs r3, 0x1 adds r0, r3, 0 ands r0, r1 mov r12, r2 cmp r0, 0 bne @08032B80 lsls r0, r5, 3 subs r0, r5 lsls r0, 2 add r0, r12 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @08032B92 b @08032BD8 .align 2, 0 .pool @08032B80: lsls r0, r5, 3 subs r0, r5 lsls r0, 2 add r0, r12 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @08032BD8 @08032B92: mov r0, r12 adds r2, r4, r0 ldrh r0, [r2, 0x18] lsls r0, 2 ldr r1, =0x03005d60 adds r0, r1 ldr r1, =sub_818994C str r1, [r0] ldrh r1, [r2, 0x18] cmp r1, 0x2 bgt @08032BBC cmp r1, 0x1 bge @08032BD0 cmp r1, 0 beq @08032BC0 b @08032C2C .align 2, 0 .pool @08032BBC: cmp r1, 0x3 bne @08032C2C @08032BC0: mov r2, r12 adds r0, r4, r2 ldrh r1, [r0, 0x18] adds r1, r7 mov r2, r8 strb r2, [r1] ldrh r0, [r0, 0x18] b @08032C12 @08032BD0: adds r1, r7 movs r0, 0x2 strb r0, [r1] b @08032C22 @08032BD8: mov r0, r12 adds r2, r4, r0 ldrh r0, [r2, 0x18] lsls r0, 2 ldr r1, =0x03005d60 adds r0, r1 ldr r1, =sub_81864EC str r1, [r0] ldrh r0, [r2, 0x18] cmp r0, 0x2 bgt @08032C00 cmp r0, 0x1 bge @08032C1C cmp r0, 0 beq @08032C04 b @08032C2C .align 2, 0 .pool @08032C00: cmp r0, 0x3 bne @08032C2C @08032C04: mov r0, r12 adds r2, r4, r0 ldrh r0, [r2, 0x18] adds r0, r7 movs r1, 0x1 strb r1, [r0] ldrh r0, [r2, 0x18] @08032C12: lsls r0, 1 adds r0, r6 mov r1, r8 strh r1, [r0] b @08032C2C @08032C1C: adds r0, r7 mov r1, r9 strb r1, [r0] @08032C22: ldrh r0, [r2, 0x18] @08032C24: lsls r0, 1 adds r0, r6 mov r2, r9 strh r2, [r0] @08032C2C: adds r4, 0x1C movs r0, 0x1 add r10, r0 mov r1, r10 cmp r1, 0x3 bgt @08032C3A b @08032AC2 @08032C3A: b @08032CB2 @08032C3C: movs r1, 0x4 ands r1, r3 cmp r1, 0 beq @08032C7C ldr r0, =sub_818994C str r0, [r2] strb r5, [r4] str r0, [r2, 0x8] mov r0, r12 strb r0, [r4, 0x2] movs r0, 0x80 lsls r0, 18 ands r3, r0 cmp r3, 0 beq @08032C70 ldr r0, =sub_81864EC str r0, [r2, 0x4] strb r7, [r4, 0x1] str r0, [r2, 0xC] mov r1, r8 strb r1, [r4, 0x3] b @08032CB2 .align 2, 0 .pool @08032C70: str r6, [r2, 0x4] strb r7, [r4, 0x1] str r6, [r2, 0xC] mov r2, r8 strb r2, [r4, 0x3] b @08032CB2 @08032C7C: ldr r0, =sub_818994C str r0, [r2, 0x4] strb r1, [r4, 0x1] str r0, [r2, 0xC] mov r0, r12 strb r0, [r4, 0x3] movs r0, 0x80 lsls r0, 18 ands r3, r0 cmp r3, 0 beq @08032CA8 ldr r0, =sub_81864EC str r0, [r2] strb r7, [r4] str r0, [r2, 0x8] mov r1, r8 strb r1, [r4, 0x2] b @08032CB2 .align 2, 0 .pool @08032CA8: str r6, [r2] strb r7, [r4] str r6, [r2, 0x8] mov r2, r8 strb r2, [r4, 0x2] @08032CB2: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end b_setup_bx thumb_func_start b_setup_bx_link b_setup_bx_link: ; 8032CC0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r4, =0x02022fec ldr r1, [r4] movs r5, 0x1 adds r3, r1, 0 ands r3, r5 cmp r3, 0 bne @08032D48 movs r4, 0x4 ands r4, r1 cmp r4, 0 beq @08032D1C ldr r1, =0x03005d04 ldr r0, =sub_8039ECC str r0, [r1] ldr r2, =0x03005d60 ldr r0, =sub_805745C str r0, [r2] ldr r1, =0x02024076 strb r3, [r1] ldr r0, =sub_8064394 str r0, [r2, 0x4] strb r5, [r1, 0x1] ldr r1, =0x0202406c movs r0, 0x2 b @0803303A .align 2, 0 .pool @08032D1C: ldr r2, =0x03005d60 ldr r0, =sub_805745C str r0, [r2, 0x4] ldr r1, =0x02024076 strb r4, [r1, 0x1] ldr r0, =sub_8064394 str r0, [r2] strb r5, [r1] ldr r1, =0x0202406c movs r0, 0x2 b @0803303A .align 2, 0 .pool @08032D48: movs r0, 0x41 ands r0, r1 cmp r0, 0x1 bne @08032DD0 movs r6, 0x4 adds r3, r6, 0 ands r3, r1 cmp r3, 0 beq @08032D98 ldr r1, =0x03005d04 ldr r0, =sub_8039ECC str r0, [r1] ldr r2, =0x03005d60 ldr r4, =sub_805745C str r4, [r2] ldr r1, =0x02024076 movs r0, 0 strb r0, [r1] ldr r3, =sub_8064394 str r3, [r2, 0x4] strb r5, [r1, 0x1] str r4, [r2, 0x8] movs r0, 0x2 strb r0, [r1, 0x2] str r3, [r2, 0xC] movs r0, 0x3 strb r0, [r1, 0x3] b @08032DB4 .align 2, 0 .pool @08032D98: ldr r2, =0x03005d60 ldr r0, =sub_805745C str r0, [r2, 0x4] ldr r1, =0x02024076 strb r3, [r1, 0x1] ldr r3, =sub_8064394 str r3, [r2] strb r5, [r1] str r0, [r2, 0xC] movs r0, 0x2 strb r0, [r1, 0x3] str r3, [r2, 0x8] movs r0, 0x3 strb r0, [r1, 0x2] @08032DB4: ldr r0, =0x0202406c strb r6, [r0] b @0803303C .align 2, 0 .pool @08032DD0: movs r0, 0x80 lsls r0, 1 ands r0, r1 cmp r0, 0 beq @08032E8C movs r4, 0x4 adds r3, r4, 0 ands r3, r1 cmp r3, 0 beq @08032E1C ldr r1, =0x03005d04 ldr r0, =sub_8039ECC str r0, [r1] ldr r2, =0x03005d60 ldr r0, =sub_805745C str r0, [r2] ldr r1, =0x02024076 movs r0, 0 strb r0, [r1] ldr r3, =sub_805F164 str r3, [r2, 0x4] strb r5, [r1, 0x1] ldr r0, =sub_814AEB0 b @08032E2E .align 2, 0 .pool @08032E1C: ldr r2, =0x03005d60 ldr r0, =sub_814AEB0 str r0, [r2] ldr r1, =0x02024076 strb r3, [r1] ldr r3, =sub_8064394 str r3, [r2, 0x4] strb r5, [r1, 0x1] ldr r0, =sub_805745C @08032E2E: str r0, [r2, 0x8] movs r0, 0x2 strb r0, [r1, 0x2] str r3, [r2, 0xC] movs r0, 0x3 strb r0, [r1, 0x3] ldr r0, =0x0202406c strb r4, [r0] movs r0, 0 movs r1, 0 bl sub_81B8D64 movs r0, 0x1 movs r1, 0 bl sub_81B8D64 movs r0, 0x2 movs r1, 0x1 bl sub_81B8D64 movs r0, 0x3 movs r1, 0x1 bl sub_81B8D64 ldr r0, =0x0202406e movs r1, 0 strh r1, [r0] strh r1, [r0, 0x2] movs r1, 0x3 strh r1, [r0, 0x4] strh r1, [r0, 0x6] b @0803303C .align 2, 0 .pool @08032E8C: bl link_get_multiplayer_id lsls r0, 24 lsrs r5, r0, 24 ldr r0, [r4] movs r1, 0x4 ands r0, r1 cmp r0, 0 beq @08032EA4 ldr r1, =0x03005d04 ldr r0, =sub_8039ECC str r0, [r1] @08032EA4: movs r0, 0 mov r10, r0 ldr r1, =0x020229e8 mov r12, r1 ldr r7, =0x02024076 mov r8, r0 ldr r6, =0x0202406e movs r4, 0 movs r2, 0x3 mov r9, r2 @08032EB8: mov r1, r12 adds r0, r4, r1 ldrh r0, [r0, 0x18] cmp r0, 0x2 bgt @08032EE0 cmp r0, 0x1 bge @08032EF8 cmp r0, 0 beq @08032EE4 b @08032F02 .align 2, 0 .pool @08032EE0: cmp r0, 0x3 bne @08032F02 @08032EE4: ldr r0, =0x020229e8 adds r0, r4, r0 ldrb r0, [r0, 0x18] movs r1, 0 bl sub_81B8D64 b @08032F02 .align 2, 0 .pool @08032EF8: lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl sub_81B8D64 @08032F02: cmp r10, r5 bne @08032F52 ldr r0, =0x020229e8 adds r3, r4, r0 ldrh r1, [r3, 0x18] lsls r1, 2 ldr r2, =0x03005d60 adds r1, r2 ldr r2, =sub_805745C str r2, [r1] ldrh r1, [r3, 0x18] mov r12, r0 cmp r1, 0x2 bgt @08032F34 cmp r1, 0x1 bge @08032F48 cmp r1, 0 beq @08032F38 b @08033028 .align 2, 0 .pool @08032F34: cmp r1, 0x3 bne @08033028 @08032F38: mov r1, r12 adds r0, r4, r1 ldrh r1, [r0, 0x18] adds r1, r7 mov r2, r8 strb r2, [r1] ldrh r0, [r0, 0x18] b @0803300E @08032F48: adds r1, r7 movs r0, 0x2 strb r0, [r1] ldrh r0, [r3, 0x18] b @08033020 @08032F52: ldr r2, =0x020229e8 adds r0, r4, r2 ldrh r1, [r0, 0x18] movs r3, 0x1 adds r0, r3, 0 ands r0, r1 mov r12, r2 cmp r0, 0 bne @08032F7C lsls r0, r5, 3 subs r0, r5 lsls r0, 2 add r0, r12 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @08032F8E b @08032FD4 .align 2, 0 .pool @08032F7C: lsls r0, r5, 3 subs r0, r5 lsls r0, 2 add r0, r12 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @08032FD4 @08032F8E: mov r0, r12 adds r2, r4, r0 ldrh r0, [r2, 0x18] lsls r0, 2 ldr r1, =0x03005d60 adds r0, r1 ldr r1, =sub_814AEB0 str r1, [r0] ldrh r1, [r2, 0x18] cmp r1, 0x2 bgt @08032FB8 cmp r1, 0x1 bge @08032FCC cmp r1, 0 beq @08032FBC b @08033028 .align 2, 0 .pool @08032FB8: cmp r1, 0x3 bne @08033028 @08032FBC: mov r2, r12 adds r0, r4, r2 ldrh r1, [r0, 0x18] adds r1, r7 mov r2, r8 strb r2, [r1] ldrh r0, [r0, 0x18] b @0803300E @08032FCC: adds r1, r7 movs r0, 0x2 strb r0, [r1] b @0803301E @08032FD4: mov r0, r12 adds r2, r4, r0 ldrh r0, [r2, 0x18] lsls r0, 2 ldr r1, =0x03005d60 adds r0, r1 ldr r1, =sub_8064394 str r1, [r0] ldrh r0, [r2, 0x18] cmp r0, 0x2 bgt @08032FFC cmp r0, 0x1 bge @08033018 cmp r0, 0 beq @08033000 b @08033028 .align 2, 0 .pool @08032FFC: cmp r0, 0x3 bne @08033028 @08033000: mov r0, r12 adds r2, r4, r0 ldrh r0, [r2, 0x18] adds r0, r7 movs r1, 0x1 strb r1, [r0] ldrh r0, [r2, 0x18] @0803300E: lsls r0, 1 adds r0, r6 mov r1, r8 strh r1, [r0] b @08033028 @08033018: adds r0, r7 mov r1, r9 strb r1, [r0] @0803301E: ldrh r0, [r2, 0x18] @08033020: lsls r0, 1 adds r0, r6 mov r2, r9 strh r2, [r0] @08033028: adds r4, 0x1C movs r0, 0x1 add r10, r0 mov r1, r10 cmp r1, 0x3 bgt @08033036 b @08032EB8 @08033036: ldr r1, =0x0202406c movs r0, 0x4 @0803303A: strb r0, [r1] @0803303C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end b_setup_bx_link thumb_func_start sub_8033050 sub_8033050: ; 8033050 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08033068 b @0803319C @08033068: movs r0, 0 mov r8, r0 b @0803317A .align 2, 0 .pool @08033074: movs r5, 0 movs r0, 0x1 add r0, r8 mov r10, r0 ldr r0, =0x02024076 add r0, r8 mov r9, r0 mov r0, r8 lsls r6, r0, 1 movs r7, 0 @08033088: mov r0, r8 cmp r0, 0x1 bgt @080330F0 mov r0, r9 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080330A8 ldr r0, =0x020244ec b @080330AA .align 2, 0 .pool @080330A8: ldr r0, =0x02024744 @080330AA: adds r4, r7, r0 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08033170 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @08033170 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @08033170 adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @08033170 ldr r0, =0x0202406e adds r0, r6, r0 strh r5, [r0] b @08033178 .align 2, 0 .pool @080330F0: mov r0, r9 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08033118 ldr r0, =0x020244ec adds r4, r7, r0 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08033170 adds r0, r4, 0 movs r1, 0xB b @0803312C .align 2, 0 .pool @08033118: ldr r0, =0x02024744 adds r4, r7, r0 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08033170 adds r0, r4, 0 movs r1, 0x41 @0803312C: bl pokemon_getattr cmp r0, 0 beq @08033170 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @08033170 adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @08033170 ldr r1, =0x0202406e mov r0, r8 subs r0, 0x2 lsls r0, 1 adds r0, r1 ldrh r0, [r0] cmp r0, r5 beq @08033170 adds r0, r6, r1 strh r5, [r0] b @08033178 .align 2, 0 .pool @08033170: adds r7, 0x64 adds r5, 0x1 cmp r5, 0x5 ble @08033088 @08033178: mov r8, r10 @0803317A: ldr r0, =0x0202406c ldrb r0, [r0] cmp r8, r0 bge @08033184 b @08033074 @08033184: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 beq @0803319C ldr r0, =0x0202406e movs r1, 0 strh r1, [r0, 0x2] movs r1, 0x3 strh r1, [r0, 0x6] @0803319C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8033050 thumb_func_start dp01_prepare_buffer dp01_prepare_buffer: ; 80331B8 push {r4-r6,lr} adds r4, r1, 0 lsls r0, 24 lsrs r3, r0, 24 adds r5, r3, 0 lsls r2, 16 lsrs r2, 16 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @080331E4 adds r0, r3, 0 adds r1, r2, 0 adds r2, r4, 0 bl dp01_prepare_buffer_wireless_probably b @08033236 .align 2, 0 .pool @080331E4: cmp r5, 0 beq @080331EE cmp r5, 0x1 beq @08033218 b @08033236 @080331EE: movs r3, 0 cmp r3, r2 bge @08033236 ldr r6, =0x02023064 ldr r5, =0x02024064 @080331F8: ldrb r0, [r5] lsls r0, 9 adds r0, r3, r0 adds r0, r6 ldrb r1, [r4] strb r1, [r0] adds r4, 0x1 adds r3, 0x1 cmp r3, r2 blt @080331F8 b @08033236 .align 2, 0 .pool @08033218: movs r3, 0 cmp r3, r2 bge @08033236 ldr r6, =0x02023864 ldr r5, =0x02024064 @08033222: ldrb r0, [r5] lsls r0, 9 adds r0, r3, r0 adds r0, r6 ldrb r1, [r4] strb r1, [r0] adds r4, 0x1 adds r3, 0x1 cmp r3, r2 blt @08033222 @08033236: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_prepare_buffer thumb_func_start sub_8033244 sub_8033244: ; 8033244 push {r4-r6,lr} ldr r0, =task00_wireless_something movs r1, 0 bl AddTask ldr r2, =0x02022d08 strb r0, [r2] ldr r5, =0x03005e00 ldrb r1, [r2] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r6, 0 movs r4, 0 strh r4, [r0, 0x1E] ldrb r1, [r2] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r4, [r0, 0x20] ldrb r1, [r2] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r4, [r0, 0x22] ldrb r1, [r2] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r4, [r0, 0x24] ldrb r1, [r2] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r4, [r0, 0x26] ldr r0, =sub_803375C movs r1, 0 bl AddTask ldr r2, =0x02022d09 strb r0, [r2] ldrb r1, [r2] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r4, [r0, 0x20] ldrb r1, [r2] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r4, [r0, 0x22] ldrb r1, [r2] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r4, [r0, 0x24] ldrb r1, [r2] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r4, [r0, 0x26] ldr r0, =0x02022d0a strb r6, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8033244 thumb_func_start dp01_prepare_buffer_wireless_probably dp01_prepare_buffer_wireless_probably: ; 80332F4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} mov r9, r2 lsls r0, 24 lsrs r6, r0, 24 lsls r1, 16 lsrs r1, 16 mov r12, r1 movs r1, 0x3 mov r0, r12 bics r0, r1 adds r0, 0x4 mov r8, r0 ldr r2, =0x03005e00 ldr r3, =0x02022d08 ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r4, r0, r2 movs r1, 0x24 ldrsh r0, [r4, r1] add r0, r8 adds r0, 0x9 movs r1, 0x80 lsls r1, 5 adds r5, r2, 0 cmp r0, r1 ble @08033346 ldrh r0, [r4, 0x24] movs r2, 0 strh r0, [r4, 0x20] ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r2, [r0, 0x24] @08033346: ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r2, 0x24 ldrsh r1, [r0, r2] ldr r4, =0x020244a0 ldr r0, [r4] adds r0, r1 strb r6, [r0] ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r7, 0x24 ldrsh r1, [r0, r7] ldr r0, [r4] adds r1, r0 ldr r0, =0x02024064 ldrb r0, [r0] strb r0, [r1, 0x1] ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r2, 0x24 ldrsh r1, [r0, r2] ldr r0, [r4] adds r1, r0 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r1, 0x2] ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r7, 0x24 ldrsh r1, [r0, r7] ldr r0, [r4] adds r1, r0 ldr r0, =0x0202420c ldrb r0, [r0] strb r0, [r1, 0x3] ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r1, 0x24 ldrsh r0, [r0, r1] ldr r1, [r4] adds r0, r1 mov r2, r8 strb r2, [r0, 0x4] ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r7, 0x24 ldrsh r1, [r0, r7] ldr r0, [r4] adds r1, r0 movs r0, 0xFF lsls r0, 8 mov r2, r8 ands r0, r2 asrs r0, 8 strb r0, [r1, 0x5] ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r7, 0x24 ldrsh r1, [r0, r7] ldr r0, [r4] adds r1, r0 ldr r0, =0x02024210 ldrb r0, [r0] strb r0, [r1, 0x6] ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r2, 0x24 ldrsh r1, [r0, r2] ldr r0, [r4] adds r1, r0 ldr r0, =0x0202420e ldrb r0, [r0] strb r0, [r1, 0x7] movs r2, 0 cmp r2, r12 bge @08033434 mov r10, r5 adds r6, r3, 0 @08033412: ldrb r1, [r6] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 add r0, r10 movs r7, 0x24 ldrsh r1, [r0, r7] ldr r0, [r4] adds r1, r2, r1 adds r1, r0 mov r7, r9 adds r0, r7, r2 ldrb r0, [r0] strb r0, [r1, 0x8] adds r2, 0x1 cmp r2, r12 blt @08033412 @08033434: ldrb r0, [r3] lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r5 ldrh r0, [r1, 0x24] add r0, r8 adds r0, 0x8 strh r0, [r1, 0x24] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_prepare_buffer_wireless_probably thumb_func_start task00_wireless_something task00_wireless_something: ; 8033474 push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r2, 0x1E ldrsh r0, [r0, r2] adds r7, r1, 0 cmp r0, 0x5 bls @08033490 b @08033640 @08033490: lsls r0, 2 ldr r1, =@080334A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080334A4: .4byte @080334BC .4byte @080334CA .4byte @080334E6 .4byte @08033570 .4byte @080335E6 .4byte @08033624 @080334BC: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r7 movs r1, 0x64 strh r1, [r0, 0x1C] b @080334F6 @080334CA: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r1, r0, r7 ldrh r0, [r1, 0x1C] subs r0, 0x1 strh r0, [r1, 0x1C] lsls r0, 16 cmp r0, 0 beq @080334E0 b @08033640 @080334E0: ldrh r0, [r1, 0x1E] adds r0, 0x1 b @0803363E @080334E6: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08033504 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r7 @080334F6: ldrh r1, [r0, 0x1E] adds r1, 0x1 strh r1, [r0, 0x1E] b @08033640 .align 2, 0 .pool @08033504: ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 1 ands r0, r1 cmp r0, 0 beq @0803351C movs r5, 0x2 b @0803352A .align 2, 0 .pool @0803351C: movs r0, 0x40 ands r1, r0 movs r0, 0x2 cmp r1, 0 beq @08033528 movs r0, 0x4 @08033528: adds r5, r0, 0 @0803352A: bl sub_800ABAC lsls r0, 24 lsrs r0, 24 cmp r0, r5 bcs @08033538 b @08033640 @08033538: bl sub_800ABBC lsls r0, 24 cmp r0, 0 beq @0803355C bl sub_800A620 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x1E] adds r0, 0x1 b @0803363E .align 2, 0 .pool @0803355C: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x1E] adds r0, 0x1 b @0803363E .align 2, 0 .pool @08033570: lsls r1, r4, 2 adds r0, r1, r4 lsls r0, 3 adds r2, r0, r7 movs r3, 0x26 ldrsh r5, [r2, r3] movs r0, 0x24 ldrsh r6, [r2, r0] mov r12, r6 cmp r5, r12 beq @08033640 ldrh r0, [r2, 0x22] movs r6, 0x22 ldrsh r3, [r2, r6] cmp r3, 0 bne @080335E0 cmp r5, r12 ble @080335A0 movs r6, 0x20 ldrsh r0, [r2, r6] cmp r5, r0 bne @080335A0 strh r3, [r2, 0x20] strh r3, [r2, 0x26] @080335A0: adds r4, r1, r4 lsls r4, 3 adds r4, r7 movs r0, 0x26 ldrsh r1, [r4, r0] ldr r5, =0x020244a0 ldr r0, [r5] adds r1, r0 ldrb r0, [r1, 0x4] ldrb r1, [r1, 0x5] lsls r1, 8 orrs r0, r1 adds r0, 0x8 lsls r0, 16 lsrs r6, r0, 16 bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 movs r1, 0x26 ldrsh r2, [r4, r1] ldr r1, [r5] adds r1, r2 adds r2, r6, 0 bl link_0800A448 ldrh r0, [r4, 0x1E] adds r0, 0x1 strh r0, [r4, 0x1E] b @08033640 .align 2, 0 .pool @080335E0: subs r0, 0x1 strh r0, [r2, 0x22] b @08033640 @080335E6: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08033640 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 movs r3, 0x26 ldrsh r2, [r1, r3] ldr r0, =0x020244a0 ldr r0, [r0] adds r2, r0 ldrb r0, [r2, 0x4] ldrb r2, [r2, 0x5] lsls r2, 8 movs r3, 0x1 strh r3, [r1, 0x22] orrs r0, r2 ldrh r6, [r1, 0x26] adds r0, r6 adds r0, 0x8 strh r0, [r1, 0x26] b @0803363C .align 2, 0 .pool @08033624: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r1, r0, r7 ldrh r0, [r1, 0x22] subs r0, 0x1 strh r0, [r1, 0x22] lsls r0, 16 cmp r0, 0 bne @08033640 movs r0, 0x1 strh r0, [r1, 0x22] @0803363C: movs r0, 0x3 @0803363E: strh r0, [r1, 0x1E] @08033640: pop {r4-r7} pop {r0} bx r0 thumb_func_end task00_wireless_something thumb_func_start sub_8033648 sub_8033648: ; 8033648 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08033738 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x20 ands r0, r1 cmp r0, 0 beq @08033738 bl sub_8011BD0 movs r4, 0 ldr r0, =0x020223c4 mov r10, r0 b @0803372C .align 2, 0 .pool @08033680: bl sub_800A550 lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_0832A328 lsls r1, r4, 2 adds r1, r2 ldr r1, [r1] ands r0, r1 adds r1, r4, 0x1 mov r9, r1 cmp r0, 0 beq @08033726 adds r0, r4, 0 bl sub_800A5EC lsls r0, r4, 8 mov r4, r10 adds r3, r0, r4 ldr r1, =0x020223c8 adds r0, r1 ldrh r6, [r0] ldr r7, =0x03005e00 ldr r4, =0x02022d09 mov r12, r4 ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r2, r0, r7 movs r0, 0x24 ldrsh r1, [r2, r0] adds r0, r6, 0 adds r0, 0x9 adds r1, r0 movs r0, 0x80 lsls r0, 5 cmp r1, r0 ble @080336E0 ldrh r0, [r2, 0x24] strh r0, [r2, 0x20] ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r7 movs r1, 0 strh r1, [r0, 0x24] @080336E0: ldr r2, =0x020244a4 mov r4, r12 ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r7 movs r4, 0x24 ldrsh r1, [r0, r4] ldr r0, [r2] adds r5, r0, r1 adds r4, r3, 0 movs r2, 0 adds r3, r6, 0 adds r3, 0x8 mov r8, r7 mov r7, r12 cmp r2, r3 bge @08033714 @08033706: adds r0, r5, r2 adds r1, r4, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, r3 blt @08033706 @08033714: ldrb r0, [r7] lsls r1, r0, 2 adds r1, r0 lsls r1, 3 add r1, r8 ldrh r0, [r1, 0x24] adds r0, r6, r0 adds r0, 0x8 strh r0, [r1, 0x24] @08033726: mov r1, r9 lsls r0, r1, 24 lsrs r4, r0, 24 @0803372C: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r4, r0 bcc @08033680 @08033738: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8033648 thumb_func_start sub_803375C sub_803375C: ; 803375C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r7, r0, 24 ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r3, r0, r1 movs r0, 0x26 ldrsh r2, [r3, r0] movs r4, 0x24 ldrsh r0, [r3, r4] cmp r2, r0 bne @08033780 b @0803389C @08033780: cmp r2, r0 ble @08033792 movs r4, 0x20 ldrsh r0, [r3, r4] cmp r2, r0 bne @08033792 movs r0, 0 strh r0, [r3, 0x20] strh r0, [r3, 0x26] @08033792: lsls r2, r7, 2 adds r0, r2, r7 lsls r0, 3 adds r5, r0, r1 movs r0, 0x26 ldrsh r1, [r5, r0] ldr r3, =0x020244a4 mov r8, r3 ldr r0, [r3] adds r3, r1, r0 ldrb r4, [r3, 0x1] ldrb r6, [r3, 0x4] ldrb r0, [r3, 0x5] lsls r0, 8 orrs r6, r0 ldrb r0, [r3] mov r9, r2 cmp r0, 0x1 beq @0803385C cmp r0, 0x1 bgt @080337CC cmp r0, 0 beq @080337D2 b @0803388A .align 2, 0 .pool @080337CC: cmp r0, 0x2 beq @08033874 b @0803388A @080337D2: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 lsls r0, r4, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0803389C lsls r0, r4, 9 ldr r1, =0x02023064 adds r0, r1 adds r1, r3, 0 adds r1, 0x8 adds r2, r6, 0 bl memcpy adds r0, r4, 0 bl sub_803F850 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x4 ands r0, r1 cmp r0, 0 bne @0803388A ldr r2, =0x0202420b movs r4, 0x26 ldrsh r0, [r5, r4] mov r3, r8 ldr r1, [r3] adds r0, r1 ldrb r0, [r0, 0x2] strb r0, [r2] ldr r2, =0x0202420c movs r4, 0x26 ldrsh r0, [r5, r4] adds r0, r1 ldrb r0, [r0, 0x3] strb r0, [r2] ldr r2, =0x02024210 movs r3, 0x26 ldrsh r0, [r5, r3] adds r0, r1 ldrb r0, [r0, 0x6] strb r0, [r2] ldr r2, =0x0202420e movs r4, 0x26 ldrsh r0, [r5, r4] adds r0, r1 ldrb r0, [r0, 0x7] strb r0, [r2] b @0803388A .align 2, 0 .pool @0803385C: lsls r0, r4, 9 ldr r1, =0x02023864 adds r0, r1 adds r1, r3, 0 adds r1, 0x8 adds r2, r6, 0 bl memcpy b @0803388A .align 2, 0 .pool @08033874: ldrb r2, [r3, 0x8] ldr r3, =0x02024068 ldr r1, =gUnknown_0832A328 lsls r0, r4, 2 adds r0, r1 lsls r2, 2 ldr r1, [r0] lsls r1, r2 ldr r0, [r3] bics r0, r1 str r0, [r3] @0803388A: ldr r0, =0x03005e00 mov r2, r9 adds r1, r2, r7 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x26] adds r0, r6, r0 adds r0, 0x8 strh r0, [r1, 0x26] @0803389C: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803375C thumb_func_start dp01_build_cmdbuf_x00_a_b_0 dp01_build_cmdbuf_x00_a_b_0: ; 80338B4 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r3, 0 strb r3, [r1] strb r4, [r1, 0x1] strb r2, [r1, 0x2] strb r3, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x00_a_b_0 thumb_func_start dp01_build_cmdbuf_x01_a_b_0 dp01_build_cmdbuf_x01_a_b_0: ; 80338D8 push {r4,r5,lr} adds r5, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r4, 0 movs r3, 0x1 strb r3, [r1] strb r5, [r1, 0x1] strb r2, [r1, 0x2] strb r4, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x01_a_b_0 thumb_func_start dp01_build_cmdbuf_x02_a_b_varargs dp01_build_cmdbuf_x02_a_b_varargs: ; 8033900 push {r4-r6,lr} ldr r4, [sp, 0x10] lsls r0, 24 lsrs r6, r0, 24 lsls r3, 24 lsrs r5, r3, 24 ldr r0, =0x02022d10 movs r3, 0x2 strb r3, [r0] strb r1, [r0, 0x1] strb r2, [r0, 0x2] adds r1, r0, 0 cmp r5, 0 beq @0803392E adds r3, r1, 0x3 adds r2, r5, 0 @08033920: ldrb r0, [r4] strb r0, [r3] adds r4, 0x1 adds r3, 0x1 subs r2, 0x1 cmp r2, 0 bne @08033920 @0803392E: adds r2, r5, 0x3 adds r0, r6, 0 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x02_a_b_varargs thumb_func_start sub_8033940 sub_8033940: ; 8033940 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r2, 24 lsrs r4, r2, 24 ldr r0, =0x02022d10 movs r2, 0x3 strb r2, [r0] strb r1, [r0, 0x1] strb r4, [r0, 0x2] adds r5, r0, 0 cmp r4, 0 beq @0803396C adds r1, r5, 0x3 adds r2, r4, 0 @0803395E: ldrb r0, [r3] strb r0, [r1] adds r3, 0x1 adds r1, 0x1 subs r2, 0x1 cmp r2, 0 bne @0803395E @0803396C: adds r2, r4, 0x3 adds r0, r6, 0 adds r1, r5, 0 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8033940 thumb_func_start dp01_build_cmdbuf_x04_4_4_4 dp01_build_cmdbuf_x04_4_4_4: ; 8033980 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x4 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x04_4_4_4 thumb_func_start dp01_build_cmdbuf_x05_a_b_c dp01_build_cmdbuf_x05_a_b_c: ; 80339A0 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r3, 0x5 strb r3, [r1] strb r4, [r1, 0x1] strb r2, [r1, 0x2] strb r3, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x05_a_b_c thumb_func_start dp01_build_cmdbuf_x06_a dp01_build_cmdbuf_x06_a: ; 80339C4 push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x6 strb r2, [r1] strb r3, [r1, 0x1] movs r2, 0x2 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x06_a thumb_func_start dp01_build_cmdbuf_x07_7_7_7 dp01_build_cmdbuf_x07_7_7_7: ; 80339E4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x7 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x07_7_7_7 thumb_func_start dp01_build_cmdbuf_x08_8_8_8 dp01_build_cmdbuf_x08_8_8_8: ; 8033A04 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x8 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x08_8_8_8 thumb_func_start dp01_build_cmdbuf_x09_9_9_9 dp01_build_cmdbuf_x09_9_9_9: ; 8033A24 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x9 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x09_9_9_9 thumb_func_start dp01_build_cmdbuf_x0A_A_A_A dp01_build_cmdbuf_x0A_A_A_A: ; 8033A44 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0xA strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x0A_A_A_A thumb_func_start dp01_build_cmdbuf_x0B_B_B_B dp01_build_cmdbuf_x0B_B_B_B: ; 8033A64 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0xB strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x0B_B_B_B thumb_func_start dp01_build_cmdbuf_x0C_C_C_C dp01_build_cmdbuf_x0C_C_C_C: ; 8033A84 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0xC strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x0C_C_C_C thumb_func_start dp01_build_cmdbuf_x0D_a dp01_build_cmdbuf_x0D_a: ; 8033AA4 push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0xD strb r2, [r1] strb r3, [r1, 0x1] movs r2, 0x2 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x0D_a thumb_func_start sub_8033AC4 sub_8033AC4: ; 8033AC4 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r4, r1, 24 ldr r1, =0x02022d10 movs r0, 0xE strb r0, [r1] strb r4, [r1, 0x1] lsls r0, r4, 1 adds r0, r4 adds r5, r1, 0 cmp r0, 0 beq @08033AF2 adds r1, r5, 0x2 adds r3, r0, 0 @08033AE4: ldrb r0, [r2] strb r0, [r1] adds r2, 0x1 adds r1, 0x1 subs r3, 0x1 cmp r3, 0 bne @08033AE4 @08033AF2: lsls r2, r4, 1 adds r2, r4 adds r2, 0x2 adds r0, r6, 0 adds r1, r5, 0 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8033AC4 thumb_func_start dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes: ; 8033B0C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 ldr r4, [sp, 0x20] ldr r5, [sp, 0x24] ldr r6, [sp, 0x2C] mov r8, r6 lsls r0, 24 lsrs r0, 24 mov r9, r0 lsls r1, 16 lsrs r1, 16 lsls r3, 16 lsrs r3, 16 ldr r7, =0x02022d10 movs r0, 0 mov r12, r0 movs r0, 0xF strb r0, [r7] strb r1, [r7, 0x1] lsrs r1, 8 strb r1, [r7, 0x2] strb r2, [r7, 0x3] strb r3, [r7, 0x4] movs r6, 0xFF lsls r6, 8 lsrs r3, 8 strb r3, [r7, 0x5] strb r4, [r7, 0x6] adds r0, r4, 0 ands r0, r6 asrs r0, 8 strb r0, [r7, 0x7] movs r0, 0xFF lsls r0, 16 ands r0, r4 asrs r0, 16 strb r0, [r7, 0x8] lsrs r4, 24 strb r4, [r7, 0x9] strb r5, [r7, 0xA] mov r0, r8 strb r0, [r7, 0xB] mov r0, r12 str r0, [sp] movs r0, 0xE movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08033BAC str r0, [sp] movs r0, 0xE movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @08033BAC ldr r0, =0x020243cc ldrh r0, [r0] strb r0, [r7, 0xC] ands r6, r0 lsrs r0, r6, 8 strb r0, [r7, 0xD] adds r4, r7, 0 b @08033BB6 .align 2, 0 .pool @08033BAC: ldr r0, =0x02022d10 movs r1, 0 strb r1, [r0, 0xC] strb r1, [r0, 0xD] adds r4, r0, 0 @08033BB6: movs r0, 0 strb r0, [r4, 0xE] strb r0, [r4, 0xF] adds r0, r4, 0 adds r0, 0x10 ldr r1, [sp, 0x28] movs r2, 0x1C bl memcpy mov r0, r9 adds r1, r4, 0 movs r2, 0x2C bl dp01_prepare_buffer add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes thumb_func_start dp01_build_cmdbuf_x10_TODO dp01_build_cmdbuf_x10_TODO: ; 8033BE4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 mov r10, r0 lsls r1, 16 lsrs r1, 16 ldr r2, =0x02022d10 movs r0, 0x10 strb r0, [r2] ldr r0, =0x0202433a ldrb r0, [r0] strb r0, [r2, 0x1] strb r1, [r2, 0x2] lsrs r1, 8 strb r1, [r2, 0x3] adds r0, r2, 0x4 mov r12, r0 ldr r4, =0x020241ea ldrh r0, [r4] strh r0, [r2, 0x4] ldr r0, =0x020241ec ldrh r0, [r0] mov r1, r12 strh r0, [r1, 0x2] ldr r0, =0x02024208 ldrh r0, [r0] strh r0, [r1, 0x4] ldr r0, =0x0202420a ldrb r0, [r0] strb r0, [r1, 0x6] ldr r0, =0x02024474 ldrb r0, [r0, 0x17] strb r0, [r1, 0x7] ldr r0, =0x0202449c ldr r0, [r0] adds r1, r0, 0 adds r1, 0x52 ldrb r1, [r1] mov r3, r12 strb r1, [r3, 0x8] adds r0, 0xB1 ldrb r0, [r0] strb r0, [r3, 0x9] ldr r0, =0x0202420f ldrb r0, [r0] strb r0, [r3, 0xA] ldr r3, =gBattleMoves ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x2] mov r7, r12 strb r0, [r7, 0xB] movs r3, 0 mov r9, r2 ldr r0, =0x02022f78 mov r8, r0 adds r2, 0x10 ldr r0, =0x02024084 adds r4, r0, 0 adds r4, 0x20 @08033C6A: adds r1, r2, r3 ldrb r0, [r4] strb r0, [r1] adds r4, 0x58 adds r3, 0x1 cmp r3, 0x3 ble @08033C6A movs r3, 0 mov r5, r12 adds r5, 0x10 mov r4, r12 adds r4, 0x20 ldr r6, =0x02022f68 mov r2, r12 adds r2, 0x30 @08033C88: adds r1, r5, r3 ldr r7, =0x02022f58 adds r0, r3, r7 ldrb r0, [r0] strb r0, [r1] adds r1, r4, r3 adds r0, r3, r6 ldrb r0, [r0] strb r0, [r1] adds r1, r2, r3 mov r7, r8 adds r0, r3, r7 ldrb r0, [r0] strb r0, [r1] adds r3, 0x1 cmp r3, 0xF ble @08033C88 mov r0, r10 mov r1, r9 movs r2, 0x44 bl dp01_prepare_buffer pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x10_TODO thumb_func_start dp01_build_cmdbuf_x11_TODO dp01_build_cmdbuf_x11_TODO: ; 8033CFC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 mov r10, r0 lsls r1, 16 lsrs r1, 16 ldr r2, =0x02022d10 movs r0, 0x11 strb r0, [r2] strb r0, [r2, 0x1] strb r1, [r2, 0x2] lsrs r1, 8 strb r1, [r2, 0x3] adds r0, r2, 0x4 mov r12, r0 ldr r0, =0x020241ea ldrh r0, [r0] strh r0, [r2, 0x4] ldr r0, =0x020241ec ldrh r0, [r0] mov r1, r12 strh r0, [r1, 0x2] ldr r0, =0x02024208 ldrh r0, [r0] strh r0, [r1, 0x4] ldr r0, =0x0202420a ldrb r0, [r0] strb r0, [r1, 0x6] ldr r0, =0x02024474 ldrb r0, [r0, 0x17] strb r0, [r1, 0x7] ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x52 ldrb r0, [r0] strb r0, [r1, 0x8] movs r3, 0 mov r9, r2 ldr r7, =0x02022f78 mov r8, r7 mov r4, r9 adds r4, 0x10 ldr r0, =0x02024084 adds r2, r0, 0 adds r2, 0x20 @08033D5E: adds r1, r4, r3 ldrb r0, [r2] strb r0, [r1] adds r2, 0x58 adds r3, 0x1 cmp r3, 0x3 ble @08033D5E movs r3, 0 mov r5, r12 adds r5, 0x10 mov r4, r12 adds r4, 0x20 ldr r6, =0x02022f68 mov r2, r12 adds r2, 0x30 @08033D7C: adds r1, r5, r3 ldr r7, =0x02022f58 adds r0, r3, r7 ldrb r0, [r0] strb r0, [r1] adds r1, r4, r3 adds r0, r3, r6 ldrb r0, [r0] strb r0, [r1] adds r1, r2, r3 mov r7, r8 adds r0, r3, r7 ldrb r0, [r0] strb r0, [r1] adds r3, 0x1 cmp r3, 0xF ble @08033D7C mov r0, r10 mov r1, r9 movs r2, 0x44 bl dp01_prepare_buffer pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x11_TODO thumb_func_start dp01_build_cmdbuf_x12_a_bb dp01_build_cmdbuf_x12_a_bb: ; 8033DE4 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 lsls r2, 16 lsrs r2, 16 ldr r1, =0x02022d10 movs r3, 0x12 strb r3, [r1] strb r4, [r1, 0x1] strb r2, [r1, 0x2] lsrs r2, 8 strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x12_a_bb thumb_func_start sub_8033E10 sub_8033E10: ; 8033E10 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x13 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8033E10 thumb_func_start sub_8033E30 sub_8033E30: ; 8033E30 push {r4-r6,lr} adds r5, r3, 0 lsls r0, 24 lsrs r6, r0, 24 ldr r3, =0x02022d10 movs r4, 0 movs r0, 0x14 strb r0, [r3] strb r1, [r3, 0x1] strb r2, [r3, 0x2] strb r4, [r3, 0x3] movs r2, 0 adds r1, r3, 0 adds r4, r1, 0x4 @08033E4C: adds r0, r5, r2 ldrb r0, [r0] strb r0, [r4] adds r4, 0x1 adds r2, 0x1 cmp r2, 0x13 bls @08033E4C adds r0, r6, 0 movs r2, 0x18 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8033E30 thumb_func_start sub_8033E6C sub_8033E6C: ; 8033E6C push {r4,r5,lr} adds r4, r1, 0 lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x02022d10 movs r0, 0x15 strb r0, [r1] movs r2, 0 adds r3, r1, 0x1 @08033E7E: adds r0, r4, r2 ldrb r0, [r0] strb r0, [r3] adds r3, 0x1 adds r2, 0x1 cmp r2, 0x2 ble @08033E7E adds r0, r5, 0 movs r2, 0x4 bl dp01_prepare_buffer pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8033E6C thumb_func_start dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f: ; 8033EA0 push {r4-r6,lr} ldr r6, [sp, 0x10] lsls r0, 24 lsrs r5, r0, 24 ldr r4, =0x02022d10 movs r0, 0x16 strb r0, [r4] strb r1, [r4, 0x1] strb r2, [r4, 0x2] strb r3, [r4, 0x3] movs r2, 0 adds r1, r4, 0 adds r3, r1, 0x4 @08033EBA: adds r0, r6, r2 ldrb r0, [r0] strb r0, [r3] adds r3, 0x1 adds r2, 0x1 cmp r2, 0x2 ble @08033EBA adds r0, r5, 0 movs r2, 0x8 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f thumb_func_start dp01_build_cmdbuf_x17_17_17_17 dp01_build_cmdbuf_x17_17_17_17: ; 8033EDC push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x17 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x17_17_17_17 thumb_func_start dp01_build_cmdbuf_x18_0_aa_health_bar_update dp01_build_cmdbuf_x18_0_aa_health_bar_update: ; 8033EFC push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r1, 16 ldr r3, =0x02022d10 movs r4, 0 movs r2, 0x18 strb r2, [r3] strb r4, [r3, 0x1] strb r1, [r3, 0x2] lsls r1, 16 asrs r1, 16 movs r2, 0xFF lsls r2, 8 ands r1, r2 asrs r1, 8 strb r1, [r3, 0x3] adds r1, r3, 0 movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x18_0_aa_health_bar_update thumb_func_start dp01_build_cmdbuf_x19_a_bb dp01_build_cmdbuf_x19_a_bb: ; 8033F34 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 lsls r2, 16 lsrs r2, 16 ldr r1, =0x02022d10 movs r3, 0x19 strb r3, [r1] strb r4, [r1, 0x1] strb r2, [r1, 0x2] lsls r2, 16 asrs r2, 16 movs r3, 0xFF lsls r3, 8 ands r2, r3 asrs r2, 8 strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x19_a_bb thumb_func_start dp01_build_cmdbuf_x1A_aaaa_bbbb dp01_build_cmdbuf_x1A_aaaa_bbbb: ; 8033F68 push {r4-r6,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r3, 0x1A strb r3, [r1] strb r4, [r1, 0x1] movs r6, 0xFF lsls r6, 8 adds r3, r4, 0 ands r3, r6 lsrs r3, 8 strb r3, [r1, 0x2] movs r5, 0xFF lsls r5, 16 adds r3, r4, 0 ands r3, r5 lsrs r3, 16 strb r3, [r1, 0x3] lsrs r4, 24 strb r4, [r1, 0x4] strb r2, [r1, 0x5] adds r3, r2, 0 ands r3, r6 lsrs r3, 8 strb r3, [r1, 0x6] adds r3, r2, 0 ands r3, r5 lsrs r3, 16 strb r3, [r1, 0x7] lsrs r2, 24 strb r2, [r1, 0x8] movs r2, 0x9 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x1A_aaaa_bbbb thumb_func_start dp01_build_cmdbuf_x1B_aaaa_b dp01_build_cmdbuf_x1B_aaaa_b: ; 8033FBC push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r3, 0x1B strb r3, [r1] strb r4, [r1, 0x1] strb r2, [r1, 0x2] movs r3, 0xFF lsls r3, 8 ands r3, r2 lsrs r3, 8 strb r3, [r1, 0x3] movs r3, 0xFF lsls r3, 16 ands r3, r2 lsrs r3, 16 strb r3, [r1, 0x4] lsrs r2, 24 strb r2, [r1, 0x5] movs r2, 0x6 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x1B_aaaa_b thumb_func_start dp01_build_cmdbuf_x1C_a dp01_build_cmdbuf_x1C_a: ; 8033FF8 push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x1C strb r2, [r1] strb r3, [r1, 0x1] movs r2, 0x2 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x1C_a thumb_func_start dp01_build_cmdbuf_x1D_1D_numargs_varargs dp01_build_cmdbuf_x1D_1D_numargs_varargs: ; 8034018 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 16 lsrs r4, r1, 16 ldr r1, =0x02022d10 movs r0, 0x1D strb r0, [r1] strb r0, [r1, 0x1] strb r4, [r1, 0x2] lsrs r0, r4, 8 strb r0, [r1, 0x3] adds r5, r1, 0 cmp r4, 0 beq @08034048 adds r1, r5, 0x4 adds r3, r4, 0 @0803403A: ldrb r0, [r2] strb r0, [r1] adds r2, 0x1 adds r1, 0x1 subs r3, 0x1 cmp r3, 0 bne @0803403A @08034048: adds r2, r4, 0x4 lsls r2, 16 lsrs r2, 16 adds r0, r6, 0 adds r1, r5, 0 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x1D_1D_numargs_varargs thumb_func_start sub_8034060 sub_8034060: ; 8034060 push {r4-r6,lr} adds r4, r3, 0 lsls r0, 24 lsrs r6, r0, 24 lsls r2, 16 lsrs r5, r2, 16 ldr r2, =0x02022d10 movs r0, 0x1E strb r0, [r2] strb r1, [r2, 0x1] movs r3, 0xFF lsls r3, 8 adds r0, r1, 0 ands r0, r3 lsrs r0, 8 strb r0, [r2, 0x2] movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r0, 16 strb r0, [r2, 0x3] lsrs r1, 24 strb r1, [r2, 0x4] strb r5, [r2, 0x5] adds r0, r5, 0 ands r0, r3 lsrs r0, 8 strb r0, [r2, 0x6] adds r1, r2, 0 cmp r5, 0 beq @080340B0 adds r3, r1, 0x7 adds r2, r5, 0 @080340A2: ldrb r0, [r4] strb r0, [r3] adds r4, 0x1 adds r3, 0x1 subs r2, 0x1 cmp r2, 0 bne @080340A2 @080340B0: adds r2, r5, 0x7 lsls r2, 16 lsrs r2, 16 adds r0, r6, 0 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8034060 thumb_func_start sub_80340C8 sub_80340C8: ; 80340C8 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 16 lsrs r4, r1, 16 ldr r1, =0x02022d10 movs r0, 0x1F strb r0, [r1] strb r4, [r1, 0x1] lsrs r0, r4, 8 strb r0, [r1, 0x2] adds r5, r1, 0 cmp r4, 0 beq @080340F6 adds r1, r5, 0x3 adds r3, r4, 0 @080340E8: ldrb r0, [r2] strb r0, [r1] adds r2, 0x1 adds r1, 0x1 subs r3, 0x1 cmp r3, 0 bne @080340E8 @080340F6: adds r2, r4, 0x3 lsls r2, 16 lsrs r2, 16 adds r0, r6, 0 adds r1, r5, 0 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80340C8 thumb_func_start sub_8034110 sub_8034110: ; 8034110 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 16 lsrs r4, r1, 16 ldr r1, =0x02022d10 movs r0, 0x20 strb r0, [r1] strb r4, [r1, 0x1] lsrs r0, r4, 8 strb r0, [r1, 0x2] adds r5, r1, 0 cmp r4, 0 beq @0803413E adds r1, r5, 0x3 adds r3, r4, 0 @08034130: ldrb r0, [r2] strb r0, [r1] adds r2, 0x1 adds r1, 0x1 subs r3, 0x1 cmp r3, 0 bne @08034130 @0803413E: adds r2, r4, 0x3 lsls r2, 16 lsrs r2, 16 adds r0, r6, 0 adds r1, r5, 0 bl dp01_prepare_buffer pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8034110 thumb_func_start dp01_build_cmdbuf_x21_a_bb dp01_build_cmdbuf_x21_a_bb: ; 8034158 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 lsls r2, 16 lsrs r2, 16 ldr r1, =0x02022d10 movs r3, 0x21 strb r3, [r1] strb r4, [r1, 0x1] strb r2, [r1, 0x2] lsrs r2, 8 strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x21_a_bb thumb_func_start dp01_build_cmdbuf_x22_a_three_bytes dp01_build_cmdbuf_x22_a_three_bytes: ; 8034184 push {r4,r5,lr} adds r4, r2, 0 lsls r0, 24 lsrs r5, r0, 24 ldr r2, =0x02022d10 movs r0, 0x22 strb r0, [r2] strb r1, [r2, 0x1] movs r3, 0 adds r1, r2, 0x2 @08034198: adds r0, r4, r3 ldrb r0, [r0] strb r0, [r1] adds r1, 0x1 adds r3, 0x1 cmp r3, 0x2 ble @08034198 adds r0, r5, 0 adds r1, r2, 0 movs r2, 0x5 bl dp01_prepare_buffer pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x22_a_three_bytes thumb_func_start dp01_build_cmdbuf_x23_aa_0 dp01_build_cmdbuf_x23_aa_0: ; 80341BC push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r1, 16 ldr r3, =0x02022d10 movs r4, 0 movs r2, 0x23 strb r2, [r3] strb r1, [r3, 0x1] lsrs r1, 8 strb r1, [r3, 0x2] strb r4, [r3, 0x3] adds r1, r3, 0 movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x23_aa_0 thumb_func_start dp01_build_cmdbuf_x24_aa_0 dp01_build_cmdbuf_x24_aa_0: ; 80341E8 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r1, 16 ldr r3, =0x02022d10 movs r4, 0 movs r2, 0x24 strb r2, [r3] strb r1, [r3, 0x1] lsrs r1, 8 strb r1, [r3, 0x2] strb r4, [r3, 0x3] adds r1, r3, 0 movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x24_aa_0 thumb_func_start dp01_build_cmdbuf_x25_25_25_25 dp01_build_cmdbuf_x25_25_25_25: ; 8034214 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x25 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x25_25_25_25 thumb_func_start dp01_build_cmdbuf_x26_a dp01_build_cmdbuf_x26_a: ; 8034234 push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x26 strb r2, [r1] strb r3, [r1, 0x1] movs r2, 0x2 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x26_a thumb_func_start dp01_build_cmdbuf_x27_27_27_27 dp01_build_cmdbuf_x27_27_27_27: ; 8034254 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x27 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x27_27_27_27 thumb_func_start dp01_build_cmdbuf_x28_28_28_28 dp01_build_cmdbuf_x28_28_28_28: ; 8034274 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x28 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x28_28_28_28 thumb_func_start dp01_build_cmdbuf_x29_29_29_29 dp01_build_cmdbuf_x29_29_29_29: ; 8034294 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x29 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x29_29_29_29 thumb_func_start dp01_build_cmdbuf_x2A_2A_2A_2A dp01_build_cmdbuf_x2A_2A_2A_2A: ; 80342B4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x2A strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x2A_2A_2A_2A thumb_func_start dp01_build_cmdbuf_x2B_aa_0 dp01_build_cmdbuf_x2B_aa_0: ; 80342D4 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r1, 16 ldr r3, =0x02022d10 movs r4, 0 movs r2, 0x2B strb r2, [r3] strb r1, [r3, 0x1] lsrs r1, 8 strb r1, [r3, 0x2] strb r4, [r3, 0x3] adds r1, r3, 0 movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x2B_aa_0 thumb_func_start sub_8034300 sub_8034300: ; 8034300 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r1, 16 ldr r4, =0x02022d10 movs r3, 0x2C strb r3, [r4] strb r1, [r4, 0x1] lsrs r1, 8 strb r1, [r4, 0x2] strb r2, [r4, 0x3] adds r1, r4, 0 movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8034300 thumb_func_start dp01_build_cmdbuf_x2D_2D_2D_2D dp01_build_cmdbuf_x2D_2D_2D_2D: ; 803432C push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x2D strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x2D_2D_2D_2D thumb_func_start dp01_build_cmdbuf_x2E_a dp01_build_cmdbuf_x2E_a: ; 803434C push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x2E strb r2, [r1] strb r3, [r1, 0x1] movs r2, 0x2 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x2E_a thumb_func_start dp01_build_cmdbuf_x2F_2F_2F_2F dp01_build_cmdbuf_x2F_2F_2F_2F: ; 803436C push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x2F strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x2F_2F_2F_2F thumb_func_start dp01_build_cmdbuf_x30_TODO dp01_build_cmdbuf_x30_TODO: ; 803438C push {r4,r5,lr} adds r4, r1, 0 lsls r0, 24 lsrs r5, r0, 24 lsls r2, 24 lsrs r2, 24 ldr r1, =0x02022d10 movs r3, 0x30 strb r3, [r1] movs r0, 0x7F ands r0, r2 strb r0, [r1, 0x1] movs r0, 0x80 ands r0, r2 lsls r0, 24 lsrs r0, 31 strb r0, [r1, 0x2] strb r3, [r1, 0x3] movs r2, 0 adds r3, r1, 0x4 @080343B4: adds r0, r4, r2 ldrb r0, [r0] strb r0, [r3] adds r3, 0x1 adds r2, 0x1 cmp r2, 0x2F ble @080343B4 adds r0, r5, 0 movs r2, 0x34 bl dp01_prepare_buffer pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x30_TODO thumb_func_start dp01_build_cmdbuf_x31_31_31_31 dp01_build_cmdbuf_x31_31_31_31: ; 80343D4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x31 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x31_31_31_31 thumb_func_start dp01_build_cmdbuf_x32_32_32_32 dp01_build_cmdbuf_x32_32_32_32: ; 80343F4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x32 strb r2, [r1] strb r2, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x32_32_32_32 thumb_func_start dp01_build_cmdbuf_x33_a_33_33 dp01_build_cmdbuf_x33_a_33_33: ; 8034414 push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x33 strb r2, [r1] strb r3, [r1, 0x1] strb r2, [r1, 0x2] strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x33_a_33_33 thumb_func_start dp01_build_cmdbuf_x34_a_bb_aka_battle_anim dp01_build_cmdbuf_x34_a_bb_aka_battle_anim: ; 8034438 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 lsls r2, 16 lsrs r2, 16 ldr r1, =0x02022d10 movs r3, 0x34 strb r3, [r1] strb r4, [r1, 0x1] strb r2, [r1, 0x2] lsrs r2, 8 strb r2, [r1, 0x3] movs r2, 0x4 bl dp01_prepare_buffer pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x34_a_bb_aka_battle_anim thumb_func_start sub_8034464 sub_8034464: ; 8034464 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r2, 24 lsrs r2, 24 ldr r4, =0x02022d10 movs r0, 0x35 strb r0, [r4] strb r1, [r4, 0x1] cmp r2, 0 beq @0803448C adds r0, r4, 0x4 bl sub_81850DC strb r0, [r4, 0x2] strb r0, [r4, 0x3] b @08034490 .align 2, 0 .pool @0803448C: strb r2, [r4, 0x2] strb r2, [r4, 0x3] @08034490: ldr r1, =0x02022d10 ldrb r2, [r1, 0x2] adds r2, 0x4 adds r0, r5, 0 bl dp01_prepare_buffer pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8034464 thumb_func_start dp01_build_cmdbuf_x38_a dp01_build_cmdbuf_x38_a: ; 80344A8 push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02022d10 movs r2, 0x36 strb r2, [r1] strb r3, [r1, 0x1] movs r2, 0x2 bl dp01_prepare_buffer pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x38_a thumb_func_start dp01_build_cmdbuf_x37_a dp01_build_cmdbuf_x37_a: ; 80344C8 push {r4,r5,lr} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r4, =0x02022d10 movs r0, 0x37 strb r0, [r4] strb r1, [r4, 0x1] ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r0, [r1] lsls r0, 28 lsrs r0, 31 strb r0, [r4, 0x2] ldrb r0, [r1] lsls r0, 28 lsrs r0, 31 strb r0, [r4, 0x3] adds r0, r4, 0x6 bl sub_81850DC strb r0, [r4, 0x4] strb r0, [r4, 0x5] ldrb r2, [r4, 0x4] adds r2, 0x6 adds r0, r5, 0 adds r1, r4, 0 bl dp01_prepare_buffer pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_build_cmdbuf_x37_a thumb_func_start call_LZZUnCompWram ; void call_LZZUnCompWram(void *src, void *dest) call_LZZUnCompWram: ; 8034518 push {lr} bl LZ77UnCompWram pop {r0} bx r0 thumb_func_end call_LZZUnCompWram thumb_func_start call_LZZUnCompVram ; void call_LZZUnCompVram(void *src, void *dest) 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 ; u16 gpu_tile_obj_decompress_and_load(struct rom_obj_tile_data *x) gpu_tile_obj_decompress_and_load: ; 8034530 push {r4,r5,lr} sub sp, 0x8 adds r4, r0, 0 ldr r0, [r4] ldr r5, =0x0201c000 adds r1, r5, 0 bl LZ77UnCompWram str r5, [sp] ldrh r1, [r4, 0x6] lsls r1, 16 ldrh r0, [r4, 0x4] orrs r0, r1 str r0, [sp, 0x4] mov r0, sp bl 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 .pool thumb_func_end gpu_tile_obj_decompress_and_load thumb_func_start gpu_tile_obj_decompress_and_load2 ; void gpu_tile_obj_decompress_and_load2(struct rom_obj_tile_data *x, void *dest) 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 ; void gpu_pal_obj_decompress_and_apply(struct rom_obj_pal_data *x) gpu_pal_obj_decompress_and_apply: ; 803458C push {r4,r5,lr} sub sp, 0x8 adds r5, r0, 0 ldr r0, [r5] ldr r4, =0x0201c000 adds r1, r4, 0 bl LZ77UnCompWram str r4, [sp] ldrh r2, [r5, 0x4] ldr r1, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r1 orrs r0, r2 str r0, [sp, 0x4] mov r0, sp bl gpu_pal_obj_alloc_tag_and_apply add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end gpu_pal_obj_decompress_and_apply thumb_func_start gpu_pal_obj_decompress_and_apply2 ; void gpu_pal_obj_decompress_and_apply2(struct rom_obj_pal_data *x, void *dest) 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, =0xffff0000 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 .pool thumb_func_end gpu_pal_obj_decompress_and_apply2 thumb_func_start sub_80345F0 ; void sub_80345F0(void **a1, void *a2, int species_num) 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, =gMonFrontPicTable ldr r0, [r0] bl LZ77UnCompWram b @08034618 .align 2, 0 .pool @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 ; void sub_8034628(int *a1, void *a2, int species_num, int a4) sub_8034628: ; 8034628 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 lsls r0, r2, 3 ldr r1, =gMonFrontPicTable adds r0, r1 movs r1, 0 cmp r4, r0 bne @0803463E movs r1, 0x1 @0803463E: str r1, [sp] adds r0, r4, 0 adds r1, r5, 0 bl load_poke_gfx_probably add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8034628 thumb_func_start sub_8034654 ; void sub_8034654(void **a1, void *a2, int species_num, unsigned int a4, u8 a5) 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, =gMonBackPicTable lsls r1, 3 adds r1, r0 ldr r0, [r1] b @080346DC .align 2, 0 .pool @080346C0: ldr r0, =gMonFrontPicTable lsls r1, 3 adds r1, r0 ldr r0, [r1] b @080346DC .align 2, 0 .pool @080346D0: movs r0, 0xCE lsls r0, 1 cmp r7, r0 ble @080346E8 ldr r0, =gMonFrontPicTable ldr r0, [r0] @080346DC: adds r1, r4, 0 bl LZ77UnCompWram b @080346F0 .align 2, 0 .pool @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 DrawSpindaSpots 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, =0x00000103 adds r1, r3, r0 ldrb r0, [r2, 0x11] strb r0, [r1] movs r0, 0x90 lsls r0, 1 adds r1, r3, r0 ldrb r0, [r2, 0x12] strb r0, [r1] ldr r0, =0x00000121 adds r1, r3, r0 ldrb r0, [r2, 0x13] strb r0, [r1] movs r1, 0x4 add r12, r1 adds r2, 0x4 adds r3, 0x4 subs r6, 0x1 cmp r6, 0 bge @08034840 str r4, [sp, 0x4] adds r5, r7, 0 mov r3, r10 cmp r3, r9 blt @08034828 @0803488E: mov r2, r9 cmp r2, 0x7 bne @080348A0 adds r5, 0x20 b @080348A8 .align 2, 0 .pool @080348A0: mov r4, r9 cmp r4, 0x5 bne @080348A8 adds r5, 0x60 @080348A8: mov r7, r8 cmp r7, r9 blt @0803481E @080348AE: mov r0, r9 cmp r0, 0x7 bne @080348BC movs r1, 0x80 lsls r1, 1 adds r5, r1 b @080348C8 @080348BC: mov r2, r9 cmp r2, 0x5 bne @080348C8 movs r4, 0xF0 lsls r4, 1 adds r5, r4 @080348C8: ldr r0, [sp, 0x14] ldr r1, [sp] cmp r0, r1 bge @080348D2 b @08034756 @080348D2: b @08034964 @080348D4: movs r6, 0 ldr r2, [sp] cmp r6, r2 bge @08034964 @080348DC: adds r6, 0x1 mov r10, r6 mov r4, r9 cmp r4, 0x6 bne @080348F4 movs r0, 0 movs r3, 0xFF @080348EA: strb r0, [r5] adds r5, 0x1 subs r3, 0x1 cmp r3, 0 bge @080348EA @080348F4: movs r7, 0 cmp r7, r9 bge @08034948 @080348FA: adds r7, 0x1 mov r8, r7 mov r1, r9 lsls r0, r1, 5 cmp r1, 0x6 bne @08034914 movs r1, 0 movs r3, 0x1F @0803490A: strb r1, [r5] adds r5, 0x1 subs r3, 0x1 cmp r3, 0 bge @0803490A @08034914: adds r1, r0, 0 cmp r1, 0 ble @0803492E adds r3, r1, 0 @0803491C: ldr r2, [sp, 0x4] ldrb r0, [r2] strb r0, [r5] adds r2, 0x1 str r2, [sp, 0x4] adds r5, 0x1 subs r3, 0x1 cmp r3, 0 bne @0803491C @0803492E: mov r4, r9 cmp r4, 0x6 bne @08034942 movs r0, 0 movs r3, 0x1F @08034938: strb r0, [r5] adds r5, 0x1 subs r3, 0x1 cmp r3, 0 bge @08034938 @08034942: mov r7, r8 cmp r7, r9 blt @080348FA @08034948: mov r0, r9 cmp r0, 0x6 bne @0803495C movs r0, 0 movs r3, 0xFF @08034952: strb r0, [r5] adds r5, 0x1 subs r3, 0x1 cmp r3, 0 bge @08034952 @0803495C: mov r6, r10 ldr r1, [sp] cmp r6, r1 blt @080348DC @08034964: add sp, 0x24 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_803471C thumb_func_start sub_8034974 sub_8034974: ; 8034974 adds r2, r0, 0 ldrb r0, [r2, 0x3] lsls r0, 16 ldrb r1, [r2, 0x2] lsls r1, 8 orrs r0, r1 ldrb r1, [r2, 0x1] orrs r0, r1 bx lr thumb_func_end sub_8034974 thumb_func_start gpu_tile_obj_decompress_and_load3 ; u16 gpu_tile_obj_decompress_and_load3(struct rom_obj_tile_data *x) 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 ; int gpu_pal_obj_decompress_and_apply3(struct rom_obj_pal_data *x) 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, =0xffff0000 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 .pool thumb_func_end gpu_pal_obj_decompress_and_apply3 thumb_func_start LZ77UnCompAnyRam ; void LZ77UnCompAnyRam(void **a1, void *a2, int species_num) 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, =gMonFrontPicTable ldr r0, [r0] bl LZ77UnCompWram b @08034A30 .align 2, 0 .pool @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 ; void load_poke_gfx_probably(void **src, u8 *pixels, u32 species, u32 personality, u8 isFrontPic) 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, =gMonBackPicTable lsls r1, 3 adds r1, r0 ldr r0, [r1] b @08034AC8 .align 2, 0 .pool @08034AAC: ldr r0, =gMonFrontPicTable lsls r1, 3 adds r1, r0 ldr r0, [r1] b @08034AC8 .align 2, 0 .pool @08034ABC: movs r0, 0xCE lsls r0, 1 cmp r7, r0 ble @08034AD4 ldr r0, =gMonFrontPicTable ldr r0, [r0] @08034AC8: adds r1, r4, 0 bl LZ77UnCompWram b @08034ADC .align 2, 0 .pool @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 DrawSpindaSpots 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 ; void help_system_enable_unless_flashback__sp199(int *a1, void *a2, int species_num, int a4) 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, =gMonFrontPicTable adds r0, r1 movs r1, 0 cmp r4, r0 bne @08034B12 movs r1, 0x1 @08034B12: str r1, [sp] adds r0, r4, 0 adds r1, r5, 0 bl load_poke_gfx_probably add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end help_system_enable_unless_flashback__sp199 thumb_func_start sub_8034B28 ; void sub_8034B28(void **a1, void *a2, int species_num) sub_8034B28: ; 8034B28 push {lr} adds r3, r0, 0 movs r0, 0xCE lsls r0, 1 cmp r2, r0 ble @08034B44 ldr r0, =gMonFrontPicTable ldr r0, [r0] bl LZ77UnCompWram b @08034B4A .align 2, 0 .pool @08034B44: ldr r0, [r3] bl LZ77UnCompWram @08034B4A: pop {r0} bx r0 thumb_func_end sub_8034B28 thumb_func_start sub_8034B50 ; void sub_8034B50(int a1, int a2) sub_8034B50: ; 8034B50 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 lsls r0, r2, 3 ldr r1, =gMonFrontPicTable adds r0, r1 movs r1, 0 cmp r4, r0 bne @08034B66 movs r1, 0x1 @08034B66: str r1, [sp] adds r0, r4, 0 adds r1, r5, 0 bl sub_8034B7C add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8034B50 thumb_func_start sub_8034B7C ; void sub_8034B7C(void **a1, void *a2, int species_num, int a4, u8 a5) 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, =gMonBackPicTable lsls r1, 3 adds r1, r0 ldr r0, [r1] b @08034C04 .align 2, 0 .pool @08034BE8: ldr r0, =gMonFrontPicTable lsls r1, 3 adds r1, r0 ldr r0, [r1] b @08034C04 .align 2, 0 .pool @08034BF8: movs r0, 0xCE lsls r0, 1 cmp r7, r0 ble @08034C10 ldr r0, =gMonFrontPicTable ldr r0, [r0] @08034C04: adds r1, r5, 0 bl LZ77UnCompWram b @08034C18 .align 2, 0 .pool @08034C10: ldr r0, [r6] adds r1, r5, 0 bl LZ77UnCompWram @08034C18: lsls r0, r7, 16 lsrs r0, 16 adds r1, r4, 0 adds r2, r5, 0 mov r3, r8 bl DrawSpindaSpots pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8034B7C thumb_func_start duplicate_deoxys_graphics_data ; void duplicate_deoxys_graphics_data(int a1, int species_num) 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, =0x04000200 adds r1, r3, 0 bl CpuSet @08034C4A: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e10 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 .pool @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, =0x02022e10 ldr r1, [r2] cmp r1, 0 beq @08034D08 ldr r0, [r1, 0x4] cmp r0, 0 beq @08034CFC movs r4, 0 ldr r0, [r1] cmp r4, r0 bcs @08034CF2 adds r5, r2, 0 @08034CE2: adds r0, r4, 0 bl sub_80353DC adds r4, 0x1 ldr r0, [r5] ldr r0, [r0] cmp r4, r0 bcc @08034CE2 @08034CF2: ldr r0, =0x02022e10 ldr r0, [r0] ldr r0, [r0, 0x4] bl free @08034CFC: ldr r4, =0x02022e10 ldr r0, [r4] bl free movs r0, 0 str r0, [r4] @08034D08: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8034CC8 thumb_func_start sub_8034D14 sub_8034D14: ; 8034D14 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 mov r8, r0 mov r10, r1 adds r5, r2, 0 ldr r6, =0x02022e10 ldr r0, [r6] cmp r0, 0 beq @08034DD4 ldr r1, [r0, 0x4] mov r0, r8 lsls r2, r0, 3 subs r0, r2, r0 lsls r4, r0, 2 adds r1, r4, r1 ldrb r0, [r1] mov r9, r2 cmp r0, 0 bne @08034DD4 ldrb r0, [r5, 0x1] bl sub_8035518 ldr r1, [r6] ldr r1, [r1, 0x4] adds r1, r4, r1 strb r0, [r1, 0x1] ldr r0, [r6] ldr r0, [r0, 0x4] adds r0, r4, r0 ldrb r0, [r0, 0x1] cmp r0, 0xFF beq @08034DD4 ldr r0, [r5, 0x8] ldrh r0, [r0, 0x6] bl 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, =0xffff0000 lsrs r0, r7, 16 cmp r1, r0 bne @08034DE0 ldr r2, [r5, 0x8] ldrh r0, [r2, 0x4] adds r1, r2, 0 cmp r0, 0 beq @08034D94 adds r0, r1, 0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram b @08034DB4 .align 2, 0 .pool @08034D94: ldr r0, [r2] ldr r1, [r2, 0x4] str r0, [sp] str r1, [sp, 0x4] ldr r0, [r2] bl sub_8034974 lsls r0, 16 lsrs r0, 16 ldr r1, [sp, 0x4] ands r1, r7 orrs r1, r0 str r1, [sp, 0x4] mov r0, sp bl gpu_tile_obj_decompress_and_load @08034DB4: ldr r1, [r6] ldr r1, [r1, 0x4] adds r1, r4, r1 strh r0, [r1, 0xA] ldr r0, =0x02022e10 ldr r0, [r0] ldr r1, [r0, 0x4] mov r2, r9 mov r3, r8 subs r0, r2, r3 lsls r0, 2 adds r0, r1 ldrh r1, [r0, 0xA] ldr r0, =0x0000ffff cmp r1, r0 bne @08034DE0 @08034DD4: movs r0, 0 b @08034EE8 .align 2, 0 .pool @08034DE0: ldr r0, [r5, 0xC] ldrh r0, [r0, 0x4] bl gpu_pal_tags_index_of ldr r6, =0x02022e10 ldr r1, [r6] ldr r1, [r1, 0x4] mov r4, r9 mov r3, r8 subs r2, r4, r3 lsls r4, r2, 2 adds r1, r4, r1 strb r0, [r1, 0x4] ldr r0, [r6] ldr r0, [r0, 0x4] adds r0, r4, r0 ldrb r0, [r0, 0x4] cmp r0, 0xFF bne @08034E14 ldr r0, [r5, 0xC] bl 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, =0x02022e10 ldr r0, [r0] mov r3, r9 mov r4, r8 subs r1, r3, r4 lsls r1, 2 ldr r0, [r0, 0x4] adds r0, r1 bl sub_8034EFC mov r0, r8 mov r1, r10 bl sub_8035044 movs r0, 0x1 @08034EE8: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8034D14 thumb_func_start sub_8034EFC sub_8034EFC: ; 8034EFC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 adds r4, r0, 0 ldrb r5, [r4, 0x1] movs r0, 0xC ldrsh r7, [r4, r0] ldrb r0, [r4, 0x3] adds r0, 0x1 mov r8, r0 mov r1, sp movs r0, 0 strh r0, [r1] lsls r1, r5, 3 ldr r2, =0x030022f8 mov r9, r2 add r1, r9 mov r0, r8 lsls r2, r0, 2 movs r0, 0x80 lsls r0, 17 orrs r2, r0 mov r0, sp bl CpuSet movs r6, 0 ldrb r5, [r4, 0x1] cmp r6, r8 bcs @08034FCE movs r1, 0x3F mov r10, r1 movs r2, 0xD negs r2, r2 mov r9, r2 @08034F46: lsls r0, r5, 3 ldr r1, =0x030022c0 adds r3, r0, r1 ldrh r1, [r4, 0xE] adds r0, r3, 0 adds r0, 0x38 strb r1, [r0] ldr r2, =0x000001ff adds r0, r2, 0 adds r1, r7, 0 ands r1, r0 ldrh r2, [r3, 0x3A] ldr r0, =0xfffffe00 ands r0, r2 orrs r0, r1 strh r0, [r3, 0x3A] ldrb r1, [r4, 0x6] movs r0, 0x39 adds r0, r3 mov r12, r0 lsls r1, 6 ldrb r2, [r0] mov r0, r10 ands r0, r2 orrs r0, r1 mov r1, r12 strb r0, [r1] ldrb r1, [r4, 0x5] movs r2, 0x3B adds r2, r3 mov r12, r2 lsls r1, 6 ldrb r2, [r2] mov r0, r10 ands r0, r2 orrs r0, r1 mov r1, r12 strb r0, [r1] ldrh r0, [r4, 0xA] ldr r1, =0x000003ff ands r1, r0 ldrh r2, [r3, 0x3C] ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r3, 0x3C] adds r3, 0x3D movs r0, 0x3 ldrb r1, [r4, 0x7] ands r1, r0 lsls r1, 2 ldrb r2, [r3] mov r0, r9 ands r0, r2 orrs r0, r1 strb r0, [r3] ldrb r2, [r4, 0x4] lsls r2, 4 movs r1, 0xF ands r0, r1 orrs r0, r2 strb r0, [r3] ldrb r0, [r4, 0x8] adds r7, r0 adds r6, 0x1 adds r5, 0x1 cmp r6, r8 bcc @08034F46 @08034FCE: subs r5, 0x1 ldr r0, =0x030022c0 lsls r3, r5, 3 adds r3, r0 movs r2, 0xC ldrsh r1, [r4, r2] ldrb r0, [r4, 0x8] subs r1, r0 ldr r2, =0x000001ff adds r0, r2, 0 ands r1, r0 ldrh r2, [r3, 0x3A] ldr r0, =0xfffffe00 ands r0, r2 orrs r0, r1 strh r0, [r3, 0x3A] adds r2, r3, 0 adds r2, 0x39 ldrb r1, [r2] movs r0, 0x4 negs r0, r0 ands r0, r1 movs r1, 0x2 orrs r0, r1 strb r0, [r2] ldrb r0, [r4, 0x9] lsls r1, r0, 2 adds r1, r0 lsls r1, 1 ldrh r4, [r4, 0xA] adds r1, r4 ldr r2, =0x000003ff adds r0, r2, 0 ands r1, r0 ldrh r2, [r3, 0x3C] ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r3, 0x3C] add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8034EFC thumb_func_start sub_8035044 sub_8035044: ; 8035044 push {r4-r6,lr} adds r3, r0, 0 adds r4, r1, 0 ldr r0, =0x02022e10 ldr r1, [r0] adds r6, r0, 0 cmp r1, 0 beq @080350A8 ldr r2, [r1, 0x4] lsls r1, r3, 3 subs r0, r1, r3 lsls r0, 2 adds r2, r0, r2 ldrb r0, [r2] adds r5, r1, 0 cmp r0, 0 beq @080350A8 str r4, [r2, 0x18] cmp r4, 0 bge @08035078 movs r2, 0x1 negs r4, r4 b @0803507A .align 2, 0 .pool @08035078: movs r2, 0 @0803507A: ldr r0, [r6] ldr r1, [r0, 0x4] subs r0, r5, r3 lsls r0, 2 adds r0, r1 ldrb r3, [r0, 0x2] cmp r3, 0x1 beq @0803509A cmp r3, 0x1 ble @08035092 cmp r3, 0x2 beq @080350A2 @08035092: adds r1, r4, 0 bl sub_80350B0 b @080350A8 @0803509A: adds r1, r4, 0 bl sub_8035164 b @080350A8 @080350A2: adds r1, r4, 0 bl sub_80352C0 @080350A8: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8035044 thumb_func_start sub_80350B0 sub_80350B0: ; 80350B0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 mov r8, r0 mov r9, r1 str r2, [sp] ldr r5, [r0, 0x14] ldrb r7, [r0, 0x1] ldr r0, =0x030022c0 mov r10, r0 cmp r5, 0 beq @0803511A lsls r0, r7, 3 adds r0, 0x3C mov r1, r10 adds r6, r0, r1 @080350D6: mov r0, r9 adds r1, r5, 0 bl __udivsi3 adds r4, r0, 0 adds r0, r4, 0 muls r0, r5 mov r2, r9 subs r2, r0 mov r9, r2 adds r0, r5, 0 movs r1, 0xA bl __udivsi3 adds r5, r0, 0 mov r1, r8 ldrb r0, [r1, 0x9] adds r1, r4, 0 muls r1, r0 mov r2, r8 ldrh r2, [r2, 0xA] adds r1, r2 ldr r2, =0x000003ff adds r0, r2, 0 ands r1, r0 ldrh r0, [r6] ldr r2, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r6] adds r6, 0x8 adds r7, 0x1 cmp r5, 0 bne @080350D6 @0803511A: ldr r0, [sp] cmp r0, 0 beq @08035140 lsls r0, r7, 3 add r0, r10 adds r0, 0x39 ldrb r2, [r0] movs r1, 0x4 negs r1, r1 ands r1, r2 strb r1, [r0] b @08035154 .align 2, 0 .pool @08035140: lsls r2, r7, 3 add r2, r10 adds r2, 0x39 ldrb r1, [r2] movs r0, 0x4 negs r0, r0 ands r0, r1 movs r1, 0x2 orrs r0, r1 strb r0, [r2] @08035154: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80350B0 thumb_func_start sub_8035164 sub_8035164: ; 8035164 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 adds r6, r0, 0 mov r8, r1 str r2, [sp] ldr r5, [r6, 0x14] ldr r3, =0x03000dd4 ldrb r0, [r6, 0x1] str r0, [r3] ldr r2, =0x03000dd8 movs r0, 0 str r0, [r2] ldr r1, =0x03000ddc subs r0, 0x1 str r0, [r1] adds r7, r3, 0 mov r10, r1 ldr r0, =0x030022c0 mov r9, r0 cmp r5, 0 beq @0803524C @08035196: mov r0, r8 adds r1, r5, 0 bl __udivsi3 adds r4, r0, 0 adds r0, r4, 0 muls r0, r5 mov r1, r8 subs r1, r0 mov r8, r1 adds r0, r5, 0 movs r1, 0xA bl __udivsi3 adds r5, r0, 0 cmp r4, 0 bne @080351C8 mov r2, r10 ldr r1, [r2] movs r0, 0x1 negs r0, r0 cmp r1, r0 bne @080351C8 cmp r5, 0 bne @08035224 @080351C8: ldr r2, [r7] lsls r2, 3 add r2, r9 ldrb r0, [r6, 0x9] adds r3, r4, 0 muls r3, r0 ldrh r4, [r6, 0xA] adds r3, r4 ldr r1, =0x000003ff adds r0, r1, 0 ands r3, r0 ldrh r0, [r2, 0x3C] ldr r4, =0xfffffc00 adds r1, r4, 0 ands r0, r1 orrs r0, r3 strh r0, [r2, 0x3C] adds r2, 0x39 ldrb r0, [r2] movs r1, 0x4 negs r1, r1 ands r0, r1 strb r0, [r2] mov r2, r10 ldr r1, [r2] movs r0, 0x1 negs r0, r0 cmp r1, r0 bne @0803523A ldr r4, =0x03000dd8 ldr r0, [r4] str r0, [r2] b @0803523A .align 2, 0 .pool @08035224: ldr r0, [r7] lsls r0, 3 add r0, r9 adds r0, 0x39 ldrb r1, [r0] movs r2, 0x4 negs r2, r2 ands r1, r2 movs r2, 0x2 orrs r1, r2 strb r1, [r0] @0803523A: ldr r0, [r7] adds r0, 0x1 str r0, [r7] ldr r4, =0x03000dd8 ldr r0, [r4] adds r0, 0x1 str r0, [r4] cmp r5, 0 bne @08035196 @0803524C: ldr r0, [sp] cmp r0, 0 beq @08035298 ldr r1, [r7] lsls r1, 3 add r1, r9 adds r1, 0x39 ldrb r2, [r1] movs r0, 0x4 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r3, [r7] lsls r3, 3 add r3, r9 movs r1, 0xC ldrsh r2, [r6, r1] mov r4, r10 ldr r0, [r4] subs r0, 0x1 ldrb r1, [r6, 0x8] muls r0, r1 adds r2, r0 ldr r1, =0x000001ff adds r0, r1, 0 ands r2, r0 ldrh r1, [r3, 0x3A] ldr r0, =0xfffffe00 ands r0, r1 orrs r0, r2 strh r0, [r3, 0x3A] b @080352AE .align 2, 0 .pool @08035298: ldr r0, [r7] lsls r0, 3 add r0, r9 adds r0, 0x39 ldrb r2, [r0] movs r1, 0x4 negs r1, r1 ands r1, r2 movs r2, 0x2 orrs r1, r2 strb r1, [r0] @080352AE: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8035164 thumb_func_start sub_80352C0 sub_80352C0: ; 80352C0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC mov r8, r0 mov r10, r1 str r2, [sp] ldr r5, [r0, 0x14] ldrb r3, [r0, 0x1] movs r0, 0 str r0, [sp, 0x4] mov r9, r0 cmp r5, 0 beq @0803535A @080352E0: lsls r0, r3, 3 adds r1, r0, 0 adds r1, 0x39 ldr r2, =0x030022c0 adds r7, r1, r2 adds r0, 0x3C adds r6, r0, r2 @080352EE: mov r0, r10 adds r1, r5, 0 str r3, [sp, 0x8] bl __udivsi3 adds r4, r0, 0 adds r0, r4, 0 muls r0, r5 mov r1, r10 subs r1, r0 mov r10, r1 adds r0, r5, 0 movs r1, 0xA bl __udivsi3 adds r5, r0, 0 ldr r3, [sp, 0x8] cmp r4, 0 bne @0803531E ldr r2, [sp, 0x4] cmp r2, 0 bne @0803531E cmp r5, 0 bne @080352E0 @0803531E: movs r0, 0x1 str r0, [sp, 0x4] mov r1, r8 ldrb r0, [r1, 0x9] adds r2, r4, 0 muls r2, r0 ldrh r4, [r1, 0xA] adds r2, r4 ldr r1, =0x000003ff adds r0, r1, 0 ands r2, r0 ldrh r0, [r6] ldr r4, =0xfffffc00 adds r1, r4, 0 ands r0, r1 orrs r0, r2 strh r0, [r6] ldrb r0, [r7] movs r2, 0x4 negs r2, r2 adds r1, r2, 0 ands r0, r1 strb r0, [r7] adds r7, 0x8 adds r6, 0x8 adds r3, 0x1 movs r4, 0x1 add r9, r4 cmp r5, 0 bne @080352EE @0803535A: mov r0, r8 ldrb r0, [r0, 0x3] cmp r9, r0 bge @0803538A ldr r1, =0x030022c0 movs r5, 0x4 negs r5, r5 movs r4, 0x2 lsls r0, r3, 3 adds r0, 0x39 adds r2, r0, r1 @08035370: ldrb r1, [r2] adds r0, r5, 0 ands r0, r1 orrs r0, r4 strb r0, [r2] adds r2, 0x8 adds r3, 0x1 movs r1, 0x1 add r9, r1 mov r0, r8 ldrb r0, [r0, 0x3] cmp r9, r0 blt @08035370 @0803538A: ldr r1, [sp] cmp r1, 0 beq @080353B0 lsls r0, r3, 3 ldr r2, =0x030022c0 adds r0, r2 adds r0, 0x39 ldrb r2, [r0] movs r1, 0x4 negs r1, r1 ands r1, r2 strb r1, [r0] b @080353C6 .align 2, 0 .pool @080353B0: lsls r2, r3, 3 ldr r4, =0x030022c0 adds r2, r4 adds r2, 0x39 ldrb r1, [r2] movs r0, 0x4 negs r0, r0 ands r0, r1 movs r1, 0x2 orrs r0, r1 strb r0, [r2] @080353C6: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80352C0 thumb_func_start sub_80353DC sub_80353DC: ; 80353DC push {r4-r7,lr} adds r4, r0, 0 ldr r0, =0x02022e10 ldr r0, [r0] cmp r0, 0 beq @0803546E ldr r2, [r0, 0x4] lsls r1, r4, 3 subs r0, r1, r4 lsls r0, 2 adds r2, r0, r2 ldrb r0, [r2] adds r5, r1, 0 cmp r0, 0 beq @0803546E ldrb r3, [r2, 0x3] adds r0, r3, 0x1 ldrb r2, [r2, 0x1] cmp r0, 0 beq @08035426 ldr r1, =0x030022c0 movs r7, 0x4 negs r7, r7 movs r6, 0x2 adds r3, r0, 0 lsls r0, r2, 3 adds r0, 0x39 adds r2, r0, r1 @08035414: ldrb r1, [r2] adds r0, r7, 0 ands r0, r1 orrs r0, r6 strb r0, [r2] subs r3, 0x1 adds r2, 0x8 cmp r3, 0 bne @08035414 @08035426: adds r0, r4, 0 bl sub_8035570 cmp r0, 0 bne @08035442 ldr r0, =0x02022e10 ldr r0, [r0] ldr r1, [r0, 0x4] subs r0, r5, r4 lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x10] bl gpu_tile_obj_free_by_tag @08035442: adds r0, r4, 0 bl sub_80355B4 cmp r0, 0 bne @0803545E ldr r0, =0x02022e10 ldr r0, [r0] ldr r1, [r0, 0x4] subs r0, r5, r4 lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x12] bl gpu_pal_free_tag @0803545E: ldr r0, =0x02022e10 ldr r0, [r0] ldr r1, [r0, 0x4] subs r0, r5, r4 lsls r0, 2 adds r0, r1 movs r1, 0 strb r1, [r0] @0803546E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80353DC thumb_func_start sub_803547C sub_803547C: ; 803547C push {r4-r7,lr} adds r4, r0, 0 adds r5, r1, 0 ldr r0, =0x02022e10 ldr r1, [r0] adds r7, r0, 0 cmp r1, 0 beq @0803550C ldr r2, [r1, 0x4] lsls r1, r4, 3 subs r0, r1, r4 lsls r0, 2 adds r2, r0, r2 ldrb r0, [r2] adds r6, r1, 0 cmp r0, 0 beq @0803550C ldrb r3, [r2, 0x3] adds r1, r3, 0x1 ldrb r0, [r2, 0x1] cmp r5, 0 beq @080354D8 cmp r1, 0 beq @0803550C ldr r1, =0x030022c0 movs r5, 0x4 negs r5, r5 movs r4, 0x2 adds r3, 0x1 lsls r0, 3 adds r0, 0x39 adds r2, r0, r1 @080354BC: ldrb r1, [r2] adds r0, r5, 0 ands r0, r1 orrs r0, r4 strb r0, [r2] subs r3, 0x1 adds r2, 0x8 cmp r3, 0 bne @080354BC b @0803550C .align 2, 0 .pool @080354D8: cmp r1, 0 beq @080354FA ldr r1, =0x030022c0 movs r5, 0x4 negs r5, r5 adds r3, 0x1 lsls r0, 3 adds r0, 0x39 adds r2, r0, r1 @080354EA: ldrb r1, [r2] adds r0, r5, 0 ands r0, r1 strb r0, [r2] subs r3, 0x1 adds r2, 0x8 cmp r3, 0 bne @080354EA @080354FA: ldr r0, [r7] ldr r1, [r0, 0x4] subs r0, r6, r4 lsls r0, 2 adds r0, r1 ldr r1, [r0, 0x18] adds r0, r4, 0 bl sub_8035044 @0803550C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803547C thumb_func_start sub_8035518 sub_8035518: ; 8035518 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 movs r5, 0x40 movs r3, 0 ldr r0, =0x02022e10 ldr r0, [r0] ldr r2, [r0] cmp r3, r2 bcs @0803555A ldr r1, [r0, 0x4] @0803552E: ldrb r0, [r1] cmp r0, 0 bne @08035548 ldrb r0, [r1, 0x1] cmp r0, 0xFF beq @08035552 ldrb r0, [r1, 0x3] cmp r0, r4 bhi @08035552 ldrb r0, [r1, 0x1] b @0803556A .align 2, 0 .pool @08035548: adds r0, r5, 0x1 ldrb r5, [r1, 0x3] adds r0, r5 lsls r0, 16 lsrs r5, r0, 16 @08035552: adds r1, 0x1C adds r3, 0x1 cmp r3, r2 bcc @0803552E @0803555A: adds r0, r5, r4 adds r0, 0x1 cmp r0, 0x80 bgt @08035568 lsls r0, r5, 24 lsrs r0, 24 b @0803556A @08035568: movs r0, 0xFF @0803556A: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8035518 thumb_func_start sub_8035570 sub_8035570: ; 8035570 push {r4-r6,lr} adds r3, r0, 0 movs r2, 0 ldr r0, =0x02022e10 ldr r0, [r0] ldr r4, [r0] cmp r2, r4 bcs @080355AC ldr r1, [r0, 0x4] lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r5, r0, r1 @0803558A: ldrb r0, [r1] cmp r0, 0 beq @080355A4 cmp r2, r3 beq @080355A4 ldrh r0, [r1, 0x10] ldrh r6, [r5, 0x10] cmp r0, r6 bne @080355A4 movs r0, 0x1 b @080355AE .align 2, 0 .pool @080355A4: adds r1, 0x1C adds r2, 0x1 cmp r2, r4 bcc @0803558A @080355AC: movs r0, 0 @080355AE: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8035570 thumb_func_start sub_80355B4 sub_80355B4: ; 80355B4 push {r4-r6,lr} adds r3, r0, 0 movs r2, 0 ldr r0, =0x02022e10 ldr r0, [r0] ldr r4, [r0] cmp r2, r4 bcs @080355F0 ldr r1, [r0, 0x4] lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r5, r0, r1 @080355CE: ldrb r0, [r1] cmp r0, 0 beq @080355E8 cmp r2, r3 beq @080355E8 ldrh r0, [r1, 0x12] ldrh r6, [r5, 0x12] cmp r0, r6 bne @080355E8 movs r0, 0x1 b @080355F2 .align 2, 0 .pool @080355E8: adds r1, 0x1C adds r2, 0x1 cmp r2, r4 bcc @080355CE @080355F0: movs r0, 0 @080355F2: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_80355B4 thumb_func_start sub_80355F8 sub_80355F8: ; 80355F8 ldr r2, =gUnknown_082FF1C8 lsls r0, 2 adds r1, r0 adds r1, r2 ldrb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80355F8 thumb_func_start sub_8035608 sub_8035608: ; 8035608 push {lr} bl reset_all_obj_data ldr r0, =gUnknown_0831AC88 movs r1, 0 movs r2, 0 movs r3, 0 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 adds r1, 0x3E ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] ldr r0, =sub_8035648 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0831AA08 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 11 ands r1, r0 cmp r1, 0 beq @080356A4 ldr r0, =0x02024474 adds r0, 0x24 movs r1, 0x1 strb r1, [r0] ldr r4, =0x02023060 ldr r1, [r4] movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] movs r0, 0x2 bl bg_set_tilemap b @080356AA .align 2, 0 .pool @080356A4: ldr r0, =0x02024474 adds r0, 0x24 strb r1, [r0] @080356AA: ldr r1, =gUnknown_0831ABA0 ldr r0, =0x02024474 adds r0, 0x24 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl Window_InitFromTemplates bl TextBox_ResetSomeField pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end trs_config thumb_func_start c2_berry_program_update_menu c2_berry_program_update_menu: ; 80356D0 push {lr} movs r0, 0x2 bl 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, =0x0000b040 movs r0, 0 bl lcd_io_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_berry_program_update_menu thumb_func_start sub_803570C sub_803570C: ; 803570C push {lr} movs r0, 0x2 movs r1, 0x12 movs r2, 0x10 bl sub_809882C movs r0, 0x2 movs r1, 0x22 movs r2, 0x10 bl sub_809882C ldr r0, =gUnknown_08D85600 movs r1, 0x50 movs r2, 0x20 bl decompress_palette ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @0803575A movs r0, 0x70 bl sub_81978B0 movs r0, 0 movs r1, 0x30 movs r2, 0x70 bl copy_textbox_border_tile_patterns_to_vram ldr r0, =0x02037714 adds r0, 0xEC movs r1, 0 strh r1, [r0] ldr r1, =0x02037c00 movs r2, 0x1 bl CpuSet @0803575A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803570C thumb_func_start sub_8035770 sub_8035770: ; 8035770 push {r4,r5,lr} ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 cmp r0, 0 beq @080357B0 ldr r0, =gUnknown_08D7C440 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7CA28 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7C9EC b @08035A52 .align 2, 0 .pool @080357B0: movs r0, 0x80 lsls r0, 21 ands r0, r1 cmp r0, 0 beq @080357E4 ldr r0, =gUnknown_08D7BB14 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7C154 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7DF30 b @08035A52 .align 2, 0 .pool @080357E4: movs r0, 0x80 lsls r0, 22 ands r0, r1 cmp r0, 0 beq @08035818 ldr r0, =gUnknown_08D7A108 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7A720 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7DEF4 b @08035A52 .align 2, 0 .pool @08035818: movs r0, 0x80 lsls r0, 23 ands r0, r1 cmp r0, 0 beq @0803584C ldr r0, =gUnknown_08D7D590 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7DC04 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7E234 b @08035A52 .align 2, 0 .pool @0803584C: movs r0, 0x8 ands r1, r0 cmp r1, 0 beq @080358C4 ldr r2, =gTrainers ldr r0, =0x02038bca ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0x20 bne @08035898 ldr r0, =gUnknown_08D7C440 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7CA28 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7DFC4 b @08035A52 .align 2, 0 .pool @08035898: cmp r0, 0x26 bne @080358C4 ldr r0, =gUnknown_08D7CCD8 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7D2E0 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7E1F8 b @08035A52 .align 2, 0 .pool @080358C4: bl sav1_map_get_battletype lsls r0, 24 lsrs r0, 24 cmp r0, 0x8 bhi @08035904 lsls r0, 2 ldr r1, =@080358E0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080358E0: .4byte @08035904 .4byte @08035950 .4byte @08035978 .4byte @080359A0 .4byte @080359C8 .4byte @080359F0 .4byte @08035A18 .4byte @08035A40 .4byte @08035A70 @08035904: ldr r4, =gUnknown_0831ABA8 ldr r5, =0x02022ff0 ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r0, [r0] ldr r1, =0x06008000 bl 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, =0x0600d000 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 .pool @08035950: ldr r0, =gUnknown_08D7C440 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7CA28 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7DF88 b @08035A52 .align 2, 0 .pool @08035978: ldr r0, =gUnknown_08D7CCD8 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7D2E0 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7E060 b @08035A52 .align 2, 0 .pool @080359A0: ldr r0, =gUnknown_08D7CCD8 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7D2E0 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7E000 b @08035A52 .align 2, 0 .pool @080359C8: ldr r0, =gUnknown_08D7CCD8 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7D2E0 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7E0CC b @08035A52 .align 2, 0 .pool @080359F0: ldr r0, =gUnknown_08D7CCD8 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7D2E0 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7E11C b @08035A52 .align 2, 0 .pool @08035A18: ldr r0, =gUnknown_08D7CCD8 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7D2E0 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7E164 b @08035A52 .align 2, 0 .pool @08035A40: ldr r0, =gUnknown_08D7CCD8 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7D2E0 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7E1A8 @08035A52: movs r1, 0x20 movs r2, 0x60 bl decompress_palette b @08035A8A .align 2, 0 .pool @08035A70: ldr r0, =gUnknown_08D7C440 ldr r1, =0x06008000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7CA28 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7C9EC movs r1, 0x20 movs r2, 0x60 bl decompress_palette @08035A8A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8035770 thumb_func_start sub_8035AA4 sub_8035AA4: ; 8035AA4 push {lr} ldr r0, =gUnknown_08C00000 movs r1, 0xC0 lsls r1, 19 bl call_LZZUnCompVram ldr r1, =gUnknown_08C00524 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, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x40 bl decompress_palette bl sub_803570C bl sub_8035770 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8035AA4 thumb_func_start sub_8035AE4 sub_8035AE4: ; 8035AE4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x18 ldr r4, [sp, 0x34] lsls r0, 24 lsrs r6, r0, 24 adds r7, r6, 0 lsls r1, 24 lsrs r5, r1, 24 lsls r2, 24 lsrs r2, 24 mov r8, r2 lsls r3, 24 lsrs r3, 24 mov r12, r3 lsls r4, 24 lsrs r4, 24 mov r9, r4 movs r4, 0 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08035BCC ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 movs r2, 0x12 ldrsh r0, [r1, r2] cmp r0, 0 beq @08035B56 cmp r5, 0x1 beq @08035B7E cmp r5, 0x1 bgt @08035B44 cmp r5, 0 beq @08035B4E b @08035B88 .align 2, 0 .pool @08035B44: cmp r5, 0x2 beq @08035B52 cmp r5, 0x3 beq @08035B72 b @08035B88 @08035B4E: ldrh r0, [r1, 0xE] b @08035B74 @08035B52: ldrh r1, [r1, 0xE] b @08035B80 @08035B56: cmp r5, 0x1 beq @08035B72 cmp r5, 0x1 bgt @08035B64 cmp r5, 0 beq @08035B6E b @08035B88 @08035B64: cmp r5, 0x2 beq @08035B7A cmp r5, 0x3 beq @08035B7E b @08035B88 @08035B6E: ldrh r0, [r1, 0xE] b @08035B74 @08035B72: ldrh r0, [r1, 0x10] @08035B74: movs r4, 0x3F ands r4, r0 b @08035B88 @08035B7A: ldrh r1, [r1, 0xE] b @08035B80 @08035B7E: ldrh r1, [r1, 0x10] @08035B80: movs r0, 0xFC lsls r0, 4 ands r0, r1 lsrs r4, r0, 6 @08035B88: movs r2, 0 movs r6, 0x3 ldr r0, =0x00006001 adds r5, r0, 0 add r3, sp, 0xC @08035B92: lsls r1, r2, 1 adds r0, r6, 0 lsls r0, r1 ands r0, r4 asrs r0, r1 adds r0, r5 strh r0, [r3] adds r3, 0x2 adds r2, 0x1 cmp r2, 0x2 ble @08035B92 movs r0, 0x3 str r0, [sp] movs r0, 0x1 str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] mov r0, r8 add r1, sp, 0xC mov r2, r12 mov r3, r9 bl bg_copy_tilemap_rect_simple mov r0, r8 bl gpu_copy_wram_bg_tilemap_to_vram b @08035C36 .align 2, 0 .pool @08035BCC: ldr r0, =0x02024474 adds r0, 0x25 ldrb r0, [r0] cmp r5, r0 bne @08035BEC ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldrh r4, [r0, 0xE] b @08035BF8 .align 2, 0 .pool @08035BEC: ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldrh r4, [r0, 0x10] @08035BF8: movs r2, 0 movs r6, 0x3 ldr r0, =0x00006001 adds r5, r0, 0 add r3, sp, 0xC @08035C02: lsls r1, r2, 1 adds r0, r6, 0 lsls r0, r1 ands r0, r4 asrs r0, r1 adds r0, r5 strh r0, [r3] adds r3, 0x2 adds r2, 0x1 cmp r2, 0x5 ble @08035C02 movs r0, 0x6 str r0, [sp] movs r0, 0x1 str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] mov r0, r8 add r1, sp, 0xC mov r2, r12 mov r3, r9 bl 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 .pool thumb_func_end sub_8035AE4 thumb_func_start sub_8035C4C sub_8035C4C: ; 8035C4C push {lr} ldr r0, =0x0202433a ldrb r2, [r0] cmp r2, 0x3 bne @08035C68 ldr r0, =gUnknown_085CCBAD movs r1, 0x15 bl battle_show_message_maybe b @08035D68 .align 2, 0 .pool @08035C68: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08035CE2 cmp r2, 0x1 bne @08035CAE ldr r2, =0x020229e8 ldr r0, =0x02024474 adds r0, 0x25 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrh r0, [r0, 0x18] cmp r0, 0x1 beq @08035CFC cmp r0, 0x1 bgt @08035CA4 cmp r0, 0 beq @08035D36 b @08035D68 .align 2, 0 .pool @08035CA4: cmp r0, 0x2 beq @08035D36 cmp r0, 0x3 bne @08035D68 b @08035CFC @08035CAE: ldr r2, =0x020229e8 ldr r0, =0x02024474 adds r0, 0x25 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrh r0, [r0, 0x18] cmp r0, 0x1 beq @08035D36 cmp r0, 0x1 bgt @08035CD8 cmp r0, 0 beq @08035CFC b @08035D68 .align 2, 0 .pool @08035CD8: cmp r0, 0x2 beq @08035CFC cmp r0, 0x3 bne @08035D68 b @08035D36 @08035CE2: cmp r2, 0x1 bne @08035D20 ldr r2, =0x020229e8 ldr r0, =0x02024474 adds r0, 0x25 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrh r0, [r0, 0x18] cmp r0, 0 beq @08035D36 @08035CFC: ldr r0, =gUnknown_085CCB9E movs r1, 0x17 bl battle_show_message_maybe ldr r0, =gUnknown_085CCBA5 movs r1, 0x16 bl battle_show_message_maybe b @08035D68 .align 2, 0 .pool @08035D20: ldr r2, =0x020229e8 ldr r0, =0x02024474 adds r0, 0x25 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrh r0, [r0, 0x18] cmp r0, 0 beq @08035D58 @08035D36: ldr r0, =gUnknown_085CCB9E movs r1, 0x16 bl battle_show_message_maybe ldr r0, =gUnknown_085CCBA5 movs r1, 0x17 bl battle_show_message_maybe b @08035D68 .align 2, 0 .pool @08035D58: ldr r0, =gUnknown_085CCB9E movs r1, 0x17 bl battle_show_message_maybe ldr r0, =gUnknown_085CCBA5 movs r1, 0x16 bl battle_show_message_maybe @08035D68: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8035C4C thumb_func_start task00_0800F6FC task00_0800F6FC: ; 8035D74 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 lsls r0, 24 lsrs r7, r0, 24 ldr r1, =0x03005e00 lsls r0, r7, 2 mov r8, r0 adds r0, r7 lsls r0, 3 adds r5, r0, r1 movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0x1 bne @08035D96 b @08035EC4 @08035D96: cmp r0, 0x1 bgt @08035DA4 cmp r0, 0 beq @08035DAC b @08036138 .align 2, 0 .pool @08035DA4: cmp r0, 0x2 bne @08035DAA b @08035F64 @08035DAA: b @08036138 @08035DAC: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08035E44 movs r5, 0 movs r6, 0x3 @08035DBC: ldr r0, =0x020229f0 adds r1, r5, r0 subs r0, 0x8 adds r4, r5, r0 ldrh r0, [r4, 0x18] cmp r0, 0x1 beq @08035DF4 cmp r0, 0x1 bgt @08035DDC cmp r0, 0 beq @08035DE6 b @08035E3A .align 2, 0 .pool @08035DDC: cmp r0, 0x2 beq @08035E08 cmp r0, 0x3 beq @08035E22 b @08035E3A @08035DE6: adds r0, r1, 0 movs r1, 0x11 bl battle_show_message_maybe ldrb r1, [r4, 0x18] movs r0, 0x4 b @08035E14 @08035DF4: adds r0, r1, 0 movs r1, 0x12 bl battle_show_message_maybe ldrb r1, [r4, 0x18] movs r0, 0x4 str r0, [sp] adds r0, r7, 0 movs r2, 0x2 b @08035E1A @08035E08: adds r0, r1, 0 movs r1, 0x13 bl battle_show_message_maybe ldrb r1, [r4, 0x18] movs r0, 0x8 @08035E14: str r0, [sp] adds r0, r7, 0 movs r2, 0x1 @08035E1A: movs r3, 0x2 bl sub_8035AE4 b @08035E3A @08035E22: adds r0, r1, 0 movs r1, 0x14 bl battle_show_message_maybe ldrb r1, [r4, 0x18] movs r0, 0x8 str r0, [sp] adds r0, r7, 0 movs r2, 0x2 movs r3, 0x2 bl sub_8035AE4 @08035E3A: adds r5, 0x1C subs r6, 0x1 cmp r6, 0 bge @08035DBC b @08035EA6 @08035E44: ldr r0, =0x02024474 adds r0, 0x25 ldrb r5, [r0] movs r0, 0x1 adds r6, r5, 0 eors r6, r0 adds r1, r6, 0 ldr r4, =0x020229e8 lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r4 ldrh r0, [r0, 0x18] cmp r0, 0 beq @08035E66 adds r6, r5, 0 adds r5, r1, 0 @08035E66: lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r4, 0x8 adds r1, r0, r4 adds r0, r1, 0 movs r1, 0xF bl battle_show_message_maybe lsls r0, r6, 3 subs r0, r6 lsls r0, 2 adds r1, r0, r4 adds r0, r1, 0 movs r1, 0x10 bl battle_show_message_maybe movs r4, 0x7 str r4, [sp] adds r0, r7, 0 adds r1, r5, 0 movs r2, 0x1 movs r3, 0x2 bl sub_8035AE4 str r4, [sp] adds r0, r7, 0 adds r1, r6, 0 movs r2, 0x2 movs r3, 0x2 bl sub_8035AE4 @08035EA6: ldr r0, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @08036138 .align 2, 0 .pool @08035EC4: ldr r0, =0x00002710 bl gpu_pal_alloc_new lsls r0, 24 ldr r2, =0x02037714 lsrs r0, 19 ldr r3, =0x0000021e adds r0, r3 adds r2, r0, r2 ldr r1, =0x02037b14 adds r0, r1 ldr r1, =0x00007fff strh r1, [r0] strh r1, [r2] ldr r0, =gUnknown_0831A9D0 movs r1, 0x6F movs r2, 0x50 movs r3, 0 bl obj_add_from_template_forward_search ldr r4, =0x0202449c ldr r1, [r4] adds r1, 0x7D strb r0, [r1] ldr r0, =gUnknown_0831A9E8 movs r1, 0x81 movs r2, 0x50 movs r3, 0 bl obj_add_from_template_forward_search ldr r1, [r4] adds r1, 0x7E strb r0, [r1] ldr r3, =0x02020630 ldr r0, [r4] adds r0, 0x7D ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] ldr r0, [r4] adds r0, 0x7E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r1, [r0] orrs r1, r2 strb r1, [r0] ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] b @08036138 .align 2, 0 .pool @08035F64: movs r1, 0x12 ldrsh r0, [r5, r1] cmp r0, 0 beq @08035FCC ldr r4, =0x02022e18 ldrh r0, [r5, 0xA] bl sine2 lsls r0, 16 asrs r0, 16 cmp r0, 0 bge @08035F7E adds r0, 0x1F @08035F7E: asrs r1, r0, 5 movs r2, 0x14 negs r2, r2 adds r0, r2, 0 subs r0, r1 strh r0, [r4] ldr r4, =0x02022e1c ldrh r0, [r5, 0xC] bl sine2 lsls r0, 16 asrs r0, 16 cmp r0, 0 bge @08035F9C adds r0, 0x1F @08035F9C: asrs r1, r0, 5 movs r3, 0x8C negs r3, r3 adds r0, r3, 0 subs r0, r1 strh r0, [r4] ldr r0, =0x02022e1a ldr r2, =0x0000ffdc adds r1, r2, 0 strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] b @08036038 .align 2, 0 .pool @08035FCC: ldr r4, =0x02022e18 ldrh r0, [r5, 0xA] bl sine2 lsls r0, 16 asrs r0, 16 cmp r0, 0 bge @08035FDE adds r0, 0x1F @08035FDE: asrs r1, r0, 5 movs r3, 0x14 negs r3, r3 adds r0, r3, 0 subs r0, r1 strh r0, [r4] ldr r4, =0x02022e1a ldrh r0, [r5, 0xA] bl cosine2 lsls r0, 16 asrs r0, 16 cmp r0, 0 bge @08035FFC adds r0, 0x1F @08035FFC: asrs r0, 5 subs r0, 0xA4 strh r0, [r4] ldr r4, =0x02022e1c ldrh r0, [r5, 0xC] bl sine2 lsls r0, 16 asrs r0, 16 cmp r0, 0 bge @08036014 adds r0, 0x1F @08036014: asrs r1, r0, 5 movs r2, 0x8C negs r2, r2 adds r0, r2, 0 subs r0, r1 strh r0, [r4] ldr r4, =0x02022e1e ldrh r0, [r5, 0xC] bl cosine2 lsls r0, 16 asrs r0, 16 cmp r0, 0 bge @08036032 adds r0, 0x1F @08036032: asrs r0, 5 subs r0, 0xA4 strh r0, [r4] @08036038: ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r1, r0, r1 ldrh r0, [r1, 0xC] movs r2, 0xC ldrsh r3, [r1, r2] mov r8, r3 cmp r3, 0 beq @08036070 subs r0, 0x2 strh r0, [r1, 0xC] ldrh r0, [r1, 0xA] adds r0, 0x2 strh r0, [r1, 0xA] b @08036138 .align 2, 0 .pool @08036070: movs r3, 0x12 ldrsh r0, [r1, r3] cmp r0, 0 beq @0803607C bl sub_8035C4C @0803607C: movs r0, 0x78 bl audio_play adds r0, r7, 0 bl remove_task ldr r4, =0x02020630 ldr r5, =0x0202449c ldr r0, [r5] adds r0, 0x7D ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 adds r1, 0x3E ldrb r3, [r1] movs r2, 0x5 negs r2, r2 adds r0, r2, 0 ands r0, r3 strb r0, [r1] ldr r0, [r5] adds r0, 0x7E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] ands r2, r1 strb r2, [r0] ldr r5, [r5] adds r6, r5, 0 adds r6, 0x7E ldrb r0, [r6] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r4 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x40 ldr r7, =0x000003ff adds r0, r7, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] adds r5, 0x7D ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 mov r1, r8 strh r1, [r0, 0x2E] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x1 strh r1, [r0, 0x2E] ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x20] strh r1, [r0, 0x30] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x20] strh r1, [r0, 0x30] ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 mov r2, r8 strh r2, [r0, 0x32] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r2, [r0, 0x32] @08036138: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task00_0800F6FC thumb_func_start sub_8036154 sub_8036154: ; 8036154 push {r4,r5,lr} ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08036208 ldr r0, =gUnknown_08D778F0 ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D77B0C ldr r1, =0x06010000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D77AE4 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, =0x00005c04 movs r0, 0xA bl lcd_io_set ldr r4, =gUnknown_08D779D8 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, =0x02022e1a ldr r2, =0x0000ff5c adds r1, r2, 0 strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] ldr r0, =gUnknown_0831AA00 bl gpu_tile_obj_decompress_and_load3 b @080363AC .align 2, 0 .pool @08036208: ldr r0, =0x023f0902 ands r0, r1 cmp r0, 0 beq @0803628C movs r0, 0x80 lsls r0, 15 ands r1, r0 cmp r1, 0 beq @08036224 ldr r0, =0x02038bce ldrh r1, [r0] ldr r0, =0x00000c03 cmp r1, r0 bne @08036248 @08036224: ldr r0, =gUnknown_08D820D4 ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D824E4 b @08036382 .align 2, 0 .pool @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, =gUnknown_08D857A8 movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r1, =gUnknown_08D85A1C 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 .pool @0803628C: movs r0, 0x80 lsls r0, 21 ands r0, r1 cmp r0, 0 beq @080362B0 ldr r0, =gUnknown_08D81610 ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D81E2C b @08036382 .align 2, 0 .pool @080362B0: movs r0, 0x80 lsls r0, 22 ands r0, r1 cmp r0, 0 beq @080362D4 ldr r0, =gUnknown_08D7F9F8 ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D7FEC4 b @08036382 .align 2, 0 .pool @080362D4: movs r0, 0x80 lsls r0, 23 ands r0, r1 cmp r0, 0 beq @080362F8 ldr r0, =gUnknown_08D82608 ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D82C70 b @08036382 .align 2, 0 .pool @080362F8: movs r0, 0x8 ands r1, r0 cmp r1, 0 beq @08036350 ldr r2, =gTrainers ldr r0, =0x02038bca ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0x20 bne @08036334 ldr r0, =gUnknown_08D820D4 ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D824E4 b @08036382 .align 2, 0 .pool @08036334: cmp r0, 0x26 bne @08036350 ldr r0, =gUnknown_08D820D4 ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D824E4 b @08036382 .align 2, 0 .pool @08036350: bl sav1_map_get_battletype lsls r0, 24 cmp r0, 0 bne @0803639C ldr r4, =gUnknown_0831ABA8 ldr r5, =0x02022ff0 ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x8 adds r0, r1 ldr r0, [r0] ldr r1, =0x06004000 bl 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, =0x0600e000 bl call_LZZUnCompVram b @080363AC .align 2, 0 .pool @0803639C: ldr r0, =gUnknown_08D820D4 ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D824E4 ldr r1, =0x0600e000 bl call_LZZUnCompVram @080363AC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8036154 thumb_func_start sub_80363C4 sub_80363C4: ; 80363C4 push {r4,lr} lsls r0, 24 lsrs r0, 24 movs r4, 0 cmp r0, 0x6 bls @080363D2 b @08036756 @080363D2: lsls r0, 2 ldr r1, =@080363E0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080363E0: .4byte @080363FC .4byte @0803640C .4byte @08036424 .4byte @08036434 .4byte @0803652C .4byte @08036638 .4byte @08036750 @080363FC: ldr r0, =gUnknown_08C00000 movs r1, 0xC0 lsls r1, 19 bl call_LZZUnCompVram b @08036758 .align 2, 0 .pool @0803640C: ldr r1, =gUnknown_08C00524 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 .pool @08036424: ldr r0, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x40 bl decompress_palette b @08036758 .align 2, 0 .pool @08036434: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 cmp r0, 0 bne @08036518 movs r0, 0x80 lsls r0, 21 ands r0, r1 cmp r0, 0 beq @0803645C ldr r0, =gUnknown_08D7BB14 b @0803651A .align 2, 0 .pool @0803645C: movs r0, 0x8 ands r1, r0 cmp r1, 0 beq @0803648C ldr r2, =gTrainers ldr r0, =0x02038bca ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0x20 beq @08036518 cmp r0, 0x26 bne @0803648C ldr r0, =gUnknown_08D7CCD8 b @0803651A .align 2, 0 .pool @0803648C: bl sav1_map_get_battletype lsls r0, 24 lsrs r0, 24 cmp r0, 0x8 bhi @080364CC lsls r0, 2 ldr r1, =@080364A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080364A8: .4byte @080364CC .4byte @08036518 .4byte @080364E8 .4byte @080364F0 .4byte @080364F8 .4byte @08036500 .4byte @08036508 .4byte @08036510 .4byte @08036518 @080364CC: ldr r2, =gUnknown_0831ABA8 ldr r0, =0x02022ff0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r0, [r0] b @0803651A .align 2, 0 .pool @080364E8: ldr r0, =gUnknown_08D7CCD8 b @0803651A .align 2, 0 .pool @080364F0: ldr r0, =gUnknown_08D7CCD8 b @0803651A .align 2, 0 .pool @080364F8: ldr r0, =gUnknown_08D7CCD8 b @0803651A .align 2, 0 .pool @08036500: ldr r0, =gUnknown_08D7CCD8 b @0803651A .align 2, 0 .pool @08036508: ldr r0, =gUnknown_08D7CCD8 b @0803651A .align 2, 0 .pool @08036510: ldr r0, =gUnknown_08D7CCD8 b @0803651A .align 2, 0 .pool @08036518: ldr r0, =gUnknown_08D7C440 @0803651A: ldr r1, =0x06008000 bl call_LZZUnCompVram b @08036758 .align 2, 0 .pool @0803652C: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 cmp r0, 0 beq @0803653A b @08036624 @0803653A: movs r0, 0x80 lsls r0, 5 ands r0, r1 cmp r0, 0 beq @08036568 ldr r0, =gUnknown_82E9530 ldrb r0, [r0] cmp r0, 0x2 bne @08036560 ldr r0, =gUnknown_08D7C154 b @08036626 .align 2, 0 .pool @08036560: ldr r0, =gUnknown_08D7A720 b @08036626 .align 2, 0 .pool @08036568: movs r0, 0x8 ands r1, r0 cmp r1, 0 beq @08036598 ldr r2, =gTrainers ldr r0, =0x02038bca ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0x20 beq @08036624 cmp r0, 0x26 bne @08036598 ldr r0, =gUnknown_08D7D2E0 b @08036626 .align 2, 0 .pool @08036598: bl sav1_map_get_battletype lsls r0, 24 lsrs r0, 24 cmp r0, 0x8 bhi @080365D8 lsls r0, 2 ldr r1, =@080365B4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080365B4: .4byte @080365D8 .4byte @08036624 .4byte @080365F4 .4byte @080365FC .4byte @08036604 .4byte @0803660C .4byte @08036614 .4byte @0803661C .4byte @08036624 @080365D8: ldr r2, =gUnknown_0831ABA8 ldr r0, =0x02022ff0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r2, 0x4 adds r0, r2 ldr r0, [r0] b @08036626 .align 2, 0 .pool @080365F4: ldr r0, =gUnknown_08D7D2E0 b @08036626 .align 2, 0 .pool @080365FC: ldr r0, =gUnknown_08D7D2E0 b @08036626 .align 2, 0 .pool @08036604: ldr r0, =gUnknown_08D7D2E0 b @08036626 .align 2, 0 .pool @0803660C: ldr r0, =gUnknown_08D7D2E0 b @08036626 .align 2, 0 .pool @08036614: ldr r0, =gUnknown_08D7D2E0 b @08036626 .align 2, 0 .pool @0803661C: ldr r0, =gUnknown_08D7D2E0 b @08036626 .align 2, 0 .pool @08036624: ldr r0, =gUnknown_08D7CA28 @08036626: ldr r1, =0x0600d000 bl call_LZZUnCompVram b @08036758 .align 2, 0 .pool @08036638: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x023f0902 ands r0, r1 cmp r0, 0 beq @08036646 b @08036740 @08036646: movs r0, 0x80 lsls r0, 5 ands r0, r1 cmp r0, 0 beq @08036674 ldr r0, =gUnknown_82E9530 ldrb r0, [r0] cmp r0, 0x2 bne @0803666C ldr r0, =gUnknown_08D7DF30 b @08036742 .align 2, 0 .pool @0803666C: ldr r0, =gUnknown_08D7DEF4 b @08036742 .align 2, 0 .pool @08036674: movs r0, 0x8 ands r1, r0 cmp r1, 0 beq @080366AC ldr r2, =gTrainers ldr r0, =0x02038bca ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0x20 bne @080366A0 ldr r0, =gUnknown_08D7DFC4 b @08036742 .align 2, 0 .pool @080366A0: cmp r0, 0x26 bne @080366AC ldr r0, =gUnknown_08D7E1F8 b @08036742 .align 2, 0 .pool @080366AC: bl sav1_map_get_battletype lsls r0, 24 lsrs r0, 24 cmp r0, 0x8 bhi @080366EC lsls r0, 2 ldr r1, =@080366C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080366C8: .4byte @080366EC .4byte @08036708 .4byte @08036710 .4byte @08036718 .4byte @08036720 .4byte @08036728 .4byte @08036730 .4byte @08036738 .4byte @08036740 @080366EC: ldr r2, =gUnknown_0831ABA8 ldr r0, =0x02022ff0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r2, 0x10 adds r0, r2 ldr r0, [r0] b @08036742 .align 2, 0 .pool @08036708: ldr r0, =gUnknown_08D7DF88 b @08036742 .align 2, 0 .pool @08036710: ldr r0, =gUnknown_08D7E060 b @08036742 .align 2, 0 .pool @08036718: ldr r0, =gUnknown_08D7E000 b @08036742 .align 2, 0 .pool @08036720: ldr r0, =gUnknown_08D7E0CC b @08036742 .align 2, 0 .pool @08036728: ldr r0, =gUnknown_08D7E11C b @08036742 .align 2, 0 .pool @08036730: ldr r0, =gUnknown_08D7E164 b @08036742 .align 2, 0 .pool @08036738: ldr r0, =gUnknown_08D7E1A8 b @08036742 .align 2, 0 .pool @08036740: ldr r0, =gUnknown_08D7C9EC @08036742: movs r1, 0x20 movs r2, 0x60 bl decompress_palette b @08036758 .align 2, 0 .pool @08036750: bl sub_803570C b @08036758 @08036756: movs r4, 0x1 @08036758: adds r0, r4, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_80363C4 thumb_func_start sub_8036760 sub_8036760: ; 8036760 push {lr} bl saveblock_randomize_and_relocate bl sub_8056F28 bl dp11_init bl init_uns_table_pokemon_copy bl sub_8185F84 ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @080367CC movs r0, 0x80 lsls r0, 17 ands r0, r1 cmp r0, 0 beq @08036798 bl sub_80367D4 b @080367BA .align 2, 0 .pool @08036798: movs r0, 0x80 lsls r0, 15 ands r1, r0 cmp r1, 0 bne @080367B4 bl battle_wireless_setup_if_required_maybe ldr r0, =sub_8037ADC bl set_callback2 b @080367BA .align 2, 0 .pool @080367B4: ldr r0, =intro_end bl set_callback2 @080367BA: ldr r1, =0x02024332 movs r0, 0 strb r0, [r1] b @080367D0 .align 2, 0 .pool @080367CC: bl sub_80367D4 @080367D0: pop {r0} bx r0 thumb_func_end sub_8036760 thumb_func_start sub_80367D4 sub_80367D4: ; 80367D4 push {r4,r5,lr} sub sp, 0x4 movs r0, 0 bl SetHBlankCallback movs r0, 0 bl SetVBlankCallback movs r0, 0 str r0, [sp] movs r1, 0xC0 lsls r1, 19 ldr r2, =0x05006000 mov r0, sp bl CpuSet movs r0, 0x4C movs r1, 0 bl lcd_io_set movs r0, 0x40 movs r1, 0xF0 bl lcd_io_set ldr r1, =0x00005051 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, =0x02022e24 movs r2, 0xF0 strh r2, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @08036870 ldr r0, =0x02038bce ldrh r1, [r0] ldr r0, =0x00000c03 cmp r1, r0 beq @08036870 ldr r1, =0x02022e26 movs r0, 0x9F strh r0, [r1] ldr r0, =0x02022e28 strh r2, [r0] ldr r1, =0x02022e2a movs r0, 0x20 strh r0, [r1] b @080368BE .align 2, 0 .pool @08036870: ldr r0, =0x02022e26 ldr r2, =0x00005051 adds r1, r2, 0 strh r1, [r0] bl dp12_8087EA4 ldr r0, =0x02038c28 movs r3, 0xF0 movs r5, 0xF0 lsls r5, 3 adds r2, r0, r5 movs r1, 0x4F @08036888: strh r3, [r0] strh r3, [r2] adds r2, 0x2 adds r0, 0x2 subs r1, 0x1 cmp r1, 0 bge @08036888 movs r1, 0x50 ldr r4, =gUnknown_0831AC70 ldr r0, =0x02038c28 ldr r3, =0x0000ff10 movs r5, 0x82 lsls r5, 4 adds r2, r0, r5 adds r0, 0xA0 @080368A6: strh r3, [r0] strh r3, [r2] adds r2, 0x2 adds r0, 0x2 adds r1, 0x1 cmp r1, 0x9F ble @080368A6 ldr r0, [r4] ldr r1, [r4, 0x4] ldr r2, [r4, 0x8] bl sub_80BA038 @080368BE: bl sub_80A1A74 ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r0, =0x02022e18 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] ldr r0, =0x02022e1c strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] ldr r0, =0x02022e20 strh r1, [r0] ldr r0, =0x02022e22 strh r1, [r0] bl sub_80B0BD0 ldr r2, =0x02022ff0 strb r0, [r2] ldr r4, =0x02022fec ldr r0, [r4] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @080368FE movs r0, 0x8 strb r0, [r2] @080368FE: bl c2_berry_program_update_menu bl sub_8035AA4 bl reset_all_obj_data bl clear_tasks bl sub_8036154 bl gpu_pal_allocator_reset ldr r1, =0x0300301c movs r0, 0x4 strb r0, [r1] ldr r0, =vblank_cb_08078BB4 bl SetVBlankCallback bl sub_803269C ldr r2, [r4] movs r1, 0xA0 lsls r1, 1 adds r0, r2, 0 ands r0, r1 cmp r0, r1 beq @0803693E ldr r1, =0x00400040 adds r0, r2, 0 ands r0, r1 cmp r0, r1 bne @08036994 @0803693E: ldr r0, =sub_8037458 bl set_callback2 b @080369AE .align 2, 0 .pool @08036994: movs r0, 0x40 ands r2, r0 cmp r2, 0 beq @080369A8 ldr r0, =sub_8037DF4 bl set_callback2 b @080369AE .align 2, 0 .pool @080369A8: ldr r0, =sub_8036FAC bl set_callback2 @080369AE: ldr r5, =0x02022fec ldr r0, [r5] ldr r1, =0x01000002 ands r0, r1 cmp r0, 0 bne @080369E8 ldr r4, =0x02024744 ldr r0, =0x02038bca ldrh r1, [r0] adds r0, r4, 0 movs r2, 0x1 bl 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, =0x02038bcc ldrh r1, [r1] movs r2, 0 bl sub_80385E8 @080369E4: bl sub_806EA68 @080369E8: ldr r1, =0x030022c0 ldr r2, =0x00000439 adds r1, r2 ldrb r0, [r1] movs r2, 0x2 orrs r0, r2 strb r0, [r1] ldr r0, =0x03005d90 ldr r1, [r0] ldr r5, =0x00000ca9 adds r1, r5 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r4, =0x020244ec movs r0, 0xFA lsls r0, 1 adds r5, r4, r0 @08036A10: adds r0, r4, 0 movs r1, 0x3 bl happiness_algorithm adds r4, 0x64 cmp r4, r5 ble @08036A10 movs r1, 0 ldr r0, =0x02024332 strb r1, [r0] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80367D4 thumb_func_start sub_8036A5C sub_8036A5C: ; 8036A5C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r6, 0 mov r9, r6 movs r0, 0xCE lsls r0, 1 mov r10, r0 mov r8, r6 @08036A72: movs r0, 0x64 mov r4, r9 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr lsls r0, 16 lsrs r7, r0, 16 adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr adds r1, r0, 0 cmp r5, 0 beq @08036AEE cmp r5, r10 beq @08036ABA cmp r7, 0 beq @08036ABA cmp r1, 0 bne @08036ABA movs r0, 0x1 mov r2, r8 lsls r0, r2 orrs r6, r0 lsls r0, r6, 16 lsrs r6, r0, 16 @08036ABA: cmp r5, 0 beq @08036AEE cmp r7, 0 beq @08036AD6 cmp r5, r10 beq @08036ACA cmp r1, 0 beq @08036AD6 @08036ACA: movs r0, 0x2 mov r1, r8 lsls r0, r1 orrs r6, r0 lsls r0, r6, 16 lsrs r6, r0, 16 @08036AD6: cmp r5, 0 beq @08036AEE cmp r5, r10 beq @08036AEE cmp r7, 0 bne @08036AEE movs r0, 0x3 mov r2, r8 lsls r0, r2 orrs r6, r0 lsls r0, r6, 16 lsrs r6, r0, 16 @08036AEE: movs r0, 0x2 add r8, r0 movs r1, 0x1 add r9, r1 mov r2, r9 cmp r2, 0x5 ble @08036A72 ldr r4, =0x0202449c ldr r0, [r4] movs r1, 0xC1 lsls r1, 1 adds r0, r1 strb r6, [r0] ldr r0, [r4] ldr r5, =0x00000183 adds r0, r5 lsrs r1, r6, 8 strb r1, [r0] ldr r0, =0x000008d2 bl 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 .pool thumb_func_end sub_8036A5C thumb_func_start sub_8036B44 sub_8036B44: ; 8036B44 push {r4-r7,lr} ldr r0, =0x0202449c ldr r5, [r0] movs r0, 0xC2 lsls r0, 1 adds r4, r5, r0 bl sub_80E162C cmp r0, 0x1 bne @08036BC0 movs r2, 0 ldr r7, =0x03005d8c movs r1, 0xC6 lsls r1, 1 adds r5, r1 adds r6, r7, 0 ldr r3, =0x000031f8 @08036B66: adds r0, r4, r2 ldr r1, [r6] adds r1, r3 adds r1, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x5 ble @08036B66 adds r1, r4, r2 movs r0, 0xFF strb r0, [r1] movs r2, 0 adds r3, r5, 0 ldr r6, =0x03005d8c ldr r5, =0x00003214 @08036B86: adds r0, r3, r2 ldr r1, [r6] adds r1, r5 adds r1, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x11 ble @08036B86 ldr r0, [r7] ldr r1, =0x00003226 adds r0, r1 ldrb r0, [r0] strb r0, [r4, 0x7] ldr r0, [r7] adds r1, 0x1 adds r0, r1 ldrb r0, [r0] b @08036C00 .align 2, 0 .pool @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, =0x02022fec ldr r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08036C20 b @08036D4C @08036C20: bl sub_80E162C cmp r0, 0x1 bne @08036CDC movs r5, 0 ldr r3, =0x02024404 ldr r0, =0x03005d8c mov r8, r0 adds r6, r3, 0 mov r4, r8 ldr r2, =0x000031f8 adds r7, r3, 0 adds r7, 0x38 @08036C3A: adds r1, r5, r6 ldr r0, [r4] adds r0, r2 adds r0, r5 ldrb r0, [r0] strb r0, [r1] adds r1, r5, r7 ldr r0, [r4] adds r0, r2 adds r0, r5 ldrb r0, [r0] strb r0, [r1] adds r5, 0x1 cmp r5, 0x5 ble @08036C3A adds r1, r5, r3 movs r0, 0xFF strb r0, [r1] adds r0, r3, 0 adds r0, 0x38 adds r0, r5, r0 movs r1, 0x1 negs r1, r1 strb r1, [r0] movs r5, 0 adds r7, r3, 0 adds r7, 0x8 ldr r4, =0x03005d8c ldr r2, =0x00003214 adds r6, r3, 0 adds r6, 0x40 @08036C78: adds r1, r5, r7 ldr r0, [r4] adds r0, r2 adds r0, r5 ldrb r0, [r0] strb r0, [r1] adds r1, r5, r6 ldr r0, [r4] adds r0, r2 adds r0, r5 ldrb r0, [r0] strb r0, [r1] adds r5, 0x1 cmp r5, 0x11 ble @08036C78 mov r1, r8 ldr r0, [r1] ldr r2, =0x00003226 adds r0, r2 ldrb r1, [r0] strb r1, [r3, 0x7] ldrb r0, [r0] adds r1, r3, 0 adds r1, 0x3F strb r0, [r1] mov r4, r8 ldr r0, [r4] ldr r1, =0x00003227 adds r0, r1 ldrb r1, [r0] strb r1, [r3, 0x1A] ldrb r1, [r0] adds r0, r3, 0 adds r0, 0x52 strb r1, [r0] b @08036EA0 .align 2, 0 .pool @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, =0x02024404 adds r7, r4, 0 adds r7, 0x38 adds r3, r4, 0 @08036CF6: adds r1, r5, r4 adds r2, r6, r5 ldrb r0, [r2] strb r0, [r1] adds r1, r5, r7 ldrb r0, [r2] strb r0, [r1] adds r5, 0x1 cmp r5, 0x5 ble @08036CF6 adds r1, r5, r3 movs r0, 0xFF strb r0, [r1] adds r0, r3, 0 adds r0, 0x38 adds r0, r5, r0 movs r1, 0x1 negs r1, r1 strb r1, [r0] movs r5, 0 adds r4, r3, 0 adds r4, 0x8 movs r1, 0 adds r2, r3, 0 adds r2, 0x40 @08036D28: adds r0, r5, r4 strb r1, [r0] adds r0, r5, r2 strb r1, [r0] adds r5, 0x1 cmp r5, 0x11 ble @08036D28 movs r1, 0 strb r1, [r3, 0x7] adds r0, r3, 0 adds r0, 0x3F strb r1, [r0] strb r1, [r3, 0x1A] adds r0, 0x13 strb r1, [r0] b @08036EA0 .align 2, 0 .pool @08036D4C: movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @08036DF0 movs r0, 0x80 lsls r0, 1 ands r1, r0 movs r2, 0x4 mov r8, r2 cmp r1, 0 beq @08036D66 movs r4, 0x2 mov r8, r4 @08036D66: movs r5, 0 cmp r5, r8 blt @08036D6E b @08036EA0 @08036D6E: ldr r0, =0x020229e8 mov r12, r0 ldr r3, =0x02024404 adds r6, r3, 0 movs r1, 0x8 adds r1, r6 mov r9, r1 @08036D7C: lsls r1, r5, 8 ldr r0, =0x020223c8 adds r7, r1, r0 lsls r0, r5, 3 subs r0, r5 lsls r0, 2 add r0, r12 ldrb r3, [r0, 0x18] movs r4, 0 adds r5, 0x1 mov r10, r5 lsls r1, r3, 3 subs r0, r1, r3 adds r5, r1, 0 lsls r0, 2 adds r1, r0, r6 @08036D9C: adds r0, r7, r4 ldrb r0, [r0] strb r0, [r1] adds r1, 0x1 adds r4, 0x1 cmp r4, 0x5 ble @08036D9C subs r0, r5, r3 lsls r0, 2 adds r1, r4, r0 adds r1, r6 movs r2, 0xFF strb r2, [r1] movs r4, 0 mov r2, r9 adds r1, r0, r2 adds r2, r7, 0 adds r2, 0x8 @08036DC0: adds r0, r2, r4 ldrb r0, [r0] strb r0, [r1] adds r1, 0x1 adds r4, 0x1 cmp r4, 0x11 ble @08036DC0 subs r0, r5, r3 lsls r0, 2 adds r0, r6 ldrb r1, [r7, 0x7] strb r1, [r0, 0x7] ldrb r1, [r7, 0x1A] strb r1, [r0, 0x1A] mov r5, r10 cmp r5, r8 blt @08036D7C b @08036EA0 .align 2, 0 .pool @08036DF0: movs r5, 0 ldr r4, =0x02024404 mov r9, r4 @08036DF6: lsls r0, r5, 8 ldr r1, =0x020223c8 adds r7, r0, r1 movs r4, 0 adds r2, r5, 0x1 mov r10, r2 lsls r0, r5, 3 mov r8, r0 adds r1, r5, 0x2 mov r12, r1 subs r1, r0, r5 mov r2, r12 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 mov r2, r9 adds r3, r0, r2 lsls r1, 2 adds r2, r1, r2 @08036E1C: adds r0, r7, r4 ldrb r1, [r0] strb r1, [r2] ldrb r0, [r0] strb r0, [r3] adds r3, 0x1 adds r2, 0x1 adds r4, 0x1 cmp r4, 0x5 ble @08036E1C mov r0, r8 subs r3, r0, r5 lsls r3, 2 adds r1, r4, r3 add r1, r9 ldrb r0, [r1] movs r2, 0xFF orrs r0, r2 strb r0, [r1] mov r0, r12 lsls r2, r0, 3 subs r2, r0 lsls r2, 2 adds r1, r4, r2 add r1, r9 ldrb r0, [r1] movs r4, 0xFF orrs r0, r4 strb r0, [r1] movs r4, 0 ldr r0, =0x02024404 adds r0, 0x8 adds r2, r0 adds r3, r0 adds r6, r7, 0 adds r6, 0x8 @08036E64: adds r0, r6, r4 ldrb r1, [r0] strb r1, [r3] ldrb r0, [r0] strb r0, [r2] adds r2, 0x1 adds r3, 0x1 adds r4, 0x1 cmp r4, 0x11 ble @08036E64 mov r0, r8 subs r2, r0, r5 lsls r2, 2 add r2, r9 ldrb r0, [r7, 0x7] strb r0, [r2, 0x7] mov r1, r12 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r9 ldrb r1, [r7, 0x7] strb r1, [r0, 0x7] ldrb r1, [r7, 0x1A] strb r1, [r2, 0x1A] ldrb r1, [r7, 0x1A] strb r1, [r0, 0x1A] mov r5, r10 cmp r5, 0x1 ble @08036DF6 @08036EA0: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end berry_801017C thumb_func_start sub_8036EB8 sub_8036EB8: ; 8036EB8 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 lsrs r3, r1, 24 movs r6, 0 ldr r0, =0x020223c4 ldrh r2, [r0] movs r1, 0x80 lsls r1, 1 mov r12, r0 cmp r2, r1 bne @08036EFC cmp r3, 0 bne @08036EEC ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0xC b @08036EF2 .align 2, 0 .pool @08036EEC: ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0x8 @08036EF2: orrs r1, r2 str r1, [r0] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @08036EFC: cmp r6, 0 bne @08036FA0 movs r2, 0 cmp r2, r4 bge @08036F20 ldr r1, =0x020223c4 mov r8, r1 movs r5, 0x80 lsls r5, 1 @08036F0E: adds r1, r5 adds r2, 0x1 cmp r2, r4 bge @08036F20 mov r7, r8 ldrh r0, [r7] ldrh r7, [r1] cmp r0, r7 beq @08036F0E @08036F20: cmp r2, r4 bne @08036F48 cmp r3, 0 bne @08036F38 ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0xC b @08036F3E .align 2, 0 .pool @08036F38: ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0x8 @08036F3E: orrs r1, r2 str r1, [r0] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @08036F48: cmp r6, 0 bne @08036FA0 movs r2, 0 ldr r5, =0x02022fec cmp r2, r4 bge @08036F8A mov r0, r12 ldrh r1, [r0] movs r0, 0xC0 lsls r0, 2 cmp r1, r0 beq @08036F82 @08036F60: lsls r0, r2, 8 add r0, r12 ldrh r0, [r0] movs r1, 0xC0 lsls r1, 2 cmp r0, r1 bls @08036F72 cmp r2, r3 bne @08036F8A @08036F72: adds r2, 0x1 cmp r2, r4 bge @08036F8A lsls r0, r2, 8 add r0, r12 ldrh r0, [r0] cmp r0, r1 bne @08036F60 @08036F82: cmp r2, r3 beq @08036F60 cmp r2, r3 bge @08036F60 @08036F8A: cmp r2, r4 bne @08036F98 ldr r0, [r5] movs r1, 0xC b @08036F9C .align 2, 0 .pool @08036F98: ldr r0, [r5] movs r1, 0x8 @08036F9C: orrs r0, r1 str r0, [r5] @08036FA0: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8036EB8 thumb_func_start sub_8036FAC sub_8036FAC: ; 8036FAC push {r4-r6,lr} bl 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, =0x02024474 adds r0, 0x25 strb r6, [r0] movs r0, 0x1 adds r5, r6, 0 eors r5, r0 ldr r0, =0x02024332 ldrb r0, [r0] cmp r0, 0x12 bls @08036FD8 b @0803744C @08036FD8: lsls r0, 2 ldr r1, =@08036FF0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08036FF0: .4byte @0803703C .4byte @08037080 .4byte @08037144 .4byte @080371D8 .4byte @08037200 .4byte @0803742C .4byte @08037438 .4byte @08037230 .4byte @08037258 .4byte @0803742C .4byte @08037438 .4byte @08037288 .4byte @080372B0 .4byte @0803742C .4byte @08037438 .4byte @08037318 .4byte @08037378 .4byte @080373A0 .4byte @080373E0 @0803703C: bl 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, =0x02024332 movs r0, 0x1 strb r0, [r1] @08037068: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08037072 b @0803744C @08037072: bl sub_800E0E8 b @0803744C .align 2, 0 .pool @08037080: ldr r2, =0x02022fec ldr r1, [r2] movs r6, 0x2 adds r0, r1, 0 ands r0, r6 cmp r0, 0 beq @08037124 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08037098 b @0803744C @08037098: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080370EE ldr r4, =0x0202449c ldr r0, [r4] movs r5, 0xC0 lsls r5, 1 adds r0, r5 movs r1, 0 strb r1, [r0] ldr r0, [r4] ldr r2, =0x00000181 adds r1, r0, r2 movs r0, 0x3 strb r0, [r1] bl sub_8036A5C bl sub_8036B44 ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 cmp r1, r0 bne @080370D8 ldr r0, =0x020229e8 movs r1, 0 strh r1, [r0, 0x18] movs r1, 0x1 strh r1, [r0, 0x34] @080370D8: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, [r4] adds r1, r5 movs r2, 0x20 bl link_0800A448 ldr r0, =0x02024332 strb r6, [r0] @080370EE: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @080370F8 b @0803744C @080370F8: movs r0, 0 movs r1, 0 bl sub_800DFB4 b @0803744C .align 2, 0 .pool @08037124: movs r0, 0x80 lsls r0, 17 ands r0, r1 cmp r0, 0 bne @08037134 movs r0, 0x4 orrs r1, r0 str r1, [r2] @08037134: ldr r1, =0x02024332 movs r0, 0xF strb r0, [r1] bl berry_801017C b @0803744C .align 2, 0 .pool @08037144: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @08037152 b @0803744C @08037152: bl sub_800A5B4 movs r0, 0x2 adds r1, r6, 0 bl sub_8036EB8 bl berry_801017C ldr r0, =task00_0800F6FC movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 adds r2, r1 movs r1, 0 movs r0, 0x87 lsls r0, 1 strh r0, [r2, 0xA] movs r0, 0x5A strh r0, [r2, 0xC] strh r1, [r2, 0x12] ldr r0, =0x0202449c ldr r3, [r0] movs r4, 0xC1 lsls r4, 1 adds r0, r3, r4 ldrb r1, [r0] adds r4, 0x1 adds r0, r3, r4 ldrb r0, [r0] lsls r0, 8 orrs r1, r0 strh r1, [r2, 0xE] ldr r1, =0x020223c4 lsls r4, r5, 8 adds r1, 0x2 adds r4, r1 ldrh r0, [r4] strh r0, [r2, 0x10] lsls r0, r6, 8 adds r0, r1 ldrh r0, [r0] bl sub_8185F90 ldrh r0, [r4] bl sub_8185F90 bl sub_8068AA4 ldr r1, =0x02024332 b @08037446 .align 2, 0 .pool @080371D8: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @080371E4 b @0803744C @080371E4: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x020244ec movs r2, 0xC8 bl link_0800A448 ldr r1, =0x02024332 b @08037446 .align 2, 0 .pool @08037200: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @0803720E b @0803744C @0803720E: bl sub_800A5B4 ldr r0, =0x02024744 lsls r1, r5, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0xC8 bl memcpy ldr r1, =0x02024332 b @08037446 .align 2, 0 .pool @08037230: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @0803723C b @0803744C @0803723C: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x020245b4 movs r2, 0xC8 bl link_0800A448 ldr r1, =0x02024332 b @08037446 .align 2, 0 .pool @08037258: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @08037266 b @0803744C @08037266: bl sub_800A5B4 ldr r0, =0x0202480c lsls r1, r5, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0xC8 bl memcpy ldr r1, =0x02024332 b @08037446 .align 2, 0 .pool @08037288: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @08037294 b @0803744C @08037294: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x0202467c movs r2, 0xC8 bl link_0800A448 ldr r1, =0x02024332 b @08037446 .align 2, 0 .pool @080372B0: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @080372BE b @0803744C @080372BE: bl sub_800A5B4 ldr r4, =0x020248d4 lsls r1, r5, 8 ldr r0, =0x020223c4 adds r1, r0 adds r0, r4, 0 movs r2, 0xC8 bl memcpy ldr r1, =0xfffffe70 adds r0, r4, r1 bl shedinja_something ldr r2, =0xfffffed4 adds r0, r4, r2 bl shedinja_something adds r0, r4, 0 subs r0, 0xC8 bl shedinja_something adds r0, r4, 0 subs r0, 0x64 bl shedinja_something adds r0, r4, 0 bl shedinja_something adds r0, r4, 0 adds r0, 0x64 bl shedinja_something ldr r1, =0x02024332 b @08037446 .align 2, 0 .pool @08037318: bl sub_8032768 bl sub_8184E58 ldr r2, =0x02024332 movs r0, 0 strb r0, [r2, 0x1] strb r0, [r2, 0x2] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @08037372 movs r3, 0 ldr r1, =0x020229e8 ldrb r0, [r1] adds r5, r2, 0 cmp r0, 0x3 bne @08037356 movs r4, 0xFF adds r2, r1, 0 @08037344: adds r2, 0x1C adds r3, 0x1 cmp r3, 0x1 bgt @08037356 ldrh r1, [r2] adds r0, r4, 0 ands r0, r1 cmp r0, 0x3 beq @08037344 @08037356: cmp r3, 0x2 bne @0803736C movs r0, 0x10 strb r0, [r5] b @0803744C .align 2, 0 .pool @0803736C: movs r0, 0x12 strb r0, [r5] b @0803744C @08037372: movs r0, 0x12 strb r0, [r2] b @0803744C @08037378: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0803744C bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203bd2c movs r2, 0x4 bl link_0800A448 ldr r1, =0x02024332 b @08037446 .align 2, 0 .pool @080373A0: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 bne @0803744C bl sub_800A5B4 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x4 ands r0, r1 cmp r0, 0 bne @080373CA ldr r0, =0x0203bd2c lsls r1, r5, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x4 bl memcpy @080373CA: ldr r1, =0x02024332 b @08037446 .align 2, 0 .pool @080373E0: ldr r0, =0x02024333 adds r1, r0, 0x1 bl battle_load_something lsls r0, 24 cmp r0, 0 beq @0803744C ldr r2, =0x03005d00 ldr r1, =0x030022c0 ldr r0, [r1] str r0, [r2] ldr r0, =sub_8039EF0 str r0, [r1] ldr r0, =sub_8038420 bl set_callback2 ldr r2, =0x02022fec ldr r1, [r2] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0803744C movs r0, 0x20 orrs r1, r0 str r1, [r2] b @0803744C .align 2, 0 .pool @0803742C: ldr r0, =0x02024332 ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] movs r1, 0x1 strb r1, [r0, 0x1] @08037438: ldr r1, =0x02024332 ldrb r0, [r1, 0x1] subs r0, 0x1 strb r0, [r1, 0x1] lsls r0, 24 cmp r0, 0 bne @0803744C @08037446: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0803744C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024474 adds r0, 0x25 strb r6, [r0] movs r0, 0x1 adds r7, r6, 0 eors r7, r0 ldr r0, =0x02024332 ldrb r0, [r0] cmp r0, 0x10 bls @08037486 b @080379D6 @08037486: lsls r0, 2 ldr r1, =@0803749C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0803749C: .4byte @080374E0 .4byte @08037518 .4byte @0803761C .4byte @08037670 .4byte @08037694 .4byte @08037710 .4byte @08037734 .4byte @080377B0 .4byte @080377CC .4byte @080377FC .4byte @08037818 .4byte @08037848 .4byte @08037864 .4byte @08037908 .4byte @0803793A .4byte @0803795C .4byte @080379A0 @080374E0: bl 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, =0x02024332 movs r0, 0x1 strb r0, [r1] @0803750C: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08037518 bl sub_800E0E8 @08037518: ldr r2, =0x02022fec ldr r1, [r2] movs r3, 0x2 adds r0, r1, 0 ands r0, r3 cmp r0, 0 beq @080375FC ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08037530 b @080379D6 @08037530: ldr r6, =0x020229e8 movs r0, 0 strh r0, [r6, 0x18] strh r3, [r6, 0x34] adds r1, r6, 0 adds r1, 0x50 movs r0, 0x1 strh r0, [r1] adds r1, 0x1C movs r0, 0x3 strh r0, [r1] adds r0, r6, 0 adds r0, 0x40 ldr r4, =0x02038bca ldrh r1, [r4] bl sub_8162E20 adds r0, r6, 0 adds r0, 0x5C ldr r5, =0x02038bcc ldrh r1, [r5] bl sub_8162E20 ldrh r1, [r4] mov r0, sp bl sub_8165B88 mov r0, sp ldrb r0, [r0] adds r1, r6, 0 adds r1, 0x52 strh r0, [r1] ldrh r1, [r5] mov r0, sp bl sub_8165B88 mov r0, sp ldrb r1, [r0] adds r0, r6, 0 adds r0, 0x6E strh r1, [r0] bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080375C4 ldr r4, =0x0202449c ldr r0, [r4] movs r5, 0xC0 lsls r5, 1 adds r0, r5 movs r1, 0 strb r1, [r0] ldr r0, [r4] ldr r2, =0x00000181 adds r1, r0, r2 movs r0, 0x3 strb r0, [r1] bl sub_8036A5C bl sub_8036B44 bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, [r4] adds r1, r5 movs r2, 0x20 bl link_0800A448 ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1] @080375C4: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @080375CE b @080379D6 @080375CE: movs r0, 0 movs r1, 0 bl sub_800DFB4 b @080379D6 .align 2, 0 .pool @080375FC: movs r0, 0x80 lsls r0, 17 ands r0, r1 cmp r0, 0 bne @0803760C movs r0, 0x4 orrs r1, r0 str r1, [r2] @0803760C: ldr r1, =0x02024332 movs r0, 0xD strb r0, [r1] bl berry_801017C b @080379D6 .align 2, 0 .pool @0803761C: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @0803762A b @080379D6 @0803762A: bl sub_800A5B4 movs r0, 0x2 adds r1, r6, 0 bl sub_8036EB8 bl berry_801017C ldr r0, =task00_0800F6FC movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0 movs r0, 0x87 lsls r0, 1 strh r0, [r1, 0xA] movs r0, 0x5A strh r0, [r1, 0xC] strh r2, [r1, 0x12] adds r0, 0xEB strh r0, [r1, 0xE] strh r0, [r1, 0x10] b @08037986 .align 2, 0 .pool @08037670: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @0803767C b @080379D6 @0803767C: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x020244ec @08037686: movs r2, 0xC8 bl link_0800A448 b @08037986 .align 2, 0 .pool @08037694: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @080376A2 b @080379D6 @080376A2: bl sub_800A5B4 ldr r0, =0x020229e8 lsls r1, r6, 3 subs r1, r6 lsls r1, 2 adds r1, r0 ldrh r0, [r1, 0x18] cmp r0, 0 beq @080376E8 ldr r4, =0x020244ec lsls r1, r7, 8 ldr r5, =0x020223c4 adds r1, r5 adds r0, r4, 0 movs r2, 0xC8 bl memcpy movs r0, 0x96 lsls r0, 1 adds r4, r0 lsls r1, r6, 8 adds r1, r5 adds r0, r4, 0 movs r2, 0xC8 bl memcpy b @08037986 .align 2, 0 .pool @080376E8: ldr r4, =0x020244ec lsls r1, r6, 8 ldr r5, =0x020223c4 adds r1, r5 adds r0, r4, 0 movs r2, 0xC8 bl memcpy movs r1, 0x96 lsls r1, 1 adds r4, r1 lsls r1, r7, 8 adds r1, r5 adds r0, r4, 0 movs r2, 0xC8 b @08037982 .align 2, 0 .pool @08037710: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @0803771C b @080379D6 @0803771C: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x020245b4 movs r2, 0x64 bl link_0800A448 b @08037986 .align 2, 0 .pool @08037734: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @08037742 b @080379D6 @08037742: bl sub_800A5B4 ldr r0, =0x020229e8 lsls r1, r6, 3 subs r1, r6 lsls r1, 2 adds r1, r0 ldrh r0, [r1, 0x18] cmp r0, 0 beq @08037788 ldr r4, =0x020245b4 lsls r1, r7, 8 ldr r5, =0x020223c4 adds r1, r5 adds r0, r4, 0 movs r2, 0x64 bl memcpy movs r2, 0x96 lsls r2, 1 adds r4, r2 lsls r1, r6, 8 adds r1, r5 adds r0, r4, 0 movs r2, 0x64 bl memcpy b @08037986 .align 2, 0 .pool @08037788: ldr r4, =0x020245b4 lsls r1, r6, 8 ldr r5, =0x020223c4 adds r1, r5 adds r0, r4, 0 movs r2, 0x64 bl memcpy movs r0, 0x96 lsls r0, 1 adds r4, r0 lsls r1, r7, 8 adds r1, r5 adds r0, r4, 0 movs r2, 0x64 b @08037982 .align 2, 0 .pool @080377B0: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @080377BC b @080379D6 @080377BC: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x02024744 b @08037686 .align 2, 0 .pool @080377CC: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @080377DA b @080379D6 @080377DA: bl sub_800A5B4 bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @080377EA b @08037986 @080377EA: ldr r0, =0x02024744 ldr r1, =0x020223c4 movs r2, 0xC8 b @08037982 .align 2, 0 .pool @080377FC: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @08037808 b @080379D6 @08037808: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x0202480c b @08037686 .align 2, 0 .pool @08037818: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @08037826 b @080379D6 @08037826: bl sub_800A5B4 bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @08037836 b @08037986 @08037836: ldr r0, =0x0202480c ldr r1, =0x020223c4 movs r2, 0xC8 b @08037982 .align 2, 0 .pool @08037848: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @08037854 b @080379D6 @08037854: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x020248d4 b @08037686 .align 2, 0 .pool @08037864: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @08037872 b @080379D6 @08037872: bl sub_800A5B4 bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 beq @0803788A ldr r0, =0x020248d4 ldr r1, =0x020223c4 movs r2, 0xC8 bl memcpy @0803788A: ldr r4, =0x020244ec adds r0, r4, 0 bl shedinja_something adds r0, r4, 0 adds r0, 0x64 bl shedinja_something adds r0, r4, 0 adds r0, 0xC8 bl shedinja_something movs r1, 0x96 lsls r1, 1 adds r0, r4, r1 bl shedinja_something movs r2, 0xC8 lsls r2, 1 adds r0, r4, r2 bl shedinja_something movs r1, 0xFA lsls r1, 1 adds r0, r4, r1 bl shedinja_something ldr r4, =0x02024744 adds r0, r4, 0 bl shedinja_something adds r0, r4, 0 adds r0, 0x64 bl shedinja_something adds r0, r4, 0 adds r0, 0xC8 bl shedinja_something movs r2, 0x96 lsls r2, 1 adds r0, r4, r2 bl shedinja_something movs r1, 0xC8 lsls r1, 1 adds r0, r4, r1 bl shedinja_something movs r2, 0xFA lsls r2, 1 adds r0, r4, r2 bl shedinja_something b @08037986 .align 2, 0 .pool @08037908: bl sub_8032768 bl sub_8184E58 ldr r2, =0x02024332 movs r0, 0 strb r0, [r2, 0x1] strb r0, [r2, 0x2] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @08037934 movs r0, 0xE strb r0, [r2] b @080379D6 .align 2, 0 .pool @08037934: movs r0, 0x10 strb r0, [r2] b @080379D6 @0803793A: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080379D6 bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203bd2c movs r2, 0x4 bl link_0800A448 b @08037986 .align 2, 0 .pool @0803795C: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 bne @080379D6 bl sub_800A5B4 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x4 ands r0, r1 cmp r0, 0 bne @08037986 ldr r0, =0x0203bd2c lsls r1, r7, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x4 @08037982: bl memcpy @08037986: ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080379D6 .align 2, 0 .pool @080379A0: ldr r0, =0x02024333 adds r1, r0, 0x1 bl battle_load_something lsls r0, 24 cmp r0, 0 beq @080379D6 bl sub_8166188 ldr r2, =0x03005d00 ldr r1, =0x030022c0 ldr r0, [r1] str r0, [r2] ldr r0, =sub_8039EF0 str r0, [r1] ldr r0, =sub_8038420 bl set_callback2 ldr r2, =0x02022fec ldr r1, [r2] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080379D6 movs r0, 0x20 orrs r1, r0 str r1, [r2] @080379D6: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8037458 thumb_func_start sub_80379F8 sub_80379F8: ; 80379F8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 str r0, [sp] movs r0, 0 mov r8, r0 ldr r6, =0x02022ff8 mov r10, r6 @08037A12: ldr r1, [sp] add r1, r8 movs r0, 0x64 adds r4, r1, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr mov r1, r8 lsls r5, r1, 5 strh r0, [r6] adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr strh r0, [r6, 0x2] movs r0, 0x4 add r0, r10 mov r9, r0 adds r7, r5, r0 adds r0, r4, 0 movs r1, 0x2 adds r2, r7, 0 bl pokemon_getattr adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr strb r0, [r6, 0xF] adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr strh r0, [r6, 0x10] adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr strh r0, [r6, 0x12] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr mov r1, r10 adds r1, 0x14 adds r5, r1 str r0, [r5] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [r6, 0x18] adds r0, r4, 0 bl pokemon_get_gender strb r0, [r6, 0x1C] adds r0, r7, 0 bl 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, =0x02023058 ldr r0, [r0] mov r1, r9 subs r1, 0x4 movs r2, 0x60 bl memcpy add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80379F8 thumb_func_start sub_8037ADC sub_8037ADC: ; 8037ADC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r0, 0x4 mov r9, r0 movs r4, 0xF ldr r6, =0x02022fec ldr r0, [r6] movs r1, 0x80 lsls r1, 1 ands r0, r1 cmp r0, 0 beq @08037B02 movs r1, 0x2 mov r9, r1 movs r4, 0x3 @08037B02: bl link_get_multiplayer_id lsls r0, 24 lsrs r7, r0, 24 ldr r0, =0x02024474 adds r0, 0x25 movs r2, 0 mov r8, r2 strb r7, [r0] ldr r0, =0x0202449c ldr r0, [r0] adds r1, r0, 0 adds r1, 0xB4 str r1, [sp] adds r0, 0xAC mov r10, r0 bl run_active_tasks bl call_obj_callbacks bl obj_sync_something ldr r5, =0x02024332 ldrb r0, [r5] cmp r0, 0x1 beq @08037BA4 cmp r0, 0x1 bgt @08037B50 cmp r0, 0 beq @08037B5E b @08037D0A .align 2, 0 .pool @08037B50: cmp r0, 0x2 bne @08037B56 b @08037C64 @08037B56: cmp r0, 0x3 bne @08037B5C b @08037C9E @08037B5C: b @08037D0A @08037B5E: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08037B68 b @08037D0A @08037B68: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @08037B74 b @08037D0A @08037B74: ldr r4, =0x02023058 movs r0, 0x60 bl 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 .pool @08037BA4: bl sub_800A550 adds r1, r4, 0 ands r1, r0 cmp r1, r4 beq @08037BB2 b @08037D0A @08037BB2: bl sub_800A5B4 movs r5, 0 cmp r8, r9 bge @08037C2E lsls r0, r7, 3 subs r0, r7 lsls r6, r0, 2 mov r8, r5 ldr r4, =0x020223c4 @08037BC6: cmp r5, r7 beq @08037C1E mov r2, r9 cmp r2, 0x4 bne @08037C14 ldr r2, =0x020229e8 mov r1, r8 adds r0, r1, r2 ldrh r1, [r0, 0x18] movs r3, 0x1 adds r0, r3, 0 ands r0, r1 cmp r0, 0 bne @08037BF8 adds r0, r6, r2 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @08037C04 b @08037C1E .align 2, 0 .pool @08037BF8: adds r0, r6, r2 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @08037C1E @08037C04: ldr r0, =0x02022ff8 adds r1, r4, 0 movs r2, 0x60 bl memcpy b @08037C1E .align 2, 0 .pool @08037C14: ldr r0, =0x02022ff8 adds r1, r4, 0 movs r2, 0x60 bl memcpy @08037C1E: movs r2, 0x80 lsls r2, 1 adds r4, r2 movs r0, 0x1C add r8, r0 adds r5, 0x1 cmp r5, r9 blt @08037BC6 @08037C2E: ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r1, =0x030022c0 ldr r0, [r1, 0x8] ldr r2, [sp] str r0, [r2] ldr r0, =0x02022fec ldr r0, [r0] mov r2, r10 str r0, [r2] ldr r0, =sub_8037ADC str r0, [r1, 0x8] bl sub_81B9150 b @08037D0A .align 2, 0 .pool @08037C64: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08037D0A ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08037D0A ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08037C98 bl sub_800ADF8 b @08037D0A .align 2, 0 .pool @08037C98: bl sub_800AC34 b @08037D0A @08037C9E: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08037CE4 bl sub_8010500 lsls r0, 24 cmp r0, 0 beq @08037D0A mov r1, r10 ldr r0, [r1] str r0, [r6] ldr r1, =0x030022c0 ldr r2, [sp] ldr r0, [r2] str r0, [r1, 0x8] ldr r0, =sub_80367D4 bl set_callback2 ldr r4, =0x02023058 ldr r0, [r4] bl free mov r0, r8 str r0, [r4] b @08037D0A .align 2, 0 .pool @08037CE4: ldr r0, =0x03003124 ldrb r5, [r0] cmp r5, 0 bne @08037D0A mov r1, r10 ldr r0, [r1] str r0, [r6] ldr r1, =0x030022c0 ldr r2, [sp] ldr r0, [r2] str r0, [r1, 0x8] ldr r0, =sub_80367D4 bl set_callback2 ldr r4, =0x02023058 ldr r0, [r4] bl free str r5, [r4] @08037D0A: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8037ADC thumb_func_start intro_end intro_end: ; 8037D2C push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x0202449c ldr r0, [r0] movs r1, 0xB4 adds r1, r0 mov r8, r1 adds r7, r0, 0 adds r7, 0xAC bl run_active_tasks bl call_obj_callbacks bl obj_sync_something ldr r5, =0x02024332 ldrb r0, [r5] cmp r0, 0 beq @08037D64 cmp r0, 0x1 beq @08037DA4 b @08037DD6 .align 2, 0 .pool @08037D64: ldr r4, =0x02023058 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, =0x030022c0 ldr r0, [r1, 0x8] mov r2, r8 str r0, [r2] ldr r0, =0x02022fec ldr r0, [r0] str r0, [r7] ldr r0, =intro_end str r0, [r1, 0x8] bl sub_81B9150 b @08037DD6 .align 2, 0 .pool @08037DA4: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 bne @08037DD6 movs r0, 0x2 strb r0, [r5] ldr r1, =0x02022fec ldr r0, [r7] str r0, [r1] ldr r1, =0x030022c0 mov r2, r8 ldr r0, [r2] str r0, [r1, 0x8] ldr r0, =sub_80367D4 bl set_callback2 ldr r4, =0x02023058 ldr r0, [r4] bl free str r6, [r4] @08037DD6: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end intro_end thumb_func_start sub_8037DF4 sub_8037DF4: ; 8037DF4 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 bl link_get_multiplayer_id lsls r0, 24 lsrs r7, r0, 24 ldr r0, =0x02024474 adds r0, 0x25 strb r7, [r0] bl run_active_tasks bl call_obj_callbacks bl obj_sync_something ldr r0, =0x02024332 ldrb r0, [r0] cmp r0, 0xA bls @08037E20 b @080383F8 @08037E20: lsls r0, 2 ldr r1, =@08037E38 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08037E38: .4byte @08037E64 .4byte @08037EA8 .4byte @08037F50 .4byte @08038026 .4byte @0803804C .4byte @08038140 .4byte @08038164 .4byte @080382CC .4byte @0803832C .4byte @0803836C .4byte @080383BC @08037E64: bl 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, =0x02024332 movs r0, 0x1 strb r0, [r1] @08037E90: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08037E9A b @080383F8 @08037E9A: bl sub_800E0E8 b @080383F8 .align 2, 0 .pool @08037EA8: ldr r2, =0x02022fec ldr r1, [r2] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08037F30 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08037EBE b @080383F8 @08037EBE: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08037F02 ldr r4, =0x0202449c ldr r0, [r4] movs r5, 0xC0 lsls r5, 1 adds r0, r5 movs r1, 0 strb r1, [r0] ldr r0, [r4] ldr r2, =0x00000181 adds r1, r0, r2 movs r0, 0x3 strb r0, [r1] bl sub_8036A5C bl sub_8036B44 bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, [r4] adds r1, r5 movs r2, 0x20 bl link_0800A448 ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @08037F02: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08037F0C b @080383F8 @08037F0C: movs r0, 0 movs r1, 0 bl sub_800DFB4 b @080383F8 .align 2, 0 .pool @08037F30: movs r0, 0x80 lsls r0, 17 ands r0, r1 cmp r0, 0 bne @08037F40 movs r0, 0x4 orrs r1, r0 str r1, [r2] @08037F40: ldr r1, =0x02024332 movs r0, 0x7 strb r0, [r1] bl berry_801017C b @080383F8 .align 2, 0 .pool @08037F50: bl sub_800A550 movs r1, 0xF ands r1, r0 cmp r1, 0xF beq @08037F5E b @080383F8 @08037F5E: bl sub_800A5B4 movs r0, 0x4 adds r1, r7, 0 bl sub_8036EB8 bl berry_801017C bl sub_8068AA4 ldr r0, =task00_0800F6FC movs r1, 0 bl AddTask lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 movs r2, 0 movs r1, 0x87 lsls r1, 1 strh r1, [r0, 0xA] movs r1, 0x5A strh r1, [r0, 0xC] strh r2, [r0, 0x12] strh r2, [r0, 0xE] strh r2, [r0, 0x10] ldr r1, =0x020223c4 adds r4, r0, 0 adds r5, r1, 0x2 movs r7, 0x3F movs r6, 0x3 @08037FA4: ldrh r0, [r5] str r2, [sp] bl sub_8185F90 ldr r0, =0x020229e8 ldr r2, [sp] adds r0, r2, r0 ldrh r0, [r0, 0x18] cmp r0, 0x1 beq @08037FE6 cmp r0, 0x1 bgt @08037FD4 cmp r0, 0 beq @08037FDE b @0803800C .align 2, 0 .pool @08037FD4: cmp r0, 0x2 beq @08037FEE cmp r0, 0x3 beq @08037FFE b @0803800C @08037FDE: ldrh r0, [r5] adds r1, r7, 0 ands r1, r0 b @08037FF6 @08037FE6: ldrh r0, [r5] adds r1, r7, 0 ands r1, r0 b @08038006 @08037FEE: ldrh r0, [r5] adds r1, r7, 0 ands r1, r0 lsls r1, 6 @08037FF6: ldrh r0, [r4, 0xE] orrs r1, r0 strh r1, [r4, 0xE] b @0803800C @08037FFE: ldrh r0, [r5] adds r1, r7, 0 ands r1, r0 lsls r1, 6 @08038006: ldrh r0, [r4, 0x10] orrs r1, r0 strh r1, [r4, 0x10] @0803800C: movs r0, 0x80 lsls r0, 1 adds r5, r0 adds r2, 0x1C subs r6, 0x1 cmp r6, 0 bge @08037FA4 bl zero_enemy_party_data ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @08038026: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @08038032 b @080383F8 @08038032: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x020244ec movs r2, 0xC8 bl link_0800A448 b @080383A6 .align 2, 0 .pool @0803804C: bl sub_800A550 movs r1, 0xF ands r1, r0 cmp r1, 0xF beq @0803805A b @080383F8 @0803805A: bl sub_800A5B4 movs r6, 0 lsls r0, r7, 3 subs r0, r7 lsls r0, 2 mov r8, r0 ldr r4, =0x020223c4 movs r5, 0 @0803806C: cmp r6, r7 bne @080380A0 ldr r0, =0x020229e8 adds r0, r5, r0 ldrh r0, [r0, 0x18] cmp r0, 0x2 bgt @0803808C cmp r0, 0x1 bge @08038098 cmp r0, 0 beq @08038090 b @0803812A .align 2, 0 .pool @0803808C: cmp r0, 0x3 bne @0803812A @08038090: ldr r0, =0x020244ec b @08038110 .align 2, 0 .pool @08038098: ldr r0, =0x02024618 b @08038110 .align 2, 0 .pool @080380A0: ldr r2, =0x020229e8 adds r0, r5, r2 ldrh r1, [r0, 0x18] movs r3, 0x1 adds r0, r3, 0 ands r0, r1 cmp r0, 0 bne @080380C4 mov r1, r8 adds r0, r1, r2 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @080380D2 b @080380F8 .align 2, 0 .pool @080380C4: mov r1, r8 adds r0, r1, r2 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @080380F8 @080380D2: adds r0, r5, r2 ldrh r0, [r0, 0x18] cmp r0, 0x2 bgt @080380E4 cmp r0, 0x1 bge @080380F0 cmp r0, 0 beq @080380E8 b @0803812A @080380E4: cmp r0, 0x3 bne @0803812A @080380E8: ldr r0, =0x020244ec b @08038110 .align 2, 0 .pool @080380F0: ldr r0, =0x02024618 b @08038110 .align 2, 0 .pool @080380F8: adds r0, r5, r2 ldrh r0, [r0, 0x18] cmp r0, 0x2 bgt @0803810A cmp r0, 0x1 bge @08038120 cmp r0, 0 beq @0803810E b @0803812A @0803810A: cmp r0, 0x3 bne @0803812A @0803810E: ldr r0, =0x02024744 @08038110: adds r1, r4, 0 movs r2, 0xC8 bl memcpy b @0803812A .align 2, 0 .pool @08038120: ldr r0, =0x02024870 adds r1, r4, 0 movs r2, 0xC8 bl memcpy @0803812A: movs r2, 0x80 lsls r2, 1 adds r4, r2 adds r5, 0x1C adds r6, 0x1 cmp r6, 0x3 ble @0803806C b @080383A6 .align 2, 0 .pool @08038140: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @0803814C b @080383F8 @0803814C: bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, =0x020245b4 movs r2, 0x64 bl link_0800A448 b @080383A6 .align 2, 0 .pool @08038164: bl sub_800A550 movs r1, 0xF ands r1, r0 cmp r1, 0xF beq @08038172 b @080383F8 @08038172: bl sub_800A5B4 movs r6, 0 lsls r0, r7, 3 subs r0, r7 lsls r0, 2 mov r8, r0 ldr r4, =0x020223c4 movs r5, 0 @08038184: cmp r6, r7 bne @080381B8 ldr r0, =0x020229e8 adds r0, r5, r0 ldrh r0, [r0, 0x18] cmp r0, 0x2 bgt @080381A4 cmp r0, 0x1 bge @080381B0 cmp r0, 0 beq @080381A8 b @08038242 .align 2, 0 .pool @080381A4: cmp r0, 0x3 bne @08038242 @080381A8: ldr r0, =0x020245b4 b @08038228 .align 2, 0 .pool @080381B0: ldr r0, =0x020246e0 b @08038228 .align 2, 0 .pool @080381B8: ldr r2, =0x020229e8 adds r0, r5, r2 ldrh r1, [r0, 0x18] movs r3, 0x1 adds r0, r3, 0 ands r0, r1 cmp r0, 0 bne @080381DC mov r1, r8 adds r0, r1, r2 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @080381EA b @08038210 .align 2, 0 .pool @080381DC: mov r1, r8 adds r0, r1, r2 ldrh r1, [r0, 0x18] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @08038210 @080381EA: adds r0, r5, r2 ldrh r0, [r0, 0x18] cmp r0, 0x2 bgt @080381FC cmp r0, 0x1 bge @08038208 cmp r0, 0 beq @08038200 b @08038242 @080381FC: cmp r0, 0x3 bne @08038242 @08038200: ldr r0, =0x020245b4 b @08038228 .align 2, 0 .pool @08038208: ldr r0, =0x020246e0 b @08038228 .align 2, 0 .pool @08038210: adds r0, r5, r2 ldrh r0, [r0, 0x18] cmp r0, 0x2 bgt @08038222 cmp r0, 0x1 bge @08038238 cmp r0, 0 beq @08038226 b @08038242 @08038222: cmp r0, 0x3 bne @08038242 @08038226: ldr r0, =0x0202480c @08038228: adds r1, r4, 0 movs r2, 0x64 bl memcpy b @08038242 .align 2, 0 .pool @08038238: ldr r0, =0x02024938 adds r1, r4, 0 movs r2, 0x64 bl memcpy @08038242: movs r2, 0x80 lsls r2, 1 adds r4, r2 adds r5, 0x1C adds r6, 0x1 cmp r6, 0x3 ble @08038184 ldr r4, =0x020244ec adds r0, r4, 0 bl shedinja_something adds r0, r4, 0 adds r0, 0x64 bl shedinja_something adds r0, r4, 0 adds r0, 0xC8 bl shedinja_something movs r1, 0x96 lsls r1, 1 adds r0, r4, r1 bl shedinja_something movs r2, 0xC8 lsls r2, 1 adds r0, r4, r2 bl shedinja_something movs r1, 0xFA lsls r1, 1 adds r0, r4, r1 bl shedinja_something ldr r4, =0x02024744 adds r0, r4, 0 bl shedinja_something adds r0, r4, 0 adds r0, 0x64 bl shedinja_something adds r0, r4, 0 adds r0, 0xC8 bl shedinja_something movs r2, 0x96 lsls r2, 1 adds r0, r4, r2 bl shedinja_something movs r1, 0xC8 lsls r1, 1 adds r0, r4, r1 bl shedinja_something movs r2, 0xFA lsls r2, 1 adds r0, r4, r2 bl shedinja_something b @080383A6 .align 2, 0 .pool @080382CC: bl sub_8032768 bl sub_8184E58 ldr r3, =0x02024332 movs r0, 0 strb r0, [r3, 0x1] strb r0, [r3, 0x2] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @08038326 movs r6, 0 ldr r0, =0x020229e8 ldrb r1, [r0] adds r4, r3, 0 adds r2, r0, 0 cmp r1, 0x3 bne @0803830A movs r3, 0xFF @080382F8: adds r2, 0x1C adds r6, 0x1 cmp r6, 0x3 bgt @0803830A ldrh r1, [r2] adds r0, r3, 0 ands r0, r1 cmp r0, 0x3 beq @080382F8 @0803830A: cmp r6, 0x4 bne @08038320 movs r0, 0x8 strb r0, [r4] b @080383F8 .align 2, 0 .pool @08038320: movs r0, 0xA strb r0, [r4] b @080383F8 @08038326: movs r0, 0xA strb r0, [r3] b @080383F8 @0803832C: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080383F8 ldr r0, =0x0202449c ldr r4, [r0] movs r0, 0xC0 lsls r0, 1 adds r4, r0 ldr r0, =0x02022fec ldr r0, [r0] str r0, [r4] ldr r0, =0x0203bd2c ldr r0, [r0] str r0, [r4, 0x4] bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 movs r2, 0x8 bl link_0800A448 b @080383A6 .align 2, 0 .pool @0803836C: bl sub_800A550 movs r1, 0xF ands r1, r0 cmp r1, 0xF bne @080383F8 bl sub_800A5B4 movs r2, 0 b @08038386 @08038380: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 @08038386: cmp r2, 0x3 bhi @080383A6 ldr r4, =0x020223c4 lsls r3, r2, 8 adds r0, r3, r4 ldrh r0, [r0] movs r1, 0x4 ands r0, r1 cmp r0, 0 beq @08038380 adds r1, r4, 0x4 adds r1, r3, r1 ldr r0, =0x0203bd2c movs r2, 0x4 bl memcpy @080383A6: ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080383F8 .align 2, 0 .pool @080383BC: ldr r0, =0x02024333 adds r1, r0, 0x1 bl battle_load_something lsls r0, 24 cmp r0, 0 beq @080383F8 ldr r2, =0x03005d00 ldr r1, =0x030022c0 ldr r0, [r1] str r0, [r2] ldr r0, =sub_8039EF0 str r0, [r1] ldr r0, =sub_8038420 bl set_callback2 ldr r3, =0x02022fec ldr r2, [r3] movs r0, 0x2 ands r0, r2 cmp r0, 0 beq @080383F8 ldr r0, =0x02038bca movs r4, 0x80 lsls r4, 4 adds r1, r4, 0 strh r1, [r0] movs r0, 0x20 orrs r2, r0 str r2, [r3] @080383F8: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2C] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08038482 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @08038482 bl rfu_lacks_rfufunc lsls r0, 24 cmp r0, 0 beq @08038482 ldr r2, =0x020375f0 ldr r1, =0x0202433a movs r0, 0x5 strb r0, [r1] movs r0, 0x5 strh r0, [r2] bl pal_fade_control_reset_maybe movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =sub_80384E4 bl set_callback2 @08038482: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8038420 thumb_func_start sub_803849C sub_803849C: ; 803849C push {lr} ldr r1, =0x030022c0 ldr r0, =0x03005d00 ldr r0, [r0] str r0, [r1] ldr r2, =0x02039b28 movs r0, 0x3 strb r0, [r2, 0x15] ldr r0, =0x00000439 adds r1, r0 ldrb r2, [r1] movs r0, 0x3 negs r0, r0 ands r0, r2 strb r0, [r1] bl zero_enemy_party_data movs r0, 0x5A bl m4aSongNumStop bl sub_805F094 bl dp11_free bl sub_8057028 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803849C thumb_func_start sub_80384E4 sub_80384E4: ; 80384E4 push {lr} bl fade_and_return_progress_probably ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08038512 ldr r0, =0x030075f0 bl MPlayStop_rev01 ldr r0, =0x03007630 bl MPlayStop_rev01 bl sub_803849C bl Window_FreeMemory ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 @08038512: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80384E4 thumb_func_start sub_8038528 sub_8038528: ; 8038528 movs r1, 0 strh r1, [r0, 0x2E] ldr r1, =sub_8038538 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool thumb_func_end sub_8038528 thumb_func_start sub_8038538 sub_8038538: ; 8038538 push {r4,r5,lr} adds r3, r0, 0 ldr r5, =0x0201c000 movs r0, 0x2E ldrsh r1, [r3, r0] cmp r1, 0x1 beq @0803856C cmp r1, 0x1 bgt @08038554 cmp r1, 0 beq @0803855A b @080385DC .align 2, 0 .pool @08038554: cmp r1, 0x2 beq @080385C8 b @080385DC @0803855A: ldrh r0, [r3, 0x2E] adds r0, 0x1 strh r0, [r3, 0x2E] strh r1, [r3, 0x30] ldr r0, =0x00000281 strh r0, [r3, 0x32] strh r1, [r3, 0x34] movs r0, 0x1 strh r0, [r3, 0x36] @0803856C: ldrh r0, [r3, 0x36] subs r0, 0x1 strh r0, [r3, 0x36] lsls r0, 16 cmp r0, 0 bne @080385DC movs r0, 0x2 strh r0, [r3, 0x36] movs r4, 0x30 ldrsh r2, [r3, r4] movs r0, 0x34 ldrsh r1, [r3, r0] lsls r1, 5 adds r2, r1 movs r4, 0x32 ldrsh r0, [r3, r4] subs r0, r1 movs r4, 0x3D lsls r0, 1 adds r0, r5 lsls r2, 1 adds r2, r5 movs r1, 0x1C @0803859A: strh r4, [r2] strh r4, [r0] adds r0, 0x4 adds r2, 0x4 subs r1, 0x2 cmp r1, 0 bge @0803859A ldrh r0, [r3, 0x34] adds r0, 0x1 strh r0, [r3, 0x34] lsls r0, 16 asrs r0, 16 cmp r0, 0x15 bne @080385DC ldrh r0, [r3, 0x2E] adds r0, 0x1 strh r0, [r3, 0x2E] movs r0, 0x20 strh r0, [r3, 0x30] b @080385DC .align 2, 0 .pool @080385C8: ldrh r0, [r3, 0x30] subs r0, 0x1 strh r0, [r3, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x14 bne @080385DC ldr r0, =sub_8036760 bl set_callback2 @080385DC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022fec ldr r0, [r4] ldr r1, =0x043f0908 ands r0, r1 ldr r1, [sp, 0x14] lsls r1, 2 str r1, [sp, 0x20] cmp r0, 0x8 beq @08038624 b @080389D2 @08038624: cmp r2, 0x1 bne @0803862C bl zero_enemy_party_data @0803862C: ldr r0, [r4] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 beq @08038668 ldr r0, =gTrainers ldr r2, [sp, 0x20] ldr r3, [sp, 0x14] adds r1, r2, r3 lsls r1, 3 adds r1, r0 adds r2, r1, 0 adds r2, 0x20 ldrb r1, [r2] movs r4, 0x3 str r4, [sp, 0x1C] adds r4, r0, 0 cmp r1, 0x3 bhi @0803867C adds r2, r1, 0 str r2, [sp, 0x1C] b @0803867C .align 2, 0 .pool @08038668: ldr r1, =gTrainers ldr r2, [sp, 0x20] ldr r3, [sp, 0x14] adds r0, r2, r3 lsls r0, 3 adds r0, r1 adds r0, 0x20 ldrb r0, [r0] str r0, [sp, 0x1C] adds r4, r1, 0 @0803867C: movs r0, 0 str r0, [sp, 0x18] b @080389B4 .align 2, 0 .pool @08038688: ldr r2, [sp, 0x20] ldr r3, [sp, 0x14] adds r0, r2, r3 lsls r0, 3 adds r1, r0, r4 ldrb r0, [r1, 0x18] cmp r0, 0x1 bne @0803869E movs r0, 0x80 mov r10, r0 b @080386B0 @0803869E: ldrb r1, [r1, 0x2] movs r0, 0x80 ands r0, r1 movs r1, 0x88 mov r10, r1 cmp r0, 0 beq @080386B0 movs r2, 0x78 mov r10, r2 @080386B0: movs r6, 0 ldr r2, [sp, 0x20] ldr r3, [sp, 0x14] adds r0, r2, r3 lsls r0, 3 adds r1, r4, 0x4 adds r0, r1 ldrb r0, [r0] ldr r3, [sp, 0x18] adds r3, 0x1 str r3, [sp, 0x24] cmp r0, 0xFF beq @080386E6 adds r3, r1, 0 @080386CC: ldr r0, [sp, 0x14] adds r1, r2, r0 lsls r1, 3 adds r0, r6, r1 adds r0, r3 ldrb r0, [r0] add r9, r0 adds r6, 0x1 adds r1, r6, r1 adds r1, r3 ldrb r0, [r1] cmp r0, 0xFF bne @080386CC @080386E6: ldr r1, [sp, 0x20] ldr r2, [sp, 0x14] adds r0, r1, r2 lsls r1, r0, 3 adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0x1 beq @08038794 cmp r0, 0x1 bgt @08038700 cmp r0, 0 beq @0803870E b @080389AC @08038700: cmp r0, 0x2 bne @08038706 b @08038854 @08038706: cmp r0, 0x3 bne @0803870C b @080388E8 @0803870C: b @080389AC @0803870E: adds r0, r4, 0 adds r0, 0x24 adds r0, r1, r0 ldr r4, [r0] movs r6, 0 ldr r3, [sp, 0x18] lsls r2, r3, 3 adds r0, r2, r4 ldrh r1, [r0, 0x4] movs r0, 0xB muls r0, r1 ldr r1, =gSpeciesNames adds r0, r1 ldrb r0, [r0] adds r5, r2, 0 cmp r0, 0xFF beq @08038750 adds r3, r1, 0 movs r7, 0xB @08038734: adds r0, r2, r4 ldrh r0, [r0, 0x4] adds r1, r0, 0 muls r1, r7 adds r0, r6, r1 adds r0, r3 ldrb r0, [r0] add r9, r0 adds r6, 0x1 adds r1, r6, r1 adds r1, r3 ldrb r0, [r1] cmp r0, 0xFF bne @08038734 @08038750: mov r2, r9 lsls r0, r2, 8 add r10, r0 adds r4, r5, r4 ldrh r1, [r4] lsls r0, r1, 5 subs r0, r1 movs r1, 0xFF bl __divsi3 lsls r0, 24 lsrs r6, r0, 24 ldr r3, [sp, 0x18] movs r1, 0x64 adds r0, r3, 0 muls r0, r1 ldr r2, [sp, 0x10] adds r0, r2, r0 ldrh r1, [r4, 0x4] ldrb r2, [r4, 0x2] movs r3, 0x1 str r3, [sp] mov r3, r10 str r3, [sp, 0x4] movs r3, 0x2 str r3, [sp, 0x8] movs r3, 0 str r3, [sp, 0xC] adds r3, r6, 0 bl create_pokemon_set_level b @080389AC .align 2, 0 .pool @08038794: adds r0, r4, 0 adds r0, 0x24 adds r0, r1, r0 ldr r7, [r0] movs r6, 0 ldr r4, [sp, 0x18] lsls r2, r4, 4 adds r0, r2, r7 ldrh r1, [r0, 0x4] movs r0, 0xB muls r0, r1 ldr r1, =gSpeciesNames adds r0, r1 ldrb r0, [r0] mov r8, r2 cmp r0, 0xFF beq @080387D6 adds r3, r1, 0 movs r4, 0xB @080387BA: adds r0, r2, r7 ldrh r0, [r0, 0x4] adds r1, r0, 0 muls r1, r4 adds r0, r6, r1 adds r0, r3 ldrb r0, [r0] add r9, r0 adds r6, 0x1 adds r1, r6, r1 adds r1, r3 ldrb r0, [r1] cmp r0, 0xFF bne @080387BA @080387D6: mov r2, r9 lsls r0, r2, 8 add r10, r0 mov r3, r8 adds r4, r3, r7 ldrh r1, [r4] lsls r0, r1, 5 subs r0, r1 movs r1, 0xFF bl __divsi3 lsls r0, 24 lsrs r6, r0, 24 ldr r0, [sp, 0x18] movs r1, 0x64 adds r5, r0, 0 muls r5, r1 ldr r2, [sp, 0x10] adds r5, r2, r5 ldrh r1, [r4, 0x4] ldrb r2, [r4, 0x2] movs r0, 0x1 str r0, [sp] mov r3, r10 str r3, [sp, 0x4] movs r0, 0x2 str r0, [sp, 0x8] movs r0, 0 str r0, [sp, 0xC] adds r0, r5, 0 adds r3, r6, 0 bl create_pokemon_set_level movs r6, 0 mov r0, r8 adds r0, 0x6 adds r4, r7, r0 @08038820: adds r1, r6, 0 adds r1, 0xD adds r0, r5, 0 adds r2, r4, 0 bl pokemon_setattr adds r1, r6, 0 adds r1, 0x11 ldrh r0, [r4] lsls r2, r0, 1 adds r2, r0 lsls r2, 2 ldr r0, =gBattleMoves + 0x4 ; PP offset adds r2, r0 adds r0, r5, 0 bl pokemon_setattr adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @08038820 b @080389AC .align 2, 0 .pool @08038854: adds r0, r4, 0 adds r0, 0x24 adds r0, r1, r0 ldr r4, [r0] movs r6, 0 ldr r0, [sp, 0x18] lsls r2, r0, 3 adds r0, r2, r4 ldrh r1, [r0, 0x4] movs r0, 0xB muls r0, r1 ldr r1, =gSpeciesNames adds r0, r1 ldrb r0, [r0] adds r5, r2, 0 cmp r0, 0xFF beq @08038896 adds r3, r1, 0 movs r7, 0xB @0803887A: adds r0, r2, r4 ldrh r0, [r0, 0x4] adds r1, r0, 0 muls r1, r7 adds r0, r6, r1 adds r0, r3 ldrb r0, [r0] add r9, r0 adds r6, 0x1 adds r1, r6, r1 adds r1, r3 ldrb r0, [r1] cmp r0, 0xFF bne @0803887A @08038896: mov r2, r9 lsls r0, r2, 8 add r10, r0 adds r5, r4 ldrh r1, [r5] lsls r0, r1, 5 subs r0, r1 movs r1, 0xFF bl __divsi3 lsls r0, 24 lsrs r6, r0, 24 ldr r3, [sp, 0x18] movs r0, 0x64 adds r4, r3, 0 muls r4, r0 ldr r1, [sp, 0x10] adds r4, r1, r4 ldrh r1, [r5, 0x4] ldrb r2, [r5, 0x2] movs r0, 0x1 str r0, [sp] mov r3, r10 str r3, [sp, 0x4] movs r0, 0x2 str r0, [sp, 0x8] movs r0, 0 str r0, [sp, 0xC] adds r0, r4, 0 adds r3, r6, 0 bl create_pokemon_set_level adds r5, 0x6 adds r0, r4, 0 movs r1, 0xC adds r2, r5, 0 bl pokemon_setattr b @080389AC .align 2, 0 .pool @080388E8: adds r0, r4, 0 adds r0, 0x24 adds r0, r1, r0 ldr r7, [r0] movs r6, 0 ldr r4, [sp, 0x18] lsls r2, r4, 4 adds r0, r2, r7 ldrh r1, [r0, 0x4] movs r0, 0xB muls r0, r1 ldr r1, =gSpeciesNames adds r0, r1 ldrb r0, [r0] mov r8, r2 cmp r0, 0xFF beq @0803892A adds r3, r1, 0 movs r4, 0xB @0803890E: adds r0, r2, r7 ldrh r0, [r0, 0x4] adds r1, r0, 0 muls r1, r4 adds r0, r6, r1 adds r0, r3 ldrb r0, [r0] add r9, r0 adds r6, 0x1 adds r1, r6, r1 adds r1, r3 ldrb r0, [r1] cmp r0, 0xFF bne @0803890E @0803892A: mov r2, r9 lsls r0, r2, 8 add r10, r0 mov r3, r8 adds r5, r3, r7 ldrh r1, [r5] lsls r0, r1, 5 subs r0, r1 movs r1, 0xFF bl __divsi3 lsls r0, 24 lsrs r6, r0, 24 ldr r0, [sp, 0x18] movs r1, 0x64 adds r4, r0, 0 muls r4, r1 ldr r2, [sp, 0x10] adds r4, r2, r4 ldrh r1, [r5, 0x4] ldrb r2, [r5, 0x2] movs r0, 0x1 str r0, [sp] mov r3, r10 str r3, [sp, 0x4] movs r0, 0x2 str r0, [sp, 0x8] movs r0, 0 str r0, [sp, 0xC] adds r0, r4, 0 adds r3, r6, 0 bl create_pokemon_set_level adds r5, 0x6 adds r0, r4, 0 movs r1, 0xC adds r2, r5, 0 bl pokemon_setattr movs r6, 0 adds r5, r4, 0 mov r0, r8 adds r0, 0x8 adds r4, r7, r0 @08038982: adds r1, r6, 0 adds r1, 0xD adds r0, r5, 0 adds r2, r4, 0 bl pokemon_setattr adds r1, r6, 0 adds r1, 0x11 ldrh r0, [r4] lsls r2, r0, 1 adds r2, r0 lsls r2, 2 ldr r0, =gBattleMoves + 0x4 ; PP offset adds r2, r0 adds r0, r5, 0 bl pokemon_setattr adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @08038982 @080389AC: ldr r4, [sp, 0x24] str r4, [sp, 0x18] ldr r4, =gTrainers ldr r0, [sp, 0x18] @080389B4: ldr r1, [sp, 0x1C] cmp r0, r1 bge @080389BC b @08038688 @080389BC: ldr r2, =0x02022fec ldr r1, =gTrainers ldr r3, [sp, 0x20] ldr r4, [sp, 0x14] adds r0, r3, r4 lsls r0, 3 adds r0, r1 ldrb r1, [r0, 0x18] ldr r0, [r2] orrs r0, r1 str r0, [r2] @080389D2: ldr r0, =gTrainers ldr r2, [sp, 0x20] ldr r3, [sp, 0x14] adds r1, r2, r3 lsls r1, 3 adds r1, r0 adds r1, 0x20 ldrb r0, [r1] @080389E2: add sp, 0x28 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80385E8 thumb_func_start sub_8038A04 sub_8038A04: ; 8038A04 push {lr} ldr r0, =0x04000006 ldrh r0, [r0] subs r0, 0x6F lsls r0, 16 lsrs r0, 16 cmp r0, 0x30 bhi @08038A1E movs r1, 0x98 lsls r1, 8 movs r0, 0x8 bl lcd_io_set @08038A1E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8038A04 thumb_func_start vblank_cb_08078BB4 vblank_cb_08078BB4: ; 8038A28 push {lr} ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x013f0102 ands r0, r1 cmp r0, 0 bne @08038A3A bl GenerateRandomNumber @08038A3A: ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 bl lcd_io_set ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 bl lcd_io_set ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 bl lcd_io_set ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 bl lcd_io_set ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 bl lcd_io_set ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A bl lcd_io_set ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C bl lcd_io_set ldr r0, =0x02022e22 ldrh r1, [r0] movs r0, 0x1E bl lcd_io_set ldr r0, =0x02022e24 ldrh r1, [r0] movs r0, 0x40 bl lcd_io_set ldr r0, =0x02022e26 ldrh r1, [r0] movs r0, 0x44 bl lcd_io_set ldr r0, =0x02022e28 ldrh r1, [r0] movs r0, 0x42 bl lcd_io_set ldr r0, =0x02022e2a 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 .pool thumb_func_end vblank_cb_08078BB4 thumb_func_start nullsub_17 nullsub_17: ; 8038B00 bx lr thumb_func_end nullsub_17 thumb_func_start sub_8038B04 sub_8038B04: ; 8038B04 push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x2E ldrsh r0, [r5, r1] cmp r0, 0 beq @08038B24 movs r1, 0x32 ldrsh r0, [r5, r1] movs r1, 0xFF lsls r1, 8 ands r0, r1 lsrs r0, 8 ldrh r1, [r5, 0x30] adds r0, r1 strh r0, [r5, 0x20] b @08038B36 @08038B24: movs r1, 0x32 ldrsh r0, [r5, r1] movs r1, 0xFF lsls r1, 8 ands r0, r1 asrs r0, 8 ldrh r1, [r5, 0x30] subs r1, r0 strh r1, [r5, 0x20] @08038B36: movs r1, 0xC0 lsls r1, 1 adds r0, r1, 0 ldrh r1, [r5, 0x32] adds r0, r1 strh r0, [r5, 0x32] adds r0, r5, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @08038B6A ldr r4, =0x00002710 adds r0, r4, 0 bl 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 .pool thumb_func_end sub_8038B04 thumb_func_start sub_8038B74 sub_8038B74: ; 8038B74 push {r4,lr} adds r4, r0, 0 movs r1, 0x1 bl sub_8008258 ldr r0, =sub_8038B04 str r0, [r4, 0x1C] movs r0, 0x68 bl audio_play pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8038B74 thumb_func_start sub_8038B94 sub_8038B94: ; 8038B94 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 lsls r0, 24 lsrs r0, 24 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] ldr r0, =0x02024474 adds r0, 0x25 ldrb r2, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08038C04 ldr r1, =0x020229e8 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x18] cmp r0, 0x1 beq @08038BF0 cmp r0, 0x1 bgt @08038BE8 cmp r0, 0 beq @08038C04 b @08038C0C .align 2, 0 .pool @08038BE8: cmp r0, 0x2 beq @08038C04 cmp r0, 0x3 bne @08038C0C @08038BF0: ldr r0, =0x02024744 str r0, [sp, 0x4] ldr r1, =0x020244ec str r1, [sp, 0x8] b @08038C0C .align 2, 0 .pool @08038C04: ldr r2, =0x020244ec str r2, [sp, 0x4] ldr r3, =0x02024744 str r3, [sp, 0x8] @08038C0C: movs r7, 0 movs r0, 0 mov r8, r0 ldr r1, [sp] lsls r1, 2 str r1, [sp, 0xC] movs r2, 0xCE lsls r2, 1 mov r10, r2 mov r9, r0 @08038C20: movs r0, 0x64 mov r4, r8 muls r4, r0 ldr r3, [sp, 0x4] adds r4, r3, r4 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr lsls r0, 16 lsrs r6, r0, 16 adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr adds r1, r0, 0 cmp r5, 0 beq @08038C90 cmp r5, r10 beq @08038C64 cmp r6, 0 beq @08038C64 cmp r1, 0 bne @08038C64 movs r0, 0x1 mov r2, r9 lsls r0, r2 orrs r7, r0 @08038C64: cmp r5, 0 beq @08038C90 cmp r6, 0 beq @08038C7C cmp r5, r10 beq @08038C74 cmp r1, 0 beq @08038C7C @08038C74: movs r0, 0x2 mov r3, r9 lsls r0, r3 orrs r7, r0 @08038C7C: cmp r5, 0 beq @08038C90 cmp r5, r10 beq @08038C90 cmp r6, 0 bne @08038C90 movs r0, 0x3 mov r1, r9 lsls r0, r1 orrs r7, r0 @08038C90: movs r2, 0x2 add r9, r2 movs r3, 0x1 add r8, r3 mov r0, r8 cmp r0, 0x5 ble @08038C20 ldr r1, =0x03005e00 ldr r2, [sp, 0xC] ldr r3, [sp] adds r0, r2, r3 lsls r0, 3 adds r0, r1 strh r7, [r0, 0xE] movs r7, 0 movs r0, 0 mov r8, r0 movs r1, 0xCE lsls r1, 1 mov r10, r1 mov r9, r0 @08038CBA: movs r0, 0x64 mov r4, r8 muls r4, r0 ldr r2, [sp, 0x8] adds r4, r2, r4 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr lsls r0, 16 lsrs r6, r0, 16 adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr adds r1, r0, 0 cmp r5, 0 beq @08038D2A cmp r5, r10 beq @08038CFE cmp r6, 0 beq @08038CFE cmp r1, 0 bne @08038CFE movs r0, 0x1 mov r3, r9 lsls r0, r3 orrs r7, r0 @08038CFE: cmp r5, 0 beq @08038D2A cmp r6, 0 beq @08038D16 cmp r5, r10 beq @08038D0E cmp r1, 0 beq @08038D16 @08038D0E: movs r0, 0x2 mov r1, r9 lsls r0, r1 orrs r7, r0 @08038D16: cmp r5, 0 beq @08038D2A cmp r5, r10 beq @08038D2A cmp r6, 0 bne @08038D2A movs r0, 0x3 mov r2, r9 lsls r0, r2 orrs r7, r0 @08038D2A: movs r3, 0x2 add r9, r3 movs r0, 0x1 add r8, r0 mov r1, r8 cmp r1, 0x5 ble @08038CBA ldr r1, =0x03005e00 ldr r2, [sp, 0xC] ldr r3, [sp] adds r0, r2, r3 lsls r0, 3 adds r0, r1 strh r7, [r0, 0x10] add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8038B94 thumb_func_start sub_8038D64 sub_8038D64: ; 8038D64 push {r4,lr} sub sp, 0x4 movs r0, 0 bl SetHBlankCallback movs r0, 0 bl SetVBlankCallback ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0x21 negs r2, r2 ands r1, r2 str r1, [r0] ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @08038DAC ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 bl sub_8057028 bl dp11_free bl sub_805F094 b @08038EB6 .align 2, 0 .pool @08038DAC: str r0, [sp] movs r1, 0xC0 lsls r1, 19 ldr r2, =0x05006000 mov r0, sp bl CpuSet movs r0, 0x4C movs r1, 0 bl lcd_io_set movs r0, 0x40 movs r1, 0xF0 bl lcd_io_set ldr r4, =0x00005051 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, =0x02022e24 movs r0, 0xF0 strh r0, [r1] ldr r0, =0x02022e26 strh r4, [r0] bl dp12_8087EA4 ldr r0, =0x02038c28 movs r3, 0xF0 movs r1, 0xF0 lsls r1, 3 adds r2, r0, r1 movs r1, 0x4F @08038DFE: strh r3, [r0] strh r3, [r2] adds r2, 0x2 adds r0, 0x2 subs r1, 0x1 cmp r1, 0 bge @08038DFE movs r1, 0x50 ldr r0, =0x02038c28 ldr r3, =0x0000ff10 movs r4, 0x82 lsls r4, 4 adds r2, r0, r4 adds r0, 0xA0 @08038E1A: strh r3, [r0] strh r3, [r2] adds r2, 0x2 adds r0, 0x2 adds r1, 0x1 cmp r1, 0x9F ble @08038E1A bl sub_80A1A74 ldr r0, =0x02022e14 movs r4, 0 strh r4, [r0] ldr r0, =0x02022e16 strh r4, [r0] ldr r0, =0x02022e18 strh r4, [r0] ldr r0, =0x02022e1a strh r4, [r0] ldr r0, =0x02022e1c strh r4, [r0] ldr r0, =0x02022e1e strh r4, [r0] ldr r0, =0x02022e20 strh r4, [r0] ldr r0, =0x02022e22 strh r4, [r0] bl c2_berry_program_update_menu ldr r0, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x40 bl decompress_palette bl sub_803570C bl 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, =0x0300301c movs r0, 0x4 strb r0, [r1] ldr r0, =vblank_cb_08078BB4 bl SetVBlankCallback ldr r0, =task00_0800F6FC movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0x87 lsls r2, 1 strh r2, [r1, 0xA] movs r2, 0x5A strh r2, [r1, 0xC] movs r2, 0x1 strh r2, [r1, 0x12] bl sub_8038B94 ldr r0, =sub_8038F14 bl set_callback2 ldr r0, =0x02024332 strb r4, [r0] @08038EB6: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024332 ldrb r1, [r0] adds r4, r0, 0 cmp r1, 0x9 bls @08038F44 b @080391C6 @08038F44: lsls r0, r1, 2 ldr r1, =@08038F58 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08038F58: .4byte @08038F80 .4byte @08038FA0 .4byte @08038FC2 .4byte @080390C8 .4byte @08039100 .4byte @08039118 .4byte @0803912C .4byte @0803914C .4byte @08039166 .4byte @08039184 @08038F80: movs r0, 0 bl gpu_sync_bg_show movs r0, 0x1 bl gpu_sync_bg_show movs r0, 0x2 bl gpu_sync_bg_show ldr r1, =0x02024332 movs r0, 0xFF strb r0, [r1, 0x1] b @08039174 .align 2, 0 .pool @08038FA0: ldrb r0, [r4, 0x1] subs r0, 0x1 strb r0, [r4, 0x1] lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @08038FB0 b @080391C6 @08038FB0: movs r0, 0x1 negs r0, r0 str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @0803910C @08038FC2: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08038FD0 b @080391C6 @08038FD0: bl sub_8185FAC ldr r2, =0x030022c0 ldr r1, =0x00000439 adds r2, r1 movs r1, 0x1 ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 movs r3, 0x2 cmp r0, 0 beq @08038FFC movs r3, 0x4 @08038FFC: movs r4, 0 ldr r6, =0x03005d90 cmp r4, r3 bge @08039022 ldr r1, =0x020229e8 ldrb r0, [r1] cmp r0, 0x3 bne @08039022 movs r5, 0xFF adds r2, r1, 0 @08039010: adds r2, 0x1C adds r4, 0x1 cmp r4, r3 bge @08039022 ldrh r1, [r2] adds r0, r5, 0 ands r0, r1 cmp r0, 0x3 beq @08039010 @08039022: ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 ldrb r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 bne @080390AC cmp r4, r3 bne @080390AC ldr r0, =0x000008d2 bl flag_check lsls r0, 24 cmp r0, 0 beq @08039074 bl Window_FreeMemory ldr r0, =sub_80392A8 bl set_callback2 b @080391C6 .align 2, 0 .pool @08039074: ldr r2, =0x030022c0 ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 bne @08039090 ldr r0, [r2, 0x8] b @080390B0 .align 2, 0 .pool @08039090: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08039172 ldr r0, =sub_80B3AF8 movs r1, 0x5 bl AddTask b @08039172 .align 2, 0 .pool @080390AC: ldr r0, =0x030022c0 ldr r0, [r0, 0x8] @080390B0: bl set_callback2 bl sub_8057028 bl dp11_free bl sub_805F094 b @080391C6 .align 2, 0 .pool @080390C8: movs r0, 0 str r0, [sp, 0x4] movs r1, 0xC0 lsls r1, 19 ldr r2, =0x05006000 add r0, sp, 0x4 bl CpuSet movs r4, 0 @080390DA: lsls r0, r4, 24 lsrs r0, 24 bl sub_80363C4 adds r4, 0x1 cmp r4, 0x1 ble @080390DA movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 b @08039172 .align 2, 0 .pool @08039100: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080391C6 @0803910C: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @080391C6 .align 2, 0 .pool @08039118: ldr r0, =sub_80B3AF8 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080391C6 b @08039172 .align 2, 0 .pool @0803912C: bl sub_800A520 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080391C6 bl sub_800ADF8 ldr r0, =gUnknown_0824978D movs r1, 0 bl battle_show_message_maybe b @08039172 .align 2, 0 .pool @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, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08039172 bl sub_800AC34 @08039172: ldr r1, =0x02024332 @08039174: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080391C6 .align 2, 0 .pool @08039184: ldr r2, =0x030022c0 ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 adds r3, r2, 0 cmp r0, 0 beq @080391A6 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @080391A6 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 beq @080391C6 @080391A6: ldr r0, =0x00000439 adds r2, r3, r0 ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] ldr r0, [r3, 0x8] bl 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 .pool thumb_func_end sub_8038F34 thumb_func_start sub_80391E0 sub_80391E0: ; 80391E0 push {lr} lsls r0, 24 lsrs r2, r0, 24 lsls r1, 24 lsrs r1, 24 movs r0, 0 cmp r1, 0x6 bhi @080392A0 lsls r0, r1, 2 ldr r1, =@08039200 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08039200: .4byte @0803921C .4byte @08039230 .4byte @08039244 .4byte @08039258 .4byte @0803926C .4byte @08039280 .4byte @08039294 @0803921C: ldr r0, =gUnknown_0831AA08 lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1] lsls r0, 30 lsrs r0, 30 b @080392A0 .align 2, 0 .pool @08039230: ldr r0, =gUnknown_0831AA08 lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1] lsls r0, 28 lsrs r0, 30 b @080392A0 .align 2, 0 .pool @08039244: ldr r0, =gUnknown_0831AA08 lsls r1, r2, 2 adds r1, r0 ldrh r0, [r1] lsls r0, 23 lsrs r0, 27 b @080392A0 .align 2, 0 .pool @08039258: ldr r0, =gUnknown_0831AA08 lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1, 0x1] lsls r0, 29 lsrs r0, 30 b @080392A0 .align 2, 0 .pool @0803926C: ldr r0, =gUnknown_0831AA08 lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1, 0x1] lsls r0, 28 lsrs r0, 31 b @080392A0 .align 2, 0 .pool @08039280: ldr r0, =gUnknown_0831AA08 lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1, 0x1] lsls r0, 26 lsrs r0, 30 b @080392A0 .align 2, 0 .pool @08039294: ldr r0, =gUnknown_0831AA08 lsls r1, r2, 2 adds r1, r0 ldr r0, [r1] lsls r0, 8 lsrs r0, 22 @080392A0: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80391E0 thumb_func_start sub_80392A8 sub_80392A8: ; 80392A8 push {r4,lr} sub sp, 0x8 movs r0, 0 bl SetHBlankCallback movs r0, 0 bl SetVBlankCallback movs r4, 0 str r4, [sp, 0x4] movs r1, 0xC0 lsls r1, 19 ldr r2, =0x05006000 add r0, sp, 0x4 bl CpuSet bl sub_80A1A74 ldr r0, =0x02022e14 strh r4, [r0] ldr r0, =0x02022e16 strh r4, [r0] ldr r0, =0x02022e18 strh r4, [r0] ldr r0, =0x02022e1a strh r4, [r0] ldr r0, =0x02022e1c strh r4, [r0] ldr r0, =0x02022e1e strh r4, [r0] ldr r0, =0x02022e20 strh r4, [r0] ldr r0, =0x02022e22 strh r4, [r0] bl c2_berry_program_update_menu movs r1, 0x82 lsls r1, 5 movs r0, 0 bl 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, =0x0300301c movs r0, 0x4 strb r0, [r1] ldr r0, =vblank_cb_08078BB4 bl SetVBlankCallback ldr r0, =sub_803937C 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, =0x02024332 strb r4, [r0] add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024332 ldrb r1, [r0] adds r4, r0, 0 cmp r1, 0xC bls @080393AC b @0803975E @080393AC: lsls r0, r1, 2 ldr r1, =@080393C0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080393C0: .4byte @080393F4 .4byte @08039414 .4byte @08039450 .4byte @08039470 .4byte @0803949C .4byte @080394D8 .4byte @0803957C .4byte @08039704 .4byte @080395CC .4byte @08039610 .4byte @08039678 .4byte @080396A8 .4byte @08039704 @080393F4: movs r0, 0 bl gpu_sync_bg_show movs r0, 0x1 bl gpu_sync_bg_show movs r0, 0x2 bl gpu_sync_bg_show ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 b @0803975C .align 2, 0 .pool @08039414: ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08039434 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08039434 ldr r0, =sub_80B3AF8 movs r1, 0x5 bl AddTask @08039434: ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 b @0803975C .align 2, 0 .pool @08039450: ldr r0, =sub_80B3AF8 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @0803945E b @0803975E @0803945E: ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 b @0803975C .align 2, 0 .pool @08039470: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0803947E b @0803975E @0803947E: ldr r0, =gUnknown_085CD28F movs r1, 0 bl battle_show_message_maybe ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 b @0803975C .align 2, 0 .pool @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, =gUnknown_085CCABB movs r1, 0xC bl battle_show_message_maybe ldr r4, =0x02024332 movs r0, 0x1 strb r0, [r4, 0x1] bl sub_8056B74 b @080396EA .align 2, 0 .pool @080394D8: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @08039500 ldrb r0, [r4, 0x1] cmp r0, 0 bne @080394EC b @0803975E @080394EC: movs r0, 0x5 bl audio_play ldrb r0, [r4, 0x1] bl sub_8056BAC movs r0, 0 b @0803951E .align 2, 0 .pool @08039500: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08039526 ldrb r0, [r4, 0x1] cmp r0, 0 beq @08039510 b @0803975E @08039510: movs r0, 0x5 bl audio_play ldrb r0, [r4, 0x1] bl sub_8056BAC movs r0, 0x1 @0803951E: strb r0, [r4, 0x1] bl sub_8056B74 b @0803975E @08039526: movs r5, 0x1 adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @08039560 movs r0, 0x5 bl audio_play ldr r4, =0x02024332 ldrb r0, [r4, 0x1] cmp r0, 0 beq @08039540 b @080396EA @08039540: str r5, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C bl sub_8185338 strb r0, [r4, 0x1] movs r0, 0xA strb r0, [r4] b @0803975E .align 2, 0 .pool @08039560: movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0803956A b @0803975E @0803956A: movs r0, 0x5 bl audio_play ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 b @0803975C .align 2, 0 .pool @0803957C: bl sub_800A520 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0803958A b @0803975E @0803958A: str r0, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080395B4 bl sub_800ADF8 ldr r0, =gUnknown_0824978D movs r1, 0 bl battle_show_message_maybe @080395B4: ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 b @0803975C .align 2, 0 .pool @080395CC: ldrb r0, [r4, 0x1] subs r0, 0x1 strb r0, [r4, 0x1] lsls r0, 24 cmp r0, 0 beq @080395DA b @0803975E @080395DA: ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080395F6 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @080395F6 bl sub_800AC34 @080395F6: ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 b @0803975C .align 2, 0 .pool @08039610: ldr r2, =0x030022c0 ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 adds r3, r2, 0 cmp r0, 0 beq @08039634 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08039634 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 bne @08039634 b @0803975E @08039634: ldr r0, =0x00000439 adds r2, r3, r0 ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08039650 b @0803975E @08039650: ldr r0, [r3, 0x8] bl set_callback2 bl sub_8057028 bl dp11_free bl sub_805F094 b @0803975E .align 2, 0 .pool @08039678: ldrb r0, [r4, 0x1] cmp r0, 0x1 bne @080396A0 movs r0, 0x37 bl audio_play ldr r0, =gUnknown_085CD2CB @08039686: bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe movs r0, 0x80 strb r0, [r4, 0x1] b @080396EA .align 2, 0 .pool @080396A0: ldr r0, =gUnknown_08242481 b @08039686 .align 2, 0 .pool @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, =0x02024332 ldrb r0, [r4, 0x1] subs r0, 0x1 strb r0, [r4, 0x1] lsls r0, 24 cmp r0, 0 bne @0803975E ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080396EA bl sub_800ADF8 ldr r0, =gUnknown_0824978D movs r1, 0 bl battle_show_message_maybe @080396EA: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @0803975E .align 2, 0 .pool @08039704: movs r0, 0 bl a_pressed_maybe lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 bne @0803975E ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @08039744 bl sub_800A520 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0803975E movs r0, 0x1 negs r0, r0 str r4, [sp] b @0803974A .align 2, 0 .pool @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, =0x02024332 movs r0, 0x20 strb r0, [r1, 0x1] movs r0, 0x8 @0803975C: strb r0, [r1] @0803975E: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803939C thumb_func_start shedinja_something shedinja_something: ; 803976C push {r4,r5,lr} sub sp, 0x10 adds r4, r0, 0 add r5, sp, 0xC movs r0, 0x1 strb r0, [r5] adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr ldr r1, =0x0000012f cmp r0, r1 bne @080397B4 adds r0, r4, 0 movs r1, 0x3 bl pokemon_getattr ldrb r1, [r5] cmp r0, r1 beq @080397B4 adds r0, r4, 0 movs r1, 0x2 mov r2, sp bl pokemon_getattr ldr r1, =gUnknown_0831ACA0 mov r0, sp bl 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 .pool thumb_func_end shedinja_something thumb_func_start sub_80397C4 sub_80397C4: ; 80397C4 ldr r2, =gUnknown_0831ABA0 lsls r0, 2 adds r0, r2 ldr r0, [r0] lsls r1, 3 adds r1, r0 ldrb r0, [r1, 0x3] lsls r0, 3 bx lr .align 2, 0 .pool thumb_func_end sub_80397C4 thumb_func_start oac_poke_opponent oac_poke_opponent: ; 80397DC push {lr} sub sp, 0x4 ldr r1, =sub_803980C str r1, [r0, 0x1C] movs r1, 0 bl obj_anim_image_start_if_different movs r0, 0x80 lsls r0, 10 ldr r1, =0x00002108 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 .pool thumb_func_end oac_poke_opponent thumb_func_start sub_803980C sub_803980C: ; 803980C push {lr} adds r2, r0, 0 ldr r0, =0x020243fc ldrh r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0803982C ldrh r0, [r2, 0x24] adds r0, 0x2 strh r0, [r2, 0x24] lsls r0, 16 cmp r0, 0 bne @0803982C ldr r0, =sub_8039838 str r0, [r2, 0x1C] @0803982C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803980C thumb_func_start sub_8039838 sub_8039838: ; 8039838 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08039880 ldrh r0, [r4, 0x2E] lsls r0, 24 lsrs r0, 24 bl sub_8076918 ldr r1, =0x03005d70 movs r2, 0x2E ldrsh r0, [r4, r2] adds r0, r1 ldrb r0, [r0] bl sub_80729D0 ldr r0, =sub_8039894 str r0, [r4, 0x1C] adds r0, r4, 0 movs r1, 0 bl obj_anim_image_start_if_different movs r0, 0x80 lsls r0, 10 ldr r1, =0x00002108 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 .pool thumb_func_end sub_8039838 thumb_func_start sub_8039894 sub_8039894: ; 8039894 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080398B0 ldrh r1, [r2, 0x32] adds r0, r2, 0 movs r2, 0 movs r3, 0x1 bl sub_806ECEC @080398B0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039894 thumb_func_start nullsub_18 nullsub_18: ; 80398B8 bx lr thumb_func_end nullsub_18 thumb_func_start sub_80398BC sub_80398BC: ; 80398BC movs r1, 0x6 strh r1, [r0, 0x34] movs r1, 0x1 strh r1, [r0, 0x36] ldr r1, =sub_80398D0 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool thumb_func_end sub_80398BC thumb_func_start sub_80398D0 sub_80398D0: ; 80398D0 push {r4,lr} adds r3, r0, 0 ldrh r0, [r3, 0x36] subs r0, 0x1 strh r0, [r3, 0x36] lsls r0, 16 cmp r0, 0 bne @08039924 movs r0, 0x8 strh r0, [r3, 0x36] movs r0, 0x3E adds r0, r3 mov r12, r0 ldrb r2, [r0] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r4, 0x5 negs r4, r4 adds r0, r4, 0 ands r0, r2 orrs r0, r1 mov r1, r12 strb r0, [r1] ldrh r0, [r3, 0x34] subs r0, 0x1 strh r0, [r3, 0x34] lsls r0, 16 asrs r2, r0, 16 cmp r2, 0 bne @08039924 ldrb r1, [r1] adds r0, r4, 0 ands r0, r1 mov r1, r12 strb r0, [r1] ldr r0, =nullsub_18 str r0, [r3, 0x1C] ldr r0, =0x02022f88 str r2, [r0] @08039924: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80398D0 thumb_func_start sub_8039934 sub_8039934: ; 8039934 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} mov r9, r0 ldrh r0, [r0, 0x2E] lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r6, 2 adds r1, r0, r1 ldrh r0, [r1, 0x2] cmp r0, 0 beq @0803995C adds r4, r0, 0 b @08039960 .align 2, 0 .pool @0803995C: mov r0, r9 ldrh r4, [r0, 0x32] @08039960: ldr r1, =0x0202406e lsls r0, r6, 1 adds r5, r0, r1 ldrh r0, [r5] movs r1, 0x64 mov r8, r1 mov r1, r8 muls r1, r0 adds r0, r1, 0 ldr r7, =0x02024744 adds r0, r7 movs r1, 0 bl pokemon_getattr cmp r4, 0xC9 bne @080399E4 ldrh r0, [r5] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r7 movs r1, 0 bl pokemon_getattr adds r2, r0, 0 movs r0, 0xC0 lsls r0, 18 ands r0, r2 lsrs r0, 18 movs r1, 0xC0 lsls r1, 10 ands r1, r2 lsrs r1, 12 orrs r0, r1 movs r1, 0xC0 lsls r1, 2 ands r1, r2 lsrs r1, 6 orrs r0, r1 movs r1, 0x3 ands r1, r2 orrs r0, r1 movs r1, 0x1C bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @080399D0 movs r0, 0xC9 b @080399DA .align 2, 0 .pool @080399D0: movs r1, 0xCE lsls r1, 1 adds r0, r1 lsls r0, 16 lsrs r0, 16 @080399DA: ldr r1, =gUnknown_08300D38 lsls r0, 2 b @08039A1C .align 2, 0 .pool @080399E4: ldr r0, =0x00000181 cmp r4, r0 bne @08039A08 ldr r0, =gUnknown_08525F78 ldr r1, =0x020244e4 adds r1, r6, r1 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] b @08039A20 .align 2, 0 .pool @08039A08: movs r0, 0xCE lsls r0, 1 cmp r4, r0 bls @08039A18 ldr r0, =gUnknown_08300D38 b @08039A1E .align 2, 0 .pool @08039A18: ldr r1, =gUnknown_08300D38 lsls r0, r4, 2 @08039A1C: adds r0, r1 @08039A1E: ldrb r0, [r0, 0x1] @08039A20: lsrs r1, r0, 3 movs r0, 0x8 subs r0, r1 mov r1, r9 strh r0, [r1, 0x34] movs r0, 0x1 strh r0, [r1, 0x36] ldr r0, =sub_8039A48 str r0, [r1, 0x1C] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039934 thumb_func_start sub_8039A48 sub_8039A48: ; 8039A48 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x36] subs r0, 0x1 strh r0, [r4, 0x36] lsls r0, 16 cmp r0, 0 bne @08039AC8 movs r0, 0x2 strh r0, [r4, 0x36] ldrh r0, [r4, 0x26] adds r0, 0x8 strh r0, [r4, 0x26] ldrh r0, [r4, 0x34] subs r0, 0x1 strh r0, [r4, 0x34] lsls r0, 16 cmp r0, 0 bge @08039A7C adds r0, r4, 0 bl obj_free_rotscale_entry adds r0, r4, 0 bl 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, =0x020244d4 ldr r1, [r1] lsls r0, 24 lsrs r0, 22 adds r1, 0x4 adds r1, r0 ldr r2, =0x020244e4 movs r3, 0x2E ldrsh r0, [r4, r3] adds r0, r2 ldrb r0, [r0] lsls r0, 11 ldr r1, [r1] adds r1, r0 movs r2, 0x34 ldrsh r0, [r4, r2] lsls r0, 8 adds r1, r0 movs r2, 0 movs r0, 0xFF @08039AAE: strb r2, [r1] adds r1, 0x1 subs r0, 0x1 cmp r0, 0 bge @08039AAE ldr r0, =0x020244e4 movs r3, 0x2E ldrsh r1, [r4, r3] adds r1, r0 ldrb r1, [r1] adds r0, r4, 0 bl obj_anim_image_start @08039AC8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039A48 thumb_func_start sub_8039AD8 sub_8039AD8: ; 8039AD8 movs r1, 0x8 strh r1, [r0, 0x34] adds r1, r0, 0 adds r1, 0x3E ldrb r1, [r1] lsls r1, 29 lsrs r1, 31 strh r1, [r0, 0x36] ldr r1, =sub_8039AF4 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool thumb_func_end sub_8039AD8 thumb_func_start sub_8039AF4 sub_8039AF4: ; 8039AF4 push {lr} adds r3, r0, 0 ldrh r0, [r3, 0x34] subs r0, 0x1 strh r0, [r3, 0x34] lsls r0, 16 cmp r0, 0 bne @08039B26 movs r0, 0x3E adds r0, r3 mov r12, r0 ldrb r2, [r0] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r0, 0x5 negs r0, r0 ands r0, r2 orrs r0, r1 mov r1, r12 strb r0, [r1] movs r0, 0x8 strh r0, [r3, 0x34] @08039B26: pop {r0} bx r0 thumb_func_end sub_8039AF4 thumb_func_start sub_8039B2C sub_8039B2C: ; 8039B2C movs r1, 0x3E adds r1, r0 mov r12, r1 movs r1, 0x1 ldrh r2, [r0, 0x36] ands r2, r1 lsls r2, 2 mov r1, r12 ldrb r3, [r1] movs r1, 0x5 negs r1, r1 ands r1, r3 orrs r1, r2 mov r2, r12 strb r1, [r2] movs r1, 0 strh r1, [r0, 0x36] ldr r1, =nullsub_18 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool thumb_func_end sub_8039B2C thumb_func_start sub_8039B58 sub_8039B58: ; 8039B58 push {r4,lr} adds r4, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @08039BA0 ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @08039B80 ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 beq @08039B94 @08039B80: ldrh r0, [r4, 0x32] bl sub_806F0D4 lsls r0, 24 cmp r0, 0 beq @08039B94 adds r0, r4, 0 movs r1, 0x1 bl 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 .pool thumb_func_end sub_8039B58 thumb_func_start sub_8039BB4 sub_8039BB4: ; 8039BB4 ldr r1, =oac_poke_ally_ str r1, [r0, 0x1C] bx lr .align 2, 0 .pool thumb_func_end sub_8039BB4 thumb_func_start oac_poke_ally_ oac_poke_ally_: ; 8039BC0 push {lr} adds r2, r0, 0 ldr r0, =0x020243fc ldrh r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08039BE4 ldrh r0, [r2, 0x24] subs r0, 0x2 strh r0, [r2, 0x24] lsls r0, 16 asrs r1, r0, 16 cmp r1, 0 bne @08039BE4 ldr r0, =nullsub_19 str r0, [r2, 0x1C] strh r1, [r2, 0x30] @08039BE4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end oac_poke_ally_ thumb_func_start sub_8039BF0 sub_8039BF0: ; 8039BF0 ldr r1, =nullsub_19 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool thumb_func_end sub_8039BF0 thumb_func_start nullsub_19 nullsub_19: ; 8039BFC bx lr thumb_func_end nullsub_19 thumb_func_start sub_8039C00 sub_8039C00: ; 8039C00 push {lr} adds r2, r0, 0 ldr r0, =0x020243fc ldrh r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08039C20 ldrh r0, [r2, 0x30] ldrh r1, [r2, 0x24] adds r0, r1 strh r0, [r2, 0x24] ldrh r0, [r2, 0x32] ldrh r1, [r2, 0x26] adds r0, r1 strh r0, [r2, 0x26] @08039C20: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039C00 thumb_func_start dp11b_obj_instanciate dp11b_obj_instanciate: ; 8039C28 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 lsrs r1, 24 mov r8, r1 lsls r2, 24 lsrs r2, 24 mov r9, r2 lsls r3, 24 lsrs r3, 24 mov r10, r3 cmp r1, 0 beq @08039C64 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r2, r4, 1 adds r0, r2, r4 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 b @08039C76 .align 2, 0 .pool @08039C64: ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r2, r4, 1 adds r0, r2, r4 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 @08039C76: ands r0, r1 adds r6, r2, 0 cmp r0, 0 bne @08039D2C ldr r0, =objc_dp11b_pingpong bl object_new_hidden_with_callback lsls r0, 24 lsrs r5, r0, 24 mov r0, r8 cmp r0, 0x1 bne @08039CD0 ldr r0, =0x03005d70 adds r0, r4, r0 ldrb r7, [r0] ldr r2, =0x020244d0 ldr r0, [r2] ldr r0, [r0, 0x4] adds r1, r6, r4 lsls r1, 2 adds r0, r1, r0 strb r5, [r0, 0x2] ldr r0, [r2] ldr r0, [r0, 0x4] adds r1, r0 ldrb r0, [r1] movs r2, 0x2 orrs r0, r2 strb r0, [r1] ldr r2, =0x02020630 lsls r3, r5, 4 adds r0, r3, r5 lsls r0, 2 adds r0, r2 movs r1, 0x80 b @08039CFE .align 2, 0 .pool @08039CD0: ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r7, [r0] ldr r2, =0x020244d0 ldr r0, [r2] ldr r0, [r0, 0x4] adds r1, r6, r4 lsls r1, 2 adds r0, r1, r0 strb r5, [r0, 0x3] ldr r0, [r2] ldr r0, [r0, 0x4] adds r1, r0 ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] ldr r2, =0x02020630 lsls r3, r5, 4 adds r0, r3, r5 lsls r0, 2 adds r0, r2 movs r1, 0xC0 @08039CFE: strh r1, [r0, 0x2E] adds r4, r2, 0 adds r1, r3, r5 lsls r1, 2 adds r1, r4 mov r2, r9 lsls r0, r2, 24 asrs r0, 24 movs r2, 0 strh r0, [r1, 0x30] mov r3, r10 lsls r0, r3, 24 asrs r0, 24 strh r0, [r1, 0x32] strh r7, [r1, 0x34] mov r0, r8 strh r0, [r1, 0x36] lsls r0, r7, 4 adds r0, r7 lsls r0, 2 adds r0, r4 strh r2, [r0, 0x24] strh r2, [r0, 0x26] @08039D2C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp11b_obj_instanciate thumb_func_start dp11b_obj_free dp11b_obj_free: ; 8039D48 push {r4-r6,lr} lsls r0, 24 lsrs r2, r0, 24 lsls r1, 24 lsrs r1, 24 cmp r1, 0x1 bne @08039D9C ldr r6, =0x020244d0 ldr r0, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r5, r0, 2 adds r3, r5, r1 ldrb r1, [r3] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08039DEA ldr r2, =0x02020630 ldrb r1, [r3, 0x2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x34] lsls r1, 24 lsrs r4, r1, 24 bl 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 .pool @08039D9C: ldr r6, =0x020244d0 ldr r0, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r5, r0, 2 adds r3, r5, r1 ldrb r1, [r3] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08039DEA ldr r2, =0x02020630 ldrb r1, [r3, 0x3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x34] lsls r1, 24 lsrs r4, r1, 24 bl 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, =0x02020630 lsls r1, r4, 4 adds r1, r4 lsls r1, 2 adds r1, r0 movs r0, 0 strh r0, [r1, 0x24] strh r0, [r1, 0x26] @08039DEA: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp11b_obj_free thumb_func_start objc_dp11b_pingpong objc_dp11b_pingpong: ; 8039DF8 push {r4,r5,lr} adds r4, r0, 0 ldrh r0, [r4, 0x34] lsls r0, 24 lsrs r5, r0, 24 movs r1, 0x36 ldrsh r0, [r4, r1] cmp r0, 0x1 bne @08039E10 movs r2, 0x2E ldrsh r0, [r4, r2] b @08039E14 @08039E10: movs r1, 0x2E ldrsh r0, [r4, r1] @08039E14: movs r2, 0x32 ldrsh r1, [r4, r2] bl sine ldr r2, =0x02020630 lsls r1, r5, 4 adds r1, r5 lsls r1, 2 adds r1, r2 ldrh r2, [r4, 0x32] adds r0, r2 strh r0, [r1, 0x26] ldrh r0, [r4, 0x30] ldrh r1, [r4, 0x2E] adds r0, r1 movs r1, 0xFF ands r0, r1 strh r0, [r4, 0x2E] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end objc_dp11b_pingpong thumb_func_start sub_8039E44 sub_8039E44: ; 8039E44 push {lr} adds r2, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @08039E5C ldrh r1, [r2, 0x32] adds r0, r2, 0 bl sub_806EEB4 @08039E5C: pop {r0} bx r0 thumb_func_end sub_8039E44 thumb_func_start sub_8039E60 sub_8039E60: ; 8039E60 push {r4,lr} adds r4, r0, 0 bl sub_8039E9C adds r0, r4, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08039E7A ldr r0, =nullsub_19 str r0, [r4, 0x1C] @08039E7A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039E60 thumb_func_start sub_8039E84 sub_8039E84: ; 8039E84 push {r4,lr} adds r4, r0, 0 movs r1, 0x1 bl obj_anim_image_start ldr r0, =sub_8039E60 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039E84 thumb_func_start sub_8039E9C sub_8039E9C: ; 8039E9C push {lr} adds r2, r0, 0 adds r0, 0x2C ldrb r1, [r0] movs r0, 0x3F ands r0, r1 cmp r0, 0 bne @08039EBE ldr r1, =gUnknown_0831ACE0 adds r0, r2, 0 adds r0, 0x2B ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] adds r0, r2, 0 adds r0, 0x28 strb r1, [r0] @08039EBE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039E9C thumb_func_start nullsub_20 nullsub_20: ; 8039EC8 bx lr thumb_func_end nullsub_20 thumb_func_start sub_8039ECC sub_8039ECC: ; 8039ECC push {lr} bl sub_8039F40 ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x1] ldr r1, =0x03005d04 ldr r0, =bc_8012FAC str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039ECC thumb_func_start sub_8039EF0 sub_8039EF0: ; 8039EF0 push {r4,r5,lr} ldr r0, =0x03005d04 ldr r0, [r0] bl _call_via_r0 ldr r1, =0x02024064 movs r0, 0 strb r0, [r1] ldr r0, =0x0202406c ldrb r0, [r0] cmp r0, 0 beq @08039F2A ldr r5, =0x03005d60 adds r4, r1, 0 @08039F0C: ldrb r0, [r4] lsls r0, 2 adds r0, r5 ldr r0, [r0] bl _call_via_r0 ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @08039F0C @08039F2A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039EF0 thumb_func_start sub_8039F40 sub_8039F40: ; 8039F40 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r0, 0 bl sub_803D580 bl sub_803D6A0 movs r2, 0 movs r3, 0 ldr r0, =0x02024260 mov r10, r0 ldr r1, =0x02024258 mov r9, r1 ldr r0, =0x02024250 mov r8, r0 ldr r1, =0x02024248 mov r12, r1 ldr r5, =0x020242bc movs r4, 0 ldr r7, =0x02024240 ldr r6, =0x02024268 @08039F70: ldr r0, =0x020242ac adds r0, r4, r0 str r3, [r0] movs r1, 0 @08039F78: adds r0, r5, r1 strb r3, [r0] adds r1, 0x1 cmp r1, 0x1B bls @08039F78 movs r0, 0x2 strb r0, [r5, 0x16] ldr r1, =0x02024284 adds r0, r2, r1 strb r3, [r0] mov r0, r12 strh r3, [r0] mov r1, r8 strh r3, [r1] mov r0, r9 strh r3, [r0] mov r1, r10 strh r3, [r1] ldr r0, =0x02024270 adds r1, r2, r0 movs r0, 0xFF strb r0, [r1] strh r3, [r6] strh r3, [r7] ldr r1, =0x020244a8 ldr r0, [r1] ldr r0, [r0, 0x4] adds r0, r4 str r3, [r0] ldr r1, =0x02024230 adds r0, r4, r1 str r3, [r0] movs r0, 0x2 add r10, r0 add r9, r0 add r8, r0 add r12, r0 adds r5, 0x1C adds r4, 0x4 adds r7, 0x2 adds r6, 0x2 adds r2, 0x1 cmp r2, 0x3 ble @08039F70 movs r5, 0 ldr r3, =0x02024294 ldr r4, =0x0202428e movs r2, 0x1 @08039FD8: strh r5, [r4] movs r1, 0 @08039FDC: adds r0, r3, r1 strb r5, [r0] adds r1, 0x1 cmp r1, 0xB bls @08039FDC adds r3, 0xC adds r4, 0x2 subs r2, 0x1 cmp r2, 0 bge @08039FD8 movs r1, 0 ldr r2, =0x0202420b strb r1, [r2] ldr r0, =0x0202420c strb r1, [r0] ldr r2, =0x020243cc strh r1, [r2] ldr r1, =0x020243d0 movs r2, 0 movs r3, 0 @0803A004: adds r0, r1, r2 strb r3, [r0] adds r2, 0x1 cmp r2, 0x2B bls @0803A004 ldr r2, =0x02024280 movs r0, 0 str r0, [r2] ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 17 ands r0, r1 cmp r0, 0 bne @0803A090 movs r0, 0x2 ands r1, r0 cmp r1, 0 bne @0803A0AE ldr r0, =0x03005d90 ldr r0, [r0] ldrb r1, [r0, 0x15] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0803A0AE movs r0, 0x80 b @0803A0AC .align 2, 0 .pool @0803A090: ldr r0, =0x02000002 ands r1, r0 cmp r1, 0 bne @0803A0AE bl sub_8185FB8 lsls r0, 24 cmp r0, 0 beq @0803A0AE ldr r1, =0x02024280 ldr r0, [r1] movs r1, 0x80 orrs r0, r1 ldr r2, =0x02024280 @0803A0AC: str r0, [r2] @0803A0AE: ldr r3, =0x02024474 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x15] lsls r0, 30 lsrs r0, 31 movs r1, 0 strb r0, [r3, 0x1D] ldr r0, =0x02024212 strb r1, [r0] ldr r0, =0x0202433a strb r1, [r0] ldr r0, =0x02024068 str r1, [r0] ldr r0, =0x0202432e movs r2, 0 strh r1, [r0] ldr r1, =0x020244a8 ldr r0, [r1] ldr r0, [r0, 0x8] adds r0, 0x20 strb r2, [r0] ldr r0, [r1] ldr r0, [r0, 0xC] adds r0, 0x20 strb r2, [r0] ldr r5, =0x0202432c ldr r6, =0x020241f0 ldr r7, =0x020243fc ldr r0, =0x03005d54 mov r8, r0 ldr r1, =0x02024210 mov r9, r1 ldr r2, =0x02024744 mov r10, r2 ldr r1, =0x02024332 movs r2, 0 adds r0, r1, 0x7 @0803A0FA: strb r2, [r0] subs r0, 0x1 cmp r0, r1 bge @0803A0FA movs r4, 0 strh r4, [r5] movs r0, 0 str r0, [r6] strh r0, [r7] strb r4, [r3, 0x18] strb r4, [r3, 0x19] mov r0, r8 strb r4, [r0] mov r1, r9 strb r4, [r1] ldr r5, =0x0202449c ldr r0, [r5] adds r0, 0x6C strb r4, [r0] ldr r0, [r5] adds r0, 0x79 strb r4, [r0] ldr r0, [r5] adds r0, 0x7A strb r4, [r0] mov r0, r10 movs r1, 0xB bl pokemon_getattr ldr r6, [r5] adds r6, 0x7C ldr r2, =gBaseStats lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 ldrb r1, [r1, 0x8] movs r0, 0x64 muls r0, r1 ldr r1, =0x000004fb bl __divsi3 strb r0, [r6] ldr r0, [r5] adds r0, 0x7B movs r1, 0x3 strb r1, [r0] ldr r0, [r5] strb r4, [r0, 0x12] ldr r0, [r5] adds r0, 0x4A movs r1, 0x1 strb r1, [r0] movs r2, 0 movs r1, 0 adds r6, r5, 0 @0803A16A: ldr r0, [r5] adds r0, r2, r0 adds r0, 0x98 strb r1, [r0] ldr r0, [r5] adds r0, r2, r0 adds r0, 0xB8 strb r1, [r0] ldr r0, [r5] adds r0, r2, r0 adds r0, 0xC8 strb r1, [r0] ldr r0, [r5] adds r0, r2, r0 adds r0, 0xD0 strb r1, [r0] ldr r0, [r5] adds r0, r2, r0 adds r0, 0xE0 strb r1, [r0] ldr r0, [r5] adds r0, r2, r0 adds r0, 0xE8 strb r1, [r0] ldr r0, [r5] adds r0, r2, r0 adds r0, 0xF0 strb r1, [r0] ldr r0, [r5] adds r0, r2, r0 adds r0, 0xF8 strb r1, [r0] adds r2, 0x1 cmp r2, 0x7 ble @0803A16A movs r2, 0 ldr r4, =0x0202449c movs r3, 0xA5 lsls r3, 2 movs r1, 0x6 @0803A1BA: ldr r0, [r4] adds r0, r2, r0 adds r0, r3 strb r1, [r0] adds r2, 0x1 cmp r2, 0x3 ble @0803A1BA ldr r0, [r6] adds r0, 0xDF movs r1, 0 strb r1, [r0] ldr r0, [r6] adds r0, 0x92 strb r1, [r0] bl GenerateRandomNumber ldr r1, =0x02024330 strh r0, [r1] ldr r1, =0x03005d10 movs r2, 0 movs r3, 0 @0803A1E4: adds r0, r1, r2 strb r3, [r0] adds r2, 0x1 cmp r2, 0x43 bls @0803A1E4 ldr r0, =0x02024744 bl sub_806EBA4 ldr r3, =0x03005d10 movs r1, 0x1 ands r1, r0 lsls r1, 6 ldrb r2, [r3, 0x5] movs r0, 0x41 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3, 0x5] ldr r2, =0x0202449c ldr r0, [r2] movs r1, 0xA8 lsls r1, 2 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r2] ldr r2, =0x000002a1 adds r0, r2 strb r1, [r0] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8039F40 thumb_func_start sub_803A284 sub_803A284: ; 803A284 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x20 ldr r4, =0x020242bc ldr r5, =0x02024064 ldrb r1, [r5] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 mov r1, sp adds r0, r4 ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldr r0, [r0] str r0, [r1] ldr r2, =gBattleMoves ldr r3, =0x020241ea ldrh r1, [r3] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] mov r12, r4 mov r9, r5 ldr r6, =0x020242ac mov r10, r6 cmp r0, 0x7F beq @0803A35C movs r5, 0 mov r6, r9 movs r4, 0x58 ldr r2, =0x02024084 adds r2, 0x18 movs r1, 0x6 @0803A2D4: ldrb r0, [r6] muls r0, r4 adds r0, r5, r0 adds r0, r2 strb r1, [r0] adds r5, 0x1 cmp r5, 0x7 ble @0803A2D4 movs r5, 0 ldr r7, =0x0202406c ldrb r7, [r7] cmp r5, r7 bge @0803A348 ldr r0, =0x020240d4 mov r8, r0 ldr r4, =0x020242bc ldr r3, =0x020242ac @0803A2F6: movs r0, 0x58 muls r0, r5 mov r1, r8 adds r2, r0, r1 ldr r1, [r2] movs r0, 0x80 lsls r0, 19 ands r0, r1 cmp r0, 0 beq @0803A31A ldrb r0, [r4, 0x14] ldr r6, =0x02024064 ldrb r6, [r6] cmp r0, r6 bne @0803A31A ldr r0, =0xfbffffff ands r1, r0 str r1, [r2] @0803A31A: ldr r1, [r3] movs r0, 0x18 ands r0, r1 cmp r0, 0 beq @0803A33A ldrb r0, [r4, 0x15] ldr r7, =0x02024064 ldrb r7, [r7] cmp r0, r7 bne @0803A33A movs r0, 0x19 negs r0, r0 ands r1, r0 str r1, [r3] movs r0, 0 strb r0, [r4, 0x15] @0803A33A: adds r4, 0x1C adds r3, 0x4 adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @0803A2F6 @0803A348: ldr r1, =0x020241ea ldrh r0, [r1] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 ldr r2, =gBattleMoves adds r1, r2 ldrb r0, [r1] cmp r0, 0x7F bne @0803A414 @0803A35C: mov r3, r9 ldrb r1, [r3] movs r0, 0x58 adds r2, r1, 0 muls r2, r0 ldr r0, =0x02024084 adds r0, 0x50 adds r2, r0 ldr r0, [r2] ldr r1, =0x15100007 ands r0, r1 str r0, [r2] ldrb r1, [r3] lsls r1, 2 add r1, r10 ldr r0, [r1] ldr r2, =0x0003043f ands r0, r2 str r0, [r1] movs r5, 0 ldr r6, =0x0202406c ldrb r6, [r6] cmp r5, r6 bge @0803A430 mov r7, r9 movs r6, 0 @0803A390: ldrb r0, [r7] bl battle_side_get_owner adds r4, r0, 0 lsls r0, r5, 24 lsrs r0, 24 bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 beq @0803A3D0 ldr r1, =0x020242ac lsls r0, r5, 2 adds r2, r0, r1 ldr r1, [r2] movs r0, 0x18 ands r0, r1 cmp r0, 0 beq @0803A3D0 ldr r0, =0x020242bc adds r0, r6, r0 ldrb r0, [r0, 0x15] ldrb r3, [r7] cmp r0, r3 bne @0803A3D0 movs r0, 0x19 negs r0, r0 ands r1, r0 movs r0, 0x10 orrs r1, r0 str r1, [r2] @0803A3D0: adds r6, 0x1C adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @0803A390 ldr r6, =0x020242bc mov r12, r6 ldr r7, =0x02024064 mov r9, r7 b @0803A430 .align 2, 0 .pool @0803A414: mov r0, r9 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 ldr r1, =0x02024084 adds r1, 0x50 adds r0, r1 movs r1, 0 str r1, [r0] mov r2, r9 ldrb r0, [r2] lsls r0, 2 add r0, r10 str r1, [r0] @0803A430: movs r5, 0 ldr r3, =0x0202449c mov r8, r3 ldr r6, =0x020244ac mov r10, r6 ldr r7, =0x0202406c ldrb r7, [r7] cmp r5, r7 bge @0803A490 ldr r3, =0x020240d4 ldr r7, =gUnknown_0832A328 ldr r6, =0x02024064 @0803A448: movs r0, 0x58 muls r0, r5 adds r4, r0, r3 ldrb r0, [r6] lsls r0, 2 adds r0, r7 ldr r0, [r0] lsls r2, r0, 16 ldr r1, [r4] adds r0, r1, 0 ands r0, r2 cmp r0, 0 beq @0803A466 bics r1, r2 str r1, [r4] @0803A466: ldr r1, [r4] movs r0, 0xE0 lsls r0, 8 ands r0, r1 cmp r0, 0 beq @0803A486 mov r2, r8 ldr r0, [r2] adds r0, r5, r0 ldrb r0, [r0, 0x14] ldrb r2, [r6] cmp r0, r2 bne @0803A486 ldr r0, =0xffff1fff ands r1, r0 str r1, [r4] @0803A486: adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @0803A448 @0803A490: mov r1, r9 ldrb r0, [r1] add r0, r10 movs r1, 0 strb r1, [r0] mov r2, r9 ldrb r0, [r2] ldr r3, =0x020244b0 adds r0, r3 strb r1, [r0] ldrb r1, [r2] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 mov r6, r12 adds r1, r0, r6 movs r5, 0 movs r2, 0 @0803A4B4: adds r0, r1, r5 strb r2, [r0] adds r5, 0x1 cmp r5, 0x1B bls @0803A4B4 ldr r7, =0x020241ea ldrh r0, [r7] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 ldr r0, =gBattleMoves adds r1, r0 ldrb r0, [r1] cmp r0, 0x7F bne @0803A540 mov r2, r9 ldrb r1, [r2] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 mov r1, sp ldrb r1, [r1, 0xA] strb r1, [r0, 0xA] ldrb r1, [r2] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 mov r1, sp ldrb r1, [r1, 0x15] strb r1, [r0, 0x15] ldrb r0, [r2] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 add r1, r12 mov r0, sp ldrb r2, [r0, 0xF] lsls r2, 28 movs r4, 0xF lsrs r2, 28 ldrb r3, [r1, 0xF] movs r0, 0x10 negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1, 0xF] mov r3, r9 ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 mov r1, sp ldrb r1, [r1, 0xF] lsrs r1, 4 lsls r1, 4 ldrb r2, [r0, 0xF] ands r4, r2 orrs r4, r1 strb r4, [r0, 0xF] ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 mov r1, sp ldrb r1, [r1, 0x14] strb r1, [r0, 0x14] @0803A540: movs r0, 0 ldr r6, =0x0202427c strb r0, [r6] mov r7, r9 ldrb r1, [r7] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 movs r4, 0 movs r1, 0x2 strb r1, [r0, 0x16] ldrb r0, [r7] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 add r1, r12 mov r0, sp ldrb r0, [r0, 0x18] movs r2, 0x2 ands r2, r0 ldrb r3, [r1, 0x18] movs r0, 0x3 negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1, 0x18] ldrb r0, [r7] lsls r0, 1 ldr r1, =0x02024248 adds r0, r1 movs r2, 0 strh r4, [r0] ldrb r0, [r7] lsls r0, 1 ldr r3, =0x02024250 adds r0, r3 strh r4, [r0] ldrb r0, [r7] lsls r0, 1 ldr r6, =0x02024258 adds r0, r6 strh r4, [r0] ldrb r0, [r7] lsls r0, 1 ldr r7, =0x02024260 adds r0, r7 strh r4, [r0] mov r1, r9 ldrb r0, [r1] lsls r0, 1 ldr r3, =0x02024240 adds r0, r3 strh r4, [r0] ldrb r0, [r1] ldr r6, =0x02024270 adds r0, r6 movs r1, 0xFF strb r1, [r0] mov r7, r9 ldrb r0, [r7] mov r3, r8 ldr r1, [r3] lsls r0, 1 adds r0, r1 adds r0, 0x98 strb r2, [r0] ldrb r0, [r7] ldr r1, [r3] lsls r0, 1 adds r0, r1 adds r0, 0x99 strb r2, [r0] ldrb r0, [r7] ldr r1, [r3] lsls r0, 3 adds r0, r1 adds r0, 0xE0 strb r2, [r0] ldrb r0, [r7] ldr r1, [r3] lsls r0, 3 adds r0, r1 adds r0, 0xE1 strb r2, [r0] ldrb r0, [r7] ldr r1, [r3] lsls r0, 3 adds r0, r1 adds r0, 0xE2 strb r2, [r0] ldrb r0, [r7] ldr r1, [r3] lsls r0, 3 adds r0, r1 adds r0, 0xE3 strb r2, [r0] ldrb r0, [r7] ldr r1, [r3] lsls r0, 3 adds r0, r1 adds r0, 0xE4 strb r2, [r0] ldrb r0, [r7] ldr r1, [r3] lsls r0, 3 adds r0, r1 adds r0, 0xE5 strb r2, [r0] ldrb r0, [r7] ldr r1, [r3] lsls r0, 3 adds r0, r1 adds r0, 0xE6 strb r2, [r0] ldrb r0, [r7] ldr r1, [r3] lsls r0, 3 adds r0, r1 adds r0, 0xE7 strb r2, [r0] ldr r1, [r3] adds r1, 0x92 ldrb r0, [r7] lsls r0, 2 ldr r6, =gUnknown_0832A328 adds r0, r6 ldr r2, [r0] ldrb r0, [r1] bics r0, r2 strb r0, [r1] movs r5, 0 ldr r7, =0x0202406c ldrb r7, [r7] cmp r5, r7 bge @0803A6B4 mov r3, r9 mov r7, r8 movs r6, 0 @0803A656: ldrb r0, [r3] cmp r5, r0 beq @0803A68C lsls r0, r5, 24 lsrs r0, 24 str r3, [sp, 0x1C] bl battle_side_get_owner adds r4, r0, 0 ldr r3, [sp, 0x1C] ldrb r0, [r3] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 ldr r3, [sp, 0x1C] cmp r4, r0 beq @0803A68C ldr r0, [r7] lsls r1, r5, 1 adds r0, r1, r0 adds r0, 0x98 strb r6, [r0] ldr r0, [r7] adds r1, r0 adds r1, 0x99 strb r6, [r1] @0803A68C: ldrb r0, [r3] ldr r1, [r7] lsls r0, 1 lsls r2, r5, 3 adds r0, r2 adds r0, r1 adds r0, 0xE0 strb r6, [r0] ldrb r0, [r3] ldr r1, [r7] lsls r0, 1 adds r0, r2 adds r0, r1 adds r0, 0xE1 strb r6, [r0] adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @0803A656 @0803A6B4: mov r1, r9 ldrb r0, [r1] mov r2, r8 ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0xC8 movs r2, 0 strb r2, [r0] mov r3, r9 ldrb r0, [r3] mov r6, r8 ldr r1, [r6] lsls r0, 1 adds r0, r1 adds r0, 0xC9 strb r2, [r0] ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x4] ldrb r0, [r3] lsls r0, 2 adds r1, r0 movs r2, 0 str r2, [r1] ldr r0, =0x020241ea strh r2, [r0] ldr r0, [r6] adds r0, 0xDA movs r1, 0xFF strb r1, [r0] ldrb r0, [r3] bl sub_81310F0 mov r7, r9 ldrb r0, [r7] bl sub_8131130 add sp, 0x20 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803A284 thumb_func_start sub_803A75C sub_803A75C: ; 803A75C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r5, 0 ldr r6, =0x02024084 ldr r0, =0x020242ac mov r8, r0 ldr r1, =0x0202449c mov r12, r1 ldr r2, =0x020244ac mov r9, r2 ldr r3, =0x020244b0 mov r10, r3 ldr r7, =0x0202433c ldr r4, =0x02024064 movs r3, 0x58 adds r2, r6, 0 adds r2, 0x18 movs r1, 0x6 @0803A788: ldrb r0, [r4] muls r0, r3 adds r0, r5, r0 adds r0, r2 strb r1, [r0] adds r5, 0x1 cmp r5, 0x7 ble @0803A788 ldr r0, =0x02024064 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r2, r6, 0 adds r2, 0x50 adds r0, r2 movs r1, 0 str r1, [r0] ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 2 add r0, r8 str r1, [r0] movs r5, 0 ldr r6, =0x0202406c ldrb r6, [r6] cmp r5, r6 bge @0803A830 adds r3, r2, 0 movs r4, 0 ldr r0, =gUnknown_0832A328 mov r8, r0 @0803A7C6: ldr r1, [r3] movs r0, 0x80 lsls r0, 19 ands r0, r1 cmp r0, 0 beq @0803A7E6 ldr r2, =0x020242bc adds r0, r4, r2 ldrb r0, [r0, 0x14] ldr r6, =0x02024064 ldrb r6, [r6] cmp r0, r6 bne @0803A7E6 ldr r0, =0xfbffffff ands r1, r0 str r1, [r3] @0803A7E6: ldr r1, =0x02024064 ldrb r0, [r1] lsls r0, 2 add r0, r8 ldr r0, [r0] lsls r2, r0, 16 ldr r1, [r3] adds r0, r1, 0 ands r0, r2 cmp r0, 0 beq @0803A800 bics r1, r2 str r1, [r3] @0803A800: ldr r1, [r3] movs r0, 0xE0 lsls r0, 8 ands r0, r1 cmp r0, 0 beq @0803A822 mov r2, r12 ldr r0, [r2] adds r0, r5, r0 ldrb r0, [r0, 0x14] ldr r6, =0x02024064 ldrb r6, [r6] cmp r0, r6 bne @0803A822 ldr r0, =0xffff1fff ands r1, r0 str r1, [r3] @0803A822: adds r3, 0x58 adds r4, 0x1C adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @0803A7C6 @0803A830: ldr r1, =0x02024064 ldrb r0, [r1] add r0, r9 movs r1, 0 strb r1, [r0] ldr r2, =0x02024064 ldrb r0, [r2] add r0, r10 strb r1, [r0] ldrb r1, [r2] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 ldr r3, =0x020242bc adds r1, r0, r3 movs r5, 0 movs r2, 0 @0803A852: adds r0, r1, r5 strb r2, [r0] adds r5, 0x1 cmp r5, 0x1B bls @0803A852 ldr r6, =0x02024064 ldrb r1, [r6] lsls r1, 4 adds r1, r7 ldrb r2, [r1] movs r0, 0x2 negs r0, r0 mov r9, r0 ands r0, r2 strb r0, [r1] ldrb r1, [r6] lsls r1, 4 adds r1, r7 ldrb r2, [r1] movs r3, 0x3 negs r3, r3 mov r8, r3 mov r0, r8 ands r0, r2 strb r0, [r1] ldrb r1, [r6] lsls r1, 4 adds r1, r7 ldrb r2, [r1] movs r6, 0x5 negs r6, r6 adds r0, r6, 0 ands r0, r2 strb r0, [r1] ldr r0, =0x02024064 ldrb r1, [r0] lsls r1, 4 adds r1, r7 ldrb r2, [r1] subs r3, 0x6 mov r10, r3 mov r0, r10 ands r0, r2 strb r0, [r1] ldr r0, =0x02024064 ldrb r1, [r0] lsls r1, 4 adds r1, r7 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r2, =0x02024064 ldrb r1, [r2] lsls r1, 4 adds r1, r7 ldrb r2, [r1] movs r5, 0x21 negs r5, r5 adds r0, r5, 0 ands r0, r2 strb r0, [r1] ldr r3, =0x02024064 ldrb r1, [r3] lsls r1, 4 adds r1, r7 ldrb r2, [r1] movs r4, 0x41 negs r4, r4 adds r0, r4, 0 ands r0, r2 strb r0, [r1] ldrb r1, [r3] lsls r1, 4 adds r1, r7 ldrb r2, [r1] movs r3, 0x7F adds r0, r3, 0 ands r0, r2 strb r0, [r1] ldr r0, =0x02024064 ldrb r1, [r0] lsls r1, 4 adds r1, r7 ldrb r2, [r1, 0x1] mov r0, r9 ands r0, r2 strb r0, [r1, 0x1] ldr r2, =0x02024064 ldrb r1, [r2] lsls r1, 4 adds r1, r7 ldrb r2, [r1, 0x1] mov r0, r8 ands r0, r2 strb r0, [r1, 0x1] ldr r0, =0x02024064 ldrb r1, [r0] lsls r1, 4 adds r1, r7 ldrb r2, [r1, 0x1] adds r0, r6, 0 ands r0, r2 strb r0, [r1, 0x1] ldr r2, =0x02024064 ldrb r1, [r2] lsls r1, 4 adds r1, r7 ldrb r2, [r1, 0x1] movs r0, 0x19 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r1, =0x02024064 ldrb r0, [r1] lsls r0, 4 adds r0, r7 ldrb r1, [r0, 0x1] ands r5, r1 strb r5, [r0, 0x1] ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 4 adds r0, r7 ldrb r1, [r0, 0x1] ands r4, r1 strb r4, [r0, 0x1] ldrb r0, [r2] lsls r0, 4 adds r0, r7 ldrb r1, [r0, 0x1] ands r3, r1 strb r3, [r0, 0x1] ldrb r0, [r2] lsls r0, 4 adds r0, r7 ldrb r1, [r0, 0x2] mov r3, r9 ands r3, r1 strb r3, [r0, 0x2] ldrb r0, [r2] lsls r0, 4 adds r0, r7 ldrb r1, [r0, 0x2] mov r2, r8 ands r2, r1 strb r2, [r0, 0x2] ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 4 adds r0, r7 ldrb r1, [r0, 0x2] ands r6, r1 strb r6, [r0, 0x2] ldrb r0, [r3] lsls r0, 4 adds r0, r7 ldrb r1, [r0, 0x2] mov r6, r10 ands r6, r1 strb r6, [r0, 0x2] ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 ldr r1, =0x020242bc adds r0, r1 movs r2, 0 movs r1, 0x2 strb r1, [r0, 0x16] ldrb r0, [r3] lsls r0, 1 ldr r3, =0x02024248 adds r0, r3 movs r3, 0 strh r2, [r0] ldr r6, =0x02024064 ldrb r0, [r6] lsls r0, 1 ldr r1, =0x02024250 adds r0, r1 strh r2, [r0] ldrb r0, [r6] lsls r0, 1 ldr r6, =0x02024258 adds r0, r6 strh r2, [r0] ldr r1, =0x02024064 ldrb r0, [r1] lsls r0, 1 ldr r6, =0x02024260 adds r0, r6 strh r2, [r0] ldrb r0, [r1] lsls r0, 1 ldr r1, =0x02024240 adds r0, r1 strh r2, [r0] ldr r2, =0x02024064 ldrb r0, [r2] ldr r6, =0x02024270 adds r0, r6 movs r1, 0xFF strb r1, [r0] ldrb r0, [r2] mov r2, r12 ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0xC8 strb r3, [r0] ldr r6, =0x02024064 ldrb r0, [r6] ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0xC9 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0x98 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0x99 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 3 adds r0, r1 adds r0, 0xE0 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 3 adds r0, r1 adds r0, 0xE1 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 3 adds r0, r1 adds r0, 0xE2 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 3 adds r0, r1 adds r0, 0xE3 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 3 adds r0, r1 adds r0, 0xE4 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 3 adds r0, r1 adds r0, 0xE5 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 3 adds r0, r1 adds r0, 0xE6 strb r3, [r0] ldrb r0, [r6] ldr r1, [r2] lsls r0, 3 adds r0, r1 adds r0, 0xE7 strb r3, [r0] ldr r1, [r2] adds r1, 0x92 ldrb r0, [r6] lsls r0, 2 ldr r2, =gUnknown_0832A328 adds r0, r2 ldr r2, [r0] ldrb r0, [r1] bics r0, r2 strb r0, [r1] movs r5, 0 ldr r3, =0x0202406c ldrb r3, [r3] cmp r5, r3 bge @0803AB02 adds r3, r6, 0 mov r7, r12 movs r6, 0 @0803AAA4: ldrb r0, [r3] cmp r5, r0 beq @0803AADA lsls r0, r5, 24 lsrs r0, 24 str r3, [sp] bl battle_side_get_owner adds r4, r0, 0 ldr r3, [sp] ldrb r0, [r3] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 ldr r3, [sp] cmp r4, r0 beq @0803AADA ldr r0, [r7] lsls r1, r5, 1 adds r0, r1, r0 adds r0, 0x98 strb r6, [r0] ldr r0, [r7] adds r1, r0 adds r1, 0x99 strb r6, [r1] @0803AADA: ldrb r0, [r3] ldr r1, [r7] lsls r0, 1 lsls r2, r5, 3 adds r0, r2 adds r0, r1 adds r0, 0xE0 strb r6, [r0] ldrb r0, [r3] ldr r1, [r7] lsls r0, 1 adds r0, r2 adds r0, r1 adds r0, 0xE1 strb r6, [r0] adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @0803AAA4 @0803AB02: ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x4] ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r1, r0 movs r0, 0 str r0, [r1] ldr r4, =0x02024084 ldrb r0, [r2] movs r3, 0x58 adds r2, r0, 0 muls r2, r3 b @0803AB6C .align 2, 0 .pool @0803AB6C: adds r2, r4 ldr r5, =gBaseStats ldrh r1, [r2] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r5 ldrb r0, [r0, 0x6] adds r2, 0x21 strb r0, [r2] ldr r6, =0x02024064 ldrb r0, [r6] adds r1, r0, 0 muls r1, r3 adds r1, r4 ldrh r2, [r1] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r5 ldrb r0, [r0, 0x7] adds r1, 0x22 strb r0, [r1] ldrb r0, [r6] bl sub_81310F0 ldrb r0, [r6] bl sub_8131130 add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803A75C thumb_func_start bc_8012FAC bc_8012FAC: ; 803ABC0 push {r4,r5,lr} ldr r5, =0x02024332 ldrb r0, [r5] cmp r0, 0 beq @0803ABD4 cmp r0, 0x1 beq @0803ABF8 b @0803AC2E .align 2, 0 .pool @0803ABD4: ldr r4, =0x02024064 ldrb r0, [r5, 0x1] strb r0, [r4] movs r0, 0 movs r1, 0 movs r2, 0 bl dp01_build_cmdbuf_x00_a_b_0 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] b @0803AC2E .align 2, 0 .pool @0803ABF8: ldr r0, =0x02024068 ldr r2, [r0] cmp r2, 0 bne @0803AC2E ldrb r0, [r5, 0x1] adds r0, 0x1 strb r0, [r5, 0x1] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bne @0803AC2C ldr r1, =0x03005d04 ldr r0, =bc_load_battlefield str r0, [r1] b @0803AC2E .align 2, 0 .pool @0803AC2C: strb r2, [r5] @0803AC2E: pop {r4,r5} pop {r0} bx r0 thumb_func_end bc_8012FAC thumb_func_start bc_load_battlefield bc_load_battlefield: ; 803AC34 push {r4,r5,lr} ldr r0, =0x02024068 ldr r5, [r0] cmp r5, 0 bne @0803AC64 movs r0, 0 bl battle_get_side_with_given_state ldr r4, =0x02024064 strb r0, [r4] ldr r0, =0x02022ff0 ldrb r1, [r0] movs r0, 0 bl dp01_build_cmdbuf_x2E_a ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x03005d04 ldr r0, =sub_803AC84 str r0, [r1] ldr r0, =0x02024332 strb r5, [r0] strb r5, [r0, 0x1] @0803AC64: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_load_battlefield thumb_func_start sub_803AC84 sub_803AC84: ; 803AC84 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x02024068 ldr r1, [r0] cmp r1, 0 beq @0803AC98 b @0803AF4E @0803AC98: ldr r2, =0x02024064 strb r1, [r2] ldr r0, =0x0202406c ldrb r0, [r0] cmp r1, r0 bcc @0803ACA6 b @0803AF48 @0803ACA6: movs r7, 0x58 ldr r0, =0x02024084 mov r8, r0 mov r9, r2 movs r1, 0x48 add r1, r8 mov r10, r1 @0803ACB4: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @0803ACFC ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0803ACFC ldrb r0, [r4] muls r0, r7 mov r2, r8 adds r3, r0, r2 movs r2, 0 movs r1, 0 @0803ACDA: adds r0, r3, r2 strb r1, [r0] adds r2, 0x1 cmp r2, 0x57 bls @0803ACDA b @0803ADCA .align 2, 0 .pool @0803ACFC: mov r1, r9 ldrb r0, [r1] muls r0, r7 mov r2, r8 adds r3, r0, r2 movs r2, 0 ldr r6, =gBaseStats ldr r5, =0x02023864 ldr r4, =0x02024064 @0803AD0E: adds r0, r3, r2 ldrb r1, [r4] lsls r1, 9 adds r1, 0x4 adds r1, r2, r1 adds r1, r5 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x57 bls @0803AD0E mov r1, r9 ldrb r0, [r1] adds r2, r0, 0 muls r2, r7 add r2, r8 ldrh r1, [r2] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x6] adds r2, 0x21 strb r0, [r2] mov r2, r9 ldrb r0, [r2] adds r2, r0, 0 muls r2, r7 add r2, r8 ldrh r1, [r2] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x7] adds r2, 0x22 strb r0, [r2] mov r1, r9 ldrb r0, [r1] adds r1, r0, 0 muls r1, r7 add r1, r8 ldrh r0, [r1] ldrb r1, [r1, 0x17] lsrs r1, 7 bl sub_806B694 mov r2, r9 ldrb r1, [r2] muls r1, r7 add r1, r8 adds r1, 0x20 strb r0, [r1] ldrb r0, [r2] bl battle_side_get_owner ldr r1, =0x0202449c lsls r0, 24 lsrs r0, 23 adds r0, 0xA8 ldr r1, [r1] adds r1, r0 mov r2, r9 ldrb r0, [r2] muls r0, r7 add r0, r8 ldrh r0, [r0, 0x28] strh r0, [r1] movs r2, 0 ldr r4, =0x02024064 movs r5, 0x58 ldr r1, =0x0202409c adds r6, r4, 0 movs r0, 0x18 negs r0, r0 adds r0, r1 mov r12, r0 movs r3, 0x6 @0803ADAA: ldrb r0, [r4] muls r0, r5 adds r0, r2, r0 adds r0, r1 strb r3, [r0] adds r2, 0x1 cmp r2, 0x7 ble @0803ADAA ldrb r0, [r6] adds r1, r0, 0 muls r1, r7 mov r0, r12 adds r0, 0x50 adds r1, r0 movs r0, 0 str r0, [r1] @0803ADCA: ldr r4, =0x02024064 ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 cmp r0, 0 bne @0803ADE4 movs r0, 0 bl dp01_build_cmdbuf_x07_7_7_7 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803ADE4: ldr r5, =0x02022fec ldr r0, [r5] movs r1, 0x8 ands r0, r1 cmp r0, 0 beq @0803AE60 ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0803AE0A movs r0, 0 bl dp01_build_cmdbuf_x07_7_7_7 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803AE0A: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0803AEC0 ldr r0, [r5] ldr r1, =0x063f0902 ands r0, r1 cmp r0, 0 bne @0803AEC0 ldrb r0, [r4] muls r0, r7 add r0, r8 ldrh r0, [r0] bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 ldrb r1, [r4] muls r1, r7 add r1, r10 ldr r2, [r1] movs r1, 0x2 bl sub_806F01C b @0803AEC0 .align 2, 0 .pool @0803AE60: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0803AEC0 ldr r0, [r5] ldr r1, =0x063f0902 ands r0, r1 cmp r0, 0 bne @0803AE96 ldrb r0, [r4] muls r0, r7 add r0, r8 ldrh r0, [r0] bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 ldrb r1, [r4] muls r1, r7 add r1, r10 ldr r2, [r1] movs r1, 0x2 bl 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, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr ldr r1, =0x03005d10 strh r0, [r1, 0x20] @0803AEC0: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0803AEF6 ldr r4, =0x02024064 ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 beq @0803AEEA ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bne @0803AEF6 @0803AEEA: movs r0, 0 bl dp01_build_cmdbuf_x07_7_7_7 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803AEF6: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 beq @0803AF20 ldr r4, =0x02024064 ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bne @0803AF20 movs r0, 0 bl dp01_build_cmdbuf_x07_7_7_7 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803AF20: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @0803AF32 bl sub_81A56B4 @0803AF32: mov r1, r9 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcs @0803AF48 b @0803ACB4 @0803AF48: ldr r1, =0x03005d04 ldr r0, =bc_801333C str r0, [r1] @0803AF4E: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803AC84 thumb_func_start bc_801333C bc_801333C: ; 803AF80 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x30 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @0803AF92 b @0803B10C @0803AF92: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x8 ands r0, r1 cmp r0, 0 bne @0803AFA0 b @0803B0AC @0803AFA0: movs r7, 0 add r0, sp, 0x4 mov r8, r0 mov r6, r8 mov r5, sp @0803AFAA: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x02024744 adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @0803AFD0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 bne @0803AFE8 @0803AFD0: ldr r0, =0x0000ffff strh r0, [r5] movs r0, 0 b @0803AFFA .align 2, 0 .pool @0803AFE8: adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr strh r0, [r5] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr @0803AFFA: str r0, [r6] adds r6, 0x8 adds r5, 0x8 adds r7, 0x1 cmp r7, 0x5 ble @0803AFAA movs r0, 0x1 bl battle_get_side_with_given_state ldr r4, =0x02024064 strb r0, [r4] movs r0, 0 mov r1, sp movs r2, 0x80 bl dp01_build_cmdbuf_x30_TODO ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution movs r7, 0 mov r6, r8 mov r5, sp @0803B026: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @0803B04C adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 bne @0803B060 @0803B04C: ldr r0, =0x0000ffff strh r0, [r5] movs r0, 0 b @0803B072 .align 2, 0 .pool @0803B060: adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr strh r0, [r5] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr @0803B072: str r0, [r6] adds r6, 0x8 adds r5, 0x8 adds r7, 0x1 cmp r7, 0x5 ble @0803B026 movs r0, 0 bl battle_get_side_with_given_state ldr r4, =0x02024064 strb r0, [r4] movs r0, 0 mov r1, sp movs r2, 0x80 bl dp01_build_cmdbuf_x30_TODO ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x03005d04 ldr r0, =bc_battle_begin_message b @0803B10A .align 2, 0 .pool @0803B0AC: movs r7, 0 add r6, sp, 0x4 mov r5, sp @0803B0B2: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @0803B0D8 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 bne @0803B0E8 @0803B0D8: ldr r0, =0x0000ffff strh r0, [r5] movs r0, 0 b @0803B0FA .align 2, 0 .pool @0803B0E8: adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr strh r0, [r5] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr @0803B0FA: str r0, [r6] adds r6, 0x8 adds r5, 0x8 adds r7, 0x1 cmp r7, 0x5 ble @0803B0B2 ldr r1, =0x03005d04 ldr r0, =bc_8013568 @0803B10A: str r0, [r1] @0803B10C: add sp, 0x30 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_801333C thumb_func_start bc_battle_begin_message bc_battle_begin_message: ; 803B120 push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0803B142 movs r0, 0x1 bl battle_get_side_with_given_state ldr r1, =0x02024064 strb r0, [r1] ldrb r1, [r1] movs r0, 0 bl b_std_message ldr r1, =0x03005d04 ldr r0, =sub_803B180 str r0, [r1] @0803B142: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_battle_begin_message thumb_func_start bc_8013568 bc_8013568: ; 803B158 push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0803B170 ldr r1, =0x03005d04 ldr r0, =sub_803B3CC str r0, [r1] movs r0, 0 movs r1, 0 bl b_std_message @0803B170: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_8013568 thumb_func_start sub_803B180 sub_803B180: ; 803B180 push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0803B1D0 ldr r0, =0x02022fec ldr r2, [r0] movs r0, 0x80 lsls r0, 17 ands r0, r2 cmp r0, 0 beq @0803B1B8 movs r0, 0x80 lsls r0, 18 ands r0, r2 cmp r0, 0 beq @0803B1B8 movs r1, 0x80 lsls r1, 24 ands r1, r2 negs r0, r1 orrs r0, r1 lsrs r0, 31 b @0803B1BA .align 2, 0 .pool @0803B1B8: movs r0, 0x1 @0803B1BA: bl battle_get_side_with_given_state adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 movs r0, 0x1 bl b_std_message ldr r1, =0x03005d04 ldr r0, =sub_803B25C str r0, [r1] @0803B1D0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B180 thumb_func_start sub_803B1DC sub_803B1DC: ; 803B1DC push {r4,r5,lr} ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 17 ands r0, r1 cmp r0, 0 beq @0803B1FC movs r0, 0x80 lsls r0, 18 ands r0, r1 cmp r0, 0 beq @0803B1FC movs r5, 0x2 cmp r1, 0 bge @0803B1FE @0803B1FC: movs r5, 0x3 @0803B1FE: ldr r1, =0x02024064 movs r0, 0 strb r0, [r1] ldr r0, =0x0202406c ldrb r0, [r0] cmp r0, 0 beq @0803B23A adds r4, r1, 0 @0803B20E: ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, r5 bne @0803B228 movs r0, 0 bl dp01_build_cmdbuf_x2F_2F_2F_2F ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803B228: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @0803B20E @0803B23A: ldr r1, =0x03005d04 ldr r0, =bc_801362C str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B1DC thumb_func_start sub_803B25C sub_803B25C: ; 803B25C push {r4-r6,lr} ldr r0, =0x02022fec ldr r2, [r0] movs r0, 0x80 lsls r0, 17 ands r0, r2 cmp r0, 0 beq @0803B298 movs r0, 0x80 lsls r0, 18 ands r0, r2 cmp r0, 0 beq @0803B298 movs r1, 0x80 lsls r1, 24 ands r1, r2 negs r0, r1 orrs r0, r1 lsrs r5, r0, 31 b @0803B29A .align 2, 0 .pool @0803B288: ldr r1, =0x03005d04 ldr r0, =sub_803B1DC b @0803B2F0 .align 2, 0 .pool @0803B298: movs r5, 0x1 @0803B29A: ldr r0, =0x02024068 ldr r2, [r0] cmp r2, 0 bne @0803B2F2 ldr r0, =0x02024064 strb r2, [r0] ldr r1, =0x0202406c adds r4, r0, 0 ldrb r1, [r1] cmp r2, r1 bcs @0803B2EC adds r6, r4, 0 @0803B2B2: ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, r5 bne @0803B2D8 movs r0, 0 bl dp01_build_cmdbuf_x2F_2F_2F_2F ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00008040 ands r0, r1 cmp r0, 0 bne @0803B288 @0803B2D8: ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldr r4, =0x02024064 ldrb r1, [r1] cmp r0, r1 bcc @0803B2B2 @0803B2EC: ldr r1, =0x03005d04 ldr r0, =bc_801362C @0803B2F0: str r0, [r1] @0803B2F2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B25C thumb_func_start bc_801362C bc_801362C: ; 803B314 push {r4-r7,lr} ldr r0, =0x02024068 ldr r1, [r0] cmp r1, 0 bne @0803B384 ldr r2, =0x02024064 strb r1, [r2] ldr r0, =0x0202406c ldrb r0, [r0] cmp r1, r0 bcs @0803B37E adds r4, r2, 0 ldr r6, =0x02024084 movs r5, 0x58 adds r7, r6, 0 adds r7, 0x48 @0803B334: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0803B36C ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x063f0902 ands r0, r1 cmp r0, 0 bne @0803B36C ldrb r0, [r4] muls r0, r5 adds r0, r6 ldrh r0, [r0] bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 ldrb r1, [r4] muls r1, r5 adds r1, r7 ldr r2, [r1] movs r1, 0x2 bl sub_806F01C @0803B36C: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @0803B334 @0803B37E: ldr r1, =0x03005d04 ldr r0, =sub_803B3CC str r0, [r1] @0803B384: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_801362C thumb_func_start sub_803B3AC sub_803B3AC: ; 803B3AC push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0803B3BC ldr r1, =0x03005d04 ldr r0, =sub_803B3CC str r0, [r1] @0803B3BC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B3AC thumb_func_start sub_803B3CC sub_803B3CC: ; 803B3CC push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0803B418 ldr r1, =0x02022fec ldr r2, [r1] movs r0, 0x80 lsls r0, 17 ands r0, r2 cmp r0, 0 beq @0803B3F4 movs r0, 0x80 lsls r0, 18 ands r0, r2 cmp r0, 0 beq @0803B3F4 movs r3, 0x1 cmp r2, 0 bge @0803B3F6 @0803B3F4: movs r3, 0 @0803B3F6: ldr r0, [r1] movs r1, 0x80 ands r0, r1 cmp r0, 0 bne @0803B412 adds r0, r3, 0 bl battle_get_side_with_given_state adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 movs r0, 0x1 bl b_std_message @0803B412: ldr r1, =0x03005d04 ldr r0, =sub_803B4C8 str r0, [r1] @0803B418: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B3CC thumb_func_start sub_803B42C sub_803B42C: ; 803B42C push {r4,r5,lr} ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 17 ands r0, r1 cmp r0, 0 beq @0803B44C movs r0, 0x80 lsls r0, 18 ands r0, r1 cmp r0, 0 beq @0803B44C movs r5, 0x3 cmp r1, 0 bge @0803B44E @0803B44C: movs r5, 0x2 @0803B44E: ldr r1, =0x02024064 movs r0, 0 strb r0, [r1] ldr r0, =0x0202406c ldrb r0, [r0] cmp r0, 0 beq @0803B48A adds r4, r1, 0 @0803B45E: ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, r5 bne @0803B478 movs r0, 0 bl dp01_build_cmdbuf_x2F_2F_2F_2F ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803B478: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @0803B45E @0803B48A: ldr r2, =0x0202449c ldr r0, [r2] adds r0, 0x4C movs r1, 0 strb r1, [r0] ldr r0, [r2] adds r0, 0xD9 strb r1, [r0] ldr r0, [r2] movs r2, 0xD1 lsls r2, 1 adds r0, r2 strb r1, [r0] ldr r1, =0x03005d04 ldr r0, =sub_803B628 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B42C thumb_func_start sub_803B4C8 sub_803B4C8: ; 803B4C8 push {r4-r6,lr} ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 17 ands r0, r1 cmp r0, 0 beq @0803B500 movs r0, 0x80 lsls r0, 18 ands r0, r1 cmp r0, 0 beq @0803B500 movs r6, 0x1 cmp r1, 0 bge @0803B502 b @0803B500 .align 2, 0 .pool @0803B4F0: ldr r1, =0x03005d04 ldr r0, =sub_803B42C b @0803B572 .align 2, 0 .pool @0803B500: movs r6, 0 @0803B502: ldr r0, =0x02024068 ldr r2, [r0] cmp r2, 0 bne @0803B574 ldr r0, =0x02024064 strb r2, [r0] ldr r1, =0x0202406c adds r4, r0, 0 ldrb r1, [r1] cmp r2, r1 bcs @0803B554 adds r5, r4, 0 @0803B51A: ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, r6 bne @0803B540 movs r0, 0 bl dp01_build_cmdbuf_x2F_2F_2F_2F ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @0803B4F0 @0803B540: ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldr r4, =0x02024064 ldrb r1, [r1] cmp r0, r1 bcc @0803B51A @0803B554: ldr r2, =0x0202449c ldr r0, [r2] adds r0, 0x4C movs r1, 0 strb r1, [r0] ldr r0, [r2] adds r0, 0xD9 strb r1, [r0] ldr r0, [r2] movs r2, 0xD1 lsls r2, 1 adds r0, r2 strb r1, [r0] ldr r1, =0x03005d04 ldr r0, =sub_803B628 @0803B572: str r0, [r1] @0803B574: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B4C8 thumb_func_start sub_803B598 sub_803B598: ; 803B598 push {r4,r5,lr} ldr r0, =0x02024068 ldr r1, [r0] cmp r1, 0 bne @0803B606 ldr r2, =0x02024064 strb r1, [r2] ldr r0, =0x0202406c ldrb r0, [r0] cmp r1, r0 bcs @0803B5E6 adds r4, r2, 0 ldr r5, =0x0202406e @0803B5B2: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0803B5D4 ldrb r0, [r4] lsls r0, 1 adds r0, r5 ldrb r1, [r0] movs r0, 0 movs r2, 0 bl dp01_build_cmdbuf_x05_a_b_c ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803B5D4: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @0803B5B2 @0803B5E6: ldr r2, =0x0202449c ldr r0, [r2] adds r0, 0x4C movs r1, 0 strb r1, [r0] ldr r0, [r2] adds r0, 0xD9 strb r1, [r0] ldr r0, [r2] movs r2, 0xD1 lsls r2, 1 adds r0, r2 strb r1, [r0] ldr r1, =0x03005d04 ldr r0, =sub_803B628 str r0, [r1] @0803B606: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B598 thumb_func_start sub_803B628 sub_803B628: ; 803B628 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r0, 0 mov r9, r0 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @0803B642 b @0803B8B2 @0803B642: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x4C ldrb r0, [r0] cmp r0, 0 bne @0803B6C2 movs r5, 0 ldr r1, =0x0202406c mov r10, r1 ldrb r3, [r1] cmp r5, r3 bge @0803B668 ldr r2, =0x0202407e @0803B65C: adds r0, r5, r2 strb r5, [r0] adds r5, 0x1 ldrb r0, [r1] cmp r5, r0 blt @0803B65C @0803B668: movs r5, 0 b @0803B6B8 .align 2, 0 .pool @0803B67C: adds r4, r5, 0x1 mov r8, r4 ldrb r1, [r1] cmp r8, r1 bge @0803B6B6 ldr r6, =0x0202407e ldr r1, =0x0202406c mov r10, r1 lsls r7, r5, 24 @0803B68E: adds r0, r5, r6 ldrb r0, [r0] adds r1, r4, r6 ldrb r1, [r1] movs r2, 0x1 bl b_first_side lsls r0, 24 cmp r0, 0 beq @0803B6AC lsls r1, r4, 24 lsrs r1, 24 lsrs r0, r7, 24 bl sub_803CEDC @0803B6AC: adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0803B68E @0803B6B6: mov r5, r8 @0803B6B8: mov r1, r10 ldrb r0, [r1] subs r0, 0x1 cmp r5, r0 blt @0803B67C @0803B6C2: ldr r5, =0x0202449c ldr r0, [r5] movs r4, 0xD1 lsls r4, 1 adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @0803B6FC str r0, [sp] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0xFF bl ability_something lsls r0, 24 cmp r0, 0 beq @0803B6FC ldr r0, [r5] adds r0, r4 movs r1, 0x1 strb r1, [r0] b @0803B8B2 .align 2, 0 .pool @0803B6FC: ldr r2, =0x0202449c ldr r0, [r2] adds r0, 0x4C ldr r1, =0x0202406c ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bcs @0803B756 ldr r5, =0x0202407e adds r4, r2, 0 @0803B710: ldr r0, [r4] adds r0, 0x4C ldrb r0, [r0] adds r0, r5 ldrb r1, [r0] movs r0, 0 str r0, [sp] movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @0803B736 mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @0803B736: ldr r1, [r4] adds r1, 0x4C ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r3, r9 cmp r3, 0 beq @0803B748 b @0803B8B2 @0803B748: ldr r0, [r4] adds r0, 0x4C ldr r1, =0x0202406c ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bcc @0803B710 @0803B756: movs r0, 0 str r0, [sp] movs r0, 0x9 movs r1, 0 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @0803B770 b @0803B8B2 @0803B770: str r0, [sp] movs r0, 0xB movs r1, 0 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @0803B786 b @0803B8B2 @0803B786: ldr r2, =0x0202449c ldr r0, [r2] adds r0, 0xD9 ldr r1, =0x0202406c ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bcs @0803B7DA ldr r5, =0x0202407e adds r4, r2, 0 @0803B79A: ldr r0, [r4] adds r0, 0xD9 ldrb r0, [r0] adds r0, r5 ldrb r1, [r0] movs r0, 0 movs r2, 0 bl berry_effects_maybe lsls r0, 24 cmp r0, 0 beq @0803B7BC mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @0803B7BC: ldr r1, [r4] adds r1, 0xD9 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r0, r9 cmp r0, 0 bne @0803B8B2 ldr r0, [r4] adds r0, 0xD9 ldr r1, =0x0202406c ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bcc @0803B79A @0803B7DA: movs r5, 0 ldr r1, =0x0202449c mov r8, r1 movs r7, 0x6 ldr r6, =0x0202421c ldr r2, =0x02024274 movs r4, 0xFF movs r3, 0 @0803B7EA: mov r1, r8 ldr r0, [r1] adds r0, r5, r0 adds r0, 0x5C strb r7, [r0] adds r1, r5, r6 ldrb r0, [r1] orrs r0, r4 strb r0, [r1] strh r3, [r2] adds r2, 0x2 adds r5, 0x1 cmp r5, 0x3 ble @0803B7EA movs r0, 0 bl sub_803D580 bl sub_803D6A0 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x91 ldr r1, =0x02024210 ldrb r1, [r1] strb r1, [r0] ldr r0, =gUnknown_085CC23E movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d04 ldr r0, =sub_803BE74 str r0, [r1] bl sub_803F988 ldr r1, =0x02024332 movs r2, 0 adds r0, r1, 0x7 @0803B834: strb r2, [r0] subs r0, 0x1 cmp r0, r1 bge @0803B834 movs r5, 0 ldr r3, =0x0202406c ldr r2, =0x0202449c ldr r6, =0x02024474 ldr r7, =0x0202427c ldrb r0, [r3] cmp r5, r0 bge @0803B866 ldr r0, =0x02024084 movs r4, 0x9 negs r4, r4 adds r1, r0, 0 adds r1, 0x50 @0803B856: ldr r0, [r1] ands r0, r4 str r0, [r1] adds r1, 0x58 adds r5, 0x1 ldrb r0, [r3] cmp r5, r0 blt @0803B856 @0803B866: ldr r0, [r2] movs r1, 0 strb r1, [r0] ldr r0, [r2] strb r1, [r0, 0x1] ldr r0, [r2] movs r3, 0xD0 lsls r3, 1 adds r0, r3 strb r1, [r0] ldr r0, [r2] adds r3, 0x1 adds r0, r3 strb r1, [r0] movs r1, 0 strb r1, [r6, 0x14] ldr r0, [r2] adds r0, 0x4D strb r1, [r0] ldr r0, [r2] strb r1, [r0, 0x3] strb r1, [r7] bl GenerateRandomNumber ldr r1, =0x02024330 strh r0, [r1] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @0803B8B2 bl sub_80A369C ldr r0, =gUnknown_082DB8BE bl b_call_bc_move_exec @0803B8B2: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B628 thumb_func_start bc_8013B1C bc_8013B1C: ; 803B904 push {r4-r6,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0803B994 ldr r1, =0x03005d04 ldr r0, =sub_803B9BC str r0, [r1] ldr r3, =0x0202406c ldr r1, =0x02024332 movs r2, 0 adds r0, r1, 0x7 @0803B91C: strb r2, [r0] subs r0, 0x1 cmp r0, r1 bge @0803B91C movs r4, 0 ldrb r3, [r3] cmp r4, r3 bge @0803B96E ldr r5, =0x02024084 adds r6, r5, 0 adds r6, 0x4C @0803B932: movs r0, 0x58 adds r2, r4, 0 muls r2, r0 adds r1, r5, 0 adds r1, 0x50 adds r1, r2, r1 ldr r3, [r1] subs r0, 0x61 ands r3, r0 str r3, [r1] adds r2, r6 ldr r0, [r2] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @0803B964 movs r0, 0x80 lsls r0, 5 ands r3, r0 cmp r3, 0 beq @0803B964 lsls r0, r4, 24 lsrs r0, 24 bl b_cancel_multi_turn_move_maybe @0803B964: adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0803B932 @0803B96E: ldr r2, =0x0202449c ldr r0, [r2] movs r1, 0 strb r1, [r0] ldr r0, [r2] strb r1, [r0, 0x1] ldr r0, [r2] movs r3, 0xD0 lsls r3, 1 adds r0, r3 strb r1, [r0] ldr r0, [r2] adds r3, 0x1 adds r0, r3 strb r1, [r0] ldr r0, [r2] strb r1, [r0, 0x3] ldr r0, =0x0202427c strb r1, [r0] @0803B994: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_8013B1C thumb_func_start sub_803B9BC sub_803B9BC: ; 803B9BC push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r0, 0x1 bl sub_803D580 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0 bne @0803B9EA bl sub_80401D0 lsls r0, 24 cmp r0, 0 beq @0803B9DE b @0803BB78 @0803B9DE: bl sub_8040924 lsls r0, 24 cmp r0, 0 beq @0803B9EA b @0803BB78 @0803B9EA: bl sub_8041728 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @0803B9F8 b @0803BB78 @0803B9F8: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x4D strb r1, [r0] bl sub_8041364 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @0803BA0E b @0803BB78 @0803BA0E: movs r0, 0 bl sub_803D580 ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xfffffdff ands r0, r1 ldr r1, =0xfff7ffff ands r0, r1 ldr r1, =0xffbfffff ands r0, r1 ldr r1, =0xffefffff ands r0, r1 str r0, [r2] ldr r0, =0x02024474 strb r4, [r0, 0x18] strb r4, [r0, 0x19] strb r4, [r0, 0x14] ldr r0, =0x020241f0 str r4, [r0] ldr r0, =0x0202427c strb r4, [r0] ldr r1, =0x02024332 movs r2, 0 adds r0, r1, 0x4 @0803BA40: strb r2, [r0] subs r0, 0x1 cmp r0, r1 bge @0803BA40 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0 beq @0803BA98 ldr r1, =0x02024083 movs r0, 0xC strb r0, [r1] ldr r1, =0x03005d04 ldr r0, =bc_bs_exec str r0, [r1] b @0803BB78 .align 2, 0 .pool @0803BA98: ldr r1, =0x03005d10 ldrb r0, [r1, 0x13] ldr r2, =0x0202449c mov r8, r2 cmp r0, 0xFE bhi @0803BAB2 adds r0, 0x1 strb r0, [r1, 0x13] ldr r1, [r2] adds r1, 0xDA ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0803BAB2: movs r2, 0 ldr r4, =0x0202406c ldr r0, =0x02024210 mov r12, r0 ldr r1, =gUnknown_085CC23E mov r9, r1 ldrb r0, [r4] cmp r2, r0 bge @0803BAE0 ldr r7, =0x0202421c movs r6, 0xFF movs r5, 0 ldr r3, =0x02024274 @0803BACC: adds r1, r2, r7 ldrb r0, [r1] orrs r0, r6 strb r0, [r1] strh r5, [r3] adds r3, 0x2 adds r2, 0x1 ldrb r1, [r4] cmp r2, r1 blt @0803BACC @0803BAE0: movs r2, 0 ldr r3, =0x0202449c movs r1, 0x6 @0803BAE6: ldr r0, [r3] adds r0, r2, r0 adds r0, 0x5C strb r1, [r0] adds r2, 0x1 cmp r2, 0x3 ble @0803BAE6 mov r2, r8 ldr r0, [r2] adds r0, 0x91 mov r2, r12 ldrb r1, [r2] strb r1, [r0] mov r0, r9 movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d04 ldr r0, =sub_803BE74 str r0, [r1] bl GenerateRandomNumber ldr r1, =0x02024330 strh r0, [r1] ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 10 ands r0, r1 cmp r0, 0 beq @0803BB5C ldr r0, =gUnknown_082DB881 bl b_call_bc_move_exec b @0803BB78 .align 2, 0 .pool @0803BB5C: movs r0, 0x80 lsls r0, 11 ands r1, r0 cmp r1, 0 beq @0803BB78 mov r1, r8 ldr r0, [r1] adds r0, 0xDA ldrb r0, [r0] cmp r0, 0 bne @0803BB78 ldr r0, =gUnknown_082DB8BE bl b_call_bc_move_exec @0803BB78: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803B9BC thumb_func_start sub_803BB88 sub_803BB88: ; 803BB88 push {r4-r7,lr} sub sp, 0x4 ldr r1, =0x02024084 ldr r0, =0x02024064 ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, r0, r1 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @0803BBB8 ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x7] b @0803BBC2 .align 2, 0 .pool @0803BBB8: ldrh r0, [r1, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r2, r0, 24 @0803BBC2: ldr r1, =0x0202420f ldr r3, =0x02024064 ldrb r0, [r3] strb r0, [r1] cmp r2, 0x25 bne @0803BBD0 b @0803BD4C @0803BBD0: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @0803BBDE b @0803BD4C @0803BBDE: ldr r1, =0x02024084 ldrb r2, [r3] movs r0, 0x58 muls r0, r2 adds r0, r1 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x32 bne @0803BBF2 b @0803BD4C @0803BBF2: adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 bge @0803BC86 movs r7, 0 @0803BC08: lsrs r4, r7, 24 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r6, r0 beq @0803BC2C ldr r1, =0x02024084 movs r0, 0x58 muls r0, r5 adds r0, r1 adds r2, r0, 0 adds r2, 0x20 ldrb r0, [r2] cmp r0, 0x17 bne @0803BC2C b @0803BD54 @0803BC2C: adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r6, r0 beq @0803BC76 ldr r3, =0x02024084 ldr r0, =0x02024064 ldrb r0, [r0] movs r2, 0x58 muls r0, r2 adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x1A beq @0803BC76 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x2 beq @0803BC76 adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x2 beq @0803BC76 adds r0, r5, 0 muls r0, r2 adds r0, r3 adds r2, r0, 0 adds r2, 0x20 ldrb r0, [r2] cmp r0, 0x47 bne @0803BC76 b @0803BD70 @0803BC76: movs r0, 0x80 lsls r0, 17 adds r7, r0 adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @0803BC08 @0803BC86: ldr r4, =0x02024064 ldrb r1, [r4] movs r0, 0 str r0, [sp] movs r0, 0xF movs r2, 0x2A movs r3, 0 bl ability_something lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 beq @0803BCF8 ldr r6, =0x02024084 ldrb r0, [r4] movs r3, 0x58 muls r0, r3 adds r1, r0, r6 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x8 beq @0803BCBE adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x8 bne @0803BCF8 @0803BCBE: ldr r0, =0x02024474 subs r1, r5, 0x1 strb r1, [r0, 0x17] ldr r2, =0x0202420a adds r0, r1, 0 muls r0, r3 adds r0, r6 adds r0, 0x20 ldrb r0, [r0] strb r0, [r2] ldr r1, =0x02024332 movs r0, 0x2 b @0803BD90 .align 2, 0 .pool @0803BCF8: ldr r1, =0x02024084 ldr r0, =0x02024064 ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] ldr r1, =0x0400e000 ands r0, r1 cmp r0, 0 bne @0803BD22 ldr r1, =0x020242ac lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 3 ands r0, r1 cmp r0, 0 beq @0803BD40 @0803BD22: ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x5] movs r0, 0x1 b @0803BD92 .align 2, 0 .pool @0803BD40: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x10 ands r0, r1 cmp r0, 0 bne @0803BD8C @0803BD4C: movs r0, 0 b @0803BD92 .align 2, 0 .pool @0803BD54: ldr r0, =0x02024474 strb r5, [r0, 0x17] ldr r1, =0x0202420a ldrb r0, [r2] strb r0, [r1] ldr r1, =0x02024332 movs r0, 0x2 b @0803BD90 .align 2, 0 .pool @0803BD70: ldr r0, =0x02024474 strb r5, [r0, 0x17] ldr r1, =0x0202420a ldrb r0, [r2] strb r0, [r1] ldr r1, =0x02024332 movs r0, 0x2 b @0803BD90 .align 2, 0 .pool @0803BD8C: ldr r1, =0x02024332 movs r0, 0x1 @0803BD90: strb r0, [r1, 0x5] @0803BD92: add sp, 0x4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_803BB88 thumb_func_start sub_803BDA0 sub_803BDA0: ; 803BDA0 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r5, r0, 24 movs r3, 0 ldr r0, =0x0202406e mov r8, r0 ldr r1, =0x0203cf00 mov r12, r1 ldr r7, =0x0202449c lsls r0, r5, 1 adds r4, r0, r5 adds r6, r0, 0 @0803BDBC: mov r0, r12 adds r2, r3, r0 ldr r1, [r7] adds r0, r4, r3 adds r0, r1 adds r0, 0x60 ldrb r0, [r0] strb r0, [r2] adds r3, 0x1 cmp r3, 0x2 ble @0803BDBC mov r1, r8 adds r0, r6, r1 ldrb r0, [r0] bl pokemon_order_func adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r7, =0x0202449c ldr r0, [r7] adds r0, r5, r0 adds r0, 0x5C ldrb r0, [r0] bl pokemon_order_func adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_81B8FB0 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0803BE4C movs r3, 0 adds r4, r7, 0 adds r6, r5 movs r0, 0x2 adds r1, r5, 0 eors r1, r0 ldr r7, =0x0203cf00 lsls r0, r1, 1 adds r5, r0, r1 @0803BE1A: ldr r0, [r4] adds r1, r6, r3 adds r1, r0 adds r1, 0x60 adds r2, r3, r7 ldrb r0, [r2] strb r0, [r1] ldr r1, [r4] adds r0, r5, r3 adds r0, r1 adds r0, 0x60 ldrb r1, [r2] strb r1, [r0] adds r3, 0x1 cmp r3, 0x2 ble @0803BE1A b @0803BE66 .align 2, 0 .pool @0803BE4C: movs r3, 0 adds r2, r6, r5 ldr r4, =0x0203cf00 @0803BE52: ldr r0, [r7] adds r1, r2, r3 adds r1, r0 adds r1, 0x60 adds r0, r3, r4 ldrb r0, [r0] strb r0, [r1] adds r3, 0x1 cmp r3, 0x2 ble @0803BE52 @0803BE66: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803BDA0 thumb_func_start sub_803BE74 sub_803BE74: ; 803BE74 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x1C ldr r0, =0x02024332 movs r1, 0 strb r1, [r0, 0x4] ldr r0, =0x02024064 strb r1, [r0] ldr r0, =0x0202406c bl @0803CD12 .align 2, 0 .pool @0803BE9C: ldr r4, =0x02024064 ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x02024332 ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] cmp r0, 0x8 bls @0803BEB8 bl @0803CD04 @0803BEB8: lsls r0, 2 ldr r1, =@0803BED0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0803BED0: .4byte @0803BEF4 .4byte @0803BF0C .4byte @0803C02C .4byte @0803C7D8 .4byte @0803CAD0 .4byte @0803CB84 .4byte @0803CBC8 .4byte @0803CBF4 .4byte @0803CC38 @0803BEF4: bl sub_8185FD0 ldr r1, =0x02024332 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 bl @0803CC20 .align 2, 0 .pool @0803BF0C: ldr r0, =0x02024064 ldrb r1, [r0] ldr r4, =0x0202449c ldr r0, [r4] adds r1, r0 adds r1, 0x5C movs r0, 0x6 strb r0, [r1] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @0803BF68 movs r1, 0x2 movs r0, 0x2 ands r0, r5 cmp r0, 0 beq @0803BF68 eors r5, r1 adds r0, r5, 0 bl battle_get_side_with_given_state ldr r1, [r4] adds r1, 0x91 ldrb r1, [r1] ldr r2, =gUnknown_0832A328 lsls r0, 24 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0803BF68 ldr r4, =0x02024332 adds r0, r5, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r0, r4 ldrb r0, [r0] cmp r0, 0x5 beq @0803BF68 bl @0803CD04 @0803BF68: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x91 ldrb r3, [r0] ldr r1, =gUnknown_0832A328 ldr r4, =0x02024064 ldrb r2, [r4] lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ands r3, r0 cmp r3, 0 beq @0803BFD0 ldr r0, =0x0202421c adds r0, r2, r0 movs r1, 0xD strb r1, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @0803BFBC ldr r0, =0x02024332 ldrb r1, [r4] adds r1, r0 movs r0, 0x5 strb r0, [r1] bl @0803CD04 .align 2, 0 .pool @0803BFBC: ldr r0, =0x02024332 ldrb r1, [r4] adds r1, r0 movs r0, 0x4 strb r0, [r1] bl @0803CD04 .align 2, 0 .pool @0803BFD0: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r1, [r0] movs r0, 0x80 lsls r0, 5 ands r0, r1 cmp r0, 0 bne @0803BFF0 movs r0, 0x80 lsls r0, 15 ands r1, r0 cmp r1, 0 beq @0803C00C @0803BFF0: ldr r0, =0x0202421c adds r0, r2, r0 strb r3, [r0] ldr r1, =0x02024332 ldrb r0, [r4] bl @0803CC72 .align 2, 0 .pool @0803C00C: ldr r0, =0x0202421c ldrb r1, [r0] ldr r0, =0x02023864 ldrb r2, [r0, 0x1] ldrb r0, [r0, 0x2] lsls r0, 8 orrs r2, r0 movs r0, 0 bl dp01_build_cmdbuf_x12_a_bb bl @0803CB68 .align 2, 0 .pool @0803C02C: ldr r3, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r6, =0x02024064 ldrb r5, [r6] lsls r0, r5, 2 adds r0, r1 ldr r2, [r0] lsls r1, r2, 4 movs r0, 0xF0 lsls r0, 24 orrs r1, r0 orrs r1, r2 lsls r0, r2, 8 orrs r1, r0 lsls r2, 12 orrs r1, r2 ldr r0, [r3] ands r0, r1 cmp r0, 0 beq @0803C058 bl @0803CD04 @0803C058: ldr r4, =0x02023864 lsls r0, r5, 9 adds r4, 0x1 adds r0, r4 ldrb r1, [r0] adds r0, r5, 0 bl sub_8184FBC ldr r1, =0x0202421c ldrb r0, [r6] adds r1, r0, r1 lsls r0, 9 adds r0, r4 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r6] lsls r0, 9 adds r0, r4 ldrb r0, [r0] cmp r0, 0xC bls @0803C084 b @0803C6C4 @0803C084: lsls r0, 2 ldr r1, =@0803C0A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0803C0A8: .4byte @0803C0DC .4byte @0803C230 .4byte @0803C268 .4byte @0803C6C4 .4byte @0803C6C4 .4byte @0803C440 .4byte @0803C48C .4byte @0803C6C4 .4byte @0803C6C4 .4byte @0803C6C4 .4byte @0803C6C4 .4byte @0803C6C4 .4byte @0803C4B4 @0803C0DC: bl sub_80400C8 lsls r0, 24 cmp r0, 0 beq @0803C134 ldr r0, =0x02024332 ldr r3, =0x02024064 ldrb r1, [r3] adds r1, r0 movs r4, 0 movs r0, 0x6 strb r0, [r1] ldrb r1, [r3] ldr r2, =0x0202449c ldr r0, [r2] adds r1, r0 adds r1, 0x54 strb r4, [r1] ldrb r1, [r3] ldr r0, [r2] adds r1, r0 adds r1, 0x84 movs r0, 0x4 strb r0, [r1] ldrb r1, [r3] ldr r2, [r2] adds r2, r1, r2 ldr r0, =0x02023864 lsls r1, 9 adds r0, 0x3 adds r1, r0 ldrb r0, [r1] strb r0, [r2, 0xC] bl @0803CD70 .align 2, 0 .pool @0803C134: ldr r3, =0x020242bc ldr r5, =0x02024064 ldrb r4, [r5] lsls r0, r4, 3 subs r0, r4 lsls r0, 2 adds r0, r3 ldrh r2, [r0, 0x6] cmp r2, 0 beq @0803C188 ldr r1, =0x02024274 lsls r0, r4, 1 adds r0, r1 strh r2, [r0] ldrb r2, [r5] ldr r0, =0x0202449c ldr r1, [r0] adds r1, r2, r1 adds r1, 0x80 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0xC] strb r0, [r1] ldr r1, =0x02024332 ldrb r0, [r5] adds r0, r1 movs r1, 0x4 strb r1, [r0] bl @0803CD70 .align 2, 0 .pool @0803C188: add r2, sp, 0x4 ldr r3, =0x02024084 movs r1, 0x58 adds r0, r4, 0 muls r0, r1 adds r0, r3 ldrh r0, [r0] strh r0, [r2, 0x10] ldrb r0, [r5] muls r0, r1 adds r0, r3 adds r0, 0x21 ldrb r0, [r0] strb r0, [r2, 0x12] ldrb r0, [r5] muls r0, r1 adds r0, r3 adds r0, 0x22 ldrb r0, [r0] strb r0, [r2, 0x13] movs r4, 0 mov r1, sp adds r1, 0xC str r1, [sp, 0x18] add r2, sp, 0x10 mov r10, r2 mov r8, r3 adds r7, r5, 0 movs r6, 0x58 movs r0, 0xC add r0, r8 mov r9, r0 add r5, sp, 0x4 @0803C1CA: lsls r2, r4, 1 ldrb r0, [r7] muls r0, r6 adds r0, r2, r0 add r0, r9 ldrh r0, [r0] strh r0, [r5] ldr r1, [sp, 0x18] adds r3, r1, r4 ldrb r0, [r7] muls r0, r6 adds r0, r4, r0 mov r1, r8 adds r1, 0x24 adds r0, r1 ldrb r0, [r0] strb r0, [r3] ldrb r0, [r7] adds r1, r0, 0 muls r1, r6 adds r2, r1 add r2, r9 ldrh r0, [r2] add r1, r8 adds r1, 0x3B ldrb r1, [r1] lsls r2, r4, 24 lsrs r2, 24 bl 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, =0x02022fec ldr r1, [r0] movs r0, 0x1 ands r1, r0 movs r0, 0 movs r2, 0 add r3, sp, 0x4 bl sub_8033E30 b @0803C42E .align 2, 0 .pool @0803C230: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x021f0902 ands r0, r1 cmp r0, 0 bne @0803C23E b @0803C48C @0803C23E: ldr r4, =0x02024064 ldrb r0, [r4] movs r1, 0x1 bl sub_8185008 ldr r1, =0x02024220 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DB879 b @0803C784 .align 2, 0 .pool @0803C268: ldr r5, =0x02024064 ldrb r0, [r5] ldr r3, =0x0202449c ldr r1, [r3] adds r1, r0, r1 adds r1, 0x58 ldr r2, =0x0202406e lsls r0, 1 adds r0, r2 ldrh r0, [r0] strb r0, [r1] ldr r7, =0x02024084 ldrb r2, [r5] movs r6, 0x58 adds r0, r2, 0 muls r0, r6 adds r1, r7, 0 adds r1, 0x50 adds r0, r1 ldr r1, [r0] ldr r0, =0x0400e000 ands r1, r0 cmp r1, 0 bne @0803C2B8 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 bne @0803C2B8 ldr r0, =0x020242ac lsls r1, r2, 2 adds r1, r0 ldr r1, [r1] movs r0, 0x80 lsls r0, 3 ands r1, r0 cmp r1, 0 beq @0803C2EC @0803C2B8: ldr r0, =0x02024064 ldrb r0, [r0] lsls r1, r0, 1 adds r1, r0 adds r1, 0x60 ldr r0, [r3] adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x2 movs r2, 0x6 b @0803C400 .align 2, 0 .pool @0803C2EC: str r1, [sp] movs r0, 0xC adds r1, r2, 0 movs r2, 0x17 movs r3, 0 bl ability_something lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @0803C374 ldrb r1, [r5] str r4, [sp] movs r0, 0xC movs r2, 0x47 movs r3, 0 bl ability_something lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @0803C33C ldrb r0, [r5] muls r0, r6 adds r1, r0, r7 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x2 beq @0803C33C adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x2 beq @0803C33C adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x1A bne @0803C374 @0803C33C: ldr r5, =0x02024064 ldrb r1, [r5] movs r0, 0 str r0, [sp] movs r0, 0xF movs r2, 0x2A movs r3, 0 bl ability_something lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @0803C3B0 ldr r2, =0x02024084 ldrb r1, [r5] movs r0, 0x58 muls r0, r1 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x8 beq @0803C374 adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x8 bne @0803C3B0 @0803C374: subs r1, r4, 0x1 lsls r1, 4 movs r0, 0x4 orrs r1, r0 lsls r1, 24 lsrs r1, 24 ldr r0, =0x0202420a ldrb r3, [r0] ldr r4, =0x0202449c ldr r0, =0x02024064 ldrb r0, [r0] lsls r2, r0, 1 adds r2, r0 adds r2, 0x60 ldr r0, [r4] adds r0, r2 str r0, [sp] movs r0, 0 movs r2, 0x6 bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f b @0803C42E .align 2, 0 .pool @0803C3B0: ldr r0, =0x02024064 ldrb r1, [r0] adds r4, r0, 0 cmp r1, 0x2 bne @0803C3D8 ldr r0, =0x0202421c ldrb r0, [r0] cmp r0, 0x2 bne @0803C3D8 ldr r0, =0x0202449c ldr r3, [r0] adds r0, r3, 0 adds r0, 0x5C b @0803C3EE .align 2, 0 .pool @0803C3D8: ldrb r0, [r4] cmp r0, 0x3 bne @0803C410 ldr r0, =0x0202421c ldrb r0, [r0, 0x1] cmp r0, 0x2 bne @0803C410 ldr r0, =0x0202449c ldr r3, [r0] adds r0, r3, 0 adds r0, 0x5D @0803C3EE: ldrb r2, [r0] ldrb r1, [r4] lsls r0, r1, 1 adds r0, r1 adds r0, 0x60 adds r3, r0 str r3, [sp] movs r0, 0 movs r1, 0 @0803C400: movs r3, 0 bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f b @0803C42E .align 2, 0 .pool @0803C410: ldr r2, =0x0202449c ldr r0, =0x02024064 ldrb r0, [r0] lsls r1, r0, 1 adds r1, r0 adds r1, 0x60 ldr r0, [r2] adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0 movs r2, 0x6 movs r3, 0 bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f @0803C42E: ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution b @0803C6C4 .align 2, 0 .pool @0803C440: bl sub_806B8B0 lsls r0, 24 cmp r0, 0 bne @0803C44C b @0803C6C4 @0803C44C: ldr r1, =0x02024220 ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DAB11 str r1, [r0] ldr r0, =0x02024332 ldrb r1, [r3] adds r1, r0 movs r4, 0 movs r0, 0x6 strb r0, [r1] ldrb r1, [r3] ldr r2, =0x0202449c ldr r0, [r2] adds r1, r0 adds r1, 0x54 strb r4, [r1] ldrb r1, [r3] b @0803C7A0 .align 2, 0 .pool @0803C48C: ldr r2, =0x0202449c ldr r4, =0x02024064 ldrb r1, [r4] lsls r0, r1, 1 adds r0, r1 adds r0, 0x60 ldr r1, [r2] adds r1, r0 movs r0, 0 bl sub_8033E6C ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @0803C6C4 .align 2, 0 .pool @0803C4B4: ldr r4, =0x02024332 ldr r5, =0x02024064 ldrb r0, [r5] adds r0, r4 movs r1, 0x7 strb r1, [r0] ldrb r0, [r5] bl battle_get_per_side_status movs r6, 0x2 eors r0, r6 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r0, r4 movs r1, 0x1 strb r1, [r0] ldrb r0, [r5] bl sub_8185008 ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r1, =0x02024084 lsls r0, 24 lsrs r0, 24 movs r7, 0x58 muls r0, r7 adds r4, r1, 0 adds r4, 0x50 adds r0, r4 ldr r0, [r0] movs r1, 0x80 lsls r1, 5 ands r0, r1 cmp r0, 0 bne @0803C532 ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 muls r0, r7 adds r0, r4 ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @0803C550 @0803C532: movs r0, 0 bl dp01_build_cmdbuf_x32_32_32_32 ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution bl @0803CD70 .align 2, 0 .pool @0803C550: ldr r4, =0x0202421c ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r0, r4 ldrb r0, [r0] cmp r0, 0x2 bne @0803C590 ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl sub_8185008 b @0803C6AE .align 2, 0 .pool @0803C590: ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r0, r4 ldrb r0, [r0] cmp r0, 0x3 bne @0803C5B6 ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 b @0803C668 @0803C5B6: ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @0803C628 ldr r4, =0x0202433c ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 20 adds r0, r4 ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @0803C616 ldr r4, =0x020242bc ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r4 ldrh r0, [r1, 0x6] cmp r0, 0 beq @0803C628 @0803C616: ldrb r0, [r5] bl battle_get_per_side_status eors r0, r6 b @0803C668 .align 2, 0 .pool @0803C628: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @0803C690 ldr r4, =0x0202421c ldr r6, =0x02024064 ldrb r0, [r6] bl battle_get_per_side_status movs r5, 0x2 eors r0, r5 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @0803C690 ldr r1, =0x03005d80 ldr r0, =0x0203bd30 ldr r0, [r0] str r0, [r1] ldrb r0, [r6] bl battle_get_per_side_status eors r0, r5 @0803C668: lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl sub_8185008 b @0803C6AE .align 2, 0 .pool @0803C690: ldr r0, =0x02024064 ldrb r0, [r0] bl battle_get_per_side_status movs r1, 0x2 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 movs r1, 0x3 bl sub_8185008 @0803C6AE: movs r0, 0 bl dp01_build_cmdbuf_x32_32_32_32 ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution b @0803CD70 .align 2, 0 .pool @0803C6C4: ldr r1, =0x02022fec ldr r2, [r1] movs r5, 0x8 adds r0, r2, 0 ands r0, r5 adds r3, r1, 0 cmp r0, 0 beq @0803C720 ldr r0, =0x043f0100 ands r2, r0 cmp r2, 0 beq @0803C720 ldr r0, =0x02023864 ldr r4, =0x02024064 ldrb r2, [r4] lsls r1, r2, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] cmp r0, 0x3 bne @0803C720 ldr r1, =0x02024220 lsls r0, r2, 2 adds r0, r1 ldr r1, =gUnknown_082DB9BA str r1, [r0] ldr r1, =0x02024332 ldrb r0, [r4] adds r0, r1 movs r3, 0 strb r5, [r0] b @0803C792 .align 2, 0 .pool @0803C720: ldr r0, [r3] ldr r1, =0x0200000a ands r0, r1 cmp r0, 0x8 bne @0803C760 ldr r0, =0x02023864 ldr r4, =0x02024064 ldrb r1, [r4] lsls r1, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] cmp r0, 0x3 bne @0803C760 ldr r0, =gUnknown_082DAAFE bl b_call_bc_move_exec ldr r1, =0x02024332 ldrb r0, [r4] adds r0, r1 b @0803CC20 .align 2, 0 .pool @0803C760: bl sub_803BB88 lsls r0, 24 cmp r0, 0 beq @0803C7C4 ldr r0, =0x02023864 ldr r4, =0x02024064 ldrb r2, [r4] lsls r1, r2, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] cmp r0, 0x3 bne @0803C7C4 ldr r1, =0x02024220 lsls r0, r2, 2 adds r0, r1 ldr r1, =gUnknown_082DAB0B @0803C784: str r1, [r0] ldr r0, =0x02024332 ldrb r1, [r4] adds r1, r0 movs r3, 0 movs r0, 0x6 strb r0, [r1] @0803C792: ldrb r1, [r4] ldr r2, =0x0202449c ldr r0, [r2] adds r1, r0 adds r1, 0x54 strb r3, [r1] ldrb r1, [r4] @0803C7A0: ldr r0, [r2] adds r1, r0 adds r1, 0x84 movs r0, 0x1 strb r0, [r1] b @0803CD70 .align 2, 0 .pool @0803C7C4: ldr r2, =0x02024332 ldr r0, =0x02024064 ldrb r1, [r0] adds r1, r2 b @0803CB74 .align 2, 0 .pool @0803C7D8: ldr r4, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r3, =0x02024064 ldrb r5, [r3] lsls r0, r5, 2 adds r0, r1 ldr r2, [r0] lsls r0, r2, 4 movs r1, 0xF0 lsls r1, 24 orrs r0, r1 orrs r0, r2 lsls r1, r2, 8 orrs r0, r1 lsls r2, 12 orrs r0, r2 ldr r1, [r4] ands r1, r0 adds r4, r3, 0 cmp r1, 0 beq @0803C804 b @0803CD04 @0803C804: ldr r1, =0x0202421c adds r0, r5, r1 ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0x9 bls @0803C812 b @0803CD04 @0803C812: lsls r0, 2 ldr r1, =@0803C830 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0803C830: .4byte @0803C858 .4byte @0803C99C .4byte @0803C9D4 .4byte @0803CA0A .4byte @0803CA2C .4byte @0803CA40 .4byte @0803CA54 .4byte @0803CA84 .4byte @0803CA98 .4byte @0803CABC @0803C858: ldr r1, =0x02023864 ldrb r3, [r4] lsls r0, r3, 9 adds r1, 0x1 adds r0, r1 ldrb r1, [r0] cmp r1, 0x3 blt @0803C88A cmp r1, 0x9 ble @0803C878 cmp r1, 0xF beq @0803C87E b @0803C88A .align 2, 0 .pool @0803C878: adds r0, r3, r2 strb r1, [r0] b @0803CD70 @0803C87E: adds r1, r3, r2 movs r0, 0x2 strb r0, [r1] bl sub_803CDF8 b @0803CD70 @0803C88A: movs r0, 0x2 bl sub_818603C ldr r4, =0x02023864 ldr r6, =0x02024064 ldrb r3, [r6] lsls r1, r3, 9 adds r5, r4, 0x2 adds r0, r1, r5 ldrb r2, [r0] adds r7, r4, 0x3 adds r1, r7 ldrb r0, [r1] lsls r0, 8 orrs r2, r0 ldr r0, =0x0000ffff cmp r2, r0 bne @0803C8D0 ldr r0, =0x02024332 adds r0, r3, r0 movs r1, 0x1 strb r1, [r0] ldrb r0, [r6] bl sub_8185008 b @0803CD04 .align 2, 0 .pool @0803C8D0: bl sub_803FB4C lsls r0, 24 cmp r0, 0 beq @0803C91C ldrb r0, [r6] movs r1, 0x1 bl sub_8185008 ldr r0, =0x02024332 ldrb r1, [r6] adds r1, r0 movs r3, 0 movs r0, 0x6 strb r0, [r1] ldrb r1, [r6] ldr r2, =0x0202449c ldr r0, [r2] adds r1, r0 adds r1, 0x54 strb r3, [r1] ldrb r0, [r6] lsls r0, 9 adds r1, r4, 0x1 adds r0, r1 strb r3, [r0] ldrb r1, [r6] ldr r0, [r2] adds r1, r0 adds r1, 0x84 movs r0, 0x2 strb r0, [r1] b @0803CD70 .align 2, 0 .pool @0803C91C: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 bne @0803C942 ldrb r0, [r6] lsls r1, r0, 9 adds r1, r5 ldrb r1, [r1] bl sub_8184FBC ldrb r0, [r6] lsls r1, r0, 9 adds r1, r7 ldrb r1, [r1] bl sub_8184FBC @0803C942: ldrb r0, [r6] ldr r4, =0x0202449c ldr r1, [r4] adds r1, r0, r1 adds r1, 0x80 lsls r0, 9 adds r0, r5 ldrb r0, [r0] strb r0, [r1] ldr r0, =0x02024274 ldrb r2, [r6] lsls r5, r2, 1 adds r5, r0 ldr r3, =0x02024084 ldr r4, [r4] adds r0, r2, r4 adds r0, 0x80 ldrb r0, [r0] lsls r0, 1 movs r1, 0x58 muls r1, r2 adds r0, r1 adds r3, 0xC adds r0, r3 ldrh r0, [r0] strh r0, [r5] ldrb r0, [r6] adds r4, r0, r4 lsls r0, 9 adds r0, r7 ldrb r0, [r0] strb r0, [r4, 0xC] ldr r0, =0x02024332 ldrb r1, [r6] b @0803CB72 .align 2, 0 .pool @0803C99C: ldr r2, =0x02023864 ldr r5, =0x02024064 ldrb r4, [r5] lsls r1, r4, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r3, [r0] adds r2, 0x2 adds r1, r2 ldrb r0, [r1] lsls r0, 8 orrs r3, r0 cmp r3, 0 bne @0803C9BA b @0803CC1C @0803C9BA: ldr r0, =0x02024208 strh r3, [r0] ldr r0, =0x02024332 ldrb r1, [r5] b @0803CB72 .align 2, 0 .pool @0803C9D4: ldr r0, =0x02023864 ldr r4, =0x02024064 ldrb r2, [r4] lsls r1, r2, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] cmp r0, 0x6 bne @0803CA04 ldr r0, =0x02024332 adds r0, r2, r0 movs r1, 0x1 strb r1, [r0] ldrb r0, [r4] bl sub_8185008 b @0803CD04 .align 2, 0 .pool @0803CA04: bl sub_803CDF8 b @0803CB6E @0803CA0A: ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 8 orrs r0, r1 str r0, [r2] ldr r2, =0x02024332 ldr r0, =0x02024064 ldrb r1, [r0] adds r1, r2 b @0803CB74 .align 2, 0 .pool @0803CA2C: ldr r2, =0x02024332 ldr r0, =0x02024064 ldrb r1, [r0] adds r1, r2 b @0803CB74 .align 2, 0 .pool @0803CA40: ldr r2, =0x02024332 ldr r0, =0x02024064 ldrb r1, [r0] adds r1, r2 b @0803CB74 .align 2, 0 .pool @0803CA54: ldr r3, =0x02023864 ldr r0, =0x02024064 ldrb r4, [r0] lsls r1, r4, 9 adds r0, r3, 0x1 adds r0, r1, r0 ldrb r2, [r0] adds r3, 0x2 adds r1, r3 ldrb r0, [r1] lsls r0, 8 orrs r2, r0 cmp r2, 0 bne @0803CA72 b @0803CC1C @0803CA72: ldr r1, =0x02024332 adds r1, r4, r1 b @0803CB74 .align 2, 0 .pool @0803CA84: ldr r2, =0x02024332 ldr r0, =0x02024064 ldrb r1, [r0] adds r1, r2 b @0803CB74 .align 2, 0 .pool @0803CA98: ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 8 orrs r0, r1 str r0, [r2] ldr r2, =0x02024332 ldr r0, =0x02024064 ldrb r1, [r0] adds r1, r2 b @0803CB74 .align 2, 0 .pool @0803CABC: ldr r2, =0x02024332 ldr r0, =0x02024064 ldrb r1, [r0] adds r1, r2 b @0803CB74 .align 2, 0 .pool @0803CAD0: ldr r3, =0x02024068 ldr r6, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r6 ldr r2, [r0] lsls r1, r2, 4 movs r0, 0xF0 lsls r0, 24 orrs r1, r0 orrs r1, r2 lsls r0, r2, 8 orrs r1, r0 lsls r2, 12 orrs r1, r2 ldr r0, [r3] ands r0, r1 cmp r0, 0 beq @0803CAFA b @0803CD04 @0803CAFA: bl sub_803CDB8 lsls r0, 24 lsrs r0, 24 negs r1, r0 orrs r1, r0 lsrs r4, r1, 31 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x41 ands r0, r1 cmp r0, 0x1 bne @0803CB3C movs r1, 0x2 movs r0, 0x2 ands r0, r5 cmp r0, 0 bne @0803CB3C adds r0, r5, 0 eors r0, r1 bl battle_get_side_with_given_state ldr r1, =0x0202449c ldr r1, [r1] adds r1, 0x91 ldrb r1, [r1] lsls r0, 24 lsrs r0, 22 adds r0, r6 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0803CB5C @0803CB3C: movs r0, 0 movs r1, 0 adds r2, r4, 0 bl sub_8034464 b @0803CB66 .align 2, 0 .pool @0803CB5C: movs r0, 0 movs r1, 0x1 adds r2, r4, 0 bl sub_8034464 @0803CB66: ldr r4, =0x02024064 @0803CB68: ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803CB6E: ldr r0, =0x02024332 ldrb r1, [r4] @0803CB72: adds r1, r0 @0803CB74: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0803CD04 .align 2, 0 .pool @0803CB84: ldr r3, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r2, [r0] lsls r1, r2, 4 movs r0, 0xF0 lsls r0, 24 orrs r1, r0 orrs r1, r2 lsls r0, r2, 8 orrs r1, r0 lsls r2, 12 orrs r1, r2 ldr r0, [r3] ands r0, r1 cmp r0, 0 beq @0803CBAE b @0803CD04 @0803CBAE: ldr r1, =0x02024332 ldrb r0, [r1, 0x4] adds r0, 0x1 strb r0, [r1, 0x4] b @0803CD04 .align 2, 0 .pool @0803CBC8: ldr r5, =0x02024064 ldrb r2, [r5] ldr r0, =0x0202449c ldr r0, [r0] adds r1, r2, r0 adds r0, r1, 0 adds r0, 0x54 ldrb r0, [r0] cmp r0, 0 beq @0803CCB4 ldr r0, =0x02024332 adds r0, r2, r0 adds r1, 0x84 ldrb r1, [r1] strb r1, [r0] b @0803CD04 .align 2, 0 .pool @0803CBF4: ldr r3, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r4, [r0] lsls r0, r4, 2 adds r0, r1 ldr r2, [r0] lsls r1, r2, 4 movs r0, 0xF0 lsls r0, 24 orrs r1, r0 orrs r1, r2 lsls r0, r2, 8 orrs r1, r0 lsls r2, 12 orrs r1, r2 ldr r0, [r3] ands r0, r1 cmp r0, 0 bne @0803CD04 @0803CC1C: ldr r0, =0x02024332 adds r0, r4, r0 @0803CC20: movs r1, 0x1 strb r1, [r0] b @0803CD04 .align 2, 0 .pool @0803CC38: ldr r5, =0x02024064 ldrb r2, [r5] ldr r4, =0x0202449c ldr r0, [r4] adds r0, r2, r0 adds r0, 0x54 ldrb r0, [r0] cmp r0, 0 beq @0803CCB4 ldr r0, =0x02023864 lsls r1, r2, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] cmp r0, 0xD bne @0803CC94 ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 8 orrs r0, r1 str r0, [r2] ldr r1, =0x0202421c ldrb r0, [r5] adds r0, r1 movs r1, 0x3 strb r1, [r0] ldr r1, =0x02024332 ldrb r0, [r5] @0803CC72: adds r0, r1 movs r1, 0x4 strb r1, [r0] b @0803CD04 .align 2, 0 .pool @0803CC94: adds r0, r2, 0 movs r1, 0x1 bl sub_8185008 ldr r2, =0x02024332 ldrb r0, [r5] adds r2, r0, r2 ldr r1, [r4] adds r0, r1 adds r0, 0x84 ldrb r0, [r0] strb r0, [r2] b @0803CD04 .align 2, 0 .pool @0803CCB4: ldr r0, =0x0202420b strb r2, [r0] ldr r7, =0x02024214 ldr r6, =0x02024220 ldrb r0, [r5] lsls r0, 2 adds r0, r6 ldr r4, [r0] str r4, [r7] ldr r3, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r2, [r0] lsls r1, r2, 4 movs r0, 0xF0 lsls r0, 24 orrs r1, r0 orrs r1, r2 lsls r0, r2, 8 orrs r1, r0 lsls r2, 12 orrs r1, r2 ldr r0, [r3] ands r0, r1 cmp r0, 0 bne @0803CCFA ldr r0, =gUnknown_0831BD10 ldrb r1, [r4] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 @0803CCFA: ldrb r0, [r5] lsls r0, 2 adds r0, r6 ldr r1, [r7] str r1, [r0] @0803CD04: ldr r0, =0x02024064 ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] ldr r0, =0x0202406c lsls r1, 24 lsrs r1, 24 @0803CD12: adds r5, r0, 0 ldrb r0, [r5] cmp r1, r0 bcs @0803CD1E bl @0803BE9C @0803CD1E: ldr r0, =0x02024332 ldrb r0, [r0, 0x4] ldrb r1, [r5] cmp r0, r1 bne @0803CD70 movs r0, 0x1 bl sub_818603C ldr r1, =0x03005d04 ldr r0, =sub_803D2E8 str r0, [r1] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @0803CD70 movs r4, 0 ldrb r5, [r5] cmp r4, r5 bge @0803CD70 @0803CD4A: ldr r0, =0x0202421c adds r0, r4, r0 ldrb r0, [r0] cmp r0, 0x2 bne @0803CD66 lsls r0, r4, 24 lsrs r0, 24 ldr r1, =0x0202449c ldr r1, [r1] adds r1, r4, r1 adds r1, 0x5C ldrb r1, [r1] bl sub_80571DC @0803CD66: adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0803CD4A @0803CD70: add sp, 0x1C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803BE74 thumb_func_start sub_803CDB8 sub_803CDB8: ; 803CDB8 push {r4,r5,lr} movs r3, 0 movs r1, 0 ldr r0, =0x0202406c ldrb r2, [r0] adds r5, r0, 0 cmp r3, r2 bge @0803CDDA ldr r4, =0x02024332 @0803CDCA: adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0x5 bne @0803CDD4 adds r3, 0x1 @0803CDD4: adds r1, 0x1 cmp r1, r2 blt @0803CDCA @0803CDDA: adds r0, r3, 0x1 ldrb r5, [r5] cmp r0, r5 beq @0803CDF0 movs r0, 0 b @0803CDF2 .align 2, 0 .pool @0803CDF0: movs r0, 0x1 @0803CDF2: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_803CDB8 thumb_func_start sub_803CDF8 sub_803CDF8: ; 803CDF8 push {r4-r7,lr} ldr r7, =0x02024064 ldrb r0, [r7] ldr r6, =0x0202449c ldr r1, [r6] adds r1, r0, r1 adds r1, 0x5C ldr r4, =0x02023864 lsls r0, 9 adds r2, r4, 0x1 adds r0, r2 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r7] lsls r1, r0, 9 adds r1, r2 ldrb r1, [r1] bl sub_8184FBC ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x42 ands r0, r1 cmp r0, 0x42 bne @0803CEC6 ldrb r0, [r7] ldr r2, [r6] lsls r1, r0, 1 adds r1, r0 adds r1, r2 adds r1, 0x60 ldrb r2, [r1] movs r0, 0xF ands r0, r2 strb r0, [r1] ldrb r0, [r7] ldr r2, [r6] lsls r1, r0, 1 adds r1, r0 adds r1, r2 adds r1, 0x60 lsls r0, 9 adds r5, r4, 0x2 adds r0, r5 ldrb r2, [r0] movs r3, 0xF0 adds r0, r3, 0 ands r0, r2 ldrb r2, [r1] orrs r0, r2 strb r0, [r1] ldrb r1, [r7] ldr r2, [r6] lsls r0, r1, 1 adds r0, r1 adds r0, r2 adds r0, 0x61 lsls r1, 9 adds r4, 0x3 mov r12, r4 add r1, r12 ldrb r1, [r1] strb r1, [r0] ldrb r0, [r7] movs r4, 0x2 eors r0, r4 ldr r2, [r6] lsls r1, r0, 1 adds r1, r0 adds r1, r2 adds r1, 0x60 ldrb r2, [r1] adds r0, r3, 0 ands r0, r2 strb r0, [r1] ldrb r0, [r7] eors r0, r4 ldr r2, [r6] lsls r1, r0, 1 adds r1, r0 adds r1, r2 adds r1, 0x60 ldrb r0, [r7] lsls r0, 9 adds r0, r5 ldrb r0, [r0] ands r3, r0 lsrs r3, 4 ldrb r0, [r1] orrs r3, r0 strb r3, [r1] ldrb r0, [r7] eors r4, r0 ldr r0, [r6] lsls r1, r4, 1 adds r1, r4 adds r1, r0 adds r1, 0x62 ldrb r0, [r7] lsls r0, 9 add r0, r12 ldrb r0, [r0] strb r0, [r1] @0803CEC6: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803CDF8 thumb_func_start sub_803CEDC sub_803CEDC: ; 803CEDC push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 ldr r2, =0x0202407a adds r4, r0, r2 ldrb r5, [r4] adds r2, r1, r2 ldrb r3, [r2] strb r3, [r4] strb r5, [r2] ldr r2, =0x0202407e adds r0, r2 ldrb r5, [r0] adds r1, r2 ldrb r2, [r1] strb r2, [r0] strb r5, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803CEDC thumb_func_start b_first_side b_first_side: ; 803CF10 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC lsls r0, 24 lsrs r0, 24 mov r9, r0 lsls r1, 24 lsrs r1, 24 mov r10, r1 lsls r2, 24 lsrs r2, 24 str r2, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @0803CFD8 ldr r1, [sp, 0x8] str r1, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @0803CFD8 ldr r1, =0x02024084 movs r0, 0x58 mov r2, r9 muls r2, r0 adds r0, r2, 0 adds r0, r1 adds r0, 0x20 ldrb r3, [r0] cmp r3, 0x21 bne @0803CF7C ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @0803CF8C @0803CF7C: cmp r3, 0x22 bne @0803CF98 ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @0803CF98 @0803CF8C: movs r3, 0x2 b @0803CF9A .align 2, 0 .pool @0803CF98: movs r3, 0x1 @0803CF9A: movs r0, 0x58 mov r1, r10 muls r1, r0 adds r0, r1, 0 ldr r2, =0x02024084 adds r0, r2 adds r0, 0x20 ldrb r2, [r0] cmp r2, 0x21 bne @0803CFBA ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @0803CFCA @0803CFBA: cmp r2, 0x22 bne @0803CFDA ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @0803CFDA @0803CFCA: movs r7, 0x2 b @0803CFDC .align 2, 0 .pool @0803CFD8: movs r3, 0x1 @0803CFDA: movs r7, 0x1 @0803CFDC: ldr r1, =0x02024084 movs r0, 0x58 mov r2, r9 muls r2, r0 adds r0, r2, 0 adds r4, r0, r1 ldrh r0, [r4, 0x6] muls r3, r0 ldr r2, =gUnknown_08329D2E movs r1, 0x1B ldrsb r1, [r4, r1] lsls r1, 1 adds r0, r1, r2 ldrb r0, [r0] muls r0, r3 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] bl __divsi3 mov r8, r0 ldrh r0, [r4, 0x2E] cmp r0, 0xAF bne @0803D02C ldr r1, =0x02024404 mov r3, r9 lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r1 ldrb r6, [r0, 0x7] ldrb r5, [r0, 0x1A] b @0803D040 .align 2, 0 .pool @0803D02C: ldrh r0, [r4, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r6, r0, 24 ldrh r0, [r4, 0x2E] bl itemid_get_quality lsls r0, 24 lsrs r5, r0, 24 @0803D040: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x023f0102 ands r0, r1 cmp r0, 0 bne @0803D074 ldr r0, =0x00000869 bl 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, =0x02024084 movs r0, 0x58 mov r3, r9 muls r3, r0 adds r0, r3, 0 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0803D09C mov r0, r8 lsrs r0, 2 mov r8, r0 @0803D09C: cmp r6, 0x1A bne @0803D0B8 ldr r0, =0x02024330 ldrh r4, [r0] lsls r0, r5, 16 subs r0, r5 movs r1, 0x64 bl __divsi3 cmp r4, r0 bge @0803D0B8 movs r1, 0x1 negs r1, r1 mov r8, r1 @0803D0B8: ldr r1, =0x02024084 movs r0, 0x58 mov r2, r10 muls r2, r0 adds r0, r2, 0 adds r4, r0, r1 ldrh r0, [r4, 0x6] adds r3, r0, 0 muls r3, r7 ldr r2, =gUnknown_08329D2E movs r1, 0x1B ldrsb r1, [r4, r1] lsls r1, 1 adds r0, r1, r2 ldrb r0, [r0] muls r0, r3 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] bl __divsi3 adds r7, r0, 0 ldrh r0, [r4, 0x2E] cmp r0, 0xAF bne @0803D118 ldr r1, =0x02024404 mov r3, r10 lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r1 ldrb r6, [r0, 0x7] ldrb r5, [r0, 0x1A] b @0803D12C .align 2, 0 .pool @0803D118: ldrh r0, [r4, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r6, r0, 24 ldrh r0, [r4, 0x2E] bl itemid_get_quality lsls r0, 24 lsrs r5, r0, 24 @0803D12C: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x023f0102 ands r0, r1 cmp r0, 0 bne @0803D15C ldr r0, =0x00000869 bl 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, =0x02024084 movs r0, 0x58 mov r1, r10 muls r1, r0 adds r0, r1, 0 adds r1, r2, 0 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0803D17E lsrs r7, 2 @0803D17E: cmp r6, 0x1A bne @0803D198 ldr r0, =0x02024330 ldrh r4, [r0] lsls r0, r5, 16 subs r0, r5 movs r1, 0x64 bl __divsi3 cmp r4, r0 bge @0803D198 movs r7, 0x1 negs r7, r7 @0803D198: ldr r2, [sp, 0x4] cmp r2, 0 beq @0803D1B8 movs r3, 0 b @0803D254 .align 2, 0 .pool @0803D1B8: ldr r0, =0x0202421c mov r3, r9 adds r1, r3, r0 ldrb r1, [r1] adds r2, r0, 0 cmp r1, 0 bne @0803D208 ldr r0, =0x0202433c lsls r1, r3, 4 adds r1, r0 ldrb r0, [r1] lsls r0, 29 cmp r0, 0 bge @0803D1E0 movs r3, 0xA5 b @0803D20A .align 2, 0 .pool @0803D1E0: ldr r0, =0x0202449c ldr r0, [r0] add r0, r9 adds r0, 0x80 ldrb r0, [r0] lsls r0, 1 movs r1, 0x58 mov r3, r9 muls r3, r1 adds r1, r3, 0 adds r0, r1 ldr r1, =0x02024084 adds r1, 0xC adds r0, r1 ldrh r3, [r0] b @0803D20A .align 2, 0 .pool @0803D208: movs r3, 0 @0803D20A: mov r1, r10 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 bne @0803D254 ldr r0, =0x0202433c lsls r1, 4 adds r1, r0 ldrb r0, [r1] lsls r0, 29 cmp r0, 0 bge @0803D22C movs r2, 0xA5 b @0803D256 .align 2, 0 .pool @0803D22C: ldr r0, =0x0202449c ldr r0, [r0] add r0, r10 adds r0, 0x80 ldrb r0, [r0] lsls r0, 1 movs r1, 0x58 mov r2, r10 muls r2, r1 adds r1, r2, 0 adds r0, r1 ldr r1, =0x02024084 adds r1, 0xC adds r0, r1 ldrh r2, [r0] b @0803D256 .align 2, 0 .pool @0803D254: movs r2, 0 @0803D256: ldr r4, =gBattleMoves lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r4 movs r1, 0x7 ldrsb r1, [r0, r1] lsls r3, r2, 1 cmp r1, 0 bne @0803D27A adds r0, r3, r2 lsls r0, 2 adds r0, r4 ldrb r0, [r0, 0x7] lsls r0, 24 asrs r0, 24 cmp r0, 0 beq @0803D2B8 @0803D27A: adds r0, r3, r2 lsls r0, 2 adds r0, r4 ldrb r0, [r0, 0x7] lsls r0, 24 asrs r0, 24 cmp r1, r0 bne @0803D2AE cmp r8, r7 bne @0803D2A4 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @0803D2A4 movs r3, 0x2 b @0803D2D4 .align 2, 0 .pool @0803D2A4: cmp r8, r7 bcs @0803D2D6 movs r0, 0x1 str r0, [sp, 0x8] b @0803D2D6 @0803D2AE: cmp r1, r0 bge @0803D2D6 movs r1, 0x1 str r1, [sp, 0x8] b @0803D2D6 @0803D2B8: cmp r8, r7 bne @0803D2CE bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @0803D2CE movs r2, 0x2 str r2, [sp, 0x8] b @0803D2D6 @0803D2CE: cmp r8, r7 bcs @0803D2D6 movs r3, 0x1 @0803D2D4: str r3, [sp, 0x8] @0803D2D6: ldr r0, [sp, 0x8] add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end b_first_side thumb_func_start sub_803D2E8 sub_803D2E8: ; 803D2E8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r3, 0 ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0803D354 ldr r0, =0x02024064 strb r3, [r0] ldr r4, =0x0202406c mov r8, r0 ldrb r0, [r4] cmp r3, r0 bcc @0803D310 b @0803D54A @0803D310: ldr r7, =0x0202407a ldr r6, =0x0202421c mov r2, r8 ldr r5, =0x0202407e @0803D318: adds r1, r3, r7 ldrb r0, [r2] adds r0, r6 ldrb r0, [r0] strb r0, [r1] adds r1, r3, r5 ldrb r0, [r2] strb r0, [r1] adds r3, 0x1 ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] lsls r0, 24 lsrs r0, 24 ldrb r1, [r4] cmp r0, r1 bcc @0803D318 b @0803D54A .align 2, 0 .pool @0803D354: movs r2, 0x2 ands r1, r2 cmp r1, 0 beq @0803D3A4 ldr r0, =0x02024064 strb r3, [r0] ldr r1, =0x0202406c mov r8, r0 adds r2, r1, 0 ldrb r2, [r2] cmp r3, r2 bcs @0803D3C0 ldr r0, =0x0202421c ldrb r1, [r0] adds r4, r0, 0 cmp r1, 0x3 beq @0803D3BE @0803D376: mov r7, r8 ldrb r0, [r7] adds r0, 0x1 strb r0, [r7] lsls r0, 24 lsrs r0, 24 ldr r1, =0x0202406c ldrb r1, [r1] cmp r0, r1 bcs @0803D3C0 ldrb r0, [r7] adds r0, r4 ldrb r0, [r0] cmp r0, 0x3 bne @0803D376 b @0803D3BE .align 2, 0 .pool @0803D3A4: ldr r1, =0x0202421c ldrb r0, [r1] ldr r4, =0x02024064 mov r8, r4 cmp r0, 0x3 bne @0803D3B4 strb r3, [r4] movs r3, 0x5 @0803D3B4: ldrb r0, [r1, 0x2] cmp r0, 0x3 bne @0803D3C0 mov r7, r8 strb r2, [r7] @0803D3BE: movs r3, 0x5 @0803D3C0: cmp r3, 0x5 bne @0803D448 ldr r6, =0x0202407a ldr r1, =0x0202421c mov r2, r8 ldrb r0, [r2] adds r0, r1 ldrb r0, [r0] strb r0, [r6] ldr r2, =0x0202407e mov r3, r8 ldrb r0, [r3] strb r0, [r2] movs r3, 0x1 movs r5, 0 adds r4, r1, 0 ldr r7, =0x03005d04 mov r10, r7 ldr r0, =bc_80154A0 mov r12, r0 ldr r1, =0x0202449c mov r9, r1 ldr r7, =0x0202406c ldrb r7, [r7] cmp r5, r7 bge @0803D41A adds r7, r6, 0 adds r6, r4, 0 adds r4, r2, 0 ldr r2, =0x0202406c @0803D3FC: mov r0, r8 ldrb r0, [r0] cmp r5, r0 beq @0803D412 adds r1, r3, r7 adds r0, r5, r6 ldrb r0, [r0] strb r0, [r1] adds r0, r3, r4 strb r5, [r0] adds r3, 0x1 @0803D412: adds r5, 0x1 ldrb r1, [r2] cmp r5, r1 blt @0803D3FC @0803D41A: mov r2, r12 mov r3, r10 str r2, [r3] mov r4, r9 ldr r0, [r4] b @0803D554 .align 2, 0 .pool @0803D448: movs r0, 0 mov r7, r8 strb r0, [r7] ldr r1, =0x0202406c ldrb r0, [r1] cmp r0, 0 beq @0803D48E ldr r6, =0x0202421c mov r2, r8 ldr r5, =0x0202407a ldr r4, =0x0202407e @0803D45E: ldrb r0, [r2] adds r0, r6 ldrb r1, [r0] subs r0, r1, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @0803D47C adds r0, r3, r5 strb r1, [r0] adds r1, r3, r4 mov r7, r8 ldrb r0, [r7] strb r0, [r1] adds r3, 0x1 @0803D47C: ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] lsls r0, 24 lsrs r0, 24 ldr r1, =0x0202406c ldrb r1, [r1] cmp r0, r1 bcc @0803D45E @0803D48E: movs r0, 0 mov r2, r8 strb r0, [r2] ldr r4, =0x0202406c ldrb r0, [r4] cmp r0, 0 beq @0803D4D2 ldr r6, =0x0202421c ldr r5, =0x0202407a ldr r4, =0x0202407e @0803D4A2: ldrb r0, [r2] adds r0, r6 ldrb r1, [r0] subs r0, r1, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @0803D4C0 adds r0, r3, r5 strb r1, [r0] adds r1, r3, r4 mov r7, r8 ldrb r0, [r7] strb r0, [r1] adds r3, 0x1 @0803D4C0: ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] lsls r0, 24 lsrs r0, 24 ldr r1, =0x0202406c ldrb r1, [r1] cmp r0, r1 bcc @0803D4A2 @0803D4D2: movs r5, 0 b @0803D540 .align 2, 0 .pool @0803D4E8: adds r4, r5, 0x1 adds r7, r4, 0 ldrb r1, [r1] cmp r7, r1 bge @0803D53E ldr r6, =0x0202407a lsls r2, r5, 24 mov r8, r2 @0803D4F8: ldr r0, =0x0202407e adds r1, r5, r0 ldrb r3, [r1] adds r0, r4, r0 ldrb r1, [r0] adds r0, r5, r6 ldrb r2, [r0] cmp r2, 0x1 beq @0803D534 adds r0, r4, r6 ldrb r0, [r0] cmp r0, 0x1 beq @0803D534 cmp r2, 0x2 beq @0803D534 cmp r0, 0x2 beq @0803D534 adds r0, r3, 0 movs r2, 0 bl b_first_side lsls r0, 24 cmp r0, 0 beq @0803D534 lsls r1, r4, 24 lsrs r1, 24 mov r3, r8 lsrs r0, r3, 24 bl sub_803CEDC @0803D534: adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0803D4F8 @0803D53E: adds r5, r7, 0 @0803D540: ldr r1, =0x0202406c ldrb r0, [r1] subs r0, 0x1 cmp r5, r0 blt @0803D4E8 @0803D54A: ldr r1, =0x03005d04 ldr r0, =bc_80154A0 str r0, [r1] ldr r0, =0x0202449c ldr r0, [r0] @0803D554: adds r0, 0x48 movs r1, 0 strb r1, [r0] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803D2E8 thumb_func_start sub_803D580 sub_803D580: ; 803D580 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 mov r9, r0 ldr r1, =0x02024064 movs r0, 0 strb r0, [r1] ldr r0, =0x0202406c ldrb r2, [r0] adds r5, r1, 0 cmp r2, 0 beq @0803D678 ldr r7, =0x0202433c adds r6, r5, 0 ldr r0, =0x020240d4 mov r12, r0 ldr r1, =0x020242bc mov r8, r1 mov r10, r8 @0803D5AE: mov r2, r9 cmp r2, 0 beq @0803D5EC ldrb r1, [r6] lsls r1, 4 adds r1, r7 ldrb r2, [r1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1] ldrb r1, [r6] lsls r1, 4 adds r1, r7 ldrb r2, [r1] movs r0, 0x3 negs r0, r0 ands r0, r2 strb r0, [r1] b @0803D648 .align 2, 0 .pool @0803D5EC: ldrb r0, [r6] lsls r0, 4 adds r2, r0, r7 movs r1, 0 mov r4, r10 movs r3, 0 @0803D5F8: adds r0, r2, r1 strb r3, [r0] adds r1, 0x1 cmp r1, 0xF bls @0803D5F8 ldrb r1, [r5] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r1, r0, r4 ldrb r0, [r1, 0x16] cmp r0, 0 beq @0803D616 subs r0, 0x1 strb r0, [r1, 0x16] @0803D616: ldrb r1, [r5] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r1, r0, r4 ldrb r0, [r1, 0x19] cmp r0, 0 beq @0803D648 subs r0, 0x1 strb r0, [r1, 0x19] ldrb r2, [r5] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r4 ldrb r0, [r0, 0x19] cmp r0, 0 bne @0803D648 movs r0, 0x58 muls r2, r0 add r2, r12 ldr r0, [r2] ldr r1, =0xffbfffff ands r0, r1 str r0, [r2] @0803D648: ldrb r2, [r5] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 add r0, r8 ldrb r0, [r0, 0xA] cmp r0, 0 bne @0803D666 movs r0, 0x58 muls r2, r0 add r2, r12 ldr r0, [r2] ldr r1, =0xfeffffff ands r0, r1 str r0, [r2] @0803D666: ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] lsls r0, 24 lsrs r0, 24 ldr r1, =0x0202406c ldrb r1, [r1] cmp r0, r1 bcc @0803D5AE @0803D678: movs r0, 0 ldr r2, =0x02024294 strb r0, [r2, 0x8] strb r0, [r2, 0x14] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803D580 thumb_func_start sub_803D6A0 sub_803D6A0: ; 803D6A0 push {r4-r6,lr} ldr r2, =0x02024064 movs r0, 0 strb r0, [r2] ldr r0, =0x0202406c ldrb r1, [r0] adds r6, r0, 0 cmp r1, 0 beq @0803D6DE adds r3, r2, 0 movs r4, 0 ldr r5, =0x0202437c @0803D6B8: ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r2, r0, r5 movs r1, 0 @0803D6C4: adds r0, r2, r1 strb r4, [r0] adds r1, 0x1 cmp r1, 0x13 bls @0803D6C4 ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] lsls r0, 24 lsrs r0, 24 ldrb r1, [r6] cmp r0, r1 bcc @0803D6B8 @0803D6DE: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803D6A0 thumb_func_start bc_80154A0 bc_80154A0: ; 803D6F0 push {r4-r7,lr} ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 bne @0803D7AE ldr r2, =0x0202449c ldr r0, [r2] adds r0, 0x48 ldr r1, =0x0202406c ldrb r0, [r0] mov r12, r2 adds r6, r1, 0 ldrb r1, [r6] cmp r0, r1 bcs @0803D7AE ldr r5, =0x02024064 ldr r4, =0x0202420b movs r7, 0x84 lsls r7, 1 @0803D71C: ldr r1, [r2] adds r1, 0x48 ldrb r0, [r1] strb r0, [r4] strb r0, [r5] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r1, =0x02024274 ldrb r3, [r5] lsls r0, r3, 1 adds r0, r1 ldrh r0, [r0] cmp r0, r7 bne @0803D7A0 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r3 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 bne @0803D7A0 ldr r2, =0x020242bc ldrb r1, [r4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x18] lsls r0, 31 cmp r0, 0 bne @0803D7A0 ldr r0, =0x0202433c lsls r1, r3, 4 adds r1, r0 ldrb r0, [r1] lsls r0, 29 cmp r0, 0 blt @0803D7A0 ldr r0, =gUnknown_082DB1FF bl b_call_bc_move_exec b @0803D7E8 .align 2, 0 .pool @0803D7A0: mov r2, r12 ldr r0, [r2] adds r0, 0x48 ldrb r0, [r0] ldrb r1, [r6] cmp r0, r1 bcc @0803D71C @0803D7AE: bl b_clear_atk_up_if_hit_flag_unless_enraged ldr r1, =0x02024082 movs r0, 0 strb r0, [r1] ldr r1, =0x02024083 ldr r0, =0x0202407a movs r3, 0 ldrb r0, [r0] strb r0, [r1] ldr r0, =0x02024400 movs r2, 0 strh r3, [r0] ldr r0, =0x0202449c ldr r0, [r0] strb r2, [r0, 0x13] ldr r1, =0x03005d04 ldr r0, =bc_bs_exec str r0, [r1] ldr r0, =0x02024332 strb r2, [r0, 0x3] strb r2, [r0, 0x4] ldr r0, =0x02024474 strb r2, [r0, 0x16] ldr r0, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x8] adds r0, 0x20 strb r2, [r0] @0803D7E8: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_80154A0 thumb_func_start bc_bs_exec bc_bs_exec: ; 803D818 push {r4-r6,lr} ldr r6, =0x0202433a ldrb r0, [r6] ldr r2, =0x02024083 cmp r0, 0 beq @0803D828 movs r0, 0xC strb r0, [r2] @0803D828: ldr r5, =0x0202449c ldr r0, [r5] adds r0, 0x4B ldr r4, =0x02024082 ldrb r1, [r4] strb r1, [r0] ldr r1, =gUnknown_0831BC0C ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x0202406c ldrb r1, [r4] ldrb r0, [r0] cmp r1, r0 bcc @0803D894 ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xffefffff ands r0, r1 str r0, [r2] ldr r3, =0x03005d04 ldr r2, =gUnknown_0831BC44 ldrb r1, [r6] movs r0, 0x7F ands r0, r1 lsls r0, 2 adds r0, r2 ldr r0, [r0] str r0, [r3] b @0803D8AC .align 2, 0 .pool @0803D894: ldr r0, [r5] adds r0, 0x4B ldrb r0, [r0] cmp r0, r1 beq @0803D8AC ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xfffffdff ands r0, r1 ldr r1, =0xfff7ffff ands r0, r1 str r0, [r2] @0803D8AC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_bs_exec thumb_func_start sub_803D8C0 sub_803D8C0: ; 803D8C0 push {r4,lr} ldr r1, =0x02024083 movs r0, 0 strb r0, [r1] ldr r1, =0x02022fec ldr r2, [r1] ldr r0, =0x02000002 ands r0, r2 cmp r0, 0 beq @0803D920 ldr r1, =0x020375f0 ldr r4, =0x0202433a ldrb r0, [r4] strh r0, [r1] ldr r1, =0x02022f58 ldrb r0, [r4] strb r0, [r1] movs r0, 0 bl battle_get_side_with_given_state ldr r1, =0x0202420b strb r0, [r1] ldr r1, =0x02024214 ldr r0, =gUnknown_082DAA35 str r0, [r1] ldrb r1, [r4] movs r0, 0x7F ands r0, r1 strb r0, [r4] b @0803DAA4 .align 2, 0 .pool @0803D920: movs r0, 0x8 ands r0, r2 cmp r0, 0 beq @0803D95C ldr r0, =0x043f0900 ands r2, r0 cmp r2, 0 beq @0803D95C bl sub_805EA60 ldr r1, =0x02024214 ldr r0, =gUnknown_082DAA87 str r0, [r1] ldr r0, =0x02038bca ldrh r1, [r0] ldr r0, =0x000003fe cmp r1, r0 bne @0803D946 b @0803DA8A @0803D946: b @0803DA94 .align 2, 0 .pool @0803D95C: ldr r0, [r1] movs r1, 0xA ands r0, r1 cmp r0, 0x8 beq @0803D968 b @0803DA9E @0803D968: bl sub_805EA60 ldr r1, =0x02024214 ldr r0, =gUnknown_082DA92D str r0, [r1] ldr r2, =gTrainers ldr r0, =0x02038bca ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x1] subs r0, 0x3 cmp r0, 0x32 bls @0803D98A b @0803DA94 @0803D98A: lsls r0, 2 ldr r1, =@0803D9A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0803D9A8: .4byte @0803DA80 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA80 .4byte @0803DA94 .4byte @0803DA80 .4byte @0803DA94 .4byte @0803DA80 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA74 .4byte @0803DA8A .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA74 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA80 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA94 .4byte @0803DA80 @0803DA74: ldr r0, =0x00000163 bl song_play_for_text b @0803DAA4 .align 2, 0 .pool @0803DA80: movs r0, 0xD4 lsls r0, 1 bl song_play_for_text b @0803DAA4 @0803DA8A: movs r0, 0xB1 lsls r0, 1 bl song_play_for_text b @0803DAA4 @0803DA94: movs r0, 0xCE lsls r0, 1 bl song_play_for_text b @0803DAA4 @0803DA9E: ldr r1, =0x02024214 ldr r0, =gUnknown_082DA96A str r0, [r1] @0803DAA4: ldr r1, =0x03005d04 ldr r0, =sub_803DCD8 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803D8C0 thumb_func_start sub_803DAC0 sub_803DAC0: ; 803DAC0 push {r4,lr} ldr r1, =0x02024083 movs r0, 0 strb r0, [r1] ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x02000002 ands r0, r1 cmp r0, 0 beq @0803DB7C ldr r0, =0x003f0100 ands r1, r0 cmp r1, 0 beq @0803DB44 ldr r3, =0x0202433a ldrb r2, [r3] movs r0, 0x80 ands r0, r2 cmp r0, 0 beq @0803DB2C ldr r1, =0x02024214 ldr r0, =gUnknown_082DB9C8 str r0, [r1] movs r0, 0x7F ands r0, r2 strb r0, [r3] ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r0, [r1] movs r2, 0x8 orrs r0, r2 strb r0, [r1] b @0803DB82 .align 2, 0 .pool @0803DB2C: ldr r1, =0x02024214 ldr r0, =gUnknown_082DAA0B str r0, [r1] movs r0, 0x7F ands r0, r2 strb r0, [r3] b @0803DB82 .align 2, 0 .pool @0803DB44: ldr r1, =0x02022f58 ldr r4, =0x0202433a ldrb r0, [r4] strb r0, [r1] movs r0, 0 bl battle_get_side_with_given_state ldr r1, =0x0202420b strb r0, [r1] ldr r1, =0x02024214 ldr r0, =gUnknown_082DAA35 str r0, [r1] ldrb r1, [r4] movs r0, 0x7F ands r0, r1 strb r0, [r4] b @0803DB82 .align 2, 0 .pool @0803DB7C: ldr r1, =0x02024214 ldr r0, =gUnknown_082DA96D str r0, [r1] @0803DB82: ldr r1, =0x03005d04 ldr r0, =sub_803DCD8 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803DAC0 thumb_func_start sub_803DBA0 sub_803DBA0: ; 803DBA0 push {lr} ldr r1, =0x02024083 movs r0, 0 strb r0, [r1] ldr r1, =0x02022fec ldr r2, [r1] ldr r0, =0x003f0100 ands r0, r2 cmp r0, 0 beq @0803DBFC movs r0, 0x8 ands r2, r0 cmp r2, 0 beq @0803DBFC ldr r1, =0x02024214 ldr r0, =gUnknown_082DB9C1 str r0, [r1] ldr r1, =0x0202433a movs r0, 0x9 strb r0, [r1] ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r0, [r1] movs r2, 0x8 orrs r0, r2 strb r0, [r1] b @0803DC6A .align 2, 0 .pool @0803DBFC: ldr r0, [r1] movs r1, 0x80 lsls r1, 19 ands r0, r1 cmp r0, 0 beq @0803DC24 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB9C1 str r0, [r1] ldr r1, =0x0202433a movs r0, 0x9 strb r0, [r1] b @0803DC6A .align 2, 0 .pool @0803DC24: ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0, 0x1] lsls r0, 27 lsrs r0, 30 cmp r0, 0x1 beq @0803DC54 cmp r0, 0x2 beq @0803DC64 ldr r1, =0x02024214 ldr r0, =gUnknown_082DAAF0 b @0803DC68 .align 2, 0 .pool @0803DC54: ldr r1, =0x02024214 ldr r0, =gUnknown_082DAADB b @0803DC68 .align 2, 0 .pool @0803DC64: ldr r1, =0x02024214 ldr r0, =gUnknown_082DAAE9 @0803DC68: str r0, [r1] @0803DC6A: ldr r1, =0x03005d04 ldr r0, =sub_803DCD8 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803DBA0 thumb_func_start bc_80158BC bc_80158BC: ; 803DC84 ldr r1, =0x02024083 movs r0, 0 strb r0, [r1] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x7 strb r0, [r1, 0x1] ldr r2, =0x0202420b ldrb r0, [r2] strb r0, [r1, 0x2] ldr r3, =0x0202406e ldrb r0, [r2] lsls r0, 1 adds r0, r3 ldrh r0, [r0] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02024214 ldr r0, =gUnknown_082DAAF7 str r0, [r1] ldr r1, =0x03005d04 ldr r0, =sub_803DCD8 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end bc_80158BC thumb_func_start sub_803DCD8 sub_803DCD8: ; 803DCD8 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x02024083 ldrb r0, [r0] subs r0, 0xB lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @0803DCEE b @0803DE10 @0803DCEE: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x023f0b92 ands r1, r0 cmp r1, 0 bne @0803DDB6 ldr r2, =0x02024064 strb r1, [r2] ldr r0, =0x0202406c ldrb r0, [r0] cmp r1, r0 bcs @0803DDB2 adds r5, r2, 0 ldr r0, =0x0202406e mov r8, r0 movs r7, 0x64 ldr r6, =0x020244ec @0803DD10: ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0803DDA0 ldr r4, =0x03005d10 ldrh r0, [r4, 0x6] cmp r0, 0 bne @0803DD74 ldrb r0, [r5] lsls r0, 1 add r0, r8 ldrh r0, [r0] muls r0, r7 adds r0, r6 movs r1, 0xB movs r2, 0 bl pokemon_getattr strh r0, [r4, 0x6] ldrb r0, [r5] lsls r0, 1 add r0, r8 ldrh r0, [r0] muls r0, r7 adds r0, r6 movs r1, 0x2 adds r2, r4, 0 adds r2, 0x8 bl pokemon_getattr b @0803DDA0 .align 2, 0 .pool @0803DD74: ldrb r0, [r5] lsls r0, 1 add r0, r8 ldrh r0, [r0] muls r0, r7 adds r0, r6 movs r1, 0xB movs r2, 0 bl pokemon_getattr strh r0, [r4, 0x26] ldrb r0, [r5] lsls r0, 1 add r0, r8 ldrh r0, [r0] muls r0, r7 adds r0, r6 movs r1, 0x2 adds r2, r4, 0 adds r2, 0x14 bl pokemon_getattr @0803DDA0: ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @0803DD10 @0803DDB2: bl sub_80EC728 @0803DDB6: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x023f0b9a ands r0, r1 cmp r0, 0 bne @0803DDD2 ldr r0, =0x03005d10 ldrb r1, [r0, 0x5] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0803DDD2 bl sub_80EE184 @0803DDD2: bl sub_8186444 movs r0, 0x3 bl sub_80A2390 movs r0, 0x5 bl sub_80A2F50 ldr r1, =0x03005d04 ldr r0, =sub_803DE40 str r0, [r1] ldr r1, =0x030061e8 ldr r0, =sub_8038420 str r0, [r1] b @0803DE2A .align 2, 0 .pool @0803DE10: ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0803DE2A ldr r1, =gUnknown_0831BD10 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 @0803DE2A: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803DCD8 thumb_func_start sub_803DE40 sub_803DE40: ; 803DE40 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0803DE86 bl reset_all_obj_data ldr r0, =0x03005d54 ldrb r0, [r0] cmp r0, 0 beq @0803DE62 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0x1 beq @0803DE80 @0803DE62: ldr r1, =0x03005d04 ldr r0, =c4_overworld str r0, [r1] b @0803DEA2 .align 2, 0 .pool @0803DE80: ldr r1, =0x03005d04 ldr r0, =bc_evolution_cutscene str r0, [r1] @0803DE86: bl Window_FreeMemory ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 bne @0803DEA2 bl sub_805F094 bl sub_8057028 bl dp11_free @0803DEA2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803DE40 thumb_func_start bc_evolution_cutscene bc_evolution_cutscene: ; 803DEB4 push {r4-r6,lr} ldr r0, =0x03005d54 ldrb r1, [r0] adds r3, r0, 0 cmp r1, 0 beq @0803DF2E @0803DEC0: movs r6, 0 @0803DEC2: ldrb r2, [r3] ldr r0, =gUnknown_0832A328 lsls r1, r6, 2 adds r1, r0 ldr r1, [r1] adds r0, r2, 0 ands r0, r1 cmp r0, 0 beq @0803DF20 bics r2, r1 strb r2, [r3] movs r0, 0x64 adds r1, r6, 0 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 adds r0, r5, 0 movs r1, 0 bl GetEvolutionTargetSpecies lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 beq @0803DF20 bl Window_FreeMemory ldr r0, =0x03005d04 ldr r1, =sub_803DF48 str r1, [r0] lsls r3, r6, 24 lsrs r3, 24 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x1 bl evolution_cutscene b @0803DF34 .align 2, 0 .pool @0803DF20: adds r6, 0x1 ldr r3, =0x03005d54 cmp r6, 0x5 ble @0803DEC2 ldrb r0, [r3] cmp r0, 0 bne @0803DEC0 @0803DF2E: ldr r1, =0x03005d04 ldr r0, =c4_overworld str r0, [r1] @0803DF34: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_evolution_cutscene thumb_func_start sub_803DF48 sub_803DF48: ; 803DF48 push {lr} ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 bne @0803DF5A ldr r1, =0x03005d04 ldr r0, =bc_evolution_cutscene str r0, [r1] @0803DF5A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803DF48 thumb_func_start c4_overworld c4_overworld: ; 803DF70 push {r4-r6,lr} ldr r6, =0x02022fec ldr r0, [r6] movs r5, 0x2 ands r0, r5 cmp r0, 0 bne @0803DF8C ldr r4, =0x020244ec adds r0, r4, 0 bl sub_806DCB4 adds r0, r4, 0 bl atkE5_pickupitemcalculation @0803DF8C: ldr r4, [r6] adds r0, r4, 0 ands r0, r5 cmp r0, 0 beq @0803DF9E ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0803DFEC @0803DF9E: ldr r1, =0x020375f0 ldr r5, =0x0202433a ldrb r0, [r5] strh r0, [r1] ldr r3, =0x030022c0 ldr r0, =0x00000439 adds r2, r3, r0 ldrb r1, [r2] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r2] ldr r0, =0x03005d00 ldr r0, [r0] str r0, [r3] movs r0, 0x80 lsls r0, 3 ands r4, r0 cmp r4, 0 beq @0803DFDE ldr r0, =0x02024744 bl sub_8161F18 ldrb r1, [r5] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0803DFDA cmp r1, 0x7 bne @0803DFDE @0803DFDA: bl sub_8161F4C @0803DFDE: movs r0, 0x5A bl m4aSongNumStop ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 @0803DFEC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c4_overworld thumb_func_start bc_move_exec_returning bc_move_exec_returning: ; 803E018 push {lr} ldr r0, =0x02024083 ldrb r0, [r0] subs r0, 0xB lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @0803E060 ldr r3, =0x020244a8 ldr r0, [r3] ldr r0, [r0, 0xC] adds r1, r0, 0 adds r1, 0x20 ldrb r0, [r1] cmp r0, 0 beq @0803E03C subs r0, 0x1 strb r0, [r1] @0803E03C: ldr r2, =0x03005d04 ldr r0, [r3] ldr r1, [r0, 0xC] adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] lsls r0, 2 adds r1, r0 ldr r0, [r1] str r0, [r2] b @0803E07A .align 2, 0 .pool @0803E060: ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0803E07A ldr r1, =gUnknown_0831BD10 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 @0803E07A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bc_move_exec_returning thumb_func_start sub_803E08C sub_803E08C: ; 803E08C push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0803E0A8 ldr r1, =gUnknown_0831BD10 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 @0803E0A8: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803E08C thumb_func_start sub_803E0B8 sub_803E0B8: ; 803E0B8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r0, 0x4 str r0, [sp] ldr r6, =0x0202420b ldr r1, =0x0202407e ldr r0, =0x02024082 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] strb r0, [r6] ldr r1, =0x0202449c ldr r3, [r1] adds r0, r3, 0 adds r0, 0x91 ldrb r2, [r0] ldr r1, =gUnknown_0832A328 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r0, [r0] ands r2, r0 cmp r2, 0 beq @0803E110 ldr r1, =0x02024083 movs r0, 0xC b @0803E83C .align 2, 0 .pool @0803E110: ldr r1, =0x02024211 movs r0, 0x1 strb r0, [r1] ldr r1, =0x02024474 movs r0, 0x1 strb r0, [r1, 0xE] ldr r5, =0x000001a3 adds r0, r3, r5 strb r2, [r0] ldr r0, =0x0202427c strb r2, [r0] ldr r0, =0x02024212 strb r2, [r0] ldr r0, =0x02024332 strb r2, [r0, 0x6] ldr r2, =0x020241e8 ldr r0, =0x020241e9 mov r9, r0 ldrb r0, [r6] ldr r3, =0x0202449c ldr r1, [r3] adds r0, r1 adds r0, 0x80 ldrb r0, [r0] mov r5, r9 strb r0, [r5] strb r0, [r2] ldr r1, =0x0202433c ldrb r4, [r6] lsls r0, r4, 4 adds r3, r0, r1 ldrb r1, [r3] lsls r0, r1, 29 mov r8, r2 cmp r0, 0 bge @0803E1BC movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r3] ldr r2, =0x020241ea ldr r1, =0x020241ec movs r0, 0xA5 strh r0, [r1] strh r0, [r2] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 4 orrs r0, r1 str r0, [r2] movs r0, 0xA5 movs r1, 0 bl sub_80458E0 ldrb r1, [r6] ldr r3, =0x0202449c ldr r2, [r3] b @0803E316 .align 2, 0 .pool @0803E1BC: ldr r5, =0x02024084 mov r10, r5 movs r0, 0x58 adds r5, r4, 0 muls r5, r0 mov r0, r10 adds r0, 0x50 adds r0, r5, r0 ldr r1, [r0] movs r0, 0x80 lsls r0, 5 ands r0, r1 cmp r0, 0 bne @0803E1E2 movs r7, 0x80 lsls r7, 15 ands r7, r1 cmp r7, 0 beq @0803E204 @0803E1E2: ldr r3, =0x020241ea ldr r2, =0x020241ec ldr r1, =0x02024268 lsls r0, r4, 1 adds r0, r1 ldrh r0, [r0] strh r0, [r2] strh r0, [r3] b @0803E33C .align 2, 0 .pool @0803E204: ldr r1, =0x020242bc mov r12, r1 lsls r0, r4, 3 subs r0, r4 lsls r0, 2 add r0, r12 ldrh r3, [r0, 0x6] adds r1, r3, 0 cmp r1, 0 beq @0803E2DC ldrb r2, [r0, 0xC] lsls r0, r2, 1 adds r0, r5 mov r4, r10 adds r4, 0xC adds r0, r4 ldrh r0, [r0] cmp r1, r0 bne @0803E268 ldr r2, =0x020241ea ldr r0, =0x020241ec strh r3, [r0] strh r3, [r2] ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 ldrb r0, [r0, 0xC] mov r3, r9 strb r0, [r3] mov r5, r8 strb r0, [r5] ldrh r0, [r2] movs r1, 0 bl sub_80458E0 ldrb r1, [r6] ldr r3, =0x0202449c ldr r2, [r3] b @0803E316 .align 2, 0 .pool @0803E268: cmp r1, 0 beq @0803E2DC cmp r1, r0 beq @0803E2DC mov r5, r9 strb r2, [r5] mov r0, r8 strb r2, [r0] ldr r3, =0x020241ea ldr r2, =0x020241ec ldrb r0, [r0] lsls r0, 1 ldrb r1, [r6] movs r5, 0x58 muls r1, r5 adds r0, r1 adds r0, r4 ldrh r0, [r0] strh r0, [r2] strh r0, [r3] ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 movs r2, 0 strh r7, [r0, 0x6] ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 strb r2, [r0, 0xC] ldrb r0, [r6] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 add r1, r12 ldrb r2, [r1, 0xE] movs r0, 0x10 negs r0, r0 ands r0, r2 strb r0, [r1, 0xE] ldrh r0, [r3] movs r1, 0 bl sub_80458E0 ldrb r1, [r6] ldr r3, =0x0202449c ldr r2, [r3] b @0803E316 .align 2, 0 .pool @0803E2DC: ldr r3, =0x02024084 mov r5, r8 ldrb r0, [r5] lsls r0, 1 ldr r4, =0x0202420b ldrb r2, [r4] movs r1, 0x58 muls r1, r2 adds r0, r1 adds r3, 0xC adds r0, r3 ldr r1, =0x02024274 lsls r2, 1 adds r2, r1 ldrh r3, [r0] ldrh r2, [r2] cmp r3, r2 beq @0803E334 ldr r1, =0x020241ea ldr r0, =0x020241ec strh r3, [r0] strh r3, [r1] ldrh r0, [r1] movs r1, 0 bl sub_80458E0 ldrb r1, [r4] ldr r2, =0x0202449c ldr r2, [r2] @0803E316: adds r1, r2 strb r0, [r1, 0xC] b @0803E33C .align 2, 0 .pool @0803E334: ldr r1, =0x020241ea ldr r0, =0x020241ec strh r3, [r0] strh r3, [r1] @0803E33C: ldr r2, =0x02024084 ldr r1, =0x0202420b ldrb r3, [r1] movs r0, 0x58 muls r0, r3 adds r0, r2 ldrh r0, [r0, 0x28] mov r8, r1 cmp r0, 0 beq @0803E384 adds r0, r3, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0803E37C ldr r0, =0x03005d10 ldr r1, =0x020241ea ldrh r1, [r1] strh r1, [r0, 0x22] b @0803E384 .align 2, 0 .pool @0803E37C: ldr r0, =0x03005d10 ldr r1, =0x020241ea ldrh r1, [r1] strh r1, [r0, 0x24] @0803E384: mov r1, r8 ldrb r0, [r1] bl battle_side_get_owner movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r6, r0, 24 ldr r1, =0x02024294 lsls r0, r6, 1 adds r0, r6 lsls r0, 2 adds r5, r0, r1 ldrb r0, [r5, 0x8] cmp r0, 0 beq @0803E400 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x6] cmp r0, 0 bne @0803E400 mov r3, r8 ldrb r0, [r3] bl battle_side_get_owner adds r4, r0, 0 ldrb r0, [r5, 0x9] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 beq @0803E400 ldr r1, =0x02024084 ldrb r2, [r5, 0x9] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 beq @0803E400 ldr r0, =0x0202420c strb r2, [r0] b @0803E76A .align 2, 0 .pool @0803E400: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 ldr r5, =0x0202420b mov r8, r5 cmp r0, 0 bne @0803E412 b @0803E6E0 @0803E412: ldr r1, =0x02024294 lsls r0, r6, 1 adds r0, r6 lsls r0, 2 adds r0, r1 ldrb r5, [r0, 0x8] cmp r5, 0 beq @0803E424 b @0803E630 @0803E424: ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r4, r0, r2 ldrb r0, [r4, 0x1] cmp r0, 0 bne @0803E440 ldrb r0, [r4, 0x6] cmp r0, 0x10 bne @0803E440 b @0803E630 @0803E440: ldr r3, =0x02024084 ldr r2, =0x0202420b ldrb r6, [r2] ldr r0, =0x0202449c ldr r0, [r0] adds r0, r6, r0 ldrb r1, [r0, 0xC] movs r0, 0x58 muls r0, r1 adds r0, r3 adds r0, 0x20 ldrb r0, [r0] mov r8, r2 cmp r0, 0x1F bne @0803E460 b @0803E630 @0803E460: ldrb r0, [r4, 0x2] cmp r0, 0xD beq @0803E468 b @0803E630 @0803E468: adds r0, r6, 0 bl battle_side_get_owner lsls r0, 24 lsrs r6, r0, 24 ldr r1, =0x02024064 strb r5, [r1] ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 bcs @0803E4E0 adds r4, r1, 0 @0803E480: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r6, r0 beq @0803E4CE ldr r0, =0x0202420b ldrb r1, [r0] ldr r0, =0x0202449c ldr r0, [r0] adds r1, r0 ldrb r0, [r1, 0xC] ldrb r1, [r4] cmp r0, r1 beq @0803E4CE ldr r1, =0x02024084 ldrb r2, [r4] movs r0, 0x58 muls r0, r2 adds r0, r1 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x1F bne @0803E4CE adds r0, r2, 0 bl sub_8048728 lsls r0, 24 lsrs r0, 24 ldr r3, [sp] cmp r0, r3 bcs @0803E4CE ldrb r0, [r4] bl sub_8048728 lsls r0, 24 lsrs r0, 24 str r0, [sp] @0803E4CE: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @0803E480 @0803E4E0: ldr r5, [sp] cmp r5, 0x4 beq @0803E4E8 b @0803E5E2 @0803E4E8: ldr r2, =gBattleMoves ldr r0, =0x020241ec ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x6] ands r5, r0 cmp r5, 0 beq @0803E568 ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0803E548 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @0803E544 movs r0, 0x1 b @0803E55A .align 2, 0 .pool @0803E544: movs r0, 0x3 b @0803E55A @0803E548: bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @0803E558 movs r0, 0 b @0803E55A @0803E558: movs r0, 0x2 @0803E55A: bl battle_get_side_with_given_state ldr r1, =0x0202420c strb r0, [r1] b @0803E578 .align 2, 0 .pool @0803E568: ldr r2, =0x0202420c ldr r0, =0x0202420b ldrb r0, [r0] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 ldrb r0, [r0, 0xC] strb r0, [r2] @0803E578: ldr r7, =0x02024210 ldrb r0, [r7] ldr r1, =gUnknown_0832A328 mov r8, r1 ldr r5, =0x0202420c ldrb r1, [r5] lsls r1, 2 add r1, r8 ldr r1, [r1] ands r0, r1 cmp r0, 0 bne @0803E592 b @0803E76A @0803E592: ldr r6, =0x0202420b ldrb r0, [r6] bl battle_side_get_owner adds r4, r0, 0 ldrb r0, [r5] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 beq @0803E5C4 ldrb r0, [r5] b @0803E758 .align 2, 0 .pool @0803E5C4: ldrb r0, [r6] bl battle_get_per_side_status movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state strb r0, [r5] ldrb r1, [r7] ldrb r2, [r5] lsls r0, r2, 2 add r0, r8 b @0803E74E @0803E5E2: ldr r4, =0x02024064 ldr r0, =0x0202407e ldr r3, [sp] adds r0, r3, r0 ldrb r0, [r0] strb r0, [r4] ldrb r0, [r4] ldr r2, =0x02024084 movs r1, 0x58 muls r1, r0 adds r1, r2 adds r1, 0x20 ldrb r1, [r1] bl b_history__record_ability_usage_of_player ldr r2, =0x0202437c ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x2 orrs r1, r2 strb r1, [r0] ldr r1, =0x0202420c ldrb r0, [r4] strb r0, [r1] b @0803E76A .align 2, 0 .pool @0803E630: ldr r0, =0x02022fec ldr r0, [r0] movs r4, 0x1 ands r0, r4 cmp r0, 0 beq @0803E6E0 ldr r2, =gBattleMoves ldr r0, =0x020241ec ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x6] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0803E6E0 mov r5, r8 ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0803E684 bl GenerateRandomNumber adds r1, r4, 0 ands r1, r0 cmp r1, 0 beq @0803E680 movs r0, 0x1 b @0803E696 .align 2, 0 .pool @0803E680: movs r0, 0x3 b @0803E696 @0803E684: bl GenerateRandomNumber adds r1, r4, 0 ands r1, r0 cmp r1, 0 beq @0803E694 movs r0, 0 b @0803E696 @0803E694: movs r0, 0x2 @0803E696: bl battle_get_side_with_given_state ldr r1, =0x0202420c strb r0, [r1] ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldr r5, =0x0202420c ldrb r0, [r5] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0803E76A ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner adds r4, r0, 0 ldrb r0, [r5] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 beq @0803E76A ldrb r0, [r5] b @0803E758 .align 2, 0 .pool @0803E6E0: ldr r5, =0x0202420c mov r2, r8 ldrb r0, [r2] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 ldrb r0, [r0, 0xC] strb r0, [r5] ldr r6, =0x02024210 ldrb r1, [r6] ldr r7, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r7 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0803E76A ldrb r0, [r2] bl battle_side_get_owner adds r4, r0, 0 ldrb r0, [r5] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 beq @0803E730 ldrb r0, [r5] b @0803E758 .align 2, 0 .pool @0803E730: mov r1, r8 ldrb r0, [r1] bl battle_get_per_side_status movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state strb r0, [r5] ldrb r1, [r6] ldrb r2, [r5] lsls r0, r2, 2 adds r0, r7 @0803E74E: ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0803E76A adds r0, r2, 0 @0803E758: bl battle_get_per_side_status movs r1, 0x2 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state strb r0, [r5] @0803E76A: ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0x80 lsls r2, 10 ands r1, r2 adds r5, r0, 0 cmp r1, 0 beq @0803E808 ldr r0, =0x0202433c ldr r4, =0x0202420b ldrb r2, [r4] lsls r1, r2, 4 adds r1, r0 ldrb r0, [r1, 0x2] lsls r0, 27 cmp r0, 0 bge @0803E808 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 bne @0803E7B4 ldr r1, =0x02024083 movs r0, 0xC b @0803E83C .align 2, 0 .pool @0803E7B4: ldr r3, =0x02024230 lsls r0, r2, 2 adds r0, r3 ldr r0, [r0] cmp r0, 0 beq @0803E7EC ldr r1, =0x02024332 movs r2, 0 movs r0, 0x4 strb r0, [r1, 0x5] ldr r1, =0x02024214 ldrb r0, [r4] lsls r0, 2 adds r0, r3 ldr r0, [r0] str r0, [r1] ldrb r0, [r4] lsls r0, 2 adds r0, r3 str r2, [r0] b @0803E824 .align 2, 0 .pool @0803E7EC: ldr r1, =0x02024332 movs r0, 0x4 strb r0, [r1, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB6AD str r0, [r1] b @0803E824 .align 2, 0 .pool @0803E808: ldr r4, =0x02024214 ldr r3, =gUnknown_082D86A8 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] str r0, [r4] @0803E824: ldr r0, [r5] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @0803E838 ldr r0, =0x0202420b ldrb r0, [r0] bl sub_81A56E8 @0803E838: ldr r1, =0x02024083 movs r0, 0xA @0803E83C: strb r0, [r1] add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803E0B8 thumb_func_start bs2_8016374 bs2_8016374: ; 803E868 push {r4,lr} ldr r3, =0x0202420b ldr r1, =0x0202407e ldr r0, =0x02024082 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] strb r0, [r3] ldr r0, =0x02022e14 movs r2, 0 strh r2, [r0] ldr r0, =0x02022e16 strh r2, [r0] ldr r1, =0x020244ac ldrb r0, [r3] adds r0, r1 strb r2, [r0] ldr r1, =0x020244b0 ldrb r0, [r3] adds r0, r1 strb r2, [r0] ldr r2, =0x02022f58 movs r0, 0xFD strb r0, [r2] movs r0, 0x7 strb r0, [r2, 0x1] ldrb r4, [r3] strb r4, [r2, 0x2] ldrb r0, [r3] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 adds r0, 0x58 ldrb r0, [r0] strb r0, [r2, 0x3] movs r0, 0xFF strb r0, [r2, 0x4] ldr r0, =0x02024474 strb r4, [r0, 0x17] ldr r1, =0x02024214 ldr r0, =gUnknown_082DAB15 str r0, [r1] ldr r1, =0x02024083 movs r0, 0xA strb r0, [r1] ldr r1, =0x03005d10 ldrb r0, [r1, 0x2] cmp r0, 0xFE bhi @0803E8CE adds r0, 0x1 strb r0, [r1, 0x2] @0803E8CE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bs2_8016374 thumb_func_start sub_803E90C sub_803E90C: ; 803E90C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r4, =0x0202420b ldr r2, =0x0202420c ldr r1, =0x0202407e ldr r0, =0x02024082 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] strb r0, [r2] strb r0, [r4] ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldrb r0, [r4] bl sub_8045868 ldr r5, =0x02024208 ldr r2, =0x02023864 ldrb r1, [r4] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r3, [r0] adds r2, 0x2 adds r1, r2 ldrb r0, [r1] lsls r0, 8 orrs r3, r0 strh r3, [r5] cmp r3, 0xC bhi @0803E998 ldr r2, =0x02024214 ldr r1, =gUnknown_082DBD08 ldrh r0, [r5] lsls r0, 2 adds r0, r1 ldr r0, [r0] str r0, [r2] ldr r0, =0x02024083 mov r10, r0 b @0803EBF6 .align 2, 0 .pool @0803E998: adds r0, r3, 0 subs r0, 0x50 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @0803E9C0 ldr r0, =0x02024214 ldr r1, =gUnknown_082DBD54 ldr r1, [r1] str r1, [r0] ldr r1, =0x02024083 mov r10, r1 b @0803EBF6 .align 2, 0 .pool @0803E9C0: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0803E9E8 ldr r0, =0x02024214 ldr r1, =gUnknown_082DBD3C ldr r1, [r1] str r1, [r0] ldr r2, =0x02024083 mov r10, r2 b @0803EBF6 .align 2, 0 .pool @0803E9E8: ldr r3, =0x02024474 ldrb r0, [r4] strb r0, [r3, 0x17] lsls r0, 24 lsrs r0, 25 ldr r2, =0x0202449c ldr r1, [r2] adds r0, r1 adds r0, 0xC4 ldrb r0, [r0] subs r0, 0x1 mov r8, r4 ldr r1, =0x02024214 mov r9, r1 ldr r6, =gUnknown_082DBD3C mov r12, r3 adds r7, r2, 0 ldr r2, =0x02024083 mov r10, r2 cmp r0, 0x4 bls @0803EA14 b @0803EBDE @0803EA14: lsls r0, 2 ldr r1, =@0803EA38 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0803EA38: .4byte @0803EBDE .4byte @0803EBDE .4byte @0803EA4C .4byte @0803EAE0 .4byte @0803EBB0 @0803EA4C: ldr r5, =0x02024332 movs r0, 0 strb r0, [r5, 0x5] ldr r2, =0x0202420b ldrb r0, [r2] lsrs r0, 1 ldr r1, [r7] adds r0, r1 adds r0, 0xC6 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 mov r8, r2 cmp r0, 0 beq @0803EA98 movs r0, 0x3E ands r0, r1 ldr r1, =0x02024214 mov r9, r1 ldr r6, =gUnknown_082DBD3C ldr r2, =0x02024083 mov r10, r2 cmp r0, 0 bne @0803EA7E b @0803EBDE @0803EA7E: movs r0, 0x5 strb r0, [r5, 0x5] b @0803EBDE .align 2, 0 .pool @0803EA98: ldr r0, =0x02024214 mov r9, r0 ldr r6, =gUnknown_082DBD3C ldr r1, =0x02024083 mov r10, r1 mov r4, r8 adds r3, r7, 0 adds r2, r5, 0 @0803EAA8: ldrb r1, [r4] lsrs r1, 1 ldr r0, [r3] adds r1, r0 adds r1, 0xC6 ldrb r0, [r1] lsrs r0, 1 strb r0, [r1] ldrb r0, [r2, 0x5] adds r0, 0x1 strb r0, [r2, 0x5] ldrb r0, [r4] lsrs r0, 1 ldr r1, [r3] adds r0, r1 adds r0, 0xC6 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0803EAA8 b @0803EBDE .align 2, 0 .pool @0803EAE0: ldr r3, =0x02024332 movs r0, 0x4 strb r0, [r3, 0x5] ldr r2, =0x0202420b ldrb r0, [r2] lsrs r0, 1 ldr r1, [r7] adds r0, r1 adds r6, r0, 0 adds r6, 0xC6 ldrb r1, [r6] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 mov r8, r2 cmp r5, 0 beq @0803EB28 movs r0, 0x5 strb r0, [r3, 0x5] ldr r2, =0x02024214 mov r9, r2 ldr r6, =gUnknown_082DBD3C ldr r0, =0x02024083 mov r10, r0 b @0803EBDE .align 2, 0 .pool @0803EB28: ldr r3, =0x02022f58 movs r4, 0xFD strb r4, [r3] movs r0, 0x5 strb r0, [r3, 0x1] movs r2, 0x1 strb r2, [r3, 0x2] movs r0, 0xFF strb r0, [r3, 0x3] ldr r1, =0x02022f68 strb r4, [r1] strb r5, [r1, 0x1] movs r0, 0xD2 strb r0, [r1, 0x2] strb r5, [r1, 0x3] subs r0, 0xD3 strb r0, [r1, 0x4] ldrb r0, [r6] ands r2, r0 ldr r1, =0x02024214 mov r9, r1 ldr r6, =gUnknown_082DBD3C ldr r0, =0x02024083 mov r10, r0 cmp r2, 0 bne @0803EB8C mov r5, r8 adds r4, r7, 0 adds r2, r3, 0 @0803EB62: ldrb r1, [r5] lsrs r1, 1 ldr r0, [r4] adds r1, r0 adds r1, 0xC6 ldrb r0, [r1] lsrs r0, 1 strb r0, [r1] ldrb r0, [r2, 0x2] adds r0, 0x1 strb r0, [r2, 0x2] ldrb r0, [r5] lsrs r0, 1 ldr r1, [r4] adds r0, r1 adds r0, 0xC6 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0803EB62 @0803EB8C: ldrb r0, [r3, 0x2] adds r0, 0xE movs r1, 0 mov r2, r12 strb r0, [r2, 0x10] strb r1, [r2, 0x11] b @0803EBDE .align 2, 0 .pool @0803EBB0: ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x1 ands r1, r0 cmp r1, 0 beq @0803EBCC ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] b @0803EBD0 .align 2, 0 .pool @0803EBCC: ldr r0, =0x02024332 strb r1, [r0, 0x5] @0803EBD0: ldr r0, =0x0202420b mov r8, r0 ldr r1, =0x02024214 mov r9, r1 ldr r6, =gUnknown_082DBD3C ldr r2, =0x02024083 mov r10, r2 @0803EBDE: mov r1, r8 ldrb r0, [r1] lsrs r0, 1 ldr r1, [r7] adds r0, r1 adds r0, 0xC4 ldrb r0, [r0] lsls r0, 2 adds r0, r6 ldr r0, [r0] mov r2, r9 str r0, [r2] @0803EBF6: movs r0, 0xA mov r1, r10 strb r0, [r1] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803E90C thumb_func_start sub_803EC20 sub_803EC20: ; 803EC20 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r5, r0, 24 movs r7, 0 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r5 adds r1, r0, r1 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @0803EC54 ldr r1, =0x02024404 lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x7] b @0803EC5E .align 2, 0 .pool @0803EC54: ldrh r0, [r1, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r1, r0, 24 @0803EC5E: ldr r0, =0x0202420f strb r5, [r0] cmp r1, 0x25 bne @0803EC9C ldr r2, =0x02024208 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r5 adds r0, r1 ldrh r0, [r0, 0x2E] strh r0, [r2] ldr r0, =0x0202433c lsls r2, r5, 4 adds r2, r0 ldrb r1, [r2, 0x1] movs r0, 0x19 negs r0, r0 ands r0, r1 movs r1, 0x8 orrs r0, r1 strb r0, [r2, 0x1] b @0803ED70 .align 2, 0 .pool @0803EC9C: ldr r0, =0x02024084 mov r10, r0 movs r2, 0x58 mov r9, r2 mov r0, r9 muls r0, r5 add r0, r10 mov r8, r0 adds r0, 0x20 ldrb r6, [r0] cmp r6, 0x32 bne @0803ED5C bl sub_81A9E40 lsls r0, 24 cmp r0, 0 beq @0803ED38 ldr r4, =0x0202449c ldr r1, [r4] adds r1, 0x6C ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] bl sub_81A9E28 lsls r0, 24 lsrs r1, r0, 24 mov r2, r8 ldrh r0, [r2, 0x6] muls r0, r1 movs r2, 0x1 adds r1, r5, 0 eors r1, r2 mov r2, r9 muls r2, r1 adds r1, r2, 0 add r1, r10 ldrh r1, [r1, 0x6] bl __divsi3 ldr r1, [r4] adds r1, 0x6C ldrb r2, [r1] lsls r1, r2, 4 subs r1, r2 lsls r1, 1 adds r0, r1 lsls r0, 24 lsrs r4, r0, 24 bl GenerateRandomNumber movs r1, 0xFF ands r1, r0 cmp r4, r1 bhi @0803ED0C b @0803EE12 @0803ED0C: ldr r0, =0x0202420a strb r6, [r0] ldr r0, =0x0202433c lsls r2, r5, 4 adds r2, r0 ldrb r1, [r2, 0x1] movs r0, 0x19 negs r0, r0 ands r0, r1 movs r1, 0x10 orrs r0, r1 strb r0, [r2, 0x1] b @0803ED70 .align 2, 0 .pool @0803ED38: ldr r0, =0x0202420a strb r6, [r0] ldr r0, =0x0202433c lsls r2, r5, 4 adds r2, r0 ldrb r1, [r2, 0x1] movs r0, 0x19 negs r0, r0 ands r0, r1 movs r1, 0x10 orrs r0, r1 strb r0, [r2, 0x1] b @0803ED70 .align 2, 0 .pool @0803ED5C: ldr r1, =0x02022fec ldr r2, [r1] ldr r0, =0x043f0100 ands r0, r2 cmp r0, 0 beq @0803ED80 movs r0, 0x8 ands r2, r0 cmp r2, 0 beq @0803ED80 @0803ED70: adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 b @0803EE12 .align 2, 0 .pool @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, =0x02024084 movs r3, 0x58 adds r0, r5, 0 muls r0, r3 adds r0, r4 ldrh r0, [r0, 0x6] muls r0, r1 movs r2, 0x1 adds r1, r5, 0 eors r1, r2 muls r1, r3 adds r1, r4 b @0803EDDA .align 2, 0 .pool @0803EDBC: ldr r3, =0x02024084 movs r2, 0x58 adds r0, r5, 0 muls r0, r2 adds r4, r0, r3 movs r1, 0x1 adds r0, r5, 0 eors r0, r1 muls r0, r2 adds r1, r0, r3 ldrh r0, [r4, 0x6] ldrh r2, [r1, 0x6] cmp r0, r2 bcs @0803EE00 lsls r0, 7 @0803EDDA: ldrh r1, [r1, 0x6] bl __divsi3 ldr r1, =0x0202449c ldr r1, [r1] adds r1, 0x6C ldrb r2, [r1] lsls r1, r2, 4 subs r1, r2 lsls r1, 1 adds r0, r1 lsls r0, 24 lsrs r4, r0, 24 bl GenerateRandomNumber movs r1, 0xFF ands r1, r0 cmp r4, r1 bls @0803EE06 @0803EE00: adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 @0803EE06: ldr r0, =0x0202449c ldr r1, [r0] adds r1, 0x6C ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0803EE12: cmp r7, 0 beq @0803EE24 ldr r1, =0x02024082 ldr r0, =0x0202406c ldrb r0, [r0] strb r0, [r1] ldr r1, =0x0202433a movs r0, 0x4 strb r0, [r1] @0803EE24: adds r0, r7, 0 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_803EC20 thumb_func_start sub_803EE48 sub_803EE48: ; 803EE48 push {r4-r6,lr} ldr r4, =0x0202420b ldr r1, =0x0202407e ldr r5, =0x02024082 ldrb r0, [r5] adds r0, r1 ldrb r0, [r0] strb r0, [r4] ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 beq @0803EF0C ldr r0, =0x0202406c ldrb r1, [r0] strb r1, [r5] ldr r2, =0x02024064 movs r0, 0 strb r0, [r2] lsls r1, 24 cmp r1, 0 beq @0803EEE0 adds r4, r2, 0 ldr r6, =0x0202421c ldr r5, =0x0202433a @0803EE7C: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0803EEBC ldrb r0, [r4] adds r0, r6 ldrb r0, [r0] cmp r0, 0x3 bne @0803EECE ldrb r0, [r5] movs r1, 0x2 b @0803EECA .align 2, 0 .pool @0803EEBC: ldrb r0, [r4] adds r0, r6 ldrb r0, [r0] cmp r0, 0x3 bne @0803EECE ldrb r0, [r5] movs r1, 0x1 @0803EECA: orrs r0, r1 strb r0, [r5] @0803EECE: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @0803EE7C @0803EEE0: ldr r2, =0x0202433a ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r0, [r1] movs r2, 0x8 orrs r0, r2 b @0803EF96 .align 2, 0 .pool @0803EF0C: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0803EF4C ldrb r0, [r4] bl sub_803EC20 lsls r0, 24 cmp r0, 0 bne @0803EF98 ldrb r0, [r4] bl sub_8045868 ldr r1, =0x02024332 movs r0, 0x3 strb r0, [r1, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DAB02 str r0, [r1] ldr r1, =0x02024083 movs r0, 0xA b @0803EF96 .align 2, 0 .pool @0803EF4C: ldr r1, =0x02024084 ldrb r2, [r4] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] ldr r1, =0x0400e000 ands r0, r1 cmp r0, 0 beq @0803EF8C ldr r1, =0x02024332 movs r0, 0x4 strb r0, [r1, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DAB02 str r0, [r1] ldr r1, =0x02024083 movs r0, 0xA b @0803EF96 .align 2, 0 .pool @0803EF8C: ldr r0, =0x0202406c ldrb r0, [r0] strb r0, [r5] ldr r1, =0x0202433a movs r0, 0x6 @0803EF96: strb r0, [r1] @0803EF98: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803EE48 thumb_func_start sub_803EFA8 sub_803EFA8: ; 803EFA8 ldr r2, =0x0202420b ldr r1, =0x0202407e ldr r0, =0x02024082 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r1, =0x02024214 ldr r0, =gUnknown_082DBD58 ldr r0, [r0] str r0, [r1] ldr r1, =0x02024083 movs r0, 0xA strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_803EFA8 thumb_func_start bs5_8016AC0 bs5_8016AC0: ; 803EFF0 ldr r2, =0x0202420b ldr r1, =0x0202407e ldr r0, =0x02024082 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r1, =0x0203a04c ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] ldr r1, =0x02024208 movs r0, 0x5 strh r0, [r1] ldr r1, =0x02024214 ldr r0, =gUnknown_082DBD08 ldr r0, [r0, 0x14] str r0, [r1] ldr r1, =0x02024083 movs r0, 0xA strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end bs5_8016AC0 thumb_func_start sub_803F050 sub_803F050: ; 803F050 push {r4-r6,lr} ldr r3, =0x0202420b ldr r1, =0x0202407e ldr r0, =0x02024082 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] strb r0, [r3] ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r6, =0x02024332 ldr r2, =0x02023864 ldrb r0, [r3] lsls r0, 9 adds r1, r2, 0x1 adds r0, r1 ldrb r0, [r0] subs r0, 0x1 strb r0, [r6, 0x5] ldr r1, =0x02024208 ldrb r0, [r3] lsls r0, 9 adds r2, 0x2 adds r0, r2 ldrb r0, [r0] strh r0, [r1] ldr r1, =0x03005d10 ldrb r0, [r1, 0x1F] cmp r0, 0xFE bhi @0803F096 adds r0, 0x1 strb r0, [r1, 0x1F] @0803F096: ldr r2, =0x0202449c ldr r0, [r2] adds r1, r0, 0 adds r1, 0x7A ldrb r0, [r1] cmp r0, 0x2 bhi @0803F0A8 adds r0, 0x1 strb r0, [r1] @0803F0A8: ldr r0, [r2] adds r3, r0, 0 adds r3, 0x7B ldrb r5, [r3] adds r4, r5, 0 cmp r4, 0x1 bls @0803F100 ldr r2, =gUnknown_0831BCE0 adds r0, 0x7A ldrb r1, [r0] lsls r0, r1, 1 adds r0, r1 ldrb r6, [r6, 0x5] adds r0, r6 adds r0, r2 ldrb r0, [r0] cmp r4, r0 bcs @0803F0FC movs r0, 0x1 b @0803F0FE .align 2, 0 .pool @0803F0FC: subs r0, r5, r0 @0803F0FE: strb r0, [r3] @0803F100: ldr r1, =0x02024214 ldr r0, =gUnknown_082DBD58 ldr r0, [r0, 0x8] str r0, [r1] ldr r1, =0x02024083 movs r0, 0xA strb r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803F050 thumb_func_start sub_803F120 sub_803F120: ; 803F120 push {r4,lr} ldr r2, =0x0202420b ldr r1, =0x0202407e ldr r0, =0x02024082 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r0, =0x02022e14 movs r4, 0 strh r4, [r0] ldr r0, =0x02022e16 strh r4, [r0] ldr r3, =0x0202449c ldr r0, [r3] adds r2, r0, 0 adds r2, 0x7C ldr r1, =gUnknown_0831BCEF adds r0, 0x79 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] ldrb r1, [r2] adds r0, r1 strb r0, [r2] ldr r0, [r3] adds r1, r0, 0 adds r1, 0x7C ldrb r0, [r1] cmp r0, 0x14 bls @0803F162 movs r0, 0x14 strb r0, [r1] @0803F162: ldr r0, [r3] adds r2, r0, 0 adds r2, 0x7B ldr r1, =gUnknown_0831BCF3 adds r0, 0x79 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] ldrb r1, [r2] adds r0, r1 strb r0, [r2] ldr r0, [r3] adds r1, r0, 0 adds r1, 0x7B ldrb r0, [r1] cmp r0, 0x14 bls @0803F188 movs r0, 0x14 strb r0, [r1] @0803F188: ldr r0, [r3] adds r1, r0, 0 adds r1, 0x79 ldrb r0, [r1] cmp r0, 0x2 bhi @0803F1C4 adds r0, 0x1 strb r0, [r1] ldr r0, =0x02024332 strb r4, [r0, 0x5] b @0803F1CA .align 2, 0 .pool @0803F1C4: ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] @0803F1CA: ldr r1, =0x02024214 ldr r0, =gUnknown_082DBD58 ldr r0, [r0, 0x4] str r0, [r1] ldr r1, =0x02024083 movs r0, 0xA strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803F120 thumb_func_start bs8_exit_by_flight bs8_exit_by_flight: ; 803F1F0 push {r4,lr} ldr r2, =0x0202420b ldr r1, =0x0202407e ldr r4, =0x02024082 ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] strb r0, [r2] movs r0, 0x11 bl audio_play ldr r0, =0x0202406c ldrb r0, [r0] strb r0, [r4] ldr r1, =0x0202433a movs r0, 0x4 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bs8_exit_by_flight thumb_func_start bs9_8016C9C bs9_8016C9C: ; 803F22C ldr r3, =0x0202420b ldr r1, =0x0202407e ldr r0, =0x02024082 ldrb r0, [r0] adds r0, r1 ldrb r2, [r0] strb r2, [r3] ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x7 strb r0, [r1, 0x1] strb r2, [r1, 0x2] ldr r2, =0x0202406e ldrb r0, [r3] lsls r0, 1 adds r0, r2 ldrh r0, [r0] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02024214 ldr r0, =gUnknown_082DBD58 ldr r0, [r0, 0xC] str r0, [r1] ldr r1, =0x02024083 movs r0, 0xA strb r0, [r1] ldr r1, =0x0202407a movs r0, 0xC strb r0, [r1, 0x1] bx lr .align 2, 0 .pool thumb_func_end bs9_8016C9C thumb_func_start bsB_exit_by_move bsB_exit_by_move: ; 803F2A4 push {lr} bl sub_8041728 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @0803F2C0 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x4D strb r1, [r0] ldr r1, =0x02024083 movs r0, 0xC strb r0, [r1] @0803F2C0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bsB_exit_by_move thumb_func_start bsD_proceed bsD_proceed: ; 803F2CC ldr r1, =0x02024082 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r3, =0x02024083 ldr r2, =0x0202407a ldrb r0, [r1] adds r0, r2 ldrb r0, [r0] strb r0, [r3] ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xf1e892af ands r0, r1 str r0, [r2] bx lr .align 2, 0 .pool thumb_func_end bsD_proceed thumb_func_start bsC_8016D70 bsC_8016D70: ; 803F300 push {r4-r6,lr} ldr r1, =0x0202407e ldr r2, =0x02024082 ldrb r0, [r2] adds r0, r1 ldrb r0, [r0] ldr r6, =0x0202449c ldr r1, [r6] adds r0, r1 adds r0, 0x5C movs r1, 0x6 strb r1, [r0] ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] ldr r3, =0x02024083 ldr r1, =0x0202407a ldrb r0, [r2] adds r0, r1 ldrb r0, [r0] strb r0, [r3] bl sub_803D6A0 ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xf1e892af ands r0, r1 str r0, [r2] ldr r0, =0x020241ea movs r1, 0 strh r1, [r0] ldr r0, =0x020241f0 movs r4, 0 str r4, [r0] ldr r0, =0x0202427c strb r1, [r0] ldr r5, =0x02024474 strb r1, [r5, 0x18] strb r1, [r5, 0x19] ldr r2, =0x02024250 ldr r3, =0x0202420b ldrb r0, [r3] lsls r0, 1 adds r0, r2 strh r4, [r0] ldr r2, =0x02024258 ldrb r0, [r3] lsls r0, 1 adds r0, r2 strh r4, [r0] ldr r0, [r6] strb r1, [r0, 0x13] ldr r0, =0x02024400 strh r4, [r0] strb r1, [r5, 0x14] ldr r0, =0x02024332 strb r1, [r0, 0x3] strb r1, [r0, 0x4] strb r1, [r5, 0x16] ldr r0, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x8] adds r0, 0x20 strb r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bsC_8016D70 thumb_func_start get_battle_side_of_something get_battle_side_of_something: ; 803F3CC push {lr} lsls r0, 24 lsrs r1, r0, 24 movs r0, 0 cmp r1, 0xE bhi @0803F47A lsls r0, r1, 2 ldr r1, =@0803F3E8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0803F3E8: .4byte @0803F424 .4byte @0803F430 .4byte @0803F43C .4byte @0803F458 .4byte @0803F464 .4byte @0803F458 .4byte @0803F464 .4byte @0803F448 .4byte @0803F464 .4byte @0803F464 .4byte @0803F44C .4byte @0803F464 .4byte @0803F468 .4byte @0803F46C .4byte @0803F470 @0803F424: ldr r0, =0x0202420c ldrb r0, [r0] b @0803F47A .align 2, 0 .pool @0803F430: ldr r0, =0x0202420b ldrb r0, [r0] b @0803F47A .align 2, 0 .pool @0803F43C: ldr r0, =0x0202420e ldrb r0, [r0] b @0803F47A .align 2, 0 .pool @0803F448: movs r0, 0 b @0803F47A @0803F44C: ldr r0, =0x02024474 ldrb r0, [r0, 0x17] b @0803F47A .align 2, 0 .pool @0803F458: ldr r0, =0x0202420d ldrb r0, [r0] b @0803F47A .align 2, 0 .pool @0803F464: movs r0, 0 b @0803F472 @0803F468: movs r0, 0x1 b @0803F472 @0803F46C: movs r0, 0x2 b @0803F472 @0803F470: movs r0, 0x3 @0803F472: bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 @0803F47A: pop {r1} bx r1 thumb_func_end get_battle_side_of_something thumb_func_start sub_803F480 sub_803F480: ; 803F480 push {r4-r7,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r5, r1, 24 lsls r2, 16 lsrs r2, 16 ldr r1, =0x02024084 movs r4, 0x58 muls r0, r4 adds r0, r1 adds r0, 0x20 ldrb r0, [r0] mov r12, r1 cmp r0, 0x2E bne @0803F532 movs r3, 0 adds r0, r5, 0 muls r0, r4 adds r1, 0xC adds r1, r0, r1 b @0803F4BC .align 2, 0 .pool @0803F4B4: adds r1, 0x2 adds r3, 0x1 cmp r3, 0x3 bgt @0803F4C2 @0803F4BC: ldrh r0, [r1] cmp r0, r2 bne @0803F4B4 @0803F4C2: cmp r3, 0x4 beq @0803F532 movs r7, 0x58 adds r2, r5, 0 muls r2, r7 adds r0, r3, r2 mov r6, r12 adds r6, 0x24 adds r1, r0, r6 ldrb r0, [r1] cmp r0, 0 beq @0803F4DE subs r0, 0x1 strb r0, [r1] @0803F4DE: mov r0, r12 adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @0803F532 ldr r1, =0x020242bc lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0803F532 ldr r4, =0x02024064 strb r5, [r4] adds r1, r3, 0 adds r1, 0x9 lsls r1, 24 lsrs r1, 24 ldrb r0, [r4] muls r0, r7 adds r0, r6 adds r0, r3 str r0, [sp] movs r0, 0 movs r2, 0 movs r3, 0x1 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803F532: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803F480 thumb_func_start sub_803F548 sub_803F548: ; 803F548 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 24 lsrs r5, r0, 24 movs r0, 0x4 mov r8, r0 adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 mov r9, r0 movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 bge @0803F5F0 ldr r1, =0x02024084 movs r0, 0x58 adds r7, r5, 0 muls r7, r0 adds r1, 0xC mov r10, r1 @0803F57E: lsls r0, r4, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 adds r6, r4, 0x1 cmp r9, r0 beq @0803F5E6 ldr r0, =0x02024084 movs r3, 0x58 adds r1, r4, 0 muls r1, r3 adds r1, r0 adds r1, 0x20 ldrb r1, [r1] adds r4, r0, 0 cmp r1, 0x2E bne @0803F5E6 movs r2, 0 adds r0, r5, 0 muls r0, r3 adds r1, r4, 0 adds r1, 0xC adds r0, r1 ldrh r0, [r0] movs r1, 0x8F lsls r1, 1 cmp r0, r1 beq @0803F5CE adds r3, r1, 0 mov r0, r10 adds r1, r7, r0 @0803F5C0: adds r1, 0x2 adds r2, 0x1 cmp r2, 0x3 bgt @0803F5CE ldrh r0, [r1] cmp r0, r3 bne @0803F5C0 @0803F5CE: cmp r2, 0x4 beq @0803F5E6 mov r8, r2 adds r1, r2, r7 adds r0, r4, 0 adds r0, 0x24 adds r1, r0 ldrb r0, [r1] cmp r0, 0 beq @0803F5E6 subs r0, 0x1 strb r0, [r1] @0803F5E6: adds r4, r6, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0803F57E @0803F5F0: mov r1, r8 cmp r1, 0x4 beq @0803F658 ldr r6, =0x02024084 movs r3, 0x58 adds r0, r5, 0 muls r0, r3 adds r1, r6, 0 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @0803F658 ldr r1, =0x020242bc lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 mov r4, r8 lsls r0, r4, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0803F658 ldr r4, =0x02024064 strb r5, [r4] mov r1, r8 adds r1, 0x9 lsls r1, 24 lsrs r1, 24 ldrb r0, [r4] muls r0, r3 adds r2, r6, 0 adds r2, 0x24 adds r0, r2 add r0, r8 str r0, [sp] movs r0, 0 movs r2, 0 movs r3, 0x1 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803F658: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803F548 thumb_func_start sub_803F67C sub_803F67C: ; 803F67C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 24 lsrs r3, r0, 24 movs r6, 0x4 movs r1, 0 ldr r0, =0x0202406c mov r8, r0 ldrb r0, [r0] cmp r1, r0 bge @0803F6FE ldr r7, =0x02024084 movs r2, 0x58 mov r12, r2 mov r5, r12 muls r5, r3 adds r0, r7, 0 adds r0, 0xC adds r2, r5, r0 mov r10, r2 mov r9, r5 @0803F6AE: mov r0, r12 muls r0, r1 adds r0, r7 adds r0, 0x20 ldrb r0, [r0] adds r4, r1, 0x1 cmp r0, 0x2E bne @0803F6F4 cmp r1, r3 beq @0803F6F4 movs r2, 0 mov r1, r10 ldrh r0, [r1] cmp r0, 0xC3 beq @0803F6DE ldr r1, =0x02024090 add r1, r9 @0803F6D0: adds r1, 0x2 adds r2, 0x1 cmp r2, 0x3 bgt @0803F6DE ldrh r0, [r1] cmp r0, 0xC3 bne @0803F6D0 @0803F6DE: cmp r2, 0x4 beq @0803F6F4 adds r6, r2, 0 adds r0, r6, r5 ldr r2, =0x020240a8 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0 beq @0803F6F4 subs r0, 0x1 strb r0, [r1] @0803F6F4: adds r1, r4, 0 mov r0, r8 ldrb r0, [r0] cmp r1, r0 blt @0803F6AE @0803F6FE: cmp r6, 0x4 beq @0803F762 ldr r7, =0x02024084 movs r5, 0x58 adds r0, r3, 0 muls r0, r5 adds r1, r7, 0 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @0803F762 ldr r1, =0x020242bc lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 lsls r0, r6, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0803F762 ldr r4, =0x02024064 strb r3, [r4] adds r1, r6, 0 adds r1, 0x9 lsls r1, 24 lsrs r1, 24 ldrb r0, [r4] muls r0, r5 adds r2, r7, 0 adds r2, 0x24 adds r0, r2 adds r0, r6 str r0, [sp] movs r0, 0 movs r2, 0 movs r3, 0x1 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0803F762: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803F67C thumb_func_start sub_803F790 sub_803F790: ; 803F790 push {r4,r5,lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @0803F7D0 movs r2, 0 ldr r4, =0x0202406c ldrb r0, [r4] cmp r2, r0 bge @0803F7EE ldr r3, =0x02024068 ldr r5, =gUnknown_0832A328 @0803F7AC: ldm r5!, {r1} lsls r1, 28 ldr r0, [r3] orrs r0, r1 str r0, [r3] adds r2, 0x1 ldrb r0, [r4] cmp r2, r0 blt @0803F7AC b @0803F7EE .align 2, 0 .pool @0803F7D0: movs r2, 0 ldr r4, =0x0202406c ldrb r0, [r4] cmp r2, r0 bge @0803F7EE ldr r3, =0x02024068 ldr r5, =gUnknown_0832A328 @0803F7DE: ldr r0, [r3] ldm r5!, {r1} orrs r0, r1 str r0, [r3] adds r2, 0x1 ldrb r0, [r4] cmp r2, r0 blt @0803F7DE @0803F7EE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803F790 thumb_func_start dp01_battle_side_mark_buffer_for_execution dp01_battle_side_mark_buffer_for_execution: ; 803F800 push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @0803F834 ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 lsls r0, r3, 2 adds r0, r1 ldr r1, [r0] lsls r1, 28 ldr r0, [r2] orrs r0, r1 str r0, [r2] b @0803F844 .align 2, 0 .pool @0803F834: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] orrs r1, r0 str r1, [r2] @0803F844: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_battle_side_mark_buffer_for_execution thumb_func_start sub_803F850 sub_803F850: ; 803F850 push {r4-r7,lr} lsls r0, 24 lsrs r7, r0, 24 movs r4, 0 ldr r5, =0x02024068 ldr r1, =gUnknown_0832A328 lsls r0, r7, 2 adds r6, r0, r1 b @0803F87A .align 2, 0 .pool @0803F86C: lsls r0, r4, 2 ldr r1, [r6] lsls r1, r0 ldr r0, [r5] orrs r0, r1 str r0, [r5] adds r4, 0x1 @0803F87A: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r4, r0 blt @0803F86C ldr r2, =0x02024068 movs r1, 0x80 lsls r1, 21 lsls r1, r7 ldr r0, [r2] bics r0, r1 str r0, [r2] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803F850 thumb_func_start b_cancel_multi_turn_move_maybe b_cancel_multi_turn_move_maybe: ; 803F8A0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02024084 movs r2, 0x58 adds r3, r0, 0 muls r3, r2 adds r1, 0x50 adds r3, r1 ldr r1, [r3] ldr r2, =0xffffefff ands r1, r2 ldr r2, =0xfffff3ff ands r1, r2 movs r2, 0x71 negs r2, r2 ands r1, r2 ldr r2, =0xfffffcff ands r1, r2 str r1, [r3] ldr r1, =0x020242ac lsls r2, r0, 2 adds r2, r1 ldr r1, [r2] ldr r3, =0xfffbff3f ands r1, r3 str r1, [r2] ldr r2, =0x020242bc lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 ldrb r2, [r1, 0x11] movs r0, 0x10 negs r0, r0 ands r0, r2 strb r0, [r1, 0x11] movs r0, 0 strb r0, [r1, 0x10] bx lr .align 2, 0 .pool thumb_func_end b_cancel_multi_turn_move_maybe thumb_func_start sub_803F90C sub_803F90C: ; 803F90C push {lr} lsls r0, 24 ldr r1, =0x0202433c lsrs r0, 20 adds r1, r0, r1 ldrb r0, [r1] lsrs r0, 7 cmp r0, 0 bne @0803F952 ldrb r2, [r1, 0x1] lsls r0, r2, 30 cmp r0, 0 blt @0803F952 lsls r0, r2, 26 cmp r0, 0 blt @0803F952 lsls r0, r2, 25 cmp r0, 0 blt @0803F952 lsrs r0, r2, 7 cmp r0, 0 bne @0803F952 ldrb r1, [r1, 0x2] lsls r0, r1, 31 cmp r0, 0 bne @0803F952 lsls r0, r1, 30 cmp r0, 0 blt @0803F952 lsls r0, r1, 29 cmp r0, 0 blt @0803F952 lsls r0, r2, 31 cmp r0, 0 beq @0803F95C @0803F952: movs r0, 0x1 b @0803F95E .align 2, 0 .pool @0803F95C: movs r0, 0 @0803F95E: pop {r1} bx r1 thumb_func_end sub_803F90C thumb_func_start b_std_message b_std_message: ; 803F964 push {r4,lr} adds r2, r0, 0 lsls r2, 16 lsrs r2, 16 ldr r4, =0x02024064 strb r1, [r4] movs r0, 0 adds r1, r2, 0 bl dp01_build_cmdbuf_x10_TODO ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end b_std_message thumb_func_start sub_803F988 sub_803F988: ; 803F988 push {r4-r6,lr} movs r3, 0 ldr r0, =0x020243fe strb r3, [r0] strb r3, [r0, 0x1] movs r1, 0 ldr r0, =0x0202406c ldrb r2, [r0] adds r6, r0, 0 cmp r1, r2 bge @0803F9B6 ldr r5, =gUnknown_0832A328 adds r4, r2, 0 ldr r2, =0x0202406e @0803F9A4: ldrh r0, [r2] lsls r0, 2 adds r0, r5 ldr r0, [r0] orrs r3, r0 adds r2, 0x4 adds r1, 0x2 cmp r1, r4 blt @0803F9A4 @0803F9B6: movs r1, 0x1 adds r2, r6, 0 ldrb r0, [r2] cmp r1, r0 bge @0803F9D6 ldr r5, =0x020243fe movs r4, 0x2 @0803F9C4: adds r0, r1, 0 ands r0, r4 asrs r0, 1 adds r0, r5 strb r3, [r0] adds r1, 0x2 ldrb r0, [r2] cmp r1, r0 blt @0803F9C4 @0803F9D6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803F988 thumb_func_start sub_803F9EC sub_803F9EC: ; 803F9EC push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0803FA50 movs r0, 0x2 ands r0, r5 lsls r0, 24 lsrs r0, 25 mov r12, r0 ldr r1, =0x020243fe adds r0, r1 strb r4, [r0] adds r5, r4, 0 ldr r0, =0x0202406c ldrb r2, [r0] mov r8, r1 cmp r4, r2 bge @0803FA4A ldr r0, =0x02024210 ldrb r7, [r0] ldr r1, =gUnknown_0832A328 adds r6, r2, 0 ldr r3, =0x0202406e adds r2, r1, 0 @0803FA2E: ldr r0, [r2] ands r0, r7 cmp r0, 0 bne @0803FA40 ldrh r0, [r3] lsls r0, 2 adds r0, r1 ldr r0, [r0] orrs r4, r0 @0803FA40: adds r3, 0x4 adds r2, 0x8 adds r5, 0x2 cmp r5, r6 blt @0803FA2E @0803FA4A: mov r0, r12 add r0, r8 strb r4, [r0] @0803FA50: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803F9EC thumb_func_start sub_803FA70 sub_803FA70: ; 803FA70 push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0803FA8C adds r0, r4, 0 bl sub_803F9EC b @0803FAC2 @0803FA8C: movs r3, 0x1 ldr r5, =0x0202406c ldrb r0, [r5] cmp r3, r0 bge @0803FAC2 ldr r0, =0x020243fe mov r12, r0 movs r7, 0x2 ldr r6, =gUnknown_0832A328 ldr r1, =0x0202406e lsls r0, r4, 1 adds r4, r0, r1 @0803FAA4: adds r2, r3, 0 ands r2, r7 asrs r2, 1 add r2, r12 ldrh r0, [r4] lsls r0, 2 adds r0, r6 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] adds r3, 0x1 ldrb r0, [r5] cmp r3, r0 blt @0803FAA4 @0803FAC2: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_803FA70 thumb_func_start b_movescr_stack_push b_movescr_stack_push: ; 803FAD8 push {r4,lr} ldr r1, =0x020244a8 ldr r1, [r1] ldr r3, [r1, 0x8] adds r4, r3, 0 adds r4, 0x20 ldrb r1, [r4] adds r2, r1, 0x1 strb r2, [r4] lsls r1, 24 lsrs r1, 22 adds r3, r1 str r0, [r3] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end b_movescr_stack_push thumb_func_start b_movescr_stack_push_cursor b_movescr_stack_push_cursor: ; 803FAFC ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0x8] adds r3, r2, 0 adds r3, 0x20 ldrb r0, [r3] adds r1, r0, 0x1 strb r1, [r3] lsls r0, 24 lsrs r0, 22 adds r2, r0 ldr r0, =0x02024214 ldr r0, [r0] str r0, [r2] bx lr .align 2, 0 .pool thumb_func_end b_movescr_stack_push_cursor thumb_func_start b_movescr_stack_pop_cursor b_movescr_stack_pop_cursor: ; 803FB24 ldr r3, =0x02024214 ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x8] adds r2, r1, 0 adds r2, 0x20 ldrb r0, [r2] subs r0, 0x1 strb r0, [r2] lsls r0, 24 lsrs r0, 22 adds r1, r0 ldr r0, [r1] str r0, [r3] bx lr .align 2, 0 .pool thumb_func_end b_movescr_stack_pop_cursor thumb_func_start sub_803FB4C sub_803FB4C: ; 803FB4C push {r4-r7,lr} mov r7, r8 push {r7} movs r6, 0 ldr r2, =0x02024084 ldr r1, =0x02023864 ldr r3, =0x02024064 ldrb r4, [r3] lsls r0, r4, 9 adds r1, 0x2 adds r0, r1 ldrb r0, [r0] lsls r0, 1 movs r1, 0x58 muls r1, r4 adds r0, r1 adds r2, 0xC adds r0, r2 ldrh r5, [r0] ldr r1, =0x0202449c lsls r0, r4, 1 adds r0, 0xC8 ldr r1, [r1] adds r1, r0 mov r8, r1 ldr r1, =0x020242bc lsls r0, r4, 3 subs r0, r4 lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x4] adds r7, r3, 0 adds r3, r1, 0 cmp r0, r5 bne @0803FC06 cmp r5, 0 beq @0803FC06 ldr r0, =0x02024474 strb r4, [r0, 0x17] ldr r0, =0x020241ea strh r5, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @0803FBF8 ldr r1, =0x02024230 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DAE2A str r1, [r0] ldr r0, =0x0202433c ldrb r1, [r7] lsls r1, 4 adds r1, r0 ldrb r0, [r1, 0x2] movs r2, 0x10 orrs r0, r2 strb r0, [r1, 0x2] b @0803FC06 .align 2, 0 .pool @0803FBF8: ldr r0, =0x02024220 ldrb r1, [r7] lsls r1, 2 adds r1, r0 ldr r0, =gUnknown_082DAE1F str r0, [r1] movs r6, 0x1 @0803FC06: ldr r1, =0x02024248 ldrb r2, [r7] lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r5, r0 bne @0803FC90 cmp r5, 0xA5 beq @0803FC90 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] cmp r0, 0 bge @0803FC90 adds r0, r2, 0 bl b_cancel_multi_turn_move_maybe ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @0803FC7C ldr r1, =0x02024230 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DB098 str r1, [r0] ldr r0, =0x0202433c ldrb r1, [r7] lsls r1, 4 adds r1, r0 ldrb r0, [r1, 0x2] movs r2, 0x10 orrs r0, r2 strb r0, [r1, 0x2] b @0803FC8E .align 2, 0 .pool @0803FC7C: ldr r1, =0x02024220 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DB089 str r1, [r0] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0803FC8E: ldr r3, =0x020242bc @0803FC90: ldrb r0, [r7] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r3 ldrb r0, [r1, 0x13] lsls r0, 28 cmp r0, 0 beq @0803FD1A ldr r0, =gBattleMoves lsls r1, r5, 1 adds r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] cmp r0, 0 bne @0803FD1A ldr r0, =0x020241ea strh r5, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @0803FD08 ldr r1, =0x02024230 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DB0AF str r1, [r0] ldr r0, =0x0202433c ldrb r1, [r7] lsls r1, 4 adds r1, r0 ldrb r0, [r1, 0x2] movs r2, 0x10 orrs r0, r2 strb r0, [r1, 0x2] b @0803FD1A .align 2, 0 .pool @0803FD08: ldr r1, =0x02024220 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DB0A0 str r1, [r0] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0803FD1A: ldr r4, =0x02024064 ldrb r0, [r4] adds r1, r5, 0 bl sub_8040130 lsls r0, 24 cmp r0, 0 beq @0803FD8E ldr r0, =0x020241ea strh r5, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @0803FD7C ldr r1, =0x02024230 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DB185 str r1, [r0] ldr r0, =0x0202433c ldrb r1, [r4] lsls r1, 4 adds r1, r0 ldrb r0, [r1, 0x2] movs r2, 0x10 orrs r0, r2 strb r0, [r1, 0x2] b @0803FD8E .align 2, 0 .pool @0803FD7C: ldr r1, =0x02024220 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DB181 str r1, [r0] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0803FD8E: ldr r1, =0x02024084 ldr r0, =0x02024064 ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, r0, r1 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @0803FDC4 ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r4, [r0, 0x7] b @0803FDCE .align 2, 0 .pool @0803FDC4: ldrh r0, [r1, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r4, r0, 24 @0803FDCE: ldr r2, =0x0202420f ldr r1, =0x02024064 ldrb r0, [r1] strb r0, [r2] ldr r0, =0x02024084 mov r12, r0 adds r7, r1, 0 cmp r4, 0x1D bne @0803FE58 mov r0, r8 ldrh r1, [r0] adds r2, r1, 0 cmp r2, 0 beq @0803FE58 ldr r0, =0x0000ffff cmp r2, r0 beq @0803FE58 cmp r2, r5 beq @0803FE58 ldr r0, =0x020241ea strh r1, [r0] ldr r2, =0x02024208 ldrb r1, [r7] movs r0, 0x58 muls r0, r1 add r0, r12 ldrh r0, [r0, 0x2E] strh r0, [r2] ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 10 ands r1, r0 ldrb r2, [r7] cmp r1, 0 beq @0803FE48 ldr r0, =0x0202433c lsls r1, r2, 4 adds r1, r0 ldrb r0, [r1, 0x2] movs r2, 0x10 orrs r0, r2 strb r0, [r1, 0x2] b @0803FE58 .align 2, 0 .pool @0803FE48: ldr r1, =0x02024220 lsls r0, r2, 2 adds r0, r1 ldr r1, =gUnknown_082DB812 str r1, [r0] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0803FE58: ldr r0, =0x02023864 ldrb r3, [r7] lsls r1, r3, 9 adds r0, 0x2 adds r1, r0 movs r0, 0x58 muls r0, r3 ldrb r1, [r1] adds r0, r1 mov r1, r12 adds r1, 0x24 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @0803FEB8 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @0803FEA8 ldr r0, =0x0202433c lsls r1, r3, 4 adds r1, r0 ldrb r0, [r1, 0x2] movs r2, 0x10 orrs r0, r2 strb r0, [r1, 0x2] b @0803FEB8 .align 2, 0 .pool @0803FEA8: ldr r1, =0x02024220 lsls r0, r3, 2 adds r0, r1 ldr r1, =gUnknown_082DB076 str r1, [r0] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0803FEB8: adds r0, r6, 0 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_803FB4C thumb_func_start sub_803FECC sub_803FECC: ; 803FECC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x1C lsls r0, 24 lsrs r7, r0, 24 lsls r1, 24 lsrs r4, r1, 24 lsls r2, 24 lsrs r3, r2, 24 ldr r1, =0x0202449c lsls r0, r7, 1 adds r0, 0xC8 ldr r1, [r1] adds r1, r0 str r1, [sp, 0x4] ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r1, r0, r1 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @0803FF1C ldr r2, =0x02024404 lsls r1, r7, 3 subs r0, r1, r7 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x7] str r0, [sp] b @0803FF2E .align 2, 0 .pool @0803FF1C: ldrh r0, [r1, 0x2E] str r3, [sp, 0x14] bl itemid_get_x12 lsls r0, 24 lsrs r0, 24 str r0, [sp] lsls r1, r7, 3 ldr r3, [sp, 0x14] @0803FF2E: ldr r0, =0x0202420f strb r7, [r0] movs r0, 0 mov r9, r0 lsls r2, r7, 1 str r2, [sp, 0xC] ldr r5, =0x020242bc mov r12, r5 ldr r0, =0x02024084 movs r2, 0x58 adds r6, r7, 0 muls r6, r2 str r6, [sp, 0x8] ldr r2, =0x02024090 adds r5, r6, r2 movs r6, 0 str r6, [sp, 0x10] mov r10, r0 subs r0, r1, r7 lsls r0, 2 mov r8, r0 ldr r6, =gUnknown_0832A328 @0803FF5A: ldrh r0, [r5] cmp r0, 0 bne @0803FF70 movs r0, 0x1 ands r0, r3 cmp r0, 0 beq @0803FF70 ldr r0, [r6] orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0803FF70: ldr r0, [sp, 0x8] add r0, r9 mov r1, r10 adds r1, 0x24 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @0803FF90 movs r0, 0x2 ands r0, r3 cmp r0, 0 beq @0803FF90 ldr r0, [r6] orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0803FF90: mov r1, r8 add r1, r12 ldrh r0, [r5] ldrh r1, [r1, 0x4] cmp r0, r1 bne @0803FFAC movs r0, 0x4 ands r0, r3 cmp r0, 0 beq @0803FFAC ldr r0, [r6] orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0803FFAC: movs r0, 0x58 adds r2, r7, 0 muls r2, r0 ldr r1, [sp, 0x10] adds r0, r1, r2 ldr r1, =0x02024090 adds r0, r1 mov r12, r0 ldr r1, =0x02024248 ldr r0, [sp, 0xC] adds r1, r0, r1 str r1, [sp, 0x18] mov r1, r12 ldrh r1, [r1] mov r12, r1 ldr r0, [sp, 0x18] ldrh r0, [r0] cmp r12, r0 bne @0803FFEE movs r0, 0x8 ands r0, r3 cmp r0, 0 beq @0803FFEE mov r0, r10 adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] cmp r0, 0 bge @0803FFEE ldr r0, [r6] orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0803FFEE: ldr r0, =0x020242bc add r0, r8 ldrb r0, [r0, 0x13] lsls r0, 28 cmp r0, 0 beq @0804001C movs r0, 0x10 ands r0, r3 cmp r0, 0 beq @0804001C ldr r2, =gBattleMoves ldrh r1, [r5] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 bne @0804001C ldr r0, [r6] orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0804001C: ldrh r1, [r5] adds r0, r7, 0 str r3, [sp, 0x14] bl sub_8040130 lsls r0, 24 ldr r3, [sp, 0x14] cmp r0, 0 beq @0804003E movs r0, 0x20 ands r0, r3 cmp r0, 0 beq @0804003E ldr r0, [r6] orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0804003E: ldr r1, =0x020242bc mov r0, r8 adds r2, r0, r1 ldrb r0, [r2, 0xE] lsls r0, 28 mov r12, r1 cmp r0, 0 beq @0804005E ldrh r0, [r2, 0x6] ldrh r1, [r5] cmp r0, r1 beq @0804005E ldr r0, [r6] orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0804005E: ldr r2, [sp] cmp r2, 0x1D bne @08040080 ldr r0, [sp, 0x4] ldrh r1, [r0] cmp r1, 0 beq @08040080 ldr r0, =0x0000ffff cmp r1, r0 beq @08040080 ldrh r2, [r5] cmp r1, r2 beq @08040080 ldr r0, [r6] orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @08040080: adds r6, 0x4 adds r5, 0x2 ldr r0, [sp, 0x10] adds r0, 0x2 str r0, [sp, 0x10] movs r1, 0x1 add r9, r1 mov r2, r9 cmp r2, 0x3 bgt @08040096 b @0803FF5A @08040096: adds r0, r4, 0 add sp, 0x1C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_803FECC thumb_func_start sub_80400C8 sub_80400C8: ; 80400C8 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] movs r1, 0 movs r2, 0xFF bl sub_803FECC lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0xF bne @0804010C ldr r0, =0x0202433c ldrb r1, [r4] lsls r1, 4 adds r1, r0 ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] ldr r1, =0x02024220 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =gUnknown_082DB072 str r1, [r0] b @0804011E .align 2, 0 .pool @0804010C: ldr r0, =0x0202433c ldrb r1, [r4] lsls r1, 4 adds r1, r0 ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] @0804011E: movs r0, 0 cmp r3, 0xF bne @08040126 movs r0, 0x1 @08040126: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80400C8 thumb_func_start sub_8040130 sub_8040130: ; 8040130 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r5, r1, 16 movs r6, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 mov r9, r0 movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r6, r0 bge @080401B4 ldr r7, =0x02024090 mov r8, r7 @0804015A: lsls r0, r4, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 adds r3, r4, 0x1 cmp r9, r0 beq @080401AA ldr r1, =0x020242ac lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 6 ands r0, r1 cmp r0, 0 beq @080401AA movs r2, 0 movs r0, 0x58 adds r1, r4, 0 muls r1, r0 adds r0, r1, r7 ldrh r0, [r0] cmp r5, r0 beq @080401A0 mov r4, r8 adds r0, r1, r4 @08040192: adds r0, 0x2 adds r2, 0x1 cmp r2, 0x3 bgt @080401AA ldrh r1, [r0] cmp r5, r1 bne @08040192 @080401A0: cmp r2, 0x3 bgt @080401AA adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @080401AA: adds r4, r3, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0804015A @080401B4: adds r0, r6, 0 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8040130 thumb_func_start sub_80401D0 sub_80401D0: ; 80401D0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r0, 0 mov r9, r0 ldr r1, =0x0202420b mov r2, r9 strb r2, [r1] ldr r0, =0x0202406c ldrb r4, [r0] adds r6, r1, 0 mov r10, r0 ldr r7, =0x0202420c ldr r3, =0x0202449c mov r12, r3 cmp r9, r4 bcs @08040224 ldr r2, =0x02024210 ldrb r1, [r2] ldr r5, =gUnknown_0832A328 ldr r0, [r5] ands r1, r0 cmp r1, 0 beq @08040224 adds r3, r6, 0 @08040206: ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] lsls r0, 24 lsrs r0, 24 cmp r0, r4 bcs @08040224 ldrb r0, [r2] ldrb r1, [r6] lsls r1, 2 adds r1, r5 ldr r1, [r1] ands r0, r1 cmp r0, 0 bne @08040206 @08040224: movs r0, 0 strb r0, [r7] mov r0, r10 ldrb r4, [r0] cmp r4, 0 beq @0804025E ldr r2, =0x02024210 ldrb r1, [r2] ldr r5, =gUnknown_0832A328 ldr r0, [r5] ands r1, r0 cmp r1, 0 beq @0804025E adds r3, r7, 0 @08040240: ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] lsls r0, 24 lsrs r0, 24 cmp r0, r4 bcs @0804025E ldrb r0, [r2] ldrb r1, [r7] lsls r1, 2 adds r1, r5 ldr r1, [r1] ands r0, r1 cmp r0, 0 bne @08040240 @0804025E: mov r1, r12 ldr r0, [r1] ldrb r0, [r0, 0x3] cmp r0, 0xA bls @0804026A b @080408F6 @0804026A: lsls r0, 2 ldr r1, =@08040290 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08040290: .4byte @080402BC .4byte @08040342 .4byte @08040408 .4byte @080404D4 .4byte @080405B0 .4byte @08040668 .4byte @0804071C .4byte @080407A0 .4byte @08040810 .4byte @08040868 .4byte @080408EC @080402BC: movs r5, 0 ldr r1, =0x0202406c mov r10, r1 ldrb r2, [r1] cmp r5, r2 bge @080402D6 ldr r2, =0x0202407e @080402CA: adds r0, r5, r2 strb r5, [r0] adds r5, 0x1 ldrb r3, [r1] cmp r5, r3 blt @080402CA @080402D6: movs r5, 0 b @08040324 .align 2, 0 .pool @080402E4: adds r4, r5, 0x1 adds r6, r4, 0 ldrb r1, [r1] cmp r6, r1 bge @08040322 ldr r7, =0x0202407e ldr r0, =0x0202406c mov r10, r0 lsls r1, r5, 24 mov r8, r1 @080402F8: adds r0, r5, r7 ldrb r0, [r0] adds r1, r4, r7 ldrb r1, [r1] movs r2, 0 bl b_first_side lsls r0, 24 cmp r0, 0 beq @08040318 lsls r1, r4, 24 lsrs r1, 24 mov r2, r8 lsrs r0, r2, 24 bl sub_803CEDC @08040318: adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @080402F8 @08040322: adds r5, r6, 0 @08040324: mov r1, r10 ldrb r0, [r1] subs r0, 0x1 cmp r5, r0 blt @080402E4 ldr r2, =0x0202449c ldr r1, [r2] ldrb r0, [r1, 0x3] adds r0, 0x1 strb r0, [r1, 0x3] ldr r0, [r2] adds r0, 0xDB movs r1, 0 strb r1, [r0] mov r12, r2 @08040342: mov r1, r12 ldr r0, [r1] adds r0, 0xDB ldrb r0, [r0] cmp r0, 0x1 bls @08040350 b @0804062C @08040350: ldr r3, =0x02024064 mov r8, r3 movs r7, 0 ldr r6, =0x0202420b ldr r5, =0x02022f58 @0804035A: ldr r0, [r1] adds r0, 0xDB ldrb r4, [r0] ldr r2, =0x02024294 lsls r1, r4, 1 adds r0, r1, r4 lsls r0, 2 adds r2, r0, r2 ldrb r0, [r2, 0x1] strb r0, [r6] mov r3, r8 strb r0, [r3] ldr r0, =0x0202428e adds r3, r1, r0 ldrh r1, [r3] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080403BC ldrb r0, [r2] subs r0, 0x1 strb r0, [r2] movs r4, 0xFF lsls r0, 24 cmp r0, 0 bne @080403BC ldrh r0, [r3] ldr r2, =0x0000fffe adds r1, r2, 0 ands r0, r1 strh r0, [r3] ldr r0, =gUnknown_082DACFA bl b_call_bc_move_exec movs r0, 0xFD strb r0, [r5] movs r0, 0x2 strb r0, [r5, 0x1] movs r0, 0x73 strb r0, [r5, 0x2] strb r7, [r5, 0x3] ldrb r0, [r5, 0x4] orrs r0, r4 strb r0, [r5, 0x4] mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @080403BC: ldr r2, =0x0202449c ldr r1, [r2] adds r1, 0xDB ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r12, r2 mov r3, r9 cmp r3, 0 beq @080403D2 b @080408FE @080403D2: mov r1, r12 ldr r0, [r1] adds r0, 0xDB ldrb r0, [r0] cmp r0, 0x1 bls @0804035A b @0804062C .align 2, 0 .pool @08040408: mov r1, r12 ldr r0, [r1] adds r0, 0xDB ldrb r0, [r0] cmp r0, 0x1 bls @08040416 b @08040570 @08040416: movs r0, 0x2 mov r10, r0 movs r2, 0 mov r8, r2 ldr r7, =0x0202420b ldr r5, =0x02022f58 @08040422: ldr r0, [r1] adds r0, 0xDB ldrb r4, [r0] ldr r2, =0x02024294 lsls r1, r4, 1 adds r0, r1, r4 lsls r0, 2 adds r2, r0, r2 ldrb r0, [r2, 0x3] strb r0, [r7] ldr r3, =0x02024064 strb r0, [r3] ldr r0, =0x0202428e adds r3, r1, r0 ldrh r1, [r3] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0804048A ldrb r0, [r2, 0x2] subs r0, 0x1 strb r0, [r2, 0x2] movs r6, 0xFF lsls r0, 24 cmp r0, 0 bne @0804048A ldrh r0, [r3] ldr r2, =0x0000fffd adds r1, r2, 0 ands r0, r1 strh r0, [r3] ldr r0, =gUnknown_082DACFA bl b_call_bc_move_exec ldr r0, =0x02024332 strb r4, [r0, 0x5] movs r0, 0xFD strb r0, [r5] mov r3, r10 strb r3, [r5, 0x1] movs r0, 0x71 strb r0, [r5, 0x2] mov r0, r8 strb r0, [r5, 0x3] ldrb r0, [r5, 0x4] orrs r0, r6 strb r0, [r5, 0x4] mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @0804048A: ldr r2, =0x0202449c ldr r1, [r2] adds r1, 0xDB ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r12, r2 mov r1, r9 cmp r1, 0 beq @080404A0 b @080408FE @080404A0: mov r1, r12 ldr r0, [r1] adds r0, 0xDB ldrb r0, [r0] cmp r0, 0x1 bls @08040422 b @08040570 .align 2, 0 .pool @080404D4: mov r1, r12 ldr r0, [r1] adds r0, 0xDB ldrb r0, [r0] cmp r0, 0x1 bhi @08040570 ldr r0, =0x02024064 mov r10, r0 movs r2, 0 mov r8, r2 ldr r7, =0x0202420b ldr r5, =0x02022f58 @080404EC: ldr r0, [r1] adds r0, 0xDB ldrb r4, [r0] ldr r1, =0x02024294 lsls r3, r4, 1 adds r0, r3, r4 lsls r0, 2 adds r1, r0, r1 ldrb r0, [r1, 0x5] strb r0, [r7] mov r2, r10 strb r0, [r2] ldrb r0, [r1, 0x4] cmp r0, 0 beq @0804054E subs r0, 0x1 strb r0, [r1, 0x4] movs r6, 0xFF lsls r0, 24 cmp r0, 0 bne @0804054E ldr r2, =0x0202428e adds r2, r3, r2 ldrh r0, [r2] ldr r3, =0x0000feff adds r1, r3, 0 ands r0, r1 strh r0, [r2] ldr r0, =gUnknown_082DACFA bl b_call_bc_move_exec ldr r0, =0x02024332 strb r4, [r0, 0x5] movs r0, 0xFD strb r0, [r5] movs r0, 0x2 strb r0, [r5, 0x1] movs r0, 0x36 strb r0, [r5, 0x2] mov r0, r8 strb r0, [r5, 0x3] ldrb r0, [r5, 0x4] orrs r0, r6 strb r0, [r5, 0x4] mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @0804054E: ldr r2, =0x0202449c ldr r1, [r2] adds r1, 0xDB ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r12, r2 mov r1, r9 cmp r1, 0 beq @08040564 b @080408FE @08040564: mov r1, r12 ldr r0, [r1] adds r0, 0xDB ldrb r0, [r0] cmp r0, 0x1 bls @080404EC @08040570: mov r2, r9 cmp r2, 0 beq @08040578 b @080408FE @08040578: mov r3, r12 ldr r0, [r3] ldrb r1, [r0, 0x3] adds r1, 0x1 strb r1, [r0, 0x3] ldr r0, [r3] adds r0, 0xDB strb r2, [r0] b @080408F6 .align 2, 0 .pool @080405B0: mov r1, r12 ldr r0, [r1] adds r0, 0xDB ldrb r0, [r0] cmp r0, 0x1 bhi @0804062C ldr r6, =0x02024064 ldr r5, =0x0202420b @080405C0: ldr r0, [r1] adds r0, 0xDB ldrb r4, [r0] ldr r2, =0x02024294 lsls r1, r4, 1 adds r0, r1, r4 lsls r0, 2 adds r2, r0, r2 ldrb r0, [r2, 0x7] strb r0, [r5] strb r0, [r6] ldr r0, =0x0202428e adds r3, r1, r0 ldrh r1, [r3] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @0804060A ldrb r0, [r2, 0x6] subs r0, 0x1 strb r0, [r2, 0x6] lsls r0, 24 cmp r0, 0 bne @0804060A ldrh r0, [r3] ldr r2, =0x0000ffdf adds r1, r2, 0 ands r0, r1 strh r0, [r3] ldr r0, =gUnknown_082DAD0B bl b_call_bc_move_exec mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @0804060A: ldr r2, =0x0202449c ldr r1, [r2] adds r1, 0xDB ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r12, r2 mov r3, r9 cmp r3, 0 beq @08040620 b @080408FE @08040620: mov r1, r12 ldr r0, [r1] adds r0, 0xDB ldrb r0, [r0] cmp r0, 0x1 bls @080405C0 @0804062C: mov r0, r9 cmp r0, 0 beq @08040634 b @080408FE @08040634: mov r1, r12 ldr r0, [r1] ldrb r1, [r0, 0x3] adds r1, 0x1 strb r1, [r0, 0x3] mov r2, r12 ldr r0, [r2] adds r0, 0xDB mov r3, r9 strb r3, [r0] b @080408F6 .align 2, 0 .pool @08040668: mov r2, r12 ldr r0, [r2] adds r0, 0xDB ldr r1, =0x0202406c ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bcs @080406E8 ldr r4, =0x02024064 ldr r5, =0x0202407e @0804067C: ldr r0, [r2] adds r0, 0xDB ldrb r0, [r0] adds r0, r5 ldrb r0, [r0] strb r0, [r4] ldr r0, =0x020243d0 adds r0, 0x20 ldrb r2, [r4] adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0 beq @080406C4 subs r0, 0x1 strb r0, [r1] lsls r0, 24 cmp r0, 0 bne @080406C4 ldr r1, =0x02024084 ldrb r2, [r4] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 beq @080406C4 ldr r0, =0x0202420c strb r2, [r0] ldr r0, =gUnknown_082DB0B7 bl b_call_bc_move_exec mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @080406C4: ldr r2, =0x0202449c ldr r1, [r2] adds r1, 0xDB ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r12, r2 mov r3, r9 cmp r3, 0 beq @080406DA b @080408FE @080406DA: ldr r0, [r2] adds r0, 0xDB ldr r1, =0x0202406c ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bcc @0804067C @080406E8: mov r0, r9 cmp r0, 0 beq @080406F0 b @080408FE @080406F0: mov r2, r12 ldr r1, [r2] ldrb r0, [r1, 0x3] adds r0, 0x1 strb r0, [r1, 0x3] b @080408F6 .align 2, 0 .pool @0804071C: ldr r3, =0x020243cc ldrh r2, [r3] movs r0, 0x7 ands r0, r2 cmp r0, 0 bne @0804072A b @080408C8 @0804072A: movs r0, 0x4 ands r0, r2 cmp r0, 0 bne @08040776 ldr r1, =0x020243d0 adds r1, 0x28 ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] lsls r0, 24 cmp r0, 0 bne @08040768 ldr r0, =0x0000fffe ands r0, r2 ldr r1, =0x0000fffd ands r0, r1 strh r0, [r3] ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] b @08040794 .align 2, 0 .pool @08040768: movs r0, 0x2 ands r0, r2 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 bne @08040782 b @08040790 @08040776: movs r0, 0x2 ands r0, r2 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @08040790 @08040782: ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] b @08040794 .align 2, 0 .pool @08040790: ldr r0, =0x02024332 strb r1, [r0, 0x5] @08040794: ldr r0, =gUnknown_082DAC2C b @080408BA .align 2, 0 .pool @080407A0: ldr r3, =0x020243cc ldrh r2, [r3] movs r0, 0x18 ands r0, r2 cmp r0, 0 bne @080407AE b @080408C8 @080407AE: movs r0, 0x10 ands r0, r2 cmp r0, 0 bne @080407E8 ldr r1, =0x020243d0 adds r1, 0x28 ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] lsls r0, 24 cmp r0, 0 bne @080407E8 ldr r0, =0x0000fff7 ands r0, r2 strh r0, [r3] ldr r1, =0x02024214 ldr r0, =gUnknown_082DACC9 b @080407EC .align 2, 0 .pool @080407E8: ldr r1, =0x02024214 ldr r0, =gUnknown_082DAC47 @080407EC: str r0, [r1] adds r3, r1, 0 ldr r1, =0x02024474 movs r2, 0 movs r0, 0xC strb r0, [r1, 0x10] ldr r0, =0x02024332 strb r2, [r0, 0x5] b @080408B8 .align 2, 0 .pool @08040810: ldr r3, =0x020243cc ldrh r2, [r3] movs r0, 0x60 ands r0, r2 cmp r0, 0 beq @080408C8 movs r0, 0x40 ands r0, r2 cmp r0, 0 bne @08040854 ldr r1, =0x020243d0 adds r1, 0x28 ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] lsls r0, 24 cmp r0, 0 bne @08040854 ldr r0, =0x0000ffdf ands r0, r2 strh r0, [r3] ldr r1, =0x02024214 ldr r0, =gUnknown_082DACE0 b @08040858 .align 2, 0 .pool @08040854: ldr r1, =0x02024214 ldr r0, =gUnknown_082DACD2 @08040858: str r0, [r1] adds r3, r1, 0 b @080408B8 .align 2, 0 .pool @08040868: ldr r3, =0x020243cc ldrh r2, [r3] movs r0, 0x80 ands r0, r2 cmp r0, 0 beq @080408C8 ldr r1, =0x020243d0 adds r1, 0x28 ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] lsls r0, 24 cmp r0, 0 bne @080408A4 ldr r0, =0x0000ff7f ands r0, r2 strh r0, [r3] ldr r1, =0x02024214 ldr r0, =gUnknown_082DACC9 b @080408A8 .align 2, 0 .pool @080408A4: ldr r1, =0x02024214 ldr r0, =gUnknown_082DAC47 @080408A8: str r0, [r1] adds r3, r1, 0 ldr r1, =0x02024474 movs r0, 0xD strb r0, [r1, 0x10] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] @080408B8: ldr r0, [r3] @080408BA: bl b_call_bc_move_exec mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @080408C8: ldr r2, =0x0202449c ldr r1, [r2] ldrb r0, [r1, 0x3] adds r0, 0x1 strb r0, [r1, 0x3] mov r12, r2 b @080408F6 .align 2, 0 .pool @080408EC: mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @080408F6: mov r3, r9 cmp r3, 0 bne @080408FE b @0804025E @080408FE: ldr r0, =0x03005d04 ldr r1, [r0] ldr r0, =sub_803B9BC eors r1, r0 negs r0, r1 orrs r0, r1 lsrs r0, 31 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80401D0 thumb_func_start sub_8040924 sub_8040924: ; 8040924 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 movs r0, 0 mov r9, r0 ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0x01000020 orrs r0, r1 str r0, [r2] ldr r5, =0x0202449c ldr r2, [r5] ldr r0, =0x0202406c ldrb r1, [r2, 0x1] adds r7, r5, 0 mov r8, r0 ldrb r3, [r0] cmp r1, r3 bcc @08040954 bl @08041338 @08040954: bl @0804132E .align 2, 0 .pool @08040968: ldr r3, =0x02024064 ldr r4, =0x0202420b ldr r1, =0x0202407e ldr r5, [r5] ldrb r0, [r5, 0x1] adds r0, r1 ldrb r0, [r0] strb r0, [r4] strb r0, [r3] ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r3] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 adds r6, r3, 0 cmp r1, 0 beq @080409B0 ldrb r0, [r5, 0x1] adds r0, 0x1 strb r0, [r5, 0x1] bl @0804131C .align 2, 0 .pool @080409B0: ldrb r0, [r5] cmp r0, 0x13 bls @080409BA bl @08041312 @080409BA: lsls r0, 2 ldr r1, =@080409C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080409C8: .4byte @08040A18 .4byte @08040A78 .4byte @08040A96 .4byte @08040AC6 .4byte @08040B44 .4byte @08040B8C .4byte @08040C0C .4byte @08040C54 .4byte @08040CB8 .4byte @08040D00 .4byte @08040E60 .4byte @08040F7C .4byte @08041024 .4byte @080410E8 .4byte @0804119C .4byte @080411BC .4byte @08041208 .4byte @08041238 .4byte @08040AAE .4byte @08041304 @08040A18: ldr r1, =0x020242ac ldrb r3, [r6] lsls r0, r3, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 3 ands r0, r1 cmp r0, 0 bne @08040A30 bl @080412DE @08040A30: ldr r0, =0x02024084 movs r1, 0x58 muls r1, r3 adds r0, r1, r0 ldrh r2, [r0, 0x28] ldrh r5, [r0, 0x2C] cmp r2, r5 bne @08040A44 bl @080412DE @08040A44: cmp r2, 0 bne @08040A4C bl @080412DE @08040A4C: ldr r1, =0x020241f0 ldrh r0, [r0, 0x2C] lsrs r0, 4 str r0, [r1] cmp r0, 0 bne @08040A5C movs r0, 0x1 str r0, [r1] @08040A5C: ldr r0, [r1] negs r0, r0 str r0, [r1] ldr r0, =gUnknown_082DB0EE bl @080412D0 .align 2, 0 .pool @08040A78: ldrb r1, [r6] movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @08040A92 bl @080412DE @08040A92: bl @080412D4 @08040A96: ldrb r1, [r6] movs r0, 0x1 movs r2, 0 bl berry_effects_maybe lsls r0, 24 cmp r0, 0 bne @08040AAA bl @080412DE @08040AAA: bl @080412D4 @08040AAE: ldrb r1, [r6] movs r0, 0x1 movs r2, 0x1 bl berry_effects_maybe lsls r0, 24 cmp r0, 0 bne @08040AC2 bl @080412DE @08040AC2: bl @080412D4 @08040AC6: ldr r0, =0x020242ac ldrb r2, [r6] lsls r1, r2, 2 adds r1, r0 ldr r1, [r1] movs r0, 0x4 ands r0, r1 cmp r0, 0 bne @08040ADC bl @080412DE @08040ADC: ldr r3, =0x02024084 movs r5, 0x3 ands r5, r1 movs r1, 0x58 adds r0, r5, 0 muls r0, r1 adds r0, r3 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08040AF4 bl @080412DE @08040AF4: adds r0, r2, 0 muls r0, r1 adds r0, r3 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08040B04 bl @080412DE @08040B04: ldr r0, =0x0202420c strb r5, [r0] ldr r2, =0x020241f0 ldrb r0, [r6] muls r0, r1 adds r0, r3 ldrh r0, [r0, 0x2C] lsrs r0, 3 str r0, [r2] cmp r0, 0 bne @08040B1E movs r0, 0x1 str r0, [r2] @08040B1E: ldr r1, =0x02024474 strb r5, [r1, 0x10] ldrb r0, [r4] strb r0, [r1, 0x11] ldr r0, =gUnknown_082DAD15 b @080412D0 .align 2, 0 .pool @08040B44: ldr r2, =0x02024084 ldrb r1, [r6] movs r0, 0x58 adds r3, r1, 0 muls r3, r0 adds r0, r2, 0 adds r0, 0x4C adds r0, r3, r0 ldr r0, [r0] movs r1, 0x8 ands r0, r1 cmp r0, 0 bne @08040B60 b @080412DE @08040B60: adds r1, r3, r2 ldrh r0, [r1, 0x28] cmp r0, 0 bne @08040B6A b @080412DE @08040B6A: ldr r2, =0x020241f0 ldrh r0, [r1, 0x2C] lsrs r0, 3 str r0, [r2] cmp r0, 0 bne @08040B7A movs r0, 0x1 str r0, [r2] @08040B7A: ldr r0, =gUnknown_082DB23D b @080412D0 .align 2, 0 .pool @08040B8C: ldr r4, =0x02024084 ldrb r0, [r6] movs r7, 0x58 mov r8, r7 mov r2, r8 muls r2, r0 adds r3, r4, 0 adds r3, 0x4C adds r0, r2, r3 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 bne @08040BAA b @080412DE @08040BAA: adds r1, r2, r4 ldrh r0, [r1, 0x28] cmp r0, 0 bne @08040BB4 b @080412DE @08040BB4: ldr r5, =0x020241f0 ldrh r0, [r1, 0x2C] lsrs r0, 4 str r0, [r5] cmp r0, 0 bne @08040BC4 movs r0, 0x1 str r0, [r5] @08040BC4: ldrb r0, [r6] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r2, r0, r3 ldr r1, [r2] movs r4, 0xF0 lsls r4, 4 adds r0, r1, 0 ands r0, r4 cmp r0, r4 beq @08040BE4 movs r7, 0x80 lsls r7, 1 adds r0, r1, r7 str r0, [r2] @08040BE4: ldrb r0, [r6] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r3 ldr r0, [r0] ands r0, r4 lsrs r0, 8 ldr r1, [r5] muls r0, r1 str r0, [r5] ldr r0, =gUnknown_082DB23D b @080412D0 .align 2, 0 .pool @08040C0C: ldr r2, =0x02024084 ldrb r1, [r6] movs r0, 0x58 adds r3, r1, 0 muls r3, r0 adds r0, r2, 0 adds r0, 0x4C adds r0, r3, r0 ldr r0, [r0] movs r1, 0x10 ands r0, r1 cmp r0, 0 bne @08040C28 b @080412DE @08040C28: adds r1, r3, r2 ldrh r0, [r1, 0x28] cmp r0, 0 bne @08040C32 b @080412DE @08040C32: ldr r2, =0x020241f0 ldrh r0, [r1, 0x2C] lsrs r0, 3 str r0, [r2] cmp r0, 0 bne @08040C42 movs r0, 0x1 str r0, [r2] @08040C42: ldr r0, =gUnknown_082DB25F b @080412D0 .align 2, 0 .pool @08040C54: ldr r4, =0x02024084 ldrb r1, [r6] movs r0, 0x58 muls r1, r0 adds r0, r4, 0 adds r0, 0x50 adds r5, r1, r0 ldr r2, [r5] movs r0, 0x80 lsls r0, 20 ands r0, r2 cmp r0, 0 bne @08040C70 b @080412DE @08040C70: adds r3, r1, r4 ldrh r0, [r3, 0x28] cmp r0, 0 bne @08040C7A b @080412DE @08040C7A: adds r0, r4, 0 adds r0, 0x4C adds r0, r1, r0 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @08040CAC ldr r1, =0x020241f0 ldrh r0, [r3, 0x2C] lsrs r0, 2 str r0, [r1] cmp r0, 0 bne @08040C9A movs r0, 0x1 str r0, [r1] @08040C9A: ldr r0, =gUnknown_082DB33F b @080412D0 .align 2, 0 .pool @08040CAC: ldr r0, =0xf7ffffff ands r2, r0 str r2, [r5] b @080412DE .align 2, 0 .pool @08040CB8: ldr r2, =0x02024084 ldrb r1, [r6] movs r0, 0x58 adds r3, r1, 0 muls r3, r0 adds r0, r2, 0 adds r0, 0x50 adds r0, r3, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 21 ands r0, r1 cmp r0, 0 bne @08040CD6 b @080412DE @08040CD6: adds r1, r3, r2 ldrh r0, [r1, 0x28] cmp r0, 0 bne @08040CE0 b @080412DE @08040CE0: ldr r2, =0x020241f0 ldrh r0, [r1, 0x2C] lsrs r0, 2 str r0, [r2] cmp r0, 0 bne @08040CF0 movs r0, 0x1 str r0, [r2] @08040CF0: ldr r0, =gUnknown_082DB350 b @080412D0 .align 2, 0 .pool @08040D00: ldr r3, =0x02024084 mov r8, r3 ldrb r0, [r6] movs r3, 0x58 adds r1, r0, 0 muls r1, r3 movs r5, 0x50 add r5, r8 mov r10, r5 adds r4, r1, r5 ldr r2, [r4] movs r5, 0xE0 lsls r5, 8 adds r0, r2, 0 ands r0, r5 cmp r0, 0 bne @08040D24 b @080412DE @08040D24: mov r7, r8 adds r0, r1, r7 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08040D30 b @080412DE @08040D30: ldr r1, =0xffffe000 adds r0, r2, r1 str r0, [r4] ldrb r4, [r6] adds r0, r4, 0 muls r0, r3 add r0, r10 ldr r0, [r0] ands r0, r5 cmp r0, 0 beq @08040DC0 ldr r1, =0x02024474 ldr r0, =0x0202449c ldr r2, [r0] lsls r0, r4, 1 adds r0, r2 ldrb r0, [r0, 0x4] strb r0, [r1, 0x10] ldrb r0, [r6] lsls r0, 1 adds r0, r2 ldrb r0, [r0, 0x5] strb r0, [r1, 0x11] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] ldrb r0, [r6] lsls r0, 1 adds r0, r2 ldrb r0, [r0, 0x4] strb r0, [r1, 0x2] ldrb r0, [r6] lsls r0, 1 adds r0, r2 ldrb r0, [r0, 0x5] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB30E str r0, [r1] ldr r2, =0x020241f0 ldrb r0, [r6] muls r0, r3 add r0, r8 ldrh r0, [r0, 0x2C] lsrs r0, 4 str r0, [r2] cmp r0, 0 bne @08040DEC movs r0, 0x1 str r0, [r2] b @08040DEC .align 2, 0 .pool @08040DC0: ldr r2, =0x02022f58 movs r0, 0xFD strb r0, [r2] movs r0, 0x2 strb r0, [r2, 0x1] ldrb r1, [r6] ldr r0, =0x0202449c ldr r3, [r0] lsls r1, 1 adds r1, r3 ldrb r0, [r1, 0x4] strb r0, [r2, 0x2] ldrb r0, [r6] lsls r0, 1 adds r0, r3 ldrb r0, [r0, 0x5] strb r0, [r2, 0x3] movs r0, 0xFF strb r0, [r2, 0x4] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB320 str r0, [r1] @08040DEC: ldr r0, [r1] b @080412D0 .align 2, 0 .pool @08040E00: movs r0, 0x8 negs r0, r0 ands r3, r0 str r3, [r2] ldrb r0, [r6] mov r2, r8 muls r2, r0 mov r0, r10 adds r0, 0x50 adds r2, r0 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] ldr r0, =gUnknown_082DB234 bl b_call_bc_move_exec ldr r4, =0x02024064 ldrb r0, [r6] strb r0, [r4] ldrb r0, [r4] mov r3, r8 muls r3, r0 adds r0, r3, 0 add r0, r9 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @08040EC8 .align 2, 0 .pool @08040E60: ldr r2, =0x02024084 ldrb r1, [r6] movs r0, 0x58 muls r0, r1 adds r1, r2, 0 adds r1, 0x50 adds r0, r1 ldr r1, [r0] movs r0, 0x70 ands r1, r0 adds r7, r2, 0 cmp r1, 0 beq @08040F6A movs r0, 0 strb r0, [r4] mov r5, r8 ldrb r0, [r5] cmp r0, 0 beq @08040EC8 mov r10, r7 adds r6, r4, 0 movs r1, 0x58 mov r8, r1 movs r3, 0x4C adds r3, r7 mov r9, r3 str r0, [sp, 0x4] movs r5, 0x7 mov r12, r5 @08040E9A: ldrb r4, [r6] mov r1, r8 muls r1, r4 mov r0, r9 adds r2, r1, r0 ldr r3, [r2] adds r0, r3, 0 mov r5, r12 ands r0, r5 cmp r0, 0 beq @08040EBA adds r0, r1, r7 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x2B bne @08040E00 @08040EBA: adds r0, r4, 0x1 strb r0, [r6] lsls r0, 24 lsrs r0, 24 ldr r1, [sp, 0x4] cmp r0, r1 bcc @08040E9A @08040EC8: ldr r2, =0x0202420b ldr r1, =0x0202406c ldrb r0, [r2] ldrb r1, [r1] cmp r0, r1 beq @08040EE8 movs r3, 0x2 mov r9, r3 b @08041318 .align 2, 0 .pool @08040EE8: ldr r5, =0x02024064 ldrb r0, [r5] strb r0, [r2] ldr r2, =0x02024084 ldrb r0, [r5] movs r7, 0x58 adds r1, r0, 0 muls r1, r7 adds r6, r2, 0 adds r6, 0x50 adds r1, r6 ldr r0, [r1] subs r0, 0x10 str r0, [r1] ldrb r0, [r5] bl sub_803F90C lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @08040F2C ldrb r0, [r5] bl b_cancel_multi_turn_move_maybe ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] b @08040F60 .align 2, 0 .pool @08040F2C: ldrb r3, [r5] adds r0, r3, 0 muls r0, r7 adds r2, r0, r6 ldr r0, [r2] movs r1, 0x70 ands r0, r1 cmp r0, 0 beq @08040F54 ldr r0, =0x02024332 strb r4, [r0, 0x5] ldr r0, [r2] movs r1, 0x80 lsls r1, 5 orrs r0, r1 str r0, [r2] b @08040F60 .align 2, 0 .pool @08040F54: ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] adds r0, r3, 0 bl b_cancel_multi_turn_move_maybe @08040F60: ldr r0, =gUnknown_082DB2A6 bl b_call_bc_move_exec movs r5, 0x1 mov r9, r5 @08040F6A: mov r7, r9 cmp r7, 0x2 bne @08040F72 b @08041312 @08040F72: b @080412DE .align 2, 0 .pool @08040F7C: ldr r1, =0x02024084 ldrb r0, [r6] movs r7, 0x58 muls r0, r7 adds r5, r1, 0 adds r5, 0x50 adds r2, r0, r5 ldr r1, [r2] movs r4, 0xC0 lsls r4, 4 adds r0, r1, 0 ands r0, r4 cmp r0, 0 bne @08040F9A b @080412DE @08040F9A: ldr r3, =0xfffffc00 adds r0, r1, r3 str r0, [r2] ldrb r0, [r6] bl sub_803F90C lsls r0, 24 cmp r0, 0 beq @08040FBC ldrb r0, [r6] bl b_cancel_multi_turn_move_maybe b @080412DE .align 2, 0 .pool @08040FBC: ldrb r0, [r6] muls r0, r7 adds r2, r0, r5 ldr r1, [r2] adds r0, r1, 0 ands r0, r4 cmp r0, 0 beq @08040FCE b @080412DE @08040FCE: movs r0, 0x80 lsls r0, 5 ands r0, r1 cmp r0, 0 bne @08040FDA b @080412DE @08040FDA: ldr r0, =0xffffefff ands r1, r0 str r1, [r2] ldrb r0, [r6] muls r0, r7 adds r0, r5 ldr r0, [r0] movs r4, 0x7 ands r0, r4 cmp r0, 0 beq @08040FF2 b @080412DE @08040FF2: ldr r1, =0x02024332 movs r0, 0x47 strb r0, [r1, 0x3] movs r0, 0x1 movs r1, 0 bl sub_8048760 ldrb r0, [r6] muls r0, r7 adds r0, r5 ldr r0, [r0] ands r0, r4 cmp r0, 0 bne @08041010 b @080412D4 @08041010: ldr r0, =gUnknown_082DB2AF bl b_call_bc_move_exec b @080412D4 .align 2, 0 .pool @08041024: ldr r0, =0x020242bc ldrb r3, [r6] lsls r1, r3, 3 subs r1, r3 lsls r1, 2 adds r5, r1, r0 ldrb r1, [r5, 0xB] lsls r1, 28 adds r7, r0, 0 cmp r1, 0 bne @0804103C b @080412DE @0804103C: movs r4, 0 ldr r2, =0x02024084 movs r0, 0x58 adds r1, r3, 0 muls r1, r0 adds r2, 0xC adds r1, r2 ldrh r0, [r5, 0x4] ldrh r1, [r1] cmp r0, r1 beq @0804107A mov r12, r7 mov r8, r2 adds r5, r6, 0 movs r3, 0x58 @0804105A: adds r4, 0x1 cmp r4, 0x3 bgt @0804107A ldrb r2, [r5] lsls r1, r2, 3 subs r1, r2 lsls r1, 2 add r1, r12 lsls r0, r4, 1 muls r2, r3 adds r0, r2 add r0, r8 ldrh r1, [r1, 0x4] ldrh r0, [r0] cmp r1, r0 bne @0804105A @0804107A: cmp r4, 0x4 bne @080410AC ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r7 movs r1, 0 strh r1, [r0, 0x4] ldrb r0, [r6] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r7 ldrb r2, [r1, 0xB] movs r0, 0x10 negs r0, r0 ands r0, r2 strb r0, [r1, 0xB] b @080412DE .align 2, 0 .pool @080410AC: ldrb r0, [r6] lsls r2, r0, 3 subs r2, r0 lsls r2, 2 adds r2, r7 ldrb r3, [r2, 0xB] lsls r1, r3, 28 lsrs r1, 28 subs r1, 0x1 movs r0, 0xF ands r1, r0 movs r0, 0x10 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2, 0xB] adds r2, r1, 0 cmp r2, 0 beq @080410D4 b @080412DE @080410D4: ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x4] ldr r0, =gUnknown_082DAE23 b @080412D0 .align 2, 0 .pool @080410E8: ldr r3, =0x020242bc ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r2, r0, r3 ldrb r5, [r2, 0xE] lsls r4, r5, 28 cmp r4, 0 bne @080410FE b @080412DE @080410FE: ldr r7, =0x02024084 mov r8, r7 ldrb r0, [r2, 0xC] lsls r0, 1 movs r7, 0x58 muls r1, r7 adds r0, r1 mov r1, r8 adds r1, 0xC adds r0, r1 ldrh r0, [r0] ldrh r1, [r2, 0x6] cmp r0, r1 beq @0804113C movs r0, 0 strh r0, [r2, 0x6] ldrb r0, [r6] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r3 ldrb r2, [r1, 0xE] movs r0, 0x10 negs r0, r0 ands r0, r2 strb r0, [r1, 0xE] b @080412DE .align 2, 0 .pool @0804113C: lsrs r1, r4, 28 subs r1, 0x1 movs r0, 0xF ands r1, r0 movs r4, 0x10 negs r4, r4 adds r0, r4, 0 ands r0, r5 orrs r0, r1 strb r0, [r2, 0xE] cmp r1, 0 beq @08041172 ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r3 muls r1, r7 ldrb r0, [r0, 0xC] adds r1, r0 mov r0, r8 adds r0, 0x24 adds r1, r0 ldrb r0, [r1] cmp r0, 0 beq @08041172 b @080412DE @08041172: ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0 strh r1, [r0, 0x6] ldrb r0, [r6] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r3 ldrb r2, [r1, 0xE] adds r0, r4, 0 ands r0, r2 strb r0, [r1, 0xE] ldr r0, =gUnknown_082DAE37 b @080412D0 .align 2, 0 .pool @0804119C: ldr r0, =0x020242ac ldrb r1, [r6] lsls r1, 2 adds r1, r0 ldr r2, [r1] movs r0, 0x18 ands r0, r2 cmp r0, 0 beq @080411B4 adds r0, r2, 0 subs r0, 0x8 str r0, [r1] @080411B4: ldr r1, [r7] b @080412E2 .align 2, 0 .pool @080411BC: ldr r2, =0x020242bc ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r3, r0, r2 ldrb r2, [r3, 0x12] lsls r1, r2, 28 cmp r1, 0 beq @080411F6 lsrs r1, 28 subs r1, 0x1 movs r0, 0xF ands r1, r0 movs r0, 0x10 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3, 0x12] cmp r1, 0 bne @080411F6 ldr r0, =0x020242ac ldrb r2, [r6] lsls r2, 2 adds r2, r0 ldr r0, [r2] ldr r1, =0xfffffdff ands r0, r1 str r0, [r2] @080411F6: ldr r1, [r7] b @080412E2 .align 2, 0 .pool @08041208: ldr r2, =0x020242bc ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r3, r0, r2 ldrb r2, [r3, 0x13] lsls r1, r2, 28 cmp r1, 0 beq @0804122E lsrs r1, 28 subs r1, 0x1 movs r0, 0xF ands r1, r0 movs r0, 0x10 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3, 0x13] @0804122E: ldr r1, [r7] b @080412E2 .align 2, 0 .pool @08041238: ldr r4, =0x020242ac ldrb r0, [r6] lsls r0, 2 adds r2, r0, r4 ldr r1, [r2] movs r3, 0xC0 lsls r3, 5 adds r0, r1, 0 ands r0, r3 cmp r0, 0 beq @080412DE ldr r5, =0xfffff800 adds r0, r1, r5 str r0, [r2] ldrb r2, [r6] lsls r0, r2, 2 adds r0, r4 ldr r0, [r0] ands r0, r3 cmp r0, 0 bne @080412DE ldr r3, =0x02024084 movs r5, 0x58 adds r1, r2, 0 muls r1, r5 adds r4, r3, 0 adds r4, 0x4C adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0 bne @080412DE adds r0, r1, r3 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x48 beq @080412DE cmp r0, 0xF beq @080412DE adds r0, r2, 0 bl sub_8050650 lsls r0, 24 cmp r0, 0 bne @080412DE ldrb r0, [r6] bl b_cancel_multi_turn_move_maybe bl GenerateRandomNumber ldrb r1, [r6] adds r2, r1, 0 muls r2, r5 adds r2, r4 movs r1, 0x3 ands r1, r0 adds r1, 0x2 ldr r0, [r2] orrs r0, r1 str r0, [r2] ldrb r0, [r6] muls r0, r5 adds r0, r4 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r6] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x0202420e ldrb r0, [r6] strb r0, [r1] ldr r0, =gUnknown_082DB378 @080412D0: bl b_call_bc_move_exec @080412D4: mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @080412DE: ldr r0, =0x0202449c ldr r1, [r0] @080412E2: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08041312 .align 2, 0 .pool @08041304: ldr r1, [r7] movs r0, 0 strb r0, [r1] ldr r1, [r7] ldrb r0, [r1, 0x1] adds r0, 0x1 strb r0, [r1, 0x1] @08041312: mov r7, r9 cmp r7, 0 beq @0804131C @08041318: mov r0, r9 b @08041344 @0804131C: ldr r5, =0x0202449c ldr r2, [r5] ldr r0, =0x0202406c ldrb r1, [r2, 0x1] adds r7, r5, 0 mov r8, r0 ldrb r0, [r0] cmp r1, r0 bcs @08041338 @0804132E: ldrb r0, [r2] cmp r0, 0x13 bhi @08041338 bl @08040968 @08041338: ldr r0, =0x02024280 ldr r1, [r0] ldr r2, =0xfeffffdf ands r1, r2 str r1, [r0] movs r0, 0 @08041344: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8040924 thumb_func_start sub_8041364 sub_8041364: ; 8041364 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0x01000020 orrs r0, r1 str r0, [r2] ldr r1, =0x0202449c ldr r3, [r1] movs r4, 0xD0 lsls r4, 1 adds r0, r3, r4 ldrb r0, [r0] mov r10, r2 adds r6, r1, 0 cmp r0, 0x1 bne @0804138E b @08041548 @0804138E: cmp r0, 0x1 bgt @080413A4 cmp r0, 0 beq @080413AC b @08041708 .align 2, 0 .pool @080413A4: cmp r0, 0x2 bne @080413AA b @0804169A @080413AA: b @08041708 @080413AC: ldr r2, =0x000001a1 adds r0, r3, r2 ldr r1, =0x0202406c ldrb r0, [r0] mov r8, r1 ldrb r7, [r1] cmp r0, r7 bcc @080413BE b @08041532 @080413BE: ldr r4, =0x02024064 ldr r5, =0x02022f58 ldr r7, =0x020243d0 movs r0, 0x18 adds r0, r7 mov r12, r0 @080413CA: ldr r0, [r6] adds r3, r0, r2 ldrb r0, [r3] strb r0, [r4] ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0804140C ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] b @08041520 .align 2, 0 .pool @0804140C: ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] ldr r1, =0x020243d0 ldrb r0, [r4] adds r2, r0, r1 ldrb r0, [r2] mov r9, r1 cmp r0, 0 bne @08041422 b @08041520 @08041422: subs r0, 0x1 strb r0, [r2] lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 bne @08041520 ldr r1, =0x02024084 ldrb r2, [r4] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08041520 lsls r0, r2, 1 add r0, r12 ldrh r0, [r0] cmp r0, 0xF8 bne @0804145C ldr r0, =0x02024332 strb r3, [r0, 0x5] b @08041462 .align 2, 0 .pool @0804145C: ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] @08041462: movs r0, 0xFD strb r0, [r5] movs r6, 0x2 movs r0, 0x2 strb r0, [r5, 0x1] ldrb r0, [r4] lsls r0, 1 add r0, r12 ldrh r0, [r0] strb r0, [r5, 0x2] ldrb r0, [r4] lsls r0, 1 add r0, r12 ldrh r0, [r0] lsrs r0, 8 strb r0, [r5, 0x3] movs r0, 0xFF strb r0, [r5, 0x4] ldr r5, =0x0202420c ldrb r0, [r4] strb r0, [r5] ldr r1, =0x0202420b adds r0, r7, 0x4 ldrb r2, [r4] adds r0, r2 ldrb r0, [r0] strb r0, [r1] ldr r2, =0x020241f0 ldrb r0, [r4] lsls r0, 2 adds r1, r7, 0 adds r1, 0x8 adds r0, r1 ldr r0, [r0] str r0, [r2] ldr r2, =0x0202437c ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r2, 0x4 adds r0, r2 ldr r1, =0x0000ffff str r1, [r0] ldr r0, =gUnknown_082DAFE4 bl b_call_bc_move_exec ldrb r1, [r4] adds r0, r1, r7 ldrb r0, [r0] cmp r0, 0 beq @080414CC b @08041664 @080414CC: eors r1, r6 mov r3, r9 adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 beq @080414DA b @08041664 @080414DA: ldrb r0, [r5] bl battle_get_per_side_status ldr r2, =0x0202428e lsls r0, 24 lsrs r0, 24 movs r1, 0x1 ands r0, r1 lsls r0, 1 adds r0, r2 ldrh r1, [r0] ldr r4, =0x0000ffbf adds r2, r4, 0 ands r1, r2 strh r1, [r0] b @08041664 .align 2, 0 .pool @08041520: ldr r0, [r6] ldr r2, =0x000001a1 adds r0, r2 ldrb r0, [r0] mov r1, r8 ldrb r1, [r1] cmp r0, r1 bcs @08041532 b @080413CA @08041532: ldr r0, [r6] movs r2, 0xD0 lsls r2, 1 adds r0, r2 movs r1, 0x1 strb r1, [r0] ldr r0, [r6] ldr r3, =0x000001a1 adds r1, r0, r3 movs r0, 0 strb r0, [r1] @08041548: adds r3, r6, 0 ldr r0, [r6] ldr r2, =0x000001a1 adds r0, r2 ldr r1, =0x0202406c ldrb r0, [r0] mov r8, r1 ldrb r4, [r1] cmp r0, r4 bcc @0804155E b @08041684 @0804155E: ldr r5, =0x02024064 ldr r4, =0x02022f58 ldr r7, =0x020242bc mov r12, r7 ldr r0, =0x0202420b mov r9, r0 @0804156A: ldr r1, =0x0202407e ldr r0, [r3] adds r3, r0, r2 ldrb r0, [r3] adds r0, r1 ldrb r0, [r0] mov r1, r9 strb r0, [r1] strb r0, [r5] ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @080415BC ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] b @08041670 .align 2, 0 .pool @080415BC: ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] ldr r7, =0x020242ac ldrb r0, [r5] lsls r0, 2 adds r0, r7 ldr r0, [r0] movs r1, 0x20 ands r0, r1 cmp r0, 0 beq @08041670 movs r0, 0xFD strb r0, [r4] movs r0, 0x1 strb r0, [r4, 0x1] strb r0, [r4, 0x2] strb r0, [r4, 0x3] ldrb r1, [r5] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 ldrb r0, [r0, 0xF] lsls r0, 28 lsrs r0, 28 strb r0, [r4, 0x4] movs r0, 0xFF strb r0, [r4, 0x5] ldrb r2, [r5] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 mov r3, r12 adds r4, r0, r3 ldrb r3, [r4, 0xF] lsls r1, r3, 28 cmp r1, 0 bne @08041644 lsls r2, 2 adds r2, r7 ldr r0, [r2] movs r1, 0x21 negs r1, r1 ands r0, r1 str r0, [r2] ldr r3, =0x020241f0 ldr r2, =0x02024084 ldrb r1, [r5] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x28] str r0, [r3] ldr r1, =0x02024214 ldr r0, =gUnknown_082DAF05 b @0804165C .align 2, 0 .pool @08041644: lsrs r1, 28 subs r1, 0x1 movs r0, 0xF ands r1, r0 movs r7, 0x10 negs r7, r7 adds r0, r7, 0 ands r0, r3 orrs r0, r1 strb r0, [r4, 0xF] ldr r1, =0x02024214 ldr r0, =gUnknown_082DAF20 @0804165C: str r0, [r1] ldr r0, [r1] bl b_call_bc_move_exec @08041664: movs r0, 0x1 b @08041714 .align 2, 0 .pool @08041670: adds r3, r6, 0 ldr r0, [r6] ldr r2, =0x000001a1 adds r0, r2 ldrb r0, [r0] mov r1, r8 ldrb r1, [r1] cmp r0, r1 bcs @08041684 b @0804156A @08041684: ldr r0, [r6] movs r2, 0xD0 lsls r2, 1 adds r0, r2 movs r1, 0x2 strb r1, [r0] ldr r0, [r6] ldr r3, =0x000001a1 adds r1, r0, r3 movs r0, 0 strb r0, [r1] @0804169A: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @08041708 ldr r0, [r6] adds r0, 0xDA ldrb r0, [r0] cmp r0, 0x2 bne @08041708 ldr r1, =0x02024084 ldrh r0, [r1, 0x28] cmp r0, 0 beq @08041708 adds r0, r1, 0 adds r0, 0x80 ldrh r0, [r0] cmp r0, 0 beq @08041708 movs r4, 0 @080416C6: lsls r0, r4, 24 lsrs r0, 24 bl b_cancel_multi_turn_move_maybe adds r4, 0x1 cmp r4, 0x1 ble @080416C6 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB8F3 str r0, [r1] bl b_call_bc_move_exec ldr r0, =0x0202449c ldr r1, [r0] movs r4, 0xD0 lsls r4, 1 adds r1, r4 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08041664 .align 2, 0 .pool @08041708: mov r7, r10 ldr r0, [r7] ldr r1, =0xfeffffdf ands r0, r1 str r0, [r7] movs r0, 0 @08041714: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8041364 thumb_func_start sub_8041728 sub_8041728: ; 8041728 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @08041770 b @08041A0A .align 2, 0 .pool @08041744: ldr r0, =gUnknown_082DA7C4 bl b_call_bc_move_exec ldr r0, [r5] adds r0, 0x4D movs r1, 0x2 b @08041764 .align 2, 0 .pool @08041758: ldr r0, =gUnknown_082DA7CD bl b_call_bc_move_exec ldr r0, [r5] adds r0, 0x4D movs r1, 0x5 @08041764: strb r1, [r0] @08041766: movs r0, 0x1 b @08041A0C .align 2, 0 .pool @08041770: ldr r0, =0x0202449c mov r8, r0 @08041774: mov r1, r8 ldr r0, [r1] adds r0, 0x4D ldrb r0, [r0] cmp r0, 0x7 bls @08041782 b @080419FC @08041782: lsls r0, 2 ldr r1, =@08041794 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08041794: .4byte @080417B4 .4byte @08041806 .4byte @080418A0 .4byte @080418E2 .4byte @080418F6 .4byte @08041960 .4byte @08041994 .4byte @080419FC @080417B4: mov r4, r8 ldr r0, [r4] adds r0, 0x4E movs r1, 0 strb r1, [r0] ldr r1, [r4] adds r1, 0x4D ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r5, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 bge @08041806 ldr r6, =0x02024210 @080417D4: ldrb r0, [r6] ldr r2, =gUnknown_0832A328 lsls r1, r5, 2 adds r1, r2 ldr r4, [r1] ands r0, r4 cmp r0, 0 beq @080417FC lsls r0, r5, 24 lsrs r0, 24 movs r1, 0x6 movs r2, 0x6 bl sub_80423F4 lsls r0, 24 cmp r0, 0 bne @080417FC ldrb r0, [r6] bics r0, r4 strb r0, [r6] @080417FC: adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @080417D4 @08041806: ldr r0, =0x0202449c mov r8, r0 ldr r1, =0x0202420d mov r12, r1 ldr r2, =0x0202420c mov r5, r8 ldr r7, =0x02024084 ldr r6, =0x0202406e @08041816: ldr r3, [r5] adds r1, r3, 0 adds r1, 0x4E ldrb r0, [r1] strb r0, [r2] mov r4, r12 strb r0, [r4] ldrb r4, [r1] movs r0, 0x58 muls r0, r4 adds r0, r7 ldrh r0, [r0, 0x28] cmp r0, 0 bne @0804185E adds r0, r3, 0 adds r0, 0xDF ldrb r1, [r0] ldr r3, =gUnknown_0832A328 lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0804185E ldr r0, =0x02024210 ldrb r1, [r0] lsls r0, r4, 2 adds r0, r3 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0804185E b @08041744 @0804185E: ldr r0, [r5] adds r0, 0x4E ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] ldr r0, =0x0202406c lsls r1, 24 lsrs r1, 24 ldrb r0, [r0] cmp r1, r0 bne @08041816 mov r1, r8 ldr r0, [r1] adds r0, 0x4D movs r1, 0x3 strb r1, [r0] b @080419FC .align 2, 0 .pool @080418A0: ldr r0, =0x0202420d ldrb r0, [r0] bl sub_803F9EC ldr r2, =0x0202449c ldr r1, [r2] adds r1, 0x4E ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bne @080418D8 ldr r0, [r2] adds r0, 0x4D movs r1, 0x3 strb r1, [r0] b @080419FA .align 2, 0 .pool @080418D8: ldr r0, [r2] adds r0, 0x4D movs r1, 0x1 strb r1, [r0] b @080419FA @080418E2: mov r4, r8 ldr r0, [r4] adds r0, 0x4E movs r1, 0 strb r1, [r0] ldr r1, [r4] adds r1, 0x4D ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @080418F6: ldr r0, =0x0202420d mov r12, r0 ldr r7, =0x0202420c ldr r5, =0x0202449c ldr r2, =0x02024084 ldr r6, =gUnknown_0832A328 @08041902: ldr r0, [r5] adds r4, r0, 0 adds r4, 0x4E ldrb r0, [r4] strb r0, [r7] mov r1, r12 strb r0, [r1] ldrb r3, [r4] movs r0, 0x58 muls r0, r3 adds r0, r2 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08041930 ldr r0, =0x02024210 ldrb r1, [r0] lsls r0, r3, 2 adds r0, r6 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08041930 b @08041758 @08041930: adds r0, r3, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bne @08041902 b @08041978 .align 2, 0 .pool @08041960: mov r1, r8 ldr r0, [r1] adds r0, 0x4E ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] ldr r0, =0x0202406c lsls r1, 24 lsrs r1, 24 ldrb r0, [r0] cmp r1, r0 bne @08041988 @08041978: mov r4, r8 ldr r0, [r4] adds r0, 0x4D movs r1, 0x6 strb r1, [r0] b @080419FC .align 2, 0 .pool @08041988: mov r1, r8 ldr r0, [r1] adds r0, 0x4D movs r1, 0x4 strb r1, [r0] b @080419FC @08041994: movs r0, 0 str r0, [sp] movs r0, 0x9 movs r1, 0 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @080419AE b @08041766 @080419AE: str r0, [sp] movs r0, 0xB movs r1, 0 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @080419C4 b @08041766 @080419C4: movs r0, 0x1 movs r1, 0 movs r2, 0x1 bl berry_effects_maybe lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @080419D8 b @08041766 @080419D8: str r0, [sp] movs r0, 0x6 movs r1, 0 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @080419EE b @08041766 @080419EE: ldr r2, =0x0202449c ldr r1, [r2] adds r1, 0x4D ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @080419FA: mov r8, r2 @080419FC: mov r4, r8 ldr r0, [r4] adds r0, 0x4D ldrb r0, [r0] cmp r0, 0x7 beq @08041A0A b @08041774 @08041A0A: movs r0, 0 @08041A0C: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8041728 thumb_func_start b_clear_atk_up_if_hit_flag_unless_enraged b_clear_atk_up_if_hit_flag_unless_enraged: ; 8041A1C push {r4-r6,lr} movs r3, 0 ldr r0, =0x0202406c adds r5, r0, 0 ldrb r0, [r5] cmp r3, r0 bge @08041A54 ldr r4, =0x02024274 movs r6, 0x80 lsls r6, 16 ldr r2, =0x020240d4 @08041A32: ldr r1, [r2] adds r0, r1, 0 ands r0, r6 cmp r0, 0 beq @08041A48 ldrh r0, [r4] cmp r0, 0x63 beq @08041A48 ldr r0, =0xff7fffff ands r1, r0 str r1, [r2] @08041A48: adds r4, 0x2 adds r2, 0x58 adds r3, 0x1 ldrb r0, [r5] cmp r3, r0 blt @08041A32 @08041A54: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end b_clear_atk_up_if_hit_flag_unless_enraged thumb_func_start sub_8041A6C sub_8041A6C: ; 8041A6C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 movs r0, 0 mov r9, r0 ldr r1, =0x02024478 mov r10, r1 ldr r2, =0x0202449c mov r8, r2 b @08041A9A .align 2, 0 .pool @08041A90: mov r3, r9 cmp r3, 0 beq @08041A9A bl @08042388 @08041A9A: mov r4, r8 ldr r0, [r4] ldr r7, =0x000001a3 adds r0, r7 ldrb r0, [r0] cmp r0, 0xE bls @08041AAC bl @08042376 @08041AAC: lsls r0, 2 ldr r1, =@08041AC0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08041AC0: .4byte @08041AFC .4byte @08041B48 .4byte @08041C90 .4byte @08041D50 .4byte @08041DC4 .4byte @08041E40 .4byte @08041EB8 .4byte @08041F38 .4byte @08041FC0 .4byte @08042028 .4byte @08042114 .4byte @08042194 .4byte @08042234 .4byte @0804231C .4byte @08042376 @08041AFC: ldr r1, =0x02024084 ldr r3, =0x0202420b ldrb r2, [r3] movs r0, 0x58 muls r2, r0 adds r1, 0x50 adds r2, r1 ldr r0, [r2] ldr r1, =0xfdffffff ands r0, r1 str r0, [r2] ldr r0, =0x020242ac ldrb r2, [r3] lsls r2, 2 adds r2, r0 ldr r0, [r2] ldr r1, =0xffffbfff ands r0, r1 str r0, [r2] mov r1, r8 ldr r0, [r1] ldr r2, =0x000001a3 adds r1, r0, r2 bl @08042370 .align 2, 0 .pool @08041B48: ldr r7, =0x02024084 ldr r4, =0x0202420b ldrb r1, [r4] movs r5, 0x58 adds r0, r1, 0 muls r0, r5 adds r6, r7, 0 adds r6, 0x4C adds r0, r6 ldr r0, [r0] movs r3, 0x7 mov r8, r3 ands r0, r3 cmp r0, 0 bne @08041B68 b @08041C6E @08041B68: adds r0, r1, 0 bl sub_8050650 lsls r0, 24 cmp r0, 0 beq @08041BC8 ldrb r0, [r4] adds r2, r0, 0 muls r2, r5 adds r2, r6 ldr r0, [r2] movs r1, 0x8 negs r1, r1 ands r0, r1 str r0, [r2] ldrb r0, [r4] adds r2, r0, 0 muls r2, r5 adds r0, r7, 0 adds r0, 0x50 adds r2, r0 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB220 str r0, [r1] movs r4, 0x2 mov r9, r4 b @08041C6E .align 2, 0 .pool @08041BC8: ldrb r0, [r4] adds r1, r0, 0 muls r1, r5 adds r0, r1, r7 adds r0, 0x20 ldrb r0, [r0] movs r3, 0x1 cmp r0, 0x30 bne @08041BDC movs r3, 0x2 @08041BDC: adds r2, r1, r6 ldr r1, [r2] adds r0, r1, 0 mov r7, r8 ands r0, r7 cmp r0, r3 bcs @08041BF4 movs r0, 0x8 negs r0, r0 ands r1, r0 str r1, [r2] b @08041BF8 @08041BF4: subs r0, r1, r3 str r0, [r2] @08041BF8: ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r1, r0 adds r0, r2, 0 adds r0, 0x4C adds r0, r1, r0 ldr r4, [r0] movs r0, 0x7 ands r4, r0 cmp r4, 0 beq @08041C50 ldr r0, =0x020241ea ldrh r0, [r0] cmp r0, 0xAD beq @08041C6E cmp r0, 0xD6 beq @08041C6E ldr r1, =0x02024214 ldr r0, =gUnknown_082DB213 str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] movs r0, 0x2 mov r9, r0 b @08041C6E .align 2, 0 .pool @08041C50: adds r2, 0x50 adds r2, r1, r2 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] bl b_movescr_stack_push_cursor ldr r0, =0x02024332 strb r4, [r0, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB220 str r0, [r1] movs r1, 0x2 mov r9, r1 @08041C6E: ldr r1, =0x0202449c ldr r0, [r1] ldr r3, =0x000001a3 adds r2, r0, r3 b @0804216A .align 2, 0 .pool @08041C90: ldr r1, =0x02024084 ldr r7, =0x0202420b ldrb r0, [r7] movs r6, 0x58 muls r0, r6 adds r5, r1, 0 adds r5, 0x4C adds r0, r5 ldr r0, [r0] movs r1, 0x20 ands r0, r1 cmp r0, 0 beq @08041D30 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x5 bl __umodsi3 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 beq @08041D08 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] cmp r0, 0x7D bne @08041CD6 b @08042162 @08041CD6: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB26A str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 2 orrs r0, r1 str r0, [r2] b @08041D28 .align 2, 0 .pool @08041D08: ldrb r0, [r7] adds r2, r0, 0 muls r2, r6 adds r2, r5 ldr r0, [r2] movs r1, 0x21 negs r1, r1 ands r0, r1 str r0, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB277 str r0, [r1] ldr r0, =0x02024332 strb r4, [r0, 0x5] @08041D28: movs r7, 0x2 mov r9, r7 ldr r0, =0x0202449c mov r8, r0 @08041D30: mov r1, r8 ldr r0, [r1] ldr r2, =0x000001a3 adds r1, r0, r2 b @08042370 .align 2, 0 .pool @08041D50: ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r0, r1 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x36 beq @08041D66 b @08042162 @08041D66: ldr r0, =0x020242bc lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x18] lsls r0, 31 cmp r0, 0 bne @08041D7A b @08042162 @08041D7A: adds r0, r2, 0 bl b_cancel_multi_turn_move_maybe ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB6AD str r0, [r1] ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] b @0804215E .align 2, 0 .pool @08041DC4: ldr r1, =0x02024084 ldr r3, =0x0202420b ldrb r2, [r3] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r2, r0, r1 ldr r1, [r2] movs r0, 0x80 lsls r0, 15 ands r0, r1 cmp r0, 0 beq @08041E10 ldr r0, =0xffbfffff ands r1, r0 str r1, [r2] ldr r2, =0x020242bc ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x19] ldrb r0, [r3] bl b_cancel_multi_turn_move_maybe ldr r1, =0x02024214 ldr r0, =gUnknown_082D9462 str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] movs r7, 0x1 mov r9, r7 @08041E10: ldr r1, =0x0202449c ldr r0, [r1] ldr r3, =0x000001a3 adds r2, r0, r3 b @0804216A .align 2, 0 .pool @08041E40: ldr r1, =0x02024084 ldr r3, =0x0202420b ldrb r2, [r3] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r2, r0, r1 ldr r1, [r2] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @08041E8C movs r0, 0x9 negs r0, r0 ands r1, r0 str r1, [r2] ldr r0, =0x0202433c ldrb r2, [r3] lsls r2, 4 adds r2, r0 ldrb r0, [r2, 0x2] movs r1, 0x4 orrs r0, r1 strb r0, [r2, 0x2] ldrb r0, [r3] bl b_cancel_multi_turn_move_maybe ldr r1, =0x02024214 ldr r0, =gUnknown_082DB29B str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] movs r4, 0x1 mov r9, r4 @08041E8C: ldr r1, =0x0202449c ldr r0, [r1] ldr r7, =0x000001a3 adds r2, r0, r7 b @0804216A .align 2, 0 .pool @08041EB8: ldr r0, =0x020242bc ldr r3, =0x0202420b ldrb r2, [r3] lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r0 ldr r0, =0x020241ea ldrh r1, [r1, 0x4] ldrh r0, [r0] cmp r1, r0 bne @08041F04 cmp r1, 0 beq @08041F04 ldr r0, =0x0202433c lsls r2, 4 adds r2, r0 ldrb r0, [r2, 0x1] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x1] ldr r1, =0x02024474 ldrb r0, [r3] strb r0, [r1, 0x17] ldrb r0, [r3] bl b_cancel_multi_turn_move_maybe ldr r1, =0x02024214 ldr r0, =gUnknown_082DAE14 str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] movs r0, 0x1 mov r9, r0 @08041F04: ldr r1, =0x0202449c ldr r0, [r1] ldr r3, =0x000001a3 adds r2, r0, r3 b @0804216A .align 2, 0 .pool @08041F38: ldr r0, =0x020242bc ldr r4, =0x0202420b ldrb r3, [r4] lsls r1, r3, 3 subs r1, r3 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x13] lsls r0, 28 cmp r0, 0 beq @08041F8C ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 bne @08041F8C ldr r0, =0x0202433c lsls r2, r3, 4 adds r2, r0 ldrb r0, [r2, 0x2] movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x2] ldrb r0, [r4] bl b_cancel_multi_turn_move_maybe ldr r1, =0x02024214 ldr r0, =gUnknown_082DB0A4 str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] movs r4, 0x1 mov r9, r4 @08041F8C: ldr r1, =0x0202449c ldr r0, [r1] ldr r7, =0x000001a3 adds r2, r0, r7 b @0804216A .align 2, 0 .pool @08041FC0: ldr r4, =0x0202420b ldrb r0, [r4] ldr r1, =0x020241ea ldrh r1, [r1] bl sub_8040130 lsls r0, 24 cmp r0, 0 beq @08041FFE ldr r0, =0x0202433c ldrb r2, [r4] lsls r2, 4 adds r2, r0 ldrb r0, [r2, 0x1] movs r1, 0x20 orrs r0, r1 strb r0, [r2, 0x1] ldrb r0, [r4] bl b_cancel_multi_turn_move_maybe ldr r1, =0x02024214 ldr r0, =gUnknown_082DB176 str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] movs r0, 0x1 mov r9, r0 @08041FFE: ldr r1, =0x0202449c ldr r0, [r1] ldr r3, =0x000001a3 adds r2, r0, r3 b @0804216A .align 2, 0 .pool @08042028: ldr r7, =0x02024084 ldr r5, =0x0202420b ldrb r0, [r5] movs r6, 0x58 muls r0, r6 adds r4, r7, 0 adds r4, 0x50 adds r2, r0, r4 ldr r1, [r2] movs r3, 0x7 adds r0, r1, 0 ands r0, r3 cmp r0, 0 beq @080420FA subs r0, r1, 0x1 str r0, [r2] ldrb r0, [r5] muls r0, r6 adds r0, r4 ldr r0, [r0] ands r0, r3 cmp r0, 0 beq @080420E8 bl GenerateRandomNumber movs r1, 0x1 movs r2, 0x1 ands r2, r0 cmp r2, 0 beq @0804207C ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x5] bl b_movescr_stack_push_cursor b @080420C6 .align 2, 0 .pool @0804207C: ldr r0, =0x02024332 movs r4, 0x1 strb r1, [r0, 0x5] ldr r1, =0x0202420c ldrb r0, [r5] strb r0, [r1] ldrb r0, [r5] adds r1, r0, 0 muls r1, r6 adds r1, r7 movs r0, 0x28 str r0, [sp] str r2, [sp, 0x4] ldrb r0, [r5] str r0, [sp, 0x8] ldrb r0, [r5] str r0, [sp, 0xC] adds r0, r1, 0 movs r2, 0x1 movs r3, 0 bl sub_806957C ldr r1, =0x020241f0 str r0, [r1] ldr r0, =0x0202433c ldrb r1, [r5] lsls r1, 4 adds r1, r0 ldrb r0, [r1, 0x1] orrs r0, r4 strb r0, [r1, 0x1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] @080420C6: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB2BD b @080420F0 .align 2, 0 .pool @080420E8: bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB300 @080420F0: str r0, [r1] movs r4, 0x1 mov r9, r4 ldr r7, =0x0202449c mov r8, r7 @080420FA: mov r1, r8 ldr r0, [r1] ldr r2, =0x000001a3 adds r1, r0, r2 b @08042370 .align 2, 0 .pool @08042114: ldr r1, =0x02024084 ldr r4, =0x0202420b ldrb r2, [r4] movs r0, 0x58 muls r0, r2 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08042162 bl GenerateRandomNumber lsls r0, 16 movs r1, 0xC0 lsls r1, 10 ands r1, r0 cmp r1, 0 bne @08042162 ldr r0, =0x0202433c ldrb r2, [r4] lsls r2, 4 adds r2, r0 ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB28B str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] @0804215E: movs r3, 0x1 mov r9, r3 @08042162: ldr r1, =0x0202449c ldr r0, [r1] ldr r4, =0x000001a3 adds r2, r0, r4 @0804216A: ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] mov r8, r1 b @08042376 .align 2, 0 .pool @08042194: ldr r1, =0x02024084 ldr r4, =0x0202420b ldrb r2, [r4] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r1, [r0] movs r0, 0xF0 lsls r0, 12 ands r1, r0 cmp r1, 0 beq @0804220E lsrs r0, r1, 16 bl sub_806F8A8 ldr r1, =0x02024474 strb r0, [r1, 0x17] bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @080421D8 bl b_movescr_stack_push_cursor b @08042200 .align 2, 0 .pool @080421D8: ldr r0, =gUnknown_082DB334 bl b_movescr_stack_push ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [r2] ldr r0, =0x0202433c ldrb r2, [r4] lsls r2, 4 adds r2, r0 ldrb r0, [r2, 0x1] movs r1, 0x40 orrs r0, r1 strb r0, [r2, 0x1] ldrb r0, [r4] bl b_cancel_multi_turn_move_maybe @08042200: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB327 str r0, [r1] movs r7, 0x1 mov r9, r7 ldr r0, =0x0202449c mov r8, r0 @0804220E: mov r1, r8 ldr r0, [r1] ldr r2, =0x000001a3 adds r1, r0, r2 b @08042370 .align 2, 0 .pool @08042234: ldr r1, =0x02024084 ldr r6, =0x0202420b ldrb r0, [r6] movs r5, 0x58 muls r0, r5 adds r1, 0x50 adds r3, r0, r1 ldr r2, [r3] movs r4, 0xC0 lsls r4, 2 adds r0, r2, 0 ands r0, r4 cmp r0, 0 beq @08042306 ldr r7, =0xffffff00 adds r0, r2, r7 str r0, [r3] ldrb r2, [r6] adds r0, r2, 0 muls r0, r5 adds r0, r1 ldr r0, [r0] ands r0, r4 cmp r0, 0 beq @08042280 ldr r1, =0x02024214 ldr r0, =gUnknown_082DAD71 b @08042300 .align 2, 0 .pool @08042280: ldr r3, =0x020241f8 lsls r0, r2, 2 adds r0, r3 ldr r0, [r0] cmp r0, 0 beq @080422FC ldr r1, =0x020241ea movs r0, 0x75 strh r0, [r1] ldrb r0, [r6] lsls r0, 2 adds r0, r3 ldr r0, [r0] lsls r0, 1 mov r1, r10 str r0, [r1] ldr r4, =0x0202420c ldr r1, =0x02024288 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] strb r0, [r4] ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @080422CA movs r0, 0x75 movs r1, 0x1 bl sub_80458E0 strb r0, [r4] @080422CA: ldr r1, =0x02024214 ldr r0, =gUnknown_082DAD7C str r0, [r1] ldr r2, =0x0202449c mov r8, r2 b @08042302 .align 2, 0 .pool @080422FC: ldr r1, =0x02024214 ldr r0, =gUnknown_082DADC4 @08042300: str r0, [r1] @08042302: movs r3, 0x1 mov r9, r3 @08042306: mov r4, r8 ldr r0, [r4] ldr r7, =0x000001a3 adds r1, r0, r7 b @08042370 .align 2, 0 .pool @0804231C: ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x4C adds r4, r0, r1 ldr r3, [r4] movs r0, 0x20 ands r0, r3 cmp r0, 0 beq @08042368 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] cmp r0, 0x7D bne @08042360 movs r0, 0x21 negs r0, r0 ands r3, r0 str r3, [r4] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB277 str r0, [r1] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] @08042360: movs r0, 0x2 mov r9, r0 ldr r1, =0x0202449c mov r8, r1 @08042368: mov r2, r8 ldr r0, [r2] ldr r3, =0x000001a3 adds r1, r0, r3 @08042370: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @08042376: mov r4, r8 ldr r0, [r4] ldr r7, =0x000001a3 adds r0, r7 ldrb r0, [r0] cmp r0, 0xE beq @08042388 bl @08041A90 @08042388: mov r0, r9 cmp r0, 0x2 bne @080423B4 ldr r4, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r4] ldrb r1, [r4] movs r0, 0x58 muls r0, r1 ldr r1, =0x020240d0 adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @080423B4: mov r0, r9 add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8041A6C thumb_func_start sub_80423F4 sub_80423F4: ; 80423F4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 lsrs r1, 24 mov r10, r1 lsls r2, 24 lsrs r2, 24 mov r9, r2 ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08042424 movs r0, 0 b @080426A0 .align 2, 0 .pool @08042424: movs r0, 0x80 lsls r0, 15 ands r0, r1 cmp r0, 0 beq @0804249C adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r8, r1 cmp r0, 0 bne @08042442 ldr r2, =0x020244ec mov r8, r2 @08042442: movs r0, 0x2 ands r0, r4 lsls r0, 24 lsrs r6, r0, 25 lsls r0, r6, 1 adds r4, r0, r6 adds r0, r4, 0x3 cmp r4, r0 bge @0804248C adds r7, r0, 0 @08042456: movs r0, 0x64 muls r0, r4 mov r1, r8 adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08042486 adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @08042486 adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 bne @0804248C @08042486: adds r4, 0x1 cmp r4, r7 blt @08042456 @0804248C: movs r1, 0 lsls r0, r6, 1 adds r0, r6 b @08042556 .align 2, 0 .pool @0804249C: movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0804256C movs r0, 0x80 lsls r0, 16 ands r1, r0 cmp r1, 0 beq @080424E4 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080424D0 ldr r2, =0x020244ec mov r8, r2 adds r0, r4, 0 bl sub_806D864 lsls r0, 24 lsrs r7, r0, 24 b @08042502 .align 2, 0 .pool @080424D0: ldr r0, =0x02024744 mov r8, r0 movs r1, 0x1 eors r1, r4 negs r0, r1 orrs r0, r1 lsrs r6, r0, 31 b @0804250C .align 2, 0 .pool @080424E4: adds r0, r4, 0 bl sub_806D864 lsls r0, 24 lsrs r7, r0, 24 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r8, r1 cmp r0, 0 bne @08042502 ldr r2, =0x020244ec mov r8, r2 @08042502: adds r0, r7, 0 bl sub_806D82C lsls r0, 24 lsrs r6, r0, 24 @0804250C: lsls r0, r6, 1 adds r4, r0, r6 adds r1, r4, 0x3 mov r9, r0 cmp r4, r1 bge @08042550 adds r7, r1, 0 @0804251A: movs r0, 0x64 muls r0, r4 mov r1, r8 adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0804254A adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @0804254A adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 bne @08042550 @0804254A: adds r4, 0x1 cmp r4, r7 blt @0804251A @08042550: movs r1, 0 mov r2, r9 adds r0, r2, r6 @08042556: adds r0, 0x3 cmp r4, r0 bne @0804255E movs r1, 0x1 @0804255E: adds r0, r1, 0 b @080426A0 .align 2, 0 .pool @0804256C: movs r0, 0x80 lsls r0, 8 ands r1, r0 cmp r1, 0 beq @080425DA adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080425DA ldr r0, =0x02024744 mov r8, r0 movs r6, 0x3 cmp r4, 0x1 bne @08042590 movs r6, 0 @08042590: adds r4, r6, 0 adds r6, r4, 0x3 b @0804259E .align 2, 0 .pool @0804259C: adds r4, 0x1 @0804259E: cmp r4, r6 bge @080425D2 movs r0, 0x64 muls r0, r4 mov r1, r8 adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0804259C adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @0804259C adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @0804259C @080425D2: movs r0, 0 cmp r4, r6 bne @080426A0 b @0804269E @080425DA: adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08042608 movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 movs r0, 0x3 bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 ldr r2, =0x02024744 mov r8, r2 b @08042620 .align 2, 0 .pool @08042608: movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 movs r0, 0x2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x020244ec mov r8, r0 @08042620: mov r1, r10 cmp r1, 0x6 bne @08042630 ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrb r0, [r0] mov r10, r0 @08042630: mov r2, r9 cmp r2, 0x6 bne @08042640 ldr r1, =0x0202406e lsls r0, r6, 1 adds r0, r1 ldrb r0, [r0] mov r9, r0 @08042640: movs r4, 0 @08042642: movs r0, 0x64 muls r0, r4 mov r1, r8 adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08042692 adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @08042692 adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @08042692 cmp r4, r10 beq @08042692 cmp r4, r9 beq @08042692 ldr r0, =0x0202449c ldr r1, [r0] adds r0, r7, r1 adds r0, 0x5C ldrb r0, [r0] cmp r4, r0 beq @08042692 adds r0, r6, r1 adds r0, 0x5C ldrb r0, [r0] cmp r4, r0 bne @08042698 @08042692: adds r4, 0x1 cmp r4, 0x5 ble @08042642 @08042698: movs r0, 0 cmp r4, 0x6 bne @080426A0 @0804269E: movs r0, 0x1 @080426A0: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80423F4 thumb_func_start castform_switch castform_switch: ; 80426BC push {r4-r6,lr} sub sp, 0x4 lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r6 adds r4, r0, r1 ldrh r1, [r4] ldr r0, =0x00000181 cmp r1, r0 bne @08042760 adds r0, r4, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x3B bne @08042760 ldrh r0, [r4, 0x28] cmp r0, 0 beq @08042760 str r5, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @0804270E str r5, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @08042734 @0804270E: adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0 beq @08042734 adds r1, r4, 0 adds r1, 0x22 ldrb r0, [r1] cmp r0, 0 beq @08042734 strb r5, [r2] strb r5, [r1] movs r0, 0x1 b @08042818 .align 2, 0 .pool @08042734: movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08042760 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @08042764 @08042760: movs r0, 0 b @08042818 @08042764: ldr r1, =0x020243cc ldrh r0, [r1] movs r2, 0xE7 ands r2, r0 adds r4, r1, 0 cmp r2, 0 bne @08042792 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r6 adds r1, r0, r1 adds r3, r1, 0 adds r3, 0x21 ldrb r0, [r3] cmp r0, 0 beq @08042792 adds r1, 0x22 ldrb r0, [r1] cmp r0, 0 beq @08042792 strb r2, [r3] strb r2, [r1] movs r5, 0x1 @08042792: ldrh r1, [r4] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @080427BE ldr r1, =0x02024084 movs r0, 0x58 muls r0, r6 adds r1, r0, r1 adds r2, r1, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0xA beq @080427BE adds r1, 0x22 ldrb r0, [r1] cmp r0, 0xA beq @080427BE movs r0, 0xA strb r0, [r2] strb r0, [r1] movs r5, 0x2 @080427BE: ldrh r1, [r4] movs r0, 0x7 ands r0, r1 cmp r0, 0 beq @080427EA ldr r1, =0x02024084 movs r0, 0x58 muls r0, r6 adds r1, r0, r1 adds r2, r1, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0xB beq @080427EA adds r1, 0x22 ldrb r0, [r1] cmp r0, 0xB beq @080427EA movs r0, 0xB strb r0, [r2] strb r0, [r1] movs r5, 0x3 @080427EA: ldrh r1, [r4] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08042816 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r6 adds r1, r0, r1 adds r2, r1, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0xF beq @08042816 adds r1, 0x22 ldrb r0, [r1] cmp r0, 0xF beq @08042816 movs r0, 0xF strb r0, [r2] strb r0, [r1] movs r5, 0x4 @08042816: adds r0, r5, 0 @08042818: add sp, 0x4 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end castform_switch thumb_func_start ability_something ability_something: ; 8042828 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x28 ldr r4, [sp, 0x48] lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4] lsls r1, 24 lsrs r1, 24 mov r10, r1 lsls r2, 24 lsrs r6, r2, 24 lsls r3, 24 lsrs r3, 24 mov r8, r3 lsls r4, 16 lsrs r4, 16 movs r0, 0 mov r9, r0 ldr r5, =0x0202420b ldr r1, =0x0202406c ldrb r0, [r5] ldrb r1, [r1] cmp r0, r1 bcc @08042864 mov r1, r10 strb r1, [r5] @08042864: ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08042894 ldr r1, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec b @080428A4 .align 2, 0 .pool @08042894: ldr r1, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 @080428A4: adds r7, r1, r0 ldr r5, =0x0202420c ldr r1, =0x0202406c ldrb r0, [r5] ldrb r1, [r1] cmp r0, r1 bcc @080428B6 mov r2, r10 strb r2, [r5] @080428B6: ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080428E8 ldr r1, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec b @080428F8 .align 2, 0 .pool @080428E8: ldr r1, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 @080428F8: adds r5, r1, r0 adds r0, r7, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x8] adds r0, r7, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x10] adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 str r0, [sp, 0xC] adds r0, r5, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x14] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @0804293A bl @0804443A @0804293A: mov r3, r8 cmp r3, 0 beq @08042958 ldr r0, =0x0202420a strb r3, [r0] adds r7, r0, 0 b @0804296E .align 2, 0 .pool @08042958: ldr r2, =0x0202420a ldr r1, =0x02024084 movs r0, 0x58 mov r5, r10 muls r5, r0 adds r0, r5, 0 adds r0, r1 adds r0, 0x20 ldrb r0, [r0] strb r0, [r2] adds r7, r2, 0 @0804296E: cmp r4, 0 beq @08042980 adds r5, r4, 0 b @08042984 .align 2, 0 .pool @08042980: ldr r0, =0x020241ea ldrh r5, [r0] @08042984: ldr r1, =0x0202449c ldr r0, [r1] ldrb r0, [r0, 0x13] mov r8, r1 cmp r0, 0 beq @080429A0 movs r3, 0x3F ands r3, r0 b @080429AC .align 2, 0 .pool @080429A0: ldr r1, =gBattleMoves lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r3, [r0, 0x2] @080429AC: ldr r0, [sp, 0x4] cmp r0, 0x13 bls @080429B6 bl @0804441E @080429B6: lsls r0, 2 ldr r1, =@080429C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080429C8: .4byte @08042A18 .4byte @08042CDC .4byte @08042EF8 .4byte @08042F8C .4byte @080431AC .4byte @08043908 .4byte @08043C6C .4byte @08043CBC .4byte @08043D40 .4byte @08043DC4 .4byte @08043FE4 .4byte @08043E08 .4byte @08044028 .4byte @08044084 .4byte @080440E0 .4byte @080441DC .4byte @08044220 .4byte @0804427C .4byte @080443EC .4byte @08044196 @08042A18: ldr r2, =0x0202420b ldr r0, =0x0202406c ldrb r1, [r2] adds r5, r0, 0 ldrb r3, [r5] cmp r1, r3 bcc @08042A2A mov r0, r10 strb r0, [r2] @08042A2A: ldrb r0, [r7] cmp r0, 0x2D bne @08042A32 b @08042BA8 @08042A32: cmp r0, 0x2D bgt @08042A64 cmp r0, 0xD bne @08042A3C b @08042CA4 @08042A3C: cmp r0, 0xD bgt @08042A54 cmp r0, 0x2 bne @08042A46 b @08042B78 @08042A46: bl @0804441E .align 2, 0 .pool @08042A54: cmp r0, 0x16 bne @08042A5A b @08042C08 @08042A5A: cmp r0, 0x24 bne @08042A60 b @08042C68 @08042A60: bl @0804441E @08042A64: cmp r0, 0x46 bne @08042A6A b @08042BD8 @08042A6A: cmp r0, 0x46 bgt @08042A78 cmp r0, 0x3B bne @08042A74 b @08042C3C @08042A74: bl @0804441E @08042A78: cmp r0, 0x4D bne @08042A7E b @08042CA4 @08042A7E: cmp r0, 0xFF beq @08042A86 bl @0804441E @08042A86: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne @08042B4C bl weather_get_current lsls r0, 24 lsrs r0, 24 subs r0, 0x3 cmp r0, 0xA bhi @08042B4C lsls r0, 2 ldr r1, =@08042AB4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08042AB4: .4byte @08042AE0 .4byte @08042B4C .4byte @08042AE0 .4byte @08042B4C .4byte @08042B4C .4byte @08042B04 .4byte @08042B4C .4byte @08042B4C .4byte @08042B4C .4byte @08042B28 .4byte @08042AE0 @08042AE0: ldr r2, =0x020243cc ldrh r1, [r2] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @08042B4C movs r0, 0x5 strh r0, [r2] ldr r1, =0x02024474 movs r0, 0xA strb r0, [r1, 0x10] mov r2, r10 strb r2, [r1, 0x17] b @08042B42 .align 2, 0 .pool @08042B04: ldr r3, =0x020243cc ldrh r1, [r3] movs r2, 0x18 adds r0, r2, 0 ands r0, r1 cmp r0, 0 bne @08042B4C strh r2, [r3] ldr r1, =0x02024474 movs r0, 0xC strb r0, [r1, 0x10] mov r3, r10 strb r3, [r1, 0x17] b @08042B42 .align 2, 0 .pool @08042B28: ldr r3, =0x020243cc ldrh r1, [r3] movs r2, 0x60 adds r0, r2, 0 ands r0, r1 cmp r0, 0 bne @08042B4C strh r2, [r3] ldr r1, =0x02024474 movs r0, 0xB strb r0, [r1, 0x10] mov r5, r10 strb r5, [r1, 0x17] @08042B42: mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @08042B4C: mov r0, r9 cmp r0, 0 bne @08042B56 bl @0804443A @08042B56: bl weather_get_current ldr r1, =0x02024332 strb r0, [r1, 0x5] ldr r0, =gUnknown_082DACE7 bl b_push_move_exec bl @0804441E .align 2, 0 .pool @08042B78: ldr r2, =0x020243cc ldrh r1, [r2] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08042B88 bl @0804441E @08042B88: movs r0, 0x5 strh r0, [r2] ldr r0, =gUnknown_082DB430 bl b_push_move_exec ldr r0, =0x02024474 mov r1, r10 strb r1, [r0, 0x17] bl @080443D0 .align 2, 0 .pool @08042BA8: ldr r2, =0x020243cc ldrh r1, [r2] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08042BB8 bl @0804441E @08042BB8: movs r0, 0x18 strh r0, [r2] ldr r0, =gUnknown_082DB470 bl b_push_move_exec ldr r0, =0x02024474 mov r2, r10 strb r2, [r0, 0x17] bl @080443D0 .align 2, 0 .pool @08042BD8: ldr r2, =0x020243cc ldrh r1, [r2] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @08042BE8 bl @0804441E @08042BE8: movs r0, 0x60 strh r0, [r2] ldr r0, =gUnknown_082DB52A bl b_push_move_exec ldr r0, =0x02024474 mov r3, r10 strb r3, [r0, 0x17] bl @080443D0 .align 2, 0 .pool @08042C08: ldr r0, =0x0202437c mov r5, r10 lsls r2, r5, 2 adds r1, r2, r5 lsls r1, 2 adds r3, r1, r0 ldrb r0, [r3] lsls r0, 28 cmp r0, 0 bge @08042C20 bl @0804441E @08042C20: ldr r1, =0x020242ac adds r1, r2, r1 ldr r0, [r1] movs r2, 0x80 lsls r2, 12 orrs r0, r2 str r0, [r1] ldrb r0, [r3] movs r1, 0x8 b @08042C92 .align 2, 0 .pool @08042C3C: mov r0, r10 bl castform_switch lsls r0, 24 lsrs r0, 24 mov r9, r0 cmp r0, 0 bne @08042C50 bl @0804443A @08042C50: ldr r0, =gUnknown_082DB4A9 bl b_push_move_exec ldr r0, =0x02024474 mov r1, r10 strb r1, [r0, 0x17] bl @080442E2 .align 2, 0 .pool @08042C68: ldr r0, =0x0202437c mov r3, r10 lsls r2, r3, 2 adds r1, r2, r3 lsls r1, 2 adds r3, r1, r0 ldrb r0, [r3] lsls r0, 27 cmp r0, 0 bge @08042C80 bl @0804441E @08042C80: ldr r1, =0x020242ac adds r1, r2, r1 ldr r0, [r1] movs r2, 0x80 lsls r2, 13 orrs r0, r2 str r0, [r1] ldrb r0, [r3] movs r1, 0x10 @08042C92: orrs r0, r1 strb r0, [r3] bl @0804441E .align 2, 0 .pool @08042CA4: movs r6, 0 ldrb r5, [r5] cmp r6, r5 bcc @08042CB0 bl @0804441E @08042CB0: adds r0, r6, 0 bl castform_switch lsls r0, 24 lsrs r0, 24 mov r9, r0 cmp r0, 0 beq @08042CC4 bl @080442D8 @08042CC4: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x0202406c ldrb r0, [r0] cmp r6, r0 bcc @08042CB0 bl @0804441E .align 2, 0 .pool @08042CDC: ldr r5, =0x02024084 mov r8, r5 movs r0, 0x58 mov r6, r10 muls r6, r0 adds r4, r6, r5 ldrh r0, [r4, 0x28] cmp r0, 0 bne @08042CF2 bl @0804441E @08042CF2: ldr r0, =0x0202420b mov r1, r10 strb r1, [r0] ldrb r5, [r7] cmp r5, 0x2C beq @08042D22 cmp r5, 0x2C bgt @08042D14 cmp r5, 0x3 bne @08042D08 b @08042E84 @08042D08: bl @0804441E .align 2, 0 .pool @08042D14: cmp r5, 0x36 bne @08042D1A b @08042ED0 @08042D1A: cmp r5, 0x3D beq @08042DA0 bl @0804441E @08042D22: movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @08042D3E bl @0804441E @08042D3E: str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @08042D56 bl @0804441E @08042D56: ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @08042D66 bl @0804441E @08042D66: ldrh r0, [r4, 0x2C] ldrh r2, [r4, 0x28] cmp r0, r2 bhi @08042D72 bl @0804441E @08042D72: strb r5, [r7] ldr r0, =gUnknown_082DB45C bl b_push_move_exec ldr r1, =0x020241f0 ldrh r0, [r4, 0x2C] lsrs r0, 4 str r0, [r1] cmp r0, 0 bne @08042D8A movs r0, 0x1 str r0, [r1] @08042D8A: ldr r0, [r1] negs r0, r0 str r0, [r1] bl @080443D0 .align 2, 0 .pool @08042DA0: mov r0, r8 adds r0, 0x4C adds r5, r6, r0 ldrb r0, [r5] cmp r0, 0 bne @08042DB0 bl @0804441E @08042DB0: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 beq @08042DCA bl @0804441E @08042DCA: ldr r0, [r5] movs r1, 0x88 ands r0, r1 cmp r0, 0 beq @08042DDC ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC70 bl gf_strcpy @08042DDC: ldr r0, [r5] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @08042DEE ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC78 bl gf_strcpy @08042DEE: ldr r0, [r5] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08042E00 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC80 bl gf_strcpy @08042E00: ldr r0, [r5] movs r1, 0x10 ands r0, r1 cmp r0, 0 beq @08042E12 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC88 bl gf_strcpy @08042E12: ldr r0, [r5] movs r1, 0x20 ands r0, r1 cmp r0, 0 beq @08042E24 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC90 bl gf_strcpy @08042E24: str r4, [r5] mov r1, r8 adds r1, 0x50 adds r1, r6, r1 ldr r0, [r1] ldr r2, =0xf7ffffff ands r0, r2 str r0, [r1] ldr r0, =0x02024474 ldr r4, =0x02024064 mov r3, r10 strb r3, [r4] strb r3, [r0, 0x17] ldr r0, =gUnknown_082DB484 bl b_push_move_exec str r5, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution bl @080443D0 .align 2, 0 .pool @08042E84: ldrb r2, [r4, 0x1B] movs r0, 0x1B ldrsb r0, [r4, r0] cmp r0, 0xB ble @08042E92 bl @0804441E @08042E92: ldr r0, =0x020242bc mov r5, r10 lsls r1, r5, 3 subs r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x16] cmp r0, 0x2 bne @08042EA8 bl @0804441E @08042EA8: adds r0, r2, 0x1 movs r1, 0 strb r0, [r4, 0x1B] ldr r4, =0x02024474 movs r0, 0x11 strb r0, [r4, 0x10] strb r1, [r4, 0x11] ldr r0, =gUnknown_082DB444 bl b_push_move_exec strb r5, [r4, 0x17] bl @080443D0 .align 2, 0 .pool @08042ED0: ldr r2, =0x020242bc ldrb r0, [r0] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 ldrb r3, [r1, 0x18] lsls r0, r3, 31 lsrs r0, 31 movs r2, 0x1 eors r2, r0 movs r0, 0x2 negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1, 0x18] bl @0804441E .align 2, 0 .pool @08042EF8: ldrb r0, [r7] cmp r0, 0x2B beq @08042F02 bl @0804441E @08042F02: movs r4, 0 ldr r0, =gUnknown_0831BCF8 ldrh r2, [r0] ldr r3, =0x0000ffff adds r1, r0, 0 cmp r2, r3 bne @08042F14 bl @0804441E @08042F14: cmp r2, r5 beq @08042F2C adds r2, r1, 0 @08042F1A: adds r2, 0x2 adds r4, 0x1 ldrh r0, [r2] cmp r0, r3 bne @08042F28 bl @0804441E @08042F28: cmp r0, r5 bne @08042F1A @08042F2C: lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] ldr r0, =0x0000ffff cmp r1, r0 bne @08042F3C bl @0804441E @08042F3C: ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 5 ands r0, r1 cmp r0, 0 beq @08042F62 ldr r0, =0x02024280 ldr r1, [r0] movs r2, 0x80 lsls r2, 4 orrs r1, r2 str r1, [r0] @08042F62: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB61F str r0, [r1] movs r0, 0x1 mov r9, r0 bl @08044424 .align 2, 0 .pool @08042F8C: cmp r5, 0 bne @08042F94 bl @0804441E @08042F94: ldrb r0, [r7] cmp r0, 0xB beq @08043004 cmp r0, 0xB bgt @08042FA4 cmp r0, 0xA beq @08042FAA b @08043126 @08042FA4: cmp r0, 0x12 beq @0804305C b @08043126 @08042FAA: cmp r3, 0xD beq @08042FB0 b @08043126 @08042FB0: ldr r0, =gBattleMoves lsls r1, r5, 1 adds r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] cmp r0, 0 bne @08042FC2 b @08043126 @08042FC2: ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0, 0x2] lsls r0, 28 cmp r0, 0 bge @08042FF0 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB56F b @08042FF4 .align 2, 0 .pool @08042FF0: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB56E @08042FF4: str r0, [r1] movs r1, 0x1 b @08043124 .align 2, 0 .pool @08043004: cmp r3, 0xB beq @0804300A b @08043126 @0804300A: ldr r0, =gBattleMoves lsls r1, r5, 1 adds r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] cmp r0, 0 bne @0804301C b @08043126 @0804301C: ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0, 0x2] lsls r0, 28 cmp r0, 0 bge @08043048 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB56F b @0804304C .align 2, 0 .pool @08043048: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB56E @0804304C: str r0, [r1] movs r2, 0x1 mov r9, r2 b @08043126 .align 2, 0 .pool @0804305C: cmp r3, 0xA bne @08043126 ldr r1, =0x02024084 movs r0, 0x58 mov r3, r10 muls r3, r0 adds r0, r3, 0 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x20 ands r0, r1 cmp r0, 0 bne @08043126 ldr r2, =0x020244a8 ldr r0, [r2] ldr r0, [r0, 0x4] mov r5, r10 lsls r1, r5, 2 adds r0, r1 ldr r3, [r0] movs r4, 0x1 ands r3, r4 adds r5, r1, 0 cmp r3, 0 bne @080430EC ldr r0, =0x02024332 strb r3, [r0, 0x5] ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0, 0x2] lsls r0, 28 cmp r0, 0 bge @080430C8 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB5A8 b @080430CC .align 2, 0 .pool @080430C8: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB5A7 @080430CC: str r0, [r1] ldr r0, [r2] ldr r1, [r0, 0x4] adds r1, r5 ldr r0, [r1] movs r2, 0x1 orrs r0, r2 str r0, [r1] movs r0, 0x2 mov r9, r0 b @08043126 .align 2, 0 .pool @080430EC: ldr r0, =0x02024332 strb r4, [r0, 0x5] ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0, 0x2] lsls r0, 28 cmp r0, 0 bge @0804311C ldr r1, =0x02024214 ldr r0, =gUnknown_082DB5A8 b @08043120 .align 2, 0 .pool @0804311C: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB5A7 @08043120: str r0, [r1] movs r1, 0x2 @08043124: mov r9, r1 @08043126: mov r2, r9 cmp r2, 0x1 beq @08043130 bl @0804441E @08043130: ldr r1, =0x02024084 movs r0, 0x58 mov r3, r10 muls r3, r0 adds r0, r3, 0 adds r1, r0, r1 ldrh r0, [r1, 0x2C] ldrh r5, [r1, 0x28] cmp r0, r5 bne @0804318C ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0, 0x2] lsls r0, 28 cmp r0, 0 bge @08043178 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB592 str r0, [r1] bl @0804441E .align 2, 0 .pool @08043178: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB591 str r0, [r1] bl @0804441E .align 2, 0 .pool @0804318C: ldr r2, =0x020241f0 ldrh r0, [r1, 0x2C] lsrs r0, 2 str r0, [r2] cmp r0, 0 bne @0804319C mov r0, r9 str r0, [r2] @0804319C: ldr r0, [r2] negs r0, r0 str r0, [r2] bl @0804441E .align 2, 0 .pool @080431AC: ldrb r0, [r7] subs r0, 0x9 cmp r0, 0x2F bls @080431B8 bl @0804441E @080431B8: lsls r0, 2 ldr r1, =@080431C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080431C8: .4byte @080435E4 .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @08043288 .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @08043350 .4byte @0804441E .4byte @0804441E .4byte @08043410 .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @08043508 .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @080436C0 .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804441E .4byte @0804379C @08043288: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @08043298 bl @0804441E @08043298: cmp r5, 0xA5 bne @080432A0 bl @0804441E @080432A0: ldr r0, =gBattleMoves lsls r1, r5, 1 adds r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] cmp r0, 0 bne @080432B4 bl @0804441E @080432B4: ldr r2, =0x0202437c ldr r0, =0x0202420c ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r1, r0, 2 adds r0, r2, 0 adds r0, 0x8 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @080432DC adds r0, r2, 0 adds r0, 0xC adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @080432DC bl @0804441E @080432DC: ldr r1, =0x02024084 movs r0, 0x58 mov r2, r10 muls r2, r0 adds r0, r2, 0 adds r1, r0, r1 adds r4, r1, 0 adds r4, 0x21 ldrb r0, [r4] cmp r0, r3 bne @080432F6 bl @0804441E @080432F6: adds r2, r1, 0 adds r2, 0x22 ldrb r0, [r2] cmp r0, r3 bne @08043304 bl @0804441E @08043304: ldrh r0, [r1, 0x28] cmp r0, 0 bne @0804330E bl @0804441E @0804330E: strb r3, [r4] strb r3, [r2] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x3 strb r0, [r1, 0x1] strb r3, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB64D str r0, [r1] bl @080443D0 .align 2, 0 .pool @08043350: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @08043360 bl @0804441E @08043360: ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r3, r0, r1 ldrh r0, [r3, 0x28] cmp r0, 0 bne @08043376 bl @0804441E @08043376: ldr r0, =0x0202433c lsls r1, r2, 4 adds r1, r0 ldrb r0, [r1, 0x1] lsls r0, 31 cmp r0, 0 beq @08043388 bl @0804441E @08043388: ldr r2, =0x0202437c ldr r0, =0x0202420c ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r1, r0, 2 adds r0, r2, 0 adds r0, 0x8 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @080433B0 adds r0, r2, 0 adds r0, 0xC adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @080433B0 bl @0804441E @080433B0: ldr r1, =gBattleMoves lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x8] movs r2, 0x1 adds r0, r2, 0 ands r0, r1 cmp r0, 0 bne @080433CA bl @0804441E @080433CA: ldr r1, =0x020241f0 ldrh r0, [r3, 0x2C] lsrs r0, 4 str r0, [r1] cmp r0, 0 bne @080433D8 str r2, [r1] @080433D8: bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB654 str r0, [r1] bl @080443D0 .align 2, 0 .pool @08043410: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @08043420 bl @0804441E @08043420: ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08043436 bl @0804441E @08043436: ldr r0, =0x0202433c lsls r1, r2, 4 adds r1, r0 ldrb r0, [r1, 0x1] lsls r0, 31 cmp r0, 0 beq @08043448 bl @0804441E @08043448: ldr r2, =0x0202437c ldr r0, =0x0202420c ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r1, r0, 2 adds r0, r2, 0 adds r0, 0x8 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08043470 adds r0, r2, 0 adds r0, 0xC adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08043470 bl @0804441E @08043470: ldr r1, =gBattleMoves lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08043488 bl @0804441E @08043488: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xA bl __umodsi3 lsls r0, 16 cmp r0, 0 beq @080434A0 bl @0804441E @080434A0: ldr r5, =0x02024332 movs r4, 0x3 @080434A4: bl GenerateRandomNumber ands r0, r4 strb r0, [r5, 0x3] cmp r0, 0 beq @080434A4 ldr r1, =0x02024332 ldrb r0, [r1, 0x3] cmp r0, 0x3 bne @080434BC adds r0, 0x2 strb r0, [r1, 0x3] @080434BC: ldrb r0, [r1, 0x3] adds r0, 0x40 strb r0, [r1, 0x3] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB67C str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 6 orrs r0, r1 str r0, [r2] bl @080443D0 .align 2, 0 .pool @08043508: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @08043518 bl @0804441E @08043518: ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 bne @0804352E bl @0804441E @0804352E: ldr r0, =0x0202433c lsls r1, r2, 4 adds r1, r0 ldrb r0, [r1, 0x1] lsls r0, 31 cmp r0, 0 beq @08043540 bl @0804441E @08043540: ldr r2, =0x0202437c ldr r0, =0x0202420c ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r1, r0, 2 adds r0, r2, 0 adds r0, 0x8 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08043568 adds r0, r2, 0 adds r0, 0xC adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08043568 bl @0804441E @08043568: ldr r1, =gBattleMoves lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08043580 bl @0804441E @08043580: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 lsls r0, 16 cmp r0, 0 beq @08043598 bl @0804441E @08043598: ldr r1, =0x02024332 movs r0, 0x42 strb r0, [r1, 0x3] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB67C str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 6 orrs r0, r1 str r0, [r2] bl @080443D0 .align 2, 0 .pool @080435E4: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @080435F4 bl @0804441E @080435F4: ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 bne @0804360A bl @0804441E @0804360A: ldr r0, =0x0202433c lsls r1, r2, 4 adds r1, r0 ldrb r0, [r1, 0x1] lsls r0, 31 cmp r0, 0 beq @0804361C bl @0804441E @0804361C: ldr r2, =0x0202437c ldr r0, =0x0202420c ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r1, r0, 2 adds r0, r2, 0 adds r0, 0x8 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08043644 adds r0, r2, 0 adds r0, 0xC adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08043644 bl @0804441E @08043644: ldr r1, =gBattleMoves lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0804365C bl @0804441E @0804365C: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 lsls r0, 16 cmp r0, 0 beq @08043674 bl @0804441E @08043674: ldr r1, =0x02024332 movs r0, 0x45 strb r0, [r1, 0x3] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB67C str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 6 orrs r0, r1 str r0, [r2] bl @080443D0 .align 2, 0 .pool @080436C0: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @080436D0 bl @0804441E @080436D0: ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 bne @080436E6 bl @0804441E @080436E6: ldr r0, =0x0202433c lsls r1, r2, 4 adds r1, r0 ldrb r0, [r1, 0x1] lsls r0, 31 cmp r0, 0 beq @080436F8 bl @0804441E @080436F8: ldr r1, =gBattleMoves lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08043710 bl @0804441E @08043710: ldr r2, =0x0202437c ldr r0, =0x0202420c ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r1, r0, 2 adds r0, r2, 0 adds r0, 0x8 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08043738 adds r0, r2, 0 adds r0, 0xC adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08043738 bl @0804441E @08043738: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 lsls r0, 16 cmp r0, 0 beq @08043750 bl @0804441E @08043750: ldr r1, =0x02024332 movs r0, 0x43 strb r0, [r1, 0x3] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB67C str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 6 orrs r0, r1 str r0, [r2] bl @080443D0 .align 2, 0 .pool @0804379C: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @080437AC bl @0804441E @080437AC: ldr r6, =0x02024084 ldr r3, =0x0202420b mov r8, r3 ldrb r1, [r3] movs r7, 0x58 adds r0, r1, 0 muls r0, r7 adds r0, r6 ldrh r0, [r0, 0x28] cmp r0, 0 bne @080437C6 bl @0804441E @080437C6: ldr r0, =0x0202433c lsls r1, 4 adds r1, r0 ldrb r0, [r1, 0x1] lsls r0, 31 cmp r0, 0 beq @080437D8 bl @0804441E @080437D8: ldr r1, =gBattleMoves lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080437F0 bl @0804441E @080437F0: ldr r3, =0x0202437c ldr r5, =0x0202420c ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r2, r0, 2 adds r0, r3, 0 adds r0, 0x8 adds r0, r2, r0 ldr r0, [r0] cmp r0, 0 bne @08043818 adds r0, r3, 0 adds r0, 0xC adds r0, r2, r0 ldr r0, [r0] cmp r0, 0 bne @08043818 bl @0804441E @08043818: adds r0, r1, 0 muls r0, r7 adds r0, r6 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08043828 bl @0804441E @08043828: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 lsls r0, 16 cmp r0, 0 beq @08043840 bl @0804441E @08043840: mov r1, r8 ldrb r0, [r1] muls r0, r7 adds r0, r6 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0xC bne @08043854 bl @0804441E @08043854: ldr r0, [sp, 0x8] ldr r1, [sp, 0x10] bl pokemon_species_get_gender_info adds r4, r0, 0 ldr r0, [sp, 0xC] ldr r1, [sp, 0x14] bl pokemon_species_get_gender_info lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @08043872 bl @0804441E @08043872: mov r2, r8 ldrb r0, [r2] muls r0, r7 adds r4, r6, 0 adds r4, 0x50 adds r0, r4 ldr r0, [r0] movs r1, 0xF0 lsls r1, 12 ands r0, r1 cmp r0, 0 beq @0804388E bl @0804441E @0804388E: ldr r0, [sp, 0x8] ldr r1, [sp, 0x10] bl pokemon_species_get_gender_info lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @080438A2 bl @0804441E @080438A2: ldr r0, [sp, 0xC] ldr r1, [sp, 0x14] bl pokemon_species_get_gender_info lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @080438B6 bl @0804441E @080438B6: mov r3, r8 ldrb r0, [r3] adds r2, r0, 0 muls r2, r7 adds r2, r4 ldr r1, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, [r0] lsls r1, 16 ldr r0, [r2] orrs r0, r1 str r0, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB66F str r0, [r1] bl @080443D0 .align 2, 0 .pool @08043908: movs r5, 0 mov r10, r5 ldr r0, =0x0202406c ldrb r0, [r0] cmp r10, r0 bcc @08043918 bl @0804441E @08043918: ldr r1, =0x02024084 movs r0, 0x58 mov r2, r10 muls r2, r0 adds r0, r2, 0 adds r0, r1 adds r0, 0x20 ldrb r0, [r0] subs r0, 0x7 adds r2, r1, 0 cmp r0, 0x41 bls @08043932 b @08043B96 @08043932: lsls r0, 2 ldr r1, =@08043948 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08043948: .4byte @08043AAC .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B70 .4byte @08043B96 .4byte @08043B96 .4byte @08043AD4 .4byte @08043B96 .4byte @08043A50 .4byte @08043B96 .4byte @08043B96 .4byte @08043A7C .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B40 .4byte @08043B10 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043B96 .4byte @08043AD4 @08043A50: movs r0, 0x58 mov r3, r10 muls r3, r0 adds r0, r3, 0 adds r1, r2, 0 adds r1, 0x4C adds r0, r1 ldr r0, [r0] ldr r1, =0x00000f88 ands r0, r1 cmp r0, 0 bne @08043A6A b @08043B96 @08043A6A: ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC70 b @08043B5C .align 2, 0 .pool @08043A7C: movs r0, 0x58 mov r1, r10 muls r1, r0 adds r0, r1, 0 adds r1, r2, 0 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 bne @08043A96 b @08043B96 @08043A96: ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC98 bl gf_strcpy movs r2, 0x2 mov r9, r2 b @08043B9C .align 2, 0 .pool @08043AAC: movs r0, 0x58 mov r3, r10 muls r3, r0 adds r0, r3, 0 adds r1, r2, 0 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08043B96 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC80 b @08043B5C .align 2, 0 .pool @08043AD4: movs r0, 0x58 mov r3, r10 muls r3, r0 adds r0, r2, 0 adds r0, 0x4C adds r0, r3, r0 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @08043B96 adds r2, 0x50 adds r2, r3, r2 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC78 bl gf_strcpy movs r0, 0x1 mov r9, r0 b @08043B9C .align 2, 0 .pool @08043B10: movs r0, 0x58 mov r1, r10 muls r1, r0 adds r0, r1, 0 adds r1, r2, 0 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x10 ands r0, r1 cmp r0, 0 beq @08043B96 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC88 bl gf_strcpy movs r2, 0x1 mov r9, r2 b @08043B9C .align 2, 0 .pool @08043B40: movs r0, 0x58 mov r3, r10 muls r3, r0 adds r0, r3, 0 adds r1, r2, 0 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x20 ands r0, r1 cmp r0, 0 beq @08043B96 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC90 @08043B5C: bl gf_strcpy movs r5, 0x1 mov r9, r5 b @08043B9C .align 2, 0 .pool @08043B70: movs r0, 0x58 mov r1, r10 muls r1, r0 adds r0, r1, 0 adds r1, r2, 0 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0xF0 lsls r1, 12 ands r0, r1 cmp r0, 0 beq @08043B96 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BCA0 bl 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 .pool @08043BB4: mov r0, r9 cmp r0, 0x3 beq @08043BE8 b @08043BFC @08043BBC: ldr r1, =0x02024084 movs r0, 0x58 mov r2, r10 muls r2, r0 adds r1, 0x4C adds r2, r1 movs r0, 0 b @08043BFA .align 2, 0 .pool @08043BD0: ldr r1, =0x02024084 movs r0, 0x58 mov r2, r10 muls r2, r0 adds r1, 0x50 adds r2, r1 ldr r0, [r2] movs r1, 0x8 negs r1, r1 b @08043BF8 .align 2, 0 .pool @08043BE8: ldr r1, =0x02024084 movs r0, 0x58 mov r2, r10 muls r2, r0 adds r1, 0x50 adds r2, r1 ldr r0, [r2] ldr r1, =0xfff0ffff @08043BF8: ands r0, r1 @08043BFA: str r0, [r2] @08043BFC: bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB68C str r0, [r1] ldr r0, =0x02024474 mov r1, r10 strb r1, [r0, 0x17] ldr r4, =0x02024064 strb r1, [r4] ldrb r1, [r4] movs r0, 0x58 muls r0, r1 ldr r1, =0x020240d0 adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution bl @0804443A .align 2, 0 .pool @08043C50: mov r0, r10 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r10, r0 bcs @08043C64 b @08043918 @08043C64: bl @0804441E .align 2, 0 .pool @08043C6C: movs r2, 0 mov r10, r2 ldr r0, =0x0202406c ldrb r0, [r0] cmp r10, r0 bcc @08043C7A b @0804441E @08043C7A: ldr r4, =0x02024084 @08043C7C: movs r0, 0x58 mov r3, r10 muls r3, r0 adds r0, r3, 0 adds r0, r4 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x3B bne @08043CA0 mov r0, r10 bl castform_switch lsls r0, 24 lsrs r0, 24 mov r9, r0 cmp r0, 0 beq @08043CA0 b @080442FC @08043CA0: mov r0, r10 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r10, r0 bcc @08043C7C b @0804441E .align 2, 0 .pool @08043CBC: ldrb r0, [r7] cmp r0, 0x1C beq @08043CC4 b @0804441E @08043CC4: ldr r4, =0x02024280 ldr r1, [r4] movs r0, 0x80 lsls r0, 7 ands r0, r1 cmp r0, 0 bne @08043CD4 b @0804441E @08043CD4: ldr r0, =0xffffbfff ands r1, r0 str r1, [r4] mov r5, r8 ldr r1, [r5] adds r1, 0xB2 ldrb r2, [r1] movs r0, 0x3F ands r0, r2 strb r0, [r1] ldr r0, [r5] adds r1, r0, 0 adds r1, 0xB2 ldrb r0, [r1] cmp r0, 0x6 bne @08043CF8 movs r0, 0x2 strb r0, [r1] @08043CF8: ldr r1, =0x02024332 mov r2, r8 ldr r0, [r2] adds r0, 0xB2 ldrb r0, [r0] adds r0, 0x40 strb r0, [r1, 0x3] ldr r1, =0x02024474 ldr r0, =0x0202420c ldrb r0, [r0] strb r0, [r1, 0x17] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB67F str r0, [r1] ldr r0, [r4] movs r1, 0x80 lsls r1, 6 orrs r0, r1 str r0, [r4] b @080443D0 .align 2, 0 .pool @08043D40: ldrb r0, [r7] cmp r0, 0x1C beq @08043D48 b @0804441E @08043D48: ldr r4, =0x02024280 ldr r1, [r4] movs r0, 0x80 lsls r0, 7 ands r0, r1 cmp r0, 0 bne @08043D58 b @0804441E @08043D58: ldr r0, =0xffffbfff ands r1, r0 str r1, [r4] mov r3, r8 ldr r1, [r3] adds r1, 0xB2 ldrb r2, [r1] movs r0, 0x3F ands r0, r2 strb r0, [r1] ldr r0, [r3] adds r1, r0, 0 adds r1, 0xB2 ldrb r0, [r1] cmp r0, 0x6 bne @08043D7C movs r0, 0x2 strb r0, [r1] @08043D7C: ldr r1, =0x02024332 mov r3, r8 ldr r0, [r3] adds r0, 0xB2 ldrb r0, [r0] strb r0, [r1, 0x3] ldr r1, =0x02024474 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r1, 0x17] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB67F str r0, [r1] ldr r0, [r4] movs r1, 0x80 lsls r1, 6 orrs r0, r1 str r0, [r4] b @080443D0 .align 2, 0 .pool @08043DC4: movs r4, 0 ldr r0, =0x0202406c ldrb r1, [r0] cmp r4, r1 blt @08043DD0 b @0804441E @08043DD0: ldr r0, =0x02024084 adds r5, r1, 0 ldr r2, =0x020242ac adds r3, r0, 0 adds r3, 0x20 movs r6, 0x80 lsls r6, 12 @08043DDE: ldrb r1, [r3] cmp r1, 0x16 bne @08043DEE ldr r0, [r2] ands r0, r6 cmp r0, 0 beq @08043DEE b @08044324 @08043DEE: adds r2, 0x4 adds r3, 0x58 adds r4, 0x1 cmp r4, r5 blt @08043DDE b @0804441E .align 2, 0 .pool @08043E08: movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @08043E14 b @0804441E @08043E14: ldr r5, =0x02024064 mov r8, r5 ldr r0, =0x02024084 adds r0, 0x20 str r0, [sp, 0x1C] movs r1, 0 str r1, [sp, 0x20] @08043E22: ldr r2, [sp, 0x1C] ldrb r0, [r2] cmp r0, 0x24 beq @08043E2C b @08043FBE @08043E2C: ldr r0, =0x020242ac ldr r3, [sp, 0x20] adds r0, r3, r0 ldr r1, [r0] movs r0, 0x80 lsls r0, 13 ands r1, r0 str r3, [sp, 0x18] cmp r1, 0 bne @08043E42 b @08043FBE @08043E42: lsls r0, r4, 24 lsrs r0, 24 bl battle_get_per_side_status movs r1, 0x1 adds r5, r0, 0 eors r5, r1 ands r5, r1 adds r0, r5, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 adds r0, r5, 0x2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 ldr r0, =0x02022fec ldr r0, [r0] movs r2, 0x1 ands r0, r2 cmp r0, 0 bne @08043E74 b @08043F84 @08043E74: movs r1, 0x58 adds r0, r6, 0 muls r0, r1 ldr r3, =0x02024084 adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0 beq @08043F40 ldrh r0, [r1, 0x28] cmp r0, 0 beq @08043EFC movs r1, 0x58 adds r0, r7, 0 muls r0, r1 adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0 beq @08043EFC ldrh r0, [r1, 0x28] cmp r0, 0 beq @08043EFC str r2, [sp, 0x24] bl GenerateRandomNumber ldr r2, [sp, 0x24] adds r1, r2, 0 ands r1, r0 lsls r1, 1 orrs r5, r1 adds r0, r5, 0 bl battle_get_side_with_given_state mov r2, r8 strb r0, [r2] ldrb r0, [r2] movs r3, 0x58 muls r0, r3 ldr r5, =0x02024084 adds r0, r5 adds r0, 0x20 ldrb r0, [r0] ldr r1, [sp, 0x1C] strb r0, [r1] ldrb r0, [r2] muls r0, r3 adds r0, r5 adds r0, 0x20 ldrb r0, [r0] ldr r2, =0x0202420a strb r0, [r2] b @08043FAC .align 2, 0 .pool @08043EFC: ldr r3, =0x02024084 movs r2, 0x58 adds r0, r6, 0 muls r0, r2 adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0 beq @08043F40 ldrh r0, [r1, 0x28] cmp r0, 0 beq @08043F40 mov r5, r8 strb r6, [r5] adds r1, r4, 0 muls r1, r2 adds r1, r3 ldrb r0, [r5] muls r0, r2 adds r0, r3 adds r0, 0x20 ldrb r0, [r0] adds r1, 0x20 strb r0, [r1] ldrb r0, [r5] muls r0, r2 adds r0, r3 adds r0, 0x20 ldrb r0, [r0] b @08043FA8 .align 2, 0 .pool @08043F40: ldr r3, =0x02024084 movs r2, 0x58 adds r0, r7, 0 muls r0, r2 adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0 beq @08043FB6 ldrh r0, [r1, 0x28] cmp r0, 0 beq @08043FB6 mov r5, r8 strb r7, [r5] adds r1, r4, 0 muls r1, r2 adds r1, r3 ldrb r0, [r5] muls r0, r2 adds r0, r3 adds r0, 0x20 ldrb r0, [r0] adds r1, 0x20 strb r0, [r1] ldrb r0, [r5] muls r0, r2 adds r0, r3 adds r0, 0x20 ldrb r0, [r0] b @08043FA8 .align 2, 0 .pool @08043F84: mov r2, r8 strb r6, [r2] movs r3, 0x58 adds r0, r6, 0 muls r0, r3 ldr r5, =0x02024084 adds r0, r5 adds r2, r0, 0 adds r2, 0x20 ldrb r1, [r2] cmp r1, 0 beq @08043FB6 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08043FB6 ldr r0, [sp, 0x1C] strb r1, [r0] ldrb r0, [r2] @08043FA8: ldr r1, =0x0202420a strb r0, [r1] @08043FAC: mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @08043FB6: mov r2, r9 cmp r2, 0 beq @08043FBE b @08044340 @08043FBE: ldr r3, [sp, 0x1C] adds r3, 0x58 str r3, [sp, 0x1C] ldr r5, [sp, 0x20] adds r5, 0x4 str r5, [sp, 0x20] adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 bge @08043FD6 b @08043E22 @08043FD6: b @0804441E .align 2, 0 .pool @08043FE4: movs r4, 0 ldr r0, =0x0202406c ldrb r1, [r0] cmp r4, r1 blt @08043FF0 b @0804441E @08043FF0: ldr r0, =0x02024084 adds r5, r1, 0 ldr r2, =0x020242ac adds r3, r0, 0 adds r3, 0x20 movs r6, 0x80 lsls r6, 12 @08043FFE: ldrb r1, [r3] cmp r1, 0x16 bne @0804400E ldr r0, [r2] ands r0, r6 cmp r0, 0 beq @0804400E b @080443B4 @0804400E: adds r2, 0x4 adds r3, 0x58 adds r4, 0x1 cmp r4, r5 blt @08043FFE b @0804441E .align 2, 0 .pool @08044028: mov r0, r10 bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0804403E b @0804441E @0804403E: ldr r7, =0x02024084 @08044040: lsls r0, r4, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 adds r3, r4, 0x1 cmp r0, r5 beq @0804406A movs r0, 0x58 muls r0, r4 adds r0, r7 adds r0, 0x20 ldrb r0, [r0] cmp r0, r6 bne @0804406A ldr r0, =0x0202420a strb r6, [r0] lsls r0, r3, 24 lsrs r0, 24 mov r9, r0 @0804406A: adds r4, r3, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @08044040 b @0804441E .align 2, 0 .pool @08044084: mov r0, r10 bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0804409A b @0804441E @0804409A: ldr r7, =0x02024084 @0804409C: lsls r0, r4, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 adds r3, r4, 0x1 cmp r0, r5 bne @080440C6 movs r0, 0x58 muls r0, r4 adds r0, r7 adds r0, 0x20 ldrb r0, [r0] cmp r0, r6 bne @080440C6 ldr r0, =0x0202420a strb r6, [r0] lsls r0, r3, 24 lsrs r0, 24 mov r9, r0 @080440C6: adds r4, r3, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0804409C b @0804441E .align 2, 0 .pool @080440E0: ldrb r0, [r7] cmp r0, 0xFD beq @08044104 cmp r0, 0xFE beq @0804413C movs r4, 0 ldr r0, =0x0202406c adds r5, r0, 0 ldrb r0, [r5] cmp r4, r0 blt @080440F8 b @0804441E @080440F8: ldr r2, =0x02024084 b @08044174 .align 2, 0 .pool @08044104: movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @08044110 b @0804441E @08044110: ldr r5, =0x020242ac movs r2, 0x80 lsls r2, 9 adds r1, r0, 0 @08044118: lsls r0, r4, 2 adds r0, r5 ldr r0, [r0] ands r0, r2 adds r3, r4, 0x1 cmp r0, 0 beq @0804412C lsls r0, r3, 24 lsrs r0, 24 mov r9, r0 @0804412C: adds r4, r3, 0 cmp r4, r1 blt @08044118 b @0804441E .align 2, 0 .pool @0804413C: movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @08044148 b @0804441E @08044148: ldr r5, =0x020242ac movs r2, 0x80 lsls r2, 10 adds r1, r0, 0 @08044150: lsls r0, r4, 2 adds r0, r5 ldr r0, [r0] ands r0, r2 adds r3, r4, 0x1 cmp r0, 0 beq @08044164 lsls r0, r3, 24 lsrs r0, 24 mov r9, r0 @08044164: adds r4, r3, 0 cmp r4, r1 blt @08044150 b @0804441E .align 2, 0 .pool @08044174: movs r0, 0x58 muls r0, r4 adds r0, r2 adds r0, 0x20 ldrb r0, [r0] adds r3, r4, 0x1 cmp r0, r6 bne @0804418C strb r6, [r7] lsls r0, r3, 24 lsrs r0, 24 mov r9, r0 @0804418C: adds r4, r3, 0 ldrb r1, [r5] cmp r4, r1 blt @08044174 b @0804441E @08044196: movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @080441A2 b @0804441E @080441A2: ldr r2, =0x02024084 mov r8, r2 adds r2, r0, 0 movs r5, 0x58 @080441AA: adds r0, r4, 0 muls r0, r5 mov r3, r8 adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] adds r3, r4, 0x1 cmp r0, r6 bne @080441CC ldrh r0, [r1, 0x28] cmp r0, 0 beq @080441CC strb r6, [r7] lsls r0, r3, 24 lsrs r0, 24 mov r9, r0 @080441CC: adds r4, r3, 0 cmp r4, r2 blt @080441AA b @0804441E .align 2, 0 .pool @080441DC: movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @080441E8 b @0804441E @080441E8: ldr r7, =0x02024084 adds r1, r0, 0 movs r5, 0x58 ldr r2, =0x0202420a @080441F0: adds r0, r4, 0 muls r0, r5 adds r0, r7 adds r0, 0x20 ldrb r0, [r0] adds r3, r4, 0x1 cmp r0, r6 bne @0804420C cmp r4, r10 beq @0804420C strb r6, [r2] lsls r0, r3, 24 lsrs r0, 24 mov r9, r0 @0804420C: adds r4, r3, 0 cmp r4, r1 blt @080441F0 b @0804441E .align 2, 0 .pool @08044220: mov r0, r10 bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @08044236 b @0804441E @08044236: ldr r7, =0x02024084 @08044238: lsls r0, r4, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, r5 beq @08044264 movs r0, 0x58 muls r0, r4 adds r0, r7 adds r0, 0x20 ldrb r0, [r0] cmp r0, r6 bne @08044264 ldr r0, =0x0202420a strb r6, [r0] mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @08044264: adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @08044238 b @0804441E .align 2, 0 .pool @0804427C: mov r0, r10 bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @08044292 b @0804441E @08044292: ldr r7, =0x02024084 @08044294: lsls r0, r4, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, r5 bne @080442C0 movs r0, 0x58 muls r0, r4 adds r0, r7 adds r0, 0x20 ldrb r0, [r0] cmp r0, r6 bne @080442C0 ldr r0, =0x0202420a strb r6, [r0] mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @080442C0: adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @08044294 b @0804441E .align 2, 0 .pool @080442D8: ldr r0, =gUnknown_082DB4A9 bl b_push_move_exec ldr r0, =0x02024474 strb r6, [r0, 0x17] @080442E2: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x7F mov r1, r9 subs r1, 0x1 strb r1, [r0] b @0804441E .align 2, 0 .pool @080442FC: ldr r0, =gUnknown_082DB4A9 bl b_push_move_exec ldr r0, =0x02024474 mov r5, r10 strb r5, [r0, 0x17] ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x7F mov r1, r9 subs r1, 0x1 strb r1, [r0] b @0804443A .align 2, 0 .pool @08044324: strb r1, [r7] ldr r0, [r2] ldr r1, =0xfff7ffff ands r0, r1 str r0, [r2] ldr r0, =gUnknown_082DB4B8 bl b_push_move_exec b @080443C8 .align 2, 0 .pool @08044340: ldr r0, =gUnknown_082DB452 bl b_push_move_exec ldr r1, =0x020242ac ldr r0, [sp, 0x18] adds r1, r0, r1 ldr r0, [r1] ldr r2, =0xffefffff ands r0, r2 str r0, [r1] ldr r0, =0x02024474 strb r4, [r0, 0x17] ldr r1, =0x02022f58 movs r4, 0xFD strb r4, [r1] movs r0, 0x4 strb r0, [r1, 0x1] ldr r2, =0x02024064 ldrb r0, [r2] strb r0, [r1, 0x2] ldr r3, =0x0202406e ldrb r0, [r2] lsls r0, 1 adds r0, r3 ldrh r0, [r0] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02022f68 strb r4, [r1] movs r0, 0x9 strb r0, [r1, 0x1] ldr r0, =0x0202420a ldrb r0, [r0] strb r0, [r1, 0x2] movs r0, 0x1 negs r0, r0 strb r0, [r1, 0x3] b @0804441E .align 2, 0 .pool @080443B4: strb r1, [r7] ldr r0, [r2] ldr r1, =0xfff7ffff ands r0, r1 str r0, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB4C1 str r0, [r1] @080443C8: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0xD8 strb r4, [r0] @080443D0: mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 b @0804441E .align 2, 0 .pool @080443EC: movs r4, 0 ldr r0, =0x0202406c ldrb r1, [r0] cmp r4, r1 bge @0804441E ldr r0, =0x02024084 adds r2, r1, 0 adds r1, r0, 0 adds r1, 0x20 ldr r3, =0x0202420a @08044400: ldrb r0, [r1] cmp r0, r6 bne @08044416 cmp r4, r10 beq @08044416 strb r6, [r3] mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @08044416: adds r1, 0x58 adds r4, 0x1 cmp r4, r2 blt @08044400 @0804441E: mov r1, r9 cmp r1, 0 beq @0804443A @08044424: ldr r2, [sp, 0x4] cmp r2, 0xB bhi @0804443A ldr r1, =0x0202420a ldrb r0, [r1] cmp r0, 0xFF beq @0804443A adds r1, r0, 0 mov r0, r10 bl b_history__record_ability_usage_of_player @0804443A: mov r0, r9 add sp, 0x28 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end ability_something thumb_func_start b_call_bc_move_exec b_call_bc_move_exec: ; 8044458 ldr r1, =0x02024214 str r0, [r1] ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0xC] adds r3, r2, 0 adds r3, 0x20 ldrb r0, [r3] adds r1, r0, 0x1 strb r1, [r3] lsls r0, 24 lsrs r0, 22 adds r2, r0 ldr r1, =0x03005d04 ldr r0, [r1] str r0, [r2] ldr r0, =bc_move_exec_returning str r0, [r1] ldr r1, =0x02024083 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end b_call_bc_move_exec thumb_func_start b_push_move_exec b_push_move_exec: ; 8044498 push {r4,lr} adds r4, r0, 0 bl b_movescr_stack_push_cursor ldr r0, =0x02024214 str r4, [r0] ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0xC] adds r3, r2, 0 adds r3, 0x20 ldrb r0, [r3] adds r1, r0, 0x1 strb r1, [r3] lsls r0, 24 lsrs r0, 22 adds r2, r0 ldr r1, =0x03005d04 ldr r0, [r1] str r0, [r2] ldr r0, =sub_803E08C str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end b_push_move_exec thumb_func_start berry_effects_maybe berry_effects_maybe: ; 80444DC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x2C lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x8] lsls r1, 24 lsrs r7, r1, 24 lsls r2, 24 lsrs r6, r2, 24 movs r0, 0 mov r10, r0 movs r1, 0 str r1, [sp, 0xC] add r0, sp, 0x4 strb r1, [r0] ldr r4, =0x02024208 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r0, r1 ldrh r0, [r0, 0x2E] strh r0, [r4] lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne @08044534 ldr r1, =0x02024404 lsls r0, r7, 3 subs r0, r7 lsls r0, 2 adds r0, r1 ldrb r5, [r0, 0x7] ldrb r0, [r0, 0x1A] b @08044548 .align 2, 0 .pool @08044534: ldrh r0, [r4] bl itemid_get_x12 lsls r0, 24 lsrs r5, r0, 24 ldrh r0, [r4] bl itemid_get_quality lsls r0, 24 lsrs r0, 24 @08044548: mov r9, r0 ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x2E] str r0, [sp, 0x14] cmp r0, 0xAF bne @0804457C ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r3, [r0, 0x7] mov r8, r3 ldrb r0, [r0, 0x1A] b @08044592 .align 2, 0 .pool @0804457C: ldr r0, [sp, 0x14] bl itemid_get_x12 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r0, [sp, 0x14] bl itemid_get_quality lsls r0, 24 lsrs r0, 24 @08044592: str r0, [sp, 0x10] ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r4, [r0, 0x2E] cmp r4, 0xAF beq @080445B2 adds r0, r4, 0 bl itemid_get_x12 adds r0, r4, 0 bl itemid_get_quality @080445B2: ldr r0, [sp, 0x8] cmp r0, 0x4 bls @080445BC bl @0804582A @080445BC: lsls r0, 2 ldr r1, =@080445D4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080445D4: .4byte @080445E8 .4byte @08044688 .4byte @0804582A .4byte @08045280 .4byte @080456D0 @080445E8: cmp r5, 0x17 beq @08044618 cmp r5, 0x20 beq @080445F4 bl @0804582A @080445F4: adds r0, r7, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08044604 bl @0804582A @08044604: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x4A movs r1, 0x2 strb r1, [r0] bl @0804582A .align 2, 0 .pool @08044618: ldr r1, =0x02024084 mov r8, r1 movs r0, 0x58 adds r1, r7, 0 muls r1, r0 mov r0, r8 adds r0, 0x18 adds r1, r0 movs r2, 0x6 movs r3, 0x7 mov r10, r3 @0804462E: movs r0, 0 ldrsb r0, [r1, r0] cmp r0, 0x5 bgt @0804463C strb r2, [r1] movs r5, 0x5 str r5, [sp, 0xC] @0804463C: adds r1, 0x1 movs r0, 0x1 negs r0, r0 add r10, r0 mov r3, r10 cmp r3, 0 bge @0804462E ldr r5, [sp, 0xC] cmp r5, 0 bne @08044654 bl @0804582A @08044654: ldr r0, =0x02024474 strb r7, [r0, 0x17] ldr r0, =0x0202420f strb r7, [r0] ldr r1, =0x02024064 ldr r0, =0x0202420b strb r7, [r0] strb r7, [r1] ldr r0, =gUnknown_082DB7AE bl b_call_bc_move_exec bl @0804582A .align 2, 0 .pool @08044688: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r0, r1 ldrh r0, [r0, 0x28] mov r8, r1 cmp r0, 0 bne @0804469C bl @0804582A @0804469C: subs r0, r5, 0x1 cmp r0, 0x2A bls @080446A6 bl @080451D6 @080446A6: lsls r0, 2 ldr r1, =@080446B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080446B8: .4byte @08044764 .4byte @08044F44 .4byte @08045008 .4byte @08044F74 .4byte @08044FA8 .4byte @08044FD8 .4byte @080447B0 .4byte @08045044 .4byte @08045074 .4byte @0804497C .4byte @080449FC .4byte @08044A78 .4byte @08044B0C .4byte @08044BA0 .4byte @08044C34 .4byte @08044C9C .4byte @08044CF0 .4byte @08044D44 .4byte @08044DAC .4byte @08044E10 .4byte @08044E5C .4byte @080451D6 .4byte @080448B0 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451A0 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @080451D6 .4byte @0804491C @08044764: movs r0, 0x58 muls r0, r7 mov r1, r8 adds r2, r0, r1 ldrh r0, [r2, 0x2C] ldrh r1, [r2, 0x28] lsrs r0, 1 cmp r1, r0 bls @0804477A bl @080451D6 @0804477A: cmp r6, 0 beq @08044782 bl @080451D6 @08044782: ldr r4, =0x020241f0 mov r3, r9 str r3, [r4] ldrh r3, [r2, 0x28] mov r5, r9 adds r0, r3, r5 ldrh r1, [r2, 0x2C] cmp r0, r1 ble @08044798 subs r0, r1, r3 str r0, [r4] @08044798: ldr r0, [r4] negs r0, r0 str r0, [r4] ldr r0, =gUnknown_082DB7C4 bl b_call_bc_move_exec b @08044B02 .align 2, 0 .pool @080447B0: cmp r6, 0 beq @080447B8 bl @080451D6 @080447B8: adds r0, r7, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080447DC ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec b @080447EA .align 2, 0 .pool @080447DC: ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 @080447EA: adds r4, r1, r0 movs r1, 0 mov r10, r1 add r5, sp, 0x4 @080447F2: mov r1, r10 adds r1, 0xD adds r0, r4, 0 bl pokemon_getattr lsls r0, 16 lsrs r6, r0, 16 mov r1, r10 adds r1, 0x11 adds r0, r4, 0 bl pokemon_getattr strb r0, [r5] adds r0, r4, 0 movs r1, 0x15 bl pokemon_getattr lsls r0, 24 lsrs r1, r0, 24 cmp r6, 0 beq @08044822 ldrb r0, [r5] cmp r0, 0 beq @0804482C @08044822: movs r2, 0x1 add r10, r2 mov r3, r10 cmp r3, 0x3 ble @080447F2 @0804482C: mov r5, r10 cmp r5, 0x4 bne @08044836 bl @080451D6 @08044836: lsls r2, r5, 24 lsrs r2, 24 adds r0, r6, 0 bl 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 .pool @08044860: add r0, sp, 0x4 strb r1, [r0] @08044864: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] strb r6, [r1, 0x2] lsrs r0, r6, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r0, =gUnknown_082DB7E1 bl b_call_bc_move_exec mov r1, r10 adds r1, 0x9 lsls r1, 24 lsrs r1, 24 add r5, sp, 0x4 str r5, [sp] movs r0, 0 movs r2, 0 movs r3, 0x1 bl dp01_build_cmdbuf_x02_a_b_varargs ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution movs r0, 0x3 str r0, [sp, 0xC] bl @080451DE .align 2, 0 .pool @080448B0: ldr r0, =0x02024084 movs r1, 0x58 muls r1, r7 adds r0, 0x18 adds r1, r0 movs r2, 0x6 movs r3, 0x7 mov r10, r3 @080448C0: movs r0, 0 ldrsb r0, [r1, r0] cmp r0, 0x5 bgt @080448CE strb r2, [r1] movs r5, 0x5 str r5, [sp, 0xC] @080448CE: adds r1, 0x1 movs r0, 0x1 negs r0, r0 add r10, r0 mov r3, r10 cmp r3, 0 bge @080448C0 movs r5, 0x8 mov r10, r5 ldr r0, [sp, 0xC] cmp r0, 0 bne @080448EA bl @0804582A @080448EA: ldr r0, =0x02024474 strb r7, [r0, 0x17] ldr r0, =0x0202420f strb r7, [r0] ldr r1, =0x02024064 ldr r0, =0x0202420b strb r7, [r0] strb r7, [r1] ldr r0, =gUnknown_082DB7AE bl b_call_bc_move_exec bl @080451D6 .align 2, 0 .pool @0804491C: movs r0, 0x58 muls r0, r7 mov r2, r8 adds r1, r0, r2 ldrh r0, [r1, 0x28] ldrh r3, [r1, 0x2C] cmp r0, r3 bcc @08044930 bl @080451D6 @08044930: cmp r6, 0 beq @08044938 bl @080451D6 @08044938: ldr r3, =0x020241f0 ldrh r0, [r1, 0x2C] lsrs r0, 4 str r0, [r3] cmp r0, 0 bne @08044948 movs r0, 0x1 str r0, [r3] @08044948: ldrh r2, [r1, 0x28] ldr r0, [r3] adds r0, r2, r0 ldrh r1, [r1, 0x2C] cmp r0, r1 ble @08044958 subs r0, r1, r2 str r0, [r3] @08044958: ldr r0, [r3] negs r0, r0 str r0, [r3] ldr r0, =gUnknown_082DB7F1 bl b_call_bc_move_exec movs r0, 0x4 str r0, [sp, 0xC] adds r0, r7, 0 adds r1, r5, 0 bl b_history__record_item_x12_of_player bl @080451D6 .align 2, 0 .pool @0804497C: movs r0, 0x58 adds r1, r7, 0 muls r1, r0 str r1, [sp, 0x18] adds r4, r1, 0 add r4, r8 ldrh r0, [r4, 0x2C] ldrh r1, [r4, 0x28] lsrs r0, 1 cmp r1, r0 bls @08044996 bl @080451D6 @08044996: cmp r6, 0 beq @0804499E bl @080451D6 @0804499E: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x8 strb r0, [r1, 0x1] strb r6, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r5, =0x020241f0 ldrh r0, [r4, 0x2C] mov r1, r9 bl __divsi3 str r0, [r5] cmp r0, 0 bne @080449C2 movs r0, 0x1 str r0, [r5] @080449C2: ldrh r2, [r4, 0x28] ldr r0, [r5] adds r0, r2, r0 ldrh r1, [r4, 0x2C] cmp r0, r1 ble @080449D2 subs r0, r1, r2 str r0, [r5] @080449D2: ldr r0, [r5] negs r0, r0 str r0, [r5] mov r0, r8 adds r0, 0x48 ldr r2, [sp, 0x18] adds r0, r2, r0 ldr r0, [r0] movs r1, 0 bl sub_806E880 lsls r0, 24 cmp r0, 0 bge @080449F0 b @08044B7C @080449F0: b @08044B90 .align 2, 0 .pool @080449FC: movs r0, 0x58 adds r5, r7, 0 muls r5, r0 str r5, [sp, 0x1C] add r5, r8 ldrh r0, [r5, 0x2C] ldrh r1, [r5, 0x28] lsrs r0, 1 cmp r1, r0 bls @08044A14 bl @080451D6 @08044A14: cmp r6, 0 beq @08044A1C bl @080451D6 @08044A1C: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x8 strb r0, [r1, 0x1] movs r6, 0x1 strb r6, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r4, =0x020241f0 ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 str r0, [r4] cmp r0, 0 bne @08044A40 str r6, [r4] @08044A40: ldrh r2, [r5, 0x28] ldr r0, [r4] adds r0, r2, r0 ldrh r1, [r5, 0x2C] cmp r0, r1 ble @08044A50 subs r0, r1, r2 str r0, [r4] @08044A50: ldr r0, [r4] negs r0, r0 str r0, [r4] mov r0, r8 adds r0, 0x48 ldr r1, [sp, 0x1C] adds r0, r1, r0 ldr r0, [r0] movs r1, 0x1 bl sub_806E880 lsls r0, 24 cmp r0, 0 bge @08044A6E b @08044C0E @08044A6E: b @08044C24 .align 2, 0 .pool @08044A78: movs r0, 0x58 adds r3, r7, 0 muls r3, r0 str r3, [sp, 0x20] adds r5, r3, 0 add r5, r8 ldrh r0, [r5, 0x2C] ldrh r1, [r5, 0x28] lsrs r0, 1 cmp r1, r0 bls @08044A90 b @080451D6 @08044A90: cmp r6, 0 beq @08044A96 b @080451D6 @08044A96: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x8 strb r0, [r1, 0x1] movs r0, 0x2 strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r4, =0x020241f0 ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 str r0, [r4] cmp r0, 0 bne @08044ABC movs r0, 0x1 str r0, [r4] @08044ABC: ldrh r2, [r5, 0x28] ldr r0, [r4] adds r0, r2, r0 ldrh r1, [r5, 0x2C] cmp r0, r1 ble @08044ACC subs r0, r1, r2 str r0, [r4] @08044ACC: ldr r0, [r4] negs r0, r0 str r0, [r4] mov r0, r8 adds r0, 0x48 ldr r5, [sp, 0x20] adds r0, r5, r0 ldr r0, [r0] movs r1, 0x2 bl sub_806E880 lsls r0, 24 cmp r0, 0 bge @08044AFC ldr r0, =gUnknown_082DB824 bl b_call_bc_move_exec b @08044B02 .align 2, 0 .pool @08044AFC: ldr r0, =gUnknown_082DB7C4 bl b_call_bc_move_exec @08044B02: movs r0, 0x4 str r0, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044B0C: movs r0, 0x58 adds r1, r7, 0 muls r1, r0 str r1, [sp, 0x24] adds r5, r1, 0 add r5, r8 ldrh r0, [r5, 0x2C] ldrh r1, [r5, 0x28] lsrs r0, 1 cmp r1, r0 bls @08044B24 b @080451D6 @08044B24: cmp r6, 0 beq @08044B2A b @080451D6 @08044B2A: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x8 strb r0, [r1, 0x1] movs r0, 0x3 strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r4, =0x020241f0 ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 str r0, [r4] cmp r0, 0 bne @08044B50 movs r0, 0x1 str r0, [r4] @08044B50: ldrh r2, [r5, 0x28] ldr r0, [r4] adds r0, r2, r0 ldrh r1, [r5, 0x2C] cmp r0, r1 ble @08044B60 subs r0, r1, r2 str r0, [r4] @08044B60: ldr r0, [r4] negs r0, r0 str r0, [r4] mov r0, r8 adds r0, 0x48 ldr r2, [sp, 0x24] adds r0, r2, r0 ldr r0, [r0] movs r1, 0x3 bl sub_806E880 lsls r0, 24 cmp r0, 0 bge @08044B90 @08044B7C: ldr r0, =gUnknown_082DB824 bl b_call_bc_move_exec b @08044B96 .align 2, 0 .pool @08044B90: ldr r0, =gUnknown_082DB7C4 bl b_call_bc_move_exec @08044B96: movs r3, 0x4 str r3, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044BA0: movs r0, 0x58 adds r5, r7, 0 muls r5, r0 str r5, [sp, 0x28] add r5, r8 ldrh r0, [r5, 0x2C] ldrh r1, [r5, 0x28] lsrs r0, 1 cmp r1, r0 bls @08044BB6 b @080451D6 @08044BB6: cmp r6, 0 beq @08044BBC b @080451D6 @08044BBC: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x8 strb r0, [r1, 0x1] movs r0, 0x4 strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r4, =0x020241f0 ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 str r0, [r4] cmp r0, 0 bne @08044BE2 movs r0, 0x1 str r0, [r4] @08044BE2: ldrh r2, [r5, 0x28] ldr r0, [r4] adds r0, r2, r0 ldrh r1, [r5, 0x2C] cmp r0, r1 ble @08044BF2 subs r0, r1, r2 str r0, [r4] @08044BF2: ldr r0, [r4] negs r0, r0 str r0, [r4] mov r0, r8 adds r0, 0x48 ldr r1, [sp, 0x28] adds r0, r1, r0 ldr r0, [r0] movs r1, 0x4 bl sub_806E880 lsls r0, 24 cmp r0, 0 bge @08044C24 @08044C0E: ldr r0, =gUnknown_082DB824 bl b_call_bc_move_exec b @08044C2A .align 2, 0 .pool @08044C24: ldr r0, =gUnknown_082DB7C4 bl b_call_bc_move_exec @08044C2A: movs r2, 0x4 str r2, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044C34: movs r0, 0x58 muls r0, r7 mov r3, r8 adds r5, r0, r3 ldrh r4, [r5, 0x28] ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 cmp r4, r0 ble @08044C4C b @080451D6 @08044C4C: cmp r6, 0 beq @08044C52 b @080451D6 @08044C52: movs r0, 0x19 ldrsb r0, [r5, r0] cmp r0, 0xB ble @08044C5C b @080451D6 @08044C5C: ldr r1, =0x02022f58 movs r2, 0xFD strb r2, [r1] movs r0, 0x5 strb r0, [r1, 0x1] movs r0, 0x1 strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r1, =0x02022f68 strb r2, [r1] strb r6, [r1, 0x1] movs r0, 0xD2 strb r0, [r1, 0x2] strb r6, [r1, 0x3] subs r0, 0xD3 strb r0, [r1, 0x4] ldr r0, =0x0202420e strb r7, [r0] ldr r1, =0x02024474 movs r0, 0x11 strb r0, [r1, 0x1A] movs r0, 0xF b @08044DF0 .align 2, 0 .pool @08044C9C: movs r0, 0x58 muls r0, r7 mov r1, r8 adds r5, r0, r1 ldrh r4, [r5, 0x28] ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 cmp r4, r0 ble @08044CB4 b @080451D6 @08044CB4: cmp r6, 0 beq @08044CBA b @080451D6 @08044CBA: movs r0, 0x1A ldrsb r0, [r5, r0] cmp r0, 0xB ble @08044CC4 b @080451D6 @08044CC4: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x5 strb r0, [r1, 0x1] movs r0, 0x2 strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r0, =0x0202420e strb r7, [r0] ldr r1, =0x02024474 movs r0, 0x12 strb r0, [r1, 0x1A] movs r0, 0x10 b @08044D8A .align 2, 0 .pool @08044CF0: movs r0, 0x58 muls r0, r7 mov r3, r8 adds r5, r0, r3 ldrh r4, [r5, 0x28] ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 cmp r4, r0 ble @08044D08 b @080451D6 @08044D08: cmp r6, 0 beq @08044D0E b @080451D6 @08044D0E: movs r0, 0x1B ldrsb r0, [r5, r0] cmp r0, 0xB ble @08044D18 b @080451D6 @08044D18: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x5 strb r0, [r1, 0x1] movs r0, 0x3 strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r0, =0x0202420e strb r7, [r0] ldr r1, =0x02024474 movs r0, 0x13 strb r0, [r1, 0x1A] movs r0, 0x11 b @08044DF0 .align 2, 0 .pool @08044D44: movs r0, 0x58 muls r0, r7 mov r1, r8 adds r5, r0, r1 ldrh r4, [r5, 0x28] ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 cmp r4, r0 ble @08044D5C b @080451D6 @08044D5C: cmp r6, 0 beq @08044D62 b @080451D6 @08044D62: movs r0, 0x1C ldrsb r0, [r5, r0] cmp r0, 0xB ble @08044D6C b @080451D6 @08044D6C: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x5 strb r0, [r1, 0x1] movs r0, 0x4 strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r0, =0x0202420e strb r7, [r0] ldr r1, =0x02024474 movs r0, 0x14 strb r0, [r1, 0x1A] movs r0, 0x12 @08044D8A: strb r0, [r1, 0x10] strb r6, [r1, 0x11] ldr r0, =gUnknown_082DB84E bl b_call_bc_move_exec movs r2, 0x5 str r2, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044DAC: movs r0, 0x58 muls r0, r7 mov r3, r8 adds r5, r0, r3 ldrh r4, [r5, 0x28] ldrh r0, [r5, 0x2C] mov r1, r9 bl __divsi3 cmp r4, r0 ble @08044DC4 b @080451D6 @08044DC4: cmp r6, 0 beq @08044DCA b @080451D6 @08044DCA: movs r0, 0x1D ldrsb r0, [r5, r0] cmp r0, 0xB ble @08044DD4 b @080451D6 @08044DD4: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x5 strb r0, [r1, 0x1] strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r0, =0x0202420e strb r7, [r0] ldr r1, =0x02024474 movs r0, 0x15 strb r0, [r1, 0x1A] movs r0, 0x13 @08044DF0: strb r0, [r1, 0x10] strb r6, [r1, 0x11] ldr r0, =gUnknown_082DB84E bl b_call_bc_move_exec movs r5, 0x5 str r5, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044E10: movs r0, 0x58 adds r5, r7, 0 muls r5, r0 mov r1, r8 adds r0, r5, r1 ldrh r4, [r0, 0x28] ldrh r0, [r0, 0x2C] mov r1, r9 bl __divsi3 cmp r4, r0 ble @08044E2A b @080451D6 @08044E2A: cmp r6, 0 beq @08044E30 b @080451D6 @08044E30: mov r0, r8 adds r0, 0x50 adds r1, r5, r0 ldr r2, [r1] movs r3, 0x80 lsls r3, 13 adds r0, r2, 0 ands r0, r3 cmp r0, 0 beq @08044E46 b @080451D6 @08044E46: orrs r2, r3 str r2, [r1] ldr r0, =gUnknown_082DB869 bl b_call_bc_move_exec movs r2, 0x2 str r2, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044E5C: cmp r6, 0 beq @08044E62 b @080451D6 @08044E62: movs r0, 0x58 adds r5, r7, 0 muls r5, r0 mov r3, r8 adds r0, r5, r3 ldrh r4, [r0, 0x28] ldrh r0, [r0, 0x2C] mov r1, r9 bl __divsi3 cmp r4, r0 ble @08044E7C b @080451D6 @08044E7C: movs r0, 0 mov r10, r0 adds r0, r5, 0x1 mov r1, r8 adds r1, 0x18 adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0xB ble @08044EAC mov r0, r8 adds r0, 0x19 adds r1, r5, r0 @08044E98: adds r1, 0x1 movs r2, 0x1 add r10, r2 mov r3, r10 cmp r3, 0x4 bgt @08044EAC movs r0, 0 ldrsb r0, [r1, r0] cmp r0, 0xB bgt @08044E98 @08044EAC: mov r5, r10 cmp r5, 0x5 bne @08044EB4 b @080451D6 @08044EB4: movs r0, 0x58 muls r0, r7 adds r4, r0, 0x1 ldr r5, =0x0202409c @08044EBC: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x5 bl __umodsi3 lsls r0, 16 lsrs r0, 16 mov r10, r0 adds r0, r4 adds r0, r5 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0xC beq @08044EBC ldr r1, =0x02022f58 movs r2, 0 movs r3, 0xFD strb r3, [r1] movs r0, 0x5 strb r0, [r1, 0x1] mov r0, r10 adds r0, 0x1 strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r0, =0x02022f68 strb r3, [r0] strb r2, [r0, 0x1] movs r1, 0xD1 strb r1, [r0, 0x2] strb r2, [r0, 0x3] strb r2, [r0, 0x4] movs r1, 0xD2 strb r1, [r0, 0x5] strb r2, [r0, 0x6] subs r1, 0xD3 strb r1, [r0, 0x7] ldr r0, =0x0202420e strb r7, [r0] ldr r1, =0x02024474 mov r0, r10 adds r0, 0x21 strb r0, [r1, 0x1A] adds r0, 0x6 strb r0, [r1, 0x10] strb r2, [r1, 0x11] ldr r0, =gUnknown_082DB84E bl b_call_bc_move_exec movs r0, 0x5 str r0, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044F44: movs r0, 0x58 adds r1, r7, 0 muls r1, r0 mov r0, r8 adds r0, 0x4C adds r1, r0 ldr r2, [r1] movs r0, 0x40 ands r0, r2 cmp r0, 0 bne @08044F5C b @080451D6 @08044F5C: movs r0, 0x41 negs r0, r0 ands r2, r0 str r2, [r1] ldr r0, =gUnknown_082DB706 bl b_call_bc_move_exec movs r1, 0x1 str r1, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044F74: movs r0, 0x58 adds r1, r7, 0 muls r1, r0 mov r0, r8 adds r0, 0x4C adds r1, r0 ldr r2, [r1] movs r0, 0x88 ands r0, r2 cmp r0, 0 bne @08044F8C b @080451D6 @08044F8C: ldr r0, =0xfffff077 ands r2, r0 str r2, [r1] ldr r0, =gUnknown_082DB71E bl b_call_bc_move_exec movs r2, 0x1 str r2, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044FA8: movs r0, 0x58 adds r1, r7, 0 muls r1, r0 mov r0, r8 adds r0, 0x4C adds r1, r0 ldr r2, [r1] movs r0, 0x10 ands r0, r2 cmp r0, 0 bne @08044FC0 b @080451D6 @08044FC0: movs r0, 0x11 negs r0, r0 ands r2, r0 str r2, [r1] ldr r0, =gUnknown_082DB736 bl b_call_bc_move_exec movs r3, 0x1 str r3, [sp, 0xC] b @080451DE .align 2, 0 .pool @08044FD8: movs r0, 0x58 adds r1, r7, 0 muls r1, r0 mov r0, r8 adds r0, 0x4C adds r1, r0 ldr r2, [r1] movs r0, 0x20 ands r0, r2 cmp r0, 0 bne @08044FF0 b @080451D6 @08044FF0: movs r0, 0x21 negs r0, r0 ands r2, r0 str r2, [r1] ldr r0, =gUnknown_082DB74E bl b_call_bc_move_exec movs r5, 0x1 str r5, [sp, 0xC] b @080451DE .align 2, 0 .pool @08045008: movs r0, 0x58 adds r3, r7, 0 muls r3, r0 mov r0, r8 adds r0, 0x4C adds r2, r3, r0 ldr r1, [r2] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @08045020 b @080451D6 @08045020: movs r0, 0x8 negs r0, r0 ands r1, r0 str r1, [r2] mov r1, r8 adds r1, 0x50 adds r1, r3, r1 ldr r0, [r1] ldr r2, =0xf7ffffff ands r0, r2 str r0, [r1] ldr r0, =gUnknown_082DB766 b @0804518A .align 2, 0 .pool @08045044: movs r0, 0x58 adds r1, r7, 0 muls r1, r0 mov r0, r8 adds r0, 0x50 adds r1, r0 ldr r2, [r1] movs r0, 0x7 ands r0, r2 cmp r0, 0 bne @0804505C b @080451D6 @0804505C: movs r0, 0x8 negs r0, r0 ands r2, r0 str r2, [r1] ldr r0, =gUnknown_082DB77E bl b_call_bc_move_exec movs r1, 0x2 str r1, [sp, 0xC] b @080451DE .align 2, 0 .pool @08045074: movs r0, 0x58 adds r5, r7, 0 muls r5, r0 mov r0, r8 adds r0, 0x4C adds r4, r5, r0 ldr r2, [r4] ldrb r0, [r4] cmp r0, 0 bne @0804509A mov r0, r8 adds r0, 0x50 adds r0, r5, r0 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 bne @0804509A b @080451D6 @0804509A: movs r3, 0 mov r10, r3 movs r0, 0x88 ands r2, r0 cmp r2, 0 beq @080450B2 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC70 bl 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, =0xf7ffffff ands r0, r1 str r0, [r2] ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC78 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, =0x02022f58 ldr r1, =gUnknown_0831BC80 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, =0x02022f58 ldr r1, =gUnknown_0831BC88 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, =0x02022f58 ldr r1, =gUnknown_0831BC90 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, =0x02022f58 ldr r1, =gUnknown_0831BC98 bl gf_strcpy movs r3, 0x1 add r10, r3 @08045132: mov r5, r10 cmp r5, 0x1 bgt @08045164 ldr r1, =0x02024332 movs r0, 0 b @08045168 .align 2, 0 .pool @08045164: ldr r1, =0x02024332 movs r0, 0x1 @08045168: strb r0, [r1, 0x5] ldr r2, =0x02024084 movs r0, 0x58 adds r3, r7, 0 muls r3, r0 adds r0, r2, 0 adds r0, 0x4C adds r0, r3, r0 movs r1, 0 str r1, [r0] adds r2, 0x50 adds r3, r2 ldr r0, [r3] subs r1, 0x8 ands r0, r1 str r0, [r3] ldr r0, =gUnknown_082DB794 @0804518A: bl b_call_bc_move_exec movs r0, 0x1 str r0, [sp, 0xC] b @080451DE .align 2, 0 .pool @080451A0: movs r0, 0x58 adds r1, r7, 0 muls r1, r0 mov r0, r8 adds r0, 0x50 adds r1, r0 ldr r2, [r1] movs r0, 0xF0 lsls r0, 12 ands r0, r2 cmp r0, 0 beq @080451D6 ldr r0, =0xfff0ffff ands r2, r0 str r2, [r1] ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BCA0 bl gf_strcpy ldr r0, =gUnknown_082DB794 bl b_call_bc_move_exec ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x5] movs r1, 0x2 str r1, [sp, 0xC] @080451D6: ldr r2, [sp, 0xC] cmp r2, 0 bne @080451DE b @0804582A @080451DE: ldr r0, =0x02024474 strb r7, [r0, 0x17] ldr r0, =0x0202420f strb r7, [r0] ldr r4, =0x02024064 ldr r0, =0x0202420b strb r7, [r0] strb r7, [r4] ldr r3, [sp, 0xC] cmp r3, 0x1 beq @08045220 cmp r3, 0x3 beq @08045226 b @0804582A .align 2, 0 .pool @08045220: movs r0, 0x58 muls r0, r7 b @0804568C @08045226: ldr r4, =0x02024084 movs r0, 0x58 adds r3, r7, 0 muls r3, r0 adds r0, r4, 0 adds r0, 0x50 adds r0, r3, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 beq @08045242 b @0804582A @08045242: ldr r1, =0x020242bc lsls r0, r7, 3 subs r0, r7 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 mov r5, r10 lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08045262 b @0804582A @08045262: adds r1, r5, r3 adds r0, r4, 0 adds r0, 0x24 adds r1, r0 add r0, sp, 0x4 ldrb r0, [r0] strb r0, [r1] b @0804582A .align 2, 0 .pool @08045280: movs r7, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r7, r0 bcc @0804528C b @0804582A @0804528C: ldr r4, =0x02024208 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r0, r1 ldrh r0, [r0, 0x2E] strh r0, [r4] lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne @080452C0 ldr r1, =0x02024404 lsls r0, r7, 3 subs r0, r7 lsls r0, 2 adds r0, r1 ldrb r5, [r0, 0x7] b @080452D0 .align 2, 0 .pool @080452C0: ldrh r0, [r4] bl itemid_get_x12 lsls r0, 24 lsrs r5, r0, 24 ldrh r0, [r4] bl itemid_get_quality @080452D0: subs r0, r5, 0x2 cmp r0, 0x1A bls @080452D8 b @08045674 @080452D8: lsls r0, 2 ldr r1, =@080452E8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080452E8: .4byte @08045354 .4byte @08045444 .4byte @08045390 .4byte @080453CC .4byte @08045408 .4byte @08045674 .4byte @0804548C .4byte @08045520 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045614 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @08045674 .4byte @080454C8 @08045354: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r1, 0x4C adds r2, r0, r1 ldr r1, [r2] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0804536A b @08045674 @0804536A: movs r0, 0x41 negs r0, r0 ands r1, r0 str r1, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB70C str r0, [r1] movs r0, 0x1 str r0, [sp, 0xC] b @0804567A .align 2, 0 .pool @08045390: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r1, 0x4C adds r2, r0, r1 ldr r1, [r2] movs r0, 0x88 ands r0, r1 cmp r0, 0 bne @080453A6 b @08045674 @080453A6: ldr r0, =0xfffff077 ands r1, r0 str r1, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB724 str r0, [r1] movs r1, 0x1 str r1, [sp, 0xC] b @0804567A .align 2, 0 .pool @080453CC: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r1, 0x4C adds r2, r0, r1 ldr r1, [r2] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @080453E2 b @08045674 @080453E2: movs r0, 0x11 negs r0, r0 ands r1, r0 str r1, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB73C str r0, [r1] movs r2, 0x1 str r2, [sp, 0xC] b @0804567A .align 2, 0 .pool @08045408: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r1, 0x4C adds r2, r0, r1 ldr r1, [r2] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0804541E b @08045674 @0804541E: movs r0, 0x21 negs r0, r0 ands r1, r0 str r1, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB754 str r0, [r1] movs r3, 0x1 str r3, [sp, 0xC] b @0804567A .align 2, 0 .pool @08045444: ldr r2, =0x02024084 movs r0, 0x58 adds r4, r7, 0 muls r4, r0 adds r0, r2, 0 adds r0, 0x4C adds r3, r4, r0 ldr r1, [r3] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @0804545E b @08045674 @0804545E: movs r0, 0x8 negs r0, r0 ands r1, r0 str r1, [r3] adds r2, 0x50 adds r2, r4, r2 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB76C b @080455DC .align 2, 0 .pool @0804548C: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r1, 0x50 adds r2, r0, r1 ldr r1, [r2] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @080454A2 b @08045674 @080454A2: movs r0, 0x8 negs r0, r0 ands r1, r0 str r1, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB784 str r0, [r1] movs r0, 0x2 str r0, [sp, 0xC] b @0804567A .align 2, 0 .pool @080454C8: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r7 adds r1, 0x50 adds r2, r0, r1 ldr r1, [r2] movs r0, 0xF0 lsls r0, 12 ands r0, r1 cmp r0, 0 bne @080454E0 b @08045674 @080454E0: ldr r0, =0xfff0ffff ands r1, r0 str r1, [r2] ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BCA0 bl gf_strcpy bl b_movescr_stack_push_cursor ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB79A str r0, [r1] movs r1, 0x2 str r1, [sp, 0xC] b @0804567A .align 2, 0 .pool @08045520: ldr r4, =0x02024084 movs r0, 0x58 adds r5, r7, 0 muls r5, r0 adds r0, r4, 0 adds r0, 0x4C adds r6, r5, r0 ldr r2, [r6] ldrb r0, [r6] cmp r0, 0 bne @08045548 adds r0, r4, 0 adds r0, 0x50 adds r0, r5, r0 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 bne @08045548 b @08045674 @08045548: movs r0, 0x88 ands r2, r0 cmp r2, 0 beq @08045558 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC70 bl 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, =0xf7ffffff ands r0, r1 str r0, [r2] ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC78 bl gf_strcpy @08045578: ldr r0, [r6] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0804558A ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC80 bl gf_strcpy @0804558A: ldr r0, [r6] movs r1, 0x10 ands r0, r1 cmp r0, 0 beq @0804559C ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC88 bl gf_strcpy @0804559C: ldr r0, [r6] movs r1, 0x20 ands r0, r1 cmp r0, 0 beq @080455AE ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC90 bl gf_strcpy @080455AE: adds r5, r4 ldr r0, [r5] mov r3, r8 ands r0, r3 cmp r0, 0 beq @080455C2 ldr r0, =0x02022f58 ldr r1, =gUnknown_0831BC98 bl 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, =0x02024332 strb r4, [r0, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB79A @080455DC: str r0, [r1] movs r5, 0x1 str r5, [sp, 0xC] b @0804567A .align 2, 0 .pool @08045614: ldr r0, =0x02024084 mov r8, r0 movs r0, 0x58 adds r1, r7, 0 muls r1, r0 mov r0, r8 adds r0, 0x18 adds r1, r0 movs r2, 0x6 movs r3, 0x7 mov r10, r3 @0804562A: movs r0, 0 ldrsb r0, [r1, r0] cmp r0, 0x5 bgt @08045638 strb r2, [r1] movs r5, 0x5 str r5, [sp, 0xC] @08045638: adds r1, 0x1 movs r0, 0x1 negs r0, r0 add r10, r0 mov r3, r10 cmp r3, 0 bge @0804562A ldr r5, [sp, 0xC] cmp r5, 0 beq @080456B8 ldr r0, =0x02024474 strb r7, [r0, 0x17] ldr r0, =0x0202420f strb r7, [r0] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB7B4 str r0, [r1] b @0804582A .align 2, 0 .pool @08045674: ldr r0, [sp, 0xC] cmp r0, 0 beq @080456B8 @0804567A: ldr r0, =0x02024474 strb r7, [r0, 0x17] ldr r0, =0x0202420f strb r7, [r0] ldr r4, =0x02024064 strb r7, [r4] ldrb r1, [r4] movs r0, 0x58 muls r0, r1 @0804568C: ldr r1, =0x020240d0 adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @0804582A .align 2, 0 .pool @080456B8: adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 ldr r0, =0x0202406c ldrb r0, [r0] cmp r7, r0 bcs @080456C8 b @0804528C @080456C8: b @0804582A .align 2, 0 .pool @080456D0: ldr r7, =0x020241f0 ldr r0, [r7] cmp r0, 0 bne @080456DA b @0804582A @080456DA: mov r1, r8 cmp r1, 0x1E beq @080456EC cmp r1, 0x3E beq @08045794 b @0804582A .align 2, 0 .pool @080456EC: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @080456FA b @0804582A @080456FA: ldr r2, =0x0202437c ldr r4, =0x0202420c ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r1, r0, 2 adds r0, r2, 0 adds r0, 0x8 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08045720 adds r0, r2, 0 adds r0, 0xC adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08045720 b @0804582A @08045720: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 ldr r2, [sp, 0x10] cmp r0, r2 bcs @0804582A ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x8] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @0804582A ldr r2, =0x02024084 ldrb r1, [r4] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x28] cmp r0, 0 beq @0804582A ldr r1, =0x02024332 movs r0, 0x8 strb r0, [r1, 0x3] bl b_movescr_stack_push_cursor movs r0, 0 movs r1, 0 bl sub_8048760 bl b_movescr_stack_pop_cursor b @0804582A .align 2, 0 .pool @08045794: ldr r0, =0x0202427c ldrb r0, [r0] movs r5, 0x29 ands r5, r0 cmp r5, 0 bne @0804582A ldr r1, =0x0202437c ldr r4, =0x0202420c ldrb r2, [r4] lsls r0, r2, 2 adds r0, r2 lsls r0, 2 adds r6, r1, 0x4 adds r0, r6 ldr r1, [r0] cmp r1, 0 beq @0804582A ldr r0, =0x0000ffff cmp r1, r0 beq @0804582A ldr r0, =0x0202420b ldrb r3, [r0] cmp r3, r2 beq @0804582A ldr r2, =0x02024084 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r1, [r0, 0x28] ldrh r0, [r0, 0x2C] cmp r1, r0 beq @0804582A cmp r1, 0 beq @0804582A ldr r0, =0x02024208 mov r1, sp ldrh r1, [r1, 0x14] strh r1, [r0] ldr r0, =0x0202420f strb r3, [r0] ldr r0, =0x02024474 strb r3, [r0, 0x17] ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r6 ldr r0, [r0] ldr r1, [sp, 0x10] bl __divsi3 negs r0, r0 str r0, [r7] ldrb r1, [r4] cmp r0, 0 bne @0804580C movs r0, 0x1 negs r0, r0 str r0, [r7] @0804580C: lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r6 str r5, [r0] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB7F7 str r0, [r1] ldr r0, [sp, 0xC] adds r0, 0x1 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0xC] @0804582A: ldr r0, [sp, 0xC] add sp, 0x2C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end berry_effects_maybe thumb_func_start sub_8045868 sub_8045868: ; 8045868 lsls r0, 24 lsrs r0, 24 ldr r2, =0x020242bc lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 movs r2, 0 strb r2, [r1, 0x10] ldr r1, =0x02024084 movs r2, 0x58 adds r3, r0, 0 muls r3, r2 adds r1, 0x50 adds r3, r1 ldr r1, [r3] ldr r2, =0xfdffffff ands r1, r2 str r1, [r3] ldr r1, =0x020242ac lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r2, =0xffffbfff ands r1, r2 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8045868 thumb_func_start sub_80458B4 sub_80458B4: ; 80458B4 push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @080458D0 ldr r1, =gUnknown_0831BD10 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 @080458D0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80458B4 thumb_func_start sub_80458E0 sub_80458E0: ; 80458E0 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 lsls r0, 16 lsrs r7, r0, 16 lsls r1, 24 lsrs r0, r1, 24 movs r5, 0 cmp r0, 0 beq @080458FE subs r0, 0x1 lsls r0, 24 lsrs r6, r0, 24 b @0804590A @080458FE: ldr r1, =gBattleMoves lsls r0, r7, 1 adds r0, r7 lsls r0, 2 adds r0, r1 ldrb r6, [r0, 0x6] @0804590A: cmp r6, 0x40 bls @08045910 b @08045C20 @08045910: lsls r0, r6, 2 ldr r1, =@08045924 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08045924: .4byte @08045A28 .4byte @08045B28 .4byte @08045C1C .4byte @08045C20 .4byte @08045B40 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045B28 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C1C .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045B28 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045C20 .4byte @08045B28 @08045A28: ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x02024294 lsls r0, r4, 1 adds r0, r4 lsls r0, 2 adds r2, r0, r1 ldrb r0, [r2, 0x8] cmp r0, 0 beq @08045A5A ldr r1, =0x02024084 ldrb r4, [r2, 0x9] movs r0, 0x58 muls r0, r4 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08045A5A b @08045B70 @08045A5A: ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 lsls r0, r7, 1 mov r8, r0 @08045A6A: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 ldr r1, =0x0202406c ldrb r1, [r1] bl __modsi3 lsls r0, 24 lsrs r5, r0, 24 ldr r6, =0x0202420b ldrb r3, [r6] cmp r5, r3 beq @08045A6A adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r4, r0 beq @08045A6A ldr r0, =0x02024210 ldrb r2, [r0] ldr r1, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r1 ldr r0, [r0] ands r2, r0 cmp r2, 0 bne @08045A6A ldr r0, =gBattleMoves mov r3, r8 adds r1, r3, r7 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x2] cmp r0, 0xD beq @08045AB8 b @08045C20 @08045AB8: ldrb r1, [r6] str r2, [sp] movs r0, 0x10 movs r2, 0x1F movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @08045ACE b @08045C20 @08045ACE: ldr r2, =0x02024084 movs r1, 0x58 adds r0, r5, 0 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x1F bne @08045AE2 b @08045C20 @08045AE2: movs r4, 0x2 eors r5, r4 adds r0, r5, 0 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r1, [r0] adds r0, r5, 0 bl b_history__record_ability_usage_of_player ldr r1, =0x0202437c lsls r0, r5, 2 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0] orrs r1, r4 strb r1, [r0] b @08045C20 .align 2, 0 .pool @08045B28: ldr r0, =0x0202420b ldrb r0, [r0] bl battle_get_per_side_status adds r1, r0, 0 movs r2, 0x1 movs r0, 0x1 ands r0, r1 eors r0, r2 b @08045BD2 .align 2, 0 .pool @08045B40: ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x02024294 lsls r0, r4, 1 adds r0, r4 lsls r0, 2 adds r2, r0, r1 ldrb r0, [r2, 0x8] cmp r0, 0 beq @08045B80 ldr r1, =0x02024084 ldrb r4, [r2, 0x9] movs r0, 0x58 muls r0, r4 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08045B80 @08045B70: adds r5, r4, 0 b @08045C20 .align 2, 0 .pool @08045B80: ldr r0, =0x02022fec ldr r0, [r0] movs r4, 0x1 ands r0, r4 cmp r0, 0 beq @08045BFC movs r0, 0x4 ands r6, r0 cmp r6, 0 beq @08045BFC ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08045BC0 bl GenerateRandomNumber adds r1, r4, 0 ands r1, r0 cmp r1, 0 beq @08045BBC movs r0, 0x1 b @08045BD2 .align 2, 0 .pool @08045BBC: movs r0, 0x3 b @08045BD2 @08045BC0: bl GenerateRandomNumber adds r1, r4, 0 ands r1, r0 cmp r1, 0 beq @08045BD0 movs r0, 0 b @08045BD2 @08045BD0: movs r0, 0x2 @08045BD2: bl battle_get_side_with_given_state lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08045C20 movs r0, 0x2 eors r5, r0 b @08045C20 .align 2, 0 .pool @08045BFC: ldr r0, =0x0202420b ldrb r0, [r0] bl battle_get_per_side_status adds r1, r0, 0 movs r2, 0x1 movs r0, 0x1 ands r0, r1 eors r0, r2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r5, r0, 24 b @08045C20 .align 2, 0 .pool @08045C1C: ldr r0, =0x0202420b ldrb r5, [r0] @08045C20: ldr r0, =0x0202420b ldrb r0, [r0] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 strb r5, [r0, 0xC] adds r0, r5, 0 add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80458E0 thumb_func_start sub_8045C44 sub_8045C44: ; 8045C44 push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08045C8A ldr r0, =0x0202406e lsls r4, 1 adds r5, r4, r0 ldrh r0, [r5] movs r7, 0x64 muls r0, r7 ldr r6, =0x020244ec adds r0, r6 movs r1, 0xB movs r2, 0 bl pokemon_getattr movs r1, 0xCD lsls r1, 1 cmp r0, r1 beq @08045C98 ldrh r0, [r5] muls r0, r7 adds r0, r6 movs r1, 0xB movs r2, 0 bl pokemon_getattr cmp r0, 0x97 beq @08045C98 @08045C8A: movs r0, 0x1 b @08045CAE .align 2, 0 .pool @08045C98: ldr r0, =0x0202406e adds r0, r4, r0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x50 movs r2, 0 bl pokemon_getattr @08045CAE: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8045C44 thumb_func_start sub_8045CBC sub_8045CBC: ; 8045CBC push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x10 movs r6, 0 ldr r5, =0x02022fec ldr r0, [r5] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 bne @08045DAC ldr r4, =0x0202420b ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08045DAC ldrb r0, [r4] bl sub_8045C44 cmp r0, 0 beq @08045D76 ldr r0, [r5] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @08045D08 ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 beq @08045DAC @08045D08: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 bne @08045DAC movs r0, 0x80 lsls r0, 17 ands r1, r0 cmp r1, 0 bne @08045DAC ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r1, r0 adds r0, r2, 0 adds r0, 0x54 adds r0, r1, r0 ldr r0, [r0] adds r2, 0x3C adds r1, r2 bl sub_806E8D4 lsls r0, 24 cmp r0, 0 beq @08045DAC ldr r0, =0x0000086e bl flag_check lsls r0, 24 cmp r0, 0 bne @08045DAC movs r6, 0xA ldr r0, =0x00000868 bl flag_check lsls r0, 24 cmp r0, 0 beq @08045D5A movs r6, 0x1E @08045D5A: ldr r0, =0x0000086a bl flag_check lsls r0, 24 cmp r0, 0 beq @08045D68 movs r6, 0x32 @08045D68: ldr r0, =0x0000086c bl flag_check lsls r0, 24 cmp r0, 0 beq @08045D76 movs r6, 0x46 @08045D76: ldr r5, =0x02024084 ldr r0, =0x0202420b mov r8, r0 ldrb r0, [r0] movs r7, 0x58 muls r0, r7 adds r0, r5 adds r0, 0x2A ldrb r0, [r0] cmp r0, r6 bls @08045DAC bl GenerateRandomNumber movs r1, 0xFF ands r1, r0 mov r2, r8 ldrb r0, [r2] adds r2, r0, 0 muls r2, r7 adds r0, r2, r5 adds r0, 0x2A ldrb r0, [r0] adds r0, r6 muls r0, r1 asrs r4, r0, 8 cmp r4, r6 bge @08045DD4 @08045DAC: movs r0, 0 b @08045FD0 .align 2, 0 .pool @08045DD4: ldr r3, =0x020241ea ldrh r0, [r3] cmp r0, 0x63 bne @08045DEA adds r0, r5, 0 adds r0, 0x50 adds r0, r2, r0 ldr r1, [r0] ldr r2, =0xff7fffff ands r1, r2 str r1, [r0] @08045DEA: mov r1, r8 ldrb r0, [r1] muls r0, r7 adds r1, r5, 0 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @08045E20 ldrh r0, [r3] cmp r0, 0xAD beq @08045E0A cmp r0, 0xD6 bne @08045E20 @08045E0A: ldr r1, =0x02024214 ldr r0, =gUnknown_082DB695 b @08045F7A .align 2, 0 .pool @08045E20: bl GenerateRandomNumber movs r5, 0xFF adds r1, r5, 0 ands r1, r0 ldr r7, =0x02024084 ldr r2, =0x0202420b mov r9, r2 ldrb r3, [r2] movs r0, 0x58 mov r8, r0 mov r0, r8 muls r0, r3 adds r0, r7 adds r0, 0x2A ldrb r2, [r0] adds r0, r2, r6 muls r0, r1 asrs r4, r0, 8 cmp r4, r6 bge @08045EE8 ldr r6, =gUnknown_0832A328 ldr r5, =0x020241e8 ldrb r0, [r5] lsls r0, 2 adds r0, r6 ldrb r1, [r0] adds r0, r3, 0 movs r2, 0xFF bl sub_803FECC lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bne @08045E68 b @08045F6A @08045E68: ldr r1, =0x020241e9 mov r8, r1 movs r7, 0x3 @08045E6E: bl GenerateRandomNumber ands r0, r7 mov r2, r8 strb r0, [r2] strb r0, [r5] ldrb r0, [r5] lsls r0, 2 adds r0, r6 ldr r0, [r0] ands r0, r4 cmp r0, 0 bne @08045E6E ldr r4, =0x020241ee ldr r3, =0x02024084 ldr r0, =0x020241e8 ldrb r0, [r0] lsls r0, 1 ldr r1, =0x0202420b ldrb r2, [r1] movs r1, 0x58 muls r1, r2 adds r0, r1 adds r3, 0xC adds r0, r3 ldrh r0, [r0] strh r0, [r4] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB6A5 str r0, [r1] ldrh r0, [r4] movs r1, 0 bl sub_80458E0 ldr r1, =0x0202420c strb r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 14 b @08045FCA .align 2, 0 .pool @08045EE8: subs r0, r2, r6 lsls r0, 24 lsrs r6, r0, 24 bl GenerateRandomNumber adds r4, r5, 0 ands r4, r0 cmp r4, r6 bge @08045F64 mov r1, r9 ldrb r0, [r1] mov r1, r8 muls r1, r0 adds r0, r7, 0 adds r0, 0x4C adds r0, r1, r0 ldr r0, [r0] ands r0, r5 cmp r0, 0 bne @08045F64 adds r0, r1, r7 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x48 beq @08045F64 cmp r0, 0xF beq @08045F64 movs r2, 0 ldr r0, =0x0202406c ldrb r3, [r0] mov r8, r0 cmp r2, r3 bge @08045F4A ldr r0, [r7, 0x50] movs r1, 0x70 ands r0, r1 cmp r0, 0 bne @08045F4A adds r1, r7, 0 adds r1, 0x50 movs r5, 0x70 @08045F3A: adds r1, 0x58 adds r2, 0x1 cmp r2, r3 bge @08045F4A ldr r0, [r1] ands r0, r5 cmp r0, 0 beq @08045F3A @08045F4A: mov r0, r8 ldrb r0, [r0] cmp r2, r0 bne @08045F64 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB6D9 b @08045F7A .align 2, 0 .pool @08045F64: subs r4, r6 cmp r4, r6 blt @08045F8C @08045F6A: bl GenerateRandomNumber ldr r2, =0x02024332 movs r1, 0x3 ands r1, r0 strb r1, [r2, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB6AD @08045F7A: str r0, [r1] movs r0, 0x1 b @08045FD0 .align 2, 0 .pool @08045F8C: ldr r4, =0x0202420b ldrb r1, [r4] movs r0, 0x58 muls r1, r0 ldr r0, =0x02024084 adds r1, r0 movs r0, 0x28 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] ldrb r0, [r4] str r0, [sp, 0x8] ldrb r0, [r4] str r0, [sp, 0xC] adds r0, r1, 0 movs r2, 0x1 movs r3, 0 bl sub_806957C ldr r1, =0x020241f0 str r0, [r1] ldr r1, =0x0202420c ldrb r0, [r4] strb r0, [r1] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB6F0 str r0, [r1] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 12 @08045FCA: orrs r0, r1 str r0, [r2] movs r0, 0x2 @08045FD0: add sp, 0x10 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8045CBC thumb_func_start atk00_attackcanceler atk00_attackcanceler: ; 8045FFC push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0 beq @08046020 ldr r1, =0x02024083 movs r0, 0xC strb r0, [r1] b @08046398 .align 2, 0 .pool @08046020: ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08046064 ldr r2, =0x02024280 ldr r1, [r2] movs r0, 0x80 lsls r0, 2 ands r0, r1 cmp r0, 0 bne @08046064 movs r0, 0x80 lsls r0, 12 orrs r1, r0 str r1, [r2] ldr r1, =0x02024214 ldr r0, =gUnknown_082D8A4E b @08046396 .align 2, 0 .pool @08046064: bl sub_8041A6C lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 beq @08046072 b @08046398 @08046072: ldr r0, =0x0202420c ldrb r1, [r0] str r2, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @0804608A b @08046398 @0804608A: ldr r4, =0x02024084 ldr r0, =0x020241e8 ldrb r1, [r0] ldr r3, =0x0202420b ldrb r2, [r3] movs r0, 0x58 muls r2, r0 adds r1, r2 adds r0, r4, 0 adds r0, 0x24 adds r1, r0 ldrb r0, [r1] ldr r5, =0x02024280 cmp r0, 0 bne @08046108 ldr r0, =0x020241ea ldrh r0, [r0] cmp r0, 0xA5 beq @08046108 ldr r0, [r5] ldr r1, =0x00800200 ands r0, r1 cmp r0, 0 bne @08046108 adds r0, r4, 0 adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 5 ands r0, r1 cmp r0, 0 bne @08046108 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB07A str r0, [r1] ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] b @08046398 .align 2, 0 .pool @08046108: ldr r0, [r5] ldr r1, =0xff7fffff ands r0, r1 str r0, [r5] movs r6, 0x80 lsls r6, 18 ands r0, r6 cmp r0, 0 bne @08046160 ldrb r1, [r3] movs r0, 0x58 muls r0, r1 adds r1, r4, 0 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 5 ands r0, r1 cmp r0, 0 bne @08046160 bl sub_8045CBC lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 beq @08046160 cmp r2, 0x2 bne @08046150 ldr r0, [r5] orrs r0, r6 str r0, [r5] b @08046398 .align 2, 0 .pool @08046150: ldr r0, =0x0202427c ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @08046398 .align 2, 0 .pool @08046160: ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 18 orrs r0, r1 str r0, [r2] ldr r2, =0x0202433c ldr r1, =0x0202420c ldrb r3, [r1] lsls r0, r3, 4 adds r0, r2 ldrb r0, [r0] lsls r0, 27 mov r8, r1 mov r9, r2 cmp r0, 0 bge @080461E8 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x8] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080461E8 ldr r0, =0x0202420b ldrb r0, [r0] ldr r2, =0x00000115 adds r1, r3, 0 bl sub_803F480 mov r0, r8 ldrb r1, [r0] lsls r1, 4 add r1, r9 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB194 b @08046396 .align 2, 0 .pool @080461E8: movs r2, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r2, r0 bge @0804622A ldr r6, =0x0202433c ldr r1, =gBattleMoves mov r12, r1 adds r5, r0, 0 ldr r7, =0x0202407e @080461FC: adds r4, r2, r7 ldrb r3, [r4] lsls r0, r3, 4 adds r0, r6 ldrb r0, [r0] lsls r0, 26 cmp r0, 0 bge @08046224 ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 add r0, r12 ldrb r1, [r0, 0x8] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @08046224 b @08046350 @08046224: adds r2, 0x1 cmp r2, r5 blt @080461FC @0804622A: ldr r0, =0x0202437c mov r1, r8 ldrb r2, [r1] lsls r1, r2, 2 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r3, [r1] lsls r0, r3, 30 cmp r0, 0 bge @08046288 movs r0, 0x3 negs r0, r0 ands r0, r3 strb r0, [r1] ldr r4, =0x0202420a movs r0, 0x1F strb r0, [r4] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB53E str r0, [r1] mov r1, r8 ldrb r0, [r1] ldrb r1, [r4] bl b_history__record_ability_usage_of_player b @08046398 .align 2, 0 .pool @08046288: lsls r0, r2, 4 add r0, r9 ldrb r0, [r0] lsls r0, 31 cmp r0, 0 bne @08046296 b @08046390 @08046296: ldr r1, =gBattleMoves ldr r2, =0x020241ea ldrh r3, [r2] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0x2 ands r0, r1 adds r4, r2, 0 cmp r0, 0 beq @08046390 cmp r3, 0xAE bne @080462D4 ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x7 beq @080462D4 adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x7 bne @08046390 @080462D4: ldrh r0, [r4] bl sub_8052F48 lsls r0, 24 cmp r0, 0 beq @080462FA ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 5 ands r0, r1 cmp r0, 0 beq @08046390 @080462FA: ldr r0, =0x0202420b ldrb r0, [r0] bl b_cancel_multi_turn_move_maybe ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024250 ldr r3, =0x0202420c ldrb r0, [r3] lsls r0, 1 adds r0, r1 movs r2, 0 strh r2, [r0] ldr r1, =0x02024258 ldrb r0, [r3] lsls r0, 1 adds r0, r1 strh r2, [r0] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x6] b @08046390 .align 2, 0 .pool @08046350: ldr r0, =0x0202420b ldrb r0, [r0] ldr r2, =0x00000121 adds r1, r3, 0 bl sub_803F480 ldrb r1, [r4] lsls r1, 4 adds r1, r6 ldrb r2, [r1] movs r0, 0x21 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, =0x02024474 ldrb r0, [r4] strb r0, [r1, 0x17] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB1AC b @08046396 .align 2, 0 .pool @08046390: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 @08046396: str r0, [r1] @08046398: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk00_attackcanceler thumb_func_start mcmd_jump_if_move_not_executed mcmd_jump_if_move_not_executed: ; 80463AC push {r4-r6,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r6, r1, 16 ldr r1, =0x02024214 ldr r5, [r1] adds r4, r5, r0 ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @0804640C ldr r1, =0x02024250 ldr r3, =0x0202420c ldrb r0, [r3] lsls r0, 1 adds r0, r1 movs r2, 0 strh r2, [r0] ldr r1, =0x02024258 ldrb r0, [r3] lsls r0, 1 adds r0, r1 strh r2, [r0] ldrb r4, [r5, 0x1] ldrb r0, [r5, 0x2] lsls r0, 8 orrs r4, r0 ldrb r0, [r5, 0x3] lsls r0, 16 orrs r4, r0 ldrb r0, [r5, 0x4] lsls r0, 24 orrs r4, r0 b @08046426 .align 2, 0 .pool @0804640C: bl b_feature_update_destiny_bond ldr r0, =0x0202420c ldrb r1, [r0] str r6, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @0804642A @08046426: ldr r0, =0x02024214 str r4, [r0] @0804642A: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end mcmd_jump_if_move_not_executed thumb_func_start atk40_801DBA0 atk40_801DBA0: ; 804643C push {lr} ldr r1, =0x0202433c ldr r0, =0x0202420c ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0] lsls r0, 31 cmp r0, 0 beq @0804649C ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x8] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0804649C ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] movs r0, 0x5 movs r1, 0 bl mcmd_jump_if_move_not_executed ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x6] b @080464A4 .align 2, 0 .pool @0804649C: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @080464A4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk40_801DBA0 thumb_func_start sub_80464AC sub_80464AC: ; 80464AC push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 movs r4, 0 ldr r1, =0x0202433c ldr r0, =0x0202420c ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0] lsls r0, 31 cmp r0, 0 beq @080464F8 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x8] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080464F8 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] movs r0, 0x7 adds r1, r3, 0 bl mcmd_jump_if_move_not_executed ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x6] movs r4, 0x1 @080464F8: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80464AC thumb_func_start sub_8046518 sub_8046518: ; 8046518 push {r4-r6,lr} sub sp, 0x4 lsls r0, 16 lsrs r5, r0, 16 ldr r2, =0x020242ac ldr r3, =0x0202420c ldrb r4, [r3] lsls r0, r4, 2 adds r0, r2 ldr r1, [r0] movs r0, 0x18 ands r1, r0 adds r6, r2, 0 cmp r1, 0 beq @0804654A ldr r1, =0x020242bc lsls r0, r4, 3 subs r0, r4 lsls r0, 2 adds r0, r1 ldr r1, =0x0202420b ldrb r0, [r0, 0x15] ldrb r1, [r1] cmp r0, r1 beq @08046634 @0804654A: ldr r0, =0x02024280 ldr r1, [r0] movs r2, 0x80 lsls r2, 9 ands r1, r2 adds r2, r0, 0 cmp r1, 0 bne @08046590 ldrb r0, [r3] lsls r0, 2 adds r0, r6 ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08046590 @0804656A: ldr r0, =0x0202427c ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @08046634 .align 2, 0 .pool @08046590: ldr r0, [r2] ldr r1, =0xfffeffff ands r0, r1 str r0, [r2] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 bne @080465B2 ldrb r0, [r3] lsls r0, 2 adds r0, r6 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 bne @0804656A @080465B2: ldr r0, [r2] ldr r1, =0xfffdffff ands r0, r1 str r0, [r2] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 bne @080465D2 ldrb r0, [r3] lsls r0, 2 adds r0, r6 ldr r0, [r0] ands r0, r1 cmp r0, 0 bne @0804656A @080465D2: ldr r0, [r2] ldr r1, =0xfffbffff ands r0, r1 str r0, [r2] movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 lsls r4, r5, 1 cmp r0, 0 bne @08046622 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @08046622 ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x7 ands r0, r1 cmp r0, 0 beq @08046622 ldr r0, =gBattleMoves adds r1, r4, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1] cmp r0, 0x98 beq @08046634 @08046622: ldr r1, =gBattleMoves adds r0, r4, r5 lsls r0, 2 adds r0, r1 ldrb r0, [r0] cmp r0, 0x11 beq @08046634 cmp r0, 0x4E bne @08046654 @08046634: movs r0, 0x7 adds r1, r5, 0 bl mcmd_jump_if_move_not_executed movs r0, 0x1 b @08046656 .align 2, 0 .pool @08046654: movs r0, 0 @08046656: add sp, 0x4 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8046518 thumb_func_start atk01_accuracycheck atk01_accuracycheck: ; 8046660 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 ldr r0, =0x02024214 ldr r5, [r0] ldrb r6, [r5, 0x5] ldrb r1, [r5, 0x6] lsls r1, 8 orrs r6, r1 adds r1, r6, 0x2 lsls r1, 16 lsrs r1, 16 adds r7, r0, 0 cmp r1, 0x1 bhi @0804671C ldr r2, =0x020242ac ldr r3, =0x0202420c ldrb r4, [r3] lsls r0, r4, 2 adds r0, r2 ldr r1, [r0] movs r0, 0x18 ands r1, r0 cmp r1, 0 beq @080466D0 ldr r0, =0x0000ffff cmp r6, r0 bne @080466D0 ldr r1, =0x020242bc lsls r0, r4, 3 subs r0, r4 lsls r0, 2 adds r0, r1 ldr r1, =0x0202420b ldrb r0, [r0, 0x15] ldrb r1, [r1] cmp r0, r1 bne @080466D0 adds r0, r5, 0x7 str r0, [r7] b @080469D2 .align 2, 0 .pool @080466D0: ldrb r0, [r3] lsls r0, 2 adds r0, r2 ldr r0, [r0] ldr r1, =0x000400c0 ands r0, r1 cmp r0, 0 beq @08046700 ldr r2, [r7] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r7] b @080469D2 .align 2, 0 .pool @08046700: movs r0, 0 bl sub_80464AC lsls r0, 24 cmp r0, 0 beq @0804670E b @080469D2 @0804670E: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x7 str r0, [r1] b @080469D2 .align 2, 0 .pool @0804671C: cmp r6, 0 bne @08046724 ldr r0, =0x020241ea ldrh r6, [r0] @08046724: ldr r0, =0x0202449c ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0 beq @08046744 movs r1, 0x3F mov r10, r1 mov r2, r10 ands r2, r0 mov r10, r2 b @08046752 .align 2, 0 .pool @08046744: ldr r1, =gBattleMoves lsls r0, r6, 1 adds r0, r6 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x2] mov r10, r0 @08046752: adds r0, r6, 0 bl sub_80464AC lsls r0, 24 cmp r0, 0 beq @08046760 b @080469D2 @08046760: adds r0, r6, 0 bl sub_8046518 lsls r0, 24 cmp r0, 0 beq @0804676E b @080469D2 @0804676E: ldr r3, =0x02024084 ldr r0, =0x0202420c ldrb r0, [r0] movs r2, 0x58 adds r4, r0, 0 muls r4, r2 adds r0, r3, 0 adds r0, 0x50 adds r0, r4, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 22 ands r0, r1 cmp r0, 0 beq @080467A8 ldr r0, =0x0202420b ldrb r0, [r0] muls r0, r2 adds r0, r3 ldrb r5, [r0, 0x1E] b @080467BE .align 2, 0 .pool @080467A8: ldr r0, =0x0202420b ldrb r0, [r0] muls r0, r2 adds r0, r3 ldrb r0, [r0, 0x1E] adds r0, 0x6 adds r1, r4, r3 ldrb r1, [r1, 0x1F] subs r0, r1 lsls r0, 24 lsrs r5, r0, 24 @080467BE: lsls r0, r5, 24 cmp r0, 0 bge @080467C6 movs r5, 0 @080467C6: lsls r0, r5, 24 asrs r0, 24 cmp r0, 0xC ble @080467D0 movs r5, 0xC @080467D0: ldr r1, =gBattleMoves lsls r4, r6, 1 adds r0, r4, r6 lsls r0, 2 adds r7, r0, r1 ldrb r3, [r7, 0x3] mov r8, r3 movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 str r4, [sp, 0x4] cmp r0, 0 bne @08046822 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @08046822 ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @08046822 ldrb r0, [r7] cmp r0, 0x98 bne @08046822 movs r0, 0x32 mov r8, r0 @08046822: ldr r1, =gUnknown_0831C0F4 lsls r0, r5, 24 asrs r0, 22 adds r0, r1 ldrb r1, [r0] mov r4, r8 muls r4, r1 ldrb r1, [r0, 0x1] adds r0, r4, 0 bl __divsi3 lsls r0, 16 lsrs r4, r0, 16 ldr r7, =0x02024084 ldr r0, =0x0202420b ldrb r0, [r0] movs r5, 0x58 muls r0, r5 adds r0, r7 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0xE bne @08046860 lsls r0, r4, 6 adds r0, r4 lsls r0, 1 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r4, r0, 16 @08046860: movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @080468B8 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @080468B8 ldr r0, =0x0202420c ldrb r0, [r0] muls r0, r5 adds r0, r7 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x8 bne @080468B8 ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x18 ands r0, r1 cmp r0, 0 beq @080468B8 lsls r0, r4, 2 adds r0, r4 lsls r0, 4 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r4, r0, 16 @080468B8: ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r0, [r0] mov r9, r2 cmp r0, 0x37 bne @080468E4 mov r1, r10 cmp r1, 0x8 bhi @080468E4 lsls r0, r4, 2 adds r0, r4 lsls r0, 4 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r4, r0, 16 @080468E4: ldr r2, =0x0202420c mov r8, r2 ldrb r2, [r2] movs r7, 0x58 adds r0, r2, 0 muls r0, r7 mov r3, r9 adds r1, r0, r3 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @08046928 ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r5, [r0, 0x7] ldrb r2, [r0, 0x1A] b @08046944 .align 2, 0 .pool @08046928: ldrh r0, [r1, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r5, r0, 24 mov r1, r8 ldrb r0, [r1] muls r0, r7 add r0, r9 ldrh r0, [r0, 0x2E] bl itemid_get_quality lsls r0, 24 lsrs r2, r0, 24 @08046944: ldr r0, =0x0202420f ldr r1, =0x0202420c ldrb r1, [r1] strb r1, [r0] cmp r5, 0x16 bne @08046960 movs r0, 0x64 subs r0, r2 muls r0, r4 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r4, r0, 16 @08046960: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 adds r0, 0x1 cmp r0, r4 ble @080469CA ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @080469C0 ldr r1, =gBattleMoves ldr r2, [sp, 0x4] adds r0, r2, r6 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x6] cmp r0, 0x8 beq @080469A2 cmp r0, 0x20 bne @080469C0 @080469A2: ldr r1, =0x02024332 movs r0, 0x2 b @080469C4 .align 2, 0 .pool @080469C0: ldr r1, =0x02024332 movs r0, 0 @080469C4: strb r0, [r1, 0x6] bl b_wonderguard_and_levitate @080469CA: movs r0, 0x7 adds r1, r6, 0 bl mcmd_jump_if_move_not_executed @080469D2: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk01_accuracycheck thumb_func_start atk02_attackstring atk02_attackstring: ; 80469E8 push {r4,r5,lr} ldr r0, =0x02024068 ldr r5, [r0] cmp r5, 0 bne @08046A20 ldr r4, =0x02024280 ldr r0, [r4] movs r1, 0xC0 lsls r1, 3 ands r0, r1 cmp r0, 0 bne @08046A14 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x4 bl b_std_message ldr r0, [r4] movs r1, 0x80 lsls r1, 3 orrs r0, r1 str r0, [r4] @08046A14: ldr r0, =0x02024214 ldr r1, [r0] adds r1, 0x1 str r1, [r0] ldr r0, =0x02024332 strb r5, [r0, 0x7] @08046A20: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk02_attackstring thumb_func_start atk03_ppreduce atk03_ppreduce: ; 8046A3C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r6, 0x1 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @08046A54 b @08046BEE @08046A54: ldr r1, =0x0202437c ldr r2, =0x0202420b ldrb r3, [r2] lsls r0, r3, 2 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r0, [r0] lsls r0, 26 lsrs r4, r0, 31 mov r9, r2 cmp r4, 0 bne @08046AF6 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x6] cmp r0, 0x20 beq @08046AA6 cmp r0, 0x20 bgt @08046AA0 cmp r0, 0x8 beq @08046ABC b @08046AD6 .align 2, 0 .pool @08046AA0: cmp r0, 0x40 beq @08046ABC b @08046AD6 @08046AA6: str r4, [sp] movs r0, 0x12 adds r1, r3, 0 movs r2, 0x2E movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 adds r6, r0, 0x1 b @08046AF6 @08046ABC: mov r0, r9 ldrb r1, [r0] movs r0, 0 str r0, [sp] movs r0, 0x10 movs r2, 0x2E movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 adds r6, r0 b @08046AF6 @08046AD6: ldr r1, =0x0202420c mov r2, r9 ldrb r0, [r2] ldrb r7, [r1] cmp r0, r7 beq @08046AF6 ldr r2, =0x02024084 ldrb r1, [r1] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x2E bne @08046AF6 adds r6, 0x1 @08046AF6: ldr r0, =0x02024280 ldr r4, [r0] movs r0, 0xA0 lsls r0, 4 ands r4, r0 cmp r4, 0 bne @08046BDC ldr r2, =0x02024084 ldr r3, =0x020241e8 ldr r1, =0x0202420b ldrb r5, [r1] movs r0, 0x58 mov r8, r0 mov r0, r8 muls r0, r5 ldrb r7, [r3] adds r0, r7 movs r7, 0x24 adds r7, r2 mov r12, r7 add r0, r12 ldrb r0, [r0] mov r9, r1 mov r10, r2 adds r7, r3, 0 cmp r0, 0 beq @08046BDC ldr r0, =0x0202433c lsls r1, r5, 4 adds r1, r0 ldrb r0, [r1, 0x2] movs r2, 0x8 orrs r0, r2 strb r0, [r1, 0x2] mov r1, r9 ldrb r0, [r1] mov r2, r8 muls r2, r0 adds r0, r2, 0 ldrb r1, [r7] adds r0, r1 mov r1, r12 adds r2, r0, r1 ldrb r0, [r2] cmp r0, r6 ble @08046B70 subs r0, r6 strb r0, [r2] b @08046B72 .align 2, 0 .pool @08046B70: strb r4, [r2] @08046B72: mov r2, r9 ldrb r3, [r2] movs r4, 0x58 adds r0, r3, 0 muls r0, r4 mov r1, r10 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @08046BDC ldr r1, =0x020242bc lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 ldrb r0, [r7] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08046BDC ldr r0, =0x02024064 strb r3, [r0] ldrb r1, [r7] adds r1, 0x9 lsls r1, 24 lsrs r1, 24 mov r2, r9 ldrb r0, [r2] muls r0, r4 mov r2, r10 adds r2, 0x24 adds r0, r2 ldrb r7, [r7] adds r0, r7 str r0, [sp] movs r0, 0 movs r2, 0 movs r3, 0x1 bl dp01_build_cmdbuf_x02_a_b_varargs mov r7, r9 ldrb r0, [r7] bl dp01_battle_side_mark_buffer_for_execution @08046BDC: ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xfffff7ff ands r0, r1 str r0, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @08046BEE: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk03_ppreduce thumb_func_start atk04_critcalc atk04_critcalc: ; 8046C18 push {r4-r7,lr} ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x2E] cmp r0, 0xAF bne @08046C48 ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r6, [r0, 0x7] b @08046C50 .align 2, 0 .pool @08046C48: bl itemid_get_x12 lsls r0, 24 lsrs r6, r0, 24 @08046C50: ldr r1, =0x0202420f ldr r3, =0x0202420b ldrb r0, [r3] strb r0, [r1] ldr r4, =0x02024084 ldrb r1, [r3] movs r0, 0x58 adds r7, r1, 0 muls r7, r0 adds r0, r4, 0 adds r0, 0x50 adds r0, r7, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 13 ands r0, r1 negs r0, r0 asrs r5, r0, 31 movs r0, 0x2 ands r5, r0 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] mov r12, r3 cmp r1, 0x2B bne @08046C90 adds r5, 0x1 @08046C90: adds r0, r5, 0 cmp r1, 0x4B bne @08046C98 adds r0, 0x1 @08046C98: cmp r1, 0xC8 bne @08046C9E adds r0, 0x1 @08046C9E: adds r2, r0, 0 cmp r1, 0xD1 bne @08046CA6 adds r2, 0x1 @08046CA6: movs r1, 0 cmp r6, 0x3F bne @08046CB6 adds r0, r7, r4 ldrh r0, [r0] cmp r0, 0x71 bne @08046CB6 movs r1, 0x1 @08046CB6: lsls r5, r1, 1 movs r3, 0 cmp r6, 0x42 bne @08046CD0 mov r0, r12 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r4 ldrh r0, [r0] cmp r0, 0x53 bne @08046CD0 movs r3, 0x1 @08046CD0: lsls r1, r3, 1 cmp r6, 0x29 bne @08046CF0 adds r0, r5, 0x1 adds r0, r2, r0 b @08046CF2 .align 2, 0 .pool @08046CF0: adds r0, r2, r5 @08046CF2: adds r0, r1 lsls r0, 16 lsrs r0, 16 adds r5, r0, 0 cmp r5, 0x4 bls @08046D00 movs r5, 0x4 @08046D00: ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r4 adds r0, 0x20 ldrb r4, [r0] cmp r4, 0x4 beq @08046D70 cmp r4, 0x4B beq @08046D70 ldr r1, =0x020242ac mov r2, r12 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 bne @08046D70 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x84 lsls r1, 2 ands r0, r1 cmp r0, 0 bne @08046D70 bl GenerateRandomNumber ldr r2, =gUnknown_0831C128 lsls r1, r5, 1 adds r1, r2 lsls r0, 16 lsrs r0, 16 ldrh r1, [r1] bl __umodsi3 lsls r0, 16 cmp r0, 0 bne @08046D70 ldr r1, =0x02024211 movs r0, 0x2 b @08046D74 .align 2, 0 .pool @08046D70: ldr r1, =0x02024211 movs r0, 0x1 @08046D74: strb r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk04_critcalc thumb_func_start atk05_cmd5 atk05_cmd5: ; 8046D8C push {r4-r7,lr} sub sp, 0x10 ldr r4, =0x0202428e ldr r5, =0x0202420c ldrb r0, [r5] bl battle_get_per_side_status movs r1, 0x1 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r3, [r1] ldr r6, =0x0202420b ldrb r0, [r6] movs r4, 0x58 muls r0, r4 ldr r2, =0x02024084 adds r0, r2 ldrb r1, [r5] muls r1, r4 adds r1, r2 ldr r7, =0x020241ea ldrh r2, [r7] ldr r4, =0x02024400 ldrh r4, [r4] str r4, [sp] ldr r4, =0x0202449c ldr r4, [r4] ldrb r4, [r4, 0x13] str r4, [sp, 0x4] ldrb r4, [r6] str r4, [sp, 0x8] ldrb r4, [r5] str r4, [sp, 0xC] bl sub_806957C ldr r4, =0x020241f0 ldr r1, =0x02024211 ldrb r1, [r1] muls r1, r0 ldr r0, =0x02024474 ldrb r0, [r0, 0xE] adds r3, r1, 0 muls r3, r0 str r3, [r4] ldr r1, =0x020242ac ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 2 ands r0, r1 cmp r0, 0 beq @08046E10 ldr r2, =gBattleMoves ldrh r1, [r7] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x2] cmp r0, 0xD bne @08046E10 lsls r0, r3, 1 str r0, [r4] @08046E10: ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0] lsls r0, 28 cmp r0, 0 bge @08046E32 ldr r4, =0x020241f0 ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 movs r1, 0xA bl __divsi3 str r0, [r4] @08046E32: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] add sp, 0x10 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk05_cmd5 thumb_func_start sub_8046E7C sub_8046E7C: ; 8046E7C push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x10 adds r5, r1, 0 lsls r0, 24 lsrs r7, r0, 24 lsls r5, 24 lsrs r5, 24 ldr r4, =0x0202428e adds r0, r5, 0 bl battle_get_per_side_status movs r1, 0x1 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r3, [r1] movs r1, 0x58 adds r0, r7, 0 muls r0, r1 ldr r2, =0x02024084 adds r0, r2 muls r1, r5 adds r1, r2 ldr r2, =0x020241ea mov r8, r2 ldrh r2, [r2] ldr r6, =0x02024400 ldrh r4, [r6] str r4, [sp] ldr r4, =0x0202449c ldr r4, [r4] ldrb r4, [r4, 0x13] str r4, [sp, 0x4] str r7, [sp, 0x8] str r5, [sp, 0xC] bl sub_806957C ldr r4, =0x020241f0 movs r1, 0 strh r1, [r6] ldr r1, =0x02024211 ldrb r1, [r1] muls r1, r0 ldr r0, =0x02024474 ldrb r0, [r0, 0xE] adds r3, r1, 0 muls r3, r0 str r3, [r4] ldr r1, =0x020242ac lsls r0, r7, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 2 ands r0, r1 cmp r0, 0 beq @08046F0A ldr r2, =gBattleMoves mov r0, r8 ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x2] cmp r0, 0xD bne @08046F0A lsls r0, r3, 1 str r0, [r4] @08046F0A: ldr r0, =0x0202433c lsls r1, r7, 4 adds r1, r0 ldrb r0, [r1] lsls r0, 28 cmp r0, 0 bge @08046F28 ldr r4, =0x020241f0 ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 movs r1, 0xA bl __divsi3 str r0, [r4] @08046F28: add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8046E7C thumb_func_start battle_attack_damage_modulate_by_effectivity battle_attack_damage_modulate_by_effectivity: ; 8046F60 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r5, =0x020241f0 ldr r0, [r5] muls r0, r4 movs r1, 0xA bl __divsi3 str r0, [r5] cmp r0, 0 bne @08046F80 cmp r4, 0 beq @08046F80 movs r0, 0x1 str r0, [r5] @08046F80: cmp r4, 0x5 beq @08046FB0 cmp r4, 0x5 bgt @08046F94 cmp r4, 0 beq @08046F9A b @08047032 .align 2, 0 .pool @08046F94: cmp r4, 0x14 beq @08046FF0 b @08047032 @08046F9A: ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x8 orrs r0, r1 movs r1, 0xFB ands r0, r1 movs r1, 0xFD ands r0, r1 b @08047030 .align 2, 0 .pool @08046FB0: ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 beq @08047032 ldr r2, =0x0202427c ldrb r1, [r2] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @08047032 movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08046FEC movs r0, 0xFD ands r0, r1 b @08047030 .align 2, 0 .pool @08046FEC: movs r0, 0x4 b @0804702E @08046FF0: ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 beq @08047032 ldr r2, =0x0202427c ldrb r1, [r2] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @08047032 movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0804702C movs r0, 0xFB ands r0, r1 b @08047030 .align 2, 0 .pool @0804702C: movs r0, 0x2 @0804702E: orrs r0, r1 @08047030: strb r0, [r2] @08047032: pop {r4,r5} pop {r0} bx r0 thumb_func_end battle_attack_damage_modulate_by_effectivity thumb_func_start sub_8047038 sub_8047038: ; 8047038 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x8 movs r3, 0 ldr r1, =0x020241ea ldrh r0, [r1] cmp r0, 0xA5 bne @0804704C b @08047260 @0804704C: ldr r0, =0x0202449c ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0 beq @08047068 movs r1, 0x3F mov r8, r1 ands r1, r0 mov r8, r1 b @08047078 .align 2, 0 .pool @08047068: ldr r2, =gBattleMoves ldrh r1, [r1] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x2] mov r8, r0 @08047078: ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] adds r5, r2, 0 cmp r0, r8 beq @0804709A adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, r8 bne @080470B0 @0804709A: ldr r4, =0x020241f0 ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 str r0, [r4] movs r1, 0xA str r3, [sp, 0x4] bl __divsi3 str r0, [r4] ldr r3, [sp, 0x4] @080470B0: ldr r2, =0x0202420c ldrb r1, [r2] movs r0, 0x58 muls r0, r1 adds r0, r5 adds r0, 0x20 ldrb r0, [r0] adds r4, r2, 0 cmp r0, 0x1A bne @08047128 mov r1, r8 cmp r1, 0x4 bne @08047128 ldr r3, =0x0202420a strb r0, [r3] ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x9 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024250 ldrb r0, [r4] lsls r0, 1 adds r0, r1 movs r2, 0 strh r2, [r0] ldr r1, =0x02024258 ldrb r0, [r4] lsls r0, 1 adds r0, r1 strh r2, [r0] ldr r0, =0x02024332 mov r1, r8 strb r1, [r0, 0x6] ldrb r0, [r4] ldrb r1, [r3] bl b_history__record_ability_usage_of_player b @080471C4 .align 2, 0 .pool @08047128: ldr r1, =gUnknown_0831ACE8 adds r0, r3, r1 ldrb r0, [r0] adds r2, r1, 0 b @080471A4 .align 2, 0 .pool @08047138: adds r3, 0x3 b @080471A0 @0804713C: ldr r5, =gUnknown_0831ACE8 adds r0, r3, r5 ldrb r0, [r0] cmp r0, r8 bne @08047198 adds r1, r3, 0x1 adds r1, r5 ldr r2, =0x02024084 ldr r7, =0x0202420c ldrb r0, [r7] movs r6, 0x58 muls r0, r6 adds r0, r2 adds r0, 0x21 ldrb r4, [r1] ldrb r0, [r0] cmp r4, r0 bne @08047172 adds r0, r3, 0x2 adds r0, r5 ldrb r0, [r0] str r2, [sp] str r3, [sp, 0x4] bl battle_attack_damage_modulate_by_effectivity ldr r3, [sp, 0x4] ldr r2, [sp] @08047172: ldrb r0, [r7] muls r0, r6 adds r0, r2 adds r1, r0, 0 adds r1, 0x22 ldrb r1, [r1] cmp r4, r1 bne @08047198 adds r0, 0x21 ldrb r0, [r0] cmp r0, r4 beq @08047198 adds r0, r3, 0x2 adds r0, r5 ldrb r0, [r0] str r3, [sp, 0x4] bl battle_attack_damage_modulate_by_effectivity ldr r3, [sp, 0x4] @08047198: adds r3, 0x3 ldr r5, =0x02024084 ldr r4, =0x0202420c ldr r2, =gUnknown_0831ACE8 @080471A0: adds r0, r3, r2 ldrb r0, [r0] @080471A4: cmp r0, 0xFF beq @080471C4 cmp r0, 0xFE bne @0804713C ldrb r1, [r4] movs r0, 0x58 muls r0, r1 adds r1, r5, 0 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 22 ands r0, r1 cmp r0, 0 beq @08047138 @080471C4: ldr r2, =0x02024084 ldr r5, =0x0202420c ldrb r1, [r5] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r6, [r0] cmp r6, 0x19 bne @08047242 ldr r0, =0x0202420b ldrb r0, [r0] ldr r7, =0x020241ea ldrh r1, [r7] bl move_weather_interaction lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08047242 ldr r1, =0x0202427c mov r8, r1 ldrb r4, [r1] ands r0, r4 cmp r0, 0 beq @08047200 movs r0, 0x6 ands r0, r4 cmp r0, 0x6 bne @08047242 @08047200: ldr r2, =gBattleMoves ldrh r1, [r7] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 beq @08047242 ldr r3, =0x0202420a strb r6, [r3] movs r0, 0x1 orrs r0, r4 mov r1, r8 strb r0, [r1] ldr r1, =0x02024250 ldrb r0, [r5] lsls r0, 1 adds r0, r1 movs r2, 0 strh r2, [r0] ldr r1, =0x02024258 ldrb r0, [r5] lsls r0, 1 adds r0, r1 strh r2, [r0] ldr r1, =0x02024332 movs r0, 0x3 strb r0, [r1, 0x6] ldrb r0, [r5] ldrb r1, [r3] bl b_history__record_ability_usage_of_player @08047242: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @08047260 ldr r2, =0x0202433c ldr r0, =0x0202420b ldrb r1, [r0] lsls r1, 4 adds r1, r2 ldrb r0, [r1, 0x1] movs r2, 0x2 orrs r0, r2 strb r0, [r1, 0x1] @08047260: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8047038 thumb_func_start b_wonderguard_and_levitate b_wonderguard_and_levitate: ; 80472A8 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r6, 0 movs r5, 0 ldr r0, =0x020241ea ldrh r1, [r0] mov r9, r0 cmp r1, 0xA5 bne @080472C0 b @08047508 @080472C0: ldr r2, =gBattleMoves lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r1, r0, r2 ldrb r0, [r1, 0x1] cmp r0, 0 bne @080472D2 b @08047508 @080472D2: ldr r0, =0x0202449c ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0 beq @080472F4 movs r1, 0x3F mov r12, r1 mov r2, r12 ands r2, r0 mov r12, r2 b @080472F8 .align 2, 0 .pool @080472F4: ldrb r1, [r1, 0x2] mov r12, r1 @080472F8: ldr r2, =0x02024084 ldr r3, =0x0202420c ldrb r1, [r3] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r1, [r0] adds r7, r2, 0 mov r8, r3 cmp r1, 0x1A bne @0804733C mov r0, r12 cmp r0, 0x4 bne @0804733C ldr r0, =0x0202420a strb r1, [r0] ldr r0, =0x02024332 mov r1, r12 strb r1, [r0, 0x6] ldrb r0, [r3] movs r1, 0x1A bl b_history__record_ability_usage_of_player b @08047508 .align 2, 0 .pool @0804733C: ldr r1, =gUnknown_0831ACE8 adds r0, r5, r1 ldrb r0, [r0] adds r4, r1, 0 b @0804748E .align 2, 0 .pool @0804734C: adds r0, r5, r4 ldrb r0, [r0] cmp r0, r12 beq @08047356 b @08047488 @08047356: adds r2, r5, 0x1 adds r3, r2, r4 mov r0, r8 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r7 adds r0, 0x21 ldrb r1, [r3] adds r3, r2, 0 ldrb r0, [r0] cmp r1, r0 bne @08047396 adds r0, r5, 0x2 adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @08047396 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x8 orrs r0, r1 strb r0, [r2] ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r2, [r0] lsls r2, 4 adds r2, r1 ldrb r0, [r2, 0x1] movs r1, 0x2 orrs r0, r1 strb r0, [r2, 0x1] @08047396: adds r2, r3, r4 mov r0, r8 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r7 adds r1, r0, 0 adds r1, 0x22 ldrb r2, [r2] ldrb r1, [r1] cmp r2, r1 bne @080473DC adds r0, 0x21 ldrb r0, [r0] cmp r0, r2 beq @080473DC adds r0, r5, 0x2 adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @080473DC ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x8 orrs r0, r1 strb r0, [r2] ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r2, [r0] lsls r2, 4 adds r2, r1 ldrb r0, [r2, 0x1] movs r1, 0x2 orrs r0, r1 strb r0, [r2, 0x1] @080473DC: adds r2, r3, r4 mov r0, r8 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r7 adds r0, 0x21 ldrb r1, [r2] ldrb r0, [r0] cmp r1, r0 bne @08047400 adds r0, r5, 0x2 adds r0, r4 ldrb r0, [r0] cmp r0, 0x14 bne @08047400 movs r0, 0x1 orrs r6, r0 @08047400: adds r2, r3, r4 mov r0, r8 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r7 adds r1, r0, 0 adds r1, 0x22 ldrb r2, [r2] ldrb r1, [r1] cmp r2, r1 bne @0804742E adds r0, 0x21 ldrb r0, [r0] cmp r0, r2 beq @0804742E adds r0, r5, 0x2 adds r0, r4 ldrb r0, [r0] cmp r0, 0x14 bne @0804742E movs r0, 0x1 orrs r6, r0 @0804742E: adds r2, r3, r4 mov r0, r8 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r7 adds r0, 0x21 ldrb r1, [r2] ldrb r0, [r0] cmp r1, r0 bne @08047456 adds r0, r5, 0x2 adds r0, r4 ldrb r0, [r0] cmp r0, 0x5 bne @08047456 movs r0, 0x2 orrs r6, r0 lsls r0, r6, 24 lsrs r6, r0, 24 @08047456: adds r2, r3, r4 mov r0, r8 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r7 adds r1, r0, 0 adds r1, 0x22 ldrb r2, [r2] ldrb r1, [r1] cmp r2, r1 bne @08047488 adds r0, 0x21 ldrb r0, [r0] cmp r0, r2 beq @08047488 adds r0, r5, 0x2 adds r0, r4 ldrb r0, [r0] cmp r0, 0x5 bne @08047488 movs r0, 0x2 orrs r6, r0 lsls r0, r6, 24 lsrs r6, r0, 24 @08047488: adds r5, 0x3 adds r0, r5, r4 ldrb r0, [r0] @0804748E: cmp r0, 0xFF beq @080474B2 cmp r0, 0xFE beq @08047498 b @0804734C @08047498: mov r2, r8 ldrb r1, [r2] movs r0, 0x58 muls r0, r1 adds r1, r7, 0 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 22 ands r0, r1 cmp r0, 0 beq @08047488 @080474B2: mov r0, r8 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r7 adds r0, 0x20 ldrb r4, [r0] cmp r4, 0x19 bne @08047508 ldr r0, =0x0202420b ldrb r0, [r0] mov r2, r9 ldrh r1, [r2] bl move_weather_interaction lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08047508 movs r0, 0x3 ands r6, r0 cmp r6, 0x1 beq @08047508 ldr r2, =gBattleMoves mov r0, r9 ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 beq @08047508 ldr r0, =0x0202420a strb r4, [r0] ldr r1, =0x02024332 movs r0, 0x3 strb r0, [r1, 0x6] mov r1, r8 ldrb r0, [r1] movs r1, 0x19 bl b_history__record_ability_usage_of_player @08047508: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end b_wonderguard_and_levitate thumb_func_start b_attack_effectivity_adapt b_attack_effectivity_adapt: ; 804752C push {r4-r7,lr} adds r6, r2, 0 lsls r0, 24 lsrs r4, r0, 24 lsls r1, 16 lsrs r5, r1, 16 ldr r7, =0x020241f0 ldr r0, [r7] muls r0, r4 movs r1, 0xA bl __divsi3 str r0, [r7] cmp r0, 0 bne @08047552 cmp r4, 0 beq @08047552 movs r0, 0x1 str r0, [r7] @08047552: cmp r4, 0x5 beq @0804757A cmp r4, 0x5 bgt @08047564 cmp r4, 0 beq @0804756A b @080475DE .align 2, 0 .pool @08047564: cmp r4, 0x14 beq @080475AC b @080475DE @0804756A: ldrb r0, [r6] movs r1, 0x8 orrs r0, r1 movs r1, 0xFB ands r0, r1 movs r1, 0xFD ands r0, r1 b @080475DC @0804757A: ldr r0, =gBattleMoves lsls r1, r5, 1 adds r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] cmp r0, 0 beq @080475DE ldrb r1, [r6] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @080475DE movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080475A8 movs r0, 0xFD ands r0, r1 b @080475DC .align 2, 0 .pool @080475A8: movs r0, 0x4 b @080475DA @080475AC: ldr r0, =gBattleMoves lsls r1, r5, 1 adds r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] cmp r0, 0 beq @080475DE ldrb r1, [r6] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @080475DE movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080475D8 movs r0, 0xFB ands r0, r1 b @080475DC .align 2, 0 .pool @080475D8: movs r0, 0x2 @080475DA: orrs r0, r1 @080475DC: strb r0, [r6] @080475DE: pop {r4-r7} pop {r0} bx r0 thumb_func_end b_attack_effectivity_adapt thumb_func_start move_effectiveness_something move_effectiveness_something: ; 80475E4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 lsls r0, 16 lsrs r0, 16 mov r10, r0 lsls r1, 24 lsrs r1, 24 str r1, [sp, 0x4] lsls r2, 24 lsrs r2, 24 mov r9, r2 movs r0, 0 mov r8, r0 mov r0, sp mov r1, r8 strb r1, [r0] mov r2, r10 cmp r2, 0xA5 bne @08047616 movs r0, 0 b @0804779E @08047616: ldr r1, =gBattleMoves mov r3, r10 lsls r2, r3, 1 adds r0, r2, r3 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x2] str r0, [sp, 0x8] ldr r1, =0x02024084 movs r0, 0x58 ldr r3, [sp, 0x4] muls r0, r3 adds r3, r0, r1 adds r0, r3, 0 adds r0, 0x21 ldrb r0, [r0] str r2, [sp, 0xC] adds r5, r1, 0 ldr r1, [sp, 0x8] cmp r0, r1 beq @0804764A adds r0, r3, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, r1 bne @0804765C @0804764A: ldr r4, =0x020241f0 ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 str r0, [r4] movs r1, 0xA bl __divsi3 str r0, [r4] @0804765C: movs r0, 0x58 mov r2, r9 muls r2, r0 adds r0, r2, 0 adds r0, r5 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x1A bne @08047690 ldr r3, [sp, 0x8] cmp r3, 0x4 bne @08047690 movs r1, 0x9 mov r0, sp ldrb r0, [r0] orrs r0, r1 mov r1, sp strb r0, [r1] b @08047740 .align 2, 0 .pool @08047690: ldr r1, =gUnknown_0831ACE8 mov r2, r8 adds r0, r2, r1 ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0xFF beq @08047740 cmp r0, 0xFE bne @080476B6 movs r0, 0x58 mov r3, r9 muls r3, r0 adds r0, r3, 0 b @0804772E .align 2, 0 .pool @080476B0: movs r0, 0x3 add r8, r0 b @08047718 @080476B6: ldr r7, =gUnknown_0831ACE8 mov r1, r8 adds r0, r1, r7 ldrb r0, [r0] ldr r2, [sp, 0x8] cmp r0, r2 bne @08047710 adds r1, 0x1 adds r1, r7 ldr r2, =0x02024084 movs r0, 0x58 mov r3, r9 muls r3, r0 adds r0, r3, 0 adds r5, r0, r2 adds r6, r5, 0 adds r6, 0x21 ldrb r4, [r1] ldrb r0, [r6] cmp r4, r0 bne @080476F0 mov r0, r8 adds r0, 0x2 adds r0, r7 ldrb r0, [r0] mov r1, r10 mov r2, sp bl b_attack_effectivity_adapt @080476F0: adds r0, r5, 0 adds r0, 0x22 ldrb r0, [r0] cmp r4, r0 bne @08047710 ldrb r0, [r6] cmp r0, r4 beq @08047710 mov r0, r8 adds r0, 0x2 adds r0, r7 ldrb r0, [r0] mov r1, r10 mov r2, sp bl b_attack_effectivity_adapt @08047710: movs r1, 0x3 add r8, r1 ldr r5, =0x02024084 ldr r2, =gUnknown_0831ACE8 @08047718: mov r3, r8 adds r0, r3, r2 ldrb r0, [r0] cmp r0, 0xFF beq @08047740 cmp r0, 0xFE bne @080476B6 movs r0, 0x58 mov r1, r9 muls r1, r0 adds r0, r1, 0 @0804772E: adds r1, r5, 0 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 22 ands r0, r1 cmp r0, 0 beq @080476B0 @08047740: movs r0, 0x58 mov r2, r9 muls r2, r0 adds r0, r2, 0 adds r0, r5 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x19 bne @0804779A mov r0, sp ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0804779A ldr r0, [sp, 0x4] mov r1, r10 bl move_weather_interaction lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x2 bne @0804779A mov r0, sp ldrb r3, [r0] adds r0, r1, 0 ands r0, r3 cmp r0, 0 beq @08047782 movs r0, 0x6 ands r0, r3 cmp r0, 0x6 bne @0804779A @08047782: ldr r0, =gBattleMoves ldr r1, [sp, 0xC] add r1, r10 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] cmp r0, 0 beq @0804779A mov r0, sp movs r1, 0x1 orrs r1, r3 strb r1, [r0] @0804779A: mov r0, sp ldrb r0, [r0] @0804779E: add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end move_effectiveness_something thumb_func_start ai_rate_move ai_rate_move: ; 80477BC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC lsls r0, 16 lsrs r6, r0, 16 lsls r1, 16 lsrs r1, 16 lsls r2, 24 lsrs r2, 24 str r2, [sp, 0x4] movs r7, 0 mov r0, sp strb r7, [r0] ldr r2, =gBaseStats lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x6] mov r9, r1 ldrb r0, [r0, 0x7] mov r8, r0 cmp r6, 0xA5 bne @080477FC movs r0, 0 b @080478A0 .align 2, 0 .pool @080477FC: ldr r2, =gBattleMoves lsls r1, r6, 1 adds r0, r1, r6 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x2] mov r10, r0 str r1, [sp, 0x8] ldr r3, [sp, 0x4] cmp r3, 0x1A bne @08047824 cmp r0, 0x4 bne @08047824 movs r1, 0x9 mov r0, sp strb r1, [r0] b @0804786A .align 2, 0 .pool @08047824: ldr r0, =gUnknown_0831ACE8 adds r1, r7, r0 ldrb r0, [r1] cmp r0, 0xFF beq @0804786A adds r4, r1, 0 @08047830: ldrb r0, [r4] cmp r0, 0xFE beq @0804785C cmp r0, r10 bne @0804785C ldrb r5, [r4, 0x1] cmp r5, r9 bne @0804784A ldrb r0, [r4, 0x2] adds r1, r6, 0 mov r2, sp bl b_attack_effectivity_adapt @0804784A: cmp r5, r8 bne @0804785C cmp r9, r8 beq @0804785C ldrb r0, [r4, 0x2] adds r1, r6, 0 mov r2, sp bl b_attack_effectivity_adapt @0804785C: adds r4, 0x3 adds r7, 0x3 ldr r1, =gUnknown_0831ACE8 adds r0, r7, r1 ldrb r0, [r0] cmp r0, 0xFF bne @08047830 @0804786A: ldr r3, [sp, 0x4] cmp r3, 0x19 bne @0804789C mov r0, sp ldrb r2, [r0] movs r0, 0x2 ands r0, r2 cmp r0, 0 beq @08047884 movs r0, 0x6 ands r0, r2 cmp r0, 0x6 bne @0804789C @08047884: ldr r0, =gBattleMoves ldr r3, [sp, 0x8] adds r1, r3, r6 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] cmp r0, 0 beq @0804789C mov r0, sp movs r1, 0x8 orrs r1, r2 strb r1, [r0] @0804789C: mov r0, sp ldrb r0, [r0] @080478A0: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end ai_rate_move thumb_func_start sub_80478B8 sub_80478B8: ; 80478B8 push {r4,lr} bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xF ands r0, r1 movs r1, 0x64 subs r1, r0 lsls r1, 16 lsrs r1, 16 ldr r4, =0x020241f0 ldr r0, [r4] cmp r0, 0 beq @080478EA muls r0, r1 str r0, [r4] movs r1, 0x64 bl __divsi3 str r0, [r4] cmp r0, 0 bne @080478EA movs r0, 0x1 str r0, [r4] @080478EA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80478B8 thumb_func_start atk07_cmd7 atk07_cmd7: ; 80478F4 push {r4-r7,lr} bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xF ands r0, r1 movs r1, 0x64 subs r1, r0 lsls r1, 16 lsrs r1, 16 ldr r4, =0x020241f0 ldr r0, [r4] cmp r0, 0 beq @08047926 muls r0, r1 str r0, [r4] movs r1, 0x64 bl __divsi3 str r0, [r4] cmp r0, 0 bne @08047926 movs r0, 0x1 str r0, [r4] @08047926: ldr r7, =0x02024084 ldr r6, =0x0202420c ldrb r2, [r6] movs r5, 0x58 adds r0, r2, 0 muls r0, r5 adds r1, r0, r7 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @0804795C ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r4, [r0, 0x7] ldrb r6, [r0, 0x1A] b @08047976 .align 2, 0 .pool @0804795C: ldrh r0, [r1, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r4, r0, 24 ldrb r0, [r6] muls r0, r5 adds r0, r7 ldrh r0, [r0, 0x2E] bl itemid_get_quality lsls r0, 24 lsrs r6, r0, 24 @08047976: ldr r1, =0x0202420f ldr r5, =0x0202420c ldrb r0, [r5] strb r0, [r1] cmp r4, 0x27 bne @080479B4 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, r6 bcs @080479B4 ldrb r0, [r5] movs r1, 0x27 bl b_history__record_item_x12_of_player ldr r2, =0x0202437c ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x80 orrs r1, r2 strb r1, [r0] @080479B4: ldr r2, =0x02024084 ldr r3, =0x0202420c ldrb r4, [r3] movs r0, 0x58 muls r0, r4 adds r1, r2, 0 adds r1, 0x50 adds r0, r1 ldr r1, [r0] movs r0, 0x80 lsls r0, 17 ands r1, r0 adds r5, r2, 0 cmp r1, 0 bne @08047A84 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] cmp r0, 0x65 beq @08047A06 ldr r0, =0x0202433c lsls r1, r4, 4 adds r1, r0 ldrb r0, [r1] lsls r0, 30 cmp r0, 0 blt @08047A06 ldr r0, =0x0202437c lsls r1, r4, 2 adds r1, r4 lsls r1, 2 adds r1, r0 ldrb r0, [r1] lsrs r0, 7 cmp r0, 0 beq @08047A84 @08047A06: ldrb r0, [r3] movs r4, 0x58 muls r0, r4 adds r0, r5 ldrh r1, [r0, 0x28] ldr r2, =0x020241f0 ldr r0, [r2] cmp r1, r0 bgt @08047A84 subs r0, r1, 0x1 str r0, [r2] ldr r1, =0x0202433c ldrb r3, [r3] lsls r0, r3, 4 adds r0, r1 ldrb r0, [r0] lsls r0, 30 cmp r0, 0 bge @08047A5C ldr r0, =0x0202427c ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] b @08047A84 .align 2, 0 .pool @08047A5C: ldr r0, =0x0202437c lsls r1, r3, 2 adds r1, r3 lsls r1, 2 adds r1, r0 ldrb r0, [r1] lsrs r0, 7 cmp r0, 0 beq @08047A84 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024208 adds r0, r3, 0 muls r0, r4 adds r0, r5 ldrh r0, [r0, 0x2E] strh r0, [r1] @08047A84: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk07_cmd7 thumb_func_start atk08_cmd8 atk08_cmd8: ; 8047AA4 push {r4-r7,lr} bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xF ands r0, r1 movs r1, 0x64 subs r1, r0 lsls r1, 16 lsrs r1, 16 ldr r4, =0x020241f0 ldr r0, [r4] cmp r0, 0 beq @08047AD6 muls r0, r1 str r0, [r4] movs r1, 0x64 bl __divsi3 str r0, [r4] cmp r0, 0 bne @08047AD6 movs r0, 0x1 str r0, [r4] @08047AD6: ldr r7, =0x02024084 ldr r6, =0x0202420c ldrb r2, [r6] movs r5, 0x58 adds r0, r2, 0 muls r0, r5 adds r1, r0, r7 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @08047B0C ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r4, [r0, 0x7] ldrb r6, [r0, 0x1A] b @08047B26 .align 2, 0 .pool @08047B0C: ldrh r0, [r1, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r4, r0, 24 ldrb r0, [r6] muls r0, r5 adds r0, r7 ldrh r0, [r0, 0x2E] bl itemid_get_quality lsls r0, 24 lsrs r6, r0, 24 @08047B26: ldr r1, =0x0202420f ldr r5, =0x0202420c ldrb r0, [r5] strb r0, [r1] cmp r4, 0x27 bne @08047B64 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, r6 bcs @08047B64 ldrb r0, [r5] movs r1, 0x27 bl b_history__record_item_x12_of_player ldr r2, =0x0202437c ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x80 orrs r1, r2 strb r1, [r0] @08047B64: ldr r4, =0x02024084 ldr r6, =0x0202420c ldrb r2, [r6] movs r7, 0x58 adds r3, r2, 0 muls r3, r7 adds r0, r4, 0 adds r0, 0x50 adds r0, r3, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne @08047C10 ldr r5, =0x0202433c lsls r0, r2, 4 adds r0, r5 ldrb r0, [r0] lsls r0, 30 cmp r0, 0 blt @08047BA2 ldr r0, =0x0202437c lsls r1, r2, 2 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1] lsrs r0, 7 cmp r0, 0 beq @08047C10 @08047BA2: adds r0, r3, r4 ldrh r1, [r0, 0x28] ldr r2, =0x020241f0 ldr r0, [r2] cmp r1, r0 bgt @08047C10 subs r0, r1, 0x1 str r0, [r2] ldrb r3, [r6] lsls r0, r3, 4 adds r0, r5 ldrb r0, [r0] lsls r0, 30 cmp r0, 0 bge @08047BE8 ldr r0, =0x0202427c ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] b @08047C10 .align 2, 0 .pool @08047BE8: ldr r0, =0x0202437c lsls r1, r3, 2 adds r1, r3 lsls r1, 2 adds r1, r0 ldrb r0, [r1] lsrs r0, 7 cmp r0, 0 beq @08047C10 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024208 adds r0, r3, 0 muls r0, r7 adds r0, r4 ldrh r0, [r0, 0x2E] strh r0, [r1] @08047C10: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk08_cmd8 thumb_func_start atk09_attackanimation atk09_attackanimation: ; 8047C30 push {r4-r7,lr} sub sp, 0x10 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @08047C3E b @08047DB6 @08047C3E: ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 ldr r5, =0x020241ea cmp r0, 0 beq @08047C8C ldrh r0, [r5] cmp r0, 0x90 beq @08047C8C cmp r0, 0xA4 beq @08047C8C ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DABB9 str r0, [r4] ldr r1, =0x02024474 ldrb r0, [r1, 0x18] adds r0, 0x1 strb r0, [r1, 0x18] ldrb r0, [r1, 0x19] adds r0, 0x1 strb r0, [r1, 0x19] b @08047DB6 .align 2, 0 .pool @08047C8C: ldr r2, =gBattleMoves ldrh r1, [r5] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x6] movs r0, 0x8 ands r0, r1 cmp r0, 0 bne @08047CB2 movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @08047CB2 movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08047CBA @08047CB2: ldr r0, =0x02024474 ldrb r0, [r0, 0x19] cmp r0, 0 bne @08047D88 @08047CBA: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @08047DA8 ldr r1, =0x02024064 ldr r3, =0x0202420b ldrb r0, [r3] strb r0, [r1] ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 adds r4, r1, 0 muls r4, r0 adds r0, r2, 0 adds r0, 0x50 adds r0, r4, r0 ldr r1, [r0] movs r0, 0x80 lsls r0, 17 ands r1, r0 adds r7, r3, 0 mov r12, r2 cmp r1, 0 beq @08047D18 ldr r0, =0x02024212 ldrb r6, [r0] b @08047D42 .align 2, 0 .pool @08047D18: ldr r3, =0x02024212 ldrb r0, [r3] cmp r0, 0x1 bls @08047D40 mov r1, r12 adds r0, r4, r1 ldrh r2, [r0, 0x28] ldr r0, =0x020241f0 ldr r1, [r0] movs r6, 0x1 adds r4, r0, 0 cmp r2, r1 ble @08047D44 ldrb r6, [r3] b @08047D44 .align 2, 0 .pool @08047D40: ldrb r6, [r3] @08047D42: ldr r4, =0x020241f0 @08047D44: ldrh r1, [r5] ldr r5, =0x02024474 ldrb r2, [r5, 0x18] ldr r0, =0x020244e0 ldrh r3, [r0] ldr r0, [r4] str r0, [sp] ldrb r4, [r7] movs r0, 0x58 muls r0, r4 add r0, r12 adds r0, 0x2B ldrb r0, [r0] str r0, [sp, 0x4] ldrb r4, [r7] lsls r0, r4, 3 subs r0, r4 lsls r0, 2 ldr r4, =0x020242bc adds r0, r4 str r0, [sp, 0x8] str r6, [sp, 0xC] movs r0, 0 bl dp01_build_cmdbuf_x0F_aa_b_cc_dddd_e_mlc_weather_00_x1Cbytes ldrb r0, [r5, 0x18] adds r0, 0x1 strb r0, [r5, 0x18] ldrb r0, [r5, 0x19] adds r0, 0x1 strb r0, [r5, 0x19] ldrb r0, [r7] bl dp01_battle_side_mark_buffer_for_execution @08047D88: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] b @08047DB6 .align 2, 0 .pool @08047DA8: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DABB9 str r0, [r4] @08047DB6: add sp, 0x10 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk09_attackanimation thumb_func_start sub_8047DC8 sub_8047DC8: ; 8047DC8 push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @08047DDA ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @08047DDA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8047DC8 thumb_func_start atk0B_graphicalhpupdate atk0B_graphicalhpupdate: ; 8047DE8 push {r4,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @08047EAA ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @08047EA2 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r2, =0x02024064 strb r0, [r2] ldr r1, =0x02024084 ldrb r2, [r2] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @08047E68 ldr r0, =0x020242bc lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xA] cmp r0, 0 beq @08047E68 ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 1 ands r0, r1 cmp r0, 0 bne @08047E68 movs r0, 0x80 adds r1, r2, 0 bl b_std_message b @08047EA2 .align 2, 0 .pool @08047E68: ldr r0, =0x020241f0 ldr r0, [r0] ldr r1, =0x00002710 cmp r0, r1 bgt @08047E76 lsls r0, 16 lsrs r1, r0, 16 @08047E76: movs r0, 0 bl dp01_build_cmdbuf_x18_0_aa_health_bar_update ldr r4, =0x02024064 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08047EA2 ldr r0, =0x020241f0 ldr r0, [r0] cmp r0, 0 ble @08047EA2 ldr r0, =0x03005d10 ldrb r1, [r0, 0x5] movs r2, 0x1 orrs r1, r2 strb r1, [r0, 0x5] @08047EA2: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] @08047EAA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk0B_graphicalhpupdate thumb_func_start atk0C_datahpupdate atk0C_datahpupdate: ; 8047EC4 push {r4-r7,lr} sub sp, 0x4 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @08047ED2 b @080482A2 @08047ED2: ldr r0, =0x0202449c ldr r0, [r0] ldrb r1, [r0, 0x13] cmp r1, 0 beq @08047EF4 movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08047EF4 movs r6, 0x3F ands r6, r1 b @08047F04 .align 2, 0 .pool @08047EF4: ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r6, [r0, 0x2] @08047F04: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @08047F12 b @08048274 @08047F12: ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r7, =0x02024064 strb r0, [r7] ldr r1, =0x02024084 ldrb r2, [r7] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @08048028 ldr r0, =0x020242bc lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r4, r1, r0 ldrb r1, [r4, 0xA] mov r12, r0 cmp r1, 0 beq @08048028 ldr r0, =0x02024280 ldr r3, [r0] movs r0, 0x80 lsls r0, 1 ands r3, r0 cmp r3, 0 bne @08048028 adds r5, r1, 0 ldr r6, =0x020241f0 ldr r4, [r6] cmp r5, r4 blt @08047FBC ldr r0, =0x0202437c lsls r1, r2, 2 adds r1, r2 lsls r1, 2 adds r0, 0x4 adds r1, r0 ldr r0, [r1] cmp r0, 0 bne @08047F76 str r4, [r1] @08047F76: ldrb r0, [r7] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 add r1, r12 ldr r2, [r6] ldrb r0, [r1, 0xA] subs r0, r2 strb r0, [r1, 0xA] ldr r1, =0x020241f4 ldr r0, [r6] str r0, [r1] b @08047FEC .align 2, 0 .pool @08047FBC: ldr r0, =0x0202437c lsls r1, r2, 2 adds r1, r2 lsls r1, 2 adds r0, 0x4 adds r1, r0 ldr r0, [r1] cmp r0, 0 bne @08047FD0 str r5, [r1] @08047FD0: ldr r2, =0x020241f4 ldrb r1, [r7] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 ldrb r0, [r0, 0xA] str r0, [r2] ldrb r1, [r7] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 strb r3, [r0, 0xA] @08047FEC: ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 ldrb r0, [r0, 0xA] cmp r0, 0 beq @08048000 b @0804829A @08048000: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x2 str r0, [r4] bl b_movescr_stack_push_cursor ldr r0, =gUnknown_082DB6FB str r0, [r4] b @080482A2 .align 2, 0 .pool @08048028: ldr r0, =0x02024280 ldr r2, [r0] ldr r1, =0xfffffeff ands r2, r1 str r2, [r0] ldr r1, =0x020241f0 ldr r5, [r1] mov r12, r0 adds r7, r1, 0 cmp r5, 0 bge @0804807C ldr r4, =0x02024084 ldr r2, =0x02024064 ldrb r0, [r2] movs r3, 0x58 adds r1, r0, 0 muls r1, r3 adds r1, r4 ldrh r0, [r1, 0x28] subs r0, r5 strh r0, [r1, 0x28] ldrb r0, [r2] muls r0, r3 adds r1, r0, r4 ldrh r3, [r1, 0x2C] ldrh r0, [r1, 0x28] adds r5, r2, 0 cmp r0, r3 bhi @08048064 b @0804823A @08048064: strh r3, [r1, 0x28] b @0804823A .align 2, 0 .pool @0804807C: movs r0, 0x20 ands r0, r2 cmp r0, 0 beq @08048098 movs r0, 0x21 negs r0, r0 ands r2, r0 mov r0, r12 str r2, [r0] ldr r5, =0x02024064 b @080480E0 .align 2, 0 .pool @08048098: ldr r0, =0x020241f8 ldr r2, =0x02024064 ldrb r1, [r2] lsls r1, 2 adds r1, r0 ldr r0, [r1] adds r0, r5 str r0, [r1] ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] adds r5, r2, 0 cmp r0, 0 bne @080480D4 ldr r1, =0x02024288 ldrb r0, [r5] adds r0, r1 ldr r1, =0x0202420b b @080480DC .align 2, 0 .pool @080480D4: ldr r1, =0x02024288 ldrb r0, [r5] adds r0, r1 ldr r1, =0x0202420c @080480DC: ldrb r1, [r1] strb r1, [r0] @080480E0: ldr r4, =0x02024084 ldrb r0, [r5] movs r3, 0x58 muls r0, r3 adds r2, r0, r4 ldrh r0, [r2, 0x28] ldr r1, [r7] cmp r0, r1 ble @08048110 subs r0, r1 strh r0, [r2, 0x28] ldr r0, =0x020241f4 str r1, [r0] adds r7, r0, 0 b @08048120 .align 2, 0 .pool @08048110: ldr r2, =0x020241f4 str r0, [r2] ldrb r0, [r5] muls r0, r3 adds r0, r4 movs r1, 0 strh r1, [r0, 0x28] adds r7, r2, 0 @08048120: ldr r2, =0x0202437c ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r1, r2, 0x4 adds r3, r0, r1 ldr r0, [r3] adds r4, r2, 0 cmp r0, 0 bne @08048148 mov r1, r12 ldr r0, [r1] movs r1, 0x80 lsls r1, 13 ands r0, r1 cmp r0, 0 bne @08048148 ldr r0, [r7] str r0, [r3] @08048148: cmp r6, 0x8 bhi @080481D0 mov r1, r12 ldr r0, [r1] movs r1, 0x80 lsls r1, 13 ands r0, r1 cmp r0, 0 bne @080481CC ldr r0, =0x020241ea ldrh r0, [r0] cmp r0, 0xDC beq @080481CC ldr r3, =0x0202433c ldrb r0, [r5] lsls r0, 4 adds r1, r3, 0x4 adds r0, r1 ldr r2, [r7] str r2, [r0] ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x8 adds r0, r1 str r2, [r0] ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0 bne @080481AC ldrb r0, [r5] lsls r0, 4 adds r0, r3 ldr r2, =0x0202420b b @080481B4 .align 2, 0 .pool @080481AC: ldrb r0, [r5] lsls r0, 4 adds r0, r3 ldr r2, =0x0202420c @080481B4: ldrb r1, [r2] strb r1, [r0, 0xC] ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r2] strb r1, [r0, 0x10] b @0804823A .align 2, 0 .pool @080481CC: cmp r6, 0x8 bls @0804823A @080481D0: mov r1, r12 ldr r0, [r1] movs r1, 0x80 lsls r1, 13 ands r0, r1 cmp r0, 0 bne @0804823A ldr r3, =0x0202433c ldrb r0, [r5] lsls r0, 4 adds r1, r3, 0 adds r1, 0x8 adds r0, r1 ldr r2, [r7] str r2, [r0] ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0xC adds r0, r1 str r2, [r0] ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0 bne @08048220 ldrb r0, [r5] lsls r0, 4 adds r0, r3 ldr r2, =0x0202420b b @08048228 .align 2, 0 .pool @08048220: ldrb r0, [r5] lsls r0, 4 adds r0, r3 ldr r2, =0x0202420c @08048228: ldrb r1, [r2] strb r1, [r0, 0xD] ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r2] strb r1, [r0, 0x11] @0804823A: mov r1, r12 ldr r0, [r1] ldr r1, =0xffefffff ands r0, r1 mov r1, r12 str r0, [r1] ldrb r1, [r5] movs r0, 0x58 muls r0, r1 ldr r1, =0x020240ac adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x2A movs r2, 0 movs r3, 0x2 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution b @0804829A .align 2, 0 .pool @08048274: ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r1, =0x02024064 strb r0, [r1] ldr r2, =0x0202437c ldrb r1, [r1] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r2, 0x4 adds r1, r0, r2 ldr r0, [r1] cmp r0, 0 bne @0804829A ldr r0, =0x0000ffff str r0, [r1] @0804829A: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] @080482A2: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk0C_datahpupdate thumb_func_start atk0D_critmessage atk0D_critmessage: ; 80482BC push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @080482F2 ldr r0, =0x02024211 ldrb r0, [r0] cmp r0, 0x2 bne @080482EA ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @080482EA ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0xD9 bl b_std_message ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x7] @080482EA: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @080482F2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk0D_critmessage thumb_func_start atk0E_missmessage atk0E_missmessage: ; 8048310 push {r4,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @080483D0 ldr r4, =0x02024064 ldr r0, =0x0202420c ldrb r0, [r0] strb r0, [r4] ldr r1, =0x0202427c ldrb r2, [r1] movs r0, 0x1 ands r0, r2 cmp r0, 0 bne @080483C8 movs r0, 0xFE ands r0, r2 cmp r0, 0x10 beq @08048382 cmp r0, 0x10 bgt @0804835E cmp r0, 0x4 beq @08048372 cmp r0, 0x4 bgt @08048358 cmp r0, 0x2 beq @0804836C b @08048382 .align 2, 0 .pool @08048358: cmp r0, 0x8 beq @080483C8 b @08048382 @0804835E: cmp r0, 0x40 beq @08048382 cmp r0, 0x40 bgt @08048382 cmp r0, 0x20 beq @080483C8 b @08048382 @0804836C: movs r0, 0 movs r1, 0xE b @08048376 @08048372: movs r0, 0 movs r1, 0xC @08048376: bl dp01_build_cmdbuf_x2B_aa_0 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @080483C8 @08048382: ldrb r1, [r1] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08048392 movs r0, 0 movs r1, 0xE b @0804839E @08048392: movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080483B0 movs r0, 0 movs r1, 0xC @0804839E: bl dp01_build_cmdbuf_x2B_aa_0 ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution b @080483C8 .align 2, 0 .pool @080483B0: movs r0, 0x28 ands r0, r1 cmp r0, 0 bne @080483C8 movs r0, 0 movs r1, 0xD bl dp01_build_cmdbuf_x2B_aa_0 ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution @080483C8: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @080483D0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk0E_missmessage thumb_func_start atk0F_resultmessage atk0F_resultmessage: ; 80483E0 push {r4-r7,lr} movs r3, 0 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @080483EE b @08048580 @080483EE: ldr r1, =0x0202427c ldrb r2, [r1] movs r4, 0x1 adds r0, r4, 0 ands r0, r2 adds r6, r1, 0 ldr r7, =0x02024332 cmp r0, 0 beq @0804842C movs r0, 0x8 ands r0, r2 cmp r0, 0 beq @0804840E ldrb r0, [r7, 0x6] cmp r0, 0x2 bls @0804842C @0804840E: ldr r1, =gUnknown_085CC834 ldrb r0, [r7, 0x6] lsls r0, 1 adds r0, r1 ldrh r3, [r0] strb r4, [r7, 0x7] b @0804856A .align 2, 0 .pool @0804842C: movs r0, 0x1 strb r0, [r7, 0x7] ldrb r5, [r6] movs r0, 0xFE ands r0, r5 cmp r0, 0x10 beq @08048470 cmp r0, 0x10 bgt @08048452 cmp r0, 0x4 beq @0804846C cmp r0, 0x4 bgt @0804844C cmp r0, 0x2 beq @08048468 b @080484B8 @0804844C: cmp r0, 0x8 beq @080484C4 b @080484B8 @08048452: cmp r0, 0x40 beq @08048474 cmp r0, 0x40 bgt @08048462 cmp r0, 0x20 bne @08048460 b @08048564 @08048460: b @080484B8 @08048462: cmp r0, 0x80 beq @08048478 b @080484B8 @08048468: movs r3, 0xDE b @0804856E @0804846C: movs r3, 0xDD b @0804856E @08048470: movs r3, 0xDA b @0804856E @08048474: movs r3, 0x99 b @0804856E @08048478: ldr r4, =0x02024208 ldr r2, =0x02024084 ldr r3, =0x0202420c ldrb r1, [r3] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x2E] strh r0, [r4] ldr r1, =0x0202420f ldrb r0, [r3] strb r0, [r1] movs r0, 0x3F ands r0, r5 strb r0, [r6] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB816 b @0804857E .align 2, 0 .pool @080484B8: adds r2, r6, 0 ldrb r5, [r2] movs r0, 0x8 ands r0, r5 cmp r0, 0 beq @080484C8 @080484C4: movs r3, 0x1B b @0804856E @080484C8: movs r0, 0x10 ands r0, r5 cmp r0, 0 beq @080484F0 movs r0, 0xEF ands r0, r5 movs r1, 0xFD ands r0, r1 movs r1, 0xFB ands r0, r1 strb r0, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB1CE b @0804857E .align 2, 0 .pool @080484F0: movs r0, 0x40 ands r0, r5 cmp r0, 0 beq @08048510 movs r0, 0x3F ands r0, r5 strb r0, [r2] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB1C7 b @0804857E .align 2, 0 .pool @08048510: movs r0, 0x80 ands r0, r5 cmp r0, 0 beq @08048558 ldr r4, =0x02024208 ldr r2, =0x02024084 ldr r3, =0x0202420c ldrb r1, [r3] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x2E] strh r0, [r4] ldr r1, =0x0202420f ldrb r0, [r3] strb r0, [r1] movs r0, 0x3F ands r0, r5 strb r0, [r6] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB816 b @0804857E .align 2, 0 .pool @08048558: movs r0, 0x20 ands r0, r5 lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @08048568 @08048564: movs r3, 0xE5 b @0804856E @08048568: strb r0, [r7, 0x7] @0804856A: cmp r3, 0 beq @08048578 @0804856E: adds r0, r3, 0 ldr r1, =0x0202420b ldrb r1, [r1] bl b_std_message @08048578: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 @0804857E: str r0, [r1] @08048580: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk0F_resultmessage thumb_func_start atk10_printstring atk10_printstring: ; 8048590 push {r4,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @080485BA ldr r4, =0x02024214 ldr r1, [r4] ldrb r0, [r1, 0x1] ldrb r1, [r1, 0x2] lsls r1, 8 orrs r0, r1 ldr r1, =0x0202420b ldrb r1, [r1] bl b_std_message ldr r0, [r4] adds r0, 0x3 str r0, [r4] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x7] @080485BA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk10_printstring thumb_func_start atk11_printstring2 atk11_printstring2: ; 80485D0 push {r4,r5,lr} ldr r5, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r5] ldr r4, =0x02024214 ldr r0, [r4] ldrb r1, [r0, 0x1] ldrb r0, [r0, 0x2] lsls r0, 8 orrs r1, r0 movs r0, 0 bl dp01_build_cmdbuf_x11_TODO ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r4] adds r0, 0x3 str r0, [r4] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x7] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk11_printstring2 thumb_func_start atk12_waitmessage atk12_waitmessage: ; 8048614 push {r4-r6,lr} ldr r0, =0x02024068 ldr r4, [r0] cmp r4, 0 bne @08048662 ldr r6, =0x02024332 ldrb r0, [r6, 0x7] cmp r0, 0 bne @0804863C ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x3 str r0, [r1] b @08048662 .align 2, 0 .pool @0804863C: ldr r5, =0x02024214 ldr r2, [r5] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldr r3, =0x0202432c ldrh r0, [r3] adds r0, 0x1 strh r0, [r3] lsls r0, 16 lsrs r0, 16 cmp r0, r1 bcc @08048662 movs r1, 0 strh r4, [r3] adds r0, r2, 0x3 str r0, [r5] strb r1, [r6, 0x7] @08048662: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk12_waitmessage thumb_func_start atk13_printfromtable atk13_printfromtable: ; 8048670 push {r4,r5,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @080486AE ldr r4, =0x02024214 ldr r2, [r4] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 ldr r5, =0x02024332 ldrb r0, [r5, 0x5] lsls r0, 1 adds r1, r0 ldrh r0, [r1] ldr r1, =0x0202420b ldrb r1, [r1] bl b_std_message ldr r0, [r4] adds r0, 0x5 str r0, [r4] movs r0, 0x1 strb r0, [r5, 0x7] @080486AE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk13_printfromtable thumb_func_start atk14_printfromtable2 atk14_printfromtable2: ; 80486C4 push {r4-r6,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804870E ldr r5, =0x02024214 ldr r2, [r5] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 ldr r6, =0x02024332 ldrb r0, [r6, 0x5] lsls r0, 1 adds r1, r0 ldr r4, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r4] ldrh r1, [r1] movs r0, 0 bl dp01_build_cmdbuf_x11_TODO ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x5 str r0, [r5] movs r0, 0x1 strb r0, [r6, 0x7] @0804870E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk14_printfromtable2 thumb_func_start sub_8048728 sub_8048728: ; 8048728 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 movs r1, 0 ldr r0, =0x0202406c ldrb r3, [r0] cmp r1, r3 bge @0804874E ldr r4, =0x0202407e ldrb r0, [r4] cmp r0, r2 beq @0804874E @08048740: adds r1, 0x1 cmp r1, r3 bge @0804874E adds r0, r1, r4 ldrb r0, [r0] cmp r0, r2 bne @08048740 @0804874E: lsls r0, r1, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8048728 thumb_func_start sub_8048760 sub_8048760: ; 8048760 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 lsls r0, 24 lsrs r5, r0, 24 lsls r1, 24 lsrs r6, r1, 24 movs r0, 0 mov r10, r0 movs r7, 0 movs r1, 0x1 str r1, [sp, 0x4] ldr r1, =0x02024332 ldrb r3, [r1, 0x3] movs r0, 0x40 ands r0, r3 cmp r0, 0 beq @080487B8 ldr r2, =0x0202420e ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r2] movs r0, 0xBF ands r0, r3 adds r3, r1, 0 strb r0, [r3, 0x3] movs r7, 0x40 ldr r1, =0x02024474 ldr r0, =0x0202420c b @080487C4 .align 2, 0 .pool @080487B8: ldr r2, =0x0202420e ldr r0, =0x0202420c ldrb r0, [r0] strb r0, [r2] ldr r1, =0x02024474 ldr r0, =0x0202420b @080487C4: ldrb r0, [r0] strb r0, [r1, 0x17] mov r9, r2 ldr r2, =0x02024084 mov r4, r9 ldrb r1, [r4] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x13 bne @08048828 ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 6 ands r0, r1 cmp r0, 0 bne @08048828 cmp r5, 0 bne @08048828 ldr r1, =0x02024332 ldrb r0, [r1, 0x3] cmp r0, 0x9 bhi @08048828 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r2, =0x02024332 strb r5, [r2, 0x3] bl @080499B8 .align 2, 0 .pool @08048828: mov r3, r9 ldrb r0, [r3] bl battle_get_per_side_status ldr r2, =0x0202428e movs r1, 0x1 ands r1, r0 lsls r1, 1 adds r1, r2 ldrh r1, [r1] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @08048880 ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 6 ands r0, r1 cmp r0, 0 bne @08048880 cmp r5, 0 bne @08048880 ldr r0, =0x02024332 ldrb r1, [r0, 0x3] cmp r1, 0x7 bhi @08048880 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r4, =0x02024332 strb r5, [r4, 0x3] bl @080499B8 .align 2, 0 .pool @08048880: ldr r3, =0x02024084 ldr r2, =0x0202420e ldrb r1, [r2] movs r0, 0x58 muls r0, r1 adds r0, r3 ldrh r4, [r0, 0x28] mov r9, r2 mov r8, r3 cmp r4, 0 bne @080488C4 ldr r1, =0x02024332 ldrb r0, [r1, 0x3] cmp r0, 0xB beq @080488C4 cmp r0, 0x1F beq @080488C4 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r2, =0x02024332 strb r4, [r2, 0x3] bl @080499B8 .align 2, 0 .pool @080488C4: mov r3, r9 ldrb r1, [r3] movs r0, 0x58 muls r0, r1 mov r1, r8 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @080488FC cmp r7, 0x40 beq @080488FC ldr r0, =0x02024214 ldr r1, [r0] adds r1, 0x1 str r1, [r0] movs r0, 0 ldr r4, =0x02024332 strb r0, [r4, 0x3] bl @080499B8 .align 2, 0 .pool @080488FC: ldr r1, =0x02024332 ldrb r0, [r1, 0x3] cmp r0, 0x6 bls @08048906 b @08048F40 @08048906: ldr r1, =gUnknown_0831C134 ldr r2, =0x02024332 ldrb r0, [r2, 0x3] lsls r0, 2 adds r0, r1 ldr r0, [r0] cmp r0, 0x10 bne @08048918 b @08048AFC @08048918: cmp r0, 0x10 bhi @08048930 cmp r0, 0x7 beq @0804894A cmp r0, 0x8 beq @08048A00 b @08048DF4 .align 2, 0 .pool @08048930: cmp r0, 0x40 bne @08048936 b @08048C84 @08048936: cmp r0, 0x40 bhi @08048942 cmp r0, 0x20 bne @08048940 b @08048BEA @08048940: b @08048DF4 @08048942: cmp r0, 0x80 bne @08048948 b @08048D02 @08048948: b @08048DF4 @0804894A: mov r3, r9 ldrb r1, [r3] movs r0, 0x58 muls r0, r1 add r0, r8 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x2B beq @080489AC ldr r0, =0x02024064 movs r1, 0 strb r1, [r0] ldr r1, =0x0202406c ldrb r3, [r1] adds r7, r0, 0 mov r12, r1 cmp r3, 0 beq @080489B8 mov r4, r8 ldr r0, [r4, 0x50] movs r1, 0x70 ands r0, r1 cmp r0, 0 bne @080489B8 adds r1, r7, 0 mov r6, r8 adds r6, 0x50 movs r5, 0x58 movs r4, 0x70 @08048984: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, r3 bcs @080489B8 ldrb r0, [r7] muls r0, r5 adds r0, r6 ldr r0, [r0] ands r0, r4 cmp r0, 0 beq @08048984 b @080489B8 .align 2, 0 .pool @080489AC: ldr r0, =0x02024064 ldr r2, =0x0202406c ldrb r1, [r2] strb r1, [r0] adds r7, r0, 0 mov r12, r2 @080489B8: mov r0, r9 ldrb r2, [r0] movs r0, 0x58 adds r1, r2, 0 muls r1, r0 mov r0, r8 adds r0, 0x4C adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 beq @080489D0 b @08048DF4 @080489D0: ldrb r0, [r7] mov r3, r12 ldrb r3, [r3] cmp r0, r3 beq @080489DC b @08048DF4 @080489DC: mov r4, r8 adds r0, r1, r4 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x48 bne @080489EA b @08048DF4 @080489EA: cmp r0, 0xF bne @080489F0 b @08048DF4 @080489F0: adds r0, r2, 0 bl b_cancel_multi_turn_move_maybe b @08048DE4 .align 2, 0 .pool @08048A00: mov r2, r9 ldrb r1, [r2] movs r0, 0x58 muls r0, r1 add r0, r8 adds r0, 0x20 ldrb r1, [r0] cmp r1, 0x11 bne @08048A70 cmp r5, 0x1 beq @08048A1A cmp r6, 0x80 bne @08048A70 @08048A1A: ldr r0, =0x0202420a strb r1, [r0] mov r3, r9 ldrb r0, [r3] movs r1, 0x11 bl b_history__record_ability_usage_of_player ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB5E9 str r0, [r4] ldr r2, =0x02024280 ldr r1, [r2] movs r0, 0x80 lsls r0, 6 ands r0, r1 cmp r0, 0 bne @08048A46 b @08048D20 @08048A46: movs r0, 0x1 ldr r4, =0x02024332 strb r0, [r4, 0x5] @08048A4C: ldr r0, =0xffffdfff ands r1, r0 str r1, [r2] bl @080499B2 .align 2, 0 .pool @08048A70: mov r2, r9 ldrb r0, [r2] movs r1, 0x58 muls r0, r1 add r0, r8 adds r1, r0, 0 adds r1, 0x21 ldrb r1, [r1] cmp r1, 0x3 beq @08048A94 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x3 beq @08048A94 cmp r1, 0x8 beq @08048A94 cmp r0, 0x8 bne @08048AAE @08048A94: ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 6 ands r0, r1 cmp r0, 0 beq @08048AAE cmp r5, 0x1 bne @08048AA8 b @08048D66 @08048AA8: cmp r6, 0x80 bne @08048AAE b @08048D66 @08048AAE: mov r3, r9 ldrb r1, [r3] movs r0, 0x58 muls r1, r0 mov r4, r8 adds r3, r1, r4 adds r0, r3, 0 adds r0, 0x21 ldrb r4, [r0] cmp r4, 0x3 bne @08048AC6 b @08048DF4 @08048AC6: adds r0, 0x1 ldrb r0, [r0] cmp r0, 0x3 bne @08048AD0 b @08048DF4 @08048AD0: cmp r4, 0x8 bne @08048AD6 b @08048DF4 @08048AD6: cmp r0, 0x8 bne @08048ADC b @08048DF4 @08048ADC: mov r0, r8 adds r0, 0x4C adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 beq @08048AEA b @08048DF4 @08048AEA: adds r0, r3, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x11 bne @08048AF6 b @08048DF4 @08048AF6: b @08048DE4 .align 2, 0 .pool @08048AFC: mov r2, r9 ldrb r1, [r2] movs r0, 0x58 muls r0, r1 add r0, r8 adds r0, 0x20 ldrb r1, [r0] cmp r1, 0x29 bne @08048B54 cmp r5, 0x1 beq @08048B16 cmp r6, 0x80 bne @08048B54 @08048B16: ldr r0, =0x0202420a strb r1, [r0] mov r3, r9 ldrb r0, [r3] movs r1, 0x29 bl b_history__record_ability_usage_of_player ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB5D1 str r0, [r4] ldr r2, =0x02024280 ldr r1, [r2] movs r0, 0x80 lsls r0, 6 ands r0, r1 cmp r0, 0 beq @08048B42 b @08048A46 @08048B42: b @08048D20 .align 2, 0 .pool @08048B54: mov r2, r9 ldrb r1, [r2] movs r0, 0x58 muls r0, r1 mov r3, r8 adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0xA beq @08048B74 adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0xA bne @08048BA4 @08048B74: ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 6 ands r0, r1 cmp r0, 0 beq @08048BA4 cmp r5, 0x1 beq @08048B8A cmp r6, 0x80 bne @08048BA4 @08048B8A: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB5D1 b @08048D72 .align 2, 0 .pool @08048BA4: mov r4, r9 ldrb r0, [r4] movs r1, 0x58 adds r2, r0, 0 muls r2, r1 mov r0, r8 adds r1, r2, r0 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0xA bne @08048BBE b @08048DF4 @08048BBE: adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0xA bne @08048BCA b @08048DF4 @08048BCA: adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x29 bne @08048BD6 b @08048DF4 @08048BD6: mov r0, r8 adds r0, 0x4C adds r0, r2, r0 ldr r0, [r0] cmp r0, 0 beq @08048BE4 b @08048DF4 @08048BE4: movs r1, 0x1 mov r10, r1 b @08048DF4 @08048BEA: movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08048C26 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @08048C26 ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @08048C26 movs r2, 0 str r2, [sp, 0x4] @08048C26: ldr r4, =0x02024084 ldr r0, =0x0202420e ldrb r3, [r0] movs r0, 0x58 adds r2, r3, 0 muls r2, r0 adds r1, r2, r4 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0xF bne @08048C40 b @08048DF4 @08048C40: adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0xF bne @08048C4C b @08048DF4 @08048C4C: adds r0, r4, 0 adds r0, 0x4C adds r0, r2, r0 ldr r0, [r0] cmp r0, 0 beq @08048C5A b @08048DF4 @08048C5A: ldr r4, [sp, 0x4] cmp r4, 0 bne @08048C62 b @08048DF4 @08048C62: adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x28 bne @08048C6E b @08048DF4 @08048C6E: adds r0, r3, 0 bl b_cancel_multi_turn_move_maybe b @08048DE4 .align 2, 0 .pool @08048C84: mov r2, r9 ldrb r1, [r2] movs r0, 0x58 muls r1, r0 mov r3, r8 adds r0, r1, r3 adds r0, 0x20 ldrb r2, [r0] cmp r2, 0x7 bne @08048CF4 cmp r5, 0x1 beq @08048CA2 cmp r6, 0x80 beq @08048CA2 b @08048DF4 @08048CA2: ldr r0, =0x0202420a strb r2, [r0] mov r4, r9 ldrb r0, [r4] movs r1, 0x7 bl b_history__record_ability_usage_of_player ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB5DD str r0, [r4] ldr r2, =0x02024280 ldr r1, [r2] movs r0, 0x80 lsls r0, 6 ands r0, r1 cmp r0, 0 beq @08048CE8 movs r0, 0x1 ldr r3, =0x02024332 strb r0, [r3, 0x5] b @08048A4C .align 2, 0 .pool @08048CE8: ldr r4, =0x02024332 strb r0, [r4, 0x5] bl @080499B2 .align 2, 0 .pool @08048CF4: mov r0, r8 adds r0, 0x4C adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08048DF4 b @08048DE4 @08048D02: mov r2, r9 ldrb r1, [r2] movs r0, 0x58 muls r0, r1 add r0, r8 adds r0, 0x20 ldrb r1, [r0] cmp r1, 0x11 bne @08048D2C cmp r5, 0x1 bne @08048D1A b @08048A1A @08048D1A: cmp r6, 0x80 bne @08048D2C b @08048A1A @08048D20: ldr r1, =0x02024332 strb r0, [r1, 0x5] bl @080499B2 .align 2, 0 .pool @08048D2C: mov r2, r9 ldrb r0, [r2] movs r1, 0x58 muls r0, r1 add r0, r8 adds r1, r0, 0 adds r1, 0x21 ldrb r1, [r1] cmp r1, 0x3 beq @08048D50 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x3 beq @08048D50 cmp r1, 0x8 beq @08048D50 cmp r0, 0x8 bne @08048D94 @08048D50: ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 6 ands r0, r1 cmp r0, 0 beq @08048D94 cmp r5, 0x1 beq @08048D66 cmp r6, 0x80 bne @08048D94 @08048D66: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB5E9 @08048D72: str r0, [r4] ldr r1, =0x02024332 movs r2, 0 movs r0, 0x2 strb r0, [r1, 0x5] strb r2, [r1, 0x3] bl @080499B8 .align 2, 0 .pool @08048D94: mov r3, r9 ldrb r0, [r3] movs r6, 0x58 muls r0, r6 mov r2, r8 adds r2, 0x4C adds r5, r0, r2 ldr r4, [r5] cmp r4, 0 bne @08048DF4 mov r3, r8 adds r1, r0, r3 adds r0, r1, 0 adds r0, 0x21 ldrb r3, [r0] cmp r3, 0x3 beq @08048DEA adds r0, 0x1 ldrb r0, [r0] cmp r0, 0x3 beq @08048DEA cmp r3, 0x8 beq @08048DEA cmp r0, 0x8 beq @08048DEA adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x11 beq @08048DF4 mov r4, r9 ldrb r0, [r4] adds r1, r0, 0 muls r1, r6 adds r1, r2 ldr r0, [r1] movs r2, 0x9 negs r2, r2 ands r0, r2 str r0, [r1] @08048DE4: movs r0, 0x1 mov r10, r0 b @08048DF4 @08048DEA: ldr r0, =0x0202427c ldrb r1, [r0] movs r2, 0x8 orrs r1, r2 strb r1, [r0] @08048DF4: mov r1, r10 cmp r1, 0x1 beq @08048DFC b @08048F1C @08048DFC: ldr r0, =0x02024214 ldr r0, [r0] adds r0, 0x1 bl b_movescr_stack_push ldr r1, =gUnknown_0831C134 ldr r0, =0x02024332 ldrb r0, [r0, 0x3] lsls r0, 2 adds r0, r1 ldr r3, [r0] cmp r3, 0x7 bne @08048E50 bl GenerateRandomNumber ldr r2, =0x02024084 ldr r1, =0x0202420e ldrb r3, [r1] movs r1, 0x58 muls r3, r1 adds r2, 0x4C adds r3, r2 movs r1, 0x3 ands r1, r0 adds r1, 0x2 ldr r0, [r3] orrs r0, r1 str r0, [r3] b @08048E64 .align 2, 0 .pool @08048E50: ldr r2, =0x02024084 ldr r0, =0x0202420e ldrb r1, [r0] movs r0, 0x58 muls r1, r0 adds r2, 0x4C adds r1, r2 ldr r0, [r1] orrs r0, r3 str r0, [r1] @08048E64: ldr r2, =0x02024214 ldr r1, =gUnknown_0831C224 ldr r5, =0x02024332 ldrb r0, [r5, 0x3] lsls r0, 2 adds r0, r1 ldr r0, [r0] str r0, [r2] ldr r4, =0x02024064 ldr r1, =0x0202420e ldrb r0, [r1] strb r0, [r4] ldrb r1, [r1] movs r0, 0x58 muls r0, r1 ldr r1, =0x020240d0 adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r2, =0x02024280 ldr r1, [r2] movs r0, 0x80 lsls r0, 6 ands r0, r1 cmp r0, 0 beq @08048ED8 movs r0, 0x1 strb r0, [r5, 0x5] ldr r0, =0xffffdfff ands r1, r0 str r1, [r2] b @08048EDA .align 2, 0 .pool @08048ED8: strb r0, [r5, 0x5] @08048EDA: ldr r0, =0x02024332 ldrb r2, [r0, 0x3] cmp r2, 0x2 beq @08048EF2 cmp r2, 0x6 beq @08048EF2 cmp r2, 0x5 beq @08048EF2 cmp r2, 0x3 beq @08048EF2 bl @080499B8 @08048EF2: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0xB2 ldr r2, =0x02024332 ldrb r1, [r2, 0x3] strb r1, [r0] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 7 orrs r0, r1 str r0, [r2] bl @080499B8 .align 2, 0 .pool @08048F1C: mov r3, r10 cmp r3, 0 beq @08048F26 bl @080499B8 @08048F26: ldr r0, =0x02024332 strb r3, [r0, 0x3] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bl @080499B8 .align 2, 0 .pool @08048F40: mov r4, r9 ldrb r1, [r4] movs r0, 0x58 muls r1, r0 mov r0, r8 adds r0, 0x50 adds r1, r0 ldr r2, =gUnknown_0831C134 ldr r0, =0x02024332 ldrb r3, [r0, 0x3] lsls r0, r3, 2 adds r0, r2 ldr r1, [r1] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08048F66 bl @08049994 @08048F66: subs r0, r3, 0x7 cmp r0, 0x34 bls @08048F70 bl @080499B2 @08048F70: lsls r0, 2 ldr r1, =@08048F88 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08048F88: .4byte @0804905C .4byte @080490D0 .4byte @08049244 .4byte @0804915C .4byte @080491D8 .4byte @0804927C .4byte @080492C4 .4byte @08049390 .4byte @080493D4 .4byte @080493D4 .4byte @080493D4 .4byte @080493D4 .4byte @080493D4 .4byte @080493D4 .4byte @080493D4 .4byte @0804941C .4byte @0804941C .4byte @0804941C .4byte @0804941C .4byte @0804941C .4byte @0804941C .4byte @0804941C .4byte @080494FC .4byte @08049544 .4byte @08049564 .4byte @08049720 .4byte @0804975C .4byte @08049778 .4byte @08049790 .4byte @080497A8 .4byte @08049808 .4byte @08049820 .4byte @08049468 .4byte @08049468 .4byte @08049468 .4byte @08049468 .4byte @08049468 .4byte @08049468 .4byte @08049468 .4byte @080494B0 .4byte @080494B0 .4byte @080494B0 .4byte @080494B0 .4byte @080494B0 .4byte @080494B0 .4byte @080494B0 .4byte @08049864 .4byte @080498C0 .4byte @080499B2 .4byte @080499B2 .4byte @080499B2 .4byte @080499B2 .4byte @080499A4 @0804905C: mov r1, r9 ldrb r0, [r1] movs r5, 0x58 adds r1, r0, 0 muls r1, r5 mov r2, r8 adds r0, r1, r2 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x14 bne @08049076 bl @08049994 @08049076: mov r4, r8 adds r4, 0x50 adds r0, r1, r4 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @0804908A bl @08049994 @0804908A: bl GenerateRandomNumber mov r3, r9 ldrb r1, [r3] adds r2, r1, 0 muls r2, r5 adds r2, r4 lsls r0, 16 movs r1, 0xC0 lsls r1, 10 ands r1, r0 lsrs r1, 16 adds r1, 0x2 ldr r0, [r2] orrs r0, r1 str r0, [r2] ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r1, =gUnknown_0831C224 ldr r0, =0x02024332 ldrb r0, [r0, 0x3] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl @080499B0 .align 2, 0 .pool @080490D0: mov r4, r9 ldrb r2, [r4] movs r4, 0x58 adds r0, r2, 0 muls r0, r4 add r0, r8 adds r0, 0x20 ldrb r1, [r0] cmp r1, 0x27 bne @08049114 cmp r5, 0x1 beq @080490F0 cmp r6, 0x80 beq @080490F0 bl @08049994 @080490F0: ldr r0, =0x0202420a strb r1, [r0] mov r1, r9 ldrb r0, [r1] movs r1, 0x27 bl b_history__record_ability_usage_of_player ldr r1, =0x02024214 ldr r0, =gUnknown_082DB603 str r0, [r1] bl @080499B2 .align 2, 0 .pool @08049114: adds r0, r2, 0 bl sub_8048728 ldr r1, =0x02024082 lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bhi @0804912A bl @08049994 @0804912A: mov r2, r9 ldrb r0, [r2] adds r2, r0, 0 muls r2, r4 mov r0, r8 adds r0, 0x50 adds r2, r0 ldr r1, =gUnknown_0831C134 ldr r0, =0x02024332 ldrb r0, [r0, 0x3] lsls r0, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] orrs r1, r0 str r1, [r2] bl @08049994 .align 2, 0 .pool @0804915C: mov r3, r9 ldrb r0, [r3] movs r5, 0x58 muls r0, r5 mov r4, r8 adds r4, 0x50 adds r2, r0, r4 ldr r1, [r2] movs r0, 0x70 ands r0, r1 cmp r0, 0 beq @08049178 bl @08049994 @08049178: movs r0, 0x80 lsls r0, 5 orrs r1, r0 str r1, [r2] ldr r1, =0x02024268 ldrb r0, [r3] lsls r0, 1 adds r0, r1 ldr r1, =0x020241ea ldrh r1, [r1] strh r1, [r0] bl GenerateRandomNumber mov r2, r9 ldrb r1, [r2] adds r2, r1, 0 muls r2, r5 adds r2, r4 movs r1, 0x3 ands r1, r0 adds r1, 0x2 lsls r1, 4 ldr r0, [r2] orrs r0, r1 str r0, [r2] ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r1, =gUnknown_0831C224 ldr r0, =0x02024332 ldrb r0, [r0, 0x3] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl @080499B0 .align 2, 0 .pool @080491D8: ldr r5, =0x0202420b ldrb r0, [r5] bl battle_get_per_side_status movs r1, 0x1 ands r1, r0 cmp r1, 0 bne @08049210 ldr r4, =0x0202432e ldrh r3, [r4] ldr r2, =0x02024084 ldrb r1, [r5] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x2A ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 adds r0, r3, r0 strh r0, [r4] lsls r0, 16 lsrs r0, 16 cmp r3, r0 bls @08049210 ldr r3, =0x0000ffff adds r0, r3, 0 strh r0, [r4] @08049210: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r1, =gUnknown_0831C224 ldr r0, =0x02024332 ldrb r0, [r0, 0x3] lsls r0, 2 adds r0, r1 ldr r0, [r0] b @080499B0 .align 2, 0 .pool @08049244: mov r4, r9 ldrb r1, [r4] movs r0, 0x58 muls r0, r1 mov r1, r8 adds r1, 0x4C adds r0, r1 ldr r0, [r0] cmp r0, 0 beq @0804925A b @08049994 @0804925A: bl GenerateRandomNumber ldr r4, =0x02024332 lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 adds r0, 0x3 strb r0, [r4, 0x3] movs r0, 0 movs r1, 0 bl sub_8048760 b @080499B2 .align 2, 0 .pool @0804927C: mov r0, r9 ldrb r1, [r0] movs r0, 0x58 adds r2, r1, 0 muls r2, r0 mov r0, r8 adds r0, 0x50 adds r2, r0 ldr r0, [r2] movs r1, 0x80 lsls r1, 5 orrs r0, r1 str r0, [r2] ldr r1, =0x02024268 mov r2, r9 ldrb r0, [r2] lsls r0, 1 adds r0, r1 ldr r1, =0x020241ea ldrh r1, [r1] strh r1, [r0] ldr r0, =0x0202433c ldrb r1, [r2] lsls r1, 4 adds r1, r0 ldrb r0, [r1, 0x1] movs r2, 0x4 orrs r0, r2 strb r0, [r1, 0x1] b @08049994 .align 2, 0 .pool @080492C4: mov r3, r9 ldrb r0, [r3] movs r6, 0x58 muls r0, r6 mov r4, r8 adds r4, 0x50 adds r0, r4 ldr r5, [r0] movs r0, 0xE0 lsls r0, 8 ands r5, r0 cmp r5, 0 beq @080492E0 b @08049994 @080492E0: bl GenerateRandomNumber mov r2, r9 ldrb r1, [r2] adds r2, r1, 0 muls r2, r6 adds r2, r4 movs r1, 0x3 ands r1, r0 adds r1, 0x3 lsls r1, 13 ldr r0, [r2] orrs r0, r1 str r0, [r2] mov r3, r9 ldrb r1, [r3] ldr r2, =0x0202449c ldr r0, [r2] lsls r1, 1 adds r1, r0 ldr r6, =0x020241ea ldrh r0, [r6] strb r0, [r1, 0x4] ldrb r1, [r3] ldr r0, [r2] lsls r1, 1 adds r1, r0 ldrh r0, [r6] lsrs r0, 8 strb r0, [r1, 0x5] ldrb r1, [r3] ldr r0, [r2] adds r1, r0 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r1, 0x14] ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r1, =gUnknown_0831C224 ldr r2, =0x02024332 ldrb r0, [r2, 0x3] lsls r0, 2 adds r0, r1 ldr r0, [r0] str r0, [r4] strb r5, [r2, 0x5] ldr r3, =gUnknown_085CC982 ldrh r0, [r3] ldrh r4, [r6] cmp r0, r4 bne @0804934E b @080499B2 @0804934E: adds r1, r2, 0 adds r2, r6, 0 @08049352: ldrb r0, [r1, 0x5] adds r0, 0x1 strb r0, [r1, 0x5] lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bls @08049362 b @080499B2 @08049362: ldrb r0, [r1, 0x5] lsls r0, 1 adds r0, r3 ldrh r0, [r0] ldrh r4, [r2] cmp r0, r4 bne @08049352 b @080499B2 .align 2, 0 .pool @08049390: ldr r1, =0x020241f0 ldr r0, =0x020241f4 ldr r0, [r0] cmp r0, 0 bge @0804939C adds r0, 0x3 @0804939C: asrs r0, 2 str r0, [r1] cmp r0, 0 bne @080493A8 movs r0, 0x1 str r0, [r1] @080493A8: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r1, =gUnknown_0831C224 ldr r0, =0x02024332 ldrb r0, [r0, 0x3] lsls r0, 2 adds r0, r1 ldr r0, [r0] b @080499B0 .align 2, 0 .pool @080493D4: ldr r4, =0x02024332 ldrb r1, [r4, 0x3] adds r1, 0xF2 lsls r1, 24 lsrs r1, 24 movs r0, 0x10 adds r2, r7, 0 movs r3, 0 bl sub_8050A1C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @080493F2 b @08049994 @080493F2: ldr r2, =0x02024474 ldrb r1, [r4, 0x3] movs r0, 0x3F ands r0, r1 strb r0, [r2, 0x10] strb r3, [r2, 0x11] ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082D8CD4 b @080499B0 .align 2, 0 .pool @0804941C: movs r0, 0x70 negs r0, r0 ldr r4, =0x02024332 ldrb r1, [r4, 0x3] adds r1, 0xEB lsls r1, 24 lsrs r1, 24 adds r2, r7, 0 movs r3, 0 bl sub_8050A1C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @0804943C b @08049994 @0804943C: ldr r2, =0x02024474 ldrb r1, [r4, 0x3] movs r0, 0x3F ands r0, r1 strb r0, [r2, 0x10] strb r3, [r2, 0x11] ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082D8D65 b @080499B0 .align 2, 0 .pool @08049468: ldr r4, =0x02024332 ldrb r1, [r4, 0x3] adds r1, 0xDA lsls r1, 24 lsrs r1, 24 movs r0, 0x20 adds r2, r7, 0 movs r3, 0 bl sub_8050A1C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @08049486 b @08049994 @08049486: ldr r2, =0x02024474 ldrb r1, [r4, 0x3] movs r0, 0x3F ands r0, r1 strb r0, [r2, 0x10] strb r3, [r2, 0x11] ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082D8CD4 b @080499B0 .align 2, 0 .pool @080494B0: movs r0, 0x60 negs r0, r0 ldr r4, =0x02024332 ldrb r1, [r4, 0x3] adds r1, 0xD3 lsls r1, 24 lsrs r1, 24 adds r2, r7, 0 movs r3, 0 bl sub_8050A1C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @080494D0 b @08049994 @080494D0: ldr r2, =0x02024474 ldrb r1, [r4, 0x3] movs r0, 0x3F ands r0, r1 strb r0, [r2, 0x10] strb r3, [r2, 0x11] ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082D8D65 b @080499B0 .align 2, 0 .pool @080494FC: mov r0, r9 ldrb r1, [r0] movs r0, 0x58 adds r2, r1, 0 muls r2, r0 mov r0, r8 adds r0, 0x50 adds r2, r0 ldr r0, [r2] movs r1, 0x80 lsls r1, 15 orrs r0, r1 str r0, [r2] ldr r2, =0x020242bc mov r3, r9 ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x2 strb r1, [r0, 0x19] ldr r1, =0x02024268 ldrb r0, [r3] lsls r0, 1 adds r0, r1 ldr r1, =0x020241ea ldrh r1, [r1] strh r1, [r0] b @08049994 .align 2, 0 .pool @08049544: ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 adds r2, r1, 0 muls r2, r0 mov r0, r8 adds r0, 0x50 adds r2, r0 ldr r0, [r2] movs r1, 0x80 lsls r1, 16 @0804955A: orrs r0, r1 str r0, [r2] b @08049994 .align 2, 0 .pool @08049564: ldr r5, =0x02022fec ldr r0, [r5] movs r1, 0x80 lsls r1, 19 ands r0, r1 cmp r0, 0 beq @08049574 b @08049994 @08049574: ldr r6, =0x0202420b ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080495A8 ldr r0, [r5] ldr r1, =0x0a3f0902 ands r0, r1 cmp r0, 0 bne @080495D4 b @08049994 .align 2, 0 .pool @080495A8: ldr r0, [r5] ldr r1, =0x0a3f0902 ands r0, r1 cmp r0, 0 bne @080495D4 ldr r0, =0x020243d0 adds r0, 0x29 adds r0, r4, r0 ldrb r1, [r0] ldr r3, =gUnknown_0832A328 ldr r2, =0x0202406e ldrb r0, [r6] lsls r0, 1 adds r0, r2 ldrh r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @080495D4 b @08049994 @080495D4: ldr r2, =0x02024084 ldr r1, =0x0202420c ldrb r0, [r1] movs r5, 0x58 muls r0, r5 adds r4, r0, r2 ldrh r0, [r4, 0x2E] adds r7, r1, 0 mov r8, r2 cmp r0, 0 beq @0804963C adds r0, r4, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x3C bne @0804963C bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB682 str r0, [r1] ldr r1, =0x0202420a ldrb r0, [r7] muls r0, r5 add r0, r8 adds r0, 0x20 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r7] ldrb r1, [r1] bl b_history__record_ability_usage_of_player b @080499B2 .align 2, 0 .pool @0804963C: ldr r4, =0x0202420b mov r10, r4 ldrb r2, [r4] movs r0, 0x58 mov r9, r0 mov r0, r9 muls r0, r2 add r0, r8 ldrh r4, [r0, 0x2E] cmp r4, 0 beq @08049654 b @08049994 @08049654: ldrb r0, [r7] mov r1, r9 muls r1, r0 adds r0, r1, 0 add r0, r8 ldrh r3, [r0, 0x2E] adds r1, r3, 0 cmp r1, 0xAF bne @08049668 b @08049994 @08049668: adds r0, r3, 0 subs r0, 0x79 lsls r0, 16 lsrs r0, 16 cmp r0, 0xB bhi @08049676 b @08049994 @08049676: cmp r1, 0 bne @0804967C b @08049994 @0804967C: ldr r5, =0x0202449c lsls r0, r2, 1 adds r0, 0xD0 ldr r1, [r5] adds r1, r0 ldr r2, =0x02024208 strh r3, [r1] strh r3, [r2] ldrb r0, [r7] mov r3, r9 muls r3, r0 adds r0, r3, 0 add r0, r8 movs r6, 0 strh r4, [r0, 0x2E] ldr r4, =0x02024064 mov r1, r10 ldrb r0, [r1] strb r0, [r4] str r2, [sp] movs r0, 0 movs r1, 0x2 movs r2, 0 movs r3, 0x2 bl dp01_build_cmdbuf_x02_a_b_varargs mov r2, r10 ldrb r0, [r2] bl dp01_battle_side_mark_buffer_for_execution ldrb r0, [r7] strb r0, [r4] ldrb r0, [r7] mov r3, r9 muls r3, r0 adds r0, r3, 0 mov r1, r8 adds r1, 0x2E adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x2 movs r2, 0 movs r3, 0x2 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r7] bl dp01_battle_side_mark_buffer_for_execution ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB422 str r0, [r4] ldrb r0, [r7] ldr r1, [r5] lsls r0, 1 adds r0, r1 adds r0, 0xC8 strb r6, [r0] ldrb r0, [r7] ldr r1, [r5] lsls r0, 1 adds r0, r1 adds r0, 0xC9 strb r6, [r0] b @080499B2 .align 2, 0 .pool @08049720: ldr r3, =0x0202420c ldrb r1, [r3] movs r0, 0x58 adds r2, r1, 0 muls r2, r0 mov r0, r8 adds r0, 0x50 adds r2, r0 ldr r0, [r2] movs r1, 0x80 lsls r1, 19 orrs r0, r1 str r0, [r2] ldr r2, =0x020242bc ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0202420b ldrb r1, [r1] strb r1, [r0, 0x14] b @08049994 .align 2, 0 .pool @0804975C: ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 adds r2, r1, 0 muls r2, r0 mov r0, r8 adds r0, 0x50 adds r2, r0 ldr r0, [r2] movs r1, 0x80 lsls r1, 20 b @0804955A .align 2, 0 .pool @08049778: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DAF27 b @080499B0 .align 2, 0 .pool @08049790: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DAFC3 b @080499B0 .align 2, 0 .pool @080497A8: ldr r6, =0x0202420c ldrb r0, [r6] movs r2, 0x58 muls r0, r2 mov r1, r8 adds r1, 0x4C adds r5, r0, r1 ldr r4, [r5] movs r0, 0x40 ands r0, r4 cmp r0, 0 bne @080497C2 b @08049994 @080497C2: movs r0, 0x41 negs r0, r0 ands r4, r0 str r4, [r5] ldr r4, =0x02024064 ldrb r0, [r6] strb r0, [r4] ldrb r0, [r4] muls r0, r2 adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB361 b @080499B0 .align 2, 0 .pool @08049808: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB117 b @080499B0 .align 2, 0 .pool @08049820: ldr r4, =0x020241f0 ldr r0, =0x020241f4 ldr r0, [r0] movs r1, 0x3 bl __divsi3 str r0, [r4] cmp r0, 0 bne @08049836 movs r0, 0x1 str r0, [r4] @08049836: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r1, =gUnknown_0831C224 ldr r0, =0x02024332 ldrb r0, [r0, 0x3] lsls r0, 2 adds r0, r1 ldr r0, [r0] b @080499B0 .align 2, 0 .pool @08049864: mov r4, r9 ldrb r0, [r4] movs r5, 0x58 muls r0, r5 mov r4, r8 adds r4, 0x50 adds r2, r0, r4 ldr r1, [r2] movs r0, 0xC0 lsls r0, 4 ands r0, r1 cmp r0, 0 beq @08049880 b @08049994 @08049880: movs r0, 0x80 lsls r0, 5 orrs r1, r0 str r1, [r2] ldr r1, =0x02024268 mov r2, r9 ldrb r0, [r2] lsls r0, 1 adds r0, r1 ldr r1, =0x020241ea ldrh r1, [r1] strh r1, [r0] bl GenerateRandomNumber mov r3, r9 ldrb r1, [r3] adds r2, r1, 0 muls r2, r5 adds r2, r4 movs r1, 0x1 ands r1, r0 adds r1, 0x2 lsls r1, 10 ldr r0, [r2] orrs r0, r1 str r0, [r2] b @080499B2 .align 2, 0 .pool @080498C0: mov r4, r9 ldrb r3, [r4] movs r5, 0x58 adds r0, r3, 0 muls r0, r5 mov r2, r8 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x20 ldrb r2, [r0] cmp r2, 0x3C bne @08049900 ldrh r0, [r1, 0x2E] cmp r0, 0 beq @08049994 ldr r0, =0x0202420a strb r2, [r0] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB63F str r0, [r1] ldrb r0, [r4] movs r1, 0x3C bl b_history__record_ability_usage_of_player b @080499B2 .align 2, 0 .pool @08049900: ldrh r0, [r1, 0x2E] cmp r0, 0 beq @08049994 adds r0, r3, 0 bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x02024208 mov r3, r9 ldrb r0, [r3] muls r0, r5 add r0, r8 ldrh r0, [r0, 0x2E] strh r0, [r1] ldrb r0, [r3] muls r0, r5 add r0, r8 movs r5, 0 movs r1, 0 strh r1, [r0, 0x2E] ldr r2, =0x020243d0 adds r2, 0x29 adds r2, r4, r2 ldr r3, =gUnknown_0832A328 ldr r1, =0x0202406e mov r4, r9 ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB168 str r0, [r4] mov r1, r9 ldrb r0, [r1] ldr r2, =0x0202449c ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0xC8 strb r5, [r0] mov r3, r9 ldrb r0, [r3] ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0xC9 strb r5, [r0] b @080499B2 .align 2, 0 .pool @08049994: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] b @080499B2 .align 2, 0 .pool @080499A4: ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB1D5 @080499B0: str r0, [r4] @080499B2: ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x3] @080499B8: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8048760 thumb_func_start atk15_seteffectwithchancetarget atk15_seteffectwithchancetarget: ; 80499D4 push {r4,lr} ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x20 bne @08049A10 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x5] lsls r4, r0, 1 b @08049A20 .align 2, 0 .pool @08049A10: ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r4, [r0, 0x5] @08049A20: ldr r3, =0x02024332 ldrb r2, [r3, 0x3] movs r0, 0x80 ands r0, r2 cmp r0, 0 beq @08049A50 ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @08049A50 movs r0, 0x7F ands r0, r2 strb r0, [r3, 0x3] b @08049A7E .align 2, 0 .pool @08049A50: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, r4 bcs @08049A9A ldr r0, =0x02024332 ldrb r0, [r0, 0x3] cmp r0, 0 beq @08049A9A ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @08049A9A cmp r4, 0x63 bls @08049A90 @08049A7E: movs r0, 0 movs r1, 0x80 bl sub_8048760 b @08049AA2 .align 2, 0 .pool @08049A90: movs r0, 0 movs r1, 0 bl sub_8048760 b @08049AA2 @08049A9A: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @08049AA2: ldr r0, =0x02024332 movs r1, 0 strb r1, [r0, 0x3] ldr r0, =0x02024474 strb r1, [r0, 0x16] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk15_seteffectwithchancetarget thumb_func_start sub_8049AC0 sub_8049AC0: ; 8049AC0 push {lr} movs r0, 0x1 movs r1, 0 bl sub_8048760 pop {r0} bx r0 thumb_func_end sub_8049AC0 thumb_func_start sub_8049AD0 sub_8049AD0: ; 8049AD0 push {lr} movs r0, 0 movs r1, 0 bl sub_8048760 pop {r0} bx r0 thumb_func_end sub_8049AD0 thumb_func_start sub_8049AE0 sub_8049AE0: ; 8049AE0 push {lr} ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r2, =0x02024064 strb r0, [r2] ldr r3, =0x02024332 ldrb r0, [r3, 0x3] cmp r0, 0x6 bhi @08049B14 ldr r1, =0x02024084 ldrb r2, [r2] movs r0, 0x58 muls r2, r0 adds r1, 0x4C b @08049B1E .align 2, 0 .pool @08049B14: ldr r1, =0x02024084 ldrb r2, [r2] movs r0, 0x58 muls r2, r0 adds r1, 0x50 @08049B1E: adds r2, r1 ldr r1, =gUnknown_0831C134 ldrb r0, [r3, 0x3] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] ldr r0, =0x02024332 movs r2, 0 strb r2, [r0, 0x3] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] ldr r0, =0x02024474 strb r2, [r0, 0x16] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8049AE0 thumb_func_start atk19_faintpokemon atk19_faintpokemon: ; 8049B5C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 ldr r0, =0x02024214 ldr r2, [r0] ldrb r1, [r2, 0x2] adds r6, r0, 0 cmp r1, 0 beq @08049BE0 ldrb r0, [r2, 0x1] bl get_battle_side_of_something ldr r5, =0x02024064 strb r0, [r5] ldr r2, =0x02024280 ldr r1, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, [r0] lsls r1, 28 ldr r0, [r2] ands r0, r1 cmp r0, 0 bne @08049B94 b @08049E2C @08049B94: ldr r1, [r6] ldrb r4, [r1, 0x3] ldrb r0, [r1, 0x4] lsls r0, 8 orrs r4, r0 ldrb r0, [r1, 0x5] lsls r0, 16 orrs r4, r0 ldrb r0, [r1, 0x6] lsls r0, 24 orrs r4, r0 bl b_movescr_stack_pop_cursor str r4, [r6] ldrb r0, [r5] bl battle_side_get_owner ldr r1, =0x0202428e lsls r0, 24 lsrs r0, 23 adds r0, r1 ldrh r2, [r0] ldr r1, =0x0000fdff ands r1, r2 strh r1, [r0] b @08049E32 .align 2, 0 .pool @08049BE0: ldrb r0, [r2, 0x1] cmp r0, 0x1 bne @08049C08 ldr r1, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r1] ldr r0, =0x0202420c ldrb r0, [r0] mov r9, r0 ldr r4, =gUnknown_082DA7AA b @08049C18 .align 2, 0 .pool @08049C08: ldr r1, =0x02024064 ldr r0, =0x0202420c ldrb r0, [r0] strb r0, [r1] ldr r0, =0x0202420b ldrb r0, [r0] mov r9, r0 ldr r4, =gUnknown_082DA7B7 @08049C18: mov r8, r1 ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 mov r7, r8 ldrb r3, [r7] lsls r0, r3, 2 adds r0, r2 ldr r2, [r0] ands r1, r2 cmp r1, 0 beq @08049C32 b @08049E2C @08049C32: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r3 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08049C42 b @08049E2C @08049C42: ldr r5, =0x02024280 lsls r1, r2, 28 ldr r0, [r5] orrs r0, r1 str r0, [r5] ldr r0, [r6] adds r0, 0x7 bl b_movescr_stack_push str r4, [r6] ldrb r0, [r7] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08049CA4 ldr r0, [r5] movs r1, 0x80 lsls r1, 15 orrs r0, r1 str r0, [r5] ldr r1, =0x03005d10 ldrb r0, [r1] cmp r0, 0xFE bhi @08049C78 adds r0, 0x1 strb r0, [r1] @08049C78: ldrb r0, [r7] bl sub_80570F4 b @08049CCE .align 2, 0 .pool @08049CA4: ldr r4, =0x03005d10 ldrb r0, [r4, 0x1] cmp r0, 0xFE bhi @08049CB0 adds r0, 0x1 strb r0, [r4, 0x1] @08049CB0: ldr r1, =0x0202406e mov r2, r8 ldrb r0, [r2] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr strh r0, [r4, 0x20] @08049CCE: ldr r2, =0x02024280 ldr r1, [r2] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @08049D0C ldr r6, =0x02024084 ldr r0, =0x0202420b ldrb r0, [r0] movs r5, 0x58 muls r0, r5 adds r0, r6 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08049D0C movs r0, 0x41 negs r0, r0 ands r1, r0 str r1, [r2] ldr r4, =0x02024214 ldr r0, [r4] bl b_movescr_stack_push ldr r1, =0x020241f0 mov r0, r9 muls r0, r5 adds r0, r6 ldrh r0, [r0, 0x28] str r0, [r1] ldr r0, =gUnknown_082DAE3E str r0, [r4] @08049D0C: ldr r1, =0x020242ac ldr r6, =0x0202420c ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 7 ands r0, r1 cmp r0, 0 bne @08049D24 b @08049E32 @08049D24: ldr r0, =0x02024280 ldr r5, [r0] movs r0, 0x80 lsls r0, 17 ands r5, r0 cmp r5, 0 beq @08049D34 b @08049E32 @08049D34: ldr r3, =0x0202420b mov r8, r3 ldrb r0, [r3] bl battle_side_get_owner adds r4, r0, 0 ldrb r0, [r6] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 beq @08049E32 ldr r0, =0x02024084 mov r9, r0 mov r2, r8 ldrb r1, [r2] movs r7, 0x58 adds r2, r1, 0 muls r2, r7 adds r0, r2, r0 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08049E32 ldr r0, =0x020241ea ldrh r0, [r0] cmp r0, 0xA5 beq @08049E32 ldr r0, =0x0202449c ldr r0, [r0] adds r0, r1, r0 adds r0, 0x80 ldrb r4, [r0] adds r0, r4, r2 mov r6, r9 adds r6, 0x24 adds r0, r6 strb r5, [r0] ldr r5, =0x02024214 ldr r0, [r5] bl b_movescr_stack_push ldr r0, =gUnknown_082DB18D str r0, [r5] ldr r5, =0x02024064 mov r3, r8 ldrb r0, [r3] strb r0, [r5] adds r1, r4, 0 adds r1, 0x9 lsls r1, 24 lsrs r1, 24 ldrb r0, [r5] muls r0, r7 adds r0, r6 adds r0, r4 str r0, [sp] movs r0, 0 movs r2, 0 movs r3, 0x1 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] lsls r4, 1 mov r2, r8 ldrb r0, [r2] muls r0, r7 adds r0, r4, r0 mov r2, r9 adds r2, 0xC adds r0, r2 ldrh r0, [r0] strb r0, [r1, 0x2] mov r3, r8 ldrb r0, [r3] muls r0, r7 adds r4, r0 adds r4, r2 ldrh r0, [r4] lsrs r0, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] b @08049E32 .align 2, 0 .pool @08049E2C: ldr r0, [r6] adds r0, 0x7 str r0, [r6] @08049E32: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end atk19_faintpokemon thumb_func_start sub_8049E40 sub_8049E40: ; 8049E40 push {r4,r5,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @08049E6A ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] movs r0, 0 bl dp01_build_cmdbuf_x0A_A_A_A ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x2 str r0, [r5] @08049E6A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8049E40 thumb_func_start sub_8049E7C sub_8049E7C: ; 8049E7C push {r4,r5,lr} sub sp, 0x4 ldr r0, =0x02024068 ldr r5, [r0] cmp r5, 0 bne @08049EE8 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @08049EB4 ldr r2, =0x02024084 ldrb r1, [r4] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08049EDC @08049EB4: ldr r1, =0x02024084 ldrb r0, [r4] movs r2, 0x58 muls r0, r2 adds r1, 0x4C adds r0, r1 str r5, [r0] ldrb r0, [r4] muls r0, r2 adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @08049EDC: bl sub_803A75C ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] @08049EE8: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8049E7C thumb_func_start atk1C_jumpifstatus atk1C_jumpifstatus: ; 8049F04 push {r4,r5,lr} ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something lsls r0, 24 lsrs r0, 24 ldr r2, [r5] ldrb r4, [r2, 0x2] ldrb r1, [r2, 0x3] lsls r1, 8 adds r4, r1 ldrb r1, [r2, 0x4] lsls r1, 16 adds r4, r1 ldrb r1, [r2, 0x5] lsls r1, 24 adds r4, r1 ldrb r3, [r2, 0x6] ldrb r1, [r2, 0x7] lsls r1, 8 adds r3, r1 ldrb r1, [r2, 0x8] lsls r1, 16 adds r3, r1 ldrb r1, [r2, 0x9] lsls r1, 24 adds r3, r1 ldr r2, =0x02024084 movs r1, 0x58 muls r1, r0 adds r0, r2, 0 adds r0, 0x4C adds r0, r1, r0 ldr r0, [r0] ands r0, r4 cmp r0, 0 beq @08049F68 adds r0, r1, r2 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08049F68 str r3, [r5] b @08049F70 .align 2, 0 .pool @08049F68: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0xA str r0, [r1] @08049F70: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk1C_jumpifstatus thumb_func_start atk1D_jumpifsecondarystatus atk1D_jumpifsecondarystatus: ; 8049F7C push {r4,r5,lr} ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something lsls r0, 24 lsrs r0, 24 ldr r2, [r5] ldrb r4, [r2, 0x2] ldrb r1, [r2, 0x3] lsls r1, 8 adds r4, r1 ldrb r1, [r2, 0x4] lsls r1, 16 adds r4, r1 ldrb r1, [r2, 0x5] lsls r1, 24 adds r4, r1 ldrb r3, [r2, 0x6] ldrb r1, [r2, 0x7] lsls r1, 8 adds r3, r1 ldrb r1, [r2, 0x8] lsls r1, 16 adds r3, r1 ldrb r1, [r2, 0x9] lsls r1, 24 adds r3, r1 ldr r2, =0x02024084 movs r1, 0x58 muls r1, r0 adds r0, r2, 0 adds r0, 0x50 adds r0, r1, r0 ldr r0, [r0] ands r0, r4 cmp r0, 0 beq @08049FE0 adds r0, r1, r2 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08049FE0 str r3, [r5] b @08049FE8 .align 2, 0 .pool @08049FE0: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0xA str r0, [r1] @08049FE8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk1D_jumpifsecondarystatus thumb_func_start atk1E_jumpifability atk1E_jumpifability: ; 8049FF4 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 ldr r6, =0x02024214 ldr r2, [r6] ldrb r5, [r2, 0x2] mov r8, r5 ldrb r1, [r2, 0x3] ldrb r0, [r2, 0x4] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x5] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x6] lsls r0, 24 adds r7, r1, r0 ldrb r0, [r2, 0x1] cmp r0, 0x8 bne @0804A054 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0 str r0, [sp] movs r0, 0xD adds r2, r5, 0 movs r3, 0 bl ability_something lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @0804A0C8 ldr r1, =0x0202420a strb r5, [r1] str r7, [r6] subs r4, 0x1 lsls r0, r4, 24 lsrs r0, 24 ldrb r1, [r1] b @0804A0B0 .align 2, 0 .pool @0804A054: cmp r0, 0x9 bne @0804A08C ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0 str r0, [sp] movs r0, 0xC adds r2, r5, 0 movs r3, 0 bl ability_something lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @0804A0C8 ldr r1, =0x0202420a strb r5, [r1] str r7, [r6] subs r4, 0x1 lsls r0, r4, 24 lsrs r0, 24 ldrb r1, [r1] b @0804A0B0 .align 2, 0 .pool @0804A08C: ldrb r0, [r2, 0x1] bl get_battle_side_of_something lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r4 adds r0, r1 adds r0, 0x20 ldrb r1, [r0] cmp r1, r8 bne @0804A0C8 ldr r0, =0x0202420a strb r1, [r0] str r7, [r6] ldrb r1, [r0] adds r0, r4, 0 @0804A0B0: bl b_history__record_ability_usage_of_player ldr r0, =0x02024474 strb r4, [r0, 0x15] b @0804A0CE .align 2, 0 .pool @0804A0C8: ldr r0, [r6] adds r0, 0x7 str r0, [r6] @0804A0CE: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end atk1E_jumpifability thumb_func_start sub_804A0DC sub_804A0DC: ; 804A0DC push {r4-r6,lr} ldr r0, =0x02024214 ldr r0, [r0] ldrb r4, [r0, 0x1] cmp r4, 0x1 bne @0804A0FC ldr r0, =0x0202420b ldrb r0, [r0] bl battle_get_per_side_status b @0804A106 .align 2, 0 .pool @0804A0FC: ldr r0, =0x0202420c ldrb r0, [r0] bl battle_get_per_side_status movs r4, 0x1 @0804A106: ands r4, r0 ldr r6, =0x02024214 ldr r3, [r6] ldrb r2, [r3, 0x2] ldrb r0, [r3, 0x3] lsls r0, 8 orrs r2, r0 ldrb r1, [r3, 0x4] ldrb r0, [r3, 0x5] lsls r0, 8 adds r1, r0 ldrb r0, [r3, 0x6] lsls r0, 16 adds r1, r0 ldrb r0, [r3, 0x7] lsls r0, 24 adds r5, r1, r0 ldr r1, =0x0202428e lsls r0, r4, 1 adds r0, r1 ldrh r0, [r0] ands r2, r0 cmp r2, 0 beq @0804A148 str r5, [r6] b @0804A14E .align 2, 0 .pool @0804A148: adds r0, r3, 0 adds r0, 0x8 str r0, [r6] @0804A14E: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_804A0DC thumb_func_start sub_804A154 sub_804A154: ; 804A154 push {r4,r5,lr} movs r5, 0 ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something lsls r0, 24 lsrs r0, 24 ldr r2, =0x02024084 ldr r3, [r4] movs r1, 0x58 muls r0, r1 ldrb r1, [r3, 0x3] adds r0, r1 adds r2, 0x18 adds r0, r2 ldrb r2, [r0] ldrb r0, [r3, 0x2] cmp r0, 0x5 bhi @0804A212 lsls r0, 2 ldr r1, =@0804A194 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0804A194: .4byte @0804A1AC .4byte @0804A1BC .4byte @0804A1CC .4byte @0804A1DC .4byte @0804A1EC .4byte @0804A200 @0804A1AC: ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r2, r0 bne @0804A212 b @0804A20C .align 2, 0 .pool @0804A1BC: ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r2, r0 beq @0804A212 b @0804A20C .align 2, 0 .pool @0804A1CC: ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r2, r0 bls @0804A212 b @0804A20C .align 2, 0 .pool @0804A1DC: ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r2, r0 bcs @0804A212 b @0804A20C .align 2, 0 .pool @0804A1EC: ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x4] ands r2, r0 cmp r2, 0 beq @0804A212 b @0804A20C .align 2, 0 .pool @0804A200: ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x4] ands r2, r0 cmp r2, 0 bne @0804A212 @0804A20C: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @0804A212: cmp r5, 0 beq @0804A238 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x5] ldrb r0, [r2, 0x6] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x7] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x8] lsls r0, 24 adds r1, r0 str r1, [r3] b @0804A240 .align 2, 0 .pool @0804A238: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x9 str r0, [r1] @0804A240: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804A154 thumb_func_start atk21_jumpifspecialstatusflag atk21_jumpifspecialstatusflag: ; 804A24C push {r4-r6,lr} ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r5, =0x02024064 strb r0, [r5] ldr r2, [r4] ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x5] lsls r0, 24 adds r6, r1, r0 ldrb r1, [r2, 0x7] ldrb r0, [r2, 0x8] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x9] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0xA] lsls r0, 24 adds r3, r1, r0 ldrb r0, [r2, 0x6] cmp r0, 0 beq @0804A2AC ldr r0, =0x020242ac ldrb r1, [r5] lsls r1, 2 adds r1, r0 ldr r0, [r1] ands r0, r6 cmp r0, 0 bne @0804A2C4 b @0804A2BC .align 2, 0 .pool @0804A2AC: ldr r0, =0x020242ac ldrb r1, [r5] lsls r1, 2 adds r1, r0 ldr r0, [r1] ands r0, r6 cmp r0, 0 beq @0804A2C4 @0804A2BC: str r3, [r4] b @0804A2CA .align 2, 0 .pool @0804A2C4: adds r0, r2, 0 adds r0, 0xB str r0, [r4] @0804A2CA: pop {r4-r6} pop {r0} bx r0 thumb_func_end atk21_jumpifspecialstatusflag thumb_func_start sub_804A2D0 sub_804A2D0: ; 804A2D0 push {r4-r6,lr} ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something lsls r0, 24 lsrs r0, 24 ldr r3, [r4] ldrb r5, [r3, 0x2] ldrb r2, [r3, 0x3] ldrb r1, [r3, 0x4] lsls r1, 8 adds r2, r1 ldrb r1, [r3, 0x5] lsls r1, 16 adds r2, r1 ldrb r1, [r3, 0x6] lsls r1, 24 adds r6, r2, r1 ldr r2, =0x02024084 movs r1, 0x58 muls r0, r1 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, r5 beq @0804A314 adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, r5 bne @0804A320 @0804A314: str r6, [r4] b @0804A324 .align 2, 0 .pool @0804A320: adds r0, r3, 0x7 str r0, [r4] @0804A324: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_804A2D0 thumb_func_start sub_804A32C sub_804A32C: ; 804A32C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r6, 0 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x50 mov r9, r0 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r1, =0x0202420d strb r0, [r1] ldr r2, =0x020243fe movs r1, 0x2 ands r1, r0 lsls r1, 24 lsrs r1, 25 adds r1, r2 ldrb r1, [r1] mov r8, r1 ldr r0, =0x02024474 ldrb r0, [r0, 0x1C] cmp r0, 0x6 bls @0804A368 bl @0804ACB2 @0804A368: lsls r0, 2 ldr r1, =@0804A38C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0804A38C: .4byte @0804A3A8 .4byte @0804A414 .4byte @0804A52E .4byte @0804A850 .4byte @0804A954 .4byte @0804AC40 .4byte @0804AC88 @0804A3A8: ldr r4, =0x0202420d ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0804A3BC bl @0804AC7C @0804A3BC: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x063f0982 ands r0, r1 cmp r0, 0 beq @0804A3CC bl @0804AC7C @0804A3CC: ldr r1, =0x02024474 ldrb r0, [r1, 0x1C] adds r0, 0x1 strb r0, [r1, 0x1C] ldr r0, =0x0202449c ldr r2, [r0] adds r2, 0xDF ldr r3, =gUnknown_0832A328 ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] bl @0804ACB2 .align 2, 0 .pool @0804A414: movs r5, 0 movs r7, 0 @0804A418: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @0804A486 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0804A486 ldr r0, =gUnknown_0832A328 lsls r1, r7, 2 adds r1, r0 ldr r0, [r1] mov r1, r8 ands r0, r1 cmp r0, 0 beq @0804A44C adds r5, 0x1 @0804A44C: adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne @0804A478 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003226 adds r0, r2 ldrb r4, [r0] b @0804A480 .align 2, 0 .pool @0804A478: bl itemid_get_x12 lsls r0, 24 lsrs r4, r0, 24 @0804A480: cmp r4, 0x19 bne @0804A486 adds r6, 0x1 @0804A486: adds r7, 0x1 cmp r7, 0x5 ble @0804A418 ldr r3, =gBaseStats ldr r2, =0x02024084 ldr r0, =0x0202420d ldrb r1, [r0] movs r0, 0x58 muls r1, r0 adds r1, r2 ldrh r2, [r1] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r3 ldrb r2, [r0, 0x9] adds r1, 0x2A ldrb r0, [r1] muls r0, r2 movs r1, 0x7 bl __divsi3 lsls r0, 16 lsrs r1, r0, 16 cmp r6, 0 beq @0804A4FC lsrs r4, r0, 17 adds r0, r4, 0 adds r1, r5, 0 bl __divsi3 mov r1, r9 strh r0, [r1] lsls r0, 16 cmp r0, 0 bne @0804A4D2 movs r0, 0x1 strh r0, [r1] @0804A4D2: ldr r5, =0x02024402 adds r0, r4, 0 adds r1, r6, 0 bl __divsi3 strh r0, [r5] lsls r0, 16 cmp r0, 0 bne @0804A516 movs r0, 0x1 strh r0, [r5] b @0804A516 .align 2, 0 .pool @0804A4FC: adds r0, r1, 0 adds r1, r5, 0 bl __divsi3 mov r2, r9 strh r0, [r2] lsls r0, 16 cmp r0, 0 bne @0804A512 movs r0, 0x1 strh r0, [r2] @0804A512: ldr r0, =0x02024402 strh r6, [r0] @0804A516: ldr r1, =0x02024474 ldrb r0, [r1, 0x1C] adds r0, 0x1 movs r2, 0 strb r0, [r1, 0x1C] ldr r1, =0x0202449c ldr r0, [r1] strb r2, [r0, 0x10] ldr r0, [r1] adds r0, 0x53 mov r4, r8 strb r4, [r0] @0804A52E: ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @0804A538 b @0804ACB2 @0804A538: ldr r0, =0x0202449c ldr r0, [r0] ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xC bl pokemon_getattr lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne @0804A57C ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003226 adds r0, r1 ldrb r4, [r0] b @0804A584 .align 2, 0 .pool @0804A57C: bl itemid_get_x12 lsls r0, 24 lsrs r4, r0, 24 @0804A584: ldr r5, =0x0202449c cmp r4, 0x19 beq @0804A5AC ldr r0, [r5] adds r1, r0, 0 adds r1, 0x53 ldrb r0, [r1] movs r2, 0x1 ands r2, r0 cmp r2, 0 bne @0804A5AC lsrs r0, 1 strb r0, [r1] ldr r1, =0x02024474 b @0804A5D0 .align 2, 0 .pool @0804A5AC: ldr r0, [r5] ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 bl pokemon_getattr cmp r0, 0x64 bne @0804A5E8 ldr r1, [r5] adds r1, 0x53 ldrb r0, [r1] lsrs r0, 1 strb r0, [r1] ldr r1, =0x02024474 movs r2, 0 @0804A5D0: movs r0, 0x5 strb r0, [r1, 0x1C] ldr r0, =0x020241f0 str r2, [r0] b @0804ACB2 .align 2, 0 .pool @0804A5E8: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x8 ands r0, r1 cmp r0, 0 bne @0804A616 ldr r0, =0x02024084 ldrh r0, [r0, 0x28] cmp r0, 0 beq @0804A616 ldr r0, [r5] ldrb r0, [r0, 0x12] cmp r0, 0 bne @0804A616 bl sub_805EA60 ldr r0, =0x00000161 bl song_play_for_text ldr r1, [r5] ldrb r0, [r1, 0x12] adds r0, 0x1 strb r0, [r1, 0x12] @0804A616: ldr r5, =0x0202449c ldr r0, [r5] ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 bne @0804A630 b @0804A824 @0804A630: ldr r0, [r5] adds r0, 0x53 ldrb r0, [r0] movs r3, 0x1 ands r3, r0 cmp r3, 0 beq @0804A664 ldr r1, =0x020241f0 mov r2, r9 ldrh r0, [r2] str r0, [r1] mov r9, r1 b @0804A66A .align 2, 0 .pool @0804A664: ldr r0, =0x020241f0 str r3, [r0] mov r9, r0 @0804A66A: cmp r4, 0x19 bne @0804A67A ldr r0, =0x02024402 ldrh r1, [r0] mov r2, r9 ldr r0, [r2] adds r0, r1 str r0, [r2] @0804A67A: cmp r4, 0x28 bne @0804A68E mov r4, r9 ldr r1, [r4] movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 str r0, [r4] @0804A68E: ldr r5, =0x02022fec ldr r0, [r5] movs r1, 0x8 ands r0, r1 cmp r0, 0 beq @0804A6AA ldr r4, =0x020241f0 ldr r1, [r4] movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 str r0, [r4] @0804A6AA: ldr r4, =0x0202449c ldr r0, [r4] ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 bl sub_806E8A8 lsls r0, 24 cmp r0, 0 beq @0804A714 ldr r0, [r5] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @0804A6F8 ldr r0, [r4] ldrb r0, [r0, 0x10] cmp r0, 0x2 bls @0804A6F8 ldr r7, =0x00000149 ldr r0, =0x020241f0 mov r9, r0 b @0804A71A .align 2, 0 .pool @0804A6F8: ldr r4, =0x020241f0 ldr r1, [r4] movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 str r0, [r4] movs r7, 0xA5 lsls r7, 1 mov r9, r4 b @0804A71A .align 2, 0 .pool @0804A714: ldr r7, =0x00000149 ldr r1, =0x020241f0 mov r9, r1 @0804A71A: ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x1 ands r1, r0 cmp r1, 0 beq @0804A786 ldr r0, =0x0202406e ldr r1, =0x0202449c ldr r4, [r1] ldrh r0, [r0, 0x4] adds r5, r1, 0 ldr r3, =gUnknown_0832A328 ldr r2, =0x02024210 ldrb r1, [r4, 0x10] cmp r0, r1 bne @0804A76C ldrb r1, [r2] ldr r0, [r3, 0x8] ands r1, r0 cmp r1, 0 bne @0804A76C adds r1, r4, 0 adds r1, 0x8F movs r0, 0x2 strb r0, [r1] b @0804A78E .align 2, 0 .pool @0804A76C: ldrb r2, [r2] ldr r0, [r3] ands r2, r0 cmp r2, 0 bne @0804A77E ldr r0, [r5] adds r0, 0x8F strb r2, [r0] b @0804A78E @0804A77E: ldr r0, [r5] adds r0, 0x8F movs r1, 0x2 b @0804A78C @0804A786: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x8F @0804A78C: strb r1, [r0] @0804A78E: ldr r1, =0x02022f58 movs r2, 0 mov r12, r2 movs r3, 0xFD strb r3, [r1] movs r5, 0x4 strb r5, [r1, 0x1] ldr r6, =0x0202449c ldr r2, [r6] movs r4, 0x8F adds r4, r2 mov r8, r4 ldrb r0, [r4] strb r0, [r1, 0x2] ldrb r0, [r2, 0x10] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02022f68 strb r3, [r1] mov r0, r12 strb r0, [r1, 0x1] strb r7, [r1, 0x2] movs r4, 0xFF lsls r4, 8 ands r7, r4 asrs r0, r7, 8 strb r0, [r1, 0x3] movs r0, 0x1 negs r0, r0 strb r0, [r1, 0x4] ldr r1, =0x02022f78 strb r3, [r1] movs r0, 0x1 strb r0, [r1, 0x1] strb r5, [r1, 0x2] movs r0, 0x5 strb r0, [r1, 0x3] mov r0, r9 ldr r2, [r0] strb r2, [r1, 0x4] adds r0, r2, 0 ands r0, r4 asrs r0, 8 strb r0, [r1, 0x5] movs r0, 0xFF lsls r0, 16 ands r0, r2 asrs r0, 16 strb r0, [r1, 0x6] lsrs r2, 24 strb r2, [r1, 0x7] movs r0, 0x1 negs r0, r0 strb r0, [r1, 0x8] mov r2, r8 ldrb r1, [r2] movs r0, 0xD bl b_std_message ldr r0, [r6] ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02024084 ldr r1, =0x0202420d ldrb r2, [r1] movs r1, 0x58 muls r1, r2 adds r1, r3 ldrh r1, [r1] bl sub_806DADC @0804A824: ldr r0, =0x0202449c ldr r1, [r0] adds r1, 0x53 ldrb r0, [r1] lsrs r0, 1 strb r0, [r1] b @0804A92A .align 2, 0 .pool @0804A850: ldr r0, =0x02024068 ldr r2, [r0] cmp r2, 0 beq @0804A85A b @0804ACB2 @0804A85A: ldr r1, =0x02023864 ldr r7, =0x0202449c ldr r0, [r7] adds r0, 0x8F ldrb r0, [r0] lsls r0, 9 adds r0, r1 strb r2, [r0] ldr r0, [r7] ldrb r0, [r0, 0x10] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0804A92A ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r6 adds r0, r5 movs r1, 0x38 bl pokemon_getattr cmp r0, 0x64 beq @0804A92A ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r6 adds r0, r5 movs r1, 0x3A bl pokemon_getattr ldr r4, =0x020244a8 ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r6 adds r0, r5 movs r1, 0x3B bl pokemon_getattr ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0x2] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r6 adds r0, r5 movs r1, 0x3C bl pokemon_getattr ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0x4] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r6 adds r0, r5 movs r1, 0x3D bl pokemon_getattr ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0x6] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r6 adds r0, r5 movs r1, 0x3E bl pokemon_getattr ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0x8] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r6 adds r0, r5 movs r1, 0x3F bl pokemon_getattr ldr r1, [r4] ldr r1, [r1, 0x10] strh r0, [r1, 0xA] ldr r4, =0x02024064 ldr r1, [r7] adds r0, r1, 0 adds r0, 0x8F ldrb r0, [r0] strb r0, [r4] ldrb r1, [r1, 0x10] ldr r0, =0x020241f0 ldrh r2, [r0] movs r0, 0 bl dp01_build_cmdbuf_x19_a_bb ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0804A92A: ldr r1, =0x02024474 ldrb r0, [r1, 0x1C] adds r0, 0x1 strb r0, [r1, 0x1C] b @0804ACB2 .align 2, 0 .pool @0804A954: ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @0804A95E b @0804ACB2 @0804A95E: ldr r1, =0x02024064 ldr r0, =0x0202449c ldr r4, [r0] adds r0, r4, 0 adds r0, 0x8F ldrb r0, [r0] strb r0, [r1] ldr r3, =0x02023864 ldrb r2, [r1] lsls r1, r2, 9 adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0x21 beq @0804A97C b @0804AC28 @0804A97C: adds r0, r3, 0x1 adds r0, r1, r0 ldrb r0, [r0] cmp r0, 0xB beq @0804A988 b @0804AC28 @0804A988: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x8 ands r0, r1 cmp r0, 0 beq @0804A9B2 ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrh r0, [r1] ldrb r4, [r4, 0x10] cmp r0, r4 bne @0804A9B2 adds r1, r0, 0 movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 adds r1, r2, 0 bl sub_805E990 @0804A9B2: ldr r1, =0x02022f58 movs r3, 0xFD strb r3, [r1] movs r0, 0x4 strb r0, [r1, 0x1] ldr r6, =0x02024064 ldrb r0, [r6] strb r0, [r1, 0x2] ldr r4, =0x0202449c mov r9, r4 ldr r2, [r4] ldrb r0, [r2, 0x10] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r4, =0x02022f68 strb r3, [r4] movs r0, 0x1 strb r0, [r4, 0x1] strb r0, [r4, 0x2] movs r0, 0x3 strb r0, [r4, 0x3] ldrb r0, [r2, 0x10] movs r1, 0x64 mov r8, r1 mov r2, r8 muls r2, r0 adds r0, r2, 0 ldr r7, =0x020244ec adds r0, r7 movs r1, 0x38 bl pokemon_getattr strb r0, [r4, 0x4] movs r0, 0x1 negs r0, r0 strb r0, [r4, 0x5] bl b_movescr_stack_push_cursor ldr r2, =0x03005d54 ldr r1, =gUnknown_0832A328 mov r4, r9 ldr r5, [r4] ldrb r0, [r5, 0x10] lsls r0, 2 adds r0, r1 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r1, =0x02024214 ldr r0, =gUnknown_082DABBD str r0, [r1] ldr r4, =0x020241f0 ldr r2, =0x02023864 ldrb r1, [r6] lsls r1, 9 adds r0, r2, 0x2 adds r0, r1, r0 ldrb r3, [r0] adds r2, 0x3 adds r1, r2 ldrb r0, [r1] lsls r0, 8 orrs r3, r0 str r3, [r4] ldrb r0, [r5, 0x10] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r7 movs r1, 0 bl happiness_algorithm ldr r1, =0x0202406e mov r2, r9 ldr r0, [r2] ldrb r2, [r0, 0x10] ldrh r0, [r1] cmp r0, r2 bne @0804AB1E ldr r4, =0x02024084 ldrh r0, [r4, 0x28] cmp r0, 0 beq @0804AB1E mov r0, r8 muls r0, r2 adds r0, r7 movs r1, 0x38 bl pokemon_getattr adds r1, r4, 0 adds r1, 0x2A strb r0, [r1] mov r1, r9 ldr r0, [r1] ldrb r0, [r0, 0x10] mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r0, r7 movs r1, 0x39 bl pokemon_getattr strh r0, [r4, 0x28] mov r1, r9 ldr r0, [r1] ldrb r0, [r0, 0x10] mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r0, r7 movs r1, 0x3A bl pokemon_getattr strh r0, [r4, 0x2C] mov r1, r9 ldr r0, [r1] ldrb r0, [r0, 0x10] mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r0, r7 movs r1, 0x3B bl pokemon_getattr strh r0, [r4, 0x2] mov r1, r9 ldr r0, [r1] ldrb r0, [r0, 0x10] mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r0, r7 movs r1, 0x3C bl pokemon_getattr strh r0, [r4, 0x4] mov r1, r9 ldr r0, [r1] ldrb r0, [r0, 0x10] mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r0, r7 movs r1, 0x3D bl pokemon_getattr strh r0, [r4, 0x6] mov r1, r9 ldr r0, [r1] ldrb r0, [r0, 0x10] mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r0, r7 movs r1, 0x3D bl pokemon_getattr strh r0, [r4, 0x6] mov r1, r9 ldr r0, [r1] ldrb r0, [r0, 0x10] mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r0, r7 movs r1, 0x3E bl pokemon_getattr strh r0, [r4, 0x8] mov r1, r9 ldr r0, [r1] ldrb r0, [r0, 0x10] mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r0, r7 movs r1, 0x3F bl pokemon_getattr strh r0, [r4, 0xA] @0804AB1E: ldr r0, =0x0202406e ldr r7, =0x0202449c ldr r1, [r7] ldrb r2, [r1, 0x10] ldrh r0, [r0, 0x4] cmp r0, r2 beq @0804AB2E b @0804AC2E @0804AB2E: ldr r6, =0x02024084 movs r4, 0xD8 adds r4, r6 mov r8, r4 ldrh r0, [r4] cmp r0, 0 beq @0804AC2E ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0804AC2E movs r5, 0x64 adds r0, r2, 0 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x38 bl pokemon_getattr adds r1, r6, 0 adds r1, 0xDA strb r0, [r1] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 movs r1, 0x39 bl pokemon_getattr mov r1, r8 strh r0, [r1] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 movs r1, 0x3A bl pokemon_getattr adds r1, r6, 0 adds r1, 0xDC strh r0, [r1] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 movs r1, 0x3B bl pokemon_getattr adds r1, r6, 0 adds r1, 0xB2 strh r0, [r1] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 movs r1, 0x3C bl pokemon_getattr adds r1, r6, 0 adds r1, 0xB4 strh r0, [r1] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 movs r1, 0x3D bl pokemon_getattr movs r2, 0xB6 adds r2, r6 mov r8, r2 strh r0, [r2] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 movs r1, 0x3D bl pokemon_getattr mov r1, r8 strh r0, [r1] ldr r0, [r7] ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 movs r1, 0x3E bl pokemon_getattr adds r1, r6, 0 adds r1, 0xB8 strh r0, [r1] b @0804AC2E .align 2, 0 .pool @0804AC28: ldr r1, =0x020241f0 movs r0, 0 str r0, [r1] @0804AC2E: ldr r1, =0x02024474 movs r0, 0x5 strb r0, [r1, 0x1C] b @0804ACB2 .align 2, 0 .pool @0804AC40: ldr r0, =0x020241f0 ldr r0, [r0] cmp r0, 0 beq @0804AC58 ldr r1, =0x02024474 movs r0, 0x3 strb r0, [r1, 0x1C] b @0804ACB2 .align 2, 0 .pool @0804AC58: ldr r2, =0x0202449c ldr r1, [r2] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] ldr r0, [r2] ldrb r0, [r0, 0x10] cmp r0, 0x5 bhi @0804AC7C ldr r1, =0x02024474 movs r0, 0x2 strb r0, [r1, 0x1C] b @0804ACB2 .align 2, 0 .pool @0804AC7C: ldr r1, =0x02024474 movs r0, 0x6 strb r0, [r1, 0x1C] b @0804ACB2 .align 2, 0 .pool @0804AC88: ldr r0, =0x02024068 ldr r5, [r0] cmp r5, 0 bne @0804ACB2 ldr r4, =0x02024084 ldr r2, =0x0202420d ldrb r0, [r2] movs r1, 0x58 muls r0, r1 adds r0, r4 movs r3, 0 strh r5, [r0, 0x2E] ldrb r0, [r2] muls r0, r1 adds r0, r4 adds r0, 0x20 strb r3, [r0] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] @0804ACB2: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804A32C thumb_func_start sub_804ACD0 sub_804ACD0: ; 804ACD0 push {r4-r7,lr} mov r7, r8 push {r7} movs r6, 0 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @0804ACE2 b @0804AF22 @0804ACE2: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @0804AD48 ldr r0, =0x02038bce ldrh r1, [r0] ldr r0, =0x00000c03 cmp r1, r0 bne @0804AD48 movs r5, 0 @0804ACFC: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @0804AD2C adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0804AD2C adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 @0804AD2C: adds r5, 0x1 cmp r5, 0x2 ble @0804ACFC b @0804ADA8 .align 2, 0 .pool @0804AD48: movs r5, 0 @0804AD4A: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @0804ADA2 adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0804ADA2 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @0804AD94 ldr r0, =0x0202449c ldr r0, [r0] movs r1, 0xA8 lsls r1, 2 adds r0, r1 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0804ADA2 @0804AD94: adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 @0804ADA2: adds r5, 0x1 cmp r5, 0x5 ble @0804AD4A @0804ADA8: cmp r6, 0 bne @0804ADB6 ldr r0, =0x0202433a ldrb r1, [r0] movs r2, 0x2 orrs r1, r2 strb r1, [r0] @0804ADB6: movs r6, 0 movs r5, 0 @0804ADBA: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x02024744 adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @0804AE10 adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0804AE10 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @0804AE02 ldr r0, =0x0202449c ldr r0, [r0] ldr r1, =0x000002a1 adds r0, r1 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0804AE10 @0804AE02: adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 @0804AE10: adds r5, 0x1 cmp r5, 0x5 ble @0804ADBA ldr r2, =0x0202433a cmp r6, 0 bne @0804AE24 ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] @0804AE24: ldrb r0, [r2] cmp r0, 0 bne @0804AF1A ldr r0, =0x02022fec ldr r1, [r0] ldr r2, =0x02000002 ands r1, r2 mov r8, r0 cmp r1, 0 beq @0804AF1A movs r3, 0 movs r5, 0 ldr r0, =0x0202406c ldrb r1, [r0] mov r12, r0 ldr r7, =0x02024214 cmp r3, r1 bge @0804AE70 ldr r0, =0x02024280 movs r6, 0x80 lsls r6, 21 ldr r4, [r0] adds r2, r1, 0 ldr r1, =0x0202437c @0804AE54: adds r0, r6, 0 lsls r0, r5 ands r0, r4 cmp r0, 0 beq @0804AE68 ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804AE68 adds r3, 0x1 @0804AE68: adds r1, 0x28 adds r5, 0x2 cmp r5, r2 blt @0804AE54 @0804AE70: movs r2, 0 movs r5, 0x1 mov r4, r12 ldrb r1, [r4] cmp r5, r1 bge @0804AEAA ldr r0, =0x02024280 movs r4, 0x80 lsls r4, 21 mov r12, r4 ldr r6, [r0] ldr r0, =0x0202437c adds r4, r1, 0 adds r1, r0, 0 adds r1, 0x14 @0804AE8E: mov r0, r12 lsls r0, r5 ands r0, r6 cmp r0, 0 beq @0804AEA2 ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804AEA2 adds r2, 0x1 @0804AEA2: adds r1, 0x28 adds r5, 0x2 cmp r5, r4 blt @0804AE8E @0804AEAA: mov r1, r8 ldr r0, [r1] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0804AEF0 adds r0, r2, r3 cmp r0, 0x1 bgt @0804AEF8 b @0804AF12 .align 2, 0 .pool @0804AEF0: cmp r2, 0 beq @0804AF12 cmp r3, 0 beq @0804AF12 @0804AEF8: ldr r2, [r7] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r1, r0 str r1, [r7] b @0804AF22 @0804AF12: ldr r0, [r7] adds r0, 0x5 str r0, [r7] b @0804AF22 @0804AF1A: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0804AF22: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804ACD0 thumb_func_start sub_804AF30 sub_804AF30: ; 804AF30 ldr r1, =0x0202427c movs r0, 0 strb r0, [r1] ldr r0, =0x02024474 movs r2, 0 movs r1, 0x1 strb r1, [r0, 0xE] ldr r0, =0x02024211 strb r1, [r0] ldr r0, =0x02024332 strb r2, [r0, 0x3] strb r2, [r0, 0x6] ldr r2, =0x02024280 ldr r0, [r2] subs r1, 0x42 ands r0, r1 ldr r1, =0xffffbfff ands r0, r1 str r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_804AF30 thumb_func_start atk25_cmd25 atk25_cmd25: ; 804AF70 push {lr} bl sub_804AF30 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk25_cmd25 thumb_func_start atk26_80225F0_storebyteforjump atk26_80225F0_storebyteforjump: ; 804AF88 ldr r3, =0x02024212 ldr r2, =0x02024214 ldr r0, [r2] ldrb r1, [r0, 0x1] strb r1, [r3] adds r0, 0x2 str r0, [r2] bx lr .align 2, 0 .pool thumb_func_end atk26_80225F0_storebyteforjump thumb_func_start atk27_cmd27 atk27_cmd27: ; 804AFA0 push {lr} ldr r1, =0x02024212 ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] lsls r0, 24 cmp r0, 0 bne @0804AFC4 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @0804AFDE .align 2, 0 .pool @0804AFC4: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r1, r0 str r1, [r3] @0804AFDE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk27_cmd27 thumb_func_start atk28_goto atk28_goto: ; 804AFE8 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r1, r0 str r1, [r3] bx lr .align 2, 0 .pool thumb_func_end atk28_goto thumb_func_start atk29_jumpifbyte atk29_jumpifbyte: ; 804B008 push {r4-r6,lr} ldr r3, =0x02024214 ldr r1, [r3] ldrb r6, [r1, 0x1] ldrb r2, [r1, 0x2] ldrb r0, [r1, 0x3] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x4] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0x5] lsls r0, 24 adds r5, r2, r0 ldrb r4, [r1, 0x6] ldrb r2, [r1, 0x7] ldrb r0, [r1, 0x8] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x9] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0xA] lsls r0, 24 adds r2, r0 adds r1, 0xB str r1, [r3] cmp r6, 0x5 bhi @0804B0A0 lsls r0, r6, 2 ldr r1, =@0804B054 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0804B054: .4byte @0804B06C .4byte @0804B074 .4byte @0804B07C .4byte @0804B084 .4byte @0804B08C .4byte @0804B096 @0804B06C: ldrb r0, [r5] cmp r0, r4 bne @0804B0A0 b @0804B09E @0804B074: ldrb r0, [r5] cmp r0, r4 beq @0804B0A0 b @0804B09E @0804B07C: ldrb r0, [r5] cmp r0, r4 bls @0804B0A0 b @0804B09E @0804B084: ldrb r0, [r5] cmp r0, r4 bcs @0804B0A0 b @0804B09E @0804B08C: ldrb r0, [r5] ands r4, r0 cmp r4, 0 beq @0804B0A0 b @0804B09E @0804B096: ldrb r0, [r5] ands r4, r0 cmp r4, 0 bne @0804B0A0 @0804B09E: str r2, [r3] @0804B0A0: pop {r4-r6} pop {r0} bx r0 thumb_func_end atk29_jumpifbyte thumb_func_start sub_804B0A8 sub_804B0A8: ; 804B0A8 push {r4-r6,lr} ldr r3, =0x02024214 ldr r1, [r3] ldrb r6, [r1, 0x1] ldrb r2, [r1, 0x2] ldrb r0, [r1, 0x3] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x4] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0x5] lsls r0, 24 adds r5, r2, r0 ldrb r4, [r1, 0x6] ldrb r0, [r1, 0x7] lsls r0, 8 orrs r4, r0 ldrb r2, [r1, 0x8] ldrb r0, [r1, 0x9] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0xA] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0xB] lsls r0, 24 adds r2, r0 adds r1, 0xC str r1, [r3] cmp r6, 0x5 bhi @0804B148 lsls r0, r6, 2 ldr r1, =@0804B0FC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0804B0FC: .4byte @0804B114 .4byte @0804B11C .4byte @0804B124 .4byte @0804B12C .4byte @0804B134 .4byte @0804B13E @0804B114: ldrh r0, [r5] cmp r0, r4 bne @0804B148 b @0804B146 @0804B11C: ldrh r0, [r5] cmp r0, r4 beq @0804B148 b @0804B146 @0804B124: ldrh r0, [r5] cmp r0, r4 bls @0804B148 b @0804B146 @0804B12C: ldrh r0, [r5] cmp r0, r4 bcs @0804B148 b @0804B146 @0804B134: ldrh r0, [r5] ands r4, r0 cmp r4, 0 beq @0804B148 b @0804B146 @0804B13E: ldrh r0, [r5] ands r4, r0 cmp r4, 0 bne @0804B148 @0804B146: str r2, [r3] @0804B148: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_804B0A8 thumb_func_start sub_804B150 sub_804B150: ; 804B150 push {r4-r6,lr} ldr r3, =0x02024214 ldr r1, [r3] ldrb r6, [r1, 0x1] ldrb r2, [r1, 0x2] ldrb r0, [r1, 0x3] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x4] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0x5] lsls r0, 24 adds r5, r2, r0 ldrb r4, [r1, 0x6] ldrb r0, [r1, 0x7] lsls r0, 8 orrs r4, r0 ldrb r0, [r1, 0x8] lsls r0, 16 orrs r4, r0 ldrb r0, [r1, 0x9] lsls r0, 24 orrs r4, r0 ldrb r2, [r1, 0xA] ldrb r0, [r1, 0xB] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0xC] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0xD] lsls r0, 24 adds r2, r0 adds r1, 0xE str r1, [r3] cmp r6, 0x5 bhi @0804B1FC lsls r0, r6, 2 ldr r1, =@0804B1B0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0804B1B0: .4byte @0804B1C8 .4byte @0804B1D0 .4byte @0804B1D8 .4byte @0804B1E0 .4byte @0804B1E8 .4byte @0804B1F2 @0804B1C8: ldr r0, [r5] cmp r0, r4 bne @0804B1FC b @0804B1FA @0804B1D0: ldr r0, [r5] cmp r0, r4 beq @0804B1FC b @0804B1FA @0804B1D8: ldr r0, [r5] cmp r0, r4 bls @0804B1FC b @0804B1FA @0804B1E0: ldr r0, [r5] cmp r0, r4 bcs @0804B1FC b @0804B1FA @0804B1E8: ldr r0, [r5] ands r0, r4 cmp r0, 0 beq @0804B1FC b @0804B1FA @0804B1F2: ldr r0, [r5] ands r0, r4 cmp r0, 0 bne @0804B1FC @0804B1FA: str r2, [r3] @0804B1FC: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_804B150 thumb_func_start sub_804B204 sub_804B204: ; 804B204 push {r4-r7,lr} ldr r2, =0x02024214 ldr r3, [r2] ldrb r1, [r3, 0x1] ldrb r0, [r3, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r3, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r3, 0x4] lsls r0, 24 adds r5, r1, r0 ldrb r1, [r3, 0x5] ldrb r0, [r3, 0x6] lsls r0, 8 adds r1, r0 ldrb r0, [r3, 0x7] lsls r0, 16 adds r1, r0 ldrb r0, [r3, 0x8] lsls r0, 24 adds r4, r1, r0 ldrb r6, [r3, 0x9] ldrb r1, [r3, 0xA] ldrb r0, [r3, 0xB] lsls r0, 8 adds r1, r0 ldrb r0, [r3, 0xC] lsls r0, 16 adds r1, r0 ldrb r0, [r3, 0xD] lsls r0, 24 adds r1, r0 mov r12, r1 movs r1, 0 cmp r1, r6 bcs @0804B27C ldrb r0, [r5] ldrb r7, [r4] cmp r0, r7 beq @0804B260 adds r0, r3, 0 b @0804B278 .align 2, 0 .pool @0804B260: adds r5, 0x1 adds r4, 0x1 adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, r6 bcs @0804B27C ldrb r0, [r5] ldrb r3, [r4] cmp r0, r3 beq @0804B260 ldr r0, [r2] @0804B278: adds r0, 0xE str r0, [r2] @0804B27C: cmp r1, r6 bne @0804B284 mov r7, r12 str r7, [r2] @0804B284: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_804B204 thumb_func_start sub_804B28C sub_804B28C: ; 804B28C push {r4-r7,lr} movs r7, 0 ldr r3, =0x02024214 ldr r1, [r3] ldrb r2, [r1, 0x1] ldrb r0, [r1, 0x2] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x3] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0x4] lsls r0, 24 adds r5, r2, r0 ldrb r2, [r1, 0x5] ldrb r0, [r1, 0x6] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x7] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0x8] lsls r0, 24 adds r4, r2, r0 ldrb r6, [r1, 0x9] ldrb r2, [r1, 0xA] ldrb r0, [r1, 0xB] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0xC] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0xD] lsls r0, 24 adds r2, r0 mov r12, r2 movs r1, 0 cmp r7, r6 bcs @0804B2F6 @0804B2DA: ldrb r0, [r5] ldrb r2, [r4] cmp r0, r2 bne @0804B2E8 adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 @0804B2E8: adds r5, 0x1 adds r4, 0x1 adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, r6 bcc @0804B2DA @0804B2F6: cmp r7, r6 beq @0804B304 mov r0, r12 b @0804B308 .align 2, 0 .pool @0804B304: ldr r0, [r3] adds r0, 0xE @0804B308: str r0, [r3] pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_804B28C thumb_func_start sub_804B310 sub_804B310: ; 804B310 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r1, r0 ldrb r0, [r2, 0x5] strb r0, [r1] ldr r0, [r3] adds r0, 0x6 str r0, [r3] bx lr .align 2, 0 .pool thumb_func_end sub_804B310 thumb_func_start sub_804B338 sub_804B338: ; 804B338 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r1, r0 ldrb r0, [r2, 0x5] ldrb r2, [r1] adds r0, r2 strb r0, [r1] ldr r0, [r3] adds r0, 0x6 str r0, [r3] bx lr .align 2, 0 .pool thumb_func_end sub_804B338 thumb_func_start sub_804B364 sub_804B364: ; 804B364 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r1, r0 ldrb r0, [r1] ldrb r2, [r2, 0x5] subs r0, r2 strb r0, [r1] ldr r0, [r3] adds r0, 0x6 str r0, [r3] bx lr .align 2, 0 .pool thumb_func_end sub_804B364 thumb_func_start atk31_copyarray atk31_copyarray: ; 804B390 push {r4-r6,lr} ldr r3, =0x02024214 ldr r1, [r3] ldrb r2, [r1, 0x1] ldrb r0, [r1, 0x2] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x3] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0x4] lsls r0, 24 adds r6, r2, r0 ldrb r2, [r1, 0x5] ldrb r0, [r1, 0x6] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x7] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0x8] lsls r0, 24 adds r5, r2, r0 ldrb r4, [r1, 0x9] movs r2, 0 cmp r2, r4 bge @0804B3D4 @0804B3C6: adds r0, r6, r2 adds r1, r5, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, r4 blt @0804B3C6 @0804B3D4: ldr r0, [r3] adds r0, 0xA str r0, [r3] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk31_copyarray thumb_func_start atk32_memcpy_with_offset atk32_memcpy_with_offset: ; 804B3E4 push {r4-r7,lr} ldr r3, =0x02024214 ldr r1, [r3] ldrb r2, [r1, 0x1] ldrb r0, [r1, 0x2] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x3] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0x4] lsls r0, 24 adds r7, r2, r0 ldrb r2, [r1, 0x5] ldrb r0, [r1, 0x6] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0x7] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0x8] lsls r0, 24 adds r6, r2, r0 ldrb r2, [r1, 0x9] ldrb r0, [r1, 0xA] lsls r0, 8 adds r2, r0 ldrb r0, [r1, 0xB] lsls r0, 16 adds r2, r0 ldrb r0, [r1, 0xC] lsls r0, 24 adds r5, r2, r0 ldrb r4, [r1, 0xD] movs r2, 0 cmp r2, r4 bge @0804B440 @0804B42E: adds r0, r7, r2 ldrb r1, [r5] adds r1, r2, r1 adds r1, r6, r1 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, r4 blt @0804B42E @0804B440: ldr r0, [r3] adds r0, 0xE str r0, [r3] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk32_memcpy_with_offset thumb_func_start atk33_orbyte atk33_orbyte: ; 804B450 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r1, r0 ldrb r0, [r1] ldrb r2, [r2, 0x5] orrs r0, r2 strb r0, [r1] ldr r0, [r3] adds r0, 0x6 str r0, [r3] bx lr .align 2, 0 .pool thumb_func_end atk33_orbyte thumb_func_start atk34_orhalfword atk34_orhalfword: ; 804B47C push {r4,lr} ldr r4, =0x02024214 ldr r3, [r4] ldrb r2, [r3, 0x1] ldrb r0, [r3, 0x2] lsls r0, 8 adds r2, r0 ldrb r0, [r3, 0x3] lsls r0, 16 adds r2, r0 ldrb r0, [r3, 0x4] lsls r0, 24 adds r2, r0 ldrb r1, [r3, 0x5] ldrb r0, [r3, 0x6] lsls r0, 8 orrs r1, r0 ldrh r0, [r2] orrs r1, r0 strh r1, [r2] ldr r0, [r4] adds r0, 0x7 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk34_orhalfword thumb_func_start atk35_orword atk35_orword: ; 804B4B4 push {r4,lr} ldr r4, =0x02024214 ldr r2, [r4] ldrb r3, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r3, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r3, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r3, r0 ldrb r1, [r2, 0x5] ldrb r0, [r2, 0x6] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x7] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x8] lsls r0, 24 adds r1, r0 ldr r0, [r3] orrs r0, r1 str r0, [r3] ldr r0, [r4] adds r0, 0x9 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk35_orword thumb_func_start atk36_bicbyte atk36_bicbyte: ; 804B4F8 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r1, r0 ldrb r2, [r2, 0x5] ldrb r0, [r1] bics r0, r2 strb r0, [r1] ldr r0, [r3] adds r0, 0x6 str r0, [r3] bx lr .align 2, 0 .pool thumb_func_end atk36_bicbyte thumb_func_start atk37_bichalfword atk37_bichalfword: ; 804B524 push {r4,lr} ldr r4, =0x02024214 ldr r3, [r4] ldrb r1, [r3, 0x1] ldrb r0, [r3, 0x2] lsls r0, 8 adds r1, r0 ldrb r0, [r3, 0x3] lsls r0, 16 adds r1, r0 ldrb r0, [r3, 0x4] lsls r0, 24 adds r1, r0 ldrb r2, [r3, 0x5] ldrb r0, [r3, 0x6] lsls r0, 8 orrs r2, r0 ldrh r0, [r1] bics r0, r2 strh r0, [r1] ldr r0, [r4] adds r0, 0x7 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk37_bichalfword thumb_func_start atk38_bicword atk38_bicword: ; 804B55C push {r4,lr} ldr r4, =0x02024214 ldr r2, [r4] ldrb r3, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 adds r3, r0 ldrb r0, [r2, 0x3] lsls r0, 16 adds r3, r0 ldrb r0, [r2, 0x4] lsls r0, 24 adds r3, r0 ldrb r1, [r2, 0x5] ldrb r0, [r2, 0x6] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x7] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x8] lsls r0, 24 adds r1, r0 ldr r0, [r3] bics r0, r1 str r0, [r3] ldr r0, [r4] adds r0, 0x9 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk38_bicword thumb_func_start atk39_pause atk39_pause: ; 804B5A0 push {r4,r5,lr} ldr r0, =0x02024068 ldr r4, [r0] cmp r4, 0 bne @0804B5CC ldr r5, =0x02024214 ldr r2, [r5] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldr r3, =0x0202432c ldrh r0, [r3] adds r0, 0x1 strh r0, [r3] lsls r0, 16 lsrs r0, 16 cmp r0, r1 bcc @0804B5CC strh r4, [r3] adds r0, r2, 0x3 str r0, [r5] @0804B5CC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk39_pause thumb_func_start sub_804B5E0 sub_804B5E0: ; 804B5E0 push {lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804B5F2 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @0804B5F2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804B5E0 thumb_func_start atk3B_8022C68 atk3B_8022C68: ; 804B600 push {lr} ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0 bne @0804B620 ldr r0, =0x02024064 ldr r1, =0x0202420c b @0804B624 .align 2, 0 .pool @0804B620: ldr r0, =0x02024064 ldr r1, =0x0202420b @0804B624: ldrb r1, [r1] strb r1, [r0] ldr r0, =0x020241f0 ldrh r1, [r0] movs r0, 0 bl dp01_build_cmdbuf_x18_0_aa_health_bar_update ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk3B_8022C68 thumb_func_start atk3C_return atk3C_return: ; 804B658 push {lr} bl b_movescr_stack_pop_cursor pop {r0} bx r0 thumb_func_end atk3C_return thumb_func_start sub_804B664 sub_804B664: ; 804B664 push {lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @0804B67C ldr r0, =0x0202420b ldrb r0, [r0] bl sub_81A5718 @0804B67C: ldr r0, =0x0202427c movs r1, 0 strb r1, [r0] ldr r0, =0x02024064 strb r1, [r0] ldr r1, =0x02024083 movs r0, 0xB strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804B664 thumb_func_start atk3E_end2 atk3E_end2: ; 804B6A4 ldr r1, =0x02024064 movs r0, 0 strb r0, [r1] ldr r1, =0x02024083 movs r0, 0xB strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end atk3E_end2 thumb_func_start atk3F_end3 atk3F_end3: ; 804B6BC push {lr} bl b_movescr_stack_pop_cursor ldr r3, =0x020244a8 ldr r0, [r3] ldr r0, [r0, 0xC] adds r1, r0, 0 adds r1, 0x20 ldrb r0, [r1] cmp r0, 0 beq @0804B6D6 subs r0, 0x1 strb r0, [r1] @0804B6D6: ldr r2, =0x03005d04 ldr r0, [r3] ldr r1, [r0, 0xC] adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] lsls r0, 2 adds r1, r0 ldr r0, [r1] str r0, [r2] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk3F_end3 thumb_func_start atk41_call atk41_call: ; 804B6F8 push {r4,lr} ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x5 bl b_movescr_stack_push ldr r2, [r4] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk41_call thumb_func_start atk42_jumpiftype2 atk42_jumpiftype2: ; 804B728 push {r4,lr} ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something lsls r0, 24 lsrs r0, 24 ldr r3, [r4] ldr r2, =0x02024084 movs r1, 0x58 muls r0, r1 adds r0, r2 adds r1, r0, 0 adds r1, 0x21 ldrb r2, [r3, 0x2] ldrb r1, [r1] cmp r2, r1 beq @0804B756 adds r0, 0x22 ldrb r0, [r0] cmp r2, r0 bne @0804B778 @0804B756: ldrb r1, [r3, 0x3] ldrb r0, [r3, 0x4] lsls r0, 8 orrs r1, r0 ldrb r0, [r3, 0x5] lsls r0, 16 orrs r1, r0 ldrb r0, [r3, 0x6] lsls r0, 24 orrs r1, r0 str r1, [r4] b @0804B77C .align 2, 0 .pool @0804B778: adds r0, r3, 0x7 str r0, [r4] @0804B77C: pop {r4} pop {r0} bx r0 thumb_func_end atk42_jumpiftype2 thumb_func_start sub_804B784 sub_804B784: ; 804B784 push {r4,lr} sub sp, 0x4 ldr r4, =0x02024214 ldr r0, [r4] ldrb r2, [r0, 0x1] movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @0804B7C0 ldr r2, [r4] ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x5] lsls r0, 24 orrs r1, r0 str r1, [r4] b @0804B7C6 .align 2, 0 .pool @0804B7C0: ldr r0, [r4] adds r0, 0x6 str r0, [r4] @0804B7C6: add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end sub_804B784 thumb_func_start sub_804B7D0 sub_804B7D0: ; 804B7D0 ldr r0, =0x0202420b ldrb r0, [r0] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 adds r0, 0x54 movs r1, 0x1 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_804B7D0 thumb_func_start atk46_cmd46 atk46_cmd46: ; 804B7EC push {r4-r6,lr} ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r6, =0x02024064 strb r0, [r6] ldr r2, [r5] ldrb r1, [r2, 0x3] ldrb r0, [r2, 0x4] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x5] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x6] lsls r0, 24 adds r3, r1, r0 ldrb r4, [r2, 0x2] adds r0, r4, 0 cmp r0, 0x1 beq @0804B822 cmp r0, 0x11 beq @0804B822 cmp r0, 0x2 bne @0804B848 @0804B822: ldr r4, =0x02024214 ldr r0, [r4] ldrb r1, [r0, 0x2] ldrh r2, [r3] movs r0, 0 bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r4] adds r0, 0x7 str r0, [r4] b @0804B8AA .align 2, 0 .pool @0804B848: ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @0804B868 adds r0, r2, 0x7 bl b_movescr_stack_push ldr r0, =gUnknown_082DABB9 b @0804B8A8 .align 2, 0 .pool @0804B868: adds r0, r4, 0 subs r0, 0xA lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bls @0804B894 ldr r1, =0x020242ac ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x000400c0 ands r0, r1 cmp r0, 0 beq @0804B894 adds r0, r2, 0x7 b @0804B8A8 .align 2, 0 .pool @0804B894: ldrb r1, [r2, 0x2] ldrh r2, [r3] movs r0, 0 bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim ldrb r0, [r6] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x7 @0804B8A8: str r0, [r5] @0804B8AA: pop {r4-r6} pop {r0} bx r0 thumb_func_end atk46_cmd46 thumb_func_start sub_804B8B0 sub_804B8B0: ; 804B8B0 push {r4-r7,lr} ldr r6, =0x02024214 ldr r0, [r6] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r7, =0x02024064 strb r0, [r7] ldr r2, [r6] ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x4] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x5] lsls r0, 24 adds r3, r1, r0 ldrb r1, [r2, 0x6] ldrb r0, [r2, 0x7] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x8] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x9] lsls r0, 24 adds r4, r1, r0 ldrb r5, [r3] adds r0, r5, 0 cmp r0, 0x1 beq @0804B8FA cmp r0, 0x11 beq @0804B8FA cmp r0, 0x2 bne @0804B920 @0804B8FA: ldrb r1, [r3] ldrh r2, [r4] movs r0, 0 bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0xA str r0, [r1] b @0804B976 .align 2, 0 .pool @0804B920: ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @0804B934 adds r0, r2, 0 b @0804B972 .align 2, 0 .pool @0804B934: adds r0, r5, 0 subs r0, 0xA lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bls @0804B960 ldr r1, =0x020242ac ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x000400c0 ands r0, r1 cmp r0, 0 beq @0804B960 adds r0, r2, 0 b @0804B972 .align 2, 0 .pool @0804B960: ldrb r1, [r3] ldrh r2, [r4] movs r0, 0 bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim ldrb r0, [r7] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r6] @0804B972: adds r0, 0xA str r0, [r6] @0804B976: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_804B8B0 thumb_func_start sub_804B97C sub_804B97C: ; 804B97C push {r4,lr} movs r3, 0 ldr r1, =0x02024474 ldrb r0, [r1, 0x1A] movs r2, 0xF0 ands r2, r0 adds r4, r1, 0 cmp r2, 0x20 beq @0804B9AA cmp r2, 0x20 bgt @0804B99C cmp r2, 0x10 beq @0804B9A6 b @0804B9B4 .align 2, 0 .pool @0804B99C: cmp r2, 0x90 beq @0804B9AE cmp r2, 0xA0 beq @0804B9B2 b @0804B9B4 @0804B9A6: movs r3, 0xF b @0804B9B4 @0804B9AA: movs r3, 0x27 b @0804B9B4 @0804B9AE: movs r3, 0x16 b @0804B9B4 @0804B9B2: movs r3, 0x2E @0804B9B4: ldrb r1, [r4, 0x1A] movs r0, 0xF ands r0, r1 adds r0, r3, r0 subs r0, 0x1 movs r1, 0 strb r0, [r4, 0x10] strb r1, [r4, 0x11] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804B97C thumb_func_start atk48_playstatchangeanimation atk48_playstatchangeanimation: ; 804B9D8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r7, 0 movs r0, 0 mov r8, r0 movs r3, 0 ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] str r3, [sp] bl get_battle_side_of_something ldr r2, =0x02024064 strb r0, [r2] ldr r0, [r5] ldrb r4, [r0, 0x2] ldrb r1, [r0, 0x3] movs r0, 0x1 ands r0, r1 ldr r3, [sp] cmp r0, 0 beq @0804BAEC movs r0, 0x2 ands r0, r1 movs r1, 0x15 cmp r0, 0 beq @0804BA18 movs r1, 0x2D @0804BA18: cmp r4, 0 beq @0804BAC0 movs r0, 0x1 mov r10, r0 ldr r0, =0x0202409c mov r9, r0 lsls r5, r1, 16 @0804BA26: adds r0, r4, 0 mov r1, r10 ands r0, r1 cmp r0, 0 beq @0804BAB2 ldr r0, =0x02024214 ldr r0, [r0] ldrb r1, [r0, 0x3] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @0804BA58 ldr r0, =0x02024064 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r7, r0 b @0804BAA0 .align 2, 0 .pool @0804BA58: ldr r6, =0x02024064 ldrb r0, [r6] str r3, [sp] bl battle_get_per_side_status mov r1, r10 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =0x02024294 adds r0, r1 ldrb r0, [r0, 0x4] ldr r3, [sp] cmp r0, 0 bne @0804BAB2 ldr r0, =0x02024084 ldrb r2, [r6] movs r1, 0x58 muls r2, r1 adds r0, r2, r0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x1D beq @0804BAB2 cmp r0, 0x49 beq @0804BAB2 cmp r0, 0x33 bne @0804BA96 cmp r7, 0x6 beq @0804BAB2 @0804BA96: cmp r0, 0x34 bne @0804BA9E cmp r7, 0x1 beq @0804BAB2 @0804BA9E: adds r0, r7, r2 @0804BAA0: add r0, r9 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 ble @0804BAB2 lsrs r0, r5, 16 mov r8, r0 adds r3, 0x1 @0804BAB2: lsrs r4, 1 movs r1, 0x80 lsls r1, 9 adds r5, r1 adds r7, 0x1 cmp r4, 0 bne @0804BA26 @0804BAC0: ldr r0, =0x02024214 mov r9, r0 cmp r3, 0x1 ble @0804BB4E ldr r0, [r0] ldrb r1, [r0, 0x3] movs r0, 0x2 ands r0, r1 movs r1, 0x39 mov r8, r1 cmp r0, 0 beq @0804BB4E movs r0, 0x3A b @0804BB4C .align 2, 0 .pool @0804BAEC: movs r0, 0x2 ands r0, r1 movs r1, 0xE cmp r0, 0 beq @0804BAF8 movs r1, 0x26 @0804BAF8: mov r9, r5 cmp r4, 0 beq @0804BB34 ldr r6, =0x0202409c adds r5, r2, 0 lsls r2, r1, 16 @0804BB04: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @0804BB26 ldrb r1, [r5] movs r0, 0x58 muls r0, r1 adds r0, r7, r0 adds r0, r6 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0xB bgt @0804BB26 lsrs r1, r2, 16 mov r8, r1 adds r3, 0x1 @0804BB26: lsrs r4, 1 movs r0, 0x80 lsls r0, 9 adds r2, r0 adds r7, 0x1 cmp r4, 0 bne @0804BB04 @0804BB34: cmp r3, 0x1 ble @0804BB4E mov r1, r9 ldr r0, [r1] ldrb r1, [r0, 0x3] movs r0, 0x2 ands r0, r1 movs r1, 0x37 mov r8, r1 cmp r0, 0 beq @0804BB4E movs r0, 0x38 @0804BB4C: mov r8, r0 @0804BB4E: mov r1, r9 ldr r2, [r1] ldrb r1, [r2, 0x3] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0804BB6C cmp r3, 0x1 bgt @0804BB6C adds r0, r2, 0x4 mov r1, r9 b @0804BBBA .align 2, 0 .pool @0804BB6C: cmp r3, 0 beq @0804BBB4 ldr r4, =0x02024474 ldrb r0, [r4, 0x1B] cmp r0, 0 bne @0804BBB4 movs r0, 0 movs r1, 0x1 mov r2, r8 str r3, [sp] bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution ldr r0, =0x02024214 ldr r0, [r0] ldrb r1, [r0, 0x3] movs r0, 0x4 ands r0, r1 ldr r3, [sp] cmp r0, 0 beq @0804BBA4 cmp r3, 0x1 ble @0804BBA4 movs r0, 0x1 strb r0, [r4, 0x1B] @0804BBA4: ldr r1, =0x02024214 b @0804BBB6 .align 2, 0 .pool @0804BBB4: mov r1, r9 @0804BBB6: ldr r0, [r1] adds r0, 0x4 @0804BBBA: str r0, [r1] add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end atk48_playstatchangeanimation thumb_func_start sub_804BBCC sub_804BBCC: ; 804BBCC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x1C movs r0, 0 mov r10, r0 ldr r2, =0x020241ec ldrh r1, [r2] ldr r0, =0x0000ffff movs r3, 0 str r3, [sp, 0x18] cmp r1, r0 beq @0804BBEE ldrh r2, [r2] str r2, [sp, 0x18] @0804BBEE: ldr r0, =0x02024214 ldr r0, [r0] ldrb r4, [r0, 0x1] str r4, [sp, 0x10] ldrb r0, [r0, 0x2] str r0, [sp, 0x14] ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, r0, r1 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @0804BC34 ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x7] b @0804BC3E .align 2, 0 .pool @0804BC34: ldrh r0, [r1, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r0, 24 @0804BC3E: str r0, [sp, 0x8] ldr r1, =0x0202449c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 1 adds r0, 0xC8 ldr r1, [r1] adds r0, r1, r0 str r0, [sp, 0xC] ldrb r0, [r1, 0x13] cmp r0, 0 beq @0804BCF0 movs r5, 0x3F ands r5, r0 str r5, [sp, 0x4] b @0804BD02 .align 2, 0 .pool @0804BC68: ldr r4, =0x02024064 strb r2, [r4] movs r0, 0 movs r1, 0x1 bl dp01_build_cmdbuf_x33_a_33_33 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @0804C15A .align 2, 0 .pool @0804BC80: ldr r4, =0x02024064 strb r2, [r4] movs r0, 0 movs r1, 0 bl dp01_build_cmdbuf_x33_a_33_33 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldrb r1, [r6] lsls r1, 2 adds r1, r5 ldr r0, [r1] ldr r2, =0xfffbff3f ands r0, r2 str r0, [r1] b @0804C15A .align 2, 0 .pool @0804BCAC: strb r2, [r7] ldr r0, [r5] orrs r0, r6 str r0, [r5] ldr r0, =0x02024474 strb r4, [r0, 0x14] bl sub_804AF30 ldr r2, =gUnknown_082D86A8 mov r0, r8 ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 add r0, r9 ldrb r0, [r0] lsls r0, 2 adds r0, r2 ldr r0, [r0] bl b_movescr_stack_push ldr r1, =0x02024214 ldr r0, =gUnknown_082DB87D bl @0804C5B8 .align 2, 0 .pool @0804BCF0: ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x2] str r0, [sp, 0x4] @0804BD02: ldr r1, =0x02024474 mov r12, r1 b @0804BD1E .align 2, 0 .pool @0804BD14: mov r2, r10 cmp r2, 0 beq @0804BD1E bl @0804C5A4 @0804BD1E: mov r3, r12 ldrb r0, [r3, 0x14] cmp r0, 0x11 bls @0804BD2A bl @0804C570 @0804BD2A: lsls r0, 2 ldr r1, =@0804BD38 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0804BD38: .4byte @0804BD80 .4byte @0804BE5C .4byte @0804BF18 .4byte @0804BF3C .4byte @0804BF54 .4byte @0804BF7C .4byte @0804BFA0 .4byte @0804C048 .4byte @0804C0BE .4byte @0804C0F4 .4byte @0804C194 .4byte @0804C088 .4byte @0804C0A8 .4byte @0804C1D8 .4byte @0804C21C .4byte @0804C3FC .4byte @0804C4E4 .4byte @0804C570 @0804BD80: ldr r6, =0x02024084 ldr r5, =0x0202420c ldrb r3, [r5] movs r7, 0x58 adds r2, r3, 0 muls r2, r7 adds r0, r6, 0 adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 16 ands r0, r1 cmp r0, 0 bne @0804BDA0 b @0804C184 @0804BDA0: adds r0, r2, r6 ldrh r0, [r0, 0x28] cmp r0, 0 bne @0804BDAA b @0804C184 @0804BDAA: ldr r0, =0x0202420b ldrb r1, [r0] cmp r1, r3 bne @0804BDB4 b @0804C184 @0804BDB4: adds r0, r1, 0 bl battle_side_get_owner adds r4, r0, 0 ldrb r0, [r5] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @0804BDCC b @0804C184 @0804BDCC: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @0804BDDA b @0804C184 @0804BDDA: ldr r2, =0x0202437c ldrb r3, [r5] lsls r0, r3, 2 adds r0, r3 lsls r1, r0, 2 adds r0, r2, 0 adds r0, 0x8 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @0804BDFE adds r0, r2, 0 adds r0, 0xC adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @0804BDFE b @0804C184 @0804BDFE: ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 bne @0804BE14 b @0804C184 @0804BE14: adds r0, r3, 0 muls r0, r7 adds r1, r0, r6 ldrb r2, [r1, 0x19] movs r0, 0x19 ldrsb r0, [r1, r0] cmp r0, 0xB ble @0804BE26 b @0804C184 @0804BE26: adds r0, r2, 0x1 strb r0, [r1, 0x19] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DAE0D str r0, [r1] b @0804C0B8 .align 2, 0 .pool @0804BE5C: ldr r4, =0x02024084 ldr r6, =0x0202420c ldrb r2, [r6] movs r5, 0x58 mov r12, r5 mov r1, r12 muls r1, r2 adds r7, r4, 0 adds r7, 0x4C adds r5, r1, r7 ldr r3, [r5] movs r0, 0x20 ands r0, r3 cmp r0, 0 bne @0804BE7C b @0804C184 @0804BE7C: adds r0, r1, r4 ldrh r0, [r0, 0x28] cmp r0, 0 bne @0804BE86 b @0804C184 @0804BE86: ldr r0, =0x0202420b ldrb r0, [r0] cmp r0, r2 bne @0804BE90 b @0804C184 @0804BE90: ldr r0, =0x0202437c lsls r1, r2, 2 adds r1, r2 lsls r1, 2 adds r0, 0xC adds r1, r0 ldr r0, [r1] cmp r0, 0 bne @0804BEA4 b @0804C184 @0804BEA4: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @0804BEB2 b @0804C184 @0804BEB2: ldr r0, [sp, 0x4] cmp r0, 0xA beq @0804BEBA b @0804C184 @0804BEBA: movs r0, 0x21 negs r0, r0 ands r3, r0 str r3, [r5] ldr r4, =0x02024064 ldrb r0, [r6] strb r0, [r4] ldrb r0, [r6] mov r1, r12 muls r1, r0 adds r0, r1, 0 adds r0, r7 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB282 str r0, [r1] movs r2, 0x1 mov r10, r2 b @0804C184 .align 2, 0 .pool @0804BF18: ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0 str r0, [sp] movs r0, 0x7 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @0804BF32 b @0804C184 @0804BF32: movs r3, 0x1 mov r10, r3 b @0804C184 .align 2, 0 .pool @0804BF3C: ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0 str r0, [sp] movs r0, 0x4 movs r2, 0 movs r3, 0 bl ability_something b @0804C0B2 .align 2, 0 .pool @0804BF54: movs r0, 0 str r0, [sp] movs r0, 0x5 movs r1, 0 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @0804BF6C b @0804C184 @0804BF6C: movs r5, 0x1 mov r10, r5 ldr r0, =0x02024474 mov r12, r0 b @0804C570 .align 2, 0 .pool @0804BF7C: ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0 str r0, [sp] movs r0, 0x8 movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @0804BF96 b @0804C184 @0804BF96: movs r1, 0x1 mov r10, r1 b @0804C184 .align 2, 0 .pool @0804BFA0: ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @0804BFE4 ldr r2, [sp, 0x8] cmp r2, 0x1D bne @0804BFE4 ldr r0, =0x020241ec ldrh r2, [r0] adds r3, r0, 0 cmp r2, 0xA5 beq @0804BFE4 ldr r4, [sp, 0xC] ldrh r1, [r4] cmp r1, 0 beq @0804BFCC ldr r0, =0x0000ffff cmp r1, r0 bne @0804BFE4 @0804BFCC: cmp r2, 0xE2 bne @0804BFDE ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0804BFDE b @0804C4B6 @0804BFDE: ldrh r0, [r3] ldr r1, [sp, 0xC] strh r0, [r1] @0804BFE4: movs r4, 0 ldr r2, =0x02024084 ldr r3, =0x0202420b ldrb r1, [r3] movs r0, 0x58 muls r0, r1 adds r2, 0xC adds r0, r2 ldrh r0, [r0] ldr r5, [sp, 0xC] ldrh r1, [r5] mov r9, r3 cmp r0, r1 beq @0804C01C mov r6, r9 movs r3, 0x58 adds r5, r1, 0 @0804C006: adds r4, 0x1 cmp r4, 0x3 bgt @0804C01C lsls r0, r4, 1 ldrb r1, [r6] muls r1, r3 adds r0, r1 adds r0, r2 ldrh r0, [r0] cmp r0, r5 bne @0804C006 @0804C01C: cmp r4, 0x4 bne @0804C026 movs r0, 0 ldr r1, [sp, 0xC] strh r0, [r1] @0804C026: mov r2, r12 ldrb r0, [r2, 0x14] adds r0, 0x1 strb r0, [r2, 0x14] b @0804C570 .align 2, 0 .pool @0804C048: movs r4, 0 ldr r0, =0x0202406c ldrb r3, [r0] cmp r4, r3 blt @0804C054 b @0804C202 @0804C054: ldr r7, =0x0202449c movs r6, 0 movs r3, 0xD0 adds r5, r0, 0 ldr r2, =0x02024084 @0804C05E: ldr r0, [r7] adds r0, r3 ldrh r1, [r0] cmp r1, 0 beq @0804C06C strh r1, [r2, 0x2E] strh r6, [r0] @0804C06C: adds r3, 0x2 adds r2, 0x58 adds r4, 0x1 ldrb r0, [r5] cmp r4, r0 blt @0804C05E b @0804C202 .align 2, 0 .pool @0804C088: movs r0, 0x3 movs r1, 0 movs r2, 0 bl berry_effects_maybe lsls r0, 24 cmp r0, 0 beq @0804C184 movs r2, 0x1 mov r10, r2 ldr r3, =0x02024474 mov r12, r3 b @0804C570 .align 2, 0 .pool @0804C0A8: movs r0, 0x4 movs r1, 0 movs r2, 0 bl berry_effects_maybe @0804C0B2: lsls r0, 24 cmp r0, 0 beq @0804C184 @0804C0B8: movs r4, 0x1 mov r10, r4 b @0804C184 @0804C0BE: ldr r1, =0x020242ac ldr r0, =0x0202420b ldrb r2, [r0] lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x000400c0 ands r0, r1 cmp r0, 0 bne @0804C0D4 b @0804C4B6 @0804C0D4: ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @0804C0E2 b @0804BC68 @0804C0E2: b @0804C4B6 .align 2, 0 .pool @0804C0F4: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @0804C120 ldr r1, =0x020242ac ldr r0, =0x0202420b ldrb r2, [r0] lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x000400c0 ands r0, r1 cmp r0, 0 beq @0804C120 adds r0, r2, 0 bl sub_803F90C lsls r0, 24 cmp r0, 0 beq @0804C184 @0804C120: ldr r4, =0x02024064 ldr r5, =0x0202420b ldrb r0, [r5] strb r0, [r4] movs r0, 0 movs r1, 0 bl dp01_build_cmdbuf_x33_a_33_33 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, =0x020242ac ldrb r2, [r5] lsls r2, 2 adds r2, r0 ldr r0, [r2] ldr r1, =0xfffbff3f ands r0, r1 str r0, [r2] ldr r2, =0x0202437c ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @0804C15A: ldr r1, =0x02024474 ldrb r0, [r1, 0x14] adds r0, 0x1 strb r0, [r1, 0x14] b @0804C5BA .align 2, 0 .pool @0804C184: ldr r1, =0x02024474 ldrb r0, [r1, 0x14] adds r0, 0x1 strb r0, [r1, 0x14] mov r12, r1 b @0804C570 .align 2, 0 .pool @0804C194: ldr r0, =0x0202437c ldr r6, =0x0202420c ldrb r2, [r6] lsls r3, r2, 2 adds r1, r3, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1] lsls r0, 29 cmp r0, 0 blt @0804C202 ldr r0, =0x0202406c ldrb r0, [r0] cmp r2, r0 bcs @0804C202 ldr r5, =0x020242ac adds r0, r3, r5 ldr r0, [r0] ldr r1, =0x000400c0 ands r0, r1 cmp r0, 0 bne @0804C1C2 b @0804BC80 @0804C1C2: b @0804C202 .align 2, 0 .pool @0804C1D8: movs r4, 0 ldr r0, =0x0202406c ldrb r2, [r0] cmp r4, r2 bge @0804C202 ldr r2, =0x020242bc ldr r5, =0xfeffffff adds r3, r0, 0 ldr r1, =0x020240d4 @0804C1EA: ldrb r0, [r2, 0xA] cmp r0, 0 bne @0804C1F6 ldr r0, [r1] ands r0, r5 str r0, [r1] @0804C1F6: adds r2, 0x1C adds r1, 0x58 adds r4, 0x1 ldrb r0, [r3] cmp r4, r0 blt @0804C1EA @0804C202: mov r1, r12 ldrb r0, [r1, 0x14] adds r0, 0x1 strb r0, [r1, 0x14] b @0804C570 .align 2, 0 .pool @0804C21C: ldr r1, =0x02024280 ldr r3, [r1] movs r0, 0x80 lsls r0, 5 ands r0, r3 ldr r2, =0x0202420b mov r9, r2 adds r5, r1, 0 cmp r0, 0 beq @0804C246 ldr r0, =0x02024064 ldrb r2, [r2] strb r2, [r0] ldr r1, =0x0202420c ldrb r0, [r1] mov r4, r9 strb r0, [r4] strb r2, [r1] ldr r0, =0xffffefff ands r3, r0 str r3, [r5] @0804C246: ldr r0, [r5] movs r1, 0x80 lsls r1, 3 ands r0, r1 cmp r0, 0 beq @0804C262 ldr r0, =0x02024240 mov r2, r9 ldrb r1, [r2] lsls r1, 1 adds r1, r0 ldr r0, =0x020241ec ldrh r0, [r0] strh r0, [r1] @0804C262: ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 mov r3, r9 ldrb r4, [r3] lsls r0, r4, 2 adds r0, r2 ldr r3, [r0] ands r1, r3 adds r6, r2, 0 cmp r1, 0 beq @0804C27C b @0804C3E8 @0804C27C: ldr r0, =0x0202449c ldr r1, [r0] adds r1, 0x91 ldrb r1, [r1] ands r1, r3 adds r7, r0, 0 cmp r1, 0 beq @0804C28E b @0804C3E8 @0804C28E: ldr r0, =gBattleMoves ldr r2, [sp, 0x18] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r1, [r1] mov r8, r0 cmp r1, 0x7F bne @0804C2A4 b @0804C3E8 @0804C2A4: ldr r0, [r5] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @0804C308 ldr r0, =0x02024248 lsls r1, r4, 1 adds r1, r0 ldr r0, =0x020241ec ldrh r0, [r0] strh r0, [r1] ldr r0, =0x02024260 mov r3, r9 ldrb r1, [r3] lsls r1, 1 adds r1, r0 ldr r0, =0x020241ea ldrh r0, [r0] strh r0, [r1] b @0804C322 .align 2, 0 .pool @0804C308: ldr r1, =0x02024248 lsls r0, r4, 1 adds r0, r1 ldr r1, =0x0000ffff strh r1, [r0] ldr r1, =0x02024260 mov r4, r9 ldrb r0, [r4] lsls r0, 1 adds r0, r1 movs r1, 0x1 negs r1, r1 strh r1, [r0] @0804C322: ldr r2, =0x0202420c ldrb r3, [r2] lsls r0, r3, 2 adds r0, r6 ldr r0, [r0] lsls r0, 28 ldr r1, [r5] ands r1, r0 cmp r1, 0 bne @0804C340 ldr r0, =0x02024270 adds r0, r3, r0 mov r3, r9 ldrb r1, [r3] strb r1, [r0] @0804C340: ldr r0, [r5] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @0804C3DC ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @0804C3DC ldr r0, =0x020241ec ldrh r3, [r0] ldr r0, =0x0000ffff cmp r3, r0 bne @0804C390 ldr r1, =0x02024250 ldrb r0, [r2] lsls r0, 1 adds r0, r1 strh r3, [r0] b @0804C3E8 .align 2, 0 .pool @0804C390: ldr r0, =0x02024250 ldrb r1, [r2] lsls r1, 1 adds r1, r0 ldr r4, =0x020241ea ldrh r0, [r4] strh r0, [r1] ldr r0, [r7] ldrb r3, [r0, 0x13] cmp r3, 0 beq @0804C3C0 ldr r0, =0x02024258 ldrb r1, [r2] lsls r1, 1 adds r1, r0 movs r0, 0x3F ands r0, r3 b @0804C3E6 .align 2, 0 .pool @0804C3C0: ldr r0, =0x02024258 ldrb r2, [r2] lsls r2, 1 adds r2, r0 ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 add r0, r8 ldrb r0, [r0, 0x2] strh r0, [r2] b @0804C3E8 .align 2, 0 .pool @0804C3DC: ldr r0, =0x02024250 ldrb r1, [r2] lsls r1, 1 adds r1, r0 ldr r0, =0x0000ffff @0804C3E6: strh r0, [r1] @0804C3E8: mov r4, r12 ldrb r0, [r4, 0x14] adds r0, 0x1 strb r0, [r4, 0x14] b @0804C570 .align 2, 0 .pool @0804C3FC: ldr r0, =0x02024210 ldrb r1, [r0] ldr r7, =gUnknown_0832A328 ldr r2, =0x0202420b ldrb r3, [r2] lsls r0, r3, 2 adds r0, r7 ldr r4, [r0] ands r1, r4 mov r9, r2 cmp r1, 0 bne @0804C4B6 ldr r6, =0x0202449c ldr r5, [r6] adds r0, r5, 0 adds r0, 0x91 ldrb r0, [r0] ands r0, r4 cmp r0, 0 bne @0804C4B6 ldr r1, =gBattleMoves ldr r2, [sp, 0x18] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x8] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @0804C4B6 ldr r0, =0x02024280 ldr r1, [r0] movs r0, 0x80 lsls r0, 18 ands r0, r1 cmp r0, 0 beq @0804C4B6 ldr r4, =0x0202420c ldrb r0, [r4] cmp r3, r0 beq @0804C4B6 ldrb r2, [r4] lsls r0, r2, 2 adds r0, r7 ldr r0, [r0] lsls r0, 28 ands r1, r0 cmp r1, 0 bne @0804C4B6 ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @0804C4B6 lsls r1, r2, 1 adds r1, r5 adds r1, 0x98 ldr r3, =0x020241ec ldrh r0, [r3] strb r0, [r1] ldrb r1, [r4] ldr r0, [r6] lsls r1, 1 adds r1, r0 adds r1, 0x99 ldrh r0, [r3] lsrs r0, 8 strb r0, [r1] ldrb r0, [r4] mov r2, r9 ldrb r1, [r2] ldr r2, [r6] lsls r0, 3 lsls r1, 1 adds r0, r1 adds r0, r2 adds r0, 0xE0 ldrh r1, [r3] strb r1, [r0] ldrb r1, [r4] mov r4, r9 ldrb r0, [r4] ldr r2, [r6] lsls r1, 3 lsls r0, 1 adds r1, r0 adds r1, r2 adds r1, 0xE1 ldrh r0, [r3] lsrs r0, 8 strb r0, [r1] @0804C4B6: mov r5, r12 ldrb r0, [r5, 0x14] adds r0, 0x1 strb r0, [r5, 0x14] b @0804C570 .align 2, 0 .pool @0804C4E4: ldr r5, =0x02024280 ldr r2, [r5] movs r0, 0x80 lsls r0, 12 ands r0, r2 cmp r0, 0 bne @0804C568 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0804C568 ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0, 0x1] lsls r0, 29 cmp r0, 0 blt @0804C568 ldr r0, =gBattleMoves mov r9, r0 ldr r1, =0x020241ea mov r8, r1 ldrh r0, [r1] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 add r1, r9 ldrb r0, [r1, 0x6] cmp r0, 0x8 bne @0804C568 movs r6, 0x80 lsls r6, 2 adds r4, r6, 0 ands r4, r2 cmp r4, 0 bne @0804C568 ldr r7, =0x0202420c ldrb r0, [r7] bl battle_get_per_side_status movs r1, 0x2 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 beq @0804C55E bl @0804BCAC @0804C55E: ldr r0, [r5] orrs r0, r6 str r0, [r5] ldr r2, =0x02024474 mov r12, r2 @0804C568: mov r3, r12 ldrb r0, [r3, 0x14] adds r0, 0x1 strb r0, [r3, 0x14] @0804C570: ldr r4, [sp, 0x10] cmp r4, 0x1 bne @0804C582 mov r5, r10 cmp r5, 0 bne @0804C582 movs r0, 0x11 mov r1, r12 strb r0, [r1, 0x14] @0804C582: ldr r2, [sp, 0x10] cmp r2, 0x2 bne @0804C598 ldr r4, [sp, 0x14] mov r3, r12 ldrb r3, [r3, 0x14] cmp r4, r3 bne @0804C598 movs r0, 0x11 mov r4, r12 strb r0, [r4, 0x14] @0804C598: mov r5, r12 ldrb r0, [r5, 0x14] cmp r0, 0x11 beq @0804C5A4 bl @0804BD14 @0804C5A4: mov r1, r12 ldrb r0, [r1, 0x14] cmp r0, 0x11 bne @0804C5BA mov r2, r10 cmp r2, 0 bne @0804C5BA ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x3 @0804C5B8: str r0, [r1] @0804C5BA: add sp, 0x1C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804BBCC thumb_func_start atk4A_damagecalc2 atk4A_damagecalc2: ; 804C5F4 push {r4-r7,lr} mov r7, r8 push {r7} movs r4, 0 movs r5, 0 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x2] mov r8, r0 ldr r2, =0x02024084 ldr r3, =0x0202420c ldrb r1, [r3] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r0, [r0] mov r12, r2 adds r7, r3, 0 cmp r0, 0x1A bne @0804C688 mov r1, r8 cmp r1, 0x4 bne @0804C688 ldr r3, =0x0202420a strb r0, [r3] ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x9 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024250 ldrb r0, [r7] lsls r0, 1 adds r0, r1 strh r4, [r0] ldr r0, =0x02024332 mov r2, r8 strb r2, [r0, 0x6] ldrb r0, [r7] ldrb r1, [r3] bl b_history__record_ability_usage_of_player b @0804C76A .align 2, 0 .pool @0804C678: ldr r0, =0x0202427c ldrb r1, [r0] movs r2, 0x8 orrs r1, r2 strb r1, [r0] b @0804C76A .align 2, 0 .pool @0804C688: ldr r1, =gUnknown_0831ACE8 adds r0, r5, r1 ldrb r0, [r0] adds r6, r1, 0 b @0804C74A .align 2, 0 .pool @0804C698: adds r0, r5, r6 ldrb r0, [r0] cmp r0, r8 bne @0804C744 adds r2, r5, 0x1 adds r3, r2, r6 ldrb r1, [r7] movs r0, 0x58 muls r0, r1 add r0, r12 adds r0, 0x21 ldrb r1, [r3] adds r3, r2, 0 ldrb r0, [r0] cmp r1, r0 bne @0804C6D6 adds r0, r5, 0x2 adds r0, r6 ldrb r1, [r0] cmp r1, 0 beq @0804C678 cmp r1, 0x5 bne @0804C6CA movs r0, 0x4 orrs r4, r0 @0804C6CA: cmp r1, 0x14 bne @0804C6D6 movs r0, 0x2 orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0804C6D6: adds r2, r3, r6 ldrb r1, [r7] movs r0, 0x58 muls r0, r1 add r0, r12 adds r1, r0, 0 adds r1, 0x22 ldrb r2, [r2] ldrb r1, [r1] cmp r2, r1 bne @0804C744 adds r0, 0x21 ldrb r1, [r0] cmp r1, r2 beq @0804C6FE adds r0, r5, 0x2 adds r0, r6 ldrb r0, [r0] cmp r0, 0 beq @0804C678 @0804C6FE: cmp r1, r2 beq @0804C714 adds r0, r5, 0x2 adds r0, r6 ldrb r0, [r0] cmp r0, 0x5 bne @0804C714 movs r0, 0x4 orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0804C714: adds r2, r3, r6 ldrb r1, [r7] movs r0, 0x58 muls r0, r1 add r0, r12 adds r1, r0, 0 adds r1, 0x22 ldrb r2, [r2] ldrb r1, [r1] cmp r2, r1 bne @0804C744 adds r0, 0x21 ldrb r0, [r0] cmp r0, r2 beq @0804C744 adds r0, r5, 0x2 adds r0, r6 ldrb r0, [r0] cmp r0, 0x14 bne @0804C744 movs r0, 0x2 orrs r4, r0 lsls r0, r4, 24 lsrs r4, r0, 24 @0804C744: adds r5, 0x3 adds r0, r5, r6 ldrb r0, [r0] @0804C74A: cmp r0, 0xFF beq @0804C76A cmp r0, 0xFE bne @0804C698 ldrb r1, [r7] movs r0, 0x58 muls r0, r1 mov r1, r12 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 22 ands r0, r1 cmp r0, 0 beq @0804C744 @0804C76A: ldr r2, =0x02024084 ldr r0, =0x0202420c mov r8, r0 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x20 ldrb r6, [r0] cmp r6, 0x19 bne @0804C7E6 movs r5, 0x29 ands r5, r4 cmp r5, 0 bne @0804C7E6 ldr r0, =0x0202420b ldrb r0, [r0] ldr r7, =0x020241ea ldrh r1, [r7] bl move_weather_interaction lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x2 bne @0804C7E6 adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @0804C7AC movs r0, 0x6 ands r4, r0 cmp r4, 0x6 bne @0804C7E6 @0804C7AC: ldr r2, =gBattleMoves ldrh r1, [r7] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 beq @0804C7E6 ldr r3, =0x0202420a strb r6, [r3] ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024250 mov r2, r8 ldrb r0, [r2] lsls r0, 1 adds r0, r1 strh r5, [r0] ldr r1, =0x02024332 movs r0, 0x3 strb r0, [r1, 0x6] ldrb r0, [r2] ldrb r1, [r3] bl b_history__record_ability_usage_of_player @0804C7E6: ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @0804C804 ldr r2, =0x0202433c ldr r0, =0x0202420b ldrb r1, [r0] lsls r1, 4 adds r1, r2 ldrb r0, [r1, 0x1] movs r2, 0x2 orrs r0, r2 strb r0, [r1, 0x1] @0804C804: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk4A_damagecalc2 thumb_func_start atk4B_cmd4b atk4B_cmd4b: ; 804C844 push {r4,lr} ldr r4, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r4] ldr r2, =0x02024280 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] lsls r1, 28 ldr r0, [r2] ands r0, r1 cmp r0, 0 bne @0804C872 movs r0, 0 movs r1, 0 bl dp01_build_cmdbuf_x06_a ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0804C872: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk4B_cmd4b thumb_func_start atk4C_switch1 atk4C_switch1: ; 804C894 push {r4,r5,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804C8E4 ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] ldr r3, =0x0202406e ldrb r0, [r4] lsls r2, r0, 1 adds r2, r3 ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 adds r0, 0x5C ldrb r0, [r0] strh r0, [r2] ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 1 adds r0, r3 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldrb r2, [r0] movs r0, 0 movs r1, 0 bl dp01_build_cmdbuf_x00_a_b_0 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x2 str r0, [r5] @0804C8E4: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk4C_switch1 thumb_func_start sub_804C904 sub_804C904: ; 804C904 push {r4-r7,lr} sub sp, 0x58 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @0804C912 b @0804CAA4 @0804C912: ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] ldr r6, =0x02024084 ldrb r0, [r4] movs r5, 0x58 adds r1, r0, 0 muls r1, r5 adds r1, r6 mov r0, sp movs r2, 0x58 bl memcpy ldrb r0, [r4] muls r0, r5 adds r3, r0, r6 movs r2, 0 ldr r5, =0x02023864 @0804C93E: adds r0, r3, r2 ldrb r1, [r4] lsls r1, 9 adds r1, 0x4 adds r1, r2, r1 adds r1, r5 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x57 bls @0804C93E ldr r4, =0x02024084 ldr r6, =0x02024064 ldrb r0, [r6] movs r7, 0x58 adds r2, r0, 0 muls r2, r7 adds r2, r4 ldr r3, =gBaseStats ldrh r1, [r2] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x6] adds r2, 0x21 strb r0, [r2] ldrb r0, [r6] adds r1, r0, 0 muls r1, r7 adds r1, r4 ldrh r2, [r1] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x7] adds r1, 0x22 strb r0, [r1] ldrb r0, [r6] adds r1, r0, 0 muls r1, r7 adds r1, r4 ldrh r0, [r1] ldrb r1, [r1, 0x17] lsrs r1, 7 bl sub_806B694 ldrb r1, [r6] muls r1, r7 adds r1, r4 adds r1, 0x20 strb r0, [r1] ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x020243d0 adds r0, 0x29 adds r0, r2, r0 ldrb r1, [r0] ldr r3, =gUnknown_0832A328 ldr r2, =0x0202406e ldrb r5, [r6] lsls r0, r5, 1 adds r0, r2 ldrh r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] ands r1, r0 mov r12, r4 cmp r1, 0 beq @0804C9DE adds r0, r5, 0 muls r0, r7 add r0, r12 movs r1, 0 strh r1, [r0, 0x2E] @0804C9DE: ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] cmp r0, 0x7F bne @0804CA26 movs r2, 0 adds r4, r6, 0 movs r6, 0x58 mov r5, r12 adds r5, 0x18 add r3, sp, 0x18 @0804C9FE: ldrb r0, [r4] adds r1, r0, 0 muls r1, r6 adds r1, r2, r1 adds r1, r5 adds r0, r3, r2 ldrb r0, [r0] strb r0, [r1] adds r2, 0x1 cmp r2, 0x7 ble @0804C9FE ldr r0, =0x02024064 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 mov r1, r12 adds r1, 0x50 adds r0, r1 ldr r1, [sp, 0x50] str r1, [r0] @0804CA26: bl sub_803A284 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @0804CA78 ldr r4, =0x02024084 ldr r0, =0x02024064 ldrb r3, [r0] movs r0, 0x58 adds r2, r3, 0 muls r2, r0 adds r1, r2, r4 ldrh r0, [r1, 0x2C] lsrs r0, 1 ldrh r1, [r1, 0x28] cmp r0, r1 bcc @0804CA78 cmp r1, 0 beq @0804CA78 adds r0, r4, 0 adds r0, 0x4C adds r0, r2, r0 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 bne @0804CA78 ldr r0, =0x0202449c ldr r2, [r0] adds r2, 0x92 ldr r1, =gUnknown_0832A328 lsls r0, r3, 2 adds r0, r1 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] @0804CA78: ldr r0, =0x02024474 ldr r3, =0x02024064 ldrb r2, [r3] strb r2, [r0, 0x17] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x7 strb r0, [r1, 0x1] strb r2, [r1, 0x2] ldr r2, =0x0202406e ldrb r0, [r3] lsls r0, 1 adds r0, r2 ldrh r0, [r0] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] @0804CAA4: add sp, 0x58 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804C904 thumb_func_start atk4E_switch3 atk4E_switch3: ; 804CAE8 push {r4-r6,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804CB86 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r6, =0x02024064 strb r0, [r6] ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0804CB3E ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x063f0902 ands r0, r1 cmp r0, 0 bne @0804CB3E ldr r4, =0x02024084 ldrb r0, [r6] movs r5, 0x58 muls r0, r5 adds r0, r4 ldrh r0, [r0] bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 ldrb r1, [r6] muls r1, r5 adds r4, 0x48 adds r1, r4 ldr r2, [r1] movs r1, 0x2 bl sub_806F01C @0804CB3E: ldr r2, =0x02024210 ldr r1, =gUnknown_0832A328 ldr r5, =0x02024064 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldrb r0, [r2] bics r0, r1 strb r0, [r2] ldr r1, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrb r1, [r0] ldr r4, =0x02024214 ldr r0, [r4] ldrb r2, [r0, 0x2] movs r0, 0 bl dp01_build_cmdbuf_x05_a_b_c ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r4] adds r0, 0x3 str r0, [r4] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @0804CB86 bl sub_81A56B4 @0804CB86: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk4E_switch3 thumb_func_start atk4F_jumpifcannotswitch atk4F_jumpifcannotswitch: ; 804CBB0 push {r4-r7,lr} mov r7, r8 push {r7} ldr r4, =0x02024214 ldr r0, [r4] ldrb r1, [r0, 0x1] movs r0, 0x7F ands r0, r1 bl get_battle_side_of_something ldr r3, =0x02024064 strb r0, [r3] ldr r2, [r4] ldrb r1, [r2, 0x1] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0804CC28 ldr r1, =0x02024084 ldrb r3, [r3] movs r0, 0x58 muls r0, r3 adds r1, 0x50 adds r0, r1 ldr r0, [r0] ldr r1, =0x0400e000 ands r0, r1 cmp r0, 0 bne @0804CBFC ldr r1, =0x020242ac lsls r0, r3, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 3 ands r0, r1 cmp r0, 0 beq @0804CC28 @0804CBFC: ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x5] lsls r0, 24 orrs r1, r0 str r1, [r4] b @0804CF00 .align 2, 0 .pool @0804CC28: ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 15 ands r0, r1 cmp r0, 0 beq @0804CCC0 ldr r5, =0x02024064 ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 ldr r1, =0x020244ec mov r8, r1 cmp r0, 0x1 bne @0804CC4E ldr r0, =0x02024744 mov r8, r0 @0804CC4E: movs r4, 0 ldrb r1, [r5] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0804CC5C movs r4, 0x3 @0804CC5C: adds r6, r4, 0x3 cmp r4, r6 bge @0804CCA4 ldr r7, =0x0202406e @0804CC64: movs r0, 0x64 muls r0, r4 mov r1, r8 adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @0804CC9E adds r0, r5, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0804CC9E adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0804CC9E ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r7 ldrh r0, [r0] cmp r0, r4 bne @0804CCA4 @0804CC9E: adds r4, 0x1 cmp r4, r6 blt @0804CC64 @0804CCA4: cmp r4, r6 bne @0804CCAA b @0804CED0 @0804CCAA: b @0804CEF8 .align 2, 0 .pool @0804CCC0: movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0804CD8C movs r0, 0x80 lsls r0, 16 ands r1, r0 cmp r1, 0 beq @0804CD00 ldr r5, =0x02024064 ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0804CCEC ldr r0, =0x020244ec b @0804CD16 .align 2, 0 .pool @0804CCEC: ldr r1, =0x02024744 mov r8, r1 ldrb r0, [r5] movs r4, 0x3 cmp r0, 0x1 bne @0804CD32 movs r4, 0 b @0804CD32 .align 2, 0 .pool @0804CD00: ldr r5, =0x02024064 ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 ldr r1, =0x020244ec mov r8, r1 cmp r0, 0x1 bne @0804CD18 ldr r0, =0x02024744 @0804CD16: mov r8, r0 @0804CD18: movs r4, 0 ldrb r0, [r5] bl sub_806D864 lsls r0, 24 lsrs r0, 24 bl sub_806D82C lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bne @0804CD32 movs r4, 0x3 @0804CD32: adds r6, r4, 0x3 cmp r4, r6 bge @0804CCA4 ldr r7, =0x0202406e @0804CD3A: movs r0, 0x64 muls r0, r4 mov r1, r8 adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @0804CD74 adds r0, r5, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0804CD74 adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0804CD74 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r7 ldrh r0, [r0] cmp r0, r4 bne @0804CCA4 @0804CD74: adds r4, 0x1 cmp r4, r6 blt @0804CD3A b @0804CCA4 .align 2, 0 .pool @0804CD8C: movs r0, 0x80 lsls r0, 8 ands r1, r0 cmp r1, 0 beq @0804CE10 ldr r5, =0x02024064 ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0804CE10 ldr r0, =0x02024744 mov r8, r0 movs r4, 0 ldrb r0, [r5] cmp r0, 0x3 bne @0804CDB4 movs r4, 0x3 @0804CDB4: adds r6, r4, 0x3 cmp r4, r6 blt @0804CDBC b @0804CCA4 @0804CDBC: ldr r7, =0x0202406e @0804CDBE: movs r0, 0x64 muls r0, r4 mov r1, r8 adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @0804CDFA adds r0, r5, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0804CDFA adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0804CDFA ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r7 ldrh r0, [r0] cmp r0, r4 beq @0804CDFA b @0804CCA4 @0804CDFA: adds r4, 0x1 cmp r4, r6 blt @0804CDBE b @0804CCA4 .align 2, 0 .pool @0804CE10: ldr r0, =0x02024064 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x1 bne @0804CE54 movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 ldr r0, =0x02022fec ldr r0, [r0] ands r0, r4 cmp r0, 0 beq @0804CE48 movs r0, 0x3 bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 b @0804CE4A .align 2, 0 .pool @0804CE48: adds r6, r7, 0 @0804CE4A: ldr r0, =0x02024744 mov r8, r0 b @0804CE82 .align 2, 0 .pool @0804CE54: movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0804CE7C movs r0, 0x2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 b @0804CE7E .align 2, 0 .pool @0804CE7C: adds r6, r7, 0 @0804CE7E: ldr r1, =0x020244ec mov r8, r1 @0804CE82: movs r4, 0 @0804CE84: movs r0, 0x64 muls r0, r4 mov r1, r8 adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0804CEC6 adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @0804CEC6 adds r0, r5, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0804CEC6 ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 beq @0804CEC6 lsls r0, r6, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 bne @0804CECC @0804CEC6: adds r4, 0x1 cmp r4, 0x5 ble @0804CE84 @0804CECC: cmp r4, 0x6 bne @0804CEF8 @0804CED0: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x5] lsls r0, 24 orrs r1, r0 str r1, [r3] b @0804CF00 .align 2, 0 .pool @0804CEF8: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x6 str r0, [r1] @0804CF00: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk4F_jumpifcannotswitch thumb_func_start sub_804CF10 sub_804CF10: ; 804CF10 push {r4,r5,lr} sub sp, 0x4 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 ldr r5, =0x02024064 ldrb r0, [r5] ldr r4, =0x0202449c ldr r1, [r4] adds r1, r0, r1 adds r1, 0x58 ldr r3, =0x0202406e lsls r0, 1 adds r0, r3 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r5] ldr r1, [r4] adds r0, r1 adds r0, 0x5C movs r1, 0x6 strb r1, [r0] ldr r1, [r4] adds r1, 0x93 ldr r3, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r3 ldr r3, [r0] ldrb r0, [r1] bics r0, r3 strb r0, [r1] ldrb r0, [r5] lsls r1, r0, 1 adds r1, r0 adds r1, 0x60 ldr r0, [r4] adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x1 movs r3, 0 bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804CF10 thumb_func_start atk50_openpartyscreen atk50_openpartyscreen: ; 804CF88 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 movs r7, 0 movs r0, 0 mov r9, r0 ldr r6, =0x02024214 ldr r2, [r6] ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x5] lsls r0, 24 orrs r1, r0 mov r8, r1 ldrb r1, [r2, 0x1] adds r0, r1, 0 mov r12, r6 cmp r0, 0x5 beq @0804CFBE b @0804D464 @0804CFBE: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x41 ands r1, r0 cmp r1, 0x1 beq @0804D0B0 ldr r1, =0x02024064 strb r7, [r1] ldr r0, =0x0202406c ldrb r0, [r0] cmp r7, r0 bcc @0804CFD8 b @0804D450 @0804CFD8: ldr r7, =0x02024280 ldr r6, =gUnknown_0832A328 adds r4, r1, 0 ldr r2, =0x02024210 mov r8, r2 @0804CFE2: ldrb r2, [r4] lsls r0, r2, 2 adds r0, r6 ldr r1, [r0] lsls r1, 28 ldr r0, [r7] ands r0, r1 cmp r0, 0 beq @0804D088 adds r0, r2, 0 movs r1, 0x6 movs r2, 0x6 bl sub_80423F4 lsls r0, 24 cmp r0, 0 beq @0804D054 ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r0, [r0] mov r2, r8 ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r1, [r0] lsls r1, 28 ldr r0, [r7] bics r0, r1 str r0, [r7] movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @0804D098 .align 2, 0 .pool @0804D054: ldr r5, =0x0202437c ldrb r0, [r4] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r5 ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804D098 movs r0, 0x6 bl sub_804CF10 ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] b @0804D098 .align 2, 0 .pool @0804D088: movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0804D098: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @0804CFE2 b @0804D450 .align 2, 0 .pool @0804D0B0: ands r0, r1 cmp r0, 0 bne @0804D0B8 b @0804D450 @0804D0B8: ldr r0, =0x02024280 mov r8, r0 ldr r0, [r0] lsrs r5, r0, 28 ldr r6, =gUnknown_0832A328 ldr r0, [r6] ands r0, r5 cmp r0, 0 beq @0804D170 ldr r4, =0x02024064 strb r7, [r4] movs r0, 0 movs r1, 0x6 movs r2, 0x6 bl sub_80423F4 lsls r0, 24 cmp r0, 0 beq @0804D120 ldr r2, =0x02024210 ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r1, [r0] lsls r1, 28 mov r2, r8 ldr r0, [r2] bics r0, r1 str r0, [r2] movs r0, 0 bl dp01_build_cmdbuf_x2A_2A_2A_2A ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @0804D170 .align 2, 0 .pool @0804D120: ldr r6, =0x0202437c ldrb r0, [r4] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804D15C ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x5E ldrb r0, [r0] bl sub_804CF10 ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] b @0804D170 .align 2, 0 .pool @0804D15C: movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution movs r0, 0x1 mov r9, r0 @0804D170: ldr r6, =gUnknown_0832A328 ldr r0, [r6, 0x8] ands r0, r5 cmp r0, 0 beq @0804D22E ldr r0, [r6] ands r0, r5 cmp r0, 0 bne @0804D22E ldr r4, =0x02024064 movs r0, 0x2 strb r0, [r4] movs r0, 0x2 movs r1, 0x6 movs r2, 0x6 bl sub_80423F4 lsls r0, 24 cmp r0, 0 beq @0804D1D8 ldr r2, =0x02024210 ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r2, =0x02024280 ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r1, [r0] lsls r1, 28 ldr r0, [r2] bics r0, r1 str r0, [r2] movs r0, 0 bl dp01_build_cmdbuf_x2A_2A_2A_2A ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @0804D22E .align 2, 0 .pool @0804D1D8: ldr r6, =0x0202437c ldrb r0, [r4] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804D214 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x5C ldrb r0, [r0] bl sub_804CF10 ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] b @0804D22E .align 2, 0 .pool @0804D214: movs r0, 0x1 mov r1, r9 ands r0, r1 cmp r0, 0 bne @0804D22E movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0804D22E: ldr r6, =gUnknown_0832A328 ldr r0, [r6, 0x4] ands r0, r5 cmp r0, 0 beq @0804D2E4 ldr r4, =0x02024064 movs r0, 0x1 strb r0, [r4] movs r0, 0x1 movs r1, 0x6 movs r2, 0x6 bl sub_80423F4 lsls r0, 24 cmp r0, 0 beq @0804D290 ldr r2, =0x02024210 ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r2, =0x02024280 ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r1, [r0] lsls r1, 28 ldr r0, [r2] bics r0, r1 str r0, [r2] movs r0, 0 bl dp01_build_cmdbuf_x2A_2A_2A_2A ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @0804D2E4 .align 2, 0 .pool @0804D290: ldr r6, =0x0202437c ldrb r0, [r4] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804D2CC ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x5F ldrb r0, [r0] bl sub_804CF10 ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] b @0804D2E4 .align 2, 0 .pool @0804D2CC: movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution movs r0, 0x2 mov r2, r9 orrs r2, r0 mov r9, r2 @0804D2E4: ldr r6, =gUnknown_0832A328 ldr r0, [r6, 0xC] ands r0, r5 cmp r0, 0 beq @0804D3A2 ldr r0, [r6, 0x4] ands r0, r5 cmp r0, 0 bne @0804D3A2 ldr r4, =0x02024064 movs r0, 0x3 strb r0, [r4] movs r0, 0x3 movs r1, 0x6 movs r2, 0x6 bl sub_80423F4 lsls r0, 24 cmp r0, 0 beq @0804D34C ldr r2, =0x02024210 ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r2, =0x02024280 ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r1, [r0] lsls r1, 28 ldr r0, [r2] bics r0, r1 str r0, [r2] movs r0, 0 bl dp01_build_cmdbuf_x2A_2A_2A_2A ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @0804D3A2 .align 2, 0 .pool @0804D34C: ldr r6, =0x0202437c ldrb r0, [r4] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804D388 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x5D ldrb r0, [r0] bl sub_804CF10 ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] b @0804D3A2 .align 2, 0 .pool @0804D388: movs r0, 0x2 mov r1, r9 ands r1, r0 cmp r1, 0 bne @0804D3A2 movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0804D3A2: ldr r1, =0x0202437c ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804D3FA adds r0, r1, 0 adds r0, 0x28 ldrb r0, [r0] lsls r0, 25 cmp r0, 0 blt @0804D3FA cmp r5, 0 beq @0804D3FA ldr r0, =0x02024210 ldrb r1, [r0] ldr r0, =gUnknown_0832A328 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0804D3E4 ldr r1, =0x02024064 movs r0, 0x2 strb r0, [r1] b @0804D3E8 .align 2, 0 .pool @0804D3E4: ldr r0, =0x02024064 strb r1, [r0] @0804D3E8: movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution @0804D3FA: ldr r1, =0x0202437c ldrb r0, [r1, 0x14] lsls r0, 25 cmp r0, 0 blt @0804D450 adds r0, r1, 0 adds r0, 0x3C ldrb r0, [r0] lsls r0, 25 cmp r0, 0 blt @0804D450 cmp r5, 0 beq @0804D450 ldr r0, =0x02024210 ldrb r0, [r0] ldr r1, =gUnknown_0832A328 ldr r1, [r1, 0x4] ands r0, r1 cmp r0, 0 beq @0804D438 ldr r1, =0x02024064 movs r0, 0x3 b @0804D43C .align 2, 0 .pool @0804D438: ldr r1, =0x02024064 movs r0, 0x1 @0804D43C: strb r0, [r1] movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution @0804D450: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x6 str r0, [r1] b @0804D804 .align 2, 0 .pool @0804D464: cmp r0, 0x6 beq @0804D46A b @0804D658 @0804D46A: ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0804D478 b @0804D5F4 @0804D478: movs r0, 0x1 ands r1, r0 cmp r1, 0 bne @0804D482 b @0804D5F4 @0804D482: ldr r7, =0x02024280 ldr r0, [r7] lsrs r5, r0, 28 ldr r4, =gUnknown_0832A328 ldr r0, [r4, 0x8] ands r0, r5 cmp r0, 0 beq @0804D52A ldr r0, [r4] ands r0, r5 cmp r0, 0 beq @0804D52A ldr r6, =0x02024064 movs r0, 0x2 strb r0, [r6] ldr r0, =0x02023864 ldrb r1, [r0, 0x1] movs r0, 0x2 movs r2, 0x6 bl sub_80423F4 lsls r0, 24 cmp r0, 0 beq @0804D4F8 ldr r2, =0x02024210 ldrb r0, [r6] lsls r0, 2 adds r0, r4 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldrb r0, [r6] lsls r0, 2 adds r0, r4 ldr r1, [r0] lsls r1, 28 ldr r0, [r7] bics r0, r1 str r0, [r7] movs r0, 0 bl dp01_build_cmdbuf_x2A_2A_2A_2A ldrb r0, [r6] bl dp01_battle_side_mark_buffer_for_execution b @0804D52A .align 2, 0 .pool @0804D4F8: ldr r4, =0x0202437c ldrb r0, [r6] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r4 ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804D52A ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x5C ldrb r0, [r0] bl sub_804CF10 ldrb r1, [r6] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] @0804D52A: ldr r4, =gUnknown_0832A328 ldr r0, [r4, 0xC] ands r0, r5 cmp r0, 0 beq @0804D5DA ldr r0, [r4, 0x4] ands r5, r0 cmp r5, 0 beq @0804D5DA ldr r5, =0x02024064 movs r0, 0x3 strb r0, [r5] ldr r0, =0x02023864 ldr r2, =0x00000201 adds r0, r2 ldrb r1, [r0] movs r0, 0x3 movs r2, 0x6 bl sub_80423F4 lsls r0, 24 cmp r0, 0 beq @0804D5A8 ldr r2, =0x02024210 ldrb r0, [r5] lsls r0, 2 adds r0, r4 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r2, =0x02024280 ldrb r0, [r5] lsls r0, 2 adds r0, r4 ldr r1, [r0] lsls r1, 28 ldr r0, [r2] bics r0, r1 str r0, [r2] movs r0, 0 bl dp01_build_cmdbuf_x2A_2A_2A_2A ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution b @0804D5DA .align 2, 0 .pool @0804D5A8: ldr r4, =0x0202437c ldrb r0, [r5] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r4 ldrb r0, [r1] lsls r0, 25 cmp r0, 0 blt @0804D5DA ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x5D ldrb r0, [r0] bl sub_804CF10 ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] @0804D5DA: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x6 str r0, [r1] mov r12, r1 b @0804D5F8 .align 2, 0 .pool @0804D5F4: adds r0, r2, 0x6 str r0, [r6] @0804D5F8: ldr r0, =0x02024280 ldr r0, [r0] lsrs r5, r0, 28 ldr r1, =0x0202420d movs r0, 0 strb r0, [r1] ldr r4, =gUnknown_0832A328 ldr r2, [r4] ands r2, r5 ldr r6, =0x0202406c cmp r2, 0 bne @0804D634 adds r7, r6, 0 ldrb r0, [r6] cmp r2, r0 bcs @0804D634 adds r3, r1, 0 @0804D61A: ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] ldrb r2, [r3] lsls r0, r2, 2 adds r0, r4 ldr r0, [r0] ands r0, r5 cmp r0, 0 bne @0804D634 ldrb r0, [r7] cmp r2, r0 bcc @0804D61A @0804D634: ldrb r0, [r1] ldrb r6, [r6] cmp r0, r6 beq @0804D63E b @0804D804 @0804D63E: mov r1, r8 mov r2, r12 str r1, [r2] b @0804D804 .align 2, 0 .pool @0804D658: movs r0, 0x80 ands r0, r1 movs r5, 0x1 cmp r0, 0 beq @0804D664 movs r5, 0 @0804D664: movs r0, 0x7F ands r0, r1 bl get_battle_side_of_something lsls r0, 24 lsrs r7, r0, 24 ldr r1, =0x0202437c lsls r0, r7, 2 adds r0, r7 lsls r0, 2 adds r0, r1 ldrb r0, [r0] lsls r0, 25 cmp r0, 0 bge @0804D690 ldr r0, [r6] adds r0, 0x6 str r0, [r6] b @0804D804 .align 2, 0 .pool @0804D690: adds r0, r7, 0 movs r1, 0x6 movs r2, 0x6 bl sub_80423F4 lsls r0, 24 cmp r0, 0 beq @0804D6E0 ldr r2, =0x02024064 strb r7, [r2] ldr r3, =0x02024210 ldr r4, =gUnknown_0832A328 ldrb r0, [r2] lsls r0, 2 adds r0, r4 ldr r0, [r0] ldrb r1, [r3] orrs r0, r1 strb r0, [r3] ldr r3, =0x02024280 ldrb r0, [r2] lsls r0, 2 adds r0, r4 ldr r1, [r0] lsls r1, 28 ldr r0, [r3] bics r0, r1 str r0, [r3] mov r0, r8 str r0, [r6] b @0804D804 .align 2, 0 .pool @0804D6E0: ldr r4, =0x02024064 strb r7, [r4] ldrb r0, [r4] ldr r3, =0x0202449c ldr r1, [r3] adds r1, r0, r1 adds r1, 0x58 ldr r2, =0x0202406e lsls r0, 1 adds r0, r2 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r4] ldr r1, [r3] adds r0, r1 adds r0, 0x5C movs r1, 0x6 strb r1, [r0] ldr r1, [r3] adds r1, 0x93 ldr r2, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r2 ldr r2, [r0] ldrb r0, [r1] bics r0, r2 strb r0, [r1] ldrb r1, [r4] movs r0, 0x2 eors r0, r1 ldr r3, [r3] adds r0, r3 adds r0, 0x5C ldrb r2, [r0] ldrb r1, [r4] lsls r0, r1, 1 adds r0, r1 adds r0, 0x60 adds r3, r0 str r3, [sp] movs r0, 0 adds r1, r5, 0 movs r3, 0 bl dp01_build_cmdbuf_x16_a_b_c_ptr_d_e_f ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r6] adds r0, 0x6 str r0, [r6] ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 cmp r0, 0 bne @0804D760 ldr r1, =0x03005d10 ldrb r0, [r1, 0x2] cmp r0, 0xFE bhi @0804D760 adds r0, 0x1 strb r0, [r1, 0x2] @0804D760: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0804D7C4 ldr r1, =0x02024064 movs r0, 0 strb r0, [r1] ldr r0, =0x0202406c ldrb r0, [r0] cmp r0, 0 beq @0804D804 adds r4, r1, 0 @0804D77C: ldrb r0, [r4] cmp r0, r7 beq @0804D792 movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0804D792: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bcc @0804D77C b @0804D804 .align 2, 0 .pool @0804D7C4: adds r0, r7, 0 bl battle_get_per_side_status movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r4, =0x02024064 strb r0, [r4] ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r3, [r4] lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0804D7F4 movs r0, 0x2 eors r3, r0 strb r3, [r4] @0804D7F4: movs r0, 0 movs r1, 0x2 movs r2, 0 bl sub_8034464 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0804D804: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk50_openpartyscreen thumb_func_start atk51_cmd51 atk51_cmd51: ; 804D820 push {r4-r7,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @0804D82C b @0804DA8A @0804D82C: ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r5, =0x02024064 strb r0, [r5] ldr r0, [r4] ldrb r0, [r0, 0x2] cmp r0, 0x1 beq @0804D8CC cmp r0, 0x1 bgt @0804D858 cmp r0, 0 beq @0804D862 b @0804DA82 .align 2, 0 .pool @0804D858: cmp r0, 0x2 beq @0804D8E8 cmp r0, 0x3 beq @0804D922 b @0804DA82 @0804D862: movs r6, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r6, r0 blt @0804D86E b @0804DA82 @0804D86E: ldr r7, =0x02023864 @0804D870: ldrb r0, [r7] cmp r0, 0x22 bne @0804D8AA ldr r5, =0x0202449c ldr r0, [r5] adds r0, r6, r0 adds r0, 0x5C ldrb r1, [r7, 0x1] strb r1, [r0] ldr r0, [r5] adds r0, 0x93 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r6, 2 adds r0, r2 ldr r4, [r0] ands r1, r4 cmp r1, 0 bne @0804D8AA lsls r0, r6, 24 lsrs r0, 24 ldrb r1, [r7, 0x1] bl sub_8184FBC ldr r1, [r5] adds r1, 0x93 ldrb r0, [r1] orrs r4, r0 strb r4, [r1] @0804D8AA: movs r0, 0x80 lsls r0, 2 adds r7, r0 adds r6, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r6, r0 blt @0804D870 b @0804DA82 .align 2, 0 .pool @0804D8CC: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0804D8DA b @0804DA82 @0804D8DA: ldrb r0, [r5] bl sub_803BDA0 b @0804DA82 .align 2, 0 .pool @0804D8E8: ldr r4, =0x0202449c ldr r0, [r4] adds r0, 0x93 ldrb r1, [r0] ldr r6, =gUnknown_0832A328 ldrb r2, [r5] lsls r0, r2, 2 adds r0, r6 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0804D922 ldr r0, =0x02023864 lsls r1, r2, 9 adds r0, 0x1 adds r1, r0 ldrb r1, [r1] adds r0, r2, 0 bl sub_8184FBC ldr r2, [r4] adds r2, 0x93 ldrb r0, [r5] lsls r0, 2 adds r0, r6 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] @0804D922: ldr r1, =0x02024332 ldr r6, =0x02023864 ldr r7, =0x02024064 ldrb r0, [r7] lsls r0, 9 adds r2, r6, 0x1 adds r0, r2 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r7] ldr r1, =0x0202449c mov r12, r1 ldr r1, [r1] adds r1, r0, r1 adds r1, 0x5C lsls r0, 9 adds r0, r2 ldrb r0, [r0] strb r0, [r1] ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x42 ands r0, r1 cmp r0, 0x42 bne @0804DA14 ldrb r0, [r7] mov r3, r12 ldr r2, [r3] lsls r1, r0, 1 adds r1, r0 adds r1, r2 adds r1, 0x60 ldrb r2, [r1] movs r0, 0xF ands r0, r2 strb r0, [r1] ldrb r0, [r7] ldr r2, [r3] lsls r1, r0, 1 adds r1, r0 adds r1, r2 adds r1, 0x60 lsls r0, 9 adds r5, r6, 0x2 adds r0, r5 ldrb r2, [r0] movs r3, 0xF0 adds r0, r3, 0 ands r0, r2 ldrb r2, [r1] orrs r0, r2 strb r0, [r1] ldrb r1, [r7] mov r0, r12 ldr r2, [r0] lsls r0, r1, 1 adds r0, r1 adds r0, r2 adds r0, 0x61 lsls r1, 9 adds r6, 0x3 adds r1, r6 ldrb r1, [r1] strb r1, [r0] ldrb r0, [r7] movs r4, 0x2 eors r0, r4 mov r1, r12 ldr r2, [r1] lsls r1, r0, 1 adds r1, r0 adds r1, r2 adds r1, 0x60 ldrb r2, [r1] adds r0, r3, 0 ands r0, r2 strb r0, [r1] ldrb r0, [r7] eors r0, r4 mov r1, r12 ldr r2, [r1] lsls r1, r0, 1 adds r1, r0 adds r1, r2 adds r1, 0x60 ldrb r0, [r7] lsls r0, 9 adds r0, r5 ldrb r0, [r0] ands r3, r0 lsrs r3, 4 ldrb r0, [r1] orrs r3, r0 strb r3, [r1] ldrb r0, [r7] eors r4, r0 mov r2, r12 ldr r0, [r2] lsls r1, r4, 1 adds r1, r4 adds r1, r0 adds r1, 0x62 ldrb r0, [r7] lsls r0, 9 adds r0, r6 ldrb r0, [r0] strb r0, [r1] b @0804DA36 .align 2, 0 .pool @0804DA14: movs r0, 0x80 lsls r0, 15 ands r1, r0 cmp r1, 0 beq @0804DA30 ldrb r0, [r7] mov r3, r12 ldr r1, [r3] adds r1, r0, r1 adds r1, 0x5C ldrb r1, [r1] bl sub_80571DC b @0804DA36 @0804DA30: ldrb r0, [r7] bl sub_803BDA0 @0804DA36: ldr r1, =0x02022f58 movs r5, 0xFD strb r5, [r1] movs r0, 0x6 strb r0, [r1, 0x1] ldr r4, =0x02024084 ldr r3, =0x0202420b ldrb r0, [r3] movs r2, 0x58 muls r0, r2 adds r0, r4 ldrh r0, [r0] strb r0, [r1, 0x2] ldrb r0, [r3] muls r0, r2 adds r0, r4 ldrh r0, [r0] lsrs r0, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r2, =0x02022f68 strb r5, [r2] movs r0, 0x7 strb r0, [r2, 0x1] ldr r3, =0x02024064 ldrb r0, [r3] strb r0, [r2, 0x2] ldr r1, =0x02023864 ldrb r0, [r3] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] strb r0, [r2, 0x3] movs r0, 0x1 negs r0, r0 strb r0, [r2, 0x4] @0804DA82: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x3 str r0, [r1] @0804DA8A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk51_cmd51 thumb_func_start atk52_cmd52 atk52_cmd52: ; 804DAAC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 ldr r0, =0x02024214 mov r9, r0 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] ldrb r0, [r4] bl sub_803FA70 ldr r1, =0x02024280 mov r8, r1 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] lsls r1, 28 mov r2, r8 ldr r0, [r2] bics r0, r1 str r0, [r2] ldr r2, =0x0202437c ldrb r0, [r4] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r2, [r1] movs r0, 0x41 negs r0, r0 ands r0, r2 strb r0, [r1] ldrb r0, [r4] bl battle_side_get_owner ldr r5, =0x0202428e lsls r0, 24 lsrs r0, 23 adds r0, r5 ldrh r1, [r0] movs r7, 0x80 lsls r7, 2 mov r10, r7 mov r0, r10 ands r0, r1 cmp r0, 0 beq @0804DB1C b @0804DC30 @0804DB1C: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 23 adds r0, r5 ldrh r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @0804DB34 b @0804DC30 @0804DB34: ldr r7, =0x02024084 ldrb r2, [r4] movs r6, 0x58 adds r0, r2, 0 muls r0, r6 adds r1, r0, r7 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x2 beq @0804DC30 adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x2 beq @0804DC30 adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x1A beq @0804DC30 adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 23 adds r0, r5 ldrh r2, [r0] mov r1, r10 orrs r1, r2 strh r1, [r0] ldrb r0, [r4] adds r2, r0, 0 muls r2, r6 adds r0, r7, 0 adds r0, 0x50 adds r2, r0 ldr r0, [r2] ldr r1, =0xfdffffff ands r0, r1 str r0, [r2] mov r1, r8 ldr r0, [r1] movs r2, 0x41 negs r2, r2 ands r0, r2 str r0, [r1] ldrb r0, [r4] bl battle_side_get_owner ldr r2, =0x02024294 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0xA] movs r1, 0x5 subs r1, r0 lsls r1, 25 lsrs r1, 24 ldr r5, =0x020241f0 ldrb r0, [r4] muls r0, r6 adds r0, r7 ldrh r0, [r0, 0x2C] bl __divsi3 str r0, [r5] cmp r0, 0 bne @0804DBC8 movs r0, 0x1 str r0, [r5] @0804DBC8: ldr r0, =0x02024474 ldrb r1, [r4] strb r1, [r0, 0x17] bl b_movescr_stack_push_cursor mov r7, r9 ldr r0, [r7] ldrb r0, [r0, 0x1] cmp r0, 0 bne @0804DC14 ldr r0, =gUnknown_082DAE90 str r0, [r7] b @0804DD8E .align 2, 0 .pool @0804DC14: cmp r0, 0x1 bne @0804DC24 ldr r0, =gUnknown_082DAE59 mov r1, r9 str r0, [r1] b @0804DD8E .align 2, 0 .pool @0804DC24: ldr r0, =gUnknown_082DAEC7 mov r2, r9 str r0, [r2] b @0804DD8E .align 2, 0 .pool @0804DC30: ldr r2, =0x02024084 ldr r1, =0x02024064 ldrb r3, [r1] movs r0, 0x58 muls r0, r3 adds r0, r2 adds r0, 0x20 ldrb r0, [r0] adds r5, r1, 0 ldr r4, =0x020242bc cmp r0, 0x36 bne @0804DC5E lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r2, r0, r4 ldrb r1, [r2, 0x18] lsls r0, r1, 30 cmp r0, 0 blt @0804DC5E movs r0, 0x1 orrs r0, r1 strb r0, [r2, 0x18] @0804DC5E: ldrb r0, [r5] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r4 ldrb r2, [r1, 0x18] movs r0, 0x3 negs r0, r0 ands r0, r2 strb r0, [r1, 0x18] ldrb r1, [r5] movs r0, 0 str r0, [sp] movs r2, 0 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @0804DC88 b @0804DD8E @0804DC88: ldrb r1, [r5] movs r0, 0 movs r2, 0 bl berry_effects_maybe lsls r0, 24 cmp r0, 0 bne @0804DD8E ldrb r0, [r5] bl battle_side_get_owner ldr r1, =0x0202428e lsls r0, 24 lsrs r0, 23 adds r0, r1 ldrh r2, [r0] ldr r1, =0x0000fdff ands r1, r2 strh r1, [r0] movs r4, 0 ldr r0, =0x0202406c ldrb r7, [r0] cmp r4, r7 bge @0804DCD8 ldr r6, =0x0202407e adds r1, r5, 0 ldr r5, =0x0202407a movs r3, 0xC adds r2, r0, 0 @0804DCC2: adds r0, r4, r6 ldrb r0, [r0] ldrb r7, [r1] cmp r0, r7 bne @0804DCD0 adds r0, r4, r5 strb r3, [r0] @0804DCD0: adds r4, 0x1 ldrb r0, [r2] cmp r4, r0 blt @0804DCC2 @0804DCD8: movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 bge @0804DD0C ldr r6, =0x0202449c ldr r5, =0x02024084 @0804DCE6: lsls r0, r4, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 lsrs r0, 23 adds r0, 0xA8 ldr r1, [r6] adds r1, r0 movs r0, 0x58 muls r0, r4 adds r0, r5 ldrh r0, [r0, 0x28] strh r0, [r1] adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0804DCE6 @0804DD0C: ldr r0, =0x02024214 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 cmp r1, 0x5 bne @0804DD88 ldr r0, =0x02024280 ldr r0, [r0] lsrs r4, r0, 28 ldr r1, =0x0202420d ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r2, =gUnknown_0832A328 b @0804DD6E .align 2, 0 .pool @0804DD60: ldr r0, =0x0202406c ldrb r3, [r1] ldrb r0, [r0] cmp r3, r0 bcs @0804DD88 adds r0, r3, 0x1 strb r0, [r1] @0804DD6E: ldrb r0, [r1] lsls r0, 2 adds r0, r2 ldr r3, [r0] adds r0, r4, 0 ands r0, r3 cmp r0, 0 beq @0804DD60 ldr r0, =0x02024210 ldrb r0, [r0] ands r0, r3 cmp r0, 0 bne @0804DD60 @0804DD88: ldr r0, [r5] adds r0, 0x2 str r0, [r5] @0804DD8E: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk52_cmd52 thumb_func_start sub_804DDA8 sub_804DDA8: ; 804DDA8 push {r4,r5,lr} ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl battle_get_side_with_given_state ldr r4, =0x02024064 strb r0, [r4] movs r0, 0 bl dp01_build_cmdbuf_x08_8_8_8 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x2 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804DDA8 thumb_func_start atk54_802511C atk54_802511C: ; 804DDD8 push {r4,r5,lr} ldr r5, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r5] ldr r4, =0x02024214 ldr r0, [r4] ldrb r1, [r0, 0x1] ldrb r0, [r0, 0x2] lsls r0, 8 orrs r1, r0 movs r0, 0 bl dp01_build_cmdbuf_x2B_aa_0 ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r4] adds r0, 0x3 str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk54_802511C thumb_func_start sub_804DE14 sub_804DE14: ; 804DE14 push {r4,r5,lr} ldr r5, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r5] ldr r4, =0x02024214 ldr r0, [r4] ldrb r1, [r0, 0x1] ldrb r0, [r0, 0x2] lsls r0, 8 orrs r1, r0 movs r0, 0 movs r2, 0 bl sub_8034300 ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r4] adds r0, 0x3 str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804DE14 thumb_func_start atk56_8025194 atk56_8025194: ; 804DE50 push {r4,r5,lr} ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] movs r0, 0 bl dp01_build_cmdbuf_x2D_2D_2D_2D ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x2 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk56_8025194 thumb_func_start atk57_80251C4_flee atk57_80251C4_flee: ; 804DE80 push {r4,lr} movs r0, 0 bl battle_get_side_with_given_state ldr r4, =0x02024064 strb r0, [r4] ldr r0, =0x0202433a ldrb r1, [r0] movs r0, 0 bl dp01_build_cmdbuf_x37_a ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk57_80251C4_flee thumb_func_start atk58_cmd58 atk58_cmd58: ; 804DEB8 push {r4,r5,lr} ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] movs r0, 0 movs r1, 0x1 bl dp01_build_cmdbuf_x06_a ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x2 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk58_cmd58 thumb_func_start atk59_8025230 atk59_8025230: ; 804DEEC push {r4-r7,lr} ldr r0, =0x02024214 ldr r2, [r0] ldrb r6, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r6, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r6, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r6, r0 ldrb r4, [r2, 0x5] ldrb r0, [r2, 0x6] lsls r0, 8 orrs r4, r0 ldrb r0, [r2, 0x7] lsls r0, 16 orrs r4, r0 ldrb r0, [r2, 0x8] lsls r0, 24 orrs r4, r0 ldr r0, =0x0202449c ldr r0, [r0] ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r2, 0x9] bl sub_8069318 lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x0000fffe cmp r5, r0 bne @0804DF56 adds r7, r5, 0 @0804DF3A: ldr r0, =0x0202449c ldr r0, [r0] ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0 bl sub_8069318 lsls r0, 16 lsrs r5, r0, 16 cmp r5, r7 beq @0804DF3A @0804DF56: cmp r5, 0 bne @0804DF70 ldr r0, =0x02024214 str r4, [r0] b @0804E018 .align 2, 0 .pool @0804DF70: ldr r0, =0x0000ffff cmp r5, r0 bne @0804DF88 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0xA str r0, [r1] b @0804E018 .align 2, 0 .pool @0804DF88: movs r0, 0 bl battle_get_side_with_given_state ldr r1, =0x02024064 strb r0, [r1] ldr r2, =0x0202406e ldrb r3, [r1] lsls r0, r3, 1 adds r0, r2 ldr r1, =0x0202449c ldr r1, [r1] ldrh r0, [r0] ldrb r1, [r1, 0x10] cmp r0, r1 bne @0804DFC8 ldr r4, =0x02024084 movs r0, 0x58 adds r2, r3, 0 muls r2, r0 adds r0, r4, 0 adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @0804DFC8 adds r0, r2, r4 adds r1, r5, 0 bl sub_80691B0 @0804DFC8: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0804E014 movs r0, 0x2 bl battle_get_side_with_given_state ldr r1, =0x02024064 strb r0, [r1] ldr r2, =0x0202406e ldrb r3, [r1] lsls r0, r3, 1 adds r0, r2 ldr r1, =0x0202449c ldr r1, [r1] ldrh r0, [r0] ldrb r1, [r1, 0x10] cmp r0, r1 bne @0804E014 ldr r4, =0x02024084 movs r0, 0x58 adds r2, r3, 0 muls r2, r0 adds r0, r4, 0 adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @0804E014 adds r0, r2, r4 adds r1, r5, 0 bl sub_80691B0 @0804E014: ldr r0, =0x02024214 str r6, [r0] @0804E018: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk59_8025230 thumb_func_start sub_804E038 sub_804E038: ; 804E038 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 ldr r0, =0x02024064 movs r1, 0 strb r1, [r0] ldr r0, =0x02024474 ldrb r1, [r0, 0x1F] adds r2, r0, 0 cmp r1, 0x6 bls @0804E052 b @0804E3B8 @0804E052: lsls r0, r1, 2 ldr r1, =@0804E068 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0804E068: .4byte @0804E084 .4byte @0804E0BC .4byte @0804E162 .4byte @0804E1B8 .4byte @0804E1E4 .4byte @0804E38C .4byte @0804E3AC @0804E084: movs r4, 0 str r4, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C ldr r0, =gUnknown_085CCABB movs r1, 0xC bl battle_show_message_maybe ldr r1, =0x02024474 ldrb r0, [r1, 0x1F] adds r0, 0x1 strb r0, [r1, 0x1F] ldr r0, =0x02024332 strb r4, [r0, 0x1] movs r0, 0 bl sub_8056B74 b @0804E3B8 .align 2, 0 .pool @0804E0BC: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0804E0E4 ldr r4, =0x02024332 ldrb r0, [r4, 0x1] cmp r0, 0 beq @0804E0E4 movs r0, 0x5 bl audio_play ldrb r0, [r4, 0x1] bl sub_8056BAC movs r0, 0 strb r0, [r4, 0x1] bl sub_8056B74 @0804E0E4: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0804E10C ldr r4, =0x02024332 ldrb r0, [r4, 0x1] cmp r0, 0 bne @0804E10C movs r0, 0x5 bl audio_play ldrb r0, [r4, 0x1] bl sub_8056BAC movs r0, 0x1 strb r0, [r4, 0x1] bl sub_8056B74 @0804E10C: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r5, 0x1 adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @0804E150 movs r0, 0x5 bl audio_play ldr r0, =0x02024332 ldrb r4, [r0, 0x1] cmp r4, 0 bne @0804E20A str r5, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C movs r0, 0x1 negs r0, r0 str r4, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @0804E192 .align 2, 0 .pool @0804E150: movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0804E15A b @0804E3B8 @0804E15A: movs r0, 0x5 bl audio_play b @0804E20A @0804E162: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0804E170 b @0804E3B8 @0804E170: bl Window_FreeMemory ldr r0, =0x020244ec ldr r1, =0x0202449c ldr r1, [r1] ldrb r1, [r1, 0x10] ldr r2, =0x020244e9 ldrb r2, [r2] subs r2, 0x1 lsls r2, 24 lsrs r2, 24 ldr r3, =sub_80A92F8 ldr r4, =0x020244e2 ldrh r4, [r4] str r4, [sp] bl sub_81BFA38 @0804E192: ldr r1, =0x02024474 ldrb r0, [r1, 0x1F] adds r0, 0x1 strb r0, [r1, 0x1F] b @0804E3B8 .align 2, 0 .pool @0804E1B8: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0804E1C6 b @0804E3B8 @0804E1C6: ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 beq @0804E1D2 b @0804E3B8 @0804E1D2: ldrb r0, [r2, 0x1F] adds r0, 0x1 b @0804E3B6 .align 2, 0 .pool @0804E1E4: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0804E1F2 b @0804E3B8 @0804E1F2: ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 beq @0804E1FE b @0804E3B8 @0804E1FE: bl sub_81C1B94 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x4 bne @0804E224 @0804E20A: ldr r1, =0x02024474 movs r0, 0x5 strb r0, [r1, 0x1F] b @0804E3B8 .align 2, 0 .pool @0804E224: ldr r6, =0x0202449c ldr r0, [r6] ldrb r0, [r0, 0x10] movs r1, 0x64 mov r8, r1 mov r1, r8 muls r1, r0 adds r0, r1, 0 ldr r7, =0x020244ec adds r0, r7 adds r1, r5, 0 adds r1, 0xD bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 bl sub_806E804 cmp r0, 0 beq @0804E274 ldr r0, =0x0000013f ldr r1, =0x02024064 ldrb r1, [r1] bl b_std_message ldr r1, =0x02024474 movs r0, 0x6 strb r0, [r1, 0x1F] b @0804E3B8 .align 2, 0 .pool @0804E274: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] ldr r1, =0x02022f68 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] strb r4, [r1, 0x2] lsrs r0, r4, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r0, [r6] ldrb r0, [r0, 0x10] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r7 adds r1, r5, 0 bl sub_806B9A8 ldr r0, [r6] ldrb r0, [r0, 0x10] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r7 ldr r7, =0x020244e2 ldrh r1, [r7] adds r2, r5, 0 bl sub_80691F4 ldr r0, =0x0202406e ldr r1, [r6] ldrh r0, [r0] ldrb r1, [r1, 0x10] cmp r0, r1 bne @0804E30A ldr r4, =0x02024084 ldr r0, [r4, 0x50] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @0804E30A ldr r0, =0x020242bc ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0804E30A adds r0, r4, 0 adds r1, r5, 0 bl sub_806B9E4 ldrh r1, [r7] adds r0, r4, 0 adds r2, r5, 0 bl sub_8069234 @0804E30A: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0804E3B8 ldr r2, =0x0202406e ldr r0, =0x0202449c ldr r1, [r0] ldrh r0, [r2, 0x4] ldrb r1, [r1, 0x10] cmp r0, r1 bne @0804E3B8 ldr r4, =0x02024084 movs r1, 0x80 lsls r1, 1 adds r0, r4, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @0804E3B8 ldr r0, =0x020242bc adds r0, 0x50 ldrb r1, [r0] lsrs r1, 4 ldr r2, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0804E3B8 adds r4, 0xB0 adds r0, r4, 0 adds r1, r5, 0 bl sub_806B9E4 ldr r0, =0x020244e2 ldrh r1, [r0] adds r0, r4, 0 adds r2, r5, 0 bl sub_8069234 b @0804E3B8 .align 2, 0 .pool @0804E38C: movs r0, 0x1 str r0, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @0804E3B8 .align 2, 0 .pool @0804E3AC: ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804E3B8 movs r0, 0x2 @0804E3B6: strb r0, [r2, 0x1F] @0804E3B8: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804E038 thumb_func_start atk5B_80256E0 atk5B_80256E0: ; 804E3C8 push {r4,r5,lr} sub sp, 0x4 ldr r5, =0x02024474 ldrb r4, [r5, 0x1F] cmp r4, 0 beq @0804E3E0 cmp r4, 0x1 beq @0804E410 b @0804E4FA .align 2, 0 .pool @0804E3E0: str r4, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C ldr r0, =gUnknown_085CCABB movs r1, 0xC bl battle_show_message_maybe ldrb r0, [r5, 0x1F] adds r0, 0x1 strb r0, [r5, 0x1F] ldr r0, =0x02024332 strb r4, [r0, 0x1] movs r0, 0 bl sub_8056B74 b @0804E4FA .align 2, 0 .pool @0804E410: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0804E438 ldr r4, =0x02024332 ldrb r0, [r4, 0x1] cmp r0, 0 beq @0804E438 movs r0, 0x5 bl audio_play ldrb r0, [r4, 0x1] bl sub_8056BAC movs r0, 0 strb r0, [r4, 0x1] bl sub_8056B74 @0804E438: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0804E460 ldr r4, =0x02024332 ldrb r0, [r4, 0x1] cmp r0, 0 bne @0804E460 movs r0, 0x5 bl audio_play ldrb r0, [r4, 0x1] bl sub_8056BAC movs r0, 0x1 strb r0, [r4, 0x1] bl sub_8056B74 @0804E460: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r4, 0x1 adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @0804E4C4 movs r0, 0x5 bl audio_play ldr r0, =0x02024332 ldrb r0, [r0, 0x1] cmp r0, 0 beq @0804E4A4 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @0804E4AC .align 2, 0 .pool @0804E4A4: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0804E4AC: movs r0, 0x1 str r0, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C b @0804E4FA .align 2, 0 .pool @0804E4C4: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0804E4FA movs r0, 0x5 bl audio_play ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] str r4, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C @0804E4FA: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk5B_80256E0 thumb_func_start atk5C_cmd5c atk5C_cmd5c: ; 804E508 push {r4,lr} ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r2, =0x02024064 strb r0, [r2] ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 bne @0804E58C ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 1 ands r0, r1 cmp r0, 0 beq @0804E55A ldr r1, =0x02024084 ldrb r2, [r2] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @0804E55A ldr r0, =0x020242bc lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xA] cmp r0, 0 bne @0804E58C @0804E55A: movs r0, 0 bl dp01_build_cmdbuf_x29_29_29_29 ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] b @0804E592 .align 2, 0 .pool @0804E58C: ldr r0, [r4] adds r0, 0x2 str r0, [r4] @0804E592: pop {r4} pop {r0} bx r0 thumb_func_end atk5C_cmd5c thumb_func_start sub_804E598 sub_804E598: ; 804E598 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 16 lsrs r6, r0, 16 movs r7, 0 movs r5, 0 movs r0, 0x80 lsls r0, 3 cmp r6, r0 bne @0804E5D8 ldr r0, =0x020244a8 ldr r0, [r0] ldr r0, [r0] adds r0, 0x94 ldrb r2, [r0] ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x4A ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 muls r0, r2 b @0804E6CA .align 2, 0 .pool @0804E5D8: ldr r0, =gTrainers lsls r2, r6, 2 adds r1, r2, r6 lsls r1, 3 adds r4, r1, r0 ldrb r3, [r4] mov r12, r0 cmp r3, 0x1 beq @0804E62E cmp r3, 0x1 bgt @0804E5F8 cmp r3, 0 beq @0804E602 b @0804E644 .align 2, 0 .pool @0804E5F8: cmp r3, 0x2 beq @0804E618 cmp r3, 0x3 beq @0804E62E b @0804E644 @0804E602: mov r0, r12 adds r0, 0x24 adds r0, r1, r0 ldr r1, [r0] adds r0, r4, 0 adds r0, 0x20 ldrb r0, [r0] lsls r0, 3 adds r0, r1 subs r0, 0x8 b @0804E642 @0804E618: mov r0, r12 adds r0, 0x24 adds r0, r1, r0 ldr r1, [r0] adds r0, r4, 0 adds r0, 0x20 ldrb r0, [r0] lsls r0, 3 adds r0, r1 subs r0, 0x8 b @0804E642 @0804E62E: mov r0, r12 adds r0, 0x24 adds r0, r1, r0 ldr r1, [r0] adds r0, r4, 0 adds r0, 0x20 ldrb r0, [r0] lsls r0, 4 adds r0, r1 subs r0, 0x10 @0804E642: ldrb r5, [r0, 0x2] @0804E644: ldr r1, =gUnknown_0831AEB8 lsls r0, r7, 2 adds r4, r0, r1 ldrb r3, [r4] ldr r0, =0x0202449c mov r8, r0 mov r9, r1 ldr r1, =0x02022fec mov r10, r1 cmp r3, 0xFF beq @0804E67A adds r0, r2, r6 lsls r0, 3 add r0, r12 ldrb r1, [r0, 0x1] cmp r3, r1 beq @0804E67A adds r2, r0, 0 adds r0, r4, 0 @0804E66A: adds r0, 0x4 adds r7, 0x1 ldrb r1, [r0] cmp r1, 0xFF beq @0804E67A ldrb r3, [r2, 0x1] cmp r1, r3 bne @0804E66A @0804E67A: mov r0, r10 ldr r1, [r0] movs r0, 0x80 lsls r0, 8 ands r0, r1 cmp r0, 0 bne @0804E6B4 movs r0, 0x1 ands r1, r0 cmp r1, 0 beq @0804E6B4 mov r3, r8 ldr r0, [r3] adds r0, 0x4A ldrb r0, [r0] lsls r0, 2 adds r1, r5, 0 muls r1, r0 lsls r0, r7, 2 add r0, r9 ldrb r0, [r0, 0x1] lsls r0, 1 b @0804E6C8 .align 2, 0 .pool @0804E6B4: mov r1, r8 ldr r0, [r1] adds r0, 0x4A ldrb r0, [r0] lsls r0, 2 adds r1, r5, 0 muls r1, r0 lsls r0, r7, 2 add r0, r9 ldrb r0, [r0, 0x1] @0804E6C8: muls r0, r1 @0804E6CA: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_804E598 thumb_func_start sub_804E6D8 sub_804E6D8: ; 804E6D8 push {r4,lr} ldr r0, =0x02038bca ldrh r0, [r0] bl sub_804E598 adds r4, r0, 0 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 beq @0804E6FC ldr r0, =0x02038bcc ldrh r0, [r0] bl sub_804E598 adds r4, r0 @0804E6FC: ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 adds r1, r4, 0 bl add_money ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x1 strb r0, [r1, 0x1] movs r0, 0x4 strb r0, [r1, 0x2] movs r0, 0x5 strb r0, [r1, 0x3] strb r4, [r1, 0x4] movs r0, 0xFF lsls r0, 8 ands r0, r4 lsrs r0, 8 strb r0, [r1, 0x5] movs r0, 0xFF lsls r0, 16 ands r0, r4 lsrs r0, 16 strb r0, [r1, 0x6] lsrs r0, r4, 24 strb r0, [r1, 0x7] movs r0, 0xFF strb r0, [r1, 0x8] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804E6D8 thumb_func_start atk5E_8025A70 atk5E_8025A70: ; 804E764 push {r4-r7,lr} mov r7, r8 push {r7} ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r6, =0x02024064 strb r0, [r6] ldr r5, =0x02024332 ldrb r0, [r5] mov r8, r4 cmp r0, 0 beq @0804E794 cmp r0, 0x1 beq @0804E7AC b @0804E800 .align 2, 0 .pool @0804E794: movs r0, 0 movs r1, 0 movs r2, 0 bl dp01_build_cmdbuf_x00_a_b_0 ldrb r0, [r6] bl dp01_battle_side_mark_buffer_for_execution ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] b @0804E800 @0804E7AC: ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804E800 ldrb r0, [r6] lsls r0, 9 ldr r1, =0x02023868 adds r0, r1 mov r12, r0 movs r2, 0 adds r4, r6, 0 movs r5, 0x58 ldr r6, =0x020240a8 adds r7, r6, 0 subs r7, 0x18 mov r3, r12 adds r3, 0xC @0804E7CE: lsls r1, r2, 1 ldrb r0, [r4] muls r0, r5 adds r1, r0 adds r1, r7 ldrh r0, [r3] strh r0, [r1] ldrb r0, [r4] adds r1, r0, 0 muls r1, r5 adds r1, r2, r1 adds r1, r6 mov r0, r12 adds r0, 0x24 adds r0, r2 ldrb r0, [r0] strb r0, [r1] adds r3, 0x2 adds r2, 0x1 cmp r2, 0x3 ble @0804E7CE mov r1, r8 ldr r0, [r1] adds r0, 0x2 str r0, [r1] @0804E800: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk5E_8025A70 thumb_func_start atk5F_8025B24 atk5F_8025B24: ; 804E818 push {lr} ldr r0, =0x02024064 ldr r2, =0x0202420b ldrb r3, [r2] strb r3, [r0] ldr r1, =0x0202420c ldrb r0, [r1] strb r0, [r2] strb r3, [r1] ldr r2, =0x02024280 ldr r1, [r2] movs r3, 0x80 lsls r3, 5 adds r0, r1, 0 ands r0, r3 cmp r0, 0 beq @0804E854 ldr r0, =0xffffefff ands r1, r0 b @0804E856 .align 2, 0 .pool @0804E854: orrs r1, r3 @0804E856: str r1, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk5F_8025B24 thumb_func_start atk60_cmd60 atk60_cmd60: ; 804E868 push {lr} ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0804E882 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl sav12_xor_increment @0804E882: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk60_cmd60 thumb_func_start atk61_8025BA4 atk61_8025BA4: ; 804E898 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x30 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804E94C ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r1, =0x02024064 strb r0, [r1] ldrb r0, [r1] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r8, r1 cmp r0, 0 bne @0804E8CA ldr r0, =0x020244ec mov r8, r0 @0804E8CA: movs r7, 0 add r6, sp, 0x4 mov r5, sp @0804E8D0: movs r0, 0x64 muls r0, r7 mov r1, r8 adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @0804E8F4 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 bne @0804E914 @0804E8F4: ldr r0, =0x0000ffff strh r0, [r5] movs r0, 0 b @0804E926 .align 2, 0 .pool @0804E914: adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr strh r0, [r5] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr @0804E926: str r0, [r6] adds r6, 0x8 adds r5, 0x8 adds r7, 0x1 cmp r7, 0x5 ble @0804E8D0 movs r0, 0 mov r1, sp movs r2, 0x1 bl dp01_build_cmdbuf_x30_TODO ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] @0804E94C: add sp, 0x30 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk61_8025BA4 thumb_func_start atk62_08025C6C atk62_08025C6C: ; 804E960 push {r4,r5,lr} ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] movs r0, 0 bl dp01_build_cmdbuf_x31_31_31_31 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x2 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk62_08025C6C thumb_func_start atk63_jumptoattack atk63_jumptoattack: ; 804E990 push {r4,lr} ldr r0, =0x02024214 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0 beq @0804E9B4 ldr r0, =0x020241ea ldr r1, =0x020241ee ldrh r1, [r1] strh r1, [r0] b @0804E9C2 .align 2, 0 .pool @0804E9B4: ldr r2, =0x020241ec ldr r1, =0x020241ea ldr r0, =0x020241ee ldrh r0, [r0] strh r0, [r1] strh r0, [r2] adds r0, r1, 0 @0804E9C2: ldr r3, =gUnknown_082D86A8 ldr r2, =gBattleMoves ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk63_jumptoattack thumb_func_start atk64_statusanimation atk64_statusanimation: ; 804E9F4 push {r4,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804EA5C ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] ldr r1, =0x020242ac ldrb r2, [r4] lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x000400c0 ands r0, r1 cmp r0, 0 bne @0804EA54 ldr r0, =0x020242bc lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xA] cmp r0, 0 bne @0804EA54 ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 bne @0804EA54 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r1, 0x4C adds r0, r1 ldr r2, [r0] movs r0, 0 movs r1, 0 bl dp01_build_cmdbuf_x1B_aaaa_b ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @0804EA54: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] @0804EA5C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk64_statusanimation thumb_func_start atk65_8025D90 atk65_8025D90: ; 804EA84 push {r4,r5,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804EB04 ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r5, =0x02024064 strb r0, [r5] ldr r1, [r4] ldrb r3, [r1, 0x2] ldrb r0, [r1, 0x3] lsls r0, 8 orrs r3, r0 ldrb r0, [r1, 0x4] lsls r0, 16 orrs r3, r0 ldrb r0, [r1, 0x5] lsls r0, 24 orrs r3, r0 ldr r1, =0x020242ac ldrb r2, [r5] lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x000400c0 ands r0, r1 cmp r0, 0 bne @0804EAFC ldr r0, =0x020242bc lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xA] cmp r0, 0 bne @0804EAFC ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 bne @0804EAFC ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r2, [r0] ands r2, r3 movs r0, 0 movs r1, 0x1 bl dp01_build_cmdbuf_x1B_aaaa_b ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution @0804EAFC: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x6 str r0, [r1] @0804EB04: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk65_8025D90 thumb_func_start atk66_8025E38 atk66_8025E38: ; 804EB2C push {r4,r5,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @0804EB9E ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r5, =0x02024064 strb r0, [r5] ldr r4, [r4] ldrb r2, [r4, 0x3] ldrb r0, [r4, 0x4] lsls r0, 8 orrs r2, r0 ldrb r0, [r4, 0x5] lsls r0, 16 orrs r2, r0 ldrb r0, [r4, 0x6] lsls r0, 24 orrs r2, r0 ldr r1, =0x020242ac ldrb r3, [r5] lsls r0, r3, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x000400c0 ands r0, r1 cmp r0, 0 bne @0804EB96 ldr r0, =0x020242bc lsls r1, r3, 3 subs r1, r3 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xA] cmp r0, 0 bne @0804EB96 ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 bne @0804EB96 ldrb r1, [r4, 0x2] movs r0, 0 bl dp01_build_cmdbuf_x1B_aaaa_b ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution @0804EB96: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x7 str r0, [r1] @0804EB9E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk66_8025E38 thumb_func_start atk67_8025ECC atk67_8025ECC: ; 804EBC0 push {r4,r5,lr} sub sp, 0x4 ldr r5, =0x02024332 ldrb r4, [r5] cmp r4, 0 beq @0804EBD8 cmp r4, 0x1 beq @0804EC04 b @0804EC96 .align 2, 0 .pool @0804EBD8: str r4, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C ldr r0, =gUnknown_085CCABB movs r1, 0xC bl battle_show_message_maybe ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] strb r4, [r5, 0x1] movs r0, 0 bl sub_8056B74 b @0804EC96 .align 2, 0 .pool @0804EC04: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0804EC2A ldrb r0, [r5, 0x1] cmp r0, 0 beq @0804EC2A movs r0, 0x5 bl audio_play ldrb r0, [r5, 0x1] bl sub_8056BAC movs r0, 0 strb r0, [r5, 0x1] bl sub_8056B74 @0804EC2A: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0804EC52 ldr r4, =0x02024332 ldrb r0, [r4, 0x1] cmp r0, 0 bne @0804EC52 movs r0, 0x5 bl audio_play ldrb r0, [r4, 0x1] bl sub_8056BAC movs r0, 0x1 strb r0, [r4, 0x1] bl sub_8056B74 @0804EC52: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0804EC70 ldr r0, =0x02024332 movs r4, 0x1 strb r4, [r0, 0x1] b @0804EC7A .align 2, 0 .pool @0804EC70: movs r4, 0x1 adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @0804EC96 @0804EC7A: movs r0, 0x5 bl audio_play str r4, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @0804EC96: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk67_8025ECC thumb_func_start sub_804ECA4 sub_804ECA4: ; 804ECA4 push {r4,r5,lr} movs r1, 0 ldr r2, =0x0202406c ldr r5, =0x02024214 ldrb r0, [r2] cmp r1, r0 bge @0804ECC2 ldr r4, =0x0202407a movs r3, 0xC @0804ECB6: adds r0, r1, r4 strb r3, [r0] adds r1, 0x1 ldrb r0, [r2] cmp r1, r0 blt @0804ECB6 @0804ECC2: ldr r0, [r5] adds r0, 0x1 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804ECA4 thumb_func_start atk69_8025FE0 atk69_8025FE0: ; 804ECDC push {r4-r7,lr} ldr r7, =0x02024084 ldr r6, =0x0202420c ldrb r2, [r6] movs r5, 0x58 adds r0, r2, 0 muls r0, r5 adds r1, r0, r7 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @0804ED10 ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r4, [r0, 0x7] ldrb r6, [r0, 0x1A] b @0804ED2A .align 2, 0 .pool @0804ED10: ldrh r0, [r1, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r4, r0, 24 ldrb r0, [r6] muls r0, r5 adds r0, r7 ldrh r0, [r0, 0x2E] bl itemid_get_quality lsls r0, 24 lsrs r6, r0, 24 @0804ED2A: ldr r1, =0x0202420f ldr r5, =0x0202420c ldrb r0, [r5] strb r0, [r1] cmp r4, 0x27 bne @0804ED68 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, r6 bcs @0804ED68 ldrb r0, [r5] movs r1, 0x27 bl b_history__record_item_x12_of_player ldr r2, =0x0202437c ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x80 orrs r1, r2 strb r1, [r0] @0804ED68: ldr r2, =0x02024084 ldr r3, =0x0202420c ldrb r4, [r3] movs r0, 0x58 muls r0, r4 adds r1, r2, 0 adds r1, 0x50 adds r0, r1 ldr r1, [r0] movs r0, 0x80 lsls r0, 17 ands r1, r0 adds r5, r2, 0 cmp r1, 0 bne @0804EE38 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] cmp r0, 0x65 beq @0804EDBA ldr r0, =0x0202433c lsls r1, r4, 4 adds r1, r0 ldrb r0, [r1] lsls r0, 30 cmp r0, 0 blt @0804EDBA ldr r0, =0x0202437c lsls r1, r4, 2 adds r1, r4 lsls r1, 2 adds r1, r0 ldrb r0, [r1] lsrs r0, 7 cmp r0, 0 beq @0804EE38 @0804EDBA: ldrb r0, [r3] movs r4, 0x58 muls r0, r4 adds r0, r5 ldrh r1, [r0, 0x28] ldr r2, =0x020241f0 ldr r0, [r2] cmp r1, r0 bgt @0804EE38 subs r0, r1, 0x1 str r0, [r2] ldr r1, =0x0202433c ldrb r3, [r3] lsls r0, r3, 4 adds r0, r1 ldrb r0, [r0] lsls r0, 30 cmp r0, 0 bge @0804EE10 ldr r0, =0x0202427c ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] b @0804EE38 .align 2, 0 .pool @0804EE10: ldr r0, =0x0202437c lsls r1, r3, 2 adds r1, r3 lsls r1, 2 adds r1, r0 ldrb r0, [r1] lsrs r0, 7 cmp r0, 0 beq @0804EE38 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024208 adds r0, r3, 0 muls r0, r4 adds r0, r5 ldrh r0, [r0, 0x2E] strh r0, [r1] @0804EE38: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk69_8025FE0 thumb_func_start atk6A_stash_item_for_side atk6A_stash_item_for_side: ; 804EE58 push {r4-r6,lr} sub sp, 0x4 ldr r6, =0x02024214 ldr r0, [r6] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r5, =0x02024064 strb r0, [r5] ldr r1, =0x0202449c ldrb r4, [r5] lsls r0, r4, 1 adds r0, 0xB8 ldr r1, [r1] adds r1, r0 ldr r2, =0x02024084 movs r3, 0x58 adds r0, r4, 0 muls r0, r3 adds r0, r2 ldrh r0, [r0, 0x2E] strh r0, [r1] ldrb r0, [r5] muls r0, r3 adds r0, r2 movs r1, 0 strh r1, [r0, 0x2E] ldrb r0, [r5] muls r0, r3 adds r2, 0x2E adds r0, r2 str r0, [sp] movs r0, 0 movs r1, 0x2 movs r2, 0 movs r3, 0x2 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r6] adds r0, 0x2 str r0, [r6] add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk6A_stash_item_for_side thumb_func_start atk6B_end_battle_80261CC atk6B_end_battle_80261CC: ; 804EEC8 ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x7 strb r0, [r1, 0x1] ldr r2, =0x0202420b ldrb r0, [r2] strb r0, [r1, 0x2] ldr r3, =0x0202406e ldrb r0, [r2] lsls r0, 1 adds r0, r3 ldrh r0, [r0] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end atk6B_end_battle_80261CC thumb_func_start atk6C_8026208 atk6C_8026208: ; 804EF04 push {r4,lr} sub sp, 0x4 ldr r0, =0x02024474 ldrb r1, [r0, 0x1E] adds r4, r0, 0 cmp r1, 0 bne @0804EF28 bl sub_804F498 cmp r0, 0 beq @0804EF24 movs r0, 0x3 b @0804EF26 .align 2, 0 .pool @0804EF24: movs r0, 0x1 @0804EF26: strb r0, [r4, 0x1E] @0804EF28: ldrb r0, [r4, 0x1E] subs r0, 0x1 cmp r0, 0x9 bls @0804EF32 b @0804F0F2 @0804EF32: lsls r0, 2 ldr r1, =@0804EF40 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0804EF40: .4byte @0804EF68 .4byte @0804EF94 .4byte @0804EFAC .4byte @0804F000 .4byte @0804F014 .4byte @0804F02C .4byte @0804F014 .4byte @0804F04C .4byte @0804F07C .4byte @0804F0C0 @0804EF68: ldr r1, =0x02022e1e movs r0, 0x60 strh r0, [r1] movs r0, 0x2 movs r1, 0x7 movs r2, 0 bl gpu_bg_config_set_field movs r0, 0x2 bl gpu_sync_bg_show bl sub_804F17C ldr r1, =0x02024474 movs r0, 0x2 strb r0, [r1, 0x1E] b @0804F0F2 .align 2, 0 .pool @0804EF94: bl sub_804F1CC lsls r0, 24 cmp r0, 0 beq @0804EFA0 b @0804F0F2 @0804EFA0: ldr r1, =0x02024474 movs r0, 0x3 strb r0, [r1, 0x1E] b @0804F0F2 .align 2, 0 .pool @0804EFAC: ldr r1, =0x02022e18 movs r0, 0 strh r0, [r1] ldr r1, =0x02022e1a movs r2, 0x80 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] movs r0, 0 movs r1, 0x7 movs r2, 0x1 bl 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, =0x02024474 movs r0, 0x4 strb r0, [r1, 0x1E] b @0804F0F2 .align 2, 0 .pool @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, =0x02022e1a strh r1, [r0] b @0804F06A .align 2, 0 .pool @0804F02C: ldr r0, =0x030022c0 ldrh r0, [r0, 0x2E] cmp r0, 0 beq @0804F0F2 movs r0, 0x5 bl audio_play bl sub_804F144 movs r0, 0xD movs r1, 0x2 bl Window_CopyToVram b @0804F06A .align 2, 0 .pool @0804F04C: ldr r0, =0x030022c0 ldrh r0, [r0, 0x2E] cmp r0, 0 beq @0804F0F2 movs r0, 0x5 bl audio_play movs r0, 0x81 str r0, [sp] movs r0, 0x12 movs r1, 0x7 movs r2, 0x1D movs r3, 0x13 bl sub_8056A3C @0804F06A: ldr r1, =0x02024474 ldrb r0, [r1, 0x1E] adds r0, 0x1 strb r0, [r1, 0x1E] b @0804F0F2 .align 2, 0 .pool @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, =0x02024474 movs r0, 0xA strb r0, [r1, 0x1E] b @0804F0F2 .align 2, 0 .pool @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, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @0804F0F2: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk6C_8026208 thumb_func_start sub_804F100 sub_804F100: ; 804F100 push {lr} sub sp, 0x14 ldr r0, =0x0202449c ldr r0, [r0] ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 add r1, sp, 0x8 bl sub_81D388C ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x10] movs r0, 0xD str r0, [sp] movs r0, 0xF str r0, [sp, 0x4] movs r0, 0xD add r2, sp, 0x8 movs r3, 0xE bl sub_81D3640 add sp, 0x14 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804F100 thumb_func_start sub_804F144 sub_804F144: ; 804F144 push {lr} sub sp, 0x10 ldr r0, =0x0202449c ldr r0, [r0] ldrb r1, [r0, 0x10] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 add r1, sp, 0x4 bl sub_81D388C movs r0, 0xF str r0, [sp] movs r0, 0xD add r1, sp, 0x4 movs r2, 0xE movs r3, 0xD bl sub_81D3784 add sp, 0x10 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804F144 thumb_func_start sub_804F17C sub_804F17C: ; 804F17C push {lr} ldr r1, =0x02022e1e movs r0, 0 strh r0, [r1] ldr r1, =0x02022e1c movs r2, 0xD0 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] ldr r0, =gUnknown_0831C2C8 movs r1, 0x60 movs r2, 0x20 bl gpu_pal_apply ldr r1, =gUnknown_0831C2E8 movs r0, 0xE movs r2, 0 movs r3, 0 bl 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 .pool 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, =0x02022e1c ldrh r1, [r4] movs r5, 0x80 lsls r5, 2 cmp r1, r5 bne @0804F1F0 movs r0, 0 b @0804F216 .align 2, 0 .pool @0804F1F0: movs r0, 0xD0 lsls r0, 1 cmp r1, r0 bne @0804F1FC bl sub_804F220 @0804F1FC: ldrh r0, [r4] adds r0, 0x8 strh r0, [r4] lsls r0, 16 ldr r1, =0x01ff0000 cmp r0, r1 bls @0804F20C strh r5, [r4] @0804F20C: ldrh r1, [r4] eors r1, r5 negs r0, r1 orrs r0, r1 lsrs r0, 31 @0804F216: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_804F1CC thumb_func_start sub_804F220 sub_804F220: ; 804F220 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x10 ldr r6, =0x0202449c ldr r0, [r6] ldrb r0, [r0, 0x10] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x38 bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, [r6] ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 bl pokemon_get_gender lsls r0, 24 lsrs r7, r0, 24 ldr r0, [r6] ldrb r0, [r0, 0x10] muls r0, r5 adds r0, r4 ldr r5, =0x02021fc4 adds r1, r5, 0 bl 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 RepeatChar 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 .pool @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, =0x02022e1c 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 .pool @0804F35C: ldrh r0, [r2] adds r1, r0, 0 subs r1, 0x10 ldr r0, =0x0000019f cmp r1, r0 bgt @0804F370 strh r3, [r2] b @0804F372 .align 2, 0 .pool @0804F370: strh r1, [r2] @0804F372: ldrh r1, [r2] movs r0, 0xD0 lsls r0, 1 eors r1, r0 negs r0, r1 orrs r0, r1 lsrs r0, 31 @0804F380: pop {r1} bx r1 thumb_func_end sub_804F344 thumb_func_start sub_804F384 sub_804F384: ; 804F384 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x10 ldr r0, =0x0202449c mov r8, r0 ldr r0, [r0] ldrb r0, [r0, 0x10] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0xB bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r1, r8 ldr r0, [r1] ldrb r0, [r0, 0x10] muls r0, r6 adds r0, r5 movs r1, 0 bl pokemon_getattr adds r1, r0, 0 adds r0, r4, 0 movs r2, 0x1 bl sub_80D2EDC str r0, [sp] ldr r5, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r5 movs r1, 0x80 lsls r1, 2 orrs r0, r1 ldr r1, =0x0000ffff ands r0, r1 ldr r1, =0xd75a0000 orrs r0, r1 str r0, [sp, 0x4] adds r0, r4, 0 bl sub_80D30B0 str r0, [sp, 0x8] add r4, sp, 0x8 ldr r0, [r4, 0x4] ands r0, r5 ldr r1, =0x0000d75a orrs r0, r1 str r0, [r4, 0x4] mov r0, sp bl gpu_tile_obj_alloc_tag_and_copy_to_vram adds r0, r4, 0 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_0831C3C0 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, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 movs r0, 0 strh r0, [r1, 0x2E] ldr r0, =0x02022e1c ldrh r0, [r0] strh r0, [r1, 0x30] add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804F384 thumb_func_start sub_804F450 sub_804F450: ; 804F450 push {r4,lr} adds r2, r0, 0 ldr r0, =0x02022e1c ldrh r1, [r2, 0x30] ldrh r0, [r0] subs r1, r0 strh r1, [r2, 0x24] lsls r1, 16 cmp r1, 0 beq @0804F470 movs r0, 0x1 strh r0, [r2, 0x2E] b @0804F48C .align 2, 0 .pool @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, =0x0000d75a 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 .pool thumb_func_end sub_804F450 thumb_func_start sub_804F498 sub_804F498: ; 804F498 push {lr} ldr r3, =0x0202406e ldr r0, =0x0202449c ldr r0, [r0] ldrh r1, [r3] ldrb r2, [r0, 0x10] cmp r1, r2 beq @0804F4BA ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0804F4CC ldrh r0, [r3, 0x4] cmp r0, r2 bne @0804F4CC @0804F4BA: movs r0, 0x1 b @0804F4CE .align 2, 0 .pool @0804F4CC: movs r0, 0 @0804F4CE: pop {r1} bx r1 thumb_func_end sub_804F498 thumb_func_start sub_804F4D4 sub_804F4D4: ; 804F4D4 push {lr} bl sub_803F988 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804F4D4 thumb_func_start atk6E_state0_side_becomes_attacker atk6E_state0_side_becomes_attacker: ; 804F4EC push {lr} movs r0, 0 bl battle_get_side_with_given_state ldr r1, =0x0202420b strb r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk6E_state0_side_becomes_attacker thumb_func_start atk6F_8026810 atk6F_8026810: ; 804F50C push {r4,r5,lr} ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] movs r0, 0 movs r1, 0 bl dp01_build_cmdbuf_x33_a_33_33 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x2 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk6F_8026810 thumb_func_start atk70_record_ability_usage_of_side atk70_record_ability_usage_of_side: ; 804F540 push {r4,lr} ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r1, =0x02024064 strb r0, [r1] ldrb r0, [r1] ldr r1, =0x0202420a ldrb r1, [r1] bl b_history__record_ability_usage_of_player ldr r0, [r4] adds r0, 0x1 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk70_record_ability_usage_of_side thumb_func_start sub_804F574 sub_804F574: ; 804F574 ldr r2, =0x02022f68 movs r0, 0xFD strb r0, [r2] movs r0, 0x2 strb r0, [r2, 0x1] ldr r0, =0x020244e2 ldrh r1, [r0] strb r1, [r2, 0x2] movs r0, 0xFF lsls r0, 8 ands r0, r1 lsrs r0, 8 strb r0, [r2, 0x3] movs r0, 0xFF strb r0, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_804F574 thumb_func_start atk71_80268A0 atk71_80268A0: ; 804F59C push {lr} bl sub_804F574 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk71_80268A0 thumb_func_start atk72_flee atk72_flee: ; 804F5B4 push {lr} ldr r0, =0x0202420d ldrb r0, [r0] bl sub_803EC20 lsls r0, 24 cmp r0, 0 beq @0804F5E8 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @0804F5F0 .align 2, 0 .pool @0804F5E8: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0804F5F0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk72_flee thumb_func_start atk73_cmd73 atk73_cmd73: ; 804F5F8 push {r4-r6,lr} ldr r0, =0x02022fec ldr r4, [r0] movs r6, 0x1 ands r4, r6 cmp r4, 0 bne @0804F68E ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r1, =0x02024064 strb r0, [r1] movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02024084 movs r1, 0x58 muls r1, r0 adds r1, r2 ldrh r5, [r1, 0x28] movs r0, 0x64 muls r0, r5 ldrh r1, [r1, 0x2C] bl __divsi3 cmp r0, 0 bne @0804F636 movs r0, 0x1 @0804F636: cmp r0, 0x45 bgt @0804F63E cmp r5, 0 bne @0804F65C @0804F63E: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0xB1 strb r4, [r0] b @0804F68E .align 2, 0 .pool @0804F65C: cmp r0, 0x27 ble @0804F670 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0xB1 strb r6, [r0] b @0804F68E .align 2, 0 .pool @0804F670: cmp r0, 0x9 ble @0804F684 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0xB1 movs r1, 0x2 b @0804F68C .align 2, 0 .pool @0804F684: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0xB1 movs r1, 0x3 @0804F68C: strb r1, [r0] @0804F68E: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk73_cmd73 thumb_func_start atk74_hp_tresholds_2 atk74_hp_tresholds_2: ; 804F6A4 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x02022fec ldr r7, [r0] movs r0, 0x1 mov r8, r0 ands r7, r0 cmp r7, 0 bne @0804F73E ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] bl get_battle_side_of_something adds r4, r0, 0 ldr r0, =0x02024064 strb r4, [r0] movs r0, 0x1 eors r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 ldr r1, =0x0202449c ldr r6, [r1] lsrs r0, 23 adds r0, r6 adds r0, 0xA8 ldrb r5, [r0] ldr r1, =0x02024084 movs r0, 0x58 muls r0, r4 adds r0, r1 ldrh r4, [r0, 0x28] subs r1, r5, r4 movs r0, 0x64 muls r0, r1 adds r1, r5, 0 bl __divsi3 adds r1, r0, 0 cmp r4, r5 bcc @0804F71C adds r0, r6, 0 adds r0, 0xB1 strb r7, [r0] b @0804F73E .align 2, 0 .pool @0804F71C: cmp r0, 0x1D bgt @0804F72A adds r0, r6, 0 adds r0, 0xB1 mov r1, r8 strb r1, [r0] b @0804F73E @0804F72A: cmp r1, 0x45 bgt @0804F736 adds r1, r6, 0 adds r1, 0xB1 movs r0, 0x2 b @0804F73C @0804F736: adds r1, r6, 0 adds r1, 0xB1 movs r0, 0x3 @0804F73C: strb r0, [r1] @0804F73E: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk74_hp_tresholds_2 thumb_func_start atk75_8026A58 atk75_8026A58: ; 804F754 push {lr} sub sp, 0x4 ldr r2, =0x020244b8 ldr r1, =0x0202420b ldrb r0, [r1] strb r0, [r2] ldr r2, =0x0202406e ldrb r0, [r1] lsls r0, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r1, =0x02024744 adds r0, r1 ldr r1, =0x02024208 ldrh r1, [r1] lsls r2, 24 lsrs r2, 24 movs r3, 0x1 str r3, [sp] movs r3, 0 bl sub_806BD28 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk75_8026A58 thumb_func_start sub_804F7AC sub_804F7AC: ; 804F7AC push {r4-r7,lr} mov r7, r8 push {r7} ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r1, =0x02024064 strb r0, [r1] ldr r0, [r4] ldrb r0, [r0, 0x2] cmp r0, 0x1A bls @0804F7CA b @0804FD70 @0804F7CA: lsls r0, 2 ldr r1, =@0804F7E0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0804F7E0: .4byte @0804F84C .4byte @0804F85C .4byte @0804F8BC .4byte @0804F8CC .4byte @0804F8E4 .4byte @0804F920 .4byte @0804F958 .4byte @0804F9E0 .4byte @0804FA20 .4byte @0804FACC .4byte @0804FAE8 .4byte @0804FB3C .4byte @0804FB94 .4byte @0804FC18 .4byte @0804FC2C .4byte @0804FC32 .4byte @0804FC38 .4byte @0804FC60 .4byte @0804FC6A .4byte @0804FC78 .4byte @0804FC8C .4byte @0804FCC4 .4byte @0804FCD8 .4byte @0804FCF0 .4byte @0804FD1C .4byte @0804FD30 .4byte @0804FD5C @0804F84C: ldr r0, =0x02024064 ldrb r0, [r0] bl b_cancel_multi_turn_move_maybe b @0804FD70 .align 2, 0 .pool @0804F85C: ldr r1, =0x0202420b ldr r4, =0x0202420c ldrb r0, [r4] strb r0, [r1] ldrb r0, [r1] bl battle_side_get_owner movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02024294 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r2, r1, r2 ldrb r0, [r2, 0x8] cmp r0, 0 beq @0804F8A8 ldr r1, =0x02024084 ldrb r2, [r2, 0x9] movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x28] cmp r0, 0 beq @0804F8A8 strb r2, [r4] b @0804FD70 .align 2, 0 .pool @0804F8A8: ldr r0, =0x0202420c ldr r1, =0x02024064 ldrb r1, [r1] strb r1, [r0] b @0804FD70 .align 2, 0 .pool @0804F8BC: bl sub_803BB88 ldr r1, =0x02024332 strb r0, [r1] b @0804FD70 .align 2, 0 .pool @0804F8CC: ldr r0, =0x020241ea ldrh r0, [r0] movs r1, 0 bl sub_80458E0 ldr r1, =0x0202420c strb r0, [r1] b @0804FD70 .align 2, 0 .pool @0804F8E4: ldr r2, =0x02024280 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] lsls r0, 28 ldr r2, [r2] ands r2, r0 cmp r2, 0 beq @0804F914 ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1] b @0804FD70 .align 2, 0 .pool @0804F914: ldr r0, =0x02024332 strb r2, [r0] b @0804FD70 .align 2, 0 .pool @0804F920: ldr r4, =0x0202437c ldr r3, =0x02024064 ldrb r0, [r3] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r4 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] ldrb r0, [r3] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r4 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] b @0804FD70 .align 2, 0 .pool @0804F958: ldr r4, =0x0202406e ldr r1, =0x0202449c ldr r0, [r1] ldrh r3, [r4] ldrb r2, [r0, 0x10] adds r6, r1, 0 cmp r3, r2 beq @0804F974 ldrh r0, [r4, 0x4] cmp r0, r2 beq @0804F970 b @0804FD70 @0804F970: cmp r3, r0 bne @0804F988 @0804F974: ldr r1, =0x02024064 movs r0, 0 b @0804F98C .align 2, 0 .pool @0804F988: ldr r1, =0x02024064 movs r0, 0x2 @0804F98C: strb r0, [r1] adds r5, r1, 0 ldrb r2, [r5] lsls r0, r2, 1 adds r0, 0xC8 ldr r1, [r6] adds r4, r1, r0 movs r3, 0 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r1, 0xC adds r0, r1 ldrh r0, [r0] ldrh r2, [r4] cmp r0, r2 beq @0804F9CC adds r6, r5, 0 movs r5, 0x58 adds r2, r1, 0 @0804F9B4: adds r3, 0x1 cmp r3, 0x3 bgt @0804F9CC lsls r1, r3, 1 ldrb r0, [r6] muls r0, r5 adds r1, r0 adds r1, r2 ldrh r0, [r1] ldrh r1, [r4] cmp r0, r1 bne @0804F9B4 @0804F9CC: cmp r3, 0x4 beq @0804F9D2 b @0804FD70 @0804F9D2: movs r0, 0 strh r0, [r4] b @0804FD70 .align 2, 0 .pool @0804F9E0: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0xB ands r0, r1 cmp r0, 0x8 beq @0804F9EE b @0804FD70 @0804F9EE: ldr r1, =0x02024084 ldrh r0, [r1, 0x28] cmp r0, 0 bne @0804F9F8 b @0804FD70 @0804F9F8: adds r0, r1, 0 adds r0, 0x80 ldrh r0, [r0] cmp r0, 0 bne @0804FA04 b @0804FD70 @0804FA04: ldr r0, =0x02024280 ldr r1, [r0] ldr r2, =0xffbfffff ands r1, r2 str r1, [r0] b @0804FD70 .align 2, 0 .pool @0804FA20: ldr r2, =0x02024332 mov r8, r2 movs r0, 0 strb r0, [r2] ldr r1, =0x02024474 ldr r6, =0x02024064 ldrb r0, [r2, 0x1] strb r0, [r6] strb r0, [r1, 0x17] ldr r0, =0x0202449c ldr r0, [r0] adds r7, r0, 0 adds r7, 0x92 ldrb r3, [r7] ldr r1, =gUnknown_0832A328 ldrb r2, [r6] lsls r0, r2, 2 adds r0, r1 ldr r5, [r0] adds r0, r3, 0 ands r0, r5 cmp r0, 0 beq @0804FA50 b @0804FD70 @0804FA50: ldr r4, =0x02024084 movs r0, 0x58 mov r12, r0 mov r1, r12 muls r1, r2 adds r2, r1, 0 adds r1, r2, r4 ldrh r0, [r1, 0x2C] lsrs r0, 1 ldrh r1, [r1, 0x28] cmp r0, r1 bcs @0804FA6A b @0804FD70 @0804FA6A: cmp r1, 0 bne @0804FA70 b @0804FD70 @0804FA70: adds r0, r4, 0 adds r0, 0x4C adds r0, r2, r0 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @0804FA82 b @0804FD70 @0804FA82: orrs r3, r5 strb r3, [r7] movs r0, 0x1 mov r2, r8 strb r0, [r2] ldrb r0, [r6] mov r1, r12 muls r1, r0 adds r0, r1, 0 adds r1, r4, 0 adds r1, 0x48 adds r0, r1 ldr r0, [r0] bl GetNatureFromPersonality ldr r1, =gUnknown_0831C4F8 lsls r0, 24 lsrs r0, 24 adds r0, r1 ldrb r0, [r0] mov r2, r8 strb r0, [r2, 0x5] b @0804FD70 .align 2, 0 .pool @0804FACC: ldr r4, =0x02024332 adds r0, r4, 0 bl sub_81A5258 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 bne @0804FADE b @0804FD78 @0804FADE: strb r3, [r4, 0x1] b @0804FD70 .align 2, 0 .pool @0804FAE8: ldr r0, =0x02024084 adds r0, 0x80 movs r1, 0 strh r1, [r0] ldr r2, =0x02024280 ldr r3, =gUnknown_0832A328 ldr r1, [r3, 0x4] lsls r1, 28 ldr r0, [r2] orrs r0, r1 str r0, [r2] ldr r0, =0x0202449c ldr r2, [r0] ldr r0, =0x000002a1 adds r2, r0 ldr r0, =0x0202406e ldrh r0, [r0, 0x2] lsls r0, 2 adds r0, r3 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r1, =0x020242bc adds r1, 0x34 ldrb r0, [r1] movs r2, 0x2 b @0804FBF4 .align 2, 0 .pool @0804FB3C: ldr r1, =0x02024084 movs r0, 0 strh r0, [r1, 0x28] ldr r2, =0x02024280 ldr r3, =gUnknown_0832A328 ldr r1, [r3] lsls r1, 28 ldr r0, [r2] orrs r0, r1 movs r1, 0x80 lsls r1, 15 orrs r0, r1 str r0, [r2] ldr r0, =0x0202449c ldr r2, [r0] movs r1, 0xA8 lsls r1, 2 adds r2, r1 ldr r0, =0x0202406e ldrh r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r2, =0x020242bc ldrb r0, [r2, 0x18] movs r1, 0x2 orrs r0, r1 strb r0, [r2, 0x18] b @0804FD70 .align 2, 0 .pool @0804FB94: ldr r0, =0x02024084 movs r1, 0 strh r1, [r0, 0x28] adds r0, 0x80 strh r1, [r0] ldr r2, =0x02024280 ldr r3, =gUnknown_0832A328 ldr r0, [r3] lsls r0, 28 ldr r1, [r2] orrs r1, r0 ldr r0, [r3, 0x4] lsls r0, 28 orrs r1, r0 movs r0, 0x80 lsls r0, 15 orrs r1, r0 str r1, [r2] ldr r5, =0x0202449c ldr r2, [r5] movs r0, 0xA8 lsls r0, 2 adds r2, r0 ldr r4, =0x0202406e ldrh r0, [r4] lsls r0, 2 adds r0, r3 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r2, [r5] ldr r1, =0x000002a1 adds r2, r1 ldrh r0, [r4, 0x2] lsls r0, 2 adds r0, r3 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] ldr r1, =0x020242bc ldrb r0, [r1, 0x18] movs r2, 0x2 orrs r0, r2 strb r0, [r1, 0x18] adds r1, 0x34 ldrb r0, [r1] @0804FBF4: orrs r0, r2 strb r0, [r1] b @0804FD70 .align 2, 0 .pool @0804FC18: movs r0, 0 bl sub_8033E10 ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution b @0804FD70 .align 2, 0 .pool @0804FC2C: bl sub_81A5BF8 b @0804FD70 @0804FC32: bl sub_81A5D44 b @0804FD70 @0804FC38: ldr r1, =gUnknown_085CD1C8 ldr r0, =0x02024214 ldr r0, [r0] ldrb r0, [r0, 0x1] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0x16 bl battle_show_message_maybe b @0804FD70 .align 2, 0 .pool @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, =0x02024064 movs r0, 0x1 strb r0, [r4] ldr r0, =0x02024084 adds r0, 0x58 b @0804FCA2 .align 2, 0 .pool @0804FC8C: ldr r0, =0x0202406c ldrb r0, [r0] cmp r0, 0x3 bls @0804FD70 ldr r4, =0x02024064 movs r0, 0x3 strb r0, [r4] ldr r0, =0x02024084 movs r2, 0x84 lsls r2, 1 adds r0, r2 @0804FCA2: ldrh r0, [r0, 0x28] cmp r0, 0 beq @0804FD70 movs r0, 0 movs r1, 0 bl dp01_build_cmdbuf_x06_a ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @0804FD70 .align 2, 0 .pool @0804FCC4: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x55 bl MPlayVolumeControl b @0804FD70 .align 2, 0 .pool @0804FCD8: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl b @0804FD70 .align 2, 0 .pool @0804FCF0: ldr r0, =0x0202449c ldr r2, [r0] ldr r0, =0x000002a2 adds r2, r0 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] b @0804FD70 .align 2, 0 .pool @0804FD1C: ldr r0, =0x02024064 ldrb r0, [r0] bl sub_805725C @0804FD24: cmp r0, 0 bne @0804FD78 b @0804FD70 .align 2, 0 .pool @0804FD30: ldr r0, =0x02024064 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0804FD50 ldr r1, =0x0202433a movs r0, 0x5 strb r0, [r1] b @0804FD70 .align 2, 0 .pool @0804FD50: ldr r1, =0x0202433a movs r0, 0xA strb r0, [r1] b @0804FD70 .align 2, 0 .pool @0804FD5C: movs r1, 0xCE lsls r1, 1 movs r0, 0 movs r2, 0x1 bl sub_8034300 ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution @0804FD70: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x3 str r0, [r1] @0804FD78: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_804F7AC thumb_func_start atk77_setprotect atk77_setprotect: ; 804FD8C push {r4-r7,lr} mov r7, r8 push {r7} movs r6, 0x1 ldr r2, =0x02024260 ldr r1, =0x0202420b ldrb r3, [r1] lsls r0, r3, 1 adds r0, r2 ldrh r0, [r0] mov r8, r1 ldr r7, =0x020242bc cmp r0, 0xB6 beq @0804FDBC cmp r0, 0xC5 beq @0804FDBC cmp r0, 0xCB beq @0804FDBC lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r7 movs r1, 0 strb r1, [r0, 0x8] @0804FDBC: ldr r0, =0x02024082 ldrb r1, [r0] ldr r0, =0x0202406c ldrb r0, [r0] subs r0, 0x1 cmp r1, r0 bne @0804FDCC movs r6, 0 @0804FDCC: ldr r2, =gUnknown_0831C3D8 mov r5, r8 ldrb r1, [r5] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r7 ldrb r4, [r0, 0x8] lsls r4, 1 adds r4, r2 bl GenerateRandomNumber ldrh r1, [r4] lsls r0, 16 lsrs r0, 16 cmp r1, r0 bcc @0804FE80 cmp r6, 0 beq @0804FE80 ldr r4, =gBattleMoves ldr r3, =0x020241ea ldrh r0, [r3] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r4 ldrb r0, [r1] cmp r0, 0x6F bne @0804FE1C ldr r0, =0x0202433c ldrb r1, [r5] lsls r1, 4 adds r1, r0 ldrb r0, [r1] movs r2, 0x1 orrs r0, r2 strb r0, [r1] ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x5] @0804FE1C: ldrh r0, [r3] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r4 ldrb r0, [r1] cmp r0, 0x74 bne @0804FE42 ldr r0, =0x0202433c ldrb r1, [r5] lsls r1, 4 adds r1, r0 ldrb r0, [r1] movs r2, 0x2 orrs r0, r2 strb r0, [r1] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] @0804FE42: mov r1, r8 ldrb r0, [r1] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r7 ldrb r0, [r1, 0x8] adds r0, 0x1 strb r0, [r1, 0x8] b @0804FEA2 .align 2, 0 .pool @0804FE80: ldr r2, =0x020242bc ldr r0, =0x0202420b ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x8] ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] @0804FEA2: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk77_setprotect thumb_func_start atk78_faintifabilitynotdamp atk78_faintifabilitynotdamp: ; 804FEC8 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x02024068 ldr r2, [r0] cmp r2, 0 bne @0804FFCC ldr r1, =0x0202420c strb r2, [r1] ldr r0, =0x0202406c ldrb r3, [r0] adds r5, r1, 0 mov r8, r0 ldr r6, =0x02024084 cmp r2, r3 bcs @0804FF14 adds r0, r6, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x6 beq @0804FF14 adds r2, r3, 0 adds r4, r6, 0 movs r3, 0x58 @0804FEF8: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, r2 bcs @0804FF14 ldrb r0, [r5] muls r0, r3 adds r0, r4 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x6 bne @0804FEF8 @0804FF14: ldrb r0, [r5] mov r1, r8 ldrb r1, [r1] cmp r0, r1 bne @0804FFB0 ldr r4, =0x02024064 ldr r7, =0x0202420b ldrb r0, [r7] strb r0, [r4] ldr r2, =0x020241f0 ldrb r1, [r4] movs r0, 0x58 muls r0, r1 adds r0, r6 ldrh r0, [r0, 0x28] str r0, [r2] ldr r1, =0x00007fff movs r0, 0 bl dp01_build_cmdbuf_x18_0_aa_health_bar_update ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] movs r0, 0 strb r0, [r5] mov r2, r8 ldrb r0, [r2] cmp r0, 0 beq @0804FFCC adds r3, r5, 0 ldrb r5, [r7] ldr r7, =gUnknown_0832A328 adds r4, r0, 0 ldr r6, =0x02024210 @0804FF60: ldrb r2, [r3] cmp r2, r5 beq @0804FF76 ldrb r0, [r6] ldrb r1, [r3] lsls r1, 2 adds r1, r7 ldr r1, [r1] ands r0, r1 cmp r0, 0 beq @0804FFCC @0804FF76: adds r0, r2, 0x1 strb r0, [r3] lsls r0, 24 lsrs r0, 24 cmp r0, r4 bcc @0804FF60 b @0804FFCC .align 2, 0 .pool @0804FFB0: ldr r1, =0x0202420a movs r0, 0x6 strb r0, [r1] ldrb r0, [r5] movs r1, 0x58 muls r1, r0 adds r1, r6 adds r1, 0x20 ldrb r1, [r1] bl b_history__record_ability_usage_of_player ldr r1, =0x02024214 ldr r0, =gUnknown_082DB560 str r0, [r1] @0804FFCC: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk78_faintifabilitynotdamp thumb_func_start atk79_setuserhptozero atk79_setuserhptozero: ; 804FFE4 push {r4,lr} sub sp, 0x4 ldr r0, =0x02024068 ldr r3, [r0] cmp r3, 0 bne @08050028 ldr r4, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r4] ldr r1, =0x02024084 ldrb r0, [r4] movs r2, 0x58 muls r0, r2 adds r0, r1 strh r3, [r0, 0x28] ldrb r0, [r4] muls r0, r2 adds r1, 0x28 adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x2A movs r2, 0 movs r3, 0x2 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @08050028: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk79_setuserhptozero thumb_func_start sub_8050044 sub_8050044: ; 8050044 push {r4-r7,lr} ldr r3, =0x02024214 ldr r2, [r3] ldrb r4, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r4, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r4, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r4, r0 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 adds r7, r3, 0 cmp r0, 0 beq @080500DC ldr r0, =0x0202420c ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] ldr r2, =0x0202420b lsls r1, 24 lsrs r1, 24 adds r3, r0, 0 ldr r6, =0x02024210 ldr r5, =gUnknown_0832A328 ldr r0, =0x0202406c mov r12, r0 ldrb r0, [r2] cmp r1, r0 bne @0805009A @0805008A: ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] lsls r0, 24 lsrs r0, 24 ldrb r1, [r2] cmp r0, r1 beq @0805008A @0805009A: ldrb r0, [r6] ldrb r1, [r3] lsls r1, 2 adds r1, r5 ldr r1, [r1] ands r0, r1 cmp r0, 0 bne @0805008A ldrb r0, [r3] mov r2, r12 ldrb r2, [r2] cmp r0, r2 bcc @080500D8 ldr r0, [r7] adds r0, 0x5 str r0, [r7] b @080500E0 .align 2, 0 .pool @080500D8: str r4, [r7] b @080500E0 @080500DC: adds r0, r2, 0x5 str r0, [r3] @080500E0: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8050044 thumb_func_start sub_80500E8 sub_80500E8: ; 80500E8 push {r4-r6,lr} ldr r4, =0x02024214 ldr r1, [r4] ldrb r2, [r1, 0x1] ldrb r0, [r1, 0x2] lsls r0, 8 orrs r2, r0 ldrb r0, [r1, 0x3] lsls r0, 16 orrs r2, r0 ldrb r0, [r1, 0x4] lsls r0, 24 orrs r2, r0 ldrb r0, [r1, 0x5] ldr r3, =0x0202420c cmp r0, 0x1 bne @08050110 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r3] @08050110: ldr r1, =0x020241f0 ldr r6, =0x02024084 ldrb r0, [r3] movs r5, 0x58 muls r0, r5 adds r0, r6 ldrh r0, [r0, 0x2C] lsrs r0, 1 str r0, [r1] cmp r0, 0 bne @0805012A movs r0, 0x1 str r0, [r1] @0805012A: ldr r0, [r1] negs r0, r0 str r0, [r1] ldrb r0, [r3] muls r0, r5 adds r0, r6 ldrh r1, [r0, 0x28] ldrh r0, [r0, 0x2C] cmp r1, r0 bne @08050158 str r2, [r4] b @0805015E .align 2, 0 .pool @08050158: ldr r0, [r4] adds r0, 0x6 str r0, [r4] @0805015E: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_80500E8 thumb_func_start sub_8050164 sub_8050164: ; 8050164 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 ldr r2, =0x0202406c ldr r0, =0x0202420b mov r10, r0 movs r1, 0 add r0, sp, 0x4 @0805017A: strh r1, [r0] subs r0, 0x2 cmp r0, sp bge @0805017A movs r1, 0 mov r8, r1 movs r5, 0 ldrb r1, [r2] cmp r5, r1 bge @080501D0 ldr r0, =0x0202420b ldrb r6, [r0] ldr r2, =0x0000ffff mov r9, r2 lsls r4, r6, 3 mov r2, sp ldr r0, =0x0202449c mov r12, r0 adds r7, r1, 0 @080501A0: cmp r5, r6 beq @080501C8 mov r1, r12 ldr r0, [r1] adds r0, r4, r0 adds r1, r0, 0 adds r1, 0xE0 ldrb r3, [r1] adds r0, 0xE1 ldrb r0, [r0] lsls r0, 8 orrs r3, r0 cmp r3, 0 beq @080501C8 cmp r3, r9 beq @080501C8 strh r3, [r2] adds r2, 0x2 movs r0, 0x1 add r8, r0 @080501C8: adds r4, 0x2 adds r5, 0x1 cmp r5, r7 blt @080501A0 @080501D0: mov r1, r10 ldrb r0, [r1] ldr r2, =0x0202449c ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r1, r0, 0 adds r1, 0x98 ldrb r3, [r1] adds r0, 0x99 ldrb r0, [r0] lsls r0, 8 orrs r3, r0 cmp r3, 0 beq @08050220 ldr r0, =0x0000ffff cmp r3, r0 beq @08050220 ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xfffffbff ands r0, r1 str r0, [r2] ldr r4, =0x020241ea strh r3, [r4] b @0805024A .align 2, 0 .pool @08050220: mov r0, r8 cmp r0, 0 beq @08050290 ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xfffffbff ands r0, r1 str r0, [r2] bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 mov r1, r8 bl __modsi3 adds r5, r0, 0 ldr r4, =0x020241ea lsls r0, r5, 1 add r0, sp ldrh r0, [r0] strh r0, [r4] @0805024A: ldrh r0, [r4] movs r1, 0 bl sub_80458E0 ldr r1, =0x0202420c strb r0, [r1] ldr r5, =0x02024214 ldr r3, =gUnknown_082D86A8 ldr r2, =gBattleMoves ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] str r0, [r5] b @080502AE .align 2, 0 .pool @08050290: ldr r2, =0x0202437c mov r0, r10 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x20 orrs r1, r2 strb r1, [r0] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @080502AE: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8050164 thumb_func_start sub_80502C8 sub_80502C8: ; 80502C8 push {lr} ldr r2, =0x020243cc ldrh r0, [r2] movs r1, 0x7 ands r1, r0 cmp r1, 0 beq @080502F4 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] b @08050304 .align 2, 0 .pool @080502F4: movs r0, 0x1 strh r0, [r2] ldr r0, =0x02024332 strb r1, [r0, 0x5] ldr r0, =0x020243d0 adds r0, 0x28 movs r1, 0x5 strb r1, [r0] @08050304: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80502C8 thumb_func_start atk7E_setreflect atk7E_setreflect: ; 805031C push {r4-r6,lr} ldr r6, =0x0202420b ldrb r0, [r6] bl battle_get_per_side_status ldr r4, =0x0202428e movs r5, 0x1 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r1, [r1] adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @0805035C ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0 b @080503D0 .align 2, 0 .pool @0805035C: ldrb r0, [r6] bl battle_get_per_side_status adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r0, [r1] movs r2, 0x1 orrs r0, r2 strh r0, [r1] ldrb r0, [r6] bl battle_get_per_side_status ldr r4, =0x02024294 adds r1, r5, 0 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x5 strb r1, [r0] ldrb r0, [r6] bl battle_get_per_side_status adds r1, r5, 0 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r6] strb r1, [r0, 0x1] ldr r0, =0x02022fec ldr r0, [r0] ands r0, r5 cmp r0, 0 beq @080503CC movs r0, 0x1 bl sub_8069DEC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x2 bne @080503CC ldr r0, =0x02024332 strb r1, [r0, 0x5] b @080503D2 .align 2, 0 .pool @080503CC: ldr r1, =0x02024332 movs r0, 0x1 @080503D0: strb r0, [r1, 0x5] @080503D2: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk7E_setreflect thumb_func_start sub_80503E8 sub_80503E8: ; 80503E8 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r7, =0x0202427c ldrb r5, [r7] movs r0, 0x29 ands r0, r5 cmp r0, 0 bne @0805041A ldr r0, =0x020242ac mov r9, r0 ldr r1, =0x0202420c mov r8, r1 ldrb r4, [r1] lsls r0, r4, 2 mov r2, r9 adds r6, r0, r2 ldr r2, [r6] movs r0, 0x4 mov r12, r0 adds r3, r2, 0 ands r3, r0 cmp r3, 0 beq @08050438 @0805041A: movs r0, 0x1 orrs r0, r5 strb r0, [r7] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] b @08050488 .align 2, 0 .pool @08050438: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r4 adds r1, r0, r1 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0xC beq @08050454 adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0xC bne @0805046C @08050454: movs r0, 0x1 orrs r0, r5 strb r0, [r7] ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] b @08050488 .align 2, 0 .pool @0805046C: ldr r0, =0x0202420b ldrb r0, [r0] orrs r2, r0 str r2, [r6] mov r2, r8 ldrb r1, [r2] lsls r1, 2 add r1, r9 ldr r0, [r1] mov r2, r12 orrs r0, r2 str r0, [r1] ldr r0, =0x02024332 strb r3, [r0, 0x5] @08050488: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80503E8 thumb_func_start atk80_manipulatedamage atk80_manipulatedamage: ; 80504A8 push {r4,lr} ldr r1, =0x02024214 ldr r0, [r1] ldrb r2, [r0, 0x1] adds r4, r1, 0 cmp r2, 0x1 beq @080504D8 cmp r2, 0x1 bgt @080504C4 cmp r2, 0 beq @080504CA b @08050518 .align 2, 0 .pool @080504C4: cmp r2, 0x2 beq @08050510 b @08050518 @080504CA: ldr r1, =0x020241f0 ldr r0, [r1] negs r0, r0 b @08050516 .align 2, 0 .pool @080504D8: ldr r3, =0x020241f0 ldr r0, [r3] lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 str r0, [r3] cmp r0, 0 bne @080504EA str r2, [r3] @080504EA: ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x2C] lsrs r1, r0, 1 ldr r0, [r3] cmp r1, r0 bge @08050518 str r1, [r3] b @08050518 .align 2, 0 .pool @08050510: ldr r1, =0x020241f0 ldr r0, [r1] lsls r0, 1 @08050516: str r0, [r1] @08050518: ldr r0, [r4] adds r0, 0x2 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk80_manipulatedamage thumb_func_start atk81_setrest atk81_setrest: ; 8050528 push {r4-r7,lr} sub sp, 0x4 ldr r0, =0x02024214 mov r12, r0 ldr r1, [r0] ldrb r6, [r1, 0x1] ldrb r0, [r1, 0x2] lsls r0, 8 orrs r6, r0 ldrb r0, [r1, 0x3] lsls r0, 16 orrs r6, r0 ldrb r0, [r1, 0x4] lsls r0, 24 orrs r6, r0 ldr r5, =0x02024064 ldr r2, =0x0202420c ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r2] strb r0, [r5] ldr r4, =0x020241f0 ldr r1, =0x02024084 ldrb r0, [r2] movs r3, 0x58 muls r0, r3 adds r0, r1 ldrh r0, [r0, 0x2C] negs r0, r0 str r0, [r4] ldrb r0, [r2] adds r4, r0, 0 muls r4, r3 adds r0, r4, r1 ldrh r3, [r0, 0x28] adds r7, r5, 0 adds r5, r2, 0 adds r2, r1, 0 ldrh r0, [r0, 0x2C] cmp r3, r0 bne @08050598 mov r0, r12 str r6, [r0] b @080505E8 .align 2, 0 .pool @08050598: adds r0, r2, 0 adds r0, 0x4C adds r0, r4, r0 ldr r1, [r0] movs r0, 0xF8 ands r1, r0 cmp r1, 0 beq @080505B4 ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] b @080505B8 .align 2, 0 .pool @080505B4: ldr r0, =0x02024332 strb r1, [r0, 0x5] @080505B8: ldrb r0, [r5] movs r3, 0x58 muls r0, r3 adds r2, 0x4C adds r0, r2 movs r1, 0x3 str r1, [r0] ldrb r0, [r7] muls r0, r3 adds r0, r2 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r7] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @080505E8: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk81_setrest thumb_func_start atk82_jumpifnotfirstturn atk82_jumpifnotfirstturn: ; 80505F8 push {r4,r5,lr} ldr r5, =0x02024214 ldr r4, [r5] ldrb r3, [r4, 0x1] ldrb r0, [r4, 0x2] lsls r0, 8 orrs r3, r0 ldrb r0, [r4, 0x3] lsls r0, 16 orrs r3, r0 ldrb r0, [r4, 0x4] lsls r0, 24 orrs r3, r0 ldr r2, =0x020242bc ldr r0, =0x0202420b ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x16] cmp r0, 0 beq @08050638 adds r0, r4, 0x5 str r0, [r5] b @0805063A .align 2, 0 .pool @08050638: str r3, [r5] @0805063A: pop {r4,r5} pop {r0} bx r0 thumb_func_end atk82_jumpifnotfirstturn thumb_func_start sub_8050640 sub_8050640: ; 8050640 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8050640 thumb_func_start sub_8050650 sub_8050650: ; 8050650 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r3, r0, 24 movs r2, 0 ldr r0, =0x0202406c ldrb r1, [r0] mov r8, r0 cmp r2, r1 bge @080506C4 ldr r0, =0x02024084 mov r12, r0 movs r0, 0x58 muls r0, r3 add r0, r12 adds r5, r0, 0 adds r5, 0x20 adds r4, r1, 0 movs r3, 0 ldr r6, =0x02024474 ldr r7, =0x02024332 @0805067C: mov r0, r12 adds r0, 0x50 adds r0, r3, r0 ldr r0, [r0] movs r1, 0x70 ands r0, r1 cmp r0, 0 beq @080506BC ldrb r0, [r5] cmp r0, 0x2B beq @080506BC movs r3, 0 strb r2, [r6, 0x17] ldr r1, =0x0202420c ldrb r0, [r1] cmp r0, 0xFF beq @080506DC cmp r0, r2 beq @080506D0 movs r0, 0x1 strb r0, [r7, 0x5] b @080506C4 .align 2, 0 .pool @080506BC: adds r3, 0x58 adds r2, 0x1 cmp r2, r4 blt @0805067C @080506C4: mov r1, r8 ldrb r1, [r1] cmp r2, r1 beq @080506E0 movs r0, 0x1 b @080506E2 @080506D0: ldr r0, =0x02024332 strb r3, [r0, 0x5] b @080506C4 .align 2, 0 .pool @080506DC: strb r2, [r1] b @080506C4 @080506E0: movs r0, 0 @080506E2: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8050650 thumb_func_start sub_80506EC sub_80506EC: ; 80506EC push {r4-r6,lr} ldr r5, =0x02024214 ldr r1, [r5] ldrb r4, [r1, 0x1] ldrb r0, [r1, 0x2] lsls r0, 8 orrs r4, r0 ldrb r0, [r1, 0x3] lsls r0, 16 orrs r4, r0 ldrb r0, [r1, 0x4] lsls r0, 24 orrs r4, r0 ldr r6, =0x0202420c ldrb r0, [r6] bl sub_8050650 lsls r0, 24 cmp r0, 0 beq @08050720 str r4, [r5] b @08050762 .align 2, 0 .pool @08050720: ldr r1, =0x02024084 ldrb r3, [r6] movs r0, 0x58 muls r0, r3 adds r0, r1 adds r0, 0x20 ldrb r0, [r0] adds r1, r0, 0 cmp r1, 0xF beq @08050738 cmp r1, 0x48 bne @0805075C @08050738: ldr r2, =0x0202420a strb r0, [r2] ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] str r4, [r5] ldrb r1, [r2] adds r0, r3, 0 bl b_history__record_ability_usage_of_player b @08050762 .align 2, 0 .pool @0805075C: ldr r0, [r5] adds r0, 0x5 str r0, [r5] @08050762: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_80506EC thumb_func_start sub_8050768 sub_8050768: ; 8050768 push {r4,r5,lr} ldr r5, =0x020242bc ldr r4, =0x0202420b ldrb r1, [r4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r1, r0, r5 ldrb r0, [r1, 0x9] cmp r0, 0x3 bne @080507A0 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] b @080507CA .align 2, 0 .pool @080507A0: adds r0, 0x1 movs r3, 0 strb r0, [r1, 0x9] ldr r2, =0x02022f58 movs r0, 0xFD strb r0, [r2] movs r0, 0x1 strb r0, [r2, 0x1] strb r0, [r2, 0x2] strb r0, [r2, 0x3] ldrb r1, [r4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r5 ldrb r0, [r0, 0x9] strb r0, [r2, 0x4] movs r0, 0xFF strb r0, [r2, 0x5] ldr r0, =0x02024332 strb r3, [r0, 0x5] @080507CA: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8050768 thumb_func_start atk86_stockpiletobasedamage atk86_stockpiletobasedamage: ; 80507E4 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x10 ldr r3, =0x02024214 ldr r1, [r3] ldrb r2, [r1, 0x1] ldrb r0, [r1, 0x2] lsls r0, 8 orrs r2, r0 ldrb r0, [r1, 0x3] lsls r0, 16 orrs r2, r0 ldrb r0, [r1, 0x4] lsls r0, 24 orrs r2, r0 ldr r7, =0x020242bc ldr r6, =0x0202420b ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r7 ldrb r0, [r0, 0x9] cmp r0, 0 bne @08050828 str r2, [r3] b @080508CA .align 2, 0 .pool @08050828: ldr r0, =0x02024332 ldrb r0, [r0, 0x6] cmp r0, 0x1 beq @080508B0 ldr r0, =0x020241f0 mov r8, r0 ldr r4, =0x0202428e ldr r5, =0x0202420c ldrb r0, [r5] bl battle_get_per_side_status movs r1, 0x1 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r3, [r1] ldrb r0, [r6] movs r4, 0x58 muls r0, r4 ldr r2, =0x02024084 adds r0, r2 ldrb r1, [r5] muls r1, r4 adds r1, r2 ldr r2, =0x020241ea ldrh r2, [r2] movs r4, 0 str r4, [sp] str r4, [sp, 0x4] ldrb r4, [r6] str r4, [sp, 0x8] ldrb r4, [r5] str r4, [sp, 0xC] bl sub_806957C ldrb r2, [r6] lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r7 ldrb r1, [r1, 0x9] adds r3, r0, 0 muls r3, r1 mov r1, r8 str r3, [r1] ldr r2, =0x02024474 ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r7 ldrb r0, [r0, 0x9] strb r0, [r2, 0x18] ldr r1, =0x0202433c ldrb r0, [r6] lsls r0, 4 adds r0, r1 ldrb r0, [r0] lsls r0, 28 cmp r0, 0 bge @080508B0 lsls r0, r3, 4 subs r0, r3 movs r1, 0xA bl __divsi3 mov r1, r8 str r0, [r1] @080508B0: ldr r2, =0x020242bc ldr r0, =0x0202420b ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x9] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @080508CA: add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk86_stockpiletobasedamage thumb_func_start atk87_stockpiletohprecovery atk87_stockpiletohprecovery: ; 8050904 push {r4-r7,lr} mov r7, r8 push {r7} ldr r7, =0x02024214 ldr r1, [r7] ldrb r2, [r1, 0x1] ldrb r0, [r1, 0x2] lsls r0, 8 orrs r2, r0 ldrb r0, [r1, 0x3] lsls r0, 16 orrs r2, r0 ldrb r0, [r1, 0x4] lsls r0, 24 orrs r2, r0 ldr r0, =0x020242bc mov r8, r0 ldr r6, =0x0202420b ldrb r3, [r6] lsls r0, r3, 3 subs r0, r3 lsls r0, 2 mov r1, r8 adds r4, r0, r1 ldrb r1, [r4, 0x9] cmp r1, 0 bne @08050954 str r2, [r7] ldr r0, =0x02024332 strb r1, [r0, 0x5] b @080509D0 .align 2, 0 .pool @08050954: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r3 adds r1, r0, r1 ldrh r0, [r1, 0x2C] ldrh r3, [r1, 0x28] cmp r0, r3 bne @08050984 movs r0, 0 strb r0, [r4, 0x9] str r2, [r7] ldr r1, =0x0202420c ldrb r0, [r6] strb r0, [r1] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] b @080509D0 .align 2, 0 .pool @08050984: ldr r5, =0x020241f0 ldrh r0, [r1, 0x2C] ldrb r1, [r4, 0x9] movs r2, 0x3 subs r2, r1 movs r4, 0x1 adds r1, r4, 0 lsls r1, r2 bl __divsi3 str r0, [r5] cmp r0, 0 bne @080509A0 str r4, [r5] @080509A0: ldr r0, [r5] negs r0, r0 str r0, [r5] ldr r3, =0x02024474 ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r8 ldrb r0, [r0, 0x9] movs r2, 0 strb r0, [r3, 0x18] ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r8 strb r2, [r0, 0x9] ldr r0, [r7] adds r0, 0x5 str r0, [r7] ldr r1, =0x0202420c ldrb r0, [r6] strb r0, [r1] @080509D0: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk87_stockpiletohprecovery thumb_func_start atk88_negativedamage atk88_negativedamage: ; 80509E8 push {lr} ldr r2, =0x020241f0 ldr r0, =0x020241f4 ldr r0, [r0] lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 negs r0, r0 str r0, [r2] cmp r0, 0 bne @08050A04 movs r0, 0x1 negs r0, r0 str r0, [r2] @08050A04: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk88_negativedamage thumb_func_start sub_8050A1C sub_8050A1C: ; 8050A1C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} mov r8, r3 lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r7, r1, 24 lsls r2, 24 lsrs r5, r2, 24 movs r0, 0 mov r9, r0 mov r10, r0 movs r0, 0x40 ands r0, r5 cmp r0, 0 beq @08050A50 ldr r0, =0x02024064 ldr r1, =0x0202420b b @08050A54 .align 2, 0 .pool @08050A50: ldr r0, =0x02024064 ldr r1, =0x0202420c @08050A54: ldrb r1, [r1] strb r1, [r0] movs r0, 0xBF ands r5, r0 movs r0, 0x80 ands r0, r5 cmp r0, 0 beq @08050A6E mov r0, r9 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r9, r0 @08050A6E: movs r0, 0x7F ands r5, r0 movs r0, 0x20 ands r0, r5 cmp r0, 0 beq @08050A84 mov r0, r10 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r10, r0 @08050A84: movs r0, 0xDF ands r5, r0 ldr r1, =0x02022f58 movs r4, 0 movs r2, 0xFD strb r2, [r1] movs r0, 0x5 strb r0, [r1, 0x1] strb r7, [r1, 0x2] movs r3, 0x1 negs r3, r3 mov r12, r3 movs r0, 0xFF strb r0, [r1, 0x3] lsls r0, r6, 24 cmp r0, 0 blt @08050AA8 b @08050D8C @08050AA8: ldr r4, =0x02024294 ldr r1, =0x02024064 ldrb r0, [r1] bl battle_get_per_side_status movs r1, 0x1 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r0, [r0, 0x4] cmp r0, 0 beq @08050B48 mov r2, r9 cmp r2, 0 bne @08050B48 ldr r0, =0x020241ea ldrh r0, [r0] cmp r0, 0xAE beq @08050B78 cmp r5, 0x1 bne @08050B68 ldr r4, =0x0202437c ldr r3, =0x02024064 ldrb r0, [r3] lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r4 ldrb r0, [r1] lsls r0, 31 cmp r0, 0 beq @08050B10 ldr r0, =0x02024214 mov r4, r8 str r4, [r0] b @08050B68 .align 2, 0 .pool @08050B10: mov r0, r8 bl b_movescr_stack_push ldr r1, =0x02024474 ldr r6, =0x02024064 ldrb r0, [r6] strb r0, [r1, 0x17] ldr r1, =0x02024214 ldr r0, =gUnknown_082DAE03 str r0, [r1] ldrb r1, [r6] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @08050B68 .align 2, 0 .pool @08050B48: ldr r0, =0x020241ea ldrh r0, [r0] cmp r0, 0xAE beq @08050B78 mov r0, r10 cmp r0, 0x1 beq @08050B78 movs r0, 0 bl sub_80464AC lsls r0, 24 cmp r0, 0 beq @08050B78 ldr r1, =0x02024214 ldr r0, =gUnknown_082D9F1C str r0, [r1] @08050B68: movs r0, 0x1 b @08050E80 .align 2, 0 .pool @08050B78: ldr r2, =0x02024084 ldr r1, =0x02024064 ldrb r3, [r1] movs r4, 0x58 adds r0, r3, 0 muls r0, r4 adds r0, r2 adds r0, 0x20 ldrb r0, [r0] mov r10, r2 cmp r0, 0x1D beq @08050B94 cmp r0, 0x49 bne @08050C2C @08050B94: mov r0, r9 cmp r0, 0 bne @08050C2C ldr r0, =0x020241ea ldrh r0, [r0] cmp r0, 0xAE beq @08050C2C cmp r5, 0x1 bne @08050B68 ldr r4, =0x0202437c lsls r0, r3, 2 adds r0, r3 lsls r0, 2 adds r0, r4 ldrb r0, [r0] lsls r0, 31 cmp r0, 0 beq @08050BD4 ldr r0, =0x02024214 mov r1, r8 str r1, [r0] b @08050B68 .align 2, 0 .pool @08050BD4: mov r0, r8 bl b_movescr_stack_push ldr r1, =0x02024474 ldr r2, =0x02024064 ldrb r0, [r2] strb r0, [r1, 0x17] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB5C7 str r0, [r1] ldr r1, =0x0202420a ldrb r0, [r2] movs r3, 0x58 muls r0, r3 add r0, r10 adds r0, 0x20 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r2] ldrb r1, [r1] bl b_history__record_ability_usage_of_player ldr r6, =0x02024064 ldrb r1, [r6] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @08050B68 .align 2, 0 .pool @08050C2C: ldr r1, =0x02024064 ldrb r0, [r1] movs r4, 0x58 muls r0, r4 add r0, r10 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x33 bne @08050C8C mov r2, r9 cmp r2, 0 bne @08050C8C cmp r7, 0x6 bne @08050C8C cmp r5, 0x1 bne @08050B68 mov r0, r8 bl b_movescr_stack_push ldr r1, =0x02024474 ldr r3, =0x02024064 ldrb r0, [r3] strb r0, [r1, 0x17] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB62F str r0, [r1] ldr r1, =0x0202420a ldrb r0, [r3] muls r0, r4 add r0, r10 adds r0, 0x20 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r3] ldrb r1, [r1] bl b_history__record_ability_usage_of_player b @08050B68 .align 2, 0 .pool @08050C8C: ldr r4, =0x02024064 ldrb r0, [r4] movs r4, 0x58 muls r0, r4 add r0, r10 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x34 bne @08050CF0 mov r0, r9 cmp r0, 0 bne @08050CF0 cmp r7, 0x1 bne @08050CF0 cmp r5, 0x1 beq @08050CAE b @08050B68 @08050CAE: mov r0, r8 bl b_movescr_stack_push ldr r1, =0x02024474 ldr r2, =0x02024064 ldrb r0, [r2] strb r0, [r1, 0x17] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB62F str r0, [r1] ldr r1, =0x0202420a ldrb r0, [r2] muls r0, r4 add r0, r10 adds r0, 0x20 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r2] ldrb r1, [r1] bl b_history__record_ability_usage_of_player b @08050B68 .align 2, 0 .pool @08050CF0: ldr r3, =0x02024064 ldrb r1, [r3] movs r0, 0x58 muls r0, r1 add r0, r10 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x13 bne @08050D08 cmp r5, 0 bne @08050D08 b @08050B68 @08050D08: lsls r0, r6, 24 asrs r0, 28 movs r1, 0x7 ands r0, r1 negs r0, r0 lsls r0, 24 ldr r3, =0x02022f68 movs r4, 0 movs r1, 0xFD strb r1, [r3] movs r2, 0x1 lsrs r6, r0, 24 asrs r0, 24 subs r1, 0xFF cmp r0, r1 bne @08050D32 strb r4, [r3, 0x1] movs r0, 0xD3 strb r0, [r3, 0x2] strb r4, [r3, 0x3] movs r2, 0x4 @08050D32: adds r0, r2, r3 strb r4, [r0] adds r2, 0x1 adds r1, r2, r3 movs r0, 0xD4 strb r0, [r1] adds r2, 0x1 adds r0, r2, r3 strb r4, [r0] adds r2, 0x1 adds r1, r2, r3 movs r0, 0xFF strb r0, [r1] ldr r4, =0x02024064 ldrb r2, [r4] movs r0, 0x58 muls r0, r2 adds r0, r7, r0 mov r1, r10 adds r1, 0x18 adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 beq @08050DE2 movs r1, 0 ldr r0, =0x0202420c ldrb r0, [r0] ldr r3, =0x02024332 mov r8, r3 cmp r0, r2 bne @08050D76 movs r1, 0x1 @08050D76: mov r4, r8 strb r1, [r4, 0x5] b @08050E10 .align 2, 0 .pool @08050D8C: asrs r6, r0, 28 movs r0, 0x7 ands r6, r0 ldr r3, =0x02022f68 strb r2, [r3] movs r2, 0x1 cmp r6, 0x2 bne @08050DA6 strb r4, [r3, 0x1] movs r0, 0xD1 strb r0, [r3, 0x2] strb r4, [r3, 0x3] movs r2, 0x4 @08050DA6: adds r0, r2, r3 strb r4, [r0] adds r2, 0x1 adds r1, r2, r3 movs r0, 0xD2 strb r0, [r1] adds r2, 0x1 adds r0, r2, r3 strb r4, [r0] adds r2, 0x1 adds r1, r2, r3 ldrb r0, [r1] mov r2, r12 orrs r0, r2 strb r0, [r1] ldr r2, =0x02024084 ldr r4, =0x02024064 ldrb r3, [r4] movs r0, 0x58 muls r0, r3 adds r0, r7, r0 adds r1, r2, 0 adds r1, 0x18 adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 mov r10, r2 cmp r0, 0xC bne @08050DFC @08050DE2: ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] mov r8, r1 b @08050E10 .align 2, 0 .pool @08050DFC: movs r1, 0 ldr r0, =0x0202420c ldrb r0, [r0] ldr r2, =0x02024332 mov r8, r2 cmp r0, r3 bne @08050E0C movs r1, 0x1 @08050E0C: mov r3, r8 strb r1, [r3, 0x5] @08050E10: ldr r2, =0x02024064 ldrb r0, [r2] movs r4, 0x58 adds r1, r0, 0 muls r1, r4 adds r1, r7, r1 mov r3, r10 adds r3, 0x18 adds r1, r3 lsls r0, r6, 24 asrs r0, 24 ldrb r6, [r1] adds r0, r6 strb r0, [r1] ldrb r0, [r2] muls r0, r4 adds r0, r7, r0 adds r1, r0, r3 movs r0, 0 ldrsb r0, [r1, r0] cmp r0, 0 bge @08050E40 movs r0, 0 strb r0, [r1] @08050E40: ldr r1, =0x02024064 ldrb r0, [r1] muls r0, r4 adds r0, r7, r0 adds r1, r0, r3 movs r0, 0 ldrsb r0, [r1, r0] cmp r0, 0xC ble @08050E56 movs r0, 0xC strb r0, [r1] @08050E56: mov r2, r8 ldrb r0, [r2, 0x5] cmp r0, 0x2 bne @08050E7E movs r3, 0x1 ands r3, r5 cmp r3, 0 beq @08050E70 ldr r0, =0x0202427c ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] @08050E70: mov r4, r8 ldrb r0, [r4, 0x5] cmp r0, 0x2 bne @08050E7E cmp r3, 0 bne @08050E7E b @08050B68 @08050E7E: movs r0, 0 @08050E80: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8050A1C thumb_func_start atk89_statbuffchange atk89_statbuffchange: ; 8050EA0 push {r4,r5,lr} ldr r5, =0x02024214 ldr r2, [r5] ldrb r3, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 orrs r3, r0 ldrb r0, [r2, 0x4] lsls r0, 16 orrs r3, r0 ldrb r0, [r2, 0x5] lsls r0, 24 orrs r3, r0 ldr r0, =0x02024474 ldrb r4, [r0, 0x1A] movs r0, 0xF0 ands r0, r4 lsls r0, 24 asrs r0, 24 movs r1, 0xF ands r1, r4 ldrb r2, [r2, 0x1] bl sub_8050A1C lsls r0, 24 cmp r0, 0 bne @08050EDC ldr r0, [r5] adds r0, 0x6 str r0, [r5] @08050EDC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk89_statbuffchange thumb_func_start atk8A_normalisebuffs atk8A_normalisebuffs: ; 8050EEC push {r4-r7,lr} movs r2, 0 ldr r0, =0x0202406c ldrb r1, [r0] ldr r0, =0x02024214 mov r12, r0 cmp r2, r1 bge @08050F24 ldr r0, =0x02024084 movs r4, 0x6 adds r5, r1, 0 movs r7, 0x58 adds r6, r0, 0 adds r6, 0x18 @08050F08: adds r3, r2, 0x1 movs r1, 0x7 adds r0, r2, 0 muls r0, r7 adds r0, r6 adds r0, 0x7 @08050F14: strb r4, [r0] subs r0, 0x1 subs r1, 0x1 cmp r1, 0 bge @08050F14 adds r2, r3, 0 cmp r2, r5 blt @08050F08 @08050F24: mov r1, r12 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk8A_normalisebuffs thumb_func_start atk8B_setbide atk8B_setbide: ; 8050F40 push {r4,r5,lr} ldr r4, =0x02024084 ldr r3, =0x0202420b ldrb r0, [r3] movs r5, 0x58 adds r2, r0, 0 muls r2, r5 adds r4, 0x50 adds r2, r4 ldr r0, [r2] movs r1, 0x80 lsls r1, 5 orrs r0, r1 str r0, [r2] ldr r1, =0x02024268 ldrb r0, [r3] lsls r0, 1 adds r0, r1 ldr r1, =0x020241ea ldrh r1, [r1] movs r2, 0 strh r1, [r0] ldr r1, =0x020241f8 ldrb r0, [r3] lsls r0, 2 adds r0, r1 str r2, [r0] ldrb r0, [r3] adds r1, r0, 0 muls r1, r5 adds r1, r4 ldr r0, [r1] movs r2, 0x80 lsls r2, 2 orrs r0, r2 str r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk8B_setbide thumb_func_start atk8C_confuseifrepeatingattackends atk8C_confuseifrepeatingattackends: ; 8050FB0 push {lr} ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0xC0 lsls r1, 4 ands r0, r1 cmp r0, 0 bne @08050FD2 ldr r1, =0x02024332 movs r0, 0x75 strb r0, [r1, 0x3] @08050FD2: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk8C_confuseifrepeatingattackends thumb_func_start atk8D_setloopcounter atk8D_setloopcounter: ; 8050FF0 push {r4,r5,lr} ldr r0, =0x02024214 ldr r0, [r0] ldrb r1, [r0, 0x1] cmp r1, 0 beq @0805100C ldr r0, =0x02024212 strb r1, [r0] b @08051026 .align 2, 0 .pool @0805100C: ldr r4, =0x02024212 bl GenerateRandomNumber movs r5, 0x3 ands r0, r5 strb r0, [r4] cmp r0, 0x1 bls @08051022 bl GenerateRandomNumber ands r0, r5 @08051022: adds r0, 0x2 strb r0, [r4] @08051026: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk8D_setloopcounter thumb_func_start atk8E_cmd8e atk8E_cmd8e: ; 805103C ldr r1, =0x02024474 movs r2, 0 movs r0, 0xFD strb r0, [r1, 0x8] movs r0, 0x1 strb r0, [r1, 0x9] strb r0, [r1, 0xA] strb r0, [r1, 0xB] strb r2, [r1, 0xC] movs r0, 0xFF strb r0, [r1, 0xD] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end atk8E_cmd8e thumb_func_start sub_8051064 sub_8051064: ; 8051064 push {r4-r7,lr} ldr r6, =0x02024084 ldr r7, =0x0202420b ldrb r0, [r7] movs r5, 0x58 adds r1, r0, 0 muls r1, r5 adds r1, r6 adds r1, 0x2A ldr r4, =0x0202420c ldrb r3, [r4] adds r0, r3, 0 muls r0, r5 adds r0, r6 adds r0, 0x2A ldrb r1, [r1] ldrb r0, [r0] cmp r1, r0 bcc @080510AC ldr r0, =0x0202449c ldr r1, [r0] adds r1, r3, r1 adds r1, 0x58 ldr r2, =0x0202406e lsls r0, r3, 1 b @08051108 .align 2, 0 .pool @080510AC: bl GenerateRandomNumber movs r3, 0xFF ands r3, r0 ldrb r0, [r7] muls r0, r5 adds r0, r6 adds r0, 0x2A ldrb r2, [r0] ldrb r4, [r4] adds r0, r4, 0 muls r0, r5 adds r0, r6 adds r0, 0x2A ldrb r1, [r0] adds r2, r1 adds r0, r3, 0 muls r0, r2 asrs r0, 8 adds r0, 0x1 lsrs r1, 2 cmp r0, r1 bhi @080510FC ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] movs r0, 0 b @08051116 .align 2, 0 .pool @080510FC: ldr r0, =0x0202449c ldr r1, [r0] adds r1, r4, r1 adds r1, 0x58 ldr r2, =0x0202406e lsls r0, r4, 1 @08051108: adds r0, r2 ldrh r0, [r0] strb r0, [r1] ldr r1, =0x02024214 ldr r0, =gUnknown_082DADD8 str r0, [r1] movs r0, 0x1 @08051116: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8051064 thumb_func_start sub_805112C sub_805112C: ; 805112C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC movs r0, 0 str r0, [sp, 0x4] ldr r5, =0x02022fec ldr r0, [r5] movs r1, 0x8 ands r0, r1 cmp r0, 0 bne @0805114A b @08051410 @0805114A: ldr r4, =0x0202420c ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 str r1, [sp] cmp r0, 0 bne @08051160 ldr r0, =0x020244ec str r0, [sp] @08051160: ldr r2, [r5] movs r1, 0x81 lsls r1, 1 adds r0, r2, 0 ands r0, r1 cmp r0, r1 beq @08051182 ldr r1, =0x02000100 adds r0, r2, 0 ands r0, r1 cmp r0, r1 beq @08051182 movs r0, 0x80 lsls r0, 15 ands r0, r2 cmp r0, 0 beq @080511C8 @08051182: ldr r2, =0x0202420c ldrb r1, [r2] movs r0, 0x2 ands r0, r1 adds r1, r2, 0 cmp r0, 0 beq @080511AC movs r0, 0x3 mov r9, r0 movs r0, 0x6 b @080511B2 .align 2, 0 .pool @080511AC: movs r0, 0 mov r9, r0 movs r0, 0x3 @080511B2: mov r8, r0 movs r0, 0x3 mov r10, r0 movs r0, 0x1 str r0, [sp, 0x8] ldr r2, =0x0202406e ldrb r1, [r1] b @0805128E .align 2, 0 .pool @080511C8: movs r0, 0x42 ands r0, r2 cmp r0, 0x42 beq @080511DA ldr r1, =0x02000040 adds r0, r2, 0 ands r0, r1 cmp r0, r1 bne @0805121C @080511DA: ldrb r0, [r4] bl sub_806D864 lsls r0, 24 lsrs r0, 24 bl sub_806D82C lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bne @080511FC movs r1, 0x3 mov r9, r1 movs r0, 0x6 b @08051202 .align 2, 0 .pool @080511FC: movs r1, 0 mov r9, r1 movs r0, 0x3 @08051202: mov r8, r0 movs r1, 0x3 mov r10, r1 movs r0, 0x1 str r0, [sp, 0x8] ldr r2, =0x0202406e ldr r0, =0x0202420c ldrb r1, [r0] b @0805128E .align 2, 0 .pool @0805121C: movs r0, 0x80 lsls r0, 8 ands r0, r2 cmp r0, 0 beq @08051274 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08051240 movs r1, 0 mov r9, r1 movs r0, 0x6 mov r8, r0 mov r10, r0 movs r1, 0x2 b @08051260 @08051240: ldrb r1, [r4] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08051252 movs r0, 0x3 mov r9, r0 movs r1, 0x6 b @08051258 @08051252: movs r0, 0 mov r9, r0 movs r1, 0x3 @08051258: mov r8, r1 movs r0, 0x3 mov r10, r0 movs r1, 0x1 @08051260: str r1, [sp, 0x8] ldr r2, =0x0202406e ldr r0, =0x0202420c ldrb r1, [r0] b @0805128E .align 2, 0 .pool @08051274: movs r0, 0x1 ands r2, r0 cmp r2, 0 beq @080512A4 movs r0, 0 mov r9, r0 movs r1, 0x6 mov r8, r1 mov r10, r1 movs r0, 0x2 str r0, [sp, 0x8] ldr r2, =0x0202406e ldrb r1, [r4] @0805128E: lsls r0, r1, 1 adds r0, r2 ldrh r7, [r0] movs r0, 0x2 eors r1, r0 lsls r1, 1 adds r1, r2 ldrh r5, [r1] b @080512BE .align 2, 0 .pool @080512A4: movs r1, 0 mov r9, r1 movs r0, 0x6 mov r8, r0 mov r10, r0 movs r1, 0x1 str r1, [sp, 0x8] ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r5, [r0] adds r7, r5, 0 @080512BE: mov r6, r9 cmp r6, r8 bge @080512FC @080512C4: movs r0, 0x64 muls r0, r6 ldr r1, [sp] adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @080512F6 adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @080512F6 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @080512F6 ldr r0, [sp, 0x4] adds r0, 0x1 str r0, [sp, 0x4] @080512F6: adds r6, 0x1 cmp r6, r8 blt @080512C4 @080512FC: ldr r1, [sp, 0x4] ldr r0, [sp, 0x8] cmp r1, r0 bgt @08051328 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @08051414 .align 2, 0 .pool @08051328: bl sub_8051064 lsls r0, 24 cmp r0, 0 beq @08051378 @08051332: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 mov r1, r10 bl __modsi3 adds r6, r0, 0 add r6, r9 cmp r6, r7 beq @08051332 cmp r6, r5 beq @08051332 movs r0, 0x64 muls r0, r6 ldr r1, [sp] adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @08051332 adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0x1 beq @08051332 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08051332 @08051378: ldr r4, =0x0202420c ldrb r0, [r4] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 adds r0, 0x5C strb r6, [r0] bl sub_81B1250 lsls r0, 24 cmp r0, 0 bne @08051396 ldrb r0, [r4] bl sub_803BDA0 @08051396: ldr r0, =0x02022fec ldr r2, [r0] movs r1, 0x81 lsls r1, 1 adds r0, r2, 0 ands r0, r1 cmp r0, r1 beq @080513C0 movs r0, 0x42 ands r0, r2 cmp r0, 0x42 beq @080513C0 ldr r1, =0x02000100 adds r0, r2, 0 ands r0, r1 cmp r0, r1 beq @080513C0 ldr r0, =0x02000040 ands r2, r0 cmp r2, r0 bne @080513DE @080513C0: ldr r5, =0x0202420c ldrb r0, [r5] lsls r4, r6, 24 lsrs r4, 24 adds r1, r4, 0 movs r2, 0 bl sub_81B8E80 ldrb r1, [r5] movs r0, 0x2 eors r0, r1 adds r1, r4, 0 movs r2, 0x1 bl sub_81B8E80 @080513DE: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @08051414 ldr r0, =0x0202420c ldrb r0, [r0] lsls r1, r6, 24 lsrs r1, 24 bl sub_80571DC b @08051414 .align 2, 0 .pool @08051410: bl sub_8051064 @08051414: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_805112C thumb_func_start sub_8051424 sub_8051424: ; 8051424 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r6, 0 ldr r2, =0x02024084 ldr r3, =0x0202420b ldrb r1, [r3] movs r0, 0x58 muls r0, r1 adds r1, r2, 0 adds r1, 0xC adds r0, r1 ldrh r0, [r0] mov r8, r2 cmp r0, 0 beq @08051466 movs r5, 0x58 adds r2, r1, 0 @0805144C: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x3 bhi @08051466 lsls r1, r6, 1 ldrb r0, [r3] muls r0, r5 adds r1, r0 adds r1, r2 ldrh r0, [r1] cmp r0, 0 bne @0805144C @08051466: movs r3, 0 cmp r3, r6 bcs @080514E8 ldr r0, =gBattleMoves mov r10, r0 ldr r5, =0x02024084 mov r12, r5 ldr r7, =0x0202420b ldrb r0, [r7] movs r4, 0x58 adds r5, r0, 0 muls r5, r4 movs r0, 0xC add r0, r12 mov r9, r0 @08051484: lsls r0, r3, 1 adds r0, r5 add r0, r9 ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 add r0, r10 ldrb r2, [r0, 0x2] cmp r2, 0x9 bne @080514C6 mov r0, r8 adds r1, r5, r0 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x7 beq @080514B2 adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x7 bne @080514C4 @080514B2: movs r2, 0x7 b @080514C6 .align 2, 0 .pool @080514C4: movs r2, 0 @080514C6: ldrb r0, [r7] muls r0, r4 add r0, r12 adds r1, r0, 0 adds r1, 0x21 ldrb r1, [r1] cmp r2, r1 beq @080514DE adds r0, 0x22 ldrb r0, [r0] cmp r2, r0 bne @080514E8 @080514DE: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, r6 bcc @08051484 @080514E8: cmp r3, r6 bne @0805150C ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @080515B0 .align 2, 0 .pool @0805150C: movs r7, 0x3 ldr r5, =gBattleMoves mov r9, r5 @08051512: bl GenerateRandomNumber adds r3, r0, 0 ands r3, r7 cmp r3, r6 bcs @08051512 ldr r4, =0x02024084 lsls r1, r3, 1 ldr r3, =0x0202420b ldrb r2, [r3] movs r0, 0x58 adds r5, r2, 0 muls r5, r0 adds r1, r5 adds r0, r4, 0 adds r0, 0xC adds r1, r0 ldrh r1, [r1] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 add r0, r9 ldrb r2, [r0, 0x2] mov r8, r4 adds r4, r3, 0 cmp r2, 0x9 bne @08051572 mov r0, r8 adds r2, r5, r0 adds r0, r2, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x7 beq @08051560 adds r0, r2, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x7 bne @08051570 @08051560: movs r2, 0x7 b @08051572 .align 2, 0 .pool @08051570: movs r2, 0 @08051572: ldrb r0, [r4] movs r3, 0x58 muls r0, r3 add r0, r8 adds r1, r0, 0 adds r1, 0x21 ldrb r5, [r1] cmp r2, r5 beq @08051512 adds r0, 0x22 ldrb r0, [r0] cmp r2, r0 beq @08051512 strb r2, [r1] ldrb r0, [r4] muls r0, r3 add r0, r8 adds r0, 0x22 strb r2, [r0] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x3 strb r0, [r1, 0x1] strb r2, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @080515B0: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8051424 thumb_func_start atk91_givemoney atk91_givemoney: ; 80515C8 push {r4,lr} ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 bne @08051650 ldr r1, =0x0202432e ldrh r0, [r1] cmp r0, 0 beq @08051650 adds r1, r0, 0 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x4A ldrb r0, [r0] adds r4, r1, 0 muls r4, r0 ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 adds r1, r4, 0 bl add_money ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x1 strb r0, [r1, 0x1] movs r0, 0x2 strb r0, [r1, 0x2] movs r0, 0x5 strb r0, [r1, 0x3] strb r4, [r1, 0x4] movs r0, 0xFF lsls r0, 8 ands r4, r0 lsrs r4, 8 strb r4, [r1, 0x5] movs r0, 0xFF strb r0, [r1, 0x6] ldr r4, =0x02024214 ldr r0, [r4] adds r0, 0x1 bl b_movescr_stack_push ldr r0, =gUnknown_082DB307 str r0, [r4] b @08051658 .align 2, 0 .pool @08051650: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @08051658: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk91_givemoney thumb_func_start atk92_setlightscreen atk92_setlightscreen: ; 8051664 push {r4-r6,lr} ldr r5, =0x0202420b ldrb r0, [r5] bl battle_get_per_side_status ldr r4, =0x0202428e movs r6, 0x1 adds r1, r6, 0 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r1, [r1] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080516A4 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0 b @08051718 .align 2, 0 .pool @080516A4: ldrb r0, [r5] bl battle_get_per_side_status adds r1, r6, 0 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r0, [r1] movs r2, 0x2 orrs r0, r2 strh r0, [r1] ldrb r0, [r5] bl battle_get_per_side_status ldr r4, =0x02024294 adds r1, r6, 0 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x5 strb r1, [r0, 0x2] ldrb r0, [r5] bl battle_get_per_side_status adds r1, r6, 0 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r5] strb r1, [r0, 0x3] ldr r0, =0x02022fec ldr r0, [r0] ands r0, r6 cmp r0, 0 beq @08051714 movs r0, 0x1 bl sub_8069DEC lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08051714 ldr r1, =0x02024332 movs r0, 0x4 b @08051718 .align 2, 0 .pool @08051714: ldr r1, =0x02024332 movs r0, 0x3 @08051718: strb r0, [r1, 0x5] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk92_setlightscreen thumb_func_start atk93_ko_move atk93_ko_move: ; 8051730 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r7, =0x02024084 ldr r6, =0x0202420c ldrb r2, [r6] movs r5, 0x58 adds r0, r2, 0 muls r0, r5 adds r1, r0, r7 ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @08051768 ldr r1, =0x02024404 lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r4, [r0, 0x7] ldrb r6, [r0, 0x1A] b @08051782 .align 2, 0 .pool @08051768: ldrh r0, [r1, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r4, r0, 24 ldrb r0, [r6] muls r0, r5 adds r0, r7 ldrh r0, [r0, 0x2E] bl itemid_get_quality lsls r0, 24 lsrs r6, r0, 24 @08051782: ldr r1, =0x0202420f ldr r5, =0x0202420c ldrb r0, [r5] strb r0, [r1] cmp r4, 0x27 bne @080517C0 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, r6 bcs @080517C0 ldrb r0, [r5] movs r1, 0x27 bl b_history__record_item_x12_of_player ldr r2, =0x0202437c ldrb r1, [r5] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x80 orrs r1, r2 strb r1, [r0] @080517C0: ldr r1, =0x02024084 ldr r2, =0x0202420c ldrb r3, [r2] movs r6, 0x58 adds r0, r3, 0 muls r0, r6 adds r5, r0, r1 adds r0, r5, 0 adds r0, 0x20 ldrb r4, [r0] mov r8, r1 mov r9, r2 cmp r4, 0x5 bne @0805181C ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r0, =0x0202420a strb r4, [r0] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB552 str r0, [r1] mov r1, r9 ldrb r0, [r1] movs r1, 0x5 bl b_history__record_ability_usage_of_player b @08051A70 .align 2, 0 .pool @0805181C: ldr r1, =0x020242ac lsls r0, r3, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x18 ands r0, r1 cmp r0, 0 bne @080518A0 ldr r1, =gBattleMoves ldr r0, =0x020241ea ldrh r0, [r0] lsls r2, r0, 1 adds r2, r0 lsls r2, 2 adds r2, r1 ldr r7, =0x0202420b ldrb r0, [r7] muls r0, r6 add r0, r8 adds r0, 0x2A ldrb r0, [r0] adds r1, r5, 0 adds r1, 0x2A ldrb r1, [r1] subs r0, r1 ldrb r2, [r2, 0x3] adds r0, r2 lsls r0, 16 lsrs r4, r0, 16 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 adds r0, 0x1 cmp r0, r4 blt @08051870 b @08051A08 @08051870: ldrb r0, [r7] adds r1, r0, 0 muls r1, r6 add r1, r8 adds r1, 0x2A mov r2, r9 ldrb r0, [r2] muls r0, r6 add r0, r8 adds r0, 0x2A ldrb r1, [r1] movs r4, 0x1 ldrb r0, [r0] cmp r1, r0 bcs @08051936 b @08051A08 .align 2, 0 .pool @080518A0: ldr r1, =0x020242bc lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r1 ldr r1, =0x0202420b ldrb r0, [r0, 0x15] adds r7, r1, 0 ldrb r3, [r7] cmp r0, r3 bne @080518CA ldrb r0, [r7] muls r0, r6 add r0, r8 adds r0, 0x2A adds r1, r5, 0 adds r1, 0x2A ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bcs @08051942 @080518CA: ldr r1, =gBattleMoves ldr r0, =0x020241ea ldrh r0, [r0] lsls r2, r0, 1 adds r2, r0 lsls r2, 2 adds r2, r1 ldr r6, =0x02024084 ldrb r0, [r7] movs r5, 0x58 muls r0, r5 adds r0, r6 adds r0, 0x2A ldrb r1, [r0] ldr r0, =0x0202420c mov r8, r0 ldrb r0, [r0] muls r0, r5 adds r0, r6 adds r0, 0x2A ldrb r0, [r0] subs r1, r0 ldrb r2, [r2, 0x3] adds r1, r2 lsls r1, 16 lsrs r4, r1, 16 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 adds r0, 0x1 cmp r0, r4 bge @08051934 ldrb r0, [r7] adds r1, r0, 0 muls r1, r5 adds r1, r6 adds r1, 0x2A mov r2, r8 ldrb r0, [r2] muls r0, r5 adds r0, r6 adds r0, 0x2A ldrb r1, [r1] movs r4, 0x1 ldrb r0, [r0] cmp r1, r0 bcs @08051936 @08051934: movs r4, 0 @08051936: ldr r3, =0x02024084 mov r8, r3 ldr r0, =0x0202420c mov r9, r0 cmp r4, 0 beq @08051A08 @08051942: ldr r0, =0x0202433c mov r1, r9 ldrb r2, [r1] lsls r1, r2, 4 adds r1, r0 ldrb r0, [r1] lsls r0, 30 cmp r0, 0 bge @08051990 ldr r1, =0x020241f0 movs r0, 0x58 muls r0, r2 add r0, r8 ldrh r0, [r0, 0x28] subs r0, 0x1 str r0, [r1] ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x40 b @080519EE .align 2, 0 .pool @08051990: ldr r0, =0x0202437c lsls r1, r2, 2 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1] lsrs r0, 7 cmp r0, 0 beq @080519DC ldr r1, =0x020241f0 movs r3, 0x58 adds r0, r2, 0 muls r0, r3 add r0, r8 ldrh r0, [r0, 0x28] subs r0, 0x1 str r0, [r1] ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024208 mov r2, r9 ldrb r0, [r2] muls r0, r3 add r0, r8 ldrh r0, [r0, 0x2E] strh r0, [r1] b @080519F2 .align 2, 0 .pool @080519DC: ldr r1, =0x020241f0 movs r0, 0x58 muls r0, r2 add r0, r8 ldrh r0, [r0, 0x28] str r0, [r1] ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x10 @080519EE: orrs r0, r1 strb r0, [r2] @080519F2: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08051A70 .align 2, 0 .pool @08051A08: ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r3, =0x02024084 ldr r0, =0x0202420b ldrb r0, [r0] movs r2, 0x58 adds r1, r0, 0 muls r1, r2 adds r1, r3 adds r1, 0x2A ldr r0, =0x0202420c ldrb r0, [r0] muls r0, r2 adds r0, r3 adds r0, 0x2A ldrb r1, [r1] ldrb r0, [r0] cmp r1, r0 bcc @08051A50 ldr r1, =0x02024332 movs r0, 0 b @08051A54 .align 2, 0 .pool @08051A50: ldr r1, =0x02024332 movs r0, 0x1 @08051A54: strb r0, [r1, 0x5] ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08051A70: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk93_ko_move thumb_func_start atk94_gethalfcurrentenemyhp atk94_gethalfcurrentenemyhp: ; 8051A84 push {lr} ldr r3, =0x020241f0 ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x28] lsrs r0, 1 str r0, [r3] cmp r0, 0 bne @08051AA2 movs r0, 0x1 str r0, [r3] @08051AA2: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk94_gethalfcurrentenemyhp thumb_func_start sub_8051AC0 sub_8051AC0: ; 8051AC0 push {lr} ldr r2, =0x020243cc ldrh r1, [r2] movs r0, 0x18 ands r0, r1 cmp r0, 0 beq @08051AEC ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] b @08051AFE .align 2, 0 .pool @08051AEC: movs r0, 0x8 strh r0, [r2] ldr r1, =0x02024332 movs r0, 0x3 strb r0, [r1, 0x5] ldr r0, =0x020243d0 adds r0, 0x28 movs r1, 0x5 strb r1, [r0] @08051AFE: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8051AC0 thumb_func_start sub_8051B18 sub_8051B18: ; 8051B18 push {r4,r5,lr} sub sp, 0x4 movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @08051B36 b @08051C48 @08051B36: str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @08051B4C b @08051C48 @08051B4C: ldr r2, =0x020243cc ldrh r1, [r2] movs r0, 0x18 ands r0, r1 adds r4, r2, 0 ldr r5, =0x0202420b cmp r0, 0 beq @08051BDA ldr r0, =0x02024084 ldrb r2, [r5] movs r1, 0x58 muls r1, r2 adds r3, r1, r0 adds r0, r3, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x5 beq @08051BD4 cmp r0, 0x8 beq @08051BD4 cmp r0, 0x4 beq @08051BD4 adds r0, r3, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x5 beq @08051BD4 cmp r0, 0x8 beq @08051BD4 cmp r0, 0x4 beq @08051BD4 adds r0, r3, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x8 beq @08051BD4 ldr r0, =0x020242ac lsls r1, r2, 2 adds r1, r0 ldr r1, [r1] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08051BD4 movs r0, 0x80 lsls r0, 11 ands r1, r0 cmp r1, 0 bne @08051BD4 ldr r1, =0x020241f0 ldrh r0, [r3, 0x2C] lsrs r0, 4 str r0, [r1] cmp r0, 0 bne @08051BDA movs r0, 0x1 b @08051BD8 .align 2, 0 .pool @08051BD4: ldr r1, =0x020241f0 movs r0, 0 @08051BD8: str r0, [r1] @08051BDA: ldrh r1, [r4] movs r4, 0x80 adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @08051C50 ldr r1, =0x02024084 ldrb r3, [r5] movs r0, 0x58 muls r0, r3 adds r2, r0, r1 adds r0, r2, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0xF beq @08051C3C adds r0, r2, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0xF beq @08051C3C ldr r0, =0x020242ac lsls r1, r3, 2 adds r1, r0 ldr r1, [r1] adds r0, r1, 0 ands r0, r4 cmp r0, 0 bne @08051C3C movs r0, 0x80 lsls r0, 11 ands r1, r0 cmp r1, 0 bne @08051C3C ldr r1, =0x020241f0 ldrh r0, [r2, 0x2C] lsrs r0, 4 str r0, [r1] cmp r0, 0 bne @08051C50 movs r0, 0x1 str r0, [r1] b @08051C50 .align 2, 0 .pool @08051C3C: ldr r1, =0x020241f0 movs r0, 0 str r0, [r1] b @08051C50 .align 2, 0 .pool @08051C48: ldr r1, =0x020241f0 movs r0, 0 str r0, [r1] ldr r5, =0x0202420b @08051C50: ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08051C6A ldr r1, =0x020241f0 movs r0, 0 str r0, [r1] @08051C6A: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8051B18 thumb_func_start atk97_tryinfatuatetarget atk97_tryinfatuatetarget: ; 8051C90 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r4, =0x0202420b ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08051CC8 ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec b @08051CD8 .align 2, 0 .pool @08051CC8: ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 @08051CD8: adds r5, r1, r0 ldr r4, =0x0202420c ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08051D0C ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec b @08051D1C .align 2, 0 .pool @08051D0C: ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 @08051D1C: adds r4, r1, r0 adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r10, r0 adds r0, r5, 0 movs r1, 0 bl pokemon_getattr mov r9, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r8, r0 adds r0, r4, 0 movs r1, 0 bl pokemon_getattr adds r7, r0, 0 ldr r5, =0x0202420c ldrb r0, [r5] movs r6, 0x58 muls r0, r6 ldr r1, =0x02024084 adds r0, r1 adds r0, 0x20 ldrb r2, [r0] cmp r2, 0xC bne @08051D94 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB5F5 str r0, [r1] ldr r0, =0x0202420a strb r2, [r0] ldrb r0, [r5] movs r1, 0xC bl b_history__record_ability_usage_of_player b @08051E2C .align 2, 0 .pool @08051D94: mov r0, r10 mov r1, r9 bl pokemon_species_get_gender_info adds r4, r0, 0 mov r0, r8 adds r1, r7, 0 bl pokemon_species_get_gender_info lsls r4, 24 lsls r0, 24 cmp r4, r0 beq @08051DE4 ldrb r0, [r5] muls r0, r6 ldr r4, =0x02024084 adds r4, 0x50 adds r0, r4 ldr r0, [r0] movs r1, 0xF0 lsls r1, 12 ands r0, r1 cmp r0, 0 bne @08051DE4 mov r0, r10 mov r1, r9 bl pokemon_species_get_gender_info lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @08051DE4 mov r0, r8 adds r1, r7, 0 bl pokemon_species_get_gender_info lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @08051E08 @08051DE4: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @08051E2C .align 2, 0 .pool @08051E08: ldrb r0, [r5] adds r2, r0, 0 muls r2, r6 adds r2, r4 ldr r1, =gUnknown_0832A328 ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, [r0] lsls r1, 16 ldr r0, [r2] orrs r0, r1 str r0, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08051E2C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk97_tryinfatuatetarget thumb_func_start sub_8051E48 sub_8051E48: ; 8051E48 push {r4-r7,lr} ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 bne @08051F34 ldr r5, =0x02024214 ldr r1, [r5] ldrb r0, [r1, 0x1] cmp r0, 0x4 beq @08051EA0 bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] ldr r3, =0x02024084 ldrb r1, [r4] movs r0, 0x58 adds r2, r1, 0 muls r2, r0 adds r0, r3, 0 adds r0, 0x4C adds r0, r2, r0 ldr r1, [r0] adds r3, 0x50 adds r2, r3 ldr r2, [r2] movs r0, 0 bl dp01_build_cmdbuf_x1A_aaaa_bbbb ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x2 str r0, [r5] b @08051F34 .align 2, 0 .pool @08051EA0: ldr r4, =0x02024064 ldr r5, =0x0202420b ldrb r0, [r5] strb r0, [r4] ldr r6, =0x02024210 ldrb r1, [r6] ldr r7, =gUnknown_0832A328 ldrb r2, [r4] lsls r0, r2, 2 adds r0, r7 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08051EDC ldr r3, =0x02024084 movs r0, 0x58 muls r2, r0 adds r0, r3, 0 adds r0, 0x4C adds r0, r2, r0 ldr r1, [r0] adds r3, 0x50 adds r2, r3 ldr r2, [r2] movs r0, 0 bl dp01_build_cmdbuf_x1A_aaaa_bbbb ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @08051EDC: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08051F2C ldrb r0, [r5] bl battle_get_per_side_status movs r1, 0x2 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state strb r0, [r4] ldrb r1, [r6] ldrb r2, [r4] lsls r0, r2, 2 adds r0, r7 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08051F2C ldr r3, =0x02024084 movs r0, 0x58 muls r2, r0 adds r0, r3, 0 adds r0, 0x4C adds r0, r2, r0 ldr r1, [r0] adds r3, 0x50 adds r2, r3 ldr r2, [r2] movs r0, 0 bl dp01_build_cmdbuf_x1A_aaaa_bbbb ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @08051F2C: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x2 str r0, [r1] @08051F34: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8051E48 thumb_func_start atk99_setmisteffect atk99_setmisteffect: ; 8051F58 push {r4-r6,lr} ldr r6, =0x02024294 ldr r4, =0x0202420b ldrb r0, [r4] bl battle_get_per_side_status movs r5, 0x1 adds r1, r5, 0 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x4] cmp r0, 0 beq @08051F98 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x20 orrs r0, r1 strb r0, [r2] ldr r0, =0x02024332 strb r5, [r0, 0x5] b @08051FE6 .align 2, 0 .pool @08051F98: ldrb r0, [r4] bl battle_get_per_side_status adds r1, r5, 0 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r6 movs r1, 0x5 strb r1, [r0, 0x4] ldrb r0, [r4] bl battle_get_per_side_status adds r1, r5, 0 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r1, [r4] strb r1, [r0, 0x5] ldrb r0, [r4] bl battle_get_per_side_status ldr r2, =0x0202428e adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r3, 0x80 lsls r3, 1 adds r0, r3, 0 movs r3, 0 orrs r0, r2 strh r0, [r1] ldr r0, =0x02024332 strb r3, [r0, 0x5] @08051FE6: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk99_setmisteffect thumb_func_start atk9A_setincreasedcriticalchance atk9A_setincreasedcriticalchance: ; 8052000 push {lr} ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r1, [r0] movs r3, 0x80 lsls r3, 13 adds r2, r1, 0 ands r2, r3 cmp r2, 0 beq @08052040 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x20 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] b @08052048 .align 2, 0 .pool @08052040: orrs r1, r3 str r1, [r0] ldr r0, =0x02024332 strb r2, [r0, 0x5] @08052048: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk9A_setincreasedcriticalchance thumb_func_start atk9B_transformdataexecution atk9B_transformdataexecution: ; 805205C push {r4-r7,lr} mov r7, r8 push {r7} ldr r1, =0x020241ec ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r7, =0x02024084 ldr r0, =0x0202420c mov r12, r0 ldrb r1, [r0] movs r6, 0x58 adds r0, r1, 0 muls r0, r6 adds r5, r7, 0 adds r5, 0x50 adds r0, r5 ldr r0, [r0] movs r4, 0x80 lsls r4, 14 ands r0, r4 cmp r0, 0 bne @080520A2 ldr r0, =0x020242ac lsls r1, 2 adds r1, r0 ldr r2, [r1] ldr r0, =0x000400c0 ands r2, r0 cmp r2, 0 beq @080520D8 @080520A2: ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x20 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0x1 b @080521EC .align 2, 0 .pool @080520D8: ldr r3, =0x0202420b ldrb r0, [r3] adds r1, r0, 0 muls r1, r6 adds r1, r5 ldr r0, [r1] orrs r0, r4 str r0, [r1] ldr r4, =0x020242bc ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r4 strh r2, [r0, 0x4] ldrb r0, [r3] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r4 ldrb r2, [r1, 0xB] movs r0, 0x10 negs r0, r0 ands r0, r2 strb r0, [r1, 0xB] ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r4 mov r2, r12 ldrb r1, [r2] muls r1, r6 adds r2, r7, 0 adds r2, 0x48 adds r1, r2 ldr r1, [r1] str r1, [r0] ldrb r0, [r3] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r4 ldrb r2, [r1, 0x18] movs r0, 0xF ands r0, r2 strb r0, [r1, 0x18] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x6 strb r0, [r1, 0x1] mov r2, r12 ldrb r0, [r2] muls r0, r6 adds r0, r7 ldrh r0, [r0] strb r0, [r1, 0x2] ldrb r0, [r2] muls r0, r6 adds r0, r7 ldrh r0, [r0] lsrs r0, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldrb r0, [r3] muls r0, r6 adds r5, r0, r7 ldrb r0, [r2] muls r0, r6 adds r2, r0, r7 movs r4, 0 adds r6, r3, 0 ldr r0, =0x02024064 mov r8, r0 @08052170: adds r0, r5, r4 adds r1, r2, r4 ldrb r1, [r1] strb r1, [r0] adds r4, 0x1 cmp r4, 0x23 bls @08052170 movs r4, 0 ldr r7, =gBattleMoves ldr r3, =0x02024090 adds r5, r3, 0 adds r5, 0x18 @08052188: lsls r1, r4, 1 ldrb r2, [r6] movs r0, 0x58 muls r2, r0 adds r1, r2 adds r1, r3 ldrh r1, [r1] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r7 ldrb r1, [r0, 0x4] cmp r1, 0x4 bhi @080521C4 adds r0, r4, r2 adds r0, r5 b @080521CA .align 2, 0 .pool @080521C4: adds r0, r4, r2 adds r0, r5 movs r1, 0x5 @080521CA: strb r1, [r0] adds r4, 0x1 cmp r4, 0x3 ble @08052188 ldrb r0, [r6] mov r1, r8 strb r0, [r1] movs r0, 0 movs r1, 0x2 bl dp01_build_cmdbuf_x38_a mov r2, r8 ldrb r0, [r2] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024332 movs r0, 0 @080521EC: strb r0, [r1, 0x5] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk9B_transformdataexecution thumb_func_start sub_80521FC sub_80521FC: ; 80521FC push {r4-r7,lr} ldr r7, =0x02024084 ldr r6, =0x0202420b ldrb r0, [r6] movs r5, 0x58 muls r0, r5 adds r3, r0, r7 ldrh r0, [r3, 0x2C] lsrs r1, r0, 2 adds r2, r1, 0 cmp r1, 0 bne @08052216 movs r2, 0x1 @08052216: ldrh r0, [r3, 0x28] cmp r0, r2 bhi @0805223C ldr r1, =0x020241f0 movs r0, 0 str r0, [r1] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] b @08052290 .align 2, 0 .pool @0805223C: ldr r4, =0x020241f0 str r1, [r4] cmp r1, 0 bne @08052248 movs r0, 0x1 str r0, [r4] @08052248: ldrb r0, [r6] adds r2, r0, 0 muls r2, r5 adds r3, r7, 0 adds r3, 0x50 adds r2, r3 ldr r0, [r2] movs r1, 0x80 lsls r1, 17 orrs r0, r1 str r0, [r2] ldrb r0, [r6] adds r1, r0, 0 muls r1, r5 adds r1, r3 ldr r0, [r1] ldr r2, =0xffff1fff ands r0, r2 str r0, [r1] ldr r2, =0x020242bc ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldr r1, [r4] movs r2, 0 strb r1, [r0, 0xA] ldr r0, =0x02024332 strb r2, [r0, 0x5] ldr r2, =0x02024280 ldr r0, [r2] movs r1, 0x80 lsls r1, 1 orrs r0, r1 str r0, [r2] @08052290: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80521FC thumb_func_start sub_80522B8 sub_80522B8: ; 80522B8 push {r4,r5,lr} lsls r0, 16 lsrs r2, r0, 16 movs r3, 0 ldr r0, =gUnknown_0831C3E0 ldrh r1, [r0] ldr r4, =0x0000fffe adds r5, r0, 0 cmp r1, r4 beq @080522E0 cmp r1, r2 beq @080522E0 adds r1, r5, 0 @080522D2: adds r1, 0x2 adds r3, 0x1 ldrh r0, [r1] cmp r0, r4 beq @080522E0 cmp r0, r2 bne @080522D2 @080522E0: lsls r0, r3, 1 adds r0, r5 ldrh r1, [r0] ldr r0, =0x0000fffe eors r1, r0 negs r0, r1 orrs r0, r1 lsrs r0, 31 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80522B8 thumb_func_start atk9D_copyattack atk9D_copyattack: ; 8052300 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x020241ec ldr r1, =0x0000ffff adds r7, r1, 0 strh r7, [r0] ldr r5, =0x02024248 ldr r6, =0x0202420c ldrb r0, [r6] lsls r0, 1 adds r0, r5 ldrh r0, [r0] bl sub_80522B8 lsls r0, 24 cmp r0, 0 bne @0805235A ldr r3, =0x02024084 ldr r2, =0x0202420b ldrb r1, [r2] movs r0, 0x58 adds r4, r1, 0 muls r4, r0 adds r0, r3, 0 adds r0, 0x50 adds r0, r4, r0 ldr r1, [r0] movs r0, 0x80 lsls r0, 14 ands r1, r0 mov r12, r3 mov r9, r2 cmp r1, 0 bne @0805235A ldrb r0, [r6] lsls r0, 1 adds r0, r5 ldrh r1, [r0] cmp r1, 0 beq @0805235A cmp r1, r7 bne @08052394 @0805235A: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @080524CC .align 2, 0 .pool @08052394: movs r2, 0 mov r3, r12 adds r3, 0xC adds r0, r4, r3 ldrh r0, [r0] ldr r4, =0x02024214 mov r10, r4 cmp r0, r1 beq @080523CE mov r8, r3 adds r7, r5, 0 adds r5, r6, 0 mov r4, r9 movs r3, 0x58 @080523B0: adds r2, 0x1 cmp r2, 0x3 bgt @080523CE lsls r1, r2, 1 ldrb r0, [r4] muls r0, r3 adds r1, r0 add r1, r8 ldrb r0, [r5] lsls r0, 1 adds r0, r7 ldrh r1, [r1] ldrh r0, [r0] cmp r1, r0 bne @080523B0 @080523CE: cmp r2, 0x4 bne @080524B0 ldr r5, =0x020241e8 ldrb r1, [r5] lsls r1, 1 mov r2, r9 ldrb r0, [r2] movs r6, 0x58 muls r0, r6 adds r1, r0 mov r0, r12 adds r0, 0xC adds r1, r0 ldr r2, =0x02024248 ldr r3, =0x0202420c ldrb r0, [r3] lsls r0, 1 adds r0, r2 ldrh r0, [r0] strh r0, [r1] ldr r4, =gBattleMoves ldrb r0, [r3] lsls r0, 1 adds r0, r2 ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r4, [r0, 0x4] cmp r4, 0x4 bhi @08052438 mov r1, r9 ldrb r0, [r1] muls r0, r6 ldrb r1, [r5] adds r0, r1 mov r1, r12 adds r1, 0x24 adds r0, r1 strb r4, [r0] b @0805244C .align 2, 0 .pool @08052438: mov r4, r9 ldrb r0, [r4] muls r0, r6 ldrb r1, [r5] adds r0, r1 mov r1, r12 adds r1, 0x24 adds r0, r1 movs r1, 0x5 strb r1, [r0] @0805244C: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] ldrb r0, [r3] lsls r0, 1 adds r0, r2 ldrh r0, [r0] strb r0, [r1, 0x2] ldrb r0, [r3] lsls r0, 1 adds r0, r2 ldrh r0, [r0] lsrs r0, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x020242bc mov r2, r9 ldrb r0, [r2] lsls r2, r0, 3 subs r2, r0 lsls r2, 2 adds r2, r1 ldrb r4, [r2, 0x18] lsrs r3, r4, 4 ldr r1, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, [r0] orrs r1, r3 lsls r1, 4 movs r0, 0xF ands r0, r4 orrs r0, r1 strb r0, [r2, 0x18] mov r4, r10 ldr r0, [r4] adds r0, 0x5 str r0, [r4] b @080524CC .align 2, 0 .pool @080524B0: mov r0, r10 ldr r2, [r0] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 mov r2, r10 str r1, [r2] @080524CC: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end atk9D_copyattack thumb_func_start sub_80524DC sub_80524DC: ; 80524DC push {r4-r7,lr} mov r7, r8 push {r7} ldr r7, =0x020241ea movs r6, 0xB1 lsls r6, 1 ldr r5, =gUnknown_0831C3E0 ldr r0, =0x02024214 mov r8, r0 @080524EE: bl GenerateRandomNumber ldr r2, =0x000001ff adds r1, r2, 0 ands r0, r1 adds r0, 0x1 strh r0, [r7] cmp r0, r6 bhi @080524EE movs r0, 0x3 @08052502: subs r0, 0x1 cmp r0, 0 bge @08052502 ldr r4, =0x020241ea ldrh r2, [r4] ldr r3, =0x0000ffff subs r0, r5, 0x2 @08052510: adds r0, 0x2 ldrh r1, [r0] cmp r1, r2 beq @0805251C cmp r1, r3 bne @08052510 @0805251C: ldr r0, =0x0000ffff cmp r1, r0 bne @080524EE ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xfffffbff ands r0, r1 str r0, [r2] ldr r3, =gUnknown_082D86A8 ldr r2, =gBattleMoves ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] mov r1, r8 str r0, [r1] ldrh r0, [r4] movs r1, 0 bl sub_80458E0 ldr r1, =0x0202420c strb r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80524DC thumb_func_start atk9F_nightshadedamageeffect atk9F_nightshadedamageeffect: ; 8052584 ldr r3, =0x020241f0 ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x2A ldrb r0, [r0] str r0, [r3] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end atk9F_nightshadedamageeffect thumb_func_start atkA0_psywavedamageeffect atkA0_psywavedamageeffect: ; 80525B4 push {r4,lr} movs r4, 0xF @080525B8: bl GenerateRandomNumber adds r3, r4, 0 ands r3, r0 cmp r3, 0xA bgt @080525B8 lsls r0, r3, 2 adds r0, r3 lsls r3, r0, 1 ldr r4, =0x020241f0 ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x2A ldrb r1, [r0] adds r0, r3, 0 adds r0, 0x32 muls r0, r1 movs r1, 0x64 bl __divsi3 str r0, [r4] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkA0_psywavedamageeffect thumb_func_start atkA1_counterdamagecalculator atkA1_counterdamagecalculator: ; 8052608 push {r4-r6,lr} ldr r4, =0x0202420b ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r6, r0, 24 ldr r5, =0x0202433c ldrb r0, [r4] lsls r0, 4 adds r0, r5 ldrb r0, [r0, 0xC] bl battle_side_get_owner lsls r0, 24 lsrs r2, r0, 24 ldrb r0, [r4] lsls r1, r0, 4 adds r0, r5, 0x4 adds r0, r1, r0 ldr r3, [r0] cmp r3, 0 beq @080526BC cmp r6, r2 beq @080526BC ldr r6, =0x02024084 adds r0, r1, r5 ldrb r0, [r0, 0xC] movs r4, 0x58 muls r0, r4 adds r0, r6 ldrh r0, [r0, 0x28] cmp r0, 0 beq @080526BC ldr r1, =0x020241f0 lsls r0, r3, 1 str r0, [r1] ldr r1, =0x02024294 lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r1, r0, r1 ldrb r0, [r1, 0x8] cmp r0, 0 beq @08052690 ldrb r1, [r1, 0x9] adds r0, r1, 0 muls r0, r4 adds r0, r6 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08052690 ldr r0, =0x0202420c strb r1, [r0] b @080526A0 .align 2, 0 .pool @08052690: ldr r2, =0x0202420c ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0, 0xC] strb r0, [r2] @080526A0: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @080526EC .align 2, 0 .pool @080526BC: ldr r2, =0x0202437c ldr r0, =0x0202420b ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x20 orrs r1, r2 strb r1, [r0] ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @080526EC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkA1_counterdamagecalculator thumb_func_start atkA2_mirrorcoatdamagecalculator atkA2_mirrorcoatdamagecalculator: ; 8052700 push {r4-r6,lr} ldr r4, =0x0202420b ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r6, r0, 24 ldr r5, =0x0202433c ldrb r0, [r4] lsls r0, 4 adds r0, r5 ldrb r0, [r0, 0xD] bl battle_side_get_owner lsls r0, 24 lsrs r2, r0, 24 ldrb r0, [r4] lsls r1, r0, 4 adds r0, r5, 0 adds r0, 0x8 adds r0, r1, r0 ldr r3, [r0] cmp r3, 0 beq @080527B4 cmp r6, r2 beq @080527B4 ldr r6, =0x02024084 adds r0, r1, r5 ldrb r0, [r0, 0xD] movs r4, 0x58 muls r0, r4 adds r0, r6 ldrh r0, [r0, 0x28] cmp r0, 0 beq @080527B4 ldr r1, =0x020241f0 lsls r0, r3, 1 str r0, [r1] ldr r1, =0x02024294 lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r1, r0, r1 ldrb r0, [r1, 0x8] cmp r0, 0 beq @08052788 ldrb r1, [r1, 0x9] adds r0, r1, 0 muls r0, r4 adds r0, r6 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08052788 ldr r0, =0x0202420c strb r1, [r0] b @08052798 .align 2, 0 .pool @08052788: ldr r2, =0x0202420c ldr r1, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 4 adds r0, r1 ldrb r0, [r0, 0xD] strb r0, [r2] @08052798: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @080527E4 .align 2, 0 .pool @080527B4: ldr r2, =0x0202437c ldr r0, =0x0202420b ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x20 orrs r1, r2 strb r1, [r0] ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @080527E4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkA2_mirrorcoatdamagecalculator thumb_func_start atkA3_disablelastusedattack atkA3_disablelastusedattack: ; 80527F8 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r4, 0 ldr r2, =0x02024084 ldr r3, =0x0202420c ldrb r1, [r3] movs r0, 0x58 muls r0, r1 adds r7, r2, 0 adds r7, 0xC adds r0, r7 ldr r5, =0x02024248 lsls r1, 1 adds r1, r5 ldrh r0, [r0] mov r9, r2 adds r6, r3, 0 ldr r2, =0x020242bc mov r8, r2 ldrh r1, [r1] cmp r0, r1 beq @0805284C mov r12, r6 movs r3, 0x58 @0805282C: adds r4, 0x1 cmp r4, 0x3 bgt @0805284C lsls r2, r4, 1 mov r0, r12 ldrb r1, [r0] adds r0, r1, 0 muls r0, r3 adds r2, r0 adds r2, r7 lsls r1, 1 adds r1, r5 ldrh r0, [r2] ldrh r1, [r1] cmp r0, r1 bne @0805282C @0805284C: ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r8 ldrh r0, [r0, 0x4] cmp r0, 0 bne @08052910 cmp r4, 0x4 beq @08052910 movs r5, 0x58 adds r0, r1, 0 muls r0, r5 adds r0, r4, r0 mov r1, r9 adds r1, 0x24 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @08052910 ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] lsls r2, r4, 1 ldrb r0, [r6] muls r0, r5 adds r0, r2, r0 mov r3, r9 adds r3, 0xC adds r0, r3 ldrh r0, [r0] strb r0, [r1, 0x2] ldrb r0, [r6] muls r0, r5 adds r0, r2, r0 adds r0, r3 ldrh r0, [r0] lsrs r0, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r8 muls r1, r5 adds r2, r1 adds r2, r3 ldrh r1, [r2] strh r1, [r0, 0x4] bl GenerateRandomNumber ldrb r2, [r6] lsls r1, r2, 3 subs r1, r2 lsls r1, 2 add r1, r8 movs r2, 0x3 ands r2, r0 adds r2, 0x2 ldrb r3, [r1, 0xB] movs r0, 0x10 negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1, 0xB] ldrb r0, [r6] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 add r1, r8 ldrb r3, [r1, 0xB] lsls r2, r3, 28 lsrs r2, 24 movs r0, 0xF ands r0, r3 orrs r0, r2 strb r0, [r1, 0xB] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @0805292A .align 2, 0 .pool @08052910: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @0805292A: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkA3_disablelastusedattack thumb_func_start atkA4_setencore atkA4_setencore: ; 805293C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r5, 0 ldr r3, =0x02024084 ldr r4, =0x0202420c ldrb r1, [r4] movs r0, 0x58 muls r0, r1 adds r6, r3, 0 adds r6, 0xC adds r0, r6 ldr r2, =0x02024248 lsls r1, 1 adds r1, r2 ldrh r0, [r0] mov r10, r3 mov r8, r2 ldr r2, =0x020242bc mov r9, r2 ldrh r1, [r1] cmp r0, r1 beq @08052996 mov r12, r4 adds r7, r6, 0 mov r6, r8 movs r3, 0x58 @08052976: adds r5, 0x1 cmp r5, 0x3 bgt @08052996 lsls r2, r5, 1 mov r0, r12 ldrb r1, [r0] adds r0, r1, 0 muls r0, r3 adds r2, r0 adds r2, r7 lsls r1, 1 adds r1, r6 ldrh r0, [r2] ldrh r1, [r1] cmp r0, r1 bne @08052976 @08052996: ldrb r0, [r4] lsls r0, 1 add r0, r8 ldrh r2, [r0] cmp r2, 0xA5 beq @080529AA cmp r2, 0xE3 beq @080529AA cmp r2, 0x77 bne @080529AC @080529AA: movs r5, 0x4 @080529AC: ldrb r1, [r4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 mov r2, r9 adds r3, r0, r2 ldrh r0, [r3, 0x6] cmp r0, 0 bne @08052A44 cmp r5, 0x4 beq @08052A44 movs r0, 0x58 adds r2, r1, 0 muls r2, r0 adds r0, r5, r2 mov r1, r10 adds r1, 0x24 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @08052A44 lsls r0, r5, 1 adds r0, r2 subs r1, 0x18 adds r0, r1 ldrh r0, [r0] strh r0, [r3, 0x6] ldrb r1, [r4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r9 strb r5, [r0, 0xC] bl GenerateRandomNumber ldrb r2, [r4] lsls r1, r2, 3 subs r1, r2 lsls r1, 2 add r1, r9 movs r2, 0x3 ands r2, r0 adds r2, 0x3 ldrb r3, [r1, 0xE] movs r0, 0x10 negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1, 0xE] ldrb r0, [r4] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 add r1, r9 ldrb r3, [r1, 0xE] lsls r2, r3, 28 lsrs r2, 24 movs r0, 0xF ands r0, r3 orrs r0, r2 strb r0, [r1, 0xE] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08052A5E .align 2, 0 .pool @08052A44: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08052A5E: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkA4_setencore thumb_func_start sub_8052A70 sub_8052A70: ; 8052A70 push {r4-r7,lr} ldr r6, =0x02024084 ldr r0, =0x0202420c mov r12, r0 ldrb r0, [r0] movs r7, 0x58 adds r2, r0, 0 muls r2, r7 adds r0, r6, 0 adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne @08052B10 ldr r5, =0x0202420b ldrb r0, [r5] muls r0, r7 adds r0, r6 ldrh r3, [r0, 0x28] adds r0, r2, r6 ldrh r1, [r0, 0x28] adds r3, r1 asrs r3, 1 ldr r4, =0x020241f0 subs r1, r3 str r1, [r4] ldr r2, =0x02024474 strb r1, [r2] movs r0, 0xFF lsls r0, 8 ands r0, r1 asrs r0, 8 strb r0, [r2, 0x1] movs r0, 0xFF lsls r0, 16 ands r0, r1 asrs r0, 16 strb r0, [r2, 0x2] lsrs r1, 24 strb r1, [r2, 0x3] ldrb r0, [r5] muls r0, r7 adds r0, r6 ldrh r0, [r0, 0x28] subs r0, r3 str r0, [r4] ldr r2, =0x0202437c mov r0, r12 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r2, 0x4 adds r0, r2 ldr r1, =0x0000ffff str r1, [r0] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08052B2A .align 2, 0 .pool @08052B10: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08052B2A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8052A70 thumb_func_start atkA6_settypetorandomresistance atkA6_settypetorandomresistance: ; 8052B34 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r1, =0x02024250 ldr r4, =0x0202420b ldrb r0, [r4] lsls r0, 1 adds r2, r0, r1 ldrh r1, [r2] cmp r1, 0 beq @08052B7E ldr r0, =0x0000ffff cmp r1, r0 beq @08052B7E ldrh r0, [r2] bl sub_8052F48 lsls r0, 24 cmp r0, 0 beq @08052C1C ldr r1, =0x02024084 ldr r2, =0x02024270 ldrb r0, [r4] adds r0, r2 ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 5 ands r0, r1 cmp r0, 0 beq @08052C1C @08052B7E: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @08052D08 .align 2, 0 .pool @08052BB4: mov r0, r12 strb r5, [r0] mov r1, r10 ldrb r0, [r1] muls r0, r2 adds r0, r7 adds r0, 0x22 strb r5, [r0] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x3 strb r0, [r1, 0x1] strb r5, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r1, =0x02024214 b @08052C0A .align 2, 0 .pool @08052BE0: mov r0, r8 adds r0, 0x1 adds r0, r3 ldrb r2, [r0] strb r2, [r4] mov r4, r10 ldrb r0, [r4] muls r0, r6 ldr r7, =0x02024084 adds r0, r7 adds r0, 0x22 strb r2, [r0] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x3 strb r0, [r1, 0x1] strb r2, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] mov r1, r12 @08052C0A: ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08052D08 .align 2, 0 .pool @08052C1C: movs r4, 0 mov r8, r4 movs r7, 0x7F mov r9, r7 @08052C24: bl GenerateRandomNumber mov r4, r9 ands r4, r0 cmp r4, 0x70 bhi @08052C24 lsls r0, r4, 1 adds r4, r0, r4 ldr r6, =gUnknown_0831ACE8 adds r3, r4, r6 ldr r1, =0x02024258 ldr r2, =0x0202420b ldrb r5, [r2] lsls r0, r5, 1 adds r0, r1 ldrb r1, [r3] mov r10, r2 ldrh r0, [r0] cmp r1, r0 bne @08052C80 adds r0, r4, 0x2 adds r0, r6 ldrb r0, [r0] cmp r0, 0x5 bhi @08052C80 ldr r7, =0x02024084 movs r2, 0x58 adds r0, r5, 0 muls r0, r2 adds r3, r0, r7 movs r0, 0x21 adds r0, r3 mov r12, r0 adds r0, r4, 0x1 adds r0, r6 ldrb r5, [r0] mov r1, r12 ldrb r0, [r1] adds r1, r5, 0 cmp r0, r1 beq @08052C80 adds r0, r3, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, r1 bne @08052BB4 @08052C80: movs r7, 0x1 add r8, r7 ldr r0, =0x000003e7 cmp r8, r0 ble @08052C24 movs r0, 0 mov r8, r0 ldr r1, =0x02024214 mov r12, r1 ldr r3, =gUnknown_0831ACE8 adds r0, r4, 0x1 adds r0, r3 mov r9, r0 adds r5, r3, 0 @08052C9C: ldrb r1, [r5] cmp r1, 0xFF bgt @08052CA6 cmp r1, 0xFE bge @08052CE0 @08052CA6: mov r4, r10 ldrb r2, [r4] lsls r0, r2, 1 ldr r7, =0x02024258 adds r0, r7 ldrh r0, [r0] cmp r1, r0 bne @08052CE0 ldrb r0, [r5, 0x2] cmp r0, 0x5 bhi @08052CE0 movs r6, 0x58 adds r0, r2, 0 muls r0, r6 ldr r1, =0x02024084 adds r2, r0, r1 adds r4, r2, 0 adds r4, 0x21 ldrb r0, [r4] mov r7, r9 ldrb r1, [r7] cmp r0, r1 beq @08052CE0 adds r0, r2, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, r1 beq @08052CE0 b @08052BE0 @08052CE0: adds r5, 0x3 movs r0, 0x3 add r8, r0 ldr r0, =0x0000014f cmp r8, r0 bls @08052C9C mov r1, r12 ldr r2, [r1] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 mov r4, r12 str r1, [r4] @08052D08: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkA6_settypetorandomresistance thumb_func_start atkA7_setalwayshitflag atkA7_setalwayshitflag: ; 8052D34 push {r4,lr} ldr r4, =0x020242ac ldr r3, =0x0202420c ldrb r1, [r3] lsls r1, 2 adds r1, r4 ldr r0, [r1] movs r2, 0x19 negs r2, r2 ands r0, r2 str r0, [r1] ldrb r1, [r3] lsls r1, 2 adds r1, r4 ldr r0, [r1] movs r2, 0x10 orrs r0, r2 str r0, [r1] ldr r2, =0x020242bc ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0202420b ldrb r1, [r1] strb r1, [r0, 0x15] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkA7_setalwayshitflag thumb_func_start atkA8_copymovepermanently atkA8_copymovepermanently: ; 8052D8C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x14 ldr r0, =0x020241ec ldr r1, =0x0000ffff adds r5, r1, 0 strh r5, [r0] ldr r3, =0x02024084 ldr r2, =0x0202420b ldrb r1, [r2] movs r0, 0x58 adds r4, r1, 0 muls r4, r0 adds r0, r3, 0 adds r0, 0x50 adds r0, r4, r0 ldr r1, [r0] movs r0, 0x80 lsls r0, 14 ands r1, r0 mov r12, r3 mov r10, r2 cmp r1, 0 beq @08052DC4 b @08052F18 @08052DC4: ldr r0, =0x02024240 ldr r2, =0x0202420c ldrb r1, [r2] lsls r1, 1 adds r1, r0 ldrh r1, [r1] mov r9, r0 mov r8, r2 cmp r1, 0xA5 bne @08052DDA b @08052F18 @08052DDA: cmp r1, 0 bne @08052DE0 b @08052F18 @08052DE0: cmp r1, r5 bne @08052DE6 b @08052F18 @08052DE6: cmp r1, 0xA6 bne @08052DEC b @08052F18 @08052DEC: movs r7, 0 mov r5, r9 mov r0, r12 adds r0, 0xC adds r1, r4, r0 mov r3, r8 @08052DF8: ldrh r2, [r1] cmp r2, 0xA6 beq @08052E0A ldrb r0, [r3] lsls r0, 1 adds r0, r5 ldrh r0, [r0] cmp r2, r0 beq @08052E12 @08052E0A: adds r1, 0x2 adds r7, 0x1 cmp r7, 0x3 ble @08052DF8 @08052E12: cmp r7, 0x4 beq @08052E18 b @08052F18 @08052E18: ldr r4, =0x020241e8 ldrb r1, [r4] lsls r1, 1 mov r2, r10 ldrb r0, [r2] movs r3, 0x58 muls r0, r3 adds r1, r0 mov r6, r12 adds r6, 0xC adds r1, r6 mov r2, r8 ldrb r0, [r2] lsls r0, 1 add r0, r9 ldrh r0, [r0] strh r0, [r1] mov r1, r10 ldrb r0, [r1] adds r2, r0, 0 muls r2, r3 ldrb r4, [r4] adds r2, r4 mov r5, r12 adds r5, 0x24 adds r2, r5 ldr r4, =gBattleMoves mov r1, r8 ldrb r0, [r1] lsls r0, 1 add r0, r9 ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r0, [r0, 0x4] strb r0, [r2] ldr r1, =0x02024064 mov r2, r10 ldrb r0, [r2] strb r0, [r1] movs r7, 0 ldrb r0, [r2] muls r0, r3 adds r4, r0, r5 adds r3, r0, 0 add r2, sp, 0x4 add r5, sp, 0xC @08052E7A: adds r0, r3, r6 ldrh r0, [r0] strh r0, [r2] adds r1, r5, r7 ldrb r0, [r4] strb r0, [r1] adds r4, 0x1 adds r3, 0x2 adds r2, 0x2 adds r7, 0x1 cmp r7, 0x3 ble @08052E7A add r2, sp, 0x4 mov r0, r10 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 add r0, r12 adds r0, 0x3B ldrb r0, [r0] strb r0, [r2, 0xC] str r2, [sp] movs r0, 0 movs r1, 0x3 movs r2, 0 movs r3, 0x10 bl dp01_build_cmdbuf_x02_a_b_varargs ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] ldr r3, =0x02024240 ldr r2, =0x0202420c ldrb r0, [r2] lsls r0, 1 adds r0, r3 ldrh r0, [r0] strb r0, [r1, 0x2] ldrb r0, [r2] lsls r0, 1 adds r0, r3 ldrh r0, [r0] lsrs r0, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08052F32 .align 2, 0 .pool @08052F18: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08052F32: add sp, 0x14 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkA8_copymovepermanently thumb_func_start sub_8052F48 sub_8052F48: ; 8052F48 push {lr} lsls r0, 16 lsrs r0, 16 ldr r2, =gBattleMoves lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1] cmp r0, 0x91 beq @08052F72 cmp r0, 0x27 beq @08052F72 cmp r0, 0x4B beq @08052F72 cmp r0, 0x97 beq @08052F72 cmp r0, 0x9B beq @08052F72 cmp r0, 0x1A bne @08052F7C @08052F72: movs r0, 0x1 b @08052F7E .align 2, 0 .pool @08052F7C: movs r0, 0 @08052F7E: pop {r1} bx r1 thumb_func_end sub_8052F48 thumb_func_start sub_8052F84 sub_8052F84: ; 8052F84 push {lr} lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @08052FA2 cmp r1, 0xD6 beq @08052FA2 movs r0, 0x89 lsls r0, 1 cmp r1, r0 beq @08052FA2 cmp r1, 0x77 beq @08052FA2 cmp r1, 0x76 bne @08052FA6 @08052FA2: movs r0, 0x1 b @08052FA8 @08052FA6: movs r0, 0 @08052FA8: pop {r1} bx r1 thumb_func_end sub_8052F84 thumb_func_start move_weather_interaction move_weather_interaction: ; 8052FAC push {lr} lsls r1, 16 lsrs r2, r1, 16 ldr r1, =gBattleMoves lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r0, [r0] adds r3, r1, 0 cmp r0, 0x97 bne @08052FD0 ldr r0, =0x020243cc ldrh r1, [r0] movs r0, 0x60 ands r0, r1 cmp r0, 0 bne @08053010 @08052FD0: lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r3 ldrb r0, [r0] cmp r0, 0x91 beq @08052FF2 cmp r0, 0x27 beq @08052FF2 cmp r0, 0x4B beq @08052FF2 cmp r0, 0x97 beq @08052FF2 cmp r0, 0x9B beq @08052FF2 cmp r0, 0x1A bne @08053010 @08052FF2: ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 20 ands r0, r1 cmp r0, 0 beq @08053010 movs r0, 0x1 b @08053012 .align 2, 0 .pool @08053010: movs r0, 0x2 @08053012: pop {r1} bx r1 thumb_func_end move_weather_interaction thumb_func_start sub_8053018 sub_8053018: ; 8053018 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r6, 0 movs r5, 0 ldr r0, =0x0202420b mov r9, r0 movs r1, 0x58 mov r8, r1 ldr r7, =0x02024090 movs r0, 0x84 lsls r0, 1 mov r10, r0 @08053036: lsls r4, r5, 1 mov r1, r9 ldrb r0, [r1] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r4, r0 adds r0, r7 ldrh r0, [r0] bl sub_8052F84 lsls r0, 24 cmp r0, 0 bne @08053076 mov r1, r9 ldrb r0, [r1] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r4, r0 adds r0, r7 ldrh r1, [r0] cmp r1, r10 beq @08053076 cmp r1, 0xFD beq @08053076 adds r0, r1, 0 bl sub_8052F48 lsls r0, 24 cmp r0, 0 beq @08053084 @08053076: ldr r1, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r1 ldr r0, [r0] orrs r6, r0 lsls r0, r6, 24 lsrs r6, r0, 24 @08053084: adds r5, 0x1 cmp r5, 0x3 ble @08053036 ldr r0, =0x0202420b ldrb r0, [r0] adds r1, r6, 0 movs r2, 0xFD bl sub_803FECC lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0xF bne @080530B8 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @0805311C .align 2, 0 .pool @080530B8: movs r7, 0x3 ldr r4, =gUnknown_0832A328 @080530BC: bl GenerateRandomNumber adds r5, r7, 0 ands r5, r0 lsls r0, r5, 2 adds r0, r4 ldr r0, [r0] ands r0, r6 cmp r0, 0 bne @080530BC ldr r4, =0x020241ee ldr r2, =0x02024084 lsls r1, r5, 1 ldr r0, =0x0202420b ldrb r3, [r0] movs r0, 0x58 muls r0, r3 adds r1, r0 adds r2, 0xC adds r1, r2 ldrh r0, [r1] strh r0, [r4] ldr r0, =0x020241e8 strb r5, [r0] ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xfffffbff ands r0, r1 str r0, [r2] ldrh r0, [r4] movs r1, 0 bl sub_80458E0 ldr r1, =0x0202420c strb r0, [r1] ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @0805311C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8053018 thumb_func_start atkAA_destinybondeffect atkAA_destinybondeffect: ; 8053150 ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r2, r0 adds r1, 0x50 adds r2, r1 ldr r0, [r2] movs r1, 0x80 lsls r1, 18 orrs r0, r1 str r0, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end atkAA_destinybondeffect thumb_func_start b_feature_update_destiny_bond b_feature_update_destiny_bond: ; 8053180 push {r4,r5,lr} ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 ldr r4, =0x0202420c ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r3, r0, 24 ldr r1, =0x02024084 ldrb r2, [r4] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @080531CA cmp r5, r3 beq @080531CA ldr r2, =0x02024280 ldr r1, [r2] movs r0, 0x80 lsls r0, 17 ands r0, r1 cmp r0, 0 bne @080531CA movs r0, 0x40 orrs r1, r0 str r1, [r2] @080531CA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end b_feature_update_destiny_bond thumb_func_start atkAB_802A458 atkAB_802A458: ; 80531E0 push {lr} bl b_feature_update_destiny_bond ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkAB_802A458 thumb_func_start atkAC_remaininghptopower atkAC_remaininghptopower: ; 80531F8 push {lr} ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r1, r0 adds r1, r2 movs r2, 0x28 ldrsh r0, [r1, r2] movs r2, 0x2C ldrsh r1, [r1, r2] movs r2, 0x30 bl sub_8075034 lsls r0, 24 lsrs r1, r0, 24 movs r3, 0 ldr r0, =gUnknown_0831C408 ldrb r2, [r0] cmp r1, r2 ble @08053232 adds r2, r0, 0 @08053224: adds r3, 0x2 cmp r3, 0xB bgt @08053232 adds r0, r3, r2 ldrb r0, [r0] cmp r1, r0 bgt @08053224 @08053232: ldr r2, =0x02024400 ldr r1, =gUnknown_0831C408 adds r0, r3, 0x1 adds r0, r1 ldrb r0, [r0] strh r0, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkAC_remaininghptopower thumb_func_start atkAD_reducepprandom atkAD_reducepprandom: ; 8053260 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 ldr r4, =0x02024248 ldr r1, =0x0202420c ldrb r3, [r1] lsls r0, r3, 1 adds r0, r4 ldrh r2, [r0] mov r8, r1 cmp r2, 0 bne @08053280 b @08053408 @08053280: ldr r0, =0x0000ffff cmp r2, r0 bne @08053288 b @08053408 @08053288: movs r7, 0 ldr r0, =0x02024084 movs r1, 0x58 muls r1, r3 adds r3, r0, 0 adds r3, 0xC adds r1, r3 ldrh r1, [r1] cmp r2, r1 beq @080532C0 adds r6, r4, 0 mov r5, r8 adds r4, r3, 0 movs r3, 0x58 @080532A4: adds r7, 0x1 cmp r7, 0x3 bgt @080532C0 ldrb r0, [r5] lsls r2, r0, 1 adds r2, r6 lsls r1, r7, 1 muls r0, r3 adds r1, r0 adds r1, r4 ldrh r0, [r2] ldrh r1, [r1] cmp r0, r1 bne @080532A4 @080532C0: cmp r7, 0x4 bne @080532C6 b @08053408 @080532C6: mov r4, r8 ldrb r0, [r4] movs r1, 0x58 mov r9, r1 mov r3, r9 muls r3, r0 adds r0, r3, 0 adds r0, r7, r0 ldr r1, =0x02024084 adds r1, 0x24 mov r10, r1 add r0, r10 ldrb r0, [r0] cmp r0, 0x1 bhi @080532E6 b @08053408 @080532E6: bl GenerateRandomNumber movs r1, 0x3 ands r1, r0 adds r6, r1, 0x2 ldrb r0, [r4] mov r3, r9 muls r3, r0 adds r0, r3, 0 adds r0, r7, r0 add r0, r10 ldrb r0, [r0] cmp r0, r6 bge @08053304 adds r6, r0, 0 @08053304: ldr r1, =0x02022f58 movs r5, 0xFD strb r5, [r1] movs r0, 0x2 strb r0, [r1, 0x1] ldr r2, =0x02024248 mov r3, r8 ldrb r0, [r3] lsls r0, 1 adds r0, r2 ldrh r0, [r0] strb r0, [r1, 0x2] ldrb r0, [r3] lsls r0, 1 adds r0, r2 ldrh r0, [r0] lsrs r0, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r4, =0x02022f68 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0 movs r3, 0x1 bl 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, =0x02024064 mov r3, r8 ldrb r0, [r3] strb r0, [r4] ldr r1, =0x020242bc ldrb r3, [r4] lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 lsls r0, r7, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @080533B8 mov r2, r9 muls r2, r3 ldr r0, =0x02024084 adds r0, 0x50 adds r0, r2, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @080533B8 adds r1, r7, 0 adds r1, 0x9 lsls r1, 24 lsrs r1, 24 mov r3, r10 adds r0, r2, r3 adds r0, r7 str r0, [sp] movs r0, 0 movs r2, 0 movs r3, 0x1 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @080533B8: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] ldr r1, =0x02024084 ldr r0, =0x0202420c ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r0, r7, r0 adds r1, 0x24 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @08053422 adds r0, r2, 0 bl b_cancel_multi_turn_move_maybe b @08053422 .align 2, 0 .pool @08053408: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08053422: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkAD_reducepprandom thumb_func_start atkAE_clearstatusifnotsoundproofed atkAE_clearstatusifnotsoundproofed: ; 8053438 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 movs r4, 0 str r4, [sp, 0x4] mov r8, r4 ldr r0, =0x020241ea ldrh r0, [r0] cmp r0, 0xD7 beq @08053454 b @0805363E @08053454: ldr r6, =0x02024332 mov r0, r8 strb r0, [r6, 0x5] ldr r5, =0x0202420b ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r10, r1 cmp r0, 0 bne @08053470 ldr r2, =0x020244ec mov r10, r2 @08053470: ldr r4, =0x02024084 ldrb r3, [r5] movs r7, 0x58 adds r2, r3, 0 muls r2, r7 adds r0, r2, r4 adds r1, r0, 0 adds r1, 0x20 ldrb r0, [r1] cmp r0, 0x2B beq @080534C4 adds r0, r4, 0 adds r0, 0x4C adds r0, r2, r0 mov r1, r8 str r1, [r0] ldrb r0, [r5] adds r2, r0, 0 muls r2, r7 adds r0, r4, 0 adds r0, 0x50 adds r2, r0 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] b @080534D4 .align 2, 0 .pool @080534C4: ldrb r1, [r1] adds r0, r3, 0 bl b_history__record_ability_usage_of_player ldrb r0, [r6, 0x5] movs r1, 0x1 orrs r0, r1 strb r0, [r6, 0x5] @080534D4: ldr r7, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] bl battle_get_per_side_status movs r2, 0x2 mov r9, r2 mov r1, r9 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r1, =0x02024474 strb r0, [r1, 0x17] strb r0, [r7] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0805357A ldr r0, =0x02024210 ldrb r2, [r0] ldr r1, =gUnknown_0832A328 ldrb r3, [r7] lsls r0, r3, 2 adds r0, r1 ldr r0, [r0] ands r2, r0 cmp r2, 0 bne @0805357A ldr r5, =0x02024084 movs r6, 0x58 adds r4, r3, 0 muls r4, r6 adds r0, r4, r5 adds r1, r0, 0 adds r1, 0x20 ldrb r0, [r1] cmp r0, 0x2B beq @08053568 adds r0, r5, 0 adds r0, 0x4C adds r0, r4, r0 str r2, [r0] ldrb r0, [r7] adds r2, r0, 0 muls r2, r6 adds r0, r5, 0 adds r0, 0x50 adds r2, r0 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] b @0805357A .align 2, 0 .pool @08053568: ldrb r1, [r1] adds r0, r3, 0 bl b_history__record_ability_usage_of_player ldr r1, =0x02024332 ldrb r0, [r1, 0x5] mov r2, r9 orrs r0, r2 strb r0, [r1, 0x5] @0805357A: movs r6, 0 ldr r7, =0x02024084 @0805357E: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 add r4, r10 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr lsls r0, 24 lsrs r4, r0, 24 cmp r5, 0 beq @08053636 movs r0, 0xCE lsls r0, 1 cmp r5, r0 beq @08053636 ldr r2, =0x0202406e ldr r0, =0x0202420b ldrb r1, [r0] lsls r0, r1, 1 adds r0, r2 ldrh r0, [r0] cmp r0, r6 bne @080535D0 movs r0, 0x58 muls r0, r1 b @08053600 .align 2, 0 .pool @080535D0: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08053618 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 1 adds r0, r2 ldrh r0, [r0] cmp r0, r6 bne @08053618 ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08053618 movs r0, 0x58 muls r0, r3 @08053600: adds r0, r7 adds r0, 0x20 ldrb r0, [r0] b @08053624 .align 2, 0 .pool @08053618: adds r0, r5, 0 adds r1, r4, 0 bl sub_806B694 lsls r0, 24 lsrs r0, 24 @08053624: cmp r0, 0x2B beq @08053636 movs r0, 0x1 lsls r0, r6 mov r1, r8 orrs r1, r0 lsls r0, r1, 24 lsrs r0, 24 mov r8, r0 @08053636: adds r6, 0x1 cmp r6, 0x5 ble @0805357E b @080536BC @0805363E: ldr r1, =0x02024332 movs r0, 0x4 strb r0, [r1, 0x5] movs r2, 0x3F mov r8, r2 ldr r3, =0x02024084 ldr r2, =0x0202420b ldrb r0, [r2] movs r5, 0x58 muls r0, r5 movs r1, 0x4C adds r1, r3 mov r9, r1 add r0, r9 str r4, [r0] ldrb r0, [r2] adds r1, r0, 0 muls r1, r5 adds r7, r3, 0 adds r7, 0x50 adds r1, r7 ldr r0, [r1] ldr r6, =0xf7ffffff ands r0, r6 str r0, [r1] ldrb r0, [r2] bl battle_get_per_side_status movs r1, 0x2 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r4, =0x02024064 strb r0, [r4] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @080536BC ldr r0, =0x02024210 ldrb r2, [r0] ldr r1, =gUnknown_0832A328 ldrb r3, [r4] lsls r0, r3, 2 adds r0, r1 ldr r0, [r0] ands r2, r0 cmp r2, 0 bne @080536BC adds r0, r3, 0 muls r0, r5 add r0, r9 str r2, [r0] ldrb r0, [r4] adds r1, r0, 0 muls r1, r5 adds r1, r7 ldr r0, [r1] ands r0, r6 str r0, [r1] @080536BC: mov r2, r8 cmp r2, 0 beq @080536DE ldr r4, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r4] add r0, sp, 0x4 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @080536DE: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkAE_clearstatusifnotsoundproofed thumb_func_start atkAF_cursetarget atkAF_cursetarget: ; 805371C push {r4,r5,lr} ldr r5, =0x02024084 ldr r0, =0x0202420c ldrb r0, [r0] movs r4, 0x58 adds r1, r0, 0 muls r1, r4 adds r0, r5, 0 adds r0, 0x50 adds r1, r0 ldr r2, [r1] movs r3, 0x80 lsls r3, 21 adds r0, r2, 0 ands r0, r3 cmp r0, 0 beq @08053768 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @0805378C .align 2, 0 .pool @08053768: orrs r2, r3 str r2, [r1] ldr r1, =0x020241f0 ldr r0, =0x0202420b ldrb r0, [r0] muls r0, r4 adds r0, r5 ldrh r0, [r0, 0x2C] lsrs r0, 1 str r0, [r1] cmp r0, 0 bne @08053784 movs r0, 0x1 str r0, [r1] @08053784: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0805378C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkAF_cursetarget thumb_func_start atkB0_setspikes atkB0_setspikes: ; 80537A0 push {r4,lr} ldr r4, =0x0202420b ldrb r0, [r4] bl battle_side_get_owner movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02024294 lsls r2, r0, 1 adds r0, r2, r0 lsls r0, 2 adds r3, r0, r1 ldrb r0, [r3, 0xA] cmp r0, 0x3 bne @08053804 ldr r2, =0x0202437c ldrb r1, [r4] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x20 orrs r1, r2 strb r1, [r0] ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @0805381E .align 2, 0 .pool @08053804: ldr r1, =0x0202428e adds r1, r2, r1 ldrh r2, [r1] movs r0, 0x10 orrs r0, r2 strh r0, [r1] ldrb r0, [r3, 0xA] adds r0, 0x1 strb r0, [r3, 0xA] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0805381E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkB0_setspikes thumb_func_start atkB1_setforesight atkB1_setforesight: ; 805382C ldr r1, =0x02024084 ldr r0, =0x0202420c ldrb r2, [r0] movs r0, 0x58 muls r2, r0 adds r1, 0x50 adds r2, r1 ldr r0, [r2] movs r1, 0x80 lsls r1, 22 orrs r0, r1 str r0, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end atkB1_setforesight thumb_func_start atkB2_setperishsong atkB2_setperishsong: ; 805385C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r6, 0 movs r3, 0 ldr r0, =0x0202406c adds r7, r0, 0 ldr r0, =0x0202420b mov r8, r0 ldrb r1, [r7] cmp r6, r1 bge @080538C8 movs r5, 0x20 ldr r0, =0x02024084 mov r12, r0 ldr r0, =0x020242bc adds r4, r0, 0 adds r4, 0xF ldr r2, =0x020242ac @08053884: ldr r1, [r2] adds r0, r1, 0 ands r0, r5 cmp r0, 0 bne @0805389C movs r0, 0x58 muls r0, r3 add r0, r12 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x2B bne @080538B4 @0805389C: adds r6, 0x1 b @080538BC .align 2, 0 .pool @080538B4: orrs r1, r5 str r1, [r2] movs r0, 0x33 strb r0, [r4] @080538BC: adds r4, 0x1C adds r2, 0x4 adds r3, 0x1 ldrb r0, [r7] cmp r3, r0 blt @08053884 @080538C8: mov r1, r8 ldrb r0, [r1] bl sub_803F67C ldr r0, =0x0202406c ldrb r0, [r0] cmp r6, r0 bne @080538FC ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @08053904 .align 2, 0 .pool @080538FC: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08053904: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkB2_setperishsong thumb_func_start atkB3_rolloutdamagecalculation atkB3_rolloutdamagecalculation: ; 8053914 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @08053948 ldr r0, =0x0202420b ldrb r0, [r0] bl b_cancel_multi_turn_move_maybe ldr r1, =0x02024214 ldr r0, =gUnknown_082D8A60 str r0, [r1] b @08053A60 .align 2, 0 .pool @08053948: ldr r2, =0x02024084 ldr r1, =0x0202420b ldrb r3, [r1] movs r5, 0x58 adds r0, r3, 0 muls r0, r5 adds r4, r2, 0 adds r4, 0x50 adds r0, r4 ldr r0, [r0] movs r7, 0x80 lsls r7, 5 ands r0, r7 adds r6, r1, 0 mov r9, r2 ldr r1, =0x020242bc mov r12, r1 ldr r2, =0x020241ea mov r8, r2 cmp r0, 0 bne @080539BA lsls r0, r3, 3 subs r0, r3 lsls r0, 2 add r0, r12 ldrb r2, [r0, 0x11] movs r1, 0x10 negs r1, r1 ands r1, r2 movs r2, 0x5 orrs r1, r2 strb r1, [r0, 0x11] ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r12 ldrb r2, [r0, 0x11] movs r1, 0xF ands r1, r2 movs r2, 0x50 orrs r1, r2 strb r1, [r0, 0x11] ldrb r0, [r6] adds r1, r0, 0 muls r1, r5 adds r1, r4 ldr r0, [r1] orrs r0, r7 str r0, [r1] ldr r1, =0x02024268 ldrb r0, [r6] lsls r0, 1 adds r0, r1 mov r2, r8 ldrh r1, [r2] strh r1, [r0] @080539BA: ldrb r0, [r6] lsls r2, r0, 3 subs r2, r0 lsls r2, 2 add r2, r12 ldrb r3, [r2, 0x11] lsls r1, r3, 28 lsrs r1, 28 subs r1, 0x1 movs r0, 0xF ands r1, r0 movs r0, 0x10 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2, 0x11] cmp r1, 0 bne @080539EE ldrb r0, [r6] adds r1, r0, 0 muls r1, r5 adds r1, r4 ldr r0, [r1] ldr r2, =0xffffefff ands r0, r2 str r0, [r1] @080539EE: ldr r3, =0x02024400 ldr r2, =gBattleMoves mov r0, r8 ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] strh r0, [r3] movs r2, 0x1 ldrb r1, [r6] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 mov r1, r12 adds r4, r0, r1 ldrb r0, [r4, 0x11] lsls r0, 28 lsrs r0, 28 movs r1, 0x5 subs r1, r0 ldr r7, =0x02024214 adds r5, r3, 0 cmp r2, r1 bge @08053A3C adds r1, r5, 0 adds r3, r4, 0 movs r4, 0x5 @08053A28: ldrh r0, [r1] lsls r0, 1 strh r0, [r1] adds r2, 0x1 ldrb r0, [r3, 0x11] lsls r0, 28 lsrs r0, 28 subs r0, r4, r0 cmp r2, r0 blt @08053A28 @08053A3C: ldrb r1, [r6] movs r0, 0x58 muls r0, r1 mov r1, r9 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 23 ands r0, r1 cmp r0, 0 beq @08053A5A ldrh r0, [r5] lsls r0, 1 strh r0, [r5] @08053A5A: ldr r0, [r7] adds r0, 0x1 str r0, [r7] @08053A60: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkB3_rolloutdamagecalculation thumb_func_start atkB4_jumpifconfusedandattackmaxed atkB4_jumpifconfusedandattackmaxed: ; 8053A90 push {r4,r5,lr} ldr r5, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 adds r3, r1, 0 muls r3, r0 adds r0, r5, 0 adds r0, 0x50 adds r0, r3, r0 ldr r0, [r0] movs r1, 0x7 ands r0, r1 ldr r4, =0x02024214 cmp r0, 0 beq @08053AEC ldr r2, [r4] ldrb r0, [r2, 0x1] adds r0, r3 adds r1, r5, 0 adds r1, 0x18 adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0xC bne @08053AEC ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x5] lsls r0, 24 orrs r1, r0 str r1, [r4] b @08053AF2 .align 2, 0 .pool @08053AEC: ldr r0, [r4] adds r0, 0x6 str r0, [r4] @08053AF2: pop {r4,r5} pop {r0} bx r0 thumb_func_end atkB4_jumpifconfusedandattackmaxed thumb_func_start sub_8053AF8 sub_8053AF8: ; 8053AF8 push {r4,r5,lr} ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @08053B34 ldr r2, =0x020242bc ldr r0, =0x0202420b ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x10] ldr r1, =0x02024214 ldr r0, =gUnknown_082D8A60 str r0, [r1] b @08053B8C .align 2, 0 .pool @08053B34: ldr r5, =0x020242bc ldr r4, =0x0202420b ldrb r1, [r4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r1, r0, r5 ldrb r0, [r1, 0x10] cmp r0, 0x5 beq @08053B4C adds r0, 0x1 strb r0, [r1, 0x10] @08053B4C: ldr r3, =0x02024400 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] strh r0, [r3] movs r2, 0x1 ldrb r1, [r4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r5 ldr r4, =0x02024214 ldrb r1, [r0, 0x10] cmp r2, r1 bge @08053B86 adds r1, r3, 0 adds r3, r0, 0 @08053B78: ldrh r0, [r1] lsls r0, 1 strh r0, [r1] adds r2, 0x1 ldrb r0, [r3, 0x10] cmp r2, r0 blt @08053B78 @08053B86: ldr r0, [r4] adds r0, 0x1 str r0, [r4] @08053B8C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8053AF8 thumb_func_start atkB6_happinesstodamagecalculation atkB6_happinesstodamagecalculation: ; 8053BAC push {r4,lr} ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] cmp r0, 0x79 bne @08053BEC ldr r4, =0x02024400 ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x2B ldrb r1, [r0] b @08053C02 .align 2, 0 .pool @08053BEC: ldr r4, =0x02024400 ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x2B ldrb r0, [r0] movs r1, 0xFF subs r1, r0 @08053C02: lsls r0, r1, 2 adds r0, r1 lsls r0, 1 movs r1, 0x19 bl __divsi3 strh r0, [r4] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkB6_happinesstodamagecalculation thumb_func_start atkB7_presentdamagecalculation atkB7_presentdamagecalculation: ; 8053C30 push {r4,lr} bl GenerateRandomNumber movs r4, 0xFF ands r4, r0 cmp r4, 0x65 bgt @08053C4C ldr r1, =0x02024400 movs r0, 0x28 strh r0, [r1] b @08053C8E .align 2, 0 .pool @08053C4C: cmp r4, 0xB1 bgt @08053C5C ldr r1, =0x02024400 movs r0, 0x50 strh r0, [r1] b @08053C8E .align 2, 0 .pool @08053C5C: cmp r4, 0xCB bgt @08053C6C ldr r1, =0x02024400 movs r0, 0x78 strh r0, [r1] b @08053C8E .align 2, 0 .pool @08053C6C: ldr r3, =0x020241f0 ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x2C] lsrs r0, 2 str r0, [r3] cmp r0, 0 bne @08053C88 movs r0, 0x1 str r0, [r3] @08053C88: ldr r0, [r3] negs r0, r0 str r0, [r3] @08053C8E: cmp r4, 0xCB bgt @08053CAC ldr r1, =0x02024214 ldr r0, =gUnknown_082D8A30 b @08053CE6 .align 2, 0 .pool @08053CAC: ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r1, [r0, 0x2C] ldrh r0, [r0, 0x28] cmp r1, r0 bne @08053CD8 ldr r1, =0x02024214 ldr r0, =gUnknown_082D9EFB b @08053CE6 .align 2, 0 .pool @08053CD8: ldr r2, =0x0202427c ldrb r1, [r2] movs r0, 0xF7 ands r0, r1 strb r0, [r2] ldr r1, =0x02024214 ldr r0, =gUnknown_082D9EE1 @08053CE6: str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkB7_presentdamagecalculation thumb_func_start atkB8_setsafeguard atkB8_setsafeguard: ; 8053CFC push {r4-r7,lr} ldr r7, =0x0202420b ldrb r0, [r7] bl battle_get_per_side_status ldr r4, =0x0202428e movs r6, 0x1 adds r1, r6, 0 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r1, [r1] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @08053D40 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x5] b @08053D88 .align 2, 0 .pool @08053D40: ldrb r0, [r7] bl battle_get_per_side_status adds r1, r6, 0 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r0, [r1] movs r2, 0x20 orrs r0, r2 strh r0, [r1] ldrb r0, [r7] bl battle_get_per_side_status ldr r5, =0x02024294 adds r1, r6, 0 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r5 movs r4, 0x5 strb r4, [r0, 0x6] ldrb r0, [r7] bl battle_get_per_side_status adds r1, r6, 0 ands r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r7] strb r1, [r0, 0x7] ldr r0, =0x02024332 strb r4, [r0, 0x5] @08053D88: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkB8_setsafeguard thumb_func_start atkB9_magnitudedamagecalculation atkB9_magnitudedamagecalculation: ; 8053DA4 push {r4-r7,lr} mov r7, r8 push {r7} bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r3, r0, 16 cmp r3, 0x4 bgt @08053DD0 ldr r1, =0x02024400 movs r0, 0xA strh r0, [r1] movs r3, 0x4 b @08053E3C .align 2, 0 .pool @08053DD0: cmp r3, 0xE bgt @08053DE4 ldr r1, =0x02024400 movs r0, 0x1E strh r0, [r1] movs r3, 0x5 b @08053E3C .align 2, 0 .pool @08053DE4: cmp r3, 0x22 bgt @08053DF8 ldr r1, =0x02024400 movs r0, 0x32 strh r0, [r1] movs r3, 0x6 b @08053E3C .align 2, 0 .pool @08053DF8: cmp r3, 0x40 bgt @08053E0C ldr r1, =0x02024400 movs r0, 0x46 strh r0, [r1] movs r3, 0x7 b @08053E3C .align 2, 0 .pool @08053E0C: cmp r3, 0x54 bgt @08053E20 ldr r1, =0x02024400 movs r0, 0x5A strh r0, [r1] movs r3, 0x8 b @08053E3C .align 2, 0 .pool @08053E20: cmp r3, 0x5E bgt @08053E34 ldr r1, =0x02024400 movs r0, 0x6E strh r0, [r1] movs r3, 0x9 b @08053E3C .align 2, 0 .pool @08053E34: ldr r1, =0x02024400 movs r0, 0x96 strh r0, [r1] movs r3, 0xA @08053E3C: ldr r1, =0x02022f58 movs r2, 0 movs r0, 0xFD strb r0, [r1] movs r0, 0x1 strb r0, [r1, 0x1] strb r0, [r1, 0x2] movs r0, 0x2 strb r0, [r1, 0x3] strb r3, [r1, 0x4] movs r0, 0xFF strb r0, [r1, 0x5] ldr r1, =0x0202420c strb r2, [r1] ldr r0, =0x0202406c ldrb r3, [r0] adds r6, r1, 0 ldr r0, =0x02024214 mov r8, r0 cmp r2, r3 bcs @08053E94 adds r4, r6, 0 ldr r0, =0x0202420b ldrb r5, [r0] ldr r1, =gUnknown_0832A328 mov r12, r1 ldr r7, =0x02024210 @08053E72: ldrb r2, [r4] cmp r2, r5 beq @08053E88 ldrb r0, [r7] ldrb r1, [r6] lsls r1, 2 add r1, r12 ldr r1, [r1] ands r0, r1 cmp r0, 0 beq @08053E94 @08053E88: adds r0, r2, 0x1 strb r0, [r4] lsls r0, 24 lsrs r0, 24 cmp r0, r3 bcc @08053E72 @08053E94: mov r1, r8 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkB9_magnitudedamagecalculation thumb_func_start atkBA_802B140 atkBA_802B140: ; 8053EC8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x02024212 ldrb r0, [r0] cmp r0, 0x1 bne @08053EF8 ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08053EF4 movs r0, 0x1 b @08053F12 .align 2, 0 .pool @08053EF4: movs r0, 0 b @08053F12 @08053EF8: ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08053F10 movs r0, 0x3 b @08053F12 .align 2, 0 .pool @08053F10: movs r0, 0x2 @08053F12: bl battle_get_side_with_given_state ldr r1, =0x0202420c strb r0, [r1] ldr r0, =0x0202421c ldr r1, =0x0202420c ldrb r3, [r1] adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @08053F2A b @08054030 @08053F2A: ldr r5, =0x0202420b ldr r0, =0x0202449c ldr r1, [r0] adds r1, r3, r1 ldrb r2, [r5] ldrb r1, [r1, 0xC] cmp r2, r1 bne @08054030 ldr r4, =0x02024084 movs r2, 0x58 adds r0, r3, 0 muls r0, r2 adds r1, r4, 0 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x27 ands r0, r1 cmp r0, 0 bne @08054030 ldrb r0, [r5] muls r0, r2 adds r0, r4 ldrh r0, [r0, 0x28] cmp r0, 0 beq @08054030 ldr r0, =0x020242bc lsls r1, r3, 3 subs r1, r3 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x18] lsls r0, 31 cmp r0, 0 bne @08054030 ldr r0, =0x02024274 lsls r1, r3, 1 adds r1, r0 ldrh r0, [r1] cmp r0, 0xE4 bne @08054030 movs r1, 0 ldr r0, =0x0202406c ldr r2, =0x020241ea mov r8, r2 ldr r7, =0x020241e8 mov r10, r7 ldr r2, =0x020241e9 mov r9, r2 ldr r7, =0x02024280 mov r12, r7 ldrb r2, [r0] cmp r1, r2 bge @08053FB6 ldr r6, =0x0202407e ldr r5, =0x0202420c ldr r4, =0x0202407a movs r3, 0xB adds r2, r0, 0 @08053FA0: adds r0, r1, r6 ldrb r0, [r0] ldrb r7, [r5] cmp r0, r7 bne @08053FAE adds r0, r1, r4 strb r3, [r0] @08053FAE: adds r1, 0x1 ldrb r0, [r2] cmp r1, r0 blt @08053FA0 @08053FB6: movs r0, 0xE4 mov r1, r8 strh r0, [r1] ldr r2, =0x0202420c ldrb r0, [r2] ldr r7, =0x0202449c ldr r1, [r7] adds r0, r1 adds r0, 0x80 ldrb r0, [r0] mov r1, r9 strb r0, [r1] mov r2, r10 strb r0, [r2] ldr r7, =0x02024214 ldr r0, [r7] adds r0, 0x5 str r0, [r7] movs r0, 0x1 ldr r1, =0x02024474 strb r0, [r1, 0x18] mov r2, r12 ldr r0, [r2] ldr r1, =0xfffffbff ands r0, r1 str r0, [r2] b @0805404A .align 2, 0 .pool @08054030: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @0805404A: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkBA_802B140 thumb_func_start sub_805405C sub_805405C: ; 805405C push {lr} ldr r2, =0x020243cc ldrh r1, [r2] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @08054088 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] b @0805409A .align 2, 0 .pool @08054088: movs r0, 0x20 strh r0, [r2] ldr r1, =0x02024332 movs r0, 0x4 strb r0, [r1, 0x5] ldr r0, =0x020243d0 adds r0, 0x28 movs r1, 0x5 strb r1, [r0] @0805409A: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805405C thumb_func_start atkBC_maxattackhalvehp atkBC_maxattackhalvehp: ; 80540B4 push {r4,r5,lr} ldr r5, =0x02024084 ldr r4, =0x0202420b ldrb r0, [r4] movs r3, 0x58 muls r0, r3 adds r2, r0, r5 ldrh r0, [r2, 0x2C] lsrs r1, r0, 1 cmp r1, 0 bne @080540CC movs r1, 0x1 @080540CC: movs r0, 0x19 ldrsb r0, [r2, r0] cmp r0, 0xB bgt @08054110 ldrh r0, [r2, 0x28] cmp r0, r1 bls @08054110 movs r0, 0xC strb r0, [r2, 0x19] ldr r1, =0x020241f0 ldrb r0, [r4] muls r0, r3 adds r0, r5 ldrh r0, [r0, 0x2C] lsrs r0, 1 str r0, [r1] cmp r0, 0 bne @080540F4 movs r0, 0x1 str r0, [r1] @080540F4: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @0805412A .align 2, 0 .pool @08054110: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @0805412A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkBC_maxattackhalvehp thumb_func_start atkBD_copyfoestats atkBD_copyfoestats: ; 8054134 push {r4-r7,lr} movs r2, 0 ldr r7, =0x02024214 ldr r6, =0x0202420b movs r4, 0x58 ldr r3, =0x0202409c ldr r5, =0x0202420c @08054142: ldrb r0, [r6] adds r1, r0, 0 muls r1, r4 adds r1, r2, r1 adds r1, r3 ldrb r0, [r5] muls r0, r4 adds r0, r2, r0 adds r0, r3 ldrb r0, [r0] strb r0, [r1] adds r2, 0x1 cmp r2, 0x7 ble @08054142 ldr r0, [r7] adds r0, 0x5 str r0, [r7] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkBD_copyfoestats thumb_func_start atkBE_breakfree atkBE_breakfree: ; 805417C push {r4-r6,lr} ldr r1, =0x02024084 ldr r5, =0x0202420b ldrb r2, [r5] movs r6, 0x58 adds r0, r2, 0 muls r0, r6 adds r4, r1, 0 adds r4, 0x50 adds r0, r4 ldr r0, [r0] movs r1, 0xE0 lsls r1, 8 ands r0, r1 cmp r0, 0 beq @08054210 ldr r1, =0x02024474 ldr r3, =0x0202420c ldrb r0, [r3] strb r0, [r1, 0x17] ldrb r0, [r5] adds r1, r0, 0 muls r1, r6 adds r1, r4 ldr r0, [r1] ldr r2, =0xffff1fff ands r0, r2 str r0, [r1] ldrb r0, [r5] ldr r1, =0x0202449c ldr r2, [r1] adds r0, r2 ldrb r0, [r0, 0x14] strb r0, [r3] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] ldrb r0, [r5] lsls r0, 1 adds r0, r2 ldrb r0, [r0, 0x4] strb r0, [r1, 0x2] ldrb r0, [r5] lsls r0, 1 adds r0, r2 ldrb r0, [r0, 0x5] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DAFC5 b @080542BA .align 2, 0 .pool @08054210: ldr r4, =0x020242ac lsls r0, r2, 2 adds r3, r0, r4 ldr r1, [r3] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08054250 movs r0, 0x5 negs r0, r0 ands r1, r0 str r1, [r3] ldrb r1, [r5] lsls r1, 2 adds r1, r4 ldr r0, [r1] movs r2, 0x4 negs r2, r2 ands r0, r2 str r0, [r1] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DAFD6 b @080542BA .align 2, 0 .pool @08054250: adds r0, r2, 0 bl battle_side_get_owner ldr r4, =0x0202428e lsls r0, 24 lsrs r0, 23 adds r0, r4 ldrh r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080542B4 ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 lsrs r0, 23 adds r0, r4 ldrh r2, [r0] ldr r1, =0x0000ffef ands r1, r2 movs r4, 0 strh r1, [r0] ldrb r0, [r5] bl battle_side_get_owner ldr r2, =0x02024294 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 strb r4, [r1, 0xA] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DAFDD b @080542BA .align 2, 0 .pool @080542B4: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 @080542BA: str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkBE_breakfree thumb_func_start atkBF_setcurled atkBF_setcurled: ; 80542C8 ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r2, r0 adds r1, 0x50 adds r2, r1 ldr r0, [r2] movs r1, 0x80 lsls r1, 23 orrs r0, r1 str r0, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end atkBF_setcurled thumb_func_start atkC0_recoverbasedonsunlight atkC0_recoverbasedonsunlight: ; 80542F8 push {r4-r7,lr} sub sp, 0x4 ldr r1, =0x0202420c ldr r5, =0x0202420b ldrb r0, [r5] strb r0, [r1] ldr r7, =0x02024084 ldrb r0, [r5] movs r6, 0x58 muls r0, r6 adds r0, r7 ldrh r1, [r0, 0x28] ldrh r0, [r0, 0x2C] cmp r1, r0 beq @080543D8 ldr r4, =0x020243cc ldrh r0, [r4] cmp r0, 0 beq @0805434A movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @0805434A str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @08054378 @0805434A: ldr r3, =0x020241f0 ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x2C] lsrs r0, 1 str r0, [r3] adds r1, r3, 0 b @080543B2 .align 2, 0 .pool @08054378: ldrh r1, [r4] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @080543A4 ldr r4, =0x020241f0 ldrb r0, [r5] muls r0, r6 adds r0, r7 ldrh r1, [r0, 0x2C] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 movs r1, 0x1E bl __divsi3 str r0, [r4] adds r1, r4, 0 b @080543B2 .align 2, 0 .pool @080543A4: ldr r1, =0x020241f0 ldrb r0, [r5] muls r0, r6 adds r0, r7 ldrh r0, [r0, 0x2C] lsrs r0, 2 str r0, [r1] @080543B2: adds r2, r1, 0 ldr r0, [r2] cmp r0, 0 bne @080543BE movs r0, 0x1 str r0, [r2] @080543BE: ldr r0, [r1] negs r0, r0 str r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @080543F2 .align 2, 0 .pool @080543D8: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @080543F2: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkC0_recoverbasedonsunlight thumb_func_start sub_8054400 sub_8054400: ; 8054400 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 adds r4, r1, 0 muls r4, r0 adds r4, r2 ldrb r0, [r4, 0x14] mov r10, r0 mov r7, r10 lsls r7, 27 adds r0, r7, 0 lsrs r0, 27 mov r10, r0 movs r1, 0x2 mov r2, r10 ands r2, r1 asrs r2, 1 ldrh r7, [r4, 0x14] mov r9, r7 mov r0, r9 lsls r0, 22 mov r9, r0 lsrs r3, r0, 27 adds r0, r1, 0 ands r0, r3 orrs r2, r0 ldrb r7, [r4, 0x15] mov r8, r7 mov r0, r8 lsls r0, 25 mov r8, r0 lsrs r3, r0, 27 adds r0, r1, 0 ands r0, r3 lsls r0, 1 orrs r2, r0 ldr r6, [r4, 0x14] lsls r6, 12 lsrs r3, r6, 27 adds r0, r1, 0 ands r0, r3 lsls r0, 2 orrs r2, r0 ldrh r5, [r4, 0x16] lsls r5, 23 lsrs r3, r5, 27 adds r0, r1, 0 ands r0, r3 lsls r0, 3 orrs r2, r0 ldrb r3, [r4, 0x17] lsls r3, 26 lsrs r0, r3, 27 ands r1, r0 lsls r1, 4 orrs r2, r1 movs r1, 0x1 adds r4, r1, 0 mov r7, r10 ands r4, r7 mov r0, r9 lsrs r0, 27 mov r9, r0 adds r0, r1, 0 mov r7, r9 ands r0, r7 lsls r0, 1 orrs r4, r0 mov r0, r8 lsrs r0, 27 mov r8, r0 adds r0, r1, 0 mov r7, r8 ands r0, r7 lsls r0, 2 orrs r4, r0 lsrs r6, 27 adds r0, r1, 0 ands r0, r6 lsls r0, 3 orrs r4, r0 lsrs r5, 27 adds r0, r1, 0 ands r0, r5 lsls r0, 4 orrs r4, r0 lsrs r3, 27 ands r1, r3 lsls r1, 5 orrs r4, r1 ldr r5, =0x02024400 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 movs r1, 0x3F bl __divsi3 adds r0, 0x1E strh r0, [r5] ldr r6, =0x0202449c ldr r5, [r6] lsls r0, r4, 4 subs r0, r4 movs r1, 0x3F bl __divsi3 adds r0, 0x1 strb r0, [r5, 0x13] ldr r1, [r6] ldrb r0, [r1, 0x13] cmp r0, 0x8 bls @080544F0 adds r0, 0x1 strb r0, [r1, 0x13] @080544F0: ldr r2, [r6] ldrb r0, [r2, 0x13] movs r1, 0xC0 orrs r0, r1 strb r0, [r2, 0x13] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8054400 thumb_func_start atkC2_selectnexttarget atkC2_selectnexttarget: ; 8054524 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x0202420c movs r1, 0 strb r1, [r0] ldr r1, =0x0202406c ldrb r1, [r1] adds r6, r0, 0 ldr r0, =0x02024214 mov r8, r0 cmp r1, 0 beq @0805456E adds r3, r6, 0 ldr r0, =0x0202420b ldrb r5, [r0] ldr r0, =gUnknown_0832A328 mov r12, r0 adds r4, r1, 0 ldr r7, =0x02024210 @0805454C: ldrb r2, [r3] cmp r2, r5 beq @08054562 ldrb r0, [r7] ldrb r1, [r6] lsls r1, 2 add r1, r12 ldr r1, [r1] ands r0, r1 cmp r0, 0 beq @0805456E @08054562: adds r0, r2, 0x1 strb r0, [r3] lsls r0, 24 lsrs r0, 24 cmp r0, r4 bcc @0805454C @0805456E: mov r1, r8 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkC2_selectnexttarget thumb_func_start atkC3_setfutureattack atkC3_setfutureattack: ; 8054598 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x14 ldr r0, =0x020243d0 mov r8, r0 ldr r6, =0x0202420c ldrb r1, [r6] adds r0, r1, r0 ldrb r7, [r0] cmp r7, 0 beq @080545DC ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @080546CC .align 2, 0 .pool @080545DC: adds r0, r1, 0 bl battle_get_per_side_status ldr r4, =0x0202428e lsls r0, 24 lsrs r0, 24 movs r1, 0x1 mov r10, r1 ands r0, r1 lsls r0, 1 adds r0, r4 ldrh r2, [r0] movs r1, 0x40 movs r5, 0 mov r3, sp strh r5, [r3, 0x10] orrs r1, r2 strh r1, [r0] ldrb r0, [r6] lsls r0, 1 mov r1, r8 adds r1, 0x18 adds r0, r1 ldr r1, =0x020241ea mov r9, r1 ldrh r1, [r1] strh r1, [r0] mov r0, r8 adds r0, 0x4 ldrb r2, [r6] adds r0, r2 ldr r5, =0x0202420b ldrb r1, [r5] strb r1, [r0] ldrb r0, [r6] add r0, r8 movs r1, 0x3 strb r1, [r0] ldrb r0, [r6] bl battle_get_per_side_status mov r1, r10 ands r1, r0 lsls r1, 1 adds r1, r4 ldrh r3, [r1] ldrb r0, [r5] movs r4, 0x58 muls r0, r4 ldr r2, =0x02024084 adds r0, r2 ldrb r1, [r6] muls r1, r4 adds r1, r2 mov r4, r9 ldrh r2, [r4] str r7, [sp] str r7, [sp, 0x4] ldrb r4, [r5] str r4, [sp, 0x8] ldrb r4, [r6] str r4, [sp, 0xC] bl sub_806957C ldrb r1, [r6] lsls r1, 2 mov r2, r8 adds r2, 0x8 adds r1, r2 str r0, [r1] ldr r1, =0x0202433c ldrb r0, [r5] lsls r0, 4 adds r0, r1 ldrb r0, [r0] lsls r0, 28 cmp r0, 0 bge @0805468C ldrb r4, [r6] lsls r4, 2 adds r4, r2 ldr r1, [r4] lsls r0, r1, 4 subs r0, r1 movs r1, 0xA bl __divsi3 str r0, [r4] @0805468C: mov r5, r9 ldrh r1, [r5] ldr r0, =0x00000161 cmp r1, r0 bne @080546BC ldr r0, =0x02024332 mov r1, r10 strb r1, [r0, 0x5] b @080546C4 .align 2, 0 .pool @080546BC: ldr r0, =0x02024332 mov r2, sp ldrb r2, [r2, 0x10] strb r2, [r0, 0x5] @080546C4: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @080546CC: add sp, 0x14 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkC3_setfutureattack thumb_func_start atkC4_802B910 atkC4_802B910: ; 80546E4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 ldr r7, =0x02024744 cmp r0, 0 bne @080546FE ldr r7, =0x020244ec @080546FE: ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08054740 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] b @080548DC .align 2, 0 .pool @08054740: ldr r6, =0x02024332 ldrb r0, [r6] mov r8, r0 cmp r0, 0x5 bls @0805474C b @080548A8 @0805474C: adds r4, r6, 0 movs r5, 0x64 @08054750: ldrb r0, [r4] muls r0, r5 adds r0, r7, r0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08054794 ldrb r0, [r6] muls r0, r5 adds r0, r7, r0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @08054794 ldrb r0, [r4] muls r0, r5 adds r0, r7, r0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @08054794 ldrb r0, [r4] muls r0, r5 adds r0, r7, r0 movs r1, 0x37 bl pokemon_getattr cmp r0, 0 beq @080547A4 @08054794: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] adds r6, r4, 0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 bls @08054750 @080547A4: ldr r1, =0x02024332 mov r9, r1 ldrb r2, [r1] cmp r2, 0x5 bhi @080548A8 ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x4 strb r0, [r1, 0x1] ldr r6, =0x0202420b ldrb r0, [r6] strb r0, [r1, 0x2] strb r2, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x9 str r0, [r1] ldr r2, =0x020241f0 mov r8, r2 ldr r5, =gBaseStats mov r1, r9 ldrb r0, [r1] movs r4, 0x64 muls r0, r4 adds r0, r7, r0 movs r1, 0xB bl pokemon_getattr lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r3, [r1, 0x1] mov r2, r8 str r3, [r2] ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] muls r0, r3 mov r1, r8 str r0, [r1] mov r2, r9 ldrb r0, [r2] muls r0, r4 adds r0, r7, r0 movs r1, 0x38 bl pokemon_getattr lsls r0, 1 movs r1, 0x5 bl __udivsi3 adds r0, 0x2 mov r2, r8 ldr r1, [r2] muls r0, r1 str r0, [r2] ldr r3, =0x02024084 ldr r1, =0x0202420c ldrb r2, [r1] movs r1, 0x58 muls r1, r2 adds r1, r3 ldrh r2, [r1] lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r5 ldrb r1, [r1, 0x2] bl __divsi3 mov r1, r8 str r0, [r1] movs r1, 0x32 bl __divsi3 adds r2, r0, 0x2 mov r0, r8 str r2, [r0] ldr r1, =0x0202433c ldrb r0, [r6] lsls r0, 4 adds r0, r1 ldrb r0, [r0] lsls r0, 28 cmp r0, 0 bge @08054870 lsls r0, r2, 4 subs r0, r2 movs r1, 0xA bl __divsi3 mov r1, r8 str r0, [r1] @08054870: mov r2, r9 ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] b @080548E2 .align 2, 0 .pool @080548A8: mov r0, r8 cmp r0, 0 beq @080548C8 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] b @080548DC .align 2, 0 .pool @080548C8: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x5] ldrb r0, [r2, 0x6] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x7] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x8] @080548DC: lsls r0, 24 orrs r1, r0 str r1, [r3] @080548E2: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkC4_802B910 thumb_func_start atkC5_hidepreattack atkC5_hidepreattack: ; 80548F4 push {lr} ldr r0, =0x020241ea ldrh r1, [r0] cmp r1, 0x5B beq @08054934 cmp r1, 0x5B bgt @0805490C cmp r1, 0x13 beq @08054918 b @08054960 .align 2, 0 .pool @0805490C: ldr r0, =0x00000123 cmp r1, r0 beq @0805494C adds r0, 0x31 cmp r1, r0 bne @08054960 @08054918: ldr r2, =0x020242ac ldr r0, =0x0202420b ldrb r1, [r0] lsls r1, 2 adds r1, r2 ldr r0, [r1] movs r2, 0x40 b @0805495C .align 2, 0 .pool @08054934: ldr r2, =0x020242ac ldr r0, =0x0202420b ldrb r1, [r0] lsls r1, 2 adds r1, r2 ldr r0, [r1] movs r2, 0x80 b @0805495C .align 2, 0 .pool @0805494C: ldr r2, =0x020242ac ldr r0, =0x0202420b ldrb r1, [r0] lsls r1, 2 adds r1, r2 ldr r0, [r1] movs r2, 0x80 lsls r2, 11 @0805495C: orrs r0, r2 str r0, [r1] @08054960: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkC5_hidepreattack thumb_func_start atkC6_unhidepostattack atkC6_unhidepostattack: ; 8054978 push {lr} ldr r0, =0x020241ea ldrh r1, [r0] cmp r1, 0x5B beq @080549BC cmp r1, 0x5B bgt @08054990 cmp r1, 0x13 beq @0805499C b @080549EA .align 2, 0 .pool @08054990: ldr r0, =0x00000123 cmp r1, r0 beq @080549D8 adds r0, 0x31 cmp r1, r0 bne @080549EA @0805499C: ldr r2, =0x020242ac ldr r0, =0x0202420b ldrb r1, [r0] lsls r1, 2 adds r1, r2 ldr r0, [r1] movs r2, 0x41 negs r2, r2 b @080549E6 .align 2, 0 .pool @080549BC: ldr r2, =0x020242ac ldr r0, =0x0202420b ldrb r1, [r0] lsls r1, 2 adds r1, r2 ldr r0, [r1] movs r2, 0x81 negs r2, r2 b @080549E6 .align 2, 0 .pool @080549D8: ldr r2, =0x020242ac ldr r0, =0x0202420b ldrb r1, [r0] lsls r1, 2 adds r1, r2 ldr r0, [r1] ldr r2, =0xfffbffff @080549E6: ands r0, r2 str r0, [r1] @080549EA: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkC6_unhidepostattack thumb_func_start atkC7_setminimize atkC7_setminimize: ; 8054A08 push {lr} ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @08054A2C ldr r2, =0x020242ac ldr r0, =0x0202420b ldrb r1, [r0] lsls r1, 2 adds r1, r2 ldr r0, [r1] movs r2, 0x80 lsls r2, 1 orrs r0, r2 str r0, [r1] @08054A2C: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkC7_setminimize thumb_func_start sub_8054A48 sub_8054A48: ; 8054A48 push {lr} ldr r3, =0x020243cc ldrh r1, [r3] movs r2, 0x80 adds r0, r2, 0 ands r0, r1 cmp r0, 0 beq @08054A78 ldr r2, =0x0202427c ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] b @08054A86 .align 2, 0 .pool @08054A78: strh r2, [r3] ldr r0, =0x02024332 movs r1, 0x5 strb r1, [r0, 0x5] ldr r0, =0x020243d0 adds r0, 0x28 strb r1, [r0] @08054A86: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8054A48 thumb_func_start atkC9_jumpifattackandspecialattackcannotfall atkC9_jumpifattackandspecialattackcannotfall: ; 8054AA0 push {r4,lr} ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r1, r0, r2 movs r0, 0x19 ldrsb r0, [r1, r0] adds r3, r2, 0 cmp r0, 0 bne @08054AF4 movs r0, 0x1C ldrsb r0, [r1, r0] cmp r0, 0 bne @08054AF4 ldr r0, =0x02024332 ldrb r0, [r0, 0x6] cmp r0, 0x1 beq @08054AF4 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @08054B20 .align 2, 0 .pool @08054AF4: ldr r4, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r4] ldr r2, =0x020241f0 ldrb r1, [r4] movs r0, 0x58 muls r0, r1 adds r0, r3 ldrh r0, [r0, 0x28] str r0, [r2] ldr r1, =0x00007fff movs r0, 0 bl dp01_build_cmdbuf_x18_0_aa_health_bar_update ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08054B20: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkC9_jumpifattackandspecialattackcannotfall thumb_func_start atkCA_setforcedtarget atkCA_setforcedtarget: ; 8054B3C push {r4,r5,lr} ldr r4, =0x0202420b ldrb r0, [r4] bl battle_side_get_owner ldr r5, =0x02024294 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r5 movs r0, 0x1 strb r0, [r1, 0x8] ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r5 ldrb r0, [r4] strb r0, [r1, 0x9] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkCA_setforcedtarget thumb_func_start atkCB_setcharge atkCB_setcharge: ; 8054B88 push {r4,lr} ldr r0, =0x020242ac ldr r3, =0x0202420b ldrb r1, [r3] lsls r1, 2 adds r1, r0 ldr r0, [r1] movs r2, 0x80 lsls r2, 2 orrs r0, r2 str r0, [r1] ldr r4, =0x020242bc ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r4 ldrb r2, [r0, 0x12] movs r1, 0x10 negs r1, r1 ands r1, r2 movs r2, 0x2 orrs r1, r2 strb r1, [r0, 0x12] ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r4 ldrb r2, [r0, 0x12] movs r1, 0xF ands r1, r2 movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x12] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkCB_setcharge thumb_func_start atkCC_callterrainattack atkCC_callterrainattack: ; 8054BEC push {r4,lr} ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xfffffbff ands r0, r1 str r0, [r2] ldr r4, =0x020241ea ldr r1, =gUnknown_0831C414 ldr r0, =0x02022ff0 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r0, [r0] strh r0, [r4] ldrh r0, [r4] movs r1, 0 bl sub_80458E0 ldr r1, =0x0202420c strb r0, [r1] ldr r3, =gUnknown_082D86A8 ldr r2, =gBattleMoves ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] lsls r0, 2 adds r0, r3 ldr r0, [r0] bl b_movescr_stack_push ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkCC_callterrainattack thumb_func_start atkCD_cureifburnedparalysedorpoisoned atkCD_cureifburnedparalysedorpoisoned: ; 8054C60 push {r4-r6,lr} sub sp, 0x4 ldr r1, =0x02024084 ldr r3, =0x0202420b ldrb r0, [r3] movs r6, 0x58 muls r0, r6 adds r5, r1, 0 adds r5, 0x4C adds r2, r0, r5 ldr r0, [r2] movs r1, 0xD8 ands r0, r1 cmp r0, 0 beq @08054CBC movs r0, 0 str r0, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] ldr r4, =0x02024064 ldrb r0, [r3] strb r0, [r4] ldrb r0, [r4] muls r0, r6 adds r0, r5 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution b @08054CD6 .align 2, 0 .pool @08054CBC: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08054CD6: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkCD_cureifburnedparalysedorpoisoned thumb_func_start atkCE_settorment atkCE_settorment: ; 8054CE4 push {lr} ldr r1, =0x02024084 ldr r0, =0x0202420c ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r1, [r0] movs r2, 0x80 lsls r2, 24 cmp r1, 0 bge @08054D28 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @08054D34 .align 2, 0 .pool @08054D28: orrs r1, r2 str r1, [r0] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08054D34: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkCE_settorment thumb_func_start atkCF_jumpifnodamage atkCF_jumpifnodamage: ; 8054D3C push {lr} ldr r2, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r1, r0, 4 adds r0, r2, 0x4 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 bne @08054D5C adds r0, r2, 0 adds r0, 0x8 adds r0, r1, r0 ldr r0, [r0] cmp r0, 0 beq @08054D74 @08054D5C: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08054D8E .align 2, 0 .pool @08054D74: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08054D8E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkCF_jumpifnodamage thumb_func_start atkD0_settaunt atkD0_settaunt: ; 8054D98 push {r4,lr} ldr r4, =0x020242bc ldr r3, =0x0202420c ldrb r0, [r3] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r2, r1, r4 ldrb r1, [r2, 0x13] lsls r0, r1, 28 cmp r0, 0 bne @08054DE8 movs r0, 0x10 negs r0, r0 ands r0, r1 movs r1, 0x2 orrs r0, r1 strb r0, [r2, 0x13] ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r4 ldrb r2, [r0, 0x13] movs r1, 0xF ands r1, r2 movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x13] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08054E02 .align 2, 0 .pool @08054DE8: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08054E02: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkD0_settaunt thumb_func_start atkD1_sethelpinghand atkD1_sethelpinghand: ; 8054E0C push {r4,lr} ldr r4, =0x0202420b ldrb r0, [r4] bl battle_get_per_side_status movs r1, 0x2 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r3, =0x0202420c strb r0, [r3] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08054E90 ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r3, [r3] lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08054E90 ldr r1, =0x0202433c ldrb r0, [r4] lsls r0, 4 adds r0, r1 ldrb r0, [r0] lsls r0, 28 cmp r0, 0 blt @08054E90 lsls r0, r3, 4 adds r2, r0, r1 ldrb r1, [r2] lsls r0, r1, 28 cmp r0, 0 blt @08054E90 movs r0, 0x8 orrs r0, r1 strb r0, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08054EAA .align 2, 0 .pool @08054E90: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08054EAA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkD1_sethelpinghand thumb_func_start sub_8054EB4 sub_8054EB4: ; 8054EB4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 ldr r4, =0x02022fec ldr r0, [r4] movs r1, 0x80 lsls r1, 19 ands r0, r1 cmp r0, 0 bne @08054F9A ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08054EE8 ldr r0, [r4] ldr r1, =0x0a3f0902 ands r0, r1 cmp r0, 0 beq @08054F9A @08054EE8: ldr r6, =0x0202420b ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 ldr r7, =0x0202420c ldrb r0, [r7] bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x0a3f0902 ands r0, r1 cmp r0, 0 bne @08054F46 ldr r0, =0x020243d0 adds r2, r0, 0 adds r2, 0x29 adds r0, r4, r2 ldrb r1, [r0] ldr r4, =gUnknown_0832A328 ldr r3, =0x0202406e ldrb r0, [r6] lsls r0, 1 adds r0, r3 ldrh r0, [r0] lsls r0, 2 adds r0, r4 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08054F9A adds r0, r5, r2 ldrb r1, [r0] ldrb r0, [r7] lsls r0, 1 adds r0, r3 ldrh r0, [r0] lsls r0, 2 adds r0, r4 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08054F9A @08054F46: ldr r0, =0x02024084 mov r8, r0 ldr r1, =0x0202420b ldrb r4, [r1] movs r5, 0x58 adds r0, r4, 0 muls r0, r5 add r0, r8 mov r9, r0 ldrh r3, [r0, 0x2E] adds r1, r3, 0 cmp r1, 0 bne @08054F6E ldr r0, =0x0202420c ldrb r0, [r0] muls r0, r5 add r0, r8 ldrh r0, [r0, 0x2E] cmp r0, 0 beq @08054F9A @08054F6E: cmp r1, 0xAF beq @08054F9A ldr r7, =0x0202420c ldrb r0, [r7] muls r0, r5 mov r2, r8 adds r1, r0, r2 ldrh r2, [r1, 0x2E] cmp r2, 0xAF beq @08054F9A adds r0, r3, 0 subs r0, 0x79 lsls r0, 16 lsrs r0, 16 cmp r0, 0xB bls @08054F9A adds r0, r2, 0 subs r0, 0x79 lsls r0, 16 lsrs r0, 16 cmp r0, 0xB bhi @08054FDC @08054F9A: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @08055132 .align 2, 0 .pool @08054FDC: adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x3C bne @08055010 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB63F str r0, [r1] ldr r1, =0x0202420a ldrb r0, [r7] muls r0, r5 add r0, r8 adds r0, 0x20 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r7] ldrb r1, [r1] bl b_history__record_ability_usage_of_player b @08055132 .align 2, 0 .pool @08055010: ldr r3, =0x0202449c mov r10, r3 lsls r0, r4, 1 adds r0, 0xD0 ldr r1, [r3] adds r6, r1, r0 mov r0, r9 ldrh r0, [r0, 0x2E] mov r9, r0 strh r2, [r6] ldr r1, =0x0202420b ldrb r0, [r1] muls r0, r5 add r0, r8 movs r1, 0 strh r1, [r0, 0x2E] ldrb r0, [r7] muls r0, r5 add r0, r8 mov r2, r9 strh r2, [r0, 0x2E] ldr r4, =0x02024064 ldr r3, =0x0202420b ldrb r0, [r3] strb r0, [r4] str r6, [sp] movs r0, 0 movs r1, 0x2 movs r2, 0 movs r3, 0x2 bl dp01_build_cmdbuf_x02_a_b_varargs ldr r1, =0x0202420b ldrb r0, [r1] bl dp01_battle_side_mark_buffer_for_execution ldrb r0, [r7] strb r0, [r4] ldrb r0, [r7] muls r0, r5 mov r1, r8 adds r1, 0x2E adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x2 movs r2, 0 movs r3, 0x2 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r7] bl dp01_battle_side_mark_buffer_for_execution ldrb r0, [r7] mov r2, r10 ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0xC8 movs r3, 0 strb r3, [r0] ldrb r0, [r7] ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0xC9 strb r3, [r0] ldr r1, =0x0202420b ldrb r0, [r1] ldr r1, [r2] lsls r0, 1 adds r0, r1 adds r0, 0xC8 strb r3, [r0] ldr r2, =0x0202420b ldrb r0, [r2] mov r3, r10 ldr r1, [r3] lsls r0, 1 adds r0, r1 adds r0, 0xC9 movs r1, 0 strb r1, [r0] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] ldr r1, =0x02022f58 movs r3, 0xFD strb r3, [r1] movs r2, 0xA strb r2, [r1, 0x1] ldrh r0, [r6] strb r0, [r1, 0x2] ldrh r0, [r6] lsrs r0, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x02022f68 strb r3, [r1] strb r2, [r1, 0x1] mov r2, r9 strb r2, [r1, 0x2] mov r3, r9 lsrs r0, r3, 8 strb r0, [r1, 0x3] movs r0, 0x1 negs r0, r0 strb r0, [r1, 0x4] cmp r3, 0 beq @08055118 ldrh r0, [r6] cmp r0, 0 beq @0805512C ldr r1, =0x02024332 movs r0, 0x2 b @08055130 .align 2, 0 .pool @08055118: ldrh r0, [r6] cmp r0, 0 beq @0805512C ldr r0, =0x02024332 movs r1, 0 strb r1, [r0, 0x5] b @08055132 .align 2, 0 .pool @0805512C: ldr r1, =0x02024332 movs r0, 0x1 @08055130: strb r0, [r1, 0x5] @08055132: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8054EB4 thumb_func_start sub_8055148 sub_8055148: ; 8055148 push {r4,lr} ldr r3, =0x02024084 ldr r4, =0x0202420c ldrb r0, [r4] movs r2, 0x58 muls r0, r2 adds r0, r3 adds r0, 0x20 ldrb r1, [r0] adds r0, r1, 0 cmp r0, 0 beq @0805519C cmp r0, 0x19 beq @0805519C ldr r0, =0x0202420b ldrb r0, [r0] muls r0, r2 adds r0, r3 adds r0, 0x20 strb r1, [r0] ldr r1, =0x0202420a ldrb r0, [r4] muls r0, r2 adds r0, r3 adds r0, 0x20 ldrb r0, [r0] strb r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @080551B6 .align 2, 0 .pool @0805519C: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @080551B6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8055148 thumb_func_start atkD4_802C408 atkD4_802C408: ; 80551C0 push {r4-r7,lr} ldr r7, =0x02024214 ldr r2, [r7] ldrb r3, [r2, 0x1] cmp r3, 0 beq @080551D8 cmp r3, 0x1 beq @08055210 b @0805528C .align 2, 0 .pool @080551D8: ldr r1, =0x020243d0 ldr r4, =0x0202420b adds r0, r1, 0 adds r0, 0x20 ldrb r5, [r4] adds r3, r0, r5 ldrb r0, [r3] cmp r0, 0 bne @0805525C movs r0, 0x2 strb r0, [r3] ldrb r0, [r4] adds r1, 0x24 adds r1, r0, r1 ldr r2, =0x0202406e lsls r0, 1 adds r0, r2 ldrh r0, [r0] strb r0, [r1] ldr r0, [r7] adds r0, 0x6 b @0805528A .align 2, 0 .pool @08055210: ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x4 strb r0, [r1, 0x1] ldr r4, =0x0202420c ldrb r0, [r4] strb r0, [r1, 0x2] ldr r0, =0x020243d0 adds r0, 0x24 ldrb r5, [r4] adds r0, r5 ldrb r0, [r0] strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, =0x020241f0 ldr r6, =0x02024084 ldrb r0, [r4] movs r5, 0x58 muls r0, r5 adds r0, r6 ldrh r0, [r0, 0x2C] lsrs r0, 1 str r0, [r1] cmp r0, 0 bne @08055248 str r3, [r1] @08055248: ldr r0, [r1] negs r0, r0 str r0, [r1] ldrb r0, [r4] muls r0, r5 adds r0, r6 ldrh r1, [r0, 0x28] ldrh r0, [r0, 0x2C] cmp r1, r0 bne @08055288 @0805525C: ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x5] lsls r0, 24 orrs r1, r0 str r1, [r7] b @0805528C .align 2, 0 .pool @08055288: adds r0, r2, 0x6 @0805528A: str r0, [r7] @0805528C: pop {r4-r7} pop {r0} bx r0 thumb_func_end atkD4_802C408 thumb_func_start sub_8055294 sub_8055294: ; 8055294 push {lr} ldr r1, =0x020242ac ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 2 adds r2, r0, r1 ldr r1, [r2] movs r3, 0x80 lsls r3, 3 adds r0, r1, 0 ands r0, r3 cmp r0, 0 beq @080552D8 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @080552E4 .align 2, 0 .pool @080552D8: orrs r1, r3 str r1, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @080552E4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8055294 thumb_func_start atkD6_doubledamagedealtifdamaged atkD6_doubledamagedealtifdamaged: ; 80552EC push {lr} ldr r3, =0x0202433c ldr r0, =0x0202420b ldrb r0, [r0] lsls r2, r0, 4 adds r0, r3, 0x4 adds r0, r2, r0 ldr r0, [r0] cmp r0, 0 beq @0805530C adds r0, r2, r3 ldr r1, =0x0202420c ldrb r0, [r0, 0xC] ldrb r1, [r1] cmp r0, r1 beq @08055324 @0805530C: adds r0, r3, 0 adds r0, 0x8 adds r0, r2, r0 ldr r0, [r0] cmp r0, 0 beq @0805532A adds r0, r2, r3 ldr r1, =0x0202420c ldrb r0, [r0, 0xD] ldrb r1, [r1] cmp r0, r1 bne @0805532A @08055324: ldr r1, =0x02024474 movs r0, 0x2 strb r0, [r1, 0xE] @0805532A: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkD6_doubledamagedealtifdamaged thumb_func_start sub_805534C sub_805534C: ; 805534C push {r4,lr} ldr r1, =0x020242ac ldr r0, =0x0202420c ldrb r3, [r0] lsls r0, r3, 2 adds r4, r0, r1 ldr r2, [r4] movs r0, 0xC0 lsls r0, 5 ands r0, r2 cmp r0, 0 bne @08055374 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r3 adds r1, 0x4C adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080553A0 @08055374: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @080553B0 .align 2, 0 .pool @080553A0: movs r0, 0x80 lsls r0, 5 orrs r2, r0 str r2, [r4] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @080553B0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805534C thumb_func_start atkD8_setdamagetohealthdifference atkD8_setdamagetohealthdifference: ; 80553BC push {lr} ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r0, [r0] movs r1, 0x58 muls r0, r1 adds r3, r0, r2 ldr r0, =0x0202420b ldrb r0, [r0] muls r0, r1 adds r1, r0, r2 ldrh r0, [r3, 0x28] ldrh r2, [r1, 0x28] cmp r0, r2 bhi @08055408 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @0805541A .align 2, 0 .pool @08055408: ldr r2, =0x020241f0 ldrh r0, [r3, 0x28] ldrh r1, [r1, 0x28] subs r0, r1 str r0, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0805541A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkD8_setdamagetohealthdifference thumb_func_start atkD9_scaledamagebyhealthratio atkD9_scaledamagebyhealthratio: ; 8055428 push {r4,lr} ldr r4, =0x02024400 ldrh r0, [r4] cmp r0, 0 bne @08055464 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r3, [r0, 0x1] ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r1, r0 adds r1, r2 ldrh r0, [r1, 0x28] muls r0, r3 ldrh r1, [r1, 0x2C] bl __divsi3 strh r0, [r4] lsls r0, 16 cmp r0, 0 bne @08055464 movs r0, 0x1 strh r0, [r4] @08055464: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkD9_scaledamagebyhealthratio thumb_func_start atkDA_abilityswap atkDA_abilityswap: ; 805548C push {r4-r6,lr} ldr r5, =0x02024084 ldr r0, =0x0202420b ldrb r0, [r0] movs r4, 0x58 muls r0, r4 adds r0, r5 adds r2, r0, 0 adds r2, 0x20 ldrb r1, [r2] cmp r1, 0 bne @080554B4 ldr r0, =0x0202420c ldrb r0, [r0] muls r0, r4 adds r0, r5 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0 beq @080554D4 @080554B4: cmp r1, 0x19 beq @080554D4 ldr r6, =0x0202420c ldrb r0, [r6] muls r0, r4 adds r0, r5 adds r0, 0x20 ldrb r3, [r0] cmp r3, 0x19 beq @080554D4 ldr r0, =0x0202427c ldrb r1, [r0] movs r0, 0x29 ands r0, r1 cmp r0, 0 beq @08055504 @080554D4: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @0805551A .align 2, 0 .pool @08055504: ldrb r1, [r2] strb r3, [r2] ldrb r0, [r6] muls r0, r4 adds r0, r5 adds r0, 0x20 strb r1, [r0] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0805551A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkDA_abilityswap thumb_func_start atkDB_imprisoneffect atkDB_imprisoneffect: ; 8055524 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r1, =0x020242ac ldr r4, =0x0202420b ldrb r2, [r4] lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 6 ands r0, r1 cmp r0, 0 beq @08055574 b @080555F6 .align 2, 0 .pool @0805554C: ldr r0, =0x020242ac mov r2, r9 ldrb r1, [r2] lsls r1, 2 adds r1, r0 ldr r0, [r1] movs r2, 0x80 lsls r2, 6 orrs r0, r2 str r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @080555EE .align 2, 0 .pool @08055574: adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 mov r8, r0 ldrb r0, [r4] bl sub_803F548 movs r6, 0 b @080555E6 @0805558A: adds r0, r6, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r8, r0 beq @080555E0 movs r4, 0 ldr r7, =0x0202420b mov r9, r7 ldr r0, =0x02024084 mov r12, r0 mov r1, r9 ldrb r0, [r1] mov r2, r12 adds r2, 0xC movs r1, 0x58 muls r0, r1 adds r3, r0, r2 adds r5, r6, 0 muls r5, r1 @080555B4: movs r2, 0 ldrh r1, [r3] mov r0, r12 adds r0, 0xC adds r0, r5, r0 @080555BE: ldrh r7, [r0] cmp r1, r7 bne @080555C8 cmp r1, 0 bne @080555D0 @080555C8: adds r0, 0x2 adds r2, 0x1 cmp r2, 0x3 ble @080555BE @080555D0: cmp r2, 0x4 bne @080555DC adds r3, 0x2 adds r4, 0x1 cmp r4, 0x3 ble @080555B4 @080555DC: cmp r4, 0x4 bne @0805554C @080555E0: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @080555E6: ldr r0, =0x0202406c ldrb r0, [r0] cmp r6, r0 bcc @0805558A @080555EE: ldr r0, =0x0202406c ldrb r0, [r0] cmp r6, r0 bne @08055610 @080555F6: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08055610: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkDB_imprisoneffect thumb_func_start atkDC_setgrudge atkDC_setgrudge: ; 805562C push {lr} ldr r1, =0x020242ac ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 2 adds r2, r0, r1 ldr r1, [r2] movs r3, 0x80 lsls r3, 7 adds r0, r1, 0 ands r0, r3 cmp r0, 0 beq @08055670 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @0805567C .align 2, 0 .pool @08055670: orrs r1, r3 str r1, [r2] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0805567C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkDC_setgrudge thumb_func_start atkDD_weightdamagecalculation atkDD_weightdamagecalculation: ; 8055684 push {r4-r7,lr} mov r7, r8 push {r7} movs r5, 0 ldr r2, =gUnknown_0831C428 ldrh r0, [r2] ldr r1, =0x0000ffff cmp r0, r1 beq @080556FC adds r6, r2, 0 ldr r0, =0x02024084 mov r8, r0 adds r7, r1, 0 adds r4, r6, 0 @080556A0: ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 add r0, r8 ldrh r0, [r0] bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x1 bl sub_80C0630 ldrh r1, [r4] lsls r0, 16 lsrs r0, 16 cmp r1, r0 bhi @080556CE adds r4, 0x4 adds r5, 0x2 ldrh r0, [r4] cmp r0, r7 bne @080556A0 @080556CE: lsls r0, r5, 1 adds r0, r6 ldrh r1, [r0] ldr r0, =0x0000ffff cmp r1, r0 beq @080556FC ldr r0, =0x02024400 adds r1, r5, 0x1 lsls r1, 1 adds r1, r6 ldrh r1, [r1] strh r1, [r0] b @08055702 .align 2, 0 .pool @080556FC: ldr r1, =0x02024400 movs r0, 0x78 strh r0, [r1] @08055702: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkDD_weightdamagecalculation thumb_func_start atkDE_asistattackselect atkDE_asistattackselect: ; 805571C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC movs r0, 0 mov r10, r0 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x18 str r0, [sp, 0x4] ldr r0, =0x0202420b ldrb r0, [r0] bl battle_get_per_side_status movs r1, 0x1 ands r1, r0 ldr r0, =0x020244ec str r0, [sp] cmp r1, 0 beq @0805574C ldr r1, =0x02024744 str r1, [sp] @0805574C: movs r2, 0 @0805574E: ldr r1, =0x0202406e ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 1 adds r0, r1 adds r1, r2, 0x1 str r1, [sp, 0x8] ldrh r0, [r0] cmp r2, r0 beq @080557F4 movs r0, 0x64 adds r6, r2, 0 muls r6, r0 ldr r0, [sp] adds r4, r0, r6 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @080557F4 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @080557F4 movs r5, 0 ldr r1, =0x0000ffff mov r8, r1 mov r9, r6 mov r1, r10 lsls r0, r1, 1 ldr r1, [sp, 0x4] adds r6, r0, r1 @08055798: movs r7, 0 adds r1, r5, 0 adds r1, 0xD ldr r0, [sp] add r0, r9 bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 bl sub_8052F84 lsls r0, 24 adds r1, r5, 0x1 cmp r0, 0 bne @080557EE ldr r0, =gUnknown_0831C3E0 ldrh r2, [r0] adds r3, r0, 0 cmp r2, r8 beq @080557E2 cmp r4, r2 beq @080557D8 ldr r5, =0x0000ffff adds r2, r3, 0 @080557CA: adds r2, 0x2 adds r7, 0x1 ldrh r0, [r2] cmp r0, r5 beq @080557E2 cmp r4, r0 bne @080557CA @080557D8: lsls r0, r7, 1 adds r0, r3 ldrh r0, [r0] cmp r0, r8 bne @080557EE @080557E2: cmp r4, 0 beq @080557EE strh r4, [r6] adds r6, 0x2 movs r0, 0x1 add r10, r0 @080557EE: adds r5, r1, 0 cmp r5, 0x3 ble @08055798 @080557F4: ldr r2, [sp, 0x8] cmp r2, 0x5 ble @0805574E mov r1, r10 cmp r1, 0 beq @0805586C ldr r2, =0x02024280 ldr r0, [r2] ldr r1, =0xfffffbff ands r0, r1 str r0, [r2] ldr r4, =0x020241ee bl GenerateRandomNumber movs r1, 0xFF ands r1, r0 mov r0, r10 muls r0, r1 asrs r0, 8 lsls r0, 1 ldr r1, [sp, 0x4] adds r0, r1 ldrh r0, [r0] strh r0, [r4] ldrh r0, [r4] movs r1, 0 bl sub_80458E0 ldr r1, =0x0202420c strb r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08055886 .align 2, 0 .pool @0805586C: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08055886: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkDE_asistattackselect thumb_func_start atkDF_setmagiccoat atkDF_setmagiccoat: ; 805589C push {lr} ldr r1, =0x0202420c ldr r3, =0x0202420b ldrb r0, [r3] strb r0, [r1] ldr r2, =0x0202437c ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x20 orrs r1, r2 strb r1, [r0] ldr r0, =0x02024082 ldrb r1, [r0] ldr r0, =0x0202406c ldrb r0, [r0] subs r0, 0x1 cmp r1, r0 bne @080558FC ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @08055914 .align 2, 0 .pool @080558FC: ldr r0, =0x0202433c ldrb r1, [r3] lsls r1, 4 adds r1, r0 ldrb r0, [r1] movs r2, 0x10 orrs r0, r2 strb r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08055914: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkDF_setmagiccoat thumb_func_start atkE0_setstealstatchange atkE0_setstealstatchange: ; 8055920 push {lr} ldr r2, =0x0202437c ldr r3, =0x0202420b ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x20 orrs r1, r2 strb r1, [r0] ldr r0, =0x02024082 ldrb r1, [r0] ldr r0, =0x0202406c ldrb r0, [r0] subs r0, 0x1 cmp r1, r0 bne @08055978 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @0805598E .align 2, 0 .pool @08055978: ldr r0, =0x0202433c ldrb r1, [r3] lsls r1, 4 adds r1, r0 ldrb r0, [r1] orrs r0, r2 strb r0, [r1] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0805598E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkE0_setstealstatchange thumb_func_start atkE1_802CBE4 atkE1_802CBE4: ; 805599C push {r4-r6,lr} ldr r4, =0x02024474 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0xD8 ldrb r0, [r0] strb r0, [r4, 0x17] ldrb r0, [r4, 0x17] bl battle_side_get_owner lsls r0, 24 lsrs r5, r0, 24 ldr r2, =0x02022f58 movs r0, 0xFD strb r0, [r2] movs r0, 0x9 strb r0, [r2, 0x1] ldr r3, =0x02024084 ldrb r1, [r4, 0x17] movs r0, 0x58 muls r0, r1 adds r0, r3 adds r0, 0x20 ldrb r0, [r0] strb r0, [r2, 0x2] movs r0, 0xFF strb r0, [r2, 0x3] ldr r2, =0x0202420c ldr r1, =0x0202406c ldrb r0, [r2] ldrb r1, [r1] cmp r0, r1 bcs @08055A22 adds r4, r2, 0 ldr r6, =gUnknown_0832A328 @080559E2: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, r5 beq @08055A04 ldr r0, =0x02024210 ldrb r1, [r0] ldrb r0, [r4] lsls r0, 2 adds r0, r6 ldr r0, [r0] ands r1, r0 ldr r2, =0x0202406c cmp r1, 0 beq @08055A18 @08055A04: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 adds r2, r1, 0 ldrb r1, [r2] cmp r0, r1 bcc @080559E2 @08055A18: ldr r0, =0x0202420c ldrb r0, [r0] ldrb r2, [r2] cmp r0, r2 bcc @08055A64 @08055A22: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @08055A6C .align 2, 0 .pool @08055A64: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08055A6C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkE1_802CBE4 thumb_func_start atkE2_cmde2 atkE2_cmde2: ; 8055A78 push {r4-r6,lr} sub sp, 0x4 ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r4, =0x02024064 strb r0, [r4] ldr r3, =0x02024084 ldrb r0, [r4] movs r6, 0x58 adds r1, r0, 0 muls r1, r6 adds r0, r1, r3 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x1E bne @08055AD2 adds r3, 0x4C adds r1, r3 movs r0, 0 str r0, [r1] ldr r2, =gUnknown_0832A328 ldrb r1, [r4] ldr r0, =0x0202449c ldr r0, [r0] adds r0, r1, r0 adds r0, 0x58 ldrb r0, [r0] lsls r0, 2 adds r0, r2 ldrb r2, [r0] adds r0, r1, 0 muls r0, r6 adds r0, r3 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @08055AD2: ldr r0, [r5] adds r0, 0x2 str r0, [r5] add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkE2_cmde2 thumb_func_start atkE3_jumpiffainted atkE3_jumpiffainted: ; 8055AF4 push {r4,lr} ldr r4, =0x02024214 ldr r0, [r4] ldrb r0, [r0, 0x1] bl get_battle_side_of_something ldr r1, =0x02024064 strb r0, [r1] ldr r2, =0x02024084 ldrb r1, [r1] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0, 0x28] cmp r0, 0 bne @08055B3C ldr r2, [r4] ldrb r1, [r2, 0x2] ldrb r0, [r2, 0x3] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x5] lsls r0, 24 orrs r1, r0 str r1, [r4] b @08055B42 .align 2, 0 .pool @08055B3C: ldr r0, [r4] adds r0, 0x6 str r0, [r4] @08055B42: pop {r4} pop {r0} bx r0 thumb_func_end atkE3_jumpiffainted thumb_func_start sub_8055B48 sub_8055B48: ; 8055B48 push {lr} ldr r0, =0x02022ff0 ldrb r0, [r0] cmp r0, 0x7 bhi @08055BE4 lsls r0, 2 ldr r1, =@08055B64 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08055B64: .4byte @08055B84 .4byte @08055B90 .4byte @08055B9C .4byte @08055BA8 .4byte @08055BB4 .4byte @08055BC0 .4byte @08055BCC .4byte @08055BD8 @08055B84: ldr r1, =0x02024332 movs r0, 0x2 b @08055BE8 .align 2, 0 .pool @08055B90: ldr r1, =0x02024332 movs r0, 0x1 b @08055BE8 .align 2, 0 .pool @08055B9C: ldr r1, =0x02024332 movs r0, 0x1B b @08055BE8 .align 2, 0 .pool @08055BA8: ldr r1, =0x02024332 movs r0, 0x17 b @08055BE8 .align 2, 0 .pool @08055BB4: ldr r1, =0x02024332 movs r0, 0x16 b @08055BE8 .align 2, 0 .pool @08055BC0: ldr r1, =0x02024332 movs r0, 0x18 b @08055BE8 .align 2, 0 .pool @08055BCC: ldr r1, =0x02024332 movs r0, 0x7 b @08055BE8 .align 2, 0 .pool @08055BD8: ldr r1, =0x02024332 movs r0, 0x8 b @08055BE8 .align 2, 0 .pool @08055BE4: ldr r1, =0x02024332 movs r0, 0x5 @08055BE8: strb r0, [r1, 0x3] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =gBaseStats mov r8, r0 @08055C2A: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr strh r0, [r7] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr cmp r0, 0 beq @08055C6C lsls r0, r5, 3 subs r0, r5 lsls r0, 2 add r0, r8 ldrb r0, [r0, 0x17] b @08055C76 .align 2, 0 .pool @08055C6C: lsls r0, r5, 3 subs r0, r5 lsls r0, 2 add r0, r8 ldrb r0, [r0, 0x16] @08055C76: cmp r0, 0x35 bne @08055CB6 cmp r5, 0 beq @08055CB6 movs r0, 0xCE lsls r0, 1 cmp r5, r0 beq @08055CB6 ldrh r0, [r7] cmp r0, 0 bne @08055CB6 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xA bl __umodsi3 lsls r0, 16 cmp r0, 0 bne @08055CB6 bl sub_81AAAE0 strh r0, [r7] movs r0, 0x64 muls r0, r6 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xC mov r2, sp bl pokemon_setattr @08055CB6: adds r6, 0x1 cmp r6, 0x5 ble @08055C2A b @08055DD8 .align 2, 0 .pool @08055CC4: movs r6, 0 movs r1, 0x64 mov r8, r1 ldr r7, =0x020244ec mov r10, sp @08055CCE: mov r4, r8 muls r4, r6 adds r4, r7 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr mov r1, r10 strh r0, [r1] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr cmp r0, 0 beq @08055D30 lsls r0, r5, 3 subs r0, r5 lsls r0, 2 ldr r1, =gBaseStats adds r0, r1 ldrb r0, [r0, 0x17] b @08055D3C .align 2, 0 .pool @08055D10: mov r0, r8 muls r0, r6 adds r0, r7 adds r2, r1, 0 adds r2, 0x63 subs r2, r4 lsls r2, 1 ldr r1, =gRarePickupItems adds r2, r1 movs r1, 0xC bl pokemon_setattr b @08055DD0 .align 2, 0 .pool @08055D30: lsls r0, r5, 3 subs r0, r5 lsls r0, 2 ldr r1, =gBaseStats adds r0, r1 ldrb r0, [r0, 0x16] @08055D3C: adds r1, r6, 0x1 mov r9, r1 cmp r0, 0x35 bne @08055DD0 cmp r5, 0 beq @08055DD0 movs r0, 0xCE lsls r0, 1 cmp r5, r0 beq @08055DD0 mov r1, r10 ldrh r0, [r1] cmp r0, 0 bne @08055DD0 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xA bl __umodsi3 lsls r0, 16 cmp r0, 0 bne @08055DD0 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r4, r0, 16 mov r0, r8 muls r0, r6 adds r0, r7 movs r1, 0x38 bl pokemon_getattr subs r0, 0x1 movs r1, 0xA bl __udivsi3 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x9 bls @08055D9C movs r1, 0x9 @08055D9C: movs r2, 0 b @08055DAE .align 2, 0 .pool @08055DA4: adds r0, r4, 0 subs r0, 0x62 cmp r0, 0x1 bls @08055D10 adds r2, 0x1 @08055DAE: cmp r2, 0x8 bgt @08055DD0 ldr r0, =gPickupProbabilities adds r0, r2, r0 ldrb r0, [r0] cmp r0, r4 ble @08055DA4 mov r0, r8 muls r0, r6 adds r0, r7 adds r2, r1, r2 lsls r2, 1 ldr r1, =gPickupItems adds r2, r1 movs r1, 0xC bl pokemon_setattr @08055DD0: mov r6, r9 cmp r6, 0x5 bgt @08055DD8 b @08055CCE @08055DD8: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8055C00 thumb_func_start atkE6_castform_transform atkE6_castform_transform: ; 8055DFC push {r4,lr} ldr r4, =0x02024064 ldr r0, =0x02024474 ldrb r0, [r0, 0x17] strb r0, [r4] ldr r1, =0x02024084 ldrb r2, [r4] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 ldr r3, =0x0202449c cmp r0, 0 beq @08055E2C ldr r0, [r3] adds r0, 0x7F ldrb r1, [r0] movs r2, 0x80 orrs r1, r2 strb r1, [r0] @08055E2C: ldr r0, [r3] adds r0, 0x7F ldrb r2, [r0] movs r0, 0 movs r1, 0 bl dp01_build_cmdbuf_x34_a_bb_aka_battle_anim ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkE6_castform_transform thumb_func_start atkE7_castform_switch atkE7_castform_switch: ; 8055E64 push {r4,lr} ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r0, =0x02024474 ldrb r0, [r0, 0x17] bl castform_switch lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @08055E8E ldr r0, =gUnknown_082DB4A9 bl b_push_move_exec ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x7F subs r1, r4, 0x1 strb r1, [r0] @08055E8E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkE7_castform_switch thumb_func_start atkE8_settypebasedhalvers atkE8_settypebasedhalvers: ; 8055EA4 push {r4,lr} movs r4, 0 ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] cmp r0, 0xC9 bne @08055EF4 ldr r1, =0x020242ac ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 2 adds r2, r0, r1 ldr r1, [r2] movs r3, 0x80 lsls r3, 9 adds r0, r1, 0 ands r0, r3 cmp r0, 0 bne @08055F18 orrs r1, r3 str r1, [r2] ldr r0, =0x02024332 strb r4, [r0, 0x5] b @08055F1C .align 2, 0 .pool @08055EF4: ldr r1, =0x020242ac ldr r0, =0x0202420b ldrb r0, [r0] lsls r0, 2 adds r2, r0, r1 ldr r1, [r2] movs r3, 0x80 lsls r3, 10 adds r0, r1, 0 ands r0, r3 cmp r0, 0 bne @08055F18 orrs r1, r3 str r1, [r2] ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] movs r4, 0x1 @08055F18: cmp r4, 0 beq @08055F38 @08055F1C: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08055F52 .align 2, 0 .pool @08055F38: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08055F52: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkE8_settypebasedhalvers thumb_func_start atkE9_seteffectbyweather atkE9_seteffectbyweather: ; 8055F5C push {lr} sub sp, 0x4 movs r0, 0 str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08055FFC str r0, [sp] movs r0, 0x13 movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @08055FFC ldr r2, =0x020243cc ldrb r0, [r2] cmp r0, 0 beq @08055F9A ldr r1, =0x02024474 movs r0, 0x2 strb r0, [r1, 0xE] @08055F9A: ldrh r1, [r2] movs r0, 0x7 ands r0, r1 cmp r0, 0 beq @08055FB8 ldr r0, =0x0202449c ldr r1, [r0] movs r0, 0x8B b @08055FFA .align 2, 0 .pool @08055FB8: movs r0, 0x18 ands r0, r1 cmp r0, 0 beq @08055FCC ldr r0, =0x0202449c ldr r1, [r0] movs r0, 0x85 b @08055FFA .align 2, 0 .pool @08055FCC: movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @08055FE0 ldr r0, =0x0202449c ldr r1, [r0] movs r0, 0x8A b @08055FFA .align 2, 0 .pool @08055FE0: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08055FF4 ldr r0, =0x0202449c ldr r1, [r0] movs r0, 0x8F b @08055FFA .align 2, 0 .pool @08055FF4: ldr r0, =0x0202449c ldr r1, [r0] movs r0, 0x80 @08055FFA: strb r0, [r1, 0x13] @08055FFC: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkE9_seteffectbyweather thumb_func_start atkEA_recycleitem atkEA_recycleitem: ; 8056014 push {r4-r7,lr} sub sp, 0x4 ldr r7, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r7] ldr r1, =0x0202449c ldrb r2, [r7] lsls r0, r2, 1 adds r0, 0xB8 ldr r1, [r1] adds r6, r1, r0 ldrh r5, [r6] cmp r5, 0 beq @08056094 ldr r4, =0x02024084 movs r3, 0x58 adds r0, r2, 0 muls r0, r3 adds r0, r4 ldrh r0, [r0, 0x2E] cmp r0, 0 bne @08056094 ldr r1, =0x02024208 strh r5, [r1] strh r0, [r6] ldrb r0, [r7] muls r0, r3 adds r0, r4 ldrh r1, [r1] strh r1, [r0, 0x2E] ldrb r0, [r7] muls r0, r3 adds r1, r4, 0 adds r1, 0x2E adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x2 movs r2, 0 movs r3, 0x2 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r7] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @080560AE .align 2, 0 .pool @08056094: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @080560AE: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkEA_recycleitem thumb_func_start atkEB_settypetoterrain atkEB_settypetoterrain: ; 80560BC push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x02024084 mov r8, r0 ldr r7, =0x0202420b ldrb r0, [r7] movs r6, 0x58 muls r0, r6 mov r1, r8 adds r3, r0, r1 movs r0, 0x21 adds r0, r3 mov r12, r0 ldr r5, =gUnknown_0831C483 ldr r4, =0x02022ff0 ldrb r0, [r4] adds r0, r5 ldrb r2, [r0] mov r1, r12 ldrb r0, [r1] adds r1, r2, 0 cmp r0, r1 beq @08056144 adds r0, r3, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, r1 beq @08056144 mov r0, r12 strb r2, [r0] ldrb r0, [r7] adds r1, r0, 0 muls r1, r6 add r1, r8 ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] adds r1, 0x22 strb r0, [r1] ldr r1, =0x02022f58 movs r0, 0xFD strb r0, [r1] movs r0, 0x3 strb r0, [r1, 0x1] ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] strb r0, [r1, 0x2] movs r0, 0xFF strb r0, [r1, 0x3] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @0805615E .align 2, 0 .pool @08056144: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @0805615E: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkEB_settypetoterrain thumb_func_start atkEC_802D2A0 atkEC_802D2A0: ; 805616C push {r4-r6,lr} ldr r5, =0x0202420b ldrb r0, [r5] bl battle_get_per_side_status movs r1, 0x2 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r4, =0x02024064 strb r0, [r4] ldr r0, =0x02022fec ldr r0, [r0] movs r6, 0x1 ands r0, r6 cmp r0, 0 beq @0805620C ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r3, [r4] lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0805620C ldr r0, =0x0202421c adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 bne @0805620C ldr r1, =0x02024274 lsls r0, r3, 1 adds r0, r1 ldrh r2, [r0] cmp r2, 0xE4 bne @0805620C ldr r0, =0x0202407a adds r0, r3, r0 movs r1, 0xB strb r1, [r0] ldr r0, =0x020241ea strh r2, [r0] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] ldr r0, =0x02024474 strb r6, [r0, 0x18] ldrb r1, [r5] adds r0, 0x20 strb r1, [r0] ldrb r0, [r4] strb r0, [r5] b @08056226 .align 2, 0 .pool @0805620C: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08056226: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkEC_802D2A0 thumb_func_start atkED_802D364 atkED_802D364: ; 8056230 push {r4,lr} ldr r1, =0x0202420e ldr r3, =0x0202420b ldrb r0, [r3] strb r0, [r1] ldr r2, =0x0202420c lsls r0, 24 lsrs r0, 24 adds r4, r1, 0 ldrb r1, [r2] cmp r0, r1 bne @08056264 ldr r1, =0x02024474 ldrb r0, [r1, 0x17] strb r0, [r2] strb r0, [r3] b @0805626A .align 2, 0 .pool @08056264: ldr r1, =0x02024474 ldrb r0, [r1, 0x17] strb r0, [r2] @0805626A: ldrb r0, [r4] strb r0, [r1, 0x17] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkED_802D364 thumb_func_start atkEE_removereflectlightscreen atkEE_removereflectlightscreen: ; 8056284 push {r4,lr} ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02024294 lsls r3, r0, 1 adds r0, r3, r0 lsls r0, 2 adds r4, r0, r1 ldrb r0, [r4] cmp r0, 0 bne @080562AC ldrb r1, [r4, 0x2] cmp r1, 0 beq @080562E4 @080562AC: ldr r2, =0x0202428e adds r2, r3, r2 ldrh r1, [r2] ldr r0, =0x0000fffe ands r0, r1 movs r3, 0 ldr r1, =0x0000fffd ands r0, r1 strh r0, [r2] strb r3, [r4] strb r3, [r4, 0x2] ldr r1, =0x02024474 movs r0, 0x1 strb r0, [r1, 0x18] strb r0, [r1, 0x19] b @080562EA .align 2, 0 .pool @080562E4: ldr r0, =0x02024474 strb r1, [r0, 0x18] strb r1, [r0, 0x19] @080562EA: ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkEE_removereflectlightscreen thumb_func_start sub_8056300 sub_8056300: ; 8056300 push {r4-r6,lr} movs r4, 0 ldr r0, =0x02024068 ldr r0, [r0] cmp r0, 0 beq @0805630E b @08056696 @0805630E: ldr r5, =0x02024064 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r5] ldr r6, =0x0202420c movs r1, 0x1 eors r0, r1 strb r0, [r6] ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @0805635C movs r0, 0 movs r1, 0x5 bl dp01_build_cmdbuf_x0D_a ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, =gUnknown_082DBE02 b @08056694 .align 2, 0 .pool @0805635C: movs r0, 0x80 lsls r0, 2 ands r1, r0 cmp r1, 0 beq @08056384 movs r0, 0 movs r1, 0x4 bl dp01_build_cmdbuf_x0D_a ldrb r0, [r5] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, =gUnknown_082DBDCA b @08056694 .align 2, 0 .pool @08056384: ldr r0, =0x02024208 ldrh r0, [r0] cmp r0, 0x5 bne @080563B0 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x7C ldrb r0, [r0] lsls r1, r0, 2 adds r1, r0 lsls r0, r1, 8 subs r0, r1 movs r1, 0x64 bl __divsi3 lsls r0, 24 lsrs r5, r0, 24 b @080563C8 .align 2, 0 .pool @080563B0: ldr r3, =gBaseStats ldr r2, =0x02024084 ldrb r1, [r6] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r3 ldrb r5, [r0, 0x8] @080563C8: ldr r2, =0x02024208 ldrh r0, [r2] cmp r0, 0x5 bhi @080563D2 b @080564C8 @080563D2: subs r0, 0x6 cmp r0, 0x6 bls @080563DA b @080564D2 @080563DA: lsls r0, 2 ldr r1, =@080563F4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080563F4: .4byte @08056410 .4byte @08056440 .4byte @08056452 .4byte @08056480 .4byte @080564B0 .4byte @08056472 .4byte @08056472 @08056410: ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r1, r0, 0 adds r1, 0x21 ldrb r1, [r1] cmp r1, 0xB beq @080564A4 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0xB beq @080564A4 cmp r1, 0x6 beq @080564A4 cmp r0, 0x6 beq @080564A4 b @08056472 .align 2, 0 .pool @08056440: bl sav1_map_get_light_level lsls r0, 24 lsrs r0, 24 movs r4, 0xA cmp r0, 0x5 bne @080564D2 movs r4, 0x23 b @080564D2 @08056452: ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x2A ldrb r1, [r0] cmp r1, 0x27 bhi @08056472 movs r0, 0x28 subs r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x9 bhi @080564D2 @08056472: movs r4, 0xA b @080564D2 .align 2, 0 .pool @08056480: ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r0, [r0] bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x1 bl pokedex_flag_operation lsls r0, 24 movs r4, 0xA cmp r0, 0 beq @080564D2 @080564A4: movs r4, 0x1E b @080564D2 .align 2, 0 .pool @080564B0: ldr r0, =0x03005d10 ldrb r0, [r0, 0x13] adds r0, 0xA lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x28 bls @080564D2 movs r4, 0x28 b @080564D2 .align 2, 0 .pool @080564C8: ldr r1, =gUnknown_0831C48D ldrh r0, [r2] subs r0, 0x2 adds r0, r1 ldrb r4, [r0] @080564D2: adds r0, r5, 0 muls r0, r4 movs r1, 0xA bl __divsi3 ldr r5, =0x02024084 ldr r1, =0x0202420c ldrb r2, [r1] movs r1, 0x58 adds r4, r2, 0 muls r4, r1 adds r3, r4, r5 ldrh r2, [r3, 0x2C] lsls r1, r2, 1 adds r1, r2 ldrh r2, [r3, 0x28] lsls r2, 1 subs r2, r1, r2 muls r0, r2 bl __divsi3 adds r6, r0, 0 adds r5, 0x4C adds r4, r5 ldr r4, [r4] movs r0, 0x27 ands r0, r4 cmp r0, 0 beq @0805650E lsls r6, 1 @0805650E: movs r0, 0xD8 ands r4, r0 cmp r4, 0 beq @08056522 lsls r0, r6, 4 subs r0, r6 movs r1, 0xA bl __udivsi3 adds r6, r0, 0 @08056522: ldr r1, =0x02024208 ldrh r0, [r1] cmp r0, 0x5 beq @08056564 cmp r0, 0x1 bne @08056550 ldr r0, =0x03005d10 ldrb r1, [r0, 0x5] movs r2, 0x2 orrs r1, r2 strb r1, [r0, 0x5] b @08056564 .align 2, 0 .pool @08056550: ldr r0, =0x03005d10 ldrh r1, [r1] adds r0, r1 adds r1, r0, 0 adds r1, 0x34 ldrb r0, [r1] cmp r0, 0xFE bhi @08056564 adds r0, 0x1 strb r0, [r1] @08056564: cmp r6, 0xFE bls @080565C8 movs r0, 0 movs r1, 0x4 bl dp01_build_cmdbuf_x0D_a ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution ldr r1, =0x02024214 ldr r0, =gUnknown_082DBD84 str r0, [r1] ldr r1, =0x0202406e ldr r0, =0x0202420c ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 ldr r2, =0x02024208 movs r1, 0x26 bl pokemon_setattr bl calc_player_party_count lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 beq @08056656 b @08056680 .align 2, 0 .pool @080565C8: movs r0, 0xFF lsls r0, 16 adds r1, r6, 0 bl __udivsi3 bl Sqrt lsls r0, 16 lsrs r0, 16 bl Sqrt lsls r0, 16 lsrs r6, r0, 16 ldr r0, =0x000ffff0 adds r1, r6, 0 bl __udivsi3 adds r6, r0, 0 movs r4, 0 b @080565FA .align 2, 0 .pool @080565F4: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @080565FA: cmp r4, 0x3 bhi @0805660A bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 cmp r0, r6 bcc @080565F4 @0805660A: ldr r5, =0x02024208 ldrh r0, [r5] cmp r0, 0x1 bne @08056614 movs r4, 0x4 @08056614: movs r0, 0 adds r1, r4, 0 bl dp01_build_cmdbuf_x0D_a ldr r0, =0x02024064 ldrb r0, [r0] bl dp01_battle_side_mark_buffer_for_execution cmp r4, 0x4 bne @0805668C ldr r1, =0x02024214 ldr r0, =gUnknown_082DBD84 str r0, [r1] ldr r1, =0x0202406e ldr r0, =0x0202420c ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x26 adds r2, r5, 0 bl pokemon_setattr bl calc_player_party_count lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 bne @08056680 @08056656: ldr r1, =0x02024332 movs r0, 0 strb r0, [r1, 0x5] b @08056696 .align 2, 0 .pool @08056680: ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x5] b @08056696 .align 2, 0 .pool @0805668C: ldr r0, =0x02024332 strb r4, [r0, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DBDD4 @08056694: str r0, [r1] @08056696: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8056300 thumb_func_start atkF0_catch_pokemon atkF0_catch_pokemon: ; 80566A8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x0202406e mov r9, r0 ldr r5, =0x0202420b ldrb r0, [r5] movs r6, 0x1 eors r0, r6 lsls r0, 1 add r0, r9 ldrh r0, [r0] movs r7, 0x64 muls r0, r7 ldr r1, =0x02024744 mov r8, r1 add r0, r8 bl pokemon_catch lsls r0, 24 cmp r0, 0 beq @08056792 bl sub_813B21C lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08056734 ldr r0, =0x02024332 strb r1, [r0, 0x5] ldr r4, =0x02021cc4 ldr r0, =0x00004036 bl 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, =0x02021dc4 movs r1, 0x2 bl pokemon_getattr b @0805677E .align 2, 0 .pool @08056734: ldr r4, =0x02021cc4 ldr r0, =0x00004036 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, =0x02021dc4 movs r1, 0x2 bl pokemon_getattr ldr r4, =0x02021ec4 bl get_unknown_box_id lsls r0, 24 lsrs r0, 24 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy ldr r1, =0x02024332 movs r0, 0x2 strb r0, [r1, 0x5] @0805677E: ldr r0, =0x000008ab bl flag_check lsls r0, 24 cmp r0, 0 beq @08056792 ldr r1, =0x02024332 ldrb r0, [r1, 0x5] adds r0, 0x1 strb r0, [r1, 0x5] @08056792: ldr r0, =0x0202406e mov r10, r0 ldr r1, =0x0202420b mov r9, r1 ldrb r0, [r1] movs r4, 0x1 eors r0, r4 lsls r0, 1 add r0, r10 ldrh r0, [r0] movs r1, 0x64 mov r8, r1 mov r1, r8 muls r1, r0 adds r0, r1, 0 ldr r6, =0x02024744 adds r0, r6 movs r1, 0xB movs r2, 0 bl pokemon_getattr ldr r5, =0x03005d10 strh r0, [r5, 0x28] mov r1, r9 ldrb r0, [r1] eors r0, r4 lsls r0, 1 add r0, r10 ldrh r0, [r0] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r6 adds r2, r5, 0 adds r2, 0x2A movs r1, 0x2 bl pokemon_getattr mov r1, r9 ldrb r0, [r1] eors r4, r0 lsls r4, 1 add r4, r10 ldrh r0, [r4] mov r1, r8 muls r1, r0 adds r0, r1, 0 adds r0, r6 movs r1, 0x26 movs r2, 0 bl pokemon_getattr movs r1, 0xF ands r0, r1 lsls r0, 2 ldrb r2, [r5, 0x5] movs r1, 0x3D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r5, 0x5] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkF0_catch_pokemon thumb_func_start atkF1_802D95C atkF1_802D95C: ; 8056850 push {r4,r5,lr} ldr r4, =0x02024744 adds r0, r4, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 adds r0, r5, 0 bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x1 bl pokedex_flag_operation lsls r0, 24 cmp r0, 0 beq @080568A8 ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] b @080568C2 .align 2, 0 .pool @080568A8: adds r0, r5, 0 bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x3 adds r2, r4, 0 bl sub_806F01C ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @080568C2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkF1_802D95C thumb_func_start sub_80568CC sub_80568CC: ; 80568CC push {r4,lr} sub sp, 0x4 ldr r0, =0x02024744 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x02024332 ldrb r0, [r0] cmp r0, 0x5 bls @080568E8 b @08056A2C @080568E8: lsls r0, 2 ldr r1, =@08056900 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08056900: .4byte @08056918 .4byte @0805692A .4byte @08056978 .4byte @080569C8 .4byte @080569E0 .4byte @08056A18 @08056918: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @08056A06 @0805692A: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08056938 b @08056A2C @08056938: bl Window_FreeMemory adds r0, r4, 0 bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 ldr r3, =0x02024084 ldr r1, =0x0202420c ldrb r2, [r1] movs r1, 0x58 muls r2, r1 adds r1, r3, 0 adds r1, 0x54 adds r1, r2, r1 ldr r1, [r1] adds r3, 0x48 adds r2, r3 ldr r2, [r2] bl sub_80BFDF4 ldr r1, =0x02024332 strb r0, [r1, 0x1] b @08056A08 .align 2, 0 .pool @08056978: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08056A2C ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 bne @08056A2C ldr r2, =0x03005e00 ldr r4, =0x02024332 ldrb r1, [r4, 0x1] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x4] cmp r0, 0 bne @08056A2C ldr r0, =vblank_cb_08078BB4 bl SetVBlankCallback ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @08056A2C .align 2, 0 .pool @080569C8: bl c2_berry_program_update_menu bl sub_8035AA4 ldr r1, =0x02022e20 movs r2, 0x80 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] b @08056A06 .align 2, 0 .pool @080569E0: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08056A2C ldr r0, =0x0000ffff str r1, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 movs r0, 0 bl gpu_sync_bg_show movs r0, 0x3 bl gpu_sync_bg_show @08056A06: ldr r1, =0x02024332 @08056A08: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08056A2C .align 2, 0 .pool @08056A18: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08056A2C ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] @08056A2C: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80568CC thumb_func_start sub_8056A3C sub_8056A3C: ; 8056A3C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x20 ldr r4, [sp, 0x40] lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r1, 24 lsrs r1, 24 str r1, [sp, 0x10] lsls r2, 24 lsrs r2, 24 str r2, [sp, 0x1C] lsls r3, 24 lsrs r3, 24 str r3, [sp, 0x14] lsls r4, 24 lsrs r4, 24 mov r10, r4 movs r1, 0 add r0, sp, 0xC strh r1, [r0] ldr r6, [sp, 0x10] cmp r6, r3 ble @08056A76 b @08056B62 @08056A76: mov r4, r8 adds r0, r6, 0x1 str r0, [sp, 0x18] ldr r2, [sp, 0x1C] cmp r4, r2 bgt @08056B58 add r5, sp, 0xC lsls r7, r6, 24 mov r9, r7 @08056A88: ldr r0, [sp, 0x10] cmp r6, r0 bne @08056AB4 cmp r4, r8 bne @08056A9C ldr r0, =0x00001022 b @08056AFE .align 2, 0 .pool @08056A9C: ldr r2, [sp, 0x1C] cmp r4, r2 bne @08056AAC ldr r0, =0x00001024 b @08056AFE .align 2, 0 .pool @08056AAC: ldr r0, =0x00001023 b @08056AFE .align 2, 0 .pool @08056AB4: ldr r7, [sp, 0x14] cmp r6, r7 bne @08056AE0 cmp r4, r8 bne @08056AC8 ldr r0, =0x00001028 b @08056AFE .align 2, 0 .pool @08056AC8: ldr r0, [sp, 0x1C] cmp r4, r0 bne @08056AD8 ldr r0, =0x0000102a b @08056AFE .align 2, 0 .pool @08056AD8: ldr r0, =0x00001029 b @08056AFE .align 2, 0 .pool @08056AE0: cmp r4, r8 bne @08056AEC ldr r0, =0x00001025 b @08056AFE .align 2, 0 .pool @08056AEC: ldr r2, [sp, 0x1C] cmp r4, r2 bne @08056AFC ldr r0, =0x00001027 b @08056AFE .align 2, 0 .pool @08056AFC: ldr r0, =0x00001026 @08056AFE: strh r0, [r5] movs r1, 0x1 mov r0, r10 ands r0, r1 cmp r0, 0 beq @08056B0E movs r0, 0 strh r0, [r5] @08056B0E: movs r0, 0x80 mov r7, r10 ands r0, r7 cmp r0, 0 beq @08056B38 lsls r2, r4, 24 lsrs r2, 24 str r1, [sp] str r1, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0x1 add r1, sp, 0xC mov r7, r9 lsrs r3, r7, 24 bl bg_copy_tilemap_rect_simple b @08056B50 .align 2, 0 .pool @08056B38: lsls r2, r4, 24 lsrs r2, 24 str r1, [sp] str r1, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC mov r7, r9 lsrs r3, r7, 24 bl 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, =0x00001016 strh r1, [r0] strh r1, [r0, 0x2] lsls r3, 25 movs r0, 0x90 lsls r0, 20 adds r3, r0 lsrs r3, 24 movs r0, 0x1 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC movs r2, 0x19 bl 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 .pool thumb_func_end sub_8056BAC thumb_func_start atkF3_receive_new_pokemon_maybe atkF3_receive_new_pokemon_maybe: ; 8056BEC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 ldr r0, =0x02024332 ldrb r1, [r0] adds r4, r0, 0 cmp r1, 0x4 bls @08056C04 b @08056E62 @08056C04: lsls r0, r1, 2 ldr r1, =@08056C18 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08056C18: .4byte @08056C2C .4byte @08056C60 .4byte @08056CFC .4byte @08056DD4 .4byte @08056E2C @08056C2C: movs r4, 0 str r4, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C ldr r0, =gUnknown_085CCABB movs r1, 0xC bl battle_show_message_maybe ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] strb r4, [r1, 0x1] movs r0, 0 bl sub_8056B74 b @08056E62 .align 2, 0 .pool @08056C60: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @08056C86 ldrb r0, [r4, 0x1] cmp r0, 0 beq @08056C86 movs r0, 0x5 bl audio_play ldrb r0, [r4, 0x1] bl sub_8056BAC movs r0, 0 strb r0, [r4, 0x1] bl sub_8056B74 @08056C86: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08056CAE ldr r4, =0x02024332 ldrb r0, [r4, 0x1] cmp r0, 0 bne @08056CAE movs r0, 0x5 bl audio_play ldrb r0, [r4, 0x1] bl sub_8056BAC movs r0, 0x1 strb r0, [r4, 0x1] bl sub_8056B74 @08056CAE: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08056CE0 movs r0, 0x5 bl audio_play ldr r1, =0x02024332 ldrb r0, [r1, 0x1] cmp r0, 0 bne @08056CF2 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r0, 0x3 bl sub_80A2390 b @08056E62 .align 2, 0 .pool @08056CE0: movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08056CEA b @08056E62 @08056CEA: movs r0, 0x5 bl audio_play ldr r1, =0x02024332 @08056CF2: movs r0, 0x4 strb r0, [r1] b @08056E62 .align 2, 0 .pool @08056CFC: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08056D0A b @08056E62 @08056D0A: ldr r7, =0x0202406e ldr r0, =0x0202420b mov r10, r0 ldrb r0, [r0] movs r4, 0x1 eors r0, r4 lsls r0, 1 adds r0, r7 ldrh r0, [r0] movs r1, 0x64 mov r9, r1 mov r2, r9 muls r2, r0 adds r0, r2, 0 ldr r1, =0x02024744 mov r8, r1 add r0, r8 ldr r1, =0x0202449c ldr r2, [r1] adds r2, 0x6D movs r1, 0x2 bl pokemon_getattr bl 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, =0x0202449c ldr r1, [r2] adds r1, 0x6D str r0, [sp] ldr r0, =sub_8038420 str r0, [sp, 0x4] movs r0, 0x2 adds r2, r6, 0 adds r3, r5, 0 bl do_choose_name_or_words_screen ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08056E62 .align 2, 0 .pool @08056DD4: ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 bne @08056E62 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08056E62 ldr r2, =0x0202406e ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x1 eors r0, r1 lsls r0, 1 adds r0, r2 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 ldr r1, =0x0202449c ldr r2, [r1] adds r2, 0x6D movs r1, 0x2 bl pokemon_setattr b @08056E48 .align 2, 0 .pool @08056E2C: bl calc_player_party_count lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 bne @08056E48 ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x5 str r0, [r1] b @08056E62 .align 2, 0 .pool @08056E48: ldr r3, =0x02024214 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0x3] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0x4] lsls r0, 24 orrs r1, r0 str r1, [r3] @08056E62: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atkF3_receive_new_pokemon_maybe thumb_func_start sub_8056E78 sub_8056E78: ; 8056E78 ldr r2, =0x02024084 ldr r0, =0x0202420b ldrb r1, [r0] movs r0, 0x58 muls r1, r0 adds r1, r2 ldr r0, =0x020241f0 ldr r2, [r0] ldrh r0, [r1, 0x28] subs r0, r2 strh r0, [r1, 0x28] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8056E78 thumb_func_start atkF5_reset_attacker_bd_x4C atkF5_reset_attacker_bd_x4C: ; 8056EA8 ldr r1, =0x02024084 ldr r0, =0x0202420b ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x4C adds r0, r1 movs r1, 0 str r1, [r0] ldr r1, =0x02024214 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end atkF5_reset_attacker_bd_x4C thumb_func_start sub_8056ED0 sub_8056ED0: ; 8056ED0 ldr r1, =0x02024083 movs r0, 0xC strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8056ED0 thumb_func_start sub_8056EDC sub_8056EDC: ; 8056EDC ldr r1, =0x02024083 movs r0, 0xC strb r0, [r1] ldr r1, =0x02024082 ldr r0, =0x0202406c ldrb r0, [r0] strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8056EDC thumb_func_start sub_8056EF8 sub_8056EF8: ; 8056EF8 push {r4,r5,lr} ldr r5, =0x02024214 ldr r0, [r5] ldrb r0, [r0, 0x1] bl battle_get_side_with_given_state ldr r4, =0x02024064 strb r0, [r4] movs r0, 0 bl dp01_build_cmdbuf_x09_9_9_9 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution ldr r0, [r5] adds r0, 0x2 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8056EF8 thumb_func_start sub_8056F28 sub_8056F28: ; 8056F28 push {r4-r6,lr} ldr r5, =0x020244a8 ldr r6, =0x02022fec ldr r0, [r6] movs r1, 0x80 lsls r1, 19 ands r0, r1 cmp r0, 0 beq @08056F3E bl sub_81D55D0 @08056F3E: ldr r4, =0x0202449c movs r0, 0xA9 lsls r0, 2 bl 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, =0x020244a0 movs r5, 0x80 lsls r5, 5 adds r0, r5, 0 bl malloc_and_clear str r0, [r4] ldr r4, =0x020244a4 adds r0, r5, 0 bl malloc_and_clear str r0, [r4] ldr r4, =0x0202305c movs r0, 0x80 lsls r0, 6 bl malloc_and_clear str r0, [r4] ldr r4, =0x02023060 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, =0x00004054 bl var_get lsls r0, 16 lsrs r0, 16 ldr r2, =0x03005d8c lsls r1, r0, 2 adds r1, r0 lsls r1, 5 ldr r0, =0x00001a9c adds r1, r0 ldr r0, [r2] adds r0, r1 bl create_enemy_party @08056FFA: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8056F28 thumb_func_start sub_8057028 sub_8057028: ; 8057028 push {r4-r6,lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 19 ands r0, r1 cmp r0, 0 beq @0805703C bl sub_81D5694 @0805703C: ldr r6, =0x020244a8 ldr r0, [r6] cmp r0, 0 beq @080570D0 ldr r4, =0x0202449c ldr r0, [r4] bl free movs r5, 0 str r5, [r4] ldr r0, [r6] ldr r0, [r0] bl free ldr r0, [r6] str r5, [r0] ldr r0, [r0, 0x4] bl free ldr r0, [r6] str r5, [r0, 0x4] ldr r0, [r0, 0x8] bl free ldr r0, [r6] str r5, [r0, 0x8] ldr r0, [r0, 0xC] bl free ldr r0, [r6] str r5, [r0, 0xC] ldr r0, [r0, 0x10] bl free ldr r0, [r6] str r5, [r0, 0x10] ldr r0, [r0, 0x14] bl free ldr r0, [r6] str r5, [r0, 0x14] ldr r0, [r0, 0x18] bl free ldr r0, [r6] str r5, [r0, 0x18] ldr r0, [r0, 0x1C] bl free ldr r0, [r6] str r5, [r0, 0x1C] bl free str r5, [r6] ldr r4, =0x020244a0 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x020244a4 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0202305c ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x02023060 ldr r0, [r4] bl free str r5, [r4] @080570D0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8057028 thumb_func_start sub_80570F4 sub_80570F4: ; 80570F4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08057140 movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r4, r0, 24 movs r0, 0x3 bl battle_get_side_with_given_state lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x02024084 movs r0, 0x58 adds r1, r3, 0 muls r1, r0 adds r1, r2 adds r1, 0x2A muls r0, r4 adds r0, r2 adds r0, 0x2A ldrb r1, [r1] ldrb r0, [r0] cmp r1, r0 bls @0805714A adds r4, r3, 0 b @0805714A .align 2, 0 .pool @08057140: movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r4, r0, 24 @0805714A: ldr r2, =0x02024084 movs r1, 0x58 adds r0, r4, 0 muls r0, r1 adds r0, r2 adds r3, r0, 0 adds r3, 0x2A adds r0, r5, 0 muls r0, r1 adds r0, r2 adds r1, r0, 0 adds r1, 0x2A ldrb r0, [r3] ldrb r2, [r1] cmp r0, r2 bls @080571B8 ldrb r1, [r1] subs r0, r1 cmp r0, 0x1D ble @08057198 ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x8 bl happiness_algorithm b @080571CE .align 2, 0 .pool @08057198: ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x6 bl happiness_algorithm b @080571CE .align 2, 0 .pool @080571B8: ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x6 bl happiness_algorithm @080571CE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80570F4 thumb_func_start sub_80571DC sub_80571DC: ; 80571DC push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 lsrs r7, r1, 24 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08057248 movs r2, 0 ldr r6, =0x0202406e lsls r3, r4, 1 ldr r5, =0x0203cf00 ldr r4, =0x0202449c @080571FE: adds r0, r2, r5 ldr r1, [r4] adds r1, r2, r1 adds r1, 0x60 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x2 ble @080571FE adds r0, r3, r6 ldrb r0, [r0] bl pokemon_order_func adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r7, 0 bl pokemon_order_func adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_81B8FB0 movs r2, 0 ldr r4, =0x0202449c ldr r3, =0x0203cf00 @08057236: ldr r0, [r4] adds r0, r2, r0 adds r0, 0x60 adds r1, r2, r3 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x2 ble @08057236 @08057248: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80571DC thumb_func_start sub_805725C sub_805725C: ; 805725C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 mov r9, r0 movs r0, 0 mov r8, r0 ldr r1, =0x02024332 mov r10, r1 b @08057284 .align 2, 0 .pool @0805727C: mov r2, r8 cmp r2, 0 beq @08057284 b @08057406 @08057284: mov r1, r10 ldrb r0, [r1] cmp r0, 0x1 bne @0805728E b @08057390 @0805728E: cmp r0, 0x1 ble @08057294 b @080573FC @08057294: cmp r0, 0 beq @0805729A b @080573FC @0805729A: ldr r6, =0x02024084 movs r0, 0x58 mov r5, r9 muls r5, r0 adds r0, r6, 0 adds r0, 0x4C adds r4, r5, r0 ldr r0, [r4] movs r7, 0x7 ands r0, r7 cmp r0, 0 beq @08057372 mov r0, r9 bl sub_8050650 lsls r0, 24 cmp r0, 0 beq @080572FC ldr r0, [r4] movs r1, 0x8 negs r1, r1 ands r0, r1 str r0, [r4] adds r2, r6, 0 adds r2, 0x50 adds r2, r5, r2 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] bl b_movescr_stack_push_cursor movs r0, 0x1 mov r2, r10 strb r0, [r2, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB220 str r0, [r1] movs r0, 0x2 mov r8, r0 b @08057372 .align 2, 0 .pool @080572FC: adds r0, r5, r6 adds r0, 0x20 ldrb r0, [r0] movs r2, 0x1 cmp r0, 0x30 bne @0805730A movs r2, 0x2 @0805730A: ldr r1, [r4] adds r0, r1, 0 ands r0, r7 cmp r0, r2 bcs @0805731E movs r0, 0x8 negs r0, r0 ands r1, r0 str r1, [r4] b @08057322 @0805731E: subs r0, r1, r2 str r0, [r4] @08057322: ldr r2, =0x02024084 movs r0, 0x58 mov r1, r9 muls r1, r0 adds r0, r2, 0 adds r0, 0x4C adds r0, r1, r0 ldr r4, [r0] movs r0, 0x7 ands r4, r0 cmp r4, 0 beq @08057354 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB213 str r0, [r1] movs r1, 0x2 mov r8, r1 b @08057372 .align 2, 0 .pool @08057354: adds r2, 0x50 adds r2, r1, r2 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] bl b_movescr_stack_push_cursor ldr r0, =0x02024332 strb r4, [r0, 0x5] ldr r1, =0x02024214 ldr r0, =gUnknown_082DB220 str r0, [r1] movs r2, 0x2 mov r8, r2 @08057372: ldr r1, =0x02024332 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r10, r1 b @080573FC .align 2, 0 .pool @08057390: ldr r1, =0x02024084 movs r0, 0x58 mov r2, r9 muls r2, r0 adds r0, r2, 0 adds r1, 0x4C adds r4, r0, r1 ldr r0, [r4] movs r1, 0x20 ands r0, r1 cmp r0, 0 beq @080573F4 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x5 bl __umodsi3 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0 beq @080573D4 ldr r1, =0x02024214 ldr r0, =gUnknown_082DB26A str r0, [r1] b @080573EC .align 2, 0 .pool @080573D4: ldr r0, [r4] movs r1, 0x21 negs r1, r1 ands r0, r1 str r0, [r4] bl b_movescr_stack_push_cursor ldr r1, =0x02024214 ldr r0, =gUnknown_082DB277 str r0, [r1] mov r0, r10 strb r5, [r0, 0x5] @080573EC: movs r1, 0x2 mov r8, r1 ldr r2, =0x02024332 mov r10, r2 @080573F4: mov r1, r10 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @080573FC: mov r2, r10 ldrb r0, [r2] cmp r0, 0x2 beq @08057406 b @0805727C @08057406: mov r0, r8 cmp r0, 0x2 bne @08057430 ldr r4, =0x02024064 mov r1, r9 strb r1, [r4] ldrb r1, [r4] movs r0, 0x58 muls r0, r1 ldr r1, =0x020240d0 adds r0, r1 str r0, [sp] movs r0, 0 movs r1, 0x28 movs r2, 0 movs r3, 0x4 bl dp01_build_cmdbuf_x02_a_b_varargs ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution @08057430: mov r0, r8 add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_805725C thumb_func_start nullsub_21 nullsub_21: ; 8057458 bx lr thumb_func_end nullsub_21 thumb_func_start sub_805745C sub_805745C: ; 805745C ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl1 str r1, [r0] ldr r0, =0x020244b9 movs r1, 0 strb r1, [r0] ldr r0, =0x020244cc strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_805745C thumb_func_start dp01_tbl1_exec_completed dp01_tbl1_exec_completed: ; 805748C push {r4,lr} sub sp, 0x4 ldr r1, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl1 str r1, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @080574E0 bl link_get_multiplayer_id mov r1, sp strb r0, [r1] movs r0, 0x2 movs r1, 0x4 mov r2, sp bl dp01_prepare_buffer_wireless_probably ldr r1, =0x02023064 ldrb r0, [r4] lsls r0, 9 adds r0, r1 movs r1, 0x38 strb r1, [r0] b @080574F2 .align 2, 0 .pool @080574E0: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] @080574F2: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_tbl1_exec_completed thumb_func_start bx_exec_buffer_A_ch0_tbl1 bx_exec_buffer_A_ch0_tbl1: ; 8057504 push {lr} ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08057550 ldr r0, =0x02023064 lsls r1, r3, 9 adds r1, r0 ldrb r0, [r1] cmp r0, 0x38 bhi @0805754C ldr r0, =gUnknown_0831C514 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 b @08057550 .align 2, 0 .pool @0805754C: bl dp01_tbl1_exec_completed @08057550: pop {r0} bx r0 thumb_func_end bx_exec_buffer_A_ch0_tbl1 thumb_func_start bx_0802E404 bx_0802E404: ; 8057554 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x24 ldrsh r0, [r0, r1] cmp r0, 0 bne @08057576 bl dp01_tbl1_exec_completed @08057576: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_0802E404 thumb_func_start sub_8057588 sub_8057588: ; 8057588 push {r4-r7,lr} ldr r3, =0x02023064 ldr r4, =0x02024064 ldrb r0, [r4] lsls r2, r0, 9 adds r1, r3, 0x2 adds r1, r2, r1 ldrb r5, [r1] adds r3, 0x3 adds r2, r3 ldrb r1, [r2] lsls r1, 8 orrs r5, r1 movs r1, 0x1 movs r2, 0x7 movs r3, 0x1 bl dp11b_obj_instanciate ldrb r0, [r4] movs r1, 0 movs r2, 0x7 movs r3, 0x1 bl dp11b_obj_instanciate ldr r0, =0x030022c0 ldrh r1, [r0, 0x30] movs r0, 0xF0 ands r0, r1 cmp r0, 0 beq @080575EC ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x2 bne @080575EC ldr r1, =0x020244cc ldrb r0, [r1] adds r0, 0x1 b @080575F0 .align 2, 0 .pool @080575EC: ldr r1, =0x020244cc movs r0, 0 @080575F0: strb r0, [r1] ldr r0, =0x030022c0 ldrh r2, [r0, 0x2E] movs r3, 0x1 adds r0, r3, 0 ands r0, r2 cmp r0, 0 beq @08057658 movs r0, 0x5 bl audio_play ldr r1, =0x020244ac ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @08057640 cmp r0, 0x1 bgt @08057630 cmp r0, 0 beq @0805763A b @080577C2 .align 2, 0 .pool @08057630: cmp r0, 0x2 beq @08057646 cmp r0, 0x3 beq @0805764C b @080577C2 @0805763A: movs r0, 0x1 movs r1, 0 b @080577BC @08057640: movs r0, 0x1 movs r1, 0x1 b @080577BC @08057646: movs r0, 0x1 movs r1, 0x2 b @080577BC @0805764C: movs r0, 0x1 movs r1, 0x3 movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb b @080577C2 @08057658: movs r0, 0x20 ands r0, r2 cmp r0, 0 beq @08057698 ldr r5, =0x020244ac ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] adds r0, r3, 0 ands r0, r1 cmp r0, 0 bne @08057674 b @080577E8 @08057674: movs r0, 0x5 bl audio_play ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_8059CF8 ldrb r1, [r4] adds r1, r5 ldrb r0, [r1] movs r2, 0x1 b @08057732 .align 2, 0 .pool @08057698: movs r0, 0x10 ands r0, r2 cmp r0, 0 beq @080576D8 ldr r5, =0x020244ac ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @080576B4 b @080577E8 @080576B4: movs r0, 0x5 bl audio_play ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_8059CF8 ldrb r1, [r4] adds r1, r5 ldrb r0, [r1] movs r2, 0x1 b @08057732 .align 2, 0 .pool @080576D8: movs r7, 0x40 adds r0, r7, 0 ands r0, r2 cmp r0, 0 beq @08057700 ldr r5, =0x020244ac ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080577E8 b @0805771A .align 2, 0 .pool @08057700: movs r0, 0x80 ands r0, r2 cmp r0, 0 beq @0805774C ldr r5, =0x020244ac ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @080577E8 @0805771A: movs r0, 0x5 bl audio_play ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_8059CF8 ldrb r1, [r4] adds r1, r5 ldrb r0, [r1] movs r2, 0x2 @08057732: eors r0, r2 strb r0, [r1] ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] movs r1, 0 bl sub_8059CB4 b @080577E8 .align 2, 0 .pool @0805774C: movs r0, 0x2 ands r0, r2 cmp r0, 0 bne @0805775A ldrb r0, [r1] cmp r0, 0x3B bls @080577DC @0805775A: ldr r4, =0x02022fec ldr r0, [r4] ands r0, r3 cmp r0, 0 beq @080577E8 ldr r6, =0x02024064 ldrb r0, [r6] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @080577E8 movs r0, 0 bl battle_get_side_with_given_state ldr r1, =0x02024210 ldrb r1, [r1] ldr r2, =gUnknown_0832A328 lsls r0, 24 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @080577E8 ldr r0, [r4] ands r0, r7 cmp r0, 0 bne @080577E8 ldr r0, =0x02023064 ldrb r1, [r6] lsls r1, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] cmp r0, 0x1 bne @080577B2 cmp r5, 0xC bhi @080577E8 adds r0, r5, 0 movs r1, 0x1 bl bag_add_item @080577B2: movs r0, 0x5 bl audio_play movs r0, 0x1 movs r1, 0xC @080577BC: movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb @080577C2: bl dp01_tbl1_exec_completed b @080577E8 .align 2, 0 .pool @080577DC: movs r0, 0x8 ands r0, r2 cmp r0, 0 beq @080577E8 bl sub_8073314 @080577E8: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8057588 thumb_func_start sub_80577F0 sub_80577F0: ; 80577F0 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] movs r1, 0x1 bl dp11b_obj_free ldrb r0, [r4] movs r1, 0 bl dp11b_obj_free ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8057824 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80577F0 thumb_func_start sub_8057824 sub_8057824: ; 8057824 push {r4,r5,lr} sub sp, 0x4 ldr r1, =gUnknown_0831C5F8 mov r0, sp movs r2, 0x4 bl memcpy ldr r0, =0x03005d74 ldrb r0, [r0] movs r1, 0x1 movs r2, 0xF movs r3, 0x1 bl dp11b_obj_instanciate movs r4, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r0, 0 beq @08057866 @0805784A: ldr r0, =0x03005d74 ldrb r0, [r0] cmp r4, r0 beq @0805785C lsls r0, r4, 24 lsrs r0, 24 movs r1, 0x1 bl dp11b_obj_free @0805785C: adds r4, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r4, r0 blt @0805784A @08057866: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2C] movs r0, 0xF0 ands r0, r1 cmp r0, 0 beq @0805789C ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x2 bne @0805789C ldr r1, =0x020244cc ldrb r0, [r1] adds r0, 0x1 b @080578A0 .align 2, 0 .pool @0805789C: ldr r1, =0x020244cc movs r0, 0 @080578A0: strb r0, [r1] ldrh r2, [r2, 0x2E] movs r0, 0x1 ands r0, r2 cmp r0, 0 beq @08057910 movs r0, 0x5 bl audio_play ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r4, =0x03005d74 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039B2C str r1, [r0] ldr r1, =0x020244b0 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r2, [r0] ldrb r0, [r4] lsls r0, 8 orrs r2, r0 movs r0, 0x1 movs r1, 0xA bl dp01_build_cmdbuf_x21_a_bb ldrb r0, [r4] movs r1, 0x1 bl dp11b_obj_free bl dp01_tbl1_exec_completed b @08057BC8 .align 2, 0 .pool @08057910: movs r0, 0x2 ands r0, r2 cmp r0, 0 bne @0805791E ldrb r0, [r1] cmp r0, 0x3B bls @0805798C @0805791E: movs r0, 0x5 bl audio_play ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r5, =0x03005d74 ldrb r0, [r5] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039B2C str r1, [r0] ldr r1, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8057BFC str r1, [r0] ldrb r0, [r4] movs r1, 0x1 movs r2, 0x7 movs r3, 0x1 bl dp11b_obj_instanciate ldrb r0, [r4] movs r1, 0 movs r2, 0x7 movs r3, 0x1 bl dp11b_obj_instanciate ldrb r0, [r5] movs r1, 0x1 bl dp11b_obj_free b @08057BC8 .align 2, 0 .pool @0805798C: movs r0, 0x60 ands r0, r2 cmp r0, 0 bne @08057996 b @08057AB0 @08057996: movs r0, 0x5 bl audio_play ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r3, =0x03005d74 ldrb r0, [r3] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039B2C str r1, [r0] adds r5, r3, 0 @080579B8: ldrb r0, [r5] bl battle_get_per_side_status lsls r0, 24 lsrs r1, r0, 24 movs r4, 0 mov r0, sp b @080579E2 .align 2, 0 .pool @080579D8: adds r4, 0x1 cmp r4, 0x3 bgt @080579E8 mov r2, sp adds r0, r2, r4 @080579E2: ldrb r0, [r0] cmp r1, r0 bne @080579D8 @080579E8: subs r4, 0x1 cmp r4, 0 bge @080579F0 movs r4, 0x4 @080579F0: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] bl battle_get_side_with_given_state strb r0, [r5] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 beq @080579E8 movs r4, 0 ldrb r0, [r5] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08057A6E cmp r0, 0x1 bgt @08057A28 cmp r0, 0 beq @08057A32 b @08057A70 .align 2, 0 .pool @08057A28: cmp r0, 0x2 beq @08057A32 cmp r0, 0x3 beq @08057A6E b @08057A70 @08057A32: ldr r2, =0x02024064 ldrb r0, [r2] ldrb r1, [r5] cmp r0, r1 bne @08057A6E ldr r1, =0x0202406e ldrb r2, [r2] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x020244b0 adds r2, r1 ldrb r1, [r2] adds r1, 0xD bl pokemon_getattr ldr r2, =gBattleMoves lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r1, [r1, 0x6] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08057A70 @08057A6E: adds r4, 0x1 @08057A70: ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 ldr r0, =0x03005d74 cmp r1, 0 beq @08057A88 movs r4, 0 @08057A88: cmp r4, 0 beq @080579B8 b @08057BB0 .align 2, 0 .pool @08057AB0: movs r0, 0x90 ands r0, r2 cmp r0, 0 bne @08057ABA b @08057BC8 @08057ABA: movs r0, 0x5 bl audio_play ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r3, =0x03005d74 ldrb r0, [r3] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039B2C str r1, [r0] adds r5, r3, 0 @08057ADC: ldrb r0, [r5] bl battle_get_per_side_status lsls r0, 24 lsrs r1, r0, 24 movs r4, 0 mov r0, sp b @08057B06 .align 2, 0 .pool @08057AFC: adds r4, 0x1 cmp r4, 0x3 bgt @08057B0C mov r2, sp adds r0, r2, r4 @08057B06: ldrb r0, [r0] cmp r1, r0 bne @08057AFC @08057B0C: adds r4, 0x1 cmp r4, 0x3 ble @08057B14 movs r4, 0 @08057B14: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] bl battle_get_side_with_given_state strb r0, [r5] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 beq @08057B0C movs r4, 0 ldrb r0, [r5] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08057B92 cmp r0, 0x1 bgt @08057B4C cmp r0, 0 beq @08057B56 b @08057B94 .align 2, 0 .pool @08057B4C: cmp r0, 0x2 beq @08057B56 cmp r0, 0x3 beq @08057B92 b @08057B94 @08057B56: ldr r2, =0x02024064 ldrb r0, [r2] ldrb r1, [r5] cmp r0, r1 bne @08057B92 ldr r1, =0x0202406e ldrb r2, [r2] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x020244b0 adds r2, r1 ldrb r1, [r2] adds r1, 0xD bl pokemon_getattr ldr r2, =gBattleMoves lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r1, [r1, 0x6] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08057B94 @08057B92: adds r4, 0x1 @08057B94: ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 ldr r0, =0x03005d74 cmp r1, 0 beq @08057BAC movs r4, 0 @08057BAC: cmp r4, 0 beq @08057ADC @08057BB0: ldr r2, =0x02020630 ldr r1, =0x020241e4 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039AD8 str r1, [r0] @08057BC8: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8057824 thumb_func_start sub_8057BFC sub_8057BFC: ; 8057BFC push {r4-r7,lr} mov r7, r8 push {r7} movs r0, 0 mov r8, r0 ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 9 ldr r1, =0x02023068 adds r6, r0, r1 ldr r2, =0x030022c0 ldrh r1, [r2, 0x2C] movs r0, 0xF0 ands r0, r1 adds r7, r3, 0 cmp r0, 0 beq @08057C44 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x2 bne @08057C44 ldr r1, =0x020244cc ldrb r0, [r1] adds r0, 0x1 b @08057C48 .align 2, 0 .pool @08057C44: ldr r1, =0x020244cc movs r0, 0 @08057C48: strb r0, [r1] ldrh r2, [r2, 0x2E] movs r5, 0x1 adds r0, r5, 0 ands r0, r2 cmp r0, 0 bne @08057C58 b @08057E04 @08057C58: movs r0, 0x5 bl audio_play ldr r1, =0x020244b0 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] lsls r0, 1 adds r1, r6, r0 ldrh r0, [r1] cmp r0, 0xAE bne @08057C98 ldrb r0, [r6, 0x12] movs r4, 0 cmp r0, 0x7 beq @08057CA6 ldrb r1, [r6, 0x13] movs r0, 0x7 eors r1, r0 negs r0, r1 orrs r0, r1 asrs r4, r0, 31 movs r0, 0x10 ands r4, r0 b @08057CA6 .align 2, 0 .pool @08057C98: ldr r2, =gBattleMoves ldrh r1, [r1] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r4, [r0, 0x6] @08057CA6: movs r0, 0x10 ands r0, r4 cmp r0, 0 beq @08057CC4 ldr r0, =0x03005d74 ldr r1, =0x02024064 ldrb r1, [r1] strb r1, [r0] b @08057CDE .align 2, 0 .pool @08057CC4: ldr r0, =0x02024064 ldrb r0, [r0] bl battle_get_per_side_status adds r1, r0, 0 movs r2, 0x1 movs r0, 0x1 ands r0, r1 eors r0, r2 bl battle_get_side_with_given_state ldr r1, =0x03005d74 strb r0, [r1] @08057CDE: ldr r5, =0x02023064 ldr r0, =0x02024064 ldrb r3, [r0] lsls r2, r3, 9 adds r1, r5, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r7, r0, 0 cmp r1, 0 bne @08057D18 movs r0, 0x2 ands r0, r4 cmp r0, 0 beq @08057D5A adds r0, r5, 0x2 adds r0, r2, r0 ldrb r0, [r0] cmp r0, 0 bne @08057D5A movs r0, 0x1 add r8, r0 b @08057D5A .align 2, 0 .pool @08057D18: movs r0, 0x7D ands r0, r4 cmp r0, 0 bne @08057D24 movs r0, 0x1 add r8, r0 @08057D24: ldr r0, =0x020244b0 adds r0, r3, r0 adds r1, r6, 0 adds r1, 0x8 ldrb r0, [r0] adds r1, r0 ldrb r0, [r1] cmp r0, 0 beq @08057D62 movs r0, 0x12 ands r0, r4 cmp r0, 0 bne @08057D5A movs r0, 0 bl sub_8069DEC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @08057D5A ldrb r0, [r7] bl sub_8069F34 ldr r1, =0x03005d74 strb r0, [r1] movs r0, 0 mov r8, r0 @08057D5A: ldr r7, =0x02024064 mov r0, r8 cmp r0, 0 bne @08057D80 @08057D62: ldr r1, =0x020244b0 ldrb r0, [r7] adds r0, r1 ldrb r2, [r0] ldr r0, =0x03005d74 ldrb r0, [r0] lsls r0, 8 orrs r2, r0 b @08057E1C .align 2, 0 .pool @08057D80: ldr r1, =0x03005d60 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =sub_8057824 str r1, [r0] movs r0, 0x12 ands r4, r0 cmp r4, 0 beq @08057DA8 ldr r1, =0x03005d74 ldrb r0, [r7] b @08057DD8 .align 2, 0 .pool @08057DA8: movs r0, 0x1 bl battle_get_side_with_given_state ldr r1, =0x02024210 ldrb r1, [r1] ldr r2, =gUnknown_0832A328 lsls r0, 24 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08057DD0 movs r0, 0x3 b @08057DD2 .align 2, 0 .pool @08057DD0: movs r0, 0x1 @08057DD2: bl battle_get_side_with_given_state ldr r1, =0x03005d74 @08057DD8: strb r0, [r1] ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x03005d74 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039AD8 b @08057F9C .align 2, 0 .pool @08057E04: movs r6, 0x2 adds r0, r6, 0 ands r0, r2 cmp r0, 0 bne @08057E14 ldrb r0, [r1] cmp r0, 0x3B bls @08057E30 @08057E14: movs r0, 0x5 bl audio_play ldr r2, =0x0000ffff @08057E1C: movs r0, 0x1 movs r1, 0xA bl dp01_build_cmdbuf_x21_a_bb bl dp01_tbl1_exec_completed b @08057F9E .align 2, 0 .pool @08057E30: movs r0, 0x20 ands r0, r2 cmp r0, 0 beq @08057E60 ldr r4, =0x020244b0 ldrb r0, [r7] adds r2, r0, r4 ldrb r1, [r2] adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @08057E4A b @08057F9E @08057E4A: ldrb r0, [r2] bl battle_menu_cursor_related ldrb r1, [r7] adds r1, r4 ldrb r0, [r1] movs r2, 0x1 eors r0, r2 b @08057F08 .align 2, 0 .pool @08057E60: movs r0, 0x10 ands r0, r2 cmp r0, 0 beq @08057EA4 ldr r4, =0x020244b0 ldrb r0, [r7] adds r3, r0, r4 ldrb r2, [r3] movs r6, 0x1 adds r0, r5, 0 ands r0, r2 cmp r0, 0 beq @08057E7C b @08057F9E @08057E7C: ldr r1, =0x03005d78 adds r0, r6, 0 eors r0, r2 ldrb r1, [r1] cmp r0, r1 bcc @08057E8A b @08057F9E @08057E8A: ldrb r0, [r3] bl battle_menu_cursor_related ldrb r1, [r7] adds r1, r4 ldrb r0, [r1] eors r0, r6 b @08057F08 .align 2, 0 .pool @08057EA4: movs r0, 0x40 ands r0, r2 cmp r0, 0 beq @08057ED4 ldr r4, =0x020244b0 ldrb r0, [r7] adds r2, r0, r4 ldrb r1, [r2] adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @08057F9E ldrb r0, [r2] bl battle_menu_cursor_related ldrb r1, [r7] adds r1, r4 ldrb r0, [r1] movs r2, 0x2 eors r0, r2 b @08057F08 .align 2, 0 .pool @08057ED4: movs r0, 0x80 ands r0, r2 cmp r0, 0 beq @08057F30 ldr r4, =0x020244b0 ldrb r0, [r7] adds r3, r0, r4 ldrb r2, [r3] movs r5, 0x2 adds r0, r6, 0 ands r0, r2 cmp r0, 0 bne @08057F9E ldr r1, =0x03005d78 adds r0, r5, 0 eors r0, r2 ldrb r1, [r1] cmp r0, r1 bcs @08057F9E ldrb r0, [r3] bl battle_menu_cursor_related ldrb r1, [r7] adds r1, r4 ldrb r0, [r1] eors r0, r5 @08057F08: strb r0, [r1] movs r0, 0x5 bl audio_play ldrb r0, [r7] adds r0, r4 ldrb r0, [r0] movs r1, 0 bl battle_menu_cursor_related_2 bl sub_8059B3C bl sub_8059BB0 b @08057F9E .align 2, 0 .pool @08057F30: movs r0, 0x4 ands r0, r2 cmp r0, 0 beq @08057F9E ldr r0, =0x03005d78 ldrb r0, [r0] cmp r0, 0x1 bls @08057F9E ldr r0, =0x02022fec ldr r5, [r0] ands r5, r6 cmp r5, 0 bne @08057F9E ldr r4, =0x020244b0 ldrb r0, [r7] adds r0, r4 ldrb r0, [r0] movs r1, 0x1D bl battle_menu_cursor_related_2 ldrb r0, [r7] adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @08057F78 ldr r0, =0x03005d74 strb r5, [r0] b @08057F80 .align 2, 0 .pool @08057F78: ldr r1, =0x03005d74 adds r0, 0x1 strb r0, [r1] adds r0, r1, 0 @08057F80: ldrb r0, [r0] movs r1, 0x1B bl battle_menu_cursor_related_2 ldr r0, =gUnknown_085CCACA movs r1, 0xB bl battle_show_message_maybe ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8058138 @08057F9C: str r1, [r0] @08057F9E: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8057BFC thumb_func_start sub_8057FBC sub_8057FBC: ; 8057FBC push {r4-r7,lr} movs r7, 0 ldr r4, =0x030022c0 ldrh r1, [r4, 0x2E] movs r6, 0x1 adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @08057FD6 movs r0, 0x5 bl audio_play movs r7, 0x1 @08057FD6: ldrh r1, [r4, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08057FF8 movs r0, 0x5 bl audio_play ldr r1, =0x02022e14 movs r0, 0 strh r0, [r1] ldr r1, =0x02022e16 movs r2, 0xA0 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] movs r7, 0xFF @08057FF8: ldrh r1, [r4, 0x2E] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @08058038 ldr r5, =0x020244b0 ldr r4, =0x02024064 ldrb r0, [r4] adds r2, r0, r5 ldrb r1, [r2] adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @08058038 ldrb r0, [r2] bl battle_menu_cursor_related ldrb r1, [r4] adds r1, r5 ldrb r0, [r1] movs r2, 0x1 eors r0, r2 strb r0, [r1] movs r0, 0x5 bl audio_play ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] movs r1, 0 bl battle_menu_cursor_related_2 @08058038: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08058086 ldr r5, =0x020244b0 ldr r4, =0x02024064 ldrb r0, [r4] adds r3, r0, r5 ldrb r2, [r3] movs r6, 0x1 movs r0, 0x1 ands r0, r2 cmp r0, 0 bne @08058086 ldr r1, =0x03005d78 adds r0, r6, 0 eors r0, r2 ldrb r1, [r1] cmp r0, r1 bcs @08058086 ldrb r0, [r3] bl battle_menu_cursor_related ldrb r1, [r4] adds r1, r5 ldrb r0, [r1] eors r0, r6 strb r0, [r1] movs r0, 0x5 bl audio_play ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] movs r1, 0 bl battle_menu_cursor_related_2 @08058086: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @080580C8 ldr r5, =0x020244b0 ldr r4, =0x02024064 ldrb r0, [r4] adds r2, r0, r5 ldrb r1, [r2] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080580C8 ldrb r0, [r2] bl battle_menu_cursor_related ldrb r1, [r4] adds r1, r5 ldrb r0, [r1] movs r2, 0x2 eors r0, r2 strb r0, [r1] movs r0, 0x5 bl audio_play ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] movs r1, 0 bl battle_menu_cursor_related_2 @080580C8: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08058116 ldr r5, =0x020244b0 ldr r4, =0x02024064 ldrb r0, [r4] adds r3, r0, r5 ldrb r2, [r3] movs r6, 0x2 movs r0, 0x2 ands r0, r2 cmp r0, 0 bne @08058116 ldr r1, =0x03005d78 adds r0, r6, 0 eors r0, r2 ldrb r1, [r1] cmp r0, r1 bcs @08058116 ldrb r0, [r3] bl battle_menu_cursor_related ldrb r1, [r4] adds r1, r5 ldrb r0, [r1] eors r0, r6 strb r0, [r1] movs r0, 0x5 bl audio_play ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] movs r1, 0 bl battle_menu_cursor_related_2 @08058116: adds r0, r7, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8057FBC thumb_func_start sub_8058138 sub_8058138: ; 8058138 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x24 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x5 ands r0, r1 cmp r0, 0 bne @08058152 b @08058500 @08058152: movs r0, 0x5 bl audio_play ldr r0, =0x020244b0 mov r10, r0 ldr r1, =0x02024064 mov r8, r1 ldrb r1, [r1] adds r2, r1, r0 ldr r5, =0x03005d74 ldrb r0, [r2] ldrb r3, [r5] cmp r0, r3 bne @08058170 b @080584A8 @08058170: lsls r1, 9 ldr r0, =0x02023068 adds r1, r0 mov r9, r1 ldrb r1, [r2] lsls r1, 1 add r1, r9 ldrh r6, [r1] ldrb r0, [r5] lsls r0, 1 add r0, r9 ldrh r0, [r0] strh r0, [r1] ldrb r0, [r5] lsls r0, 1 add r0, r9 strh r6, [r0] mov r1, r8 ldrb r0, [r1] add r0, r10 ldrb r1, [r0] mov r7, r9 adds r7, 0x8 adds r1, r7, r1 ldrb r6, [r1] ldrb r0, [r5] adds r0, r7, r0 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r5] adds r0, r7, r0 strb r6, [r0] mov r2, r8 ldrb r0, [r2] add r0, r10 ldrb r1, [r0] mov r2, r9 adds r2, 0xC adds r1, r2, r1 ldrb r6, [r1] ldrb r0, [r5] adds r0, r2, r0 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r5] adds r2, r0 strb r6, [r2] mov r3, r8 ldrb r1, [r3] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 ldr r2, =0x020242bc adds r6, r0, r2 ldrb r4, [r6, 0x18] lsls r3, r4, 24 lsrs r2, r3, 28 ldr r0, =gUnknown_0832A328 mov r12, r0 add r1, r10 ldrb r0, [r1] lsls r0, 2 add r0, r12 ldr r0, [r0] ands r2, r0 cmp r2, 0 beq @0805822A lsrs r1, r3, 28 bics r1, r0 lsls r1, 4 movs r2, 0xF adds r0, r2, 0 ands r0, r4 orrs r0, r1 strb r0, [r6, 0x18] mov r1, r8 ldrb r0, [r1] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r3, =0x020242bc adds r1, r3 ldrb r4, [r1, 0x18] lsrs r3, r4, 4 ldrb r0, [r5] lsls r0, 2 add r0, r12 ldr r0, [r0] orrs r0, r3 lsls r0, 4 ands r2, r4 orrs r2, r0 strb r2, [r1, 0x18] @0805822A: bl sub_8059AAC movs r6, 0 mov r12, r7 mov r5, sp adds r5, 0x18 str r5, [sp, 0x1C] ldr r2, =0x02024084 mov r0, r8 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r4, r0, 0 adds r4, 0x3B mov r7, r8 mov r10, r2 movs r5, 0x3 @0805824E: mov r1, sp adds r3, r1, r6 ldrb r1, [r4] lsls r2, r6, 1 adds r0, r5, 0 lsls r0, r2 ands r1, r0 asrs r1, r2 strb r1, [r3] adds r6, 0x1 cmp r6, 0x3 ble @0805824E ldr r1, =0x020244b0 ldrb r0, [r7] adds r0, r1 ldrb r0, [r0] add r0, sp ldrb r0, [r0] ldr r2, [sp, 0x1C] strb r0, [r2] ldrb r0, [r7] adds r0, r1 ldrb r0, [r0] mov r3, sp adds r2, r3, r0 ldr r1, =0x03005d74 ldrb r0, [r1] add r0, sp ldrb r0, [r0] movs r3, 0 strb r0, [r2] ldrb r0, [r1] mov r5, sp adds r1, r5, r0 ldr r2, [sp, 0x1C] ldrb r0, [r2] strb r0, [r1] strb r3, [r2] movs r6, 0 ldr r2, [sp, 0x1C] @0805829E: mov r3, sp adds r0, r3, r6 ldrb r1, [r0] lsls r0, r6, 1 lsls r1, r0 ldrb r0, [r2] orrs r0, r1 strb r0, [r2] adds r6, 0x1 cmp r6, 0x3 ble @0805829E ldrb r1, [r7] movs r0, 0x58 muls r0, r1 add r0, r10 adds r0, 0x3B ldr r5, [sp, 0x1C] ldrb r1, [r5] strb r1, [r0] movs r6, 0 adds r4, r7, 0 movs r3, 0x58 movs r0, 0x24 add r0, r10 mov r8, r0 mov r2, r9 mov r7, r10 adds r7, 0xC mov r5, r12 @080582D8: lsls r1, r6, 1 ldrb r0, [r4] muls r0, r3 adds r1, r0 adds r1, r7 ldrh r0, [r2] strh r0, [r1] ldrb r0, [r4] adds r1, r0, 0 muls r1, r3 adds r1, r6, r1 add r1, r8 adds r0, r5, r6 ldrb r0, [r0] strb r0, [r1] adds r2, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @080582D8 ldr r2, =0x02024064 ldrb r1, [r2] movs r0, 0x58 muls r0, r1 mov r1, r10 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 beq @0805831A b @080584A8 @0805831A: movs r6, 0 mov r1, sp adds r1, 0x4 str r1, [sp, 0x20] add r3, sp, 0xC mov r10, r3 ldr r5, =0x0202406e mov r9, r5 mov r8, r2 movs r7, 0x64 ldr r5, =0x020244ec adds r4, r1, 0 @08058332: mov r1, r8 ldrb r0, [r1] lsls r0, 1 add r0, r9 ldrh r0, [r0] muls r0, r7 adds r0, r5 adds r1, r6, 0 adds r1, 0xD bl pokemon_getattr strh r0, [r4] mov r2, r8 ldrb r0, [r2] lsls r0, 1 add r0, r9 ldrh r0, [r0] muls r0, r7 adds r0, r5 adds r1, r6, 0 adds r1, 0x11 bl pokemon_getattr mov r3, r10 adds r1, r3, r6 strb r0, [r1] adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @08058332 ldr r1, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x15 bl pokemon_getattr ldr r5, [sp, 0x1C] strb r0, [r5] movs r6, 0 movs r5, 0x3 ldr r4, [sp, 0x1C] @08058392: mov r0, sp adds r3, r0, r6 lsls r2, r6, 1 adds r1, r5, 0 lsls r1, r2 ldrb r0, [r4] ands r0, r1 asrs r0, r2 strb r0, [r3] adds r6, 0x1 cmp r6, 0x3 ble @08058392 ldr r4, =0x020244b0 ldr r3, =0x02024064 ldrb r0, [r3] adds r0, r4 ldrb r1, [r0] lsls r1, 1 ldr r2, [sp, 0x20] adds r1, r2, r1 ldrh r6, [r1] ldr r2, =0x03005d74 ldrb r0, [r2] lsls r0, 1 ldr r5, [sp, 0x20] adds r0, r5, r0 ldrh r0, [r0] movs r5, 0 strh r0, [r1] ldrb r0, [r2] lsls r0, 1 ldr r1, [sp, 0x20] adds r0, r1, r0 strh r6, [r0] ldrb r0, [r3] adds r0, r4 ldrb r1, [r0] add r1, r10 ldrb r6, [r1] ldrb r0, [r2] add r0, r10 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r2] add r0, r10 strb r6, [r0] ldrb r0, [r3] adds r0, r4 ldrb r0, [r0] add r0, sp ldrb r0, [r0] ldr r1, [sp, 0x1C] strb r0, [r1] ldrb r0, [r3] adds r0, r4 ldrb r0, [r0] mov r3, sp adds r1, r3, r0 ldrb r0, [r2] add r0, sp ldrb r0, [r0] strb r0, [r1] ldrb r0, [r2] adds r1, r3, r0 ldr r2, [sp, 0x1C] ldrb r0, [r2] strb r0, [r1] strb r5, [r2] movs r6, 0 ldr r2, [sp, 0x1C] @0805841E: mov r3, sp adds r0, r3, r6 ldrb r1, [r0] lsls r0, r6, 1 lsls r1, r0 ldrb r0, [r2] orrs r0, r1 strb r0, [r2] adds r6, 0x1 cmp r6, 0x3 ble @0805841E movs r6, 0 ldr r5, =0x0202406e mov r10, r5 ldr r0, =0x02024064 mov r9, r0 movs r1, 0x64 mov r8, r1 ldr r7, =0x020244ec ldr r5, [sp, 0x20] adds r5, 0x8 ldr r4, [sp, 0x20] @0805844A: mov r2, r9 ldrb r0, [r2] lsls r0, 1 add r0, r10 ldrh r0, [r0] mov r3, r8 muls r3, r0 adds r0, r3, 0 adds r0, r7 adds r1, r6, 0 adds r1, 0xD adds r2, r4, 0 bl pokemon_setattr mov r1, r9 ldrb r0, [r1] lsls r0, 1 add r0, r10 ldrh r0, [r0] mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r0, r7 adds r1, r6, 0 adds r1, 0x11 adds r2, r5, 0 bl pokemon_setattr adds r5, 0x1 adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @0805844A ldr r1, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x15 ldr r2, [sp, 0x1C] bl pokemon_setattr @080584A8: ldr r1, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_8057BFC str r1, [r0] ldr r3, =0x020244b0 ldrb r0, [r2] adds r0, r3 ldr r1, =0x03005d74 ldrb r1, [r1] strb r1, [r0] ldrb r0, [r2] adds r0, r3 ldrb r0, [r0] movs r1, 0 bl battle_menu_cursor_related_2 b @08058532 .align 2, 0 .pool @08058500: movs r0, 0x6 ands r0, r1 cmp r0, 0 beq @08058554 movs r0, 0x5 bl audio_play ldr r0, =0x03005d74 ldrb r0, [r0] bl battle_menu_cursor_related ldr r1, =0x020244b0 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] movs r1, 0 bl battle_menu_cursor_related_2 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8057BFC str r1, [r0] @08058532: bl sub_8059B18 bl sub_8059B3C bl sub_8059BB0 b @080586E8 .align 2, 0 .pool @08058554: movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @080585A4 ldr r3, =0x03005d74 ldrb r2, [r3] movs r0, 0x1 ands r0, r2 cmp r0, 0 bne @0805856A b @080586E8 @0805856A: ldr r0, =0x020244b0 ldr r1, =0x02024064 ldrb r1, [r1] adds r1, r0 ldrb r5, [r1] cmp r2, r5 bne @08058590 @08058578: ldrb r0, [r1] movs r1, 0x1D bl battle_menu_cursor_related_2 b @08058596 .align 2, 0 .pool @08058590: ldrb r0, [r3] bl battle_menu_cursor_related @08058596: ldr r4, =0x03005d74 ldrb r0, [r4] movs r1, 0x1 b @0805862C .align 2, 0 .pool @080585A4: movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080585E8 ldr r3, =0x03005d74 ldrb r2, [r3] movs r0, 0x1 ands r0, r2 cmp r0, 0 beq @080585BA b @080586E8 @080585BA: ldr r1, =0x03005d78 movs r0, 0x1 eors r0, r2 ldrb r1, [r1] cmp r0, r1 bcc @080585C8 b @080586E8 @080585C8: ldr r0, =0x020244b0 ldr r1, =0x02024064 ldrb r1, [r1] adds r1, r0 ldrb r0, [r1] cmp r2, r0 beq @08058578 b @08058590 .align 2, 0 .pool @080585E8: movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0805865C ldr r3, =0x03005d74 ldrb r2, [r3] movs r0, 0x2 ands r0, r2 cmp r0, 0 beq @080586E8 ldr r0, =0x020244b0 ldr r1, =0x02024064 ldrb r1, [r1] adds r1, r0 ldrb r5, [r1] cmp r2, r5 bne @08058620 ldrb r0, [r1] movs r1, 0x1D bl battle_menu_cursor_related_2 b @08058626 .align 2, 0 .pool @08058620: ldrb r0, [r3] bl battle_menu_cursor_related @08058626: ldr r4, =0x03005d74 ldrb r0, [r4] movs r1, 0x2 @0805862C: eors r0, r1 strb r0, [r4] movs r0, 0x5 bl audio_play ldr r1, =0x020244b0 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r4] ldrb r0, [r0] cmp r1, r0 beq @080586CA ldrb r0, [r4] movs r1, 0x1B bl battle_menu_cursor_related_2 b @080586E8 .align 2, 0 .pool @0805865C: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080586E8 ldr r3, =0x03005d74 ldrb r2, [r3] movs r0, 0x2 ands r0, r2 cmp r0, 0 bne @080586E8 ldr r1, =0x03005d78 movs r0, 0x2 eors r0, r2 ldrb r1, [r1] cmp r0, r1 bcs @080586E8 ldr r0, =0x020244b0 ldr r1, =0x02024064 ldrb r1, [r1] adds r1, r0 ldrb r0, [r1] cmp r2, r0 bne @080586A4 ldrb r0, [r1] movs r1, 0x1D bl battle_menu_cursor_related_2 b @080586AA .align 2, 0 .pool @080586A4: ldrb r0, [r3] bl battle_menu_cursor_related @080586AA: ldr r4, =0x03005d74 ldrb r0, [r4] movs r1, 0x2 eors r0, r1 strb r0, [r4] movs r0, 0x5 bl audio_play ldr r1, =0x020244b0 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r4] ldrb r0, [r0] cmp r1, r0 bne @080586E0 @080586CA: adds r0, r1, 0 movs r1, 0 bl battle_menu_cursor_related_2 b @080586E8 .align 2, 0 .pool @080586E0: ldrb r0, [r4] movs r1, 0x1B bl battle_menu_cursor_related_2 @080586E8: add sp, 0x24 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8058138 thumb_func_start sub_80586F8 sub_80586F8: ; 80586F8 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @0805875C ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08058798 movs r0, 0x5A bl m4aSongNumStop ldr r3, =0x030022c0 ldr r0, =0x00000439 adds r2, r3, r0 ldrb r1, [r2] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r2] ldr r0, =0x03005d00 ldr r0, [r0] str r0, [r3] ldr r0, =sub_8038D64 bl set_callback2 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0x1 bne @08058738 bl sub_817E3F4 @08058738: bl Window_FreeMemory b @08058798 .align 2, 0 .pool @0805875C: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08058798 movs r0, 0x5A bl m4aSongNumStop ldr r3, =0x030022c0 ldr r0, =0x00000439 adds r2, r3, r0 ldrb r1, [r2] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r2] ldr r0, =0x03005d00 ldr r0, [r0] str r0, [r3] ldr r0, =sub_8038D64 bl set_callback2 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0x1 bne @08058794 bl sub_817E3F4 @08058794: bl Window_FreeMemory @08058798: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80586F8 thumb_func_start sub_80587B0 sub_80587B0: ; 80587B0 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08058832 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @08058810 bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08058832 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @080587F0 bl sub_800AC34 b @080587F4 .align 2, 0 .pool @080587F0: bl sub_800ADF8 @080587F4: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_80586F8 str r1, [r0] b @08058832 .align 2, 0 .pool @08058810: movs r0, 0x5A bl m4aSongNumStop ldr r2, =0x030022c0 ldr r0, =0x00000439 adds r3, r2, r0 ldrb r1, [r3] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r3] ldr r0, =0x03005d00 ldr r0, [r0] str r0, [r2] ldr r0, [r2, 0x8] bl set_callback2 @08058832: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80587B0 thumb_func_start sub_8058844 sub_8058844: ; 8058844 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08058868 bl dp01_tbl1_exec_completed @08058868: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8058844 thumb_func_start sub_805887C sub_805887C: ; 805887C push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @080588A0 bl dp01_tbl1_exec_completed @080588A0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805887C thumb_func_start bx_802F7A0 bx_802F7A0: ; 80588B4 push {r4-r6,lr} ldr r6, =0x02020630 ldr r5, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r6, 0 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08058908 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] bl nullsub_25 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 bl obj_free_rotscale_entry ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 bl obj_delete_and_free_tiles bl dp01_tbl1_exec_completed @08058908: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_802F7A0 thumb_func_start sub_8058924 sub_8058924: ; 8058924 push {r4,lr} ldr r4, =0x020244d0 ldr r1, [r4] ldr r3, =0x02024064 ldrb r0, [r3] ldr r2, [r1, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x9] subs r0, 0x1 strb r0, [r1, 0x9] lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @0805895C ldr r0, [r4] ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x9] bl dp01_tbl1_exec_completed @0805895C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8058924 thumb_func_start sub_805896C sub_805896C: ; 805896C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r7, 0 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08058998 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @080589D0 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @080589D0 @08058998: ldr r2, =0x02020630 ldr r1, =0x03005d70 ldr r3, =0x02024064 ldrb r0, [r3] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 mov r10, r3 cmp r1, r0 bne @08058A0A b @08058A0E .align 2, 0 .pool @080589D0: ldr r3, =0x02020630 ldr r6, =0x03005d70 ldr r2, =0x02024064 ldrb r4, [r2] adds r0, r4, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r5, r3, 0 adds r5, 0x1C adds r0, r5 ldr r3, [r0] ldr r0, =nullsub_12 mov r10, r2 cmp r3, r0 bne @08058A0A movs r0, 0x2 eors r4, r0 adds r0, r4, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r0, [r0] cmp r0, r3 bne @08058A0A movs r7, 0x1 @08058A0A: cmp r7, 0 beq @08058B08 @08058A0E: ldr r0, =0x020244d0 mov r9, r0 ldr r0, [r0] mov r6, r10 ldrb r2, [r6] ldr r3, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r4, r0, r3 ldrb r1, [r4, 0x1] movs r5, 0x1 adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @08058B08 movs r1, 0x2 mov r8, r1 mov r1, r8 eors r1, r2 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x1] adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @08058B08 ldrb r1, [r4] movs r3, 0x7F adds r0, r3, 0 ands r0, r1 strb r0, [r4] mov r2, r9 ldr r0, [r2] ldrb r2, [r6] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r4, 0x2 negs r4, r4 adds r0, r4, 0 ands r0, r2 strb r0, [r1, 0x1] mov r0, r9 ldr r2, [r0] ldrb r0, [r6] mov r1, r8 eors r1, r0 ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] ands r3, r1 strb r3, [r0] mov r1, r9 ldr r2, [r1] ldrb r0, [r6] mov r1, r8 eors r1, r0 ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] ands r4, r1 strb r4, [r0, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag ldr r7, =0x0202406e ldrb r1, [r6] lsls r0, r1, 1 adds r0, r7 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 bl sub_805E990 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08058AE4 ldrb r0, [r6] mov r1, r8 eors r1, r0 lsls r0, r1, 1 adds r0, r7 ldrh r0, [r0] muls r0, r5 adds r0, r4 bl sub_805E990 @08058AE4: mov r2, r9 ldr r0, [r2] mov r2, r10 ldrb r1, [r2] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x9] ldr r1, =0x03005d60 mov r2, r10 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_8058924 str r1, [r0] @08058B08: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805896C thumb_func_start sub_8058B40 sub_8058B40: ; 8058B40 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r0, 0 mov r9, r0 mov r8, r0 ldr r4, =0x020244d0 ldr r0, [r4] ldr r7, =0x02024064 ldrb r2, [r7] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r5, 0x88 adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @08058B80 ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @08058B80: ldr r1, [r4] ldrb r0, [r7] movs r6, 0x2 adds r2, r6, 0 eors r2, r0 ldr r1, [r1, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @08058BB2 ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @08058BB2: ldr r0, [r4] ldrb r2, [r7] ldr r3, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r4, r0, r3 ldrb r1, [r4] movs r5, 0x8 adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @08058C82 adds r1, r6, 0 eors r1, r2 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0] adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @08058C82 ldrb r1, [r4, 0x1] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08058C68 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08058C38 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @08058C38 ldr r4, =0x03005d70 ldrb r0, [r7] adds r1, r6, 0 eors r1, r0 adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r7] eors r0, r6 bl sub_8076918 ldrb r0, [r7] eors r0, r6 adds r0, r4 ldrb r0, [r0] bl sub_80729D0 @08058C38: ldr r5, =0x03005d70 ldr r4, =0x02024064 ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r4] bl sub_8076918 ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 @08058C68: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x80 orrs r1, r2 strb r1, [r0, 0x1] @08058C82: ldr r5, =0x020244d0 ldr r0, [r5] ldr r4, =0x02024064 ldrb r2, [r4] ldr r3, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x1] movs r0, 0xC0 ands r0, r1 cmp r0, 0x80 bne @08058D32 movs r1, 0x2 eors r1, r2 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x1] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08058D32 bl sub_80A36C8 lsls r0, 24 cmp r0, 0 bne @08058D32 ldr r0, [r5] ldrb r1, [r4] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @08058D14 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x42 ands r0, r1 cmp r0, 0x42 bne @08058D08 ldr r0, =0x03007420 bl m4aMPlayContinue b @08058D14 .align 2, 0 .pool @08058D08: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl @08058D14: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x1] movs r0, 0x1 mov r9, r0 @08058D32: bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08058D52 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08058DAC ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08058DAC @08058D52: ldr r2, =0x02020630 ldr r0, =0x03005d7c ldr r1, =0x02024064 ldrb r4, [r1] adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r3, [r0] ldr r0, =nullsub_12 cmp r3, r0 bne @08058E0A ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r0, [r0] cmp r0, r3 bne @08058E0A b @08058E06 .align 2, 0 .pool @08058DAC: ldr r2, =0x02020630 ldr r7, =0x03005d7c ldr r0, =0x02024064 ldrb r3, [r0] adds r0, r3, r7 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r4, [r0] ldr r0, =nullsub_12 cmp r4, r0 bne @08058E0A ldr r6, =0x020241e4 adds r0, r3, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r5, [r0] cmp r5, r4 bne @08058E0A movs r0, 0x2 eors r3, r0 adds r0, r3, r7 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r4, [r0] cmp r4, r5 bne @08058E0A adds r0, r3, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r0, [r0] cmp r0, r4 bne @08058E0A @08058E06: movs r0, 0x1 mov r8, r0 @08058E0A: mov r0, r9 cmp r0, 0 beq @08058EAA mov r0, r8 cmp r0, 0 beq @08058EAA bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08058E48 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @08058E48 ldr r2, =0x03005d7c ldr r0, =0x02024064 ldrb r1, [r0] movs r0, 0x2 eors r0, r1 adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles @08058E48: ldr r1, =0x03005d7c ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldr r3, =0x020244d0 ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r1, [r2, 0x9] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2, 0x9] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x21 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x7F ands r0, r2 strb r0, [r1, 0x1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_805896C str r1, [r0] @08058EAA: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8058B40 thumb_func_start sub_8058EDC sub_8058EDC: ; 8058EDC push {r4-r6,lr} ldr r2, =0x02020630 ldr r0, =0x03005d70 ldr r6, =0x02024064 ldrb r3, [r6] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r4, [r0] ldr r0, =nullsub_12 cmp r4, r0 bne @08058F94 ldr r5, =0x020244d0 ldr r0, [r5] ldr r1, [r0, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08058F94 ldr r0, =0x020241e4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r0, [r0] cmp r0, r4 bne @08058F94 adds r0, r3, 0 bl sub_805E408 ldr r0, [r5] ldrb r2, [r6] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x7F ands r0, r2 strb r0, [r1] ldr r0, [r5] ldrb r2, [r6] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 bl 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, =0x03005d60 ldrb r1, [r6] lsls r1, 2 adds r1, r0 ldr r0, =sub_8058FC0 str r0, [r1] @08058F94: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8058EDC thumb_func_start sub_8058FC0 sub_8058FC0: ; 8058FC0 push {r4,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r4, =0x02024064 ldrb r1, [r4] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0805900E bl sub_80A36C8 lsls r0, 24 cmp r0, 0 bne @0805900E ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl ldr r2, =0x0202406e ldrb r1, [r4] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 bl dp01_tbl1_exec_completed @0805900E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8058FC0 thumb_func_start sub_805902C sub_805902C: ; 805902C push {r4-r6,lr} ldr r6, =0x020244d0 ldr r0, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x88 ands r0, r1 cmp r0, 0 bne @0805905E ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @0805905E: ldr r4, =0x02020630 ldr r0, =0x03005d7c ldrb r2, [r5] adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r3, r0, 2 adds r0, r4, 0 adds r0, 0x1C adds r0, r3, r0 ldr r1, [r0] ldr r0, =nullsub_12 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, =0x03005d70 ldrb r1, [r5] adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r5] bl sub_8076918 ldrb r0, [r5] adds r0, r4 ldrb r0, [r0] bl sub_80729D0 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8058EDC str r1, [r0] @080590D2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805902C thumb_func_start c3_0802FDF4 c3_0802FDF4: ; 8059100 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_80A36C8 lsls r0, 24 cmp r0, 0 bne @08059122 ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl adds r0, r4, 0 bl remove_task @08059122: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c3_0802FDF4 thumb_func_start bx_t1_healthbar_update bx_t1_healthbar_update: ; 8059130 push {r4-r6,lr} ldr r5, =0x02024064 ldrb r0, [r5] ldr r6, =0x03005d70 adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] bl sub_80729D0 lsls r4, 16 asrs r1, r4, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08059178 ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] movs r2, 0 bl heathbar_draw_hp b @08059192 .align 2, 0 .pool @08059178: ldr r2, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 bl dp01_tbl1_exec_completed @08059192: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, 2 add r0, r9 lsls r0, 3 adds r0, r1 mov r8, r0 ldrb r0, [r0, 0x8] mov r10, r0 mov r1, r8 ldrb r7, [r1, 0xC] str r7, [sp, 0x8] ldrh r2, [r1, 0xA] str r2, [sp, 0xC] bl battle_type_is_double lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080591FE ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r0, [r0] cmp r10, r0 bne @080591FE b @08059314 @080591FE: movs r0, 0x64 mov r1, r10 muls r1, r0 ldr r0, =0x020244ec adds r6, r1, r0 adds r0, r6, 0 movs r1, 0xB bl pokemon_getattr adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 movs r1, 0x38 bl pokemon_getattr adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x4] ldr r3, =gExperienceTables adds r4, 0x1 lsls r4, 2 ldr r2, =gBaseStats lsls r1, r5, 3 subs r1, r5 lsls r1, 2 adds r1, r2 ldrb r2, [r1, 0x13] movs r1, 0xCA lsls r1, 1 muls r1, r2 adds r4, r1 adds r4, r3 ldr r2, [r4] str r2, [sp] ldr r3, [sp, 0xC] lsls r1, r3, 16 asrs r1, 16 adds r0, r1 cmp r0, r2 bcc @080592EC adds r0, r6, 0 movs r1, 0x19 mov r2, sp bl pokemon_setattr adds r0, r6, 0 bl pokemon_calc_effective_stats ldr r2, [sp] add r0, sp, 0x4 ldrh r0, [r0] subs r2, r0 ldr r0, [sp, 0xC] subs r2, r0, r2 ldr r4, =0x02024064 ldrb r5, [r4] strb r7, [r4] lsls r2, 16 lsrs r2, 16 movs r0, 0x1 movs r1, 0xB bl dp01_build_cmdbuf_x21_a_bb strb r5, [r4] bl battle_type_is_double lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080592D4 ldr r2, =0x0202406e lsls r0, r7, 1 adds r0, r2 mov r1, r10 ldrh r0, [r0] cmp r1, r0 beq @080592B2 movs r0, 0x2 eors r7, r0 lsls r0, r7, 1 adds r0, r2 ldrh r0, [r0] cmp r1, r0 bne @080592D4 @080592B2: ldr r0, =sub_8059544 b @08059316 .align 2, 0 .pool @080592D4: ldr r0, =0x03005e00 mov r2, r9 lsls r1, r2, 2 add r1, r9 lsls r1, 3 adds r1, r0 ldr r0, =sub_805965C b @08059318 .align 2, 0 .pool @080592EC: str r0, [sp, 0x4] add r2, sp, 0x4 adds r0, r6, 0 movs r1, 0x19 bl pokemon_setattr ldr r1, =0x03005d60 ldr r3, [sp, 0x8] lsls r0, r3, 2 adds r0, r1 ldr r1, =sub_80591A0 str r1, [r0] mov r0, r9 bl remove_task b @0805931A .align 2, 0 .pool @08059314: ldr r0, =sub_8059330 @08059316: mov r1, r8 @08059318: str r0, [r1] @0805931A: add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80591B8 thumb_func_start sub_8059330 sub_8059330: ; 8059330 push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 lsls r2, r0, 2 mov r8, r2 add r8, r0 mov r0, r8 lsls r0, 3 mov r8, r0 add r8, r1 mov r2, r8 ldrb r1, [r2, 0x8] movs r0, 0xA ldrsh r2, [r2, r0] mov r9, r2 mov r2, r8 ldrb r2, [r2, 0xC] mov r10, r2 movs r0, 0x64 adds r6, r1, 0 muls r6, r0 ldr r0, =0x020244ec adds r6, r0 adds r0, r6, 0 movs r1, 0x38 bl pokemon_getattr adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 movs r1, 0xB bl pokemon_getattr adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 movs r1, 0x19 bl pokemon_getattr adds r3, r0, 0 ldr r6, =gExperienceTables lsls r1, r4, 2 ldr r2, =gBaseStats lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r2 ldrb r2, [r0, 0x13] movs r0, 0xCA lsls r0, 1 muls r0, r2 adds r1, r0 adds r1, r6 ldr r1, [r1] subs r3, r1 adds r4, 0x1 lsls r4, 2 adds r4, r0 adds r4, r6 ldr r2, [r4] subs r2, r1 ldr r0, =0x03005d70 add r0, r10 ldrb r1, [r0] mov r0, r9 negs r0, r0 str r0, [sp] mov r0, r10 bl sub_807294C movs r0, 0x21 bl audio_play ldr r0, =sub_8059400 mov r1, r8 str r0, [r1] add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8059330 thumb_func_start sub_8059400 sub_8059400: ; 8059400 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r1, =0x03005e00 lsls r0, 2 add r0, r8 lsls r0, 3 adds r6, r0, r1 ldrh r1, [r6, 0x1C] movs r2, 0x1C ldrsh r0, [r6, r2] cmp r0, 0xC bgt @08059430 adds r0, r1, 0x1 strh r0, [r6, 0x1C] b @0805952C .align 2, 0 .pool @08059430: ldrb r0, [r6, 0x8] mov r9, r0 ldrh r2, [r6, 0xA] mov r10, r2 ldrb r7, [r6, 0xC] ldr r5, =0x03005d70 adds r5, r7, r5 ldrb r1, [r5] adds r0, r7, 0 movs r2, 0x1 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r5] bl sub_80729D0 lsls r4, 16 asrs r4, 16 movs r0, 0x1 negs r0, r0 cmp r4, r0 bne @0805952C movs r0, 0x21 bl m4aSongNumStop movs r0, 0x64 mov r1, r9 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x38 bl pokemon_getattr adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x4] adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 ldr r3, =gExperienceTables adds r4, 0x1 lsls r4, 2 ldr r2, =gBaseStats lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 ldrb r1, [r1, 0x13] movs r0, 0xCA lsls r0, 1 muls r0, r1 adds r4, r0 adds r4, r3 ldr r1, [r4] str r1, [sp] mov r2, r10 lsls r0, r2, 16 asrs r4, r0, 16 ldr r0, [sp, 0x4] adds r0, r4 cmp r0, r1 blt @08059510 adds r0, r5, 0 movs r1, 0x19 mov r2, sp bl pokemon_setattr adds r0, r5, 0 bl pokemon_calc_effective_stats ldr r2, [sp] add r0, sp, 0x4 ldrh r0, [r0] subs r2, r0 subs r2, r4, r2 ldr r4, =0x02024064 ldrb r5, [r4] strb r7, [r4] lsls r2, 16 lsrs r2, 16 movs r0, 0x1 movs r1, 0xB bl dp01_build_cmdbuf_x21_a_bb strb r5, [r4] ldr r0, =sub_8059544 str r0, [r6] b @0805952C .align 2, 0 .pool @08059510: str r0, [sp, 0x4] add r2, sp, 0x4 adds r0, r5, 0 movs r1, 0x19 bl pokemon_setattr ldr r1, =0x03005d60 lsls r0, r7, 2 adds r0, r1 ldr r1, =sub_80591A0 str r1, [r0] mov r0, r8 bl remove_task @0805952C: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8059400 thumb_func_start sub_8059544 sub_8059544: ; 8059544 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldrb r4, [r0, 0xC] ldrb r6, [r0, 0x8] bl battle_type_is_double lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08059578 ldr r1, =0x0202406e movs r0, 0x2 adds r2, r4, 0 eors r2, r0 lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r6, r0 bne @08059578 adds r4, r2, 0 @08059578: adds r0, r4, 0 adds r1, r4, 0 adds r2, r4, 0 movs r3, 0 bl move_anim_start_t4 ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80595A4 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8059544 thumb_func_start sub_80595A4 sub_80595A4: ; 80595A4 push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r2, r0, r1 ldrb r5, [r2, 0xC] ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08059646 ldrb r4, [r2, 0x8] movs r0, 0x64 adds r1, r4, 0 muls r1, r0 ldr r0, =0x020244ec adds r7, r1, r0 adds r0, r7, 0 movs r1, 0x38 bl pokemon_getattr bl battle_type_is_double lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08059624 ldr r1, =0x0202406e movs r0, 0x2 adds r2, r5, 0 eors r2, r0 lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 bne @08059624 ldr r0, =0x03005d70 adds r0, r2, r0 ldrb r0, [r0] adds r1, r7, 0 movs r2, 0 bl healthbar_draw_field_maybe b @08059638 .align 2, 0 .pool @08059624: ldr r0, =0x03005d70 adds r0, r5, r0 ldrb r0, [r0] movs r1, 0x64 muls r1, r4 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @08059638: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_805965C str r0, [r1] @08059646: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80595A4 thumb_func_start sub_805965C sub_805965C: ; 805965C push {r4,r5,lr} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r0, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r0 ldrb r1, [r4, 0x8] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 bl pokemon_getattr ldrb r0, [r4, 0xC] ldr r1, =0x03005d60 lsls r0, 2 adds r0, r1 ldr r1, =sub_80591A0 str r1, [r0] adds r0, r5, 0 bl remove_task pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805965C thumb_func_start sub_80596A8 sub_80596A8: ; 80596A8 push {r4-r6,lr} ldr r6, =0x02020630 ldr r5, =0x020241e4 ldr r4, =0x02024064 ldrb r2, [r4] adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 movs r3, 0x22 ldrsh r1, [r0, r3] movs r3, 0x26 ldrsh r0, [r0, r3] adds r1, r0 cmp r1, 0xA0 ble @08059724 ldr r1, =0x0202406e lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 bl nullsub_24 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 bl rotscale_free_entry ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl dp01_tbl1_exec_completed @08059724: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80596A8 thumb_func_start sub_8059744 sub_8059744: ; 8059744 push {r4-r6,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r6, =0x02024064 ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08059798 ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl dp01_tbl1_exec_completed @08059798: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0805980A ldr r1, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_8059828 str r1, [r0] ldr r3, =0x03005e00 ldr r1, =0x03005d7c ldrb r0, [r2] adds r0, r1 ldrb r0, [r0] lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r3 ldrb r4, [r1, 0x8] bl remove_task bl Window_FreeMemory adds r0, r4, 0 bl sub_81B89AC @0805980A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80597CC thumb_func_start sub_8059828 sub_8059828: ; 8059828 push {lr} ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 bne @08059898 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08059898 ldr r0, =0x0203cee8 ldrb r0, [r0] cmp r0, 0x1 bne @08059870 ldr r0, =0x0203cee9 ldrb r1, [r0] ldr r2, =0x0203cf00 movs r0, 0x1 bl dp01_build_cmdbuf_x22_a_three_bytes b @0805987A .align 2, 0 .pool @08059870: movs r0, 0x1 movs r1, 0x6 movs r2, 0 bl dp01_build_cmdbuf_x22_a_three_bytes @0805987A: ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r1, [r0] movs r0, 0xF ands r0, r1 cmp r0, 0x1 bne @08059894 bl b_link_standby_message @08059894: bl dp01_tbl1_exec_completed @08059898: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8059828 thumb_func_start sub_80598A4 sub_80598A4: ; 80598A4 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080598CC ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_80598E0 str r1, [r0] bl nullsub_35 bl Window_FreeMemory bl sub_81AABB0 @080598CC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80598A4 thumb_func_start sub_80598E0 sub_80598E0: ; 80598E0 push {lr} ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 bne @08059906 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08059906 ldr r0, =0x0203ce7c ldrh r1, [r0] movs r0, 0x1 bl dp01_build_cmdbuf_x23_aa_0 bl dp01_tbl1_exec_completed @08059906: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80598E0 thumb_func_start bx_wait_t1 bx_wait_t1: ; 805991C push {lr} ldr r0, =0x020244b9 ldrb r0, [r0] cmp r0, 0 beq @08059942 ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08059946 @08059942: bl dp01_tbl1_exec_completed @08059946: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_wait_t1 thumb_func_start bx_blink_t1 bx_blink_t1: ; 8059958 push {r4,lr} ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r2 movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x20 bne @080599A4 movs r3, 0 movs r0, 0 strh r0, [r4, 0x30] adds r2, r4, 0 adds r2, 0x3E ldrb r1, [r2] subs r0, 0x5 ands r0, r1 strb r0, [r2] ldr r0, =0x020244b9 strb r3, [r0] bl dp01_tbl1_exec_completed b @080599CE .align 2, 0 .pool @080599A4: ldrh r0, [r4, 0x30] movs r1, 0x3 ands r0, r1 cmp r0, 0 bne @080599C8 adds r3, r4, 0 adds r3, 0x3E ldrb r2, [r3] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r0, 0x5 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] @080599C8: ldrh r0, [r4, 0x30] adds r0, 0x1 strh r0, [r4, 0x30] @080599CE: pop {r4} pop {r0} bx r0 thumb_func_end bx_blink_t1 thumb_func_start sub_80599D4 sub_80599D4: ; 80599D4 push {r4,lr} sub sp, 0x4 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @08059A02 ldr r4, =0x03005d74 ldrb r0, [r4] cmp r0, 0 beq @08059A02 movs r0, 0x5 bl audio_play ldrb r0, [r4] bl sub_8056BAC movs r0, 0 strb r0, [r4] movs r0, 0 bl sub_8056B74 @08059A02: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08059A2C ldr r4, =0x03005d74 ldrb r0, [r4] cmp r0, 0 bne @08059A2C movs r0, 0x5 bl audio_play ldrb r0, [r4] bl sub_8056BAC movs r0, 0x1 strb r0, [r4] movs r0, 0x1 bl sub_8056B74 @08059A2C: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r2, 0x1 adds r0, r2, 0 ands r0, r1 cmp r0, 0 beq @08059A7A str r2, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C movs r0, 0x5 bl audio_play ldr r0, =0x03005d74 ldrb r0, [r0] cmp r0, 0 beq @08059A6C movs r0, 0x1 movs r1, 0xE movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb b @08059A76 .align 2, 0 .pool @08059A6C: movs r0, 0x1 movs r1, 0xD movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb @08059A76: bl dp01_tbl1_exec_completed @08059A7A: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08059AA0 movs r0, 0x1 str r0, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C movs r0, 0x5 bl audio_play bl dp01_tbl1_exec_completed @08059AA0: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80599D4 thumb_func_start sub_8059AAC sub_8059AAC: ; 8059AAC push {r4-r7,lr} ldr r0, =0x02024064 ldrb r1, [r0] lsls r1, 9 ldr r3, =0x02023068 ldr r2, =0x03005d78 movs r0, 0 strb r0, [r2] movs r5, 0 ldr r7, =0x02022e2c adds r4, r1, r3 adds r6, r2, 0 @08059AC4: lsls r0, r5, 24 lsrs r0, 24 bl battle_menu_cursor_related ldrh r1, [r4] movs r0, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 adds r0, r7, 0 bl 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 .pool thumb_func_end sub_8059AAC thumb_func_start sub_8059B18 sub_8059B18: ; 8059B18 push {r4,lr} ldr r4, =0x02022e2c ldr r1, =gUnknown_085CCA6F adds r0, r4, 0 bl gf_strcpy adds r0, r4, 0 movs r1, 0x7 bl battle_show_message_maybe pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8059B18 thumb_func_start sub_8059B3C sub_8059B3C: ; 8059B3C push {r4-r7,lr} ldr r5, =0x02023064 ldr r7, =0x02024064 ldrb r0, [r7] lsls r0, 9 adds r1, r5, 0x2 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @08059B98 bl sub_814FBAC ldrb r1, [r7] lsls r4, r1, 9 adds r0, r5, 0x4 adds r4, r0 ldr r6, =0x02022e2c ldr r5, =0x020244b0 adds r1, r5 adds r0, r4, 0 adds r0, 0x8 ldrb r1, [r1] adds r0, r1 ldrb r1, [r0] adds r0, r6, 0 movs r2, 0x1 movs r3, 0x2 bl 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 .pool thumb_func_end sub_8059B3C thumb_func_start sub_8059BB0 sub_8059BB0: ; 8059BB0 push {r4-r6,lr} ldr r5, =0x02024064 ldrb r4, [r5] lsls r4, 9 ldr r0, =0x02023068 adds r4, r0 ldr r6, =0x02022e2c ldr r1, =gUnknown_085CCA73 adds r0, r6, 0 bl 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, =gBattleMoves ldr r2, =0x020244b0 ldrb r1, [r5] adds r1, r2 ldrb r1, [r1] lsls r1, 1 adds r4, r1 ldrh r2, [r4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r3 ldrb r2, [r1, 0x2] lsls r1, r2, 3 subs r1, r2 ldr r2, =gTypeNames adds r1, r2 bl gf_strcpy adds r0, r6, 0 movs r1, 0xA bl battle_show_message_maybe pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8059BB0 thumb_func_start battle_menu_cursor_related_2 battle_menu_cursor_related_2: ; 8059C28 push {lr} sub sp, 0x10 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 lsls r1, 24 lsrs r1, 24 add r2, sp, 0xC adds r0, r1, 0x1 strh r0, [r2] adds r0, r2, 0 adds r1, 0x2 strh r1, [r0, 0x2] movs r1, 0x1 adds r0, r3, 0 ands r0, r1 lsls r2, r0, 3 adds r2, r0 adds r2, 0x1 movs r0, 0x2 ands r3, r0 adds r3, 0x37 str r1, [sp] str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC bl 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, =0x00001016 strh r1, [r0] strh r1, [r0, 0x2] movs r1, 0x1 adds r0, r3, 0 ands r0, r1 lsls r2, r0, 3 adds r2, r0 adds r2, 0x1 movs r0, 0x2 ands r3, r0 adds r3, 0x37 str r1, [sp] str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC bl 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 .pool thumb_func_end battle_menu_cursor_related thumb_func_start sub_8059CB4 sub_8059CB4: ; 8059CB4 push {r4,lr} sub sp, 0x10 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 add r0, sp, 0xC movs r4, 0x1 strh r4, [r0] movs r1, 0x2 strh r1, [r0, 0x2] adds r0, r3, 0 ands r0, r4 lsls r2, r0, 3 subs r2, r0 adds r2, 0x10 lsls r2, 24 lsrs r2, 24 ands r3, r1 adds r3, 0x23 str r4, [sp] str r1, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC bl 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, =0x00001016 strh r1, [r0] strh r1, [r0, 0x2] movs r1, 0x1 adds r0, r3, 0 ands r0, r1 lsls r2, r0, 3 subs r2, r0 adds r2, 0x10 lsls r2, 24 lsrs r2, 24 movs r0, 0x2 ands r3, r0 adds r3, 0x23 str r1, [sp] str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0 add r1, sp, 0xC bl 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 .pool thumb_func_end sub_8059CF8 thumb_func_start sub_8059D40 sub_8059D40: ; 8059D40 push {lr} ldr r0, =sub_80A92F8 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8059D40 thumb_func_start sub_8059D50 sub_8059D50: ; 8059D50 push {lr} ldr r0, =sub_80A92F8 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8059D50 thumb_func_start sub_8059D60 sub_8059D60: ; 8059D60 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @08059D82 bl dp01_tbl1_exec_completed @08059D82: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8059D60 thumb_func_start bx_8030B2C bx_8030B2C: ; 8059D90 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @08059DB2 bl dp01_tbl1_exec_completed @08059DB2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_8030B2C thumb_func_start b_link_standby_message b_link_standby_message: ; 8059DC0 push {lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @08059DE0 ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r0, =gUnknown_085CCA29 movs r1, 0 bl battle_show_message_maybe @08059DE0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end b_link_standby_message thumb_func_start dp01t_00_1_getattr dp01t_00_1_getattr: ; 8059DF4 push {r4-r6,lr} sub sp, 0x100 movs r6, 0 ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @08059E2C ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] mov r1, sp bl dp01_getattr_by_ch1_for_player_pokemon_ adds r6, r0, 0 b @08059E4E .align 2, 0 .pool @08059E2C: ldrb r4, [r1] movs r5, 0 @08059E30: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @08059E46 lsls r0, r5, 24 lsrs r0, 24 mov r2, sp adds r1, r2, r6 bl dp01_getattr_by_ch1_for_player_pokemon_ adds r6, r0 @08059E46: lsrs r4, 1 adds r5, 0x1 cmp r5, 0x5 ble @08059E30 @08059E4E: lsls r1, r6, 16 lsrs r1, 16 movs r0, 0x1 mov r2, sp bl dp01_build_cmdbuf_x1D_1D_numargs_varargs bl dp01_tbl1_exec_completed add sp, 0x100 pop {r4-r6} pop {r0} bx r0 thumb_func_end dp01t_00_1_getattr thumb_func_start dp01_getattr_by_ch1_for_player_pokemon_ dp01_getattr_by_ch1_for_player_pokemon_: ; 8059E68 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x90 adds r7, r1, 0 lsls r0, 24 lsrs r5, r0, 24 movs r6, 0 ldr r2, =0x02023064 ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 9 adds r1, r2, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0x3B bls @08059E92 bl @0805A5FE @08059E92: lsls r0, 2 ldr r1, =@08059EA8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08059EA8: .4byte @08059F98 .4byte @0805A1BC .4byte @0805A1CC .4byte @0805A1DC .4byte @0805A244 .4byte @0805A244 .4byte @0805A244 .4byte @0805A244 .4byte @0805A260 .4byte @0805A29C .4byte @0805A29C .4byte @0805A29C .4byte @0805A29C .4byte @0805A5FE .4byte @0805A5FE .4byte @0805A5FE .4byte @0805A5FE .4byte @0805A2B8 .4byte @0805A2C8 .4byte @0805A2F8 .4byte @0805A308 .4byte @0805A318 .4byte @0805A328 .4byte @0805A338 .4byte @0805A348 .4byte @0805A358 .4byte @0805A368 .4byte @0805A378 .4byte @0805A388 .4byte @0805A398 .4byte @0805A3A8 .4byte @0805A3B8 .4byte @0805A408 .4byte @0805A418 .4byte @0805A428 .4byte @0805A438 .4byte @0805A448 .4byte @0805A458 .4byte @0805A468 .4byte @0805A478 .4byte @0805A488 .4byte @0805A4BC .4byte @0805A4CC .4byte @0805A4DC .4byte @0805A4EC .4byte @0805A4FC .4byte @0805A50C .4byte @0805A51C .4byte @0805A52C .4byte @0805A54C .4byte @0805A55C .4byte @0805A56C .4byte @0805A57C .4byte @0805A58C .4byte @0805A59C .4byte @0805A5AC .4byte @0805A5BC .4byte @0805A5CC .4byte @0805A5DC .4byte @0805A5EC @08059F98: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 add r0, sp, 0x24 mov r9, r0 movs r1, 0x3B add r1, sp mov r10, r1 mov r2, sp adds r2, 0x2B str r2, [sp, 0x80] mov r0, sp adds r0, 0x2A str r0, [sp, 0x7C] mov r1, sp adds r1, 0x68 str r1, [sp, 0x8C] adds r2, 0x5 str r2, [sp, 0x84] adds r0, 0x12 str r0, [sp, 0x88] mov r8, r4 add r4, sp, 0xC @08059FE4: adds r1, r6, 0 adds r1, 0xD mov r0, r8 bl pokemon_getattr strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 bl pokemon_getattr mov r2, r9 adds r1, r2, r6 strb r0, [r1] adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @08059FE4 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_getattr mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 bl pokemon_getattr ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr mov r3, sp movs r5, 0x1F ands r0, r5 ldrb r2, [r3, 0x14] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr mov r3, sp movs r6, 0x1F ands r0, r6 lsls r0, 5 ldrh r2, [r3, 0x14] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 2 ldrb r2, [r3, 0x15] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [sp, 0x14] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr mov r3, sp ands r0, r6 lsls r0, 4 ldrh r2, [r3, 0x16] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 1 ldrb r2, [r3, 0x17] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C bl pokemon_getattr mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D bl pokemon_getattr mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E bl pokemon_getattr mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F bl pokemon_getattr mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr mov r3, sp movs r1, 0x1 ands r0, r1 lsls r0, 6 ldrb r2, [r3, 0x17] movs r1, 0x41 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] bl pokemon_getattr ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] bl 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 .pool @0805A1BC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB b @0805A536 .align 2, 0 .pool @0805A1CC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xC b @0805A536 .align 2, 0 .pool @0805A1DC: movs r6, 0 add r2, sp, 0x58 mov r9, r2 add r0, sp, 0x60 mov r10, r0 movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 mov r8, r9 @0805A1F2: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 bl pokemon_getattr mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 bl pokemon_getattr mov r2, r10 adds r1, r2, r6 strb r0, [r1] movs r0, 0x2 add r8, r0 adds r6, 0x1 cmp r6, 0x3 ble @0805A1F2 movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x15 bl pokemon_getattr mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 movs r6, 0 @0805A230: adds r0, r7, r6 adds r1, r2, r6 ldrb r1, [r1] strb r1, [r0] adds r6, 0x1 cmp r6, 0xF bls @0805A230 b @0805A5FE .align 2, 0 .pool @0805A244: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x9 b @0805A536 .align 2, 0 .pool @0805A260: movs r6, 0 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r2, =0x020244ec mov r8, r2 @0805A26C: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 cmp r6, 0x3 ble @0805A26C movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x15 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 b @0805A5FE .align 2, 0 .pool @0805A29C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x8 b @0805A5F6 .align 2, 0 .pool @0805A2B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1 b @0805A2D2 .align 2, 0 .pool @0805A2C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x19 @0805A2D2: bl pokemon_getattr adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF lsls r0, 8 ands r0, r1 lsrs r0, 8 strb r0, [r7, 0x1] movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r0, 16 strb r0, [r7, 0x2] movs r6, 0x3 b @0805A5FE .align 2, 0 .pool @0805A2F8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1A b @0805A5F6 .align 2, 0 .pool @0805A308: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1B b @0805A5F6 .align 2, 0 .pool @0805A318: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1C b @0805A5F6 .align 2, 0 .pool @0805A328: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1D b @0805A5F6 .align 2, 0 .pool @0805A338: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1E b @0805A5F6 .align 2, 0 .pool @0805A348: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1F b @0805A5F6 .align 2, 0 .pool @0805A358: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x20 b @0805A5F6 .align 2, 0 .pool @0805A368: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x22 b @0805A5F6 .align 2, 0 .pool @0805A378: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x23 b @0805A5F6 .align 2, 0 .pool @0805A388: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x24 b @0805A5F6 .align 2, 0 .pool @0805A398: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x25 b @0805A5F6 .align 2, 0 .pool @0805A3A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x26 b @0805A5F6 .align 2, 0 .pool @0805A3B8: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr strb r0, [r7, 0x5] movs r6, 0x6 b @0805A5FE .align 2, 0 .pool @0805A408: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x27 b @0805A5F6 .align 2, 0 .pool @0805A418: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x28 b @0805A5F6 .align 2, 0 .pool @0805A428: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x29 b @0805A5F6 .align 2, 0 .pool @0805A438: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2A b @0805A5F6 .align 2, 0 .pool @0805A448: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2B b @0805A5F6 .align 2, 0 .pool @0805A458: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2C b @0805A5F6 .align 2, 0 .pool @0805A468: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0 b @0805A492 .align 2, 0 .pool @0805A478: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x9 b @0805A536 .align 2, 0 .pool @0805A488: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x37 @0805A492: bl pokemon_getattr adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF lsls r0, 8 ands r0, r1 lsrs r0, 8 strb r0, [r7, 0x1] movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r0, 16 strb r0, [r7, 0x2] lsrs r0, r1, 24 strb r0, [r7, 0x3] movs r6, 0x4 b @0805A5FE .align 2, 0 .pool @0805A4BC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 b @0805A5F6 .align 2, 0 .pool @0805A4CC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x39 b @0805A536 .align 2, 0 .pool @0805A4DC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A b @0805A536 .align 2, 0 .pool @0805A4EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3B b @0805A536 .align 2, 0 .pool @0805A4FC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3C b @0805A536 .align 2, 0 .pool @0805A50C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3D b @0805A536 .align 2, 0 .pool @0805A51C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3E b @0805A536 .align 2, 0 .pool @0805A52C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3F @0805A536: bl pokemon_getattr lsls r0, 16 lsrs r0, 16 strb r0, [r7] lsrs r0, 8 strb r0, [r7, 0x1] movs r6, 0x2 b @0805A5FE .align 2, 0 .pool @0805A54C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x16 b @0805A5F6 .align 2, 0 .pool @0805A55C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x17 b @0805A5F6 .align 2, 0 .pool @0805A56C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x18 b @0805A5F6 .align 2, 0 .pool @0805A57C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x21 b @0805A5F6 .align 2, 0 .pool @0805A58C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2F b @0805A5F6 .align 2, 0 .pool @0805A59C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x30 b @0805A5F6 .align 2, 0 .pool @0805A5AC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x32 b @0805A5F6 .align 2, 0 .pool @0805A5BC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x33 b @0805A5F6 .align 2, 0 .pool @0805A5CC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x34 b @0805A5F6 .align 2, 0 .pool @0805A5DC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x35 b @0805A5F6 .align 2, 0 .pool @0805A5EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x36 @0805A5F6: bl pokemon_getattr strb r0, [r7] movs r6, 0x1 @0805A5FE: adds r0, r6, 0 add sp, 0x90 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end dp01_getattr_by_ch1_for_player_pokemon_ thumb_func_start sub_805A614 sub_805A614: ; 805A614 push {r4-r7,lr} sub sp, 0x58 ldr r2, =0x0202406e ldr r5, =0x02024064 ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 adds r4, r2, 0 muls r4, r0 ldr r3, =0x02023064 lsls r1, 9 adds r0, r3, 0x1 adds r0, r1, r0 ldrb r2, [r0] ldr r0, =0x020244ec adds r0, r2, r0 adds r6, r4, r0 mov r0, sp adds r4, r0, r2 movs r2, 0 adds r0, r3, 0x2 adds r1, r0 adds r7, r5, 0 mov r12, r3 ldrb r1, [r1] cmp r2, r1 bcs @0805A66A adds r3, r0, 0 @0805A650: adds r1, r4, r2 adds r0, r6, r2 ldrb r0, [r0] strb r0, [r1] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 ldrb r0, [r5] lsls r0, 9 adds r0, r3 ldrb r0, [r0] cmp r2, r0 bcc @0805A650 @0805A66A: ldrb r0, [r7] lsls r0, 9 mov r1, r12 adds r1, 0x2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 adds r2, r4, 0 bl dp01_build_cmdbuf_x1D_1D_numargs_varargs bl dp01_tbl1_exec_completed add sp, 0x58 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805A614 thumb_func_start dp01t_02_1_setattr dp01t_02_1_setattr: ; 805A69C push {r4,r5,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @0805A6CC ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] bl dp01_setattr_by_ch1_for_player_pokemon b @0805A6EA .align 2, 0 .pool @0805A6CC: ldrb r4, [r1] movs r5, 0 @0805A6D0: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @0805A6DE adds r0, r5, 0 bl dp01_setattr_by_ch1_for_player_pokemon @0805A6DE: lsrs r4, 1 adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x5 bls @0805A6D0 @0805A6EA: bl dp01_tbl1_exec_completed pop {r4,r5} pop {r0} bx r0 thumb_func_end dp01t_02_1_setattr thumb_func_start dp01_setattr_by_ch1_for_player_pokemon dp01_setattr_by_ch1_for_player_pokemon: ; 805A6F4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x34 lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 ldr r2, =0x02023067 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 adds r0, r1 ldrb r0, [r0] adds r7, r2, 0 cmp r0, 0x3B bls @0805A720 bl @0805B0BA @0805A720: lsls r0, 2 ldr r1, =@0805A738 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0805A738: .4byte @0805A828 .4byte @0805A9C0 .4byte @0805A9E0 .4byte @0805AA00 .4byte @0805AA58 .4byte @0805AA58 .4byte @0805AA58 .4byte @0805AA58 .4byte @0805AA80 .4byte @0805AAE4 .4byte @0805AAE4 .4byte @0805AAE4 .4byte @0805AAE4 .4byte @0805B0BA .4byte @0805B0BA .4byte @0805B0BA .4byte @0805B0BA .4byte @0805AB14 .4byte @0805AB34 .4byte @0805AB54 .4byte @0805AB74 .4byte @0805AB94 .4byte @0805ABB4 .4byte @0805ABD4 .4byte @0805ABF4 .4byte @0805AC14 .4byte @0805AC34 .4byte @0805AC54 .4byte @0805AC74 .4byte @0805AC94 .4byte @0805ACB4 .4byte @0805ACD4 .4byte @0805AD44 .4byte @0805AD64 .4byte @0805AD84 .4byte @0805ADA4 .4byte @0805ADC4 .4byte @0805ADE4 .4byte @0805AE04 .4byte @0805AE24 .4byte @0805AE44 .4byte @0805AE64 .4byte @0805AE84 .4byte @0805AEA4 .4byte @0805AEC4 .4byte @0805AEE4 .4byte @0805AF04 .4byte @0805AF24 .4byte @0805AF44 .4byte @0805AF64 .4byte @0805AF84 .4byte @0805AFA4 .4byte @0805AFC4 .4byte @0805AFE4 .4byte @0805B004 .4byte @0805B024 .4byte @0805B044 .4byte @0805B064 .4byte @0805B084 .4byte @0805B0A4 @0805A828: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB adds r2, r6, 0 bl pokemon_setattr adds r2, r6, 0 adds r2, 0x2E adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr movs r0, 0 mov r8, r0 movs r0, 0x3B adds r0, r6 mov r10, r0 adds r0, r6, 0 adds r0, 0x2B str r0, [sp, 0x20] adds r0, 0x19 str r0, [sp, 0x28] adds r0, 0x4 str r0, [sp, 0x2C] adds r0, 0x4 str r0, [sp, 0x30] subs r0, 0x22 str r0, [sp, 0x1C] subs r0, 0x2 str r0, [sp, 0x18] adds r0, 0x4 str r0, [sp, 0x24] adds r0, r6, 0x2 str r0, [sp, 0x4] adds r0, r6, 0x4 str r0, [sp, 0x8] adds r0, r6, 0x6 str r0, [sp, 0xC] adds r0, 0x2 str r0, [sp, 0x10] adds r0, 0x2 str r0, [sp, 0x14] mov r9, r4 adds r7, r6, 0 adds r7, 0x24 adds r4, r6, 0 adds r4, 0xC @0805A88E: mov r1, r8 adds r1, 0xD mov r0, r9 adds r2, r4, 0 bl pokemon_setattr mov r1, r8 adds r1, 0x11 mov r0, r9 adds r2, r7, 0 bl pokemon_setattr adds r7, 0x1 adds r4, 0x2 movs r0, 0x1 add r8, r0 mov r0, r8 cmp r0, 0x3 ble @0805A88E movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 mov r2, r10 bl pokemon_setattr adds r0, r4, 0 movs r1, 0x20 ldr r2, [sp, 0x20] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x19 ldr r2, [sp, 0x28] bl pokemon_setattr ldrb r0, [r6, 0x14] lsls r0, 27 lsrs r0, 27 mov r1, sp strb r0, [r1] adds r0, r4, 0 movs r1, 0x27 mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x14] lsls r0, 22 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x28 mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x15] lsls r0, 25 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x29 mov r2, sp bl pokemon_setattr mov r1, sp ldr r0, [r6, 0x14] lsls r0, 12 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2A mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x16] lsls r0, 23 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2B mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x17] lsls r0, 26 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0 ldr r2, [sp, 0x2C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x37 ldr r2, [sp, 0x30] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 ldr r2, [sp, 0x1C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 ldr r2, [sp, 0x18] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A ldr r2, [sp, 0x24] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3B ldr r2, [sp, 0x4] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C ldr r2, [sp, 0x8] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D ldr r2, [sp, 0xC] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E ldr r2, [sp, 0x10] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F ldr r2, [sp, 0x14] bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805A9C0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xB bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805A9E0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xC bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AA00: movs r0, 0 mov r8, r0 movs r0, 0xC adds r0, r3 mov r9, r0 movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r7, r1, r0 adds r6, r3, 0 adds r6, 0x8 adds r4, r3, 0 @0805AA1A: mov r1, r8 adds r1, 0xD adds r0, r7, 0 adds r2, r4, 0 bl pokemon_setattr mov r1, r8 adds r1, 0x11 adds r0, r7, 0 adds r2, r6, 0 bl pokemon_setattr adds r6, 0x1 adds r4, 0x2 movs r0, 0x1 add r8, r0 mov r0, r8 cmp r0, 0x3 ble @0805AA1A movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x15 mov r2, r9 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AA58: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x9 b @0805AAFC .align 2, 0 .pool @0805AA80: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x11 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x12 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x13 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x14 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AAE4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x8 @0805AAFC: adds r3, 0x3 adds r2, r3 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AB14: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AB34: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x19 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AB54: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1A bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AB74: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1B bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AB94: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1C bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805ABB4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1D bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805ABD4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1E bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805ABF4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1F bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AC14: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x20 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AC34: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x22 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AC54: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x23 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AC74: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x24 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AC94: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x25 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805ACB4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x26 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805ACD4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x27 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x28 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x29 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x2A bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x2B bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x5 adds r2, r0 adds r0, r4, 0 b @0805ADF4 .align 2, 0 .pool @0805AD44: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x27 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AD64: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x28 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AD84: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x29 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805ADA4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2A bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805ADC4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2B bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805ADE4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 @0805ADF4: movs r1, 0x2C bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AE04: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AE24: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x9 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AE44: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x37 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AE64: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x38 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AE84: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x39 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AEA4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3A bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AEC4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3B bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AEE4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3C bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AF04: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3D bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AF24: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3E bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AF44: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3F bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AF64: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x16 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AF84: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x17 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AFA4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x18 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AFC4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x21 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805AFE4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2F bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805B004: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x30 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805B024: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x32 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805B044: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x33 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805B064: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x34 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805B084: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x35 bl pokemon_setattr b @0805B0BA .align 2, 0 .pool @0805B0A4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x36 bl pokemon_setattr @0805B0BA: ldr r2, =0x0202406e ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 add sp, 0x34 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_setattr_by_ch1_for_player_pokemon thumb_func_start sub_805B0F0 sub_805B0F0: ; 805B0F0 push {r4-r7,lr} ldr r1, =0x0202406e ldr r7, =0x02024064 ldrb r2, [r7] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 adds r3, r1, 0 muls r3, r0 ldr r4, =0x02023064 lsls r2, 9 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] ldr r1, =0x020244ec adds r0, r1 adds r5, r3, r0 movs r3, 0 adds r0, r4, 0x2 adds r2, r0 ldrb r2, [r2] cmp r3, r2 bcs @0805B148 adds r6, r4, 0 adds r2, r7, 0 adds r4, r0, 0 @0805B126: adds r1, r5, r3 ldrb r0, [r2] lsls r0, 9 adds r0, 0x3 adds r0, r3, r0 adds r0, r6 ldrb r0, [r0] strb r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 ldrb r0, [r2] lsls r0, 9 adds r0, r4 ldrb r0, [r0] cmp r3, r0 bcc @0805B126 @0805B148: bl dp01_tbl1_exec_completed pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805B0F0 thumb_func_start sub_805B164 sub_805B164: ; 805B164 push {r4,lr} ldr r2, =0x0202406e ldr r4, =0x02024064 ldrb r1, [r4] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805DD7C ldr r2, =0x02020630 ldr r0, =0x020241e4 ldrb r3, [r4] adds r0, r3, r0 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_0802E404 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805B164 thumb_func_start sub_805B1CC sub_805B1CC: ; 805B1CC push {r4-r6,lr} ldr r5, =0x02024064 ldrb r0, [r5] ldr r4, =0x02023064 lsls r1, r0, 9 adds r6, r4, 0x2 adds r1, r6 ldrb r1, [r1] bl sub_805EF84 ldr r2, =0x0202406e ldrb r0, [r5] lsls r1, r0, 1 adds r1, r2 lsls r0, 9 adds r4, 0x1 adds r0, r4 ldrb r0, [r0] movs r4, 0 strh r0, [r1] ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805DD7C ldr r1, =0x020244ac ldrb r0, [r5] adds r0, r1 strb r4, [r0] ldr r1, =0x020244b0 ldrb r0, [r5] adds r0, r1 strb r4, [r0] ldrb r0, [r5] lsls r1, r0, 9 adds r1, r6 ldrb r1, [r1] bl sub_805B258 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_805902C str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805B1CC thumb_func_start sub_805B258 sub_805B258: ; 805B258 push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 bl sub_805EF84 ldr r0, =0x0202406e lsls r2, r6, 1 adds r2, r0 ldr r0, =0x02023064 lsls r1, r6, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] strh r0, [r2] ldrh r1, [r2] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 bl object_new_hidden_with_callback ldr r1, =0x03005d7c mov r9, r1 add r9, r6 mov r1, r9 strb r0, [r1] adds r0, r6, 0 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_806A068 ldr r0, =0x0202499c mov r10, r0 adds r0, r6, 0 movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r10 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 adds r4, r6, r4 strb r0, [r4] ldr r5, =0x02020630 mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r4] strh r1, [r0, 0x30] mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x32] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x2E] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 mov r1, r8 strh r1, [r0, 0x32] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, r6, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r6, r1 ldrb r1, [r6] bl 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, =nullsub_12 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 .pool thumb_func_end sub_805B258 thumb_func_start sub_805B3D4 sub_805B3D4: ; 805B3D4 push {r4-r6,lr} ldr r1, =0x02023064 ldr r6, =0x02024064 ldrb r2, [r6] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r3, [r0] cmp r3, 0 bne @0805B41C ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_805B464 str r1, [r0] b @0805B452 .align 2, 0 .pool @0805B41C: ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl dp01_tbl1_exec_completed @0805B452: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805B3D4 thumb_func_start sub_805B464 sub_805B464: ; 805B464 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r4, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r0, [r3, 0x4] cmp r0, 0 beq @0805B48C cmp r0, 0x1 beq @0805B4BA b @0805B4E2 .align 2, 0 .pool @0805B48C: ldr r1, [r4] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0805B4A6 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @0805B4A6: ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strb r1, [r0, 0x4] b @0805B4E2 @0805B4BA: ldrb r1, [r3] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @0805B4E2 strb r0, [r3, 0x4] ldrb r2, [r5] adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x1 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8059744 str r1, [r0] @0805B4E2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805B464 thumb_func_start sub_805B4F0 sub_805B4F0: ; 805B4F0 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @0805B5B4 bl link_get_multiplayer_id ldr r5, =0x020229e8 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 movs r4, 0xFF ldrb r0, [r1] cmp r0, 0x4 beq @0805B538 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrh r1, [r1] adds r0, r4, 0 ands r0, r1 cmp r0, 0x5 bne @0805B558 @0805B538: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r0, [r1, 0x13] adds r4, r0, 0x2 b @0805B5BA .align 2, 0 .pool @0805B558: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrh r1, [r1] adds r0, r4, 0 ands r0, r1 cmp r0, 0x2 beq @0805B58A bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrh r0, [r1] ands r4, r0 cmp r4, 0x1 bne @0805B5A0 @0805B58A: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r0, [r1, 0x13] adds r4, r0, 0x4 b @0805B5BA @0805B5A0: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r4, [r1, 0x13] b @0805B5BA @0805B5B4: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r4, [r0, 0x8] @0805B5BA: ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0x40 ands r1, r2 adds r5, r0, 0 cmp r1, 0 beq @0805B63C ldr r0, =0x02024064 ldrb r0, [r0] bl battle_get_per_side_status movs r1, 0x2 ands r1, r0 movs r0, 0x20 mov r9, r0 cmp r1, 0 beq @0805B5E0 movs r1, 0x5A mov r9, r1 @0805B5E0: ldr r0, [r5] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @0805B618 ldr r0, =0x02038bce ldrh r1, [r0] ldr r0, =0x00000c03 cmp r1, r0 beq @0805B618 movs r0, 0x5A mov r9, r0 ldr r1, =gUnknown_083054E0 b @0805B642 .align 2, 0 .pool @0805B618: ldr r1, =gUnknown_08305D2C lsls r0, r4, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x8 subs r0, r1 lsls r0, 18 movs r1, 0xA0 lsls r1, 15 adds r0, r1 lsrs r7, r0, 16 ldr r5, =0x02022fec b @0805B656 .align 2, 0 .pool @0805B63C: movs r0, 0x50 mov r9, r0 ldr r1, =gUnknown_08305D2C @0805B642: lsls r0, r4, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x8 subs r0, r1 lsls r0, 18 movs r1, 0xA0 lsls r1, 15 adds r0, r1 lsrs r7, r0, 16 @0805B656: ldr r0, [r5] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 bne @0805B664 b @0805B794 @0805B664: ldr r0, =0x02038bce ldrh r1, [r0] ldr r0, =0x00000c03 cmp r1, r0 bne @0805B670 b @0805B794 @0805B670: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] bl sub_806F000 lsls r0, 16 lsrs r4, r0, 16 adds r5, r4, 0 ldr r6, =0x02024064 ldrb r1, [r6] adds r0, r5, 0 bl sub_805DF38 ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 bl sub_806A1C0 ldr r0, =0x0202499c mov r8, r0 lsls r4, r7, 16 asrs r4, 16 ldrb r0, [r6] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r8 mov r1, r9 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 ldrb r1, [r6] adds r1, r4 strb r0, [r1] ldr r0, =gTrainerPaletteTable lsls r5, 3 adds r5, r0 ldrh r0, [r5, 0x4] bl gpu_pal_tags_index_of ldr r5, =0x02020630 ldrb r1, [r6] adds r1, r4 ldrb r1, [r1] lsls r2, r1, 4 adds r2, r1 lsls r2, 2 adds r2, r5 lsls r0, 4 ldrb r3, [r2, 0x5] movs r1, 0xF ands r1, r3 orrs r1, r0 strb r1, [r2, 0x5] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0xF0 strh r1, [r0, 0x24] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x30 strh r1, [r0, 0x26] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_805D7AC str r1, [r0] ldrb r0, [r6] adds r0, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 ldrb r2, [r1, 0x1] movs r0, 0x4 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 adds r0, 0x3F ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @0805B82A .align 2, 0 .pool @0805B794: ldr r5, =0x02024064 ldrb r1, [r5] adds r0, r4, 0 bl sub_805DF84 ldrb r0, [r5] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl template_build_for_pokemon_or_trainer ldr r6, =0x0202499c mov r8, r9 lsls r4, r7, 16 asrs r4, 16 ldrb r0, [r5] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 adds r0, r6, 0 mov r1, r8 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r6, =0x020241e4 ldrb r1, [r5] adds r1, r6 strb r0, [r1] ldr r4, =0x02020630 ldrb r3, [r5] adds r0, r3, r6 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0xF0 strh r1, [r0, 0x24] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, 0x1C adds r0, r4 ldr r1, =sub_805D7AC str r1, [r0] @0805B82A: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8058844 str r1, [r0] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805B4F0 thumb_func_start dp01t_08_1_8032428 dp01t_08_1_8032428: ; 805B864 push {r4-r6,lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @0805B920 bl link_get_multiplayer_id ldr r5, =0x020229e8 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 movs r4, 0xFF ldrb r0, [r1] cmp r0, 0x4 beq @0805B8A6 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrh r1, [r1] adds r0, r4, 0 ands r0, r1 cmp r0, 0x5 bne @0805B8C4 @0805B8A6: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r0, [r1, 0x13] adds r4, r0, 0x2 b @0805B926 .align 2, 0 .pool @0805B8C4: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrh r1, [r1] adds r0, r4, 0 ands r0, r1 cmp r0, 0x2 beq @0805B8F6 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrh r0, [r1] ands r4, r0 cmp r4, 0x1 bne @0805B90C @0805B8F6: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r0, [r1, 0x13] adds r4, r0, 0x4 b @0805B926 @0805B90C: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r4, [r1, 0x13] b @0805B926 @0805B920: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r4, [r0, 0x8] @0805B926: ldr r5, =0x02024064 ldrb r1, [r5] adds r0, r4, 0 bl sub_805DF84 ldrb r0, [r5] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl template_build_for_pokemon_or_trainer ldr r0, =0x0202499c ldr r1, =gUnknown_08305D2C lsls r4, 2 adds r4, r1 ldrb r1, [r4] movs r2, 0x8 subs r2, r1 lsls r2, 18 movs r1, 0xA0 lsls r1, 15 adds r2, r1 asrs r2, 16 movs r1, 0x50 movs r3, 0x1E bl obj_add_from_template_forward_search ldr r6, =0x020241e4 ldrb r1, [r5] adds r1, r6 strb r0, [r1] ldr r4, =0x02020630 ldrb r3, [r5] adds r0, r3, r6 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000ffa0 strh r1, [r0, 0x24] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x2 strh r1, [r0, 0x2E] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, 0x1C adds r0, r4 ldr r1, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_805887C str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_08_1_8032428 thumb_func_start sub_805B9F8 sub_805B9F8: ; 805B9F8 push {r4-r6,lr} ldr r5, =0x020241e4 ldr r6, =0x02024064 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl oamt_add_pos2_onto_pos1 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x32 strh r1, [r0, 0x2E] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000ffd8 strh r1, [r0, 0x32] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =nullsub_12 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, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =bx_802F7A0 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805B9F8 thumb_func_start sub_805BAB8 sub_805BAB8: ; 805BAB8 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r0, [r4, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r3, r1, r0 ldrb r0, [r3, 0x4] cmp r0, 0 bne @0805BB0C ldr r1, [r4] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0805BAEC adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @0805BAEC: ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x4] adds r1, 0x1 strb r1, [r0, 0x4] b @0805BB82 .align 2, 0 .pool @0805BB0C: ldrb r1, [r3] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @0805BB82 strb r4, [r3, 0x4] ldr r2, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 movs r1, 0x40 negs r1, r1 movs r0, 0x10 bl audio_play_and_stuff ldr r2, =0x02020630 ldr r3, =0x020241e4 ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r4, [r0, 0x30] ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x5 strh r1, [r0, 0x32] ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039C00 str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_80596A8 str r1, [r0] @0805BB82: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805BAB8 thumb_func_start sub_805BBA4 sub_805BBA4: ; 805BBA4 push {lr} sub sp, 0x4 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r1, 0x2 movs r2, 0 movs r3, 0x10 bl 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, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x8] movs r0, 0x4 strb r0, [r1, 0x8] ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldr r5, =0x02024064 ldrb r4, [r5] movs r0, 0x1 bl battle_get_side_with_given_state adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r4, 0 movs r3, 0x3 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_wait_t1 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805BBC4 thumb_func_start sub_805BC18 sub_805BC18: ; 805BC18 push {r4,r5,lr} ldr r1, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r1, [r0] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] strb r1, [r0, 0x8] ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r4, [r5] movs r0, 0x1 bl battle_get_side_with_given_state adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r4, 0 movs r3, 0x3 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_wait_t1 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805BC18 thumb_func_start sub_805BC78 sub_805BC78: ; 805BC78 push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @0805BC96 @0805BC8C: subs r0, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @0805BC8C @0805BC96: bl dp01_tbl1_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805BC78 thumb_func_start dp01t_0F_1_move_anim dp01t_0F_1_move_anim: ; 805BCA8 push {r4-r7,lr} mov r7, r8 push {r7} ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 beq @0805BCBE b @0805BDE4 @0805BCBE: ldr r0, =0x02023064 mov r12, r0 ldrb r1, [r5] lsls r1, 9 adds r0, 0x1 adds r0, r1, r0 ldrb r6, [r0] mov r0, r12 adds r0, 0x2 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 8 orrs r6, r0 ldr r0, =0x02038432 mov r8, r0 mov r0, r12 adds r0, 0x3 adds r1, r0 ldrb r0, [r1] mov r1, r8 strb r0, [r1] ldr r3, =0x02038408 ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0x4 adds r0, r1, r0 ldrb r2, [r0] mov r0, r12 adds r0, 0x5 adds r1, r0 ldrb r0, [r1] lsls r0, 8 orrs r2, r0 strh r2, [r3] ldr r3, =0x02038404 ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0x6 adds r0, r1, r0 ldrb r2, [r0] mov r0, r12 adds r0, 0x7 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 8 orrs r2, r0 mov r0, r12 adds r0, 0x8 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 16 orrs r2, r0 mov r0, r12 adds r0, 0x9 adds r1, r0 ldrb r0, [r1] lsls r0, 24 orrs r2, r0 str r2, [r3] ldr r2, =0x0203841a ldrb r0, [r5] lsls r0, 9 mov r1, r12 adds r1, 0xA adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r4, =0x0203841c ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0xC adds r0, r1, r0 ldrb r2, [r0] mov r0, r12 adds r0, 0xD adds r1, r0 ldrb r0, [r1] lsls r0, 8 orrs r2, r0 strh r2, [r4] ldr r7, =0x02038400 ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0x10 adds r1, r0 str r1, [r7] ldr r2, =0x020244bc ldrb r0, [r5] lsls r0, 2 adds r0, r2 ldr r1, [r1] str r1, [r0] mov r0, r8 ldrb r1, [r0] adds r0, r6, 0 bl sub_805DB8C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @0805BDBC bl dp01_tbl1_exec_completed b @0805BDE4 .align 2, 0 .pool @0805BDBC: ldr r0, =0x020244d0 ldr r0, [r0] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_move_anim_1 str r1, [r0] ldrh r1, [r4] ldr r2, [r7] adds r0, r6, 0 bl sub_817E0FC @0805BDE4: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_0F_1_move_anim thumb_func_start bx_move_anim_1 bx_move_anim_1: ; 805BDFC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r2, =0x02023064 ldr r6, =0x02024064 ldrb r3, [r6] lsls r1, r3, 9 adds r0, r2, 0x1 mov r10, r0 adds r0, r1, r0 ldrb r4, [r0] adds r5, r2, 0x2 mov r9, r5 adds r0, r1, r5 ldrb r0, [r0] lsls r0, 8 orrs r4, r0 adds r2, 0xB adds r1, r2 ldrb r1, [r1] mov r8, r1 ldr r7, =0x020244d0 ldr r5, [r7] ldr r1, [r5, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x4] cmp r2, 0x1 beq @0805BE94 cmp r2, 0x1 bgt @0805BE54 cmp r2, 0 beq @0805BE5E b @0805BF70 .align 2, 0 .pool @0805BE54: cmp r2, 0x2 beq @0805BEBE cmp r2, 0x3 beq @0805BF34 b @0805BF70 @0805BE5E: ldr r1, [r5] lsls r0, r3, 2 adds r1, r0, r1 ldrb r2, [r1] movs r0, 0xC ands r0, r2 cmp r0, 0x4 bne @0805BE80 movs r0, 0x8 orrs r0, r2 strb r0, [r1] ldrb r2, [r6] adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @0805BE80: ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strb r1, [r0, 0x4] b @0805BF70 @0805BE94: ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0805BF70 movs r0, 0 bl sub_805EB9C adds r0, r4, 0 bl move_anim_start_t1 ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x2 strb r1, [r0, 0x4] b @0805BF70 @0805BEBE: ldr r0, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd ldrb r0, [r0] cmp r0, 0 bne @0805BF70 movs r0, 0x1 bl sub_805EB9C ldr r0, [r7] ldrb r2, [r6] ldr r1, [r0] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0805BF0C mov r0, r8 cmp r0, 0x1 bhi @0805BF0C adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x6 bl move_anim_start_t4 ldr r0, [r7] ldrb r1, [r6] ldr r0, [r0] lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] @0805BF0C: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x4] b @0805BF70 .align 2, 0 .pool @0805BF34: ldrb r1, [r0] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @0805BF70 bl sub_805E394 ldrb r0, [r6] lsls r2, r0, 9 mov r3, r10 adds r1, r2, r3 ldrb r1, [r1] add r2, r9 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 bl sub_805E94C ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r4, [r0, 0x4] bl dp01_tbl1_exec_completed @0805BF70: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end bx_move_anim_1 thumb_func_start sub_805BF80 sub_805BF80: ; 805BF80 push {r4,r5,lr} ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r5, =0x02024064 ldrb r4, [r5] lsls r4, 9 ldr r0, =0x02023066 adds r4, r0 ldrh r0, [r4] bl battle_pick_message ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_80597B4 str r1, [r0] ldrh r0, [r4] bl sub_817C95C ldrb r0, [r5] ldrh r1, [r4] bl sub_81A57E4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805BF80 thumb_func_start dp01t_11_1_message_for_player_only dp01t_11_1_message_for_player_only: ; 805BFE0 push {lr} ldr r0, =0x02024064 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0805BFFC bl sub_805BF80 b @0805C000 .align 2, 0 .pool @0805BFFC: bl dp01_tbl1_exec_completed @0805C000: pop {r0} bx r0 thumb_func_end dp01t_11_1_message_for_player_only thumb_func_start sub_805C004 sub_805C004: ; 805C004 push {lr} bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @0805C02A ldr r0, =0x02022e14 strh r1, [r0] ldr r1, =0x02022e16 movs r0, 0xA0 strh r0, [r1] ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8057588 str r1, [r0] @0805C02A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C004 thumb_func_start dp01t_12_6_battle_menu dp01t_12_6_battle_menu: ; 805C044 push {r4,lr} ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_805C004 str r1, [r0] bl sub_817F2A8 ldr r0, =gUnknown_085CCA3A movs r1, 0x2 bl battle_show_message_maybe movs r4, 0 @0805C062: lsls r0, r4, 24 lsrs r0, 24 bl sub_8059CF8 adds r4, 0x1 cmp r4, 0x3 ble @0805C062 ldr r1, =0x020244ac ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] movs r1, 0 bl sub_8059CB4 ldr r0, =gUnknown_085CC9F3 bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0x1 bl battle_show_message_maybe pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_12_6_battle_menu thumb_func_start sub_805C0B0 sub_805C0B0: ; 805C0B0 push {r4,lr} sub sp, 0x4 ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @0805C108 str r0, [sp] movs r0, 0x18 movs r1, 0x8 movs r2, 0x1D movs r3, 0xD bl sub_8056A3C ldr r0, =gUnknown_085CCABB movs r1, 0xC bl battle_show_message_maybe ldr r1, =0x03005d74 movs r0, 0x1 strb r0, [r1] movs r0, 0x1 bl sub_8056B74 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_80599D4 str r1, [r0] b @0805C10C .align 2, 0 .pool @0805C108: bl dp01_tbl1_exec_completed @0805C10C: add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end sub_805C0B0 thumb_func_start sub_805C114 sub_805C114: ; 805C114 push {lr} bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @0805C13E ldr r0, =0x02022e14 strh r1, [r0] ldr r1, =0x02022e16 movs r2, 0xA0 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8057BFC str r1, [r0] @0805C13E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C114 thumb_func_start sub_805C158 sub_805C158: ; 805C158 push {lr} ldr r0, =0x02024064 ldrb r1, [r0] ldr r0, =0x0202449c ldr r0, [r0] adds r1, r0 movs r0, 0xA6 lsls r0, 2 adds r1, r0 ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] lsls r0, 24 cmp r0, 0 bne @0805C194 ldr r1, =0x0203bd30 ldr r0, =0x03005d80 ldr r0, [r0] str r0, [r1] bl sub_805D19C adds r2, r0, 0 lsls r2, 16 lsrs r2, 16 movs r0, 0x1 movs r1, 0xA bl dp01_build_cmdbuf_x21_a_bb bl dp01_tbl1_exec_completed @0805C194: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C158 thumb_func_start dp01t_14_5_move_menu_pokedude dp01t_14_5_move_menu_pokedude: ; 805C1A8 push {lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @0805C1EC ldr r2, =0x02024064 ldrb r0, [r2] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 movs r1, 0xA6 lsls r1, 2 adds r0, r1 movs r1, 0x8 strb r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_805C158 b @0805C1FC .align 2, 0 .pool @0805C1EC: bl sub_805C210 ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_805C114 @0805C1FC: str r1, [r0] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_14_5_move_menu_pokedude thumb_func_start sub_805C210 sub_805C210: ; 805C210 push {lr} bl sub_8059AAC ldr r1, =0x03005d74 movs r0, 0xFF strb r0, [r1] ldr r1, =0x020244b0 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] movs r1, 0 bl battle_menu_cursor_related_2 bl sub_8059B18 bl sub_8059B3C bl sub_8059BB0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C210 thumb_func_start sub_805C248 sub_805C248: ; 805C248 push {r4,r5,lr} sub sp, 0x4 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_80598A4 str r1, [r0] ldr r1, =0x020244b8 ldrb r0, [r2] strb r0, [r1] movs r3, 0 ldr r5, =0x0203cf00 ldr r4, =0x02023064 @0805C276: adds r0, r3, r5 ldrb r1, [r2] lsls r1, 9 adds r1, 0x1 adds r1, r3, r1 adds r1, r4 ldrb r1, [r1] strb r1, [r0] adds r3, 0x1 cmp r3, 0x2 ble @0805C276 add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C248 thumb_func_start sub_805C2AC sub_805C2AC: ; 805C2AC push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 movs r3, 0 ldr r0, =0x0203cf00 mov r12, r0 ldr r1, =0x02023064 mov r8, r1 ldr r2, =0x02024064 ldr r7, =0x02022fec mov r6, r12 mov r5, r8 adds r4, r2, 0 @0805C2C8: adds r0, r3, r6 ldrb r1, [r4] lsls r1, 9 adds r1, 0x4 adds r1, r3, r1 adds r1, r5 ldrb r1, [r1] strb r1, [r0] adds r3, 0x1 cmp r3, 0x2 ble @0805C2C8 ldr r0, [r7] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @0805C330 ldrb r3, [r2] lsls r0, r3, 9 mov r1, r8 adds r1, 0x1 adds r0, r1 ldrb r1, [r0] movs r0, 0xF ands r0, r1 cmp r0, 0x2 beq @0805C330 ldr r1, =0x0202406e lsls r0, r3, 1 adds r0, r1 ldrb r1, [r0] adds r1, 0x1 lsls r1, 24 lsrs r1, 24 movs r0, 0x1 mov r2, r12 bl dp01_build_cmdbuf_x22_a_three_bytes bl dp01_tbl1_exec_completed b @0805C3BC .align 2, 0 .pool @0805C330: ldr r0, =nullsub_4 movs r1, 0xFF bl AddTask ldr r3, =0x03005d7c ldr r4, =0x02024064 ldrb r1, [r4] adds r1, r3 movs r2, 0 mov r8, r2 strb r0, [r1] ldr r5, =0x03005e00 ldrb r2, [r4] adds r3, r2, r3 ldrb r0, [r3] lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r5 ldr r5, =0x02023064 lsls r2, 9 adds r6, r5, 0x1 adds r2, r6 ldrb r2, [r2] movs r0, 0xF ands r0, r2 strh r0, [r1, 0x8] ldr r3, =0x0202449c ldr r1, [r3] adds r1, 0x49 ldrb r0, [r4] lsls r0, 9 adds r0, r6 ldrb r0, [r0] lsrs r0, 4 strb r0, [r1] ldr r2, [r3] adds r2, 0x8B ldrb r0, [r4] lsls r0, 9 adds r1, r5, 0x2 adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r1, [r3] adds r1, 0xB0 ldrb r0, [r4] lsls r0, 9 adds r5, 0x3 adds r0, r5 ldrb r0, [r0] strb r0, [r1] movs r0, 0x1 negs r0, r0 mov r1, r8 str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_80597CC str r1, [r0] ldr r1, =0x020244b8 ldrb r0, [r4] strb r0, [r1] @0805C3BC: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C2AC thumb_func_start sub_805C3EC sub_805C3EC: ; 805C3EC push {lr} sub sp, 0x4 bl sub_805EA60 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r1, 0x2 movs r2, 0 movs r3, 0x10 bl 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, =0x02023064 ldr r0, =0x02024064 mov r9, r0 ldrb r1, [r0] lsls r1, 9 adds r0, r3, 0x2 adds r0, r1, r0 ldrb r2, [r0] adds r3, 0x3 adds r1, r3 ldrb r0, [r1] lsls r0, 8 orrs r2, r0 lsls r2, 16 asrs r7, r2, 16 cmp r7, 0 ble @0805C44A ldr r1, =0x0203cd70 ldr r0, [r1] adds r0, r7 str r0, [r1] @0805C44A: ldr r0, =0x00007fff cmp r7, r0 beq @0805C4B4 ldr r6, =0x0202406e mov r1, r9 ldrb r0, [r1] lsls r0, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x3A bl pokemon_getattr mov r8, r0 mov r2, r9 ldrb r0, [r2] lsls r0, 1 adds r0, r6 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] mov r2, r8 bl sub_807294C b @0805C4F2 .align 2, 0 .pool @0805C4B4: ldr r1, =0x0202406e mov r2, r9 ldrb r0, [r2] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A bl pokemon_getattr adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r4, =0x03005d70 adds r1, r0, r4 ldrb r1, [r1] str r7, [sp] movs r3, 0 bl sub_807294C mov r2, r9 ldrb r0, [r2] adds r0, r4 ldrb r0, [r0] movs r1, 0 movs r2, 0 bl heathbar_draw_hp @0805C4F2: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_t1_healthbar_update str r1, [r0] add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C410 thumb_func_start sub_805C528 sub_805C528: ; 805C528 push {r4-r7,lr} ldr r5, =0x02023064 ldr r6, =0x02024064 ldrb r0, [r6] lsls r0, 9 adds r1, r5, 0x1 adds r0, r1 ldrb r7, [r0] movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr cmp r0, 0x63 bls @0805C560 bl dp01_tbl1_exec_completed b @0805C5AC .align 2, 0 .pool @0805C560: movs r0, 0x1 bl load_gfxc_health_bar adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr ldrb r1, [r6] lsls r1, 9 adds r0, r5, 0x2 adds r0, r1, r0 ldrb r4, [r0] adds r0, r5, 0x3 adds r1, r0 ldrb r0, [r1] lsls r0, 8 orrs r4, r0 ldr r0, =sub_80591B8 movs r1, 0xA bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r7, [r1, 0x8] strh r4, [r1, 0xA] ldrb r0, [r6] strh r0, [r1, 0xC] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_21 str r1, [r0] @0805C5AC: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C528 thumb_func_start sub_805C5C4 sub_805C5C4: ; 805C5C4 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @0805C618 ldr r0, =0x03005d70 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe ldrb r2, [r4] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8059D60 str r1, [r0] @0805C618: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C5C4 thumb_func_start sub_805C63C sub_805C63C: ; 805C63C push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @0805C68C ldr r4, =0x02023064 ldrb r3, [r5] lsls r3, 9 adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] adds r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 adds r2, r4, 0x4 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 16 orrs r1, r2 adds r4, 0x5 adds r3, r4 ldrb r2, [r3] lsls r2, 24 orrs r1, r2 bl move_anim_start_t2_for_situation ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8059D60 str r1, [r0] @0805C68C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C63C thumb_func_start sub_805C6A4 sub_805C6A4: ; 805C6A4 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x4 ldr r0, =0x0202406e mov r8, r0 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 1 add r0, r8 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0x37 bl pokemon_getattr ldr r2, =0x02023064 ldrb r1, [r4] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] eors r0, r1 mov r1, sp strb r0, [r1] ldrb r0, [r4] lsls r0, 1 add r0, r8 ldrh r0, [r0] muls r0, r6 adds r0, r5 movs r1, 0x37 mov r2, sp bl pokemon_setattr bl dp01_tbl1_exec_completed add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C6A4 thumb_func_start sub_805C710 sub_805C710: ; 805C710 push {lr} bl dp01_tbl1_exec_completed pop {r0} bx r0 thumb_func_end sub_805C710 thumb_func_start sub_805C71C sub_805C71C: ; 805C71C push {r4,r5,lr} ldr r3, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r2, 9 adds r0, r3, 0x1 adds r0, r2, r0 ldrb r5, [r0] adds r0, r3, 0x2 adds r0, r2, r0 ldrb r0, [r0] lsls r0, 8 orrs r5, r0 adds r0, r3, 0x3 adds r0, r2, r0 ldrb r0, [r0] lsls r0, 16 orrs r5, r0 adds r0, r3, 0x4 adds r0, r2, r0 ldrb r4, [r0] lsls r4, 24 adds r0, r3, 0x5 adds r0, r2, r0 ldrb r1, [r0] adds r0, r3, 0x6 adds r0, r2, r0 ldrb r0, [r0] lsls r0, 8 orrs r1, r0 lsls r1, 16 adds r3, 0x7 adds r2, r3 orrs r5, r4 lsrs r4, r1, 16 movs r0, 0x80 lsls r0, 5 cmp r4, r0 bhi @0805C78C ldr r0, =0x040000d4 str r2, [r0] str r5, [r0, 0x4] lsrs r1, 17 movs r2, 0x80 lsls r2, 24 orrs r1, r2 str r1, [r0, 0x8] ldr r0, [r0, 0x8] b @0805C7B8 .align 2, 0 .pool @0805C78C: ldr r3, =0x040000d4 str r2, [r3] str r5, [r3, 0x4] ldr r0, =0x80000800 str r0, [r3, 0x8] ldr r0, [r3, 0x8] movs r0, 0x80 lsls r0, 5 adds r2, r0 adds r5, r0 ldr r1, =0xfffff000 adds r4, r1 cmp r4, r0 bhi @0805C78C str r2, [r3] str r5, [r3, 0x4] lsrs r0, r4, 1 movs r1, 0x80 lsls r1, 24 orrs r0, r1 str r0, [r3, 0x8] ldr r0, [r3, 0x8] @0805C7B8: bl dp01_tbl1_exec_completed pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C71C thumb_func_start sub_805C7D0 sub_805C7D0: ; 805C7D0 push {lr} ldr r2, =0x02023064 ldr r0, =0x02024064 ldrb r1, [r0] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl song_play_for_text bl dp01_tbl1_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C7D0 thumb_func_start sub_805C800 sub_805C800: ; 805C800 push {lr} bl dp01_tbl1_exec_completed pop {r0} bx r0 thumb_func_end sub_805C800 thumb_func_start sub_805C80C sub_805C80C: ; 805C80C push {lr} movs r0, 0x1 movs r1, 0 movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb bl dp01_tbl1_exec_completed pop {r0} bx r0 thumb_func_end sub_805C80C thumb_func_start sub_805C820 sub_805C820: ; 805C820 push {lr} movs r0, 0x1 movs r1, 0 movs r2, 0 bl dp01_build_cmdbuf_x22_a_three_bytes bl dp01_tbl1_exec_completed pop {r0} bx r0 thumb_func_end sub_805C820 thumb_func_start sub_805C834 sub_805C834: ; 805C834 push {lr} movs r0, 0x1 movs r1, 0 bl dp01_build_cmdbuf_x23_aa_0 bl dp01_tbl1_exec_completed pop {r0} bx r0 thumb_func_end sub_805C834 thumb_func_start sub_805C848 sub_805C848: ; 805C848 push {lr} movs r0, 0x1 movs r1, 0 bl dp01_build_cmdbuf_x24_aa_0 bl dp01_tbl1_exec_completed pop {r0} bx r0 thumb_func_end sub_805C848 thumb_func_start sub_805C85C sub_805C85C: ; 805C85C push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x80 negs r0, r0 ands r0, r1 strb r0, [r2] bl dp01_tbl1_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C85C thumb_func_start sub_805C878 sub_805C878: ; 805C878 push {lr} ldr r3, =0x02022d0c ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] movs r1, 0x7F ands r1, r0 ldrb r2, [r3] movs r0, 0x80 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] bl dp01_tbl1_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C878 thumb_func_start sub_805C8B0 sub_805C8B0: ; 805C8B0 push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] bl dp01_tbl1_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C8B0 thumb_func_start sub_805C8C8 sub_805C8C8: ; 805C8C8 push {lr} ldr r3, =0x02022d0c ldr r1, [r3] lsls r1, 24 lsrs r1, 31 movs r0, 0x1 eors r1, r0 lsls r1, 7 ldrb r2, [r3] movs r0, 0x7F ands r0, r2 orrs r0, r1 strb r0, [r3] bl dp01_tbl1_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C8C8 thumb_func_start dp01t_29_1_blink dp01t_29_1_blink: ; 805C8F0 push {r4,lr} ldr r3, =0x02020630 ldr r2, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @0805C924 bl dp01_tbl1_exec_completed b @0805C94E .align 2, 0 .pool @0805C924: ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0 strh r1, [r0, 0x30] ldrb r0, [r4] bl sub_80769F4 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_blink_t1 str r1, [r0] @0805C94E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_29_1_blink thumb_func_start sub_805C960 sub_805C960: ; 805C960 push {lr} bl dp01_tbl1_exec_completed pop {r0} bx r0 thumb_func_end sub_805C960 thumb_func_start sub_805C96C sub_805C96C: ; 805C96C push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 movs r3, 0x3F cmp r0, 0 bne @0805C980 movs r3, 0xC0 @0805C980: ldr r2, =0x02023064 ldrb r1, [r4] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 lsls r1, r3, 24 asrs r1, 24 bl audio_play_and_stuff bl dp01_tbl1_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805C96C thumb_func_start sub_805C9B0 sub_805C9B0: ; 805C9B0 push {r4,r5,lr} ldr r4, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r3, r0, 9 adds r0, r4, 0x3 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @0805C9EC bl sub_805EA60 ldrb r1, [r5] lsls r1, 9 adds r0, r4, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, r4, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl song_play_for_text b @0805CA00 .align 2, 0 .pool @0805C9EC: adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl fanfare_play @0805CA00: bl dp01_tbl1_exec_completed pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_805C9B0 thumb_func_start sub_805CA0C sub_805CA0C: ; 805CA0C push {lr} ldr r1, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 movs r1, 0x19 negs r1, r1 movs r2, 0x5 bl sub_80A32E4 bl dp01_tbl1_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805CA0C thumb_func_start dp01t_2E_1_battle_intro dp01t_2E_1_battle_intro: ; 805CA4C push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] bl battle_intro_launch ldr r2, =0x020243fc ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] bl dp01_tbl1_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_2E_1_battle_intro thumb_func_start dp01t_2F_1_pokemon_enter dp01t_2F_1_pokemon_enter: ; 805CA80 push {r4-r7,lr} ldr r6, =0x020241e4 ldr r7, =0x02024064 ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 bl oamt_add_pos2_onto_pos1 ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x32 strh r1, [r0, 0x2E] ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ffd8 strh r1, [r0, 0x32] ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r2, [r7] adds r0, r2, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x38] ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =sub_805CC00 bl oamt_set_x3A_32 ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x1 bl obj_anim_image_start ldr r0, =0x0000d6f8 bl gpu_pal_alloc_new adds r4, r0, 0 lsls r4, 24 ldr r1, =gTrainerBackPicPaletteTable ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 3 adds r0, r1 ldr r0, [r0] lsrs r4, 20 movs r2, 0x80 lsls r2, 1 adds r1, r4, r2 movs r2, 0x20 bl decompress_palette ldrb r0, [r7] adds r0, r6 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r4 strb r0, [r1, 0x5] ldr r0, =task05_08033660 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r4, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r4 ldrb r0, [r7] strh r0, [r1, 0x8] ldr r3, =0x020244d0 ldr r0, [r3] ldrb r2, [r7] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0805CBA2 ldr r0, =0x020244b4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r4 ldr r1, =sub_8073C30 str r1, [r0] @0805CBA2: ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r0, [r2, 0x9] movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_21 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_2F_1_pokemon_enter thumb_func_start sub_805CC00 sub_805CC00: ; 805CC00 push {r4,r5,lr} adds r5, r0, 0 ldrh r4, [r5, 0x38] lsls r4, 24 lsrs r4, 24 bl obj_free_rotscale_entry ldrb r0, [r5, 0x5] lsrs r0, 4 bl 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, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 adds r1, r4, 0 bl sub_805DD7C ldr r0, =0x020241e4 adds r4, r0 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 bl obj_anim_image_start pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805CC00 thumb_func_start task05_08033660 task05_08033660: ; 805CC68 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r1, =0x03005e00 lsls r0, 2 add r0, r8 lsls r0, 3 adds r1, r0, r1 ldrh r2, [r1, 0xA] movs r3, 0xA ldrsh r0, [r1, r3] cmp r0, 0x1E bgt @0805CC94 adds r0, r2, 0x1 strh r0, [r1, 0xA] b @0805CD50 .align 2, 0 .pool @0805CC94: ldr r7, =0x02024064 ldrb r0, [r7] mov r9, r0 ldrh r0, [r1, 0x8] strb r0, [r7] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805CCB4 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0805CCE4 @0805CCB4: ldr r0, =0x02023064 ldrb r1, [r7] lsls r2, r1, 9 adds r0, 0x1 adds r2, r0 ldr r0, =0x0202406e lsls r1, 1 adds r1, r0 ldrh r0, [r1] strb r0, [r2] ldrb r0, [r7] movs r1, 0 bl sub_805B258 b @0805CD38 .align 2, 0 .pool @0805CCE4: ldr r4, =0x02023064 ldrb r0, [r7] lsls r1, r0, 9 adds r4, 0x1 adds r1, r4 ldr r5, =0x0202406e lsls r0, 1 adds r0, r5 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r7] movs r1, 0 bl sub_805B258 ldrb r0, [r7] movs r6, 0x2 eors r0, r6 strb r0, [r7] ldrb r0, [r7] lsls r1, r0, 9 adds r1, r4 lsls r0, 1 adds r0, r5 ldrh r0, [r0] strb r0, [r1] ldrb r1, [r7] lsls r0, r1, 1 adds r0, r5 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805DD7C ldrb r0, [r7] movs r1, 0 bl sub_805B258 ldrb r0, [r7] eors r0, r6 strb r0, [r7] @0805CD38: ldr r1, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_8058B40 str r1, [r0] mov r3, r9 strb r3, [r2] mov r0, r8 bl remove_task @0805CD50: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task05_08033660 thumb_func_start sub_805CD74 sub_805CD74: ; 805CD74 push {r4-r6,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @0805CDA4 adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0805CDA4 bl dp01_tbl1_exec_completed b @0805CE18 .align 2, 0 .pool @0805CDA4: ldr r6, =0x020244d0 ldr r0, [r6] ldr r5, =0x02024064 ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] ldrb r0, [r5] lsls r3, r0, 9 ldr r4, =0x02023068 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] subs r4, 0x2 adds r3, r4 ldrb r3, [r3] bl sub_80735DC ldr r2, =0x020244b4 ldrb r1, [r5] adds r1, r2 movs r3, 0 strb r0, [r1] ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x5] ldrb r2, [r5] lsls r0, r2, 9 adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @0805CE0C ldr r0, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 movs r1, 0x5D strb r1, [r0, 0x5] @0805CE0C: ldr r0, =0x03005d60 ldrb r1, [r5] lsls r1, 2 adds r1, r0 ldr r0, =sub_805CE38 str r0, [r1] @0805CE18: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805CD74 thumb_func_start sub_805CE38 sub_805CE38: ; 805CE38 push {r4,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x5] adds r2, r1, 0x1 strb r2, [r0, 0x5] lsls r1, 24 lsrs r1, 24 cmp r1, 0x5C bls @0805CE70 ldr r0, [r4] ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x5] bl dp01_tbl1_exec_completed @0805CE70: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805CE38 thumb_func_start sub_805CE80 sub_805CE80: ; 805CE80 push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0805CEB2 ldr r2, =0x03005e00 ldr r0, =0x020244b4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, =sub_8073C30 str r1, [r0] @0805CEB2: bl dp01_tbl1_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805CE80 thumb_func_start sub_805CED0 sub_805CED0: ; 805CED0 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] movs r1, 0x1 bl dp11b_obj_free ldrb r0, [r4] movs r1, 0 bl dp11b_obj_free bl dp01_tbl1_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805CED0 thumb_func_start dp01t_33_1_enemy_move dp01t_33_1_enemy_move: ; 805CEF4 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @0805CF3A ldr r3, =0x02020630 ldr r0, =0x020241e4 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 ldr r0, =0x02023064 lsls r1, 9 adds r0, 0x1 adds r1, r0 adds r2, 0x3E movs r0, 0x1 ldrb r1, [r1] ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] ldrb r0, [r4] bl sub_805E408 @0805CF3A: bl dp01_tbl1_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_33_1_enemy_move thumb_func_start sub_805CF54 sub_805CF54: ; 805CF54 push {r4-r6,lr} sub sp, 0x4 ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @0805CFB6 ldr r4, =0x02023064 ldrb r2, [r5] lsls r1, r2, 9 adds r0, r4, 0x1 adds r0, r1, r0 ldrb r6, [r0] adds r0, r4, 0x2 adds r0, r1, r0 ldrb r3, [r0] adds r4, 0x3 adds r1, r4 ldrb r0, [r1] lsls r0, 8 orrs r3, r0 str r3, [sp] adds r0, r2, 0 adds r1, r2, 0 adds r3, r6, 0 bl move_anim_start_t3 lsls r0, 24 cmp r0, 0 beq @0805CFA4 bl dp01_tbl1_exec_completed b @0805CFB0 .align 2, 0 .pool @0805CFA4: ldr r0, =0x03005d60 ldrb r1, [r5] lsls r1, 2 adds r1, r0 ldr r0, =bx_8030B2C str r0, [r1] @0805CFB0: adds r0, r6, 0 bl sub_817E32C @0805CFB6: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805CF54 thumb_func_start dp01t_35_1_link_standby_message_and_free_vram dp01t_35_1_link_standby_message_and_free_vram: ; 805CFC8 push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] lsls r0, 9 ldr r4, =0x02023066 adds r0, r4 bl sub_81851A8 ldrb r0, [r5] lsls r0, 9 subs r4, 0x1 adds r0, r4 ldrb r0, [r0] cmp r0, 0x1 beq @0805D002 cmp r0, 0x1 bgt @0805CFF8 cmp r0, 0 beq @0805CFFE b @0805D020 .align 2, 0 .pool @0805CFF8: cmp r0, 0x2 beq @0805D01C b @0805D020 @0805CFFE: bl b_link_standby_message @0805D002: ldr r4, =0x02024064 ldrb r0, [r4] movs r1, 0x1 bl dp11b_obj_free ldrb r0, [r4] movs r1, 0 bl dp11b_obj_free b @0805D020 .align 2, 0 .pool @0805D01C: bl b_link_standby_message @0805D020: bl dp01_tbl1_exec_completed pop {r4,r5} pop {r0} bx r0 thumb_func_end dp01t_35_1_link_standby_message_and_free_vram thumb_func_start sub_805D02C sub_805D02C: ; 805D02C push {r4,lr} ldr r1, =0x02023064 ldr r4, =0x02024064 ldrb r3, [r4] lsls r0, r3, 9 adds r1, 0x1 adds r0, r1 ldrb r2, [r0] cmp r2, 0x1 beq @0805D074 cmp r2, 0x1 bgt @0805D054 cmp r2, 0 beq @0805D05A b @0805D084 .align 2, 0 .pool @0805D054: cmp r2, 0x2 beq @0805D07C b @0805D084 @0805D05A: ldr r0, =0x020244ac adds r0, r3, r0 strb r2, [r0] ldr r1, =0x020244b0 ldrb r0, [r4] adds r0, r1 strb r2, [r0] b @0805D084 .align 2, 0 .pool @0805D074: ldr r0, =0x020244ac b @0805D07E .align 2, 0 .pool @0805D07C: ldr r0, =0x020244b0 @0805D07E: adds r0, r3, r0 movs r1, 0 strb r1, [r0] @0805D084: bl dp01_tbl1_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805D02C thumb_func_start sub_805D094 sub_805D094: ; 805D094 push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] lsls r0, 9 ldr r4, =0x02023068 adds r0, r4 bl sub_81851A8 ldr r2, =0x0202433a ldrb r0, [r5] lsls r0, 9 subs r1, r4, 0x3 adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r0, =0x03005d90 ldr r3, [r0] ldrb r0, [r5] lsls r0, 9 subs r4, 0x2 adds r0, r4 ldrb r0, [r0] ldr r1, =0x00000ca9 adds r3, r1 movs r1, 0x1 ands r1, r0 lsls r1, 3 ldrb r2, [r3] movs r0, 0x9 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 bl sub_80A2390 bl dp01_tbl1_exec_completed ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_80587B0 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805D094 thumb_func_start nullsub_22 nullsub_22: ; 805D114 bx lr thumb_func_end nullsub_22 thumb_func_start dp11_init dp11_init: ; 805D118 push {r4,lr} ldr r4, =0x020244d0 movs r0, 0x10 bl 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 .pool thumb_func_end dp11_init thumb_func_start dp11_free dp11_free: ; 805D158 push {r4,r5,lr} ldr r5, =0x020244d0 ldr r0, [r5] cmp r0, 0 beq @0805D192 ldr r0, [r0, 0xC] bl free ldr r0, [r5] movs r4, 0 str r4, [r0, 0xC] ldr r0, [r0, 0x8] bl free ldr r0, [r5] str r4, [r0, 0x8] ldr r0, [r0, 0x4] bl free ldr r0, [r5] str r4, [r0, 0x4] ldr r0, [r0] bl free ldr r0, [r5] str r4, [r0] bl free str r4, [r5] @0805D192: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp11_free thumb_func_start sub_805D19C sub_805D19C: ; 805D19C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r0, 0x1 negs r0, r0 mov r9, r0 ldr r4, =0x02024064 ldrb r0, [r4] lsls r2, r0, 9 ldr r1, =0x02023068 adds r2, r1 mov r10, r2 movs r1, 0 movs r2, 0xFF bl sub_803FECC lsls r0, 24 lsrs r0, 24 mov r8, r0 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r7, r0, 16 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x92 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 negs r0, r1 orrs r0, r1 asrs r4, r0, 31 movs r0, 0x2 ands r4, r0 adds r6, r4, 0 adds r5, r4, 0x2 b @0805D20E .align 2, 0 .pool @0805D20C: adds r4, 0x1 @0805D20E: cmp r4, r5 bge @0805D234 ldr r0, =0x02024064 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 ldr r1, =0x020240cc adds r0, r1 ldr r0, [r0] bl GetNatureFromPersonality lsls r0, 24 lsrs r0, 22 adds r0, r4, r0 ldr r2, =gUnknown_0831C494 adds r0, r2 ldrb r0, [r0] cmp r0, r7 ble @0805D20C @0805D234: subs r7, r4, r6 cmp r4, r5 bne @0805D23C movs r7, 0x2 @0805D23C: movs r6, 0 movs r4, 0 mov r1, r10 ldrh r0, [r1] cmp r0, 0 beq @0805D27C mov r5, r10 @0805D24A: ldrh r0, [r5] bl sub_805D4A8 lsls r0, 24 lsrs r0, 24 cmp r7, r0 bne @0805D26E mov r0, r10 adds r0, 0x8 adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @0805D26E ldr r0, =gUnknown_0832A328 lsls r1, r4, 2 adds r1, r0 ldr r0, [r1] orrs r6, r0 @0805D26E: adds r5, 0x2 adds r4, 0x1 cmp r4, 0x3 bgt @0805D27C ldrh r0, [r5] cmp r0, 0 bne @0805D24A @0805D27C: cmp r6, 0 beq @0805D2AC ldr r3, =0x0202449c ldr r1, [r3] adds r1, 0x92 ldrb r2, [r1] movs r0, 0xF ands r0, r2 strb r0, [r1] ldr r1, [r3] adds r1, 0x92 lsls r0, r6, 4 ldrb r2, [r1] orrs r0, r2 strb r0, [r1] lsls r0, r6, 24 lsrs r0, 24 bl sub_8130950 bl sub_8130BA4 lsls r0, 24 lsrs r0, 24 mov r9, r0 @0805D2AC: movs r0, 0x1 negs r0, r0 cmp r9, r0 beq @0805D2B6 b @0805D40C @0805D2B6: mov r2, r8 cmp r2, 0xF bne @0805D2BE b @0805D3EA @0805D2BE: movs r5, 0 movs r6, 0 ldr r7, =gUnknown_0832A328 mov r4, r10 @0805D2C6: ldrh r0, [r4] bl sub_805D4A8 lsls r0, 24 cmp r0, 0 bne @0805D2DE ldr r0, [r7] mov r1, r8 ands r0, r1 cmp r0, 0 bne @0805D2DE adds r5, 0x1 @0805D2DE: ldrh r0, [r4] bl sub_805D4A8 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0805D2F8 ldr r0, [r7] mov r2, r8 ands r0, r2 cmp r0, 0 bne @0805D2F8 adds r5, 0x10 @0805D2F8: ldrh r0, [r4] bl sub_805D4A8 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @0805D316 ldr r0, [r7] mov r1, r8 ands r0, r1 cmp r0, 0 bne @0805D316 movs r2, 0x80 lsls r2, 1 adds r5, r2 @0805D316: adds r7, 0x4 adds r4, 0x2 ldr r0, =gUnknown_0832A328 adds r0, 0xC cmp r7, r0 ble @0805D2C6 movs r1, 0xF ands r1, r5 cmp r1, 0x1 ble @0805D32C adds r6, 0x1 @0805D32C: movs r0, 0xF0 ands r0, r5 cmp r0, 0x1F ble @0805D336 adds r6, 0x1 @0805D336: ldr r2, =0x000001ff cmp r0, r2 ble @0805D33E adds r6, 0x1 @0805D33E: cmp r6, 0x1 bgt @0805D346 cmp r6, 0 bne @0805D388 @0805D346: ldr r5, =gUnknown_0832A328 @0805D348: bl GenerateRandomNumber lsls r0, 16 movs r1, 0xC0 lsls r1, 10 ands r1, r0 lsrs r4, r1, 16 lsls r0, r4, 2 adds r0, r5 ldr r0, [r0] mov r1, r8 ands r0, r1 cmp r0, 0 bne @0805D366 mov r9, r4 @0805D366: movs r0, 0x1 negs r0, r0 cmp r9, r0 beq @0805D348 b @0805D3D4 .align 2, 0 .pool @0805D388: cmp r1, 0x1 ble @0805D38E movs r6, 0 @0805D38E: cmp r0, 0x1F ble @0805D394 movs r6, 0x1 @0805D394: cmp r0, r2 ble @0805D39A movs r6, 0x2 @0805D39A: bl GenerateRandomNumber lsls r0, 16 movs r1, 0xC0 lsls r1, 10 ands r1, r0 lsrs r4, r1, 16 ldr r1, =gUnknown_0832A328 lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] mov r2, r8 ands r0, r2 cmp r0, 0 bne @0805D3CC lsls r0, r4, 1 add r0, r10 ldrh r0, [r0] bl sub_805D4A8 lsls r0, 24 lsrs r0, 24 cmp r6, r0 bne @0805D3CC mov r9, r4 @0805D3CC: movs r0, 0x1 negs r0, r0 cmp r9, r0 beq @0805D39A @0805D3D4: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bls @0805D40C @0805D3EA: ldr r2, =0x0202433c ldr r0, =0x02024064 ldrb r1, [r0] lsls r1, 4 adds r1, r2 ldrb r0, [r1, 0x2] movs r2, 0x10 orrs r0, r2 strb r0, [r1, 0x2] movs r0, 0 b @0805D496 .align 2, 0 .pool @0805D40C: mov r1, r9 lsls r0, r1, 1 mov r2, r10 adds r1, r2, r0 ldrh r0, [r1] cmp r0, 0xAE bne @0805D434 ldrb r0, [r2, 0x12] movs r5, 0 cmp r0, 0x7 beq @0805D442 ldrb r1, [r2, 0x13] movs r0, 0x7 eors r1, r0 negs r0, r1 orrs r0, r1 asrs r5, r0, 31 movs r0, 0x10 ands r5, r0 b @0805D442 @0805D434: ldr r2, =gBattleMoves ldrh r1, [r1] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r5, [r0, 0x6] @0805D442: movs r0, 0x10 ands r0, r5 cmp r0, 0 beq @0805D45C ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 8 b @0805D48A .align 2, 0 .pool @0805D45C: cmp r5, 0 bne @0805D470 bl sub_805D5F4 lsls r0, 16 lsrs r0, 16 mov r2, r9 orrs r2, r0 mov r9, r2 b @0805D490 @0805D470: ldr r0, =0x02024064 ldrb r0, [r0] bl battle_get_per_side_status adds r1, r0, 0 movs r2, 0x1 movs r0, 0x1 ands r0, r1 eors r0, r2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 16 @0805D48A: mov r1, r9 orrs r1, r0 mov r9, r1 @0805D490: mov r2, r9 lsls r0, r2, 16 lsrs r0, 16 @0805D496: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_805D19C thumb_func_start sub_805D4A8 sub_805D4A8: ; 805D4A8 push {lr} lsls r0, 16 lsrs r2, r0, 16 ldr r1, =gBattleMoves lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x6] adds r3, r1, 0 cmp r0, 0x40 bls @0805D4C2 b @0805D5EE @0805D4C2: lsls r0, 2 ldr r1, =@0805D4D4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0805D4D4: .4byte @0805D5D8 .4byte @0805D5E6 .4byte @0805D5D8 .4byte @0805D5EE .4byte @0805D5D8 .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5D8 .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EA .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5D8 .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5EE .4byte @0805D5E6 @0805D5D8: lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x1] cmp r0, 0 bne @0805D5EE @0805D5E6: movs r0, 0x2 b @0805D5F0 @0805D5EA: movs r0, 0x1 b @0805D5F0 @0805D5EE: movs r0, 0 @0805D5F0: pop {r1} bx r1 thumb_func_end sub_805D4A8 thumb_func_start sub_805D5F4 sub_805D5F4: ; 805D5F4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0805D6FA ldr r0, =0x02024064 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0805D630 movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r0, 0x3 b @0805D63E .align 2, 0 .pool @0805D630: movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r0, 0x2 @0805D63E: bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 ldr r1, =0x02024084 movs r2, 0x58 mov r0, r8 muls r0, r2 adds r5, r0, r1 adds r0, r7, 0 muls r0, r2 adds r6, r0, r1 ldrh r0, [r5, 0x28] ldrh r3, [r6, 0x28] cmp r0, r3 bne @0805D680 bl GenerateRandomNumber adds r3, r0, 0 ldr r0, =0x02024064 ldrb r1, [r0] movs r2, 0x1 movs r0, 0x1 ands r0, r1 eors r0, r2 movs r1, 0x2 ands r1, r3 adds r0, r1 b @0805D702 .align 2, 0 .pool @0805D680: ldr r4, =gUnknown_0831C604 ldr r0, =0x02024064 mov r9, r0 ldrb r0, [r0] muls r0, r2 adds r1, 0x48 adds r0, r1 ldr r0, [r0] bl GetNatureFromPersonality lsls r0, 24 lsrs r0, 24 adds r0, r4 ldrb r4, [r0] cmp r4, 0x1 beq @0805D6CC cmp r4, 0x1 bgt @0805D6B4 cmp r4, 0 beq @0805D6BA b @0805D6FA .align 2, 0 .pool @0805D6B4: cmp r4, 0x2 beq @0805D6DE b @0805D6FA @0805D6BA: ldrh r0, [r5, 0x28] ldrh r6, [r6, 0x28] cmp r0, r6 bls @0805D6C8 mov r1, r8 lsls r0, r1, 8 b @0805D704 @0805D6C8: lsls r0, r7, 8 b @0805D704 @0805D6CC: ldrh r0, [r5, 0x28] ldrh r6, [r6, 0x28] cmp r0, r6 bcs @0805D6DA mov r3, r8 lsls r0, r3, 8 b @0805D704 @0805D6DA: lsls r0, r7, 8 b @0805D704 @0805D6DE: bl GenerateRandomNumber adds r3, r0, 0 mov r0, r9 ldrb r1, [r0] movs r2, 0x1 movs r0, 0x1 ands r0, r1 eors r0, r2 ands r4, r3 adds r0, r4 lsls r0, 24 lsrs r0, 16 b @0805D704 @0805D6FA: ldr r0, =0x02024064 ldrb r1, [r0] movs r0, 0x1 eors r0, r1 @0805D702: lsls r0, 8 @0805D704: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_805D5F4 thumb_func_start sub_805D714 sub_805D714: ; 805D714 push {r4,lr} adds r4, r0, 0 ldrh r1, [r4, 0x30] lsls r1, 24 lsrs r1, 24 ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x3F ldrb r3, [r0] lsls r0, r3, 26 cmp r0, 0 bge @0805D766 adds r0, r1, 0 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @0805D766 adds r2, r1, 0 adds r2, 0x2C ldrb r1, [r2] lsls r0, r1, 25 cmp r0, 0 bge @0805D75C movs r0, 0x41 negs r0, r0 ands r0, r1 strb r0, [r2] b @0805D766 .align 2, 0 .pool @0805D75C: lsls r0, r3, 27 cmp r0, 0 bge @0805D766 ldr r0, =nullsub_12 str r0, [r4, 0x1C] @0805D766: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805D714 thumb_func_start sub_805D770 sub_805D770: ; 805D770 push {r4,lr} adds r4, r0, 0 lsls r1, 24 adds r3, r4, 0 adds r3, 0x2C ldrb r0, [r3] movs r2, 0x40 orrs r0, r2 strb r0, [r3] ldr r0, =nullsub_12 str r0, [r4, 0x1C] cmp r1, 0 bne @0805D798 adds r0, r4, 0 movs r1, 0x1 bl sub_8008258 b @0805D7A0 .align 2, 0 .pool @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, =0x020243fc ldrh r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0805D7E4 ldrh r0, [r2, 0x2E] ldrh r1, [r2, 0x24] adds r0, r1 strh r0, [r2, 0x24] lsls r0, 16 cmp r0, 0 bne @0805D7E4 movs r1, 0x26 ldrsh r0, [r2, r1] cmp r0, 0 beq @0805D7E0 ldr r0, =sub_805D7EC b @0805D7E2 .align 2, 0 .pool @0805D7E0: ldr r0, =nullsub_12 @0805D7E2: str r0, [r2, 0x1C] @0805D7E4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805D7AC thumb_func_start sub_805D7EC sub_805D7EC: ; 805D7EC push {lr} adds r1, r0, 0 ldrh r0, [r1, 0x26] subs r0, 0x2 strh r0, [r1, 0x26] lsls r0, 16 cmp r0, 0 bne @0805D800 ldr r0, =nullsub_12 str r0, [r1, 0x1C] @0805D800: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805D7EC thumb_func_start move_anim_start_t2_for_situation move_anim_start_t2_for_situation: ; 805D808 push {r4-r6,lr} adds r4, r1, 0 lsls r0, 24 ldr r6, =0x020244d0 ldr r1, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r3, [r1, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r3 ldrb r2, [r1] movs r3, 0x10 orrs r2, r3 strb r2, [r1] cmp r0, 0 bne @0805D888 cmp r4, 0x20 bne @0805D844 ldrb r0, [r5] movs r1, 0x6 bl move_anim_start_t2 b @0805D902 .align 2, 0 .pool @0805D844: cmp r4, 0x8 beq @0805D850 movs r0, 0x80 ands r0, r4 cmp r0, 0 beq @0805D85A @0805D850: ldrb r0, [r5] movs r1, 0 bl move_anim_start_t2 b @0805D902 @0805D85A: cmp r4, 0x10 bne @0805D868 ldrb r0, [r5] movs r1, 0x2 bl move_anim_start_t2 b @0805D902 @0805D868: movs r0, 0x7 ands r0, r4 cmp r0, 0 beq @0805D87A ldrb r0, [r5] movs r1, 0x4 bl move_anim_start_t2 b @0805D902 @0805D87A: cmp r4, 0x40 bne @0805D8EA ldrb r0, [r5] movs r1, 0x5 bl move_anim_start_t2 b @0805D902 @0805D888: movs r0, 0xF0 lsls r0, 12 ands r0, r4 cmp r0, 0 beq @0805D89C ldrb r0, [r5] movs r1, 0x3 bl move_anim_start_t2 b @0805D902 @0805D89C: movs r0, 0x7 ands r0, r4 cmp r0, 0 beq @0805D8AE ldrb r0, [r5] movs r1, 0x1 bl move_anim_start_t2 b @0805D902 @0805D8AE: movs r0, 0x80 lsls r0, 21 ands r0, r4 cmp r0, 0 beq @0805D8C2 ldrb r0, [r5] movs r1, 0x7 bl move_anim_start_t2 b @0805D902 @0805D8C2: movs r0, 0x80 lsls r0, 20 ands r0, r4 cmp r0, 0 beq @0805D8D6 ldrb r0, [r5] movs r1, 0x8 bl move_anim_start_t2 b @0805D902 @0805D8D6: movs r0, 0xE0 lsls r0, 8 ands r0, r4 cmp r0, 0 beq @0805D8EA ldrb r0, [r5] movs r1, 0x9 bl move_anim_start_t2 b @0805D902 @0805D8EA: ldr r0, [r6] ldrb r2, [r5] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] @0805D902: pop {r4-r6} pop {r0} bx r0 thumb_func_end move_anim_start_t2_for_situation thumb_func_start move_anim_start_t3 move_anim_start_t3: ; 805D908 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 ldr r4, [sp, 0x24] lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r1, 24 mov r10, r1 lsls r2, 24 lsrs r2, 24 str r2, [sp] lsls r3, 24 lsrs r5, r3, 24 lsls r4, 16 lsrs r7, r4, 16 cmp r5, 0 bne @0805D950 movs r0, 0x80 ands r0, r7 cmp r0, 0 beq @0805D950 ldr r0, =0x020244e4 adds r0, r6, r0 movs r2, 0x7F adds r1, r7, 0 ands r1, r2 strb r1, [r0] movs r0, 0x1 b @0805DA1E .align 2, 0 .pool @0805D950: ldr r0, =0x020244d0 mov r9, r0 ldr r0, [r0] ldr r0, [r0] lsls r4, r6, 2 adds r0, r4, r0 ldrb r1, [r0] movs r2, 0x4 mov r8, r2 mov r0, r8 ands r0, r1 cmp r0, 0 beq @0805D9CC adds r0, r5, 0 bl sub_805DAA0 lsls r0, 24 cmp r0, 0 bne @0805D980 movs r0, 0x1 b @0805DA1E .align 2, 0 .pool @0805D980: mov r1, r9 ldr r0, [r1] ldr r0, [r0] adds r0, r4, r0 ldrb r1, [r0] mov r0, r8 ands r0, r1 cmp r0, 0 beq @0805D9CC cmp r5, 0x2 bne @0805D9CC ldr r1, =0x02020630 ldr r0, =0x020241e4 adds r0, r6, r0 ldrb r2, [r0] lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @0805D9CC adds r0, r6, 0 movs r1, 0x1 bl refresh_graphics_maybe adds r0, r6, 0 bl sub_805E974 movs r0, 0x1 b @0805DA1E .align 2, 0 .pool @0805D9CC: ldr r0, =0x02038436 mov r2, r10 strb r2, [r0] ldr r0, =0x02038437 mov r1, sp ldrb r1, [r1] strb r1, [r0] ldr r4, =0x020244d0 ldr r0, [r4] ldr r0, [r0, 0x8] strh r7, [r0] ldr r0, =gUnknown_082C9320 adds r1, r5, 0 movs r2, 0 bl move_something ldr r0, =task0A_0803415C movs r1, 0xA bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r6, [r1, 0x8] ldr r0, [r4] movs r2, 0x8 ldrsh r1, [r1, r2] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x20 orrs r1, r2 strb r1, [r0] movs r0, 0 @0805DA1E: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end move_anim_start_t3 thumb_func_start task0A_0803415C task0A_0803415C: ; 805DA48 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd ldrb r0, [r0] cmp r0, 0 bne @0805DA8A ldr r0, =0x020244d0 ldr r2, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0x8 ldrsh r0, [r0, r1] ldr r2, [r2, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r2, [r1] movs r0, 0x21 negs r0, r0 ands r0, r2 strb r0, [r1] adds r0, r4, 0 bl remove_task @0805DA8A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task0A_0803415C thumb_func_start sub_805DAA0 sub_805DAA0: ; 805DAA0 push {lr} lsls r0, 24 lsrs r0, 24 cmp r0, 0xD bgt @0805DAB4 cmp r0, 0xA bge @0805DAB8 cmp r0, 0x2 beq @0805DAB8 b @0805DABC @0805DAB4: cmp r0, 0x11 bne @0805DABC @0805DAB8: movs r0, 0x1 b @0805DABE @0805DABC: movs r0, 0 @0805DABE: pop {r1} bx r1 thumb_func_end sub_805DAA0 thumb_func_start move_anim_start_t4 move_anim_start_t4: ; 805DAC4 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 lsls r3, 24 lsrs r3, 24 ldr r0, =0x02038436 strb r1, [r0] ldr r0, =0x02038437 strb r2, [r0] ldr r0, =gUnknown_082C937C adds r1, r3, 0 movs r2, 0 bl move_something ldr r0, =task0A_08034248 movs r1, 0xA bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] ldr r0, =0x020244d0 ldr r0, [r0] movs r2, 0x8 ldrsh r1, [r1, r2] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end move_anim_start_t4 thumb_func_start task0A_08034248 task0A_08034248: ; 805DB34 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd ldrb r0, [r0] cmp r0, 0 bne @0805DB76 ldr r0, =0x020244d0 ldr r2, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0x8 ldrsh r0, [r0, r1] ldr r2, [r2, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r2, [r1] movs r0, 0x41 negs r0, r0 ands r0, r2 strb r0, [r1] adds r0, r4, 0 bl remove_task @0805DB76: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task0A_08034248 thumb_func_start sub_805DB8C sub_805DB8C: ; 805DB8C movs r0, 0 bx lr thumb_func_end sub_805DB8C thumb_func_start mplay_80342A4 mplay_80342A4: ; 805DB90 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 movs r5, 0 bl mplay_has_finished_maybe lsls r0, 24 cmp r0, 0 beq @0805DBD8 ldr r2, =0x020244d0 ldr r0, [r2] ldr r1, [r0, 0x4] lsls r0, r4, 1 adds r0, r4 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x8] adds r1, 0x1 strb r1, [r0, 0x8] ldr r2, [r2] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x8] cmp r0, 0x1D bls @0805DBDC ldr r0, =0x030075f0 bl MPlayStop_rev01 ldr r0, =0x03007630 bl MPlayStop_rev01 @0805DBD8: cmp r5, 0 beq @0805DBF0 @0805DBDC: movs r0, 0x1 b @0805DC02 .align 2, 0 .pool @0805DBF0: ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r4, 1 adds r0, r4 lsls r0, 2 adds r0, r1 strb r5, [r0, 0x8] movs r0, 0 @0805DC02: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end mplay_80342A4 thumb_func_start sub_805DC0C sub_805DC0C: ; 805DC0C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 adds r4, r0, 0 lsls r1, 24 lsrs r1, 24 mov r8, r1 movs r1, 0 bl pokemon_getattr str r0, [sp] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] mov r2, r8 lsls r1, r2, 2 adds r2, r1, r0 ldrh r0, [r2, 0x2] cmp r0, 0 bne @0805DC50 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 ldr r6, [sp] b @0805DC58 .align 2, 0 .pool @0805DC50: ldrh r5, [r2, 0x2] ldr r0, =0x020244bc adds r0, r1, r0 ldr r6, [r0] @0805DC58: adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr mov r10, r0 mov r0, r8 bl battle_get_per_side_status lsls r0, 24 lsls r2, r5, 3 ldr r1, =gMonFrontPicTable adds r2, r1 ldr r1, =0x020244d4 ldr r1, [r1] lsrs r0, 22 adds r1, 0x4 adds r1, r0 ldr r1, [r1] adds r0, r2, 0 adds r2, r5, 0 adds r3, r6, 0 bl sub_8034B50 mov r3, r8 lsls r2, r3, 4 movs r0, 0x80 lsls r0, 1 adds r7, r2, r0 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] lsls r1, r3, 2 adds r0, r1, r0 ldrh r0, [r0, 0x2] str r1, [sp, 0x4] mov r9, r2 cmp r0, 0 bne @0805DCBC adds r0, r4, 0 bl pokemon_get_pal b @0805DCC6 .align 2, 0 .pool @0805DCBC: adds r0, r5, 0 mov r1, r10 ldr r2, [sp] bl species_and_otid_get_pal @0805DCC6: adds r6, r0, 0 ldr r4, =0x0201c000 adds r0, r6, 0 adds r1, r4, 0 bl 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, =0x00000181 cmp r5, r0 bne @0805DD1A movs r7, 0x80 lsls r7, 1 add r7, r9 ldr r5, =0x0202449c ldr r1, [r5] movs r4, 0x80 lsls r4, 1 adds r1, r4 adds r0, r6, 0 bl call_LZZUnCompWram ldr r0, =0x020244e4 add r0, r8 ldrb r1, [r0] lsls r1, 5 adds r1, r4 ldr r0, [r5] adds r0, r1 adds r1, r7, 0 movs r2, 0x20 bl gpu_pal_apply @0805DD1A: ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] ldr r1, [sp, 0x4] adds r0, r1, r0 ldrh r0, [r0, 0x2] cmp r0, 0 beq @0805DD46 ldr r3, =0x00007fff adds r0, r7, 0 movs r1, 0x10 movs r2, 0x6 bl pal_fade_1 lsls r1, r7, 1 ldr r0, =0x02037b14 adds r0, r1, r0 ldr r2, =0x02037714 adds r1, r2 ldr r2, =0x04000008 bl CpuSet @0805DD46: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805DC0C thumb_func_start sub_805DD7C sub_805DD7C: ; 805DD7C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 adds r6, r0, 0 lsls r1, 24 lsrs r1, 24 mov r8, r1 movs r1, 0 bl pokemon_getattr str r0, [sp] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] mov r2, r8 lsls r1, r2, 2 adds r2, r1, r0 ldrh r0, [r2, 0x2] cmp r0, 0 bne @0805DDC0 adds r0, r6, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 ldr r4, [sp] b @0805DDC8 .align 2, 0 .pool @0805DDC0: ldrh r5, [r2, 0x2] ldr r0, =0x020244bc adds r0, r1, r0 ldr r4, [r0] @0805DDC8: adds r0, r6, 0 movs r1, 0x1 bl pokemon_getattr str r0, [sp, 0x4] mov r0, r8 bl battle_get_per_side_status lsls r0, 24 lsrs r7, r0, 24 movs r0, 0x1 mov r1, r8 bl sub_80688F8 lsls r0, 24 lsrs r0, 24 mov r1, r8 lsls r1, 2 mov r10, r1 cmp r0, 0x1 beq @0805DE00 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] add r0, r10 ldrh r0, [r0, 0x2] cmp r0, 0 beq @0805DE2C @0805DE00: lsls r0, r5, 3 ldr r1, =gMonBackPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] lsls r2, r7, 2 adds r1, 0x4 adds r1, r2 ldr r1, [r1] adds r2, r5, 0 adds r3, r4, 0 bl sub_8034B50 b @0805DE46 .align 2, 0 .pool @0805DE2C: lsls r0, r5, 3 ldr r1, =gMonBackPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] lsls r2, r7, 2 adds r1, 0x4 adds r1, r2 ldr r1, [r1] adds r2, r5, 0 adds r3, r4, 0 bl sub_8034628 @0805DE46: mov r2, r8 lsls r1, r2, 4 movs r0, 0x80 lsls r0, 1 adds r7, r1, r0 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] add r0, r10 ldrh r0, [r0, 0x2] mov r9, r1 cmp r0, 0 bne @0805DE74 adds r0, r6, 0 bl pokemon_get_pal b @0805DE7E .align 2, 0 .pool @0805DE74: adds r0, r5, 0 ldr r1, [sp, 0x4] ldr r2, [sp] bl species_and_otid_get_pal @0805DE7E: adds r6, r0, 0 ldr r4, =0x0201c000 adds r0, r6, 0 adds r1, r4, 0 bl 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, =0x00000181 cmp r5, r0 bne @0805DED2 movs r7, 0x80 lsls r7, 1 add r7, r9 ldr r5, =0x0202449c ldr r1, [r5] movs r4, 0x80 lsls r4, 1 adds r1, r4 adds r0, r6, 0 bl call_LZZUnCompWram ldr r0, =0x020244e4 add r0, r8 ldrb r1, [r0] lsls r1, 5 adds r1, r4 ldr r0, [r5] adds r0, r1 adds r1, r7, 0 movs r2, 0x20 bl gpu_pal_apply @0805DED2: ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] add r0, r10 ldrh r0, [r0, 0x2] cmp r0, 0 beq @0805DEFC ldr r3, =0x00007fff adds r0, r7, 0 movs r1, 0x10 movs r2, 0x6 bl pal_fade_1 lsls r1, r7, 1 ldr r0, =0x02037b14 adds r0, r1, r0 ldr r2, =0x02037714 adds r1, r2 ldr r2, =0x04000008 bl CpuSet @0805DEFC: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805DD7C thumb_func_start nullsub_23 nullsub_23: ; 805DF30 bx lr thumb_func_end nullsub_23 thumb_func_start nullsub_24 nullsub_24: ; 805DF34 bx lr thumb_func_end nullsub_24 thumb_func_start sub_805DF38 sub_805DF38: ; 805DF38 push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 lsls r4, 16 lsrs r4, 16 lsls r0, 24 lsrs r0, 24 bl battle_get_per_side_status lsls r0, 24 lsls r4, 3 ldr r2, =gTrainerPicTable adds r2, r4, r2 ldr r1, =0x020244d4 ldr r1, [r1] lsrs r0, 22 adds r1, 0x4 adds r1, r0 ldr r1, [r1] adds r0, r2, 0 movs r2, 0 bl LZ77UnCompAnyRam ldr r0, =gTrainerPaletteTable adds r4, r0 adds r0, r4, 0 bl gpu_pal_obj_decompress_and_apply pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805DF38 thumb_func_start sub_805DF84 sub_805DF84: ; 805DF84 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 lsls r5, 16 lsrs r5, 16 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 lsls r5, 3 ldr r2, =gTrainerBackPicTable adds r2, r5, r2 ldr r1, =0x020244d4 ldr r1, [r1] lsrs r0, 22 adds r1, 0x4 adds r1, r0 ldr r1, [r1] adds r0, r2, 0 movs r2, 0 bl LZ77UnCompAnyRam ldr r0, =gTrainerBackPicPaletteTable adds r5, r0 ldr r0, [r5] lsls r4, 20 movs r1, 0x80 lsls r1, 17 adds r4, r1 lsrs r4, 16 adds r1, r4, 0 movs r2, 0x20 bl decompress_palette pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805DF84 thumb_func_start nullsub_25 nullsub_25: ; 805DFE0 bx lr thumb_func_end nullsub_25 thumb_func_start sub_805DFE4 sub_805DFE4: ; 805DFE4 push {lr} lsls r0, 16 ldr r1, =gTrainerPaletteTable lsrs r0, 13 adds r0, r1 ldrh r0, [r0, 0x4] bl gpu_pal_free_tag pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805DFE4 thumb_func_start sub_805DFFC sub_805DFFC: ; 805DFFC push {r4-r7,lr} ldr r4, =gUnknown_0832C128 adds r0, r4, 0 bl 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, =gUnknown_0832C0D0 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0832C0D8 bl gpu_tile_obj_decompress_and_load movs r5, 0x2 b @0805E056 .align 2, 0 .pool @0805E034: ldr r4, =gUnknown_0832C0E0 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, =gUnknown_0832C0F0 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, =0x02024076 ldr r6, =gUnknown_0832C108 @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 .pool thumb_func_end sub_805DFFC thumb_func_start sub_805E08C sub_805E08C: ; 805E08C push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 movs r6, 0 cmp r4, 0 bne @0805E09C b @0805E1AE @0805E09C: cmp r4, 0x1 bne @0805E0B8 ldr r4, =gUnknown_0832C128 adds r0, r4, 0 bl 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 .pool @0805E0B8: bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @0805E120 cmp r4, 0x2 bne @0805E0F0 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @0805E0E4 ldr r0, =gUnknown_0832C100 bl gpu_tile_obj_decompress_and_load b @0805E1AE .align 2, 0 .pool @0805E0E4: ldr r0, =gUnknown_0832C0D0 bl gpu_tile_obj_decompress_and_load b @0805E1AE .align 2, 0 .pool @0805E0F0: cmp r4, 0x3 bne @0805E100 ldr r0, =gUnknown_0832C0D8 bl gpu_tile_obj_decompress_and_load b @0805E1AE .align 2, 0 .pool @0805E100: cmp r4, 0x4 bne @0805E110 ldr r0, =0x02024076 ldrb r0, [r0] b @0805E198 .align 2, 0 .pool @0805E110: cmp r4, 0x5 bne @0805E1AC ldr r0, =0x02024076 ldrb r0, [r0, 0x1] b @0805E198 .align 2, 0 .pool @0805E120: cmp r4, 0x2 bne @0805E130 ldr r0, =gUnknown_0832C0E0 bl gpu_tile_obj_decompress_and_load b @0805E1AE .align 2, 0 .pool @0805E130: cmp r4, 0x3 bne @0805E140 ldr r0, =gUnknown_0832C0E8 bl gpu_tile_obj_decompress_and_load b @0805E1AE .align 2, 0 .pool @0805E140: cmp r4, 0x4 bne @0805E150 ldr r0, =gUnknown_0832C0F0 bl gpu_tile_obj_decompress_and_load b @0805E1AE .align 2, 0 .pool @0805E150: cmp r4, 0x5 bne @0805E160 ldr r0, =gUnknown_0832C0F8 bl gpu_tile_obj_decompress_and_load b @0805E1AE .align 2, 0 .pool @0805E160: cmp r4, 0x6 bne @0805E170 ldr r0, =0x02024076 ldrb r0, [r0] b @0805E198 .align 2, 0 .pool @0805E170: cmp r4, 0x7 bne @0805E180 ldr r0, =0x02024076 ldrb r0, [r0, 0x1] b @0805E198 .align 2, 0 .pool @0805E180: cmp r4, 0x8 bne @0805E190 ldr r0, =0x02024076 ldrb r0, [r0, 0x2] b @0805E198 .align 2, 0 .pool @0805E190: cmp r5, 0x9 bne @0805E1AC ldr r0, =0x02024076 ldrb r0, [r0, 0x3] @0805E198: lsls r0, 3 ldr r1, =gUnknown_0832C108 adds r0, r1 bl gpu_tile_obj_decompress_and_load b @0805E1AE .align 2, 0 .pool @0805E1AC: movs r6, 0x1 @0805E1AE: adds r0, r6, 0 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_805E08C thumb_func_start load_gfxc_health_bar load_gfxc_health_bar: ; 805E1B8 push {lr} ldr r0, =gUnknown_08C093F0 ldr r1, =0x020244d4 ldr r1, [r1] movs r2, 0xBA lsls r2, 1 adds r1, r2 ldr r1, [r1] bl call_LZZUnCompWram pop {r0} bx r0 .align 2, 0 .pool thumb_func_end load_gfxc_health_bar thumb_func_start battle_load_something battle_load_something: ; 805E1D8 push {r4-r6,lr} adds r5, r0, 0 adds r4, r1, 0 movs r6, 0 ldrb r0, [r5] cmp r0, 0x6 bls @0805E1E8 b @0805E346 @0805E1E8: lsls r0, 2 ldr r1, =@0805E1F8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0805E1F8: .4byte @0805E214 .4byte @0805E21A .4byte @0805E324 .4byte @0805E230 .4byte @0805E260 .4byte @0805E29C .4byte @0805E33C @0805E214: bl sub_805E378 b @0805E324 @0805E21A: ldrb r0, [r4] bl sub_805E08C lsls r0, 24 cmp r0, 0 beq @0805E228 b @0805E320 @0805E228: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @0805E346 @0805E230: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @0805E24C ldrb r0, [r4] cmp r0, 0 bne @0805E24C bl battle_make_oam_safari_battle b @0805E252 .align 2, 0 .pool @0805E24C: ldrb r0, [r4] bl battle_make_oam_normal_battle @0805E252: ldr r2, =0x03005d70 ldrb r1, [r4] adds r1, r2 strb r0, [r1] b @0805E30E .align 2, 0 .pool @0805E260: ldrb r0, [r4] bl sub_8072B18 ldr r0, =0x02024076 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] cmp r0, 0x1 bhi @0805E288 ldr r0, =0x03005d70 adds r0, r1, r0 ldrb r0, [r0] movs r1, 0 bl nullsub_30 b @0805E30E .align 2, 0 .pool @0805E288: ldr r0, =0x03005d70 adds r0, r1, r0 ldrb r0, [r0] movs r1, 0x1 bl nullsub_30 b @0805E30E .align 2, 0 .pool @0805E29C: ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0805E2E4 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 bne @0805E302 ldr r0, =0x03005d70 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe b @0805E302 .align 2, 0 .pool @0805E2E4: ldr r0, =0x03005d70 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @0805E302: ldr r1, =0x03005d70 ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] bl sub_8072984 @0805E30E: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] ldr r1, =0x0202406c lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bne @0805E346 @0805E320: movs r0, 0 strb r0, [r4] @0805E324: ldrb r0, [r5] adds r0, 0x1 strb r0, [r5] b @0805E346 .align 2, 0 .pool @0805E33C: bl sub_805EC84 bl sub_81B8C68 movs r6, 0x1 @0805E346: adds r0, r6, 0 pop {r4-r6} pop {r1} bx r1 thumb_func_end battle_load_something thumb_func_start sub_805E350 sub_805E350: ; 805E350 push {r4,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r0, [r0, 0x4] movs r1, 0 movs r2, 0x30 bl memset ldr r0, [r4] ldr r0, [r0, 0x8] movs r1, 0 movs r2, 0x10 bl memset pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805E350 thumb_func_start sub_805E378 sub_805E378: ; 805E378 push {lr} bl sub_805E350 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] movs r1, 0 movs r2, 0x10 bl memset pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805E378 thumb_func_start sub_805E394 sub_805E394: ; 805E394 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r4, 0 ldr r5, =0x0202406c ldrb r0, [r5] cmp r4, r0 bge @0805E3EA ldr r0, =0x02020630 mov r9, r0 movs r0, 0x1 mov r12, r0 movs r0, 0x2 negs r0, r0 mov r8, r0 ldr r7, =0x020244d0 ldr r6, =0x020241e4 @0805E3B8: ldr r0, [r7] ldr r0, [r0] lsls r3, r4, 2 adds r3, r0 adds r0, r4, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r9 adds r0, 0x3E ldrb r1, [r0] lsls r1, 29 lsrs r1, 31 mov r0, r12 ands r1, r0 ldrb r2, [r3] mov r0, r8 ands r0, r2 orrs r0, r1 strb r0, [r3] adds r4, 0x1 ldrb r0, [r5] cmp r4, r0 blt @0805E3B8 @0805E3EA: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805E394 thumb_func_start sub_805E408 sub_805E408: ; 805E408 lsls r0, 24 lsrs r0, 24 ldr r1, =0x020244d0 ldr r1, [r1] ldr r1, [r1] lsls r3, r0, 2 adds r3, r1 ldr r2, =0x02020630 ldr r1, =0x020241e4 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r1, [r0] lsls r1, 29 lsrs r1, 31 ldrb r2, [r3] movs r0, 0x2 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] bx lr .align 2, 0 .pool thumb_func_end sub_805E408 thumb_func_start sub_805E448 sub_805E448: ; 805E448 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 24 lsrs r7, r0, 24 lsls r1, 24 lsrs r1, 24 str r1, [sp] lsls r2, 24 cmp r2, 0 beq @0805E51C ldr r0, =0x020241e4 adds r5, r7, r0 ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 mov r8, r1 add r0, r8 ldr r4, =0x020244d0 ldr r1, [r4] ldr r1, [r1, 0x8] ldrb r1, [r1] bl obj_anim_image_start lsls r0, r7, 20 movs r2, 0x80 lsls r2, 17 adds r0, r2 lsrs r6, r0, 16 ldr r2, =0x0202449c ldr r0, [r4] ldr r0, [r0, 0x8] ldrh r1, [r0] lsls r1, 5 movs r3, 0x80 lsls r3, 1 adds r1, r3 ldr r0, [r2] adds r0, r1 adds r1, r6, 0 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0x020244e4 adds r1, r7, r1 ldr r0, [r4] ldr r0, [r0, 0x8] ldrh r0, [r0] strb r0, [r1] ldr r0, [r4] ldr r1, [r0] lsls r0, r7, 2 adds r0, r1 ldrh r0, [r0, 0x2] cmp r0, 0 beq @0805E4DE ldr r3, =0x00007fff adds r0, r6, 0 movs r1, 0x10 movs r2, 0x6 bl pal_fade_1 lsls r1, r6, 1 ldr r0, =0x02037b14 adds r0, r1, r0 ldr r2, =0x02037714 adds r1, r2 ldr r2, =0x04000008 bl CpuSet @0805E4DE: adds r0, r7, 0 bl sub_80A6138 ldrb r2, [r5] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 add r1, r8 lsls r0, 24 lsrs r0, 24 strh r0, [r1, 0x22] b @0805E77A .align 2, 0 .pool @0805E51C: bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @0805E558 movs r0, 0 mov r10, r0 ldr r0, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0x18] ldrh r1, [r2, 0x2] mov r8, r1 ldr r3, [r2, 0x8] mov r9, r3 ldr r4, [r2, 0xC] lsls r0, r1, 3 ldr r1, =gMonBackPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] ldr r1, [r1, 0x4] ldr r3, [r2, 0x10] b @0805E5FA .align 2, 0 .pool @0805E558: adds r0, r7, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r0, [sp] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0805E58C ldr r1, =0x0202406e ldr r2, [sp] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @0805E59C .align 2, 0 .pool @0805E58C: ldr r1, =0x0202406e ldr r3, [sp] lsls r0, r3, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @0805E59C: adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r8, r0 adds r0, r7, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0805E618 ldr r0, =0x0202406e lsls r4, r7, 1 adds r4, r0 ldrh r0, [r4] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0 bl pokemon_getattr mov r9, r0 ldrh r0, [r4] muls r0, r6 adds r0, r5 movs r1, 0x1 bl pokemon_getattr adds r4, r0, 0 mov r1, r8 lsls r0, r1, 3 ldr r1, =gMonBackPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] mov r3, r10 lsls r2, r3, 2 adds r1, 0x4 adds r1, r2 ldr r1, [r1] ldr r3, =0x020244bc lsls r2, r7, 2 adds r2, r3 ldr r3, [r2] @0805E5FA: mov r2, r8 bl sub_8034B50 b @0805E662 .align 2, 0 .pool @0805E618: ldr r0, =0x0202406e lsls r4, r7, 1 adds r4, r0 ldrh r0, [r4] movs r6, 0x64 muls r0, r6 ldr r5, =0x02024744 adds r0, r5 movs r1, 0 bl pokemon_getattr mov r9, r0 ldrh r0, [r4] muls r0, r6 adds r0, r5 movs r1, 0x1 bl pokemon_getattr adds r4, r0, 0 mov r1, r8 lsls r0, r1, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] mov r3, r10 lsls r2, r3, 2 adds r1, 0x4 adds r1, r2 ldr r1, [r1] ldr r3, =0x020244bc lsls r2, r7, 2 adds r2, r3 ldr r3, [r2] mov r2, r8 bl sub_8034B50 @0805E662: ldr r0, =0x020244d4 ldr r0, [r0] mov r2, r10 lsls r1, r2, 2 adds r0, 0x4 adds r0, r1 ldr r2, [r0] ldr r0, =0x020241e4 adds r0, r7 mov r10, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r3, =0x02020630 adds r0, r3 ldrh r0, [r0, 0x4] lsls r0, 22 lsrs r0, 17 ldr r1, =0x06010000 adds r0, r1 ldr r1, =0x040000d4 str r2, [r1] str r0, [r1, 0x4] ldr r0, =0x84000200 str r0, [r1, 0x8] ldr r0, [r1, 0x8] lsls r0, r7, 20 movs r1, 0x80 lsls r1, 17 adds r0, r1 lsrs r6, r0, 16 mov r0, r8 adds r1, r4, 0 mov r2, r9 bl species_and_otid_get_pal mov r9, r0 ldr r4, =0x0201c000 adds r1, r4, 0 bl call_LZZUnCompWram adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =0x00000181 cmp r8, r0 bne @0805E70A mov r2, r10 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r1, 0x8 adds r0, r1 ldr r1, =gUnknown_08309AAC mov r3, r8 lsls r2, r3, 2 adds r1, r2 ldr r1, [r1] str r1, [r0] ldr r5, =0x0202449c ldr r1, [r5] movs r4, 0x80 lsls r4, 1 adds r1, r4 mov r0, r9 bl call_LZZUnCompWram ldr r0, =0x020244e4 ldr r1, [sp] adds r0, r1, r0 ldrb r1, [r0] lsls r1, 5 adds r1, r4 ldr r0, [r5] adds r0, r1 adds r1, r6, 0 movs r2, 0x20 bl gpu_pal_apply @0805E70A: ldr r3, =0x00007fff adds r0, r6, 0 movs r1, 0x10 movs r2, 0x6 bl pal_fade_1 lsls r1, r6, 1 ldr r0, =0x02037b14 adds r0, r1, r0 ldr r2, =0x02037714 adds r1, r2 ldr r2, =0x04000008 bl CpuSet bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @0805E74A ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r7, 2 adds r0, r1 mov r2, r8 strh r2, [r0, 0x2] ldr r0, =0x020244e4 adds r1, r7, r0 ldr r3, [sp] adds r0, r3, r0 ldrb r0, [r0] strb r0, [r1] @0805E74A: adds r0, r7, 0 bl sub_80A6138 mov r1, r10 ldrb r2, [r1] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 ldr r2, =0x02020630 adds r1, r2 lsls r0, 24 lsrs r0, 24 strh r0, [r1, 0x22] mov r3, r10 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x020244e4 adds r1, r7, r1 ldrb r1, [r1] bl 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 .pool thumb_func_end sub_805E448 thumb_func_start sub_805E7DC sub_805E7DC: ; 805E7DC push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 lsls r1, 24 cmp r1, 0 bne @0805E898 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @0805E7F8 movs r4, 0 b @0805E802 @0805E7F8: adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r4, r0, 24 @0805E802: bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @0805E814 ldr r0, =gUnknown_08C2D120 b @0805E822 .align 2, 0 .pool @0805E814: adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0805E83C ldr r0, =gUnknown_08C2CEE0 @0805E822: ldr r1, =0x020244d4 ldr r1, [r1] lsls r4, 2 adds r1, 0x4 adds r1, r4 ldr r1, [r1] bl call_LZZUnCompVram b @0805E84E .align 2, 0 .pool @0805E83C: ldr r0, =gUnknown_08C2D120 ldr r1, =0x020244d4 ldr r1, [r1] lsls r4, 2 adds r1, 0x4 adds r1, r4 ldr r1, [r1] bl call_LZZUnCompVram @0805E84E: movs r3, 0x1 lsls r6, r5, 4 ldr r7, =gUnknown_08C2CEBC ldr r0, =0x020244d4 ldr r0, [r0] adds r0, 0x4 adds r4, r0, r4 ldr r2, =0x040000d4 ldr r5, =0x84000200 @0805E860: ldr r0, [r4] lsls r1, r3, 11 adds r1, r0, r1 str r0, [r2] str r1, [r2, 0x4] str r5, [r2, 0x8] ldr r0, [r2, 0x8] adds r3, 0x1 cmp r3, 0x3 ble @0805E860 movs r0, 0x80 lsls r0, 1 adds r1, r6, r0 adds r0, r7, 0 movs r2, 0x20 bl decompress_palette b @0805E8E6 .align 2, 0 .pool @0805E898: bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @0805E8E6 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0805E8D0 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 adds r1, r4, 0 bl sub_805DC0C b @0805E8E6 .align 2, 0 .pool @0805E8D0: ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 adds r1, r5, 0 bl sub_805DD7C @0805E8E6: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805E7DC thumb_func_start refresh_graphics_maybe refresh_graphics_maybe: ; 805E8F4 push {r4-r6,lr} adds r5, r1, 0 adds r4, r2, 0 lsls r0, 24 lsrs r6, r0, 24 lsls r5, 24 lsrs r5, 24 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 adds r1, r5, 0 bl sub_805E7DC lsls r0, r4, 4 adds r0, r4 lsls r0, 2 ldr r1, =0x02020630 adds r4, r0, r1 ldr r0, =0x020244e4 adds r0, r6, r0 ldrb r1, [r0] adds r0, r4, 0 bl obj_anim_image_start cmp r5, 0 bne @0805E938 adds r0, r6, 0 bl sub_80A614C b @0805E93E .align 2, 0 .pool @0805E938: adds r0, r6, 0 bl sub_80A6138 @0805E93E: lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] pop {r4-r6} pop {r0} bx r0 thumb_func_end refresh_graphics_maybe thumb_func_start sub_805E94C sub_805E94C: ; 805E94C push {lr} lsls r0, 24 lsrs r2, r0, 24 lsls r1, 16 lsrs r1, 16 cmp r1, 0xA4 bne @0805E96C ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] @0805E96C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805E94C thumb_func_start sub_805E974 sub_805E974: ; 805E974 lsls r0, 24 ldr r1, =0x020244d0 ldr r1, [r1] ldr r1, [r1] lsrs r0, 22 adds r0, r1 ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_805E974 thumb_func_start sub_805E990 sub_805E990: ; 805E990 push {r4-r7,lr} adds r5, r0, 0 lsls r1, 24 lsrs r6, r1, 24 adds r7, r6, 0 movs r1, 0x39 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x3A bl pokemon_getattr adds r1, r0, 0 lsls r4, 16 asrs r4, 16 lsls r1, 16 asrs r1, 16 adds r0, r4, 0 bl sub_8075060 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0805EA08 ldr r7, =0x020244d0 ldr r0, [r7] ldr r2, [r0] lsls r4, r6, 2 adds r0, r4, r2 ldrb r1, [r0] movs r5, 0x2 movs r3, 0x2 adds r0, r3, 0 ands r0, r1 cmp r0, 0 bne @0805EA5A adds r0, r6, 0 eors r0, r5 lsls r0, 2 adds r0, r2 ldrb r1, [r0] adds r0, r3, 0 ands r0, r1 cmp r0, 0 bne @0805E9F6 movs r0, 0x5A bl audio_play @0805E9F6: ldr r0, [r7] ldr r1, [r0] adds r1, r4, r1 ldrb r0, [r1] orrs r0, r5 strb r0, [r1] b @0805EA5A .align 2, 0 .pool @0805EA08: ldr r4, =0x020244d0 ldr r0, [r4] ldr r0, [r0] lsls r1, r6, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x3 negs r0, r0 ands r0, r2 strb r0, [r1] bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @0805EA34 movs r0, 0x5A bl m4aSongNumStop b @0805EA5A .align 2, 0 .pool @0805EA34: bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805EA5A ldr r1, [r4] movs r0, 0x2 eors r7, r0 ldr r1, [r1] lsls r0, r7, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0805EA5A movs r0, 0x5A bl m4aSongNumStop @0805EA5A: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_805E990 thumb_func_start sub_805EA60 sub_805EA60: ; 805EA60 push {r4-r6,lr} movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r4, r0, 24 ldr r5, =0x020244d0 ldr r0, [r5] ldr r0, [r0] lsls r1, r4, 2 adds r1, r0 ldrb r2, [r1] movs r6, 0x3 negs r6, r6 adds r0, r6, 0 ands r0, r2 strb r0, [r1] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805EAA2 ldr r2, [r5] movs r0, 0x2 adds r1, r4, 0 eors r1, r0 ldr r0, [r2] lsls r1, 2 adds r1, r0 ldrb r2, [r1] adds r0, r6, 0 ands r0, r2 strb r0, [r1] @0805EAA2: movs r0, 0x5A bl m4aSongNumStop pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805EA60 thumb_func_start sub_805EAB4 sub_805EAB4: ; 805EAB4 push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x39 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x3A bl pokemon_getattr adds r1, r0, 0 lsls r4, 16 asrs r4, 16 lsls r1, 16 asrs r1, 16 adds r0, r4, 0 bl sub_8075060 lsls r0, 24 lsrs r0, 24 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_805EAB4 thumb_func_start sub_805EAE8 sub_805EAE8: ; 805EAE8 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0805EB7E movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r0, 0x2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 mov r9, r0 ldr r5, =0x0202406e mov r1, r8 lsls r0, r1, 1 adds r0, r5 ldrb r0, [r0] bl pokemon_order_func adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 mov r1, r9 lsls r0, r1, 1 adds r0, r5 ldrb r0, [r0] bl pokemon_order_func lsls r0, 24 lsrs r5, r0, 24 movs r7, 0x64 adds r0, r4, 0 muls r0, r7 ldr r6, =0x020244ec adds r4, r0, r6 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0805EB5A adds r0, r4, 0 mov r1, r8 bl sub_805E990 @0805EB5A: bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805EB7E adds r0, r5, 0 muls r0, r7 adds r4, r0, r6 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0805EB7E adds r0, r4, 0 mov r1, r9 bl sub_805E990 @0805EB7E: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805EAE8 thumb_func_start sub_805EB9C sub_805EB9C: ; 805EB9C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r5, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 bge @0805EC6C movs r0, 0x3 mov r10, r8 mov r1, r10 ands r1, r0 mov r10, r1 movs r6, 0 movs r2, 0x3F negs r2, r2 mov r9, r2 @0805EBC8: lsls r0, r5, 24 lsrs r0, 24 bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @0805EC60 ldr r4, =0x02020630 ldr r0, =0x020241e4 adds r3, r5, r0 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0, 0x1] movs r7, 0x4 negs r7, r7 adds r2, r7, 0 ands r1, r2 mov r2, r10 orrs r1, r2 strb r1, [r0, 0x1] mov r7, r8 cmp r7, 0 bne @0805EC3C ldr r0, =0x020244d0 ldr r0, [r0] ldr r2, [r0, 0x4] adds r2, r6, r2 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 strb r0, [r2, 0x6] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0, 0x3] mov r2, r9 ands r1, r2 strb r1, [r0, 0x3] b @0805EC60 .align 2, 0 .pool @0805EC3C: ldrb r0, [r3] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r4 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] adds r0, r6, r0 ldrb r1, [r0, 0x6] movs r0, 0x1F ands r1, r0 lsls r1, 1 ldrb r0, [r2, 0x3] mov r3, r9 ands r0, r3 orrs r0, r1 strb r0, [r2, 0x3] @0805EC60: adds r6, 0xC adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @0805EBC8 @0805EC6C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805EB9C thumb_func_start sub_805EC84 sub_805EC84: ; 805EC84 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =gUnknown_0831C6A0 bl 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, =gUnknown_0831C6B0 mov r8, r0 adds r0, r5, 0 movs r1, 0 bl sub_80A5C6C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x1 bl sub_80A5C6C adds r2, r0, 0 lsls r2, 24 lsrs r2, 8 movs r0, 0xE8 lsls r0, 13 adds r2, r0 asrs r2, 16 mov r0, r8 adds r1, r4, 0 movs r3, 0xC8 bl obj_add_from_template_forward_search ldr r6, =0x020244d0 ldr r1, [r6] ldr r2, [r1, 0x4] lsls r1, r5, 1 adds r1, r5 lsls r1, 2 adds r2, r1, r2 strb r0, [r2, 0x7] ldr r7, =0x02020630 ldr r0, [r6] ldr r0, [r0, 0x4] adds r1, r0 ldrb r1, [r1, 0x7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r5, [r0, 0x2E] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805ED56 movs r0, 0x3 bl battle_get_side_with_given_state adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r5, 0 movs r1, 0 bl sub_80A5C6C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x1 bl sub_80A5C6C adds r2, r0, 0 lsls r2, 24 lsrs r2, 8 movs r0, 0xE8 lsls r0, 13 adds r2, r0 asrs r2, 16 mov r0, r8 adds r1, r4, 0 movs r3, 0xC8 bl 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 .pool thumb_func_end sub_805EC84 thumb_func_start sub_805ED70 ; int sub_805ED70(obj *a1) sub_805ED70: ; 805ED70 push {r4-r7,lr} mov r7, r8 push {r7} adds r5, r0, 0 movs r0, 0 mov r8, r0 ldrh r0, [r5, 0x2E] lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r7, r0, r1 adds r6, r7, 0 adds r6, 0x3E ldrb r1, [r6] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0805EDAC adds r0, r4, 0 bl sub_80A6A90 lsls r0, 24 cmp r0, 0 bne @0805EDC0 @0805EDAC: ldr r0, =sub_805EE48 str r0, [r5, 0x1C] b @0805EE36 .align 2, 0 .pool @0805EDC0: ldr r0, =0x020383fd ldrb r0, [r0] cmp r0, 0 bne @0805EDD2 ldrb r1, [r6] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0805EDE4 @0805EDD2: movs r0, 0x1 mov r8, r0 ldr r2, =0x020244d0 lsls r4, 2 b @0805EE06 .align 2, 0 .pool @0805EDE4: ldr r2, =0x020244d0 ldr r0, [r2] ldr r0, [r0] lsls r1, r4, 2 adds r3, r1, r0 ldrh r0, [r3, 0x2] adds r4, r1, 0 cmp r0, 0 beq @0805EE06 ldr r0, =gUnknown_08305DCC ldrh r1, [r3, 0x2] adds r1, r0 ldrb r0, [r1] cmp r0, 0 bne @0805EE06 movs r0, 0x1 mov r8, r0 @0805EE06: ldr r0, [r2] ldr r0, [r0] adds r0, r4, r0 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0805EE1A movs r0, 0x1 mov r8, r0 @0805EE1A: ldrh r0, [r7, 0x20] strh r0, [r5, 0x20] ldrh r0, [r7, 0x24] strh r0, [r5, 0x24] adds r2, r5, 0 adds r2, 0x3E mov r0, r8 lsls r3, r0, 2 ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 orrs r0, r3 strb r0, [r2] @0805EE36: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805ED70 thumb_func_start sub_805EE48 sub_805EE48: ; 805EE48 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] bx lr thumb_func_end sub_805EE48 thumb_func_start sub_805EE54 sub_805EE54: ; 805EE54 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 lsls r1, 16 lsrs r5, r1, 16 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0805EED0 ldr r0, =0x020244d0 ldr r3, [r0] ldr r1, [r3] lsls r0, r4, 2 adds r1, r0, r1 ldrh r0, [r1, 0x2] cmp r0, 0 beq @0805EE7E adds r5, r0, 0 @0805EE7E: ldr r0, =gUnknown_08305DCC adds r0, r5, r0 ldrb r0, [r0] cmp r0, 0 beq @0805EEB4 ldr r2, =0x02020630 ldr r1, [r3, 0x4] lsls r0, r4, 1 adds r0, r4 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_805ED70 b @0805EECE .align 2, 0 .pool @0805EEB4: ldr r2, =0x02020630 ldr r1, [r3, 0x4] lsls r0, r6, 1 adds r0, r6 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_805EE48 @0805EECE: str r1, [r0] @0805EED0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805EE54 thumb_func_start sub_805EEE0 sub_805EEE0: ; 805EEE0 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 ldr r1, =0x020244d0 ldr r1, [r1] ldr r3, [r1, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r3 ldrb r1, [r1, 0x7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_805EE48 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_805EEE0 thumb_func_start sub_805EF14 sub_805EF14: ; 805EF14 push {r4-r6,lr} ldr r3, =0x06000240 movs r0, 0 movs r6, 0xF0 lsls r6, 8 @0805EF1E: adds r5, r0, 0x1 movs r4, 0xF @0805EF22: ldrh r1, [r3] adds r0, r6, 0 ands r0, r1 cmp r0, 0 bne @0805EF32 adds r0, r6, 0 orrs r0, r1 strh r0, [r3] @0805EF32: ldrh r1, [r3] movs r2, 0xF0 lsls r2, 4 adds r0, r2, 0 ands r0, r1 cmp r0, 0 bne @0805EF46 adds r0, r2, 0 orrs r0, r1 strh r0, [r3] @0805EF46: ldrh r1, [r3] movs r2, 0xF0 movs r0, 0xF0 ands r0, r1 cmp r0, 0 bne @0805EF58 adds r0, r1, 0 orrs r0, r2 strh r0, [r3] @0805EF58: ldrh r1, [r3] movs r2, 0xF movs r0, 0xF ands r0, r1 cmp r0, 0 bne @0805EF6A adds r0, r1, 0 orrs r0, r2 strh r0, [r3] @0805EF6A: adds r3, 0x2 subs r4, 0x1 cmp r4, 0 bge @0805EF22 adds r0, r5, 0 cmp r0, 0x8 ble @0805EF1E pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805EF14 thumb_func_start sub_805EF84 sub_805EF84: ; 805EF84 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 ldr r0, =0x020244d0 ldr r0, [r0] ldr r2, [r0] lsls r0, r4, 2 adds r0, r2 movs r3, 0 movs r2, 0 strh r2, [r0, 0x2] ldr r0, =0x020244e4 adds r0, r4, r0 strb r3, [r0] cmp r1, 0 bne @0805EFAC adds r0, r4, 0 bl sub_805E974 @0805EFAC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805EF84 thumb_func_start init_uns_table_pokemon_copy init_uns_table_pokemon_copy: ; 805EFBC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r6, 0 ldr r4, =0x020244d4 str r6, [r4] movs r0, 0xC0 lsls r0, 1 bl 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, =0x020244d4 ldr r1, [r0] lsls r4, r6, 2 adds r2, r1, 0x4 adds r2, r4 lsls r3, r6, 13 ldr r0, [r1] adds r0, r3 str r0, [r2] lsls r3, r6, 1 adds r0, r3, r6 lsls r0, 3 adds r1, r0, r1 ldr r2, =gUnknown_08329D98 adds r1, 0x14 adds r0, r2 ldm r0!, {r2,r5,r7} stm r1!, {r2,r5,r7} ldm r0!, {r2,r5,r7} stm r1!, {r2,r5,r7} movs r5, 0 mov r9, r3 lsls r0, r6, 5 mov r8, r0 adds r1, r6, 0x1 mov r10, r1 mov r12, r8 adds r7, r4, 0 @0805F01A: ldr r2, =0x020244d4 ldr r1, [r2] lsls r4, r5, 3 add r4, r12 adds r3, r1, 0 adds r3, 0x74 adds r3, r4 adds r0, r1, 0x4 adds r0, r7 lsls r2, r5, 11 ldr r0, [r0] adds r0, r2 str r0, [r3] adds r1, r4 adds r1, 0x78 movs r0, 0x80 lsls r0, 4 strh r0, [r1] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x3 bls @0805F01A ldr r1, =0x020244d4 ldr r2, [r1] mov r5, r9 adds r0, r5, r6 lsls r0, 3 adds r1, r2, 0 adds r1, 0x20 adds r1, r0 mov r0, r8 adds r0, 0x74 adds r2, r0 str r2, [r1] mov r7, r10 lsls r0, r7, 24 lsrs r6, r0, 24 cmp r6, 0x3 bls @0805EFE2 movs r0, 0x80 lsls r0, 5 bl malloc_and_clear ldr r1, =0x020244d4 ldr r1, [r1] movs r2, 0xBA lsls r2, 1 adds r1, r2 str r0, [r1] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end init_uns_table_pokemon_copy thumb_func_start sub_805F094 sub_805F094: ; 805F094 push {r4-r6,lr} ldr r6, =0x020244d4 ldr r0, [r6] cmp r0, 0 beq @0805F106 movs r1, 0xBE lsls r1, 1 adds r0, r1 ldr r0, [r0] cmp r0, 0 beq @0805F0BA bl free ldr r0, [r6] movs r1, 0xBE lsls r1, 1 adds r0, r1 movs r1, 0 str r1, [r0] @0805F0BA: ldr r0, [r6] movs r1, 0xBC lsls r1, 1 adds r0, r1 ldr r0, [r0] cmp r0, 0 beq @0805F0D8 bl free ldr r0, [r6] movs r1, 0xBC lsls r1, 1 adds r0, r1 movs r1, 0 str r1, [r0] @0805F0D8: ldr r0, [r6] movs r5, 0xBA lsls r5, 1 adds r0, r5 ldr r0, [r0] bl free ldr r0, [r6] adds r5, r0, r5 movs r4, 0 str r4, [r5] ldr r0, [r0] bl free ldr r0, [r6] str r4, [r0] str r4, [r0, 0x4] str r4, [r0, 0x8] str r4, [r0, 0xC] str r4, [r0, 0x10] bl free str r4, [r6] @0805F106: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805F094 thumb_func_start sub_805F110 sub_805F110: ; 805F110 push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x37 bl pokemon_getattr ldr r1, =0x00000fff ands r1, r0 cmp r1, 0 bne @0805F158 adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x3A bl pokemon_getattr adds r1, r0, 0 lsls r4, 16 asrs r4, 16 lsls r1, 16 asrs r1, 16 adds r0, r4, 0 bl sub_8075060 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 ble @0805F158 movs r0, 0x1 b @0805F15A .align 2, 0 .pool @0805F158: movs r0, 0 @0805F15A: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_805F110 thumb_func_start nullsub_26 nullsub_26: ; 805F160 bx lr thumb_func_end nullsub_26 thumb_func_start sub_805F164 sub_805F164: ; 805F164 ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl7 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_805F164 thumb_func_start bx_exec_buffer_A_ch0_tbl7 bx_exec_buffer_A_ch0_tbl7: ; 805F180 push {lr} ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0805F1CC ldr r0, =0x02023064 lsls r1, r3, 9 adds r1, r0 ldrb r0, [r1] cmp r0, 0x38 bhi @0805F1C8 ldr r0, =gUnknown_0831C6C8 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 b @0805F1CC .align 2, 0 .pool @0805F1C8: bl dp01_tbl7_exec_completed @0805F1CC: pop {r0} bx r0 thumb_func_end bx_exec_buffer_A_ch0_tbl7 thumb_func_start sub_805F1D0 sub_805F1D0: ; 805F1D0 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0805F1F4 bl dp01_tbl7_exec_completed @0805F1F4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805F1D0 thumb_func_start sub_805F208 sub_805F208: ; 805F208 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0805F22C bl dp01_tbl7_exec_completed @0805F22C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805F208 thumb_func_start sub_805F240 sub_805F240: ; 805F240 push {r4-r6,lr} ldr r5, =0x02020630 ldr r6, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r2, r0, 2 adds r0, r5, 0 adds r0, 0x1C adds r0, r2, r0 ldr r1, [r0] ldr r0, =nullsub_12 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 .pool thumb_func_end sub_805F240 thumb_func_start sub_805F2A8 sub_805F2A8: ; 805F2A8 push {r4,lr} ldr r4, =0x020244d0 ldr r1, [r4] ldr r3, =0x02024064 ldrb r0, [r3] ldr r2, [r1, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x9] subs r0, 0x1 strb r0, [r1, 0x9] lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @0805F2E0 ldr r0, [r4] ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x9] bl dp01_tbl7_exec_completed @0805F2E0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805F2A8 thumb_func_start sub_805F2F0 sub_805F2F0: ; 805F2F0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r0, 0 mov r10, r0 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805F32C bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805F31E ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @0805F32C @0805F31E: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 beq @0805F368 @0805F32C: ldr r2, =0x02020630 ldr r1, =0x03005d70 ldr r3, =0x02024064 ldrb r0, [r3] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0805F34E movs r1, 0x1 mov r10, r1 @0805F34E: movs r6, 0 b @0805F3A2 .align 2, 0 .pool @0805F368: ldr r3, =0x02020630 ldr r6, =0x03005d70 ldr r2, =0x02024064 ldrb r4, [r2] adds r0, r4, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r3, 0x1C adds r0, r3 ldr r5, [r0] ldr r0, =nullsub_12 cmp r5, r0 bne @0805F3A0 movs r0, 0x2 eors r4, r0 adds r0, r4, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldr r0, [r0] cmp r0, r5 bne @0805F3A0 movs r0, 0x1 mov r10, r0 @0805F3A0: movs r6, 0x1 @0805F3A2: ldr r3, =0x020244d8 ldr r1, =0x020244d0 mov r8, r1 ldr r2, [r1] ldr r7, =0x02024064 ldrb r1, [r7] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r5, [r2, 0x4] adds r0, r5, r0 str r0, [r3] ldr r2, =0x020244dc ldrb r0, [r7] movs r1, 0x2 mov r9, r1 mov r1, r9 eors r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r5, r0 str r0, [r2] mov r0, r10 cmp r0, 0 bne @0805F3D8 b @0805F53C @0805F3D8: cmp r6, 0x1 bne @0805F494 ldrb r2, [r7] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r4, r0, r5 ldrb r1, [r4, 0x1] adds r0, r6, 0 ands r0, r1 cmp r0, 0 bne @0805F3F2 b @0805F53C @0805F3F2: mov r0, r9 eors r0, r2 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r5 ldrb r0, [r1, 0x1] ands r6, r0 cmp r6, 0 bne @0805F408 b @0805F53C @0805F408: ldrb r1, [r4] movs r3, 0x7F adds r0, r3, 0 ands r0, r1 strb r0, [r4] mov r1, r8 ldr r0, [r1] ldrb r2, [r7] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r4, 0x2 negs r4, r4 adds r0, r4, 0 ands r0, r2 strb r0, [r1, 0x1] mov r0, r8 ldr r2, [r0] ldrb r0, [r7] mov r1, r9 eors r1, r0 ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] ands r3, r1 strb r3, [r0] mov r1, r8 ldr r2, [r1] ldrb r0, [r7] mov r1, r9 eors r1, r0 ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] ands r4, r1 strb r4, [r0, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag b @0805F51A .align 2, 0 .pool @0805F494: ldrb r2, [r7] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r5 ldrb r1, [r0, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0805F53C adds r0, r2, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bne @0805F4E4 mov r0, r8 ldr r2, [r0] ldrb r0, [r7] mov r1, r9 eors r1, r0 ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0] movs r0, 0xC0 lsls r0, 1 ands r0, r1 cmp r0, 0 bne @0805F53C ldr r4, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag @0805F4E4: mov r1, r8 ldr r0, [r1] ldr r1, =0x02024064 ldrb r2, [r1] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x7F ands r0, r2 strb r0, [r1] mov r1, r8 ldr r0, [r1] ldr r1, =0x02024064 ldrb r2, [r1] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] @0805F51A: ldr r0, =0x020244d0 ldr r0, [r0] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x9] ldr r1, =0x03005d60 ldrb r0, [r3] lsls r0, 2 adds r0, r1 ldr r1, =sub_805F2A8 str r1, [r0] @0805F53C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805F2F0 thumb_func_start sub_805F560 sub_805F560: ; 805F560 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r0, 0 str r0, [sp] mov r10, r0 ldr r5, =0x020244d0 ldr r0, [r5] ldr r4, =0x02024064 ldrb r2, [r4] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrh r1, [r0] movs r6, 0xC4 lsls r6, 1 adds r0, r6, 0 ands r0, r1 cmp r0, 0 bne @0805F5A6 ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @0805F5A6: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00008040 ands r0, r1 cmp r0, 0 bne @0805F5EE bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805F5EE ldr r2, [r5] ldrb r1, [r4] movs r0, 0x2 adds r3, r0, 0 eors r3, r1 ldr r1, [r2, 0x4] lsls r2, r3, 1 adds r0, r2, r3 lsls r0, 2 adds r0, r1 ldrh r1, [r0] adds r0, r6, 0 ands r0, r1 cmp r0, 0 bne @0805F5EE ldr r0, =0x0202406e adds r0, r2, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @0805F5EE: ldr r2, =0x020244d0 ldr r0, [r2] ldr r1, =0x02024064 mov r8, r1 ldrb r4, [r1] ldr r5, [r0, 0x4] lsls r0, r4, 1 adds r0, r4 lsls r0, 2 adds r3, r0, r5 ldrb r1, [r3] movs r6, 0x8 adds r0, r6, 0 ands r0, r1 mov r9, r2 cmp r0, 0 bne @0805F6D0 movs r7, 0x2 adds r1, r7, 0 eors r1, r4 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r0] adds r0, r6, 0 ands r0, r1 cmp r0, 0 bne @0805F6D0 ldrb r1, [r3, 0x1] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0805F6B4 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805F684 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @0805F684 ldr r4, =0x03005d70 mov r1, r8 ldrb r0, [r1] adds r1, r7, 0 eors r1, r0 adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe mov r1, r8 ldrb r0, [r1] eors r0, r7 bl sub_8076918 mov r1, r8 ldrb r0, [r1] eors r0, r7 adds r0, r4 ldrb r0, [r0] bl sub_80729D0 @0805F684: ldr r5, =0x03005d70 ldr r4, =0x02024064 ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r4] bl sub_8076918 ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 @0805F6B4: ldr r3, =0x020244d0 ldr r2, [r3] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x80 orrs r1, r2 strb r1, [r0, 0x1] mov r9, r3 @0805F6D0: mov r1, r9 ldr r0, [r1] ldr r4, =0x02024064 ldrb r2, [r4] ldr r3, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x1] movs r0, 0xC0 ands r0, r1 cmp r0, 0x80 bne @0805F792 movs r1, 0x2 eors r1, r2 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x1] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0805F792 bl sub_80A36C8 lsls r0, 24 cmp r0, 0 bne @0805F792 mov r1, r9 ldr r0, [r1] ldrb r4, [r4] ldr r1, [r0, 0x4] lsls r0, r4, 1 adds r0, r4 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x1] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0805F774 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x42 ands r0, r1 cmp r0, 0x42 bne @0805F768 adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0805F774 ldr r0, =0x03007420 bl m4aMPlayContinue b @0805F774 .align 2, 0 .pool @0805F768: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl @0805F774: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x1] movs r0, 0x1 str r0, [sp] @0805F792: bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805F7B2 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805F810 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0805F810 @0805F7B2: ldr r2, =0x02020630 ldr r0, =0x03005d7c ldr r1, =0x02024064 ldrb r4, [r1] adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r3, [r0] ldr r0, =nullsub_12 cmp r3, r0 bne @0805F86E ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r0, [r0] cmp r0, r3 bne @0805F86E movs r1, 0x1 mov r10, r1 b @0805F86E .align 2, 0 .pool @0805F810: ldr r2, =0x02020630 ldr r7, =0x03005d7c ldr r0, =0x02024064 ldrb r3, [r0] adds r0, r3, r7 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r4, [r0] ldr r0, =nullsub_12 cmp r4, r0 bne @0805F86E ldr r6, =0x020241e4 adds r0, r3, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r5, [r0] cmp r5, r4 bne @0805F86E movs r0, 0x2 eors r3, r0 adds r0, r3, r7 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r4, [r0] cmp r4, r5 bne @0805F86E adds r0, r3, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r0, [r0] cmp r0, r4 bne @0805F86E movs r0, 0x1 mov r10, r0 @0805F86E: ldr r1, [sp] cmp r1, 0 beq @0805F958 mov r0, r10 cmp r0, 0 beq @0805F958 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0805F8D2 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @0805F8D2 ldr r1, =0x03005d7c ldr r5, =0x02024064 ldrb r0, [r5] movs r4, 0x2 eors r0, r4 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldrb r0, [r5] eors r4, r0 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_805EE54 @0805F8D2: ldr r1, =0x03005d7c ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldrb r5, [r4] ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r5, 0 bl sub_805EE54 ldr r3, =0x020244d0 ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r1, [r2, 0x9] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2, 0x9] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x21 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x7F ands r0, r2 strb r0, [r1, 0x1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_805F2F0 str r1, [r0] @0805F958: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805F560 thumb_func_start sub_805F994 sub_805F994: ; 805F994 push {r4,r5,lr} ldr r2, =0x02020630 ldr r0, =0x020241e4 ldr r1, =0x02024064 ldrb r3, [r1] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x24 ldrsh r0, [r0, r1] cmp r0, 0 bne @0805F9E0 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r2, r3, 1 adds r0, r2, r3 lsls r0, 2 adds r0, r1 ldrh r1, [r0] movs r0, 0xC0 lsls r0, 1 ands r0, r1 cmp r0, 0 bne @0805F9E0 ldr r0, =0x0202406e adds r0, r2, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @0805F9E0: ldr r2, =0x02020630 ldr r0, =0x020241e4 ldr r5, =0x02024064 ldrb r3, [r5] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0805FA48 ldr r4, =0x020244d0 ldr r0, [r4] ldr r1, [r0, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r2, r0, r1 ldrb r1, [r2, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0805FA48 ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] ldr r0, [r4] ldrb r2, [r5] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 bl 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 .pool thumb_func_end sub_805F994 thumb_func_start sub_805FA70 sub_805FA70: ; 805FA70 push {r4-r6,lr} ldr r6, =0x02024064 ldrb r0, [r6] ldr r5, =0x03005d70 adds r1, r0, r5 ldrb r1, [r1] movs r2, 0 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r6] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 lsls r4, 16 asrs r1, r4, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0805FAB8 ldrb r0, [r6] adds r0, r5 ldrb r0, [r0] movs r2, 0 bl heathbar_draw_hp b @0805FABC .align 2, 0 .pool @0805FAB8: bl dp01_tbl7_exec_completed @0805FABC: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_805FA70 thumb_func_start sub_805FAC4 sub_805FAC4: ; 805FAC4 push {lr} ldr r2, =0x02020630 ldr r0, =0x020241e4 ldr r1, =0x02024064 ldrb r3, [r1] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 31 cmp r0, 0 bne @0805FAF2 ldr r0, =0x03005d70 adds r0, r3, r0 ldrb r0, [r0] bl sub_8072984 bl dp01_tbl7_exec_completed @0805FAF2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805FAC4 thumb_func_start sub_805FB08 sub_805FB08: ; 805FB08 push {r4-r6,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r6, =0x02024064 ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0805FB62 ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldrb r0, [r6] bl sub_805EEE0 ldr r1, =0x03005d70 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl dp01_tbl7_exec_completed @0805FB62: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r2 movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x20 bne @0805FBE0 movs r3, 0 movs r0, 0 strh r0, [r4, 0x30] adds r2, r4, 0 adds r2, 0x3E ldrb r1, [r2] subs r0, 0x5 ands r0, r1 strb r0, [r2] ldr r0, =0x020244b9 strb r3, [r0] bl dp01_tbl7_exec_completed b @0805FC0A .align 2, 0 .pool @0805FBE0: ldrh r0, [r4, 0x30] movs r1, 0x3 ands r0, r1 cmp r0, 0 bne @0805FC04 adds r3, r4, 0 adds r3, 0x3E ldrb r2, [r3] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r0, 0x5 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] @0805FC04: ldrh r0, [r4, 0x30] adds r0, 0x1 strh r0, [r4, 0x30] @0805FC0A: pop {r4} pop {r0} bx r0 thumb_func_end bx_blink_t7 thumb_func_start sub_805FC10 sub_805FC10: ; 805FC10 push {r4,lr} ldr r2, =0x02020630 ldr r0, =0x03005d70 ldr r4, =0x02024064 ldrb r3, [r4] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0805FC5C ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r3, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0805FC50 adds r0, r3, 0 adds r1, r3, 0 adds r2, r3, 0 movs r3, 0x6 bl move_anim_start_t4 @0805FC50: ldr r0, =0x03005d60 ldrb r1, [r4] lsls r1, 2 adds r1, r0 ldr r0, =bx_803AEDC str r0, [r1] @0805FC5C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805FC10 thumb_func_start bx_803AEDC bx_803AEDC: ; 805FC80 push {r4,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r4, =0x02024064 ldrb r1, [r4] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0805FCDA bl sub_80A36C8 lsls r0, 24 cmp r0, 0 bne @0805FCDA ldr r2, =0x02020630 ldr r1, =0x020241e4 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @0805FCCA ldr r0, =nullsub_18 cmp r1, r0 bne @0805FCDA @0805FCCA: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl bl dp01_tbl7_exec_completed @0805FCDA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_803AEDC thumb_func_start sub_805FD00 sub_805FD00: ; 805FD00 push {r4-r7,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r1, [r3, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0805FDBC ldr r7, =0x02020630 ldr r6, =0x020241e4 adds r0, r2, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r7, 0 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0805FDBC ldrb r1, [r3] movs r0, 0x7F ands r0, r1 strb r0, [r3] ldr r0, [r4] ldrb r2, [r5] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 bl 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, =0x03005d70 ldrb r1, [r5] adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r5] bl sub_8076918 ldrb r0, [r5] adds r0, r4 ldrb r0, [r0] bl sub_80729D0 ldrb r0, [r5] bl sub_805E408 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_805FC10 str r1, [r0] @0805FDBC: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805FD00 thumb_func_start sub_805FDF0 sub_805FDF0: ; 805FDF0 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r0, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x88 ands r0, r1 cmp r0, 0 bne @0805FE22 ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @0805FE22: ldr r4, =0x02020630 ldr r0, =0x03005d7c ldrb r2, [r5] adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r3, r0, 2 adds r0, r4, 0 adds r0, 0x1C adds r0, r3, r0 ldr r1, [r0] ldr r0, =nullsub_12 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, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_805EE54 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_805FD00 str r1, [r0] @0805FE8C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805FDF0 thumb_func_start sub_805FEB8 sub_805FEB8: ; 805FEB8 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @0805FEDA bl dp01_tbl7_exec_completed @0805FEDA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_805FEB8 thumb_func_start bx_803B0F4 bx_803B0F4: ; 805FEE8 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0805FF0A bl dp01_tbl7_exec_completed @0805FF0A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_803B0F4 thumb_func_start dp01_tbl7_exec_completed dp01_tbl7_exec_completed: ; 805FF18 push {r4,lr} sub sp, 0x4 ldr r1, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl7 str r1, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @0805FF6C bl link_get_multiplayer_id mov r1, sp strb r0, [r1] movs r0, 0x2 movs r1, 0x4 mov r2, sp bl dp01_prepare_buffer_wireless_probably ldr r1, =0x02023064 ldrb r0, [r4] lsls r0, 9 adds r0, r1 movs r1, 0x38 strb r1, [r0] b @0805FF7E .align 2, 0 .pool @0805FF6C: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] @0805FF7E: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_tbl7_exec_completed thumb_func_start dp01t_00_7_getattr dp01t_00_7_getattr: ; 805FF90 push {r4-r6,lr} sub sp, 0x100 movs r6, 0 ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @0805FFC8 ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] mov r1, sp bl sub_8060004 adds r6, r0, 0 b @0805FFEA .align 2, 0 .pool @0805FFC8: ldrb r4, [r1] movs r5, 0 @0805FFCC: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @0805FFE2 lsls r0, r5, 24 lsrs r0, 24 mov r2, sp adds r1, r2, r6 bl sub_8060004 adds r6, r0 @0805FFE2: lsrs r4, 1 adds r5, 0x1 cmp r5, 0x5 ble @0805FFCC @0805FFEA: lsls r1, r6, 16 lsrs r1, 16 movs r0, 0x1 mov r2, sp bl dp01_build_cmdbuf_x1D_1D_numargs_varargs bl dp01_tbl7_exec_completed add sp, 0x100 pop {r4-r6} pop {r0} bx r0 thumb_func_end dp01t_00_7_getattr thumb_func_start sub_8060004 sub_8060004: ; 8060004 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x90 adds r7, r1, 0 lsls r0, 24 lsrs r5, r0, 24 movs r6, 0 ldr r2, =0x02023064 ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 9 adds r1, r2, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0x3B bls @0806002E bl @0806079A @0806002E: lsls r0, 2 ldr r1, =@08060044 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08060044: .4byte @08060134 .4byte @08060358 .4byte @08060368 .4byte @08060378 .4byte @080603E0 .4byte @080603E0 .4byte @080603E0 .4byte @080603E0 .4byte @080603FC .4byte @08060438 .4byte @08060438 .4byte @08060438 .4byte @08060438 .4byte @0806079A .4byte @0806079A .4byte @0806079A .4byte @0806079A .4byte @08060454 .4byte @08060464 .4byte @08060494 .4byte @080604A4 .4byte @080604B4 .4byte @080604C4 .4byte @080604D4 .4byte @080604E4 .4byte @080604F4 .4byte @08060504 .4byte @08060514 .4byte @08060524 .4byte @08060534 .4byte @08060544 .4byte @08060554 .4byte @080605A4 .4byte @080605B4 .4byte @080605C4 .4byte @080605D4 .4byte @080605E4 .4byte @080605F4 .4byte @08060604 .4byte @08060614 .4byte @08060624 .4byte @08060658 .4byte @08060668 .4byte @08060678 .4byte @08060688 .4byte @08060698 .4byte @080606A8 .4byte @080606B8 .4byte @080606C8 .4byte @080606E8 .4byte @080606F8 .4byte @08060708 .4byte @08060718 .4byte @08060728 .4byte @08060738 .4byte @08060748 .4byte @08060758 .4byte @08060768 .4byte @08060778 .4byte @08060788 @08060134: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 add r0, sp, 0x24 mov r9, r0 movs r1, 0x3B add r1, sp mov r10, r1 mov r2, sp adds r2, 0x2B str r2, [sp, 0x80] mov r0, sp adds r0, 0x2A str r0, [sp, 0x7C] mov r1, sp adds r1, 0x68 str r1, [sp, 0x8C] adds r2, 0x5 str r2, [sp, 0x84] adds r0, 0x12 str r0, [sp, 0x88] mov r8, r4 add r4, sp, 0xC @08060180: adds r1, r6, 0 adds r1, 0xD mov r0, r8 bl pokemon_getattr strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 bl pokemon_getattr mov r2, r9 adds r1, r2, r6 strb r0, [r1] adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @08060180 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_getattr mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 bl pokemon_getattr ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr mov r3, sp movs r5, 0x1F ands r0, r5 ldrb r2, [r3, 0x14] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr mov r3, sp movs r6, 0x1F ands r0, r6 lsls r0, 5 ldrh r2, [r3, 0x14] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 2 ldrb r2, [r3, 0x15] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [sp, 0x14] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr mov r3, sp ands r0, r6 lsls r0, 4 ldrh r2, [r3, 0x16] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 1 ldrb r2, [r3, 0x17] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C bl pokemon_getattr mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D bl pokemon_getattr mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E bl pokemon_getattr mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F bl pokemon_getattr mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr mov r3, sp movs r1, 0x1 ands r0, r1 lsls r0, 6 ldrb r2, [r3, 0x17] movs r1, 0x41 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] bl pokemon_getattr ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] bl 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 .pool @08060358: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB b @080606D2 .align 2, 0 .pool @08060368: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xC b @080606D2 .align 2, 0 .pool @08060378: movs r6, 0 add r2, sp, 0x58 mov r9, r2 add r0, sp, 0x60 mov r10, r0 movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x02024744 adds r4, r1, r0 mov r8, r9 @0806038E: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 bl pokemon_getattr mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 bl pokemon_getattr mov r2, r10 adds r1, r2, r6 strb r0, [r1] movs r0, 0x2 add r8, r0 adds r6, 0x1 cmp r6, 0x3 ble @0806038E movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x15 bl pokemon_getattr mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 movs r6, 0 @080603CC: adds r0, r7, r6 adds r1, r2, r6 ldrb r1, [r1] strb r1, [r0] adds r6, 0x1 cmp r6, 0xF bls @080603CC b @0806079A .align 2, 0 .pool @080603E0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x9 b @080606D2 .align 2, 0 .pool @080603FC: movs r6, 0 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r2, =0x02024744 mov r8, r2 @08060408: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 cmp r6, 0x3 ble @08060408 movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x15 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 b @0806079A .align 2, 0 .pool @08060438: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x8 b @08060792 .align 2, 0 .pool @08060454: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1 b @0806046E .align 2, 0 .pool @08060464: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x19 @0806046E: bl pokemon_getattr adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF lsls r0, 8 ands r0, r1 lsrs r0, 8 strb r0, [r7, 0x1] movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r0, 16 strb r0, [r7, 0x2] movs r6, 0x3 b @0806079A .align 2, 0 .pool @08060494: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1A b @08060792 .align 2, 0 .pool @080604A4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1B b @08060792 .align 2, 0 .pool @080604B4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1C b @08060792 .align 2, 0 .pool @080604C4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1D b @08060792 .align 2, 0 .pool @080604D4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1E b @08060792 .align 2, 0 .pool @080604E4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1F b @08060792 .align 2, 0 .pool @080604F4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x20 b @08060792 .align 2, 0 .pool @08060504: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x22 b @08060792 .align 2, 0 .pool @08060514: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x23 b @08060792 .align 2, 0 .pool @08060524: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x24 b @08060792 .align 2, 0 .pool @08060534: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x25 b @08060792 .align 2, 0 .pool @08060544: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x26 b @08060792 .align 2, 0 .pool @08060554: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr strb r0, [r7, 0x5] movs r6, 0x6 b @0806079A .align 2, 0 .pool @080605A4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x27 b @08060792 .align 2, 0 .pool @080605B4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x28 b @08060792 .align 2, 0 .pool @080605C4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x29 b @08060792 .align 2, 0 .pool @080605D4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2A b @08060792 .align 2, 0 .pool @080605E4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2B b @08060792 .align 2, 0 .pool @080605F4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2C b @08060792 .align 2, 0 .pool @08060604: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0 b @0806062E .align 2, 0 .pool @08060614: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x9 b @080606D2 .align 2, 0 .pool @08060624: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x37 @0806062E: bl pokemon_getattr adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF lsls r0, 8 ands r0, r1 lsrs r0, 8 strb r0, [r7, 0x1] movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r0, 16 strb r0, [r7, 0x2] lsrs r0, r1, 24 strb r0, [r7, 0x3] movs r6, 0x4 b @0806079A .align 2, 0 .pool @08060658: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x38 b @08060792 .align 2, 0 .pool @08060668: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x39 b @080606D2 .align 2, 0 .pool @08060678: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3A b @080606D2 .align 2, 0 .pool @08060688: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3B b @080606D2 .align 2, 0 .pool @08060698: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3C b @080606D2 .align 2, 0 .pool @080606A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3D b @080606D2 .align 2, 0 .pool @080606B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3E b @080606D2 .align 2, 0 .pool @080606C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3F @080606D2: bl pokemon_getattr lsls r0, 16 lsrs r0, 16 strb r0, [r7] lsrs r0, 8 strb r0, [r7, 0x1] movs r6, 0x2 b @0806079A .align 2, 0 .pool @080606E8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x16 b @08060792 .align 2, 0 .pool @080606F8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x17 b @08060792 .align 2, 0 .pool @08060708: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x18 b @08060792 .align 2, 0 .pool @08060718: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x21 b @08060792 .align 2, 0 .pool @08060728: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2F b @08060792 .align 2, 0 .pool @08060738: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x30 b @08060792 .align 2, 0 .pool @08060748: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x32 b @08060792 .align 2, 0 .pool @08060758: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x33 b @08060792 .align 2, 0 .pool @08060768: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x34 b @08060792 .align 2, 0 .pool @08060778: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x35 b @08060792 .align 2, 0 .pool @08060788: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x36 @08060792: bl pokemon_getattr strb r0, [r7] movs r6, 0x1 @0806079A: adds r0, r6, 0 add sp, 0x90 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8060004 thumb_func_start dp01t_01_2_read_pokmon_data_slice dp01t_01_2_read_pokmon_data_slice: ; 80607B0 push {r4-r7,lr} sub sp, 0x58 ldr r2, =0x0202406e ldr r5, =0x02024064 ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 adds r4, r2, 0 muls r4, r0 ldr r3, =0x02023064 lsls r1, 9 adds r0, r3, 0x1 adds r0, r1, r0 ldrb r2, [r0] ldr r0, =0x02024744 adds r0, r2, r0 adds r6, r4, r0 mov r0, sp adds r4, r0, r2 movs r2, 0 adds r0, r3, 0x2 adds r1, r0 adds r7, r5, 0 mov r12, r3 ldrb r1, [r1] cmp r2, r1 bcs @08060806 adds r3, r0, 0 @080607EC: adds r1, r4, r2 adds r0, r6, r2 ldrb r0, [r0] strb r0, [r1] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 ldrb r0, [r5] lsls r0, 9 adds r0, r3 ldrb r0, [r0] cmp r2, r0 bcc @080607EC @08060806: ldrb r0, [r7] lsls r0, 9 mov r1, r12 adds r1, 0x2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 adds r2, r4, 0 bl dp01_build_cmdbuf_x1D_1D_numargs_varargs bl dp01_tbl7_exec_completed add sp, 0x58 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_01_2_read_pokmon_data_slice thumb_func_start dp01t_02_7_setattr dp01t_02_7_setattr: ; 8060838 push {r4,r5,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @08060868 ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] bl sub_8060890 b @08060886 .align 2, 0 .pool @08060868: ldrb r4, [r1] movs r5, 0 @0806086C: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @0806087A adds r0, r5, 0 bl sub_8060890 @0806087A: lsrs r4, 1 adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x5 bls @0806086C @08060886: bl dp01_tbl7_exec_completed pop {r4,r5} pop {r0} bx r0 thumb_func_end dp01t_02_7_setattr thumb_func_start sub_8060890 sub_8060890: ; 8060890 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x38 lsls r0, 24 lsrs r5, r0, 24 ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 9 ldr r2, =0x02023067 adds r4, r0, r2 adds r7, r4, 0 subs r1, r2, 0x2 adds r0, r1 ldrb r0, [r0] adds r6, r3, 0 adds r3, r2, 0 cmp r0, 0x3B bls @080608BE bl @0806119C @080608BE: lsls r0, 2 ldr r1, =@080608D4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080608D4: .4byte @080609C4 .4byte @08060B5C .4byte @08060B78 .4byte @08060B94 .4byte @08060BE8 .4byte @08060BE8 .4byte @08060BE8 .4byte @08060BE8 .4byte @08060C08 .4byte @08060C70 .4byte @08060C70 .4byte @08060C70 .4byte @08060C70 .4byte @0806119C .4byte @0806119C .4byte @0806119C .4byte @0806119C .4byte @08060C98 .4byte @08060CB4 .4byte @08060CD0 .4byte @08060CEC .4byte @08060D08 .4byte @08060D24 .4byte @08060D40 .4byte @08060D5C .4byte @08060D78 .4byte @08060D94 .4byte @08060DB0 .4byte @08060DCC .4byte @08060DE8 .4byte @08060E04 .4byte @08060E20 .4byte @08060E94 .4byte @08060EB0 .4byte @08060ECC .4byte @08060EE8 .4byte @08060F04 .4byte @08060F20 .4byte @08060F3C .4byte @08060F58 .4byte @08060F74 .4byte @08060F90 .4byte @08060FAC .4byte @08060FC8 .4byte @08060FE4 .4byte @08061000 .4byte @0806101C .4byte @08061038 .4byte @08061054 .4byte @08061070 .4byte @0806108C .4byte @080610A8 .4byte @080610C4 .4byte @080610E0 .4byte @080610FC .4byte @08061118 .4byte @08061134 .4byte @08061150 .4byte @0806116C .4byte @08061188 @080609C4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0xB adds r2, r7, 0 bl pokemon_setattr adds r2, r7, 0 adds r2, 0x2E adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr movs r0, 0 mov r8, r0 movs r0, 0x3B adds r0, r7 mov r10, r0 adds r0, r7, 0 adds r0, 0x2B str r0, [sp, 0x20] adds r0, 0x19 str r0, [sp, 0x28] adds r0, 0x4 str r0, [sp, 0x2C] adds r0, 0x4 str r0, [sp, 0x30] subs r0, 0x22 str r0, [sp, 0x1C] subs r0, 0x2 str r0, [sp, 0x18] adds r0, 0x4 str r0, [sp, 0x24] adds r0, r7, 0x2 str r0, [sp, 0x4] adds r0, r7, 0x4 str r0, [sp, 0x8] adds r0, r7, 0x6 str r0, [sp, 0xC] adds r0, 0x2 str r0, [sp, 0x10] adds r0, 0x2 str r0, [sp, 0x14] mov r9, r4 adds r6, r7, 0 adds r6, 0x24 adds r4, r7, 0 adds r4, 0xC @08060A2A: mov r1, r8 adds r1, 0xD mov r0, r9 adds r2, r4, 0 bl pokemon_setattr mov r1, r8 adds r1, 0x11 mov r0, r9 adds r2, r6, 0 bl pokemon_setattr adds r6, 0x1 adds r4, 0x2 movs r0, 0x1 add r8, r0 mov r0, r8 cmp r0, 0x3 ble @08060A2A movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x15 mov r2, r10 bl pokemon_setattr adds r0, r4, 0 movs r1, 0x20 ldr r2, [sp, 0x20] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x19 ldr r2, [sp, 0x28] bl pokemon_setattr ldrb r0, [r7, 0x14] lsls r0, 27 lsrs r0, 27 mov r1, sp strb r0, [r1] adds r0, r4, 0 movs r1, 0x27 mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r7, 0x14] lsls r0, 22 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x28 mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r7, 0x15] lsls r0, 25 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x29 mov r2, sp bl pokemon_setattr mov r1, sp ldr r0, [r7, 0x14] lsls r0, 12 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2A mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r7, 0x16] lsls r0, 23 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2B mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r7, 0x17] lsls r0, 26 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0 ldr r2, [sp, 0x2C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x37 ldr r2, [sp, 0x30] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 ldr r2, [sp, 0x1C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 ldr r2, [sp, 0x18] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A ldr r2, [sp, 0x24] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3B ldr r2, [sp, 0x4] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C ldr r2, [sp, 0x8] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D ldr r2, [sp, 0xC] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E ldr r2, [sp, 0x10] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F ldr r2, [sp, 0x14] bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060B5C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0xB bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060B78: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0xC bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060B94: movs r0, 0 mov r8, r0 movs r0, 0xC adds r0, r4 mov r9, r0 movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x02024744 adds r7, r1, r0 adds r6, r4, 0 adds r6, 0x8 @08060BAC: mov r1, r8 adds r1, 0xD adds r0, r7, 0 adds r2, r4, 0 bl pokemon_setattr mov r1, r8 adds r1, 0x11 adds r0, r7, 0 adds r2, r6, 0 bl pokemon_setattr adds r6, 0x1 adds r4, 0x2 movs r0, 0x1 add r8, r0 mov r0, r8 cmp r0, 0x3 ble @08060BAC movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x15 mov r2, r9 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060BE8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldr r3, =0x02023064 ldrb r2, [r6] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x9 b @08060C86 .align 2, 0 .pool @08060C08: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 ldrb r2, [r6] lsls r2, 9 adds r2, r3 adds r0, r4, 0 movs r1, 0x11 str r3, [sp, 0x34] bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x12 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x13 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x14 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060C70: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldr r3, =0x02023064 ldrb r2, [r6] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x8 @08060C86: adds r3, 0x3 adds r2, r3 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060C98: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060CB4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x19 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060CD0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1A bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060CEC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1B bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060D08: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1C bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060D24: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1D bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060D40: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1E bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060D5C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1F bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060D78: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x20 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060D94: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x22 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060DB0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x23 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060DCC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x24 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060DE8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x25 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060E04: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x26 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060E20: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 ldrb r2, [r6] lsls r2, 9 adds r2, r3 adds r0, r4, 0 movs r1, 0x27 str r3, [sp, 0x34] bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x28 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x29 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x2A bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x2B bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x5 adds r2, r0 adds r0, r4, 0 b @08060F2E .align 2, 0 .pool @08060E94: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x27 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060EB0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x28 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060ECC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x29 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060EE8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x2A bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060F04: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x2B bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060F20: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 @08060F2E: movs r1, 0x2C bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060F3C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060F58: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x9 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060F74: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x37 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060F90: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x38 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060FAC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x39 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060FC8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3A bl pokemon_setattr b @0806119C .align 2, 0 .pool @08060FE4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3B bl pokemon_setattr b @0806119C .align 2, 0 .pool @08061000: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3C bl pokemon_setattr b @0806119C .align 2, 0 .pool @0806101C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3D bl pokemon_setattr b @0806119C .align 2, 0 .pool @08061038: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3E bl pokemon_setattr b @0806119C .align 2, 0 .pool @08061054: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3F bl pokemon_setattr b @0806119C .align 2, 0 .pool @08061070: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x16 bl pokemon_setattr b @0806119C .align 2, 0 .pool @0806108C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x17 bl pokemon_setattr b @0806119C .align 2, 0 .pool @080610A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x18 bl pokemon_setattr b @0806119C .align 2, 0 .pool @080610C4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x21 bl pokemon_setattr b @0806119C .align 2, 0 .pool @080610E0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x2F bl pokemon_setattr b @0806119C .align 2, 0 .pool @080610FC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x30 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08061118: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x32 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08061134: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x33 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08061150: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x34 bl pokemon_setattr b @0806119C .align 2, 0 .pool @0806116C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x35 bl pokemon_setattr b @0806119C .align 2, 0 .pool @08061188: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x36 bl pokemon_setattr @0806119C: add sp, 0x38 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8060890 thumb_func_start sub_80611B0 sub_80611B0: ; 80611B0 push {r4-r7,lr} ldr r1, =0x0202406e ldr r7, =0x02024064 ldrb r2, [r7] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 adds r3, r1, 0 muls r3, r0 ldr r4, =0x02023064 lsls r2, 9 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] ldr r1, =0x02024744 adds r0, r1 adds r5, r3, r0 movs r3, 0 adds r0, r4, 0x2 adds r2, r0 ldrb r2, [r2] cmp r3, r2 bcs @08061208 adds r6, r4, 0 adds r2, r7, 0 adds r4, r0, 0 @080611E6: adds r1, r5, r3 ldrb r0, [r2] lsls r0, 9 adds r0, 0x3 adds r0, r3, r0 adds r0, r6 ldrb r0, [r0] strb r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 ldrb r0, [r2] lsls r0, 9 adds r0, r4 ldrb r0, [r0] cmp r3, r0 bcc @080611E6 @08061208: bl dp01_tbl7_exec_completed pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80611B0 thumb_func_start sub_8061224 sub_8061224: ; 8061224 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r6, =0x02024064 ldrb r0, [r6] lsls r0, 1 ldr r1, =0x0202406e adds r0, r1 ldrh r0, [r0] movs r7, 0x64 muls r0, r7 ldr r2, =0x02024744 mov r10, r2 add r0, r10 movs r1, 0xB bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldrb r1, [r6] lsls r0, r1, 1 ldr r2, =0x0202406e adds r0, r2 ldrh r0, [r0] muls r0, r7 add r0, r10 bl sub_805DC0C ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_806A068 ldr r0, =0x0202499c mov r9, r0 ldrb r0, [r6] movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldrb r0, [r6] bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r6] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r9 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 ldrb r1, [r6] adds r1, r4 strb r0, [r1] ldr r5, =0x02020630 ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ff10 strh r1, [r0, 0x24] ldrb r2, [r6] adds r0, r2, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x2E] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 mov r1, r8 strh r1, [r0, 0x32] ldrb r3, [r6] adds r0, r3, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r2, [r6] adds r4, r2, r4 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r2, r1 ldrb r1, [r2] bl obj_anim_image_start ldrb r4, [r6] lsls r0, r4, 1 ldr r2, =0x0202406e adds r0, r2 ldrh r0, [r0] muls r0, r7 add r0, r10 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_805EE54 ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_805F994 str r1, [r0] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8061224 thumb_func_start sub_806137C sub_806137C: ; 806137C push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 adds r0, 0x5C movs r1, 0x6 strb r1, [r0] ldr r1, =0x0202406e ldrb r0, [r4] lsls r2, r0, 1 adds r2, r1 ldr r3, =0x02023064 lsls r0, 9 adds r1, r3, 0x1 adds r0, r1 ldrb r0, [r0] strh r0, [r2] ldrb r0, [r4] lsls r1, r0, 9 adds r3, 0x2 adds r1, r3 ldrb r1, [r1] bl sub_80613DC ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_805FDF0 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806137C thumb_func_start sub_80613DC sub_80613DC: ; 80613DC push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 bl sub_805EF84 ldr r0, =0x0202406e lsls r4, r6, 1 adds r4, r0 ldr r0, =0x02023064 lsls r1, r6, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] strh r0, [r4] ldrh r0, [r4] movs r1, 0x64 mov r9, r1 mov r1, r9 muls r1, r0 adds r0, r1, 0 ldr r5, =0x02024744 adds r0, r5 movs r1, 0xB bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 bl object_new_hidden_with_callback ldr r1, =0x03005d7c mov r10, r1 add r10, r6 mov r1, r10 strb r0, [r1] ldrh r0, [r4] mov r1, r9 muls r1, r0 adds r0, r1, 0 adds r0, r5 adds r1, r6, 0 bl sub_805DC0C adds r0, r6, 0 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_806A068 ldr r0, =0x0202499c mov r9, r0 adds r0, r6, 0 movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r9 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 adds r4, r6, r4 strb r0, [r4] ldr r5, =0x02020630 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x2E] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 mov r1, r8 strh r1, [r0, 0x32] mov r0, r10 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r4] strh r1, [r0, 0x30] mov r0, r10 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x32] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, r6, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r6, r1 ldrb r1, [r6] bl 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, =nullsub_12 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 .pool thumb_func_end sub_80613DC thumb_func_start sub_806156C sub_806156C: ; 806156C push {r4-r6,lr} ldr r1, =0x02023064 ldr r6, =0x02024064 ldrb r2, [r6] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r3, [r0] cmp r3, 0 bne @080615B4 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_8061604 str r1, [r0] b @080615F0 .align 2, 0 .pool @080615B4: ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldrb r0, [r6] bl sub_805EEE0 ldr r1, =0x03005d70 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl dp01_tbl7_exec_completed @080615F0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806156C thumb_func_start sub_8061604 sub_8061604: ; 8061604 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r4, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r0, [r3, 0x4] cmp r0, 0 beq @0806162C cmp r0, 0x1 beq @0806165A b @08061682 .align 2, 0 .pool @0806162C: ldr r1, [r4] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08061646 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @08061646: ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strb r1, [r0, 0x4] b @08061682 @0806165A: ldrb r1, [r3] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08061682 strb r0, [r3, 0x4] ldrb r2, [r5] adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x2 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_805FB08 str r1, [r0] @08061682: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8061604 thumb_func_start sub_8061690 sub_8061690: ; 8061690 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x02022fec ldr r2, [r0] movs r0, 0x80 lsls r0, 20 ands r0, r2 cmp r0, 0 beq @080616B0 bl sub_806B830 b @0806175A .align 2, 0 .pool @080616B0: ldr r3, =0x02038bca ldrh r1, [r3] ldr r0, =0x000003fe cmp r1, r0 bne @080616C8 bl sub_81A4CB0 b @0806175A .align 2, 0 .pool @080616C8: movs r0, 0x80 lsls r0, 19 ands r0, r2 cmp r0, 0 beq @08061708 movs r0, 0x80 lsls r0, 8 ands r2, r0 cmp r2, 0 beq @08061700 ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, 0x1 bne @080616F0 ldrh r0, [r3] bl sub_81D5588 b @0806175A .align 2, 0 .pool @080616F0: ldr r0, =0x02038bcc ldrh r0, [r0] bl sub_81D5588 b @0806175A .align 2, 0 .pool @08061700: ldrh r0, [r3] bl sub_81D5588 b @0806175A @08061708: ldr r0, =0x003f0100 ands r0, r2 cmp r0, 0 beq @0806174C ldr r0, =0x00808000 ands r2, r0 cmp r2, 0 beq @08061744 ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, 0x1 bne @08061734 ldrh r0, [r3] bl sub_8162AA0 b @0806175A .align 2, 0 .pool @08061734: ldr r0, =0x02038bcc ldrh r0, [r0] bl sub_8162AA0 b @0806175A .align 2, 0 .pool @08061744: ldrh r0, [r3] bl sub_8162AA0 b @0806175A @0806174C: movs r0, 0x80 lsls r0, 4 ands r0, r2 cmp r0, 0 beq @08061760 bl sub_8165244 @0806175A: lsls r0, 24 lsrs r4, r0, 24 b @08061796 @08061760: movs r0, 0x80 lsls r0, 8 ands r2, r0 cmp r2, 0 beq @08061788 ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, 0x1 beq @08061788 ldr r2, =gTrainers ldr r0, =0x02038bcc ldrh r1, [r0] b @0806178C .align 2, 0 .pool @08061788: ldr r2, =gTrainers ldrh r1, [r3] @0806178C: lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r4, [r0, 0x3] @08061796: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00008040 ands r0, r1 cmp r0, 0 beq @080617C8 ldr r0, =0x02024064 ldrb r0, [r0] bl battle_get_per_side_status movs r1, 0x2 ands r1, r0 movs r7, 0xC8 cmp r1, 0 beq @080617CA movs r7, 0x98 b @080617CA .align 2, 0 .pool @080617C8: movs r7, 0xB0 @080617CA: mov r8, r4 ldr r5, =0x02024064 ldrb r1, [r5] mov r0, r8 bl sub_805DF38 ldrb r0, [r5] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl template_build_for_pokemon_or_trainer ldr r6, =0x0202499c mov r9, r7 ldr r1, =gUnknown_083054E0 mov r2, r8 lsls r0, r2, 2 adds r0, r1 ldrb r0, [r0] movs r4, 0x8 subs r4, r0 lsls r4, 18 movs r0, 0xA0 lsls r0, 14 adds r4, r0 asrs r4, 16 ldrb r0, [r5] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 adds r0, r6, 0 mov r1, r9 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r6, =0x020241e4 ldrb r1, [r5] adds r1, r6 strb r0, [r1] ldr r4, =0x02020630 ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000ff10 strh r1, [r0, 0x24] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x2 strh r1, [r0, 0x2E] ldr r1, =gTrainerPaletteTable 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, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_805F1D0 str r1, [r0] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8061690 thumb_func_start sub_80618D8 sub_80618D8: ; 80618D8 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =0x02022fec ldr r2, [r0] movs r0, 0x80 lsls r0, 20 ands r0, r2 cmp r0, 0 beq @080618F8 bl sub_806B830 b @080619A2 .align 2, 0 .pool @080618F8: ldr r3, =0x02038bca ldrh r1, [r3] ldr r0, =0x000003fe cmp r1, r0 bne @08061910 bl sub_81A4CB0 b @080619A2 .align 2, 0 .pool @08061910: movs r0, 0x80 lsls r0, 19 ands r0, r2 cmp r0, 0 beq @08061950 movs r0, 0x80 lsls r0, 8 ands r2, r0 cmp r2, 0 beq @08061948 ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, 0x1 bne @08061938 ldrh r0, [r3] bl sub_81D5588 b @080619A2 .align 2, 0 .pool @08061938: ldr r0, =0x02038bcc ldrh r0, [r0] bl sub_81D5588 b @080619A2 .align 2, 0 .pool @08061948: ldrh r0, [r3] bl sub_81D5588 b @080619A2 @08061950: ldr r0, =0x003f0100 ands r0, r2 cmp r0, 0 beq @08061994 ldr r0, =0x00808000 ands r2, r0 cmp r2, 0 beq @0806198C ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, 0x1 bne @0806197C ldrh r0, [r3] bl sub_8162AA0 b @080619A2 .align 2, 0 .pool @0806197C: ldr r0, =0x02038bcc ldrh r0, [r0] bl sub_8162AA0 b @080619A2 .align 2, 0 .pool @0806198C: ldrh r0, [r3] bl sub_8162AA0 b @080619A2 @08061994: movs r0, 0x80 lsls r0, 4 ands r0, r2 cmp r0, 0 beq @080619A8 bl sub_8165244 @080619A2: lsls r0, 24 lsrs r0, 24 b @080619DE @080619A8: movs r0, 0x80 lsls r0, 8 ands r2, r0 cmp r2, 0 beq @080619D0 ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, 0x1 beq @080619D0 ldr r2, =gTrainers ldr r0, =0x02038bcc ldrh r1, [r0] b @080619D4 .align 2, 0 .pool @080619D0: ldr r2, =gTrainers ldrh r1, [r3] @080619D4: lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x3] @080619DE: mov r8, r0 ldr r6, =0x02024064 ldrb r1, [r6] bl sub_805DF38 ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl template_build_for_pokemon_or_trainer ldr r0, =0x0202499c ldr r2, =gUnknown_083054E0 mov r3, r8 lsls r1, r3, 2 adds r1, r2 ldrb r1, [r1] movs r2, 0x8 subs r2, r1 lsls r2, 18 movs r1, 0xA0 lsls r1, 14 adds r2, r1 asrs r2, 16 movs r1, 0xB0 movs r3, 0x1E bl obj_add_from_template_forward_search ldr r5, =0x020241e4 ldrb r1, [r6] adds r1, r5 strb r0, [r1] ldr r4, =0x02020630 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x60 strh r1, [r0, 0x24] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x20] adds r1, 0x20 strh r1, [r0, 0x20] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldr r1, =gTrainerPaletteTable 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, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_805F208 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80618D8 thumb_func_start sub_8061AF0 sub_8061AF0: ; 8061AF0 push {r4-r6,lr} ldr r6, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 bl oamt_add_pos2_onto_pos1 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x23 strh r1, [r0, 0x2E] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x8C lsls r1, 1 strh r1, [r0, 0x32] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =nullsub_12 bl oamt_set_x3A_32 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_805F240 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8061AF0 thumb_func_start sub_8061B9C sub_8061B9C: ; 8061B9C push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r0, [r4, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r3, r1, r0 ldrb r0, [r3, 0x4] cmp r0, 0 bne @08061BF0 ldr r1, [r4] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08061BD0 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @08061BD0: ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x4] adds r1, 0x1 strb r1, [r0, 0x4] b @08061C2C .align 2, 0 .pool @08061BF0: ldrb r1, [r3] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08061C2C strb r0, [r3, 0x4] movs r0, 0x10 movs r1, 0x3F bl audio_play_and_stuff ldr r2, =0x02020630 ldr r1, =0x020241e4 ldrb r0, [r5] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039934 str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_805FAC4 str r1, [r0] @08061C2C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8061B9C thumb_func_start sub_8061C48 sub_8061C48: ; 8061C48 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8061C48 thumb_func_start sub_8061C54 sub_8061C54: ; 8061C54 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8061C54 thumb_func_start sub_8061C60 sub_8061C60: ; 8061C60 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8061C60 thumb_func_start sub_8061C6C sub_8061C6C: ; 8061C6C push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8061C6C thumb_func_start sub_8061C78 sub_8061C78: ; 8061C78 push {r4-r6,lr} ldr r6, =0x02024064 ldrb r0, [r6] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 beq @08061C8A b @08061D9E @08061C8A: ldr r0, =0x02023064 mov r12, r0 ldrb r2, [r6] lsls r2, 9 adds r0, 0x1 adds r0, r2, r0 ldrb r0, [r0] mov r1, r12 adds r1, 0x2 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 ldr r5, =0x02038432 mov r1, r12 adds r1, 0x3 adds r2, r1 ldrb r1, [r2] strb r1, [r5] ldr r4, =0x02038408 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x4 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x5 adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r4, =0x02038404 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x6 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x7 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r3, r1 mov r1, r12 adds r1, 0x8 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 16 orrs r3, r1 mov r1, r12 adds r1, 0x9 adds r2, r1 ldrb r1, [r2] lsls r1, 24 orrs r3, r1 str r3, [r4] ldr r3, =0x0203841a ldrb r1, [r6] lsls r1, 9 mov r2, r12 adds r2, 0xA adds r1, r2 ldrb r1, [r1] strb r1, [r3] ldr r4, =0x0203841c ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0xC adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0xD adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r3, =0x02038400 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x10 adds r2, r1 str r2, [r3] ldr r3, =0x020244bc ldrb r1, [r6] lsls r1, 2 adds r1, r3 ldr r2, [r2] str r2, [r1] ldrb r1, [r5] bl sub_805DB8C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @08061D80 bl dp01_tbl7_exec_completed b @08061D9E .align 2, 0 .pool @08061D80: ldr r0, =0x020244d0 ldr r0, [r0] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =bx_move_anim_7 str r1, [r0] @08061D9E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8061C78 thumb_func_start bx_move_anim_7 bx_move_anim_7: ; 8061DB0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r2, =0x02023064 ldr r6, =0x02024064 ldrb r3, [r6] lsls r1, r3, 9 adds r0, r2, 0x1 mov r10, r0 adds r0, r1, r0 ldrb r4, [r0] adds r5, r2, 0x2 mov r9, r5 adds r0, r1, r5 ldrb r0, [r0] lsls r0, 8 orrs r4, r0 adds r2, 0xB adds r1, r2 ldrb r1, [r1] mov r8, r1 ldr r7, =0x020244d0 ldr r5, [r7] ldr r1, [r5, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x4] cmp r2, 0x1 beq @08061E48 cmp r2, 0x1 bgt @08061E08 cmp r2, 0 beq @08061E12 b @08061F24 .align 2, 0 .pool @08061E08: cmp r2, 0x2 beq @08061E72 cmp r2, 0x3 beq @08061EE8 b @08061F24 @08061E12: ldr r1, [r5] lsls r0, r3, 2 adds r1, r0, r1 ldrb r2, [r1] movs r0, 0xC ands r0, r2 cmp r0, 0x4 bne @08061E34 movs r0, 0x8 orrs r0, r2 strb r0, [r1] ldrb r2, [r6] adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @08061E34: ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strb r1, [r0, 0x4] b @08061F24 @08061E48: ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08061F24 movs r0, 0 bl sub_805EB9C adds r0, r4, 0 bl move_anim_start_t1 ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x2 strb r1, [r0, 0x4] b @08061F24 @08061E72: ldr r0, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd ldrb r0, [r0] cmp r0, 0 bne @08061F24 movs r0, 0x1 bl sub_805EB9C ldr r0, [r7] ldrb r2, [r6] ldr r1, [r0] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08061EC0 mov r0, r8 cmp r0, 0x1 bhi @08061EC0 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x6 bl move_anim_start_t4 ldr r0, [r7] ldrb r1, [r6] ldr r0, [r0] lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] @08061EC0: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x4] b @08061F24 .align 2, 0 .pool @08061EE8: ldrb r1, [r0] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @08061F24 bl sub_805E394 ldrb r0, [r6] lsls r2, r0, 9 mov r3, r10 adds r1, r2, r3 ldrb r1, [r1] add r2, r9 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 bl sub_805E94C ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r4, [r0, 0x4] bl dp01_tbl7_exec_completed @08061F24: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end bx_move_anim_7 thumb_func_start sub_8061F34 sub_8061F34: ; 8061F34 push {r4,r5,lr} ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r5, =0x02024064 ldrb r4, [r5] lsls r4, 9 ldr r0, =0x02023066 adds r4, r0 ldrh r0, [r4] bl battle_pick_message ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_t7_button_a str r1, [r0] ldrb r0, [r5] ldrh r1, [r4] bl sub_81A57E4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8061F34 thumb_func_start sub_8061F90 sub_8061F90: ; 8061F90 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8061F90 thumb_func_start sub_8061F9C sub_8061F9C: ; 8061F9C push {lr} bl sub_8063880 bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8061F9C thumb_func_start sub_8061FAC sub_8061FAC: ; 8061FAC push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8061FAC thumb_func_start sub_8061FB8 sub_8061FB8: ; 8061FB8 push {r4-r6,lr} ldr r0, =0x02022fec ldr r2, [r0] movs r0, 0x80 lsls r0, 10 ands r0, r2 cmp r0, 0 beq @08061FE4 bl sub_805D19C adds r2, r0, 0 lsls r2, 16 lsrs r2, 16 movs r0, 0x1 movs r1, 0xA @08061FD6: bl dp01_build_cmdbuf_x21_a_bb @08061FDA: bl dp01_tbl7_exec_completed b @08062156 .align 2, 0 .pool @08061FE4: ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 ldr r1, =0x02023068 adds r5, r0, r1 movs r0, 0x93 lsls r0, 3 ands r2, r0 cmp r2, 0 beq @080620C4 movs r0, 0xF bl sub_8130950 bl sub_8130BA4 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x5 beq @08062022 cmp r4, 0x5 bgt @0806201C cmp r4, 0x4 beq @08062028 b @08062040 .align 2, 0 .pool @0806201C: cmp r4, 0x6 beq @08062030 b @08062040 @08062022: movs r0, 0x1 movs r1, 0x4 b @0806202C @08062028: movs r0, 0x1 movs r1, 0x3 @0806202C: movs r2, 0 b @08061FD6 @08062030: ldr r0, =0x0202420c ldrb r2, [r0] movs r0, 0x1 movs r1, 0xF b @08061FD6 .align 2, 0 .pool @08062040: ldr r3, =gBattleMoves lsls r0, r4, 1 adds r2, r5, r0 ldrh r1, [r2] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x6] movs r0, 0x12 ands r0, r1 cmp r0, 0 beq @08062062 ldr r0, =0x0202420c ldr r1, =0x02024064 ldrb r1, [r1] strb r1, [r0] @08062062: ldrh r1, [r2] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x6] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @0806209C movs r0, 0 bl battle_get_side_with_given_state ldr r5, =0x0202420c strb r0, [r5] ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r5] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0806209C movs r0, 0x2 bl battle_get_side_with_given_state strb r0, [r5] @0806209C: ldr r0, =0x0202420c ldrb r0, [r0] lsls r0, 8 orrs r4, r0 movs r0, 0x1 movs r1, 0xA adds r2, r4, 0 bl dp01_build_cmdbuf_x21_a_bb b @08061FDA .align 2, 0 .pool @080620C4: movs r6, 0x3 @080620C6: bl GenerateRandomNumber adds r4, r0, 0 ands r4, r6 lsls r0, r4, 1 adds r0, r5, r0 ldrh r2, [r0] cmp r2, 0 beq @080620C6 ldr r1, =gBattleMoves lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x6] movs r0, 0x12 ands r0, r1 cmp r0, 0 beq @08062108 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 8 orrs r4, r0 movs r0, 0x1 movs r1, 0xA adds r2, r4, 0 bl dp01_build_cmdbuf_x21_a_bb b @08062152 .align 2, 0 .pool @08062108: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0806213C bl GenerateRandomNumber movs r1, 0x2 ands r1, r0 lsls r1, 24 lsrs r1, 24 adds r0, r1, 0 bl battle_get_side_with_given_state adds r2, r0, 0 lsls r2, 24 lsrs r2, 16 orrs r2, r4 movs r0, 0x1 movs r1, 0xA bl dp01_build_cmdbuf_x21_a_bb b @08062152 .align 2, 0 .pool @0806213C: movs r0, 0 bl battle_get_side_with_given_state adds r2, r0, 0 lsls r2, 24 lsrs r2, 16 orrs r2, r4 movs r0, 0x1 movs r1, 0xA bl dp01_build_cmdbuf_x21_a_bb @08062152: bl dp01_tbl7_exec_completed @08062156: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8061FB8 thumb_func_start sub_806215C sub_806215C: ; 806215C push {lr} ldr r0, =0x02024064 ldrb r0, [r0] lsrs r0, 1 ldr r1, =0x0202449c ldr r1, [r1] lsls r0, 1 adds r0, r1 adds r0, 0xC0 ldrb r1, [r0] movs r0, 0x1 bl dp01_build_cmdbuf_x23_aa_0 bl dp01_tbl7_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806215C thumb_func_start sub_8062188 sub_8062188: ; 8062188 push {r4-r7,lr} ldr r0, =0x02024064 ldrb r0, [r0] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 movs r2, 0xA5 lsls r2, 2 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0x6 bne @08062254 bl sub_8063A90 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x6 bne @0806225A ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 bne @080621D4 movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r5, r0, 24 adds r7, r5, 0 b @080621E8 .align 2, 0 .pool @080621D4: movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 movs r0, 0x3 bl battle_get_side_with_given_state lsls r0, 24 lsrs r5, r0, 24 @080621E8: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 cmp r0, 0 beq @08062214 ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, 0x1 bne @08062210 movs r0, 0 movs r6, 0x3 b @08062218 .align 2, 0 .pool @08062210: movs r0, 0x3 b @08062216 @08062214: movs r0, 0 @08062216: movs r6, 0x6 @08062218: adds r4, r0, 0 b @0806221E @0806221C: adds r4, 0x1 @0806221E: cmp r4, r6 bge @0806225A movs r0, 0x64 muls r0, r4 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @0806221C ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 beq @0806221C lsls r0, r5, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 beq @0806221C b @0806225A .align 2, 0 .pool @08062254: ldrb r4, [r1] movs r0, 0x6 strb r0, [r1] @0806225A: ldr r0, =0x02024064 ldrb r0, [r0] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 adds r0, 0x5C strb r4, [r0] lsls r1, r4, 24 lsrs r1, 24 movs r0, 0x1 movs r2, 0 bl dp01_build_cmdbuf_x22_a_three_bytes bl dp01_tbl7_exec_completed pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062188 thumb_func_start sub_8062288 sub_8062288: ; 8062288 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8062288 thumb_func_start sub_8062294 sub_8062294: ; 8062294 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 movs r0, 0 bl load_gfxc_health_bar ldr r3, =0x02023064 ldr r0, =0x02024064 mov r9, r0 ldrb r4, [r0] lsls r2, r4, 9 adds r0, r3, 0x3 adds r0, r2, r0 ldrb r1, [r0] lsls r1, 8 adds r3, 0x2 adds r2, r3 ldrb r0, [r2] orrs r0, r1 lsls r0, 16 asrs r7, r0, 16 ldr r0, =0x00007fff cmp r7, r0 beq @08062324 ldr r6, =0x0202406e lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x02024744 adds r0, r4 movs r1, 0x3A bl pokemon_getattr mov r8, r0 mov r1, r9 ldrb r0, [r1] lsls r0, 1 adds r0, r6 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] mov r2, r8 bl sub_807294C b @0806234E .align 2, 0 .pool @08062324: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3A bl pokemon_getattr adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] movs r3, 0 bl sub_807294C @0806234E: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_805FA70 str r1, [r0] add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062294 thumb_func_start sub_8062384 sub_8062384: ; 8062384 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8062384 thumb_func_start sub_8062390 sub_8062390: ; 8062390 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @080623E4 ldr r0, =0x03005d70 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe ldrb r2, [r4] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_805FEB8 str r1, [r0] @080623E4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062390 thumb_func_start sub_8062408 sub_8062408: ; 8062408 push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @08062458 ldr r4, =0x02023064 ldrb r3, [r5] lsls r3, 9 adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] adds r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 adds r2, r4, 0x4 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 16 orrs r1, r2 adds r4, 0x5 adds r3, r4 ldrb r2, [r3] lsls r2, 24 orrs r1, r2 bl move_anim_start_t2_for_situation ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_805FEB8 str r1, [r0] @08062458: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062408 thumb_func_start sub_8062470 sub_8062470: ; 8062470 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8062470 thumb_func_start sub_806247C sub_806247C: ; 806247C push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_806247C thumb_func_start sub_8062488 sub_8062488: ; 8062488 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8062488 thumb_func_start sub_8062494 sub_8062494: ; 8062494 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8062494 thumb_func_start sub_80624A0 sub_80624A0: ; 80624A0 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_80624A0 thumb_func_start sub_80624AC sub_80624AC: ; 80624AC push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_80624AC thumb_func_start sub_80624B8 sub_80624B8: ; 80624B8 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_80624B8 thumb_func_start sub_80624C4 sub_80624C4: ; 80624C4 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_80624C4 thumb_func_start sub_80624D0 sub_80624D0: ; 80624D0 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_80624D0 thumb_func_start sub_80624DC sub_80624DC: ; 80624DC push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x80 negs r0, r0 ands r0, r1 strb r0, [r2] bl dp01_tbl7_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80624DC thumb_func_start sub_80624F8 sub_80624F8: ; 80624F8 push {lr} ldr r3, =0x02022d0c ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] movs r1, 0x7F ands r1, r0 ldrb r2, [r3] movs r0, 0x80 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] bl dp01_tbl7_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80624F8 thumb_func_start sub_8062530 sub_8062530: ; 8062530 push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] bl dp01_tbl7_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062530 thumb_func_start sub_8062548 sub_8062548: ; 8062548 push {lr} ldr r3, =0x02022d0c ldr r1, [r3] lsls r1, 24 lsrs r1, 31 movs r0, 0x1 eors r1, r0 lsls r1, 7 ldrb r2, [r3] movs r0, 0x7F ands r0, r2 orrs r0, r1 strb r0, [r3] bl dp01_tbl7_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062548 thumb_func_start dp01t_29_7_blink dp01t_29_7_blink: ; 8062570 push {r4,lr} ldr r3, =0x02020630 ldr r2, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @080625A4 bl dp01_tbl7_exec_completed b @080625CE .align 2, 0 .pool @080625A4: ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0 strh r1, [r0, 0x30] ldrb r0, [r4] bl sub_80769F4 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_blink_t7 str r1, [r0] @080625CE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_29_7_blink thumb_func_start sub_80625E0 sub_80625E0: ; 80625E0 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_80625E0 thumb_func_start sub_80625EC sub_80625EC: ; 80625EC push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 movs r3, 0x3F cmp r0, 0 bne @08062600 movs r3, 0xC0 @08062600: ldr r2, =0x02023064 ldrb r1, [r4] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 lsls r1, r3, 24 asrs r1, 24 bl audio_play_and_stuff bl dp01_tbl7_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80625EC thumb_func_start sub_8062630 sub_8062630: ; 8062630 push {r4,r5,lr} ldr r4, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r3, r0, 9 adds r0, r4, 0x3 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @0806266C bl sub_805EA60 ldrb r1, [r5] lsls r1, 9 adds r0, r4, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, r4, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl song_play_for_text b @08062680 .align 2, 0 .pool @0806266C: adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl fanfare_play @08062680: bl dp01_tbl7_exec_completed pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8062630 thumb_func_start sub_806268C sub_806268C: ; 806268C push {lr} ldr r1, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 movs r1, 0x19 movs r2, 0x5 bl sub_80A32E4 bl dp01_tbl7_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806268C thumb_func_start dp01t_2E_7_battle_intro dp01t_2E_7_battle_intro: ; 80626C8 push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] bl battle_intro_launch ldr r2, =0x020243fc ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] bl dp01_tbl7_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_2E_7_battle_intro thumb_func_start sub_80626FC sub_80626FC: ; 80626FC push {r4-r6,lr} ldr r5, =0x020241e4 ldr r6, =0x02024064 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl oamt_add_pos2_onto_pos1 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x23 strh r1, [r0, 0x2E] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x8C lsls r1, 1 strh r1, [r0, 0x32] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =sub_806280C bl oamt_set_x3A_32 ldr r0, =sub_8062828 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r4, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r4 ldrb r0, [r6] strh r0, [r1, 0x8] ldr r3, =0x020244d0 ldr r0, [r3] ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080627BE ldr r0, =0x020244b4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r4 ldr r1, =sub_8073C30 str r1, [r0] @080627BE: ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r0, [r2, 0x9] movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_26 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80626FC thumb_func_start sub_806280C sub_806280C: ; 806280C push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x6] bl sub_805DFE4 adds r0, r4, 0 bl obj_free_rotscale_entry adds r0, r4, 0 bl 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, =0x02024064 ldrb r0, [r7] mov r9, r0 ldr r1, =0x03005e00 mov r2, r8 lsls r0, r2, 2 add r0, r8 lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x8] strb r0, [r7] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0806286C ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0806286C movs r0, 0x80 lsls r0, 8 ands r1, r0 cmp r1, 0 beq @080628A0 @0806286C: ldr r0, =0x02023064 ldrb r1, [r7] lsls r2, r1, 9 adds r0, 0x1 adds r2, r0 ldr r0, =0x0202406e lsls r1, 1 adds r1, r0 ldrh r0, [r1] strb r0, [r2] ldrb r0, [r7] movs r1, 0 bl sub_80613DC b @080628E0 .align 2, 0 .pool @080628A0: ldr r4, =0x02023064 ldrb r0, [r7] lsls r1, r0, 9 adds r4, 0x1 adds r1, r4 ldr r6, =0x0202406e lsls r0, 1 adds r0, r6 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r7] movs r1, 0 bl sub_80613DC ldrb r0, [r7] movs r5, 0x2 eors r0, r5 strb r0, [r7] ldrb r0, [r7] lsls r1, r0, 9 adds r1, r4 lsls r0, 1 adds r0, r6 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r7] movs r1, 0 bl sub_80613DC ldrb r0, [r7] eors r0, r5 strb r0, [r7] @080628E0: ldr r1, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_805F560 str r1, [r0] mov r0, r9 strb r0, [r2] mov r0, r8 bl remove_task pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062828 thumb_func_start dp01t_30_7_0803D67C dp01t_30_7_0803D67C: ; 8062918 push {r4-r7,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @08062948 adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08062948 bl dp01_tbl7_exec_completed b @08062A12 .align 2, 0 .pool @08062948: ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] ldr r1, =0x02023064 ldrb r2, [r3] lsls r0, r2, 9 adds r1, 0x2 adds r0, r1 ldrb r0, [r0] adds r7, r3, 0 cmp r0, 0 beq @080629B4 ldr r0, [r4] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r2, [r3, 0x1] lsls r1, r2, 27 lsrs r0, r1, 28 cmp r0, 0x1 bhi @080629AC adds r0, 0x1 movs r1, 0xF ands r0, r1 lsls r0, 1 movs r1, 0x1F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x1] b @08062A12 .align 2, 0 .pool @080629AC: movs r0, 0x1F negs r0, r0 ands r0, r2 strb r0, [r3, 0x1] @080629B4: adds r5, r7, 0 ldrb r0, [r5] lsls r3, r0, 9 ldr r4, =0x02023068 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] subs r4, 0x2 adds r3, r4 ldrb r3, [r3] bl sub_80735DC ldr r2, =0x020244b4 ldrb r1, [r5] adds r1, r2 movs r3, 0 strb r0, [r1] ldr r6, =0x020244d0 ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x5] ldrb r2, [r5] lsls r0, r2, 9 adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @08062A06 ldr r0, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 movs r1, 0x5D strb r1, [r0, 0x5] @08062A06: ldr r0, =0x03005d60 ldrb r1, [r7] lsls r1, 2 adds r1, r0 ldr r0, =bx_0803D790_t7 str r0, [r1] @08062A12: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_30_7_0803D67C thumb_func_start bx_0803D790_t7 bx_0803D790_t7: ; 8062A2C push {r4,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x5] adds r2, r1, 0x1 strb r2, [r0, 0x5] lsls r1, 24 lsrs r1, 24 cmp r1, 0x5C bls @08062A64 ldr r0, [r4] ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x5] bl dp01_tbl7_exec_completed @08062A64: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_0803D790_t7 thumb_func_start sub_8062A74 sub_8062A74: ; 8062A74 push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08062AA6 ldr r2, =0x03005e00 ldr r0, =0x020244b4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, =sub_8073C30 str r1, [r0] @08062AA6: bl dp01_tbl7_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062A74 thumb_func_start sub_8062AC4 sub_8062AC4: ; 8062AC4 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8062AC4 thumb_func_start sub_8062AD0 sub_8062AD0: ; 8062AD0 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @08062B16 ldr r3, =0x02020630 ldr r0, =0x020241e4 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 ldr r0, =0x02023064 lsls r1, 9 adds r0, 0x1 adds r1, r0 adds r2, 0x3E movs r0, 0x1 ldrb r1, [r1] ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] ldrb r0, [r4] bl sub_805E408 @08062B16: bl dp01_tbl7_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062AD0 thumb_func_start dp01t_34_7_move_anim_start_t3 dp01t_34_7_move_anim_start_t3: ; 8062B30 push {r4-r6,lr} sub sp, 0x4 ldr r6, =0x02024064 ldrb r0, [r6] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @08062B88 ldr r5, =0x02023064 ldrb r2, [r6] lsls r1, r2, 9 adds r0, r5, 0x1 adds r0, r1, r0 ldrb r3, [r0] adds r0, r5, 0x2 adds r0, r1, r0 ldrb r4, [r0] adds r5, 0x3 adds r1, r5 ldrb r0, [r1] lsls r0, 8 orrs r4, r0 str r4, [sp] adds r0, r2, 0 adds r1, r2, 0 bl move_anim_start_t3 lsls r0, 24 cmp r0, 0 beq @08062B7C bl dp01_tbl7_exec_completed b @08062B88 .align 2, 0 .pool @08062B7C: ldr r0, =0x03005d60 ldrb r1, [r6] lsls r1, 2 adds r1, r0 ldr r0, =bx_803B0F4 str r0, [r1] @08062B88: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_34_7_move_anim_start_t3 thumb_func_start sub_8062B98 sub_8062B98: ; 8062B98 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8062B98 thumb_func_start sub_8062BA4 sub_8062BA4: ; 8062BA4 push {lr} bl dp01_tbl7_exec_completed pop {r0} bx r0 thumb_func_end sub_8062BA4 thumb_func_start sub_8062BB0 sub_8062BB0: ; 8062BB0 push {lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x6 ands r0, r1 cmp r0, 0x2 bne @08062BDA ldr r2, =0x030022c0 ldr r0, =0x00000439 adds r3, r2, r0 ldrb r1, [r3] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r3] ldr r0, =0x03005d00 ldr r0, [r0] str r0, [r2] ldr r0, [r2, 0x8] bl set_callback2 @08062BDA: bl dp01_tbl7_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8062BB0 thumb_func_start nullsub_91 nullsub_91: ; 8062BF4 bx lr thumb_func_end nullsub_91 thumb_func_start ai_switch_perish_song ai_switch_perish_song: ; 8062BF8 push {lr} ldr r1, =0x020242ac ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x20 ands r0, r1 cmp r0, 0 beq @08062C50 ldr r0, =0x020242bc lsls r1, r2, 3 subs r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xF] lsls r0, 28 cmp r0, 0 bne @08062C50 ldr r0, =0x0202449c ldr r0, [r0] adds r0, r2, r0 movs r1, 0xA5 lsls r1, 2 adds r0, r1 movs r1, 0x6 strb r1, [r0] movs r0, 0x1 movs r1, 0x2 movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb movs r0, 0x1 b @08062C52 .align 2, 0 .pool @08062C50: movs r0, 0 @08062C52: pop {r1} bx r1 thumb_func_end ai_switch_perish_song thumb_func_start sub_8062C58 sub_8062C58: ; 8062C58 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08062C72 b @08062E2C @08062C72: ldr r0, =0x02024064 ldrb r0, [r0] bl battle_get_per_side_status movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r4, =0x02024084 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 movs r1, 0x58 muls r0, r1 adds r0, r4 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x19 beq @08062C9E b @08062E2C @08062C9E: mov r0, r10 bl battle_get_side_with_given_state lsls r0, 24 lsrs r2, r0, 24 movs r6, 0 mov r8, r4 movs r7, 0x58 adds r0, r2, 0 muls r0, r7 adds r4, r0, r4 movs r0, 0x20 adds r0, r4 mov r9, r0 @08062CBA: lsls r1, r6, 1 ldr r5, =0x02024064 ldrb r0, [r5] muls r0, r7 adds r1, r0 mov r0, r8 adds r0, 0xC adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @08062CE8 ldrh r1, [r4] mov r3, r9 ldrb r2, [r3] bl ai_rate_move lsls r0, 24 lsrs r1, r0, 24 movs r0, 0x2 ands r1, r0 cmp r1, 0 beq @08062CE8 b @08062E2C @08062CE8: adds r6, 0x1 cmp r6, 0x3 ble @08062CBA ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 cmp r0, 0 beq @08062D50 ldrb r1, [r5] movs r0, 0x2 ands r0, r1 adds r1, r5, 0 cmp r0, 0 bne @08062D20 movs r4, 0 movs r0, 0x3 str r0, [sp] b @08062D58 .align 2, 0 .pool @08062D20: movs r4, 0x3 movs r3, 0x6 str r3, [sp] b @08062D58 @08062D28: ldr r0, =0x02024064 ldrb r0, [r0] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 movs r1, 0xA5 lsls r1, 2 adds r0, r1 strb r6, [r0] movs r0, 0x1 movs r1, 0x2 movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb movs r0, 0x1 b @08062E2E .align 2, 0 .pool @08062D50: movs r4, 0 movs r3, 0x6 str r3, [sp] adds r1, r5, 0 @08062D58: ldrb r0, [r1] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r9, r1 cmp r0, 0 bne @08062D6C ldr r3, =0x020244ec mov r9, r3 @08062D6C: adds r6, r4, 0 ldr r0, [sp] cmp r6, r0 bge @08062E2C @08062D74: movs r0, 0x64 adds r5, r6, 0 muls r5, r0 mov r1, r9 adds r4, r1, r5 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08062E24 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @08062E24 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @08062E24 ldr r1, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r0, [r0] cmp r6, r0 beq @08062E24 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr mov r0, r10 bl battle_get_side_with_given_state lsls r0, 24 lsrs r2, r0, 24 movs r4, 0 mov r8, r5 ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r5, r0, r1 adds r7, r5, 0 adds r7, 0x20 @08062DE0: adds r1, r4, 0 adds r1, 0xD mov r0, r9 add r0, r8 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 cmp r0, 0 beq @08062E1E ldrh r1, [r5] ldrb r2, [r7] bl ai_rate_move lsls r0, 24 lsrs r1, r0, 24 movs r0, 0x2 ands r1, r0 cmp r1, 0 beq @08062E1E bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bls @08062D28 @08062E1E: adds r4, 0x1 cmp r4, 0x3 ble @08062DE0 @08062E24: adds r6, 0x1 ldr r3, [sp] cmp r6, r3 blt @08062D74 @08062E2C: movs r0, 0 @08062E2E: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8062C58 thumb_func_start sub_8062E54 sub_8062E54: ; 8062E54 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 movs r0, 0x1 bl ai_has_super_effective_move_on_field lsls r0, 24 cmp r0, 0 beq @08062E82 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 lsls r0, 16 cmp r0, 0 beq @08062E82 b @080630AC @08062E82: ldr r1, =0x02024250 ldr r5, =0x02024064 ldrb r3, [r5] lsls r0, r3, 1 adds r4, r0, r1 ldrh r1, [r4] cmp r1, 0 bne @08062E94 b @080630AC @08062E94: ldr r0, =0x0000ffff cmp r1, r0 bne @08062E9C b @080630AC @08062E9C: ldr r2, =gBattleMoves ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 bne @08062EB0 b @080630AC @08062EB0: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08062F1A mov r8, r3 mov r0, r8 bl battle_get_per_side_status movs r4, 0x2 eors r0, r4 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r1, =0x02024210 ldrb r1, [r1] ldr r2, =gUnknown_0832A328 lsls r0, 24 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08062F04 ldrb r7, [r5] b @08062F1E .align 2, 0 .pool @08062F04: ldrb r0, [r5] bl battle_get_per_side_status eors r0, r4 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r7, r0, 24 b @08062F1E @08062F1A: adds r7, r3, 0 mov r8, r7 @08062F1E: ldr r3, =gBattleMoves ldr r1, =0x02024250 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 1 adds r0, r1 ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x2] cmp r0, 0xA bne @08062F4C movs r0, 0x12 b @08062F5E .align 2, 0 .pool @08062F4C: cmp r0, 0xB bne @08062F56 movs r1, 0xB str r1, [sp] b @08062F60 @08062F56: cmp r0, 0xD beq @08062F5C b @080630AC @08062F5C: movs r0, 0xA @08062F5E: str r0, [sp] @08062F60: ldr r1, =0x02024084 ldrb r3, [r2] movs r0, 0x58 muls r0, r3 adds r0, r1 adds r0, 0x20 ldrb r0, [r0] ldr r1, [sp] cmp r0, r1 bne @08062F76 b @080630AC @08062F76: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 cmp r0, 0 beq @08062FCC movs r0, 0x2 ands r3, r0 cmp r3, 0 bne @08062F9C movs r4, 0 movs r0, 0x3 b @08062FD0 .align 2, 0 .pool @08062F9C: movs r4, 0x3 movs r1, 0x6 mov r10, r1 b @08062FD2 @08062FA4: ldr r0, =0x02024064 ldrb r0, [r0] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 movs r2, 0xA5 lsls r2, 2 adds r0, r2 strb r5, [r0] movs r0, 0x1 movs r1, 0x2 movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb movs r0, 0x1 b @080630AE .align 2, 0 .pool @08062FCC: movs r4, 0 movs r0, 0x6 @08062FD0: mov r10, r0 @08062FD2: ldrb r0, [r2] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 str r1, [sp, 0x4] cmp r0, 0 bne @08062FE6 ldr r2, =0x020244ec str r2, [sp, 0x4] @08062FE6: adds r5, r4, 0 cmp r5, r10 bge @080630AC ldr r0, =gBaseStats mov r9, r0 @08062FF0: movs r0, 0x64 muls r0, r5 ldr r1, [sp, 0x4] adds r6, r1, r0 adds r0, r6, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @080630A6 adds r0, r6, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @080630A6 adds r0, r6, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @080630A6 ldr r1, =0x0202406e mov r2, r8 lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r5, r0 beq @080630A6 lsls r0, r7, 1 adds r0, r1 ldrh r0, [r0] cmp r5, r0 beq @080630A6 ldr r0, =0x0202449c ldr r1, [r0] adds r0, r2, r1 adds r0, 0x5C ldrb r0, [r0] cmp r5, r0 beq @080630A6 adds r0, r7, r1 adds r0, 0x5C ldrb r0, [r0] cmp r5, r0 beq @080630A6 adds r0, r6, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 adds r0, r6, 0 movs r1, 0x2E bl pokemon_getattr cmp r0, 0 beq @08063088 lsls r0, r4, 3 subs r0, r4 lsls r0, 2 add r0, r9 ldrb r0, [r0, 0x17] b @08063092 .align 2, 0 .pool @08063088: lsls r0, r4, 3 subs r0, r4 lsls r0, 2 add r0, r9 ldrb r0, [r0, 0x16] @08063092: ldr r1, [sp] cmp r1, r0 bne @080630A6 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @080630A6 b @08062FA4 @080630A6: adds r5, 0x1 cmp r5, r10 blt @08062FF0 @080630AC: movs r0, 0 @080630AE: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8062E54 thumb_func_start ai_switchout_natural_cure ai_switchout_natural_cure: ; 80630C0 push {r4,r5,lr} ldr r3, =0x02024084 ldr r5, =0x02024064 ldrb r4, [r5] movs r0, 0x58 adds r2, r4, 0 muls r2, r0 adds r0, r3, 0 adds r0, 0x4C adds r0, r2, r0 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @08063188 adds r1, r2, r3 adds r0, r1, 0 adds r0, 0x20 ldrb r0, [r0] cmp r0, 0x1E bne @08063188 ldrh r0, [r1, 0x2C] ldrh r1, [r1, 0x28] lsrs r0, 1 cmp r1, r0 bcc @08063188 ldr r1, =0x02024250 lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] cmp r1, 0 beq @08063106 ldr r0, =0x0000ffff cmp r1, r0 bne @08063128 @08063106: bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @08063128 ldrb r0, [r5] b @08063190 .align 2, 0 .pool @08063128: ldr r2, =gBattleMoves ldr r1, =0x02024250 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 bne @08063160 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @08063160 ldrb r0, [r4] b @08063190 .align 2, 0 .pool @08063160: movs r0, 0x8 movs r1, 0x1 bl ai_switchout_something lsls r0, 24 cmp r0, 0 bne @080631AA movs r0, 0x4 movs r1, 0x1 bl ai_switchout_something lsls r0, 24 cmp r0, 0 bne @080631AA bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 bne @0806318C @08063188: movs r0, 0 b @080631AC @0806318C: ldr r0, =0x02024064 ldrb r0, [r0] @08063190: ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 movs r1, 0xA5 lsls r1, 2 adds r0, r1 movs r1, 0x6 strb r1, [r0] movs r0, 0x1 movs r1, 0x2 movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb @080631AA: movs r0, 0x1 @080631AC: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end ai_switchout_natural_cure thumb_func_start ai_has_super_effective_move_on_field ai_has_super_effective_move_on_field: ; 80631BC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 mov r9, r0 ldr r0, =0x02024064 ldrb r0, [r0] bl battle_get_per_side_status movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 mov r10, r0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r3, r0, 24 ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08063256 movs r4, 0 ldr r6, =0x02024084 movs r7, 0x58 adds r0, r3, 0 muls r0, r7 adds r5, r0, r6 movs r0, 0x20 adds r0, r5 mov r8, r0 @0806320A: lsls r1, r4, 1 ldr r0, =0x02024064 ldrb r0, [r0] muls r0, r7 adds r1, r0 adds r0, r6, 0 adds r0, 0xC adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @08063250 ldrh r1, [r5] mov r3, r8 ldrb r2, [r3] bl ai_rate_move lsls r0, 24 lsrs r1, r0, 24 movs r0, 0x2 ands r1, r0 cmp r1, 0 beq @08063250 mov r0, r9 cmp r0, 0 bne @08063278 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xA bl __umodsi3 lsls r0, 16 cmp r0, 0 bne @08063278 @08063250: adds r4, 0x1 cmp r4, 0x3 ble @0806320A @08063256: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 bne @0806327C b @080632FA .align 2, 0 .pool @08063278: movs r0, 0x1 b @080632FC @0806327C: movs r1, 0x2 mov r0, r10 eors r0, r1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r3, r0, 24 ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r3, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @080632FA movs r4, 0 ldr r6, =0x02024084 movs r7, 0x58 adds r0, r3, 0 muls r0, r7 adds r5, r0, r6 movs r3, 0x20 adds r3, r5 mov r8, r3 @080632AE: lsls r1, r4, 1 ldr r0, =0x02024064 ldrb r0, [r0] muls r0, r7 adds r1, r0 adds r0, r6, 0 adds r0, 0xC adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @080632F4 ldrh r1, [r5] mov r3, r8 ldrb r2, [r3] bl ai_rate_move lsls r0, 24 lsrs r1, r0, 24 movs r0, 0x2 ands r1, r0 cmp r1, 0 beq @080632F4 mov r0, r9 cmp r0, 0 bne @08063278 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xA bl __umodsi3 lsls r0, 16 cmp r0, 0 bne @08063278 @080632F4: adds r4, 0x1 cmp r4, 0x3 ble @080632AE @080632FA: movs r0, 0 @080632FC: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end ai_has_super_effective_move_on_field thumb_func_start ai_is_too_invested_in_stat_buffs ai_is_too_invested_in_stat_buffs: ; 806331C push {r4,lr} movs r4, 0 ldr r1, =0x02024084 ldr r0, =0x02024064 ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x18 adds r2, r0, r1 movs r3, 0x7 @08063330: ldrb r1, [r2] movs r0, 0 ldrsb r0, [r2, r0] cmp r0, 0x6 ble @08063346 subs r1, 0x6 lsls r0, r4, 24 asrs r0, 24 adds r0, r1 lsls r0, 24 lsrs r4, r0, 24 @08063346: adds r2, 0x1 subs r3, 0x1 cmp r3, 0 bge @08063330 movs r0, 0 cmp r4, 0x3 bls @08063356 movs r0, 0x1 @08063356: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end ai_is_too_invested_in_stat_buffs thumb_func_start ai_switchout_something ai_switchout_something: ; 8063364 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 lsls r0, 24 lsrs r0, 24 str r0, [sp] lsls r1, 24 lsrs r1, 24 str r1, [sp, 0x4] ldr r2, =0x02024250 ldr r1, =0x02024064 ldrb r3, [r1] lsls r0, r3, 1 adds r4, r0, r2 ldrh r2, [r4] adds r5, r1, 0 cmp r2, 0 bne @08063390 b @080635EE @08063390: ldr r0, =0x0000ffff cmp r2, r0 bne @08063398 b @080635EE @08063398: ldr r0, =0x02024270 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0xFF bne @080633A4 b @080635EE @080633A4: ldr r2, =gBattleMoves ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] cmp r0, 0 bne @080633B8 b @080635EE @080633B8: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0806342C mov r9, r3 mov r0, r9 bl battle_get_per_side_status movs r4, 0x2 eors r0, r4 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r1, =0x02024210 ldrb r1, [r1] ldr r2, =gUnknown_0832A328 lsls r0, 24 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08063414 ldrb r5, [r5] mov r10, r5 b @08063430 .align 2, 0 .pool @08063414: ldrb r0, [r5] bl battle_get_per_side_status eors r0, r4 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 mov r10, r0 b @08063430 @0806342C: mov r9, r3 mov r10, r9 @08063430: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 cmp r0, 0 beq @08063490 ldr r2, =0x02024064 ldrb r1, [r2] movs r0, 0x2 ands r0, r1 adds r5, r2, 0 cmp r0, 0 bne @08063460 movs r4, 0 movs r0, 0x3 str r0, [sp, 0x8] b @08063498 .align 2, 0 .pool @08063460: movs r4, 0x3 movs r1, 0x6 str r1, [sp, 0x8] b @08063498 @08063468: ldr r0, =0x02024064 ldrb r0, [r0] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 movs r2, 0xA5 lsls r2, 2 adds r0, r2 strb r6, [r0] movs r0, 0x1 movs r1, 0x2 movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb movs r0, 0x1 b @080635F0 .align 2, 0 .pool @08063490: movs r4, 0 movs r0, 0x6 str r0, [sp, 0x8] ldr r5, =0x02024064 @08063498: ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 str r1, [sp, 0xC] cmp r0, 0 bne @080634AC ldr r2, =0x020244ec str r2, [sp, 0xC] @080634AC: adds r6, r4, 0 b @080635E6 .align 2, 0 .pool @080634BC: movs r0, 0x64 muls r0, r6 ldr r1, [sp, 0xC] adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 bne @080634D2 b @080635E4 @080634D2: adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 bne @080634E0 b @080635E4 @080634E0: adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @080635E4 ldr r1, =0x0202406e mov r2, r9 lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r6, r0 beq @080635E4 mov r2, r10 lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r6, r0 beq @080635E4 ldr r0, =0x0202449c ldr r1, [r0] mov r2, r9 adds r0, r2, r1 adds r0, 0x5C ldrb r0, [r0] cmp r6, r0 beq @080635E4 mov r2, r10 adds r0, r2, r1 adds r0, 0x5C ldrb r0, [r0] cmp r6, r0 beq @080635E4 adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 adds r0, r5, 0 movs r1, 0x2E bl pokemon_getattr cmp r0, 0 beq @08063558 lsls r0, r4, 3 subs r0, r4 lsls r0, 2 ldr r1, =gBaseStats adds r0, r1 ldrb r2, [r0, 0x17] b @08063564 .align 2, 0 .pool @08063558: lsls r0, r4, 3 subs r0, r4 lsls r0, 2 ldr r2, =gBaseStats adds r0, r2 ldrb r2, [r0, 0x16] @08063564: ldr r1, =0x02024250 ldr r5, =0x02024064 ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrh r0, [r0] adds r1, r4, 0 bl ai_rate_move ldr r1, [sp] ands r1, r0 cmp r1, 0 beq @080635E4 ldr r1, =0x02024270 ldrb r0, [r5] adds r0, r1 ldrb r0, [r0] mov r9, r0 movs r4, 0 movs r0, 0x64 adds r1, r6, 0 muls r1, r0 mov r8, r1 ldr r1, =0x02024084 movs r0, 0x58 mov r2, r9 muls r2, r0 adds r0, r2, 0 adds r5, r0, r1 adds r7, r5, 0 adds r7, 0x20 @080635A2: adds r1, r4, 0 adds r1, 0xD ldr r0, [sp, 0xC] add r0, r8 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 cmp r0, 0 beq @080635DE ldrh r1, [r5] ldrb r2, [r7] bl ai_rate_move lsls r0, 24 lsrs r1, r0, 24 movs r0, 0x2 ands r1, r0 cmp r1, 0 beq @080635DE bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 ldr r1, [sp, 0x4] bl __modsi3 cmp r0, 0 bne @080635DE b @08063468 @080635DE: adds r4, 0x1 cmp r4, 0x3 ble @080635A2 @080635E4: adds r6, 0x1 @080635E6: ldr r0, [sp, 0x8] cmp r6, r0 bge @080635EE b @080634BC @080635EE: movs r0, 0 @080635F0: add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end ai_switchout_something thumb_func_start sub_8063614 sub_8063614: ; 8063614 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 ldr r6, =0x02024084 ldr r4, =0x02024064 ldrb r2, [r4] movs r5, 0x58 adds r0, r2, 0 muls r0, r5 adds r1, r6, 0 adds r1, 0x50 adds r0, r1 ldr r0, [r0] ldr r1, =0x0400e000 ands r0, r1 cmp r0, 0 beq @0806363E b @0806386C @0806363E: ldr r0, =0x020242ac lsls r1, r2, 2 adds r1, r0 ldr r1, [r1] movs r0, 0x80 lsls r0, 3 ands r1, r0 cmp r1, 0 beq @08063652 b @0806386C @08063652: str r1, [sp] movs r0, 0xC adds r1, r2, 0 movs r2, 0x17 movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @0806366A b @0806386C @0806366A: ldrb r1, [r4] str r0, [sp] movs r0, 0xC movs r2, 0x47 movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @08063682 b @0806386C @08063682: str r0, [sp] movs r0, 0xE movs r1, 0 movs r2, 0x2A movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @080636B4 ldrb r0, [r4] muls r0, r5 adds r1, r0, r6 adds r0, r1, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x8 bne @080636A8 b @0806386C @080636A8: adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] cmp r0, 0x8 bne @080636B4 b @0806386C @080636B4: ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 11 ands r0, r1 cmp r0, 0 beq @080636C4 b @0806386C @080636C4: movs r0, 0 mov r10, r0 movs r0, 0x1 ands r1, r0 cmp r1, 0 beq @0806372E ldrb r7, [r4] adds r0, r7, 0 bl battle_get_per_side_status movs r5, 0x2 eors r0, r5 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r1, =0x02024210 ldrb r1, [r1] ldr r2, =gUnknown_0832A328 lsls r0, 24 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08063718 ldrb r6, [r4] b @08063732 .align 2, 0 .pool @08063718: ldrb r0, [r4] bl battle_get_per_side_status eors r0, r5 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 b @08063732 @0806372E: ldrb r6, [r4] adds r7, r6, 0 @08063732: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 cmp r0, 0 beq @08063768 ldr r2, =0x02024064 ldrb r1, [r2] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08063760 movs r4, 0 movs r1, 0x3 mov r8, r1 b @08063770 .align 2, 0 .pool @08063760: movs r4, 0x3 movs r0, 0x6 mov r8, r0 b @08063770 @08063768: movs r4, 0 movs r1, 0x6 mov r8, r1 ldr r2, =0x02024064 @08063770: ldrb r0, [r2] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r9, r1 cmp r0, 0 bne @08063784 ldr r0, =0x020244ec mov r9, r0 @08063784: adds r5, r4, 0 cmp r5, r8 bge @080637F2 @0806378A: movs r0, 0x64 muls r0, r5 mov r1, r9 adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @080637EC adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @080637EC adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @080637EC ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r0, [r0] cmp r5, r0 beq @080637EC lsls r0, r6, 1 adds r0, r1 ldrh r0, [r0] cmp r5, r0 beq @080637EC ldr r0, =0x0202449c ldr r1, [r0] adds r0, r7, r1 adds r0, 0x5C ldrb r0, [r0] cmp r5, r0 beq @080637EC adds r0, r6, r1 adds r0, 0x5C ldrb r0, [r0] cmp r5, r0 beq @080637EC movs r0, 0x1 add r10, r0 @080637EC: adds r5, 0x1 cmp r5, r8 blt @0806378A @080637F2: mov r1, r10 cmp r1, 0 beq @0806386C bl ai_switch_perish_song lsls r0, 24 cmp r0, 0 bne @08063852 bl sub_8062C58 lsls r0, 24 cmp r0, 0 bne @08063852 bl sub_8062E54 lsls r0, 24 cmp r0, 0 bne @08063852 bl ai_switchout_natural_cure lsls r0, 24 cmp r0, 0 bne @08063852 movs r0, 0 bl ai_has_super_effective_move_on_field lsls r0, 24 cmp r0, 0 bne @0806386C bl ai_is_too_invested_in_stat_buffs lsls r0, 24 cmp r0, 0 bne @0806386C movs r0, 0x8 movs r1, 0x2 bl ai_switchout_something lsls r0, 24 cmp r0, 0 bne @08063852 movs r0, 0x4 movs r1, 0x3 bl ai_switchout_something lsls r0, 24 cmp r0, 0 beq @0806386C @08063852: movs r0, 0x1 b @0806386E .align 2, 0 .pool @0806386C: movs r0, 0 @0806386E: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8063614 thumb_func_start sub_8063880 sub_8063880: ; 8063880 push {r4-r7,lr} mov r7, r8 push {r7} ldr r4, =0x02024064 ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 lsrs r6, r0, 24 adds r5, r6, 0 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r8, r1 cmp r0, 0 bne @080638A8 ldr r2, =0x020244ec mov r8, r2 @080638A8: ldr r7, =0x02022fec ldr r0, [r7] movs r1, 0x8 ands r0, r1 cmp r0, 0 bne @080638B6 b @080639E6 @080638B6: bl sub_8063614 lsls r0, 24 cmp r0, 0 bne @080638C2 b @080639DC @080638C2: ldrb r0, [r4] ldr r2, =0x0202449c ldr r1, [r2] adds r0, r1 movs r1, 0xA5 lsls r1, 2 adds r0, r1 ldrb r0, [r0] cmp r0, 0x6 bne @080639B8 bl sub_8063A90 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x6 bne @080639A6 ldr r0, [r7] movs r1, 0x1 ands r0, r1 cmp r0, 0 bne @08063910 adds r0, r6, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 b @08063928 .align 2, 0 .pool @08063910: adds r0, r5, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 movs r0, 0x2 eors r5, r0 adds r0, r5, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r5, r0, 24 @08063928: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 cmp r0, 0 beq @08063958 ldr r0, =0x02024064 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08063954 movs r0, 0 movs r7, 0x3 b @0806395C .align 2, 0 .pool @08063954: movs r0, 0x3 b @0806395A @08063958: movs r0, 0 @0806395A: movs r7, 0x6 @0806395C: adds r4, r0, 0 cmp r4, r7 bge @080639A6 @08063962: movs r0, 0x64 muls r0, r4 add r0, r8 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @080639A0 ldr r1, =0x0202406e lsls r0, r6, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 beq @080639A0 lsls r0, r5, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 beq @080639A0 ldr r0, =0x0202449c ldr r1, [r0] adds r0, r6, r1 adds r0, 0x5C ldrb r0, [r0] cmp r4, r0 beq @080639A0 adds r0, r5, r1 adds r0, 0x5C ldrb r0, [r0] cmp r4, r0 bne @080639A6 @080639A0: adds r4, 0x1 cmp r4, r7 blt @08063962 @080639A6: ldr r0, =0x02024064 ldrb r0, [r0] ldr r2, =0x0202449c ldr r1, [r2] adds r0, r1 movs r1, 0xA5 lsls r1, 2 adds r0, r1 strb r4, [r0] @080639B8: ldr r0, =0x02024064 ldrb r1, [r0] ldr r0, [r2] adds r0, r1, r0 adds r1, r0, 0 adds r1, 0x5C movs r2, 0xA5 lsls r2, 2 adds r0, r2 ldrb r0, [r0] strb r0, [r1] b @080639F8 .align 2, 0 .pool @080639DC: bl sub_8063EE0 lsls r0, 24 cmp r0, 0 bne @080639F8 @080639E6: ldr r0, =0x02024064 ldrb r0, [r0] movs r2, 0x1 eors r2, r0 lsls r2, 8 movs r0, 0x1 movs r1, 0 bl dp01_build_cmdbuf_x21_a_bb @080639F8: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8063880 thumb_func_start sub_8063A08 sub_8063A08: ; 8063A08 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 adds r6, r3, 0 lsls r0, 24 lsrs r0, 24 str r0, [sp] lsls r1, 24 lsrs r1, 24 mov r9, r1 lsls r2, 24 lsrs r2, 24 mov r8, r2 movs r7, 0 ldr r0, =gUnknown_0831ACE8 mov r10, r0 ldrb r0, [r0] cmp r0, 0xFF beq @08063A7A mov r5, r10 @08063A36: ldrb r0, [r5] cmp r0, 0xFE beq @08063A6C ldr r1, [sp] cmp r0, r1 bne @08063A6C ldrb r4, [r5, 0x1] cmp r4, r9 bne @08063A56 ldrb r1, [r6] ldrb r0, [r5, 0x2] muls r0, r1 movs r1, 0xA bl __divsi3 strb r0, [r6] @08063A56: cmp r4, r8 bne @08063A6C cmp r9, r8 beq @08063A6C ldrb r1, [r6] ldrb r0, [r5, 0x2] muls r0, r1 movs r1, 0xA bl __divsi3 strb r0, [r6] @08063A6C: adds r5, 0x3 adds r7, 0x3 mov r1, r10 adds r0, r7, r1 ldrb r0, [r0] cmp r0, 0xFF bne @08063A36 @08063A7A: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8063A08 thumb_func_start sub_8063A90 sub_8063A90: ; 8063A90 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x24 ldr r4, =0x02024064 ldrb r2, [r4] ldr r0, =0x0202449c ldr r0, [r0] adds r0, r2, r0 adds r1, r0, 0 adds r1, 0x5C ldrb r0, [r1] cmp r0, 0x6 beq @08063AB2 b @08063E50 @08063AB2: ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 11 ands r0, r1 cmp r0, 0 beq @08063AE0 ldr r1, =0x0202406e lsls r0, r2, 1 adds r0, r1 ldrb r0, [r0] adds r0, 0x1 lsls r0, 24 lsrs r0, 24 b @08063E50 .align 2, 0 .pool @08063AE0: movs r0, 0x1 ands r1, r0 cmp r1, 0 beq @08063B6C str r2, [sp, 0x10] adds r0, r2, 0 bl battle_get_per_side_status movs r5, 0x2 eors r0, r5 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state ldr r1, =0x02024210 ldrb r1, [r1] ldr r2, =gUnknown_0832A328 lsls r0, 24 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08063B20 ldrb r4, [r4] str r4, [sp, 0x14] b @08063B36 .align 2, 0 .pool @08063B20: ldrb r0, [r4] bl battle_get_per_side_status eors r0, r5 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x14] @08063B36: bl GenerateRandomNumber movs r3, 0x2 ands r0, r3 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4] ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldr r4, [sp, 0x4] lsls r0, r4, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08063B8A eors r4, r3 lsls r0, r4, 24 lsrs r0, 24 str r0, [sp, 0x4] b @08063B8A .align 2, 0 .pool @08063B6C: adds r0, r2, 0 bl battle_get_per_side_status movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4] ldrb r4, [r4] str r4, [sp, 0x14] str r4, [sp, 0x10] @08063B8A: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00808000 ands r0, r1 cmp r0, 0 beq @08063BC2 ldr r2, =0x02024064 ldrb r1, [r2] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08063BB8 movs r0, 0 str r0, [sp, 0x18] movs r1, 0x3 str r1, [sp, 0x1C] b @08063BCC .align 2, 0 .pool @08063BB8: movs r4, 0x3 str r4, [sp, 0x18] movs r0, 0x6 str r0, [sp, 0x1C] b @08063BCC @08063BC2: movs r1, 0 str r1, [sp, 0x18] movs r2, 0x6 str r2, [sp, 0x1C] ldr r2, =0x02024064 @08063BCC: ldrb r0, [r2] bl battle_side_get_owner lsls r0, 24 ldr r4, =0x02024744 str r4, [sp, 0x20] cmp r0, 0 bne @08063BE0 ldr r0, =0x020244ec str r0, [sp, 0x20] @08063BE0: movs r1, 0 mov r9, r1 @08063BE4: movs r2, 0 str r2, [sp, 0x8] movs r4, 0x6 str r4, [sp, 0xC] ldr r7, [sp, 0x18] ldr r0, [sp, 0x1C] cmp r7, r0 blt @08063BF6 b @08063CF2 @08063BF6: lsls r0, r7, 2 ldr r1, =gUnknown_0832A328 adds r0, r1 mov r8, r0 mov r10, sp @08063C00: movs r0, 0x64 muls r0, r7 ldr r2, [sp, 0x20] adds r4, r2, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0 beq @08063CD8 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08063CD8 mov r4, r8 ldr r0, [r4] mov r1, r9 ands r0, r1 cmp r0, 0 bne @08063CD8 ldr r1, =0x0202406e ldr r2, [sp, 0x10] lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r0, r7 beq @08063CD8 ldr r4, [sp, 0x14] lsls r0, r4, 1 adds r0, r1 ldrh r0, [r0] cmp r0, r7 beq @08063CD8 ldr r0, =0x0202449c ldr r1, [r0] adds r0, r2, r1 adds r0, 0x5C ldrb r0, [r0] cmp r7, r0 beq @08063CD8 adds r0, r4, r1 adds r0, 0x5C ldrb r0, [r0] cmp r7, r0 beq @08063CD8 ldr r1, =gBaseStats lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r1 ldrb r5, [r0, 0x6] ldrb r6, [r0, 0x7] movs r0, 0xA mov r1, r10 strb r0, [r1] movs r0, 0x58 ldr r2, [sp, 0x4] adds r4, r2, 0 muls r4, r0 ldr r0, =0x02024084 adds r4, r0 adds r0, r4, 0 adds r0, 0x21 ldrb r0, [r0] adds r1, r5, 0 adds r2, r6, 0 mov r3, sp bl sub_8063A08 adds r4, 0x22 ldrb r0, [r4] adds r1, r5, 0 adds r2, r6, 0 mov r3, sp bl sub_8063A08 ldr r2, [sp, 0x8] mov r1, r10 ldrb r1, [r1] cmp r2, r1 bcs @08063CE6 mov r2, r10 ldrb r2, [r2] str r2, [sp, 0x8] lsls r0, r7, 24 lsrs r0, 24 str r0, [sp, 0xC] b @08063CE6 .align 2, 0 .pool @08063CD8: mov r4, r8 ldr r0, [r4] mov r1, r9 orrs r1, r0 lsls r0, r1, 24 lsrs r0, 24 mov r9, r0 @08063CE6: movs r2, 0x4 add r8, r2 adds r7, 0x1 ldr r4, [sp, 0x1C] cmp r7, r4 blt @08063C00 @08063CF2: ldr r0, [sp, 0xC] cmp r0, 0x6 beq @08063D54 movs r7, 0 movs r0, 0x64 ldr r1, [sp, 0xC] adds r5, r1, 0 muls r5, r0 @08063D02: adds r1, r7, 0 adds r1, 0xD ldr r2, [sp, 0x20] adds r0, r2, r5 bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 beq @08063D2A ldr r0, =0x02024064 ldrb r1, [r0] adds r0, r4, 0 ldr r2, [sp, 0x4] bl move_effectiveness_something movs r1, 0x2 ands r1, r0 cmp r1, 0 bne @08063D30 @08063D2A: adds r7, 0x1 cmp r7, 0x3 ble @08063D02 @08063D30: cmp r7, 0x4 beq @08063D36 b @08063E4E @08063D36: ldr r4, [sp, 0xC] lsls r0, r4, 2 ldr r1, =gUnknown_0832A328 adds r0, r1 ldr r0, [r0] mov r2, r9 orrs r2, r0 lsls r0, r2, 24 lsrs r0, 24 mov r9, r0 b @08063D58 .align 2, 0 .pool @08063D54: movs r4, 0x3F mov r9, r4 @08063D58: mov r0, r9 cmp r0, 0x3F beq @08063D60 b @08063BE4 @08063D60: ldr r0, =0x02024400 movs r1, 0 strh r1, [r0] ldr r0, =0x0202449c ldr r0, [r0] strb r1, [r0, 0x13] ldr r0, =0x02024474 movs r2, 0x1 strb r2, [r0, 0xE] ldr r0, =0x0202427c strb r1, [r0] ldr r0, =0x02024211 strb r2, [r0] movs r1, 0 str r1, [sp, 0x8] movs r2, 0x6 str r2, [sp, 0xC] ldr r7, [sp, 0x18] ldr r4, [sp, 0x1C] cmp r7, r4 bge @08063E4E @08063D8A: movs r0, 0x64 adds r6, r7, 0 muls r6, r0 ldr r0, [sp, 0x20] adds r4, r0, r6 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 adds r1, r7, 0x1 mov r10, r1 cmp r0, 0 beq @08063E46 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08063E46 ldr r1, =0x0202406e ldr r2, [sp, 0x10] lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r0, r7 beq @08063E46 ldr r4, [sp, 0x14] lsls r0, r4, 1 adds r0, r1 ldrh r0, [r0] cmp r0, r7 beq @08063E46 ldr r0, =0x0202449c ldr r1, [r0] adds r0, r2, r1 adds r0, 0x5C ldrb r0, [r0] cmp r7, r0 beq @08063E46 adds r0, r4, r1 adds r0, 0x5C ldrb r0, [r0] cmp r7, r0 beq @08063E46 movs r5, 0 mov r9, r6 ldr r0, =0x020241f0 mov r8, r0 ldr r6, =0x02024064 @08063DEE: adds r1, r5, 0 adds r1, 0xD ldr r0, [sp, 0x20] add r0, r9 bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 movs r0, 0 mov r1, r8 str r0, [r1] cmp r4, 0 beq @08063E2A ldr r0, =gBattleMoves lsls r1, r4, 1 adds r1, r4 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] cmp r0, 0x1 beq @08063E2A ldrb r0, [r6] ldr r1, [sp, 0x4] bl sub_8046E7C ldrb r1, [r6] adds r0, r4, 0 ldr r2, [sp, 0x4] bl move_effectiveness_something @08063E2A: mov r2, r8 ldr r0, [r2] ldr r4, [sp, 0x8] cmp r4, r0 bge @08063E40 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x8] lsls r0, r7, 24 lsrs r0, 24 str r0, [sp, 0xC] @08063E40: adds r5, 0x1 cmp r5, 0x3 ble @08063DEE @08063E46: mov r7, r10 ldr r0, [sp, 0x1C] cmp r7, r0 blt @08063D8A @08063E4E: ldr r0, [sp, 0xC] @08063E50: add sp, 0x24 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8063A90 thumb_func_start ai_identify_item_effect ai_identify_item_effect: ; 8063E84 push {r4,lr} adds r2, r1, 0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x13 bne @08063E94 movs r0, 0x1 b @08063EDA @08063E94: ldrb r1, [r2, 0x4] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08063EA2 movs r0, 0x2 b @08063EDA @08063EA2: ldrb r4, [r2, 0x3] movs r3, 0x3F adds r0, r3, 0 ands r0, r4 cmp r0, 0 beq @08063EB2 movs r0, 0x3 b @08063EDA @08063EB2: ldrb r1, [r2] adds r0, r3, 0 ands r0, r1 cmp r0, 0 bne @08063EC8 ldrb r0, [r2, 0x1] cmp r0, 0 bne @08063EC8 ldrb r0, [r2, 0x2] cmp r0, 0 beq @08063ECC @08063EC8: movs r0, 0x4 b @08063EDA @08063ECC: movs r0, 0x80 ands r0, r4 cmp r0, 0 bne @08063ED8 movs r0, 0x6 b @08063EDA @08063ED8: movs r0, 0x5 @08063EDA: pop {r4} pop {r1} bx r1 thumb_func_end ai_identify_item_effect thumb_func_start sub_8063EE0 sub_8063EE0: ; 8063EE0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r0, 0 mov r10, r0 movs r7, 0 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @08063F12 ldr r0, =0x02024064 ldrb r0, [r0] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08063F12 b @0806437C @08063F12: ldr r0, =0x02024064 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 ldr r5, =0x02024744 cmp r0, 0 bne @08063F24 ldr r5, =0x020244ec @08063F24: movs r1, 0 mov r8, r1 @08063F28: movs r0, 0x64 mov r2, r8 muls r2, r0 adds r0, r2, 0 adds r4, r5, r0 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @08063F64 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr cmp r0, 0 beq @08063F64 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @08063F64 mov r0, r10 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r10, r0 @08063F64: movs r0, 0x1 add r8, r0 mov r1, r8 cmp r1, 0x5 ble @08063F28 movs r2, 0 mov r8, r2 @08063F72: ldr r1, =0x020244a8 mov r0, r8 cmp r0, 0 beq @08063F8E ldr r0, [r1] ldr r0, [r0, 0x18] adds r0, 0x50 ldrb r0, [r0] mov r2, r8 subs r0, r2 adds r0, 0x1 cmp r10, r0 ble @08063F8E b @08064370 @08063F8E: ldr r0, [r1] ldr r0, [r0, 0x18] mov r2, r8 lsls r1, r2, 1 adds r0, 0x48 adds r0, r1 ldrh r0, [r0] mov r9, r0 str r1, [sp] cmp r0, 0 bne @08063FA6 b @08064370 @08063FA6: ldr r1, =gItemEffectInfoPointers subs r0, 0xD lsls r0, 2 adds r0, r1 ldr r1, [r0] cmp r1, 0 bne @08063FB6 b @08064370 @08063FB6: mov r0, r9 cmp r0, 0xAF bne @08063FE8 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003214 adds r5, r0, r1 b @08063FEA .align 2, 0 .pool @08063FE8: adds r5, r1, 0 @08063FEA: mov r2, r9 lsls r0, r2, 24 lsrs r0, 24 adds r1, r5, 0 bl ai_identify_item_effect ldr r4, =0x02024064 ldrb r1, [r4] lsrs r1, 1 ldr r3, =0x0202449c ldr r2, [r3] adds r1, r2 adds r1, 0xC4 strb r0, [r1] ldrb r0, [r4] lsrs r0, 1 ldr r1, [r3] adds r0, r1 adds r0, 0xC4 ldrb r0, [r0] subs r0, 0x1 cmp r0, 0x5 bls @0806401A b @08064324 @0806401A: lsls r0, 2 ldr r1, =@08064030 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08064030: .4byte @08064048 .4byte @08064074 .4byte @080640BC .4byte @08064214 .4byte @080642F4 .4byte @0806437C @08064048: ldr r2, =0x02024084 ldr r0, =0x02024064 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 ldrh r1, [r0, 0x2C] ldrh r0, [r0, 0x28] lsrs r1, 2 cmp r0, r1 bcc @08064060 b @08064324 @08064060: cmp r0, 0 bne @08064066 b @08064324 @08064066: movs r7, 0x1 b @08064328 .align 2, 0 .pool @08064074: mov r0, r9 movs r1, 0x4 movs r2, 0x4 bl sub_806CDDC lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @08064088 b @08064324 @08064088: ldr r2, =0x02024084 ldr r0, =0x02024064 ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r1, r0, r2 ldrh r2, [r1, 0x28] cmp r2, 0 bne @0806409C b @08064324 @0806409C: ldrh r3, [r1, 0x2C] lsrs r0, r3, 2 cmp r2, r0 bcc @08064066 adds r0, r2, 0 subs r0, r3, r0 adds r1, r5, r4 ldrb r1, [r1] cmp r0, r1 bgt @080640B2 b @08064324 @080640B2: b @08064066 .align 2, 0 .pool @080640BC: ldr r3, =0x02024064 ldrb r0, [r3] lsrs r0, 1 ldr r2, =0x0202449c ldr r1, [r2] adds r0, r1 adds r0, 0xC6 movs r1, 0 strb r1, [r0] ldrb r1, [r5, 0x3] movs r6, 0x20 movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @08064100 ldr r1, =0x02024084 ldrb r4, [r3] movs r0, 0x58 muls r0, r4 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @08064100 lsrs r1, r4, 1 ldr r0, [r2] adds r1, r0 adds r1, 0xC6 ldrb r0, [r1] orrs r0, r6 strb r0, [r1] movs r7, 0x1 @08064100: ldrb r1, [r5, 0x3] movs r6, 0x10 movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @0806413A ldr r1, =0x02024084 ldrb r4, [r3] movs r0, 0x58 muls r0, r4 adds r1, 0x4C adds r0, r1 ldr r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 bne @0806412A movs r0, 0x80 ands r1, r0 cmp r1, 0 beq @0806413A @0806412A: lsrs r1, r4, 1 ldr r0, [r2] adds r1, r0 adds r1, 0xC6 ldrb r0, [r1] orrs r0, r6 strb r0, [r1] movs r7, 0x1 @0806413A: ldrb r1, [r5, 0x3] movs r6, 0x8 movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @0806416C ldr r1, =0x02024084 ldrb r4, [r3] movs r0, 0x58 muls r0, r4 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x10 ands r0, r1 cmp r0, 0 beq @0806416C lsrs r1, r4, 1 ldr r0, [r2] adds r1, r0 adds r1, 0xC6 ldrb r0, [r1] orrs r0, r6 strb r0, [r1] movs r7, 0x1 @0806416C: ldrb r1, [r5, 0x3] movs r6, 0x4 movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0806419E ldr r1, =0x02024084 ldrb r4, [r3] movs r0, 0x58 muls r0, r4 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x20 ands r0, r1 cmp r0, 0 beq @0806419E lsrs r1, r4, 1 ldr r0, [r2] adds r1, r0 adds r1, 0xC6 ldrb r0, [r1] orrs r0, r6 strb r0, [r1] movs r7, 0x1 @0806419E: ldrb r1, [r5, 0x3] movs r6, 0x2 movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080641D0 ldr r1, =0x02024084 ldrb r4, [r3] movs r0, 0x58 muls r0, r4 adds r1, 0x4C adds r0, r1 ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @080641D0 lsrs r1, r4, 1 ldr r0, [r2] adds r1, r0 adds r1, 0xC6 ldrb r0, [r1] orrs r0, r6 strb r0, [r1] movs r7, 0x1 @080641D0: ldrb r1, [r5, 0x3] movs r4, 0x1 movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080641DE b @08064324 @080641DE: ldr r1, =0x02024084 ldrb r3, [r3] movs r0, 0x58 muls r0, r3 adds r1, 0x50 adds r0, r1 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 bne @080641F6 b @08064324 @080641F6: lsrs r1, r3, 1 ldr r0, [r2] adds r1, r0 adds r1, 0xC6 ldrb r0, [r1] orrs r0, r4 strb r0, [r1] b @08064066 .align 2, 0 .pool @08064214: ldr r4, =0x02024064 ldrb r0, [r4] lsrs r0, 1 ldr r3, =0x0202449c ldr r1, [r3] adds r0, r1 adds r0, 0xC6 movs r1, 0 strb r1, [r0] ldr r1, =0x020242bc ldrb r2, [r4] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x16] cmp r0, 0 beq @08064324 ldrb r1, [r5] movs r6, 0xF adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @08064254 lsrs r2, 1 ldr r0, [r3] adds r2, r0 adds r2, 0xC6 ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] @08064254: ldrb r1, [r5, 0x1] movs r7, 0xF0 adds r0, r7, 0 ands r0, r1 cmp r0, 0 beq @08064272 ldrb r0, [r4] lsrs r0, 1 ldr r1, [r3] adds r0, r1 adds r0, 0xC6 ldrb r1, [r0] movs r2, 0x2 orrs r1, r2 strb r1, [r0] @08064272: ldrb r1, [r5, 0x1] adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @0806428E ldrb r0, [r4] lsrs r0, 1 ldr r1, [r3] adds r0, r1 adds r0, 0xC6 ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @0806428E: ldrb r1, [r5, 0x2] adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @080642AA ldrb r0, [r4] lsrs r0, 1 ldr r1, [r3] adds r0, r1 adds r0, 0xC6 ldrb r1, [r0] movs r2, 0x8 orrs r1, r2 strb r1, [r0] @080642AA: ldrb r1, [r5, 0x2] adds r0, r7, 0 ands r0, r1 cmp r0, 0 beq @080642C6 ldrb r0, [r4] lsrs r0, 1 ldr r1, [r3] adds r0, r1 adds r0, 0xC6 ldrb r1, [r0] movs r2, 0x20 orrs r1, r2 strb r1, [r0] @080642C6: ldrb r1, [r5] movs r0, 0x30 ands r0, r1 cmp r0, 0 bne @080642D2 b @08064066 @080642D2: ldrb r0, [r4] lsrs r0, 1 ldr r1, [r3] adds r0, r1 adds r0, 0xC6 ldrb r1, [r0] movs r2, 0x80 orrs r1, r2 strb r1, [r0] b @08064066 .align 2, 0 .pool @080642F4: ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x020242bc ldrb r1, [r4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x16] cmp r0, 0 beq @08064324 ldr r0, =0x02024294 lsls r1, r3, 1 adds r1, r3 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x4] cmp r0, 0 bne @08064324 b @08064066 @08064324: cmp r7, 0 beq @08064370 @08064328: movs r0, 0x1 movs r1, 0x1 movs r2, 0 bl dp01_build_cmdbuf_x21_a_bb ldr r0, =0x02024064 ldrb r0, [r0] lsrs r0, 1 ldr r1, =0x0202449c ldr r1, [r1] lsls r0, 1 adds r0, r1 adds r0, 0xC0 mov r1, r9 strb r1, [r0] ldr r0, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x18] adds r0, 0x48 ldr r2, [sp] adds r0, r2 movs r1, 0 strh r1, [r0] adds r0, r7, 0 b @0806437E .align 2, 0 .pool @08064370: movs r0, 0x1 add r8, r0 mov r1, r8 cmp r1, 0x3 bgt @0806437C b @08063F72 @0806437C: movs r0, 0 @0806437E: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8063EE0 thumb_func_start nullsub_28 nullsub_28: ; 8064390 bx lr thumb_func_end nullsub_28 thumb_func_start sub_8064394 sub_8064394: ; 8064394 ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_80643B0 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8064394 thumb_func_start sub_80643B0 sub_80643B0: ; 80643B0 push {lr} ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @080643FC ldr r0, =0x02023064 lsls r1, r3, 9 adds r1, r0 ldrb r0, [r1] cmp r0, 0x38 bhi @080643F8 ldr r0, =gUnknown_0831C7B4 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 b @080643FC .align 2, 0 .pool @080643F8: bl sub_8065068 @080643FC: pop {r0} bx r0 thumb_func_end sub_80643B0 thumb_func_start sub_8064400 sub_8064400: ; 8064400 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08064424 bl sub_8065068 @08064424: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8064400 thumb_func_start sub_8064438 sub_8064438: ; 8064438 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0806445C bl sub_8065068 @0806445C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8064438 thumb_func_start sub_8064470 sub_8064470: ; 8064470 push {r4-r6,lr} ldr r5, =0x02020630 ldr r6, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r2, r0, 2 adds r0, r5, 0 adds r0, 0x1C adds r0, r2, r0 ldr r1, [r0] ldr r0, =nullsub_12 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 .pool thumb_func_end sub_8064470 thumb_func_start sub_80644D8 sub_80644D8: ; 80644D8 push {r4,lr} ldr r4, =0x020244d0 ldr r1, [r4] ldr r3, =0x02024064 ldrb r0, [r3] ldr r2, [r1, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x9] subs r0, 0x1 strb r0, [r1, 0x9] lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @08064510 ldr r0, [r4] ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x9] bl sub_8065068 @08064510: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80644D8 thumb_func_start sub_8064520 sub_8064520: ; 8064520 push {r4-r7,lr} mov r7, r8 push {r7} movs r0, 0 mov r8, r0 movs r4, 0 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0806454C bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08064584 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08064584 @0806454C: ldr r2, =0x02020630 ldr r1, =0x03005d70 ldr r3, =0x02024064 ldrb r0, [r3] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 adds r7, r3, 0 cmp r1, r0 bne @080645C2 b @080645CA .align 2, 0 .pool @08064584: ldr r3, =0x02020630 ldr r6, =0x03005d70 ldr r2, =0x02024064 ldrb r4, [r2] adds r0, r4, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r5, r3, 0 adds r5, 0x1C adds r0, r5 ldr r3, [r0] ldr r0, =nullsub_12 adds r7, r2, 0 cmp r3, r0 bne @080645C0 movs r0, 0x2 eors r4, r0 adds r0, r4, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r0, [r0] cmp r0, r3 bne @080645C0 movs r1, 0x1 mov r8, r1 @080645C0: movs r4, 0x1 @080645C2: mov r0, r8 cmp r0, 0 bne @080645CA b @08064714 @080645CA: cmp r4, 0 bne @080645DE ldrb r1, [r7] movs r0, 0x2 eors r0, r1 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 bne @0806469C @080645DE: ldr r1, =0x020244d0 mov r12, r1 ldr r0, [r1] ldr r7, =0x02024064 ldrb r2, [r7] ldr r3, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r4, r0, r3 ldrb r1, [r4, 0x1] movs r5, 0x1 adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @08064600 b @08064714 @08064600: movs r6, 0x2 adds r1, r6, 0 eors r1, r2 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x1] adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @08064714 ldrb r1, [r4] movs r3, 0x7F adds r0, r3, 0 ands r0, r1 strb r0, [r4] mov r1, r12 ldr r0, [r1] ldrb r2, [r7] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r4, 0x2 negs r4, r4 adds r0, r4, 0 ands r0, r2 strb r0, [r1, 0x1] mov r0, r12 ldr r2, [r0] ldrb r0, [r7] adds r1, r6, 0 eors r1, r0 ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] ands r3, r1 strb r3, [r0] mov r1, r12 ldr r2, [r1] ldrb r0, [r7] adds r1, r6, 0 eors r1, r0 ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] ands r4, r1 strb r4, [r0, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag b @080646F2 .align 2, 0 .pool @0806469C: ldr r3, =0x020244d0 ldr r0, [r3] ldrb r1, [r7] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r2, r0, r2 ldrb r1, [r2, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08064714 ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] ldr r0, [r3] ldrb r2, [r7] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldrb r0, [r7] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bne @080646F2 ldr r4, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag @080646F2: ldr r0, =0x020244d0 ldr r0, [r0] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x9] ldr r1, =0x03005d60 ldrb r0, [r3] lsls r0, 2 adds r0, r1 ldr r1, =sub_80644D8 str r1, [r0] @08064714: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8064520 thumb_func_start sub_8064734 sub_8064734: ; 8064734 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} movs r0, 0 mov r10, r0 ldr r5, =0x020244d0 ldr r0, [r5] ldr r4, =0x02024064 ldrb r2, [r4] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrh r1, [r0] movs r6, 0xC4 lsls r6, 1 adds r0, r6, 0 ands r0, r1 cmp r0, 0 bne @08064776 ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @08064776: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @080647B4 ldr r2, [r5] ldrb r1, [r4] movs r0, 0x2 adds r3, r0, 0 eors r3, r1 ldr r1, [r2, 0x4] lsls r2, r3, 1 adds r0, r2, r3 lsls r0, 2 adds r0, r1 ldrh r1, [r0] adds r0, r6, 0 ands r0, r1 cmp r0, 0 bne @080647B4 ldr r0, =0x0202406e adds r0, r2, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @080647B4: ldr r3, =0x020244d0 ldr r0, [r3] ldr r2, =0x02024064 ldrb r5, [r2] ldr r4, [r0, 0x4] lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r6, r0, r4 ldrb r1, [r6] movs r0, 0x8 mov r12, r0 ands r0, r1 mov r8, r3 mov r9, r2 cmp r0, 0 bne @08064898 movs r7, 0x2 adds r1, r7, 0 eors r1, r5 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0] mov r0, r12 ands r0, r1 cmp r0, 0 bne @08064898 ldrb r1, [r6, 0x1] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0806487A bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0806484A ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @0806484A ldr r4, =0x03005d70 mov r1, r9 ldrb r0, [r1] adds r1, r7, 0 eors r1, r0 adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe mov r1, r9 ldrb r0, [r1] eors r0, r7 bl sub_8076918 mov r1, r9 ldrb r0, [r1] eors r0, r7 adds r0, r4 ldrb r0, [r0] bl sub_80729D0 @0806484A: ldr r5, =0x03005d70 ldr r4, =0x02024064 ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r4] bl sub_8076918 ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 @0806487A: ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x80 orrs r1, r2 strb r1, [r0, 0x1] mov r8, r4 mov r9, r3 @08064898: mov r1, r8 ldr r0, [r1] mov r1, r9 ldrb r2, [r1] ldr r3, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x1] movs r0, 0xC0 ands r0, r1 cmp r0, 0x80 bne @0806495A movs r1, 0x2 eors r1, r2 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x1] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0806495A bl sub_80A36C8 lsls r0, 24 cmp r0, 0 bne @0806495A mov r1, r8 ldr r0, [r1] mov r1, r9 ldrb r2, [r1] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x1] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0806493C ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x42 ands r0, r1 cmp r0, 0x42 bne @08064930 adds r0, r2, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0806493C ldr r0, =0x03007420 bl m4aMPlayContinue b @0806493C .align 2, 0 .pool @08064930: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl @0806493C: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x1] movs r0, 0x1 mov r10, r0 @0806495A: mov r1, r10 cmp r1, 0 bne @08064962 b @08064AC0 @08064962: ldr r2, =0x02020630 ldr r0, =0x03005d7c ldr r5, =0x02024064 ldrb r3, [r5] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r4, [r0] ldr r0, =nullsub_12 cmp r4, r0 beq @08064982 b @08064AC0 @08064982: ldr r0, =0x020241e4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r0, [r0] cmp r0, r4 beq @08064998 b @08064AC0 @08064998: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @080649E2 adds r0, r3, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bne @080649E2 ldr r3, =0x020244d0 ldr r0, [r3] ldrb r2, [r5] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x9] adds r0, 0x1 strb r0, [r1, 0x9] lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08064AC0 ldr r0, [r3] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x9] @080649E2: bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08064A3A ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @08064A3A ldr r1, =0x03005d7c ldr r5, =0x02024064 ldrb r0, [r5] movs r4, 0x2 eors r0, r4 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldrb r0, [r5] eors r4, r0 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_805EE54 @08064A3A: ldr r1, =0x03005d7c ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldrb r5, [r4] ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r5, 0 bl sub_805EE54 ldr r3, =0x020244d0 ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r1, [r2, 0x9] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2, 0x9] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x21 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x7F ands r0, r2 strb r0, [r1, 0x1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064520 str r1, [r0] @08064AC0: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8064734 thumb_func_start sub_8064B04 sub_8064B04: ; 8064B04 push {r4-r7,lr} ldr r4, =0x02020630 ldr r0, =0x020241e4 ldr r7, =0x02024064 ldrb r3, [r7] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r2, r0, 2 adds r0, r4, 0 adds r0, 0x1C adds r0, r2, r0 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08064BB6 adds r0, r2, r4 movs r1, 0x24 ldrsh r0, [r0, r1] cmp r0, 0 bne @08064BB6 ldr r6, =0x020244d0 ldr r0, [r6] ldr r1, [r0, 0x4] lsls r4, r3, 1 adds r0, r4, r3 lsls r0, 2 adds r2, r0, r1 ldrb r5, [r2] movs r0, 0x80 ands r0, r5 cmp r0, 0 bne @08064B7C ldr r0, =0x0202406e adds r0, r4, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 b @08064BB6 .align 2, 0 .pool @08064B7C: ldrb r1, [r2, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08064BB6 movs r0, 0x7F ands r0, r5 strb r0, [r2] ldr r0, [r6] ldrb r2, [r7] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 bl 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 .pool thumb_func_end sub_8064B04 thumb_func_start sub_8064BC0 sub_8064BC0: ; 8064BC0 push {r4-r6,lr} ldr r6, =0x02024064 ldrb r0, [r6] ldr r5, =0x03005d70 adds r1, r0, r5 ldrb r1, [r1] movs r2, 0 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r6] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 lsls r4, 16 asrs r1, r4, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08064C08 ldrb r0, [r6] adds r0, r5 ldrb r0, [r0] movs r2, 0 bl heathbar_draw_hp b @08064C0C .align 2, 0 .pool @08064C08: bl sub_8065068 @08064C0C: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8064BC0 thumb_func_start sub_8064C14 sub_8064C14: ; 8064C14 push {lr} ldr r2, =0x02020630 ldr r0, =0x020241e4 ldr r1, =0x02024064 ldrb r3, [r1] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 31 cmp r0, 0 bne @08064C42 ldr r0, =0x03005d70 adds r0, r3, r0 ldrb r0, [r0] bl sub_8072984 bl sub_8065068 @08064C42: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8064C14 thumb_func_start sub_8064C58 sub_8064C58: ; 8064C58 push {r4-r6,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r6, =0x02024064 ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08064CB2 ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldrb r0, [r6] bl sub_805EEE0 ldr r1, =0x03005d70 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl sub_8065068 @08064CB2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r2 movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x20 bne @08064D30 movs r3, 0 movs r0, 0 strh r0, [r4, 0x30] adds r2, r4, 0 adds r2, 0x3E ldrb r1, [r2] subs r0, 0x5 ands r0, r1 strb r0, [r2] ldr r0, =0x020244b9 strb r3, [r0] bl sub_8065068 b @08064D5A .align 2, 0 .pool @08064D30: ldrh r0, [r4, 0x30] movs r1, 0x3 ands r0, r1 cmp r0, 0 bne @08064D54 adds r3, r4, 0 adds r3, 0x3E ldrb r2, [r3] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r0, 0x5 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] @08064D54: ldrh r0, [r4, 0x30] adds r0, 0x1 strh r0, [r4, 0x30] @08064D5A: pop {r4} pop {r0} bx r0 thumb_func_end sub_8064CE4 thumb_func_start sub_8064D60 sub_8064D60: ; 8064D60 push {r4,lr} ldr r2, =0x02020630 ldr r0, =0x03005d70 ldr r4, =0x02024064 ldrb r3, [r4] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08064DAC ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r3, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08064DA0 adds r0, r3, 0 adds r1, r3, 0 adds r2, r3, 0 movs r3, 0x6 bl move_anim_start_t4 @08064DA0: ldr r0, =0x03005d60 ldrb r1, [r4] lsls r1, 2 adds r1, r0 ldr r0, =sub_8064DD0 str r0, [r1] @08064DAC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8064D60 thumb_func_start sub_8064DD0 sub_8064DD0: ; 8064DD0 push {r4,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r4, =0x02024064 ldrb r1, [r4] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08064E2A bl sub_80A36C8 lsls r0, 24 cmp r0, 0 bne @08064E2A ldr r2, =0x02020630 ldr r1, =0x020241e4 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @08064E1A ldr r0, =nullsub_18 cmp r1, r0 bne @08064E2A @08064E1A: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl bl sub_8065068 @08064E2A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8064DD0 thumb_func_start sub_8064E50 sub_8064E50: ; 8064E50 push {r4-r7,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r1, [r3, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08064F0C ldr r7, =0x02020630 ldr r6, =0x020241e4 adds r0, r2, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r7, 0 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08064F0C ldrb r1, [r3] movs r0, 0x7F ands r0, r1 strb r0, [r3] ldr r0, [r4] ldrb r2, [r5] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 bl 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, =0x03005d70 ldrb r1, [r5] adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r5] bl sub_8076918 ldrb r0, [r5] adds r0, r4 ldrb r0, [r0] bl sub_80729D0 ldrb r0, [r5] bl sub_805E408 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064D60 str r1, [r0] @08064F0C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8064E50 thumb_func_start sub_8064F40 sub_8064F40: ; 8064F40 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r0, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x88 ands r0, r1 cmp r0, 0 bne @08064F72 ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @08064F72: ldr r4, =0x02020630 ldr r0, =0x03005d7c ldrb r2, [r5] adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r3, r0, 2 adds r0, r4, 0 adds r0, 0x1C adds r0, r3, r0 ldr r1, [r0] ldr r0, =nullsub_12 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, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_805EE54 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064E50 str r1, [r0] @08064FDC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8064F40 thumb_func_start sub_8065008 sub_8065008: ; 8065008 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @0806502A bl sub_8065068 @0806502A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8065008 thumb_func_start sub_8065038 sub_8065038: ; 8065038 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0806505A bl sub_8065068 @0806505A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8065038 thumb_func_start sub_8065068 sub_8065068: ; 8065068 push {r4,lr} sub sp, 0x4 ldr r1, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_80643B0 str r1, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @080650BC bl link_get_multiplayer_id mov r1, sp strb r0, [r1] movs r0, 0x2 movs r1, 0x4 mov r2, sp bl dp01_prepare_buffer_wireless_probably ldr r1, =0x02023064 ldrb r0, [r4] lsls r0, 9 adds r0, r1 movs r1, 0x38 strb r1, [r0] b @080650CE .align 2, 0 .pool @080650BC: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] @080650CE: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8065068 thumb_func_start dp01t_00_2_getattr dp01t_00_2_getattr: ; 80650E0 push {r4-r6,lr} sub sp, 0x100 movs r6, 0 ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @08065118 ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] mov r1, sp bl dp01_getattr_by_ch1_for_opponent_pokemon adds r6, r0, 0 b @0806513A .align 2, 0 .pool @08065118: ldrb r4, [r1] movs r5, 0 @0806511C: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @08065132 lsls r0, r5, 24 lsrs r0, 24 mov r2, sp adds r1, r2, r6 bl dp01_getattr_by_ch1_for_opponent_pokemon adds r6, r0 @08065132: lsrs r4, 1 adds r5, 0x1 cmp r5, 0x5 ble @0806511C @0806513A: lsls r1, r6, 16 lsrs r1, 16 movs r0, 0x1 mov r2, sp bl dp01_build_cmdbuf_x1D_1D_numargs_varargs bl sub_8065068 add sp, 0x100 pop {r4-r6} pop {r0} bx r0 thumb_func_end dp01t_00_2_getattr thumb_func_start dp01_getattr_by_ch1_for_opponent_pokemon dp01_getattr_by_ch1_for_opponent_pokemon: ; 8065154 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x90 adds r7, r1, 0 lsls r0, 24 lsrs r5, r0, 24 movs r6, 0 ldr r2, =0x02023064 ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 9 adds r1, r2, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0x3B bls @0806517E bl @080658EA @0806517E: lsls r0, 2 ldr r1, =@08065194 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08065194: .4byte @08065284 .4byte @080654A8 .4byte @080654B8 .4byte @080654C8 .4byte @08065530 .4byte @08065530 .4byte @08065530 .4byte @08065530 .4byte @0806554C .4byte @08065588 .4byte @08065588 .4byte @08065588 .4byte @08065588 .4byte @080658EA .4byte @080658EA .4byte @080658EA .4byte @080658EA .4byte @080655A4 .4byte @080655B4 .4byte @080655E4 .4byte @080655F4 .4byte @08065604 .4byte @08065614 .4byte @08065624 .4byte @08065634 .4byte @08065644 .4byte @08065654 .4byte @08065664 .4byte @08065674 .4byte @08065684 .4byte @08065694 .4byte @080656A4 .4byte @080656F4 .4byte @08065704 .4byte @08065714 .4byte @08065724 .4byte @08065734 .4byte @08065744 .4byte @08065754 .4byte @08065764 .4byte @08065774 .4byte @080657A8 .4byte @080657B8 .4byte @080657C8 .4byte @080657D8 .4byte @080657E8 .4byte @080657F8 .4byte @08065808 .4byte @08065818 .4byte @08065838 .4byte @08065848 .4byte @08065858 .4byte @08065868 .4byte @08065878 .4byte @08065888 .4byte @08065898 .4byte @080658A8 .4byte @080658B8 .4byte @080658C8 .4byte @080658D8 @08065284: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 add r0, sp, 0x24 mov r9, r0 movs r1, 0x3B add r1, sp mov r10, r1 mov r2, sp adds r2, 0x2B str r2, [sp, 0x80] mov r0, sp adds r0, 0x2A str r0, [sp, 0x7C] mov r1, sp adds r1, 0x68 str r1, [sp, 0x8C] adds r2, 0x5 str r2, [sp, 0x84] adds r0, 0x12 str r0, [sp, 0x88] mov r8, r4 add r4, sp, 0xC @080652D0: adds r1, r6, 0 adds r1, 0xD mov r0, r8 bl pokemon_getattr strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 bl pokemon_getattr mov r2, r9 adds r1, r2, r6 strb r0, [r1] adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @080652D0 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_getattr mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 bl pokemon_getattr ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr mov r3, sp movs r5, 0x1F ands r0, r5 ldrb r2, [r3, 0x14] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr mov r3, sp movs r6, 0x1F ands r0, r6 lsls r0, 5 ldrh r2, [r3, 0x14] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 2 ldrb r2, [r3, 0x15] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [sp, 0x14] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr mov r3, sp ands r0, r6 lsls r0, 4 ldrh r2, [r3, 0x16] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 1 ldrb r2, [r3, 0x17] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C bl pokemon_getattr mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D bl pokemon_getattr mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E bl pokemon_getattr mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F bl pokemon_getattr mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr mov r3, sp movs r1, 0x1 ands r0, r1 lsls r0, 6 ldrb r2, [r3, 0x17] movs r1, 0x41 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] bl pokemon_getattr ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] bl 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 .pool @080654A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB b @08065822 .align 2, 0 .pool @080654B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xC b @08065822 .align 2, 0 .pool @080654C8: movs r6, 0 add r2, sp, 0x58 mov r9, r2 add r0, sp, 0x60 mov r10, r0 movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x02024744 adds r4, r1, r0 mov r8, r9 @080654DE: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 bl pokemon_getattr mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 bl pokemon_getattr mov r2, r10 adds r1, r2, r6 strb r0, [r1] movs r0, 0x2 add r8, r0 adds r6, 0x1 cmp r6, 0x3 ble @080654DE movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x15 bl pokemon_getattr mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 movs r6, 0 @0806551C: adds r0, r7, r6 adds r1, r2, r6 ldrb r1, [r1] strb r1, [r0] adds r6, 0x1 cmp r6, 0xF bls @0806551C b @080658EA .align 2, 0 .pool @08065530: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x9 b @08065822 .align 2, 0 .pool @0806554C: movs r6, 0 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r2, =0x02024744 mov r8, r2 @08065558: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 cmp r6, 0x3 ble @08065558 movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x15 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 b @080658EA .align 2, 0 .pool @08065588: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x8 b @080658E2 .align 2, 0 .pool @080655A4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1 b @080655BE .align 2, 0 .pool @080655B4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x19 @080655BE: bl pokemon_getattr adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF lsls r0, 8 ands r0, r1 lsrs r0, 8 strb r0, [r7, 0x1] movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r0, 16 strb r0, [r7, 0x2] movs r6, 0x3 b @080658EA .align 2, 0 .pool @080655E4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1A b @080658E2 .align 2, 0 .pool @080655F4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1B b @080658E2 .align 2, 0 .pool @08065604: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1C b @080658E2 .align 2, 0 .pool @08065614: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1D b @080658E2 .align 2, 0 .pool @08065624: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1E b @080658E2 .align 2, 0 .pool @08065634: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1F b @080658E2 .align 2, 0 .pool @08065644: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x20 b @080658E2 .align 2, 0 .pool @08065654: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x22 b @080658E2 .align 2, 0 .pool @08065664: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x23 b @080658E2 .align 2, 0 .pool @08065674: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x24 b @080658E2 .align 2, 0 .pool @08065684: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x25 b @080658E2 .align 2, 0 .pool @08065694: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x26 b @080658E2 .align 2, 0 .pool @080656A4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr strb r0, [r7, 0x5] movs r6, 0x6 b @080658EA .align 2, 0 .pool @080656F4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x27 b @080658E2 .align 2, 0 .pool @08065704: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x28 b @080658E2 .align 2, 0 .pool @08065714: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x29 b @080658E2 .align 2, 0 .pool @08065724: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2A b @080658E2 .align 2, 0 .pool @08065734: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2B b @080658E2 .align 2, 0 .pool @08065744: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2C b @080658E2 .align 2, 0 .pool @08065754: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0 b @0806577E .align 2, 0 .pool @08065764: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x9 b @08065822 .align 2, 0 .pool @08065774: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x37 @0806577E: bl pokemon_getattr adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF lsls r0, 8 ands r0, r1 lsrs r0, 8 strb r0, [r7, 0x1] movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r0, 16 strb r0, [r7, 0x2] lsrs r0, r1, 24 strb r0, [r7, 0x3] movs r6, 0x4 b @080658EA .align 2, 0 .pool @080657A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x38 b @080658E2 .align 2, 0 .pool @080657B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x39 b @08065822 .align 2, 0 .pool @080657C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3A b @08065822 .align 2, 0 .pool @080657D8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3B b @08065822 .align 2, 0 .pool @080657E8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3C b @08065822 .align 2, 0 .pool @080657F8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3D b @08065822 .align 2, 0 .pool @08065808: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3E b @08065822 .align 2, 0 .pool @08065818: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3F @08065822: bl pokemon_getattr lsls r0, 16 lsrs r0, 16 strb r0, [r7] lsrs r0, 8 strb r0, [r7, 0x1] movs r6, 0x2 b @080658EA .align 2, 0 .pool @08065838: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x16 b @080658E2 .align 2, 0 .pool @08065848: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x17 b @080658E2 .align 2, 0 .pool @08065858: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x18 b @080658E2 .align 2, 0 .pool @08065868: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x21 b @080658E2 .align 2, 0 .pool @08065878: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2F b @080658E2 .align 2, 0 .pool @08065888: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x30 b @080658E2 .align 2, 0 .pool @08065898: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x32 b @080658E2 .align 2, 0 .pool @080658A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x33 b @080658E2 .align 2, 0 .pool @080658B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x34 b @080658E2 .align 2, 0 .pool @080658C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x35 b @080658E2 .align 2, 0 .pool @080658D8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x36 @080658E2: bl pokemon_getattr strb r0, [r7] movs r6, 0x1 @080658EA: adds r0, r6, 0 add sp, 0x90 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end dp01_getattr_by_ch1_for_opponent_pokemon thumb_func_start sub_8065900 sub_8065900: ; 8065900 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8065900 thumb_func_start sub_806590C sub_806590C: ; 806590C push {r4,r5,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @0806593C ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] bl sub_8065964 b @0806595A .align 2, 0 .pool @0806593C: ldrb r4, [r1] movs r5, 0 @08065940: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @0806594E adds r0, r5, 0 bl sub_8065964 @0806594E: lsrs r4, 1 adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x5 bls @08065940 @0806595A: bl sub_8065068 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_806590C thumb_func_start sub_8065964 sub_8065964: ; 8065964 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x38 lsls r0, 24 lsrs r5, r0, 24 ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 9 ldr r2, =0x02023067 adds r4, r0, r2 adds r7, r4, 0 subs r1, r2, 0x2 adds r0, r1 ldrb r0, [r0] adds r6, r3, 0 adds r3, r2, 0 cmp r0, 0x3B bls @08065992 bl @08066270 @08065992: lsls r0, 2 ldr r1, =@080659A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080659A8: .4byte @08065A98 .4byte @08065C30 .4byte @08065C4C .4byte @08065C68 .4byte @08065CBC .4byte @08065CBC .4byte @08065CBC .4byte @08065CBC .4byte @08065CDC .4byte @08065D44 .4byte @08065D44 .4byte @08065D44 .4byte @08065D44 .4byte @08066270 .4byte @08066270 .4byte @08066270 .4byte @08066270 .4byte @08065D6C .4byte @08065D88 .4byte @08065DA4 .4byte @08065DC0 .4byte @08065DDC .4byte @08065DF8 .4byte @08065E14 .4byte @08065E30 .4byte @08065E4C .4byte @08065E68 .4byte @08065E84 .4byte @08065EA0 .4byte @08065EBC .4byte @08065ED8 .4byte @08065EF4 .4byte @08065F68 .4byte @08065F84 .4byte @08065FA0 .4byte @08065FBC .4byte @08065FD8 .4byte @08065FF4 .4byte @08066010 .4byte @0806602C .4byte @08066048 .4byte @08066064 .4byte @08066080 .4byte @0806609C .4byte @080660B8 .4byte @080660D4 .4byte @080660F0 .4byte @0806610C .4byte @08066128 .4byte @08066144 .4byte @08066160 .4byte @0806617C .4byte @08066198 .4byte @080661B4 .4byte @080661D0 .4byte @080661EC .4byte @08066208 .4byte @08066224 .4byte @08066240 .4byte @0806625C @08065A98: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0xB adds r2, r7, 0 bl pokemon_setattr adds r2, r7, 0 adds r2, 0x2E adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr movs r0, 0 mov r8, r0 movs r0, 0x3B adds r0, r7 mov r10, r0 adds r0, r7, 0 adds r0, 0x2B str r0, [sp, 0x20] adds r0, 0x19 str r0, [sp, 0x28] adds r0, 0x4 str r0, [sp, 0x2C] adds r0, 0x4 str r0, [sp, 0x30] subs r0, 0x22 str r0, [sp, 0x1C] subs r0, 0x2 str r0, [sp, 0x18] adds r0, 0x4 str r0, [sp, 0x24] adds r0, r7, 0x2 str r0, [sp, 0x4] adds r0, r7, 0x4 str r0, [sp, 0x8] adds r0, r7, 0x6 str r0, [sp, 0xC] adds r0, 0x2 str r0, [sp, 0x10] adds r0, 0x2 str r0, [sp, 0x14] mov r9, r4 adds r6, r7, 0 adds r6, 0x24 adds r4, r7, 0 adds r4, 0xC @08065AFE: mov r1, r8 adds r1, 0xD mov r0, r9 adds r2, r4, 0 bl pokemon_setattr mov r1, r8 adds r1, 0x11 mov r0, r9 adds r2, r6, 0 bl pokemon_setattr adds r6, 0x1 adds r4, 0x2 movs r0, 0x1 add r8, r0 mov r0, r8 cmp r0, 0x3 ble @08065AFE movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x15 mov r2, r10 bl pokemon_setattr adds r0, r4, 0 movs r1, 0x20 ldr r2, [sp, 0x20] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x19 ldr r2, [sp, 0x28] bl pokemon_setattr ldrb r0, [r7, 0x14] lsls r0, 27 lsrs r0, 27 mov r1, sp strb r0, [r1] adds r0, r4, 0 movs r1, 0x27 mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r7, 0x14] lsls r0, 22 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x28 mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r7, 0x15] lsls r0, 25 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x29 mov r2, sp bl pokemon_setattr mov r1, sp ldr r0, [r7, 0x14] lsls r0, 12 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2A mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r7, 0x16] lsls r0, 23 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2B mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r7, 0x17] lsls r0, 26 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0 ldr r2, [sp, 0x2C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x37 ldr r2, [sp, 0x30] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 ldr r2, [sp, 0x1C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 ldr r2, [sp, 0x18] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A ldr r2, [sp, 0x24] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3B ldr r2, [sp, 0x4] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C ldr r2, [sp, 0x8] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D ldr r2, [sp, 0xC] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E ldr r2, [sp, 0x10] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F ldr r2, [sp, 0x14] bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065C30: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0xB bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065C4C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0xC bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065C68: movs r0, 0 mov r8, r0 movs r0, 0xC adds r0, r4 mov r9, r0 movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x02024744 adds r7, r1, r0 adds r6, r4, 0 adds r6, 0x8 @08065C80: mov r1, r8 adds r1, 0xD adds r0, r7, 0 adds r2, r4, 0 bl pokemon_setattr mov r1, r8 adds r1, 0x11 adds r0, r7, 0 adds r2, r6, 0 bl pokemon_setattr adds r6, 0x1 adds r4, 0x2 movs r0, 0x1 add r8, r0 mov r0, r8 cmp r0, 0x3 ble @08065C80 movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x15 mov r2, r9 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065CBC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldr r3, =0x02023064 ldrb r2, [r6] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x9 b @08065D5A .align 2, 0 .pool @08065CDC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 ldrb r2, [r6] lsls r2, 9 adds r2, r3 adds r0, r4, 0 movs r1, 0x11 str r3, [sp, 0x34] bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x12 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x13 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x14 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065D44: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldr r3, =0x02023064 ldrb r2, [r6] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x8 @08065D5A: adds r3, 0x3 adds r2, r3 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065D6C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065D88: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x19 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065DA4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1A bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065DC0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1B bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065DDC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1C bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065DF8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1D bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065E14: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1E bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065E30: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1F bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065E4C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x20 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065E68: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x22 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065E84: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x23 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065EA0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x24 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065EBC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x25 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065ED8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x26 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065EF4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 ldrb r2, [r6] lsls r2, 9 adds r2, r3 adds r0, r4, 0 movs r1, 0x27 str r3, [sp, 0x34] bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x28 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x29 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x2A bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x2B bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x5 adds r2, r0 adds r0, r4, 0 b @08066002 .align 2, 0 .pool @08065F68: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x27 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065F84: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x28 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065FA0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x29 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065FBC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x2A bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065FD8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x2B bl pokemon_setattr b @08066270 .align 2, 0 .pool @08065FF4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 @08066002: movs r1, 0x2C bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066010: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0 bl pokemon_setattr b @08066270 .align 2, 0 .pool @0806602C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x9 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066048: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x37 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066064: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x38 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066080: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x39 bl pokemon_setattr b @08066270 .align 2, 0 .pool @0806609C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3A bl pokemon_setattr b @08066270 .align 2, 0 .pool @080660B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3B bl pokemon_setattr b @08066270 .align 2, 0 .pool @080660D4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3C bl pokemon_setattr b @08066270 .align 2, 0 .pool @080660F0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3D bl pokemon_setattr b @08066270 .align 2, 0 .pool @0806610C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3E bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066128: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3F bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066144: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x16 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066160: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x17 bl pokemon_setattr b @08066270 .align 2, 0 .pool @0806617C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x18 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066198: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x21 bl pokemon_setattr b @08066270 .align 2, 0 .pool @080661B4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x2F bl pokemon_setattr b @08066270 .align 2, 0 .pool @080661D0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x30 bl pokemon_setattr b @08066270 .align 2, 0 .pool @080661EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x32 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066208: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x33 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066224: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x34 bl pokemon_setattr b @08066270 .align 2, 0 .pool @08066240: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x35 bl pokemon_setattr b @08066270 .align 2, 0 .pool @0806625C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x36 bl pokemon_setattr @08066270: add sp, 0x38 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8065964 thumb_func_start sub_8066284 sub_8066284: ; 8066284 push {r4-r7,lr} ldr r1, =0x0202406e ldr r7, =0x02024064 ldrb r2, [r7] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 adds r3, r1, 0 muls r3, r0 ldr r4, =0x02023064 lsls r2, 9 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] ldr r1, =0x02024744 adds r0, r1 adds r5, r3, r0 movs r3, 0 adds r0, r4, 0x2 adds r2, r0 ldrb r2, [r2] cmp r3, r2 bcs @080662DC adds r6, r4, 0 adds r2, r7, 0 adds r4, r0, 0 @080662BA: adds r1, r5, r3 ldrb r0, [r2] lsls r0, 9 adds r0, 0x3 adds r0, r3, r0 adds r0, r6 ldrb r0, [r0] strb r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 ldrb r0, [r2] lsls r0, 9 adds r0, r4 ldrb r0, [r0] cmp r3, r0 bcc @080662BA @080662DC: bl sub_8065068 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8066284 thumb_func_start sub_80662F8 sub_80662F8: ; 80662F8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r7, =0x0202406e ldr r6, =0x02024064 ldrb r0, [r6] lsls r0, 1 adds r0, r7 ldrh r0, [r0] movs r1, 0x64 mov r10, r1 mov r2, r10 muls r2, r0 adds r0, r2, 0 ldr r1, =0x02024744 mov r9, r1 add r0, r9 movs r1, 0xB bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r1, [r6] lsls r0, r1, 1 adds r0, r7 ldrh r0, [r0] mov r2, r10 muls r2, r0 adds r0, r2, 0 add r0, r9 bl sub_805DC0C ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_806A068 ldr r0, =0x0202499c mov r8, r0 ldrb r0, [r6] movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldrb r0, [r6] bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r6] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r8 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 ldrb r1, [r6] adds r1, r4 strb r0, [r1] ldr r5, =0x02020630 ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ff10 strh r1, [r0, 0x24] ldrb r2, [r6] adds r0, r2, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x2E] ldrb r3, [r6] adds r0, r3, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r2, [r6] adds r4, r2, r4 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r2, r1 ldrb r1, [r2] bl 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, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064B04 str r1, [r0] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80662F8 thumb_func_start sub_8066448 sub_8066448: ; 8066448 push {r4,lr} ldr r1, =0x0202406e ldr r4, =0x02024064 ldrb r0, [r4] lsls r2, r0, 1 adds r2, r1 ldr r3, =0x02023064 lsls r0, 9 adds r1, r3, 0x1 adds r0, r1 ldrb r0, [r0] strh r0, [r2] ldrb r0, [r4] lsls r1, r0, 9 adds r3, 0x2 adds r1, r3 ldrb r1, [r1] bl sub_8066494 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064F40 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8066448 thumb_func_start sub_8066494 sub_8066494: ; 8066494 push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 bl sub_805EF84 ldr r0, =0x0202406e lsls r4, r6, 1 adds r4, r0 ldr r0, =0x02023064 lsls r1, r6, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] strh r0, [r4] ldrh r0, [r4] movs r1, 0x64 mov r9, r1 mov r1, r9 muls r1, r0 adds r0, r1, 0 ldr r5, =0x02024744 adds r0, r5 movs r1, 0xB bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 bl object_new_hidden_with_callback ldr r1, =0x03005d7c mov r10, r1 add r10, r6 mov r1, r10 strb r0, [r1] ldrh r0, [r4] mov r1, r9 muls r1, r0 adds r0, r1, 0 adds r0, r5 adds r1, r6, 0 bl sub_805DC0C adds r0, r6, 0 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_806A068 ldr r0, =0x0202499c mov r9, r0 adds r0, r6, 0 movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r9 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 adds r4, r6, r4 strb r0, [r4] ldr r5, =0x02020630 mov r0, r10 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r4] strh r1, [r0, 0x30] mov r0, r10 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x32] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x2E] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 mov r1, r8 strh r1, [r0, 0x32] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, r6, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r6, r1 ldrb r1, [r6] bl 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, =nullsub_12 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 .pool thumb_func_end sub_8066494 thumb_func_start sub_8066624 sub_8066624: ; 8066624 push {r4-r6,lr} ldr r1, =0x02023064 ldr r6, =0x02024064 ldrb r2, [r6] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r3, [r0] cmp r3, 0 bne @0806666C ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_80666BC str r1, [r0] b @080666A8 .align 2, 0 .pool @0806666C: ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldrb r0, [r6] bl sub_805EEE0 ldr r1, =0x03005d70 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl sub_8065068 @080666A8: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8066624 thumb_func_start sub_80666BC sub_80666BC: ; 80666BC push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r4, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r0, [r3, 0x4] cmp r0, 0 beq @080666E4 cmp r0, 0x1 beq @08066712 b @0806673A .align 2, 0 .pool @080666E4: ldr r1, [r4] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080666FE adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @080666FE: ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strb r1, [r0, 0x4] b @0806673A @08066712: ldrb r1, [r3] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @0806673A strb r0, [r3, 0x4] ldrb r2, [r5] adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x2 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064C58 str r1, [r0] @0806673A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80666BC thumb_func_start sub_8066748 sub_8066748: ; 8066748 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r4, =0x02022fec ldr r0, [r4] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08066840 ldr r5, =0x02024064 ldrb r0, [r5] bl battle_get_per_side_status movs r1, 0x2 ands r1, r0 movs r7, 0xC8 cmp r1, 0 beq @08066770 movs r7, 0x98 @08066770: ldr r0, [r4] movs r1, 0x80 lsls r1, 1 ands r0, r1 cmp r0, 0 beq @080667A8 ldrb r0, [r5] cmp r0, 0x1 bne @08066794 ldr r0, =0x02038bca b @08066796 .align 2, 0 .pool @08066794: ldr r0, =0x02038bcc @08066796: ldrh r0, [r0] bl sub_8162AA0 lsls r0, 24 lsrs r0, 24 b @0806694C .align 2, 0 .pool @080667A8: ldrb r0, [r5] bl sub_806D864 ldr r6, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 movs r4, 0xFF ldrb r0, [r1] cmp r0, 0x4 beq @080667D8 ldrb r0, [r5] bl sub_806D864 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrh r1, [r1] adds r0, r4, 0 ands r0, r1 cmp r0, 0x5 bne @080667F4 @080667D8: ldrb r0, [r5] bl sub_806D864 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r1, 0x13] cmp r0, 0 bne @080668AA b @080668BC .align 2, 0 .pool @080667F4: ldrb r0, [r5] bl sub_806D864 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrh r1, [r1] adds r0, r4, 0 ands r0, r1 cmp r0, 0x2 beq @08066822 ldrb r0, [r5] bl sub_806D864 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrh r0, [r1] ands r4, r0 cmp r4, 0x1 bne @08066838 @08066822: ldrb r0, [r5] bl sub_806D864 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r1, 0x13] cmp r0, 0 bne @08066916 b @08066924 @08066838: ldrb r0, [r5] bl sub_806D864 b @0806693A @08066840: movs r7, 0xB0 ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 cmp r1, r0 bne @08066858 bl sub_8068B48 b @08066948 .align 2, 0 .pool @08066858: bl link_get_multiplayer_id ldr r6, =0x020229e8 movs r5, 0x1 eors r0, r5 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 movs r4, 0xFF ldrb r0, [r1] cmp r0, 0x4 beq @08066892 bl link_get_multiplayer_id eors r0, r5 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrh r1, [r1] adds r0, r4, 0 ands r0, r1 cmp r0, 0x5 bne @080668C8 @08066892: bl link_get_multiplayer_id eors r0, r5 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r1, 0x13] cmp r0, 0 beq @080668BC @080668AA: ldr r0, =gUnknown_0831F578 adds r0, 0x4F ldrb r0, [r0] b @0806694C .align 2, 0 .pool @080668BC: ldr r0, =gUnknown_0831F578 adds r0, 0x4E ldrb r0, [r0] b @0806694C .align 2, 0 .pool @080668C8: bl link_get_multiplayer_id eors r0, r5 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrh r1, [r1] adds r0, r4, 0 ands r0, r1 cmp r0, 0x2 beq @080668FE bl link_get_multiplayer_id eors r0, r5 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrh r0, [r1] ands r4, r0 cmp r4, 0x1 bne @08066930 @080668FE: bl link_get_multiplayer_id eors r0, r5 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r1, 0x13] cmp r0, 0 beq @08066924 @08066916: ldr r0, =gUnknown_0831F578 adds r0, 0x51 ldrb r0, [r0] b @0806694C .align 2, 0 .pool @08066924: ldr r0, =gUnknown_0831F578 adds r0, 0x50 ldrb r0, [r0] b @0806694C .align 2, 0 .pool @08066930: bl link_get_multiplayer_id eors r0, r5 lsls r0, 24 lsrs r0, 24 @0806693A: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r1, 0x13] bl sub_806F000 @08066948: lsls r0, 16 lsrs r0, 16 @0806694C: mov r8, r0 ldr r5, =0x02024064 ldrb r1, [r5] bl sub_805DF38 ldrb r0, [r5] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl template_build_for_pokemon_or_trainer ldr r6, =0x0202499c mov r9, r7 ldr r1, =gUnknown_083054E0 mov r2, r8 lsls r0, r2, 2 adds r0, r1 ldrb r0, [r0] movs r4, 0x8 subs r4, r0 lsls r4, 18 movs r0, 0xA0 lsls r0, 14 adds r4, r0 asrs r4, 16 ldrb r0, [r5] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 adds r0, r6, 0 mov r1, r9 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r6, =0x020241e4 ldrb r1, [r5] adds r1, r6 strb r0, [r1] ldr r4, =0x02020630 ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000ff10 strh r1, [r0, 0x24] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x2 strh r1, [r0, 0x2E] ldr r1, =gTrainerPaletteTable 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, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064400 str r1, [r0] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8066748 thumb_func_start sub_8066A58 sub_8066A58: ; 8066A58 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, 0x1 bne @08066A74 ldr r0, =0x02038bca b @08066A76 .align 2, 0 .pool @08066A74: ldr r0, =0x02038bcc @08066A76: ldrh r0, [r0] bl sub_8162AA0 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r6, =0x02024064 ldrb r1, [r6] bl sub_805DF38 ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl template_build_for_pokemon_or_trainer ldr r0, =0x0202499c ldr r2, =gUnknown_083054E0 mov r3, r8 lsls r1, r3, 2 adds r1, r2 ldrb r1, [r1] movs r2, 0x8 subs r2, r1 lsls r2, 18 movs r1, 0xA0 lsls r1, 14 adds r2, r1 asrs r2, 16 movs r1, 0xB0 movs r3, 0x1E bl obj_add_from_template_forward_search ldr r5, =0x020241e4 ldrb r1, [r6] adds r1, r5 strb r0, [r1] ldr r4, =0x02020630 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x60 strh r1, [r0, 0x24] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x20] adds r1, 0x20 strh r1, [r0, 0x20] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldr r1, =gTrainerPaletteTable 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, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064438 str r1, [r0] bl sub_8065068 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8066A58 thumb_func_start sub_8066B94 sub_8066B94: ; 8066B94 push {r4-r6,lr} ldr r6, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 bl oamt_add_pos2_onto_pos1 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x23 strh r1, [r0, 0x2E] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x8C lsls r1, 1 strh r1, [r0, 0x32] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =nullsub_12 bl oamt_set_x3A_32 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064470 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8066B94 thumb_func_start sub_8066C40 sub_8066C40: ; 8066C40 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r0, [r4, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r3, r1, r0 ldrb r0, [r3, 0x4] cmp r0, 0 bne @08066C94 ldr r1, [r4] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08066C74 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @08066C74: ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x4] adds r1, 0x1 strb r1, [r0, 0x4] b @08066CD0 .align 2, 0 .pool @08066C94: ldrb r1, [r3] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08066CD0 strb r0, [r3, 0x4] movs r0, 0x10 movs r1, 0x3F bl audio_play_and_stuff ldr r2, =0x02020630 ldr r1, =0x020241e4 ldrb r0, [r5] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039934 str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064C14 str r1, [r0] @08066CD0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8066C40 thumb_func_start sub_8066CEC sub_8066CEC: ; 8066CEC push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8066CEC thumb_func_start sub_8066CF8 sub_8066CF8: ; 8066CF8 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8066CF8 thumb_func_start sub_8066D04 sub_8066D04: ; 8066D04 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8066D04 thumb_func_start sub_8066D10 sub_8066D10: ; 8066D10 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8066D10 thumb_func_start sub_8066D1C sub_8066D1C: ; 8066D1C push {r4-r7,lr} mov r7, r8 push {r7} ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 beq @08066D32 b @08066E58 @08066D32: ldr r0, =0x02023064 mov r12, r0 ldrb r1, [r5] lsls r1, 9 adds r0, 0x1 adds r0, r1, r0 ldrb r6, [r0] mov r0, r12 adds r0, 0x2 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 8 orrs r6, r0 ldr r0, =0x02038432 mov r8, r0 mov r0, r12 adds r0, 0x3 adds r1, r0 ldrb r0, [r1] mov r1, r8 strb r0, [r1] ldr r3, =0x02038408 ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0x4 adds r0, r1, r0 ldrb r2, [r0] mov r0, r12 adds r0, 0x5 adds r1, r0 ldrb r0, [r1] lsls r0, 8 orrs r2, r0 strh r2, [r3] ldr r3, =0x02038404 ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0x6 adds r0, r1, r0 ldrb r2, [r0] mov r0, r12 adds r0, 0x7 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 8 orrs r2, r0 mov r0, r12 adds r0, 0x8 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 16 orrs r2, r0 mov r0, r12 adds r0, 0x9 adds r1, r0 ldrb r0, [r1] lsls r0, 24 orrs r2, r0 str r2, [r3] ldr r2, =0x0203841a ldrb r0, [r5] lsls r0, 9 mov r1, r12 adds r1, 0xA adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r4, =0x0203841c ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0xC adds r0, r1, r0 ldrb r2, [r0] mov r0, r12 adds r0, 0xD adds r1, r0 ldrb r0, [r1] lsls r0, 8 orrs r2, r0 strh r2, [r4] ldr r7, =0x02038400 ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0x10 adds r1, r0 str r1, [r7] ldr r2, =0x020244bc ldrb r0, [r5] lsls r0, 2 adds r0, r2 ldr r1, [r1] str r1, [r0] mov r0, r8 ldrb r1, [r0] adds r0, r6, 0 bl sub_805DB8C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @08066E30 bl sub_8065068 b @08066E58 .align 2, 0 .pool @08066E30: ldr r0, =0x020244d0 ldr r0, [r0] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8066E70 str r1, [r0] ldrh r1, [r4] ldr r2, [r7] adds r0, r6, 0 bl sub_817E0FC @08066E58: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8066D1C thumb_func_start sub_8066E70 sub_8066E70: ; 8066E70 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r2, =0x02023064 ldr r6, =0x02024064 ldrb r3, [r6] lsls r1, r3, 9 adds r0, r2, 0x1 mov r10, r0 adds r0, r1, r0 ldrb r4, [r0] adds r5, r2, 0x2 mov r9, r5 adds r0, r1, r5 ldrb r0, [r0] lsls r0, 8 orrs r4, r0 adds r2, 0xB adds r1, r2 ldrb r1, [r1] mov r8, r1 ldr r7, =0x020244d0 ldr r5, [r7] ldr r1, [r5, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x4] cmp r2, 0x1 beq @08066F08 cmp r2, 0x1 bgt @08066EC8 cmp r2, 0 beq @08066ED2 b @08066FE4 .align 2, 0 .pool @08066EC8: cmp r2, 0x2 beq @08066F32 cmp r2, 0x3 beq @08066FA8 b @08066FE4 @08066ED2: ldr r1, [r5] lsls r0, r3, 2 adds r1, r0, r1 ldrb r2, [r1] movs r0, 0xC ands r0, r2 cmp r0, 0x4 bne @08066EF4 movs r0, 0x8 orrs r0, r2 strb r0, [r1] ldrb r2, [r6] adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @08066EF4: ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strb r1, [r0, 0x4] b @08066FE4 @08066F08: ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08066FE4 movs r0, 0 bl sub_805EB9C adds r0, r4, 0 bl move_anim_start_t1 ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x2 strb r1, [r0, 0x4] b @08066FE4 @08066F32: ldr r0, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd ldrb r0, [r0] cmp r0, 0 bne @08066FE4 movs r0, 0x1 bl sub_805EB9C ldr r0, [r7] ldrb r2, [r6] ldr r1, [r0] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08066F80 mov r0, r8 cmp r0, 0x1 bhi @08066F80 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x6 bl move_anim_start_t4 ldr r0, [r7] ldrb r1, [r6] ldr r0, [r0] lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] @08066F80: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x4] b @08066FE4 .align 2, 0 .pool @08066FA8: ldrb r1, [r0] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @08066FE4 bl sub_805E394 ldrb r0, [r6] lsls r2, r0, 9 mov r3, r10 adds r1, r2, r3 ldrb r1, [r1] add r2, r9 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 bl sub_805E94C ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r4, [r0, 0x4] bl sub_8065068 @08066FE4: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8066E70 thumb_func_start sub_8066FF4 sub_8066FF4: ; 8066FF4 push {r4,r5,lr} ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r5, =0x02024064 ldrb r4, [r5] lsls r4, 9 ldr r0, =0x02023066 adds r4, r0 ldrh r0, [r4] bl battle_pick_message ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064CCC str r1, [r0] ldrh r0, [r4] bl sub_817C95C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8066FF4 thumb_func_start sub_806704C sub_806704C: ; 806704C push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_806704C thumb_func_start sub_8067058 sub_8067058: ; 8067058 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8067058 thumb_func_start sub_8067064 sub_8067064: ; 8067064 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8067064 thumb_func_start sub_8067070 sub_8067070: ; 8067070 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8067070 thumb_func_start sub_806707C sub_806707C: ; 806707C push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_806707C thumb_func_start sub_8067088 sub_8067088: ; 8067088 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8067088 thumb_func_start sub_8067094 sub_8067094: ; 8067094 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8067094 thumb_func_start sub_80670A0 sub_80670A0: ; 80670A0 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 movs r0, 0 bl load_gfxc_health_bar ldr r3, =0x02023064 ldr r0, =0x02024064 mov r9, r0 ldrb r4, [r0] lsls r2, r4, 9 adds r0, r3, 0x2 adds r0, r2, r0 ldrb r1, [r0] adds r3, 0x3 adds r2, r3 ldrb r0, [r2] lsls r0, 8 orrs r1, r0 lsls r1, 16 asrs r7, r1, 16 ldr r0, =0x00007fff cmp r7, r0 beq @08067130 ldr r6, =0x0202406e lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x02024744 adds r0, r4 movs r1, 0x3A bl pokemon_getattr mov r8, r0 mov r1, r9 ldrb r0, [r1] lsls r0, 1 adds r0, r6 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] mov r2, r8 bl sub_807294C b @0806715A .align 2, 0 .pool @08067130: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3A bl pokemon_getattr adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] movs r3, 0 bl sub_807294C @0806715A: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064BC0 str r1, [r0] add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80670A0 thumb_func_start sub_8067190 sub_8067190: ; 8067190 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8067190 thumb_func_start sub_806719C sub_806719C: ; 806719C push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @080671F0 ldr r0, =0x03005d70 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe ldrb r2, [r4] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8065008 str r1, [r0] @080671F0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806719C thumb_func_start sub_8067214 sub_8067214: ; 8067214 push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @08067264 ldr r4, =0x02023064 ldrb r3, [r5] lsls r3, 9 adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] adds r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 adds r2, r4, 0x4 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 16 orrs r1, r2 adds r4, 0x5 adds r3, r4 ldrb r2, [r3] lsls r2, 24 orrs r1, r2 bl move_anim_start_t2_for_situation ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8065008 str r1, [r0] @08067264: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8067214 thumb_func_start sub_806727C sub_806727C: ; 806727C push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_806727C thumb_func_start sub_8067288 sub_8067288: ; 8067288 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8067288 thumb_func_start sub_8067294 sub_8067294: ; 8067294 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_8067294 thumb_func_start sub_80672A0 sub_80672A0: ; 80672A0 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_80672A0 thumb_func_start sub_80672AC sub_80672AC: ; 80672AC push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_80672AC thumb_func_start sub_80672B8 sub_80672B8: ; 80672B8 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_80672B8 thumb_func_start sub_80672C4 sub_80672C4: ; 80672C4 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_80672C4 thumb_func_start sub_80672D0 sub_80672D0: ; 80672D0 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_80672D0 thumb_func_start sub_80672DC sub_80672DC: ; 80672DC push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_80672DC thumb_func_start sub_80672E8 sub_80672E8: ; 80672E8 push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x80 negs r0, r0 ands r0, r1 strb r0, [r2] bl sub_8065068 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80672E8 thumb_func_start sub_8067304 sub_8067304: ; 8067304 push {lr} ldr r3, =0x02022d0c ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] movs r1, 0x7F ands r1, r0 ldrb r2, [r3] movs r0, 0x80 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] bl sub_8065068 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8067304 thumb_func_start sub_806733C sub_806733C: ; 806733C push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] bl sub_8065068 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806733C thumb_func_start sub_8067354 sub_8067354: ; 8067354 push {lr} ldr r3, =0x02022d0c ldr r1, [r3] lsls r1, 24 lsrs r1, 31 movs r0, 0x1 eors r1, r0 lsls r1, 7 ldrb r2, [r3] movs r0, 0x7F ands r0, r2 orrs r0, r1 strb r0, [r3] bl sub_8065068 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8067354 thumb_func_start sub_806737C sub_806737C: ; 806737C push {r4,lr} ldr r3, =0x02020630 ldr r2, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @080673B0 bl sub_8065068 b @080673DA .align 2, 0 .pool @080673B0: ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0 strh r1, [r0, 0x30] ldrb r0, [r4] bl sub_80769F4 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064CE4 str r1, [r0] @080673DA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806737C thumb_func_start sub_80673EC sub_80673EC: ; 80673EC push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_80673EC thumb_func_start sub_80673F8 sub_80673F8: ; 80673F8 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 movs r3, 0x3F cmp r0, 0 bne @0806740C movs r3, 0xC0 @0806740C: ldr r2, =0x02023064 ldrb r1, [r4] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 lsls r1, r3, 24 asrs r1, 24 bl audio_play_and_stuff bl sub_8065068 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80673F8 thumb_func_start sub_806743C sub_806743C: ; 806743C push {r4,r5,lr} ldr r4, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r3, r0, 9 adds r0, r4, 0x3 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @08067478 bl sub_805EA60 ldrb r1, [r5] lsls r1, 9 adds r0, r4, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, r4, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl song_play_for_text b @0806748C .align 2, 0 .pool @08067478: adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl fanfare_play @0806748C: bl sub_8065068 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_806743C thumb_func_start sub_8067498 sub_8067498: ; 8067498 push {lr} ldr r1, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 movs r1, 0x19 movs r2, 0x5 bl sub_80A32E4 bl sub_8065068 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8067498 thumb_func_start sub_80674D4 sub_80674D4: ; 80674D4 push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] bl battle_intro_launch ldr r2, =0x020243fc ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] bl sub_8065068 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80674D4 thumb_func_start sub_8067508 sub_8067508: ; 8067508 push {r4-r6,lr} ldr r5, =0x020241e4 ldr r6, =0x02024064 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl oamt_add_pos2_onto_pos1 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x23 strh r1, [r0, 0x2E] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x8C lsls r1, 1 strh r1, [r0, 0x32] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =sub_80676FC bl oamt_set_x3A_32 ldr r0, =c3_08038DC4 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r4, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r4 ldrb r0, [r6] strh r0, [r1, 0x8] ldr r3, =0x020244d0 ldr r0, [r3] ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080675CA ldr r0, =0x020244b4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r4 ldr r1, =sub_8073C30 str r1, [r0] @080675CA: ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r0, [r2, 0x9] movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_28 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8067508 thumb_func_start c3_08038DC4 c3_08038DC4: ; 8067618 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r7, =0x02024064 ldrb r0, [r7] mov r9, r0 ldr r1, =0x03005e00 mov r2, r8 lsls r0, r2, 2 add r0, r8 lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x8] strb r0, [r7] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08067652 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08067684 @08067652: ldr r0, =0x02023064 ldrb r1, [r7] lsls r2, r1, 9 adds r0, 0x1 adds r2, r0 ldr r0, =0x0202406e lsls r1, 1 adds r1, r0 ldrh r0, [r1] strb r0, [r2] ldrb r0, [r7] movs r1, 0 bl sub_8066494 b @080676C4 .align 2, 0 .pool @08067684: ldr r4, =0x02023064 ldrb r0, [r7] lsls r1, r0, 9 adds r4, 0x1 adds r1, r4 ldr r6, =0x0202406e lsls r0, 1 adds r0, r6 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r7] movs r1, 0 bl sub_8066494 ldrb r0, [r7] movs r5, 0x2 eors r0, r5 strb r0, [r7] ldrb r0, [r7] lsls r1, r0, 9 adds r1, r4 lsls r0, 1 adds r0, r6 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r7] movs r1, 0 bl sub_8066494 ldrb r0, [r7] eors r0, r5 strb r0, [r7] @080676C4: ldr r1, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_8064734 str r1, [r0] mov r0, r9 strb r0, [r2] mov r0, r8 bl remove_task pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c3_08038DC4 thumb_func_start sub_80676FC sub_80676FC: ; 80676FC push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x6] bl sub_805DFE4 adds r0, r4, 0 bl obj_free_rotscale_entry adds r0, r4, 0 bl 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, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @08067748 adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08067748 bl sub_8065068 b @08067812 .align 2, 0 .pool @08067748: ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] ldr r1, =0x02023064 ldrb r2, [r3] lsls r0, r2, 9 adds r1, 0x2 adds r0, r1 ldrb r0, [r0] adds r7, r3, 0 cmp r0, 0 beq @080677B4 ldr r0, [r4] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r2, [r3, 0x1] lsls r1, r2, 27 lsrs r0, r1, 28 cmp r0, 0x1 bhi @080677AC adds r0, 0x1 movs r1, 0xF ands r0, r1 lsls r0, 1 movs r1, 0x1F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x1] b @08067812 .align 2, 0 .pool @080677AC: movs r0, 0x1F negs r0, r0 ands r0, r2 strb r0, [r3, 0x1] @080677B4: adds r5, r7, 0 ldrb r0, [r5] lsls r3, r0, 9 ldr r4, =0x02023068 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] subs r4, 0x2 adds r3, r4 ldrb r3, [r3] bl sub_80735DC ldr r2, =0x020244b4 ldrb r1, [r5] adds r1, r2 movs r3, 0 strb r0, [r1] ldr r6, =0x020244d0 ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x5] ldrb r2, [r5] lsls r0, r2, 9 adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @08067806 ldr r0, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 movs r1, 0x5D strb r1, [r0, 0x5] @08067806: ldr r0, =0x03005d60 ldrb r1, [r7] lsls r1, 2 adds r1, r0 ldr r0, =sub_806782C str r0, [r1] @08067812: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8067718 thumb_func_start sub_806782C sub_806782C: ; 806782C push {r4,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x5] adds r2, r1, 0x1 strb r2, [r0, 0x5] lsls r1, 24 lsrs r1, 24 cmp r1, 0x5C bls @08067864 ldr r0, [r4] ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x5] bl sub_8065068 @08067864: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806782C thumb_func_start sub_8067874 sub_8067874: ; 8067874 push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080678A6 ldr r2, =0x03005e00 ldr r0, =0x020244b4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, =sub_8073C30 str r1, [r0] @080678A6: bl sub_8065068 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8067874 thumb_func_start sub_80678C4 sub_80678C4: ; 80678C4 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_80678C4 thumb_func_start sub_80678D0 sub_80678D0: ; 80678D0 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @08067916 ldr r3, =0x02020630 ldr r0, =0x020241e4 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 ldr r0, =0x02023064 lsls r1, 9 adds r0, 0x1 adds r1, r0 adds r2, 0x3E movs r0, 0x1 ldrb r1, [r1] ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] ldrb r0, [r4] bl sub_805E408 @08067916: bl sub_8065068 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80678D0 thumb_func_start sub_8067930 sub_8067930: ; 8067930 push {r4-r6,lr} sub sp, 0x4 ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @08067992 ldr r4, =0x02023064 ldrb r2, [r5] lsls r1, r2, 9 adds r0, r4, 0x1 adds r0, r1, r0 ldrb r6, [r0] adds r0, r4, 0x2 adds r0, r1, r0 ldrb r3, [r0] adds r4, 0x3 adds r1, r4 ldrb r0, [r1] lsls r0, 8 orrs r3, r0 str r3, [sp] adds r0, r2, 0 adds r1, r2, 0 adds r3, r6, 0 bl move_anim_start_t3 lsls r0, 24 cmp r0, 0 beq @08067980 bl sub_8065068 b @0806798C .align 2, 0 .pool @08067980: ldr r0, =0x03005d60 ldrb r1, [r5] lsls r1, 2 adds r1, r0 ldr r0, =sub_8065038 str r0, [r1] @0806798C: adds r0, r6, 0 bl sub_817E32C @08067992: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8067930 thumb_func_start sub_80679A4 sub_80679A4: ; 80679A4 push {lr} ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 ldr r1, =0x02023066 adds r0, r1 bl sub_81851A8 bl sub_8065068 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80679A4 thumb_func_start sub_80679C4 sub_80679C4: ; 80679C4 push {lr} bl sub_8065068 pop {r0} bx r0 thumb_func_end sub_80679C4 thumb_func_start sub_80679D0 sub_80679D0: ; 80679D0 push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] lsls r0, 9 ldr r4, =0x02023068 adds r0, r4 bl sub_81851A8 ldrb r0, [r5] lsls r0, 9 subs r4, 0x3 adds r0, r4 ldrb r2, [r0] cmp r2, 0x3 bne @08067A00 ldr r0, =0x0202433a strb r2, [r0] b @08067A08 .align 2, 0 .pool @08067A00: ldr r0, =0x0202433a movs r1, 0x3 eors r1, r2 strb r1, [r0] @08067A08: ldr r0, =0x03005d90 ldr r3, [r0] ldr r1, =0x02023064 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 adds r1, 0x2 adds r0, r1 ldrb r0, [r0] ldr r1, =0x00000ca9 adds r3, r1 movs r1, 0x1 ands r1, r0 lsls r1, 3 ldrb r2, [r3] movs r0, 0x9 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 bl sub_80A2390 bl sub_8065068 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_80587B0 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80679D0 thumb_func_start nullsub_92 nullsub_92: ; 8067A70 bx lr thumb_func_end nullsub_92 thumb_func_start zero_pokemon_boxed_data ; void zero_pokemon_boxed_data(pokemon *mon) zero_pokemon_boxed_data: ; 8067A74 push {lr} adds r2, r0, 0 movs r1, 0 movs r3, 0 @08067A7C: adds r0, r2, r1 strb r3, [r0] adds r1, 0x1 cmp r1, 0x4F bls @08067A7C pop {r0} bx r0 thumb_func_end zero_pokemon_boxed_data thumb_func_start zero_pokemon_struct ; void zero_pokemon_struct(pokemon *mon) zero_pokemon_struct: ; 8067A8C push {r4,lr} sub sp, 0x4 adds r4, r0, 0 bl zero_pokemon_boxed_data movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0x37 mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3B mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F mov r2, sp bl pokemon_setattr movs r0, 0xFF str r0, [sp] adds r0, r4, 0 movs r1, 0x40 mov r2, sp bl pokemon_setattr add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end zero_pokemon_struct thumb_func_start zero_player_party_data ; void zero_player_party_data() zero_player_party_data: ; 8067B0C push {r4,r5,lr} ldr r4, =0x020244ec movs r0, 0xFA lsls r0, 1 adds r5, r4, r0 @08067B16: adds r0, r4, 0 bl zero_pokemon_struct adds r4, 0x64 cmp r4, r5 ble @08067B16 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end zero_player_party_data thumb_func_start zero_enemy_party_data zero_enemy_party_data: ; 8067B2C push {r4,r5,lr} ldr r4, =0x02024744 movs r0, 0xFA lsls r0, 1 adds r5, r4, r0 @08067B36: adds r0, r4, 0 bl zero_pokemon_struct adds r4, 0x64 cmp r4, r5 ble @08067B36 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end zero_enemy_party_data thumb_func_start create_pokemon_set_level ; void create_pokemon_set_level(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) create_pokemon_set_level: ; 8067B4C push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x1C mov r8, r0 adds r6, r1, 0 ldr r4, [sp, 0x34] ldr r7, [sp, 0x38] ldr r5, [sp, 0x3C] lsls r6, 16 lsrs r6, 16 add r0, sp, 0x10 strb r2, [r0] lsls r3, 24 lsrs r3, 24 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 mov r0, r8 str r3, [sp, 0x18] bl zero_pokemon_struct str r4, [sp] str r7, [sp, 0x4] str r5, [sp, 0x8] ldr r0, [sp, 0x40] str r0, [sp, 0xC] mov r0, r8 adds r1, r6, 0 add r2, sp, 0x10 ldrb r2, [r2] ldr r3, [sp, 0x18] bl create_pokemon mov r0, r8 movs r1, 0x38 add r2, sp, 0x10 bl pokemon_setattr movs r0, 0xFF str r0, [sp, 0x14] add r2, sp, 0x14 mov r0, r8 movs r1, 0x40 bl pokemon_setattr mov r0, r8 bl pokemon_calc_effective_stats add sp, 0x1C pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end create_pokemon_set_level thumb_func_start create_pokemon ; void create_pokemon(pokemon *mon, s16 species_num, u8 level, u8 forced_iv, char pokemon_id_is_nonrandom, int pokemon_id, u8 trainer_id_mode, int trainer_id) create_pokemon: ; 8067BBC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x20 adds r7, r0, 0 ldr r4, [sp, 0x40] ldr r0, [sp, 0x48] movs r5, 0xE add r5, sp strh r1, [r5] add r6, sp, 0x10 strb r2, [r6] mov r5, sp adds r5, 0x11 strb r3, [r5] lsls r4, 24 lsrs r4, 24 lsls r0, 24 lsrs r0, 24 mov r10, r0 adds r0, r7, 0 bl zero_pokemon_boxed_data cmp r4, 0 beq @08067BF8 ldr r0, [sp, 0x44] str r0, [sp, 0x14] b @08067C0C @08067BF8: bl GenerateRandomNumber adds r4, r0, 0 bl GenerateRandomNumber lsls r4, 16 lsrs r4, 16 lsls r0, 16 orrs r4, r0 str r4, [sp, 0x14] @08067C0C: add r2, sp, 0x14 adds r0, r7, 0 movs r1, 0 bl pokemon_setattr_encrypted add r0, sp, 0x18 mov r9, r0 add r5, sp, 0xC mov r1, r10 cmp r1, 0x2 bne @08067C64 ldr r2, =0xffff0000 mov r8, r2 ldr r6, =0x0000ffff @08067C28: bl GenerateRandomNumber adds r4, r0, 0 bl GenerateRandomNumber lsls r4, 16 lsrs r4, 16 lsls r0, 16 orrs r4, r0 str r4, [sp, 0x18] adds r1, r4, 0 mov r3, r8 ands r1, r3 lsrs r1, 16 ands r4, r6 eors r1, r4 ldr r2, [sp, 0x14] adds r0, r2, 0 ands r0, r3 lsrs r0, 16 eors r1, r0 ands r2, r6 eors r1, r2 cmp r1, 0x7 bls @08067C28 b @08067C8A .align 2, 0 .pool @08067C64: mov r0, r10 cmp r0, 0x1 bne @08067C70 ldr r0, [sp, 0x4C] str r0, [sp, 0x18] b @08067C8A @08067C70: ldr r0, =0x03005d90 ldr r2, [r0] ldrb r1, [r2, 0xA] ldrb r0, [r2, 0xB] lsls r0, 8 orrs r1, r0 ldrb r0, [r2, 0xC] lsls r0, 16 orrs r1, r0 ldrb r0, [r2, 0xD] lsls r0, 24 orrs r1, r0 str r1, [sp, 0x18] @08067C8A: adds r0, r7, 0 movs r1, 0x1 mov r2, r9 bl pokemon_setattr_encrypted adds r0, r7, 0 bl pokemon_calc_checksum strh r0, [r5] adds r0, r7, 0 movs r1, 0x9 adds r2, r5, 0 bl pokemon_setattr_encrypted adds r0, r7, 0 bl pokemon_encrypt mov r0, sp ldrh r1, [r0, 0xE] bl get_pokemon_name adds r0, r7, 0 movs r1, 0x2 mov r2, sp bl pokemon_setattr_encrypted ldr r2, =gUnknown_82E9531 adds r0, r7, 0 movs r1, 0x3 bl pokemon_setattr_encrypted ldr r5, =0x03005d90 ldr r2, [r5] adds r0, r7, 0 movs r1, 0x7 bl pokemon_setattr_encrypted adds r0, r7, 0 movs r1, 0xB mov r2, sp adds r2, 0xE bl pokemon_setattr_encrypted ldr r4, =gBaseStats mov r2, sp ldrh r1, [r2, 0xE] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0, 0x13] movs r0, 0xCA lsls r0, 1 adds r2, r1, 0 muls r2, r0 mov r3, sp ldrb r0, [r3, 0x10] lsls r0, 2 ldr r1, =gExperienceTables adds r0, r1 adds r2, r0 adds r0, r7, 0 movs r1, 0x19 bl pokemon_setattr_encrypted mov r1, sp ldrh r0, [r1, 0xE] lsls r2, r0, 3 subs r2, r0 lsls r2, 2 adds r4, 0x12 adds r2, r4 adds r0, r7, 0 movs r1, 0x20 bl pokemon_setattr_encrypted bl sav1_map_get_name lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x18] adds r0, r7, 0 movs r1, 0x23 mov r2, r9 bl pokemon_setattr_encrypted adds r0, r7, 0 movs r1, 0x24 add r2, sp, 0x10 bl pokemon_setattr_encrypted ldr r2, =gUnknown_82E9530 adds r0, r7, 0 movs r1, 0x25 bl pokemon_setattr_encrypted movs r0, 0x4 str r0, [sp, 0x18] adds r0, r7, 0 movs r1, 0x26 mov r2, r9 bl pokemon_setattr_encrypted ldr r2, [r5] adds r2, 0x8 adds r0, r7, 0 movs r1, 0x31 bl pokemon_setattr_encrypted mov r2, sp ldrb r0, [r2, 0x11] cmp r0, 0x1F bhi @08067DC8 adds r0, r7, 0 movs r1, 0x27 adds r2, 0x11 bl pokemon_setattr_encrypted adds r0, r7, 0 movs r1, 0x28 mov r2, sp adds r2, 0x11 bl pokemon_setattr_encrypted adds r0, r7, 0 movs r1, 0x29 mov r2, sp adds r2, 0x11 bl pokemon_setattr_encrypted adds r0, r7, 0 movs r1, 0x2A mov r2, sp adds r2, 0x11 bl pokemon_setattr_encrypted adds r0, r7, 0 movs r1, 0x2B mov r2, sp adds r2, 0x11 bl pokemon_setattr_encrypted adds r0, r7, 0 movs r1, 0x2C mov r2, sp adds r2, 0x11 bl pokemon_setattr_encrypted b @08067E50 .align 2, 0 .pool @08067DC8: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x18] movs r3, 0x1F mov r8, r3 ands r0, r3 str r0, [sp, 0x1C] add r4, sp, 0x1C adds r0, r7, 0 movs r1, 0x27 adds r2, r4, 0 bl pokemon_setattr_encrypted ldr r0, [sp, 0x18] movs r6, 0xF8 lsls r6, 2 ands r0, r6 lsrs r0, 5 str r0, [sp, 0x1C] adds r0, r7, 0 movs r1, 0x28 adds r2, r4, 0 bl pokemon_setattr_encrypted ldr r0, [sp, 0x18] movs r5, 0xF8 lsls r5, 7 ands r0, r5 lsrs r0, 10 str r0, [sp, 0x1C] adds r0, r7, 0 movs r1, 0x29 adds r2, r4, 0 bl pokemon_setattr_encrypted bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x18] mov r1, r8 ands r0, r1 str r0, [sp, 0x1C] adds r0, r7, 0 movs r1, 0x2A adds r2, r4, 0 bl pokemon_setattr_encrypted ldr r0, [sp, 0x18] ands r0, r6 lsrs r0, 5 str r0, [sp, 0x1C] adds r0, r7, 0 movs r1, 0x2B adds r2, r4, 0 bl pokemon_setattr_encrypted ldr r0, [sp, 0x18] ands r0, r5 lsrs r0, 10 str r0, [sp, 0x1C] adds r0, r7, 0 movs r1, 0x2C adds r2, r4, 0 bl pokemon_setattr_encrypted @08067E50: ldr r2, =gBaseStats mov r3, sp ldrh r1, [r3, 0xE] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x17] cmp r0, 0 beq @08067E76 ldr r0, [sp, 0x14] movs r1, 0x1 ands r0, r1 str r0, [sp, 0x18] adds r0, r7, 0 movs r1, 0x2E mov r2, r9 bl pokemon_setattr_encrypted @08067E76: adds r0, r7, 0 bl sub_8069270 add sp, 0x20 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end create_pokemon thumb_func_start pokemon_make_with_nature pokemon_make_with_nature: ; 8067E90 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x10 mov r9, r0 ldr r0, [sp, 0x2C] lsls r1, 16 lsrs r1, 16 mov r8, r1 lsls r2, 24 lsrs r7, r2, 24 lsls r3, 24 lsrs r6, r3, 24 lsls r0, 24 lsrs r5, r0, 24 @08067EB0: bl GenerateRandomNumber adds r4, r0, 0 bl GenerateRandomNumber lsls r4, 16 lsrs r4, 16 lsls r0, 16 orrs r4, r0 adds r0, r4, 0 bl GetNatureFromPersonality lsls r0, 24 lsrs r0, 24 cmp r5, r0 bne @08067EB0 movs r0, 0x1 str r0, [sp] str r4, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] str r0, [sp, 0xC] mov r0, r9 mov r1, r8 adds r2, r7, 0 adds r3, r6, 0 bl create_pokemon_set_level add sp, 0x10 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end pokemon_make_with_nature thumb_func_start sub_8067EF8 sub_8067EF8: ; 8067EF8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 str r0, [sp, 0x10] ldr r4, [sp, 0x38] ldr r5, [sp, 0x3C] ldr r0, [sp, 0x40] lsls r1, 16 lsrs r7, r1, 16 lsls r2, 24 lsrs r2, 24 str r2, [sp, 0x14] lsls r3, 24 lsrs r3, 24 mov r10, r3 lsls r4, 24 lsrs r4, 24 mov r8, r4 lsls r5, 24 lsrs r6, r5, 24 lsls r0, 24 lsrs r1, r0, 24 mov r9, r1 movs r1, 0xFF lsls r1, 24 adds r0, r1 lsrs r0, 24 cmp r0, 0x1B bhi @08067F9E @08067F38: bl GenerateRandomNumber adds r4, r0, 0 bl GenerateRandomNumber lsls r4, 16 lsrs r4, 16 lsls r0, 16 orrs r4, r0 movs r0, 0xC0 lsls r0, 18 ands r0, r4 lsrs r0, 18 movs r1, 0xC0 lsls r1, 10 ands r1, r4 lsrs r1, 12 orrs r0, r1 movs r1, 0xC0 lsls r1, 2 ands r1, r4 lsrs r1, 6 orrs r0, r1 movs r1, 0x3 ands r1, r4 orrs r0, r1 movs r1, 0x1C bl __umodsi3 lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 bl GetNatureFromPersonality lsls r0, 24 lsrs r0, 24 cmp r6, r0 bne @08067F38 adds r0, r7, 0 adds r1, r4, 0 bl pokemon_species_get_gender_info lsls r0, 24 lsrs r0, 24 cmp r8, r0 bne @08067F38 mov r0, r9 subs r0, 0x1 cmp r5, r0 bne @08067F38 b @08067FCE @08067F9E: bl GenerateRandomNumber adds r4, r0, 0 bl GenerateRandomNumber lsls r4, 16 lsrs r4, 16 lsls r0, 16 orrs r4, r0 adds r0, r4, 0 bl GetNatureFromPersonality lsls r0, 24 lsrs r0, 24 cmp r6, r0 bne @08067F9E adds r0, r7, 0 adds r1, r4, 0 bl pokemon_species_get_gender_info lsls r0, 24 lsrs r0, 24 cmp r8, r0 bne @08067F9E @08067FCE: movs r0, 0x1 str r0, [sp] str r4, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] str r0, [sp, 0xC] ldr r0, [sp, 0x10] adds r1, r7, 0 ldr r2, [sp, 0x14] mov r3, r10 bl create_pokemon_set_level add sp, 0x18 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8067EF8 thumb_func_start sub_8067FF8 sub_8067FF8: ; 8067FF8 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x10 mov r8, r0 lsls r1, 16 lsrs r6, r1, 16 lsls r2, 24 lsrs r7, r2, 24 @0806800A: bl GenerateRandomNumber adds r4, r0, 0 bl GenerateRandomNumber lsls r4, 16 lsrs r5, r4, 16 lsls r0, 16 orrs r5, r0 bl GenerateRandomNumber adds r4, r0, 0 bl GenerateRandomNumber lsls r4, 16 lsrs r4, 16 lsls r0, 16 orrs r4, r0 adds r0, r6, 0 adds r1, r4, 0 bl pokemon_species_get_gender_info lsls r0, 24 cmp r0, 0 bne @0806800A movs r0, 0x1 str r0, [sp] str r4, [sp, 0x4] str r0, [sp, 0x8] str r5, [sp, 0xC] mov r0, r8 adds r1, r6, 0 adds r2, r7, 0 movs r3, 0x20 bl create_pokemon_set_level add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8067FF8 thumb_func_start sub_8068060 sub_8068060: ; 8068060 push {r4,lr} sub sp, 0x14 adds r4, r0, 0 str r3, [sp, 0x10] ldr r3, [sp, 0x1C] lsls r1, 16 lsrs r1, 16 lsls r2, 24 lsrs r2, 24 movs r0, 0x1 str r0, [sp] str r3, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] str r0, [sp, 0xC] adds r0, r4, 0 movs r3, 0 bl create_pokemon_set_level adds r0, r4, 0 movs r1, 0x42 add r2, sp, 0x10 bl pokemon_setattr adds r0, r4, 0 bl pokemon_calc_effective_stats add sp, 0x14 pop {r4} pop {r0} bx r0 thumb_func_end sub_8068060 thumb_func_start sub_80680A0 sub_80680A0: ; 80680A0 push {r4,r5,lr} sub sp, 0x10 adds r5, r0, 0 adds r4, r3, 0 ldr r3, [sp, 0x1C] lsls r1, 16 lsrs r1, 16 lsls r2, 24 lsrs r2, 24 movs r0, 0 str r0, [sp] str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] str r3, [sp, 0xC] adds r0, r5, 0 movs r3, 0 bl create_pokemon_set_level adds r0, r5, 0 movs r1, 0x27 adds r2, r4, 0 bl pokemon_setattr adds r2, r4, 0x1 adds r0, r5, 0 movs r1, 0x28 bl pokemon_setattr adds r2, r4, 0x2 adds r0, r5, 0 movs r1, 0x29 bl pokemon_setattr adds r2, r4, 0x3 adds r0, r5, 0 movs r1, 0x2A bl pokemon_setattr adds r2, r4, 0x4 adds r0, r5, 0 movs r1, 0x2B bl pokemon_setattr adds r4, 0x5 adds r0, r5, 0 movs r1, 0x2C adds r2, r4, 0 bl pokemon_setattr adds r0, r5, 0 bl pokemon_calc_effective_stats add sp, 0x10 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_80680A0 thumb_func_start pokemon_make_ev_something pokemon_make_ev_something: ; 8068114 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x14 adds r7, r0, 0 ldr r0, [sp, 0x2C] lsls r1, 16 lsrs r1, 16 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r6, 0 str r6, [sp] str r6, [sp, 0x4] str r6, [sp, 0x8] str r6, [sp, 0xC] adds r0, r7, 0 bl create_pokemon_set_level mov r4, r8 movs r1, 0x1 movs r5, 0x5 @08068148: adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @08068152 adds r6, 0x1 @08068152: lsrs r4, 1 subs r5, 0x1 cmp r5, 0 bge @08068148 movs r0, 0xFF lsls r0, 1 adds r1, r6, 0 bl __divsi3 add r1, sp, 0x10 strh r0, [r1] movs r4, 0x1 movs r5, 0 @0806816C: mov r0, r8 ands r0, r4 cmp r0, 0 beq @08068180 adds r1, r5, 0 adds r1, 0x1A adds r0, r7, 0 add r2, sp, 0x10 bl pokemon_setattr @08068180: lsls r0, r4, 25 lsrs r4, r0, 24 adds r5, 0x1 cmp r5, 0x5 ble @0806816C adds r0, r7, 0 bl pokemon_calc_effective_stats add sp, 0x14 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end pokemon_make_ev_something thumb_func_start sub_806819C sub_806819C: ; 806819C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x34 adds r7, r0, 0 adds r6, r1, 0 ldrh r1, [r6] ldrb r2, [r6, 0xC] movs r3, 0x1 str r3, [sp] ldr r0, [r6, 0x1C] str r0, [sp, 0x4] str r3, [sp, 0x8] ldr r0, [r6, 0x14] str r0, [sp, 0xC] adds r0, r7, 0 movs r3, 0 bl create_pokemon_set_level movs r5, 0 add r0, sp, 0x30 mov r9, r0 movs r1, 0x31 add r1, sp mov r8, r1 adds r4, r6, 0x4 @080681D2: ldrh r1, [r4] lsls r2, r5, 24 lsrs r2, 24 adds r0, r7, 0 bl sub_80691F4 adds r4, 0x2 adds r5, 0x1 cmp r5, 0x3 ble @080681D2 adds r2, r6, 0 adds r2, 0xD adds r0, r7, 0 movs r1, 0x15 bl pokemon_setattr adds r2, r6, 0x2 adds r0, r7, 0 movs r1, 0xC bl pokemon_setattr adds r2, r6, 0 adds r2, 0x2B adds r0, r7, 0 movs r1, 0x20 bl pokemon_setattr adds r1, r6, 0 adds r1, 0x20 add r0, sp, 0x10 bl 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r1, [r0] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @08068374 lsls r0, r1, 30 lsrs r0, 30 bl sub_8165C90 lsls r0, 24 lsrs r3, r0, 24 b @0806837C .align 2, 0 .pool @08068374: movs r3, 0x32 cmp r2, 0 bne @0806837C ldrb r3, [r6, 0xC] @0806837C: ldrh r1, [r6] movs r2, 0x1 str r2, [sp] ldr r0, [r6, 0x1C] str r0, [sp, 0x4] str r2, [sp, 0x8] ldr r0, [r6, 0x14] str r0, [sp, 0xC] adds r0, r7, 0 adds r2, r3, 0 movs r3, 0 bl create_pokemon_set_level movs r5, 0 movs r0, 0xD adds r0, r6 mov r10, r0 adds r1, r6, 0x2 str r1, [sp, 0x38] adds r0, r6, 0 adds r0, 0x2B str r0, [sp, 0x34] adds r1, 0x1E str r1, [sp, 0x54] add r0, sp, 0x30 mov r9, r0 subs r1, 0x12 str r1, [sp, 0x3C] adds r0, r6, 0 adds r0, 0xF str r0, [sp, 0x40] adds r1, 0x2 str r1, [sp, 0x44] adds r0, 0x2 str r0, [sp, 0x48] adds r1, 0x2 str r1, [sp, 0x4C] adds r0, 0x2 str r0, [sp, 0x50] movs r1, 0x31 add r1, sp mov r8, r1 adds r4, r6, 0x4 @080683D2: ldrh r1, [r4] lsls r2, r5, 24 lsrs r2, 24 adds r0, r7, 0 bl sub_80691F4 adds r4, 0x2 adds r5, 0x1 cmp r5, 0x3 ble @080683D2 adds r0, r7, 0 movs r1, 0x15 mov r2, r10 bl pokemon_setattr adds r0, r7, 0 movs r1, 0xC ldr r2, [sp, 0x38] bl pokemon_setattr adds r0, r7, 0 movs r1, 0x20 ldr r2, [sp, 0x34] bl pokemon_setattr add r0, sp, 0x10 ldr r1, [sp, 0x54] bl 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, =gUnknown_08610970 ldrb r0, [r1] lsls r3, r0, 27 lsrs r1, r3, 27 movs r5, 0x58 muls r1, r5 adds r1, r6 ldrh r1, [r1, 0x30] mov r8, r1 lsrs r1, r3, 27 muls r1, r5 adds r1, r6 ldrh r4, [r1, 0x30] lsrs r4, 8 lsrs r3, 27 adds r1, r3, 0 muls r1, r5 adds r1, r6 ldrh r3, [r1, 0x30] movs r1, 0xFF ands r1, r3 lsls r1, 8 lsls r5, r2, 1 adds r5, r2 lsls r5, 2 mov r2, r9 adds r6, r2, r5 orrs r4, r1 ldrh r1, [r6, 0x4] adds r4, r1 ldrb r1, [r2, 0x2] adds r4, r1 lsls r0, 25 lsrs r0, 30 subs r0, 0x1 lsls r0, 24 lsrs r0, 24 bl sub_8165C90 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 ldrh r1, [r6, 0x4] movs r0, 0x1 str r0, [sp] str r4, [sp, 0x4] str r0, [sp, 0x8] mov r0, r8 str r0, [sp, 0xC] adds r0, r7, 0 movs r3, 0x1F bl create_pokemon_set_level mov r1, r9 adds r2, r5, r1 adds r2, 0xE adds r0, r7, 0 movs r1, 0xC bl pokemon_setattr movs r4, 0 movs r2, 0x12 add r2, sp mov r8, r2 mov r6, r9 adds r6, 0x6 @080685BE: adds r0, r6, r5 ldrh r1, [r0] lsls r2, r4, 24 lsrs r2, 24 adds r0, r7, 0 bl sub_80691F4 adds r5, 0x2 adds r4, 0x1 cmp r4, 0x3 ble @080685BE movs r1, 0x55 add r0, sp, 0x10 strh r1, [r0] movs r4, 0 mov r5, r9 adds r5, 0x3F @080685E0: adds r1, r4, 0 adds r1, 0x1A adds r0, r7, 0 add r2, sp, 0x10 bl pokemon_setattr adds r4, 0x1 cmp r4, 0x5 ble @080685E0 ldrb r0, [r5] mov r1, r8 strb r0, [r1] adds r0, r7, 0 movs r1, 0x3 mov r2, r8 bl pokemon_setattr mov r2, r9 ldrb r0, [r2] lsls r0, 27 lsrs r0, 27 mov r2, r8 ldrb r1, [r2] bl sub_81A1650 adds r2, r0, 0 adds r0, r7, 0 movs r1, 0x7 bl pokemon_setattr adds r0, r7, 0 bl pokemon_calc_effective_stats add sp, 0x14 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8068528 thumb_func_start sub_8068634 sub_8068634: ; 8068634 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 adds r7, r0, 0 ldr r0, [sp, 0x38] ldr r4, [sp, 0x3C] lsls r1, 16 lsrs r1, 16 str r1, [sp, 0x14] lsls r2, 24 lsrs r2, 24 mov r10, r2 lsls r3, 24 lsrs r5, r3, 24 lsls r0, 24 lsrs r0, 24 mov r9, r0 lsls r4, 24 lsrs r4, 24 mov r8, r4 movs r6, 0 @08068664: bl GenerateRandomNumber adds r4, r0, 0 bl GenerateRandomNumber lsls r4, 16 lsrs r4, 16 lsls r0, 16 orrs r4, r0 adds r0, r4, 0 bl GetNatureFromPersonality lsls r0, 24 lsrs r0, 24 cmp r5, r0 bne @08068664 movs r0, 0x1 str r0, [sp] str r4, [sp, 0x4] str r0, [sp, 0x8] ldr r0, [sp, 0x40] str r0, [sp, 0xC] adds r0, r7, 0 ldr r1, [sp, 0x14] mov r2, r10 mov r3, r9 bl create_pokemon_set_level mov r5, r8 movs r1, 0x1 movs r4, 0x5 @080686A2: adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @080686AC adds r6, 0x1 @080686AC: lsrs r5, 1 subs r4, 0x1 cmp r4, 0 bge @080686A2 movs r0, 0xFF lsls r0, 1 adds r1, r6, 0 bl __divsi3 add r1, sp, 0x10 strh r0, [r1] movs r5, 0x1 movs r4, 0 @080686C6: mov r0, r8 ands r0, r5 cmp r0, 0 beq @080686DA adds r1, r4, 0 adds r1, 0x1A adds r0, r7, 0 add r2, sp, 0x10 bl pokemon_setattr @080686DA: lsls r0, r5, 25 lsrs r5, r0, 24 adds r4, 0x1 cmp r4, 0x5 ble @080686C6 adds r0, r7, 0 bl pokemon_calc_effective_stats add sp, 0x18 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8068634 thumb_func_start sub_80686FC sub_80686FC: ; 80686FC push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r7, r0, 0 adds r6, r1, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr strh r0, [r6] adds r0, r7, 0 movs r1, 0xC movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne @08068726 movs r0, 0 @08068726: strh r0, [r6, 0x2] movs r5, 0 movs r0, 0x2B adds r0, r6 mov r8, r0 movs r1, 0x20 adds r1, r6 mov r9, r1 adds r4, r6, 0x4 @08068738: adds r1, r5, 0 adds r1, 0xD adds r0, r7, 0 movs r2, 0 bl pokemon_getattr strh r0, [r4] adds r4, 0x2 adds r5, 0x1 cmp r5, 0x3 ble @08068738 adds r0, r7, 0 movs r1, 0x38 movs r2, 0 bl pokemon_getattr strb r0, [r6, 0xC] adds r0, r7, 0 movs r1, 0x15 movs r2, 0 bl pokemon_getattr strb r0, [r6, 0xD] adds r0, r7, 0 movs r1, 0x1 movs r2, 0 bl pokemon_getattr str r0, [r6, 0x14] adds r0, r7, 0 movs r1, 0x1A movs r2, 0 bl pokemon_getattr strb r0, [r6, 0xE] adds r0, r7, 0 movs r1, 0x1B movs r2, 0 bl pokemon_getattr strb r0, [r6, 0xF] adds r0, r7, 0 movs r1, 0x1C movs r2, 0 bl pokemon_getattr strb r0, [r6, 0x10] adds r0, r7, 0 movs r1, 0x1D movs r2, 0 bl pokemon_getattr strb r0, [r6, 0x11] adds r0, r7, 0 movs r1, 0x1E movs r2, 0 bl pokemon_getattr strb r0, [r6, 0x12] adds r0, r7, 0 movs r1, 0x1F movs r2, 0 bl pokemon_getattr strb r0, [r6, 0x13] adds r0, r7, 0 movs r1, 0x20 movs r2, 0 bl pokemon_getattr mov r1, r8 strb r0, [r1] adds r0, r7, 0 movs r1, 0x27 movs r2, 0 bl pokemon_getattr movs r4, 0x1F ands r0, r4 ldrb r2, [r6, 0x18] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r6, 0x18] adds r0, r7, 0 movs r1, 0x28 movs r2, 0 bl pokemon_getattr movs r5, 0x1F ands r0, r5 lsls r0, 5 ldrh r2, [r6, 0x18] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r6, 0x18] adds r0, r7, 0 movs r1, 0x29 movs r2, 0 bl pokemon_getattr ands r0, r4 lsls r0, 2 ldrb r2, [r6, 0x19] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r6, 0x19] adds r0, r7, 0 movs r1, 0x2A movs r2, 0 bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [r6, 0x18] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [r6, 0x18] adds r0, r7, 0 movs r1, 0x2B movs r2, 0 bl pokemon_getattr ands r0, r5 lsls r0, 4 ldrh r2, [r6, 0x1A] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r6, 0x1A] adds r0, r7, 0 movs r1, 0x2C movs r2, 0 bl pokemon_getattr ands r0, r4 lsls r0, 1 ldrb r2, [r6, 0x1B] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r6, 0x1B] adds r0, r7, 0 movs r1, 0x2E movs r2, 0 bl pokemon_getattr lsls r0, 7 ldrb r2, [r6, 0x1B] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r6, 0x1B] adds r0, r7, 0 movs r1, 0 movs r2, 0 bl pokemon_getattr str r0, [r6, 0x1C] adds r0, r7, 0 movs r1, 0x2 mov r2, r9 bl pokemon_getattr pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80686FC thumb_func_start sub_80688A8 sub_80688A8: ; 80688A8 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x14 mov r8, r0 ldr r4, [sp, 0x2C] ldr r6, [sp, 0x30] ldr r5, [sp, 0x34] ldr r7, [sp, 0x38] lsls r1, 16 lsrs r1, 16 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 movs r0, 0x1 str r0, [sp, 0x10] str r4, [sp] str r6, [sp, 0x4] str r5, [sp, 0x8] str r7, [sp, 0xC] mov r0, r8 bl create_pokemon_set_level mov r0, r8 movs r1, 0x50 add r2, sp, 0x10 bl pokemon_setattr add sp, 0x14 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80688A8 thumb_func_start sub_80688F8 sub_80688F8: ; 80688F8 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r5, r1, 24 cmp r0, 0x5 bhi @080689CE lsls r0, 2 ldr r1, =@08068914 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08068914: .4byte @080689CE .4byte @0806892C .4byte @08068A00 .4byte @08068958 .4byte @08068A00 .4byte @08068990 @0806892C: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @080689CE ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080689CE b @080689B6 .align 2, 0 .pool @08068958: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @080689CE ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080689CE cmp r5, 0x1 beq @08068A00 cmp r5, 0x4 beq @08068A00 cmp r5, 0x5 beq @08068A00 b @080689CE .align 2, 0 .pool @08068990: ldr r0, =0x02022fec ldr r2, [r0] movs r3, 0x2 adds r0, r2, 0 ands r0, r3 cmp r0, 0 beq @080689E4 ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @080689CE movs r0, 0x40 ands r2, r0 cmp r2, 0 beq @080689F4 @080689B6: ldr r4, =0x020229e8 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r4 ldrh r0, [r1, 0x18] cmp r0, r5 bne @08068A00 @080689CE: movs r0, 0 b @08068A02 .align 2, 0 .pool @080689E4: ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @080689CE @080689F4: adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080689CE @08068A00: movs r0, 0x1 @08068A02: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80688F8 thumb_func_start get_pokemon_data_3 get_pokemon_data_3: ; 8068A10 push {r4-r6,lr} adds r5, r0, 0 adds r6, r1, 0 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x20 ands r0, r1 cmp r0, 0 bne @08068A34 adds r0, r5, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr movs r1, 0xCD lsls r1, 1 cmp r0, r1 beq @08068A3C @08068A34: movs r0, 0 b @08068A9A .align 2, 0 .pool @08068A3C: adds r1, r6, 0 adds r1, 0x27 adds r0, r5, 0 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 adds r1, r6, 0 adds r1, 0x1A adds r0, r5, 0 movs r2, 0 bl pokemon_getattr ldr r2, =gUnknown_08329D48 lsls r1, r6, 1 adds r1, r2 ldrh r1, [r1] lsls r1, 1 adds r1, r4 cmp r0, 0 bge @08068A68 adds r0, 0x3 @08068A68: asrs r0, 2 adds r0, r1, r0 adds r1, r5, 0 adds r1, 0x54 ldrb r1, [r1] muls r0, r1 movs r1, 0x64 bl __divsi3 adds r0, 0x5 lsls r0, 16 lsrs r4, r0, 16 adds r0, r5, 0 bl GetNature lsls r0, 24 lsrs r0, 24 lsls r2, r6, 24 lsrs r2, 24 adds r1, r4, 0 bl nature_stat_mod lsls r0, 16 lsrs r4, r0, 16 adds r0, r4, 0 @08068A9A: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end get_pokemon_data_3 thumb_func_start sub_8068AA4 sub_8068AA4: ; 8068AA4 push {r4,r5,lr} sub sp, 0x4 movs r5, 0 @08068AAA: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr movs r1, 0xCD lsls r1, 1 cmp r0, r1 bne @08068B34 adds r0, r4, 0 movs r1, 0x3B movs r2, 0 bl pokemon_getattr str r0, [sp] adds r0, r4, 0 movs r1, 0x3B mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C movs r2, 0 bl pokemon_getattr str r0, [sp] adds r0, r4, 0 movs r1, 0x3C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D movs r2, 0 bl pokemon_getattr str r0, [sp] adds r0, r4, 0 movs r1, 0x3D mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E movs r2, 0 bl pokemon_getattr str r0, [sp] adds r0, r4, 0 movs r1, 0x3E mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F movs r2, 0 bl pokemon_getattr str r0, [sp] adds r0, r4, 0 movs r1, 0x3F mov r2, sp bl pokemon_setattr @08068B34: adds r5, 0x1 cmp r5, 0x5 ble @08068AAA add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8068AA4 thumb_func_start sub_8068B48 sub_8068B48: ; 8068B48 push {lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @08068B6C ldr r0, =0x0203c7b4 ldrb r1, [r0] movs r0, 0x1 eors r0, r1 b @08068B78 .align 2, 0 .pool @08068B6C: bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 @08068B78: ldr r3, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r0, r3, 0x4 adds r0, r1, r0 ldr r2, [r0] movs r0, 0x7 ands r2, r0 adds r1, r3 ldrb r0, [r1, 0x13] lsls r0, 3 orrs r2, r0 ldr r0, =gUnknown_08329D54 lsls r2, 1 adds r2, r0 ldrh r0, [r2] bl sub_806EFF0 lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8068B48 thumb_func_start sub_8068BB0 sub_8068BB0: ; 8068BB0 push {lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @08068BD4 ldr r0, =0x0203c7b4 ldrb r1, [r0] movs r0, 0x1 eors r0, r1 b @08068BE0 .align 2, 0 .pool @08068BD4: bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 @08068BE0: ldr r3, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r0, r3, 0x4 adds r0, r1, r0 ldr r2, [r0] movs r0, 0x7 ands r2, r0 adds r1, r3 ldrb r0, [r1, 0x13] lsls r0, 3 orrs r2, r0 ldr r1, =gTrainerClassNameIndices ldr r0, =gUnknown_08329D54 lsls r2, 1 adds r2, r0 ldrh r0, [r2] adds r0, r1 ldrb r0, [r0] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8068BB0 thumb_func_start sub_8068C18 sub_8068C18: ; 8068C18 push {r4-r7,lr} sub sp, 0x14 ldr r0, =0x020375e0 ldrh r5, [r0] ldr r0, =0x020375e2 ldrh r4, [r0] ldr r0, =0x020375e4 ldrh r6, [r0] bl zero_enemy_party_data ldr r7, =0x02024744 lsls r4, 24 lsrs r4, 24 movs r0, 0 str r0, [sp] str r0, [sp, 0x4] str r0, [sp, 0x8] str r0, [sp, 0xC] adds r0, r7, 0 adds r1, r5, 0 adds r2, r4, 0 movs r3, 0x20 bl sub_80688A8 cmp r6, 0 beq @08068C60 add r0, sp, 0x10 strb r6, [r0] adds r1, r0, 0 asrs r0, r6, 8 strb r0, [r1, 0x1] adds r0, r7, 0 movs r1, 0xC add r2, sp, 0x10 bl pokemon_setattr @08068C60: add sp, 0x14 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8068C18 thumb_func_start pokemon_calc_checksum ; int pokemon_calc_checksum(pokemon *mon) pokemon_calc_checksum: ; 8068C78 push {r4-r7,lr} mov r7, r8 push {r7} adds r4, r0, 0 movs r6, 0 ldr r1, [r4] movs r2, 0 bl pokemon_data_permutator adds r5, r0, 0 ldr r1, [r4] adds r0, r4, 0 movs r2, 0x1 bl pokemon_data_permutator adds r7, r0, 0 ldr r1, [r4] adds r0, r4, 0 movs r2, 0x2 bl pokemon_data_permutator mov r8, r0 ldr r1, [r4] adds r0, r4, 0 movs r2, 0x3 bl pokemon_data_permutator adds r3, r0, 0 movs r1, 0x5 @08068CB2: ldrh r0, [r5] adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 adds r5, 0x2 subs r1, 0x1 cmp r1, 0 bge @08068CB2 adds r2, r7, 0 movs r1, 0x5 @08068CC6: ldrh r0, [r2] adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 adds r2, 0x2 subs r1, 0x1 cmp r1, 0 bge @08068CC6 mov r2, r8 movs r1, 0x5 @08068CDA: ldrh r0, [r2] adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 adds r2, 0x2 subs r1, 0x1 cmp r1, 0 bge @08068CDA adds r2, r3, 0 movs r1, 0x5 @08068CEE: ldrh r0, [r2] adds r0, r6, r0 lsls r0, 16 lsrs r6, r0, 16 adds r2, 0x2 subs r1, 0x1 cmp r1, 0 bge @08068CEE adds r0, r6, 0 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end pokemon_calc_checksum thumb_func_start pokemon_calc_effective_stats pokemon_calc_effective_stats: ; 8068D0C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x40 adds r5, r0, 0 movs r1, 0x3A movs r2, 0 bl pokemon_getattr mov r8, r0 adds r0, r5, 0 movs r1, 0x39 movs r2, 0 bl pokemon_getattr str r0, [sp, 0x1C] adds r0, r5, 0 movs r1, 0x27 movs r2, 0 bl pokemon_getattr adds r6, r0, 0 adds r0, r5, 0 movs r1, 0x1A movs r2, 0 bl pokemon_getattr adds r4, r0, 0 adds r0, r5, 0 movs r1, 0x28 movs r2, 0 bl pokemon_getattr mov r10, r0 adds r0, r5, 0 movs r1, 0x1B movs r2, 0 bl pokemon_getattr mov r9, r0 adds r0, r5, 0 movs r1, 0x29 movs r2, 0 bl pokemon_getattr str r0, [sp, 0x20] adds r0, r5, 0 movs r1, 0x1C movs r2, 0 bl pokemon_getattr str r0, [sp, 0x24] adds r0, r5, 0 movs r1, 0x2A movs r2, 0 bl pokemon_getattr str r0, [sp, 0x28] adds r0, r5, 0 movs r1, 0x1D movs r2, 0 bl pokemon_getattr str r0, [sp, 0x2C] adds r0, r5, 0 movs r1, 0x2B movs r2, 0 bl pokemon_getattr str r0, [sp, 0x30] adds r0, r5, 0 movs r1, 0x1E movs r2, 0 bl pokemon_getattr str r0, [sp, 0x34] adds r0, r5, 0 movs r1, 0x2C movs r2, 0 bl pokemon_getattr str r0, [sp, 0x38] adds r0, r5, 0 movs r1, 0x1F movs r2, 0 bl pokemon_getattr str r0, [sp, 0x3C] adds r0, r5, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r7, r0, 16 adds r0, r5, 0 bl level_by_exp lsls r0, 24 lsrs r0, 24 str r0, [sp] adds r0, r5, 0 movs r1, 0x38 mov r2, sp bl pokemon_setattr ldr r0, =0x0000012f cmp r7, r0 bne @08068DF8 movs r0, 0x1 str r0, [sp, 0x4] lsls r6, r7, 3 b @08068E26 .align 2, 0 .pool @08068DF8: ldr r1, =gBaseStats lsls r2, r7, 3 subs r0, r2, r7 lsls r0, 2 adds r0, r1 ldrb r0, [r0] lsls r0, 1 adds r1, r0, r6 adds r0, r4, 0 adds r6, r2, 0 cmp r0, 0 bge @08068E12 adds r0, 0x3 @08068E12: asrs r0, 2 adds r0, r1, r0 ldr r4, [sp] muls r0, r4 movs r1, 0x64 bl __divsi3 adds r0, r4 adds r0, 0xA str r0, [sp, 0x4] @08068E26: ldr r1, =0x02024474 add r2, sp, 0x4 ldrb r0, [r2] mov r3, r8 subs r0, r3 adds r1, 0x23 strb r0, [r1] lsls r0, 24 cmp r0, 0 bne @08068E3E movs r0, 0x1 strb r0, [r1] @08068E3E: adds r0, r5, 0 movs r1, 0x3A bl pokemon_setattr ldr r0, =gBaseStats subs r1, r6, r7 lsls r1, 2 adds r6, r1, r0 ldrb r0, [r6, 0x1] lsls r0, 1 mov r2, r10 adds r1, r0, r2 mov r0, r9 cmp r0, 0 bge @08068E5E adds r0, 0x3 @08068E5E: asrs r0, 2 adds r0, r1, r0 ldr r1, [sp] muls r0, r1 movs r1, 0x64 bl __divsi3 adds r0, 0x5 str r0, [sp, 0x8] adds r0, r5, 0 bl GetNature lsls r0, 24 lsrs r0, 24 add r4, sp, 0x8 ldrh r1, [r4] movs r2, 0x1 bl nature_stat_mod lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x8] adds r0, r5, 0 movs r1, 0x3B adds r2, r4, 0 bl pokemon_setattr ldrb r0, [r6, 0x2] lsls r0, 1 ldr r3, [sp, 0x20] adds r1, r0, r3 ldr r0, [sp, 0x24] cmp r0, 0 bge @08068EA4 adds r0, 0x3 @08068EA4: asrs r0, 2 adds r0, r1, r0 ldr r1, [sp] muls r0, r1 movs r1, 0x64 bl __divsi3 adds r0, 0x5 str r0, [sp, 0xC] adds r0, r5, 0 bl GetNature lsls r0, 24 lsrs r0, 24 add r4, sp, 0xC ldrh r1, [r4] movs r2, 0x2 bl nature_stat_mod lsls r0, 16 lsrs r0, 16 str r0, [sp, 0xC] adds r0, r5, 0 movs r1, 0x3C adds r2, r4, 0 bl pokemon_setattr ldrb r0, [r6, 0x3] lsls r0, 1 ldr r2, [sp, 0x28] adds r1, r0, r2 ldr r0, [sp, 0x2C] cmp r0, 0 bge @08068EEA adds r0, 0x3 @08068EEA: asrs r0, 2 adds r0, r1, r0 ldr r1, [sp] muls r0, r1 movs r1, 0x64 bl __divsi3 adds r0, 0x5 str r0, [sp, 0x10] adds r0, r5, 0 bl GetNature lsls r0, 24 lsrs r0, 24 add r4, sp, 0x10 ldrh r1, [r4] movs r2, 0x3 bl nature_stat_mod lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x10] adds r0, r5, 0 movs r1, 0x3D adds r2, r4, 0 bl pokemon_setattr ldrb r0, [r6, 0x4] lsls r0, 1 ldr r3, [sp, 0x30] adds r1, r0, r3 ldr r0, [sp, 0x34] cmp r0, 0 bge @08068F30 adds r0, 0x3 @08068F30: asrs r0, 2 adds r0, r1, r0 ldr r1, [sp] muls r0, r1 movs r1, 0x64 bl __divsi3 adds r0, 0x5 str r0, [sp, 0x14] adds r0, r5, 0 bl GetNature lsls r0, 24 lsrs r0, 24 add r4, sp, 0x14 ldrh r1, [r4] movs r2, 0x4 bl nature_stat_mod lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x14] adds r0, r5, 0 movs r1, 0x3E adds r2, r4, 0 bl pokemon_setattr ldrb r0, [r6, 0x5] lsls r0, 1 ldr r2, [sp, 0x38] adds r1, r0, r2 ldr r0, [sp, 0x3C] cmp r0, 0 bge @08068F76 adds r0, 0x3 @08068F76: asrs r0, 2 adds r0, r1, r0 ldr r1, [sp] muls r0, r1 movs r1, 0x64 bl __divsi3 adds r0, 0x5 str r0, [sp, 0x18] adds r0, r5, 0 bl GetNature lsls r0, 24 lsrs r0, 24 add r4, sp, 0x18 ldrh r1, [r4] movs r2, 0x5 bl nature_stat_mod lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x18] adds r0, r5, 0 movs r1, 0x3F adds r2, r4, 0 bl pokemon_setattr ldr r0, =0x0000012f cmp r7, r0 bne @08068FD0 ldr r0, [sp, 0x1C] cmp r0, 0 bne @08068FBE mov r3, r8 cmp r3, 0 bne @08068FF4 @08068FBE: movs r0, 0x1 b @08068FE8 .align 2, 0 .pool @08068FD0: ldr r1, [sp, 0x1C] cmp r1, 0 bne @08068FE0 mov r0, r8 cmp r0, 0 bne @08068FF4 ldr r0, [sp, 0x4] b @08068FE8 @08068FE0: ldr r0, [sp, 0x4] mov r2, r8 subs r0, r2 adds r0, r1, r0 @08068FE8: str r0, [sp, 0x1C] add r2, sp, 0x1C adds r0, r5, 0 movs r1, 0x39 bl pokemon_setattr @08068FF4: add sp, 0x40 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end pokemon_calc_effective_stats thumb_func_start sub_8069004 sub_8069004: ; 8069004 push {r4,lr} sub sp, 0x4 adds r2, r0, 0 adds r4, r1, 0 movs r0, 0 str r0, [sp] adds r0, r4, 0 adds r1, r2, 0 movs r2, 0x50 bl memcpy adds r0, r4, 0 movs r1, 0x37 mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A mov r2, sp bl pokemon_setattr movs r0, 0xFF str r0, [sp] adds r0, r4, 0 movs r1, 0x40 mov r2, sp bl pokemon_setattr adds r0, r4, 0 bl pokemon_calc_effective_stats add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end sub_8069004 thumb_func_start level_by_exp level_by_exp: ; 8069054 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x19 movs r2, 0 bl pokemon_getattr adds r3, r0, 0 movs r2, 0x1 ldr r6, =gExperienceTables ldr r1, =gBaseStats lsls r0, r4, 3 subs r0, r4 lsls r0, 2 adds r1, r0, r1 ldrb r0, [r1, 0x13] movs r5, 0xCA lsls r5, 1 muls r0, r5 adds r0, 0x4 adds r0, r6 ldr r0, [r0] cmp r0, r3 bhi @080690AA adds r4, r1, 0 @08069094: adds r2, 0x1 cmp r2, 0x64 bgt @080690AA lsls r1, r2, 2 ldrb r0, [r4, 0x13] muls r0, r5 adds r1, r0 adds r1, r6 ldr r0, [r1] cmp r0, r3 bls @08069094 @080690AA: subs r0, r2, 0x1 lsls r0, 24 lsrs r0, 24 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end level_by_exp thumb_func_start sub_80690C0 sub_80690C0: ; 80690C0 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr_encrypted adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x19 movs r2, 0 bl pokemon_getattr_encrypted adds r3, r0, 0 movs r2, 0x1 ldr r6, =gExperienceTables ldr r1, =gBaseStats lsls r0, r4, 3 subs r0, r4 lsls r0, 2 adds r1, r0, r1 ldrb r0, [r1, 0x13] movs r5, 0xCA lsls r5, 1 muls r0, r5 adds r0, 0x4 adds r0, r6 ldr r0, [r0] cmp r0, r3 bhi @08069116 adds r4, r1, 0 @08069100: adds r2, 0x1 cmp r2, 0x64 bgt @08069116 lsls r1, r2, 2 ldrb r0, [r4, 0x13] muls r0, r5 adds r1, r0 adds r1, r6 ldr r0, [r1] cmp r0, r3 bls @08069100 @08069116: subs r0, r2, 0x1 lsls r0, 24 lsrs r0, 24 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80690C0 thumb_func_start pokemon_moveset_pad_ pokemon_moveset_pad_: ; 806912C push {lr} lsls r1, 16 lsrs r1, 16 bl pokemon_moveset_pad lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 thumb_func_end pokemon_moveset_pad_ thumb_func_start pokemon_moveset_pad pokemon_moveset_pad: ; 8069140 push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 mov r0, sp strh r1, [r0] movs r5, 0 mov r6, sp @0806914E: adds r4, r5, 0 adds r4, 0xD adds r0, r7, 0 adds r1, r4, 0 movs r2, 0 bl pokemon_getattr_encrypted lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @0806918C adds r0, r7, 0 adds r1, r4, 0 mov r2, sp bl pokemon_setattr_encrypted adds r1, r5, 0 adds r1, 0x11 ldrh r0, [r6] lsls r2, r0, 1 adds r2, r0 lsls r2, 2 ldr r0, =gBattleMoves + 0x4 ; PP offset adds r2, r0 adds r0, r7, 0 bl pokemon_setattr_encrypted ldrh r0, [r6] b @080691A4 .align 2, 0 .pool @0806918C: ldrh r1, [r6] cmp r0, r1 bne @0806919C ldr r0, =0x0000fffe b @080691A4 .align 2, 0 .pool @0806919C: adds r5, 0x1 cmp r5, 0x3 ble @0806914E ldr r0, =0x0000ffff @080691A4: add sp, 0x4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end pokemon_moveset_pad thumb_func_start sub_80691B0 sub_80691B0: ; 80691B0 push {r4,r5,lr} lsls r1, 16 lsrs r4, r1, 16 movs r3, 0 adds r5, r0, 0 adds r5, 0x24 ldr r2, =gBattleMoves lsls r1, r4, 1 adds r1, r4 lsls r1, 2 adds r2, r1, r2 adds r1, r0, 0 adds r1, 0xC @080691CA: ldrh r0, [r1] cmp r0, 0 bne @080691E0 strh r4, [r1] adds r1, r5, r3 ldrb r0, [r2, 0x4] strb r0, [r1] adds r0, r4, 0 b @080691EA .align 2, 0 .pool @080691E0: adds r1, 0x2 adds r3, 0x1 cmp r3, 0x3 ble @080691CA ldr r0, =0x0000ffff @080691EA: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80691B0 thumb_func_start sub_80691F4 sub_80691F4: ; 80691F4 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 adds r4, r2, 0 mov r0, sp strh r1, [r0] lsls r4, 24 lsrs r4, 24 adds r1, r4, 0 adds r1, 0xD adds r0, r5, 0 mov r2, sp bl pokemon_setattr adds r4, 0x11 mov r0, sp ldrh r0, [r0] lsls r2, r0, 1 adds r2, r0 lsls r2, 2 ldr r0, =gBattleMoves + 0x4 ; PP offset adds r2, r0 adds r0, r5, 0 adds r1, r4, 0 bl pokemon_setattr add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80691F4 thumb_func_start sub_8069234 sub_8069234: ; 8069234 push {r4,lr} lsls r1, 16 lsrs r1, 16 lsls r2, 24 lsrs r2, 24 lsls r4, r2, 1 adds r3, r0, 0 adds r3, 0xC adds r3, r4 strh r1, [r3] adds r0, 0x24 adds r0, r2 ldr r3, =gBattleMoves lsls r2, r1, 1 adds r2, r1 lsls r2, 2 adds r2, r3 ldrb r1, [r2, 0x4] strb r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8069234 thumb_func_start sub_8069264 sub_8069264: ; 8069264 push {lr} bl sub_8069270 pop {r0} bx r0 thumb_func_end sub_8069264 thumb_func_start sub_8069270 sub_8069270: ; 8069270 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 mov r8, r0 movs r1, 0xB movs r2, 0 bl pokemon_getattr_encrypted adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 bl sub_80690C0 lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r0, =gLevelUpLearnsetPointers lsls r6, r4, 2 adds r0, r6, r0 ldr r0, [r0] ldrh r1, [r0] ldr r2, =0xffff0000 lsrs r0, r2, 16 cmp r1, r0 beq @080692FC mov r9, r2 movs r3, 0 @080692AE: ldr r0, =gLevelUpLearnsetPointers adds r7, r6, r0 ldr r0, [r7] adds r0, r3, r0 ldrh r2, [r0] movs r1, 0xFE lsls r1, 8 adds r0, r1, 0 ands r0, r2 mov r4, r10 lsls r1, r4, 9 cmp r0, r1 bgt @080692FC ldr r1, =0x000001ff adds r0, r1, 0 adds r4, r0, 0 ands r4, r2 mov r0, r8 adds r1, r4, 0 str r3, [sp] bl pokemon_moveset_pad lsls r0, 16 mov r1, r9 lsrs r5, r1, 16 ldr r3, [sp] cmp r0, r9 bne @080692F0 mov r0, r8 adds r1, r4, 0 bl sub_80694D0 ldr r3, [sp] @080692F0: adds r3, 0x2 ldr r0, [r7] adds r0, r3, r0 ldrh r0, [r0] cmp r0, r5 bne @080692AE @080692FC: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8069270 thumb_func_start sub_8069318 sub_8069318: ; 8069318 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 mov r8, r0 lsls r4, r1, 24 lsrs r4, 24 movs r0, 0 str r0, [sp] mov r0, r8 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r9, r0 mov r0, r8 movs r1, 0x38 movs r2, 0 bl pokemon_getattr lsls r0, 24 lsrs r0, 24 mov r10, r0 cmp r4, 0 beq @080693B0 ldr r4, =0x020244e8 mov r1, sp ldrb r1, [r1] strb r1, [r4] ldr r2, =gLevelUpLearnsetPointers mov r5, r9 lsls r3, r5, 2 adds r5, r3, r2 ldr r0, [r5] ldrh r1, [r0] movs r7, 0xFE lsls r7, 8 adds r0, r7, 0 ands r0, r1 adds r6, r4, 0 mov r12, r2 mov r1, r10 lsls r4, r1, 9 cmp r0, r4 beq @080693D8 adds r2, r6, 0 ldr r0, =0x0000ffff mov r12, r0 adds r6, r7, 0 adds r3, r5, 0 @08069384: ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] ldrb r0, [r2] ldr r1, [r3] lsls r0, 1 adds r0, r1 ldrh r1, [r0] cmp r1, r12 bne @080693A8 movs r0, 0 b @08069404 .align 2, 0 .pool @080693A8: adds r0, r6, 0 ands r0, r1 cmp r0, r4 bne @08069384 @080693B0: ldr r3, =gLevelUpLearnsetPointers mov r1, r9 lsls r4, r1, 2 adds r1, r4, r3 ldr r2, =0x020244e8 ldrb r0, [r2] ldr r1, [r1] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0xFE lsls r0, 8 ands r0, r1 mov r5, r10 lsls r1, r5, 9 adds r6, r2, 0 mov r12, r3 adds r3, r4, 0 cmp r0, r1 bne @08069402 @080693D8: ldr r2, =0x020244e2 mov r0, r12 adds r1, r3, r0 ldrb r0, [r6] ldr r1, [r1] lsls r0, 1 adds r0, r1 ldrh r1, [r0] ldr r0, =0x000001ff ands r0, r1 strh r0, [r2] ldrb r0, [r6] adds r0, 0x1 strb r0, [r6] ldrh r1, [r2] mov r0, r8 bl pokemon_moveset_pad_ lsls r0, 16 lsrs r0, 16 str r0, [sp] @08069402: ldr r0, [sp] @08069404: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8069318 thumb_func_start sub_8069424 sub_8069424: ; 8069424 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x10 adds r6, r0, 0 lsls r1, 16 lsrs r1, 16 mov r8, r1 movs r4, 0 add r7, sp, 0x8 add r0, sp, 0xC mov r9, r0 mov r5, sp @08069440: adds r1, r4, 0 adds r1, 0xE adds r0, r6, 0 movs r2, 0 bl pokemon_getattr strh r0, [r5] adds r1, r4, 0 adds r1, 0x12 adds r0, r6, 0 movs r2, 0 bl pokemon_getattr adds r1, r7, r4 strb r0, [r1] adds r5, 0x2 adds r4, 0x1 cmp r4, 0x2 ble @08069440 adds r0, r6, 0 movs r1, 0x15 movs r2, 0 bl pokemon_getattr mov r1, r9 strb r0, [r1] ldrb r0, [r1] lsrs r0, 2 strb r0, [r1] mov r0, sp mov r2, r8 strh r2, [r0, 0x6] ldr r1, =gBattleMoves mov r2, r8 lsls r0, r2, 1 add r0, r8 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x4] strb r0, [r7, 0x3] movs r4, 0 mov r5, sp @08069494: adds r1, r4, 0 adds r1, 0xD adds r0, r6, 0 adds r2, r5, 0 bl pokemon_setattr adds r1, r4, 0 adds r1, 0x11 adds r2, r7, r4 adds r0, r6, 0 bl pokemon_setattr adds r5, 0x2 adds r4, 0x1 cmp r4, 0x3 ble @08069494 adds r0, r6, 0 movs r1, 0x15 mov r2, r9 bl pokemon_setattr add sp, 0x10 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8069424 thumb_func_start sub_80694D0 sub_80694D0: ; 80694D0 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x10 adds r6, r0, 0 lsls r1, 16 lsrs r1, 16 mov r8, r1 movs r4, 0 add r7, sp, 0x8 add r0, sp, 0xC mov r9, r0 mov r5, sp @080694EC: adds r1, r4, 0 adds r1, 0xE adds r0, r6, 0 movs r2, 0 bl pokemon_getattr_encrypted strh r0, [r5] adds r1, r4, 0 adds r1, 0x12 adds r0, r6, 0 movs r2, 0 bl pokemon_getattr_encrypted adds r1, r7, r4 strb r0, [r1] adds r5, 0x2 adds r4, 0x1 cmp r4, 0x2 ble @080694EC adds r0, r6, 0 movs r1, 0x15 movs r2, 0 bl pokemon_getattr_encrypted mov r1, r9 strb r0, [r1] ldrb r0, [r1] lsrs r0, 2 strb r0, [r1] mov r0, sp mov r2, r8 strh r2, [r0, 0x6] ldr r1, =gBattleMoves mov r2, r8 lsls r0, r2, 1 add r0, r8 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x4] strb r0, [r7, 0x3] movs r4, 0 mov r5, sp @08069540: adds r1, r4, 0 adds r1, 0xD adds r0, r6, 0 adds r2, r5, 0 bl pokemon_setattr_encrypted adds r1, r4, 0 adds r1, 0x11 adds r2, r7, r4 adds r0, r6, 0 bl pokemon_setattr_encrypted adds r5, 0x2 adds r4, 0x1 cmp r4, 0x3 ble @08069540 adds r0, r6, 0 movs r1, 0x15 mov r2, r9 bl pokemon_setattr_encrypted add sp, 0x10 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80694D0 thumb_func_start sub_806957C sub_806957C: ; 806957C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x30 adds r6, r0, 0 str r1, [sp, 0x4] str r2, [sp, 0x8] ldr r0, [sp, 0x50] ldr r1, [sp, 0x54] ldr r2, [sp, 0x58] ldr r4, [sp, 0x5C] lsls r3, 16 lsrs r3, 16 str r3, [sp, 0xC] lsls r0, 16 lsrs r3, r0, 16 lsls r1, 24 lsrs r7, r1, 24 lsls r2, 24 lsrs r2, 24 str r2, [sp, 0x10] lsls r4, 24 lsrs r4, 24 str r4, [sp, 0x14] movs r5, 0 cmp r3, 0 bne @080695D4 ldr r2, =0x020244e0 ldr r1, =gBattleMoves ldr r3, [sp, 0x8] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x1] strh r0, [r2] b @080695D8 .align 2, 0 .pool @080695D4: ldr r0, =0x020244e0 strh r3, [r0] @080695D8: cmp r7, 0 bne @080695F8 ldr r1, =gBattleMoves ldr r7, [sp, 0x8] lsls r0, r7, 1 adds r0, r7 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x2] mov r10, r0 b @08069602 .align 2, 0 .pool @080695F8: movs r0, 0x3F mov r10, r0 mov r1, r10 ands r1, r7 mov r10, r1 @08069602: ldrh r7, [r6, 0x2] ldr r2, [sp, 0x4] ldrh r2, [r2, 0x4] str r2, [sp, 0x18] ldrh r3, [r6, 0x8] mov r8, r3 ldr r0, [sp, 0x4] ldrh r0, [r0, 0xA] str r0, [sp, 0x1C] ldrh r0, [r6, 0x2E] cmp r0, 0xAF bne @08069634 ldr r1, =0x02024404 ldr r2, [sp, 0x10] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r3, [r0, 0x7] mov r9, r3 ldrb r0, [r0, 0x1A] b @0806964A .align 2, 0 .pool @08069634: ldrh r0, [r6, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r0, 24 mov r9, r0 ldrh r0, [r6, 0x2E] bl itemid_get_quality lsls r0, 24 lsrs r0, 24 @0806964A: str r0, [sp, 0x24] ldr r1, [sp, 0x4] ldrh r0, [r1, 0x2E] cmp r0, 0xAF bne @0806967E ldr r1, =0x02024404 ldr r2, [sp, 0x14] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x7] str r0, [sp, 0x20] b @08069694 .align 2, 0 .pool @0806966C: ldr r0, [sp, 0x24] adds r0, 0x64 muls r0, r7 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r7, r0, 16 b @0806977C @0806967E: ldr r3, [sp, 0x4] ldrh r0, [r3, 0x2E] bl itemid_get_x12 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x20] ldr r1, [sp, 0x4] ldrh r0, [r1, 0x2E] bl itemid_get_quality @08069694: adds r0, r6, 0 adds r0, 0x20 ldrb r1, [r0] str r0, [sp, 0x28] cmp r1, 0x25 beq @080696A4 cmp r1, 0x4A bne @080696A8 @080696A4: lsls r0, r7, 17 lsrs r7, r0, 16 @080696A8: ldr r0, =0x00000867 ldr r1, [sp, 0x10] bl sub_8069ED8 lsls r0, 24 cmp r0, 0 beq @080696C4 movs r0, 0x6E muls r0, r7 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r7, r0, 16 @080696C4: ldr r0, =0x0000086b ldr r1, [sp, 0x14] bl sub_8069ED8 lsls r0, 24 cmp r0, 0 beq @080696E4 movs r0, 0x6E ldr r2, [sp, 0x18] muls r0, r2 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x18] @080696E4: ldr r4, =0x0000086d adds r0, r4, 0 ldr r1, [sp, 0x10] bl sub_8069ED8 lsls r0, 24 cmp r0, 0 beq @08069708 movs r0, 0x6E mov r3, r8 muls r3, r0 adds r0, r3, 0 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r0, 16 mov r8, r0 @08069708: adds r0, r4, 0 ldr r1, [sp, 0x14] bl sub_8069ED8 lsls r0, 24 cmp r0, 0 beq @08069728 movs r0, 0x6E ldr r1, [sp, 0x1C] muls r0, r1 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x1C] @08069728: movs r2, 0 ldr r4, =gUnknown_08329D74 ldr r3, [sp, 0x4] adds r3, 0x20 str r3, [sp, 0x2C] adds r3, r4, 0 @08069734: lsls r1, r2, 1 ldrb r0, [r3] cmp r9, r0 bne @08069774 adds r0, r4, 0x1 adds r0, r1, r0 ldrb r0, [r0] cmp r10, r0 bne @08069774 mov r1, r10 cmp r1, 0x8 bls @0806966C ldr r0, [sp, 0x24] adds r0, 0x64 mov r2, r8 muls r2, r0 adds r0, r2, 0 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r0, 16 mov r8, r0 b @0806977C .align 2, 0 .pool @08069774: adds r3, 0x2 adds r2, 0x1 cmp r2, 0x10 bls @08069734 @0806977C: mov r3, r9 cmp r3, 0x1D bne @08069790 movs r0, 0x96 muls r0, r7 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r7, r0, 16 @08069790: mov r0, r9 cmp r0, 0x22 bne @080697C6 ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 cmp r0, 0 bne @080697C6 ldr r1, =0xfffffe69 adds r0, r1, 0 ldrh r2, [r6] adds r0, r2 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @080697C6 movs r0, 0x96 mov r3, r8 muls r3, r0 adds r0, r3, 0 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r0, 16 mov r8, r0 @080697C6: ldr r0, [sp, 0x20] cmp r0, 0x22 bne @080697FC ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 cmp r0, 0 bne @080697FC ldr r1, =0xfffffe69 adds r0, r1, 0 ldr r2, [sp, 0x4] ldrh r2, [r2] adds r0, r2 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @080697FC movs r0, 0x96 ldr r3, [sp, 0x1C] muls r0, r3 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x1C] @080697FC: mov r0, r9 cmp r0, 0x23 bne @08069812 ldrh r1, [r6] ldr r0, =0x00000175 cmp r1, r0 bne @08069812 mov r1, r8 lsls r0, r1, 17 lsrs r0, 16 mov r8, r0 @08069812: ldr r2, [sp, 0x20] cmp r2, 0x24 bne @0806982A ldr r3, [sp, 0x4] ldrh r1, [r3] ldr r0, =0x00000175 cmp r1, r0 bne @0806982A ldr r1, [sp, 0x1C] lsls r0, r1, 17 lsrs r0, 16 str r0, [sp, 0x1C] @0806982A: mov r2, r9 cmp r2, 0x2D bne @0806983E ldrh r0, [r6] cmp r0, 0x19 bne @0806983E mov r3, r8 lsls r0, r3, 17 lsrs r0, 16 mov r8, r0 @0806983E: ldr r0, [sp, 0x20] cmp r0, 0x40 bne @08069854 ldr r1, [sp, 0x4] ldrh r0, [r1] cmp r0, 0x84 bne @08069854 ldr r2, [sp, 0x18] lsls r0, r2, 17 lsrs r0, 16 str r0, [sp, 0x18] @08069854: mov r3, r9 cmp r3, 0x41 bne @0806986A ldrh r0, [r6] subs r0, 0x68 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @0806986A lsls r0, r7, 17 lsrs r7, r0, 16 @0806986A: ldr r1, [sp, 0x2C] ldrb r0, [r1] cmp r0, 0x2F bne @08069882 mov r2, r10 cmp r2, 0xA beq @0806987C cmp r2, 0xF bne @08069882 @0806987C: mov r3, r8 lsrs r3, 1 mov r8, r3 @08069882: ldr r0, [sp, 0x28] ldrb r4, [r0] cmp r4, 0x37 bne @08069898 movs r0, 0x96 muls r0, r7 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r7, r0, 16 @08069898: cmp r4, 0x39 bne @080698C6 movs r0, 0 str r0, [sp] movs r0, 0xE movs r1, 0 movs r2, 0x3A movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @080698C6 movs r0, 0x96 mov r1, r8 muls r1, r0 adds r0, r1, 0 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r0, 16 mov r8, r0 @080698C6: ldr r2, [sp, 0x28] ldrb r0, [r2] cmp r0, 0x3A bne @080698F8 movs r0, 0 str r0, [sp] movs r0, 0xE movs r1, 0 movs r2, 0x39 movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 beq @080698F8 movs r0, 0x96 mov r3, r8 muls r3, r0 adds r0, r3, 0 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r0, 16 mov r8, r0 @080698F8: ldr r1, [sp, 0x28] ldrb r0, [r1] cmp r0, 0x3E bne @08069914 ldr r0, [r6, 0x4C] cmp r0, 0 beq @08069914 movs r0, 0x96 muls r0, r7 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r7, r0, 16 @08069914: ldr r2, [sp, 0x2C] ldrb r0, [r2] cmp r0, 0x3F bne @08069936 ldr r3, [sp, 0x4] ldr r0, [r3, 0x4C] cmp r0, 0 beq @08069936 movs r0, 0x96 ldr r1, [sp, 0x18] muls r0, r1 movs r1, 0x64 bl __divsi3 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x18] @08069936: mov r2, r10 cmp r2, 0xD bne @0806995A movs r0, 0 str r0, [sp] movs r0, 0xE movs r1, 0 movs r2, 0 movs r3, 0xFD bl ability_something lsls r0, 24 cmp r0, 0 beq @0806995A ldr r1, =0x020244e0 ldrh r0, [r1] lsrs r0, 1 strh r0, [r1] @0806995A: mov r3, r10 cmp r3, 0xA bne @0806997E movs r0, 0 str r0, [sp] movs r0, 0xE movs r1, 0 movs r2, 0 movs r3, 0xFE bl ability_something lsls r0, 24 cmp r0, 0 beq @0806997E ldr r1, =0x020244e0 ldrh r0, [r1] lsrs r0, 1 strh r0, [r1] @0806997E: mov r0, r10 cmp r0, 0xC bne @080699AE ldr r1, [sp, 0x28] ldrb r0, [r1] cmp r0, 0x41 bne @080699AE ldrh r0, [r6, 0x2C] movs r1, 0x3 bl __udivsi3 ldrh r1, [r6, 0x28] lsls r0, 16 lsrs r0, 16 cmp r1, r0 bhi @080699AE ldr r4, =0x020244e0 ldrh r1, [r4] movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 strh r0, [r4] @080699AE: mov r2, r10 cmp r2, 0xA bne @080699DE ldr r3, [sp, 0x28] ldrb r0, [r3] cmp r0, 0x42 bne @080699DE ldrh r0, [r6, 0x2C] movs r1, 0x3 bl __udivsi3 ldrh r1, [r6, 0x28] lsls r0, 16 lsrs r0, 16 cmp r1, r0 bhi @080699DE ldr r4, =0x020244e0 ldrh r1, [r4] movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 strh r0, [r4] @080699DE: mov r0, r10 cmp r0, 0xB bne @08069A0E ldr r1, [sp, 0x28] ldrb r0, [r1] cmp r0, 0x43 bne @08069A0E ldrh r0, [r6, 0x2C] movs r1, 0x3 bl __udivsi3 ldrh r1, [r6, 0x28] lsls r0, 16 lsrs r0, 16 cmp r1, r0 bhi @08069A0E ldr r4, =0x020244e0 ldrh r1, [r4] movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 strh r0, [r4] @08069A0E: mov r2, r10 cmp r2, 0x6 bne @08069A3E ldr r3, [sp, 0x28] ldrb r0, [r3] cmp r0, 0x44 bne @08069A3E ldrh r0, [r6, 0x2C] movs r1, 0x3 bl __udivsi3 ldrh r1, [r6, 0x28] lsls r0, 16 lsrs r0, 16 cmp r1, r0 bhi @08069A3E ldr r4, =0x020244e0 ldrh r1, [r4] movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 strh r0, [r4] @08069A3E: ldr r2, =gBattleMoves ldr r0, =0x020241ea ldrh r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] cmp r0, 0x7 bne @08069A58 ldr r0, [sp, 0x18] lsrs r0, 1 str r0, [sp, 0x18] @08069A58: mov r1, r10 cmp r1, 0x8 bls @08069A60 b @08069BC2 @08069A60: ldr r0, =0x02024211 ldrb r1, [r0] adds r4, r0, 0 cmp r1, 0x2 bne @08069AA0 movs r0, 0x19 ldrsb r0, [r6, r0] cmp r0, 0x6 ble @08069A9C ldr r2, =gUnknown_08329D2E b @08069AA6 .align 2, 0 .pool @08069A9C: adds r5, r7, 0 b @08069ABE @08069AA0: ldr r2, =gUnknown_08329D2E movs r0, 0x19 ldrsb r0, [r6, r0] @08069AA6: lsls r0, 1 adds r1, r0, r2 ldrb r1, [r1] adds r5, r7, 0 muls r5, r1 adds r2, 0x1 adds r0, r2 ldrb r1, [r0] adds r0, r5, 0 bl __divsi3 adds r5, r0, 0 @08069ABE: ldr r0, =0x020244e0 ldrh r0, [r0] muls r5, r0 adds r0, r6, 0 adds r0, 0x2A ldrb r0, [r0] lsls r0, 1 movs r1, 0x5 bl __divsi3 adds r0, 0x2 muls r5, r0 ldrb r0, [r4] cmp r0, 0x2 bne @08069AFC ldr r2, [sp, 0x4] movs r0, 0x1A ldrsb r0, [r2, r0] cmp r0, 0x5 bgt @08069AF8 ldr r2, =gUnknown_08329D2E ldr r3, [sp, 0x4] movs r0, 0x1A ldrsb r0, [r3, r0] b @08069B04 .align 2, 0 .pool @08069AF8: ldr r3, [sp, 0x18] b @08069B1E @08069AFC: ldr r2, =gUnknown_08329D2E ldr r1, [sp, 0x4] movs r0, 0x1A ldrsb r0, [r1, r0] @08069B04: lsls r0, 1 adds r1, r0, r2 ldrb r1, [r1] ldr r7, [sp, 0x18] adds r3, r7, 0 muls r3, r1 adds r2, 0x1 adds r0, r2 ldrb r1, [r0] adds r0, r3, 0 bl __divsi3 adds r3, r0, 0 @08069B1E: adds r0, r5, 0 adds r1, r3, 0 bl __divsi3 adds r5, r0, 0 movs r1, 0x32 bl __divsi3 adds r5, r0, 0 ldr r0, [r6, 0x4C] movs r1, 0x10 ands r0, r1 cmp r0, 0 beq @08069B48 ldr r1, [sp, 0x28] ldrb r0, [r1] cmp r0, 0x3E beq @08069B48 lsrs r0, r5, 31 adds r0, r5, r0 asrs r5, r0, 1 @08069B48: movs r0, 0x1 ldr r2, [sp, 0xC] ands r0, r2 cmp r0, 0 beq @08069B8A ldrb r1, [r4] cmp r1, 0x1 bne @08069B8A ldr r0, =0x02022fec ldr r0, [r0] ands r0, r1 cmp r0, 0 beq @08069B84 movs r0, 0x2 bl sub_8069DEC lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08069B84 adds r0, r5, 0 movs r1, 0x3 bl __divsi3 lsls r5, r0, 1 b @08069B8A .align 2, 0 .pool @08069B84: lsrs r0, r5, 31 adds r0, r5, r0 asrs r5, r0, 1 @08069B8A: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08069BBC ldr r0, =gBattleMoves ldr r3, [sp, 0x8] lsls r1, r3, 1 adds r1, r3 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x6] cmp r0, 0x8 bne @08069BBC movs r0, 0x2 bl sub_8069DEC lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08069BBC lsrs r0, r5, 31 adds r0, r5, r0 asrs r5, r0, 1 @08069BBC: cmp r5, 0 bne @08069BC2 movs r5, 0x1 @08069BC2: mov r7, r10 cmp r7, 0x9 bne @08069BCA movs r5, 0 @08069BCA: mov r0, r10 cmp r0, 0x9 bhi @08069BD2 b @08069DD4 @08069BD2: ldr r0, =0x02024211 ldrb r1, [r0] adds r4, r0, 0 cmp r1, 0x2 bne @08069BFC movs r0, 0x1C ldrsb r0, [r6, r0] cmp r0, 0x6 ble @08069BF8 ldr r2, =gUnknown_08329D2E b @08069C02 .align 2, 0 .pool @08069BF8: mov r5, r8 b @08069C1A @08069BFC: ldr r2, =gUnknown_08329D2E movs r0, 0x1C ldrsb r0, [r6, r0] @08069C02: lsls r0, 1 adds r1, r0, r2 ldrb r1, [r1] mov r5, r8 muls r5, r1 adds r2, 0x1 adds r0, r2 ldrb r1, [r0] adds r0, r5, 0 bl __divsi3 adds r5, r0, 0 @08069C1A: ldr r0, =0x020244e0 ldrh r0, [r0] muls r5, r0 adds r0, r6, 0 adds r0, 0x2A ldrb r0, [r0] lsls r0, 1 movs r1, 0x5 bl __divsi3 adds r0, 0x2 muls r5, r0 ldrb r0, [r4] cmp r0, 0x2 bne @08069C54 ldr r1, [sp, 0x4] movs r0, 0x1D ldrsb r0, [r1, r0] cmp r0, 0x5 bgt @08069C50 ldr r2, =gUnknown_08329D2E b @08069C5C .align 2, 0 .pool @08069C50: ldr r3, [sp, 0x1C] b @08069C76 @08069C54: ldr r2, =gUnknown_08329D2E ldr r7, [sp, 0x4] movs r0, 0x1D ldrsb r0, [r7, r0] @08069C5C: lsls r0, 1 adds r1, r0, r2 ldrb r1, [r1] ldr r6, [sp, 0x1C] adds r3, r6, 0 muls r3, r1 adds r2, 0x1 adds r0, r2 ldrb r1, [r0] adds r0, r3, 0 bl __divsi3 adds r3, r0, 0 @08069C76: adds r0, r5, 0 adds r1, r3, 0 bl __divsi3 adds r5, r0, 0 movs r1, 0x32 bl __divsi3 adds r5, r0, 0 movs r0, 0x2 ldr r7, [sp, 0xC] ands r0, r7 cmp r0, 0 beq @08069CCA ldrb r1, [r4] cmp r1, 0x1 bne @08069CCA ldr r0, =0x02022fec ldr r0, [r0] ands r0, r1 cmp r0, 0 beq @08069CC4 movs r0, 0x2 bl sub_8069DEC lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08069CC4 adds r0, r5, 0 movs r1, 0x3 bl __divsi3 lsls r5, r0, 1 b @08069CCA .align 2, 0 .pool @08069CC4: lsrs r0, r5, 31 adds r0, r5, r0 asrs r5, r0, 1 @08069CCA: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08069CFC ldr r0, =gBattleMoves ldr r2, [sp, 0x8] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x6] cmp r0, 0x8 bne @08069CFC movs r0, 0x2 bl sub_8069DEC lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08069CFC lsrs r0, r5, 31 adds r0, r5, r0 asrs r5, r0, 1 @08069CFC: movs r0, 0 str r0, [sp] movs r0, 0xE movs r1, 0 movs r2, 0xD movs r3, 0 bl ability_something lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08069DAC str r0, [sp] movs r0, 0xE movs r1, 0 movs r2, 0x4D movs r3, 0 bl ability_something lsls r0, 24 cmp r0, 0 bne @08069DAC ldr r2, =0x020243cc ldrh r1, [r2] movs r0, 0x1 ands r0, r1 adds r4, r2, 0 cmp r0, 0 beq @08069D64 mov r3, r10 cmp r3, 0xA beq @08069D50 cmp r3, 0xB beq @08069D58 b @08069D64 .align 2, 0 .pool @08069D50: lsrs r0, r5, 31 adds r0, r5, r0 asrs r5, r0, 1 b @08069D64 @08069D58: lsls r0, r5, 4 subs r0, r5 movs r1, 0xA bl __divsi3 adds r5, r0, 0 @08069D64: ldrh r1, [r4] movs r0, 0x9F ands r0, r1 cmp r0, 0 beq @08069D7C ldr r0, =0x020241ea ldrh r0, [r0] cmp r0, 0x4C bne @08069D7C lsrs r0, r5, 31 adds r0, r5, r0 asrs r5, r0, 1 @08069D7C: ldrh r1, [r4] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @08069DAC mov r6, r10 cmp r6, 0xA beq @08069D98 cmp r6, 0xB beq @08069DA6 b @08069DAC .align 2, 0 .pool @08069D98: lsls r0, r5, 4 subs r0, r5 movs r1, 0xA bl __divsi3 adds r5, r0, 0 b @08069DAC @08069DA6: lsrs r0, r5, 31 adds r0, r5, r0 asrs r5, r0, 1 @08069DAC: ldr r0, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x4] ldr r7, [sp, 0x10] lsls r1, r7, 2 adds r0, r1 ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08069DD4 mov r0, r10 cmp r0, 0xA bne @08069DD4 lsls r0, r5, 4 subs r0, r5 movs r1, 0xA bl __divsi3 adds r5, r0, 0 @08069DD4: adds r0, r5, 0x2 add sp, 0x30 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806957C thumb_func_start sub_8069DEC sub_8069DEC: ; 8069DEC push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 movs r6, 0 cmp r0, 0x1 beq @08069E40 cmp r0, 0x1 bgt @08069E04 cmp r0, 0 beq @08069E0A b @08069EC2 @08069E04: cmp r1, 0x2 beq @08069E88 b @08069EC2 @08069E0A: movs r5, 0 ldr r0, =0x02024064 ldrb r3, [r0] ldr r4, =0x02024210 ldr r2, =gUnknown_0832A328 @08069E14: cmp r5, r3 beq @08069E28 ldrb r0, [r4] ldr r1, [r2] ands r0, r1 cmp r0, 0 bne @08069E28 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @08069E28: adds r2, 0x4 adds r5, 0x1 cmp r5, 0x3 ble @08069E14 b @08069EC2 .align 2, 0 .pool @08069E40: movs r5, 0 @08069E42: lsls r0, r5, 24 lsrs r0, 24 bl battle_side_get_owner adds r4, r0, 0 ldr r0, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @08069E74 ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08069E74 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @08069E74: adds r5, 0x1 cmp r5, 0x3 ble @08069E42 b @08069EC2 .align 2, 0 .pool @08069E88: movs r5, 0 @08069E8A: lsls r0, r5, 24 lsrs r0, 24 bl battle_side_get_owner adds r4, r0, 0 ldr r0, =0x0202420c ldrb r0, [r0] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @08069EBC ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08069EBC adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @08069EBC: adds r5, 0x1 cmp r5, 0x3 ble @08069E8A @08069EC2: adds r0, r6, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8069DEC thumb_func_start sub_8069ED8 sub_8069ED8: ; 8069ED8 push {r4,r5,lr} lsls r0, 16 lsrs r5, r0, 16 lsls r1, 24 lsrs r2, r1, 24 ldr r4, =0x02022fec ldr r0, [r4] ldr r1, =0x023f0902 ands r0, r1 cmp r0, 0 bne @08069F1C adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08069F1C ldr r0, [r4] movs r1, 0x8 ands r0, r1 cmp r0, 0 beq @08069F10 ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0x80 lsls r0, 3 cmp r1, r0 beq @08069F1C @08069F10: adds r0, r5, 0 bl flag_check lsls r0, 24 cmp r0, 0 bne @08069F2C @08069F1C: movs r0, 0 b @08069F2E .align 2, 0 .pool @08069F2C: movs r0, 0x1 @08069F2E: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8069ED8 thumb_func_start sub_8069F34 sub_8069F34: ; 8069F34 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 bl battle_get_per_side_status movs r1, 0x1 movs r6, 0x1 adds r4, r6, 0 ands r4, r0 eors r4, r1 adds r5, r4, 0 ldr r0, =0x02022fec ldr r0, [r0] ands r0, r6 cmp r0, 0 bne @08069F5C adds r0, r4, 0 b @08069FA6 .align 2, 0 .pool @08069F5C: movs r0, 0 bl sub_8069DEC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @08069F80 bl GenerateRandomNumber adds r1, r6, 0 ands r1, r0 cmp r1, 0 bne @08069F7C movs r0, 0x2 eors r0, r4 b @08069FA6 @08069F7C: adds r0, r4, 0 b @08069FA6 @08069F80: ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r4, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @08069FA0 adds r0, r4, 0 b @08069FA6 .align 2, 0 .pool @08069FA0: movs r0, 0x2 eors r5, r0 adds r0, r5, 0 @08069FA6: bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8069F34 thumb_func_start pokemon_get_gender pokemon_get_gender: ; 8069FB4 push {lr} bl pokemon_roll_gender lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end pokemon_get_gender thumb_func_start pokemon_roll_gender pokemon_roll_gender: ; 8069FC4 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr_encrypted lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0 movs r2, 0 bl pokemon_getattr_encrypted adds r2, r0, 0 ldr r1, =gBaseStats lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x10] cmp r0, 0 beq @0806A01A cmp r0, 0 blt @08069FFC cmp r0, 0xFF bgt @08069FFC cmp r0, 0xFE bge @0806A01A @08069FFC: ldr r1, =gBaseStats lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x10] movs r0, 0xFF ands r0, r2 cmp r1, r0 bhi @0806A018 movs r0, 0 b @0806A01A .align 2, 0 .pool @0806A018: movs r0, 0xFE @0806A01A: pop {r4,r5} pop {r1} bx r1 thumb_func_end pokemon_roll_gender thumb_func_start pokemon_species_get_gender_info pokemon_species_get_gender_info: ; 806A020 push {lr} adds r3, r1, 0 lsls r0, 16 lsrs r2, r0, 16 ldr r1, =gBaseStats lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x10] cmp r0, 0 beq @0806A062 cmp r0, 0 blt @0806A044 cmp r0, 0xFF bgt @0806A044 cmp r0, 0xFE bge @0806A062 @0806A044: lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x10] movs r0, 0xFF ands r0, r3 cmp r1, r0 bhi @0806A060 movs r0, 0 b @0806A062 .align 2, 0 .pool @0806A060: movs r0, 0xFE @0806A062: pop {r1} bx r1 thumb_func_end pokemon_species_get_gender_info thumb_func_start sub_806A068 sub_806A068: ; 806A068 push {r4-r7,lr} lsls r0, 16 lsrs r5, r0, 16 lsls r1, 24 lsrs r4, r1, 24 ldr r0, =0x020244d4 ldr r2, [r0] cmp r2, 0 beq @0806A09C ldr r0, =0x0202499c lsls r1, r4, 1 adds r1, r4 lsls r1, 3 adds r1, r2, r1 adds r2, r0, 0 adds r1, 0x14 ldm r1!, {r3,r6,r7} stm r2!, {r3,r6,r7} ldm r1!, {r3,r6,r7} stm r2!, {r3,r6,r7} adds r3, r0, 0 b @0806A0DA .align 2, 0 .pool @0806A09C: ldr r1, =0x020249b4 ldr r0, [r1] cmp r0, 0 beq @0806A0B4 ldr r3, =0x0202499c ldr r2, [r0, 0xC] b @0806A0C8 .align 2, 0 .pool @0806A0B4: ldr r0, [r1, 0x4] cmp r0, 0 beq @0806A0C4 ldr r3, =0x0202499c ldr r2, [r0, 0xC] b @0806A0C8 .align 2, 0 .pool @0806A0C4: ldr r3, =0x0202499c ldr r2, =gUnknown_08329D98 @0806A0C8: lsls r0, r4, 1 adds r0, r4 lsls r0, 3 adds r1, r3, 0 adds r0, r2 ldm r0!, {r2,r6,r7} stm r1!, {r2,r6,r7} ldm r0!, {r2,r6,r7} stm r1!, {r2,r6,r7} @0806A0DA: adds r2, r3, 0 strh r5, [r2, 0x2] cmp r4, 0 beq @0806A0E6 cmp r4, 0x2 bne @0806A0F8 @0806A0E6: ldr r0, =gUnknown_082FF70C str r0, [r2, 0x8] b @0806A122 .align 2, 0 .pool @0806A0F8: movs r0, 0xFA lsls r0, 1 cmp r5, r0 bls @0806A118 ldr r0, =gUnknown_08309AAC ldr r3, =0xfffffe0c adds r1, r5, r3 lsls r1, 2 adds r1, r0 ldr r0, [r1] str r0, [r2, 0x8] b @0806A122 .align 2, 0 .pool @0806A118: ldr r0, =gUnknown_08309AAC lsls r1, r5, 2 adds r1, r0 ldr r0, [r1] str r0, [r3, 0x8] @0806A122: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806A068 thumb_func_start template_build_for_pokemon_or_trainer template_build_for_pokemon_or_trainer: ; 806A12C push {r4-r6,lr} lsls r0, 16 lsrs r4, r0, 16 lsls r1, 24 lsrs r3, r1, 24 ldr r0, =0x0202499c strh r4, [r0, 0x2] adds r5, r0, 0 cmp r3, 0 beq @0806A144 cmp r3, 0x2 bne @0806A170 @0806A144: ldr r2, =gUnknown_08329DF8 lsls r0, r4, 1 adds r0, r4 lsls r0, 3 adds r1, r5, 0 adds r0, r2 ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} ldr r1, =gUnknown_08305D0C lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] b @0806A1B0 .align 2, 0 .pool @0806A170: ldr r0, =0x020244d4 ldr r1, [r0] cmp r1, 0 beq @0806A194 lsls r0, r3, 1 adds r0, r3 lsls r0, 3 adds r0, r1, r0 adds r1, r5, 0 adds r0, 0x14 ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} b @0806A1A8 .align 2, 0 .pool @0806A194: ldr r0, =gUnknown_08329D98 lsls r1, r3, 1 adds r1, r3 lsls r1, 3 adds r2, r5, 0 adds r1, r0 ldm r1!, {r0,r3,r6} stm r2!, {r0,r3,r6} ldm r1!, {r0,r3,r6} stm r2!, {r0,r3,r6} @0806A1A8: ldr r0, =gUnknown_0830536C lsls r1, r4, 2 adds r1, r0 ldr r0, [r1] @0806A1B0: str r0, [r5, 0x8] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end template_build_for_pokemon_or_trainer thumb_func_start sub_806A1C0 sub_806A1C0: ; 806A1C0 push {r4-r6,lr} lsls r0, 16 lsrs r5, r0, 16 lsls r1, 24 lsrs r4, r1, 24 ldr r0, =0x020244d4 ldr r2, [r0] cmp r2, 0 beq @0806A1F4 ldr r0, =0x0202499c lsls r1, r4, 1 adds r1, r4 lsls r1, 3 adds r1, r2, r1 adds r2, r0, 0 adds r1, 0x14 ldm r1!, {r3,r4,r6} stm r2!, {r3,r4,r6} ldm r1!, {r3,r4,r6} stm r2!, {r3,r4,r6} adds r3, r0, 0 b @0806A20A .align 2, 0 .pool @0806A1F4: ldr r3, =0x0202499c ldr r2, =gUnknown_08329D98 lsls r0, r4, 1 adds r0, r4 lsls r0, 3 adds r1, r3, 0 adds r0, r2 ldm r0!, {r2,r4,r6} stm r1!, {r2,r4,r6} ldm r0!, {r2,r4,r6} stm r1!, {r2,r4,r6} @0806A20A: strh r5, [r3, 0x2] ldr r0, =gUnknown_0830536C lsls r1, r5, 2 adds r1, r0 ldr r0, [r1] str r0, [r3, 0x8] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806A1C0 thumb_func_start pokemon_encrypt ; void pokemon_encrypt(pokemon *mon) pokemon_encrypt: ; 806A228 push {r4,lr} adds r3, r0, 0 movs r4, 0 adds r2, r3, 0 adds r2, 0x20 @0806A232: ldr r0, [r2] ldr r1, [r3] eors r0, r1 str r0, [r2] ldr r1, [r3, 0x4] eors r0, r1 stm r2!, {r0} adds r4, 0x1 cmp r4, 0xB bls @0806A232 pop {r4} pop {r0} bx r0 thumb_func_end pokemon_encrypt thumb_func_start pokemon_decrypt ; void pokemon_decrypt(pokemon *mon) pokemon_decrypt: ; 806A24C push {r4,lr} adds r3, r0, 0 movs r4, 0 adds r2, r3, 0 adds r2, 0x20 @0806A256: ldr r0, [r2] ldr r1, [r3, 0x4] eors r0, r1 str r0, [r2] ldr r1, [r3] eors r0, r1 stm r2!, {r0} adds r4, 0x1 cmp r4, 0xB bls @0806A256 pop {r4} pop {r0} bx r0 thumb_func_end pokemon_decrypt thumb_func_start pokemon_data_permutator ; int pokemon_data_permutator(pokemon *mon, int a2, u8 a3) pokemon_data_permutator: ; 806A270 push {r4-r6,lr} adds r5, r0, 0 adds r0, r1, 0 lsls r2, 24 lsrs r4, r2, 24 movs r6, 0 movs r1, 0x18 bl __umodsi3 cmp r0, 0x17 bls @0806A288 b @0806A510 @0806A288: lsls r0, 2 ldr r1, =@0806A298 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806A298: .4byte @0806A2F8 .4byte @0806A31C .4byte @0806A338 .4byte @0806A34E .4byte @0806A364 .4byte @0806A380 .4byte @0806A396 .4byte @0806A3AC .4byte @0806A3BC .4byte @0806A3DA .4byte @0806A3F2 .4byte @0806A402 .4byte @0806A416 .4byte @0806A428 .4byte @0806A43A .4byte @0806A44C .4byte @0806A45E .4byte @0806A470 .4byte @0806A482 .4byte @0806A498 .4byte @0806A4AC .4byte @0806A4BA .4byte @0806A4CC .4byte @0806A4E0 @0806A2F8: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A302 b @0806A508 @0806A302: cmp r4, 0x1 bgt @0806A30E @0806A306: cmp r4, 0 bne @0806A30C b @0806A50E @0806A30C: b @0806A510 @0806A30E: cmp r4, 0x2 bne @0806A314 b @0806A502 @0806A314: cmp r4, 0x3 beq @0806A31A b @0806A510 @0806A31A: b @0806A4FC @0806A31C: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A326 b @0806A508 @0806A326: cmp r4, 0x1 ble @0806A306 @0806A32A: cmp r4, 0x2 bne @0806A330 b @0806A4FC @0806A330: cmp r4, 0x3 beq @0806A336 b @0806A510 @0806A336: b @0806A502 @0806A338: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A342 b @0806A502 @0806A342: cmp r4, 0x1 ble @0806A306 cmp r4, 0x2 bne @0806A34C b @0806A508 @0806A34C: b @0806A314 @0806A34E: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A358 b @0806A4FC @0806A358: cmp r4, 0x1 ble @0806A306 cmp r4, 0x2 bne @0806A362 b @0806A508 @0806A362: b @0806A330 @0806A364: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A36E b @0806A502 @0806A36E: cmp r4, 0x1 ble @0806A306 @0806A372: cmp r4, 0x2 bne @0806A378 b @0806A4FC @0806A378: cmp r4, 0x3 beq @0806A37E b @0806A510 @0806A37E: b @0806A508 @0806A380: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A38A b @0806A4FC @0806A38A: cmp r4, 0x1 ble @0806A306 cmp r4, 0x2 bne @0806A394 b @0806A502 @0806A394: b @0806A378 @0806A396: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A3A0 b @0806A50E @0806A3A0: cmp r4, 0x1 bgt @0806A30E @0806A3A4: cmp r4, 0 bne @0806A3AA b @0806A508 @0806A3AA: b @0806A510 @0806A3AC: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A3B6 b @0806A50E @0806A3B6: cmp r4, 0x1 ble @0806A3A4 b @0806A32A @0806A3BC: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A3C6 b @0806A50E @0806A3C6: cmp r4, 0x1 bgt @0806A3D2 @0806A3CA: cmp r4, 0 bne @0806A3D0 b @0806A502 @0806A3D0: b @0806A510 @0806A3D2: cmp r4, 0x2 bne @0806A3D8 b @0806A508 @0806A3D8: b @0806A314 @0806A3DA: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A3E4 b @0806A50E @0806A3E4: cmp r4, 0x1 bgt @0806A3EA b @0806A4EC @0806A3EA: cmp r4, 0x2 bne @0806A3F0 b @0806A508 @0806A3F0: b @0806A330 @0806A3F2: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A3FC b @0806A50E @0806A3FC: cmp r4, 0x1 ble @0806A3CA b @0806A372 @0806A402: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 bne @0806A40C b @0806A50E @0806A40C: cmp r4, 0x1 ble @0806A4EC cmp r4, 0x2 beq @0806A502 b @0806A378 @0806A416: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A502 cmp r4, 0x1 ble @0806A3A4 cmp r4, 0x2 beq @0806A50E b @0806A314 @0806A428: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A4FC cmp r4, 0x1 ble @0806A3A4 cmp r4, 0x2 beq @0806A50E b @0806A330 @0806A43A: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A508 cmp r4, 0x1 ble @0806A3CA cmp r4, 0x2 beq @0806A50E b @0806A314 @0806A44C: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A508 cmp r4, 0x1 ble @0806A4EC cmp r4, 0x2 beq @0806A50E b @0806A330 @0806A45E: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A4FC cmp r4, 0x1 ble @0806A3CA cmp r4, 0x2 beq @0806A50E b @0806A378 @0806A470: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A502 cmp r4, 0x1 ble @0806A4EC cmp r4, 0x2 beq @0806A50E b @0806A378 @0806A482: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A502 cmp r4, 0x1 ble @0806A3A4 @0806A48E: cmp r4, 0x2 beq @0806A4FC @0806A492: cmp r4, 0x3 bne @0806A510 b @0806A50E @0806A498: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A4FC cmp r4, 0x1 bgt @0806A4A6 b @0806A3A4 @0806A4A6: cmp r4, 0x2 beq @0806A502 b @0806A492 @0806A4AC: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A508 cmp r4, 0x1 ble @0806A3CA b @0806A48E @0806A4BA: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A508 cmp r4, 0x1 ble @0806A4EC cmp r4, 0x2 beq @0806A502 b @0806A492 @0806A4CC: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A4FC cmp r4, 0x1 bgt @0806A4DA b @0806A3CA @0806A4DA: cmp r4, 0x2 beq @0806A508 b @0806A492 @0806A4E0: adds r0, r5, 0 adds r0, 0x20 cmp r4, 0x1 beq @0806A502 cmp r4, 0x1 bgt @0806A4F2 @0806A4EC: cmp r4, 0 beq @0806A4FC b @0806A510 @0806A4F2: cmp r4, 0x2 beq @0806A508 cmp r4, 0x3 beq @0806A50E b @0806A510 @0806A4FC: adds r6, r5, 0 adds r6, 0x44 b @0806A510 @0806A502: adds r6, r5, 0 adds r6, 0x38 b @0806A510 @0806A508: adds r6, r5, 0 adds r6, 0x2C b @0806A510 @0806A50E: adds r6, r0, 0 @0806A510: adds r0, r6, 0 pop {r4-r6} pop {r1} bx r1 thumb_func_end pokemon_data_permutator thumb_func_start pokemon_getattr ; int pokemon_getattr(pokemon *mon, enum pokemon_data_request req, void *data) pokemon_getattr: ; 806A518 push {r4,lr} adds r4, r0, 0 adds r3, r1, 0 adds r0, r3, 0 subs r0, 0x37 cmp r0, 0x21 bls @0806A528 b @0806A666 @0806A528: lsls r0, 2 ldr r1, =@0806A538 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806A538: .4byte @0806A5C0 .4byte @0806A5C4 .4byte @0806A5CC .4byte @0806A5D4 .4byte @0806A5DC .4byte @0806A5EE .4byte @0806A600 .4byte @0806A612 .4byte @0806A624 .4byte @0806A65E .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A666 .4byte @0806A636 .4byte @0806A63E .4byte @0806A646 .4byte @0806A64E .4byte @0806A656 @0806A5C0: ldr r0, [r4, 0x50] b @0806A66E @0806A5C4: adds r0, r4, 0 adds r0, 0x54 ldrb r0, [r0] b @0806A66E @0806A5CC: adds r0, r4, 0 adds r0, 0x56 ldrh r0, [r0] b @0806A66E @0806A5D4: adds r0, r4, 0 adds r0, 0x58 ldrh r0, [r0] b @0806A66E @0806A5DC: adds r0, r4, 0 movs r1, 0x1 bl get_pokemon_data_3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @0806A66E b @0806A636 @0806A5EE: adds r0, r4, 0 movs r1, 0x2 bl get_pokemon_data_3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @0806A66E b @0806A63E @0806A600: adds r0, r4, 0 movs r1, 0x3 bl get_pokemon_data_3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @0806A66E b @0806A646 @0806A612: adds r0, r4, 0 movs r1, 0x4 bl get_pokemon_data_3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @0806A66E b @0806A64E @0806A624: adds r0, r4, 0 movs r1, 0x5 bl get_pokemon_data_3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @0806A66E b @0806A656 @0806A636: adds r0, r4, 0 adds r0, 0x5A ldrh r0, [r0] b @0806A66E @0806A63E: adds r0, r4, 0 adds r0, 0x5C ldrh r0, [r0] b @0806A66E @0806A646: adds r0, r4, 0 adds r0, 0x5E ldrh r0, [r0] b @0806A66E @0806A64E: adds r0, r4, 0 adds r0, 0x60 ldrh r0, [r0] b @0806A66E @0806A656: adds r0, r4, 0 adds r0, 0x62 ldrh r0, [r0] b @0806A66E @0806A65E: adds r0, r4, 0 adds r0, 0x55 ldrb r0, [r0] b @0806A66E @0806A666: adds r0, r4, 0 adds r1, r3, 0 bl pokemon_getattr_encrypted @0806A66E: pop {r4} pop {r1} bx r1 thumb_func_end pokemon_getattr thumb_func_start pokemon_getattr_encrypted ; int pokemon_getattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) pokemon_getattr_encrypted: ; 806A674 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 mov r8, r0 str r1, [sp] adds r6, r2, 0 movs r4, 0 mov r9, r4 mov r10, r4 movs r7, 0 movs r5, 0 cmp r1, 0xA ble @0806A6F2 ldr r1, [r0] movs r2, 0 bl pokemon_data_permutator mov r9, r0 mov r0, r8 ldr r1, [r0] movs r2, 0x1 bl pokemon_data_permutator mov r10, r0 mov r2, r8 ldr r1, [r2] mov r0, r8 movs r2, 0x2 bl pokemon_data_permutator adds r7, r0, 0 mov r0, r8 ldr r1, [r0] movs r2, 0x3 bl pokemon_data_permutator adds r5, r0, 0 mov r0, r8 bl pokemon_decrypt mov r0, r8 bl pokemon_calc_checksum lsls r0, 16 lsrs r0, 16 mov r1, r8 ldrh r1, [r1, 0x1C] cmp r0, r1 beq @0806A6F2 mov r2, r8 ldrb r0, [r2, 0x13] movs r1, 0x1 orrs r0, r1 movs r1, 0x4 orrs r0, r1 strb r0, [r2, 0x13] ldrb r0, [r5, 0x7] movs r1, 0x40 orrs r0, r1 strb r0, [r5, 0x7] @0806A6F2: ldr r0, [sp] cmp r0, 0x53 bls @0806A6FA b @0806AC8C @0806A6FA: lsls r0, 2 ldr r1, =@0806A708 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806A708: .4byte @0806A858 .4byte @0806A85E .4byte @0806A864 .4byte @0806A918 .4byte @0806A91E .4byte @0806A924 .4byte @0806A92A .4byte @0806A930 .4byte @0806A94C .4byte @0806A952 .4byte @0806A958 .4byte @0806A95E .4byte @0806A976 .4byte @0806A98E .4byte @0806A98E .4byte @0806A98E .4byte @0806A98E .4byte @0806A99A .4byte @0806A99A .4byte @0806A99A .4byte @0806A99A .4byte @0806A982 .4byte @0806A9BC .4byte @0806A9C0 .4byte @0806A9C4 .4byte @0806A97C .4byte @0806A9A4 .4byte @0806A9A8 .4byte @0806A9AC .4byte @0806A9B0 .4byte @0806A9B4 .4byte @0806A9B8 .4byte @0806A988 .4byte @0806A9C8 .4byte @0806A9D4 .4byte @0806A9D8 .4byte @0806A9DC .4byte @0806A9E4 .4byte @0806A9EC .4byte @0806A9F6 .4byte @0806A9FE .4byte @0806AA06 .4byte @0806AA0E .4byte @0806AA16 .4byte @0806AA1E .4byte @0806AA26 .4byte @0806AA2A .4byte @0806A9CC .4byte @0806A9D0 .4byte @0806A9F0 .4byte @0806AA30 .4byte @0806AA38 .4byte @0806AA40 .4byte @0806AA48 .4byte @0806AA50 .4byte @0806AC8C .4byte @0806AC8C .4byte @0806AC8C .4byte @0806AC8C .4byte @0806AC8C .4byte @0806AC8C .4byte @0806AC8C .4byte @0806AC8C .4byte @0806AC8C .4byte @0806AC8C .4byte @0806AAB6 .4byte @0806AADC .4byte @0806AA58 .4byte @0806AA5E .4byte @0806AA62 .4byte @0806AA66 .4byte @0806AA6A .4byte @0806AA72 .4byte @0806AA7A .4byte @0806AA82 .4byte @0806AA8A .4byte @0806AA90 .4byte @0806AA98 .4byte @0806AAA0 .4byte @0806AAA8 .4byte @0806AAB0 .4byte @0806AB16 .4byte @0806AB70 .4byte @0806ABF2 @0806A858: mov r1, r8 ldr r4, [r1] b @0806AC8C @0806A85E: mov r2, r8 ldr r4, [r2, 0x4] b @0806AC8C @0806A864: mov r0, r8 ldrb r1, [r0, 0x13] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0806A89C movs r4, 0 ldr r0, =gUnknown_085CCB90 ldrb r1, [r0] adds r2, r0, 0 cmp r1, 0xFF beq @0806A944 adds r3, r2, 0 @0806A87E: adds r0, r6, r4 adds r1, r4, r3 ldrb r1, [r1] strb r1, [r0] adds r4, 0x1 cmp r4, 0x9 bhi @0806A944 adds r0, r4, r2 ldrb r0, [r0] cmp r0, 0xFF bne @0806A87E b @0806A944 .align 2, 0 .pool @0806A89C: movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0806A8BC ldr r1, =gUnknown_085E8264 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 .pool @0806A8BC: mov r1, r8 ldrb r0, [r1, 0x12] cmp r0, 0x1 bne @0806A902 movs r0, 0xFC strb r0, [r6] movs r0, 0x15 strb r0, [r6, 0x1] movs r4, 0x2 movs r3, 0 ldrb r0, [r1, 0x8] cmp r0, 0xFF beq @0806A8F0 mov r2, r8 adds r2, 0x8 @0806A8DA: adds r1, r6, r4 ldrb r0, [r2] strb r0, [r1] adds r4, 0x1 adds r2, 0x1 adds r3, 0x1 cmp r3, 0x4 bgt @0806A8F0 ldrb r0, [r2] cmp r0, 0xFF bne @0806A8DA @0806A8F0: adds r1, r6, r4 movs r0, 0xFC strb r0, [r1] adds r4, 0x1 adds r1, r6, r4 movs r0, 0x16 strb r0, [r1] adds r4, 0x1 b @0806A944 @0806A902: movs r4, 0 mov r2, r8 adds r2, 0x8 @0806A908: adds r0, r6, r4 adds r1, r2, r4 ldrb r1, [r1] strb r1, [r0] adds r4, 0x1 cmp r4, 0x9 bls @0806A908 b @0806A944 @0806A918: mov r2, r8 ldrb r4, [r2, 0x12] b @0806AC8C @0806A91E: mov r6, r8 ldrb r0, [r6, 0x13] b @0806AA92 @0806A924: mov r1, r8 ldrb r0, [r1, 0x13] b @0806AA9A @0806A92A: mov r2, r8 ldrb r0, [r2, 0x13] b @0806AAA2 @0806A930: movs r4, 0 mov r2, r8 adds r2, 0x14 @0806A936: adds r0, r6, r4 adds r1, r2, r4 ldrb r1, [r1] strb r1, [r0] adds r4, 0x1 cmp r4, 0x6 bls @0806A936 @0806A944: adds r1, r6, r4 movs r0, 0xFF strb r0, [r1] b @0806AC8C @0806A94C: mov r6, r8 ldrb r4, [r6, 0x1B] b @0806AC8C @0806A952: mov r0, r8 ldrh r4, [r0, 0x1C] b @0806AC8C @0806A958: mov r1, r8 ldrh r4, [r1, 0x1E] b @0806AC8C @0806A95E: mov r2, r8 ldrb r1, [r2, 0x13] movs r0, 0x1 ands r0, r1 movs r4, 0xCE lsls r4, 1 cmp r0, 0 beq @0806A970 b @0806AC8C @0806A970: mov r6, r9 ldrh r4, [r6] b @0806AC8C @0806A976: mov r0, r9 ldrh r4, [r0, 0x2] b @0806AC8C @0806A97C: mov r1, r9 ldr r4, [r1, 0x4] b @0806AC8C @0806A982: mov r2, r9 ldrb r4, [r2, 0x8] b @0806AC8C @0806A988: mov r6, r9 ldrb r4, [r6, 0x9] b @0806AC8C @0806A98E: ldr r0, [sp] subs r0, 0xD lsls r0, 1 add r0, r10 ldrh r4, [r0] b @0806AC8C @0806A99A: ldr r0, [sp] add r0, r10 subs r0, 0x9 ldrb r4, [r0] b @0806AC8C @0806A9A4: ldrb r4, [r7] b @0806AC8C @0806A9A8: ldrb r4, [r7, 0x1] b @0806AC8C @0806A9AC: ldrb r4, [r7, 0x2] b @0806AC8C @0806A9B0: ldrb r4, [r7, 0x3] b @0806AC8C @0806A9B4: ldrb r4, [r7, 0x4] b @0806AC8C @0806A9B8: ldrb r4, [r7, 0x5] b @0806AC8C @0806A9BC: ldrb r4, [r7, 0x6] b @0806AC8C @0806A9C0: ldrb r4, [r7, 0x7] b @0806AC8C @0806A9C4: ldrb r4, [r7, 0x8] b @0806AC8C @0806A9C8: ldrb r4, [r7, 0x9] b @0806AC8C @0806A9CC: ldrb r4, [r7, 0xA] b @0806AC8C @0806A9D0: ldrb r4, [r7, 0xB] b @0806AC8C @0806A9D4: ldrb r4, [r5] b @0806AC8C @0806A9D8: ldrb r4, [r5, 0x1] b @0806AC8C @0806A9DC: ldrb r0, [r5, 0x2] lsls r0, 25 lsrs r4, r0, 25 b @0806AC8C @0806A9E4: ldrh r0, [r5, 0x2] lsls r0, 21 lsrs r4, r0, 28 b @0806AC8C @0806A9EC: ldrb r0, [r5, 0x3] b @0806AAAA @0806A9F0: ldrb r0, [r5, 0x3] lsrs r4, r0, 7 b @0806AC8C @0806A9F6: ldrb r0, [r5, 0x4] lsls r0, 27 lsrs r4, r0, 27 b @0806AC8C @0806A9FE: ldrh r0, [r5, 0x4] lsls r0, 22 lsrs r4, r0, 27 b @0806AC8C @0806AA06: ldrb r0, [r5, 0x5] lsls r0, 25 lsrs r4, r0, 27 b @0806AC8C @0806AA0E: ldr r0, [r5, 0x4] lsls r0, 12 lsrs r4, r0, 27 b @0806AC8C @0806AA16: ldrh r0, [r5, 0x6] lsls r0, 23 lsrs r4, r0, 27 b @0806AC8C @0806AA1E: ldrb r0, [r5, 0x7] lsls r0, 26 lsrs r4, r0, 27 b @0806AC8C @0806AA26: ldrb r0, [r5, 0x7] b @0806AA84 @0806AA2A: ldrb r0, [r5, 0x7] lsrs r4, r0, 7 b @0806AC8C @0806AA30: ldrb r0, [r5, 0x8] lsls r0, 29 lsrs r4, r0, 29 b @0806AC8C @0806AA38: ldrb r0, [r5, 0x8] lsls r0, 26 lsrs r4, r0, 29 b @0806AC8C @0806AA40: ldrh r0, [r5, 0x8] lsls r0, 23 lsrs r4, r0, 29 b @0806AC8C @0806AA48: ldrb r0, [r5, 0x9] lsls r0, 28 lsrs r4, r0, 29 b @0806AC8C @0806AA50: ldrb r0, [r5, 0x9] lsls r0, 25 lsrs r4, r0, 29 b @0806AC8C @0806AA58: ldrb r0, [r5, 0x9] lsrs r4, r0, 7 b @0806AC8C @0806AA5E: ldrb r0, [r5, 0xA] b @0806AA92 @0806AA62: ldrb r0, [r5, 0xA] b @0806AA9A @0806AA66: ldrb r0, [r5, 0xA] b @0806AAA2 @0806AA6A: ldrb r0, [r5, 0xA] lsls r0, 28 lsrs r4, r0, 31 b @0806AC8C @0806AA72: ldrb r0, [r5, 0xA] lsls r0, 27 lsrs r4, r0, 31 b @0806AC8C @0806AA7A: ldrb r0, [r5, 0xA] lsls r0, 26 lsrs r4, r0, 31 b @0806AC8C @0806AA82: ldrb r0, [r5, 0xA] @0806AA84: lsls r0, 25 lsrs r4, r0, 31 b @0806AC8C @0806AA8A: ldrb r0, [r5, 0xA] lsrs r4, r0, 7 b @0806AC8C @0806AA90: ldrb r0, [r5, 0xB] @0806AA92: lsls r0, 31 lsrs r4, r0, 31 b @0806AC8C @0806AA98: ldrb r0, [r5, 0xB] @0806AA9A: lsls r0, 30 lsrs r4, r0, 31 b @0806AC8C @0806AAA0: ldrb r0, [r5, 0xB] @0806AAA2: lsls r0, 29 lsrs r4, r0, 31 b @0806AC8C @0806AAA8: ldrb r0, [r5, 0xB] @0806AAAA: lsls r0, 25 lsrs r4, r0, 28 b @0806AC8C @0806AAB0: ldrb r0, [r5, 0xB] lsrs r4, r0, 7 b @0806AC8C @0806AAB6: mov r0, r9 ldrh r4, [r0] cmp r4, 0 bne @0806AAC0 b @0806AC8C @0806AAC0: ldrb r0, [r5, 0x7] lsls r0, 25 cmp r0, 0 blt @0806AAD6 mov r2, r8 ldrb r1, [r2, 0x13] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0806AAD6 b @0806AC8C @0806AAD6: movs r4, 0xCE lsls r4, 1 b @0806AC8C @0806AADC: ldrb r0, [r5, 0x4] lsls r0, 27 lsrs r4, r0, 27 ldrh r1, [r5, 0x4] movs r0, 0xF8 lsls r0, 2 ands r0, r1 orrs r4, r0 ldrb r0, [r5, 0x5] lsls r0, 25 lsrs r0, 27 lsls r0, 10 orrs r4, r0 ldr r0, [r5, 0x4] movs r1, 0xF8 lsls r1, 12 ands r0, r1 orrs r4, r0 ldrh r0, [r5, 0x6] lsls r0, 23 lsrs r0, 27 lsls r0, 20 orrs r4, r0 ldrb r0, [r5, 0x7] lsls r0, 26 lsrs r0, 27 lsls r0, 25 orrs r4, r0 b @0806AC8C @0806AB16: mov r1, r9 ldrh r0, [r1] cmp r0, 0 bne @0806AB20 b @0806AC8C @0806AB20: ldrb r0, [r5, 0x7] lsls r0, 25 cmp r0, 0 bge @0806AB2A b @0806AC8C @0806AB2A: ldrh r0, [r6] ldr r1, =0x00000163 cmp r0, r1 bne @0806AB34 b @0806AC8C @0806AB34: mov r2, r10 ldrh r5, [r2] adds r7, r1, 0 adds r2, r6, 0 ldr r1, =gUnknown_0832A328 @0806AB3E: ldrh r3, [r2] cmp r5, r3 beq @0806AB58 mov r6, r10 ldrh r0, [r6, 0x2] cmp r0, r3 beq @0806AB58 ldrh r0, [r6, 0x4] cmp r0, r3 beq @0806AB58 ldrh r0, [r6, 0x6] cmp r0, r3 bne @0806AB5C @0806AB58: ldr r0, [r1] orrs r4, r0 @0806AB5C: adds r2, 0x2 adds r1, 0x4 ldrh r0, [r2] cmp r0, r7 bne @0806AB3E b @0806AC8C .align 2, 0 .pool @0806AB70: movs r4, 0 mov r1, r9 ldrh r0, [r1] cmp r0, 0 bne @0806AB7C b @0806AC8C @0806AB7C: ldrb r0, [r5, 0x7] lsls r0, 25 cmp r0, 0 bge @0806AB86 b @0806AC8C @0806AB86: ldrb r0, [r5, 0x8] lsls r1, r0, 29 lsrs r4, r1, 29 lsls r0, 26 lsrs r0, 29 adds r4, r0 ldrh r0, [r5, 0x8] lsls r0, 23 lsrs r0, 29 adds r4, r0 ldrb r1, [r5, 0x9] lsls r0, r1, 28 lsrs r0, 29 adds r4, r0 lsls r0, r1, 25 lsrs r0, 29 adds r4, r0 lsrs r1, 7 adds r4, r1 ldrb r1, [r5, 0xA] lsls r0, r1, 31 lsrs r0, 31 adds r4, r0 lsls r0, r1, 30 lsrs r0, 31 adds r4, r0 lsls r0, r1, 29 lsrs r0, 31 adds r4, r0 lsls r0, r1, 28 lsrs r0, 31 adds r4, r0 lsls r0, r1, 27 lsrs r0, 31 adds r4, r0 lsls r0, r1, 26 lsrs r0, 31 adds r4, r0 lsls r0, r1, 25 lsrs r0, 31 adds r4, r0 lsrs r1, 7 adds r4, r1 ldrb r1, [r5, 0xB] lsls r0, r1, 31 lsrs r0, 31 adds r4, r0 lsls r0, r1, 30 lsrs r0, 31 adds r4, r0 lsls r1, 29 lsrs r1, 31 adds r4, r1 b @0806AC8C @0806ABF2: movs r4, 0 mov r2, r9 ldrh r0, [r2] cmp r0, 0 beq @0806AC8C ldrb r0, [r5, 0x7] lsls r0, 25 cmp r0, 0 blt @0806AC8C ldrb r2, [r5, 0x9] lsrs r4, r2, 7 ldrb r1, [r5, 0x8] lsls r0, r1, 29 lsrs r0, 28 orrs r4, r0 lsls r1, 26 lsrs r1, 29 lsls r1, 4 orrs r4, r1 ldrh r0, [r5, 0x8] lsls r0, 23 lsrs r0, 29 lsls r0, 7 orrs r4, r0 lsls r0, r2, 28 lsrs r0, 29 lsls r0, 10 orrs r4, r0 lsls r2, 25 lsrs r2, 29 lsls r2, 13 orrs r4, r2 ldrb r1, [r5, 0xA] lsls r0, r1, 31 lsrs r0, 31 lsls r0, 16 orrs r4, r0 lsls r0, r1, 30 lsrs r0, 31 lsls r0, 17 orrs r4, r0 lsls r0, r1, 29 lsrs r0, 31 lsls r0, 18 orrs r4, r0 lsls r0, r1, 28 lsrs r0, 31 lsls r0, 19 orrs r4, r0 lsls r0, r1, 27 lsrs r0, 31 lsls r0, 20 orrs r4, r0 lsls r0, r1, 26 lsrs r0, 31 lsls r0, 21 orrs r4, r0 lsls r0, r1, 25 lsrs r0, 31 lsls r0, 22 orrs r4, r0 lsrs r1, 7 lsls r1, 23 orrs r4, r1 ldrb r1, [r5, 0xB] lsls r0, r1, 31 lsrs r0, 31 lsls r0, 24 orrs r4, r0 lsls r0, r1, 30 lsrs r0, 31 lsls r0, 25 orrs r4, r0 lsls r1, 29 lsrs r1, 31 lsls r1, 26 orrs r4, r1 @0806AC8C: ldr r6, [sp] cmp r6, 0xA ble @0806AC98 mov r0, r8 bl pokemon_encrypt @0806AC98: adds r0, r4, 0 add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end pokemon_getattr_encrypted thumb_func_start pokemon_setattr ; int pokemon_setattr(pokemon *mon, enum pokemon_data_request req, void *data) pokemon_setattr: ; 806ACAC push {lr} adds r3, r0, 0 adds r0, r1, 0 subs r0, 0x37 cmp r0, 0xA bhi @0806AD90 lsls r0, 2 ldr r1, =@0806ACC8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806ACC8: .4byte @0806ACF4 .4byte @0806AD0C .4byte @0806AD16 .4byte @0806AD26 .4byte @0806AD36 .4byte @0806AD46 .4byte @0806AD56 .4byte @0806AD66 .4byte @0806AD76 .4byte @0806AD86 .4byte @0806AD96 @0806ACF4: ldrb r1, [r2] ldrb r0, [r2, 0x1] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x2] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 24 adds r1, r0 str r1, [r3, 0x50] b @0806AD96 @0806AD0C: ldrb r1, [r2] adds r0, r3, 0 adds r0, 0x54 strb r1, [r0] b @0806AD96 @0806AD16: ldrb r0, [r2] ldrb r1, [r2, 0x1] lsls r1, 8 adds r0, r1 adds r1, r3, 0 adds r1, 0x56 strh r0, [r1] b @0806AD96 @0806AD26: ldrb r0, [r2] ldrb r1, [r2, 0x1] lsls r1, 8 adds r0, r1 adds r1, r3, 0 adds r1, 0x58 strh r0, [r1] b @0806AD96 @0806AD36: ldrb r0, [r2] ldrb r1, [r2, 0x1] lsls r1, 8 adds r0, r1 adds r1, r3, 0 adds r1, 0x5A strh r0, [r1] b @0806AD96 @0806AD46: ldrb r0, [r2] ldrb r1, [r2, 0x1] lsls r1, 8 adds r0, r1 adds r1, r3, 0 adds r1, 0x5C strh r0, [r1] b @0806AD96 @0806AD56: ldrb r0, [r2] ldrb r1, [r2, 0x1] lsls r1, 8 adds r0, r1 adds r1, r3, 0 adds r1, 0x5E strh r0, [r1] b @0806AD96 @0806AD66: ldrb r0, [r2] ldrb r1, [r2, 0x1] lsls r1, 8 adds r0, r1 adds r1, r3, 0 adds r1, 0x60 strh r0, [r1] b @0806AD96 @0806AD76: ldrb r0, [r2] ldrb r1, [r2, 0x1] lsls r1, 8 adds r0, r1 adds r1, r3, 0 adds r1, 0x62 strh r0, [r1] b @0806AD96 @0806AD86: ldrb r1, [r2] adds r0, r3, 0 adds r0, 0x55 strb r1, [r0] b @0806AD96 @0806AD90: adds r0, r3, 0 bl pokemon_setattr_encrypted @0806AD96: pop {r0} bx r0 thumb_func_end pokemon_setattr thumb_func_start pokemon_setattr_encrypted ; int pokemon_setattr_encrypted(pokemon *mon, enum pokemon_data_request req, void *data) pokemon_setattr_encrypted: ; 806AD9C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r7, r0, 0 mov r10, r1 adds r4, r2, 0 movs r0, 0 mov r8, r0 mov r9, r0 movs r6, 0 movs r5, 0 cmp r1, 0xA ble @0806AE1C ldr r1, [r7] adds r0, r7, 0 movs r2, 0 bl pokemon_data_permutator mov r8, r0 ldr r1, [r7] adds r0, r7, 0 movs r2, 0x1 bl pokemon_data_permutator mov r9, r0 ldr r1, [r7] adds r0, r7, 0 movs r2, 0x2 bl pokemon_data_permutator adds r6, r0, 0 ldr r1, [r7] adds r0, r7, 0 movs r2, 0x3 bl pokemon_data_permutator adds r5, r0, 0 adds r0, r7, 0 bl pokemon_decrypt adds r0, r7, 0 bl pokemon_calc_checksum lsls r0, 16 lsrs r0, 16 ldrh r1, [r7, 0x1C] cmp r0, r1 beq @0806AE1C ldrb r0, [r7, 0x13] movs r1, 0x1 orrs r0, r1 movs r1, 0x4 orrs r0, r1 strb r0, [r7, 0x13] ldrb r0, [r5, 0x7] movs r1, 0x40 orrs r0, r1 strb r0, [r5, 0x7] adds r0, r7, 0 bl pokemon_encrypt b @0806B3EC @0806AE1C: mov r0, r10 cmp r0, 0x50 bls @0806AE24 b @0806B3D8 @0806AE24: lsls r0, 2 ldr r1, =@0806AE34 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806AE34: .4byte @0806AF78 .4byte @0806AF90 .4byte @0806AFA8 .4byte @0806AFBE .4byte @0806AFC4 .4byte @0806AFD4 .4byte @0806AFE6 .4byte @0806AFF8 .4byte @0806B00E .4byte @0806B014 .4byte @0806B020 .4byte @0806B02C .4byte @0806B04C .4byte @0806B084 .4byte @0806B084 .4byte @0806B084 .4byte @0806B084 .4byte @0806B098 .4byte @0806B098 .4byte @0806B098 .4byte @0806B098 .4byte @0806B074 .4byte @0806B0C8 .4byte @0806B0CE .4byte @0806B0D4 .4byte @0806B05A .4byte @0806B0A4 .4byte @0806B0AA .4byte @0806B0B0 .4byte @0806B0B6 .4byte @0806B0BC .4byte @0806B0C2 .4byte @0806B07C .4byte @0806B0DA .4byte @0806B0EC .4byte @0806B0F2 .4byte @0806B0F8 .4byte @0806B10C .4byte @0806B124 .4byte @0806B14A .4byte @0806B15E .4byte @0806B178 .4byte @0806B18E .4byte @0806B1A8 .4byte @0806B1C0 .4byte @0806B1D4 .4byte @0806B204 .4byte @0806B0E0 .4byte @0806B0E6 .4byte @0806B13A .4byte @0806B214 .4byte @0806B222 .4byte @0806B238 .4byte @0806B250 .4byte @0806B260 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B3D8 .4byte @0806B35E .4byte @0806B276 .4byte @0806B286 .4byte @0806B294 .4byte @0806B2A4 .4byte @0806B2B4 .4byte @0806B2C4 .4byte @0806B2D4 .4byte @0806B2E4 .4byte @0806B2FA .4byte @0806B30A .4byte @0806B318 .4byte @0806B328 .4byte @0806B338 .4byte @0806B34E @0806AF78: ldrb r1, [r4] ldrb r0, [r4, 0x1] lsls r0, 8 adds r1, r0 ldrb r0, [r4, 0x2] lsls r0, 16 adds r1, r0 ldrb r0, [r4, 0x3] lsls r0, 24 adds r1, r0 str r1, [r7] b @0806B3D8 @0806AF90: ldrb r1, [r4] ldrb r0, [r4, 0x1] lsls r0, 8 adds r1, r0 ldrb r0, [r4, 0x2] lsls r0, 16 adds r1, r0 ldrb r0, [r4, 0x3] lsls r0, 24 adds r1, r0 str r1, [r7, 0x4] b @0806B3D8 @0806AFA8: movs r2, 0 adds r3, r7, 0 adds r3, 0x8 @0806AFAE: adds r0, r3, r2 adds r1, r4, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x9 ble @0806AFAE b @0806B3D8 @0806AFBE: ldrb r0, [r4] strb r0, [r7, 0x12] b @0806B3D8 @0806AFC4: ldrb r0, [r4] movs r1, 0x1 ands r1, r0 ldrb r2, [r7, 0x13] movs r0, 0x2 negs r0, r0 ands r0, r2 b @0806B1F2 @0806AFD4: ldrb r0, [r4] movs r1, 0x1 ands r1, r0 lsls r1, 1 ldrb r2, [r7, 0x13] movs r0, 0x3 negs r0, r0 ands r0, r2 b @0806B1F2 @0806AFE6: ldrb r0, [r4] movs r1, 0x1 ands r1, r0 lsls r1, 2 ldrb r2, [r7, 0x13] movs r0, 0x5 negs r0, r0 ands r0, r2 b @0806B1F2 @0806AFF8: movs r2, 0 adds r3, r7, 0 adds r3, 0x14 @0806AFFE: adds r0, r3, r2 adds r1, r4, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x6 ble @0806AFFE b @0806B3D8 @0806B00E: ldrb r0, [r4] strb r0, [r7, 0x1B] b @0806B3D8 @0806B014: ldrb r1, [r4] ldrb r0, [r4, 0x1] lsls r0, 8 adds r1, r0 strh r1, [r7, 0x1C] b @0806B3D8 @0806B020: ldrb r1, [r4] ldrb r0, [r4, 0x1] lsls r0, 8 adds r1, r0 strh r1, [r7, 0x1E] b @0806B3D8 @0806B02C: ldrb r1, [r4] ldrb r0, [r4, 0x1] lsls r0, 8 adds r1, r0 mov r0, r8 strh r1, [r0] lsls r1, 16 cmp r1, 0 beq @0806B044 ldrb r0, [r7, 0x13] movs r1, 0x2 b @0806B1F2 @0806B044: ldrb r1, [r7, 0x13] movs r0, 0x3 negs r0, r0 b @0806B1FE @0806B04C: ldrb r1, [r4] ldrb r0, [r4, 0x1] lsls r0, 8 adds r1, r0 mov r0, r8 strh r1, [r0, 0x2] b @0806B3D8 @0806B05A: ldrb r1, [r4] ldrb r0, [r4, 0x1] lsls r0, 8 adds r1, r0 ldrb r0, [r4, 0x2] lsls r0, 16 adds r1, r0 ldrb r0, [r4, 0x3] lsls r0, 24 adds r1, r0 mov r0, r8 str r1, [r0, 0x4] b @0806B3D8 @0806B074: ldrb r0, [r4] mov r1, r8 strb r0, [r1, 0x8] b @0806B3D8 @0806B07C: ldrb r0, [r4] mov r1, r8 strb r0, [r1, 0x9] b @0806B3D8 @0806B084: mov r2, r10 subs r2, 0xD lsls r2, 1 add r2, r9 ldrb r1, [r4] ldrb r0, [r4, 0x1] lsls r0, 8 adds r1, r0 strh r1, [r2] b @0806B3D8 @0806B098: mov r0, r9 add r0, r10 subs r0, 0x9 ldrb r1, [r4] strb r1, [r0] b @0806B3D8 @0806B0A4: ldrb r0, [r4] strb r0, [r6] b @0806B3D8 @0806B0AA: ldrb r0, [r4] strb r0, [r6, 0x1] b @0806B3D8 @0806B0B0: ldrb r0, [r4] strb r0, [r6, 0x2] b @0806B3D8 @0806B0B6: ldrb r0, [r4] strb r0, [r6, 0x3] b @0806B3D8 @0806B0BC: ldrb r0, [r4] strb r0, [r6, 0x4] b @0806B3D8 @0806B0C2: ldrb r0, [r4] strb r0, [r6, 0x5] b @0806B3D8 @0806B0C8: ldrb r0, [r4] strb r0, [r6, 0x6] b @0806B3D8 @0806B0CE: ldrb r0, [r4] strb r0, [r6, 0x7] b @0806B3D8 @0806B0D4: ldrb r0, [r4] strb r0, [r6, 0x8] b @0806B3D8 @0806B0DA: ldrb r0, [r4] strb r0, [r6, 0x9] b @0806B3D8 @0806B0E0: ldrb r0, [r4] strb r0, [r6, 0xA] b @0806B3D8 @0806B0E6: ldrb r0, [r4] strb r0, [r6, 0xB] b @0806B3D8 @0806B0EC: ldrb r0, [r4] strb r0, [r5] b @0806B3D8 @0806B0F2: ldrb r0, [r4] strb r0, [r5, 0x1] b @0806B3D8 @0806B0F8: ldrb r1, [r4] movs r0, 0x7F ands r1, r0 ldrb r2, [r5, 0x2] movs r0, 0x80 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x2] b @0806B3D8 @0806B10C: ldrb r1, [r4] movs r0, 0xF ands r1, r0 lsls r1, 7 ldrh r2, [r5, 0x2] ldr r0, =0xfffff87f ands r0, r2 orrs r0, r1 strh r0, [r5, 0x2] b @0806B3D8 .align 2, 0 .pool @0806B124: ldrb r1, [r4] movs r0, 0xF ands r1, r0 lsls r1, 3 ldrb r2, [r5, 0x3] movs r0, 0x79 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x3] b @0806B3D8 @0806B13A: ldrb r0, [r4] lsls r0, 7 ldrb r2, [r5, 0x3] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r5, 0x3] b @0806B3D8 @0806B14A: ldrb r1, [r4] movs r0, 0x1F ands r1, r0 ldrb r2, [r5, 0x4] movs r0, 0x20 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x4] b @0806B3D8 @0806B15E: ldrb r1, [r4] movs r0, 0x1F ands r1, r0 lsls r1, 5 ldrh r2, [r5, 0x4] ldr r0, =0xfffffc1f ands r0, r2 orrs r0, r1 strh r0, [r5, 0x4] b @0806B3D8 .align 2, 0 .pool @0806B178: ldrb r1, [r4] movs r0, 0x1F ands r1, r0 lsls r1, 2 ldrb r2, [r5, 0x5] movs r0, 0x7D negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x5] b @0806B3D8 @0806B18E: ldrb r2, [r4] movs r0, 0x1F ands r2, r0 lsls r2, 15 ldr r0, [r5, 0x4] ldr r1, =0xfff07fff ands r0, r1 orrs r0, r2 str r0, [r5, 0x4] b @0806B3D8 .align 2, 0 .pool @0806B1A8: ldrb r1, [r4] movs r0, 0x1F ands r1, r0 lsls r1, 4 ldrh r2, [r5, 0x6] ldr r0, =0xfffffe0f ands r0, r2 orrs r0, r1 strh r0, [r5, 0x6] b @0806B3D8 .align 2, 0 .pool @0806B1C0: ldrb r1, [r4] movs r0, 0x1F ands r1, r0 lsls r1, 1 ldrb r2, [r5, 0x7] movs r0, 0x3F negs r0, r0 ands r0, r2 orrs r0, r1 b @0806B3D6 @0806B1D4: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 lsls r1, 6 ldrb r2, [r5, 0x7] movs r0, 0x41 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x7] lsls r0, 25 cmp r0, 0 bge @0806B1F8 ldrb r0, [r7, 0x13] movs r1, 0x4 @0806B1F2: orrs r0, r1 strb r0, [r7, 0x13] b @0806B3D8 @0806B1F8: ldrb r1, [r7, 0x13] movs r0, 0x5 negs r0, r0 @0806B1FE: ands r0, r1 strb r0, [r7, 0x13] b @0806B3D8 @0806B204: ldrb r0, [r4] lsls r0, 7 ldrb r2, [r5, 0x7] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r5, 0x7] b @0806B3D8 @0806B214: ldrb r1, [r4] movs r0, 0x7 ands r1, r0 ldrb r2, [r5, 0x8] movs r0, 0x8 negs r0, r0 b @0806B230 @0806B222: ldrb r1, [r4] movs r0, 0x7 ands r1, r0 lsls r1, 3 ldrb r2, [r5, 0x8] movs r0, 0x39 negs r0, r0 @0806B230: ands r0, r2 orrs r0, r1 strb r0, [r5, 0x8] b @0806B3D8 @0806B238: ldrb r1, [r4] movs r0, 0x7 ands r1, r0 lsls r1, 6 ldrh r2, [r5, 0x8] ldr r0, =0xfffffe3f ands r0, r2 orrs r0, r1 strh r0, [r5, 0x8] b @0806B3D8 .align 2, 0 .pool @0806B250: ldrb r1, [r4] movs r0, 0x7 ands r1, r0 lsls r1, 1 ldrb r2, [r5, 0x9] movs r0, 0xF negs r0, r0 b @0806B26E @0806B260: ldrb r1, [r4] movs r0, 0x7 ands r1, r0 lsls r1, 4 ldrb r2, [r5, 0x9] movs r0, 0x71 negs r0, r0 @0806B26E: ands r0, r2 orrs r0, r1 strb r0, [r5, 0x9] b @0806B3D8 @0806B276: ldrb r0, [r4] lsls r0, 7 ldrb r2, [r5, 0x9] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r5, 0x9] b @0806B3D8 @0806B286: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 ldrb r2, [r5, 0xA] movs r0, 0x2 negs r0, r0 b @0806B2F2 @0806B294: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 lsls r1, 1 ldrb r2, [r5, 0xA] movs r0, 0x3 negs r0, r0 b @0806B2F2 @0806B2A4: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 lsls r1, 2 ldrb r2, [r5, 0xA] movs r0, 0x5 negs r0, r0 b @0806B2F2 @0806B2B4: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 lsls r1, 3 ldrb r2, [r5, 0xA] movs r0, 0x9 negs r0, r0 b @0806B2F2 @0806B2C4: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 lsls r1, 4 ldrb r2, [r5, 0xA] movs r0, 0x11 negs r0, r0 b @0806B2F2 @0806B2D4: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 lsls r1, 5 ldrb r2, [r5, 0xA] movs r0, 0x21 negs r0, r0 b @0806B2F2 @0806B2E4: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 lsls r1, 6 ldrb r2, [r5, 0xA] movs r0, 0x41 negs r0, r0 @0806B2F2: ands r0, r2 orrs r0, r1 strb r0, [r5, 0xA] b @0806B3D8 @0806B2FA: ldrb r0, [r4] lsls r0, 7 ldrb r2, [r5, 0xA] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r5, 0xA] b @0806B3D8 @0806B30A: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 ldrb r2, [r5, 0xB] movs r0, 0x2 negs r0, r0 b @0806B346 @0806B318: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 lsls r1, 1 ldrb r2, [r5, 0xB] movs r0, 0x3 negs r0, r0 b @0806B346 @0806B328: ldrb r1, [r4] movs r0, 0x1 ands r1, r0 lsls r1, 2 ldrb r2, [r5, 0xB] movs r0, 0x5 negs r0, r0 b @0806B346 @0806B338: ldrb r1, [r4] movs r0, 0xF ands r1, r0 lsls r1, 3 ldrb r2, [r5, 0xB] movs r0, 0x79 negs r0, r0 @0806B346: ands r0, r2 orrs r0, r1 strb r0, [r5, 0xB] b @0806B3D8 @0806B34E: ldrb r0, [r4] lsls r0, 7 ldrb r2, [r5, 0xB] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r5, 0xB] b @0806B3D8 @0806B35E: ldrb r3, [r4] ldrb r0, [r4, 0x1] lsls r0, 8 orrs r3, r0 ldrb r0, [r4, 0x2] lsls r0, 16 orrs r3, r0 ldrb r0, [r4, 0x3] lsls r0, 24 orrs r3, r0 movs r4, 0x1F adds r1, r3, 0 ands r1, r4 ldrb r2, [r5, 0x4] movs r0, 0x20 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x4] lsrs r1, r3, 5 ands r1, r4 lsls r1, 5 ldrh r2, [r5, 0x4] ldr r0, =0xfffffc1f ands r0, r2 orrs r0, r1 strh r0, [r5, 0x4] lsrs r1, r3, 10 ands r1, r4 lsls r1, 2 ldrb r2, [r5, 0x5] movs r0, 0x7D negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x5] lsrs r1, r3, 15 ands r1, r4 lsls r1, 15 ldr r0, [r5, 0x4] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [r5, 0x4] lsrs r1, r3, 20 ands r1, r4 lsls r1, 4 ldrh r2, [r5, 0x6] ldr r0, =0xfffffe0f ands r0, r2 orrs r0, r1 strh r0, [r5, 0x6] lsrs r3, 25 ands r3, r4 lsls r3, 1 ldrb r1, [r5, 0x7] movs r0, 0x3F negs r0, r0 ands r0, r1 orrs r0, r3 @0806B3D6: strb r0, [r5, 0x7] @0806B3D8: mov r0, r10 cmp r0, 0xA ble @0806B3EC adds r0, r7, 0 bl pokemon_calc_checksum strh r0, [r7, 0x1C] adds r0, r7, 0 bl pokemon_encrypt @0806B3EC: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end pokemon_setattr_encrypted thumb_func_start memcpy_pokemon ; void *memcpy_pokemon(void *dest, void *src, unsigned int size) memcpy_pokemon: ; 806B408 push {lr} bl memcpy pop {r0} bx r0 thumb_func_end memcpy_pokemon thumb_func_start pokemon_catch ; int pokemon_catch(pokemon *mon) pokemon_catch: ; 806B414 push {r4-r6,lr} adds r6, r0, 0 ldr r4, =0x03005d90 ldr r2, [r4] movs r1, 0x7 bl pokemon_setattr ldr r2, [r4] adds r2, 0x8 adds r0, r6, 0 movs r1, 0x31 bl pokemon_setattr ldr r2, [r4] adds r2, 0xA adds r0, r6, 0 movs r1, 0x1 bl pokemon_setattr movs r5, 0 b @0806B446 .align 2, 0 .pool @0806B444: adds r5, 0x1 @0806B446: cmp r5, 0x5 bgt @0806B480 movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr cmp r0, 0 bne @0806B444 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x64 bl memcpy_pokemon ldr r1, =0x020244e9 adds r0, r5, 0x1 strb r0, [r1] movs r0, 0 b @0806B48A .align 2, 0 .pool @0806B480: adds r0, r6, 0 bl pokemon_add_to_pc lsls r0, 24 lsrs r0, 24 @0806B48A: pop {r4-r6} pop {r1} bx r1 thumb_func_end pokemon_catch thumb_func_start pokemon_add_to_pc ; int pokemon_add_to_pc(pokemon *mon) pokemon_add_to_pc: ; 806B490 push {r4-r7,lr} mov r7, r8 push {r7} mov r8, r0 ldr r0, =0x00004036 bl 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, =0x020375f6 strh r5, [r0] ldr r0, =0x020375f8 strh r6, [r0] bl get_unknown_box_id lsls r0, 16 lsrs r0, 16 cmp r0, r5 beq @0806B4F4 ldr r0, =0x000008d7 bl flag_clear @0806B4F4: lsls r1, r5, 16 ldr r0, =0x00004036 lsrs r1, 16 bl var_set movs r0, 0x1 b @0806B530 .align 2, 0 .pool @0806B514: adds r6, 0x1 cmp r6, 0x1D ble @0806B4B2 adds r5, 0x1 cmp r5, 0xE bne @0806B522 movs r5, 0 @0806B522: bl get_preferred_box lsls r0, 24 lsrs r0, 24 cmp r5, r0 bne @0806B4AE movs r0, 0x2 @0806B530: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end pokemon_add_to_pc thumb_func_start calc_player_party_count ; u8 calc_player_party_count() calc_player_party_count: ; 806B53C push {r4,lr} ldr r0, =0x020244e9 movs r1, 0 strb r1, [r0] b @0806B554 .align 2, 0 .pool @0806B54C: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] adds r0, r4, 0 @0806B554: adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0x5 bhi @0806B572 adds r1, r0, 0 movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr cmp r0, 0 bne @0806B54C @0806B572: ldrb r0, [r4] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end calc_player_party_count thumb_func_start calc_enemy_party_count ; u8 calc_enemy_party_count() calc_enemy_party_count: ; 806B580 push {r4,lr} ldr r0, =0x020244ea movs r1, 0 strb r1, [r0] b @0806B598 .align 2, 0 .pool @0806B590: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] adds r0, r4, 0 @0806B598: adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0x5 bhi @0806B5B6 adds r1, r0, 0 movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr cmp r0, 0 bne @0806B590 @0806B5B6: ldrb r0, [r4] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end calc_enemy_party_count thumb_func_start sub_806B5C4 sub_806B5C4: ; 806B5C4 push {r4-r6,lr} movs r6, 0 bl calc_player_party_count ldr r1, =0x020244e9 ldrb r0, [r1] cmp r0, 0x1 beq @0806B628 movs r5, 0 ldrb r1, [r1] cmp r6, r1 bge @0806B620 @0806B5DC: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @0806B616 adds r0, r4, 0 movs r1, 0x39 movs r2, 0 bl pokemon_getattr cmp r0, 0 beq @0806B616 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr cmp r0, 0 beq @0806B616 adds r6, 0x1 @0806B616: adds r5, 0x1 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r5, r0 blt @0806B5DC @0806B620: movs r0, 0 cmp r6, 0x1 bgt @0806B628 movs r0, 0x2 @0806B628: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr adds r1, r0, 0 movs r0, 0xCE lsls r0, 1 cmp r1, r0 beq @0806B670 cmp r1, 0 beq @0806B670 adds r0, r4, 0 movs r1, 0x39 movs r2, 0 bl pokemon_getattr cmp r0, 0 beq @0806B670 adds r6, 0x1 @0806B670: adds r5, 0x1 cmp r5, 0x5 ble @0806B63E cmp r6, 0x1 bne @0806B684 movs r0, 0x1 b @0806B68C .align 2, 0 .pool @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 ; int sub_806B694(u16 a1, int a2) sub_806B694: ; 806B694 push {lr} lsls r0, 16 lsrs r3, r0, 16 lsls r1, 24 cmp r1, 0 beq @0806B6B8 ldr r2, =0x0202420a ldr r1, =gBaseStats lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x17] b @0806B6C6 .align 2, 0 .pool @0806B6B8: ldr r2, =0x0202420a ldr r1, =gBaseStats lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x16] @0806B6C6: strb r0, [r2] ldrb r0, [r2] pop {r1} bx r1 .align 2, 0 .pool 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, =0x020244a8 ldr r0, [r4] ldr r0, [r0] adds r1, r5, 0 movs r2, 0xA0 bl memcpy movs r0, 0 mov r9, r0 @0806B730: ldr r1, =0x020244a8 ldr r3, [r1] ldr r2, [r3] mov r4, r9 lsls r7, r4, 1 adds r0, r2, 0 adds r0, 0x7C adds r1, r0, r7 ldrh r0, [r1] adds r4, 0x1 str r4, [sp, 0x10] cmp r0, 0 beq @0806B80A movs r0, 0x64 mov r6, r9 muls r6, r0 ldr r4, =0x02024744 mov r8, r4 adds r5, r6, r4 ldrh r1, [r1] adds r0, r2, 0 adds r0, 0x94 add r0, r9 ldrb r2, [r0] movs r0, 0x1 str r0, [sp] ldr r0, [r3] mov r3, r9 lsls r4, r3, 2 adds r0, 0x34 adds r0, r4 ldr r0, [r0] str r0, [sp, 0x4] movs r0, 0x2 str r0, [sp, 0x8] movs r0, 0 str r0, [sp, 0xC] adds r0, r5, 0 movs r3, 0xF bl create_pokemon_set_level ldr r1, =0x020244a8 ldr r0, [r1] adds r1, r7, 0 adds r1, 0x88 ldr r2, [r0] adds r2, r1 adds r0, r5, 0 movs r1, 0xC bl pokemon_setattr movs r5, 0 mov r10, r4 mov r7, r9 adds r7, 0x9A mov r4, r8 @0806B7A0: adds r1, r5, 0 adds r1, 0x1A ldr r2, =0x020244a8 ldr r0, [r2] ldr r2, [r0] adds r2, r7 adds r0, r6, r4 bl pokemon_setattr adds r5, 0x1 cmp r5, 0x5 ble @0806B7A0 movs r5, 0 movs r3, 0x64 mov r0, r9 muls r0, r3 ldr r1, =0x02024744 adds r7, r0, r1 mov r4, r10 lsls r0, r4, 1 adds r6, r0, 0 adds r6, 0x4C adds r4, r0, 0 @0806B7CE: adds r1, r5, 0 adds r1, 0xD ldr r2, =0x020244a8 ldr r0, [r2] ldr r2, [r0] adds r2, r6 adds r0, r7, 0 bl pokemon_setattr adds r1, r5, 0 adds r1, 0x11 ldr r3, =0x020244a8 ldr r0, [r3] ldr r0, [r0] adds r0, 0x4C adds r0, r4 ldrh r0, [r0] lsls r2, r0, 1 adds r2, r0 lsls r2, 2 ldr r0, =gBattleMoves + 0x4 ; PP offset adds r2, r0 adds r0, r7, 0 bl pokemon_setattr adds r6, 0x2 adds r4, 0x2 adds r5, 0x1 cmp r5, 0x3 ble @0806B7CE @0806B80A: ldr r4, [sp, 0x10] mov r9, r4 cmp r4, 0x5 ble @0806B730 add sp, 0x14 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end create_enemy_party thumb_func_start sub_806B830 sub_806B830: ; 806B830 push {r4,r5,lr} ldr r5, =gUnknown_08329EB8 ldr r0, =0x020244a8 ldr r0, [r0] ldr r4, [r0] ldrb r0, [r4, 0x9] movs r1, 0x5 bl __umodsi3 lsls r0, 24 lsrs r0, 24 ldrb r2, [r4, 0x1] lsls r2, 27 lsrs r2, 31 lsls r1, r2, 2 adds r1, r2 adds r0, r1 adds r0, r5 ldrb r0, [r0] ldr r1, =gUnknown_0831F578 adds r0, r1 ldrb r0, [r0] pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806B830 thumb_func_start sub_806B870 sub_806B870: ; 806B870 push {r4,r5,lr} ldr r5, =gUnknown_08329EB8 ldr r0, =0x020244a8 ldr r0, [r0] ldr r4, [r0] ldrb r0, [r4, 0x9] movs r1, 0x5 bl __umodsi3 lsls r0, 24 lsrs r0, 24 ldrb r2, [r4, 0x1] lsls r2, 27 lsrs r2, 31 lsls r1, r2, 2 adds r1, r2 adds r0, r1 adds r0, r5 ldrb r0, [r0] ldr r1, =gTrainerClassNameIndices adds r0, r1 ldrb r0, [r0] pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806B870 thumb_func_start sub_806B8B0 sub_806B8B0: ; 806B8B0 push {r4,lr} movs r4, 0 @0806B8B4: movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr cmp r0, 0 bne @0806B8D0 movs r0, 0 b @0806B8DE .align 2, 0 .pool @0806B8D0: adds r4, 0x1 cmp r4, 0x5 ble @0806B8B4 bl sub_806B8E4 lsls r0, 24 lsrs r0, 24 @0806B8DE: pop {r4} pop {r1} bx r1 thumb_func_end sub_806B8B0 thumb_func_start sub_806B8E4 sub_806B8E4: ; 806B8E4 push {r4-r6,lr} movs r6, 0 @0806B8E8: movs r4, 0 lsls r5, r6, 24 @0806B8EC: lsls r1, r4, 24 lsrs r1, 24 lsrs r0, r5, 24 movs r2, 0xB bl get_pokemon_data_from_any_box cmp r0, 0 bne @0806B900 movs r0, 0 b @0806B90E @0806B900: adds r4, 0x1 cmp r4, 0x1D ble @0806B8EC adds r6, 0x1 cmp r6, 0xD ble @0806B8E8 movs r0, 0x1 @0806B90E: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_806B8E4 thumb_func_start get_pokemon_name ; void get_pokemon_name(char *dest, u16 species_num) 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, =gSpeciesNames movs r0, 0xB muls r0, r5 adds r3, r0, r7 adds r2, r6, 0 b @0806B93A .align 2, 0 .pool @0806B934: adds r3, 0x1 adds r2, 0x1 adds r1, 0x1 @0806B93A: adds r4, r6, r1 cmp r1, 0xA bgt @0806B954 cmp r5, r12 bls @0806B94A adds r0, r1, r7 ldrb r0, [r0] b @0806B94C @0806B94A: ldrb r0, [r3] @0806B94C: strb r0, [r2] ldrb r0, [r4] cmp r0, 0xFF bne @0806B934 @0806B954: movs r0, 0xFF strb r0, [r4] pop {r4-r7} pop {r0} bx r0 thumb_func_end 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, =gBattleMoves lsls r3, r0, 1 adds r3, r0 lsls r3, 2 adds r3, r4 ldrb r4, [r3, 0x4] ldr r0, =gUnknown_08329D22 adds r0, r2, r0 ldrb r3, [r0] ands r3, r1 lsls r2, 1 asrs r3, r2 lsls r0, r3, 2 adds r0, r3 lsls r0, 2 muls r0, r4 movs r1, 0x64 bl __divsi3 adds r4, r0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_08329D26 adds r4, r1 ldrb r1, [r4] ands r1, r0 mov r0, sp strb r1, [r0] adds r0, r5, 0 movs r1, 0x15 mov r2, sp bl pokemon_setattr add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806B9A8 thumb_func_start sub_806B9E4 sub_806B9E4: ; 806B9E4 lsls r1, 24 lsrs r1, 24 adds r0, 0x3B ldr r2, =gUnknown_08329D26 adds r1, r2 ldrb r2, [r0] ldrb r1, [r1] ands r1, r2 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_806B9E4 thumb_func_start battle_data_fill battle_data_fill: ; 806B9FC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x14] lsls r1, 24 lsrs r1, 24 mov r9, r1 movs r0, 0x64 mov r5, r9 muls r5, r0 ldr r0, =0x020244ec adds r5, r0 adds r0, r5, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr ldr r1, =0x02024084 mov r8, r1 movs r1, 0x58 ldr r2, [sp, 0x14] adds r4, r2, 0 muls r4, r1 mov r3, r8 adds r6, r4, r3 strh r0, [r6] adds r0, r5, 0 movs r1, 0xC movs r2, 0 bl pokemon_getattr strh r0, [r6, 0x2E] movs r6, 0 mov r0, r8 adds r0, 0x24 adds r7, r4, r0 @0806BA4E: adds r1, r6, 0 adds r1, 0xD adds r0, r5, 0 movs r2, 0 bl pokemon_getattr movs r1, 0xC add r1, r8 mov r10, r1 adds r1, r4, r1 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r5, 0 movs r2, 0 bl pokemon_getattr strb r0, [r7] adds r7, 0x1 adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @0806BA4E movs r0, 0x64 mov r4, r9 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 movs r2, 0 bl pokemon_getattr movs r2, 0xC negs r2, r2 add r2, r10 mov r9, r2 movs r1, 0x58 ldr r3, [sp, 0x14] adds r5, r3, 0 muls r5, r1 adds r7, r5, r2 adds r1, r7, 0 adds r1, 0x3B strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 movs r2, 0 bl pokemon_getattr adds r1, r7, 0 adds r1, 0x2B strb r0, [r1] adds r0, r4, 0 movs r1, 0x19 movs r2, 0 bl pokemon_getattr mov r1, r10 adds r1, 0x38 adds r1, r5, r1 str r0, [r1] adds r0, r4, 0 movs r1, 0x27 movs r2, 0 bl pokemon_getattr movs r6, 0x1F ands r0, r6 ldrb r2, [r7, 0x14] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r7, 0x14] adds r0, r4, 0 movs r1, 0x28 movs r2, 0 bl pokemon_getattr movs r1, 0x1F mov r8, r1 mov r2, r8 ands r0, r2 lsls r0, 5 ldrh r2, [r7, 0x14] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r7, 0x14] adds r0, r4, 0 movs r1, 0x29 movs r2, 0 bl pokemon_getattr ands r0, r6 lsls r0, 2 ldrb r2, [r7, 0x15] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r7, 0x15] adds r0, r4, 0 movs r1, 0x2A movs r2, 0 bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [r7, 0x14] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [r7, 0x14] adds r0, r4, 0 movs r1, 0x2B movs r2, 0 bl pokemon_getattr mov r3, r8 ands r0, r3 lsls r0, 4 ldrh r2, [r7, 0x16] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r7, 0x16] adds r0, r4, 0 movs r1, 0x2C movs r2, 0 bl pokemon_getattr ands r0, r6 lsls r0, 1 ldrb r2, [r7, 0x17] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r7, 0x17] adds r0, r4, 0 movs r1, 0 movs r2, 0 bl pokemon_getattr mov r1, r10 adds r1, 0x3C adds r1, r5, r1 str r0, [r1] adds r0, r4, 0 movs r1, 0x37 movs r2, 0 bl pokemon_getattr mov r1, r10 adds r1, 0x40 adds r1, r5, r1 str r0, [r1] adds r0, r4, 0 movs r1, 0x38 movs r2, 0 bl pokemon_getattr adds r1, r7, 0 adds r1, 0x2A strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 movs r2, 0 bl pokemon_getattr strh r0, [r7, 0x28] adds r0, r4, 0 movs r1, 0x3A movs r2, 0 bl pokemon_getattr strh r0, [r7, 0x2C] adds r0, r4, 0 movs r1, 0x3B movs r2, 0 bl pokemon_getattr strh r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x3C movs r2, 0 bl pokemon_getattr strh r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x3D movs r2, 0 bl pokemon_getattr strh r0, [r7, 0x6] adds r0, r4, 0 movs r1, 0x3E movs r2, 0 bl pokemon_getattr strh r0, [r7, 0x8] adds r0, r4, 0 movs r1, 0x3F movs r2, 0 bl pokemon_getattr strh r0, [r7, 0xA] adds r0, r4, 0 movs r1, 0x2D movs r2, 0 bl pokemon_getattr movs r1, 0x1 ands r0, r1 lsls r0, 6 ldrb r2, [r7, 0x17] movs r1, 0x41 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r7, 0x17] adds r0, r4, 0 movs r1, 0x2E movs r2, 0 bl pokemon_getattr lsls r0, 7 ldrb r2, [r7, 0x17] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r7, 0x17] adds r0, r4, 0 movs r1, 0x1 movs r2, 0 bl pokemon_getattr mov r1, r10 adds r1, 0x48 adds r1, r5, r1 str r0, [r1] ldr r2, =gBaseStats ldrh r1, [r7] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x6] adds r1, r7, 0 adds r1, 0x21 strb r0, [r1] ldrh r1, [r7] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x7] adds r1, r7, 0 adds r1, 0x22 strb r0, [r1] ldrh r0, [r7] ldrb r1, [r7, 0x17] lsrs r1, 7 bl sub_806B694 adds r1, r7, 0 adds r1, 0x20 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2 mov r2, sp bl pokemon_getattr mov r0, r10 adds r0, 0x24 adds r0, r5, r0 mov r1, sp bl 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, =0x0202449c lsls r0, 24 lsrs r0, 23 adds r0, 0xA8 ldr r1, [r1] adds r1, r0 ldrh r0, [r7, 0x28] strh r0, [r1] movs r2, 0x6 mov r1, r9 movs r6, 0x7 add r5, r10 adds r0, r5, 0 adds r0, 0x13 @0806BCB2: strb r2, [r0] subs r0, 0x1 subs r6, 0x1 cmp r6, 0 bge @0806BCB2 movs r2, 0 movs r0, 0x58 ldr r3, [sp, 0x14] muls r0, r3 adds r1, 0x50 adds r0, r1 str r2, [r0] ldr r0, [sp, 0x14] bl sub_803FA70 ldr r0, [sp, 0x14] movs r1, 0 bl sub_805EF84 add sp, 0x18 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806BDA8 ldr r2, =0x02024404 ldr r0, =0x020244b8 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x7] b @0806BDC4 .align 2, 0 .pool @0806BDA8: ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003226 adds r0, r2 ldrb r0, [r0] b @0806BDC4 .align 2, 0 .pool @0806BDBC: bl itemid_get_x12 lsls r0, 24 lsrs r0, 24 @0806BDC4: str r0, [sp, 0x34] ldr r1, =0x0202420f ldr r0, =0x020244b8 ldrb r2, [r0] strb r2, [r1] ldr r0, =0x030022c0 ldr r3, =0x00000439 adds r0, r3 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @0806BE64 ldr r0, =0x02024064 strb r2, [r0] ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 negs r1, r0 orrs r1, r0 lsrs r1, 31 str r1, [sp, 0x1C] ldr r0, =0x0202406c ldr r4, [sp, 0xC] subs r4, 0xD ldrb r0, [r0] cmp r1, r0 bge @0806BE70 ldr r2, =0x0202406e lsls r0, r1, 1 adds r0, r2 ldrh r3, [r0] ldr r5, [sp, 0x10] lsls r0, r5, 16 lsrs r1, r0, 16 adds r5, r0, 0 cmp r3, r1 bne @0806BE3C ldr r0, [sp, 0x1C] str r0, [sp, 0x38] b @0806BE70 .align 2, 0 .pool @0806BE3C: ldr r1, [sp, 0x1C] adds r1, 0x2 str r1, [sp, 0x1C] ldr r0, =0x0202406c ldrb r0, [r0] cmp r1, r0 bge @0806BE70 lsls r0, r1, 1 adds r0, r2 ldrh r1, [r0] lsrs r0, r5, 16 cmp r1, r0 bne @0806BE3C ldr r2, [sp, 0x1C] lsls r0, r2, 24 lsrs r0, 24 str r0, [sp, 0x38] b @0806BE70 .align 2, 0 .pool @0806BE64: ldr r0, =0x02024064 strb r1, [r0] movs r3, 0x4 str r3, [sp, 0x38] ldr r4, [sp, 0xC] subs r4, 0xD @0806BE70: lsls r0, r4, 16 lsrs r0, 16 cmp r0, 0xA5 bhi @0806BEF0 ldr r1, =gItemEffectInfoPointers lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] cmp r0, 0 bne @0806BE94 ldr r5, [sp, 0xC] cmp r5, 0xAF beq @0806BE9A b @0806BEF0 .align 2, 0 .pool @0806BE94: ldr r1, [sp, 0xC] cmp r1, 0xAF bne @0806BEF6 @0806BE9A: ldr r0, =0x030022c0 ldr r2, =0x00000439 adds r0, r2 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806BECC ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 ldr r1, =0x0202440c adds r0, r1 b @0806BEF6 .align 2, 0 .pool @0806BECC: ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00003214 adds r3, r0, r3 str r3, [sp, 0x24] b @0806BEF8 .align 2, 0 .pool @0806BEE0: mov r0, r8 movs r2, 0 ldr r3, [sp, 0x10] bl sub_813DA40 movs r0, 0 bl @0806CD5C @0806BEF0: movs r0, 0x1 bl @0806CD5C @0806BEF6: str r0, [sp, 0x24] @0806BEF8: movs r5, 0 str r5, [sp, 0x1C] @0806BEFC: ldr r0, [sp, 0x1C] cmp r0, 0x5 bls @0806BF06 bl @0806CD4C @0806BF06: lsls r0, 2 ldr r1, =@0806BF14 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806BF14: .4byte @0806BF2C .4byte @0806BFFC .4byte @0806C08C .4byte @0806C120 .4byte @0806C300 .4byte @0806C9BE @0806BF2C: ldr r1, [sp, 0x24] ldr r3, [sp, 0x1C] adds r2, r1, r3 ldrb r1, [r2] movs r0, 0x80 ands r0, r1 adds r6, r2, 0 cmp r0, 0 beq @0806BF76 ldr r0, =0x030022c0 ldr r5, =0x00000439 adds r0, r5 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806BF76 ldr r0, [sp, 0x38] cmp r0, 0x4 beq @0806BF76 ldr r1, =0x02024084 movs r0, 0x58 ldr r2, [sp, 0x38] muls r0, r2 adds r1, 0x50 adds r2, r0, r1 ldr r1, [r2] movs r0, 0xF0 lsls r0, 12 ands r0, r1 cmp r0, 0 beq @0806BF76 ldr r0, =0xfff0ffff ands r1, r0 str r1, [r2] movs r3, 0 str r3, [sp, 0x20] @0806BF76: ldrb r1, [r6] movs r0, 0x30 ands r0, r1 cmp r0, 0 beq @0806BFA4 ldr r1, =0x02024084 ldr r0, =0x02024064 ldrb r2, [r0] movs r0, 0x58 muls r0, r2 adds r1, 0x50 adds r2, r0, r1 ldr r1, [r2] movs r3, 0x80 lsls r3, 13 adds r0, r1, 0 ands r0, r3 cmp r0, 0 bne @0806BFA4 orrs r1, r3 str r1, [r2] movs r5, 0 str r5, [sp, 0x20] @0806BFA4: ldrb r0, [r6] movs r3, 0xF ands r3, r0 cmp r3, 0 bne @0806BFB2 bl @0806CD4C @0806BFB2: ldr r6, =0x02024084 ldr r5, =0x02024064 ldrb r0, [r5] movs r4, 0x58 muls r0, r4 adds r1, r0, r6 ldrb r2, [r1, 0x19] movs r0, 0x19 ldrsb r0, [r1, r0] cmp r0, 0xB ble @0806BFCC bl @0806CD4C @0806BFCC: adds r0, r2, r3 strb r0, [r1, 0x19] ldrb r0, [r5] muls r0, r4 adds r1, r0, r6 movs r0, 0x19 ldrsb r0, [r1, r0] cmp r0, 0xC bgt @0806BFE0 b @0806C110 @0806BFE0: movs r0, 0xC strb r0, [r1, 0x19] b @0806C110 .align 2, 0 .pool @0806BFFC: ldr r1, [sp, 0x24] ldr r3, [sp, 0x1C] adds r2, r1, r3 ldrb r1, [r2] movs r0, 0xF0 ands r0, r1 lsls r3, r0, 24 adds r6, r2, 0 cmp r3, 0 beq @0806C042 ldr r7, =0x02024084 ldr r5, =0x02024064 ldrb r0, [r5] movs r4, 0x58 muls r0, r4 adds r1, r0, r7 ldrb r2, [r1, 0x1A] movs r0, 0x1A ldrsb r0, [r1, r0] cmp r0, 0xB bgt @0806C042 lsrs r0, r3, 28 adds r0, r2, r0 strb r0, [r1, 0x1A] ldrb r0, [r5] muls r0, r4 adds r1, r0, r7 movs r0, 0x1A ldrsb r0, [r1, r0] cmp r0, 0xC ble @0806C03E movs r0, 0xC strb r0, [r1, 0x1A] @0806C03E: movs r5, 0 str r5, [sp, 0x20] @0806C042: ldrb r0, [r6] movs r3, 0xF ands r3, r0 cmp r3, 0 bne @0806C050 bl @0806CD4C @0806C050: ldr r6, =0x02024084 ldr r5, =0x02024064 ldrb r0, [r5] movs r4, 0x58 muls r0, r4 adds r1, r0, r6 ldrb r2, [r1, 0x1B] movs r0, 0x1B ldrsb r0, [r1, r0] cmp r0, 0xB ble @0806C06A bl @0806CD4C @0806C06A: adds r0, r2, r3 strb r0, [r1, 0x1B] ldrb r0, [r5] muls r0, r4 adds r1, r0, r6 movs r0, 0x1B ldrsb r0, [r1, r0] cmp r0, 0xC ble @0806C110 movs r0, 0xC strb r0, [r1, 0x1B] b @0806C110 .align 2, 0 .pool @0806C08C: ldr r1, [sp, 0x24] ldr r3, [sp, 0x1C] adds r2, r1, r3 ldrb r1, [r2] movs r0, 0xF0 ands r0, r1 lsls r3, r0, 24 adds r6, r2, 0 cmp r3, 0 beq @0806C0D2 ldr r7, =0x02024084 ldr r5, =0x02024064 ldrb r0, [r5] movs r4, 0x58 muls r0, r4 adds r1, r0, r7 ldrb r2, [r1, 0x1E] movs r0, 0x1E ldrsb r0, [r1, r0] cmp r0, 0xB bgt @0806C0D2 lsrs r0, r3, 28 adds r0, r2, r0 strb r0, [r1, 0x1E] ldrb r0, [r5] muls r0, r4 adds r1, r0, r7 movs r0, 0x1E ldrsb r0, [r1, r0] cmp r0, 0xC ble @0806C0CE movs r0, 0xC strb r0, [r1, 0x1E] @0806C0CE: movs r5, 0 str r5, [sp, 0x20] @0806C0D2: ldrb r0, [r6] movs r3, 0xF ands r3, r0 cmp r3, 0 bne @0806C0E0 bl @0806CD4C @0806C0E0: ldr r6, =0x02024084 ldr r5, =0x02024064 ldrb r0, [r5] movs r4, 0x58 muls r0, r4 adds r1, r0, r6 ldrb r2, [r1, 0x1C] movs r0, 0x1C ldrsb r0, [r1, r0] cmp r0, 0xB ble @0806C0FA bl @0806CD4C @0806C0FA: adds r0, r2, r3 strb r0, [r1, 0x1C] ldrb r0, [r5] muls r0, r4 adds r1, r0, r6 movs r0, 0x1C ldrsb r0, [r1, r0] cmp r0, 0xC ble @0806C110 movs r0, 0xC strb r0, [r1, 0x1C] @0806C110: movs r0, 0 str r0, [sp, 0x20] bl @0806CD4C .align 2, 0 .pool @0806C120: ldr r1, [sp, 0x24] ldr r3, [sp, 0x1C] adds r2, r1, r3 ldrb r1, [r2] movs r0, 0x80 ands r0, r1 adds r6, r2, 0 cmp r0, 0 beq @0806C168 ldr r5, =0x02024294 ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r5 ldrb r0, [r1, 0x4] cmp r0, 0 bne @0806C168 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r5 movs r0, 0x5 strb r0, [r1, 0x4] movs r5, 0 str r5, [sp, 0x20] @0806C168: ldrb r1, [r6] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0806C1CA mov r0, r8 movs r1, 0x38 movs r2, 0 bl pokemon_getattr cmp r0, 0x64 beq @0806C1CA ldr r5, =gExperienceTables mov r0, r8 movs r1, 0x38 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 mov r0, r8 movs r1, 0xB movs r2, 0 bl pokemon_getattr adds r4, 0x1 lsls r4, 2 ldr r2, =gBaseStats lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 ldrb r1, [r1, 0x13] movs r0, 0xCA lsls r0, 1 muls r0, r1 adds r4, r0 adds r4, r5 ldr r0, [r4] str r0, [sp] mov r0, r8 movs r1, 0x19 mov r2, sp bl pokemon_setattr mov r0, r8 bl pokemon_calc_effective_stats movs r0, 0 str r0, [sp, 0x20] @0806C1CA: ldrb r1, [r6] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @0806C206 mov r0, r8 ldr r1, [sp, 0x10] movs r2, 0x7 ldr r3, [sp, 0x38] bl pokemon_clear_ailments lsls r0, 24 cmp r0, 0 bne @0806C206 ldr r1, [sp, 0x38] cmp r1, 0x4 beq @0806C202 ldr r1, =0x02024084 movs r0, 0x58 ldr r3, [sp, 0x38] adds r2, r3, 0 muls r2, r0 adds r1, 0x50 adds r2, r1 ldr r0, [r2] ldr r1, =0xf7ffffff ands r0, r1 str r0, [r2] @0806C202: movs r5, 0 str r5, [sp, 0x20] @0806C206: ldrb r1, [r6] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @0806C226 ldr r2, =0x00000f88 mov r0, r8 ldr r1, [sp, 0x10] ldr r3, [sp, 0x38] bl 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, =0x030022c0 ldr r5, =0x00000439 adds r0, r5 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0806C2A8 bl @0806CD4C @0806C2A8: ldr r0, [sp, 0x38] cmp r0, 0x4 bne @0806C2B2 bl @0806CD4C @0806C2B2: ldr r1, =0x02024084 movs r0, 0x58 ldr r2, [sp, 0x38] muls r0, r2 adds r1, 0x50 adds r2, r0, r1 ldr r1, [r2] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @0806C2CC bl @0806CD4C @0806C2CC: movs r0, 0x8 negs r0, r0 ands r1, r0 str r1, [r2] movs r3, 0 str r3, [sp, 0x20] bl @0806CD4C .align 2, 0 .pool @0806C300: ldr r5, [sp, 0x24] ldr r1, [sp, 0x1C] adds r0, r5, r1 ldrb r0, [r0] mov r10, r0 movs r0, 0x20 mov r2, r10 ands r0, r2 cmp r0, 0 beq @0806C3D8 movs r0, 0xDF ands r2, r0 mov r10, r2 mov r0, r8 movs r1, 0x15 movs r2, 0 bl pokemon_getattr ldr r1, =gUnknown_08329D22 ldr r3, [sp, 0x14] adds r1, r3, r1 ldrb r1, [r1] ands r0, r1 lsls r1, r3, 1 lsrs r0, r1 str r0, [sp] adds r5, r3, 0 adds r5, 0xD mov r0, r8 adds r1, r5, 0 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 bl pokemon_getattr adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 ldr r2, [sp, 0x14] bl 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, =gUnknown_08329D2A ldr r2, [sp, 0x14] adds r1, r2, r1 ldrb r1, [r1] adds r0, r1 str r0, [sp] mov r0, r8 movs r1, 0x15 mov r2, sp bl pokemon_setattr mov r0, r8 adds r1, r5, 0 movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 ldr r1, [sp] lsls r1, 24 lsrs r1, 24 ldr r2, [sp, 0x14] bl 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, =@0806C410 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806C410: .4byte @0806C430 .4byte @0806C430 .4byte @0806C4DC .4byte @0806C700 .4byte @0806C9AA .4byte @0806C9AA .4byte @0806C9AA .4byte @0806C994 @0806C430: mov r0, r8 bl sub_806DC8C lsls r0, 16 lsrs r6, r0, 16 ldr r5, [sp, 0x24] ldr r1, [sp, 0x28] adds r0, r5, r1 ldrb r5, [r0] ldr r0, =gUnknown_08329EC2 ldr r2, [sp, 0x2C] adds r0, r2, r0 ldrb r1, [r0] mov r0, r8 movs r2, 0 bl pokemon_getattr adds r1, r0, 0 str r1, [sp, 0x4] lsls r0, r5, 24 asrs r2, r0, 24 cmp r2, 0 ble @0806C498 ldr r0, =0x000001fd cmp r6, r0 bls @0806C466 b @0806BEF0 @0806C466: adds r3, r1, 0 cmp r3, 0x63 ble @0806C46E b @0806C9AA @0806C46E: adds r1, r3, r2 cmp r1, 0x64 ble @0806C484 adds r0, r2, 0 adds r0, 0x64 subs r5, r0, r1 b @0806C486 .align 2, 0 .pool @0806C484: adds r5, r2, 0 @0806C486: adds r1, r6, r5 movs r0, 0xFF lsls r0, 1 cmp r1, r0 bls @0806C494 adds r0, r5, r0 subs r5, r0, r1 @0806C494: adds r0, r3, r5 b @0806C4B2 @0806C498: cmp r1, 0 bne @0806C4A8 movs r3, 0x1 str r3, [sp, 0x3C] ldr r0, [sp, 0x28] adds r0, 0x1 lsls r0, 24 b @0806C83E @0806C4A8: adds r0, r1, r2 str r0, [sp, 0x4] cmp r0, 0 bge @0806C4B4 movs r0, 0 @0806C4B2: str r0, [sp, 0x4] @0806C4B4: ldr r0, =gUnknown_08329EC2 ldr r5, [sp, 0x2C] adds r0, r5, r0 ldrb r1, [r0] add r2, sp, 0x4 mov r0, r8 bl pokemon_setattr mov r0, r8 bl pokemon_calc_effective_stats ldr r0, [sp, 0x28] adds r0, 0x1 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x28] b @0806C978 .align 2, 0 .pool @0806C4DC: movs r0, 0x10 mov r1, r10 ands r0, r1 cmp r0, 0 beq @0806C59C mov r0, r8 movs r1, 0x39 movs r2, 0 bl pokemon_getattr cmp r0, 0 beq @0806C4FC ldr r0, [sp, 0x28] adds r0, 0x1 lsls r0, 24 b @0806C83E @0806C4FC: ldr r0, =0x030022c0 ldr r2, =0x00000439 adds r0, r2 ldrb r1, [r0] movs r4, 0x2 movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806C5B2 ldr r3, [sp, 0x38] cmp r3, 0x4 beq @0806C55C ldr r2, =0x02024210 ldr r1, =gUnknown_0832A328 lsls r0, r3, 2 adds r0, r1 ldr r1, [r0] ldrb r0, [r2] bics r0, r1 strb r0, [r2] ldr r1, =0x0202406e lsls r0, r3, 1 adds r0, r1 ldrb r0, [r0] bl pokemon_order_func adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r0, [sp, 0x38] bl battle_data_fill ldr r0, =0x02024064 ldrb r0, [r0] b @0806C574 .align 2, 0 .pool @0806C55C: ldr r3, =0x02024210 ldr r1, =gUnknown_0832A328 ldr r2, =0x02024064 ldrb r0, [r2] eors r0, r4 lsls r0, 2 adds r0, r1 ldr r1, [r0] ldrb r0, [r3] bics r0, r1 strb r0, [r3] ldrb r0, [r2] @0806C574: bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0806C5B2 ldr r1, =0x03005d10 ldrb r0, [r1, 0x4] cmp r0, 0xFE bhi @0806C5B2 adds r0, 0x1 strb r0, [r1, 0x4] b @0806C5B2 .align 2, 0 .pool @0806C59C: mov r0, r8 movs r1, 0x39 movs r2, 0 bl pokemon_getattr cmp r0, 0 bne @0806C5B2 ldr r0, [sp, 0x28] adds r0, 0x1 lsls r0, 24 b @0806C83E @0806C5B2: ldr r1, [sp, 0x28] adds r0, r1, 0x1 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x28] ldr r5, [sp, 0x24] adds r1, r5, r1 ldrb r1, [r1] str r1, [sp] adds r0, r1, 0 cmp r0, 0xFE beq @0806C5F4 cmp r0, 0xFE bhi @0806C5D4 cmp r0, 0xFD beq @0806C60A b @0806C612 @0806C5D4: cmp r1, 0xFF bne @0806C612 mov r0, r8 movs r1, 0x3A movs r2, 0 bl pokemon_getattr adds r4, r0, 0 mov r0, r8 movs r1, 0x39 movs r2, 0 bl pokemon_getattr subs r4, r0 str r4, [sp] b @0806C612 @0806C5F4: mov r0, r8 movs r1, 0x3A movs r2, 0 bl pokemon_getattr lsrs r0, 1 str r0, [sp] cmp r0, 0 bne @0806C612 movs r0, 0x1 b @0806C610 @0806C60A: ldr r0, =0x02024474 adds r0, 0x23 ldrb r0, [r0] @0806C610: str r0, [sp] @0806C612: mov r0, r8 movs r1, 0x3A movs r2, 0 bl pokemon_getattr adds r4, r0, 0 mov r0, r8 movs r1, 0x39 movs r2, 0 bl pokemon_getattr cmp r4, r0 beq @0806C6F0 ldr r0, [sp, 0x18] cmp r0, 0 bne @0806C6E4 mov r0, r8 movs r1, 0x39 movs r2, 0 bl pokemon_getattr ldr r1, [sp] adds r0, r1 str r0, [sp] mov r0, r8 movs r1, 0x3A movs r2, 0 bl pokemon_getattr ldr r1, [sp] cmp r1, r0 bls @0806C65E mov r0, r8 movs r1, 0x3A movs r2, 0 bl pokemon_getattr str r0, [sp] @0806C65E: mov r0, r8 movs r1, 0x39 mov r2, sp bl pokemon_setattr ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806C6EC ldr r2, [sp, 0x38] cmp r2, 0x4 beq @0806C6EC ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r0, r1 ldr r1, [sp] strh r1, [r0, 0x28] movs r0, 0x10 mov r3, r10 ands r0, r3 cmp r0, 0 bne @0806C6EC ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0806C6EC ldr r1, =0x03005d10 ldrb r0, [r1, 0x3] cmp r0, 0xFE bhi @0806C6AE adds r0, 0x1 strb r0, [r1, 0x3] @0806C6AE: ldrb r5, [r4] add r0, sp, 0x38 ldrb r0, [r0] strb r0, [r4] movs r0, 0 movs r1, 0 movs r2, 0 bl dp01_build_cmdbuf_x00_a_b_0 ldrb r0, [r4] bl dp01_battle_side_mark_buffer_for_execution strb r5, [r4] b @0806C6EC .align 2, 0 .pool @0806C6E4: ldr r1, =0x020241f0 ldr r0, [sp] negs r0, r0 str r0, [r1] @0806C6EC: movs r1, 0 str r1, [sp, 0x20] @0806C6F0: movs r0, 0xEF mov r2, r10 ands r2, r0 mov r10, r2 b @0806C9AA .align 2, 0 .pool @0806C700: movs r7, 0x2 mov r0, r10 ands r0, r7 cmp r0, 0 beq @0806C70C b @0806C858 @0806C70C: movs r5, 0 ldr r3, [sp, 0x28] adds r3, 0x1 str r3, [sp, 0x40] @0806C714: movs r0, 0x11 adds r0, r5 mov r9, r0 mov r0, r8 mov r1, r9 movs r2, 0 bl pokemon_getattr str r0, [sp] adds r7, r5, 0 adds r7, 0xD mov r0, r8 adds r1, r7, 0 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 bl pokemon_getattr adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 lsls r0, r5, 24 lsrs r6, r0, 24 adds r0, r4, 0 adds r2, r6, 0 bl 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806C82E ldr r2, [sp, 0x38] cmp r2, 0x4 beq @0806C82E ldr r4, =0x02024084 movs r0, 0x58 adds r3, r2, 0 muls r3, r0 adds r0, r4, 0 adds r0, 0x50 adds r0, r3, r0 ldr r1, [r0] movs r0, 0x80 lsls r0, 14 ands r1, r0 cmp r1, 0 bne @0806C82E ldr r1, =0x020242bc lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0806C82E adds r0, r5, r3 adds r1, r4, 0 adds r1, 0x24 adds r0, r1 ldr r1, [sp] strb r1, [r0] @0806C82E: movs r3, 0 str r3, [sp, 0x20] @0806C832: adds r5, 0x1 cmp r5, 0x3 bgt @0806C83A b @0806C714 @0806C83A: ldr r5, [sp, 0x40] lsls r0, r5, 24 @0806C83E: lsrs r0, 24 str r0, [sp, 0x28] b @0806C9AA .align 2, 0 .pool @0806C858: ldr r6, [sp, 0x14] adds r6, 0x11 mov r0, r8 adds r1, r6, 0 movs r2, 0 bl pokemon_getattr str r0, [sp] ldr r5, [sp, 0x14] adds r5, 0xD mov r0, r8 adds r1, r5, 0 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 bl pokemon_getattr adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 ldr r2, [sp, 0x14] bl 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] adds r0, r7, 0 ands r0, r1 cmp r0, 0 beq @0806C978 ldr r2, [sp, 0x38] cmp r2, 0x4 beq @0806C978 ldr r4, =0x02024084 movs r0, 0x58 adds r3, r2, 0 muls r3, r0 adds r0, r4, 0 adds r0, 0x50 adds r0, r3, r0 ldr r0, [r0] movs r1, 0x80 lsls r1, 14 ands r0, r1 cmp r0, 0 bne @0806C978 ldr r1, =0x020242bc lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 ldr r5, [sp, 0x14] lsls r0, r5, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 bne @0806C978 adds r0, r5, r3 adds r1, r4, 0 adds r1, 0x24 adds r0, r1 ldr r1, [sp] strb r1, [r0] @0806C978: movs r0, 0 str r0, [sp, 0x20] b @0806C9AA .align 2, 0 .pool @0806C994: mov r0, r8 movs r1, 0x2 ldr r2, [sp, 0xC] bl GetEvolutionTargetSpecies lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @0806C9AA bl @0806BEE0 @0806C9AA: ldr r1, [sp, 0x2C] adds r1, 0x1 str r1, [sp, 0x2C] mov r2, r10 lsrs r2, 1 mov r10, r2 cmp r2, 0 beq @0806C9BC b @0806C3E6 @0806C9BC: b @0806CD4C @0806C9BE: ldr r3, [sp, 0x24] ldr r5, [sp, 0x1C] adds r0, r3, r5 ldrb r0, [r0] mov r10, r0 movs r0, 0 str r0, [sp, 0x2C] mov r1, r10 cmp r1, 0 bne @0806C9D4 b @0806CD4C @0806C9D4: movs r0, 0x1 mov r2, r10 ands r0, r2 cmp r0, 0 bne @0806C9E0 b @0806CD3A @0806C9E0: ldr r3, [sp, 0x2C] cmp r3, 0x7 bls @0806C9E8 b @0806CD3A @0806C9E8: lsls r0, r3, 2 ldr r1, =@0806C9F8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806C9F8: .4byte @0806CA18 .4byte @0806CA18 .4byte @0806CA18 .4byte @0806CA18 .4byte @0806CAB8 .4byte @0806CB94 .4byte @0806CC00 .4byte @0806CC68 @0806CA18: mov r0, r8 bl sub_806DC8C lsls r0, 16 lsrs r6, r0, 16 ldr r5, [sp, 0x24] ldr r1, [sp, 0x28] adds r0, r5, r1 ldrb r5, [r0] ldr r0, =gUnknown_08329EC2 ldr r4, [sp, 0x2C] adds r4, 0x2 adds r0, r4, r0 ldrb r1, [r0] mov r0, r8 movs r2, 0 bl pokemon_getattr adds r1, r0, 0 str r1, [sp, 0x4] lsls r0, r5, 24 asrs r2, r0, 24 cmp r2, 0 ble @0806CA84 ldr r0, =0x000001fd cmp r6, r0 bls @0806CA52 bl @0806BEF0 @0806CA52: adds r3, r1, 0 cmp r3, 0x63 ble @0806CA5A b @0806CD3A @0806CA5A: adds r1, r3, r2 cmp r1, 0x64 ble @0806CA70 adds r0, r2, 0 adds r0, 0x64 subs r5, r0, r1 b @0806CA72 .align 2, 0 .pool @0806CA70: adds r5, r2, 0 @0806CA72: adds r1, r6, r5 movs r0, 0xFF lsls r0, 1 cmp r1, r0 bls @0806CA80 adds r0, r5, r0 subs r5, r0, r1 @0806CA80: adds r0, r3, r5 b @0806CA98 @0806CA84: cmp r1, 0 bne @0806CA8E movs r2, 0x1 str r2, [sp, 0x3C] b @0806CD30 @0806CA8E: adds r0, r1, r2 str r0, [sp, 0x4] cmp r0, 0 bge @0806CA9A movs r0, 0 @0806CA98: str r0, [sp, 0x4] @0806CA9A: ldr r0, =gUnknown_08329EC2 adds r0, r4, r0 ldrb r1, [r0] add r2, sp, 0x4 mov r0, r8 bl pokemon_setattr mov r0, r8 bl pokemon_calc_effective_stats movs r3, 0 str r3, [sp, 0x20] b @0806CD30 .align 2, 0 .pool @0806CAB8: mov r0, r8 movs r1, 0x15 movs r2, 0 bl pokemon_getattr ldr r1, =gUnknown_08329D22 ldr r5, [sp, 0x14] adds r1, r5, r1 ldrb r1, [r1] ands r0, r1 lsls r1, r5, 1 lsrs r0, r1 str r0, [sp] adds r6, r5, 0 adds r6, 0xD mov r0, r8 adds r1, r6, 0 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, r8 movs r1, 0x15 movs r2, 0 bl pokemon_getattr adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 ldr r2, [sp, 0x14] bl 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, =gUnknown_08329D26 ldr r2, [sp, 0x14] adds r1, r2, r1 ldrb r2, [r1] ands r2, r0 str r2, [sp] ldr r0, =gUnknown_08329D2A ldr r3, [sp, 0x14] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r1 adds r2, r0 str r2, [sp] mov r0, r8 movs r1, 0x15 mov r2, sp bl pokemon_setattr mov r0, r8 adds r1, r6, 0 movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 ldr r1, [sp] lsls r1, 24 lsrs r1, 24 ldr r2, [sp, 0x14] bl 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 .pool @0806CB94: mov r0, r8 movs r1, 0x20 movs r2, 0 bl pokemon_getattr cmp r0, 0x63 bls @0806CBA4 b @0806CD30 @0806CBA4: ldr r0, [sp, 0x20] cmp r0, 0 beq @0806CBB2 ldr r1, [sp, 0x3C] cmp r1, 0 bne @0806CBB2 b @0806CD30 @0806CBB2: bl sub_806F104 lsls r0, 24 cmp r0, 0 beq @0806CBBE b @0806CD30 @0806CBBE: ldr r2, [sp, 0x30] cmp r2, 0 beq @0806CBC6 b @0806CD30 @0806CBC6: ldr r3, [sp, 0x24] ldr r5, [sp, 0x28] adds r0, r3, r5 ldrb r0, [r0] str r0, [sp, 0x30] mov r0, r8 movs r1, 0x20 movs r2, 0 bl pokemon_getattr adds r5, r0, 0 str r5, [sp, 0x8] ldr r0, [sp, 0x30] lsls r4, r0, 24 asrs r1, r4, 24 cmp r1, 0 ble @0806CCCC ldr r2, [sp, 0x34] cmp r2, 0x1B bne @0806CCCC movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 adds r0, r5, r0 str r0, [sp, 0x8] adds r2, r4, 0 b @0806CCD8 @0806CC00: mov r0, r8 movs r1, 0x20 movs r2, 0 bl pokemon_getattr cmp r0, 0x63 bhi @0806CC10 b @0806CD30 @0806CC10: mov r0, r8 movs r1, 0x20 movs r2, 0 bl pokemon_getattr cmp r0, 0xC7 bls @0806CC20 b @0806CD30 @0806CC20: ldr r0, [sp, 0x20] cmp r0, 0 beq @0806CC2E ldr r1, [sp, 0x3C] cmp r1, 0 bne @0806CC2E b @0806CD30 @0806CC2E: bl sub_806F104 lsls r0, 24 cmp r0, 0 bne @0806CD30 ldr r2, [sp, 0x30] cmp r2, 0 bne @0806CD30 ldr r3, [sp, 0x24] ldr r5, [sp, 0x28] adds r0, r3, r5 ldrb r0, [r0] str r0, [sp, 0x30] mov r0, r8 movs r1, 0x20 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 str r4, [sp, 0x8] ldr r0, [sp, 0x30] lsls r5, r0, 24 asrs r1, r5, 24 cmp r1, 0 ble @0806CCCC ldr r2, [sp, 0x34] cmp r2, 0x1B beq @0806CCBA b @0806CCCC @0806CC68: mov r0, r8 movs r1, 0x20 movs r2, 0 bl pokemon_getattr cmp r0, 0xC7 bls @0806CD30 ldr r0, [sp, 0x20] cmp r0, 0 beq @0806CC82 ldr r1, [sp, 0x3C] cmp r1, 0 beq @0806CD30 @0806CC82: bl sub_806F104 lsls r0, 24 cmp r0, 0 bne @0806CD30 ldr r2, [sp, 0x30] cmp r2, 0 bne @0806CD30 ldr r3, [sp, 0x24] ldr r5, [sp, 0x28] adds r0, r3, r5 ldrb r0, [r0] str r0, [sp, 0x30] mov r0, r8 movs r1, 0x20 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 str r4, [sp, 0x8] ldr r0, [sp, 0x30] lsls r5, r0, 24 asrs r1, r5, 24 cmp r1, 0 ble @0806CCCC ldr r2, [sp, 0x34] cmp r2, 0x1B bne @0806CCCC @0806CCBA: movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 adds r0, r4, r0 str r0, [sp, 0x8] adds r2, r5, 0 b @0806CCD8 @0806CCCC: ldr r3, [sp, 0x30] lsls r2, r3, 24 asrs r1, r2, 24 ldr r0, [sp, 0x8] adds r0, r1 str r0, [sp, 0x8] @0806CCD8: cmp r2, 0 ble @0806CD0E mov r0, r8 movs r1, 0x26 movs r2, 0 bl pokemon_getattr cmp r0, 0xB bne @0806CCF0 ldr r0, [sp, 0x8] adds r0, 0x1 str r0, [sp, 0x8] @0806CCF0: mov r0, r8 movs r1, 0x23 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 bl sav1_map_get_name lsls r0, 24 lsrs r0, 24 cmp r4, r0 bne @0806CD0E ldr r0, [sp, 0x8] adds r0, 0x1 str r0, [sp, 0x8] @0806CD0E: ldr r0, [sp, 0x8] cmp r0, 0 bge @0806CD18 movs r0, 0 str r0, [sp, 0x8] @0806CD18: ldr r0, [sp, 0x8] cmp r0, 0xFF ble @0806CD22 movs r0, 0xFF str r0, [sp, 0x8] @0806CD22: add r2, sp, 0x8 mov r0, r8 movs r1, 0x20 bl pokemon_setattr movs r5, 0 str r5, [sp, 0x20] @0806CD30: ldr r0, [sp, 0x28] adds r0, 0x1 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x28] @0806CD3A: ldr r0, [sp, 0x2C] adds r0, 0x1 str r0, [sp, 0x2C] mov r1, r10 lsrs r1, 1 mov r10, r1 cmp r1, 0 beq @0806CD4C b @0806C9D4 @0806CD4C: ldr r2, [sp, 0x1C] adds r2, 0x1 str r2, [sp, 0x1C] cmp r2, 0x5 bgt @0806CD5A bl @0806BEFC @0806CD5A: ldr r0, [sp, 0x20] @0806CD5C: add sp, 0x44 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806CDBE cmp r6, 0x4 beq @0806CDBE ldr r0, =0x02024084 movs r1, 0x58 muls r1, r6 adds r0, 0x4C adds r1, r0 ldr r0, [r1] ands r0, r4 str r0, [r1] @0806CDBE: movs r0, 0 b @0806CDD2 .align 2, 0 .pool @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_806CDDC sub_806CDDC: ; 806CDDC push {r4-r7,lr} lsls r0, 16 lsrs r3, r0, 16 lsls r1, 24 lsrs r4, r1, 24 lsls r2, 24 lsrs r5, r2, 24 movs r7, 0x6 ldr r1, =gItemEffectInfoPointers adds r0, r3, 0 subs r0, 0xD lsls r0, 2 adds r0, r1 ldr r0, [r0] cmp r0, 0 bne @0806CE08 cmp r3, 0xAF beq @0806CE0C @0806CE00: movs r0, 0 b @0806CF1C .align 2, 0 .pool @0806CE08: cmp r3, 0xAF bne @0806CE1A @0806CE0C: ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 ldr r1, =0x0202440c adds r0, r1 @0806CE1A: mov r12, r0 movs r2, 0 @0806CE1E: cmp r2, 0x4 beq @0806CE3E cmp r2, 0x4 ble @0806CE34 cmp r2, 0x5 beq @0806CEC8 b @0806CF12 .align 2, 0 .pool @0806CE34: cmp r2, 0 blt @0806CF12 cmp r2, r4 bne @0806CF12 b @0806CE00 @0806CE3E: mov r0, r12 ldrb r3, [r0, 0x4] movs r0, 0x20 ands r0, r3 cmp r0, 0 beq @0806CE4E movs r0, 0xDF ands r3, r0 @0806CE4E: movs r6, 0 cmp r3, 0 beq @0806CF12 @0806CE54: movs r0, 0x1 ands r0, r3 cmp r0, 0 beq @0806CEB4 cmp r6, 0x7 bhi @0806CEB4 lsls r0, r6, 2 ldr r1, =@0806CE70 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806CE70: .4byte @0806CE9C .4byte @0806CE9C .4byte @0806CE90 .4byte @0806CE9C .4byte @0806CEB4 .4byte @0806CEB4 .4byte @0806CEB4 .4byte @0806CEB0 @0806CE90: movs r0, 0x10 ands r0, r3 cmp r0, 0 beq @0806CE9C movs r0, 0xEF ands r3, r0 @0806CE9C: cmp r2, r4 bne @0806CEA8 adds r0, r3, 0 ands r0, r5 cmp r0, 0 bne @0806CF1A @0806CEA8: adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 b @0806CEB4 @0806CEB0: cmp r2, r4 beq @0806CE00 @0806CEB4: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 lsrs r3, 1 cmp r2, r4 bne @0806CEC2 lsrs r5, 1 @0806CEC2: cmp r3, 0 bne @0806CE54 b @0806CF12 @0806CEC8: mov r0, r12 ldrb r3, [r0, 0x5] movs r6, 0 @0806CECE: cmp r3, 0 beq @0806CF12 movs r0, 0x1 ands r0, r3 cmp r0, 0 beq @0806CF02 cmp r6, 0 blt @0806CF02 cmp r6, 0x6 ble @0806CEE8 cmp r6, 0x7 beq @0806CEFC b @0806CF02 @0806CEE8: cmp r2, r4 bne @0806CEF4 adds r0, r3, 0 ands r0, r5 cmp r0, 0 bne @0806CF1A @0806CEF4: adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 b @0806CF02 @0806CEFC: cmp r2, r4 bne @0806CF02 b @0806CE00 @0806CF02: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 lsrs r3, 1 cmp r2, r4 bne @0806CECE lsrs r5, 1 b @0806CECE @0806CF12: adds r2, 0x1 cmp r2, 0x5 bgt @0806CF1A b @0806CE1E @0806CF1A: adds r0, r7, 0 @0806CF1C: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_806CDDC thumb_func_start sub_806CF24 sub_806CF24: ; 806CF24 push {lr} ldr r2, =0x0202420c ldr r1, =0x020244b8 ldrb r1, [r1] strb r1, [r2] ldr r3, =0x02022f58 ldr r2, =gUnknown_085CBE00 ldr r1, =gUnknown_08329EC8 adds r0, r1 ldrb r0, [r0] lsls r0, 2 adds r0, r2 ldr r1, [r0] adds r0, r3, 0 bl gf_strcpy ldr r0, =0x02022f68 ldr r1, =gUnknown_085CB38A bl gf_strcpy ldr r0, =gUnknown_085CB3AA bl sub_814E6F0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806CF24 thumb_func_start sub_806CF78 sub_806CF78: ; 806CF78 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne @0806CFCC ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806CFB8 ldr r2, =0x020244b8 ldrb r1, [r2] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 ldr r1, =0x0202440c adds r7, r0, r1 b @0806CFD8 .align 2, 0 .pool @0806CFB8: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003214 adds r7, r0, r1 b @0806CFD6 .align 2, 0 .pool @0806CFCC: ldr r1, =gItemEffectInfoPointers subs r0, 0xD lsls r0, 2 adds r0, r1 ldr r7, [r0] @0806CFD6: ldr r2, =0x020244b8 @0806CFD8: ldr r1, =0x0202420f ldrb r0, [r2] strb r0, [r1] movs r5, 0 ldr r0, =0x0202420b mov r8, r0 movs r6, 0 @0806CFE6: adds r4, r7, r5 ldrb r1, [r4] movs r0, 0xF ands r0, r1 cmp r0, 0 beq @0806CFF8 adds r0, r6, 0 bl sub_806CF24 @0806CFF8: ldrb r1, [r4] movs r0, 0xF0 ands r0, r1 cmp r0, 0 beq @0806D02E cmp r5, 0 beq @0806D020 adds r0, r6, 0x1 bl sub_806CF24 b @0806D02E .align 2, 0 .pool @0806D020: ldr r0, =0x020244b8 ldrb r0, [r0] mov r1, r8 strb r0, [r1] ldr r0, =gUnknown_085CA459 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, =0x0202420b ldr r0, =0x020244b8 ldrb r0, [r0] strb r0, [r1] ldr r0, =gUnknown_085CA424 bl sub_814E6F0 @0806D04E: ldr r0, =0x02022e2c pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806CF78 thumb_func_start GetNature ; u8 GetNature(pokemon *mon) GetNature: ; 806D070 push {lr} movs r1, 0 movs r2, 0 bl pokemon_getattr movs r1, 0x19 bl __umodsi3 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end GetNature thumb_func_start GetNatureFromPersonality ; u8 GetNatureFromPersonality(u32 personality) GetNatureFromPersonality: ; 806D088 push {lr} movs r1, 0x19 bl __umodsi3 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end GetNatureFromPersonality thumb_func_start GetEvolutionTargetSpecies GetEvolutionTargetSpecies: ; 806D098 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x14 mov r8, r0 lsls r1, 24 lsrs r5, r1, 24 lsls r2, 16 lsrs r2, 16 mov r9, r2 movs r0, 0 mov r10, r0 mov r0, r8 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r7, r0, 16 mov r0, r8 movs r1, 0xC movs r2, 0 bl pokemon_getattr mov r1, sp strh r0, [r1] mov r0, r8 movs r1, 0 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 mov r0, r8 movs r1, 0x17 movs r2, 0 bl pokemon_getattr lsls r0, 24 lsrs r0, 24 str r0, [sp, 0xC] lsrs r4, 16 str r4, [sp, 0x10] mov r0, sp ldrh r0, [r0] cmp r0, 0xAF bne @0806D10C ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003226 adds r0, r1 ldrb r0, [r0] b @0806D114 .align 2, 0 .pool @0806D10C: bl itemid_get_x12 lsls r0, 24 lsrs r0, 24 @0806D114: cmp r0, 0x26 bne @0806D120 cmp r5, 0x3 beq @0806D120 movs r0, 0 b @0806D3B0 @0806D120: cmp r5, 0x1 bne @0806D126 b @0806D340 @0806D126: cmp r5, 0x1 bgt @0806D130 cmp r5, 0 beq @0806D144 b @0806D3AE @0806D130: cmp r5, 0x3 ble @0806D136 b @0806D3AE @0806D136: movs r2, 0 str r2, [sp, 0x4] ldr r3, =gEvolutionTable lsls r6, r7, 2 b @0806D38E .align 2, 0 .pool @0806D144: mov r0, r8 movs r1, 0x38 movs r2, 0 bl pokemon_getattr lsls r0, 24 lsrs r0, 24 mov r9, r0 mov r0, r8 movs r1, 0x20 movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x8] movs r0, 0 str r0, [sp, 0x4] lsls r6, r7, 2 @0806D16A: ldr r1, =gEvolutionTable ldr r0, [sp, 0x4] lsls r2, r0, 3 adds r0, r6, r7 lsls r0, 3 adds r0, r2, r0 adds r0, r1 ldrh r0, [r0] subs r0, 0x1 adds r3, r1, 0 adds r4, r2, 0 cmp r0, 0xE bls @0806D186 b @0806D332 @0806D186: lsls r0, 2 ldr r1, =@0806D198 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806D198: .4byte @0806D1D4 .4byte @0806D1E6 .4byte @0806D208 .4byte @0806D238 .4byte @0806D332 .4byte @0806D332 .4byte @0806D332 .4byte @0806D248 .4byte @0806D272 .4byte @0806D29C .4byte @0806D2CA .4byte @0806D2EA .4byte @0806D30E .4byte @0806D332 .4byte @0806D31E @0806D1D4: ldr r1, [sp, 0x8] cmp r1, 0xDB bhi @0806D1DC b @0806D332 @0806D1DC: adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r0, r3 b @0806D228 @0806D1E6: bl sub_802F588 ldr r0, =0x03005cf8 ldrb r0, [r0, 0x2] subs r0, 0xC lsls r0, 24 lsrs r0, 24 cmp r0, 0xB bls @0806D1FA b @0806D332 @0806D1FA: ldr r2, [sp, 0x8] cmp r2, 0xDB bhi @0806D202 b @0806D332 @0806D202: b @0806D21E .align 2, 0 .pool @0806D208: bl sub_802F588 ldr r0, =0x03005cf8 ldrb r0, [r0, 0x2] cmp r0, 0xB bls @0806D216 b @0806D332 @0806D216: ldr r0, [sp, 0x8] cmp r0, 0xDB bhi @0806D21E b @0806D332 @0806D21E: ldr r1, =gEvolutionTable adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r0, r1 @0806D228: ldrh r0, [r0, 0x4] mov r10, r0 b @0806D332 .align 2, 0 .pool @0806D238: adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r1, r0, r3 ldrh r0, [r1, 0x2] cmp r0, r9 bhi @0806D332 b @0806D32E @0806D248: adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r5, r0, r3 ldrh r0, [r5, 0x2] cmp r0, r9 bhi @0806D332 mov r0, r8 movs r1, 0x3B movs r2, 0 bl pokemon_getattr adds r4, r0, 0 mov r0, r8 movs r1, 0x3C movs r2, 0 bl pokemon_getattr cmp r4, r0 bls @0806D332 b @0806D2C4 @0806D272: adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r5, r0, r3 ldrh r0, [r5, 0x2] cmp r0, r9 bhi @0806D332 mov r0, r8 movs r1, 0x3B movs r2, 0 bl pokemon_getattr adds r4, r0, 0 mov r0, r8 movs r1, 0x3C movs r2, 0 bl pokemon_getattr cmp r4, r0 bne @0806D332 b @0806D2C4 @0806D29C: adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r5, r0, r3 ldrh r0, [r5, 0x2] cmp r0, r9 bhi @0806D332 mov r0, r8 movs r1, 0x3B movs r2, 0 bl pokemon_getattr adds r4, r0, 0 mov r0, r8 movs r1, 0x3C movs r2, 0 bl pokemon_getattr cmp r4, r0 bcs @0806D332 @0806D2C4: ldrh r5, [r5, 0x4] mov r10, r5 b @0806D332 @0806D2CA: adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r4, r0, r3 ldrh r0, [r4, 0x2] cmp r0, r9 bhi @0806D332 ldr r0, [sp, 0x10] movs r1, 0xA bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0x4 bhi @0806D332 b @0806D308 @0806D2EA: adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r4, r0, r3 ldrh r0, [r4, 0x2] cmp r0, r9 bhi @0806D332 ldr r0, [sp, 0x10] movs r1, 0xA bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0x4 bls @0806D332 @0806D308: ldrh r4, [r4, 0x4] mov r10, r4 b @0806D332 @0806D30E: adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r1, r0, r3 ldrh r0, [r1, 0x2] cmp r0, r9 bhi @0806D332 b @0806D32E @0806D31E: adds r0, r6, r7 lsls r0, 3 adds r0, r4, r0 adds r1, r0, r3 ldrh r0, [r1, 0x2] ldr r2, [sp, 0xC] cmp r0, r2 bhi @0806D332 @0806D32E: ldrh r1, [r1, 0x4] mov r10, r1 @0806D332: ldr r0, [sp, 0x4] adds r0, 0x1 str r0, [sp, 0x4] cmp r0, 0x4 bgt @0806D33E b @0806D16A @0806D33E: b @0806D3AE @0806D340: lsls r6, r7, 2 ldr r1, =gEvolutionTable adds r0, r6, r7 lsls r0, 3 adds r4, r0, r1 mov r5, sp movs r1, 0x4 str r1, [sp, 0x4] @0806D350: ldrh r0, [r4] cmp r0, 0x5 beq @0806D370 cmp r0, 0x6 bne @0806D374 ldrh r0, [r4, 0x2] ldrh r1, [r5] cmp r0, r1 bne @0806D374 movs r0, 0 strh r0, [r5] mov r0, r8 movs r1, 0xC mov r2, sp bl pokemon_setattr @0806D370: ldrh r2, [r4, 0x4] mov r10, r2 @0806D374: adds r4, 0x8 ldr r0, [sp, 0x4] subs r0, 0x1 str r0, [sp, 0x4] cmp r0, 0 bge @0806D350 b @0806D3AE .align 2, 0 .pool @0806D388: ldrh r1, [r1, 0x4] mov r10, r1 b @0806D3AE @0806D38E: adds r0, r6, r7 ldr r1, [sp, 0x4] adds r0, r1 lsls r0, 3 adds r1, r0, r3 ldrh r0, [r1] cmp r0, 0x7 bne @0806D3A4 ldrh r0, [r1, 0x2] cmp r0, r9 beq @0806D388 @0806D3A4: ldr r2, [sp, 0x4] adds r2, 0x1 str r2, [sp, 0x4] cmp r2, 0x4 ble @0806D38E @0806D3AE: mov r0, r10 @0806D3B0: add sp, 0x14 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end GetEvolutionTargetSpecies thumb_func_start HoennPokedexNumToSpecies HoennPokedexNumToSpecies: ; 806D3C0 push {r4,lr} lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0 beq @0806D404 movs r1, 0 ldr r3, =gSpeciesToHoennPokedexNum ldrh r0, [r3] cmp r0, r2 beq @0806D3EC movs r4, 0xCD lsls r4, 1 @0806D3D8: adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, r4 bhi @0806D3EC lsls r0, r1, 1 adds r0, r3 ldrh r0, [r0] cmp r0, r2 bne @0806D3D8 @0806D3EC: ldr r0, =0x0000019b cmp r1, r0 beq @0806D404 adds r0, r1, 0x1 lsls r0, 16 lsrs r0, 16 b @0806D406 .align 2, 0 .pool @0806D404: movs r0, 0 @0806D406: pop {r4} pop {r1} bx r1 thumb_func_end HoennPokedexNumToSpecies thumb_func_start NationalPokedexNumToSpecies NationalPokedexNumToSpecies: ; 806D40C push {r4,lr} lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0 beq @0806D450 movs r1, 0 ldr r3, =gSpeciesToNationalPokedexNum ldrh r0, [r3] cmp r0, r2 beq @0806D438 movs r4, 0xCD lsls r4, 1 @0806D424: adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, r4 bhi @0806D438 lsls r0, r1, 1 adds r0, r3 ldrh r0, [r0] cmp r0, r2 bne @0806D424 @0806D438: ldr r0, =0x0000019b cmp r1, r0 beq @0806D450 adds r0, r1, 0x1 lsls r0, 16 lsrs r0, 16 b @0806D452 .align 2, 0 .pool @0806D450: movs r0, 0 @0806D452: pop {r4} pop {r1} bx r1 thumb_func_end NationalPokedexNumToSpecies thumb_func_start NationalToHoennOrder NationalToHoennOrder: ; 806D458 push {r4,lr} lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0 beq @0806D49C movs r1, 0 ldr r3, =gHoennToNationalOrder ldrh r0, [r3] cmp r0, r2 beq @0806D484 movs r4, 0xCD lsls r4, 1 @0806D470: adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, r4 bhi @0806D484 lsls r0, r1, 1 adds r0, r3 ldrh r0, [r0] cmp r0, r2 bne @0806D470 @0806D484: ldr r0, =0x0000019b cmp r1, r0 beq @0806D49C adds r0, r1, 0x1 lsls r0, 16 lsrs r0, 16 b @0806D49E .align 2, 0 .pool @0806D49C: movs r0, 0 @0806D49E: pop {r4} pop {r1} bx r1 thumb_func_end NationalToHoennOrder thumb_func_start SpeciesToNationalPokedexNum SpeciesToNationalPokedexNum: ; 806D4A4 push {lr} lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @0806D4C0 ldr r0, =gSpeciesToNationalPokedexNum subs r1, 0x1 lsls r1, 1 adds r1, r0 ldrh r0, [r1] b @0806D4C2 .align 2, 0 .pool @0806D4C0: movs r0, 0 @0806D4C2: pop {r1} bx r1 thumb_func_end SpeciesToNationalPokedexNum thumb_func_start SpeciesToHoennPokedexNum SpeciesToHoennPokedexNum: ; 806D4C8 push {lr} lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @0806D4E4 ldr r0, =gSpeciesToHoennPokedexNum subs r1, 0x1 lsls r1, 1 adds r1, r0 ldrh r0, [r1] b @0806D4E6 .align 2, 0 .pool @0806D4E4: movs r0, 0 @0806D4E6: pop {r1} bx r1 thumb_func_end SpeciesToHoennPokedexNum thumb_func_start HoennToNationalOrder HoennToNationalOrder: ; 806D4EC push {lr} lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @0806D508 ldr r0, =gHoennToNationalOrder subs r1, 0x1 lsls r1, 1 adds r1, r0 ldrh r0, [r1] b @0806D50A .align 2, 0 .pool @0806D508: movs r0, 0 @0806D50A: pop {r1} bx r1 thumb_func_end HoennToNationalOrder thumb_func_start speciesid_conv speciesid_conv: ; 806D510 push {lr} lsls r0, 16 lsrs r0, 16 adds r1, r0, 0 cmp r0, 0xFA bls @0806D53E ldr r0, =0x00000113 cmp r1, r0 bls @0806D53C ldr r0, =gUnknown_0831F61C ldr r2, =0xfffffeec adds r1, r2 lsls r1, 1 adds r1, r0 ldrh r0, [r1] b @0806D53E .align 2, 0 .pool @0806D53C: movs r0, 0xC8 @0806D53E: pop {r1} bx r1 thumb_func_end speciesid_conv thumb_func_start sub_806D544 sub_806D544: ; 806D544 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 adds r6, r1, 0 mov r10, r2 lsls r0, 16 movs r1, 0x9A lsls r1, 17 cmp r0, r1 bne @0806D652 ldr r0, =0x020244d4 ldr r1, [r0] ldr r0, [r1, 0x4] cmp r10, r0 beq @0806D652 ldr r0, [r1, 0xC] cmp r10, r0 beq @0806D652 movs r5, 0 @0806D570: lsls r3, r5, 3 adds r3, r5 lsls r3, 2 ldr r0, =gSpindaSpotGraphics adds r4, r3, r0 ldrb r1, [r4] adds r1, 0xF8 movs r2, 0xF adds r0, r6, 0 ands r0, r2 adds r1, r0 lsls r1, 24 lsrs r1, 24 mov r12, r1 ldrb r1, [r4, 0x1] adds r1, 0xF8 movs r0, 0xF0 ands r0, r6 lsrs r0, 4 adds r1, r0 lsls r1, 24 lsrs r1, 24 movs r2, 0 lsrs r6, 8 str r6, [sp, 0x4] adds r5, 0x1 str r5, [sp] mov r9, r3 @0806D5A8: lsls r0, r2, 1 add r0, r9 ldr r3, =gSpindaSpotGraphics + 0x2 adds r0, r3 ldrh r3, [r0] mov r4, r12 adds r0, r4, 0 adds r0, 0x10 adds r7, r1, 0x1 adds r2, 0x1 mov r8, r2 cmp r4, r0 bge @0806D640 lsrs r0, r1, 3 lsls r6, r0, 8 movs r0, 0x7 ands r1, r0 lsls r5, r1, 2 @0806D5CC: adds r0, r4, 0 cmp r4, 0 bge @0806D5D4 adds r0, r4, 0x7 @0806D5D4: asrs r0, 3 lsls r2, r0, 5 add r2, r10 lsls r0, 3 subs r0, r4, r0 lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 adds r2, r0 adds r2, r6 adds r2, r5 movs r1, 0x1 adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @0806D634 adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @0806D620 ldrb r1, [r2] movs r0, 0xF0 ands r0, r1 subs r0, 0x10 lsls r0, 24 lsrs r0, 24 cmp r0, 0x20 bhi @0806D634 adds r0, r1, 0 adds r0, 0x40 b @0806D632 .align 2, 0 .pool @0806D620: ldrb r1, [r2] movs r0, 0xF ands r0, r1 subs r0, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bhi @0806D634 adds r0, r1, 0x4 @0806D632: strb r0, [r2] @0806D634: asrs r3, 1 adds r4, 0x1 mov r0, r12 adds r0, 0x10 cmp r4, r0 blt @0806D5CC @0806D640: lsls r0, r7, 24 lsrs r1, r0, 24 mov r2, r8 cmp r2, 0xF ble @0806D5A8 ldr r6, [sp, 0x4] ldr r5, [sp] cmp r5, 0x3 ble @0806D570 @0806D652: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_806D544 thumb_func_start DrawSpindaSpots ; void DrawSpindaSpots(u16 species, u32 personality, u8 *pixels, u8 isFrontPic) DrawSpindaSpots: ; 806D664 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 adds r5, r1, 0 str r2, [sp] lsls r0, 16 lsls r3, 24 lsrs r3, 24 movs r1, 0x9A lsls r1, 17 cmp r0, r1 bne @0806D766 cmp r3, 0 beq @0806D766 movs r6, 0 @0806D688: lsls r3, r6, 3 adds r3, r6 lsls r3, 2 ldr r0, =gSpindaSpotGraphics adds r4, r3, r0 ldrb r1, [r4] adds r1, 0xF8 movs r2, 0xF adds r0, r5, 0 ands r0, r2 adds r1, r0 lsls r1, 24 lsrs r1, 24 mov r12, r1 ldrb r1, [r4, 0x1] adds r1, 0xF8 movs r0, 0xF0 ands r0, r5 lsrs r0, 4 adds r1, r0 lsls r1, 24 lsrs r1, 24 movs r2, 0 lsrs r5, 8 str r5, [sp, 0x4] adds r6, 0x1 mov r10, r6 mov r9, r3 @0806D6C0: lsls r0, r2, 1 add r0, r9 ldr r3, =gSpindaSpotGraphics + 0x2 adds r0, r3 ldrh r3, [r0] mov r4, r12 adds r0, r4, 0 adds r0, 0x10 adds r7, r1, 0x1 adds r2, 0x1 mov r8, r2 cmp r4, r0 bge @0806D754 lsrs r0, r1, 3 lsls r6, r0, 8 movs r0, 0x7 ands r1, r0 lsls r5, r1, 2 @0806D6E4: adds r0, r4, 0 cmp r4, 0 bge @0806D6EC adds r0, r4, 0x7 @0806D6EC: asrs r0, 3 lsls r2, r0, 5 ldr r1, [sp] adds r2, r1, r2 lsls r0, 3 subs r0, r4, r0 lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 adds r2, r0 adds r2, r6 adds r2, r5 movs r1, 0x1 adds r0, r3, 0 ands r0, r1 cmp r0, 0 beq @0806D748 adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @0806D734 ldrb r1, [r2] movs r0, 0xF0 ands r0, r1 subs r0, 0x10 lsls r0, 24 lsrs r0, 24 cmp r0, 0x20 bhi @0806D748 adds r0, r1, 0 adds r0, 0x40 b @0806D746 .align 2, 0 .pool @0806D734: ldrb r1, [r2] movs r0, 0xF ands r0, r1 subs r0, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bhi @0806D748 adds r0, r1, 0x4 @0806D746: strb r0, [r2] @0806D748: asrs r3, 1 adds r4, 0x1 mov r0, r12 adds r0, 0x10 cmp r4, r0 blt @0806D6E4 @0806D754: lsls r0, r7, 24 lsrs r1, r0, 24 mov r2, r8 cmp r2, 0xF ble @0806D6C0 ldr r5, [sp, 0x4] mov r6, r10 cmp r6, 0x3 ble @0806D688 @0806D766: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end DrawSpindaSpots thumb_func_start sub_806D778 sub_806D778: ; 806D778 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 adds r5, r0, 0 lsls r1, 16 lsrs r7, r1, 16 lsls r2, 16 lsrs r2, 16 mov r8, r2 ldr r0, =0x02021cc4 mov r9, r0 adds r0, r5, 0 movs r1, 0x2 mov r2, r9 bl pokemon_getattr mov r4, sp adds r0, r5, 0 movs r1, 0x3 mov r2, sp bl pokemon_getattr strb r0, [r4] lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @0806D7D4 movs r6, 0xB adds r0, r7, 0 muls r0, r6 ldr r4, =gSpeciesNames adds r0, r4 mov r1, r9 bl 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 .pool thumb_func_end sub_806D778 thumb_func_start sub_806D7EC sub_806D7EC: ; 806D7EC push {r4,r5,lr} movs r5, 0 ldr r4, =0x020229e8 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r4 ldrh r0, [r1, 0x18] cmp r0, 0x2 bgt @0806D818 cmp r0, 0x1 bge @0806D820 cmp r0, 0 beq @0806D81C b @0806D822 .align 2, 0 .pool @0806D818: cmp r0, 0x3 bne @0806D822 @0806D81C: movs r5, 0 b @0806D822 @0806D820: movs r5, 0x1 @0806D822: adds r0, r5, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_806D7EC thumb_func_start sub_806D82C sub_806D82C: ; 806D82C push {lr} lsls r0, 24 lsrs r0, 24 movs r3, 0 ldr r2, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 ldrh r0, [r1, 0x18] cmp r0, 0x2 bgt @0806D854 cmp r0, 0x1 bge @0806D85C cmp r0, 0 beq @0806D858 b @0806D85E .align 2, 0 .pool @0806D854: cmp r0, 0x3 bne @0806D85E @0806D858: movs r3, 0 b @0806D85E @0806D85C: movs r3, 0x1 @0806D85E: adds r0, r3, 0 pop {r1} bx r1 thumb_func_end sub_806D82C thumb_func_start sub_806D864 sub_806D864: ; 806D864 push {lr} lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 ldr r1, =0x020229e8 b @0806D87C .align 2, 0 .pool @0806D874: adds r1, 0x1C adds r2, 0x1 cmp r2, 0x3 bgt @0806D882 @0806D87C: ldrh r0, [r1, 0x18] cmp r0, r3 bne @0806D874 @0806D882: adds r0, r2, 0 pop {r1} bx r1 thumb_func_end sub_806D864 thumb_func_start 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, =gTrainers lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldrb r1, [r0, 0x2] movs r0, 0x7F ands r0, r1 b @0806D8CE .align 2, 0 .pool @0806D8C4: adds r0, r5, 0 bl sub_81D63C8 @0806D8CA: lsls r0, 24 lsrs r0, 24 @0806D8CE: pop {r4,r5} pop {r1} bx r1 thumb_func_end 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, =gNatureStatTable lsls r1, r4, 2 adds r1, r4 subs r1, 0x1 adds r1, r5, r1 adds r1, r0 ldrb r1, [r1] lsls r1, 24 asrs r1, 24 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0806D918 cmp r1, 0x1 bne @0806D92C movs r0, 0x6E b @0806D91A .align 2, 0 .pool @0806D918: movs r0, 0x5A @0806D91A: muls r0, r3 lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __udivsi3 lsls r0, 16 lsrs r0, 16 b @0806D92E @0806D92C: adds r0, r3, 0 @0806D92E: pop {r4,r5} pop {r1} bx r1 thumb_func_end nature_stat_mod thumb_func_start happiness_algorithm happiness_algorithm: ; 806D934 push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 lsls r1, 24 lsrs r5, r1, 24 bl sub_806F104 lsls r0, 24 cmp r0, 0 beq @0806D94A b @0806DAC2 @0806D94A: adds r0, r7, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r6, r0, 16 adds r0, r7, 0 movs r1, 0xC movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne @0806D9A0 ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806D98C ldr r0, =0x02024404 ldrb r4, [r0, 0x7] b @0806D9A8 .align 2, 0 .pool @0806D98C: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003226 adds r0, r1 ldrb r4, [r0] b @0806D9A8 .align 2, 0 .pool @0806D9A0: bl itemid_get_x12 lsls r0, 24 lsrs r4, r0, 24 @0806D9A8: cmp r6, 0 bne @0806D9AE b @0806DAC2 @0806D9AE: movs r0, 0xCE lsls r0, 1 cmp r6, r0 bne @0806D9B8 b @0806DAC2 @0806D9B8: movs r6, 0 adds r0, r7, 0 movs r1, 0x20 movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r1, sp strh r0, [r1] lsls r0, 16 asrs r0, 16 cmp r0, 0x63 ble @0806D9D6 movs r6, 0x1 @0806D9D6: cmp r0, 0xC7 ble @0806D9E0 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0806D9E0: cmp r5, 0x5 bne @0806D9F0 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 cmp r1, 0 bne @0806DAC2 @0806D9F0: cmp r5, 0x3 bne @0806DA20 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x8 ands r0, r1 cmp r0, 0 beq @0806DAC2 ldr r2, =gTrainers ldr r0, =0x02038bca ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r1, [r0, 0x1] adds r0, r1, 0 subs r0, 0x1F lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @0806DA20 cmp r1, 0x26 bne @0806DAC2 @0806DA20: ldr r1, =gUnknown_08329ECE lsls r0, r5, 1 adds r0, r5 adds r0, r6, r0 adds r0, r1 ldrb r2, [r0] movs r1, 0 ldrsb r1, [r0, r1] cmp r1, 0 ble @0806DA46 cmp r4, 0x1B bne @0806DA46 movs r0, 0x96 muls r0, r1 movs r1, 0x64 bl __divsi3 lsls r0, 24 lsrs r2, r0, 24 @0806DA46: lsls r2, 24 asrs r2, 24 mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] adds r0, r2 mov r1, sp strh r0, [r1] cmp r2, 0 ble @0806DA98 adds r0, r7, 0 movs r1, 0x26 movs r2, 0 bl pokemon_getattr cmp r0, 0xB bne @0806DA74 mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] adds r0, 0x1 mov r1, sp strh r0, [r1] @0806DA74: adds r0, r7, 0 movs r1, 0x23 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 bl sav1_map_get_name lsls r0, 24 lsrs r0, 24 cmp r4, r0 bne @0806DA98 mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] adds r0, 0x1 mov r1, sp strh r0, [r1] @0806DA98: mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bge @0806DAA8 movs r1, 0 mov r0, sp strh r1, [r0] @0806DAA8: mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0xFF ble @0806DAB8 movs r1, 0xFF mov r0, sp strh r1, [r0] @0806DAB8: adds r0, r7, 0 movs r1, 0x20 mov r2, sp bl pokemon_setattr @0806DAC2: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end happiness_algorithm thumb_func_start sub_806DADC sub_806DADC: ; 806DADC push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x8 mov r8, r0 lsls r1, 16 lsrs r5, r1, 16 movs r4, 0 movs r7, 0 movs r6, 0 @0806DAF0: adds r1, r6, 0 adds r1, 0x1A mov r0, r8 movs r2, 0 bl pokemon_getattr mov r2, sp adds r1, r2, r6 strb r0, [r1] ldrb r0, [r1] adds r0, r7, r0 lsls r0, 16 lsrs r7, r0, 16 adds r6, 0x1 cmp r6, 0x5 ble @0806DAF0 movs r6, 0 b @0806DC72 @0806DB14: mov r0, r8 movs r1, 0 bl sub_806DDE4 lsls r0, 24 movs r2, 0x1 cmp r0, 0 beq @0806DB26 movs r2, 0x2 @0806DB26: cmp r6, 0x5 bhi @0806DBC8 lsls r0, r6, 2 ldr r1, =@0806DB38 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806DB38: .4byte @0806DB50 .4byte @0806DB64 .4byte @0806DB78 .4byte @0806DB8C .4byte @0806DBA0 .4byte @0806DBB4 @0806DB50: ldr r0, =gBaseStats lsls r1, r5, 3 subs r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xA] lsls r0, 30 b @0806DBC2 .align 2, 0 .pool @0806DB64: ldr r0, =gBaseStats lsls r1, r5, 3 subs r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xA] b @0806DBC0 .align 2, 0 .pool @0806DB78: ldr r0, =gBaseStats lsls r1, r5, 3 subs r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xA] lsls r0, 26 b @0806DBC2 .align 2, 0 .pool @0806DB8C: ldr r0, =gBaseStats lsls r1, r5, 3 subs r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xA] lsrs r0, 6 b @0806DBC4 .align 2, 0 .pool @0806DBA0: ldr r0, =gBaseStats lsls r1, r5, 3 subs r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xB] lsls r0, 30 b @0806DBC2 .align 2, 0 .pool @0806DBB4: ldr r0, =gBaseStats lsls r1, r5, 3 subs r1, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0xB] @0806DBC0: lsls r0, 28 @0806DBC2: lsrs r0, 30 @0806DBC4: adds r4, r0, 0 muls r4, r2 @0806DBC8: mov r0, r8 movs r1, 0xC movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 cmp r0, 0xAF bne @0806DC14 ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806DC00 ldr r0, =0x02024404 ldrb r0, [r0, 0x7] b @0806DC1C .align 2, 0 .pool @0806DC00: ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003226 adds r0, r2 ldrb r0, [r0] b @0806DC1C .align 2, 0 .pool @0806DC14: bl itemid_get_x12 lsls r0, 24 lsrs r0, 24 @0806DC1C: cmp r0, 0x18 bne @0806DC24 lsls r0, r4, 17 lsrs r4, r0, 16 @0806DC24: lsls r0, r4, 16 asrs r2, r0, 16 adds r1, r7, r2 movs r0, 0xFF lsls r0, 1 cmp r1, r0 ble @0806DC3C adds r0, r2, r0 adds r1, r7, r4 subs r0, r1 lsls r0, 16 lsrs r4, r0, 16 @0806DC3C: mov r0, sp adds r2, r0, r6 ldrb r3, [r2] lsls r0, r4, 16 asrs r1, r0, 16 adds r0, r3, r1 cmp r0, 0xFF ble @0806DC58 adds r0, r1, 0 adds r0, 0xFF adds r1, r3, r4 subs r0, r1 lsls r0, 16 lsrs r4, r0, 16 @0806DC58: adds r0, r3, r4 strb r0, [r2] adds r0, r7, r4 lsls r0, 16 lsrs r7, r0, 16 adds r1, r6, 0 adds r1, 0x1A mov r0, r8 bl pokemon_setattr adds r6, 0x1 cmp r6, 0x5 bgt @0806DC7A @0806DC72: ldr r0, =0x000001fd cmp r7, r0 bhi @0806DC7A b @0806DB14 @0806DC7A: add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806DADC thumb_func_start sub_806DC8C sub_806DC8C: ; 806DC8C push {r4-r6,lr} adds r6, r0, 0 movs r5, 0 movs r4, 0 @0806DC94: adds r1, r4, 0 adds r1, 0x1A adds r0, r6, 0 movs r2, 0 bl pokemon_getattr adds r0, r5, r0 lsls r0, 16 lsrs r5, r0, 16 adds r4, 0x1 cmp r4, 0x5 ble @0806DC94 adds r0, r5, 0 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_806DC8C thumb_func_start sub_806DCB4 sub_806DCB4: ; 806DCB4 push {r4-r6,lr} sub sp, 0x4 adds r6, r0, 0 bl GenerateRandomNumber lsls r0, 16 lsrs r5, r0, 16 movs r0, 0x80 lsls r0, 7 cmp r5, r0 beq @0806DCDA movs r0, 0x80 lsls r0, 8 cmp r5, r0 beq @0806DCDA movs r0, 0xC0 lsls r0, 8 cmp r5, r0 bne @0806DD70 @0806DCDA: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x6 bl __umodsi3 lsls r0, 16 lsrs r5, r0, 16 movs r0, 0x64 muls r0, r5 adds r4, r6, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr cmp r0, 0 beq @0806DCDA adds r0, r4, 0 movs r1, 0x2D movs r2, 0 bl pokemon_getattr cmp r0, 0 bne @0806DCDA ldr r1, =gUnknown_0832A328 lsls r0, r5, 2 adds r0, r1 ldrb r1, [r0] adds r0, r6, 0 bl sub_806DDE4 lsls r0, 24 cmp r0, 0 bne @0806DD70 movs r4, 0x7 @0806DD24: bl GenerateRandomNumber lsls r0, 24 lsrs r0, 24 mov r1, sp strb r0, [r1] adds r2, r0, 0 adds r1, r2, 0 ands r1, r4 cmp r1, 0 beq @0806DD24 movs r0, 0xF0 ands r0, r2 cmp r0, 0 beq @0806DD46 mov r0, sp strb r1, [r0] @0806DD46: mov r0, sp ldrb r0, [r0] lsls r1, r0, 4 orrs r0, r1 lsls r0, 24 lsrs r0, 24 mov r1, sp strb r0, [r1] movs r1, 0xF3 ands r1, r0 mov r0, sp strb r1, [r0] adds r1, 0x1 strb r1, [r0] movs r0, 0x64 muls r0, r5 adds r0, r6, r0 movs r1, 0x22 mov r2, sp bl pokemon_setattr @0806DD70: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806DCB4 thumb_func_start sub_806DD7C sub_806DD7C: ; 806DD7C push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 lsls r1, 24 lsrs r4, r1, 24 movs r3, 0 movs r6, 0x1 movs r5, 0 cmp r4, 0 beq @0806DDC4 @0806DD90: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @0806DDB8 movs r0, 0x64 muls r0, r3 adds r0, r7, r0 movs r1, 0x22 movs r2, 0 str r3, [sp] bl pokemon_getattr movs r1, 0xF ands r1, r0 ldr r3, [sp] cmp r1, 0 beq @0806DDB8 orrs r5, r6 lsls r0, r5, 24 lsrs r5, r0, 24 @0806DDB8: adds r3, 0x1 lsls r6, 1 lsrs r4, 1 cmp r4, 0 bne @0806DD90 b @0806DDD8 @0806DDC4: adds r0, r7, 0 movs r1, 0x22 movs r2, 0 bl pokemon_getattr movs r1, 0xF ands r1, r0 cmp r1, 0 beq @0806DDD8 movs r5, 0x1 @0806DDD8: adds r0, r5, 0 add sp, 0x4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_806DD7C thumb_func_start sub_806DDE4 sub_806DDE4: ; 806DDE4 push {r4-r7,lr} sub sp, 0x4 adds r7, r0, 0 lsls r1, 24 lsrs r4, r1, 24 movs r3, 0 movs r6, 0x1 movs r5, 0 cmp r4, 0 beq @0806DE28 @0806DDF8: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @0806DE1C movs r0, 0x64 muls r0, r3 adds r0, r7, r0 movs r1, 0x22 movs r2, 0 str r3, [sp] bl pokemon_getattr ldr r3, [sp] cmp r0, 0 beq @0806DE1C orrs r5, r6 lsls r0, r5, 24 lsrs r5, r0, 24 @0806DE1C: adds r3, 0x1 lsls r6, 1 lsrs r4, 1 cmp r4, 0 bne @0806DDF8 b @0806DE38 @0806DE28: adds r0, r7, 0 movs r1, 0x22 movs r2, 0 bl pokemon_getattr cmp r0, 0 beq @0806DE38 movs r5, 0x1 @0806DE38: adds r0, r5, 0 add sp, 0x4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_806DDE4 thumb_func_start sub_806DE44 sub_806DE44: ; 806DE44 push {r4-r7,lr} sub sp, 0x4 lsls r0, 16 lsrs r7, r0, 16 movs r6, 0 mov r5, sp @0806DE50: movs r0, 0x64 adds r1, r6, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr cmp r0, 0 beq @0806DEB2 adds r0, r4, 0 movs r1, 0x22 movs r2, 0 bl pokemon_getattr lsls r0, 24 lsrs r0, 24 strb r0, [r5] movs r1, 0xF adds r2, r0, 0 ands r1, r2 cmp r1, 0 beq @0806DEB2 cmp r1, r7 bcc @0806DE8A cmp r7, 0x4 bls @0806DE94 @0806DE8A: movs r0, 0xF0 ands r0, r2 b @0806DE96 .align 2, 0 .pool @0806DE94: subs r0, r2, r7 @0806DE96: strb r0, [r5] ldrb r0, [r5] cmp r0, 0 bne @0806DEA2 movs r0, 0x10 strb r0, [r5] @0806DEA2: movs r0, 0x64 muls r0, r6 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x22 mov r2, sp bl pokemon_setattr @0806DEB2: adds r6, 0x1 cmp r6, 0x5 ble @0806DE50 add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gExperienceTables ldr r2, =gBaseStats lsls r1, r4, 3 subs r1, r4 lsls r1, 2 adds r1, r2 ldrb r2, [r1, 0x13] movs r1, 0xCA lsls r1, 1 adds r4, r2, 0 muls r4, r1 movs r2, 0xC8 lsls r2, 1 adds r1, r6, r2 adds r1, r4, r1 ldr r1, [r1] cmp r0, r1 bls @0806DFD4 str r1, [sp, 0x4] add r2, sp, 0x4 adds r0, r5, 0 movs r1, 0x19 bl pokemon_setattr @0806DFD4: mov r0, sp ldrb r0, [r0] cmp r0, 0x64 bhi @0806DFEA lsls r0, 2 adds r0, r4 adds r0, r6 ldr r1, [sp, 0x4] ldr r0, [r0] cmp r1, r0 bcs @0806DFF8 @0806DFEA: movs r0, 0 b @0806E004 .align 2, 0 .pool @0806DFF8: adds r0, r5, 0 movs r1, 0x38 mov r2, sp bl pokemon_setattr movs r0, 0x1 @0806E004: add sp, 0x8 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_806DF74 thumb_func_start sub_806E00C sub_806E00C: ; 806E00C push {r4,r5,lr} lsls r1, 24 lsrs r4, r1, 24 adds r5, r4, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r1, r0, 16 adds r3, r1, 0 movs r0, 0xCE lsls r0, 1 cmp r1, r0 bne @0806E02E movs r0, 0 b @0806E05A @0806E02E: cmp r4, 0x1F bls @0806E04C adds r0, r4, 0 subs r0, 0x20 movs r2, 0x1 lsls r2, r0 ldr r0, =gTMHMLearnsets lsls r1, 3 adds r0, 0x4 adds r1, r0 ldr r0, [r1] ands r0, r2 b @0806E05A .align 2, 0 .pool @0806E04C: movs r1, 0x1 lsls r1, r5 ldr r2, =gTMHMLearnsets lsls r0, r3, 3 adds r0, r2 ldr r0, [r0] ands r0, r1 @0806E05A: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806E00C thumb_func_start sub_806E064 sub_806E064: ; 806E064 push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 adds r4, r3, 0 lsls r1, 24 lsrs r1, 24 adds r2, r1, 0 movs r0, 0xCE lsls r0, 1 cmp r3, r0 bne @0806E07E movs r0, 0 b @0806E0AA @0806E07E: cmp r1, 0x1F bls @0806E09C adds r0, r1, 0 subs r0, 0x20 movs r2, 0x1 lsls r2, r0 ldr r0, =gTMHMLearnsets lsls r1, r3, 3 adds r0, 0x4 adds r1, r0 ldr r0, [r1] ands r0, r2 b @0806E0AA .align 2, 0 .pool @0806E09C: movs r1, 0x1 lsls r1, r2 ldr r2, =gTMHMLearnsets lsls r0, r4, 3 adds r0, r2 ldr r0, [r0] ands r0, r1 @0806E0AA: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806E064 thumb_func_start sub_806E0B4 sub_806E0B4: ; 806E0B4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 adds r6, r0, 0 str r1, [sp, 0x8] movs r0, 0 mov r10, r0 adds r0, r6, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r7, r0, 16 adds r0, r6, 0 movs r1, 0x38 movs r2, 0 bl pokemon_getattr lsls r0, 24 lsrs r0, 24 str r0, [sp, 0xC] movs r5, 0 mov r4, sp @0806E0EA: adds r1, r5, 0 adds r1, 0xD adds r0, r6, 0 movs r2, 0 bl pokemon_getattr strh r0, [r4] adds r4, 0x2 adds r5, 0x1 cmp r5, 0x3 ble @0806E0EA movs r5, 0 ldr r6, =gLevelUpLearnsetPointers lsls r1, r7, 2 adds r2, r1, r6 ldr r3, [r2] ldrh r0, [r3] ldr r4, =0x0000ffff str r1, [sp, 0x14] cmp r0, r4 beq @0806E1E4 mov r9, r2 str r3, [sp, 0x10] @0806E118: lsls r2, r5, 1 ldr r1, [sp, 0x10] adds r0, r2, r1 ldrh r3, [r0] movs r0, 0xFE lsls r0, 8 ands r0, r3 ldr r4, [sp, 0xC] lsls r1, r4, 9 adds r7, r2, 0 adds r5, 0x1 mov r12, r5 cmp r0, r1 bgt @0806E1CE movs r4, 0 mov r0, sp ldrh r1, [r0] ldr r0, =0x000001ff ands r0, r3 cmp r1, r0 beq @0806E168 ldr r0, [sp, 0x14] ldr r1, =gLevelUpLearnsetPointers adds r6, r0, r1 ldr r2, =0x000001ff mov r8, r2 mov r3, sp adds r5, r7, 0 @0806E150: adds r3, 0x2 adds r4, 0x1 cmp r4, 0x3 bgt @0806E168 ldr r0, [r6] adds r0, r5, r0 ldrh r1, [r0] ldrh r2, [r3] mov r0, r8 ands r0, r1 cmp r2, r0 bne @0806E150 @0806E168: cmp r4, 0x4 bne @0806E1CE movs r4, 0 cmp r4, r10 bge @0806E1AC mov r1, r9 ldr r0, [r1] adds r0, r7, r0 ldrh r1, [r0] ldr r0, [sp, 0x8] ldrh r2, [r0] ldr r0, =0x000001ff ands r0, r1 cmp r2, r0 beq @0806E1AC ldr r1, [sp, 0x14] ldr r2, =gLevelUpLearnsetPointers adds r6, r1, r2 ldr r0, =0x000001ff mov r8, r0 ldr r3, [sp, 0x8] adds r5, r7, 0 @0806E194: adds r3, 0x2 adds r4, 0x1 cmp r4, r10 bge @0806E1AC ldr r0, [r6] adds r0, r5, r0 ldrh r1, [r0] ldrh r2, [r3] mov r0, r8 ands r0, r1 cmp r2, r0 bne @0806E194 @0806E1AC: cmp r4, r10 bne @0806E1CE mov r0, r10 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r10, r0 lsls r2, r4, 1 ldr r1, [sp, 0x8] adds r2, r1 mov r4, r9 ldr r0, [r4] adds r0, r7, r0 ldrh r1, [r0] ldr r0, =0x000001ff ands r0, r1 strh r0, [r2] @0806E1CE: mov r5, r12 cmp r5, 0x13 bgt @0806E1E4 mov r1, r9 ldr r0, [r1] lsls r1, r5, 1 adds r1, r0 ldrh r0, [r1] ldr r2, =0x0000ffff cmp r0, r2 bne @0806E118 @0806E1E4: mov r0, r10 add sp, 0x18 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806E0B4 thumb_func_start sub_806E204 sub_806E204: ; 806E204 push {r4-r7,lr} adds r6, r1, 0 lsls r0, 16 movs r5, 0 movs r4, 0 ldr r1, =gLevelUpLearnsetPointers lsrs r0, 14 adds r0, r1 ldr r2, [r0] ldrh r0, [r2] ldr r1, =0x0000ffff cmp r0, r1 beq @0806E248 ldr r0, =0x000001ff mov r12, r0 adds r7, r1, 0 adds r3, r2, 0 @0806E226: adds r1, r5, 0 adds r0, r1, 0x1 lsls r0, 24 lsrs r5, r0, 24 lsls r1, 1 adds r1, r6 ldrh r2, [r3] mov r0, r12 ands r0, r2 strh r0, [r1] adds r3, 0x2 adds r4, 0x1 cmp r4, 0x13 bgt @0806E248 ldrh r0, [r3] cmp r0, r7 bne @0806E226 @0806E248: adds r0, r5, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806E204 thumb_func_start sub_806E25C sub_806E25C: ; 806E25C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x3C adds r6, r0, 0 movs r0, 0 mov r10, r0 adds r0, r6, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 adds r0, r6, 0 movs r1, 0x38 movs r2, 0 bl pokemon_getattr lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x30] movs r0, 0xCE lsls r0, 1 cmp r4, r0 bne @0806E298 movs r0, 0 b @0806E3A2 @0806E298: movs r5, 0 lsls r4, 2 str r4, [sp, 0x38] mov r4, sp @0806E2A0: adds r1, r5, 0 adds r1, 0xD adds r0, r6, 0 movs r2, 0 bl pokemon_getattr strh r0, [r4] adds r4, 0x2 adds r5, 0x1 cmp r5, 0x3 ble @0806E2A0 movs r5, 0 ldr r3, =gLevelUpLearnsetPointers ldr r2, [sp, 0x38] adds r1, r2, r3 ldr r0, [r1] ldrh r0, [r0] ldr r2, =0x0000ffff cmp r0, r2 beq @0806E3A0 mov r9, r1 mov r4, sp adds r4, 0x8 str r4, [sp, 0x34] @0806E2D0: mov r1, r9 ldr r0, [r1] lsls r2, r5, 1 adds r0, r2, r0 ldrh r3, [r0] movs r0, 0xFE lsls r0, 8 ands r0, r3 ldr r4, [sp, 0x30] lsls r1, r4, 9 adds r7, r2, 0 adds r5, 0x1 mov r12, r5 cmp r0, r1 bgt @0806E38A movs r4, 0 mov r0, sp ldrh r1, [r0] ldr r0, =0x000001ff ands r0, r3 cmp r1, r0 beq @0806E322 ldr r0, [sp, 0x38] ldr r1, =gLevelUpLearnsetPointers adds r6, r0, r1 ldr r2, =0x000001ff mov r8, r2 mov r3, sp adds r5, r7, 0 @0806E30A: adds r3, 0x2 adds r4, 0x1 cmp r4, 0x3 bgt @0806E322 ldr r0, [r6] adds r0, r5, r0 ldrh r1, [r0] ldrh r2, [r3] mov r0, r8 ands r0, r1 cmp r2, r0 bne @0806E30A @0806E322: cmp r4, 0x4 bne @0806E38A movs r4, 0 cmp r4, r10 bge @0806E368 mov r1, r9 ldr r0, [r1] adds r0, r7, r0 ldrh r1, [r0] ldr r0, [sp, 0x34] ldrh r2, [r0] ldr r0, =0x000001ff ands r0, r1 add r1, sp, 0x8 cmp r2, r0 beq @0806E368 ldr r2, [sp, 0x38] ldr r0, =gLevelUpLearnsetPointers adds r6, r2, r0 ldr r2, =0x000001ff mov r8, r2 adds r3, r1, 0 adds r5, r7, 0 @0806E350: adds r3, 0x2 adds r4, 0x1 cmp r4, r10 bge @0806E368 ldr r0, [r6] adds r0, r5, r0 ldrh r1, [r0] ldrh r2, [r3] mov r0, r8 ands r0, r1 cmp r2, r0 bne @0806E350 @0806E368: cmp r4, r10 bne @0806E38A mov r0, r10 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r10, r0 lsls r2, r4, 1 ldr r4, [sp, 0x34] adds r2, r4, r2 mov r1, r9 ldr r0, [r1] adds r0, r7, r0 ldrh r1, [r0] ldr r0, =0x000001ff ands r0, r1 strh r0, [r2] @0806E38A: mov r5, r12 cmp r5, 0x13 bgt @0806E3A0 mov r2, r9 ldr r0, [r2] lsls r1, r5, 1 adds r1, r0 ldrh r0, [r1] ldr r4, =0x0000ffff cmp r0, r4 bne @0806E2D0 @0806E3A0: mov r0, r10 @0806E3A2: add sp, 0x3C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806E25C thumb_func_start sub_806E3C0 sub_806E3C0: ; 806E3C0 push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 bl sub_809D42C cmp r0, 0 beq @0806E3DA adds r0, r4, 0 bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 b @0806E3F2 @0806E3DA: adds r0, r4, 0 bl SpeciesToHoennPokedexNum adds r4, r0, 0 cmp r4, 0xCA bls @0806E3F0 ldr r0, =0x0000ffff b @0806E3F2 .align 2, 0 .pool @0806E3F0: adds r0, r4, 0 @0806E3F2: pop {r4} pop {r1} bx r1 thumb_func_end sub_806E3C0 thumb_func_start sub_806E3F8 sub_806E3F8: ; 806E3F8 push {lr} lsls r0, 16 lsrs r0, 16 bl SpeciesToHoennPokedexNum lsls r0, 16 lsrs r0, 16 cmp r0, 0xCA bhi @0806E40E movs r0, 0x1 b @0806E410 @0806E40E: movs r0, 0 @0806E410: pop {r1} bx r1 thumb_func_end sub_806E3F8 thumb_func_start sub_806E414 sub_806E414: ; 806E414 push {lr} ldr r1, =0x020244e4 movs r2, 0 adds r0, r1, 0x3 @0806E41C: strb r2, [r0] subs r0, 0x1 cmp r0, r1 bge @0806E41C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806E414 thumb_func_start song_id_for_battle song_id_for_battle: ; 806E42C push {lr} ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 5 ands r0, r1 cmp r0, 0 beq @0806E448 movs r0, 0xF0 lsls r0, 1 b @0806E646 .align 2, 0 .pool @0806E448: movs r0, 0x80 lsls r0, 7 ands r0, r1 cmp r0, 0 beq @0806E45C ldr r0, =0x000001df b @0806E646 .align 2, 0 .pool @0806E45C: ldr r0, =0x02000002 ands r0, r1 cmp r0, 0 beq @0806E466 b @0806E63C @0806E466: movs r0, 0x8 ands r0, r1 cmp r0, 0 bne @0806E470 b @0806E642 @0806E470: ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0806E494 ldr r0, =0x02038bca ldrh r0, [r0] bl sub_8162BD8 lsls r0, 24 lsrs r0, 24 b @0806E4B2 .align 2, 0 .pool @0806E494: movs r0, 0x80 lsls r0, 19 ands r1, r0 cmp r1, 0 beq @0806E4A2 movs r0, 0xA b @0806E4B2 @0806E4A2: ldr r2, =gTrainers ldr r0, =0x02038bca ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x1] @0806E4B2: subs r0, 0x3 cmp r0, 0x3D bls @0806E4BA b @0806E63C @0806E4BA: lsls r0, 2 ldr r1, =@0806E4D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0806E4D0: .4byte @0806E5D0 .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E5D0 .4byte @0806E63C .4byte @0806E5D0 .4byte @0806E63C .4byte @0806E5C8 .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E62C .4byte @0806E5D8 .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E5E0 .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E5D0 .4byte @0806E5E6 .4byte @0806E63C .4byte @0806E63C .4byte @0806E5C8 .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E63C .4byte @0806E632 .4byte @0806E632 .4byte @0806E632 .4byte @0806E632 .4byte @0806E632 .4byte @0806E632 .4byte @0806E632 @0806E5C8: ldr r0, =0x000001e3 b @0806E646 .align 2, 0 .pool @0806E5D0: ldr r0, =0x000001db b @0806E646 .align 2, 0 .pool @0806E5D8: ldr r0, =0x000001dd b @0806E646 .align 2, 0 .pool @0806E5E0: movs r0, 0xEF lsls r0, 1 b @0806E646 @0806E5E6: ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0806E604 @0806E5F2: ldr r0, =0x000001e1 b @0806E646 .align 2, 0 .pool @0806E604: ldr r0, =0x02038bca ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =gTrainers + 0x4 ; name offset adds r0, r1 ldr r1, =gUnknown_085CCB98 bl sub_8008C44 cmp r0, 0 beq @0806E63C b @0806E5F2 .align 2, 0 .pool @0806E62C: movs r0, 0xF1 lsls r0, 1 b @0806E646 @0806E632: ldr r0, =0x000001d7 b @0806E646 .align 2, 0 .pool @0806E63C: movs r0, 0xEE lsls r0, 1 b @0806E646 @0806E642: movs r0, 0xED lsls r0, 1 @0806E646: pop {r1} bx r1 thumb_func_end song_id_for_battle thumb_func_start sub_806E64C sub_806E64C: ; 806E64C push {lr} bl map_music_set_to_zero bl m4aMPlayAllStop bl song_id_for_battle lsls r0, 16 lsrs r0, 16 bl song_play_for_text pop {r0} bx r0 thumb_func_end sub_806E64C thumb_func_start current_map_music_set__default_for_battle current_map_music_set__default_for_battle: ; 806E668 push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 bl map_music_set_to_zero bl m4aMPlayAllStop cmp r4, 0 beq @0806E682 adds r0, r4, 0 bl current_map_music_set b @0806E68E @0806E682: bl song_id_for_battle lsls r0, 16 lsrs r0, 16 bl current_map_music_set @0806E68E: pop {r4} pop {r0} bx r0 thumb_func_end current_map_music_set__default_for_battle thumb_func_start sub_806E694 sub_806E694: ; 806E694 push {r4,lr} adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl map_music_set_to_zero bl m4aMPlayAllStop ldr r0, =sub_806E6CC movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806E694 thumb_func_start sub_806E6CC sub_806E6CC: ; 806E6CC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r1, r0, r1 movs r2, 0x8 ldrsh r0, [r1, r2] cmp r0, 0 beq @0806E6F0 ldrh r0, [r1, 0x8] bl current_map_music_set b @0806E6FC .align 2, 0 .pool @0806E6F0: bl song_id_for_battle lsls r0, 16 lsrs r0, 16 bl current_map_music_set @0806E6FC: adds r0, r4, 0 bl remove_task pop {r4} pop {r0} bx r0 thumb_func_end sub_806E6CC thumb_func_start pokemon_get_pal pokemon_get_pal: ; 806E708 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x1 movs r2, 0 bl pokemon_getattr adds r6, r0, 0 adds r0, r5, 0 movs r1, 0 movs r2, 0 bl pokemon_getattr adds r2, r0, 0 adds r0, r4, 0 adds r1, r6, 0 bl species_and_otid_get_pal pop {r4-r6} pop {r1} bx r1 thumb_func_end pokemon_get_pal thumb_func_start species_and_otid_get_pal species_and_otid_get_pal: ; 806E740 push {r4,r5,lr} adds r3, r2, 0 lsls r0, 16 lsrs r4, r0, 16 adds r5, r4, 0 movs r0, 0xCE lsls r0, 1 cmp r4, r0 bls @0806E75C ldr r0, =gMonPaletteTable ldr r0, [r0] b @0806E788 .align 2, 0 .pool @0806E75C: lsrs r0, r1, 16 ldr r2, =0x0000ffff ands r1, r2 eors r0, r1 lsrs r1, r3, 16 eors r0, r1 ands r3, r2 eors r0, r3 cmp r0, 0x7 bls @0806E780 ldr r0, =gMonPaletteTable lsls r1, r4, 3 b @0806E784 .align 2, 0 .pool @0806E780: ldr r0, =gMonShinyPaletteTable lsls r1, r5, 3 @0806E784: adds r1, r0 ldr r0, [r1] @0806E788: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end species_and_otid_get_pal thumb_func_start sub_806E794 sub_806E794: ; 806E794 push {r4-r6,lr} adds r5, r0, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x1 movs r2, 0 bl pokemon_getattr adds r6, r0, 0 adds r0, r5, 0 movs r1, 0 movs r2, 0 bl pokemon_getattr adds r2, r0, 0 adds r0, r4, 0 adds r1, r6, 0 bl sub_806E7CC pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_806E794 thumb_func_start sub_806E7CC sub_806E7CC: ; 806E7CC push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 lsrs r0, r1, 16 ldr r3, =0x0000ffff ands r1, r3 eors r0, r1 lsrs r1, r2, 16 eors r0, r1 ands r2, r3 eors r0, r2 cmp r0, 0x7 bls @0806E7F4 lsls r0, r4, 3 ldr r1, =gMonPaletteTable b @0806E7F8 .align 2, 0 .pool @0806E7F4: lsls r0, r4, 3 ldr r1, =gMonShinyPaletteTable @0806E7F8: adds r0, r1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806E7CC thumb_func_start sub_806E804 sub_806E804: ; 806E804 push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 ldr r2, =gUnknown_08329EEA ldrh r0, [r2] ldr r1, =0x0000ffff cmp r0, r1 beq @0806E836 adds r4, r1, 0 adds r1, r2, 0 @0806E818: ldrh r0, [r2] adds r1, 0x2 adds r2, 0x2 cmp r0, r3 bne @0806E830 movs r0, 0x1 b @0806E838 .align 2, 0 .pool @0806E830: ldrh r0, [r1] cmp r0, r4 bne @0806E818 @0806E836: movs r0, 0 @0806E838: pop {r4} pop {r1} bx r1 thumb_func_end sub_806E804 thumb_func_start sub_806E840 sub_806E840: ; 806E840 lsls r0, 16 lsrs r0, 16 ldr r2, =gBaseStats lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x19] lsrs r0, 7 bx lr .align 2, 0 .pool thumb_func_end sub_806E840 thumb_func_start sub_806E858 sub_806E858: ; 806E858 push {r4,lr} lsls r4, r1, 24 lsrs r4, 24 bl GetNature lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_085B25A0 lsls r1, r0, 2 adds r1, r0 adds r1, r4 adds r1, r2 movs r0, 0 ldrsb r0, [r1, r0] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806E858 thumb_func_start sub_806E880 sub_806E880: ; 806E880 push {r4,lr} lsls r4, r1, 24 lsrs r4, 24 bl GetNatureFromPersonality lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_085B25A0 lsls r1, r0, 2 adds r1, r0 adds r1, r4 adds r1, r2 movs r0, 0 ldrsb r0, [r1, r0] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806E880 thumb_func_start sub_806E8A8 sub_806E8A8: ; 806E8A8 push {r4,lr} sub sp, 0x8 adds r4, r0, 0 movs r1, 0x7 mov r2, sp bl pokemon_getattr adds r0, r4, 0 movs r1, 0x1 movs r2, 0 bl pokemon_getattr mov r1, sp bl sub_806E8D4 lsls r0, 24 lsrs r0, 24 add sp, 0x8 pop {r4} pop {r1} bx r1 thumb_func_end sub_806E8A8 thumb_func_start sub_806E8D4 sub_806E8D4: ; 806E8D4 push {r4,r5,lr} adds r5, r1, 0 ldr r1, =0x03005d90 ldr r3, [r1] ldrb r2, [r3, 0xA] ldrb r1, [r3, 0xB] lsls r1, 8 orrs r2, r1 ldrb r1, [r3, 0xC] lsls r1, 16 orrs r2, r1 ldrb r1, [r3, 0xD] lsls r1, 24 orrs r2, r1 cmp r0, r2 bne @0806E91C movs r4, 0 ldrb r0, [r5] cmp r0, 0xFF beq @0806E912 adds r2, r5, 0 @0806E8FE: adds r1, r3, r4 ldrb r0, [r2] ldrb r1, [r1] cmp r0, r1 bne @0806E91C adds r2, 0x1 adds r4, 0x1 ldrb r0, [r2] cmp r0, 0xFF bne @0806E8FE @0806E912: movs r0, 0 b @0806E91E .align 2, 0 .pool @0806E91C: movs r0, 0x1 @0806E91E: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_806E8D4 thumb_func_start sub_806E924 sub_806E924: ; 806E924 push {lr} bl pokemon_restore_pp pop {r0} bx r0 thumb_func_end sub_806E924 thumb_func_start pokemon_restore_pp pokemon_restore_pp: ; 806E930 push {r4-r6,lr} sub sp, 0x4 adds r5, r0, 0 movs r6, 0 @0806E938: adds r4, r6, 0 adds r4, 0xD adds r0, r5, 0 adds r1, r4, 0 movs r2, 0 bl pokemon_getattr_encrypted cmp r0, 0 beq @0806E984 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0 bl pokemon_getattr_encrypted adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0x15 movs r2, 0 bl pokemon_getattr_encrypted adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 lsls r2, r6, 24 lsrs r2, 24 adds r0, r4, 0 bl 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, =0x0202420a ldr r5, =0x0202449c ldr r1, [r5] adds r0, r1, 0 adds r0, 0xB0 ldrb r0, [r0] strb r0, [r2] ldr r4, =0x02022f58 movs r0, 0xFD strb r0, [r4] movs r0, 0x4 strb r0, [r4, 0x1] adds r1, 0x49 ldrb r0, [r1] strb r0, [r4, 0x2] movs r0, 0xFF strb r0, [r4, 0x4] ldrb r0, [r1] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0806E9E8 ldr r1, =0x0202406e ldr r0, [r5] adds r0, 0x49 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrb r0, [r0] bl pokemon_order_func b @0806E9F6 .align 2, 0 .pool @0806E9E8: ldr r1, =0x0202406e ldr r0, [r5] adds r0, 0x49 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r0, [r0] @0806E9F6: strb r0, [r4, 0x3] ldr r4, =0x02022f68 movs r0, 0xFD strb r0, [r4] movs r0, 0x4 strb r0, [r4, 0x1] ldr r1, =0x020244b8 ldrb r0, [r1] strb r0, [r4, 0x2] ldr r2, =0x0202406e ldrb r0, [r1] lsls r0, 1 adds r0, r2 ldrb r0, [r0] bl pokemon_order_func strb r0, [r4, 0x3] movs r0, 0xFF strb r0, [r4, 0x4] ldr r0, =gUnknown_085CB2A1 ldr r1, =0x02021fc4 bl sub_814E764 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806E994 thumb_func_start sub_806EA40 sub_806EA40: ; 806EA40 push {lr} lsls r0, 16 lsrs r3, r0, 16 movs r1, 0 ldr r2, =gUnknown_08329EFC @0806EA4A: ldrh r0, [r2] cmp r0, r3 bne @0806EA58 adds r0, r1, 0 b @0806EA62 .align 2, 0 .pool @0806EA58: adds r2, 0x4 adds r1, 0x1 cmp r1, 0x8 ble @0806EA4A movs r0, 0 @0806EA62: pop {r1} bx r1 thumb_func_end sub_806EA40 thumb_func_start sub_806EA68 sub_806EA68: ; 806EA68 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x00302008 ands r0, r1 cmp r0, 0 beq @0806EA7C b @0806EB90 @0806EA7C: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r6, r0, 16 ldr r0, =0x02024744 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x2D mov r8, r0 movs r7, 0x5F ldr r5, =0x020244ec adds r0, r5, 0 movs r1, 0x6 movs r2, 0 bl pokemon_getattr cmp r0, 0 bne @0806EAC6 adds r0, r5, 0 bl 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, =0x02037318 ldrh r1, [r0, 0x12] movs r0, 0xD2 lsls r0, 1 cmp r1, r0 bne @0806EB2C adds r0, r4, 0 bl sub_806EA40 adds r2, r0, 0 cmp r2, 0 beq @0806EB04 cmp r6, r7 bcc @0806EB90 ldr r0, =0x02024744 lsls r2, 2 ldr r1, =gUnknown_08329EFE b @0806EB6C .align 2, 0 .pool @0806EB04: cmp r6, r8 bcc @0806EB90 cmp r6, r7 bcs @0806EB18 ldr r0, =0x02024744 lsls r2, r4, 3 b @0806EB66 .align 2, 0 .pool @0806EB18: ldr r0, =0x02024744 lsls r2, r4, 3 subs r2, r4 lsls r2, 2 ldr r1, =gBaseStats + 0xe ; item 2 offset b @0806EB6C .align 2, 0 .pool @0806EB2C: ldr r0, =gBaseStats mov r12, r0 lsls r0, r4, 3 subs r1, r0, r4 lsls r5, r1, 2 mov r2, r12 adds r1, r5, r2 ldrh r3, [r1, 0xC] adds r2, r0, 0 ldrh r1, [r1, 0xE] cmp r3, r1 bne @0806EB5C cmp r3, 0 beq @0806EB5C ldr r0, =0x02024744 mov r2, r12 adds r2, 0xC adds r2, r5, r2 b @0806EB6E .align 2, 0 .pool @0806EB5C: cmp r6, r8 bcc @0806EB90 cmp r6, r7 bcs @0806EB80 ldr r0, =0x02024744 @0806EB66: subs r2, r4 lsls r2, 2 ldr r1, =gBaseStats + 0xc ; item 1 offset @0806EB6C: adds r2, r1 @0806EB6E: movs r1, 0xC bl pokemon_setattr b @0806EB90 .align 2, 0 .pool @0806EB80: ldr r0, =0x02024744 subs r2, r4 lsls r2, 2 ldr r1, =gBaseStats + 0xe ; item 2 offset adds r2, r1 movs r1, 0xC bl pokemon_setattr @0806EB90: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806EA68 thumb_func_start sub_806EBA4 sub_806EBA4: ; 806EBA4 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x1 movs r2, 0 bl pokemon_getattr adds r5, r0, 0 adds r0, r4, 0 movs r1, 0 movs r2, 0 bl pokemon_getattr adds r1, r0, 0 adds r0, r5, 0 bl sub_806EBD0 lsls r0, 24 lsrs r0, 24 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_806EBA4 thumb_func_start sub_806EBD0 sub_806EBD0: ; 806EBD0 push {r4,lr} movs r4, 0 lsrs r2, r0, 16 ldr r3, =0x0000ffff ands r0, r3 eors r2, r0 lsrs r0, r1, 16 eors r2, r0 ands r1, r3 eors r2, r1 cmp r2, 0x7 bhi @0806EBEA movs r4, 0x1 @0806EBEA: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806EBD0 thumb_func_start sub_806EBF8 sub_806EBF8: ; 806EBF8 push {r4,lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @0806EC3C ldr r2, =0x02038bce ldrh r1, [r2] ldr r0, =0x00000c03 cmp r1, r0 bne @0806EC28 ldr r0, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 ; Steven's name b @0806EC64 .align 2, 0 .pool @0806EC28: ldr r4, =0x02021cc4 ldrh r1, [r2] adds r0, r4, 0 bl sub_8162E20 adds r0, r4, 0 b @0806EC64 .align 2, 0 .pool @0806EC3C: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 ldr r4, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r4 ldrh r1, [r1, 0x18] movs r0, 0x2 eors r0, r1 bl sub_806D864 adds r1, r0, 0 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r4, 0x8 adds r0, r4 @0806EC64: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806EBF8 thumb_func_start sub_806EC70 sub_806EC70: ; 806EC70 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r2, r0, r1 ldrh r0, [r2, 0xE] subs r0, 0x1 strh r0, [r2, 0xE] lsls r0, 16 cmp r0, 0 bne @0806ECA0 ldrh r0, [r2, 0x8] ldrh r1, [r2, 0xA] lsls r1, 16 orrs r0, r1 ldrb r1, [r2, 0xC] bl sub_817F544 adds r0, r4, 0 bl remove_task @0806ECA0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806EC70 thumb_func_start sub_806ECAC sub_806ECAC: ; 806ECAC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r2, r0, r1 ldrh r0, [r2, 0xE] subs r0, 0x1 strh r0, [r2, 0xE] lsls r0, 16 cmp r0, 0 bne @0806ECE2 ldrh r0, [r2, 0x8] ldrh r1, [r2, 0xA] lsls r1, 16 orrs r0, r1 ldrb r1, [r2, 0xC] bl sub_817F578 movs r0, 0xFF bl sub_81C488C adds r0, r4, 0 bl remove_task @0806ECE2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806ECAC thumb_func_start sub_806ECEC sub_806ECEC: ; 806ECEC push {r4,r5,lr} adds r5, r0, 0 lsls r1, 16 lsrs r4, r1, 16 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @0806ED30 ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 bne @0806ED30 movs r0, 0x80 orrs r3, r0 adds r0, r5, 0 adds r1, r4, 0 bl sub_806ED40 b @0806ED38 .align 2, 0 .pool @0806ED30: adds r0, r5, 0 adds r1, r4, 0 bl sub_806ED40 @0806ED38: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_806ECEC thumb_func_start sub_806ED40 sub_806ED40: ; 806ED40 push {r4-r6,lr} adds r5, r0, 0 lsls r1, 16 lsrs r4, r1, 16 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 movs r0, 0x7F ands r0, r3 cmp r0, 0 beq @0806ED60 cmp r0, 0x1 beq @0806ED64 movs r1, 0 b @0806ED66 @0806ED60: movs r1, 0xE7 b @0806ED66 @0806ED64: movs r1, 0x19 @0806ED66: movs r0, 0x80 ands r0, r3 cmp r0, 0 beq @0806ED84 cmp r2, 0 bne @0806ED7C lsls r1, 24 asrs r1, 24 adds r0, r4, 0 bl cry_related @0806ED7C: ldr r0, =nullsub_12 b @0806EDFA .align 2, 0 .pool @0806ED84: cmp r2, 0 bne @0806EDA6 lsls r1, 24 asrs r1, 24 adds r0, r4, 0 bl cry_related adds r0, r4, 0 bl sub_806F0D4 lsls r0, 24 cmp r0, 0 beq @0806EDA6 adds r0, r5, 0 movs r1, 0x1 bl obj_anim_image_start @0806EDA6: ldr r0, =gUnknown_08329B87 subs r4, 0x1 adds r6, r4, r0 ldrb r0, [r6] cmp r0, 0 beq @0806EDEC ldr r0, =sub_806EC70 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r5, [r1, 0x8] lsrs r0, r5, 16 strh r0, [r1, 0xA] ldr r0, =gUnknown_083299EC adds r0, r4, r0 ldrb r0, [r0] strh r0, [r1, 0xC] ldrb r0, [r6] strh r0, [r1, 0xE] b @0806EDF8 .align 2, 0 .pool @0806EDEC: ldr r0, =gUnknown_083299EC adds r0, r4, r0 ldrb r1, [r0] adds r0, r5, 0 bl sub_817F544 @0806EDF8: ldr r0, =nullsub_18 @0806EDFA: str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806ED40 thumb_func_start sub_806EE0C sub_806EE0C: ; 806EE0C push {r4-r6,lr} adds r5, r0, 0 lsls r1, 16 lsrs r4, r1, 16 lsls r2, 24 cmp r2, 0 bne @0806EE2E adds r0, r4, 0 bl sub_806F0D4 lsls r0, 24 cmp r0, 0 beq @0806EE2E adds r0, r5, 0 movs r1, 0x1 bl obj_anim_image_start @0806EE2E: ldr r0, =gUnknown_08329B87 subs r4, 0x1 adds r6, r4, r0 ldrb r0, [r6] cmp r0, 0 beq @0806EE80 ldr r0, =sub_806ECAC movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 adds r2, r1 strh r5, [r2, 0x8] lsrs r1, r5, 16 strh r1, [r2, 0xA] ldr r1, =gUnknown_083299EC adds r1, r4, r1 ldrb r1, [r1] strh r1, [r2, 0xC] ldrb r1, [r6] strh r1, [r2, 0xE] bl sub_81C488C adds r0, r5, 0 bl sub_817F60C b @0806EE8C .align 2, 0 .pool @0806EE80: ldr r0, =gUnknown_083299EC adds r0, r4, r0 ldrb r1, [r0] adds r0, r5, 0 bl sub_817F578 @0806EE8C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806EE0C thumb_func_start sub_806EE98 sub_806EE98: ; 806EE98 push {lr} ldr r0, =sub_806ECAC bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @0806EEAC bl remove_task @0806EEAC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806EE98 thumb_func_start sub_806EEB4 sub_806EEB4: ; 806EEB4 push {r4,lr} adds r4, r0, 0 lsls r1, 16 lsrs r2, r1, 16 ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @0806EEE8 ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 bne @0806EEE8 ldr r0, =nullsub_12 b @0806EEFC .align 2, 0 .pool @0806EEE8: adds r0, r2, 0 bl sub_817F474 adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_817F594 ldr r0, =nullsub_18 @0806EEFC: str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806EEB4 thumb_func_start sub_806EF08 sub_806EF08: ; 806EF08 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 movs r5, 0 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 ldr r2, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 ldrh r0, [r1, 0x18] cmp r0, 0x1 beq @0806EF4C cmp r0, 0x1 bgt @0806EF38 cmp r0, 0 beq @0806EF42 b @0806EF56 .align 2, 0 .pool @0806EF38: cmp r0, 0x2 beq @0806EF42 cmp r0, 0x3 beq @0806EF4C b @0806EF56 @0806EF42: movs r5, 0x3 cmp r4, 0 beq @0806EF56 movs r5, 0x1 b @0806EF56 @0806EF4C: negs r0, r4 orrs r0, r4 asrs r5, r0, 31 movs r0, 0x2 ands r5, r0 @0806EF56: movs r2, 0 ldr r4, =0x020229e8 ldrh r0, [r4, 0x18] adds r1, r5, 0 cmp r0, r1 beq @0806EF74 adds r3, r1, 0 adds r1, r4, 0 @0806EF66: adds r1, 0x1C adds r2, 0x1 cmp r2, 0x3 bgt @0806EF74 ldrh r0, [r1, 0x18] cmp r0, r3 bne @0806EF66 @0806EF74: lsls r0, r2, 24 lsrs r0, 24 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806EF08 thumb_func_start sub_806EF84 sub_806EF84: ; 806EF84 push {r4,lr} lsls r0, 24 lsrs r3, r0, 24 lsls r1, 24 lsrs r1, 24 movs r4, 0 ldr r2, =0x020229e8 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldrh r0, [r0, 0x18] cmp r0, 0x1 beq @0806EFC4 cmp r0, 0x1 bgt @0806EFB0 cmp r0, 0 beq @0806EFBA b @0806EFCE .align 2, 0 .pool @0806EFB0: cmp r0, 0x2 beq @0806EFBA cmp r0, 0x3 beq @0806EFC4 b @0806EFCE @0806EFBA: movs r4, 0x3 cmp r3, 0 beq @0806EFCE movs r4, 0x1 b @0806EFCE @0806EFC4: negs r0, r3 orrs r0, r3 asrs r4, r0, 31 movs r0, 0x2 ands r4, r0 @0806EFCE: movs r3, 0 ldrh r0, [r2, 0x18] adds r1, r4, 0 cmp r0, r1 beq @0806EFE6 @0806EFD8: adds r2, 0x1C adds r3, 0x1 cmp r3, 0x3 bgt @0806EFE6 ldrh r0, [r2, 0x18] cmp r0, r1 bne @0806EFD8 @0806EFE6: lsls r0, r3, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 thumb_func_end sub_806EF84 thumb_func_start sub_806EFF0 sub_806EFF0: ; 806EFF0 lsls r0, 16 lsrs r0, 16 ldr r1, =gUnknown_0831F578 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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 NationalPokedexNumToSpecies lsls r0, 16 lsrs r0, 16 cmp r0, 0xC9 bne @0806F05C ldr r0, =0x03005d90 ldr r0, [r0] str r7, [r0, 0x1C] @0806F05C: adds r0, r6, 0 bl NationalPokedexNumToSpecies lsls r0, 16 movs r1, 0x9A lsls r1, 17 cmp r0, r1 bne @0806F072 ldr r0, =0x03005d90 ldr r0, [r0] str r7, [r0, 0x20] @0806F072: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806F01C thumb_func_start sub_806F07C sub_806F07C: ; 806F07C push {lr} lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x00000356 cmp r2, r0 bls @0806F08A movs r2, 0 @0806F08A: ldr r1, =gTrainers lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 ldrb r1, [r0, 0x1] movs r0, 0xD muls r0, r1 ldr r1, =gTrainerClassNames adds r0, r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806F07C thumb_func_start sub_806F0B0 sub_806F0B0: ; 806F0B0 push {lr} lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x00000356 cmp r1, r0 bls @0806F0BE movs r1, 0 @0806F0BE: lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =gTrainers + 0x4 ; name offset adds r0, r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806F0B0 thumb_func_start sub_806F0D4 sub_806F0D4: ; 806F0D4 push {lr} lsls r0, 16 lsrs r2, r0, 16 movs r1, 0 ldr r0, =0x00000181 cmp r2, r0 beq @0806F0F8 adds r0, 0x19 cmp r2, r0 beq @0806F0F8 subs r0, 0x66 cmp r2, r0 beq @0806F0F8 movs r1, 0xC9 eors r1, r2 negs r0, r1 orrs r0, r1 lsrs r1, r0, 31 @0806F0F8: adds r0, r1, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806F0D4 thumb_func_start sub_806F104 sub_806F104: ; 806F104 push {lr} ldr r2, =0x030022c0 ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0806F122 ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x003f0100 ands r0, r1 cmp r0, 0 bne @0806F144 @0806F122: ldr r1, =0x00000439 adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0806F158 bl 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 .pool @0806F158: movs r0, 0 @0806F15A: pop {r1} bx r1 thumb_func_end sub_806F104 thumb_func_start sub_806F160 sub_806F160: ; 806F160 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r6, r0, 0 ldrb r0, [r6] lsls r0, 28 movs r4, 0 cmp r0, 0 beq @0806F1EA @0806F176: ldr r0, [r6, 0xC] lsls r2, r4, 1 adds r1, r2, r4 lsls r1, 3 adds r0, r1, r0 ldr r3, =gUnknown_08329D98 adds r1, r3 ldm r1!, {r3,r5,r7} stm r0!, {r3,r5,r7} ldm r1!, {r3,r5,r7} stm r0!, {r3,r5,r7} movs r5, 0 ldrb r3, [r6, 0x1] ldr r7, [r6, 0xC] mov r9, r7 mov r8, r2 ldr r0, [r6, 0x10] mov r12, r0 adds r1, r4, 0x1 mov r10, r1 cmp r5, r3 bcs @0806F1C8 mov r7, r12 ldr r1, [r6, 0x8] lsls r0, r4, 2 adds r0, r1 ldr r2, [r0] @0806F1AC: adds r0, r4, 0 muls r0, r3 adds r0, r5 lsls r0, 3 adds r0, r7 lsls r1, r5, 11 adds r1, r2, r1 str r1, [r0] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 ldrb r3, [r6, 0x1] cmp r5, r3 bcc @0806F1AC @0806F1C8: mov r3, r8 adds r1, r3, r4 lsls r1, 3 add r1, r9 ldrb r0, [r6, 0x1] muls r0, r4 lsls r0, 3 add r0, r12 str r0, [r1, 0xC] mov r5, r10 lsls r0, r5, 16 lsrs r4, r0, 16 ldrb r0, [r6] lsls r0, 28 lsrs r0, 28 cmp r4, r0 blt @0806F176 @0806F1EA: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806F160 thumb_func_start sub_806F1FC sub_806F1FC: ; 806F1FC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r4, r0, 0 ldrb r0, [r4] lsls r0, 28 movs r3, 0 cmp r0, 0 beq @0806F296 ldr r0, =gUnknown_08329F28 mov r10, r0 @0806F216: ldr r0, [r4, 0xC] lsls r2, r3, 1 adds r1, r2, r3 lsls r1, 3 adds r1, r0 mov r0, r10 ldm r0!, {r5-r7} stm r1!, {r5-r7} ldm r0!, {r5-r7} stm r1!, {r5-r7} movs r5, 0 ldr r0, [r4, 0xC] mov r8, r0 mov r12, r2 ldr r7, [r4, 0x10] adds r1, r3, 0x1 mov r9, r1 ldrb r6, [r4, 0x1] cmp r5, r6 bcs @0806F26A adds r6, r7, 0 ldr r1, [r4, 0x8] lsls r0, r3, 2 adds r0, r1 ldr r2, [r0] @0806F248: ldrb r0, [r4] lsls r0, 28 lsrs r0, 28 adds r1, r3, 0 muls r1, r0 adds r1, r5 lsls r1, 3 adds r1, r6 lsls r0, r5, 11 adds r0, r2, r0 str r0, [r1] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 ldrb r0, [r4, 0x1] cmp r5, r0 bcc @0806F248 @0806F26A: mov r5, r12 adds r1, r5, r3 lsls r1, 3 add r1, r8 ldrb r0, [r4] lsls r0, 28 lsrs r0, 28 muls r0, r3 lsls r0, 3 adds r0, r7, r0 str r0, [r1, 0xC] ldr r6, =gUnknown_082FF70C str r6, [r1, 0x8] strh r3, [r1, 0x2] mov r7, r9 lsls r0, r7, 16 lsrs r3, r0, 16 ldrb r0, [r4] lsls r0, 28 lsrs r0, 28 cmp r3, r0 blt @0806F216 @0806F296: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806F1FC thumb_func_start sub_806F2AC sub_806F2AC: ; 806F2AC push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r5, r1, 24 movs r7, 0 movs r0, 0x1 ands r6, r0 movs r0, 0x14 bl 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, =0x020249b4 add r0, r8 str r4, [r0] @0806F468: ldr r0, =0x020249b4 add r0, r8 ldr r0, [r0] @0806F46E: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806F2AC thumb_func_start sub_806F47C sub_806F47C: ; 806F47C push {r4,lr} lsls r0, 24 lsrs r0, 24 movs r1, 0x1 ands r0, r1 ldr r1, =0x020249b4 lsls r0, 2 adds r0, r1 ldr r4, [r0] cmp r4, 0 beq @0806F4F0 ldrb r0, [r4, 0x2] cmp r0, 0xA3 beq @0806F4A8 adds r0, r4, 0 movs r1, 0 movs r2, 0x14 bl memset b @0806F4F0 .align 2, 0 .pool @0806F4A8: ldr r0, [r4, 0x10] cmp r0, 0 beq @0806F4B6 bl free movs r0, 0 str r0, [r4, 0x10] @0806F4B6: ldr r0, [r4, 0xC] cmp r0, 0 beq @0806F4C4 bl free movs r0, 0 str r0, [r4, 0xC] @0806F4C4: ldr r0, [r4, 0x8] cmp r0, 0 beq @0806F4D2 bl free movs r0, 0 str r0, [r4, 0x8] @0806F4D2: ldr r0, [r4, 0x4] cmp r0, 0 beq @0806F4E0 bl free movs r0, 0 str r0, [r4, 0x4] @0806F4E0: adds r0, r4, 0 movs r1, 0 movs r2, 0x14 bl memset adds r0, r4, 0 bl free @0806F4F0: pop {r4} pop {r0} bx r0 thumb_func_end sub_806F47C thumb_func_start sub_806F4F8 sub_806F4F8: ; 806F4F8 push {lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r3, r1, 24 ldr r2, =0x020249b4 movs r1, 0x1 ands r0, r1 lsls r0, 2 adds r0, r2 ldr r1, [r0] ldrb r0, [r1, 0x2] cmp r0, 0xA3 beq @0806F51C movs r0, 0 b @0806F530 .align 2, 0 .pool @0806F51C: ldrb r0, [r1] lsls r0, 28 lsrs r0, 28 cmp r3, r0 blt @0806F528 movs r3, 0 @0806F528: ldr r0, [r1, 0x8] lsls r1, r3, 2 adds r1, r0 ldr r0, [r1] @0806F530: pop {r1} bx r1 thumb_func_end sub_806F4F8 thumb_func_start sine ; s16 sine(s16 t, s16 amplitude) sine: ; 806F534 lsls r1, 16 asrs r1, 16 ldr r2, =gUnknown_08329F40 lsls r0, 16 asrs r0, 15 adds r0, r2 movs r2, 0 ldrsh r0, [r0, r2] muls r0, r1 lsls r0, 8 asrs r0, 16 bx lr .align 2, 0 .pool thumb_func_end sine thumb_func_start cosine ; s16 cosine(s16 t, s16 amplitude) cosine: ; 806F550 lsls r1, 16 asrs r1, 16 ldr r2, =gUnknown_08329F40 lsls r0, 16 asrs r0, 15 adds r0, 0x80 adds r0, r2 movs r2, 0 ldrsh r0, [r0, r2] muls r0, r1 lsls r0, 8 asrs r0, 16 bx lr .align 2, 0 .pool thumb_func_end cosine thumb_func_start sine2 ; s16 sine2(u16 angle) sine2: ; 806F570 push {r4,r5,lr} adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r5, 0 movs r1, 0xB4 bl __umodsi3 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0xB4 bl __udivsi3 movs r1, 0x1 ands r0, r1 ldr r1, =gUnknown_0832A1C0 lsls r4, 1 adds r4, r1 ldrh r1, [r4] cmp r0, 0 bne @0806F5A8 lsls r0, r1, 16 b @0806F5AC .align 2, 0 .pool @0806F5A8: lsls r0, r1, 16 negs r0, r0 @0806F5AC: asrs r0, 16 pop {r4,r5} pop {r1} bx r1 thumb_func_end sine2 thumb_func_start cosine2 ; s16 cosine2(u16 angle) cosine2: ; 806F5B4 push {lr} lsls r0, 16 movs r1, 0xB4 lsls r1, 15 adds r0, r1 lsrs r0, 16 bl sine2 lsls r0, 16 asrs r0, 16 pop {r1} bx r1 thumb_func_end cosine2 thumb_func_start GenerateRandomNumber ; u16 GenerateRandomNumber() GenerateRandomNumber: ; 806F5CC ldr r2, =0x03005d80 ldr r1, [r2] ldr r0, =0x41c64e6d muls r0, r1 ldr r1, =0x00006073 adds r0, r1 str r0, [r2] ldr r2, =0x020249c0 ldr r1, [r2] adds r1, 0x1 str r1, [r2] lsrs r0, 16 bx lr .align 2, 0 .pool thumb_func_end GenerateRandomNumber thumb_func_start SeedRng ; void SeedRng(u16 seed) SeedRng: ; 806F5F8 lsls r0, 16 lsrs r0, 16 ldr r1, =0x03005d80 str r0, [r1] ldr r1, =0x020249bc movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end SeedRng thumb_func_start SeedRng2 SeedRng2: ; 806F610 lsls r0, 16 lsrs r0, 16 ldr r1, =0x03005d84 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end SeedRng2 thumb_func_start GenerateRandomNumber2 GenerateRandomNumber2: ; 806F620 ldr r2, =0x03005d84 ldr r1, [r2] ldr r0, =0x41c64e6d muls r0, r1 ldr r1, =0x00006073 adds r0, r1 str r0, [r2] lsrs r0, 16 bx lr .align 2, 0 .pool thumb_func_end GenerateRandomNumber2 thumb_func_start object_new_hidden_with_callback object_new_hidden_with_callback: ; 806F640 push {r4-r6,lr} adds r6, r0, 0 ldr r0, =gUnknown_0832A3A8 movs r1, 0xF8 movs r2, 0xA8 movs r3, 0xE bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r5, =0x02020630 lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r3, r2, r5 adds r3, 0x3E ldrb r1, [r3] movs r4, 0x4 orrs r1, r4 strb r1, [r3] adds r5, 0x1C adds r2, r5 str r6, [r2] pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end object_new_hidden_with_callback thumb_func_start sub_806F67C sub_806F67C: ; 806F67C strh r1, [r0] lsrs r1, 16 strh r1, [r0, 0x2] bx lr thumb_func_end sub_806F67C thumb_func_start sub_806F684 sub_806F684: ; 806F684 ldrh r2, [r0] movs r3, 0x2 ldrsh r0, [r0, r3] lsls r0, 16 orrs r2, r0 str r2, [r1] bx lr thumb_func_end sub_806F684 thumb_func_start sub_806F694 sub_806F694: ; 806F694 push {r4-r7,lr} mov r7, r8 push {r7} ldr r4, [sp, 0x18] ldr r5, [sp, 0x1C] ldr r6, [sp, 0x20] ldr r7, [sp, 0x24] mov r8, r7 str r1, [r0] str r2, [r0, 0x4] strh r3, [r0, 0x8] strh r4, [r0, 0xA] strh r5, [r0, 0xC] strh r6, [r0, 0xE] mov r1, r8 strh r1, [r0, 0x10] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_806F694 thumb_func_start sub_806F6C0 sub_806F6C0: ; 806F6C0 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x24 mov r8, r0 ldr r0, [sp, 0x38] ldr r4, [sp, 0x3C] ldr r5, [sp, 0x40] ldr r6, [sp, 0x44] lsls r6, 16 lsrs r6, 16 lsls r3, 16 asrs r3, 16 lsls r0, 16 asrs r0, 16 str r0, [sp] lsls r4, 16 asrs r4, 16 str r4, [sp, 0x4] lsls r5, 16 asrs r5, 16 str r5, [sp, 0x8] str r6, [sp, 0xC] add r0, sp, 0x10 bl sub_806F694 add r0, sp, 0x10 mov r1, r8 movs r2, 0x1 bl BgAffineSet add sp, 0x24 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_806F6C0 thumb_func_start rfu_MBOOT_CHILD_inheritanceLinkStatus rfu_MBOOT_CHILD_inheritanceLinkStatus: ; 806F70C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x38 str r2, [sp, 0x20] adds r4, r3, 0 ldr r7, [sp, 0x58] lsls r0, 24 lsls r1, 24 ldr r2, =gUnknown_0832A3C0 lsrs r1, 23 lsrs r0, 21 adds r1, r0 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] str r0, [sp, 0x24] adds r1, r2 ldrb r1, [r1] str r1, [sp, 0x28] movs r0, 0 b @0806F88C .align 2, 0 .pool @0806F740: movs r5, 0 adds r0, 0x1 str r0, [sp, 0x30] b @0806F874 @0806F748: ldrh r0, [r4] ldr r2, =0x000003ff adds r1, r2, 0 ands r1, r0 lsls r1, 5 mov r8, r1 movs r2, 0xC0 lsls r2, 4 adds r1, r2, 0 ands r1, r0 mov r2, sp strh r0, [r2, 0x34] cmp r1, 0 bne @0806F788 ldr r0, [sp, 0x20] add r0, r8 adds r1, r7, 0 ldr r2, =0x04000008 bl CpuSet adds r4, 0x2 str r4, [sp, 0x2C] adds r7, 0x20 mov r10, r7 adds r5, 0x1 mov r9, r5 b @0806F86A .align 2, 0 .pool @0806F788: movs r0, 0x80 lsls r0, 4 cmp r1, r0 bne @0806F7CC movs r1, 0 adds r4, 0x2 str r4, [sp, 0x2C] movs r2, 0x20 adds r2, r7 mov r10, r2 adds r5, 0x1 mov r9, r5 @0806F7A0: lsls r4, r1, 24 asrs r4, 24 movs r0, 0x7 subs r0, r4 lsls r0, 2 add r0, r8 ldr r1, [sp, 0x20] adds r0, r1, r0 lsls r1, r4, 2 adds r1, r7, r1 ldr r2, =0x04000001 bl CpuSet adds r4, 0x1 lsls r4, 24 lsrs r1, r4, 24 asrs r4, 24 cmp r4, 0x7 ble @0806F7A0 b @0806F86A .align 2, 0 .pool @0806F7CC: movs r1, 0 adds r4, 0x2 str r4, [sp, 0x2C] movs r2, 0x20 adds r2, r7 mov r10, r2 adds r5, 0x1 mov r9, r5 movs r0, 0xF mov r12, r0 @0806F7E0: movs r2, 0 lsls r4, r1, 24 lsls r0, r4, 2 lsrs r0, 24 adds r6, r0, 0x3 mov r1, r8 adds r5, r1, r0 @0806F7EE: lsls r1, r2, 24 asrs r1, 24 subs r0, r6, r1 mov r2, sp adds r3, r2, r0 adds r0, r5, r1 ldr r2, [sp, 0x20] adds r0, r2, r0 ldrb r2, [r0] mov r0, r12 ands r0, r2 lsls r0, 4 lsrs r2, 4 orrs r0, r2 strb r0, [r3] adds r1, 0x1 lsls r1, 24 lsrs r2, r1, 24 asrs r1, 24 cmp r1, 0x3 ble @0806F7EE movs r1, 0x80 lsls r1, 17 adds r0, r4, r1 lsrs r1, r0, 24 asrs r0, 24 cmp r0, 0x7 ble @0806F7E0 mov r2, sp ldrh r0, [r2, 0x34] movs r2, 0x80 lsls r2, 4 ands r0, r2 cmp r0, 0 beq @0806F860 movs r1, 0 @0806F836: lsls r4, r1, 24 asrs r4, 24 movs r0, 0x7 subs r0, r4 lsls r0, 2 add r0, sp lsls r1, r4, 2 adds r1, r7, r1 ldr r2, =0x04000001 bl CpuSet adds r4, 0x1 lsls r4, 24 lsrs r1, r4, 24 asrs r4, 24 cmp r4, 0x7 ble @0806F836 b @0806F86A .align 2, 0 .pool @0806F860: mov r0, sp adds r1, r7, 0 ldr r2, =0x04000008 bl CpuSet @0806F86A: ldr r4, [sp, 0x2C] mov r7, r10 mov r1, r9 lsls r0, r1, 24 lsrs r5, r0, 24 @0806F874: ldr r2, [sp, 0x28] cmp r5, r2 bcs @0806F87C b @0806F748 @0806F87C: movs r0, 0x20 ldr r1, [sp, 0x28] subs r0, r1 lsls r0, 1 adds r4, r0 ldr r2, [sp, 0x30] lsls r0, r2, 24 lsrs r0, 24 @0806F88C: ldr r1, [sp, 0x24] cmp r0, r1 bcs @0806F894 b @0806F740 @0806F894: add sp, 0x38 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end rfu_MBOOT_CHILD_inheritanceLinkStatus thumb_func_start sub_806F8A8 sub_806F8A8: ; 806F8A8 push {lr} adds r2, r0, 0 movs r1, 0 movs r3, 0x1 @0806F8B0: adds r0, r2, 0 ands r0, r3 cmp r0, 0 beq @0806F8BC adds r0, r1, 0 b @0806F8CA @0806F8BC: lsrs r2, 1 adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x1F bls @0806F8B0 movs r0, 0 @0806F8CA: pop {r1} bx r1 thumb_func_end sub_806F8A8 thumb_func_start sub_806F8D0 sub_806F8D0: ; 806F8D0 push {r4-r7,lr} adds r7, r0, 0 adds r4, r1, 0 ldr r2, =0x00001121 movs r3, 0 cmp r3, r4 bge @0806F91C movs r6, 0x1 ldr r0, =0x00008408 adds r5, r0, 0 @0806F8E4: adds r0, r7, r3 ldrb r0, [r0] eors r2, r0 movs r1, 0 adds r3, 0x1 @0806F8EE: adds r0, r2, 0 ands r0, r6 cmp r0, 0 beq @0806F908 lsrs r0, r2, 1 eors r0, r5 lsls r0, 16 lsrs r2, r0, 16 b @0806F90A .align 2, 0 .pool @0806F908: lsrs r2, 1 @0806F90A: adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0x7 bls @0806F8EE lsls r0, r3, 16 lsrs r3, r0, 16 cmp r3, r4 blt @0806F8E4 @0806F91C: mvns r0, r2 lsls r0, 16 lsrs r0, 16 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_806F8D0 thumb_func_start sub_806F928 sub_806F928: ; 806F928 push {r4-r6,lr} adds r5, r0, 0 adds r4, r1, 0 ldr r2, =0x00001121 movs r3, 0 cmp r3, r4 bcs @0806F956 ldr r6, =gUnknown_0832A3D8 @0806F938: lsrs r1, r2, 8 adds r0, r5, r3 ldrb r0, [r0] eors r2, r0 lsls r0, r2, 24 lsrs r0, 23 adds r0, r6 ldrh r0, [r0] adds r2, r0, 0 eors r2, r1 adds r0, r3, 0x1 lsls r0, 16 lsrs r3, r0, 16 cmp r3, r4 bcc @0806F938 @0806F956: mvns r0, r2 lsls r0, 16 lsrs r0, 16 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806F928 thumb_func_start sub_806F96C sub_806F96C: ; 806F96C push {r4,lr} adds r4, r0, 0 movs r3, 0 movs r2, 0 cmp r3, r1 bcs @0806F984 @0806F978: adds r0, r4, r2 ldrb r0, [r0] adds r3, r0 adds r2, 0x1 cmp r2, r1 bcc @0806F978 @0806F984: adds r0, r3, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_806F96C thumb_func_start pal_fade_1 pal_fade_1: ; 806F98C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 16 lsrs r0, 16 mov r8, r0 lsls r1, 16 lsrs r1, 16 mov r12, r1 lsls r2, 24 lsrs r7, r2, 24 mov r0, sp strh r3, [r0] movs r6, 0 cmp r6, r12 bcs @0806FA12 ldr r0, =0x02037714 mov r10, r0 ldr r1, =0x02037b14 mov r9, r1 @0806F9BA: mov r0, r8 adds r5, r6, r0 lsls r5, 16 lsrs r5, 15 mov r1, r10 adds r0, r5, r1 ldr r3, [r0] lsls r4, r3, 27 lsls r2, r3, 22 lsls r3, 17 add r5, r9 lsrs r4, 27 ldr r1, [sp] lsls r0, r1, 27 lsrs r0, 27 subs r0, r4 muls r0, r7 asrs r0, 4 adds r4, r0 lsrs r2, 27 lsls r0, r1, 22 lsrs r0, 27 subs r0, r2 muls r0, r7 asrs r0, 4 adds r2, r0 lsls r2, 5 orrs r4, r2 lsrs r3, 27 lsls r1, 17 lsrs r1, 27 subs r1, r3 adds r0, r1, 0 muls r0, r7 asrs r0, 4 adds r3, r0 lsls r3, 10 orrs r4, r3 strh r4, [r5] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 cmp r6, r12 bcc @0806F9BA @0806FA12: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end pal_fade_1 thumb_func_start pokemon_get_nick pokemon_get_nick: ; 806FA2C push {r4,lr} sub sp, 0x14 adds r4, r1, 0 movs r1, 0x2 mov r2, sp bl pokemon_getattr adds r0, r4, 0 mov r1, sp bl 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, =0x03005d90 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, =0x03005d8c ldr r1, [r1] lsls r2, r0, 3 adds r2, r0 lsls r2, 2 adds r1, r2 adds r0, r5, 0 adds r0, 0x50 ldr r2, =0x00002be0 adds r1, r2 ldm r1!, {r2-r4} stm r0!, {r2-r4} ldm r1!, {r2-r4} stm r0!, {r2-r4} ldm r1!, {r2-r4} stm r0!, {r2-r4} adds r0, r6, 0 bl sub_80D4680 @0806FBBC: adds r0, r5, 0 adds r1, r6, 0 movs r2, 0x50 bl memcpy adds r0, r5, 0 bl pokemon_restore_pp adds r1, r5, 0 adds r1, 0x88 movs r0, 0 str r0, [r1] adds r0, r6, 0 bl zero_pokemon_struct bl party_compaction bl calc_player_party_count pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec adds r0, r1 ldr r1, =0x03005d8c ldr r1, [r1] ldr r2, =0x00003030 adds r1, r2 bl daycare_send pop {r0} bx r0 .align 2, 0 .pool thumb_func_end daycare_send_selected_pokemon thumb_func_start sub_806FC48 sub_806FC48: ; 806FC48 push {r4-r6,lr} adds r5, r0, 0 adds r4, r5, 0 adds r4, 0x8C adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr_encrypted cmp r0, 0 beq @0806FC9E adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr_encrypted adds r6, r0, 0 cmp r6, 0 bne @0806FC9E adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x50 bl memcpy adds r0, r4, 0 bl zero_pokemon_boxed_data adds r4, 0x50 adds r0, r5, 0 adds r0, 0x50 adds r1, r4, 0 movs r2, 0x38 bl memcpy adds r2, r5, 0 adds r2, 0x88 movs r0, 0x8A lsls r0, 1 adds r1, r5, r0 ldr r0, [r1] str r0, [r2] str r6, [r1] adds r0, r4, 0 bl sub_806FF80 @0806FC9E: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_806FC48 thumb_func_start sub_806FCA4 sub_806FCA4: ; 806FCA4 push {r4-r7,lr} adds r4, r0, 0 movs r5, 0 ldr r7, =0x0000ffff @0806FCAC: adds r0, r4, 0 bl sub_806DF74 lsls r0, 24 cmp r0, 0 beq @0806FCE8 movs r6, 0x1 adds r5, 0x1 b @0806FCD4 .align 2, 0 .pool @0806FCC4: movs r6, 0 cmp r0, r7 bne @0806FCD4 ldr r0, =0x020244e2 ldrh r1, [r0] adds r0, r4, 0 bl sub_8069424 @0806FCD4: adds r0, r4, 0 adds r1, r6, 0 bl sub_8069318 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @0806FCC4 cmp r5, 0x63 ble @0806FCAC @0806FCE8: adds r0, r4, 0 bl pokemon_calc_effective_stats pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806FCA4 thumb_func_start sub_806FCF8 sub_806FCF8: ; 806FCF8 push {r4-r7,lr} sub sp, 0x68 adds r5, r0, 0 ldr r1, =0x02021cc4 bl pokemon_get_nick_ adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr_encrypted lsls r0, 16 lsrs r7, r0, 16 adds r0, r5, 0 mov r1, sp bl sub_8069004 mov r0, sp movs r1, 0x38 bl pokemon_getattr cmp r0, 0x64 beq @0806FD46 mov r0, sp movs r1, 0x19 bl pokemon_getattr adds r1, r5, 0 adds r1, 0x88 ldr r1, [r1] adds r0, r1 str r0, [sp, 0x64] add r2, sp, 0x64 mov r0, sp movs r1, 0x19 bl pokemon_setattr mov r0, sp bl sub_806FCA4 @0806FD46: ldr r0, =0x020244ec movs r1, 0xFA lsls r1, 1 adds r6, r0, r1 adds r0, r6, 0 mov r1, sp movs r2, 0x64 bl memcpy adds r0, r5, 0 adds r0, 0x70 ldrh r0, [r0] cmp r0, 0 beq @0806FD74 adds r4, r5, 0 adds r4, 0x50 adds r0, r6, 0 adds r1, r4, 0 bl sub_80D460C adds r0, r4, 0 bl sub_806FF80 @0806FD74: adds r0, r5, 0 bl zero_pokemon_boxed_data adds r1, r5, 0 adds r1, 0x88 movs r0, 0 str r0, [r1] bl party_compaction bl calc_player_party_count adds r0, r7, 0 add sp, 0x68 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806FCF8 thumb_func_start sub_806FD9C sub_806FD9C: ; 806FD9C push {r4,r5,lr} adds r5, r0, 0 lsls r1, 24 lsrs r1, 24 movs r0, 0x8C muls r0, r1 adds r0, r5, r0 bl sub_806FCF8 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 bl sub_806FC48 adds r0, r4, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_806FD9C thumb_func_start sub_806FDC4 sub_806FDC4: ; 806FDC4 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 ldr r1, =0x020375e0 ldrb r1, [r1] bl sub_806FD9C lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806FDC4 thumb_func_start sub_806FDEC sub_806FDEC: ; 806FDEC push {r4,r5,lr} sub sp, 0x54 adds r4, r0, 0 adds r5, r1, 0 mov r0, sp adds r1, r4, 0 movs r2, 0x50 bl memcpy adds r0, r4, 0 movs r1, 0x19 bl pokemon_getattr_encrypted adds r0, r5 str r0, [sp, 0x50] add r2, sp, 0x50 mov r0, sp movs r1, 0x19 bl pokemon_setattr_encrypted mov r0, sp bl sub_80690C0 lsls r0, 24 lsrs r0, 24 add sp, 0x54 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_806FDEC thumb_func_start sub_806FE28 sub_806FE28: ; 806FE28 push {r4,r5,lr} adds r5, r0, 0 bl sub_80690C0 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 adds r0, 0x88 ldr r1, [r0] adds r0, r5, 0 bl sub_806FDEC lsls r0, 24 lsrs r0, 24 subs r0, r4 lsls r0, 24 lsrs r0, 24 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_806FE28 thumb_func_start sub_806FE54 sub_806FE54: ; 806FE54 push {r4,r5,lr} adds r5, r0, 0 bl sub_806FE28 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x02021dc4 adds r1, r4, 0 movs r2, 0 movs r3, 0x2 bl decimal_int_to_string ldr r1, =0x02021cc4 adds r0, r5, 0 bl pokemon_get_nick_ adds r0, r4, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806FE54 thumb_func_start sub_806FE88 sub_806FE88: ; 806FE88 push {r4,r5,lr} adds r5, r0, 0 bl sub_806FE28 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r1, =0x02021cc4 adds r0, r5, 0 bl pokemon_get_nick_ movs r0, 0x64 muls r4, r0 adds r4, 0x64 ldr r0, =0x02021dc4 adds r1, r4, 0 movs r2, 0 movs r3, 0x5 bl decimal_int_to_string adds r0, r4, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806FE88 thumb_func_start sub_806FEC0 sub_806FEC0: ; 806FEC0 push {lr} lsls r1, 24 lsrs r1, 24 movs r2, 0x8C muls r1, r2 adds r0, r1 bl sub_806FE88 lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 thumb_func_end sub_806FEC0 thumb_func_start sub_806FED8 sub_806FED8: ; 806FED8 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 ldr r1, =0x020375e0 ldrb r1, [r1] bl sub_806FEC0 ldr r1, =0x020375e2 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_806FED8 thumb_func_start sub_806FF04 sub_806FF04: ; 806FF04 lsls r0, 16 lsrs r0, 16 ldr r1, =0x03005d8c ldr r2, [r1] ldr r1, =0x000030b8 adds r3, r2, r1 ldr r1, [r3] adds r1, r0 str r1, [r3] ldr r1, =0x00003144 adds r2, r1 ldr r1, [r2] adds r1, r0 str r1, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_806FF04 thumb_func_start sub_806FF30 sub_806FF30: ; 806FF30 push {r4-r6,lr} ldr r6, =0x03005d8c ldr r5, =0x020375e0 ldrh r0, [r5] movs r4, 0x8C adds r1, r0, 0 muls r1, r4 ldr r0, =0x00003030 adds r1, r0 ldr r0, [r6] adds r0, r1 movs r1, 0xB bl pokemon_getattr_encrypted cmp r0, 0 bne @0806FF60 movs r0, 0 b @0806FF76 .align 2, 0 .pool @0806FF60: ldrh r0, [r5] adds r1, r0, 0 muls r1, r4 ldr r0, =0x00003030 adds r1, r0 ldr r0, [r6] adds r0, r1 bl sub_806FE54 lsls r0, 24 lsrs r0, 24 @0806FF76: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_806FF30 thumb_func_start sub_806FF80 sub_806FF80: ; 806FF80 push {lr} movs r3, 0 movs r2, 0x7 adds r1, r0, 0 adds r1, 0x2B @0806FF8A: strb r3, [r1] subs r1, 0x1 subs r2, 0x1 cmp r2, 0 bge @0806FF8A adds r2, r0, 0 adds r2, 0x2C movs r3, 0 adds r1, r0, 0 adds r1, 0x36 @0806FF9E: strb r3, [r1] subs r1, 0x1 cmp r1, r2 bge @0806FF9E bl sub_80D439C pop {r0} bx r0 thumb_func_end sub_806FF80 thumb_func_start sub_806FFB0 sub_806FFB0: ; 806FFB0 push {r4,lr} adds r4, r0, 0 bl zero_pokemon_boxed_data adds r1, r4, 0 adds r1, 0x88 movs r0, 0 str r0, [r1] adds r4, 0x50 adds r0, r4, 0 bl sub_806FF80 pop {r4} pop {r0} bx r0 thumb_func_end sub_806FFB0 thumb_func_start sub_806FFD0 sub_806FFD0: ; 806FFD0 push {r4-r6,lr} adds r5, r0, 0 movs r4, 0 movs r6, 0x8C @0806FFD8: adds r0, r4, 0 muls r0, r6 adds r0, r5, r0 bl sub_806FFB0 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x1 bls @0806FFD8 movs r1, 0x8C lsls r1, 1 adds r0, r5, r1 movs r1, 0 str r1, [r0] movs r2, 0x8E lsls r2, 1 adds r0, r5, r2 strb r1, [r0] pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_806FFD0 thumb_func_start sub_8070004 sub_8070004: ; 8070004 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 16 lsrs r2, r0, 16 movs r0, 0 mov r8, r0 ldr r0, =gEvolutionTable mov r12, r0 @08070016: movs r7, 0 movs r6, 0x1 movs r4, 0x80 lsls r4, 9 movs r5, 0x28 mov r3, r12 adds r3, 0x28 @08070024: movs r1, 0 ldrh r0, [r3, 0x4] cmp r0, r2 bne @08070034 lsrs r2, r4, 16 b @08070060 .align 2, 0 .pool @08070034: adds r1, 0x1 cmp r1, 0x4 bgt @0807004A lsls r0, r1, 3 adds r0, r5 add r0, r12 ldrh r0, [r0, 0x4] cmp r0, r2 bne @08070034 lsrs r2, r4, 16 movs r7, 0x1 @0807004A: cmp r7, 0 bne @08070060 movs r0, 0x80 lsls r0, 9 adds r4, r0 adds r5, 0x28 adds r3, 0x28 adds r6, 0x1 ldr r0, =0x0000019b cmp r6, r0 ble @08070024 @08070060: movs r0, 0xCE lsls r0, 1 cmp r6, r0 beq @08070072 movs r0, 0x1 add r8, r0 mov r0, r8 cmp r0, 0x4 ble @08070016 @08070072: adds r0, r2, 0 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8070004 thumb_func_start sub_8070084 sub_8070084: ; 8070084 push {r4-r7,lr} sub sp, 0x8 adds r6, r0, 0 movs r7, 0x1 negs r7, r7 movs r4, 0 @08070090: movs r0, 0x8C muls r0, r4 adds r0, r6, r0 bl pokemon_roll_gender lsls r0, 24 lsrs r0, 24 cmp r0, 0xFE bne @080700A4 adds r7, r4, 0 @080700A4: adds r4, 0x1 cmp r4, 0x1 ble @08070090 movs r5, 0 movs r4, 0 @080700AE: movs r0, 0x8C muls r0, r4 adds r0, r6, r0 movs r1, 0xB bl pokemon_getattr_encrypted lsls r1, r4, 2 add r1, sp str r0, [r1] cmp r0, 0x84 bne @080700C8 adds r5, 0x1 adds r7, r4, 0 @080700C8: adds r4, 0x1 cmp r4, 0x1 ble @080700AE cmp r5, 0x2 bne @080700E2 bl GenerateRandomNumber lsls r0, 16 ldr r1, =0x7ffe0000 movs r7, 0x1 cmp r0, r1 bls @080700E2 movs r7, 0 @080700E2: movs r0, 0x8C muls r0, r7 adds r0, r6, r0 movs r1, 0xC bl pokemon_getattr_encrypted cmp r0, 0xC3 bne @080700FE bl GenerateRandomNumber lsls r0, 16 ldr r1, =0x7ffe0000 cmp r0, r1 bls @08070108 @080700FE: movs r0, 0x1 negs r0, r0 b @0807010A .align 2, 0 .pool @08070108: adds r0, r7, 0 @0807010A: add sp, 0x8 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8070084 thumb_func_start sub_8070114 sub_8070114: ; 8070114 push {r4-r7,lr} adds r5, r0, 0 movs r6, 0 ldr r0, =0x030022c0 ldrh r0, [r0, 0x24] bl SeedRng2 adds r0, r5, 0 bl sub_8070084 adds r1, r0, 0 cmp r1, 0 bge @08070160 bl GenerateRandomNumber2 adds r4, r0, 0 bl GenerateRandomNumber movs r1, 0x8C lsls r1, 1 adds r5, r1 lsls r4, 16 lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000fffe bl __umodsi3 lsls r0, 16 lsrs r0, 16 adds r0, 0x1 orrs r4, r0 str r4, [r5] b @080701AC .align 2, 0 .pool @08070160: movs r0, 0x8C muls r0, r1 adds r0, r5, r0 movs r1, 0 movs r2, 0 bl pokemon_getattr_encrypted bl GetNatureFromPersonality lsls r0, 24 lsrs r7, r0, 24 @08070176: bl GenerateRandomNumber2 adds r4, r0, 0 bl GenerateRandomNumber lsls r4, 16 lsls r0, 16 lsrs r0, 16 orrs r4, r0 adds r0, r4, 0 bl GetNatureFromPersonality lsls r0, 24 lsrs r0, 24 cmp r7, r0 bne @0807019A cmp r4, 0 bne @080701A4 @0807019A: adds r6, 0x1 movs r0, 0x96 lsls r0, 4 cmp r6, r0 ble @08070176 @080701A4: movs r1, 0x8C lsls r1, 1 adds r0, r5, r1 str r4, [r0] @080701AC: movs r0, 0x86 bl 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 bl sub_8070114 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80701E0 thumb_func_start sub_80701FC sub_80701FC: ; 80701FC push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 bl sub_80701B8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80701FC thumb_func_start sub_8070218 sub_8070218: ; 8070218 push {r4,lr} sub sp, 0x8 adds r4, r0, 0 lsls r1, 24 lsrs r1, 24 adds r1, r4, r1 movs r0, 0xFF strb r0, [r1] movs r2, 0 @0807022A: mov r1, sp adds r0, r1, r2 adds r1, r4, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x5 ble @0807022A movs r3, 0 movs r2, 0 @0807023E: mov r1, sp adds r0, r1, r2 ldrb r1, [r0] adds r0, r1, 0 cmp r0, 0xFF beq @08070250 adds r0, r4, r3 strb r1, [r0] adds r3, 0x1 @08070250: adds r2, 0x1 cmp r2, 0x5 ble @0807023E add sp, 0x8 pop {r4} pop {r0} bx r0 thumb_func_end sub_8070218 thumb_func_start sub_8070260 sub_8070260: ; 8070260 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x14 mov r9, r0 mov r8, r1 movs r5, 0 add r1, sp, 0x4 add r7, sp, 0xC adds r2, r1, 0 @08070276: adds r0, r2, r5 strb r5, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x5 bls @08070276 movs r5, 0 adds r6, r1, 0 @08070288: bl GenerateRandomNumber mov r1, sp adds r4, r1, r5 lsls r0, 16 lsrs r0, 16 movs r1, 0x6 subs r1, r5 bl __modsi3 adds r0, r6, r0 ldrb r0, [r0] strb r0, [r4] adds r0, r6, 0 adds r1, r5, 0 bl sub_8070218 adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x2 bls @08070288 movs r5, 0 movs r4, 0x1 @080702B8: bl GenerateRandomNumber adds r1, r7, r5 lsls r0, 16 lsrs r0, 16 ands r0, r4 strb r0, [r1] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x2 bls @080702B8 movs r5, 0 @080702D2: mov r1, sp adds r0, r1, r5 ldrb r0, [r0] cmp r0, 0x5 bhi @080703AE lsls r0, 2 ldr r1, =@080702EC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080702EC: .4byte @08070304 .4byte @08070322 .4byte @0807033C .4byte @08070356 .4byte @08070370 .4byte @08070390 @08070304: adds r0, r7, r5 ldrb r1, [r0] movs r0, 0x8C muls r0, r1 add r0, r8 movs r1, 0x27 bl pokemon_getattr_encrypted add r2, sp, 0x10 strb r0, [r2] mov r0, r9 movs r1, 0x27 bl pokemon_setattr b @080703AE @08070322: add r4, sp, 0x10 adds r0, r7, r5 ldrb r1, [r0] movs r0, 0x8C muls r0, r1 add r0, r8 movs r1, 0x28 bl pokemon_getattr_encrypted strb r0, [r4] mov r0, r9 movs r1, 0x28 b @08070388 @0807033C: add r4, sp, 0x10 adds r0, r7, r5 ldrb r1, [r0] movs r0, 0x8C muls r0, r1 add r0, r8 movs r1, 0x29 bl pokemon_getattr_encrypted strb r0, [r4] mov r0, r9 movs r1, 0x29 b @08070388 @08070356: add r4, sp, 0x10 adds r0, r7, r5 ldrb r1, [r0] movs r0, 0x8C muls r0, r1 add r0, r8 movs r1, 0x2A bl pokemon_getattr_encrypted strb r0, [r4] mov r0, r9 movs r1, 0x2A b @08070388 @08070370: add r4, sp, 0x10 adds r0, r7, r5 ldrb r1, [r0] movs r0, 0x8C muls r0, r1 add r0, r8 movs r1, 0x2B bl pokemon_getattr_encrypted strb r0, [r4] mov r0, r9 movs r1, 0x2B @08070388: adds r2, r4, 0 bl pokemon_setattr b @080703AE @08070390: add r4, sp, 0x10 adds r0, r7, r5 ldrb r1, [r0] movs r0, 0x8C muls r0, r1 add r0, r8 movs r1, 0x2C bl pokemon_getattr_encrypted strb r0, [r4] mov r0, r9 movs r1, 0x2C adds r2, r4, 0 bl pokemon_setattr @080703AE: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x2 bls @080702D2 add sp, 0x14 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8070260 thumb_func_start pokemon_get_eggmoves pokemon_get_eggmoves: ; 80703C8 push {r4-r7,lr} mov r7, r8 push {r7} mov r8, r1 movs r6, 0 movs r4, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 ldr r5, =gEggMoves ldrh r1, [r5] ldr r7, =0x00004e20 adds r0, r3, r7 cmp r1, r0 bne @080703F8 movs r4, 0x1 b @0807041A .align 2, 0 .pool @080703F8: adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x00000471 ldr r5, =gEggMoves cmp r2, r0 bhi @0807041A lsls r0, r2, 1 adds r0, r5 ldrh r1, [r0] ldr r7, =0x00004e20 adds r0, r3, r7 cmp r1, r0 bne @080703F8 adds r0, r2, 0x1 lsls r0, 16 lsrs r4, r0, 16 @0807041A: movs r2, 0 lsls r0, r4, 1 adds r0, r5 ldrh r0, [r0] ldr r1, =0x00004e20 cmp r0, r1 bhi @08070456 adds r7, r5, 0 adds r3, r1, 0 @0807042C: lsls r1, r2, 1 add r1, r8 adds r0, r4, r2 lsls r0, 1 adds r0, r7 ldrh r0, [r0] strh r0, [r1] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0x9 bhi @08070456 adds r0, r4, r2 lsls r0, 1 adds r0, r5 ldrh r0, [r0] cmp r0, r3 bls @0807042C @08070456: lsls r0, r6, 24 lsrs r0, 24 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end pokemon_get_eggmoves thumb_func_start daycare_build_child_moveset daycare_build_child_moveset: ; 8070470 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC adds r7, r0, 0 mov r10, r1 mov r9, r2 movs r0, 0 str r0, [sp] movs r6, 0 ldr r5, =0x02024a4c movs r2, 0 ldr r4, =0x02024a28 ldr r3, =0x02024a30 @08070490: lsls r1, r6, 1 adds r0, r1, r5 strh r2, [r0] adds r0, r1, r4 strh r2, [r0] adds r1, r3 strh r2, [r1] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0x3 bls @08070490 movs r6, 0 ldr r2, =0x02024a38 movs r1, 0 @080704AE: lsls r0, r6, 1 adds r0, r2 strh r1, [r0] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0x9 bls @080704AE movs r6, 0 ldr r2, =0x020249c4 movs r1, 0 @080704C4: lsls r0, r6, 1 adds r0, r2 strh r1, [r0] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0x31 bls @080704C4 adds r0, r7, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 ldr r1, =0x020249c4 bl sub_806E204 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4] movs r6, 0 ldr r1, =0x02024a28 mov r8, r1 @080704F2: adds r5, r6, 0 adds r5, 0xD mov r0, r10 adds r1, r5, 0 bl pokemon_getattr_encrypted lsls r4, r6, 1 mov r2, r8 adds r1, r4, r2 strh r0, [r1] mov r0, r9 adds r1, r5, 0 bl pokemon_getattr_encrypted ldr r1, =0x02024a4c adds r4, r1 strh r0, [r4] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0x3 bls @080704F2 ldr r1, =0x02024a38 adds r0, r7, 0 bl pokemon_get_eggmoves lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r6, 0 @0807052E: ldr r0, =0x02024a28 lsls r1, r6, 1 adds r2, r1, r0 ldrh r1, [r2] mov r9, r0 cmp r1, 0 beq @080705A4 movs r5, 0 cmp r5, r8 bcs @08070596 adds r4, r2, 0 ldr r2, =0x0000ffff @08070546: ldr r0, =0x02024a38 lsls r1, r5, 1 adds r1, r0 ldrh r0, [r4] ldrh r1, [r1] cmp r0, r1 bne @0807058C adds r1, r0, 0 adds r0, r7, 0 str r2, [sp, 0x8] bl pokemon_moveset_pad_ lsls r0, 16 lsrs r0, 16 ldr r2, [sp, 0x8] cmp r0, r2 bne @08070596 ldrh r1, [r4] adds r0, r7, 0 bl sub_8069424 b @08070596 .align 2, 0 .pool @0807058C: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, r8 bcc @08070546 @08070596: adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 ldr r3, =0x02024a28 mov r9, r3 cmp r6, 0x3 bls @0807052E @080705A4: movs r6, 0 @080705A6: lsls r0, r6, 1 mov r2, r9 adds r1, r0, r2 ldrh r1, [r1] adds r2, r0, 0 adds r6, 0x1 mov r8, r6 cmp r1, 0 beq @08070608 movs r5, 0 ldr r0, =0x02024a28 adds r4, r2, r0 ldr r6, =0x0000ffff mov r9, r0 @080705C2: ldr r3, =0x00000121 adds r0, r5, r3 lsls r0, 16 lsrs r0, 16 bl 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, =0x02024a30 mov r10, r3 cmp r0, 0 beq @08070672 mov r4, r9 ldr r0, =0x02024a4c mov r9, r0 mov r12, r10 @08070628: movs r5, 0 lsls r2, r6, 1 adds r6, 0x1 mov r8, r6 adds r3, r2, r4 @08070632: lsls r0, r5, 1 add r0, r9 ldrh r2, [r3] adds r1, r2, 0 ldrh r0, [r0] cmp r1, r0 bne @08070654 cmp r1, 0 beq @08070654 ldr r1, [sp] adds r0, r1, 0x1 lsls r0, 16 lsrs r0, 16 str r0, [sp] lsls r1, 1 add r1, r12 strh r2, [r1] @08070654: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x3 bls @08070632 mov r1, r8 lsls r0, r1, 16 lsrs r6, r0, 16 cmp r6, 0x3 bhi @08070672 lsls r0, r6, 1 adds r0, r4 ldrh r0, [r0] cmp r0, 0 bne @08070628 @08070672: movs r6, 0 mov r2, r10 ldrh r0, [r2] cmp r0, 0 beq @080706FC @0807067C: movs r5, 0 adds r3, r6, 0x1 mov r8, r3 ldr r0, [sp, 0x4] cmp r5, r0 bcs @080706E4 ldr r2, =0x0000ffff @0807068A: ldr r1, =0x020249c4 lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] cmp r1, 0 beq @080706D8 lsls r0, r6, 1 mov r3, r10 adds r4, r0, r3 ldrh r0, [r4] cmp r0, r1 bne @080706D8 adds r1, r0, 0 adds r0, r7, 0 str r2, [sp, 0x8] bl pokemon_moveset_pad_ lsls r0, 16 lsrs r0, 16 ldr r2, [sp, 0x8] cmp r0, r2 bne @080706E4 ldrh r1, [r4] adds r0, r7, 0 bl sub_8069424 b @080706E4 .align 2, 0 .pool @080706D8: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 ldr r0, [sp, 0x4] cmp r5, r0 bcc @0807068A @080706E4: mov r1, r8 lsls r0, r1, 16 lsrs r6, r0, 16 cmp r6, 0x3 bhi @080706FC ldr r0, =0x02024a30 lsls r1, r6, 1 adds r1, r0 ldrh r1, [r1] mov r10, r0 cmp r1, 0 bne @0807067C @080706FC: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end daycare_build_child_moveset thumb_func_start sub_8070710 sub_8070710: ; 8070710 adds r2, r0, 0 movs r1, 0x8C lsls r1, 1 adds r0, r2, r1 movs r1, 0 str r1, [r0] movs r3, 0x8E lsls r3, 1 adds r0, r2, r3 strb r1, [r0] bx lr thumb_func_end sub_8070710 thumb_func_start sub_8070728 sub_8070728: ; 8070728 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 bl sub_8070710 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8070728 thumb_func_start incense_effects incense_effects: ; 8070744 push {r4-r7,lr} adds r4, r0, 0 adds r5, r1, 0 ldrh r1, [r4] movs r7, 0xB4 lsls r7, 1 cmp r1, r7 beq @0807075C movs r0, 0xAF lsls r0, 1 cmp r1, r0 bne @0807079E @0807075C: adds r0, r5, 0 movs r1, 0xC bl pokemon_getattr_encrypted lsls r0, 16 lsrs r6, r0, 16 adds r0, r5, 0 adds r0, 0x8C movs r1, 0xC bl pokemon_getattr_encrypted lsls r0, 16 lsrs r2, r0, 16 ldrh r0, [r4] cmp r0, r7 bne @08070788 cmp r6, 0xDD beq @08070788 cmp r2, 0xDD beq @08070788 movs r0, 0xCA strh r0, [r4] @08070788: ldrh r1, [r4] movs r0, 0xAF lsls r0, 1 cmp r1, r0 bne @0807079E cmp r6, 0xDC beq @0807079E cmp r2, 0xDC beq @0807079E movs r0, 0xB7 strh r0, [r4] @0807079E: pop {r4-r7} pop {r0} bx r0 thumb_func_end incense_effects thumb_func_start sub_80707A4 sub_80707A4: ; 80707A4 push {r4-r6,lr} adds r6, r0, 0 adds r4, r1, 0 adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr_encrypted adds r5, r0, 0 adds r4, 0x8C adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr_encrypted cmp r5, 0xCA beq @080707C6 cmp r0, 0xCA bne @080707E2 @080707C6: movs r4, 0xAC lsls r4, 1 adds r0, r6, 0 adds r1, r4, 0 bl pokemon_moveset_pad_ lsls r0, 16 ldr r1, =0xffff0000 cmp r0, r1 bne @080707E2 adds r0, r6, 0 adds r1, r4, 0 bl sub_8069424 @080707E2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80707A4 thumb_func_start sub_80707EC sub_80707EC: ; 80707EC push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 adds r7, r0, 0 adds r6, r1, 0 movs r4, 0 movs r0, 0x1 mov r8, r0 @080707FE: movs r0, 0x8C muls r0, r4 adds r5, r7, r0 adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr_encrypted lsls r1, r4, 1 add r1, sp strh r0, [r1] lsls r0, 16 lsrs r0, 16 cmp r0, 0x84 bne @08070826 adds r0, r4, 0 mov r1, r8 eors r0, r1 strb r0, [r6] strb r4, [r6, 0x1] b @0807083E @08070826: adds r0, r5, 0 bl pokemon_roll_gender lsls r0, 24 lsrs r0, 24 cmp r0, 0xFE bne @0807083E strb r4, [r6] adds r0, r4, 0 mov r1, r8 eors r0, r1 strb r0, [r6, 0x1] @0807083E: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x1 bls @080707FE ldrb r0, [r6] lsls r0, 1 add r0, sp ldrh r0, [r0] bl sub_8070004 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x1D bne @08070870 movs r1, 0x8C lsls r1, 1 adds r0, r7, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 beq @08070870 movs r4, 0x20 @08070870: ldr r0, =0x00000183 cmp r4, r0 bne @0807088C movs r1, 0x8C lsls r1, 1 adds r0, r7, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 beq @0807088C movs r4, 0xC1 lsls r4, 1 @0807088C: ldrb r0, [r6, 0x1] lsls r0, 1 add r0, sp ldrh r0, [r0] cmp r0, 0x84 bne @080708B4 ldrb r1, [r6] movs r0, 0x8C muls r0, r1 adds r0, r7, r0 bl pokemon_roll_gender lsls r0, 24 lsrs r0, 24 cmp r0, 0xFE beq @080708B4 ldrb r1, [r6, 0x1] ldrb r0, [r6] strb r0, [r6, 0x1] strb r1, [r6] @080708B4: adds r0, r4, 0 add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80707EC thumb_func_start sub_80708C8 sub_80708C8: ; 80708C8 push {r4-r6,lr} sub sp, 0x6C adds r6, r0, 0 add r5, sp, 0x64 adds r1, r5, 0 bl sub_80707EC add r4, sp, 0x68 strh r0, [r4] adds r0, r4, 0 adds r1, r6, 0 bl incense_effects ldrh r1, [r4] mov r0, sp adds r2, r6, 0 bl sub_8070A0C mov r0, sp adds r1, r6, 0 bl sub_8070260 ldrb r0, [r5, 0x1] movs r2, 0x8C adds r1, r0, 0 muls r1, r2 adds r1, r6, r1 ldrb r0, [r5] muls r2, r0 adds r2, r6, r2 mov r0, sp bl daycare_build_child_moveset ldrh r0, [r4] cmp r0, 0xAC bne @08070918 mov r0, sp adds r1, r6, 0 bl sub_80707A4 @08070918: mov r2, sp adds r2, 0x6A movs r0, 0x1 strb r0, [r2] mov r0, sp movs r1, 0x2D bl pokemon_setattr ldr r0, =0x020244ec movs r1, 0xFA lsls r1, 1 adds r0, r1 mov r1, sp movs r2, 0x64 bl memcpy bl party_compaction bl calc_player_party_count adds r0, r6, 0 bl sub_8070710 add sp, 0x6C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80708C8 thumb_func_start sub_8070954 sub_8070954: ; 8070954 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x18 adds r7, r0, 0 adds r5, r1, 0 adds r6, r2, 0 lsls r5, 16 lsrs r5, 16 lsls r6, 24 lsrs r6, 24 movs r4, 0 str r4, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] str r4, [sp, 0xC] adds r1, r5, 0 movs r2, 0x5 movs r3, 0x20 bl create_pokemon_set_level movs r0, 0x12 add r0, sp mov r8, r0 strb r4, [r0] movs r1, 0x4 add r0, sp, 0x10 strh r1, [r0] mov r4, sp adds r4, 0x13 movs r0, 0x1 mov r9, r0 mov r0, r9 strb r0, [r4] adds r0, r7, 0 movs r1, 0x26 add r2, sp, 0x10 bl pokemon_setattr ldr r2, =gEggName adds r0, r7, 0 movs r1, 0x2 bl pokemon_setattr lsls r2, r5, 3 subs r2, r5 lsls r2, 2 ldr r0, =gBaseStats + 0x11 ; egg cycles offset adds r2, r0 adds r0, r7, 0 movs r1, 0x20 bl pokemon_setattr adds r0, r7, 0 movs r1, 0x24 mov r2, r8 bl pokemon_setattr adds r0, r7, 0 movs r1, 0x3 adds r2, r4, 0 bl pokemon_setattr cmp r6, 0 beq @080709E6 add r2, sp, 0x14 movs r0, 0xFD strb r0, [r2] adds r0, r7, 0 movs r1, 0x23 bl pokemon_setattr @080709E6: mov r2, sp adds r2, 0x15 mov r0, r9 strb r0, [r2] adds r0, r7, 0 movs r1, 0x2D bl pokemon_setattr add sp, 0x18 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8070954 thumb_func_start sub_8070A0C sub_8070A0C: ; 8070A0C push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x14 adds r6, r0, 0 adds r5, r1, 0 lsls r5, 16 lsrs r5, 16 movs r0, 0x8C lsls r0, 1 adds r2, r0 ldr r0, [r2] movs r1, 0x1 mov r8, r1 str r1, [sp] str r0, [sp, 0x4] movs r4, 0 str r4, [sp, 0x8] str r4, [sp, 0xC] adds r0, r6, 0 adds r1, r5, 0 movs r2, 0x5 movs r3, 0x20 bl create_pokemon_set_level movs r0, 0x12 add r0, sp mov r9, r0 strb r4, [r0] movs r1, 0x4 add r0, sp, 0x10 strh r1, [r0] mov r4, sp adds r4, 0x13 mov r1, r8 strb r1, [r4] adds r0, r6, 0 movs r1, 0x26 add r2, sp, 0x10 bl pokemon_setattr ldr r2, =gEggName adds r0, r6, 0 movs r1, 0x2 bl pokemon_setattr lsls r2, r5, 3 subs r2, r5 lsls r2, 2 ldr r0, =gBaseStats + 0x11 ; egg cycles offset adds r2, r0 adds r0, r6, 0 movs r1, 0x20 bl pokemon_setattr adds r0, r6, 0 movs r1, 0x24 mov r2, r9 bl pokemon_setattr adds r0, r6, 0 movs r1, 0x3 adds r2, r4, 0 bl pokemon_setattr add sp, 0x14 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8070A0C thumb_func_start sp0B8_daycare sp0B8_daycare: ; 8070AA8 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 bl sub_80708C8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sp0B8_daycare thumb_func_start sub_8070AC4 sub_8070AC4: ; 8070AC4 push {r4-r7,lr} sub sp, 0x4 adds r6, r0, 0 movs r7, 0 movs r5, 0 @08070ACE: movs r0, 0x8C adds r4, r5, 0 muls r4, r0 adds r0, r6, r4 movs r1, 0x5 bl pokemon_getattr_encrypted cmp r0, 0 beq @08070AEE adds r1, r6, 0 adds r1, 0x88 adds r1, r4 ldr r0, [r1] adds r0, 0x1 str r0, [r1] adds r7, 0x1 @08070AEE: adds r5, 0x1 cmp r5, 0x1 bls @08070ACE movs r1, 0x8C lsls r1, 1 adds r0, r6, r1 ldr r0, [r0] cmp r0, 0 bne @08070B34 cmp r7, 0x2 bne @08070B34 subs r1, 0x4 adds r0, r6, r1 ldrb r0, [r0] cmp r0, 0xFF bne @08070B34 adds r0, r6, 0 bl daycare_relationship_score adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 muls r0, r1 ldr r1, =0x0000ffff bl __udivsi3 cmp r4, r0 bls @08070B34 bl sub_80701E0 @08070B34: movs r0, 0x8E lsls r0, 1 adds r1, r6, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @08070BC0 bl sub_807228C lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r5, r0 bcs @08070BC0 ldr r4, =0x020244ec @08070B5C: adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 beq @08070BB4 adds r0, r4, 0 movs r1, 0x4 bl pokemon_getattr cmp r0, 0 bne @08070BB4 adds r0, r4, 0 movs r1, 0x20 bl pokemon_getattr adds r1, r0, 0 str r1, [sp] cmp r0, 0 beq @08070BA8 cmp r0, r6 bcc @08070B98 subs r0, r6 b @08070B9A .align 2, 0 .pool @08070B98: subs r0, r1, 0x1 @08070B9A: str r0, [sp] adds r0, r4, 0 movs r1, 0x20 mov r2, sp bl pokemon_setattr b @08070BB4 @08070BA8: ldr r0, =0x020375e0 strh r5, [r0] movs r0, 0x1 b @08070BC2 .align 2, 0 .pool @08070BB4: adds r4, 0x64 adds r5, 0x1 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r5, r0 bcc @08070B5C @08070BC0: movs r0, 0 @08070BC2: add sp, 0x4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8070AC4 thumb_func_start sub_8070BD0 sub_8070BD0: ; 8070BD0 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 bl sub_8070AC4 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8070BD0 thumb_func_start sub_8070BF0 sub_8070BF0: ; 8070BF0 push {lr} movs r1, 0x8C lsls r1, 1 adds r0, r1 ldr r0, [r0] cmp r0, 0 beq @08070C00 movs r0, 0x1 @08070C00: pop {r1} bx r1 thumb_func_end sub_8070BF0 thumb_func_start sub_8070C04 sub_8070C04: ; 8070C04 push {r4,lr} sub sp, 0xC adds r4, r0, 0 movs r1, 0xB bl pokemon_getattr_encrypted cmp r0, 0 beq @08070C2E ldr r1, =0x02021cc4 adds r0, r4, 0 bl pokemon_get_nick_ adds r0, r4, 0 movs r1, 0x7 mov r2, sp bl pokemon_getattr_encrypted ldr r0, =0x02021ec4 mov r1, sp bl gf_strcpy @08070C2E: adds r4, 0x8C adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr_encrypted cmp r0, 0 beq @08070C44 ldr r1, =0x02021dc4 adds r0, r4, 0 bl pokemon_get_nick_ @08070C44: add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8070C04 thumb_func_start sub_8070C58 sub_8070C58: ; 8070C58 push {r4,r5,lr} bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 ldr r1, =0x02021cc4 bl pokemon_get_nick_ bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 muls r0, r5 adds r0, r4 movs r1, 0xB bl pokemon_getattr_encrypted lsls r0, 16 lsrs r0, 16 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8070C58 thumb_func_start sp0B5_daycare sp0B5_daycare: ; 8070C94 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 bl sub_8070C04 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sp0B5_daycare thumb_func_start sp0B6_daycare sp0B6_daycare: ; 8070CB0 push {r4,lr} ldr r4, =0x03005d8c ldr r0, [r4] ldr r1, =0x00003030 adds r0, r1 bl sub_8070BF0 lsls r0, 24 cmp r0, 0 beq @08070CD0 movs r0, 0x1 b @08070CF2 .align 2, 0 .pool @08070CD0: ldr r0, [r4] ldr r1, =0x00003030 adds r0, r1 bl daycare_count_pokemon lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08070CEC movs r0, 0 b @08070CF2 .align 2, 0 .pool @08070CEC: adds r0, 0x1 lsls r0, 24 lsrs r0, 24 @08070CF2: pop {r4} pop {r1} bx r1 thumb_func_end sp0B6_daycare thumb_func_start sub_8070CF8 sub_8070CF8: ; 8070CF8 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 bl daycare_count_pokemon lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08070D10 movs r0, 0 @08070D10: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8070CF8 thumb_func_start sub_8070D1C sub_8070D1C: ; 8070D1C push {r4-r6,lr} adds r5, r1, 0 movs r4, 0 adds r1, r0, 0 @08070D24: movs r3, 0 ldrh r0, [r1] adds r2, r5, 0 @08070D2A: ldrh r6, [r2] cmp r0, r6 bne @08070D34 movs r0, 0x1 b @08070D46 @08070D34: adds r2, 0x2 adds r3, 0x1 cmp r3, 0x1 ble @08070D2A adds r1, 0x2 adds r4, 0x1 cmp r4, 0x1 ble @08070D24 movs r0, 0 @08070D46: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8070D1C thumb_func_start daycare_relationship_score daycare_relationship_score: ; 8070D4C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x30 str r0, [sp, 0x1C] movs r7, 0 mov r0, sp adds r0, 0x8 str r0, [sp, 0x20] add r1, sp, 0xC mov r9, r1 mov r2, sp adds r2, 0x14 str r2, [sp, 0x24] subs r0, 0x6 ldr r1, =gBaseStats mov r10, r1 ldr r5, [sp, 0x20] mov r8, r0 mov r6, sp str r2, [sp, 0x28] mov r2, r9 str r2, [sp, 0x2C] @08070D7E: movs r0, 0x8C adds r4, r7, 0 muls r4, r0 ldr r0, [sp, 0x1C] adds r4, r0, r4 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr_encrypted strh r0, [r5] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr_encrypted ldr r1, [sp, 0x2C] stm r1!, {r0} str r1, [sp, 0x2C] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr_encrypted adds r1, r0, 0 ldrh r0, [r5] bl pokemon_species_get_gender_info lsls r0, 24 lsrs r0, 24 ldr r2, [sp, 0x28] stm r2!, {r0} str r2, [sp, 0x28] ldrh r1, [r5] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r10 ldrb r0, [r0, 0x14] strh r0, [r6] ldrh r1, [r5] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 add r0, r10 ldrb r0, [r0, 0x15] mov r1, r8 strh r0, [r1] adds r5, 0x2 movs r2, 0x4 add r8, r2 adds r6, 0x4 adds r7, 0x1 cmp r7, 0x1 bls @08070D7E mov r0, sp ldrh r1, [r0] cmp r1, 0xF beq @08070DFC ldrh r0, [r0, 0x4] cmp r0, 0xF beq @08070DFC cmp r1, 0xD bne @08070E04 cmp r0, 0xD bne @08070E08 @08070DFC: movs r0, 0 b @08070E5C .align 2, 0 .pool @08070E04: cmp r0, 0xD bne @08070E14 @08070E08: ldr r1, [sp, 0xC] mov r2, r9 ldr r0, [r2, 0x4] cmp r1, r0 beq @08070E56 b @08070E5A @08070E14: ldr r0, [sp, 0x14] ldr r2, [sp, 0x24] ldr r1, [r2, 0x4] cmp r0, r1 beq @08070DFC cmp r0, 0xFF beq @08070DFC cmp r1, 0xFF beq @08070DFC add r1, sp, 0x4 mov r0, sp bl sub_8070D1C lsls r0, 24 cmp r0, 0 beq @08070DFC ldr r0, [sp, 0x20] ldrh r1, [r0, 0x2] ldrh r0, [r0] cmp r0, r1 bne @08070E4C ldr r1, [sp, 0xC] mov r2, r9 ldr r0, [r2, 0x4] cmp r1, r0 beq @08070E5A movs r0, 0x46 b @08070E5C @08070E4C: ldr r1, [sp, 0xC] mov r2, r9 ldr r0, [r2, 0x4] cmp r1, r0 bne @08070E5A @08070E56: movs r0, 0x14 b @08070E5C @08070E5A: movs r0, 0x32 @08070E5C: add sp, 0x30 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end daycare_relationship_score thumb_func_start daycare_relationship_score_from_savegame daycare_relationship_score_from_savegame: ; 8070E6C push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 bl daycare_relationship_score lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end daycare_relationship_score_from_savegame thumb_func_start sp0B9_daycare_relationship_comment sp0B9_daycare_relationship_comment: ; 8070E8C push {lr} bl daycare_relationship_score_from_savegame lsls r0, 24 lsrs r0, 24 adds r2, r0, 0 movs r1, 0 cmp r0, 0 bne @08070EA0 movs r1, 0x3 @08070EA0: cmp r0, 0x14 bne @08070EA6 movs r1, 0x2 @08070EA6: cmp r0, 0x32 bne @08070EAC movs r1, 0x1 @08070EAC: cmp r2, 0x46 bne @08070EB2 movs r1, 0 @08070EB2: ldr r0, =0x02021fc4 ldr r2, =gUnknown_0832B6F8 lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sp0B9_daycare_relationship_comment thumb_func_start sub_8070ECC sub_8070ECC: ; 8070ECC push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 lsls r1, 24 lsrs r5, r1, 24 mov r2, sp mov r1, sp movs r0, 0 strb r0, [r1, 0x1] strb r0, [r2] movs r3, 0 ldrb r0, [r4] cmp r0, 0xFF beq @08070F10 @08070EE8: adds r1, r4, r3 ldrb r0, [r1] cmp r0, 0xB5 bne @08070EF6 ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] @08070EF6: ldrb r0, [r1] cmp r0, 0xB6 bne @08070F02 ldrb r0, [r2, 0x1] adds r0, 0x1 strb r0, [r2, 0x1] @08070F02: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 adds r0, r4, r3 ldrb r0, [r0] cmp r0, 0xFF bne @08070EE8 @08070F10: cmp r5, 0 bne @08070F24 mov r0, sp ldrb r0, [r0] cmp r0, 0 beq @08070F24 mov r0, sp ldrb r0, [r0, 0x1] cmp r0, 0 beq @08070F38 @08070F24: cmp r5, 0xFE bne @08070F3C mov r0, sp ldrb r0, [r0, 0x1] cmp r0, 0 beq @08070F3C mov r0, sp ldrb r0, [r0] cmp r0, 0 bne @08070F3C @08070F38: movs r0, 0x1 b @08070F3E @08070F3C: movs r0, 0 @08070F3E: add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8070ECC thumb_func_start sub_8070F48 sub_8070F48: ; 8070F48 push {r4,lr} adds r4, r0, 0 lsls r1, 24 lsrs r1, 24 cmp r1, 0 bne @08070F68 movs r1, 0 bl sub_8070ECC lsls r0, 24 cmp r0, 0 bne @08070F84 ldr r1, =gUnknown_0832DAC7 b @08070F86 .align 2, 0 .pool @08070F68: cmp r1, 0xFE bne @08070F84 adds r0, r4, 0 movs r1, 0xFE bl sub_8070ECC lsls r0, 24 cmp r0, 0 bne @08070F84 ldr r1, =gUnknown_0832DAC9 b @08070F86 .align 2, 0 .pool @08070F84: ldr r1, =gUnknown_0832DACB @08070F86: adds r0, r4, 0 bl gf_strcat pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8070F48 thumb_func_start sub_8070F98 sub_8070F98: ; 8070F98 push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 bl pokemon_roll_gender adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_8070F48 pop {r4} pop {r1} bx r1 thumb_func_end sub_8070F98 thumb_func_start sub_8070FB4 sub_8070FB4: ; 8070FB4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x28 mov r8, r0 adds r7, r1, 0 movs r0, 0xFF strb r0, [r7] movs r6, 0 add r0, sp, 0x14 mov r9, r0 @08070FCC: movs r0, 0x8C adds r4, r6, 0 muls r4, r0 add r4, r8 lsls r0, r6, 2 adds r0, r6 lsls r0, 2 mov r1, sp adds r5, r1, r0 adds r0, r4, 0 adds r1, r5, 0 bl pokemon_get_nick_ adds r0, r5, 0 adds r1, r4, 0 bl sub_8070F98 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x1 bls @08070FCC adds r0, r7, 0 mov r1, sp bl gf_strcpy ldr r4, =gUnknown_085EF881 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, =gUnknown_085EF883 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 .pool thumb_func_end sub_8070FB4 thumb_func_start sub_8071038 sub_8071038: ; 8071038 push {r4-r6,lr} sub sp, 0x14 adds r6, r0, 0 adds r4, r1, 0 movs r0, 0xFF strb r0, [r4] movs r5, 0 @08071046: adds r0, r4, 0 ldr r1, =gUnknown_085EF888 bl 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, =gUnknown_085EF881 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 .pool thumb_func_end sub_8071038 thumb_func_start sub_807109C sub_807109C: ; 807109C push {r4-r6,lr} sub sp, 0x10 str r1, [sp] mov r1, sp movs r5, 0 strb r0, [r1, 0x4] mov r0, sp movs r6, 0x1 movs r4, 0x1 strb r4, [r0, 0x5] strb r2, [r0, 0x6] strb r3, [r0, 0x7] strb r2, [r0, 0x8] strb r3, [r0, 0x9] mov r3, sp ldrb r1, [r3, 0xC] movs r2, 0x10 negs r2, r2 adds r0, r2, 0 ands r0, r1 strb r0, [r3, 0xC] ldr r3, =0x03003014 ldrb r1, [r3] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r3] mov r0, sp strb r5, [r0, 0xA] strb r4, [r0, 0xB] mov r3, sp ldrb r1, [r3, 0xC] movs r4, 0xF adds r0, r4, 0 ands r0, r1 movs r1, 0x20 orrs r0, r1 strb r0, [r3, 0xC] mov r1, sp ldrb r0, [r1, 0xD] ands r2, r0 orrs r2, r6 strb r2, [r1, 0xD] ands r2, r4 movs r0, 0x30 orrs r2, r0 strb r2, [r1, 0xD] mov r0, sp movs r1, 0xFF movs r2, 0 bl remo_copy add sp, 0x10 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807109C thumb_func_start sub_8071110 sub_8071110: ; 8071110 push {r4-r6,lr} sub sp, 0x14 adds r5, r0, 0 adds r4, r1, 0 adds r6, r3, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x8C muls r0, r2 adds r5, r0 adds r0, r5, 0 mov r1, sp bl pokemon_get_nick_ mov r0, sp adds r1, r5, 0 bl sub_8070F98 adds r0, r4, 0 mov r1, sp movs r2, 0x8 adds r3, r6, 0 bl sub_807109C add sp, 0x14 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8071110 thumb_func_start sub_8071148 sub_8071148: ; 8071148 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x14 adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 mov r8, r3 lsls r5, 24 lsrs r5, 24 ldr r1, =gUnknown_085EF888 mov r0, sp bl 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 .pool thumb_func_end sub_8071148 thumb_func_start sub_80711B8 sub_80711B8: ; 80711B8 push {r4-r7,lr} mov r7, r8 push {r7} adds r6, r1, 0 lsls r0, 24 lsrs r7, r0, 24 lsls r2, 24 lsrs r5, r2, 24 cmp r6, 0x1 bhi @080711F0 ldr r0, =0x03005d8c mov r8, r0 ldr r0, [r0] ldr r4, =0x00003030 adds r0, r4 adds r1, r7, 0 adds r2, r6, 0 adds r3, r5, 0 bl sub_8071110 mov r1, r8 ldr r0, [r1] adds r0, r4 adds r1, r7, 0 adds r2, r6, 0 adds r3, r5, 0 bl sub_8071148 @080711F0: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80711B8 thumb_func_start c3_080469FC c3_080469FC: ; 8071204 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 adds r5, r0, 0 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 ldrb r0, [r4, 0x8] bl sub_81AE604 adds r1, r0, 0 ldr r0, =0x030022c0 ldrh r2, [r0, 0x2E] movs r0, 0x1 ands r0, r2 cmp r0, 0 beq @08071284 cmp r1, 0x1 bls @0807123C cmp r1, 0x5 beq @08071248 b @0807124E .align 2, 0 .pool @0807123C: ldr r0, =0x020375f0 strh r1, [r0] b @0807124E .align 2, 0 .pool @08071248: ldr r1, =0x020375f0 movs r0, 0x2 strh r0, [r1] @0807124E: ldr r0, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r0 ldrb r0, [r4, 0x8] movs r1, 0 movs r2, 0 bl sub_81AE6C8 ldrb r0, [r4, 0xA] movs r1, 0x1 bl sub_819746C ldrb r0, [r4, 0xA] bl Window_Remove adds r0, r5, 0 bl remove_task bl script_env_2_enable_and_set_ctx_running b @080712B4 .align 2, 0 .pool @08071284: movs r1, 0x2 adds r0, r1, 0 ands r0, r2 cmp r0, 0 beq @080712B4 ldr r0, =0x020375f0 strh r1, [r0] ldrb r0, [r4, 0x8] movs r1, 0 movs r2, 0 bl sub_81AE6C8 ldrb r0, [r4, 0xA] movs r1, 0x1 bl sub_819746C ldrb r0, [r4, 0xA] bl 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 .pool thumb_func_end c3_080469FC thumb_func_start sub_80712C0 sub_80712C0: ; 80712C0 push {r4,r5,lr} sub sp, 0x18 ldr r0, =gUnknown_0832B6C0 bl 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, =gUnknown_0832B6E0 ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} mov r0, sp strb r4, [r0, 0x10] movs r1, 0 movs r2, 0 bl 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, =c3_080469FC movs r1, 0x3 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r5, [r1, 0x8] strh r4, [r1, 0xA] add sp, 0x18 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80712C0 thumb_func_start sub_8071330 sub_8071330: ; 8071330 push {lr} bl sub_81B9328 ldr r1, =0x030022c0 ldr r0, =c2_exit_to_overworld_2_switch str r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8071330 thumb_func_start sub_8071348 sub_8071348: ; 8071348 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x50 adds r5, r0, 0 adds r6, r1, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x3C] movs r4, 0 add r7, sp, 0x18 add r0, sp, 0x30 mov r8, r0 movs r1, 0x31 add r1, sp mov r10, r1 mov r0, sp adds r0, 0x32 str r0, [sp, 0x40] mov r1, sp adds r1, 0x34 str r1, [sp, 0x48] adds r0, 0x1 str r0, [sp, 0x44] adds r1, 0x4 str r1, [sp, 0x4C] @08071386: adds r1, r4, 0 adds r1, 0xD adds r0, r5, 0 bl pokemon_getattr lsls r1, r4, 1 add r1, sp adds r1, 0x10 strh r0, [r1] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @08071386 adds r0, r5, 0 movs r1, 0 bl pokemon_getattr mov r9, r0 movs r4, 0 @080713AE: adds r1, r4, 0 adds r1, 0x27 adds r0, r5, 0 bl pokemon_getattr lsls r1, r4, 2 adds r1, r7, r1 str r0, [r1] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x5 bls @080713AE adds r0, r5, 0 movs r1, 0x3 bl pokemon_getattr mov r1, r8 strb r0, [r1] adds r0, r5, 0 movs r1, 0x25 bl pokemon_getattr mov r1, r10 strb r0, [r1] adds r0, r5, 0 movs r1, 0x8 bl pokemon_getattr ldr r1, [sp, 0x40] strb r0, [r1] adds r0, r5, 0 movs r1, 0x22 bl pokemon_getattr str r0, [sp, 0x38] adds r0, r5, 0 movs r1, 0x50 bl pokemon_getattr ldr r1, [sp, 0x48] strb r0, [r1] movs r0, 0x1 str r0, [sp] mov r0, r9 str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] str r0, [sp, 0xC] adds r0, r6, 0 ldr r1, [sp, 0x3C] movs r2, 0x5 movs r3, 0x20 bl create_pokemon_set_level movs r4, 0 @0807141E: adds r1, r4, 0 adds r1, 0xD lsls r0, r4, 1 mov r2, sp adds r2, r0 adds r2, 0x10 adds r0, r6, 0 bl pokemon_setattr adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @0807141E movs r4, 0 @0807143C: adds r1, r4, 0 adds r1, 0x27 lsls r2, r4, 2 adds r2, r7, r2 adds r0, r6, 0 bl pokemon_setattr adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x5 bls @0807143C movs r0, 0x2 mov r1, r8 strb r0, [r1] adds r0, r6, 0 movs r1, 0x3 mov r2, r8 bl pokemon_setattr adds r0, r6, 0 movs r1, 0x25 mov r2, r10 bl pokemon_setattr adds r0, r6, 0 movs r1, 0x8 ldr r2, [sp, 0x40] bl pokemon_setattr movs r0, 0x78 ldr r1, [sp, 0x44] strb r0, [r1] adds r0, r6, 0 movs r1, 0x20 ldr r2, [sp, 0x44] bl pokemon_setattr adds r0, r6, 0 movs r1, 0x22 ldr r2, [sp, 0x4C] bl pokemon_setattr adds r0, r6, 0 movs r1, 0x50 ldr r2, [sp, 0x48] bl pokemon_setattr adds r0, r5, 0 adds r1, r6, 0 movs r2, 0x64 bl memcpy add sp, 0x50 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8071348 thumb_func_start sub_80714B8 sub_80714B8: ; 80714B8 push {r4,r5,lr} sub sp, 0x14 lsls r0, 24 lsrs r0, 24 add r4, sp, 0xC movs r1, 0x46 strb r1, [r4] movs r1, 0x64 adds r5, r0, 0 muls r5, r1 ldr r0, =0x020244ec adds r5, r0 ldr r1, =0x02024744 adds r0, r5, 0 bl sub_8071348 adds r0, r5, 0 movs r1, 0x2D adds r2, r4, 0 bl pokemon_setattr adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 mov r0, sp adds r1, r4, 0 bl get_pokemon_name adds r0, r5, 0 movs r1, 0x2 mov r2, sp bl pokemon_setattr adds r0, r4, 0 bl SpeciesToNationalPokedexNum adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r4, 0 movs r1, 0x2 bl pokedex_flag_operation adds r0, r4, 0 movs r1, 0x3 bl pokedex_flag_operation ldr r1, =0x02021cc4 adds r0, r5, 0 bl pokemon_get_nick mov r2, sp adds r2, 0xE movs r0, 0x4 strh r0, [r2] adds r0, r5, 0 movs r1, 0x26 bl pokemon_setattr add r2, sp, 0x10 movs r0, 0 strh r0, [r2] adds r0, r5, 0 movs r1, 0x24 bl pokemon_setattr bl sav1_map_get_name mov r2, sp adds r2, 0x12 strb r0, [r2] adds r0, r5, 0 movs r1, 0x23 bl pokemon_setattr adds r0, r5, 0 bl sub_806E924 adds r0, r5, 0 bl pokemon_calc_effective_stats add sp, 0x14 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80714B8 thumb_func_start sub_8071578 sub_8071578: ; 8071578 push {lr} ldr r0, =0x020375e0 ldrb r0, [r0] bl sub_80714B8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8071578 thumb_func_start sub_807158C sub_807158C: ; 807158C push {r4-r6,lr} sub sp, 0x20 lsls r1, 24 lsrs r1, 24 movs r2, 0x8C muls r1, r2 adds r4, r0, r1 adds r0, r4, 0 mov r1, sp bl pokemon_get_nick_ adds r0, r4, 0 adds r0, 0x70 ldrh r0, [r0] cmp r0, 0 beq @08071608 adds r6, r4, 0 adds r6, 0x7C mov r0, sp adds r1, r6, 0 bl sub_80092BC adds r5, r4, 0 adds r5, 0x74 cmp r0, 0 bne @080715CE ldr r0, =0x03005d90 ldr r0, [r0] adds r1, r5, 0 bl sub_80092BC cmp r0, 0 beq @08071608 @080715CE: ldr r0, =0x02021cc4 mov r1, sp bl gf_strcpy ldr r0, =0x02021dc4 adds r4, 0x87 ldrb r2, [r4] lsls r2, 28 lsrs r2, 28 adds r1, r5, 0 bl sub_81DB5E8 ldr r0, =0x02021ec4 ldrb r2, [r4] lsrs r2, 4 adds r1, r6, 0 bl sub_81DB5E8 movs r0, 0x1 b @0807160A .align 2, 0 .pool @08071608: movs r0, 0 @0807160A: add sp, 0x20 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_807158C thumb_func_start sub_8071614 sub_8071614: ; 8071614 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003030 adds r0, r1 ldr r1, =0x020375e0 ldrb r1, [r1] bl sub_807158C lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8071614 thumb_func_start sub_807163C sub_807163C: ; 807163C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} mov r9, r3 lsls r0, 24 lsrs r3, r0, 24 mov r8, r3 lsls r1, 24 lsrs r6, r1, 24 lsls r2, 24 lsrs r1, r2, 24 adds r2, r1, 0 movs r4, 0 movs r7, 0 movs r5, 0 cmp r3, 0 bne @0807166A movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 movs r4, 0x1 @0807166A: cmp r3, 0x1 bne @0807167A movs r0, 0x64 adds r1, r2, 0 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 movs r4, 0x3 @0807167A: cmp r6, 0 beq @08071688 cmp r6, 0x1 beq @080716D8 b @08071712 .align 2, 0 .pool @08071688: adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0 bl pokemon_getattr adds r3, r0, 0 lsls r0, r4, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r2, [r1] mov r6, r8 lsls r1, r6, 1 adds r1, 0x1 lsls r1, 2 adds r2, 0x4 adds r2, r1 ldr r1, [r2] adds r2, r4, 0 bl 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 .pool @080716D8: adds r0, r5, 0 bl sub_806E794 ldrh r0, [r0, 0x4] adds r1, r4, 0 bl sub_806A068 ldr r0, =0x0202499c movs r1, 0x78 movs r2, 0x4B movs r3, 0x6 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r7, r0, 24 ldr r4, =0x02020630 lsls r1, r7, 4 adds r1, r7 lsls r1, 2 adds r2, r1, r4 adds r2, 0x3E ldrb r0, [r2] movs r3, 0x4 orrs r0, r3 strb r0, [r2] adds r4, 0x1C adds r1, r4 ldr r0, =nullsub_12 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 .pool 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, =sub_8071760 movs r1, 0xA bl AddTask movs r0, 0x1 movs r1, 0 bl fade_screen pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8071740 thumb_func_start sub_8071760 sub_8071760: ; 8071760 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08071788 bl overworld_free_bg_tilemaps ldr r0, =c1_hatching_egg bl set_callback2 ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] adds r0, r4, 0 bl remove_task @08071788: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8071760 thumb_func_start c1_hatching_egg c1_hatching_egg: ; 80717A0 push {r4,lr} sub sp, 0x4 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x8 bls @080717B4 b @080719D6 @080717B4: lsls r0, 2 ldr r1, =@080717C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080717C8: .4byte @080717EC .4byte @080718B8 .4byte @080718D0 .4byte @08071904 .4byte @08071924 .4byte @0807193C .4byte @08071954 .4byte @08071970 .4byte @080719C8 @080717EC: movs r0, 0 movs r1, 0 bl lcd_io_set ldr r4, =0x03000de0 movs r0, 0x14 bl malloc str r0, [r4] bl init_uns_table_pokemon_copy ldr r2, [r4] ldr r0, =0x020375e0 ldrh r0, [r0] movs r1, 0 strb r0, [r2, 0x4] ldr r0, [r4] strb r1, [r0, 0x7] ldr r0, =sub_807172C bl SetVBlankCallback bl current_map_music_get ldr r1, =0x020375e2 strh r0, [r1] bl reset_temp_tile_data_buffers movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_0832C064 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 .pool @080718B8: ldr r0, =gUnknown_0832C06C bl Window_InitFromTemplates ldr r0, =0x03000de0 ldr r1, [r0] movs r0, 0 strb r0, [r1, 0x8] b @080719A6 .align 2, 0 .pool @080718D0: ldr r1, =gUnknown_08C00000 movs r0, 0 str r0, [sp] movs r2, 0 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree ldr r1, =gUnknown_08C00524 movs r0, 0 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r0, =gUnknown_08C004E0 movs r1, 0 movs r2, 0x20 bl decompress_palette b @080719A6 .align 2, 0 .pool @08071904: ldr r0, =gUnknown_0832BFE4 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_0832BFEC bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_0832BFF4 bl gpu_pal_obj_alloc_tag_and_apply b @080719A6 .align 2, 0 .pool @08071924: movs r0, 0 bl gpu_copy_wram_bg_tilemap_to_vram ldr r0, =0x03000de0 ldr r0, [r0] ldrb r0, [r0, 0x4] bl sub_80714B8 b @080719A6 .align 2, 0 .pool @0807193C: ldr r0, =0x03000de0 ldr r3, [r0] ldrb r2, [r3, 0x4] adds r3, 0xC movs r0, 0 movs r1, 0 bl sub_807163C b @080719A6 .align 2, 0 .pool @08071954: ldr r4, =0x03000de0 ldr r3, [r4] ldrb r2, [r3, 0x4] adds r3, 0xC movs r0, 0 movs r1, 0x1 bl sub_807163C ldr r1, [r4] strb r0, [r1, 0x1] b @080719A6 .align 2, 0 .pool @08071970: movs r1, 0x82 lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =gUnknown_08DD7300 movs r1, 0x10 movs r2, 0xA0 bl gpu_pal_apply ldr r1, =gUnknown_08DD7360 movs r2, 0xA1 lsls r2, 5 movs r0, 0x1 movs r3, 0 bl gpu_copy_bg_tile_pattern_data_to_vram ldr r1, =gUnknown_08331F60 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080719D6 .align 2, 0 .pool @080719C8: ldr r0, =sub_8071A94 bl set_callback2 ldr r0, =0x03000de0 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 .pool thumb_func_end c1_hatching_egg thumb_func_start sub_80719FC sub_80719FC: ; 80719FC push {lr} ldr r0, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r2, =0x02021ec4 movs r1, 0x2 bl pokemon_setattr bl sub_805F094 ldr r0, =0x03000de0 ldr r0, [r0] bl free ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80719FC thumb_func_start c3_080472E4 c3_080472E4: ; 8071A3C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bne @08071A5C bl sub_80A2F30 bl play_some_sound @08071A5C: movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x1 bne @08071A6C movs r0, 0xBC lsls r0, 1 bl song_play_for_text @08071A6C: movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x3C ble @08071A80 ldr r0, =0x00000179 bl song_play_for_text adds r0, r5, 0 bl remove_task @08071A80: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c3_080472E4 thumb_func_start sub_8071A94 sub_8071A94: ; 8071A94 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x8 ldr r1, =0x03000de0 ldr r0, [r1] ldrb r0, [r0, 0x2] adds r5, r1, 0 cmp r0, 0xC bls @08071AAC b @08071E06 @08071AAC: lsls r0, 2 ldr r1, =@08071AC0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08071AC0: .4byte @08071AF4 .4byte @08071B40 .4byte @08071B68 .4byte @08071BA0 .4byte @08071BF8 .4byte @08071C24 .4byte @08071C88 .4byte @08071C96 .4byte @08071CA4 .4byte @08071CE8 .4byte @08071D1C .4byte @08071DB4 .4byte @08071DD4 @08071AF4: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =gUnknown_0832BFFC movs r1, 0x78 movs r2, 0x4B movs r3, 0x5 bl obj_add_from_template_forward_search ldr r4, =0x03000de0 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, =c3_080472E4 movs r1, 0x5 bl AddTask b @08071E06 .align 2, 0 .pool @08071B40: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @08071B52 b @08071E06 @08071B52: ldr r0, [r5] ldrb r0, [r0, 0x8] movs r1, 0 bl Window_FastFillPixels ldr r0, [r5] strb r4, [r0, 0x3] ldr r1, [r5] b @08071DC8 .align 2, 0 .pool @08071B68: ldr r1, [r5] ldrb r0, [r1, 0x3] adds r0, 0x1 strb r0, [r1, 0x3] lsls r0, 24 lsrs r0, 24 cmp r0, 0x1E bhi @08071B7A b @08071E06 @08071B7A: ldr r1, [r5] ldrb r0, [r1, 0x2] adds r0, 0x1 strb r0, [r1, 0x2] ldr r2, =0x02020630 ldr r0, [r5] ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8071E34 str r1, [r0] b @08071E06 .align 2, 0 .pool @08071BA0: ldr r4, =0x02020630 ldr r2, [r5] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @08071BBC b @08071E06 @08071BBC: ldrb r1, [r2, 0x4] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r7, r0, 16 ldr r0, [r5] ldrb r1, [r0, 0x1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r1, r7, 0 movs r2, 0 movs r3, 0x1 bl sub_806ED40 ldr r1, [r5] b @08071DC8 .align 2, 0 .pool @08071BF8: ldr r2, =0x02020630 ldr r3, [r5] ldrb r1, [r3, 0x1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @08071C12 b @08071E06 @08071C12: ldrb r0, [r3, 0x2] adds r0, 0x1 strb r0, [r3, 0x2] b @08071E06 .align 2, 0 .pool @08071C24: ldr r0, [r5] ldrb r1, [r0, 0x4] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl pokemon_get_nick ldr r4, =0x02021fc4 ldr r1, =gUnknown_085ED5A5 adds r0, r4, 0 bl 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, =0x00000173 bl fanfare_play ldr r1, [r5] ldrb r0, [r1, 0x2] adds r0, 0x1 strb r0, [r1, 0x2] ldr r0, [r5] ldrb r0, [r0, 0x8] bl Window_WriteStandardTileMap ldr r0, [r5] ldrb r0, [r0, 0x8] movs r1, 0x3 bl Window_CopyToVram b @08071E06 .align 2, 0 .pool @08071C88: bl task_is_not_running_overworld_fanfare lsls r0, 24 cmp r0, 0 bne @08071C94 b @08071E06 @08071C94: b @08071DC4 @08071C96: bl task_is_not_running_overworld_fanfare lsls r0, 24 cmp r0, 0 bne @08071CA2 b @08071E06 @08071CA2: b @08071DC4 @08071CA4: ldr r0, [r5] ldrb r1, [r0, 0x4] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl pokemon_get_nick ldr r4, =0x02021fc4 ldr r1, =gUnknown_085ED5BE adds r0, r4, 0 bl 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 .pool @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, =gUnknown_0832C07C adds r1, r4, 0 movs r2, 0xE movs r3, 0 bl sub_81996C0 ldr r1, [r5] b @08071DC8 .align 2, 0 .pool @08071D1C: bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @08071D3C cmp r1, 0 bgt @08071D36 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08071DC4 b @08071E06 @08071D36: cmp r1, 0x1 beq @08071DC4 b @08071E06 @08071D3C: ldr r0, =0x03000de0 mov r8, r0 ldr r0, [r0] ldrb r0, [r0, 0x4] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 ldr r1, =0x02021ec4 mov r9, r1 bl pokemon_get_nick mov r1, r8 ldr r0, [r1] ldrb r0, [r0, 0x4] muls r0, r6 adds r0, r5 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r7, r0, 16 mov r1, r8 ldr r0, [r1] ldrb r0, [r0, 0x4] muls r0, r6 adds r0, r5 bl pokemon_get_gender adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 mov r1, r8 ldr r0, [r1] ldrb r0, [r0, 0x4] muls r0, r6 adds r0, r5 movs r1, 0 movs r2, 0 bl pokemon_getattr str r0, [sp] ldr r0, =sub_80719FC str r0, [sp, 0x4] movs r0, 0x3 mov r1, r9 adds r2, r7, 0 adds r3, r4, 0 bl do_choose_name_or_words_screen b @08071E06 .align 2, 0 .pool @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, =0x03000de0 ldr r1, [r0] @08071DC8: ldrb r0, [r1, 0x2] adds r0, 0x1 strb r0, [r1, 0x2] b @08071E06 .align 2, 0 .pool @08071DD4: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08071E06 bl sub_805F094 ldr r4, =0x03000de0 ldr r0, [r4] ldrb r0, [r0, 0x8] bl Window_Remove movs r0, 0 bl bg_unset_tilemap movs r0, 0x1 bl bg_unset_tilemap ldr r0, [r4] bl free ldr r0, =c2_exit_to_overworld_2_switch 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 .pool thumb_func_end sub_8071A94 thumb_func_start sub_8071E34 sub_8071E34: ; 8071E34 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0x14 ble @08071E54 ldr r0, =sub_8071E8C str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x2E] b @08071E84 .align 2, 0 .pool @08071E54: ldrh r0, [r4, 0x30] adds r0, 0x14 movs r1, 0xFF ands r0, r1 strh r0, [r4, 0x30] movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x1 bl sine strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0xF bne @08071E84 movs r0, 0x17 bl audio_play adds r0, r4, 0 movs r1, 0x1 bl 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, =sub_8071EF0 str r0, [r4, 0x1C] strh r1, [r4, 0x2E] strh r1, [r4, 0x32] b @08071EE8 .align 2, 0 .pool @08071EBC: ldrh r0, [r4, 0x30] adds r0, 0x14 movs r1, 0xFF ands r0, r1 strh r0, [r4, 0x30] movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x2 bl sine strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0xF bne @08071EE8 movs r0, 0x17 bl audio_play adds r0, r4, 0 movs r1, 0x2 bl 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, =sub_8071FA4 str r0, [r4, 0x1C] strh r5, [r4, 0x2E] ldr r4, =0x03000de0 ldr r0, [r4] ldrb r1, [r0, 0x4] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr ldr r3, =0x02020630 ldr r2, [r4] ldrb r1, [r2, 0x1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 strh r5, [r0, 0x24] ldrb r1, [r2, 0x1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 strh r5, [r0, 0x26] b @08071F9E .align 2, 0 .pool @08071F5C: ldrh r0, [r4, 0x30] adds r0, 0x14 movs r1, 0xFF ands r0, r1 strh r0, [r4, 0x30] movs r1, 0x30 ldrsh r0, [r4, r1] movs r1, 0x2 bl sine strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0xF bne @08071F90 movs r0, 0x17 bl audio_play adds r0, r4, 0 movs r1, 0x2 bl 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, =sub_8071FC8 str r0, [r1, 0x1C] movs r0, 0 strh r0, [r1, 0x2E] @08071FBE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8071FA4 thumb_func_start sub_8071FC8 sub_8071FC8: ; 8071FC8 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 movs r1, 0x2E ldrsh r0, [r5, r1] cmp r0, 0 bne @08071FE8 movs r1, 0x1 negs r1, r1 ldr r0, =0x0000ffff str r0, [sp] adds r0, r1, 0 movs r2, 0 movs r3, 0x10 bl 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @08072032 movs r0, 0x71 bl audio_play adds r2, r5, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] ldr r0, =sub_8072048 str r0, [r5, 0x1C] strh r4, [r5, 0x2E] @08072032: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8071FC8 thumb_func_start sub_8072048 sub_8072048: ; 8072048 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 movs r1, 0x2E ldrsh r0, [r5, r1] cmp r0, 0 bne @08072084 ldr r4, =0x02020630 ldr r3, =0x03000de0 ldr r0, [r3] ldrb r1, [r0, 0x1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] ldr r0, [r3] ldrb r1, [r0, 0x1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x1 bl sub_8008258 @08072084: movs r2, 0x2E ldrsh r0, [r5, r2] cmp r0, 0x8 bne @0807209E movs r1, 0x1 negs r1, r1 ldr r0, =0x0000ffff str r0, [sp] adds r0, r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 @0807209E: movs r1, 0x2E ldrsh r0, [r5, r1] cmp r0, 0x9 bgt @080720BC ldr r2, =0x02020630 ldr r0, =0x03000de0 ldr r0, [r0] ldrb r1, [r0, 0x1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x22] subs r1, 0x1 strh r1, [r0, 0x22] @080720BC: ldrh r1, [r5, 0x2E] movs r2, 0x2E ldrsh r0, [r5, r2] cmp r0, 0x28 ble @080720CA ldr r0, =nullsub_12 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 .pool thumb_func_end sub_8072048 thumb_func_start sub_80720E8 sub_80720E8: ; 80720E8 push {r4,lr} adds r2, r0, 0 ldrh r0, [r2, 0x30] ldrh r1, [r2, 0x36] adds r0, r1 strh r0, [r2, 0x36] ldrh r1, [r2, 0x32] ldrh r3, [r2, 0x38] adds r0, r1, r3 strh r0, [r2, 0x38] movs r4, 0x36 ldrsh r0, [r2, r4] cmp r0, 0 bge @08072106 adds r0, 0xFF @08072106: asrs r0, 8 strh r0, [r2, 0x24] movs r3, 0x38 ldrsh r0, [r2, r3] cmp r0, 0 bge @08072114 adds r0, 0xFF @08072114: asrs r0, 8 strh r0, [r2, 0x26] ldrh r0, [r2, 0x34] adds r3, r1, r0 strh r3, [r2, 0x32] movs r4, 0x22 ldrsh r1, [r2, r4] movs r4, 0x26 ldrsh r0, [r2, r4] adds r0, r1, r0 adds r1, 0x14 cmp r0, r1 ble @0807213A lsls r0, r3, 16 cmp r0, 0 ble @0807213A adds r0, r2, 0 bl 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, =gUnknown_0832C084 ldr r0, =0x03000de0 ldr r6, [r0] ldrb r3, [r6, 0x7] lsls r0, r3, 2 adds r1, r0, r2 ldrh r5, [r1] adds r2, 0x2 adds r0, r2 ldrh r4, [r0] adds r3, 0x1 strb r3, [r6, 0x7] bl GenerateRandomNumber lsls r0, 16 movs r1, 0xC0 lsls r1, 10 ands r1, r0 lsls r5, 16 asrs r5, 16 lsls r4, 16 asrs r4, 16 movs r0, 0x64 str r0, [sp] lsrs r1, 16 str r1, [sp, 0x4] movs r0, 0x78 movs r1, 0x3C adds r2, r5, 0 adds r3, r4, 0 bl sub_8072194 add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8072140 thumb_func_start sub_8072194 sub_8072194: ; 8072194 push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 mov r8, r3 ldr r0, [sp, 0x1C] mov r9, r0 ldr r1, [sp, 0x20] mov r10, r1 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 lsls r6, 16 lsrs r6, 16 mov r0, r8 lsls r0, 16 lsrs r0, 16 mov r8, r0 mov r1, r9 lsls r1, 16 lsrs r1, 16 mov r9, r1 mov r0, r10 lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r0, =gUnknown_0832C04C adds r1, r4, 0 adds r2, r5, 0 movs r3, 0x4 bl obj_add_from_template_forward_search adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r6, [r0, 0x30] mov r1, r8 strh r1, [r0, 0x32] mov r1, r9 strh r1, [r0, 0x34] mov r1, r10 bl 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 .pool thumb_func_end sub_8072194 thumb_func_start sub_8072214 sub_8072214: ; 8072214 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x14 adds r5, r0, 0 mov r9, r1 adds r6, r2, 0 mov r8, r3 ldr r4, [sp, 0x2C] lsls r5, 24 lsrs r5, 24 lsls r6, 24 lsrs r6, 24 mov r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0xFF bl Window_FastFillPixels ldr r3, =0x03000de0 ldr r0, [r3] movs r2, 0 strb r2, [r0, 0xE] ldr r1, [r3] movs r0, 0x5 strb r0, [r1, 0xF] ldr r1, [r3] movs r0, 0x6 strb r0, [r1, 0x10] str r2, [sp] str r2, [sp, 0x4] ldr r0, [r3] adds r0, 0xE str r0, [sp, 0x8] lsls r4, 24 asrs r4, 24 str r4, [sp, 0xC] mov r0, r9 str r0, [sp, 0x10] adds r0, r5, 0 movs r1, 0x1 adds r2, r6, 0 mov r3, r8 bl sub_8199EEC add sp, 0x14 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8072214 thumb_func_start sub_807228C sub_807228C: ; 807228C push {r4-r6,lr} bl calc_player_party_count lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 cmp r5, r6 bcs @080722D6 @0807229C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x6 bl pokemon_getattr cmp r0, 0 bne @080722CC adds r0, r4, 0 bl 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 .pool @080722CC: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, r6 bcc @0807229C @080722D6: movs r0, 0x1 @080722D8: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_807228C thumb_func_start sub_80722E0 sub_80722E0: ; 80722E0 push {r4,lr} bl sub_80D22D0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 movs r0, 0x6 bl sub_80C7050 lsls r0, 24 lsrs r0, 24 adds r4, r0 lsls r4, 16 lsrs r4, 16 adds r0, r4, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_80722E0 thumb_func_start sub_8072304 sub_8072304: ; 8072304 movs r0, 0x9 bx lr thumb_func_end sub_8072304 thumb_func_start sub_8072308 sub_8072308: ; 8072308 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 adds r7, r1, 0 lsls r0, 16 lsrs r5, r0, 16 lsls r2, 24 lsrs r2, 24 mov r10, r2 movs r3, 0 movs r2, 0 @08072324: lsls r0, r3, 24 asrs r0, 24 mov r3, sp adds r1, r3, r0 strb r2, [r1] adds r0, 0x1 lsls r0, 24 lsrs r3, r0, 24 asrs r0, 24 cmp r0, 0x3 ble @08072324 movs r3, 0x3 movs r0, 0x1 negs r0, r0 mov r9, r0 mov r8, sp @08072344: lsls r0, r5, 16 asrs r6, r0, 16 cmp r6, 0 ble @08072372 lsls r4, r3, 24 asrs r4, 24 mov r1, sp adds r5, r1, r4 adds r0, r6, 0 movs r1, 0xA bl __modsi3 strb r0, [r5] adds r0, r6, 0 movs r1, 0xA bl __divsi3 lsls r0, 16 lsrs r5, r0, 16 subs r4, 0x1 lsls r4, 24 lsrs r3, r4, 24 b @08072344 @08072372: lsls r1, r3, 24 asrs r0, r1, 24 cmp r0, r9 ble @08072396 movs r4, 0xFF movs r3, 0x1 negs r3, r3 @08072380: asrs r2, r1, 24 mov r5, sp adds r1, r5, r2 ldrb r0, [r1] orrs r0, r4 strb r0, [r1] subs r2, 0x1 lsls r1, r2, 24 asrs r0, r1, 24 cmp r0, r3 bgt @08072380 @08072396: mov r1, r8 ldrb r0, [r1, 0x3] cmp r0, 0xFF bne @080723A2 movs r0, 0 strb r0, [r1, 0x3] @080723A2: mov r2, r10 cmp r2, 0 bne @08072432 movs r3, 0 movs r1, 0 movs r6, 0xFC lsls r6, 8 movs r5, 0x1E mov r12, r5 @080723B4: lsls r1, 24 asrs r2, r1, 24 mov r0, sp adds r5, r0, r2 ldrb r0, [r5] mov r8, r1 cmp r0, 0xFF bne @080723EA lsls r1, r2, 1 adds r1, r7 ldrh r2, [r1] adds r0, r6, 0 ands r0, r2 mov r2, r12 orrs r0, r2 strh r0, [r1] lsls r3, 24 asrs r1, r3, 23 adds r1, r7 adds r1, 0x40 ldrh r2, [r1] adds r0, r6, 0 ands r0, r2 mov r5, r12 orrs r0, r5 strh r0, [r1] b @0807241A @080723EA: lsls r2, 1 adds r2, r7 ldrh r0, [r2] adds r1, r6, 0 ands r1, r0 ldrb r0, [r5] adds r0, 0x14 orrs r1, r0 strh r1, [r2] lsls r4, r3, 24 asrs r3, r4, 24 lsls r2, r3, 1 adds r2, r7 adds r2, 0x40 ldrh r0, [r2] adds r1, r6, 0 ands r1, r0 mov r5, sp adds r0, r5, r3 ldrb r0, [r0] adds r0, 0x34 orrs r1, r0 strh r1, [r2] adds r3, r4, 0 @0807241A: movs r0, 0x80 lsls r0, 17 add r0, r8 lsrs r1, r0, 24 movs r2, 0x80 lsls r2, 17 adds r0, r3, r2 lsrs r3, r0, 24 asrs r0, 24 cmp r0, 0x3 ble @080723B4 b @08072496 @08072432: movs r3, 0 movs r4, 0xFC lsls r4, 8 movs r6, 0x1E @0807243A: lsls r1, r3, 24 asrs r2, r1, 24 mov r3, sp adds r5, r3, r2 ldrb r0, [r5] adds r3, r1, 0 cmp r0, 0xFF bne @08072466 lsls r1, r2, 1 adds r1, r7 ldrh r2, [r1] adds r0, r4, 0 ands r0, r2 orrs r0, r6 strh r0, [r1] adds r1, 0x40 ldrh r2, [r1] adds r0, r4, 0 ands r0, r2 orrs r0, r6 strh r0, [r1] b @08072488 @08072466: lsls r2, 1 adds r2, r7 ldrh r0, [r2] adds r1, r4, 0 ands r1, r0 ldrb r0, [r5] adds r0, 0x14 orrs r1, r0 strh r1, [r2] adds r2, 0x40 ldrh r0, [r2] adds r1, r4, 0 ands r1, r0 ldrb r0, [r5] adds r0, 0x34 orrs r1, r0 strh r1, [r2] @08072488: movs r5, 0x80 lsls r5, 17 adds r0, r3, r5 lsrs r3, r0, 24 asrs r0, 24 cmp r0, 0x3 ble @0807243A @08072496: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8072308 thumb_func_start sub_80724A8 sub_80724A8: ; 80724A8 push {r4,r5,lr} adds r4, r0, 0 adds r0, r1, 0 adds r5, r2, 0 lsls r4, 16 lsrs r4, 16 movs r1, 0x1E strh r1, [r5, 0x8] lsls r0, 16 asrs r0, 16 adds r1, r5, 0 movs r2, 0 bl sub_8072308 lsls r4, 16 asrs r4, 16 adds r5, 0xA adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x1 bl sub_8072308 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_80724A8 thumb_func_start battle_make_oam_normal_battle battle_make_oam_normal_battle: ; 80724DC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 mov r10, r0 movs r0, 0 str r0, [sp] bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @080725F0 mov r0, r10 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08072574 ldr r4, =gUnknown_0832C140 adds r0, r4, 0 movs r1, 0xF0 movs r2, 0xA0 movs r3, 0x1 bl 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, =0x02020630 lsls r1, r6, 4 adds r1, r6 lsls r1, 2 adds r1, r4 ldrb r2, [r1, 0x1] movs r3, 0x3F adds r0, r3, 0 ands r0, r2 strb r0, [r1, 0x1] lsls r2, r7, 4 adds r2, r7 lsls r2, 2 adds r2, r4 ldrb r0, [r2, 0x1] ands r3, r0 strb r3, [r2, 0x1] ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x40 ldr r4, =0x000003ff adds r0, r4, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] b @080725BA .align 2, 0 .pool @08072574: ldr r4, =gUnknown_0832C170 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, =0x02020630 lsls r2, r7, 4 adds r2, r7 lsls r2, 2 adds r2, r0 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x20 ldr r5, =0x000003ff adds r0, r5, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] movs r0, 0x2 str r0, [sp] @080725BA: ldr r2, =0x02020630 lsls r0, r6, 4 adds r0, r6 lsls r0, 2 adds r0, r2 strh r7, [r0, 0x6] lsls r0, r7, 4 adds r0, r7 lsls r0, 2 adds r1, r0, r2 strh r6, [r1, 0x38] adds r2, 0x1C adds r0, r2 ldr r1, =sub_8072924 str r1, [r0] b @08072718 .align 2, 0 .pool @080725F0: mov r0, r10 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08072694 mov r0, r10 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 25 lsls r0, r1, 1 adds r0, r1 lsls r0, 3 ldr r4, =gUnknown_0832C140 adds r0, r4 movs r1, 0xF0 movs r2, 0xA0 movs r3, 0x1 bl 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, =0x02020630 lsls r0, r6, 4 adds r0, r6 lsls r0, 2 adds r0, r4 strh r7, [r0, 0x6] lsls r2, r7, 4 adds r2, r7 lsls r2, 2 adds r3, r2, r4 strh r6, [r3, 0x38] ldrh r1, [r3, 0x4] mov r8, r1 mov r5, r8 lsls r1, r5, 22 lsrs r1, 22 adds r1, 0x20 ldr r5, =0x000003ff adds r0, r5, 0 ands r1, r0 ldr r0, =0xfffffc00 mov r5, r8 ands r0, r5 orrs r0, r1 strh r0, [r3, 0x4] adds r4, 0x1C adds r2, r4 ldr r0, =sub_8072924 str r0, [r2] movs r0, 0x1 b @08072716 .align 2, 0 .pool @08072694: mov r0, r10 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 25 lsls r0, r1, 1 adds r0, r1 lsls r0, 3 ldr r4, =gUnknown_0832C170 adds r0, r4 movs r1, 0xF0 movs r2, 0xA0 movs r3, 0x1 bl 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, =0x02020630 lsls r0, r6, 4 adds r0, r6 lsls r0, 2 adds r0, r4 strh r7, [r0, 0x6] lsls r2, r7, 4 adds r2, r7 lsls r2, 2 adds r3, r2, r4 strh r6, [r3, 0x38] ldrh r1, [r3, 0x4] mov r8, r1 mov r5, r8 lsls r1, r5, 22 lsrs r1, 22 adds r1, 0x20 ldr r5, =0x000003ff adds r0, r5, 0 ands r1, r0 ldr r0, =0xfffffc00 mov r5, r8 ands r0, r5 orrs r0, r1 strh r0, [r3, 0x4] adds r4, 0x1C adds r2, r4 ldr r0, =sub_8072924 str r0, [r2] movs r0, 0x2 @08072716: str r0, [sp] @08072718: ldr r0, =0x02024076 add r0, r10 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 3 ldr r1, =gUnknown_0832C1C0 adds r0, r1 movs r1, 0x8C movs r2, 0x3C movs r3, 0 bl 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, =0x02020630 mov r8, r1 add r4, r8 mov r0, r10 bl battle_side_get_owner adds r1, r0, 0 lsls r1, 24 lsrs r1, 21 ldr r0, =gUnknown_0832C28C adds r1, r0 adds r0, r4, 0 bl 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, =0x06010000 adds r1, r2 ldr r2, =0x04000010 bl CpuSet lsls r0, r6, 4 adds r0, r6 lsls r0, 2 add r0, r8 strh r5, [r0, 0x38] mov r2, r10 strh r2, [r0, 0x3A] adds r0, 0x3E ldrb r1, [r0] mov r5, r9 orrs r1, r5 strb r1, [r0] lsls r0, r7, 4 adds r0, r7 lsls r0, 2 add r0, r8 adds r0, 0x3E ldrb r1, [r0] orrs r1, r5 strb r1, [r0] strh r6, [r4, 0x38] mov r0, sp ldrh r0, [r0] strh r0, [r4, 0x3A] adds r4, 0x3E ldrb r0, [r4] orrs r0, r5 strb r0, [r4] adds r0, r6, 0 add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end battle_make_oam_normal_battle thumb_func_start battle_make_oam_safari_battle battle_make_oam_safari_battle: ; 8072804 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r4, =gUnknown_0832C1A0 adds r0, r4, 0 movs r1, 0xF0 movs r2, 0xA0 movs r3, 0x1 bl 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, =0x02020630 mov r9, r1 lsls r4, r6, 4 adds r4, r6 lsls r4, 2 add r4, r9 ldrb r3, [r4, 0x1] movs r2, 0x3F adds r1, r2, 0 ands r1, r3 strb r1, [r4, 0x1] lsls r3, r0, 4 adds r3, r0 lsls r3, 2 mov r7, r9 adds r5, r3, r7 ldrb r1, [r5, 0x1] ands r2, r1 strb r2, [r5, 0x1] ldrh r1, [r5, 0x4] mov r8, r1 mov r7, r8 lsls r2, r7, 22 lsrs r2, 22 adds r2, 0x40 ldr r7, =0x000003ff adds r1, r7, 0 ands r2, r1 ldr r1, =0xfffffc00 mov r7, r8 ands r1, r7 orrs r1, r2 strh r1, [r5, 0x4] strh r0, [r4, 0x6] strh r6, [r5, 0x38] movs r0, 0x1C add r9, r0 add r3, r9 ldr r0, =sub_8072924 str r0, [r3] adds r0, r6, 0 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end battle_make_oam_safari_battle thumb_func_start sub_80728A4 sub_80728A4: ; 80728A4 lsls r0, 24 lsrs r0, 19 ldr r1, =gUnknown_08C11BDC adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_80728A4 thumb_func_start sub_80728B4 sub_80728B4: ; 80728B4 push {r4,r5,lr} adds r4, r0, 0 ldrh r0, [r4, 0x38] lsls r0, 24 lsrs r5, r0, 24 movs r1, 0x3A ldrsh r0, [r4, r1] cmp r0, 0x1 beq @080728E4 cmp r0, 0x1 bgt @080728F8 cmp r0, 0 bne @080728F8 ldr r2, =0x02020630 lsls r3, r5, 4 adds r1, r3, r5 lsls r1, 2 adds r1, r2 ldrh r0, [r1, 0x20] adds r0, 0x10 b @08072906 .align 2, 0 .pool @080728E4: ldr r2, =0x02020630 lsls r3, r5, 4 adds r1, r3, r5 lsls r1, 2 adds r1, r2 ldrh r0, [r1, 0x20] adds r0, 0x10 b @08072906 .align 2, 0 .pool @080728F8: ldr r2, =0x02020630 lsls r3, r5, 4 adds r1, r3, r5 lsls r1, 2 adds r1, r2 ldrh r0, [r1, 0x20] adds r0, 0x8 @08072906: strh r0, [r4, 0x20] ldrh r0, [r1, 0x22] strh r0, [r4, 0x22] adds r0, r3, r5 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x24] strh r1, [r4, 0x24] ldrh r0, [r0, 0x26] strh r0, [r4, 0x26] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80728B4 thumb_func_start sub_8072924 sub_8072924: ; 8072924 ldrh r1, [r0, 0x38] lsls r1, 24 lsrs r1, 24 ldr r3, =0x02020630 lsls r2, r1, 4 adds r2, r1 lsls r2, 2 adds r2, r3 ldrh r1, [r2, 0x20] adds r1, 0x40 strh r1, [r0, 0x20] ldrh r1, [r2, 0x22] strh r1, [r0, 0x22] ldrh r1, [r2, 0x24] strh r1, [r0, 0x24] ldrh r1, [r2, 0x26] strh r1, [r0, 0x26] bx lr .align 2, 0 .pool thumb_func_end sub_8072924 thumb_func_start sub_807294C sub_807294C: ; 807294C push {r4-r7,lr} ldr r7, [sp, 0x14] lsls r0, 24 lsrs r0, 24 ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, [r4, 0xC] lsls r4, r0, 2 adds r4, r0 lsls r4, 2 adds r5, r4, r5 strb r1, [r5] ldr r0, [r6] ldr r0, [r0, 0xC] adds r4, r0 str r2, [r4, 0x4] str r3, [r4, 0x8] str r7, [r4, 0xC] ldr r0, =0xffff8000 str r0, [r4, 0x10] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807294C thumb_func_start sub_8072984 sub_8072984: ; 8072984 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r4, =0x02020630 lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r4 adds r1, r2, 0 adds r1, 0x3E ldrb r0, [r1] movs r3, 0x4 orrs r0, r3 strb r0, [r1] movs r0, 0x38 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] orrs r1, r3 strb r1, [r0] ldrh r1, [r2, 0x6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] orrs r1, r3 strb r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8072984 thumb_func_start sub_80729D0 sub_80729D0: ; 80729D0 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =0x02020630 lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r5 adds r4, r2, 0 adds r4, 0x3E ldrb r1, [r4] movs r3, 0x5 negs r3, r3 adds r0, r3, 0 ands r0, r1 strb r0, [r4] movs r0, 0x38 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 adds r0, 0x3E ldrb r4, [r0] adds r1, r3, 0 ands r1, r4 strb r1, [r0] ldrh r1, [r2, 0x6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 adds r0, 0x3E ldrb r1, [r0] ands r3, r1 strb r3, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80729D0 thumb_func_start sub_8072A24 sub_8072A24: ; 8072A24 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r4, =0x02020630 lsls r3, r0, 4 adds r3, r0 lsls r3, 2 adds r3, r4 strh r1, [r3, 0x20] strh r2, [r3, 0x22] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8072A24 thumb_func_start sub_8072A44 sub_8072A44: ; 8072A44 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =0x02020630 lsls r4, r0, 4 adds r4, r0 lsls r4, 2 adds r4, r5 ldrh r1, [r4, 0x6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 bl 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 .pool thumb_func_end sub_8072A44 thumb_func_start nullsub_30 nullsub_30: ; 8072A84 bx lr thumb_func_end nullsub_30 thumb_func_start sub_8072A88 sub_8072A88: ; 8072A88 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r0, 24 movs r6, 0 ldr r1, =0x0202406c mov r8, r1 ldrb r2, [r1] cmp r6, r2 bge @08072B00 ldr r1, =0x02020630 mov r12, r1 movs r1, 0x3 ands r0, r1 lsls r5, r0, 2 movs r7, 0xD negs r7, r7 ldr r2, =0x03005d70 mov r9, r2 @08072AB2: mov r1, r9 adds r0, r6, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 add r1, r12 ldrb r4, [r1, 0x6] ldrh r3, [r1, 0x38] lsls r3, 24 lsrs r3, 24 ldrb r2, [r1, 0x5] adds r0, r7, 0 ands r0, r2 orrs r0, r5 strb r0, [r1, 0x5] lsls r1, r4, 4 adds r1, r4 lsls r1, 2 add r1, r12 ldrb r2, [r1, 0x5] adds r0, r7, 0 ands r0, r2 orrs r0, r5 strb r0, [r1, 0x5] lsls r1, r3, 4 adds r1, r3 lsls r1, 2 add r1, r12 ldrb r2, [r1, 0x5] adds r0, r7, 0 ands r0, r2 orrs r0, r5 strb r0, [r1, 0x5] adds r6, 0x1 mov r2, r8 ldrb r2, [r2] cmp r6, r2 blt @08072AB2 @08072B00: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8072A88 thumb_func_start sub_8072B18 sub_8072B18: ; 8072B18 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 movs r5, 0 movs r4, 0 bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @08072B44 adds r0, r6, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08072B3E movs r5, 0x2C movs r4, 0x1E b @08072B7C @08072B3E: movs r5, 0x9E movs r4, 0x58 b @08072B7C @08072B44: adds r0, r6, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08072B72 cmp r0, 0x1 bgt @08072B5C cmp r0, 0 beq @08072B66 b @08072B7C @08072B5C: cmp r0, 0x2 beq @08072B6C cmp r0, 0x3 beq @08072B78 b @08072B7C @08072B66: movs r5, 0x9F movs r4, 0x4C b @08072B7C @08072B6C: movs r5, 0xAB movs r4, 0x65 b @08072B7C @08072B72: movs r5, 0x2C movs r4, 0x13 b @08072B7C @08072B78: movs r5, 0x20 movs r4, 0x2C @08072B7C: ldr r0, =0x03005d70 adds r0, r6, r0 ldrb r0, [r0] adds r1, r5, 0 adds r2, r4, 0 bl sub_8072A24 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8072B18 thumb_func_start healthbar_draw_level healthbar_draw_level: ; 8072B94 push {r4,r5,lr} sub sp, 0x18 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 lsls r1, 24 lsrs r1, 24 add r2, sp, 0x4 movs r0, 0xF9 strb r0, [r2] movs r0, 0x5 strb r0, [r2, 0x1] mov r0, sp adds r0, 0x6 movs r2, 0 movs r3, 0x3 bl 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, =0x02020630 lsls r1, r4, 4 adds r1, r4 lsls r1, 2 adds r1, r0 ldrh r0, [r1, 0x4] lsls r0, 22 lsrs r4, r0, 17 ldrh r0, [r1, 0x3A] lsls r0, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08072C18 bl battle_type_is_double lsls r0, 24 ldr r2, =0x06010420 adds r1, r4, r2 cmp r0, 0 bne @08072C1C ldr r0, =0x06010820 adds r1, r4, r0 b @08072C1C .align 2, 0 .pool @08072C18: ldr r2, =0x06010400 adds r1, r4, r2 @08072C1C: adds r0, r1, 0 adds r1, r5, 0 movs r2, 0x3 bl sub_8075198 ldr r0, [sp, 0x14] bl sub_807512C add sp, 0x18 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end healthbar_draw_level thumb_func_start heathbar_draw_hp heathbar_draw_hp: ; 8072C38 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x28 lsls r0, 24 lsrs r7, r0, 24 lsls r1, 16 lsrs r1, 16 mov r9, r1 lsls r2, 24 lsrs r2, 24 mov r8, r2 ldr r1, =0x02020630 lsls r0, r7, 4 adds r0, r7 lsls r0, 2 adds r4, r0, r1 ldrh r0, [r4, 0x3A] lsls r0, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08072D10 bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @08072D10 ldrh r0, [r4, 0x4] lsls r0, 22 lsrs r5, r0, 17 mov r0, r8 cmp r0, 0 beq @08072CB8 mov r2, r9 lsls r1, r2, 16 asrs r1, 16 add r0, sp, 0x4 movs r2, 0x1 movs r3, 0x3 bl 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, =0x06010b40 adds r0, r5, r1 adds r1, r4, 0 b @08072CF8 .align 2, 0 .pool @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, =0x060103e0 adds r0, r5, r1 adds r1, r4, 0 movs r2, 0x1 bl sub_8075170 ldr r2, =0x06010b00 adds r0, r5, r2 adds r1, r4, 0 adds r1, 0x20 @08072CF8: movs r2, 0x2 bl sub_8075170 ldr r0, [sp, 0x24] bl sub_807512C b @08072DEA .align 2, 0 .pool @08072D10: ldr r1, =gUnknown_0832C3C4 add r0, sp, 0x4 movs r2, 0x14 bl memcpy ldr r1, =0x02020630 lsls r4, r7, 4 adds r0, r4, r7 lsls r0, 2 adds r6, r0, r1 ldrh r0, [r6, 0x3A] lsls r0, 24 lsrs r5, r0, 24 bl battle_type_is_double lsls r0, 24 lsrs r0, 24 mov r10, r4 cmp r0, 0x1 beq @08072D46 adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08072D60 @08072D46: mov r0, r9 lsls r1, r0, 16 asrs r1, 16 adds r0, r7, 0 mov r2, r8 bl sub_8072E0C b @08072DEA .align 2, 0 .pool @08072D60: ldrh r0, [r6, 0x3A] lsls r0, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08072D7C movs r6, 0x59 mov r1, r8 cmp r1, 0 bne @08072D86 movs r6, 0x1D b @08072D86 @08072D7C: movs r6, 0x30 mov r2, r8 cmp r2, 0 bne @08072D86 movs r6, 0x14 @08072D86: mov r0, sp adds r0, 0xA mov r2, r9 lsls r1, r2, 16 asrs r1, 16 movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r0, =0x020244d4 ldr r0, [r0] movs r1, 0xBA lsls r1, 1 adds r0, r1 ldr r0, [r0] movs r1, 0x9 add r2, sp, 0x4 bl font_render_some movs r4, 0 ldr r1, =0x02020630 mov r2, r10 adds r0, r2, r7 lsls r0, 2 adds r5, r0, r1 @08072DB8: ldr r0, =0x020244d4 ldr r0, [r0] movs r1, 0xBA lsls r1, 1 adds r0, r1 lsls r1, r4, 6 adds r1, 0x20 ldr r0, [r0] adds r0, r1 ldrh r1, [r5, 0x4] lsls r1, 22 lsrs r1, 22 adds r1, r6 adds r1, r4 lsls r1, 5 ldr r2, =0x06010000 adds r1, r2 ldr r2, =0x04000008 bl CpuSet adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x2 bls @08072DB8 @08072DEA: add sp, 0x28 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end heathbar_draw_hp thumb_func_start sub_8072E0C sub_8072E0C: ; 8072E0C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x30 lsls r0, 24 lsrs r0, 24 mov r9, r0 lsls r1, 16 lsrs r4, r1, 16 mov r10, r4 lsls r2, 24 lsrs r2, 24 mov r8, r2 ldr r5, =0x02020630 lsls r0, 4 add r0, r9 lsls r0, 2 adds r7, r0, r5 ldrh r0, [r7, 0x3A] lsls r0, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08072F28 ldr r0, =0x020244d0 ldr r1, [r0] movs r2, 0x3A ldrsh r0, [r7, r2] ldr r1, [r1] lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @08072E5E b @080730B8 @08072E5E: movs r3, 0x38 ldrsh r1, [r7, r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r0, [r0, 0x4] lsls r0, 22 lsrs r5, r0, 17 ldr r0, =0x06010000 adds r6, r5, r0 mov r0, r8 cmp r0, 0 beq @08072EDC lsls r1, r4, 16 asrs r1, 16 add r0, sp, 0x4 movs r2, 0x1 movs r3, 0x3 bl 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, =0x060100c0 adds r0, r5, r1 adds r1, r4, 0 movs r2, 0x2 bl sub_8075170 ldr r0, [sp, 0x28] bl sub_807512C movs r0, 0x74 bl sub_80728A4 ldrh r1, [r7, 0x4] lsls r1, 22 lsrs r1, 17 ldr r2, =0x06010680 adds r1, r2 ldr r2, =0x04000008 bl CpuSet b @080730B8 .align 2, 0 .pool @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, =0x06010060 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 .pool @08072F28: ldr r1, =gUnknown_0832C3D8 add r0, sp, 0x4 movs r2, 0x14 bl memcpy ldrh r0, [r7, 0x3A] lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x2C] ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] ldr r2, [sp, 0x2C] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @08072F52 b @080730B8 @08072F52: movs r6, 0x4 mov r3, r8 negs r0, r3 orrs r0, r3 asrs r0, 31 ands r6, r0 ldrh r0, [r7, 0x38] lsls r0, 24 lsrs r7, r0, 24 mov r0, sp adds r0, 0xA mov r2, r10 lsls r1, r2, 16 asrs r1, 16 movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string mov r3, r8 cmp r3, 0 bne @08072F82 ldr r1, =gUnknown_085E8D3E bl gf_strcpy @08072F82: ldr r0, =0x020244d4 ldr r0, [r0] movs r1, 0xBA lsls r1, 1 adds r0, r1 ldr r0, [r0] movs r1, 0x9 add r2, sp, 0x4 bl 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, =0x020244d4 ldr r0, [r0] movs r2, 0xBA lsls r2, 1 adds r0, r2 subs r1, r4, r6 lsls r1, 6 adds r1, 0x20 ldr r0, [r0] adds r0, r1 ldrh r1, [r5, 0x4] lsls r1, 22 lsrs r1, 22 adds r4, 0x1 adds r1, r4 lsls r1, 5 ldr r3, =0x06010000 adds r1, r3 ldr r2, =0x04000008 bl CpuSet b @0807301A .align 2, 0 .pool @08072FF0: ldr r0, =0x020244d4 ldr r0, [r0] movs r1, 0xBA lsls r1, 1 adds r0, r1 subs r1, r4, r6 lsls r1, 6 adds r1, 0x20 ldr r0, [r0] adds r0, r1 ldrh r1, [r5, 0x4] lsls r1, 22 lsrs r1, 22 adds r1, r4, r1 lsls r1, 5 ldr r2, =0x06010020 adds r1, r2 ldr r2, =0x04000008 bl CpuSet adds r4, 0x1 @0807301A: lsls r0, r4, 24 lsrs r4, r0, 24 adds r0, r6, 0x3 cmp r4, r0 blt @08072FA6 @08073024: mov r3, r8 cmp r3, 0 bne @08073084 ldr r0, =0x020244d4 ldr r0, [r0] movs r1, 0xBA lsls r1, 1 adds r0, r1 ldr r0, [r0] adds r0, 0xE0 ldr r1, =0x02020630 lsls r4, r7, 4 adds r4, r7 lsls r4, 2 adds r4, r1 ldrh r1, [r4, 0x4] lsls r1, 22 lsrs r1, 17 adds r1, 0x80 ldr r5, =0x06010000 adds r1, r5 ldr r2, =0x04000008 bl CpuSet mov r2, r8 str r2, [sp, 0x24] add r0, sp, 0x24 ldrh r1, [r4, 0x4] lsls r1, 22 lsrs r1, 17 adds r1, r5 ldr r2, =0x05000008 bl CpuSet b @080730B8 .align 2, 0 .pool @08073084: ldr r0, [sp, 0x2C] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080730B8 movs r0, 0x74 bl sub_80728A4 ldr r2, =0x02020630 mov r3, r9 lsls r1, r3, 4 add r1, r9 lsls r1, 2 adds r1, r2 ldrh r1, [r1, 0x4] lsls r1, 22 lsrs r1, 17 movs r2, 0xD0 lsls r2, 3 adds r1, r2 ldr r2, =0x06010000 adds r1, r2 ldr r2, =0x04000008 bl CpuSet @080730B8: add sp, 0x30 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8072E0C thumb_func_start sub_80730D4 sub_80730D4: ; 80730D4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x20 adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x14] ldr r1, =gUnknown_0832C3C4 mov r0, sp movs r2, 0x14 bl memcpy ldr r1, =0x02020630 ldr r2, [sp, 0x14] lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x3A] lsls r0, 24 lsrs r0, 24 bl battle_get_per_side_status ldr r1, =0x020244d4 ldr r2, [r1] movs r3, 0xBA lsls r3, 1 adds r2, r3 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 1 adds r1, r0 lsls r1, 7 movs r0, 0xA4 lsls r0, 3 adds r1, r0 ldr r0, [r2] adds r6, r0, r1 movs r1, 0x5 mov r8, r1 adds r0, r4, 0 bl GetNature lsls r0, 24 mov r4, sp adds r4, 0x6 ldr r1, =gNatureNamePointers lsrs r0, 22 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 bl 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 .pool @0807318C: adds r0, r1, 0 subs r0, 0x4B lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bls @080731A4 adds r0, r1, 0 adds r0, 0x65 lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bhi @080731A8 @080731A4: movs r0, 0x2D b @080731AA @080731A8: movs r0, 0x2B @080731AA: bl sub_80728A4 lsls r1, r5, 6 adds r1, r6, r1 ldr r2, =0x04000008 bl CpuSet adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 adds r7, 0x1 cmp r5, r8 bcc @08073158 movs r7, 0x1 ldr r0, [sp, 0x14] lsls r0, 4 str r0, [sp, 0x18] movs r1, 0x1 add r1, r8 mov r9, r1 cmp r7, r9 bge @08073236 ldr r1, =0x02020630 ldr r2, =0x04000008 mov r10, r2 ldr r3, [sp, 0x14] adds r0, r3 lsls r0, 2 adds r0, r1 mov r8, r0 @080731E6: mov r1, r8 ldrh r0, [r1, 0x4] lsls r0, 22 lsrs r0, 22 adds r5, r7, 0 cmp r7, 0 bge @080731F6 adds r5, r7, 0x7 @080731F6: asrs r5, 3 lsls r4, r5, 3 subs r4, r7, r4 adds r0, r4 lsls r5, 6 adds r0, r5 lsls r0, 5 ldr r2, =0x06010000 adds r1, r0, r2 adds r0, r6, 0 mov r2, r10 bl CpuSet adds r6, 0x20 mov r3, r8 ldrh r0, [r3, 0x4] lsls r0, 22 lsrs r0, 22 adds r4, 0x8 adds r0, r4 adds r0, r5 lsls r0, 5 ldr r2, =0x06010000 adds r1, r0, r2 adds r0, r6, 0 mov r2, r10 bl CpuSet adds r6, 0x20 adds r7, 0x1 cmp r7, r9 blt @080731E6 @08073236: ldr r6, =0x02020630 ldr r3, [sp, 0x18] ldr r1, [sp, 0x14] adds r0, r3, r1 lsls r0, 2 adds r0, r6 ldrh r4, [r0, 0x38] lsls r4, 24 lsrs r4, 24 ldr r5, =0x0202449c ldr r0, [r5] adds r0, 0x7C ldrb r1, [r0] mov r0, sp adds r0, 0x6 movs r2, 0x1 movs r3, 0x2 bl 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, =0x020244d4 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, =0x06010000 adds r1, r2 ldr r2, =0x04000008 bl CpuSet b @080732F4 .align 2, 0 .pool @080732D4: ldr r0, [r5] movs r3, 0xBA lsls r3, 1 adds r0, r3 ldr r0, [r0] adds r0, r4 ldrh r1, [r6, 0x4] lsls r1, 22 lsrs r1, 22 adds r1, r7, r1 lsls r1, 5 ldr r2, =0x060100c0 adds r1, r2 ldr r2, =0x04000008 bl CpuSet @080732F4: adds r4, 0x40 adds r7, 0x1 cmp r7, 0x4 ble @08073296 add sp, 0x20 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80730D4 thumb_func_start sub_8073314 sub_8073314: ; 8073314 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 movs r0, 0 mov r9, r0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r9, r0 blt @0807332E b @080735BA @0807332E: ldr r1, =0x02020630 mov r10, r1 ldr r2, =0x0202406e mov r8, r2 @08073336: ldr r0, =0x03005d70 mov r1, r9 adds r6, r1, r0 ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 mov r1, r10 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @08073354 b @080735A8 @08073354: mov r2, r9 lsls r0, r2, 24 lsrs r7, r0, 24 adds r0, r7, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0807336A b @080735A8 @0807336A: bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @08073382 adds r0, r7, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08073382 b @080735A8 @08073382: ldr r5, =0x020244d0 ldr r0, [r5] ldr r3, [r0] mov r0, r9 lsls r4, r0, 2 adds r3, r4, r3 ldr r0, [r3] lsls r0, 27 lsrs r0, 31 movs r2, 0x1 eors r2, r0 lsls r2, 4 mov r12, r2 ldrb r0, [r3] movs r2, 0x11 negs r2, r2 adds r1, r2, 0 ands r0, r1 mov r1, r12 orrs r0, r1 strb r0, [r3] ldr r0, [r5] ldr r0, [r0] adds r4, r0 ldr r0, [r4] lsls r0, 27 lsrs r4, r0, 31 adds r0, r7, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080734B0 bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @080733D0 b @080735A8 @080733D0: ldr r0, =0x02022fec ldr r2, [r0] movs r0, 0x80 ands r2, r0 cmp r2, 0 beq @080733DE b @080735A8 @080733DE: cmp r4, 0x1 bne @08073468 ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r10 ldrh r0, [r0, 0x38] lsls r0, 24 lsrs r1, r0, 24 str r2, [sp] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r10 ldrh r1, [r0, 0x4] lsls r1, 22 lsrs r1, 17 ldr r2, =0x06010000 adds r1, r2 mov r0, sp ldr r2, =0x05000040 bl CpuSet ldrb r4, [r6] mov r1, r8 ldrh r0, [r1] movs r2, 0x64 muls r0, r2 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x39 bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 asrs r1, 16 adds r0, r4, 0 movs r2, 0 bl sub_8072E0C ldrb r4, [r6] mov r2, r8 ldrh r0, [r2] movs r1, 0x64 muls r0, r1 ldr r2, =0x020244ec b @08073536 .align 2, 0 .pool @08073468: ldrb r0, [r6] bl draw_status_ailment_maybe ldrb r0, [r6] mov r2, r8 ldrh r1, [r2] movs r2, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0x5 bl healthbar_draw_field_maybe movs r0, 0x75 bl sub_80728A4 ldrb r2, [r6] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 add r1, r10 ldrh r1, [r1, 0x4] lsls r1, 22 lsrs r1, 17 ldr r2, =0x06010680 adds r1, r2 ldr r2, =0x04000008 bl CpuSet b @08073592 .align 2, 0 .pool @080734B0: cmp r4, 0x1 bne @0807355C ldr r0, =0x02022fec ldr r2, [r0] movs r0, 0x80 ands r2, r0 cmp r2, 0 beq @080734DC ldrb r0, [r6] mov r2, r8 ldrh r1, [r2] movs r2, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 bl sub_80730D4 b @08073592 .align 2, 0 .pool @080734DC: ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r10 ldrh r0, [r0, 0x38] lsls r0, 24 lsrs r1, r0, 24 str r2, [sp] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r10 ldrh r1, [r0, 0x4] lsls r1, 22 lsrs r1, 17 ldr r0, =0x06010000 adds r1, r0 mov r0, sp ldr r2, =0x05000040 bl CpuSet ldrb r4, [r6] mov r1, r8 ldrh r0, [r1] movs r2, 0x64 muls r0, r2 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x39 bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 asrs r1, 16 adds r0, r4, 0 movs r2, 0 bl sub_8072E0C ldrb r4, [r6] mov r2, r8 ldrh r0, [r2] movs r1, 0x64 muls r0, r1 ldr r2, =0x02024744 @08073536: adds r0, r2 movs r1, 0x3A bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 asrs r1, 16 adds r0, r4, 0 movs r2, 0x1 bl sub_8072E0C b @08073592 .align 2, 0 .pool @0807355C: ldrb r0, [r6] bl draw_status_ailment_maybe ldrb r0, [r6] mov r2, r8 ldrh r1, [r2] movs r5, 0x64 muls r1, r5 ldr r4, =0x02024744 adds r1, r4 movs r2, 0x5 bl healthbar_draw_field_maybe ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @08073592 ldrb r0, [r6] mov r2, r8 ldrh r1, [r2] muls r1, r5 adds r1, r4 movs r2, 0x4 bl healthbar_draw_field_maybe @08073592: ldr r0, =0x03005d70 add r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r10 ldrh r1, [r0, 0x3C] movs r2, 0x1 eors r1, r2 strh r1, [r0, 0x3C] @080735A8: movs r0, 0x2 add r8, r0 movs r1, 0x1 add r9, r1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r9, r0 bge @080735BA b @08073336 @080735BA: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8073314 thumb_func_start sub_80735DC sub_80735DC: ; 80735DC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x24 str r1, [sp, 0xC] lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x8] lsls r2, 24 lsrs r2, 24 adds r4, r2, 0 lsls r3, 24 lsrs r3, 24 str r3, [sp, 0x10] cmp r4, 0 beq @0807360C bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 beq @0807365C @0807360C: ldr r0, [sp, 0x8] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08073630 movs r0, 0 mov r9, r0 movs r5, 0x88 movs r4, 0x60 movs r1, 0x64 mov r10, r1 ldr r2, =0x0000fffb mov r8, r2 b @0807366C .align 2, 0 .pool @08073630: movs r3, 0x1 mov r9, r3 cmp r4, 0 beq @08073642 bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @08073648 @08073642: movs r5, 0x68 movs r4, 0x28 b @0807364C @08073648: movs r5, 0x68 movs r4, 0x10 @0807364C: ldr r6, =0x0000ff9c mov r10, r6 movs r0, 0x5 mov r8, r0 b @0807366C .align 2, 0 .pool @0807365C: movs r1, 0x1 mov r9, r1 movs r5, 0x68 movs r4, 0x28 ldr r2, =0x0000ff9c mov r10, r2 movs r3, 0x5 mov r8, r3 @0807366C: ldr r0, =gUnknown_0832C334 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_0832C34C bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_0832C33C bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_0832C344 bl gpu_pal_obj_alloc_tag_and_apply mov r0, r9 lsls r6, r0, 1 adds r0, r6, r0 lsls r0, 3 ldr r1, =gUnknown_0832C364 adds r0, r1 lsls r5, 16 asrs r1, r5, 16 lsls r4, 16 asrs r2, r4, 16 movs r3, 0xA bl 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, =0x02020630 adds r7, r0, r1 ldr r1, =gUnknown_0832C2C4 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 .pool @08073700: ldrh r0, [r7, 0x20] adds r0, 0x60 strh r0, [r7, 0x20] @08073706: movs r0, 0 mov r8, r0 ldr r1, =0x02020630 mov r10, r1 mov r7, sp mov r2, r9 adds r0, r6, r2 lsls r0, 3 str r0, [sp, 0x18] movs r6, 0xA movs r5, 0 @0807371C: ldr r0, =gUnknown_0832C394 ldr r3, [sp, 0x20] ldr r1, =0xfffc0000 adds r2, r3, r1 ldr r3, [sp, 0x18] adds r0, r3, r0 ldr r3, [sp, 0x1C] asrs r1, r3, 16 asrs r2, 16 movs r3, 0x9 bl 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, =0x0202064c adds r1, r2 ldr r0, =sub_80741C8 str r0, [r1] @0807374C: ldr r4, =0x02020630 mov r3, r9 cmp r3, 0 bne @0807376E ldrb r1, [r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r10 strh r3, [r0, 0x24] ldrb r1, [r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r10 mov r1, r9 strh r1, [r0, 0x26] @0807376E: ldrb r1, [r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0 mov r2, sp ldrh r2, [r2, 0x14] strh r2, [r0, 0x2E] mov r3, r9 cmp r3, 0 bne @080737C8 ldrb r0, [r7] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 ldrh r0, [r1, 0x20] adds r0, 0x18 adds r0, r5 strh r0, [r1, 0x20] ldrb r1, [r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r6, [r0, 0x30] ldrb r1, [r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x78 b @0807380A .align 2, 0 .pool @080737C8: ldrb r0, [r7] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r4 ldrh r3, [r2, 0x20] subs r3, 0x18 movs r1, 0x5 mov r0, r8 subs r1, r0 lsls r0, r1, 2 adds r0, r1 lsls r0, 1 subs r3, r0 strh r3, [r2, 0x20] ldrb r0, [r7] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r4 movs r1, 0x6 mov r3, r8 subs r1, r3 lsls r0, r1, 3 subs r0, r1 adds r0, 0xA strh r0, [r2, 0x30] ldrb r1, [r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000ff88 @0807380A: strh r1, [r0, 0x24] ldrb r1, [r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 mov r1, r9 strh r1, [r0, 0x32] adds r7, 0x1 adds r6, 0x7 adds r5, 0xA movs r2, 0x1 add r8, r2 mov r3, r8 cmp r3, 0x5 bgt @0807382C b @0807371C @0807382C: ldr r0, [sp, 0x8] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0807383A b @080739E8 @0807383A: ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0x40 ands r1, r2 cmp r1, 0 beq @080738F4 ldr r5, =0x0000ffff mov r10, r5 ldr r6, =0x02020630 ldr r0, =0x000003ff adds r7, r0, 0 ldr r1, =0xfffffc00 mov r9, r1 mov r4, sp ldr r5, [sp, 0xC] movs r2, 0x5 mov r8, r2 @0807385C: ldrh r0, [r5] cmp r0, r10 bne @080738A8 ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r6 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x1 ands r1, r7 mov r0, r9 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 movs r1, 0x1 strh r1, [r0, 0x3C] b @080738E2 .align 2, 0 .pool @080738A8: cmp r0, 0 bne @080738C0 ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r6 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x3 b @080738D8 @080738C0: ldr r0, [r5, 0x4] cmp r0, 0 beq @080738E2 ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r6 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x2 @080738D8: ands r1, r7 mov r0, r9 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] @080738E2: adds r4, 0x1 adds r5, 0x8 movs r3, 0x1 negs r3, r3 add r8, r3 mov r0, r8 cmp r0, 0 bge @0807385C b @08073B9A @080738F4: movs r1, 0x5 mov r10, r1 movs r7, 0 ldr r2, =0x02020630 mov r8, r2 ldr r3, =0x000003ff mov r9, r3 ldr r5, =0xfffffc00 mov r12, r5 ldr r6, [sp, 0xC] mov r5, sp @0807390A: ldrh r0, [r6] ldr r1, =0x0000ffff cmp r0, r1 bne @08073958 mov r4, sp add r4, r10 ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 add r2, r8 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x1 mov r0, r9 ands r1, r0 mov r0, r12 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r8 movs r1, 0x1 strh r1, [r0, 0x3C] subs r1, 0x2 add r10, r1 b @080739DE .align 2, 0 .pool @08073958: cmp r0, 0 bne @08073970 ldrb r0, [r5] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 add r2, r8 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x3 b @080739D0 @08073970: ldr r1, =0x02022fec ldr r0, [r1] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @080739B8 ldr r0, =0x0202449c ldr r0, [r0] movs r2, 0xA8 lsls r2, 2 adds r0, r2 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 lsls r0, r7, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @080739B8 ldrb r0, [r5] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 add r2, r8 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x3 b @080739D0 .align 2, 0 .pool @080739B8: ldr r0, [r6, 0x4] cmp r0, 0 beq @080739DC ldrb r0, [r5] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 add r2, r8 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x2 @080739D0: mov r0, r9 ands r1, r0 mov r0, r12 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] @080739DC: adds r5, 0x1 @080739DE: adds r6, 0x8 adds r7, 0x1 cmp r7, 0x5 ble @0807390A b @08073B9A @080739E8: ldr r0, =0x02022fec ldr r1, [r0] ldr r2, =0x00008040 ands r1, r2 cmp r1, 0 beq @08073AA4 ldr r1, =0x0000ffff mov r10, r1 ldr r6, =0x02020630 ldr r2, =0x000003ff adds r7, r2, 0 ldr r3, =0xfffffc00 mov r9, r3 ldr r5, [sp, 0xC] mov r4, sp adds r4, 0x5 movs r0, 0x5 mov r8, r0 @08073A0C: ldrh r0, [r5] cmp r0, r10 bne @08073A58 ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r6 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x1 ands r1, r7 mov r0, r9 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 movs r1, 0x1 strh r1, [r0, 0x3C] b @08073A92 .align 2, 0 .pool @08073A58: cmp r0, 0 bne @08073A70 ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r6 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x3 b @08073A88 @08073A70: ldr r0, [r5, 0x4] cmp r0, 0 beq @08073A92 ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r6 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x2 @08073A88: ands r1, r7 mov r0, r9 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] @08073A92: subs r4, 0x1 adds r5, 0x8 movs r1, 0x1 negs r1, r1 add r8, r1 mov r2, r8 cmp r2, 0 bge @08073A0C b @08073B9A @08073AA4: movs r3, 0 mov r8, r3 movs r7, 0 ldr r5, =0x02020630 mov r9, r5 ldr r6, =0x000003ff mov r12, r6 ldr r0, =0xfffffc00 mov r10, r0 ldr r6, [sp, 0xC] mov r5, sp adds r5, 0x5 @08073ABC: ldrh r0, [r6] ldr r1, =0x0000ffff cmp r0, r1 bne @08073B08 mov r4, sp add r4, r8 ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 add r2, r9 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x1 mov r0, r12 ands r1, r0 mov r0, r10 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r9 movs r1, 0x1 strh r1, [r0, 0x3C] add r8, r1 b @08073B92 .align 2, 0 .pool @08073B08: cmp r0, 0 bne @08073B20 ldrb r0, [r5] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 add r2, r9 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x3 b @08073B84 @08073B20: ldr r1, =0x02022fec ldr r0, [r1] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @08073B6C ldr r2, =0x0202449c ldr r0, [r2] ldr r3, =0x000002a1 adds r0, r3 ldrb r1, [r0] lsls r0, r7, 2 ldr r2, =gUnknown_0832A328 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08073B6C ldrb r0, [r5] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 add r2, r9 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x3 b @08073B84 .align 2, 0 .pool @08073B6C: ldr r0, [r6, 0x4] cmp r0, 0 beq @08073B90 ldrb r0, [r5] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 add r2, r9 ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r1, 22 adds r1, 0x2 @08073B84: mov r0, r12 ands r1, r0 mov r0, r10 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] @08073B90: subs r5, 0x1 @08073B92: adds r6, 0x8 adds r7, 0x1 cmp r7, 0x5 ble @08073ABC @08073B9A: ldr r0, =nullsub_4 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r4, r0, 24 ldr r2, =0x03005e00 lsls r3, r4, 2 adds r1, r3, r4 lsls r1, 3 adds r0, r1, r2 mov r5, sp ldrh r5, [r5, 0x8] strh r5, [r0, 0x8] mov r6, sp ldrh r6, [r6, 0x14] strh r6, [r0, 0xA] movs r0, 0 mov r8, r0 adds r0, r2, 0 adds r0, 0xE adds r1, r0 @08073BC6: mov r0, sp add r0, r8 ldrb r0, [r0] strh r0, [r1] adds r1, 0x2 movs r5, 0x1 add r8, r5 mov r6, r8 cmp r6, 0x5 ble @08073BC6 adds r0, r3, r4 lsls r0, 3 adds r0, r2 mov r1, sp ldrh r1, [r1, 0x10] strh r1, [r0, 0x1C] ldr r2, [sp, 0x10] cmp r2, 0 beq @08073C0A ldr r0, =0x020244d0 ldr r0, [r0] ldr r3, [r0, 0x8] ldrb r2, [r3, 0x9] lsls r1, r2, 27 lsrs r1, 29 adds r1, 0x1 movs r0, 0x7 ands r1, r0 lsls r1, 2 movs r0, 0x1D negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3, 0x9] @08073C0A: movs r0, 0x72 movs r1, 0 bl audio_play_and_stuff adds r0, r4, 0 add sp, 0x24 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80735DC thumb_func_start sub_8073C30 sub_8073C30: ; 8073C30 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r2, =0x03005e00 lsls r3, r0, 2 adds r1, r3, r0 lsls r1, 3 adds r0, r1, r2 ldrb r7, [r0, 0x1C] ldrb r4, [r0, 0xA] mov r10, r4 ldrb r0, [r0, 0x8] str r0, [sp, 0x8] movs r5, 0 str r3, [sp, 0xC] adds r2, 0xE adds r2, r1, r2 @08073C5E: mov r0, sp adds r1, r0, r5 ldrh r0, [r2] strb r0, [r1] adds r2, 0x2 adds r5, 0x1 cmp r5, 0x5 ble @08073C5E movs r1, 0xFD lsls r1, 6 movs r0, 0x50 bl lcd_io_set movs r0, 0x52 movs r1, 0x10 bl lcd_io_set ldr r1, =0x03005e00 ldr r0, [sp, 0xC] add r0, r8 lsls r0, 3 adds r0, r1 movs r1, 0x10 strh r1, [r0, 0x26] movs r5, 0 mov r1, r10 lsls r1, 4 str r1, [sp, 0x10] ldr r3, =0x02020630 movs r6, 0xD negs r6, r6 mov r12, r3 movs r4, 0x4 @08073CA0: mov r2, sp adds r0, r2, r5 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r3 ldrb r2, [r1, 0x1] adds r0, r6, 0 ands r0, r2 orrs r0, r4 strb r0, [r1, 0x1] adds r5, 0x1 cmp r5, 0x5 ble @08073CA0 ldr r2, [sp, 0x10] add r2, r10 lsls r2, 2 add r2, r12 ldrb r1, [r2, 0x1] movs r0, 0xD negs r0, r0 ands r0, r1 movs r1, 0x4 orrs r0, r1 strb r0, [r2, 0x1] cmp r7, 0 bne @08073CDA b @08073DE0 @08073CDA: movs r5, 0 mov r6, r12 mov r9, r5 adds r3, r6, 0 adds r3, 0x1C mov r4, sp movs r7, 0 @08073CE8: ldr r0, [sp, 0x8] str r3, [sp, 0x14] bl battle_side_get_owner lsls r0, 24 lsrs r2, r0, 24 ldr r3, [sp, 0x14] cmp r2, 0 beq @08073D4C movs r0, 0x5 subs r0, r5 mov r1, sp adds r2, r1, r0 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r7, [r0, 0x30] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 mov r1, r9 strh r1, [r0, 0x34] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 mov r1, r9 strh r1, [r0, 0x36] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldr r1, =sub_8074158 str r1, [r0] ldr r2, =0x02020630 mov r12, r2 b @08073D82 .align 2, 0 .pool @08073D4C: ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r7, [r0, 0x30] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x34] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x36] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldr r1, =sub_8074158 str r1, [r0] ldr r0, =0x02020630 mov r12, r0 @08073D82: adds r4, 0x1 adds r7, 0x7 adds r5, 0x1 cmp r5, 0x5 ble @08073CE8 ldr r3, [sp, 0x10] add r3, r10 lsls r3, 2 mov r1, r12 adds r0, r3, r1 movs r2, 0x2E ldrsh r1, [r0, r2] lsrs r2, r1, 31 adds r1, r2 asrs r1, 1 movs r2, 0 strh r1, [r0, 0x2E] strh r2, [r0, 0x30] mov r1, r12 adds r1, 0x1C adds r3, r1 ldr r1, =sub_8074090 str r1, [r3] ldr r1, =gUnknown_0832C2CC bl obj_set_f18_to_r0_f42_to_40 ldr r1, =0x03005e00 ldr r0, [sp, 0xC] add r0, r8 lsls r0, 3 adds r0, r1 ldr r1, =task_battle_throw_own_ball str r1, [r0] b @08073DEE .align 2, 0 .pool @08073DE0: ldr r0, =0x03005e00 ldr r1, [sp, 0xC] add r1, r8 lsls r1, 3 adds r1, r0 ldr r0, =sub_8073F98 str r0, [r1] @08073DEE: add sp, 0x18 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8073C30 thumb_func_start task_battle_throw_own_ball task_battle_throw_own_ball: ; 8073E08 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 ldrh r0, [r4, 0x1E] adds r1, r0, 0x1 strh r1, [r4, 0x1E] lsls r0, 16 lsrs r0, 16 movs r1, 0x1 ands r0, r1 cmp r0, 0 bne @08073E48 ldrh r0, [r4, 0x26] subs r1, r0, 0x1 strh r1, [r4, 0x26] lsls r0, r1, 16 cmp r0, 0 blt @08073E54 movs r0, 0x10 subs r0, r1 lsls r0, 8 orrs r1, r0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 bl lcd_io_set @08073E48: movs r1, 0x26 ldrsh r0, [r4, r1] cmp r0, 0 bne @08073E54 ldr r0, =sub_8073E64 str r0, [r4] @08073E54: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_battle_throw_own_ball thumb_func_start sub_8073E64 sub_8073E64: ; 8073E64 push {r4-r7,lr} sub sp, 0x8 lsls r0, 24 lsrs r5, r0, 24 ldr r7, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r3, r0, 3 adds r4, r3, r7 ldrb r2, [r4, 0x8] ldrh r0, [r4, 0x26] subs r0, 0x1 strh r0, [r4, 0x26] lsls r0, 16 asrs r1, r0, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 bne @08073F54 ldrb r5, [r4, 0xA] movs r4, 0 ldr r6, =0x020244d0 adds r0, r7, 0 adds r0, 0xE adds r2, r3, r0 @08073E96: mov r0, sp adds r1, r0, r4 ldrh r0, [r2] strb r0, [r1] adds r2, 0x2 adds r4, 0x1 cmp r4, 0x5 ble @08073E96 ldr r0, [r6] ldr r3, [r0, 0x8] ldrb r2, [r3, 0x9] lsls r1, r2, 27 lsrs r1, 29 subs r1, 0x1 movs r0, 0x7 ands r1, r0 lsls r1, 2 movs r0, 0x1D negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3, 0x9] ldr r0, [r6] ldr r0, [r0, 0x8] ldrb r1, [r0, 0x9] movs r0, 0x1C ands r0, r1 cmp r0, 0 bne @08073EFC lsls r0, r5, 4 adds r0, r5 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl 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 .pool @08073EFC: lsls r4, r5, 4 adds r4, r5 lsls r4, 2 ldr r5, =0x02020630 adds r4, r5 adds r0, r4, 0 bl obj_free_rotscale_entry adds r0, r4, 0 bl 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, =0x02020630 @08073F36: mov r1, sp adds r0, r1, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 bl obj_delete_and_free_tiles adds r4, 0x1 cmp r4, 0x5 ble @08073F36 b @08073F8A .align 2, 0 .pool @08073F54: movs r0, 0x3 negs r0, r0 cmp r1, r0 bne @08073F8A ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1] movs r0, 0x50 movs r1, 0 bl 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 .pool thumb_func_end sub_8073E64 thumb_func_start sub_8073F98 sub_8073F98: ; 8073F98 push {r4-r7,lr} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 adds r4, r0, 0 ldr r7, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r6, r0, 3 adds r3, r6, r7 ldrb r5, [r3, 0x8] ldrh r0, [r3, 0x26] subs r1, r0, 0x1 strh r1, [r3, 0x26] lsls r0, r1, 16 asrs r2, r0, 16 cmp r2, 0 blt @08073FD4 movs r0, 0x10 subs r0, r1 lsls r0, 8 orrs r1, r0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 bl lcd_io_set b @0807406A .align 2, 0 .pool @08073FD4: movs r0, 0x1 negs r0, r0 cmp r2, r0 bne @08074034 ldrb r3, [r3, 0xA] movs r5, 0 adds r0, r7, 0 adds r0, 0xE adds r2, r6, r0 @08073FE6: mov r0, sp adds r1, r0, r5 ldrh r0, [r2] strb r0, [r1] adds r2, 0x2 adds r5, 0x1 cmp r5, 0x5 ble @08073FE6 lsls r0, r3, 4 adds r0, r3 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl 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 .pool @08074034: movs r0, 0x3 negs r0, r0 cmp r2, r0 bne @0807406A ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r5, 1 adds r1, r5 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1] movs r0, 0x50 movs r1, 0 bl 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 .pool thumb_func_end sub_8073F98 thumb_func_start sub_8074078 sub_8074078: ; 8074078 push {lr} adds r1, r0, 0 ldrh r2, [r1, 0x24] movs r3, 0x24 ldrsh r0, [r1, r3] cmp r0, 0 beq @0807408C ldrh r0, [r1, 0x2E] adds r0, r2, r0 strh r0, [r1, 0x24] @0807408C: pop {r0} bx r0 thumb_func_end sub_8074078 thumb_func_start sub_8074090 sub_8074090: ; 8074090 push {lr} adds r2, r0, 0 ldrh r0, [r2, 0x30] adds r1, r0, 0 adds r1, 0x20 strh r1, [r2, 0x30] movs r3, 0x2E ldrsh r0, [r2, r3] cmp r0, 0 ble @080740AE lsls r0, r1, 16 asrs r0, 20 ldrh r1, [r2, 0x24] adds r0, r1 b @080740B6 @080740AE: lsls r1, 16 asrs r1, 20 ldrh r0, [r2, 0x24] subs r0, r1 @080740B6: strh r0, [r2, 0x24] ldrh r1, [r2, 0x30] movs r0, 0xF ands r0, r1 strh r0, [r2, 0x30] pop {r0} bx r0 thumb_func_end sub_8074090 thumb_func_start sub_80740C4 sub_80740C4: ; 80740C4 push {r4,lr} adds r4, r0, 0 ldrh r1, [r4, 0x30] movs r2, 0x30 ldrsh r0, [r4, r2] cmp r0, 0 ble @080740D8 subs r0, r1, 0x1 strh r0, [r4, 0x30] b @0807414E @080740D8: ldrh r0, [r4, 0x32] lsls r0, 24 lsrs r3, r0, 24 ldrh r2, [r4, 0x34] adds r0, r2, 0 adds r0, 0x38 lsls r1, r0, 16 lsrs r2, r1, 16 ldr r0, =0x0000fff0 ands r2, r0 strh r2, [r4, 0x34] cmp r3, 0 beq @0807410C lsrs r0, r1, 20 ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] lsls r0, 16 cmp r0, 0 ble @0807411C movs r0, 0 strh r0, [r4, 0x24] b @0807411C .align 2, 0 .pool @0807410C: lsrs r1, 20 ldrh r0, [r4, 0x24] subs r0, r1 strh r0, [r4, 0x24] lsls r0, 16 cmp r0, 0 bge @0807411C strh r3, [r4, 0x24] @0807411C: movs r2, 0x24 ldrsh r0, [r4, r2] cmp r0, 0 bne @0807414E movs r1, 0x3F cmp r3, 0 beq @0807412C movs r1, 0xC0 @0807412C: movs r2, 0x3C ldrsh r0, [r4, r2] cmp r0, 0 beq @08074140 lsls r1, 24 asrs r1, 24 movs r0, 0x74 bl sub_80A383C b @0807414A @08074140: lsls r1, 24 asrs r1, 24 movs r0, 0x73 bl sub_80A3808 @0807414A: ldr r0, =nullsub_12 str r0, [r4, 0x1C] @0807414E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80740C4 thumb_func_start sub_8074158 sub_8074158: ; 8074158 push {r4,lr} adds r3, r0, 0 ldrh r1, [r3, 0x30] movs r2, 0x30 ldrsh r0, [r3, r2] cmp r0, 0 ble @0807416C subs r0, r1, 0x1 strh r0, [r3, 0x30] b @080741BC @0807416C: ldrh r0, [r3, 0x32] lsls r0, 24 ldrh r2, [r3, 0x34] adds r1, r2, 0 adds r1, 0x38 lsls r4, r1, 16 lsrs r2, r4, 16 ldr r1, =0x0000fff0 ands r2, r1 strh r2, [r3, 0x34] cmp r0, 0 beq @08074190 lsrs r0, r4, 20 ldrh r1, [r3, 0x24] adds r0, r1 b @08074196 .align 2, 0 .pool @08074190: lsrs r1, r4, 20 ldrh r0, [r3, 0x24] subs r0, r1 @08074196: strh r0, [r3, 0x24] movs r2, 0x24 ldrsh r0, [r3, r2] movs r2, 0x20 ldrsh r1, [r3, r2] adds r0, r1 adds r0, 0x8 movs r1, 0x80 lsls r1, 1 cmp r0, r1 bls @080741BC adds r2, r3, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] ldr r0, =nullsub_12 str r0, [r3, 0x1C] @080741BC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8074158 thumb_func_start sub_80741C8 sub_80741C8: ; 80741C8 ldrh r2, [r0, 0x2E] lsls r2, 24 lsrs r2, 24 ldr r3, =0x02020630 lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r3 ldrh r2, [r1, 0x24] strh r2, [r0, 0x24] ldrh r1, [r1, 0x26] strh r1, [r0, 0x26] bx lr .align 2, 0 .pool thumb_func_end sub_80741C8 thumb_func_start sub_80741E8 sub_80741E8: ; 80741E8 push {r4-r7,lr} sub sp, 0x14 adds r4, r1, 0 lsls r0, 24 lsrs r7, r0, 24 ldr r5, =0x02022e2c ldr r1, =gUnknown_085ED228 adds r0, r5, 0 bl 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, =gSpeciesNames 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, =gUnknown_085ED238 b @08074272 .align 2, 0 .pool @08074268: ldr r1, =gUnknown_085ED22E b @08074272 .align 2, 0 .pool @08074270: ldr r1, =gUnknown_085ED233 @08074272: adds r0, r5, 0 bl gf_strcpy ldr r0, =0x02022e2c add r1, sp, 0x10 str r1, [sp] movs r1, 0 movs r2, 0x3 movs r3, 0x2 bl write_to_rbox adds r6, r0, 0 ldr r0, =0x02020630 lsls r1, r7, 4 adds r1, r7 lsls r1, 2 adds r1, r0 ldrh r0, [r1, 0x4] lsls r0, 22 lsrs r4, r0, 17 ldrh r0, [r1, 0x3A] lsls r0, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080742F0 ldr r1, =0x06010040 adds r0, r4, r1 adds r1, r6, 0 movs r2, 0x6 bl sub_8075198 bl battle_type_is_double lsls r0, 24 ldr r1, =0x06010400 adds r5, r4, r1 cmp r0, 0 bne @080742C8 ldr r0, =0x06010800 adds r5, r4, r0 @080742C8: adds r1, r6, 0 adds r1, 0xC0 adds r0, r5, 0 movs r2, 0x1 bl sub_8075198 b @080742FC .align 2, 0 .pool @080742F0: ldr r1, =0x06010020 adds r0, r4, r1 adds r1, r6, 0 movs r2, 0x7 bl sub_8075198 @080742FC: ldr r0, [sp, 0x10] bl sub_807512C add sp, 0x14 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80741E8 thumb_func_start sub_8074310 sub_8074310: ; 8074310 push {r4-r7,lr} sub sp, 0x4 lsls r0, 24 lsrs r2, r0, 24 lsls r1, 24 lsrs r7, r1, 24 ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 2 ands r0, r1 cmp r0, 0 bne @080743E6 movs r0, 0x8 ands r1, r0 cmp r1, 0 bne @080743E6 ldr r6, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r5, r0, r6 ldrh r0, [r5, 0x3A] lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080743E6 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x1 bl pokedex_flag_operation lsls r0, 24 cmp r0, 0 beq @080743E6 ldrh r0, [r5, 0x38] lsls r0, 24 lsrs r4, r0, 24 cmp r7, 0 beq @080743C4 movs r0, 0x46 bl sub_80728A4 lsls r1, r4, 4 adds r1, r4 lsls r1, 2 adds r1, r6 ldrh r1, [r1, 0x4] lsls r1, 22 lsrs r1, 17 movs r2, 0x80 lsls r2, 1 adds r1, r2 ldr r2, =0x06010000 adds r1, r2 ldr r2, =0x04000008 bl CpuSet b @080743E6 .align 2, 0 .pool @080743C4: str r7, [sp] lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r0, r6 ldrh r1, [r0, 0x4] lsls r1, 22 lsrs r1, 17 movs r0, 0x80 lsls r0, 1 adds r1, r0 ldr r0, =0x06010000 adds r1, r0 ldr r2, =0x05000008 mov r0, sp bl CpuSet @080743E6: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8074310 thumb_func_start draw_status_ailment_maybe draw_status_ailment_maybe: ; 80743F8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 mov r9, r0 ldr r0, =0x02020630 mov r2, r9 lsls r1, r2, 4 add r1, r9 lsls r1, 2 adds r1, r0 ldrh r0, [r1, 0x3A] lsls r0, 24 lsrs r7, r0, 24 ldrh r0, [r1, 0x38] lsls r0, 24 lsrs r0, 24 mov r10, r0 adds r0, r7, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08074468 ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x37 bl pokemon_getattr adds r4, r0, 0 bl battle_type_is_double lsls r0, 24 movs r3, 0x12 mov r8, r3 cmp r0, 0 bne @08074484 movs r0, 0x1A mov r8, r0 b @08074484 .align 2, 0 .pool @08074468: ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x37 bl pokemon_getattr adds r4, r0, 0 movs r1, 0x11 mov r8, r1 @08074484: movs r0, 0x7 ands r0, r4 cmp r0, 0 beq @080744AC movs r0, 0x1B adds r1, r7, 0 bl sub_80746A8 lsls r0, 24 lsrs r0, 24 bl sub_80728A4 adds r6, r0, 0 movs r0, 0x2 b @080745B8 .align 2, 0 .pool @080744AC: movs r0, 0x88 ands r0, r4 cmp r0, 0 beq @080744CA movs r0, 0x15 adds r1, r7, 0 bl sub_80746A8 lsls r0, 24 lsrs r0, 24 bl sub_80728A4 adds r6, r0, 0 movs r0, 0 b @080745B8 @080744CA: movs r0, 0x10 ands r0, r4 cmp r0, 0 beq @080744E8 movs r0, 0x21 adds r1, r7, 0 bl sub_80746A8 lsls r0, 24 lsrs r0, 24 bl sub_80728A4 adds r6, r0, 0 movs r0, 0x4 b @080745B8 @080744E8: movs r0, 0x20 ands r0, r4 cmp r0, 0 beq @08074506 movs r0, 0x1E adds r1, r7, 0 bl sub_80746A8 lsls r0, 24 lsrs r0, 24 bl sub_80728A4 adds r6, r0, 0 movs r0, 0x3 b @080745B8 @08074506: movs r0, 0x40 ands r0, r4 cmp r0, 0 beq @08074524 movs r0, 0x18 adds r1, r7, 0 bl sub_80746A8 lsls r0, 24 lsrs r0, 24 bl sub_80728A4 adds r6, r0, 0 movs r0, 0x1 b @080745B8 @08074524: movs r0, 0x27 bl sub_80728A4 adds r6, r0, 0 movs r4, 0 mov r2, r9 lsls r0, r2, 4 mov r3, r8 lsls r3, 16 mov r8, r3 lsls r7, 2 ldr r1, =0x02020630 add r0, r9 lsls r0, 2 adds r5, r0, r1 @08074542: ldrh r1, [r5, 0x4] lsls r1, 22 lsrs r1, 22 mov r2, r8 asrs r0, r2, 16 adds r1, r0 adds r1, r4 lsls r1, 5 ldr r3, =0x06010000 adds r1, r3 adds r0, r6, 0 ldr r2, =0x04000008 bl CpuSet adds r4, 0x1 cmp r4, 0x2 ble @08074542 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] adds r0, r7, r0 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @08074598 movs r0, 0x1 bl sub_80728A4 ldr r2, =0x02020630 mov r3, r10 lsls r1, r3, 4 add r1, r10 lsls r1, 2 adds r1, r2 ldrh r1, [r1, 0x4] lsls r1, 22 lsrs r1, 17 ldr r2, =0x06010000 adds r1, r2 ldr r2, =0x04000010 bl CpuSet @08074598: mov r0, r9 movs r1, 0x1 bl sub_8074310 b @0807467A .align 2, 0 .pool @080745B8: mov r1, r9 lsls r5, r1, 4 add r5, r9 lsls r5, 2 ldr r2, =0x02020630 adds r5, r2 ldrb r4, [r5, 0x5] lsrs r4, 4 lsls r4, 4 adds r4, 0xC adds r4, r7 ldr r1, =gUnknown_0832C3EC lsls r0, 1 adds r0, r1 ldrh r0, [r0] movs r3, 0x80 lsls r3, 1 adds r1, r4, r3 movs r2, 0x2 bl rboxid_80040B8 lsls r4, 1 ldr r0, =0x02037914 adds r0, r4, r0 ldr r1, =0x05000200 adds r4, r1 adds r1, r4, 0 movs r2, 0x1 bl CpuSet ldrh r1, [r5, 0x4] lsls r1, 22 lsrs r1, 22 add r1, r8 lsls r1, 5 ldr r2, =0x06010000 mov r8, r2 add r1, r8 ldr r2, =0x04000018 adds r0, r6, 0 bl CpuSet bl battle_type_is_double lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08074626 adds r0, r7, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08074672 @08074626: ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r7, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @08074672 movs r0, 0 bl sub_80728A4 mov r3, r10 lsls r4, r3, 4 add r4, r10 lsls r4, 2 ldr r1, =0x02020630 adds r4, r1 ldrh r1, [r4, 0x4] lsls r1, 22 lsrs r1, 17 add r1, r8 ldr r5, =0x04000008 adds r2, r5, 0 bl CpuSet movs r0, 0x41 bl sub_80728A4 ldrh r1, [r4, 0x4] lsls r1, 22 lsrs r1, 17 adds r1, 0x20 add r1, r8 adds r2, r5, 0 bl CpuSet @08074672: mov r0, r9 movs r1, 0 bl sub_8074310 @0807467A: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end draw_status_ailment_maybe thumb_func_start sub_80746A8 sub_80746A8: ; 80746A8 push {lr} lsls r0, 24 lsls r1, 24 lsrs r3, r1, 24 lsrs r2, r0, 24 adds r0, r2, 0 subs r0, 0x15 cmp r0, 0xC bhi @08074768 lsls r0, 2 ldr r1, =@080746C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080746C8: .4byte @080746FC .4byte @08074768 .4byte @08074768 .4byte @08074712 .4byte @08074768 .4byte @08074768 .4byte @08074728 .4byte @08074768 .4byte @08074768 .4byte @0807473E .4byte @08074768 .4byte @08074768 .4byte @08074754 @080746FC: movs r2, 0x15 cmp r3, 0 beq @08074768 movs r2, 0x47 cmp r3, 0x1 beq @08074768 movs r2, 0x65 cmp r3, 0x2 bne @08074768 movs r2, 0x56 b @08074768 @08074712: movs r2, 0x18 cmp r3, 0 beq @08074768 movs r2, 0x4A cmp r3, 0x1 beq @08074768 movs r2, 0x68 cmp r3, 0x2 bne @08074768 movs r2, 0x59 b @08074768 @08074728: movs r2, 0x1B cmp r3, 0 beq @08074768 movs r2, 0x4D cmp r3, 0x1 beq @08074768 movs r2, 0x6B cmp r3, 0x2 bne @08074768 movs r2, 0x5C b @08074768 @0807473E: movs r2, 0x1E cmp r3, 0 beq @08074768 movs r2, 0x50 cmp r3, 0x1 beq @08074768 movs r2, 0x6E cmp r3, 0x2 bne @08074768 movs r2, 0x5F b @08074768 @08074754: movs r2, 0x21 cmp r3, 0 beq @08074768 movs r2, 0x53 cmp r3, 0x1 beq @08074768 movs r2, 0x71 cmp r3, 0x2 bne @08074768 movs r2, 0x62 @08074768: adds r0, r2, 0 pop {r1} bx r1 thumb_func_end sub_80746A8 thumb_func_start sub_8074770 sub_8074770: ; 8074770 push {r4,r5,lr} sub sp, 0x8 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =gUnknown_085CCB2C add r1, sp, 0x4 str r1, [sp] movs r1, 0 movs r2, 0x3 movs r3, 0x2 bl write_to_rbox adds r5, r0, 0 ldr r1, =0x02020630 lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r0, r1 ldrh r4, [r0, 0x4] lsls r4, 22 lsrs r4, 17 ldr r1, =0x06010040 adds r0, r4, r1 adds r1, r5, 0 movs r2, 0x6 bl sub_8075198 ldr r0, =0x06010800 adds r4, r0 adds r5, 0xC0 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x2 bl sub_8075198 ldr r0, [sp, 0x4] bl sub_807512C add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8074770 thumb_func_start sub_80747D8 sub_80747D8: ; 80747D8 push {r4,r5,lr} sub sp, 0x18 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r1, =gUnknown_085CCB3C add r0, sp, 0x4 bl gf_strcpy ldr r1, =0x0203a04c 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, =0x02020630 lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r0, r1 ldrh r4, [r0, 0x4] lsls r4, 22 lsrs r4, 17 ldr r1, =0x060102c0 adds r0, r4, r1 adds r1, r5, 0 movs r2, 0x2 bl sub_80751E4 ldr r0, =0x06010a00 adds r4, r0 adds r5, 0x40 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x4 bl sub_80751E4 ldr r0, [sp, 0x14] bl sub_807512C add sp, 0x18 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80747D8 thumb_func_start healthbar_draw_field_maybe healthbar_draw_field_maybe: ; 8074860 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 mov r8, r1 lsls r0, 24 lsrs r6, r0, 24 lsls r2, 24 lsrs r7, r2, 24 ldr r1, =0x02020630 lsls r0, r6, 4 adds r0, r6 lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x3A] lsls r0, 24 lsrs r0, 24 mov r9, r0 cmp r7, 0 bne @0807489C bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @0807489C mov r0, r9 bl battle_side_get_owner @0807489C: ldr r1, =0x02020630 lsls r0, r6, 4 adds r0, r6 lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x3A] lsls r0, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080748B8 b @08074A18 @080748B8: cmp r7, 0x3 beq @080748C0 cmp r7, 0 bne @080748D4 @080748C0: mov r0, r8 movs r1, 0x38 bl pokemon_getattr adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 bl healthbar_draw_level @080748D4: cmp r7, 0x1 bhi @080748EE mov r0, r8 movs r1, 0x39 bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 asrs r1, 16 adds r0, r6, 0 movs r2, 0 bl heathbar_draw_hp @080748EE: cmp r7, 0x2 beq @080748F6 cmp r7, 0 bne @0807490C @080748F6: mov r0, r8 movs r1, 0x3A bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 asrs r1, 16 adds r0, r6, 0 movs r2, 0x1 bl heathbar_draw_hp @0807490C: cmp r7, 0x5 beq @08074914 cmp r7, 0 bne @08074948 @08074914: movs r0, 0 bl load_gfxc_health_bar mov r0, r8 movs r1, 0x3A bl pokemon_getattr adds r4, r0, 0 mov r0, r8 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 movs r0, 0 str r0, [sp] mov r0, r9 adds r1, r6, 0 adds r2, r4, 0 bl sub_807294C mov r0, r9 adds r1, r6, 0 movs r2, 0 movs r3, 0 bl sub_8074AA0 @08074948: bl battle_type_is_double lsls r0, 24 lsrs r0, 24 mov r10, r0 cmp r0, 0 bne @080749CE cmp r7, 0x6 beq @0807495E cmp r7, 0 bne @080749CE @0807495E: movs r0, 0x3 bl load_gfxc_health_bar mov r0, r8 movs r1, 0xB bl pokemon_getattr adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 mov r0, r8 movs r1, 0x38 bl pokemon_getattr adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 mov r0, r8 movs r1, 0x19 bl pokemon_getattr adds r3, r0, 0 ldr r0, =gExperienceTables mov r12, r0 lsls r1, r4, 2 ldr r2, =gBaseStats lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r2 ldrb r2, [r0, 0x13] movs r0, 0xCA lsls r0, 1 muls r0, r2 adds r1, r0 add r1, r12 ldr r1, [r1] subs r3, r1 adds r4, 0x1 lsls r4, 2 adds r4, r0 add r4, r12 ldr r2, [r4] subs r2, r1 mov r0, r10 str r0, [sp] mov r0, r9 adds r1, r6, 0 bl sub_807294C mov r0, r9 adds r1, r6, 0 movs r2, 0x1 movs r3, 0 bl sub_8074AA0 @080749CE: cmp r7, 0x4 beq @080749D6 cmp r7, 0 bne @080749DE @080749D6: adds r0, r6, 0 mov r1, r8 bl sub_80741E8 @080749DE: cmp r7, 0x9 beq @080749E6 cmp r7, 0 bne @080749EC @080749E6: adds r0, r6, 0 bl draw_status_ailment_maybe @080749EC: cmp r7, 0xA bne @080749F6 adds r0, r6, 0 bl sub_8074770 @080749F6: adds r0, r7, 0 subs r0, 0xA lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @08074A8E adds r0, r6, 0 bl sub_80747D8 b @08074A8E .align 2, 0 .pool @08074A18: cmp r7, 0x3 beq @08074A20 cmp r7, 0 bne @08074A34 @08074A20: mov r0, r8 movs r1, 0x38 bl pokemon_getattr adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 bl healthbar_draw_level @08074A34: cmp r7, 0x5 beq @08074A3C cmp r7, 0 bne @08074A70 @08074A3C: movs r0, 0 bl load_gfxc_health_bar mov r0, r8 movs r1, 0x3A bl pokemon_getattr adds r4, r0, 0 mov r0, r8 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 movs r0, 0 str r0, [sp] mov r0, r9 adds r1, r6, 0 adds r2, r4, 0 bl sub_807294C mov r0, r9 adds r1, r6, 0 movs r2, 0 movs r3, 0 bl sub_8074AA0 @08074A70: cmp r7, 0x4 beq @08074A78 cmp r7, 0 bne @08074A80 @08074A78: adds r0, r6, 0 mov r1, r8 bl sub_80741E8 @08074A80: cmp r7, 0x9 beq @08074A88 cmp r7, 0 bne @08074A8E @08074A88: adds r0, r6, 0 bl draw_status_ailment_maybe @08074A8E: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end healthbar_draw_field_maybe thumb_func_start sub_8074AA0 sub_8074AA0: ; 8074AA0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r2, 24 lsrs r2, 24 mov r9, r2 cmp r2, 0 bne @08074AEC ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0xC] mov r1, r8 lsls r5, r1, 2 adds r3, r5, r1 lsls r3, 2 adds r3, r0 ldr r0, [r3, 0x4] ldr r1, [r3, 0x8] ldr r2, [r3, 0xC] adds r3, 0x10 movs r4, 0x6 str r4, [sp] movs r4, 0x1 str r4, [sp, 0x4] bl sub_8074DB8 adds r4, r0, 0 adds r7, r5, 0 b @08074B48 .align 2, 0 .pool @08074AEC: ldr r2, =0x020244d0 mov r10, r2 ldr r0, [r2] ldr r2, [r0, 0xC] mov r0, r8 lsls r4, r0, 2 adds r0, r4, r0 lsls r6, r0, 2 adds r2, r6, r2 ldr r0, [r2, 0x8] ldr r1, [r2, 0xC] ldr r2, [r2, 0x4] movs r3, 0x8 bl sub_8074FE8 lsls r0, 24 lsrs r5, r0, 24 adds r7, r4, 0 cmp r5, 0 bne @08074B16 movs r5, 0x1 @08074B16: mov r1, r10 ldr r0, [r1] ldr r0, [r0, 0xC] adds r4, r6, r0 ldr r6, [r4, 0xC] adds r0, r6, 0 adds r1, r5, 0 bl __divsi3 cmp r0, 0 bge @08074B2E negs r0, r0 @08074B2E: lsls r0, 16 lsrs r5, r0, 16 ldr r0, [r4, 0x4] ldr r1, [r4, 0x8] adds r3, r4, 0 adds r3, 0x10 movs r2, 0x8 str r2, [sp] str r5, [sp, 0x4] adds r2, r6, 0 bl sub_8074DB8 adds r4, r0, 0 @08074B48: mov r2, r9 cmp r2, 0x1 beq @08074B64 cmp r2, 0 bne @08074B6C ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] adds r0, r7, r0 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @08074B6C @08074B64: mov r0, r8 mov r1, r9 bl sub_8074B9C @08074B6C: movs r0, 0x1 negs r0, r0 cmp r4, r0 bne @08074B86 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0xC] mov r2, r8 adds r0, r7, r2 lsls r0, 2 adds r0, r1 movs r1, 0 str r1, [r0, 0x10] @08074B86: adds r0, r4, 0 add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8074AA0 thumb_func_start sub_8074B9C sub_8074B9C: ; 8074B9C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x10 lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r1, 24 cmp r1, 0 beq @08074BB8 cmp r1, 0x1 beq @08074CA0 b @08074D9E @08074BB8: ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0xC] lsls r5, r6, 2 adds r3, r5, r6 lsls r3, 2 adds r3, r0 ldr r0, [r3, 0x4] ldr r1, [r3, 0x8] ldr r2, [r3, 0xC] adds r3, 0x10 add r4, sp, 0x8 str r4, [sp] movs r4, 0x6 str r4, [sp, 0x4] bl sub_8074E8C lsls r0, 24 lsrs r0, 24 movs r1, 0x3 mov r9, r1 adds r7, r5, 0 cmp r0, 0x18 bhi @08074BF4 movs r2, 0x38 mov r9, r2 cmp r0, 0x9 bls @08074BF4 movs r4, 0x2F mov r9, r4 @08074BF4: movs r5, 0 ldr r0, =0x02020630 mov r8, r0 @08074BFA: ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0xC] adds r0, r7, r6 lsls r0, 2 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r8 ldrh r0, [r0, 0x38] lsls r0, 24 lsrs r4, r0, 24 cmp r5, 0x1 bhi @08074C5C mov r0, r9 bl sub_80728A4 mov r1, sp adds r1, r5 adds r1, 0x8 ldrb r1, [r1] lsls r1, 5 adds r0, r1 lsls r1, r4, 4 adds r1, r4 lsls r1, 2 add r1, r8 ldrh r1, [r1, 0x4] lsls r1, 22 lsrs r1, 22 adds r2, r5, 0x2 adds r1, r2 lsls r1, 5 ldr r2, =0x06010000 adds r1, r2 ldr r2, =0x04000008 bl CpuSet b @08074C8A .align 2, 0 .pool @08074C5C: mov r0, r9 bl sub_80728A4 mov r1, sp adds r1, r5 adds r1, 0x8 ldrb r1, [r1] lsls r1, 5 adds r0, r1 lsls r1, r4, 4 adds r1, r4 lsls r1, 2 add r1, r8 ldrh r1, [r1, 0x4] lsls r1, 22 lsrs r1, 22 adds r1, r5, r1 lsls r1, 5 ldr r4, =0x06010040 adds r1, r4 ldr r2, =0x04000008 bl CpuSet @08074C8A: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x5 bls @08074BFA b @08074D9E .align 2, 0 .pool @08074CA0: ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0xC] lsls r5, r6, 2 adds r3, r5, r6 lsls r3, 2 adds r3, r0 ldr r0, [r3, 0x4] ldr r1, [r3, 0x8] ldr r2, [r3, 0xC] adds r3, 0x10 add r4, sp, 0x8 str r4, [sp] movs r4, 0x8 str r4, [sp, 0x4] bl sub_8074E8C ldr r1, =0x0202406e lsls r0, r6, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 bl pokemon_getattr lsls r0, 24 lsrs r0, 24 adds r7, r5, 0 cmp r0, 0x64 bne @08074CF8 movs r5, 0 movs r1, 0 @08074CE6: mov r0, sp adds r0, r5 adds r0, 0x8 strb r1, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x7 bls @08074CE6 @08074CF8: movs r5, 0 ldr r0, =0x02020630 mov r8, r0 adds r0, r7, r6 lsls r4, r0, 2 @08074D02: cmp r5, 0x3 bhi @08074D5C movs r0, 0xC bl sub_80728A4 mov r1, sp adds r1, r5 adds r1, 0x8 ldrb r1, [r1] lsls r1, 5 adds r0, r1 ldr r1, =0x020244d0 ldr r1, [r1] ldr r1, [r1, 0xC] adds r1, r4, r1 ldrb r2, [r1] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 add r1, r8 ldrh r1, [r1, 0x4] lsls r1, 22 lsrs r1, 22 adds r2, r5, 0 adds r2, 0x24 adds r1, r2 lsls r1, 5 ldr r2, =0x06010000 adds r1, r2 ldr r2, =0x04000008 bl CpuSet b @08074D94 .align 2, 0 .pool @08074D5C: movs r0, 0xC bl sub_80728A4 mov r1, sp adds r1, r5 adds r1, 0x8 ldrb r1, [r1] lsls r1, 5 adds r0, r1 ldr r1, =0x020244d0 ldr r1, [r1] ldr r1, [r1, 0xC] adds r1, r4, r1 ldrb r2, [r1] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 add r1, r8 ldrh r1, [r1, 0x4] lsls r1, 22 lsrs r1, 22 adds r1, r5, r1 lsls r1, 5 ldr r2, =0x06010b80 adds r1, r2 ldr r2, =0x04000008 bl CpuSet @08074D94: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x7 bls @08074D02 @08074D9E: add sp, 0x10 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8074B9C thumb_func_start sub_8074DB8 sub_8074DB8: ; 8074DB8 push {r4-r7,lr} mov r7, r8 push {r7} adds r7, r0, 0 adds r4, r1, 0 mov r8, r2 adds r5, r3, 0 ldr r1, [sp, 0x18] ldr r0, [sp, 0x1C] lsls r0, 16 lsrs r3, r0, 16 lsls r1, 27 lsrs r2, r1, 24 ldr r1, [r5] ldr r0, =0xffff8000 cmp r1, r0 bne @08074DEA cmp r7, r2 bge @08074DE8 lsls r0, r4, 8 str r0, [r5] b @08074DEA .align 2, 0 .pool @08074DE8: str r4, [r5] @08074DEA: mov r0, r8 subs r4, r0 cmp r4, 0 bge @08074DF6 movs r4, 0 b @08074DFC @08074DF6: cmp r4, r7 ble @08074DFC adds r4, r7, 0 @08074DFC: cmp r7, r2 bge @08074E18 ldr r0, [r5] asrs r1, r0, 8 adds r6, r0, 0 cmp r4, r1 bne @08074E24 movs r0, 0xFF ands r0, r6 cmp r0, 0 bne @08074E24 movs r0, 0x1 negs r0, r0 b @08074E80 @08074E18: ldr r6, [r5] cmp r4, r6 bne @08074E24 movs r0, 0x1 negs r0, r0 b @08074E80 @08074E24: cmp r7, r2 bge @08074E5E lsls r0, r7, 8 adds r1, r2, 0 bl __divsi3 mov r1, r8 cmp r1, 0 bge @08074E42 adds r0, r6, r0 str r0, [r5] asrs r2, r0, 8 cmp r2, r4 blt @08074E7E b @08074E56 @08074E42: subs r0, r6, r0 str r0, [r5] asrs r2, r0, 8 movs r1, 0xFF ands r0, r1 cmp r0, 0 ble @08074E52 adds r2, 0x1 @08074E52: cmp r2, r4 bgt @08074E7E @08074E56: lsls r0, r4, 8 str r0, [r5] adds r2, r4, 0 b @08074E7E @08074E5E: mov r0, r8 cmp r0, 0 bge @08074E70 ldr r0, [r5] adds r0, r3 str r0, [r5] cmp r0, r4 ble @08074E7C b @08074E7A @08074E70: ldr r0, [r5] subs r0, r3 str r0, [r5] cmp r0, r4 bge @08074E7C @08074E7A: str r4, [r5] @08074E7C: ldr r2, [r5] @08074E7E: adds r0, r2, 0 @08074E80: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8074DB8 thumb_func_start sub_8074E8C sub_8074E8C: ; 8074E8C push {r4-r7,lr} adds r4, r0, 0 mov r12, r3 ldr r7, [sp, 0x14] ldr r0, [sp, 0x18] lsls r0, 24 lsrs r6, r0, 24 subs r5, r1, r2 cmp r5, 0 bge @08074EA4 movs r5, 0 b @08074EAA @08074EA4: cmp r5, r4 ble @08074EAA adds r5, r4, 0 @08074EAA: lsls r0, r6, 27 lsrs r3, r0, 24 movs r1, 0 cmp r1, r6 bcs @08074EC4 movs r2, 0 @08074EB6: adds r0, r7, r1 strb r2, [r0] adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, r6 bcc @08074EB6 @08074EC4: cmp r4, r3 bge @08074ED8 mov r1, r12 ldr r0, [r1] muls r0, r3 adds r1, r4, 0 bl __divsi3 asrs r0, 8 b @08074EE4 @08074ED8: mov r1, r12 ldr r0, [r1] muls r0, r3 adds r1, r4, 0 bl __divsi3 @08074EE4: lsls r0, 24 lsrs r2, r0, 24 adds r3, r2, 0 cmp r3, 0 bne @08074EFA cmp r5, 0 ble @08074EFA movs r0, 0x1 strb r0, [r7] movs r3, 0x1 b @08074F1E @08074EFA: movs r1, 0 movs r4, 0x8 @08074EFE: cmp r1, r6 bcs @08074F1E cmp r2, 0x7 bls @08074F1A adds r0, r7, r1 strb r4, [r0] adds r0, r2, 0 subs r0, 0x8 lsls r0, 24 lsrs r2, r0, 24 adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 b @08074EFE @08074F1A: adds r0, r7, r1 strb r2, [r0] @08074F1E: adds r0, r3, 0 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8074E8C thumb_func_start sub_8074F28 sub_8074F28: ; 8074F28 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x8 adds r5, r0, 0 adds r6, r1, 0 adds r4, r2, 0 mov r8, r3 ldr r0, [r5] ldr r1, [r5, 0x4] ldr r2, [r5, 0x8] movs r3, 0x6 str r3, [sp] movs r3, 0x1 str r3, [sp, 0x4] adds r3, r6, 0 bl sub_8074DB8 lsls r0, 16 lsrs r7, r0, 16 adds r0, r5, 0 adds r1, r6, 0 adds r2, r4, 0 bl sub_8074F88 ldr r0, [r5] cmp r0, 0x2F bgt @08074F68 ldr r0, [r6] lsls r0, 8 lsrs r1, r0, 16 b @08074F6A @08074F68: ldrh r1, [r6] @08074F6A: movs r2, 0 ldrsh r0, [r5, r2] lsls r1, 16 asrs r1, 16 mov r2, r8 bl sub_8072304 lsls r0, r7, 16 asrs r0, 16 add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8074F28 thumb_func_start sub_8074F88 sub_8074F88: ; 8074F88 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x1C adds r5, r0, 0 adds r3, r1, 0 mov r8, r2 ldr r0, [r5] ldr r1, [r5, 0x4] ldr r2, [r5, 0x8] add r4, sp, 0x8 str r4, [sp] movs r4, 0x6 str r4, [sp, 0x4] bl sub_8074E8C movs r3, 0 add r7, sp, 0x10 mov r12, r7 ldrb r0, [r5, 0xC] lsls r6, r0, 27 ldr r4, [r5, 0x10] @08074FB4: lsls r2, r3, 1 add r2, r12 lsrs r1, r6, 15 mov r0, sp adds r0, r3 adds r0, 0x8 ldrb r0, [r0] adds r0, r4, r0 orrs r1, r0 strh r1, [r2] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x5 bls @08074FB4 adds r0, r7, 0 mov r1, r8 movs r2, 0x6 bl CpuSet add sp, 0x1C pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8074F88 thumb_func_start sub_8074FE8 sub_8074FE8: ; 8074FE8 push {r4-r7,lr} adds r6, r2, 0 lsls r3, 27 lsrs r7, r3, 24 subs r5, r0, r1 cmp r5, 0 bge @08074FFA movs r5, 0 b @08075000 @08074FFA: cmp r5, r6 ble @08075000 adds r5, r6, 0 @08075000: muls r0, r7 adds r1, r6, 0 bl __divsi3 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 muls r0, r7 adds r1, r6, 0 bl __divsi3 lsls r4, 24 asrs r4, 24 lsls r0, 24 asrs r0, 24 subs r0, r4, r0 cmp r0, 0 bge @08075028 negs r0, r0 @08075028: lsls r0, 24 lsrs r0, 24 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8074FE8 thumb_func_start sub_8075034 sub_8075034: ; 8075034 push {r4,lr} lsls r2, 24 lsrs r2, 24 lsls r0, 16 asrs r4, r0, 16 adds r0, r4, 0 muls r0, r2 lsls r1, 16 asrs r1, 16 bl __divsi3 lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @08075058 cmp r4, 0 ble @08075058 movs r0, 0x1 @08075058: pop {r4} pop {r1} bx r1 thumb_func_end sub_8075034 thumb_func_start sub_8075060 sub_8075060: ; 8075060 push {lr} lsls r0, 16 asrs r0, 16 lsls r1, 16 asrs r1, 16 cmp r0, r1 bne @08075072 movs r0, 0x4 b @0807508E @08075072: movs r2, 0x30 bl sub_8075034 lsls r0, 24 lsrs r1, r0, 24 movs r0, 0x3 cmp r1, 0x18 bhi @0807508E movs r0, 0x2 cmp r1, 0x9 bhi @0807508E negs r0, r1 orrs r0, r1 lsrs r0, 31 @0807508E: pop {r1} bx r1 thumb_func_end sub_8075060 thumb_func_start write_to_rbox write_to_rbox: ; 8075094 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x20 mov r10, r0 mov r8, r1 mov r9, r2 adds r5, r3, 0 ldr r7, [sp, 0x40] ldr r0, =gUnknown_0832C3F8 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x18] str r1, [sp, 0x1C] add r0, sp, 0x18 bl 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 .pool 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, =0x001fffff ands r2, r0 movs r0, 0xA0 lsls r0, 19 orrs r2, r0 mov r0, sp adds r1, r3, 0 bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807513C thumb_func_start sub_8075170 sub_8075170: ; 8075170 push {lr} adds r3, r0, 0 adds r0, r1, 0 movs r1, 0x80 lsls r1, 1 adds r0, r1 lsls r2, 3 ldr r1, =0x001fffff ands r2, r1 movs r1, 0x80 lsls r1, 19 orrs r2, r1 adds r1, r3, 0 bl CpuSet pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8075170 thumb_func_start sub_8075198 sub_8075198: ; 8075198 push {r4-r6,lr} adds r6, r0, 0 adds r5, r1, 0 adds r4, r2, 0 movs r1, 0x80 lsls r1, 1 adds r0, r5, r1 adds r1, r6, r1 lsls r2, r4, 3 ldr r3, =0x001fffff ands r2, r3 movs r3, 0x80 lsls r3, 19 orrs r2, r3 bl CpuSet cmp r4, 0 ble @080751D4 @080751BC: adds r0, r5, 0 adds r0, 0x14 adds r1, r6, 0 adds r1, 0x14 ldr r2, =0x04000003 bl CpuSet adds r6, 0x20 adds r5, 0x20 subs r4, 0x1 cmp r4, 0 bne @080751BC @080751D4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8075198 thumb_func_start sub_80751E4 sub_80751E4: ; 80751E4 push {r4-r6,lr} adds r6, r0, 0 adds r5, r1, 0 lsls r4, r2, 3 ldr r0, =0x001fffff ands r4, r0 movs r0, 0x80 lsls r0, 19 orrs r4, r0 adds r0, r5, 0 adds r1, r6, 0 adds r2, r4, 0 bl CpuSet movs r0, 0x80 lsls r0, 1 adds r5, r0 adds r6, r0 adds r0, r5, 0 adds r1, r6, 0 adds r2, r4, 0 bl CpuSet pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80751E4 thumb_func_start sub_807521C sub_807521C: ; 807521C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 16 lsrs r6, r0, 16 lsls r1, 16 lsrs r7, r1, 16 lsls r2, 24 lsrs r4, r2, 24 ldr r5, =gUnknown_0831C620 ldrh r0, [r5, 0x6] bl gpu_tile_obj_tag_get_range_start lsls r0, 16 ldr r1, =0xffff0000 cmp r0, r1 bne @0807524E adds r0, r5, 0 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_0831C628 bl gpu_pal_obj_decompress_and_apply3 @0807524E: ldr r0, =sub_8075370 bl object_new_hidden_with_callback mov r8, r0 mov r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r5, r0, 4 add r5, r8 lsls r5, 2 ldr r0, =0x02020630 adds r5, r0 strh r4, [r5, 0x30] ldr r0, =gUnknown_0831C688 mov r9, r0 lsls r6, 16 asrs r0, r6, 16 mov r10, r0 ldr r0, =0xfff00000 adds r6, r0 asrs r6, 16 lsls r4, r7, 16 asrs r7, r4, 16 adds r4, r0 asrs r4, 16 mov r0, r9 adds r1, r6, 0 adds r2, r4, 0 movs r3, 0x2 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 adds r1, r0 mov r0, r8 strh r0, [r1, 0x2E] ldrh r0, [r5, 0x2E] adds r0, 0x1 strh r0, [r5, 0x2E] adds r0, r1, 0 bl 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, =0x02020630 adds r4, r0 mov r0, r8 strh r0, [r4, 0x2E] ldrh r0, [r5, 0x2E] adds r0, 0x1 strh r0, [r5, 0x2E] adds r0, r4, 0 movs r1, 0x1 bl 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, =0x02020630 adds r4, r0 mov r0, r8 strh r0, [r4, 0x2E] ldrh r0, [r5, 0x2E] adds r0, 0x1 strh r0, [r5, 0x2E] adds r0, r4, 0 movs r1, 0x2 bl 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, =0x02020630 adds r4, r0 mov r0, r8 strh r0, [r4, 0x2E] ldrh r0, [r5, 0x2E] adds r0, 0x1 strh r0, [r5, 0x2E] adds r0, r4, 0 movs r1, 0x3 bl 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 .pool thumb_func_end sub_807521C thumb_func_start sub_8075370 sub_8075370: ; 8075370 push {r4,lr} adds r4, r0, 0 movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0 bne @080753A8 ldr r0, =gUnknown_0831C620 ldrh r0, [r0, 0x6] bl gpu_tile_obj_free_by_tag ldr r0, =gUnknown_0831C628 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 .pool @080753A4: ldr r0, =nullsub_12 str r0, [r4, 0x1C] @080753A8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8075370 thumb_func_start sub_80753B4 sub_80753B4: ; 80753B4 push {lr} adds r3, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080753DE ldr r2, =0x02020630 movs r0, 0x2E ldrsh r1, [r3, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x2E] subs r1, 0x1 strh r1, [r0, 0x2E] adds r0, r3, 0 bl obj_delete_and_free_tiles @080753DE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80753B4 thumb_func_start sub_80753E8 sub_80753E8: ; 80753E8 push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 lsls r4, 16 lsrs r4, 16 lsls r5, 24 lsrs r5, 24 ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldr r0, =0x020244d0 ldr r0, [r0] ldr r6, =0x02024064 ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x8 orrs r1, r2 strb r1, [r0] ldr r0, =sub_8075450 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xA] strh r5, [r1, 0xC] ldrb r0, [r6] strh r0, [r1, 0xE] movs r0, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80753E8 thumb_func_start sub_8075450 sub_8075450: ; 8075450 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 mov r10, r0 movs r0, 0 str r0, [sp] ldr r1, =0x03005e00 mov r2, r10 lsls r0, r2, 2 add r0, r10 lsls r0, 3 adds r1, r0, r1 ldrh r2, [r1, 0x8] movs r3, 0x8 ldrsh r0, [r1, r3] cmp r0, 0 bne @08075488 adds r0, r2, 0x1 strh r0, [r1, 0x8] b @08075602 .align 2, 0 .pool @08075488: ldrh r0, [r1, 0xC] mov r8, r0 ldrb r5, [r1, 0xE] adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080754B4 ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @080754C2 .align 2, 0 .pool @080754B4: ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @080754C2: adds r0, r1 movs r1, 0x26 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 bl ball_number_to_ball_processing_index adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 bl sub_8076A78 lsls r0, r4, 1 adds r0, r4 lsls r0, 3 ldr r1, =gUnknown_0832C588 adds r0, r1 movs r1, 0x20 movs r2, 0x50 movs r3, 0x1D bl obj_add_from_template_forward_search lsls r0, 24 lsrs r7, r0, 24 ldr r2, =0x02020630 mov r9, r2 lsls r0, r7, 4 adds r0, r7 lsls r6, r0, 2 adds r4, r6, r2 movs r0, 0x80 strh r0, [r4, 0x2E] movs r3, 0 strh r3, [r4, 0x30] mov r0, r8 strh r0, [r4, 0x3C] mov r2, r8 cmp r2, 0xFE beq @08075548 cmp r2, 0xFF bne @08075584 ldr r0, =0x0202420c strb r5, [r0] movs r0, 0x18 strh r0, [r4, 0x20] movs r0, 0x44 strh r0, [r4, 0x22] mov r0, r9 adds r0, 0x1C adds r0, r6, r0 ldr r1, =sub_80761B4 str r1, [r0] b @08075592 .align 2, 0 .pool @08075548: adds r0, r5, 0 movs r1, 0 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x20] adds r0, r5, 0 movs r1, 0x1 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 adds r0, 0x18 strh r0, [r4, 0x22] ldr r0, =0x0202420c strb r5, [r0] movs r3, 0 strh r3, [r4, 0x2E] mov r0, r9 adds r0, 0x1C adds r0, r6, r0 ldr r1, =sub_8076398 str r1, [r0] b @08075592 .align 2, 0 .pool @08075584: movs r0, 0x1 bl battle_get_side_with_given_state ldr r1, =0x0202420c strb r0, [r1] movs r0, 0x1 str r0, [sp] @08075592: ldr r0, =0x02020630 lsls r1, r7, 4 adds r1, r7 lsls r1, 2 adds r4, r1, r0 ldr r5, =0x0202420c ldrb r0, [r5] strh r0, [r4, 0x3A] ldr r2, [sp] cmp r2, 0 bne @080755B8 mov r0, r10 bl remove_task b @08075602 .align 2, 0 .pool @080755B8: movs r0, 0x22 strh r0, [r4, 0x2E] ldrb r0, [r5] movs r1, 0 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x1 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 subs r0, 0x10 strh r0, [r4, 0x36] ldr r0, =0x0000ffd8 strh r0, [r4, 0x38] adds r0, r4, 0 bl sub_80A68D4 mov r3, r10 strh r3, [r4, 0x6] ldr r1, =0x03005e00 mov r2, r10 lsls r0, r2, 2 add r0, r10 lsls r0, 3 adds r0, r1 ldrb r1, [r5] strh r1, [r0, 0x10] ldr r1, =nullsub_4 str r1, [r0] movs r0, 0x3D bl audio_play @08075602: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8075450 thumb_func_start objc_0804ABD4 objc_0804ABD4: ; 8075620 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 adds r7, r0, 0 bl sub_80A6900 lsls r0, 24 cmp r0, 0 beq @080756C0 ldrb r6, [r7, 0x6] ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldrb r5, [r0, 0x10] ldrb r0, [r0, 0xC] mov r8, r0 adds r0, r7, 0 movs r1, 0x1 bl 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, =sub_80756D4 str r0, [r7, 0x1C] @080756C0: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end objc_0804ABD4 thumb_func_start sub_80756D4 sub_80756D4: ; 80756D4 ldr r1, =sub_80756E0 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool thumb_func_end sub_80756D4 thumb_func_start sub_80756E0 sub_80756E0: ; 80756E0 push {r4-r7,lr} adds r6, r0, 0 ldrh r0, [r6, 0x38] adds r0, 0x1 movs r7, 0 strh r0, [r6, 0x38] lsls r0, 16 asrs r0, 16 cmp r0, 0xA bne @0807573A strh r7, [r6, 0x38] ldr r0, =sub_807574C str r0, [r6, 0x1C] ldr r5, =0x020241e4 movs r1, 0x3A ldrsh r0, [r6, r1] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 movs r1, 0x2 bl 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 .pool thumb_func_end sub_80756E0 thumb_func_start sub_807574C sub_807574C: ; 807574C push {r4-r6,lr} adds r4, r0, 0 ldrh r0, [r4, 0x38] adds r0, 0x1 strh r0, [r4, 0x38] lsls r0, 16 asrs r0, 16 cmp r0, 0xB bne @08075764 movs r0, 0x3C bl audio_play @08075764: ldr r6, =0x02020630 ldr r5, =0x020241e4 movs r1, 0x3A ldrsh r0, [r4, r1] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r6 adds r0, r1, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 26 cmp r0, 0 bge @080757BC adds r0, r4, 0 movs r1, 0x2 bl 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, =sub_80757E4 str r0, [r4, 0x1C] b @080757DC .align 2, 0 .pool @080757BC: ldrh r0, [r1, 0x30] adds r0, 0x60 strh r0, [r1, 0x30] movs r1, 0x3A ldrsh r0, [r4, r1] adds r0, r5 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r6 movs r2, 0x30 ldrsh r0, [r1, r2] negs r0, r0 asrs r0, 8 strh r0, [r1, 0x26] @080757DC: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_807574C thumb_func_start sub_80757E4 sub_80757E4: ; 80757E4 push {r4,lr} adds r4, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @0807582C ldrh r0, [r4, 0x38] adds r0, 0x1 movs r1, 0 strh r0, [r4, 0x38] lsls r0, 16 asrs r0, 16 cmp r0, 0x1 bne @0807582C strh r1, [r4, 0x34] movs r0, 0x20 strh r0, [r4, 0x36] strh r1, [r4, 0x38] movs r0, 0 movs r1, 0x20 bl cosine ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x22] movs r0, 0x36 ldrsh r1, [r4, r0] movs r0, 0 bl cosine negs r0, r0 strh r0, [r4, 0x26] ldr r0, =sub_8075838 str r0, [r4, 0x1C] @0807582C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80757E4 thumb_func_start sub_8075838 sub_8075838: ; 8075838 push {r4,r5,lr} adds r4, r0, 0 movs r5, 0 ldrh r0, [r4, 0x34] movs r1, 0xFF ands r1, r0 cmp r1, 0 beq @0807584E cmp r1, 0x1 beq @080758C2 b @080758EE @0807584E: movs r1, 0x38 ldrsh r0, [r4, r1] movs r2, 0x36 ldrsh r1, [r4, r2] bl cosine negs r0, r0 strh r0, [r4, 0x26] ldrh r1, [r4, 0x38] adds r1, 0x4 ldrh r2, [r4, 0x34] lsls r0, r2, 16 asrs r0, 24 adds r1, r0 strh r1, [r4, 0x38] lsls r1, 16 asrs r1, 16 cmp r1, 0x3F ble @080758EE ldrh r0, [r4, 0x36] subs r0, 0xA strh r0, [r4, 0x36] ldr r1, =0x00000101 adds r0, r2, r1 strh r0, [r4, 0x34] lsls r0, 16 asrs r0, 24 cmp r0, 0x4 bne @0807588A movs r5, 0x1 @0807588A: cmp r0, 0x2 beq @080758AA cmp r0, 0x2 bgt @0807589C cmp r0, 0x1 beq @080758A2 b @080758BA .align 2, 0 .pool @0807589C: cmp r0, 0x3 beq @080758B2 b @080758BA @080758A2: movs r0, 0x38 bl audio_play b @080758EE @080758AA: movs r0, 0x39 bl audio_play b @080758EE @080758B2: movs r0, 0x3A bl audio_play b @080758EE @080758BA: movs r0, 0x3B bl audio_play b @080758EE @080758C2: movs r2, 0x38 ldrsh r0, [r4, r2] movs r2, 0x36 ldrsh r1, [r4, r2] bl cosine negs r0, r0 strh r0, [r4, 0x26] ldrh r1, [r4, 0x38] subs r1, 0x4 ldrh r2, [r4, 0x34] lsls r0, r2, 16 asrs r0, 24 subs r1, r0 strh r1, [r4, 0x38] lsls r1, 16 cmp r1, 0 bgt @080758EE strh r5, [r4, 0x38] ldr r0, =0xffffff00 ands r0, r2 strh r0, [r4, 0x34] @080758EE: cmp r5, 0 beq @08075926 movs r5, 0 strh r5, [r4, 0x34] movs r0, 0x40 movs r1, 0x20 bl cosine ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x22] strh r5, [r4, 0x26] movs r2, 0x3C ldrsh r0, [r4, r2] cmp r0, 0 bne @0807591C ldr r0, =sub_8075D14 str r0, [r4, 0x1C] b @08075926 .align 2, 0 .pool @0807591C: ldr r0, =sub_8075930 str r0, [r4, 0x1C] movs r0, 0x1 strh r0, [r4, 0x36] strh r5, [r4, 0x38] @08075926: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8075838 thumb_func_start sub_8075930 sub_8075930: ; 8075930 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x34] adds r0, 0x1 strh r0, [r4, 0x34] lsls r0, 16 asrs r0, 16 cmp r0, 0x1F bne @08075964 movs r0, 0 strh r0, [r4, 0x34] adds r2, r4, 0 adds r2, 0x2C ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] adds r0, r4, 0 movs r1, 0x1 bl sub_8008258 ldr r0, =sub_8075970 str r0, [r4, 0x1C] movs r0, 0x17 bl audio_play @08075964: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8075930 thumb_func_start sub_8075970 sub_8075970: ; 8075970 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x34] movs r1, 0xFF ands r1, r0 cmp r1, 0x4 bhi @08075A70 lsls r0, r1, 2 ldr r1, =@0807598C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807598C: .4byte @080759A0 .4byte @080759D2 .4byte @080759A0 .4byte @08075A26 .4byte @08075A70 @080759A0: ldrh r0, [r4, 0x36] ldrh r2, [r4, 0x24] adds r1, r0, r2 strh r1, [r4, 0x24] ldrh r1, [r4, 0x38] adds r0, r1 strh r0, [r4, 0x38] adds r2, r4, 0 adds r2, 0x2C ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] ldrh r0, [r4, 0x38] adds r0, 0x3 lsls r0, 16 lsrs r0, 16 cmp r0, 0x6 bls @08075AB6 ldrh r0, [r4, 0x34] adds r0, 0x1 strh r0, [r4, 0x34] movs r0, 0 strh r0, [r4, 0x38] b @08075AB6 @080759D2: ldrh r0, [r4, 0x38] adds r0, 0x1 strh r0, [r4, 0x38] lsls r0, 16 asrs r0, 16 cmp r0, 0x1 bne @08075A18 movs r0, 0 strh r0, [r4, 0x38] ldrh r0, [r4, 0x36] negs r0, r0 strh r0, [r4, 0x36] ldrh r0, [r4, 0x34] adds r0, 0x1 strh r0, [r4, 0x34] adds r2, r4, 0 adds r2, 0x2C ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] movs r2, 0x36 ldrsh r0, [r4, r2] cmp r0, 0 bge @08075A0E adds r0, r4, 0 movs r1, 0x2 bl sub_80082B8 b @08075AB6 @08075A0E: adds r0, r4, 0 movs r1, 0x1 bl sub_80082B8 b @08075AB6 @08075A18: adds r0, r4, 0 adds r0, 0x2C ldrb r1, [r0] movs r2, 0x80 orrs r1, r2 strb r1, [r0] b @08075AB6 @08075A26: movs r1, 0x80 lsls r1, 1 adds r0, r1, 0 ldrh r2, [r4, 0x34] adds r0, r2 strh r0, [r4, 0x34] lsls r0, 16 asrs r0, 24 movs r2, 0x3C ldrsh r1, [r4, r2] cmp r0, r1 bne @08075A48 ldr r0, =sub_8075D14 str r0, [r4, 0x1C] b @08075AB6 .align 2, 0 .pool @08075A48: cmp r1, 0x4 bne @08075A5C cmp r0, 0x3 bne @08075A5C ldr r0, =sub_8075FB4 str r0, [r4, 0x1C] b @08075A62 .align 2, 0 .pool @08075A5C: ldrh r0, [r4, 0x34] adds r0, 0x1 strh r0, [r4, 0x34] @08075A62: adds r2, r4, 0 adds r2, 0x2C ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] b @08075AB6 @08075A70: ldrh r0, [r4, 0x38] adds r0, 0x1 strh r0, [r4, 0x38] lsls r0, 16 asrs r0, 16 cmp r0, 0x1F bne @08075AB6 movs r0, 0 strh r0, [r4, 0x38] ldrh r1, [r4, 0x34] ldr r0, =0xffffff00 ands r0, r1 strh r0, [r4, 0x34] adds r0, r4, 0 movs r1, 0x3 bl 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 .pool @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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r2 ldrb r1, [r0, 0xC] mov r12, r1 ldrb r5, [r0, 0xA] ldrh r6, [r0, 0x8] ldrb r3, [r0, 0xE] mov r8, r3 ldrb r7, [r0, 0x10] movs r3, 0x12 ldrsh r1, [r0, r3] lsls r3, r1, 16 ldrh r1, [r0, 0x14] orrs r3, r1 movs r1, 0x26 ldrsh r0, [r0, r1] cmp r0, 0x20 bhi @08075B88 lsls r0, 2 ldr r1, =@08075B04 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08075B04: .4byte @08075B88 .4byte @08075BB4 .4byte @08075BDA .4byte @08075C54 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075BF8 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075B88 .4byte @08075C66 .4byte @08075C7E .4byte @08075CA8 @08075B88: ldr r0, =0x02020630 lsls r1, r7, 4 adds r1, r7 lsls r1, 2 adds r1, r0 adds r1, 0x3F ldrb r0, [r1] lsls r0, 26 cmp r0, 0 blt @08075B9E b @08075D04 @08075B9E: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r2 mov r1, r12 adds r1, 0x1 strh r1, [r0, 0x26] b @08075D04 .align 2, 0 .pool @08075BB4: adds r0, r3, 0 bl sub_805F110 cmp r0, 0x1 bne @08075BCC lsls r1, r5, 24 asrs r1, 24 adds r0, r6, 0 movs r2, 0 bl sub_80A32E4 b @08075C2E @08075BCC: lsls r1, r5, 24 asrs r1, 24 adds r0, r6, 0 movs r2, 0xB bl sub_80A32E4 b @08075C2E @08075BDA: bl sub_80A369C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0x3 strh r1, [r0, 0x1C] movs r1, 0x14 strh r1, [r0, 0x26] b @08075D04 .align 2, 0 .pool @08075BF8: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r1, r0, r2 ldrh r2, [r1, 0x1C] movs r7, 0x1C ldrsh r0, [r1, r7] cmp r0, 0 bne @08075CBA adds r0, r3, 0 bl sub_805F110 cmp r0, 0x1 bne @08075C22 lsls r1, r5, 24 asrs r1, 24 adds r0, r6, 0 movs r2, 0x1 bl sub_80A3344 b @08075C2E @08075C22: lsls r1, r5, 24 asrs r1, 24 adds r0, r6, 0 movs r2, 0xC bl sub_80A3344 @08075C2E: ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] mov r2, r8 lsls r1, r2, 1 add r1, r8 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x41 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] adds r0, r4, 0 bl remove_task b @08075D04 .align 2, 0 .pool @08075C54: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r2 movs r1, 0x6 strh r1, [r0, 0x1C] movs r1, 0x1E strh r1, [r0, 0x26] b @08075D04 @08075C66: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r1, r0, r2 ldrh r2, [r1, 0x1C] movs r3, 0x1C ldrsh r0, [r1, r3] cmp r0, 0 bne @08075CBA ldrh r0, [r1, 0x26] adds r0, 0x1 strh r0, [r1, 0x26] @08075C7E: bl sub_80A36C8 lsls r0, 24 cmp r0, 0 bne @08075D04 bl sub_80A369C ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 movs r0, 0x3 strh r0, [r1, 0x1C] ldrh r0, [r1, 0x26] adds r0, 0x1 strh r0, [r1, 0x26] b @08075D04 .align 2, 0 .pool @08075CA8: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r1, r0, r2 ldrh r2, [r1, 0x1C] movs r7, 0x1C ldrsh r0, [r1, r7] cmp r0, 0 beq @08075CC0 @08075CBA: subs r0, r2, 0x1 strh r0, [r1, 0x1C] b @08075D04 @08075CC0: adds r0, r3, 0 bl sub_805F110 cmp r0, 0x1 bne @08075CD8 lsls r1, r5, 24 asrs r1, 24 adds r0, r6, 0 movs r2, 0 bl sub_80A3344 b @08075CE4 @08075CD8: lsls r1, r5, 24 asrs r1, 24 adds r0, r6, 0 movs r2, 0xB bl sub_80A3344 @08075CE4: ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] mov r2, r8 lsls r1, r2, 1 add r1, r8 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x41 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] adds r0, r4, 0 bl remove_task @08075D04: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c3_0804B070 thumb_func_start sub_8075D14 sub_8075D14: ; 8075D14 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 adds r6, r0, 0 ldrh r0, [r6, 0x3A] lsls r0, 24 lsrs r5, r0, 24 adds r0, r6, 0 movs r1, 0x1 bl 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, =sub_8075FD4 str r0, [r6, 0x1C] ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08075D88 b @08075EF4 @08075D88: adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08075DC0 ldr r0, =0x0202406e lsls r2, r5, 1 adds r0, r2, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r7, r1, r0 movs r4, 0x19 mov r10, r4 b @08075DD4 .align 2, 0 .pool @08075DC0: ldr r0, =0x0202406e lsls r2, r5, 1 adds r0, r2, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r7, r1, r0 movs r0, 0xE7 mov r10, r0 @08075DD4: mov r8, r2 adds r0, r7, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r9, r0 movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 cmp r5, r0 beq @08075E00 movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 cmp r5, r0 bne @08075E56 @08075E00: bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08075E56 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r1, [r0, 0x9] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08075E56 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x42 ands r0, r1 cmp r0, 0x42 bne @08075E4C bl sub_80A38E4 lsls r0, 24 cmp r0, 0 beq @08075E56 ldr r0, =0x03007420 bl MPlayStop_rev01 b @08075E56 .align 2, 0 .pool @08075E4C: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 bl MPlayVolumeControl @08075E56: bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08075E70 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r1, [r0, 0x9] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08075E80 @08075E70: movs r4, 0 b @08075EA2 .align 2, 0 .pool @08075E80: movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 cmp r5, r0 beq @08075E9C movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 cmp r5, r0 bne @08075EA0 @08075E9C: movs r4, 0x1 b @08075EA2 @08075EA0: movs r4, 0x2 @08075EA2: ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] mov r2, r8 adds r1, r2, r5 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] movs r2, 0x40 orrs r0, r2 strb r0, [r1, 0x1] ldr r0, =c3_0804B070 movs r1, 0x3 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r3, 0 mov r0, r9 strh r0, [r1, 0x8] mov r2, r10 lsls r0, r2, 24 asrs r0, 24 strh r0, [r1, 0xA] strh r4, [r1, 0xC] strh r5, [r1, 0xE] ldr r2, =0x020241e4 movs r4, 0x3A ldrsh r0, [r6, r4] adds r0, r2 ldrb r0, [r0] strh r0, [r1, 0x10] lsrs r0, r7, 16 strh r0, [r1, 0x12] strh r7, [r1, 0x14] strh r3, [r1, 0x26] @08075EF4: ldr r4, =0x020241e4 movs r1, 0x3A ldrsh r0, [r6, r1] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 movs r1, 0x1 bl 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, =sub_8039B58 b @08075F66 .align 2, 0 .pool @08075F50: movs r1, 0x3A ldrsh r0, [r6, r1] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_8039E44 @08075F66: str r1, [r0] ldr r5, =0x020241e4 movs r2, 0x3A ldrsh r0, [r6, r2] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl 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 .pool thumb_func_end sub_8075D14 thumb_func_start sub_8075FB4 sub_8075FB4: ; 8075FB4 adds r3, r0, 0 adds r3, 0x2C ldrb r1, [r3] movs r2, 0x40 orrs r1, r2 strb r1, [r3] ldr r1, =sub_80760F8 str r1, [r0, 0x1C] movs r1, 0 strh r1, [r0, 0x34] strh r1, [r0, 0x36] strh r1, [r0, 0x38] bx lr .align 2, 0 .pool thumb_func_end sub_8075FB4 thumb_func_start sub_8075FD4 sub_8075FD4: ; 8075FD4 push {r4-r7,lr} adds r5, r0, 0 movs r7, 0 ldrh r0, [r5, 0x3A] lsls r0, 24 lsrs r6, r0, 24 ldr r4, =0x02020630 ldr r0, =0x020241e4 adds r3, r6, r0 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] adds r0, r5, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08076016 adds r2, r5, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] @08076016: ldrb r0, [r3] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 adds r0, r1, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 26 cmp r0, 0 bge @08076040 adds r0, r1, 0 movs r1, 0 bl sub_8008258 movs r7, 0x1 b @0807605C .align 2, 0 .pool @08076040: ldr r2, =0xfffffee0 adds r0, r2, 0 ldrh r2, [r1, 0x30] adds r0, r2 strh r0, [r1, 0x30] ldrb r0, [r3] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 ldrh r0, [r1, 0x30] lsls r0, 16 asrs r0, 24 strh r0, [r1, 0x26] @0807605C: adds r0, r5, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080760DE cmp r7, 0 beq @080760DE ldr r2, =0x02020630 ldr r0, =0x020241e4 adds r0, r6, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r2, 0 movs r1, 0 strh r1, [r0, 0x26] ldr r0, =0x020244b9 strb r2, [r0] ldr r4, =0x020244d0 ldr r0, [r4] ldr r0, [r0, 0x4] lsls r1, r6, 1 adds r1, r6 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] adds r0, r5, 0 bl obj_free_rotscale_entry adds r0, r5, 0 bl 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 .pool thumb_func_end sub_8075FD4 thumb_func_start sub_80760F8 sub_80760F8: ; 80760F8 push {r4-r7,lr} adds r6, r0, 0 ldrh r0, [r6, 0x3A] lsls r0, 24 lsrs r7, r0, 24 ldrh r0, [r6, 0x36] adds r0, 0x1 strh r0, [r6, 0x36] lsls r0, 16 asrs r1, r0, 16 cmp r1, 0x28 beq @08076196 cmp r1, 0x5F bne @08076130 ldr r0, =0x020244b9 movs r1, 0 strb r1, [r0] bl m4aMPlayAllStop ldr r0, =0x00000173 bl audio_play b @08076196 .align 2, 0 .pool @08076130: ldr r0, =0x0000013b cmp r1, r0 bne @08076196 ldr r5, =0x02020630 ldr r4, =0x020241e4 movs r1, 0x3A ldrsh r0, [r6, r1] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 bl rotscale_free_entry movs r1, 0x3A ldrsh r0, [r6, r1] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 bl obj_delete_and_free_tiles adds r0, r6, 0 bl obj_delete_and_free_resources ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08076196 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r7, 1 adds r1, r7 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] @08076196: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80760F8 thumb_func_start sub_80761B4 sub_80761B4: ; 80761B4 push {r4,lr} adds r4, r0, 0 movs r0, 0x19 strh r0, [r4, 0x2E] ldrh r0, [r4, 0x3A] lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrh r0, [r4, 0x3A] lsls r0, 24 lsrs r0, 24 movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 adds r0, 0x18 strh r0, [r4, 0x36] ldr r0, =0x0000ffe2 strh r0, [r4, 0x38] ldrh r0, [r4, 0x3A] strh r0, [r4, 0x6] adds r0, r4, 0 bl sub_80A68D4 ldr r0, =sub_8076204 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80761B4 thumb_func_start sub_8076204 sub_8076204: ; 8076204 push {r4-r7,lr} mov r7, r8 push {r7} adds r5, r0, 0 ldrh r0, [r5, 0x3C] movs r1, 0xFF mov r8, r1 lsrs r0, 8 subs r0, 0x23 lsls r0, 16 lsrs r0, 16 cmp r0, 0x2C bhi @080762F8 ldrh r1, [r5, 0x6] movs r0, 0xFF lsls r0, 8 ands r0, r1 cmp r0, 0 bne @08076266 ldrh r0, [r5, 0x30] movs r1, 0x1 adds r6, r1, 0 ands r6, r0 ldrh r0, [r5, 0x32] adds r7, r1, 0 ands r7, r0 movs r2, 0x30 ldrsh r0, [r5, r2] movs r1, 0x3 bl __divsi3 movs r1, 0x2 negs r1, r1 adds r4, r1, 0 ands r0, r4 orrs r6, r0 strh r6, [r5, 0x30] movs r2, 0x32 ldrsh r0, [r5, r2] movs r1, 0x3 bl __divsi3 ands r0, r4 orrs r7, r0 strh r7, [r5, 0x32] adds r0, r5, 0 movs r1, 0x4 bl 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, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r1, [r0, 0x9] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08076358 movs r0, 0x3A ldrsh r4, [r5, r0] movs r0, 0x2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 cmp r4, r0 bne @08076358 ldr r0, =sub_8076374 b @0807635A .align 2, 0 .pool @08076358: ldr r0, =sub_8075D14 @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 .pool thumb_func_end sub_8076204 thumb_func_start sub_8076374 sub_8076374: ; 8076374 push {lr} adds r2, r0, 0 ldrh r0, [r2, 0x2E] adds r1, r0, 0x1 strh r1, [r2, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0x18 ble @0807638E movs r0, 0 strh r0, [r2, 0x2E] ldr r0, =sub_8075D14 str r0, [r2, 0x1C] @0807638E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8076374 thumb_func_start sub_8076398 sub_8076398: ; 8076398 push {r4,r5,lr} adds r5, r0, 0 ldrh r0, [r5, 0x2E] adds r0, 0x1 strh r0, [r5, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0xF ble @080763EC movs r0, 0 strh r0, [r5, 0x2E] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @080763E8 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r1, [r0, 0x9] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080763E8 movs r0, 0x3A ldrsh r4, [r5, r0] movs r0, 0x3 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 cmp r4, r0 bne @080763E8 ldr r0, =sub_8076374 b @080763EA .align 2, 0 .pool @080763E8: ldr r0, =sub_8075D14 @080763EA: str r0, [r5, 0x1C] @080763EC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8076398 thumb_func_start sub_80763F8 sub_80763F8: ; 80763F8 push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 movs r4, 0 str r4, [sp] bl sub_8171D98 lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4} pop {r1} bx r1 thumb_func_end sub_80763F8 thumb_func_start sub_8076420 sub_8076420: ; 8076420 push {lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 movs r3, 0 bl sub_81729E8 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_8076420 thumb_func_start sub_8076438 sub_8076438: ; 8076438 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 adds r5, r0, 0 mov r9, r2 mov r10, r3 ldr r6, [sp, 0x28] ldr r4, [sp, 0x2C] ldr r0, [sp, 0x30] ldr r2, [sp, 0x38] lsls r5, 24 lsrs r5, 24 lsls r1, 24 lsrs r1, 24 str r1, [sp] mov r1, r9 lsls r1, 24 lsrs r1, 24 mov r9, r1 lsls r3, 24 lsrs r3, 24 mov r10, r3 lsls r6, 24 lsrs r6, 24 lsls r4, 24 lsrs r4, 24 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x4] lsls r0, r2, 16 lsrs r7, r0, 16 ldr r0, =gUnknown_0832C400 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_0832C460 bl gpu_pal_obj_decompress_and_apply3 ldr r0, =gUnknown_0832C588 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, =0x02020630 mov r8, r1 lsls r4, r0, 4 adds r4, r0 lsls r4, 2 adds r2, r4, r1 strh r5, [r2, 0x2E] lsls r1, r5, 4 adds r1, r5 lsls r1, 2 add r1, r8 ldrh r0, [r1, 0x20] strh r0, [r2, 0x38] ldrh r0, [r1, 0x22] strh r0, [r2, 0x3A] mov r3, r9 strh r3, [r1, 0x20] mov r0, r10 strh r0, [r1, 0x22] strh r7, [r1, 0x3C] mov r3, sp ldrh r3, [r3, 0x4] strh r3, [r2, 0x30] mov r0, sp ldrh r0, [r0] strh r0, [r2, 0x32] mov r3, sp ldrh r3, [r3, 0x34] strh r3, [r2, 0x34] ldr r3, [sp, 0x34] lsrs r0, r3, 16 strh r0, [r2, 0x36] movs r0, 0x3 ands r6, r0 lsls r6, 2 ldrb r3, [r2, 0x5] movs r0, 0xD negs r0, r0 ands r0, r3 orrs r0, r6 strb r0, [r2, 0x5] movs r0, 0x1C add r8, r0 add r4, r8 ldr r0, =sub_8076524 str r0, [r4] adds r1, 0x3E ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8076438 thumb_func_start sub_8076524 sub_8076524: ; 8076524 push {r4-r7,lr} mov r7, r8 push {r7} adds r6, r0, 0 ldrh r1, [r6, 0x30] movs r2, 0x30 ldrsh r0, [r6, r2] cmp r0, 0 bne @080765D0 ldrh r0, [r6, 0x2E] lsls r0, 24 lsrs r7, r0, 24 ldrh r0, [r6, 0x32] lsls r0, 24 lsrs r0, 24 mov r8, r0 ldrh r4, [r6, 0x34] ldrh r0, [r6, 0x36] lsls r0, 16 orrs r4, r0 adds r0, r6, 0 adds r0, 0x43 ldrb r0, [r0] cmp r0, 0 beq @0807655E subs r0, 0x1 lsls r0, 24 lsrs r5, r0, 24 b @08076560 @0807655E: movs r5, 0 @08076560: adds r0, r6, 0 movs r1, 0x1 bl 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, =sub_80765E0 str r0, [r6, 0x1C] ldr r0, =0x02020630 lsls r4, r7, 4 adds r4, r7 lsls r4, 2 adds r4, r0 adds r2, r4, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r0, r4, 0 movs r1, 0x1 bl 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 .pool @080765D0: subs r0, r1, 0x1 strh r0, [r6, 0x30] @080765D4: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8076524 thumb_func_start sub_80765E0 sub_80765E0: ; 80765E0 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r4, r0, 0 movs r0, 0 mov r12, r0 movs r7, 0 ldrh r0, [r4, 0x2E] lsls r0, 24 lsrs r6, r0, 24 adds r0, r4, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08076610 adds r2, r4, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] @08076610: ldr r1, =0x02020630 lsls r2, r6, 4 adds r0, r2, r6 lsls r0, 2 adds r5, r0, r1 adds r0, r5, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 26 mov r8, r2 cmp r0, 0 bge @08076634 adds r0, r5, 0 movs r1, 0 bl 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, =gUnknown_08329F40 lsls r0, r2, 24 lsrs r0, 23 adds r0, r1 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bge @08076690 adds r0, 0x7 @08076690: asrs r0, 3 negs r0, r0 lsls r0, 16 lsrs r0, 16 adds r1, r2, 0x4 strh r1, [r4, 0x3C] strh r0, [r5, 0x24] strh r0, [r5, 0x26] b @080766BA .align 2, 0 .pool @080766AC: ldrh r0, [r4, 0x38] strh r0, [r5, 0x20] ldrh r0, [r4, 0x3A] strh r0, [r5, 0x22] strh r7, [r5, 0x24] strh r7, [r5, 0x26] movs r7, 0x1 @080766BA: adds r0, r4, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @0807670E mov r2, r12 cmp r2, 0 beq @0807670E cmp r7, 0 beq @0807670E ldr r1, =0x02020630 mov r3, r8 adds r0, r3, r6 lsls r0, 2 adds r2, r0, r1 movs r0, 0x3C ldrsh r1, [r2, r0] movs r0, 0xCE lsls r0, 1 cmp r1, r0 bne @080766FC ldrh r1, [r2, 0x3C] adds r0, r2, 0 movs r2, 0x1 movs r3, 0 bl sub_806ED40 b @08076708 .align 2, 0 .pool @080766FC: ldrh r1, [r2, 0x3C] adds r0, r2, 0 movs r2, 0 movs r3, 0 bl sub_806ED40 @08076708: adds r0, r4, 0 bl 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, =gUnknown_0832C400 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_0832C460 bl gpu_pal_obj_decompress_and_apply3 ldr r0, =gUnknown_0832C588 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, =0x02020630 lsls r3, r0, 4 adds r3, r0 lsls r3, 2 adds r2, r3, r6 mov r1, r10 strh r1, [r2, 0x2E] mov r4, r9 strh r4, [r2, 0x30] strh r7, [r2, 0x32] mov r1, sp ldrh r1, [r1, 0x2C] strh r1, [r2, 0x34] ldr r4, [sp, 0x2C] lsrs r1, r4, 16 strh r1, [r2, 0x36] movs r1, 0x3 ands r5, r1 lsls r5, 2 ldrb r4, [r2, 0x5] movs r1, 0xD negs r1, r1 ands r1, r4 orrs r1, r5 strb r1, [r2, 0x5] adds r6, 0x1C adds r3, r6 ldr r1, =sub_80767D4 str r1, [r3] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_807671C thumb_func_start sub_80767D4 sub_80767D4: ; 80767D4 push {r4-r7,lr} mov r7, r8 push {r7} adds r4, r0, 0 ldrh r1, [r4, 0x30] movs r2, 0x30 ldrsh r0, [r4, r2] cmp r0, 0 bne @0807686C ldrh r0, [r4, 0x2E] lsls r0, 24 lsrs r7, r0, 24 ldrh r0, [r4, 0x32] lsls r0, 24 lsrs r0, 24 mov r8, r0 ldrh r5, [r4, 0x34] ldrh r0, [r4, 0x36] lsls r0, 16 orrs r5, r0 adds r0, r4, 0 adds r0, 0x43 ldrb r0, [r0] cmp r0, 0 beq @0807680E subs r0, 0x1 lsls r0, 24 lsrs r6, r0, 24 b @08076810 @0807680E: movs r6, 0 @08076810: adds r0, r4, 0 movs r1, 0x1 bl 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, =sub_807687C str r0, [r4, 0x1C] lsls r4, r7, 4 adds r4, r7 lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 adds r0, r4, 0 movs r1, 0x2 bl sub_8008258 adds r0, r4, 0 bl obj_anim_step strh r5, [r4, 0x30] b @08076870 .align 2, 0 .pool @0807686C: subs r0, r1, 0x1 strh r0, [r4, 0x30] @08076870: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80767D4 thumb_func_start sub_807687C sub_807687C: ; 807687C push {r4,r5,lr} adds r5, r0, 0 ldrh r0, [r5, 0x38] adds r0, 0x1 strh r0, [r5, 0x38] lsls r0, 16 asrs r0, 16 cmp r0, 0xB bne @08076894 movs r0, 0x3C bl audio_play @08076894: ldrh r1, [r5, 0x2E] lsls r1, 24 lsrs r1, 24 ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r2 adds r0, r4, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 26 cmp r0, 0 bge @080768D8 adds r0, r5, 0 movs r1, 0x2 bl 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, =sub_80768F0 str r0, [r5, 0x1C] b @080768E8 .align 2, 0 .pool @080768D8: ldrh r0, [r4, 0x30] adds r0, 0x60 strh r0, [r4, 0x30] movs r1, 0x30 ldrsh r0, [r4, r1] negs r0, r0 asrs r0, 8 strh r0, [r4, 0x26] @080768E8: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_807687C thumb_func_start sub_80768F0 sub_80768F0: ; 80768F0 push {lr} adds r2, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08076904 ldr r0, =nullsub_12 str r0, [r2, 0x1C] @08076904: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80768F0 thumb_func_start obj_delete_and_free_associated_resources_ obj_delete_and_free_associated_resources_: ; 807690C push {lr} bl 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, =0x03005d70 adds r0, r5, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r6, =0x02020630 adds r4, r0, r6 movs r1, 0 movs r0, 0x5 strh r0, [r4, 0x2E] strh r1, [r4, 0x30] movs r0, 0x73 strh r0, [r4, 0x24] strh r1, [r4, 0x26] ldr r0, =sub_80769CC str r0, [r4, 0x1C] adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08076966 ldrh r0, [r4, 0x2E] negs r0, r0 strh r0, [r4, 0x2E] ldrh r0, [r4, 0x30] negs r0, r0 strh r0, [r4, 0x30] ldrh r0, [r4, 0x24] negs r0, r0 strh r0, [r4, 0x24] ldrh r0, [r4, 0x26] negs r0, r0 strh r0, [r4, 0x26] @08076966: movs r0, 0x38 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r6, 0 adds r1, 0x1C adds r1, r0, r1 adds r0, r6 ldr r1, [r1] bl _call_via_r1 adds r0, r5, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08076990 ldr r0, =sub_80769A8 str r0, [r4, 0x1C] @08076990: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8076918 thumb_func_start sub_80769A8 sub_80769A8: ; 80769A8 push {lr} adds r1, r0, 0 ldrh r0, [r1, 0x30] adds r0, 0x1 strh r0, [r1, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x14 bne @080769C2 movs r0, 0 strh r0, [r1, 0x30] ldr r0, =sub_80769CC str r0, [r1, 0x1C] @080769C2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80769A8 thumb_func_start sub_80769CC sub_80769CC: ; 80769CC push {lr} adds r2, r0, 0 ldrh r0, [r2, 0x24] ldrh r1, [r2, 0x2E] subs r0, r1 strh r0, [r2, 0x24] ldrh r0, [r2, 0x26] ldrh r1, [r2, 0x30] subs r0, r1 strh r0, [r2, 0x26] ldr r0, [r2, 0x24] cmp r0, 0 bne @080769EA ldr r0, =nullsub_12 str r0, [r2, 0x1C] @080769EA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80769CC thumb_func_start sub_80769F4 sub_80769F4: ; 80769F4 push {r4,r5,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r5, =oamc_804BEB4 adds r0, r5, 0 bl object_new_hidden_with_callback lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r3, r1, r2 movs r0, 0x1 strh r0, [r3, 0x2E] ldr r0, =0x03005d70 adds r4, r0 ldrb r0, [r4] strh r0, [r3, 0x30] adds r2, 0x1C adds r1, r2 str r5, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80769F4 thumb_func_start oamc_804BEB4 oamc_804BEB4: ; 8076A38 push {lr} adds r3, r0, 0 ldrh r1, [r3, 0x30] lsls r1, 24 lsrs r1, 24 ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r2 ldrh r0, [r3, 0x2E] movs r2, 0 strh r0, [r1, 0x26] ldrh r0, [r3, 0x2E] negs r0, r0 strh r0, [r3, 0x2E] ldrh r0, [r3, 0x32] adds r0, 0x1 strh r0, [r3, 0x32] lsls r0, 16 asrs r0, 16 cmp r0, 0x15 bne @08076A70 strh r2, [r1, 0x24] strh r2, [r1, 0x26] adds r0, r3, 0 bl obj_delete_and_free_tiles @08076A70: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end oamc_804BEB4 thumb_func_start sub_8076A78 sub_8076A78: ; 8076A78 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =gUnknown_0832C400 lsls r6, r4, 3 adds r5, r6, r0 ldrh r0, [r5, 0x6] bl gpu_tile_obj_tag_get_range_start lsls r0, 16 ldr r1, =0xffff0000 cmp r0, r1 bne @08076AA0 adds r0, r5, 0 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_0832C460 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, =gUnknown_0832C400 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, =gUnknown_08C02300 lsrs r1, 11 ldr r2, =0x06010100 adds r1, r2 bl call_LZZUnCompVram @08076ACC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8076A78 thumb_func_start sub_8076AE8 sub_8076AE8: ; 8076AE8 push {r4,lr} adds r4, r0, 0 lsls r4, 24 ldr r0, =gUnknown_0832C400 lsrs r4, 21 adds r0, r4, r0 ldrh r0, [r0, 0x6] bl gpu_tile_obj_free_by_tag ldr r0, =gUnknown_0832C460 adds r4, r0 ldrh r0, [r4, 0x4] bl gpu_pal_free_tag pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8076AE8 thumb_func_start sub_8076B14 sub_8076B14: ; 8076B14 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08076B40 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @08076B4E .align 2, 0 .pool @08076B40: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @08076B4E: adds r0, r1 movs r1, 0x26 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8076B14 thumb_func_start flash_timeout_start_on_timer_2_when_flash_present ; void 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, =0x03005d88 movs r0, 0x1 str r0, [r1] bl flash_timeout_start_on_timer_2 b @08076B8A .align 2, 0 .pool @08076B84: ldr r1, =0x03005d88 movs r0, 0 str r0, [r1] @08076B8A: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024a54 ldr r2, =0x010007d6 mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end memclr_stdsav2 thumb_func_start clear_sav1 clear_sav1: ; 8076BB8 push {lr} sub sp, 0x4 mov r1, sp movs r0, 0 strh r0, [r1] ldr r1, =0x02025a00 ldr r2, =0x01001f04 mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c bl GenerateRandomNumber adds r4, r0 movs r0, 0x7C ands r4, r0 ldr r1, =0x03005d90 ldr r0, =0x02024a54 adds r0, r4, r0 str r0, [r1] ldr r0, =0x02025a00 adds r0, r4, r0 str r0, [r5] ldr r1, =0x03005d94 ldr r0, =0x02029808 adds r4, r0 str r4, [r1] bl init_bag_pockets bl sub_81617F4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldr r0, [r5, 0xC] str r0, [sp] ldr r1, [r5, 0x10] str r1, [sp, 0x4] movs r0, 0 str r0, [r5, 0xC] str r0, [r5, 0x10] ldr r1, =0x0203cf5c str r0, [r1] ldr r4, =0x02000000 ldr r0, =0x03005d90 ldr r1, [r0] ldr r6, =0x00000f2c adds r0, r4, 0 adds r2, r6, 0 bl memcpy ldr r1, =0x03005d8c mov r10, r1 ldr r1, [r1] ldr r7, =0x00003d88 ldr r0, =0x02000f2c adds r2, r7, 0 bl memcpy ldr r0, =0x03005d94 mov r8, r0 ldr r1, [r0] ldr r0, =0x000083d0 mov r9, r0 ldr r0, =0x02004cb4 mov r2, r9 bl memcpy ldrb r1, [r4, 0xA] ldrb r0, [r4, 0xB] adds r1, r0 ldrb r0, [r4, 0xC] adds r1, r0 ldrb r0, [r4, 0xD] adds r0, r1 bl sub_8076BDC ldr r1, =0x03005d90 ldr r0, [r1] adds r1, r4, 0 adds r2, r6, 0 bl memcpy mov r1, r10 ldr r0, [r1] ldr r1, =0x02000f2c adds r2, r7, 0 bl memcpy mov r1, r8 ldr r0, [r1] ldr r1, =0x02004cb4 mov r2, r9 bl memcpy movs r1, 0xE0 lsls r1, 9 adds r0, r4, 0 bl 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, =0x03005d90 ldr r0, [r1] adds r0, 0xAC str r4, [r0] add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end saveblock_randomize_and_relocate thumb_func_start sav2_x1_query_bit1 sav2_x1_query_bit1: ; 8076D24 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r1, [r0, 0x9] movs r0, 0x1 ands r0, r1 bx lr .align 2, 0 .pool thumb_func_end sav2_x1_query_bit1 thumb_func_start sav2_x9_clear_bit1 sav2_x9_clear_bit1: ; 8076D34 ldr r0, =0x03005d90 ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xFE ands r0, r1 strb r0, [r2, 0x9] bx lr .align 2, 0 .pool thumb_func_end sav2_x9_clear_bit1 thumb_func_start sub_8076D48 sub_8076D48: ; 8076D48 ldr r0, =0x03005d90 ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0x1 orrs r0, r1 strb r0, [r2, 0x9] bx lr .align 2, 0 .pool thumb_func_end sub_8076D48 thumb_func_start sub_8076D5C sub_8076D5C: ; 8076D5C push {lr} movs r0, 0 bl sub_8084FAC ldr r0, =0x03005d90 ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0x1 orrs r0, r1 strb r0, [r2, 0x9] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8076D5C thumb_func_start sav2_gender2_inplace_and_xFE sav2_gender2_inplace_and_xFE: ; 8076D78 ldr r0, =0x03005d90 ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xFE ands r0, r1 strb r0, [r2, 0x9] bx lr .align 2, 0 .pool thumb_func_end sav2_gender2_inplace_and_xFE thumb_func_start copy_player_party_to_sav1 ; void copy_player_party_to_sav1() copy_player_party_to_sav1: ; 8076D8C push {r4,lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x020244e9 ldrb r1, [r1] movs r2, 0x8D lsls r2, 2 adds r0, r2 strb r1, [r0] movs r4, 0 @08076DA0: ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x64 muls r1, r4 adds r0, r1 movs r2, 0x8E lsls r2, 2 adds r0, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0x64 bl memcpy adds r4, 0x1 cmp r4, 0x5 ble @08076DA0 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end copy_player_party_to_sav1 thumb_func_start copy_player_party_from_sav1 copy_player_party_from_sav1: ; 8076DD4 push {r4,r5,lr} ldr r1, =0x020244e9 ldr r0, =0x03005d8c ldr r0, [r0] movs r2, 0x8D lsls r2, 2 adds r0, r2 ldrb r0, [r0] strb r0, [r1] movs r4, 0 ldr r5, =0x020244ec @08076DEA: movs r0, 0x64 adds r2, r4, 0 muls r2, r0 adds r0, r2, r5 ldr r1, =0x03005d8c ldr r1, [r1] adds r1, r2 movs r2, 0x8E lsls r2, 2 adds r1, r2 movs r2, 0x64 bl memcpy adds r4, 0x1 cmp r4, 0x5 ble @08076DEA pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end copy_player_party_from_sav1 thumb_func_start save_serialize_npcs save_serialize_npcs: ; 8076E1C push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x03005d8c mov r12, r0 movs r5, 0xA3 lsls r5, 4 mov r8, r5 ldr r4, =0x02037350 movs r3, 0 movs r2, 0xF @08076E32: mov r6, r12 ldr r1, [r6] adds r1, r3 add r1, r8 adds r0, r4, 0 ldm r0!, {r5-r7} stm r1!, {r5-r7} ldm r0!, {r5-r7} stm r1!, {r5-r7} ldm r0!, {r5-r7} stm r1!, {r5-r7} adds r4, 0x24 adds r3, 0x24 subs r2, 0x1 cmp r2, 0 bge @08076E32 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end save_serialize_npcs thumb_func_start save_deserialize_npcs save_deserialize_npcs: ; 8076E64 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x03005d8c mov r12, r0 movs r5, 0xA3 lsls r5, 4 mov r8, r5 ldr r4, =0x02037350 movs r3, 0 movs r2, 0xF @08076E7A: mov r6, r12 ldr r1, [r6] adds r1, r3 adds r0, r4, 0 add r1, r8 ldm r1!, {r5-r7} stm r0!, {r5-r7} ldm r1!, {r5-r7} stm r0!, {r5-r7} ldm r1!, {r5-r7} stm r0!, {r5-r7} adds r4, 0x24 adds r3, 0x24 subs r2, 0x1 cmp r2, 0 bge @08076E7A pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end save_deserialize_npcs thumb_func_start save_serialize_game save_serialize_game: ; 8076EAC push {lr} bl copy_player_party_to_sav1 bl save_serialize_npcs pop {r0} bx r0 thumb_func_end save_serialize_game thumb_func_start save_deserialize_game save_deserialize_game: ; 8076EBC push {lr} bl copy_player_party_from_sav1 bl save_deserialize_npcs pop {r0} bx r0 thumb_func_end save_deserialize_game thumb_func_start 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, =0x02032180 mov r12, r0 ldr r1, =0x03005d90 mov r10, r1 ldr r5, =0x03005d8c movs r3, 0xAC lsls r3, 3 ldr r4, =0x02031c58 @08076EE8: lsls r0, r2, 2 ldr r1, [r5] adds r1, r3 adds r1, r0 ldr r0, [r1] stm r4!, {r0} adds r2, 0x1 cmp r2, 0x1D ble @08076EE8 movs r2, 0 ldr r0, =0x02031c58 ldr r5, =0x03005d8c movs r3, 0xBB lsls r3, 3 adds r4, r0, 0 adds r4, 0x78 @08076F08: lsls r0, r2, 2 ldr r1, [r5] adds r1, r3 adds r1, r0 ldr r0, [r1] stm r4!, {r0} adds r2, 0x1 cmp r2, 0x1D ble @08076F08 movs r2, 0 ldr r0, =0x02031c58 ldr r5, =0x03005d8c movs r3, 0xCA lsls r3, 3 adds r4, r0, 0 adds r4, 0xF0 @08076F28: lsls r0, r2, 2 ldr r1, [r5] adds r1, r3 adds r1, r0 ldr r0, [r1] stm r4!, {r0} adds r2, 0x1 cmp r2, 0xF ble @08076F28 movs r2, 0 ldr r0, =0x02031c58 ldr r5, =0x03005d8c movs r6, 0x98 lsls r6, 1 adds r4, r0, r6 movs r3, 0xD2 lsls r3, 3 @08076F4A: lsls r0, r2, 2 ldr r1, [r5] adds r1, r3 adds r1, r0 ldr r0, [r1] stm r4!, {r0} adds r2, 0x1 cmp r2, 0x3F ble @08076F4A movs r2, 0 ldr r0, =0x02031c58 ldr r5, =0x03005d8c movs r7, 0x8C lsls r7, 2 adds r4, r0, r7 movs r3, 0xF2 lsls r3, 3 @08076F6C: lsls r0, r2, 2 ldr r1, [r5] adds r1, r3 adds r1, r0 ldr r0, [r1] stm r4!, {r0} adds r2, 0x1 cmp r2, 0x2D ble @08076F6C ldr r0, =0x02031c58 ldr r1, =0x03005d8c mov r8, r1 movs r5, 0xBA lsls r5, 2 adds r4, r0, r5 movs r3, 0 ldr r6, =0x00002be0 mov r9, r6 movs r2, 0xF @08076F92: mov r7, r8 ldr r1, [r7] adds r1, r3 adds r0, r4, 0 add r1, r9 ldm r1!, {r5-r7} stm r0!, {r5-r7} ldm r1!, {r5-r7} stm r0!, {r5-r7} ldm r1!, {r5-r7} stm r0!, {r5-r7} adds r4, 0x24 adds r3, 0x24 subs r2, 0x1 cmp r2, 0 bge @08076F92 mov r1, r10 ldr r0, [r1] adds r0, 0xAC ldr r0, [r0] mov r5, r12 str r0, [r5] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 mov r8, r0 ldr r1, =0x02032180 mov r12, r1 ldr r5, =0x03005d8c movs r3, 0xAC lsls r3, 3 ldr r4, =0x02031c58 @08076FFC: ldr r0, [r5] lsls r1, r2, 2 adds r0, r3 adds r0, r1 ldm r4!, {r1} str r1, [r0] adds r2, 0x1 cmp r2, 0x1D ble @08076FFC movs r2, 0 ldr r5, =0x03005d8c movs r4, 0xBB lsls r4, 3 ldr r0, =0x02031c58 adds r3, r0, 0 adds r3, 0x78 @0807701C: ldr r0, [r5] lsls r1, r2, 2 adds r0, r4 adds r0, r1 ldm r3!, {r1} str r1, [r0] adds r2, 0x1 cmp r2, 0x1D ble @0807701C movs r2, 0 ldr r5, =0x03005d8c movs r4, 0xCA lsls r4, 3 ldr r0, =0x02031c58 adds r3, r0, 0 adds r3, 0xF0 @0807703C: ldr r0, [r5] lsls r1, r2, 2 adds r0, r4 adds r0, r1 ldm r3!, {r1} str r1, [r0] adds r2, 0x1 cmp r2, 0xF ble @0807703C movs r2, 0 ldr r5, =0x03005d8c movs r4, 0xD2 lsls r4, 3 ldr r0, =0x02031c58 movs r6, 0x98 lsls r6, 1 adds r3, r0, r6 @0807705E: ldr r0, [r5] lsls r1, r2, 2 adds r0, r4 adds r0, r1 ldm r3!, {r1} str r1, [r0] adds r2, 0x1 cmp r2, 0x3F ble @0807705E movs r2, 0 ldr r5, =0x03005d8c movs r4, 0xF2 lsls r4, 3 ldr r0, =0x02031c58 movs r7, 0x8C lsls r7, 2 adds r3, r0, r7 @08077080: ldr r0, [r5] lsls r1, r2, 2 adds r0, r4 adds r0, r1 ldm r3!, {r1} str r1, [r0] adds r2, 0x1 cmp r2, 0x2D ble @08077080 ldr r0, =0x03005d8c mov r9, r0 ldr r1, =0x00002be0 mov r10, r1 ldr r4, =0x02031c58 movs r3, 0 movs r2, 0xF @080770A0: mov r5, r9 ldr r1, [r5] adds r1, r3 add r1, r10 movs r6, 0xBA lsls r6, 2 adds r0, r4, r6 ldm r0!, {r5-r7} stm r1!, {r5-r7} ldm r0!, {r5-r7} stm r1!, {r5-r7} ldm r0!, {r5-r7} stm r1!, {r5-r7} adds r4, 0x24 adds r3, 0x24 subs r2, 0x1 cmp r2, 0 bge @080770A0 mov r7, r8 ldr r0, [r7] adds r0, 0xAC ldr r4, [r0] mov r2, r12 ldr r1, [r2] str r1, [r0] adds r0, r4, 0 bl encrypt_decrypt_all_item_quantities ldr r0, [r7] adds r0, 0xAC str r4, [r0] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8076FE0 thumb_func_start apply_u16_xor_crypto apply_u16_xor_crypto: ; 8077100 ldr r2, =0x03005d90 ldr r2, [r2] adds r2, 0xAC ldr r2, [r2] ldrh r3, [r0] eors r2, r3 eors r2, r1 strh r2, [r0] bx lr .align 2, 0 .pool thumb_func_end apply_u16_xor_crypto thumb_func_start apply_u32_xor_crypto apply_u32_xor_crypto: ; 8077118 ldr r2, =0x03005d90 ldr r3, [r2] adds r3, 0xAC ldr r2, [r0] ldr r3, [r3] eors r2, r3 eors r2, r1 str r2, [r0] bx lr .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r5] movs r1, 0x92 lsls r1, 3 adds r0, r1 adds r1, r4, 0 bl apply_u32_xor_crypto ldr r0, [r5] ldr r1, =0x00000494 adds r0, r1 adds r1, r4, 0 bl apply_u16_xor_crypto pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022c2c ldrb r0, [r0] cmp r0, 0x1D beq @08077194 lsls r2, r3, 16 lsrs r2, 16 movs r0, 0 adds r1, r4, 0 bl link_0800A448 lsls r0, 24 lsrs r0, 24 b @080771A2 .align 2, 0 .pool @08077194: ldr r0, =0x03004140 ldrb r0, [r0] movs r1, 0x54 adds r2, r4, 0 bl rfu_NI_setSendData movs r0, 0x1 @080771A2: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8077170 thumb_func_start sub_80771AC sub_80771AC: ; 80771AC push {lr} lsls r0, 24 lsrs r0, 24 bl sub_800A4D8 pop {r0} bx r0 thumb_func_end sub_80771AC thumb_func_start sub_80771BC sub_80771BC: ; 80771BC push {r4,lr} ldr r0, =0x02022c2c ldrb r0, [r0] cmp r0, 0x1D bne @080771F0 ldr r4, =0x03007880 ldr r0, =0x03004140 ldrb r0, [r0] bl sub_800E87C lsls r0, 2 adds r0, r4 ldr r0, [r0] ldrh r0, [r0] cmp r0, 0 bne @080771EC movs r0, 0x1 b @080771F8 .align 2, 0 .pool @080771EC: movs r0, 0 b @080771F8 @080771F0: bl sub_800A520 lsls r0, 24 lsrs r0, 24 @080771F8: pop {r4} pop {r1} bx r1 thumb_func_end sub_80771BC thumb_func_start sub_8077200 sub_8077200: ; 8077200 push {lr} bl sub_800A550 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_8077200 thumb_func_start sub_8077210 sub_8077210: ; 8077210 push {lr} bl sub_8077260 cmp r0, 0 beq @0807722C ldr r0, =0x03004140 ldrb r1, [r0] movs r0, 0xC bl rfu_clearSlot b @08077230 .align 2, 0 .pool @0807722C: bl sub_800A5B4 @08077230: pop {r0} bx r0 thumb_func_end sub_8077210 thumb_func_start sub_8077234 sub_8077234: ; 8077234 push {r4,lr} adds r4, r0, 0 bl sub_8077260 cmp r0, 0 beq @08077250 ldr r0, =0x03004140 ldrb r1, [r0] movs r0, 0xC bl rfu_clearSlot b @08077258 .align 2, 0 .pool @08077250: lsls r0, r4, 24 lsrs r0, 24 bl sub_800A5EC @08077258: pop {r4} pop {r0} bx r0 thumb_func_end sub_8077234 thumb_func_start sub_8077260 sub_8077260: ; 8077260 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08077280 ldr r0, =0x02022c2c ldrb r0, [r0] cmp r0, 0x1D bne @08077280 movs r0, 0x1 b @08077282 .align 2, 0 .pool @08077280: movs r0, 0 @08077282: pop {r1} bx r1 thumb_func_end sub_8077260 thumb_func_start sub_8077288 sub_8077288: ; 8077288 push {lr} bl sub_800ADF8 pop {r0} bx r0 thumb_func_end sub_8077288 thumb_func_start sub_8077294 sub_8077294: ; 8077294 push {lr} bl sub_800A520 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_8077294 thumb_func_start sub_80772A4 sub_80772A4: ; 80772A4 push {r4,r5,lr} sub sp, 0xC bl reset_all_obj_data bl gpu_pal_allocator_reset bl clear_tasks bl sub_80A1A74 ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] ldr r0, =sub_807811C bl SetVBlankCallback ldr r4, =gUnknown_0860F074 adds r0, r4, 0 movs r1, 0xF0 movs r2, 0x14 bl gpu_pal_apply adds r0, r4, 0 movs r1, 0xD0 movs r2, 0x14 bl gpu_pal_apply movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_0832DEE4 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r0, =0x0203229c ldr r1, [r0] movs r0, 0x8F lsls r0, 4 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r0, =gUnknown_0832DEF4 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, =0x0203229c ldr r0, [r2] adds r0, 0x69 movs r1, 0 strb r1, [r0] ldr r0, [r2] adds r0, 0x6F strb r1, [r0] ldr r0, [r2] adds r0, 0x70 strb r1, [r0] ldr r0, [r2] adds r0, 0x74 strb r1, [r0] ldr r0, [r2] adds r0, 0x75 strb r1, [r0] ldr r0, [r2] adds r0, 0x7A strb r1, [r0] ldr r0, [r2] adds r0, 0x7B strb r1, [r0] ldr r0, [r2] adds r0, 0xA8 strb r1, [r0] @0807738C: add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80772A4 thumb_func_start sub_80773AC sub_80773AC: ; 80773AC push {lr} ldr r0, =sub_80773D0 bl set_callback2 ldr r0, =0x030022c0 movs r1, 0 str r1, [r0] ldr r0, =0x020244ea strb r1, [r0] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80773AC thumb_func_start sub_80773D0 sub_80773D0: ; 80773D0 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x28 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 ldrb r0, [r0] adds r3, r1, 0 cmp r0, 0x16 bls @080773EA b @08077B46 @080773EA: lsls r0, 2 ldr r1, =@080773FC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080773FC: .4byte @08077458 .4byte @080774A4 .4byte @08077560 .4byte @0807758C .4byte @080775E8 .4byte @08077648 .4byte @08077688 .4byte @080776A8 .4byte @080777E8 .4byte @08077810 .4byte @08077834 .4byte @080778BC .4byte @080778CA .4byte @08077970 .4byte @08077A40 .4byte @08077A80 .4byte @08077A9A .4byte @08077AA8 .4byte @08077ABC .4byte @08077ADC .4byte @08077AFC .4byte @08077B10 .4byte @08077B30 @08077458: ldr r4, =0x0203229c ldr r0, =0x000010f0 bl malloc_and_clear str r0, [r4] bl sub_80772A4 ldr r4, =0x02032184 movs r0, 0xE0 lsls r0, 4 bl malloc_and_clear str r0, [r4] movs r6, 0 ldr r2, =0x02032188 @08077476: lsls r1, r6, 8 ldr r0, [r4] adds r0, r1 stm r2!, {r0} adds r6, 0x1 cmp r6, 0xD ble @08077476 ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @08077B22 .align 2, 0 .pool @080774A4: ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] movs r6, 0 movs r4, 0 @080774B2: movs r0, 0x64 muls r0, r6 ldr r1, =0x02024744 adds r0, r1 str r4, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] str r4, [sp, 0xC] movs r1, 0 movs r2, 0 movs r3, 0x20 bl create_pokemon_set_level adds r6, 0x1 cmp r6, 0x5 ble @080774B2 movs r0, 0 bl sub_807A19C movs r0, 0 bl gpu_sync_bg_show ldr r0, =0x03003124 ldrb r2, [r0] cmp r2, 0 bne @0807754C ldr r1, =0x020229c6 ldr r5, =0x00001122 adds r0, r5, 0 strh r0, [r1] ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0xA8 strb r2, [r0] ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08077528 bl sub_800B488 bl sub_8009734 bl sub_8011BA4 b @08077B46 .align 2, 0 .pool @08077528: bl sub_8009734 ldr r0, =0x030022c0 movs r7, 0x87 lsls r7, 3 adds r0, r7 ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] ldr r0, =task00_08081A90 movs r1, 0x1 bl AddTask b @08077B46 .align 2, 0 .pool @0807754C: ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x4 strb r1, [r0] b @08077B46 .align 2, 0 .pool @08077560: ldr r2, =0x0203229c ldr r1, [r2] adds r1, 0xA8 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r2] adds r1, r0, 0 adds r1, 0xA8 ldrb r0, [r1] cmp r0, 0xB bhi @0807757A b @08077B46 @0807757A: movs r0, 0 strb r0, [r1] movs r2, 0x87 lsls r2, 3 adds r1, r3, r2 b @08077B22 .align 2, 0 .pool @0807758C: bl sub_800ABAC adds r4, r0, 0 bl sub_800AA48 lsls r4, 24 lsls r0, 24 cmp r4, r0 bcs @080775A0 b @08077B46 @080775A0: bl sub_800ABBC lsls r0, 24 cmp r0, 0 beq @080775D8 ldr r0, =0x0203229c ldr r1, [r0] adds r1, 0xA8 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x1E bhi @080775C0 b @08077B46 @080775C0: bl sub_800A620 ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @08077B22 .align 2, 0 .pool @080775D8: ldr r1, =0x030022c0 movs r5, 0x87 lsls r5, 3 adds r1, r5 b @08077B22 .align 2, 0 .pool @080775E8: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 beq @080775F2 b @08077B46 @080775F2: bl sub_800A23C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08077600 b @08077B46 @08077600: bl sub_8011BD0 bl calc_player_party_count ldr r1, =0x030022c0 movs r7, 0x87 lsls r7, 3 adds r1, r7 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0xA8 strb r2, [r0] ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @0807762A b @08077B46 @0807762A: movs r0, 0x1 bl sub_801048C bl sub_800ADF8 b @08077B46 .align 2, 0 .pool @08077648: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08077680 bl sub_8010500 lsls r0, 24 cmp r0, 0 bne @0807765C b @08077B46 @0807765C: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 b @08077B46 .align 2, 0 .pool @08077680: movs r2, 0x87 lsls r2, 3 adds r1, r3, r2 b @08077B22 @08077688: bl shedinja_maker_maybe lsls r0, 24 cmp r0, 0 bne @08077694 b @08077B46 @08077694: bl sub_807A5B0 ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @08077B22 .align 2, 0 .pool @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, =0x0203229c ldr r0, [r2] ldr r1, =0x020244e9 ldrb r1, [r1] adds r0, 0x36 strb r1, [r0] ldr r0, [r2] ldr r1, =0x020244ea ldrb r1, [r1] adds r0, 0x37 strb r1, [r0] movs r6, 0 ldr r0, [r2] adds r0, 0x36 ldrb r0, [r0] cmp r6, r0 bge @08077740 mov r8, r2 ldr r7, =gUnknown_0832DE24 @080776E2: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 bl pokemon_getattr ldrb r2, [r7] lsls r2, 19 movs r1, 0xE0 lsls r1, 12 adds r2, r1 asrs r2, 16 ldrb r3, [r7, 0x1] lsls r3, 19 ldr r1, =0xfff40000 adds r3, r1 asrs r3, 16 movs r1, 0x1 str r1, [sp] str r0, [sp, 0x4] str r1, [sp, 0x8] adds r0, r5, 0 ldr r1, =sub_80D3014 bl sub_80D2CC4 mov r2, r8 ldr r1, [r2] adds r1, 0x28 adds r1, r6 strb r0, [r1] adds r7, 0x2 adds r6, 0x1 ldr r0, [r2] adds r0, 0x36 ldrb r0, [r0] cmp r6, r0 blt @080776E2 @08077740: movs r6, 0 ldr r1, =0x0203229c ldr r0, [r1] adds r0, 0x37 ldrb r0, [r0] cmp r6, r0 bge @080777B8 ldr r0, =gUnknown_0832DE24 mov r8, r1 adds r7, r0, 0 adds r7, 0xC @08077756: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 bl pokemon_getattr ldrb r2, [r7] lsls r2, 19 movs r3, 0xE0 lsls r3, 12 adds r2, r3 asrs r2, 16 ldrb r3, [r7, 0x1] lsls r3, 19 ldr r1, =0xfff40000 adds r3, r1 asrs r3, 16 movs r1, 0x1 str r1, [sp] str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] adds r0, r5, 0 ldr r1, =sub_80D3014 bl sub_80D2CC4 mov r2, r8 ldr r1, [r2] adds r1, 0x2E adds r1, r6 strb r0, [r1] adds r7, 0x2 adds r6, 0x1 ldr r0, [r2] adds r0, 0x37 ldrb r0, [r0] cmp r6, r0 blt @08077756 @080777B8: ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @08077B22 .align 2, 0 .pool @080777E8: bl sub_81B5D30 ldr r0, =0x0203229c ldr r1, [r0] adds r0, r1, 0 adds r0, 0x36 adds r1, 0x28 movs r2, 0 bl sub_81B5D4C ldr r1, =0x030022c0 movs r5, 0x87 lsls r5, 3 adds r1, r5 b @08077B22 .align 2, 0 .pool @08077810: ldr r0, =0x0203229c ldr r1, [r0] adds r0, r1, 0 adds r0, 0x36 adds r1, 0x28 movs r2, 0x1 bl sub_81B5D4C ldr r1, =0x030022c0 movs r7, 0x87 lsls r7, 3 adds r1, r7 b @08077B22 .align 2, 0 .pool @08077834: ldr r0, =0x03005d90 ldr r0, [r0] ldr r5, =0x02032188 ldr r1, [r5] movs r4, 0x3 str r4, [sp] movs r2, 0 movs r3, 0 bl sub_80C6D80 bl link_get_multiplayer_id lsls r0, 24 movs r1, 0x80 lsls r1, 17 eors r1, r0 lsrs r1, 24 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 ldr r1, =0x020229f0 adds r0, r1 ldr r1, [r5, 0xC] str r4, [sp] movs r2, 0 movs r3, 0 bl sub_80C6D80 ldr r4, =gUnknown_0832DE94 ldr r0, [r4] ldr r1, [r5, 0x18] movs r2, 0x2 str r2, [sp] movs r2, 0 movs r3, 0 bl sub_80C6D80 ldr r0, [r4, 0x4] ldr r1, [r5, 0x20] movs r2, 0x18 bl sub_807A308 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0xA8 strb r2, [r0] b @08077B46 .align 2, 0 .pool @080778BC: bl sub_807A1F0 lsls r0, 24 cmp r0, 0 bne @080778C8 b @08077B46 @080778C8: b @08077B1A @080778CA: ldr r0, =0x03005d90 ldr r1, [r0] movs r0, 0x1 movs r2, 0x78 bl sub_81DB35C movs r6, 0 add r5, sp, 0x10 adds r4, r0, 0 adds r4, 0x10 @080778DE: add r1, sp, 0x10 ldr r0, =gUnknown_0832DCAC ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldrh r0, [r5] adds r0, r6 strh r0, [r5] lsls r1, r4, 16 asrs r1, 16 add r0, sp, 0x10 movs r2, 0xA movs r3, 0x1 bl 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, =0x020229f0 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, =gUnknown_0832DCAC ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} adds r0, r6, 0x3 ldrh r3, [r5] adds r0, r3 strh r0, [r5] lsls r1, r4, 16 asrs r1, 16 add r0, sp, 0x10 movs r2, 0xA movs r3, 0x1 bl obj_add_from_template_forward_search adds r4, 0x20 adds r6, 0x1 cmp r6, 0x2 ble @0807792C ldr r1, =0x030022c0 movs r5, 0x87 lsls r5, 3 adds r1, r5 b @08077B22 .align 2, 0 .pool @08077970: ldr r4, =gUnknown_0832DCAC add r1, sp, 0x10 adds r0, r4, 0 ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldm r0!, {r2,r5,r7} stm r1!, {r2,r5,r7} add r1, sp, 0x10 adds r0, r1, 0 ldrh r0, [r0] adds r0, 0x6 strh r0, [r1] adds r0, r1, 0 movs r1, 0xD7 movs r2, 0x98 movs r3, 0x1 bl 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, =gUnknown_0832DCAC ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} adds r0, r6, 0 adds r0, 0x8 ldrh r7, [r4] adds r0, r7 strh r0, [r4] asrs r1, r5, 16 add r0, sp, 0x10 movs r2, 0x96 movs r3, 0x1 bl 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, =gUnknown_0832DC94 ldr r2, =gUnknown_0832DE24 ldrb r1, [r2] lsls r1, 19 movs r3, 0x80 lsls r3, 14 adds r1, r3 asrs r1, 16 ldrb r2, [r2, 0x1] lsls r2, 3 movs r3, 0x2 bl obj_add_from_template_forward_search ldr r2, =0x0203229c ldr r1, [r2] adds r1, 0x34 movs r3, 0 strb r0, [r1] ldr r0, [r2] adds r0, 0x35 strb r3, [r0] ldr r1, =0x030022c0 movs r5, 0x87 lsls r5, 3 adds r1, r5 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r0, 0 bl rbox_fill_rectangle b @08077B46 .align 2, 0 .pool @08077A40: movs r0, 0 bl sub_807A320 movs r0, 0 bl sub_8079BE0 ldr r2, =0x0203229c ldr r0, [r2] movs r1, 0 strb r1, [r0] ldr r0, [r2] strb r1, [r0, 0x1] bl sub_8078388 ldr r1, =0x030022c0 movs r7, 0x87 lsls r7, 3 adds r1, r7 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, =0x000001b3 bl song_play_for_text b @08077B46 .align 2, 0 .pool @08077A80: movs r0, 0x1 bl sub_807A320 movs r0, 0x1 bl sub_8079BE0 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @08077A9A: movs r0, 0 bl sub_80782B8 b @08077B1A .align 2, 0 .pool @08077AA8: movs r0, 0x1 bl sub_80782B8 ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @08077B22 .align 2, 0 .pool @08077ABC: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r1, =0x030022c0 movs r5, 0x87 lsls r5, 3 adds r1, r5 b @08077B22 .align 2, 0 .pool @08077ADC: movs r1, 0x82 lsls r1, 5 movs r0, 0 bl lcd_io_set movs r0, 0x2 bl sub_80782B8 ldr r1, =0x030022c0 movs r7, 0x87 lsls r7, 3 adds r1, r7 b @08077B22 .align 2, 0 .pool @08077AFC: movs r0, 0 bl sub_807A468 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @08077B22 .align 2, 0 .pool @08077B10: movs r0, 0x1 bl sub_807A468 bl sub_807A53C @08077B1A: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @08077B22: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08077B46 .align 2, 0 .pool @08077B30: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08077B46 ldr r0, =sub_8078C34 str r0, [r3] ldr r0, =sub_807825C bl 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 .pool thumb_func_end sub_80773D0 thumb_func_start sub_8077B74 sub_8077B74: ; 8077B74 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x24 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0x16 bls @08077B8E b @080780F6 @08077B8E: lsls r0, 2 ldr r1, =@08077BA0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08077BA0: .4byte @08077BFC .4byte @08077C10 .4byte @08077C18 .4byte @08077C20 .4byte @08077C28 .4byte @08077C3C .4byte @08077C64 .4byte @08077C6C .4byte @08077DB0 .4byte @08077DD8 .4byte @08077DFC .4byte @08077E84 .4byte @08077EA0 .4byte @08077F48 .4byte @080780F6 .4byte @080780F6 .4byte @08078038 .4byte @08078040 .4byte @08078068 .4byte @080780A4 .4byte @080780C4 .4byte @080780CC .4byte @080780E4 @08077BFC: bl sub_80772A4 ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080780D8 .align 2, 0 .pool @08077C10: movs r5, 0x87 lsls r5, 3 adds r1, r2, r5 b @08077E58 @08077C18: movs r7, 0x87 lsls r7, 3 adds r1, r2, r7 b @080780D8 @08077C20: movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 b @080780D8 @08077C28: bl calc_player_party_count ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @080780D8 .align 2, 0 .pool @08077C3C: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08077C50 bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 @08077C50: ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080780D8 .align 2, 0 .pool @08077C64: movs r5, 0x87 lsls r5, 3 adds r1, r2, r5 b @080780D8 @08077C6C: bl calc_enemy_party_count ldr r4, =0x0203229c ldr r0, [r4] ldr r1, =0x020244e9 ldrb r1, [r1] adds r0, 0x36 strb r1, [r0] ldr r0, [r4] ldr r1, =0x020244ea ldrb r1, [r1] adds r0, 0x37 strb r1, [r0] movs r0, 0 bl 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, =gUnknown_0832DE24 @08077CA8: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 bl pokemon_getattr ldrb r2, [r7] lsls r2, 19 movs r1, 0xE0 lsls r1, 12 adds r2, r1 asrs r2, 16 ldrb r3, [r7, 0x1] lsls r3, 19 ldr r1, =0xfff40000 adds r3, r1 asrs r3, 16 movs r1, 0x1 str r1, [sp] str r0, [sp, 0x4] str r1, [sp, 0x8] adds r0, r5, 0 ldr r1, =sub_80D3014 bl sub_80D2CC4 mov r2, r8 ldr r1, [r2] adds r1, 0x28 adds r1, r6 strb r0, [r1] adds r7, 0x2 adds r6, 0x1 ldr r0, [r2] adds r0, 0x36 ldrb r0, [r0] cmp r6, r0 blt @08077CA8 @08077D08: movs r6, 0 ldr r1, =0x0203229c ldr r0, [r1] adds r0, 0x37 ldrb r0, [r0] cmp r6, r0 bge @08077D80 ldr r0, =gUnknown_0832DE24 mov r8, r1 adds r7, r0, 0 adds r7, 0xC @08077D1E: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 movs r1, 0 bl pokemon_getattr ldrb r2, [r7] lsls r2, 19 movs r3, 0xE0 lsls r3, 12 adds r2, r3 asrs r2, 16 ldrb r3, [r7, 0x1] lsls r3, 19 ldr r1, =0xfff40000 adds r3, r1 asrs r3, 16 movs r1, 0x1 str r1, [sp] str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] adds r0, r5, 0 ldr r1, =sub_80D3014 bl sub_80D2CC4 mov r2, r8 ldr r1, [r2] adds r1, 0x2E adds r1, r6 strb r0, [r1] adds r7, 0x2 adds r6, 0x1 ldr r0, [r2] adds r0, 0x37 ldrb r0, [r0] cmp r6, r0 blt @08077D1E @08077D80: ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080780D8 .align 2, 0 .pool @08077DB0: bl sub_81B5D30 ldr r0, =0x0203229c ldr r1, [r0] adds r0, r1, 0 adds r0, 0x36 adds r1, 0x28 movs r2, 0 bl sub_81B5D4C ldr r1, =0x030022c0 movs r5, 0x87 lsls r5, 3 adds r1, r5 b @080780D8 .align 2, 0 .pool @08077DD8: ldr r0, =0x0203229c ldr r1, [r0] adds r0, r1, 0 adds r0, 0x36 adds r1, 0x28 movs r2, 0x1 bl sub_81B5D4C ldr r1, =0x030022c0 movs r7, 0x87 lsls r7, 3 adds r1, r7 b @080780D8 .align 2, 0 .pool @08077DFC: ldr r0, =0x03005d90 ldr r0, [r0] ldr r5, =0x02032188 ldr r1, [r5] movs r4, 0x3 str r4, [sp] movs r2, 0 movs r3, 0 bl sub_80C6D80 bl link_get_multiplayer_id lsls r0, 24 movs r1, 0x80 lsls r1, 17 eors r1, r0 lsrs r1, 24 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 ldr r1, =0x020229f0 adds r0, r1 ldr r1, [r5, 0xC] str r4, [sp] movs r2, 0 movs r3, 0 bl sub_80C6D80 ldr r4, =gUnknown_0832DE94 ldr r0, [r4] ldr r1, [r5, 0x18] movs r2, 0x2 str r2, [sp] movs r2, 0 movs r3, 0 bl sub_80C6D80 ldr r0, [r4, 0x4] ldr r1, [r5, 0x20] movs r2, 0x18 bl sub_807A308 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @08077E58: ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0xA8 strb r2, [r0] b @080780F6 .align 2, 0 .pool @08077E84: bl sub_807A1F0 lsls r0, 24 cmp r0, 0 bne @08077E90 b @080780F6 @08077E90: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @080780D8 .align 2, 0 .pool @08077EA0: ldr r0, =0x03005d90 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, =gUnknown_0832DCAC ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldrh r0, [r5] adds r0, r6 strh r0, [r5] lsls r1, r4, 16 asrs r1, 16 add r0, sp, 0xC movs r2, 0xA movs r3, 0x1 bl 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, =0x020229f0 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, =gUnknown_0832DCAC ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} adds r0, r6, 0x3 ldrh r3, [r5] adds r0, r3 strh r0, [r5] lsls r1, r4, 16 asrs r1, 16 add r0, sp, 0xC movs r2, 0xA movs r3, 0x1 bl obj_add_from_template_forward_search adds r4, 0x20 adds r6, 0x1 cmp r6, 0x2 ble @08077F02 ldr r1, =0x030022c0 movs r5, 0x87 lsls r5, 3 adds r1, r5 b @080780D8 .align 2, 0 .pool @08077F48: ldr r4, =gUnknown_0832DCAC add r1, sp, 0xC adds r0, r4, 0 ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldm r0!, {r2,r5,r7} stm r1!, {r2,r5,r7} add r1, sp, 0xC adds r0, r1, 0 ldrh r0, [r0] adds r0, 0x6 strh r0, [r1] adds r0, r1, 0 movs r1, 0xD7 movs r2, 0x98 movs r3, 0x1 bl 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, =gUnknown_0832DCAC ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} ldm r0!, {r2,r3,r7} stm r1!, {r2,r3,r7} adds r0, r6, 0 adds r0, 0x8 ldrh r7, [r4] adds r0, r7 strh r0, [r4] asrs r1, r5, 16 add r0, sp, 0xC movs r2, 0x96 movs r3, 0x1 bl 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, =0x0203229c ldr r1, [r0] adds r2, r1, 0 adds r2, 0x35 ldrb r1, [r2] adds r4, r0, 0 cmp r1, 0x5 bhi @08077FE4 ldr r0, =0x0203cf20 ldrb r0, [r0] b @08077FEA .align 2, 0 .pool @08077FE4: ldr r0, =0x0203cf20 ldrb r0, [r0] adds r0, 0x6 @08077FEA: strb r0, [r2] ldr r0, =gUnknown_0832DC94 ldr r3, =gUnknown_0832DE24 ldr r1, [r4] adds r1, 0x35 ldrb r2, [r1] lsls r2, 1 adds r1, r2, r3 ldrb r1, [r1] lsls r1, 19 movs r5, 0x80 lsls r5, 14 adds r1, r5 asrs r1, 16 adds r3, 0x1 adds r2, r3 ldrb r2, [r2] lsls r2, 3 movs r3, 0x2 bl obj_add_from_template_forward_search ldr r1, [r4] adds r1, 0x34 strb r0, [r1] ldr r0, =0x030022c0 movs r7, 0x87 lsls r7, 3 adds r0, r7 movs r1, 0x10 strb r1, [r0] b @080780F6 .align 2, 0 .pool @08078038: movs r0, 0 bl sub_80782B8 b @080780D0 @08078040: movs r0, 0x1 bl sub_80782B8 ldr r2, =0x0203229c ldr r0, [r2] movs r1, 0 strb r1, [r0] ldr r0, [r2] strb r1, [r0, 0x1] bl sub_8078388 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @080780D8 .align 2, 0 .pool @08078068: ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] movs r4, 0x1 negs r4, r4 adds r0, r4, 0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080780D8 .align 2, 0 .pool @080780A4: movs r1, 0x82 lsls r1, 5 movs r0, 0 bl lcd_io_set movs r0, 0x2 bl sub_80782B8 ldr r1, =0x030022c0 movs r5, 0x87 lsls r5, 3 adds r1, r5 b @080780D8 .align 2, 0 .pool @080780C4: movs r7, 0x87 lsls r7, 3 adds r1, r2, r7 b @080780D8 @080780CC: bl sub_807A53C @080780D0: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @080780D8: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080780F6 .align 2, 0 .pool @080780E4: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080780F6 ldr r0, =sub_807825C bl 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 .pool 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, =0x0203229c ldr r1, [r4] adds r1, 0xA8 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0xF bls @08078160 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl 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 .pool thumb_func_end sub_8078130 thumb_func_start sub_807816C sub_807816C: ; 807816C push {r4,lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080781C2 ldr r1, =0x02032298 ldr r4, =0x0203229c ldr r2, [r4] adds r0, r2, 0 adds r0, 0x35 ldrb r0, [r0] strb r0, [r1] adds r0, r2, 0 adds r0, 0x7E ldrb r0, [r0] strb r0, [r1, 0x1] ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080781B4 adds r1, r2, 0 adds r1, 0x6F movs r0, 0x10 strb r0, [r1] b @080781C2 .align 2, 0 .pool @080781B4: movs r0, 0x20 bl sub_800ABF4 ldr r0, [r4] adds r0, 0x6F movs r1, 0xD strb r1, [r0] @080781C2: pop {r4} pop {r0} bx r0 thumb_func_end sub_807816C thumb_func_start sub_80781C8 sub_80781C8: ; 80781C8 push {r4,r5,lr} ldr r5, =0x030022c0 ldr r0, =sub_80773AC str r0, [r5, 0x8] ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08078220 bl sub_8010500 lsls r0, 24 cmp r0, 0 beq @08078244 ldr r0, =0x02032184 ldr r0, [r0] bl free bl Window_FreeMemory ldr r0, =0x0203229c ldr r0, [r0] bl free movs r0, 0 str r0, [r5] bl sub_800E084 ldr r0, =sub_807AE50 bl set_callback2 b @08078244 .align 2, 0 .pool @08078220: ldr r0, =0x03003124 ldrb r4, [r0] cmp r4, 0 bne @08078244 ldr r0, =0x02032184 ldr r0, [r0] bl free bl Window_FreeMemory ldr r0, =0x0203229c ldr r0, [r0] bl free str r4, [r5] ldr r0, =sub_807AE50 bl set_callback2 @08078244: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80781C8 thumb_func_start sub_807825C sub_807825C: ; 807825C push {r4,lr} bl sub_80795AC bl sub_807A0C4 movs r0, 0 bl sub_80796B4 movs r0, 0x1 bl sub_80796B4 ldr r4, =0x0203229c ldr r2, [r4] ldrb r1, [r2] adds r0, r1, 0x1 strb r0, [r2] lsls r1, 24 lsrs r1, 24 movs r0, 0x18 bl 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 .pool thumb_func_end sub_807825C thumb_func_start sub_80782B8 sub_80782B8: ; 80782B8 push {r4,r5,lr} sub sp, 0xC lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x1 beq @08078324 cmp r4, 0x1 bgt @080782CE cmp r4, 0 beq @080782D4 b @0807837E @080782CE: cmp r4, 0x2 beq @0807834C b @0807837E @080782D4: ldr r0, =gUnknown_08DDB3E4 movs r1, 0 movs r2, 0x60 bl gpu_pal_apply ldr r1, =gUnknown_08DDB464 movs r2, 0x94 lsls r2, 5 movs r0, 0x1 movs r3, 0 bl gpu_copy_bg_tile_pattern_data_to_vram ldr r1, =gUnknown_08DDCF04 movs r0, 0x20 str r0, [sp] movs r0, 0x14 str r0, [sp, 0x4] str r4, [sp, 0x8] movs r0, 0x1 movs r2, 0 movs r3, 0 bl bg_copy_tilemap_rect_simple ldr r1, =gUnknown_0832CABC 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 .pool @08078324: ldr r1, =gUnknown_0832D2BC 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 .pool @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, =0x0203229c mov r8, r5 ldr r0, =0x02020630 mov r12, r0 movs r1, 0x5 negs r1, r1 mov r9, r1 movs r4, 0x6 movs r7, 0x1 movs r6, 0 @080783A6: mov r1, r8 ldr r0, [r1] adds r1, r0, 0 adds r1, 0x36 ldrb r1, [r1] cmp r3, r1 bge @080783E0 adds r0, 0x28 adds r0, r3 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 add r1, r12 adds r1, 0x3E ldrb r2, [r1] mov r0, r9 ands r0, r2 strb r0, [r1] ldr r0, [r5] adds r0, 0x38 adds r0, r3 strb r7, [r0] b @080783E6 .align 2, 0 .pool @080783E0: adds r0, 0x38 adds r0, r3 strb r6, [r0] @080783E6: mov r1, r8 ldr r0, [r1] adds r1, r0, 0 adds r1, 0x37 ldrb r1, [r1] cmp r3, r1 bge @08078416 adds r0, 0x2E adds r0, r3 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 add r1, r12 adds r1, 0x3E ldrb r2, [r1] mov r0, r9 ands r0, r2 strb r0, [r1] ldr r0, [r5] adds r0, 0x38 adds r0, r4 strb r7, [r0] b @0807841C @08078416: adds r0, 0x38 adds r0, r4 strb r6, [r0] @0807841C: adds r4, 0x1 adds r3, 0x1 cmp r3, 0x5 ble @080783A6 ldr r0, [r5] adds r0, 0x44 movs r1, 0x1 strb r1, [r0] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_8078388 thumb_func_start sub_8078438 sub_8078438: ; 8078438 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 movs r3, 0 cmp r3, r2 bcs @08078452 @08078444: adds r0, r5, r3 adds r1, r4, r3 ldrb r1, [r1] strb r1, [r0] adds r3, 0x1 cmp r3, r2 bcc @08078444 @08078452: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8078438 thumb_func_start shedinja_maker_maybe shedinja_maker_maybe: ; 8078458 push {r4-r6,lr} sub sp, 0xC bl link_get_multiplayer_id lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x69 ldrb r0, [r0] cmp r0, 0x15 bls @08078472 b @080787AA @08078472: lsls r0, 2 ldr r1, =@08078484 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08078484: .4byte @080784DC .4byte @08078508 .4byte @08078784 .4byte @08078534 .4byte @08078548 .4byte @0807857C .4byte @08078784 .4byte @08078598 .4byte @080785AC .4byte @080785E0 .4byte @08078784 .4byte @080785FC .4byte @08078610 .4byte @08078644 .4byte @08078784 .4byte @0807866C .4byte @08078680 .4byte @080786B4 .4byte @08078784 .4byte @080786DC .4byte @080786F0 .4byte @08078720 @080784DC: ldr r0, =0x020228c4 ldr r1, =0x020244ec movs r2, 0xC8 bl sub_8078438 ldr r3, =0x0203229c ldr r1, [r3] adds r1, 0x69 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] ldr r0, [r3] adds r0, 0xA8 strb r2, [r0] b @080787AA .align 2, 0 .pool @08078508: bl sub_80771BC cmp r0, 0 bne @08078512 b @080787AA @08078512: bl sub_8077200 cmp r0, 0 bne @08078524 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @08078524: bl sub_8077210 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @08078534: cmp r5, 0 bne @0807853E movs r0, 0x1 bl sub_80771AC @0807853E: ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @08078548: bl sub_8077200 cmp r0, 0x3 beq @08078552 b @080787AA @08078552: ldr r0, =0x02024744 movs r2, 0x1 adds r1, r5, 0 eors r1, r2 lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0xC8 bl sub_8078438 bl sub_8077210 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @0807857C: ldr r0, =0x020228c4 ldr r1, =0x020245b4 movs r2, 0xC8 bl sub_8078438 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @08078598: cmp r5, 0 bne @080785A2 movs r0, 0x1 bl sub_80771AC @080785A2: ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @080785AC: bl sub_8077200 cmp r0, 0x3 beq @080785B6 b @080787AA @080785B6: ldr r0, =0x0202480c movs r2, 0x1 adds r1, r5, 0 eors r1, r2 lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0xC8 bl sub_8078438 bl sub_8077210 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @080785E0: ldr r0, =0x020228c4 ldr r1, =0x0202467c movs r2, 0xC8 bl sub_8078438 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @080785FC: cmp r5, 0 bne @08078606 movs r0, 0x1 bl sub_80771AC @08078606: ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @08078610: bl sub_8077200 cmp r0, 0x3 beq @0807861A b @080787AA @0807861A: ldr r0, =0x020248d4 movs r2, 0x1 adds r1, r5, 0 eors r1, r2 lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0xC8 bl sub_8078438 bl sub_8077210 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @08078644: ldr r0, =0x020228c4 ldr r1, =0x03005d8c ldr r1, [r1] ldr r2, =0x00002be0 adds r1, r2 movs r2, 0xDC bl sub_8078438 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @0807866C: cmp r5, 0 bne @08078676 movs r0, 0x3 bl sub_80771AC @08078676: ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @08078680: bl sub_8077200 cmp r0, 0x3 beq @0807868A b @080787AA @0807868A: ldr r0, =0x020321c0 movs r2, 0x1 adds r1, r5, 0 eors r1, r2 lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0xD8 bl sub_8078438 bl sub_8077210 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @080786B4: ldr r0, =0x020228c4 ldr r1, =0x03005d8c ldr r1, [r1] ldr r2, =0x000031a8 adds r1, r2 movs r2, 0xB bl sub_8078438 ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @080786DC: cmp r5, 0 bne @080786E6 movs r0, 0x4 bl sub_80771AC @080786E6: ldr r0, =0x0203229c ldr r1, [r0] b @080787A2 .align 2, 0 .pool @080786F0: bl sub_8077200 cmp r0, 0x3 bne @080787AA ldr r4, =0x0203229c ldr r0, [r4] adds r0, 0xA9 movs r2, 0x1 adds r1, r5, 0 eors r1, r2 lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0xB bl sub_8078438 bl sub_8077210 ldr r1, [r4] b @080787A2 .align 2, 0 .pool @08078720: ldr r4, =0x02024744 ldr r6, =0x0000012f movs r5, 0x5 @08078726: adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 cmp r0, 0 beq @08078766 cmp r0, r6 bne @08078766 adds r0, r4, 0 movs r1, 0x3 bl pokemon_getattr cmp r0, 0x1 beq @08078766 adds r0, r4, 0 movs r1, 0x2 mov r2, sp bl pokemon_getattr mov r0, sp ldr r1, =gUnknown_0832DF94 bl sub_80092BC cmp r0, 0 bne @08078766 adds r0, r4, 0 movs r1, 0x2 ldr r2, =gSpeciesNames + SPECIES_SHEDINJA * POKEMON_NAME_LENGTH bl pokemon_setattr @08078766: adds r4, 0x64 subs r5, 0x1 cmp r5, 0 bge @08078726 movs r0, 0x1 b @080787AC .align 2, 0 .pool @08078784: ldr r2, =0x0203229c ldr r1, [r2] adds r1, 0xA8 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r2] adds r1, r0, 0 adds r1, 0xA8 ldrb r0, [r1] cmp r0, 0xA bls @080787AA movs r0, 0 strb r0, [r1] ldr r1, [r2] @080787A2: adds r1, 0x69 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @080787AA: movs r0, 0 @080787AC: add sp, 0xC pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end shedinja_maker_maybe thumb_func_start sub_80787B8 sub_80787B8: ; 80787B8 push {lr} ldr r0, =gUnknown_0832DAE5 ldr r1, =0x0203229c ldr r1, [r1] adds r1, 0x72 ldrh r1, [r1] lsls r1, 5 ldr r2, =0x06010000 adds r1, r2 movs r2, 0x18 bl sub_807A308 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80787B8 thumb_func_start sub_80787E0 sub_80787E0: ; 80787E0 push {r4,lr} lsls r1, 24 lsrs r4, r1, 24 movs r2, 0x1 adds r0, r4, 0 ands r0, r2 cmp r0, 0 beq @08078864 ldr r0, =0x020223c4 ldrh r1, [r0] ldr r0, =0x0000bbbb cmp r1, r0 beq @08078844 cmp r1, r0 bgt @08078814 ldr r0, =0x0000aabb cmp r1, r0 beq @08078834 b @0807885E .align 2, 0 .pool @08078814: ldr r0, =0x0000bbcc cmp r1, r0 beq @08078854 ldr r0, =0x0000eeaa cmp r1, r0 bne @0807885E ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x78 b @0807885A .align 2, 0 .pool @08078834: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x78 strb r2, [r0] b @0807885E .align 2, 0 .pool @08078844: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x7A strb r2, [r0] b @0807885E .align 2, 0 .pool @08078854: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x7A @0807885A: movs r1, 0x2 strb r1, [r0] @0807885E: movs r0, 0 bl sub_8077234 @08078864: movs r2, 0x2 adds r0, r4, 0 ands r0, r2 cmp r0, 0 beq @080788F6 ldr r3, =0x020223c4 movs r1, 0x80 lsls r1, 1 adds r0, r3, r1 ldrh r1, [r0] ldr r0, =0x0000bbbb cmp r1, r0 beq @080788D8 cmp r1, r0 bgt @0807889C ldr r0, =0x0000aabb cmp r1, r0 beq @080788BC b @080788F0 .align 2, 0 .pool @0807889C: ldr r0, =0x0000bbcc cmp r1, r0 beq @080788E8 ldr r0, =0x0000eeaa cmp r1, r0 bne @080788F0 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x79 b @080788EE .align 2, 0 .pool @080788BC: ldr r2, =0x0203229c ldr r1, [r2] movs r4, 0x81 lsls r4, 1 adds r0, r3, r4 ldrb r0, [r0] adds r0, 0x6 adds r1, 0x7E strb r0, [r1] ldr r0, [r2] adds r0, 0x79 b @080788DE .align 2, 0 .pool @080788D8: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x7B @080788DE: movs r1, 0x1 strb r1, [r0] b @080788F0 .align 2, 0 .pool @080788E8: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x7B @080788EE: strb r2, [r0] @080788F0: movs r0, 0x1 bl sub_8077234 @080788F6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80787E0 thumb_func_start sub_8078900 sub_8078900: ; 8078900 push {r4,r5,lr} sub sp, 0x4 lsls r1, 24 lsrs r5, r1, 24 movs r0, 0x1 ands r0, r5 cmp r0, 0 beq @080789E2 ldr r2, =0x020223c4 ldrh r1, [r2] ldr r0, =0x0000ddee cmp r1, r0 beq @080789CC cmp r1, r0 bgt @0807893C ldr r0, =0x0000ccdd cmp r1, r0 beq @080789AC ldr r0, =0x0000dddd cmp r1, r0 beq @08078978 b @080789DC .align 2, 0 .pool @0807893C: ldr r0, =0x0000eebb cmp r1, r0 beq @08078950 adds r0, 0x11 cmp r1, r0 beq @08078974 b @080789DC .align 2, 0 .pool @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, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0xB b @080789DA .align 2, 0 .pool @08078974: movs r0, 0x5 b @080789CE @08078978: ldr r4, =0x0203229c ldr r1, [r4] ldrb r0, [r2, 0x2] adds r0, 0x6 adds r1, 0x7E strb r0, [r1] movs r0, 0 bl rbox_fill_rectangle ldr r0, [r4] adds r0, 0x35 ldrb r0, [r0] bl sub_807967C ldr r0, [r4] adds r0, 0x7E ldrb r0, [r0] bl sub_807967C ldr r0, [r4] adds r0, 0x6F movs r1, 0x7 b @080789DA .align 2, 0 .pool @080789AC: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0xA b @080789DA .align 2, 0 .pool @080789CC: movs r0, 0x1 @080789CE: bl sub_807A19C ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0x8 @080789DA: strb r1, [r0] @080789DC: movs r0, 0 bl sub_8077234 @080789E2: movs r0, 0x2 ands r0, r5 cmp r0, 0 beq @080789F0 movs r0, 0x1 bl sub_8077234 @080789F0: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8078900 thumb_func_start sub_80789FC sub_80789FC: ; 80789FC push {r4-r6,lr} sub sp, 0x4 ldr r6, =0x0203229c ldr r2, [r6] adds r1, r2, 0 adds r1, 0x78 ldrb r0, [r1] cmp r0, 0 bne @08078A10 b @08078B44 @08078A10: adds r0, r2, 0 adds r0, 0x79 ldrb r0, [r0] cmp r0, 0 bne @08078A1C b @08078B44 @08078A1C: ldrh r1, [r1] ldr r0, =0x00000101 cmp r1, r0 bne @08078A64 adds r1, r2, 0 adds r1, 0x6F movs r0, 0x6 strb r0, [r1] ldr r2, [r6] adds r1, r2, 0 adds r1, 0x80 movs r4, 0 ldr r0, =0x0000dddd strh r0, [r1] adds r0, r2, 0 adds r0, 0x35 ldrb r1, [r0] adds r0, 0x4D strh r1, [r0] movs r0, 0x5 movs r1, 0 bl sub_807A048 ldr r0, [r6] adds r2, r0, 0 adds r2, 0x79 strb r4, [r2] adds r0, 0x78 strb r4, [r0] b @08078B44 .align 2, 0 .pool @08078A64: ldr r0, =0x00000201 cmp r1, r0 bne @08078AB4 movs r0, 0x1 bl sub_807A19C ldr r1, [r6] adds r2, r1, 0 adds r2, 0x80 movs r4, 0 movs r3, 0 ldr r0, =0x0000eecc strh r0, [r2] adds r1, 0x82 strh r3, [r1] movs r0, 0x5 movs r1, 0 bl sub_807A048 ldr r0, [r6] adds r1, r0, 0 adds r1, 0x7B strb r4, [r1] adds r0, 0x7A strb r4, [r0] ldr r0, [r6] adds r1, r0, 0 adds r1, 0x79 strb r4, [r1] adds r0, 0x78 strb r4, [r0] ldr r0, [r6] adds r0, 0x6F movs r1, 0x8 b @08078B42 .align 2, 0 .pool @08078AB4: movs r0, 0x81 lsls r0, 1 cmp r1, r0 bne @08078B00 movs r0, 0x5 bl sub_807A19C ldr r1, [r6] adds r2, r1, 0 adds r2, 0x80 movs r4, 0 movs r3, 0 ldr r0, =0x0000ddee strh r0, [r2] adds r1, 0x82 strh r3, [r1] movs r0, 0x5 movs r1, 0 bl sub_807A048 ldr r0, [r6] adds r1, r0, 0 adds r1, 0x7B strb r4, [r1] adds r0, 0x7A strb r4, [r0] ldr r0, [r6] adds r1, r0, 0 adds r1, 0x79 strb r4, [r1] adds r0, 0x78 strb r4, [r0] ldr r0, [r6] adds r0, 0x6F movs r1, 0x8 b @08078B42 .align 2, 0 .pool @08078B00: ldr r0, =0x00000202 cmp r1, r0 bne @08078B44 adds r1, r2, 0 adds r1, 0x80 movs r5, 0 movs r4, 0 ldr r0, =0x0000eebb strh r0, [r1] adds r0, r2, 0 adds r0, 0x82 strh r4, [r0] movs r0, 0x5 movs r1, 0 bl sub_807A048 movs r0, 0x1 negs r0, r0 str r4, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl 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, =0x0203229c ldr r3, [r5] adds r1, r3, 0 adds r1, 0x7A ldrb r0, [r1] cmp r0, 0 beq @08078BDC adds r0, r3, 0 adds r0, 0x7B ldrb r0, [r0] cmp r0, 0 beq @08078BDC ldrh r1, [r1] ldr r0, =0x00000101 cmp r1, r0 bne @08078B92 adds r1, r3, 0 adds r1, 0x80 movs r4, 0 movs r2, 0 ldr r0, =0x0000ccdd strh r0, [r1] adds r0, r3, 0 adds r0, 0x82 strh r2, [r0] movs r0, 0x5 movs r1, 0 bl sub_807A048 ldr r0, [r5] adds r0, 0x7A strb r4, [r0] ldr r0, [r5] adds r0, 0x7B strb r4, [r0] ldr r0, [r5] adds r0, 0x6F movs r1, 0x9 strb r1, [r0] @08078B92: ldr r1, [r5] adds r0, r1, 0 adds r0, 0x7A ldrb r0, [r0] cmp r0, 0x2 beq @08078BA8 adds r0, r1, 0 adds r0, 0x7B ldrb r0, [r0] cmp r0, 0x2 bne @08078BDC @08078BA8: movs r0, 0x1 bl sub_807A19C ldr r1, [r5] adds r2, r1, 0 adds r2, 0x80 movs r4, 0 movs r3, 0 ldr r0, =0x0000ddee strh r0, [r2] adds r1, 0x82 strh r3, [r1] movs r0, 0x5 movs r1, 0 bl sub_807A048 ldr r0, [r5] adds r0, 0x7A strb r4, [r0] ldr r0, [r5] adds r0, 0x7B strb r4, [r0] ldr r0, [r5] adds r0, 0x6F movs r1, 0x8 strb r1, [r0] @08078BDC: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80789FC thumb_func_start sub_8078BFC sub_8078BFC: ; 8078BFC push {lr} strh r1, [r0] strh r2, [r0, 0x2] movs r0, 0x5 movs r1, 0 bl sub_807A048 pop {r0} bx r0 thumb_func_end sub_8078BFC thumb_func_start sub_8078C10 sub_8078C10: ; 8078C10 push {lr} adds r3, r0, 0 adds r2, r1, 0 lsls r3, 16 lsrs r3, 16 lsls r2, 16 lsrs r2, 16 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x80 adds r1, r3, 0 bl sub_8078BFC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8078C10 thumb_func_start sub_8078C34 sub_8078C34: ; 8078C34 push {r4,lr} bl link_get_multiplayer_id lsls r0, 24 lsrs r4, r0, 24 bl sub_8077200 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @08078C5C cmp r4, 0 bne @08078C56 movs r0, 0 bl sub_80787E0 b @08078C5C @08078C56: adds r0, r4, 0 bl sub_8078900 @08078C5C: cmp r4, 0 bne @08078C64 bl sub_80789FC @08078C64: pop {r4} pop {r0} bx r0 thumb_func_end sub_8078C34 thumb_func_start sub_8078C6C sub_8078C6C: ; 8078C6C push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 movs r6, 0 movs r5, 0 ldr r2, =0x0203229c ldr r3, [r2] ldr r4, =gUnknown_0832DCEC lsls r2, r1, 1 adds r2, r1 lsls r2, 1 lsls r1, r0, 1 adds r1, r0 lsls r1, 3 adds r3, 0x38 adds r2, r1 adds r2, r4 @08078C92: ldrb r1, [r2] adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0x1 bne @08078CA8 adds r6, r1, 0 b @08078CB0 .align 2, 0 .pool @08078CA8: adds r2, 0x1 adds r5, 0x1 cmp r5, 0x5 ble @08078C92 @08078CB0: adds r0, r6, 0 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8078C6C thumb_func_start sub_8078CB8 sub_8078CB8: ; 8078CB8 push {r4-r7,lr} adds r7, r0, 0 lsls r1, 24 lsrs r1, 24 ldrb r0, [r7] bl sub_8078C6C lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0xC bne @08078D10 ldr r5, =0x0203229c ldr r0, [r5] adds r0, 0x34 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 movs r1, 0x1 bl 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 .pool @08078D10: ldr r4, =0x0203229c ldr r0, [r4] adds r0, 0x34 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 movs r1, 0 bl 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, =gUnknown_0832DE24 lsls r3, r6, 1 adds r0, r3, r2 ldrb r0, [r0] lsls r0, 3 adds r0, 0x20 strh r0, [r1, 0x20] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 adds r2, 0x1 adds r3, r2 ldrb r0, [r3] lsls r0, 3 strh r0, [r1, 0x22] @08078D58: ldrb r0, [r7] cmp r0, r6 beq @08078D64 movs r0, 0x5 bl audio_play @08078D64: strb r6, [r7] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8078CB8 thumb_func_start sub_8078D78 sub_8078D78: ; 8078D78 push {r4,lr} movs r0, 0 bl sub_807A19C ldr r4, =0x0203229c ldr r0, [r4] adds r0, 0x6F movs r1, 0x64 strb r1, [r0] bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08078DAC ldr r0, =0x0000aabb ldr r1, [r4] adds r1, 0x35 ldrb r1, [r1] bl sub_8078C10 b @08078DB4 .align 2, 0 .pool @08078DAC: ldr r0, [r4] adds r0, 0x78 movs r1, 0x1 strb r1, [r0] @08078DB4: pop {r4} pop {r0} bx r0 thumb_func_end sub_8078D78 thumb_func_start sub_8078DBC sub_8078DBC: ; 8078DBC push {r4,lr} sub sp, 0x4 ldr r0, =0x030022c0 ldrh r1, [r0, 0x30] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @08078DE4 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x35 movs r1, 0 bl sub_8078CB8 b @08078E30 .align 2, 0 .pool @08078DE4: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08078E00 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x35 movs r1, 0x1 bl sub_8078CB8 b @08078E30 .align 2, 0 .pool @08078E00: movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @08078E1C ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x35 movs r1, 0x2 bl sub_8078CB8 b @08078E30 .align 2, 0 .pool @08078E1C: movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08078E30 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x35 movs r1, 0x3 bl sub_8078CB8 @08078E30: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08078EE4 movs r0, 0x5 bl audio_play ldr r4, =0x0203229c ldr r0, [r4] adds r0, 0x35 ldrb r0, [r0] cmp r0, 0x5 bhi @08078E98 movs r0, 0x1 movs r1, 0x1 movs r2, 0xE bl sub_8098858 movs r0, 0x1 movs r1, 0x11 bl Window_FastFillPixels ldr r2, =gUnknown_0832DEAC movs r0, 0x1 movs r1, 0x2 bl PrintMenuTable movs r0, 0x1 movs r1, 0x2 movs r2, 0 bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed movs r0, 0x1 bl 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 .pool @08078E98: cmp r0, 0xB bhi @08078EB6 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, [r4] adds r0, 0x6F movs r1, 0x2 strb r1, [r0] b @08078EE4 @08078EB6: cmp r0, 0xC bne @08078EE4 ldr r0, =gUnknown_0832DF8C movs r1, 0x1 movs r2, 0xE movs r3, 0 bl sub_81996C0 ldr r0, [r4] adds r0, 0x6F movs r1, 0x4 strb r1, [r0] ldr r0, =gUnknown_0832DE94 ldr r0, [r0, 0x10] ldr r1, [r4] adds r1, 0x72 ldrh r1, [r1] lsls r1, 5 ldr r2, =0x06010000 adds r1, r2 movs r2, 0x18 bl sub_807A308 @08078EE4: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8078DBC thumb_func_start sub_8078EF8 sub_8078EF8: ; 8078EF8 push {lr} bl sub_8079F74 ldr r3, =0x0203229c ldr r0, [r3] adds r0, 0x6F movs r1, 0 strb r1, [r0] ldr r2, =0x02020630 ldr r0, [r3] adds r0, 0x34 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] ldr r0, =gUnknown_0832DE94 ldr r0, [r0, 0x4] ldr r1, [r3] adds r1, 0x72 ldrh r1, [r1] lsls r1, 5 ldr r2, =0x06010000 adds r1, r2 movs r2, 0x18 bl sub_807A308 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8078EF8 thumb_func_start sub_8078F50 sub_8078F50: ; 8078F50 push {lr} sub sp, 0x4 bl ProcessMenuInputNoWrapAround lsls r0, 24 asrs r0, 24 movs r1, 0x1 negs r1, r1 cmp r0, r1 beq @08078F72 cmp r0, r1 ble @0807902A cmp r0, 0 beq @08078F7E cmp r0, 0x1 beq @08078F9C b @0807902A @08078F72: movs r0, 0x5 bl audio_play bl sub_8078EF8 b @0807902A @08078F7E: str r0, [sp] adds r0, r1, 0 movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0x2 b @08079028 .align 2, 0 .pool @08078F9C: ldr r0, =0x020244ec ldr r1, =0x020244e9 ldrb r1, [r1] ldr r2, =0x0203229c ldr r2, [r2] adds r2, 0x35 ldrb r2, [r2] bl sub_807A5F4 cmp r0, 0x5 bhi @0807902A lsls r0, 2 ldr r1, =@08078FCC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08078FCC: .4byte @08078FE4 .4byte @0807900C .4byte @08079012 .4byte @08079018 .4byte @08079012 .4byte @08079018 @08078FE4: bl sub_8078D78 ldr r2, =0x02020630 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x34 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 b @08079028 .align 2, 0 .pool @0807900C: movs r0, 0x3 movs r1, 0x3 b @0807901C @08079012: movs r0, 0x3 movs r1, 0x6 b @0807901C @08079018: movs r0, 0x3 movs r1, 0x7 @0807901C: bl sub_807A048 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0x8 @08079028: strb r1, [r0] @0807902A: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8078F50 thumb_func_start sub_8079034 sub_8079034: ; 8079034 push {lr} ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0807904A movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08079054 @0807904A: movs r0, 0x5 bl audio_play bl sub_8078EF8 @08079054: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079034 thumb_func_start sub_807905C sub_807905C: ; 807905C push {lr} sub sp, 0x4 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080790C4 ldr r0, =0x0203229c ldr r0, [r0] adds r3, r0, 0 adds r3, 0x35 ldrb r2, [r3] cmp r2, 0x5 bhi @080790A4 ldr r1, =0x020244ec ldrb r2, [r3] adds r0, 0x36 ldrb r3, [r0] subs r3, 0x1 lsls r3, 24 lsrs r3, 24 ldr r0, =sub_8077B74 str r0, [sp] movs r0, 0x1 bl sub_81BF8EC b @080790C0 .align 2, 0 .pool @080790A4: ldr r1, =0x02024744 subs r2, 0x6 lsls r2, 24 lsrs r2, 24 adds r0, 0x37 ldrb r3, [r0] subs r3, 0x1 lsls r3, 24 lsrs r3, 24 ldr r0, =sub_8077B74 str r0, [sp] movs r0, 0x1 bl sub_81BF8EC @080790C0: bl Window_FreeMemory @080790C4: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807905C thumb_func_start sub_80790D4 sub_80790D4: ; 80790D4 push {r4-r7,lr} adds r4, r0, 0 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r6, r3, 24 movs r5, 0 movs r3, 0 ldr r7, =0x02024744 cmp r5, r1 bge @08079102 @080790EE: cmp r2, r3 beq @080790FC adds r0, r4, r3 ldrb r0, [r0] adds r0, r5, r0 lsls r0, 24 lsrs r5, r0, 24 @080790FC: adds r3, 0x1 cmp r3, r1 blt @080790EE @08079102: adds r0, r6, 0 movs r1, 0x6 bl __umodsi3 lsls r0, 24 lsrs r6, r0, 24 movs r0, 0x64 muls r0, r6 adds r7, r0, r7 adds r0, r7, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 movs r0, 0xCD lsls r0, 1 cmp r4, r0 beq @0807912C cmp r4, 0x97 bne @08079138 @0807912C: adds r0, r7, 0 movs r1, 0x50 bl pokemon_getattr cmp r0, 0 beq @08079158 @08079138: bl sub_809D42C cmp r0, 0 bne @08079164 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x57 adds r0, r6 ldrb r0, [r0] cmp r0, 0 bne @08079158 adds r0, r4, 0 bl sub_806E3F8 cmp r0, 0 bne @08079164 @08079158: movs r0, 0x2 b @0807916C .align 2, 0 .pool @08079164: cmp r5, 0 beq @0807916A movs r5, 0x1 @0807916A: adds r0, r5, 0 @0807916C: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80790D4 thumb_func_start sub_8079174 sub_8079174: ; 8079174 push {r4,r5,lr} sub sp, 0xC movs r2, 0 ldr r0, =0x0203229c ldr r1, [r0] adds r3, r1, 0 adds r3, 0x36 adds r5, r0, 0 ldrb r0, [r3] cmp r2, r0 bge @080791A0 adds r4, r1, 0 adds r4, 0x45 @0807918E: mov r1, sp adds r0, r1, r2 adds r1, r4, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 ldrb r0, [r3] cmp r2, r0 blt @0807918E @080791A0: ldr r0, [r5] adds r1, r0, 0 adds r1, 0x36 ldrb r1, [r1] adds r2, r0, 0 adds r2, 0x35 ldrb r2, [r2] adds r0, 0x7E ldrb r3, [r0] mov r0, sp bl sub_80790D4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080791E8 cmp r0, 0x1 bgt @080791D0 cmp r0, 0 beq @080791D6 b @0807920C .align 2, 0 .pool @080791D0: cmp r0, 0x2 beq @08079200 b @0807920C @080791D6: movs r0, 0x3 movs r1, 0x3 bl sub_807A048 ldr r0, =0x0000bbcc b @080791F2 .align 2, 0 .pool @080791E8: movs r0, 0x3 movs r1, 0x1 bl sub_807A048 ldr r0, =0x0000bbbb @080791F2: movs r1, 0 bl sub_8078C10 b @0807920C .align 2, 0 .pool @08079200: movs r0, 0x3 movs r1, 0x8 bl sub_807A048 movs r0, 0x1 b @0807920E @0807920C: movs r0, 0 @0807920E: add sp, 0xC pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8079174 thumb_func_start sub_8079218 sub_8079218: ; 8079218 push {lr} bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @0807923A cmp r1, 0 bgt @08079234 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08079268 b @08079290 @08079234: cmp r1, 0x1 beq @08079268 b @08079290 @0807923A: bl sub_8079174 cmp r0, 0 bne @08079250 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0x64 b @08079258 .align 2, 0 .pool @08079250: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0x11 @08079258: strb r1, [r0] movs r0, 0x11 bl Window_WriteStandardTileMap b @08079290 .align 2, 0 .pool @08079268: movs r0, 0x3 movs r1, 0x1 bl sub_807A048 bl sub_80771BC cmp r0, 0 beq @08079280 ldr r0, =0x0000bbcc movs r1, 0 bl sub_8078C10 @08079280: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0x64 strb r1, [r0] movs r0, 0x11 bl Window_WriteStandardTileMap @08079290: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079218 thumb_func_start sub_807929C sub_807929C: ; 807929C push {r4-r6,lr} movs r5, 0 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x37 ldrb r0, [r0] subs r0, 0x4 cmp r5, r0 bge @080792D8 movs r6, 0xC0 lsls r6, 20 @080792B2: lsrs r4, r6, 24 adds r0, r4, 0 bl 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, =0x0203229c ldr r0, [r0] adds r0, 0x37 ldrb r0, [r0] subs r0, 0x4 cmp r5, r0 blt @080792B2 @080792D8: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807929C thumb_func_start sub_80792E4 sub_80792E4: ; 80792E4 push {lr} bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @08079306 cmp r1, 0 bgt @08079300 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0807934C b @08079356 @08079300: cmp r1, 0x1 beq @0807934C b @08079356 @08079306: movs r0, 0x4 bl sub_807A19C ldr r0, =0x0000eeaa movs r1, 0 bl sub_8078C10 ldr r2, =0x02020630 ldr r3, =0x0203229c ldr r0, [r3] adds r0, 0x34 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] ldr r0, [r3] adds r0, 0x6F movs r1, 0x64 strb r1, [r0] bl sub_807929C b @08079356 .align 2, 0 .pool @0807934C: movs r0, 0x5 bl audio_play bl sub_8078EF8 @08079356: pop {r0} bx r0 thumb_func_end sub_80792E4 thumb_func_start sub_807935C sub_807935C: ; 807935C push {r4,lr} bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @08079384 movs r0, 0 bl rbox_fill_rectangle ldr r4, =0x0203229c ldr r0, [r4] adds r0, 0x35 ldrb r0, [r0] bl sub_807967C ldr r0, [r4] adds r0, 0x7E ldrb r0, [r0] bl sub_807967C @08079384: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0x7 strb r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807935C thumb_func_start sub_8079398 sub_8079398: ; 8079398 push {r4,lr} ldr r4, =0x0203229c ldr r0, [r4] adds r0, 0x74 ldrh r1, [r0] ldr r0, =0x00000505 cmp r1, r0 bne @080793B4 bl sub_80787B8 ldr r0, [r4] adds r0, 0x6F movs r1, 0xE strb r1, [r0] @080793B4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079398 thumb_func_start sub_80793C4 sub_80793C4: ; 80793C4 push {r4,lr} ldr r4, =0x0203229c ldr r1, [r4] adds r1, 0xA8 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r4] adds r0, 0xA8 ldrb r0, [r0] cmp r0, 0x78 bls @080793F8 ldr r0, =gUnknown_0832DF8C movs r1, 0x1 movs r2, 0xE movs r3, 0 bl 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 .pool thumb_func_end sub_80793C4 thumb_func_start sub_8079408 sub_8079408: ; 8079408 push {r4-r6,lr} ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0807947C movs r0, 0x5 bl audio_play movs r0, 0 bl rbox_fill_rectangle movs r0, 0x1 bl rbox_fill_rectangle movs r6, 0 movs r5, 0xE0 lsls r5, 20 @0807942E: lsrs r4, r5, 24 adds r0, r4, 0 movs r1, 0 bl 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, =0x0203229c ldr r0, [r2] adds r0, 0x6F movs r1, 0 strb r1, [r0] ldr r3, =0x02020630 ldr r0, [r2] adds r0, 0x34 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] @0807947C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079408 thumb_func_start sub_8079490 sub_8079490: ; 8079490 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080794C4 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080794B4 bl sub_800ADF8 b @080794BA .align 2, 0 .pool @080794B4: movs r0, 0xC bl sub_800ABF4 @080794BA: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0xC strb r1, [r0] @080794C4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079490 thumb_func_start sub_80794CC sub_80794CC: ; 80794CC push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08079518 bl sub_80771BC cmp r0, 0 beq @0807953A bl sub_807A09C cmp r0, 0 bne @0807953A ldr r0, =0x02032184 ldr r0, [r0] bl free ldr r0, =0x0203229c ldr r0, [r0] bl free bl Window_FreeMemory bl sub_800E084 ldr r0, =c2_8056854 bl set_callback2 b @0807953A .align 2, 0 .pool @08079518: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0807953A ldr r0, =0x02032184 ldr r0, [r0] bl free ldr r0, =0x0203229c ldr r0, [r0] bl free bl Window_FreeMemory ldr r0, =c2_8056854 bl set_callback2 @0807953A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80794CC thumb_func_start sub_8079550 sub_8079550: ; 8079550 push {lr} movs r0, 0 bl sub_801048C lsls r0, 24 cmp r0, 0 bne @08079574 bl sub_807A09C cmp r0, 0 bne @08079574 bl sub_800ADF8 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0xD strb r1, [r0] @08079574: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079550 thumb_func_start sub_807957C sub_807957C: ; 807957C push {lr} ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0807959C ldr r0, =0x0000bbcc movs r1, 0 bl sub_8078C10 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F movs r1, 0x64 strb r1, [r0] @0807959C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807957C thumb_func_start sub_80795AC sub_80795AC: ; 80795AC push {lr} ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x6F ldrb r0, [r0] cmp r0, 0x11 bhi @08079678 lsls r0, 2 ldr r1, =@080795CC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080795CC: .4byte @08079614 .4byte @0807961A .4byte @08079620 .4byte @08079626 .4byte @0807962C .4byte @08079678 .4byte @08079632 .4byte @08079638 .4byte @0807963E .4byte @08079644 .4byte @0807964A .4byte @08079650 .4byte @08079656 .4byte @0807965C .4byte @08079662 .4byte @08079668 .4byte @0807966E .4byte @08079674 @08079614: bl sub_8078DBC b @08079678 @0807961A: bl sub_8078F50 b @08079678 @08079620: bl sub_807905C b @08079678 @08079626: bl sub_8079218 b @08079678 @0807962C: bl sub_80792E4 b @08079678 @08079632: bl sub_807935C b @08079678 @08079638: bl sub_8079398 b @08079678 @0807963E: bl sub_8079408 b @08079678 @08079644: bl sub_8078130 b @08079678 @0807964A: bl sub_807816C b @08079678 @08079650: bl sub_8079490 b @08079678 @08079656: bl sub_80794CC b @08079678 @0807965C: bl sub_80781C8 b @08079678 @08079662: bl sub_80793C4 b @08079678 @08079668: bl sub_8079034 b @08079678 @0807966E: bl sub_8079550 b @08079678 @08079674: bl sub_807957C @08079678: pop {r0} bx r0 thumb_func_end sub_80795AC thumb_func_start sub_807967C sub_807967C: ; 807967C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 movs r1, 0x6 bl __udivsi3 lsls r0, 24 lsrs r2, r0, 24 ldr r3, =0x0203229c ldr r0, [r3] adds r0, 0x74 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0 bne @080796A8 movs r0, 0x1 strb r0, [r1] ldr r0, [r3] adds r0, 0x76 adds r0, r2 strb r4, [r0] @080796A8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807967C thumb_func_start sub_80796B4 sub_80796B4: ; 80796B4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x68 lsls r0, 24 lsrs r7, r0, 24 ldr r0, =0x0203229c ldr r4, [r0] adds r0, r4, 0 adds r0, 0x76 adds r0, r7 ldrb r0, [r0] movs r1, 0x1 str r1, [sp, 0x60] cmp r0, 0x5 bhi @080796DC movs r2, 0 str r2, [sp, 0x60] @080796DC: movs r1, 0x6 bl __umodsi3 lsls r0, 24 lsrs r0, 24 mov r10, r0 movs r0, 0 mov r8, r0 adds r0, r4, 0 adds r0, 0x74 adds r3, r0, r7 ldrb r0, [r3] cmp r0, 0x2 bne @080796FA b @08079884 @080796FA: cmp r0, 0x2 bgt @08079708 cmp r0, 0x1 beq @08079716 b @08079A24 .align 2, 0 .pool @08079708: cmp r0, 0x3 bne @0807970E b @080798BC @0807970E: cmp r0, 0x4 bne @08079714 b @080799EC @08079714: b @08079A24 @08079716: movs r5, 0 adds r0, r4, 0 adds r0, 0x36 adds r0, r7 ldr r1, [sp, 0x60] lsls r1, 1 mov r9, r1 lsls r6, r7, 1 lsls r2, r7, 4 str r2, [sp, 0x64] ldrb r0, [r0] cmp r8, r0 bcs @0807976A ldr r0, =0x02020630 mov r8, r0 ldr r4, =0x0203229c ldr r0, [sp, 0x60] add r0, r9 lsls r2, r0, 1 movs r3, 0x4 @0807973E: ldr r0, [r4] adds r1, r5, r2 adds r0, 0x28 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r8 adds r0, 0x3E ldrb r1, [r0] orrs r1, r3 strb r1, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 ldr r0, [r4] adds r0, 0x36 adds r0, r7 ldrb r0, [r0] cmp r5, r0 bcc @0807973E @0807976A: movs r5, 0 adds r0, r6, r7 lsls r0, 1 adds r4, r0, 0x2 @08079772: lsls r0, r5, 24 asrs r0, 24 adds r0, r4 lsls r0, 24 lsrs r0, 24 bl Window_FillTileMap adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x5 bls @08079772 ldr r1, =0x02020630 mov r8, r1 ldr r2, =0x0203229c ldr r0, [r2] ldr r6, [sp, 0x60] add r6, r9 lsls r3, r6, 1 add r10, r3 adds r0, 0x28 add r0, r10 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r8 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] ldr r0, =0x0203229c ldr r4, [r0] adds r4, 0x28 add r4, r10 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r8 movs r1, 0x14 strh r1, [r0, 0x2E] ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 add r2, r8 ldr r5, =gUnknown_0832DE24 lsls r6, 2 adds r0, r6, r5 ldrb r0, [r0] adds r3, 0x1 lsls r3, 1 adds r3, r5 ldrb r1, [r3] adds r0, r1 asrs r0, 1 lsls r0, 3 adds r0, 0xE strh r0, [r2, 0x32] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 add r1, r8 adds r5, 0x1 adds r6, r5 ldrb r0, [r6] lsls r0, 3 subs r0, 0xC strh r0, [r1, 0x36] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r8 ldr r1, =sub_80D3014 bl oamt_set_x3A_32 ldr r2, =0x0203229c ldr r1, [r2] adds r1, 0x74 adds r1, r7 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r2] adds r0, 0x28 add r0, r10 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r8 bl sub_80A6DEC ldr r1, =gUnknown_0832C8BE ldr r0, [sp, 0x64] subs r2, r0, r7 lsls r2, 24 lsrs r2, 24 movs r0, 0xF str r0, [sp] movs r0, 0x11 str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] movs r0, 0x1 movs r3, 0 bl 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 .pool @08079884: ldr r2, =0x02020630 ldr r1, [sp, 0x60] lsls r0, r1, 1 adds r0, r1 lsls r0, 1 add r0, r10 adds r1, r4, 0 adds r1, 0x28 adds r1, r0 ldrb r1, [r1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =sub_80D3014 cmp r1, r0 beq @080798AC b @08079A24 @080798AC: movs r0, 0x3 strb r0, [r3] b @08079A24 .align 2, 0 .pool @080798BC: ldr r1, =gUnknown_0832C6C0 ldr r0, [sp, 0x60] lsls r2, r0, 4 subs r2, r0 lsls r2, 24 lsrs r2, 24 movs r0, 0xF str r0, [sp] movs r0, 0x11 str r0, [sp, 0x4] mov r0, r8 str r0, [sp, 0x8] movs r0, 0x1 movs r3, 0 bl bg_copy_tilemap_rect_simple movs r0, 0x1 bl gpu_copy_wram_bg_tilemap_to_vram ldr r6, =0x02020630 ldr r1, =0x0203229c ldr r4, [r1] ldr r2, [sp, 0x60] lsls r3, r2, 1 adds r3, r2 lsls r1, r3, 1 mov r2, r10 adds r0, r2, r1 adds r4, 0x28 adds r4, r0 ldrb r0, [r4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r6 ldr r5, =gUnknown_0832DE24 lsls r3, 2 adds r0, r3, r5 ldrb r0, [r0] adds r1, 0x1 lsls r1, 1 adds r1, r5 ldrb r1, [r1] adds r0, r1 asrs r0, 1 lsls r0, 3 adds r0, 0xE strh r0, [r2, 0x20] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r6 adds r5, 0x1 adds r3, r5 ldrb r0, [r3] lsls r0, 3 subs r0, 0xC strh r0, [r1, 0x22] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 mov r1, r8 strh r1, [r0, 0x24] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 mov r2, r8 strh r2, [r0, 0x26] add r0, sp, 0x14 ldr r1, [sp, 0x60] mov r2, r10 bl sub_8079A3C lsls r4, r7, 1 adds r5, r4, 0 adds r5, 0xE lsls r5, 24 lsrs r5, 24 lsls r0, 24 asrs r0, 24 movs r2, 0x50 subs r2, r0 lsrs r0, r2, 31 adds r2, r0 asrs r2, 1 lsls r2, 24 lsrs r2, 24 ldr r0, =gUnknown_0832DEE0 mov r8, r0 str r0, [sp] movs r1, 0 str r1, [sp, 0x4] add r0, sp, 0x14 str r0, [sp, 0x8] adds r0, r5, 0 movs r3, 0x4 bl box_print add r6, sp, 0x28 adds r0, r6, 0 ldr r1, [sp, 0x60] mov r2, r10 bl sub_8079AA4 adds r4, 0xF lsls r4, 24 lsrs r4, 24 movs r1, 0 str r1, [sp] str r1, [sp, 0x4] mov r2, r8 str r2, [sp, 0x8] str r1, [sp, 0xC] str r6, [sp, 0x10] adds r0, r4, 0 movs r1, 0x1 movs r2, 0 movs r3, 0 bl 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, =0x0203229c ldr r1, [r0] b @08079A1A .align 2, 0 .pool @080799EC: ldr r0, =gUnknown_0832DF99 lsls r1, r7, 1 adds r4, r1, r0 ldrb r2, [r4] adds r2, 0x4 lsls r2, 24 lsrs r2, 24 adds r0, 0x1 adds r1, r0 ldrb r3, [r1] adds r3, 0x1 lsls r3, 24 lsrs r3, 24 ldrb r0, [r4] str r0, [sp] ldrb r0, [r1] str r0, [sp, 0x4] adds r0, r7, 0 mov r1, r10 bl sub_8079C4C ldr r2, =0x0203229c ldr r1, [r2] @08079A1A: adds r1, 0x74 adds r1, r7 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @08079A24: add sp, 0x68 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80796B4 thumb_func_start sub_8079A3C sub_8079A3C: ; 8079A3C push {r4,lr} sub sp, 0xC adds r4, r0, 0 lsls r1, 24 lsls r2, 24 lsrs r2, 24 cmp r1, 0 bne @08079A64 movs r0, 0x64 muls r0, r2 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr b @08079A74 .align 2, 0 .pool @08079A64: movs r0, 0x64 muls r0, r2 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr @08079A74: adds r0, r4, 0 mov r1, sp bl 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 .pool thumb_func_end sub_8079A3C thumb_func_start sub_8079AA4 sub_8079AA4: ; 8079AA4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x8 adds r6, r0, 0 lsls r1, 24 lsrs r7, r1, 24 lsls r2, 24 lsrs r2, 24 ldr r0, =0x0203229c ldr r1, [r0] lsls r0, r7, 1 adds r0, r7 lsls r0, 1 adds r0, r2, r0 adds r1, 0x51 adds r1, r0 ldrb r0, [r1] cmp r0, 0 bne @08079B5C movs r4, 0 movs r0, 0x64 adds r5, r2, 0 muls r5, r0 ldr r0, =0x020244ec mov r9, r0 ldr r2, =0x02024744 mov r8, r2 @08079ADE: cmp r7, 0 bne @08079AF8 adds r1, r4, 0 adds r1, 0xD mov r2, r9 b @08079AFE .align 2, 0 .pool @08079AF8: adds r1, r4, 0 adds r1, 0xD mov r2, r8 @08079AFE: adds r0, r5, r2 movs r2, 0 bl pokemon_getattr lsls r1, r4, 1 add r1, sp strh r0, [r1] adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x3 bls @08079ADE ldr r1, =gUnknown_0832DABC adds r0, r6, 0 bl 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, =gMoveNames adds r1, r0 adds r0, r6, 0 bl gf_strcat @08079B3C: adds r0, r6, 0 ldr r1, =gUnknown_0832DAD2 bl gf_strcat adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x3 bls @08079B20 b @08079B6C .align 2, 0 .pool @08079B5C: ldr r1, =gUnknown_0832DABC adds r0, r6, 0 bl gf_strcpy ldr r1, =gUnknown_0832DADF 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 .pool thumb_func_end sub_8079AA4 thumb_func_start sub_8079B84 sub_8079B84: ; 8079B84 push {r4,r5,lr} sub sp, 0xC adds r4, r1, 0 adds r5, r2, 0 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 1 adds r1, r0 lsls r1, 1 adds r1, 0x2 lsls r4, 24 asrs r4, 24 adds r4, r1 lsls r4, 24 lsrs r4, 24 movs r0, 0 adds r1, r5, 0 movs r2, 0x40 bl sub_81DB35C adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 ldr r0, =gUnknown_0832DEE0 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] str r5, [sp, 0x8] adds r0, r4, 0 movs r1, 0 movs r3, 0x4 bl box_print adds r0, r4, 0 bl 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 .pool thumb_func_end sub_8079B84 thumb_func_start sub_8079BE0 sub_8079BE0: ; 8079BE0 push {r4-r7,lr} sub sp, 0x34 lsls r0, 24 lsrs r6, r0, 24 ldr r7, =0x02024744 cmp r6, 0 bne @08079BF0 ldr r7, =0x020244ec @08079BF0: movs r4, 0 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x36 adds r0, r6 ldrb r0, [r0] cmp r4, r0 bcs @08079C36 add r5, sp, 0x14 @08079C02: movs r0, 0x64 muls r0, r4 adds r0, r7, r0 movs r1, 0x2 mov r2, sp bl pokemon_getattr adds r0, r5, 0 mov r1, sp bl 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, =0x0203229c ldr r0, [r0] adds r0, 0x36 adds r0, r6 ldrb r0, [r0] cmp r4, r0 bcc @08079C02 @08079C36: add sp, 0x34 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079BE0 thumb_func_start sub_8079C4C sub_8079C4C: ; 8079C4C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x1C ldr r4, [sp, 0x3C] ldr r5, [sp, 0x40] lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r1, 24 lsrs r7, r1, 24 lsls r2, 24 lsrs r2, 24 mov r9, r2 lsls r3, 24 lsrs r3, 24 mov r10, r3 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 ldr r1, =gUnknown_08DDD704 movs r0, 0x6 str r0, [sp] movs r0, 0x3 str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] movs r0, 0x1 adds r2, r4, 0 adds r3, r5, 0 bl 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, =0x020244ec b @08079CB6 .align 2, 0 .pool @08079CB0: movs r0, 0x64 muls r0, r7 ldr r1, =0x02024744 @08079CB6: adds r0, r1 movs r1, 0x38 movs r2, 0 bl pokemon_getattr lsls r0, 24 lsrs r6, r0, 24 ldr r4, =0x0203229c ldr r5, [r4] mov r1, r8 lsls r2, r1, 1 adds r1, r2, r1 lsls r1, 1 adds r1, r7, r1 adds r0, r5, 0 adds r0, 0x51 adds r0, r1 ldrb r0, [r0] str r2, [sp, 0x18] cmp r0, 0 bne @08079D34 adds r0, r6, 0 movs r1, 0xA bl __udivsi3 lsls r0, 24 lsrs r2, r0, 24 mov r0, r10 lsls r3, r0, 5 cmp r2, 0 beq @08079D08 mov r1, r9 adds r0, r1, r3 lsls r0, 1 movs r1, 0x8F lsls r1, 4 adds r5, r1 adds r1, r5, r0 adds r0, r2, 0 adds r0, 0x60 strh r0, [r1] @08079D08: ldr r4, [r4] mov r1, r9 adds r0, r1, r3 adds r0, 0x1 lsls r0, 1 movs r3, 0x8F lsls r3, 4 adds r4, r3 adds r4, r0 adds r0, r6, 0 movs r1, 0xA bl __umodsi3 lsls r0, 24 lsrs r0, 24 adds r0, 0x70 strh r0, [r4] b @08079D72 .align 2, 0 .pool @08079D34: mov r1, r10 lsls r0, r1, 5 mov r1, r9 adds r3, r1, r0 adds r1, r3, 0 subs r1, 0x20 lsls r1, 1 movs r0, 0x8F lsls r0, 4 adds r2, r5, r0 adds r1, r2, r1 adds r0, r3, 0 subs r0, 0x21 lsls r0, 1 adds r0, r2, r0 ldrh r0, [r0] strh r0, [r1] adds r1, r3, 0 subs r1, 0x1F lsls r1, 1 adds r1, r2, r1 adds r0, r3, 0 subs r0, 0x24 lsls r0, 1 adds r2, r0 ldrh r2, [r2] movs r3, 0x80 lsls r3, 3 adds r0, r3, 0 orrs r0, r2 strh r0, [r1] @08079D72: ldr r0, =0x0203229c ldr r1, [r0] ldr r0, [sp, 0x18] add r0, r8 lsls r0, 1 adds r0, r7, r0 adds r1, 0x51 adds r1, r0 ldrb r0, [r1] cmp r0, 0 beq @08079D94 movs r2, 0x90 lsls r2, 3 b @08079E16 .align 2, 0 .pool @08079D94: mov r0, r8 cmp r0, 0 bne @08079DC0 movs r0, 0x64 adds r4, r7, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 bl pokemon_get_gender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 movs r1, 0x2 add r2, sp, 0xC bl pokemon_getattr b @08079DDE .align 2, 0 .pool @08079DC0: movs r0, 0x64 adds r4, r7, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 bl pokemon_get_gender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 movs r1, 0x2 add r2, sp, 0xC bl pokemon_getattr @08079DDE: cmp r5, 0 beq @08079DF0 cmp r5, 0xFE beq @08079E04 movs r2, 0x83 b @08079E16 .align 2, 0 .pool @08079DF0: add r0, sp, 0xC movs r1, 0 bl sub_8070ECC lsls r0, 24 movs r2, 0x83 cmp r0, 0 bne @08079E16 movs r2, 0x84 b @08079E16 @08079E04: add r0, sp, 0xC movs r1, 0xFE bl sub_8070ECC lsls r0, 24 movs r2, 0x83 cmp r0, 0 bne @08079E16 movs r2, 0x85 @08079E16: ldr r0, =0x0203229c ldr r1, [r0] mov r0, r10 subs r0, 0x1 lsls r0, 5 add r0, r9 adds r0, 0x1 lsls r0, 1 movs r3, 0x8F lsls r3, 4 adds r1, r3 adds r1, r0 strh r2, [r1] add sp, 0x1C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079C4C thumb_func_start sub_8079E44 sub_8079E44: ; 8079E44 push {r4-r7,lr} sub sp, 0x8 lsls r0, 24 lsrs r6, r0, 24 movs r7, 0 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x36 adds r0, r6 ldrb r0, [r0] cmp r7, r0 bge @08079E94 lsls r0, r6, 1 adds r0, r6 ldr r1, =gUnknown_0832DE3E lsls r0, 2 adds r5, r0, r1 ldr r1, =gUnknown_0832DE56 adds r4, r0, r1 @08079E6A: lsls r1, r7, 24 lsrs r1, 24 ldrb r2, [r5] ldrb r3, [r5, 0x1] ldrb r0, [r4] str r0, [sp] ldrb r0, [r4, 0x1] str r0, [sp, 0x4] adds r0, r6, 0 bl sub_8079C4C adds r5, 0x2 adds r4, 0x2 adds r7, 0x1 ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x36 adds r0, r6 ldrb r0, [r0] cmp r7, r0 blt @08079E6A @08079E94: add sp, 0x8 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079E44 thumb_func_start sub_8079EA8 sub_8079EA8: ; 8079EA8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 mov r12, r0 movs r7, 0 ldr r3, =0x0203229c ldr r0, [r3] adds r0, 0x36 add r0, r12 ldrb r0, [r0] cmp r7, r0 bge @08079F5A ldr r6, =0x02020630 mov r9, r3 mov r1, r12 lsls r0, r1, 1 add r0, r12 lsls r2, r0, 1 mov r10, r2 ldr r1, =gUnknown_0832DE24 movs r2, 0 mov r8, r2 lsls r0, 2 adds r5, r0, r1 @08079EE0: mov r1, r9 ldr r0, [r1] mov r2, r10 adds r4, r7, r2 adds r0, 0x28 adds r0, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r6 adds r1, 0x3E ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] mov r0, r9 ldr r3, [r0] adds r2, r3, 0 adds r2, 0x28 adds r2, r4 ldrb r0, [r2] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r5] lsls r0, 3 adds r0, 0xE strh r0, [r1, 0x20] ldrb r0, [r2] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r6 ldrb r0, [r5, 0x1] lsls r0, 3 subs r0, 0xC strh r0, [r1, 0x22] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 mov r1, r8 strh r1, [r0, 0x24] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 mov r2, r8 strh r2, [r0, 0x26] adds r5, 0x2 adds r7, 0x1 adds r3, 0x36 add r3, r12 ldrb r3, [r3] cmp r7, r3 blt @08079EE0 @08079F5A: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079EA8 thumb_func_start sub_8079F74 sub_8079F74: ; 8079F74 push {lr} movs r0, 0x1 bl rbox_fill_rectangle movs r0, 0x1 bl sub_8079BE0 pop {r0} bx r0 thumb_func_end sub_8079F74 thumb_func_start sub_8079F88 sub_8079F88: ; 8079F88 push {r4-r6,lr} sub sp, 0xC adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r1, =gUnknown_0832C8BE lsls r2, r4, 4 subs r2, r4 lsls r2, 24 lsrs r2, 24 movs r0, 0xF str r0, [sp] movs r0, 0x11 str r0, [sp, 0x4] movs r6, 0 str r6, [sp, 0x8] movs r0, 0x1 movs r3, 0 bl 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, =gUnknown_0832DE94 ldr r0, [r0, 0x4] ldr r5, =0x0203229c ldr r1, [r5] adds r1, 0x72 ldrh r1, [r1] lsls r1, 5 ldr r2, =0x06010000 adds r1, r2 movs r2, 0x18 bl sub_807A308 ldr r0, [r5] adds r0, 0x74 adds r0, r4 strb r6, [r0] add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8079F88 thumb_func_start sub_807A000 sub_807A000: ; 807A000 push {lr} sub sp, 0x8 movs r0, 0x1E str r0, [sp] movs r0, 0x14 str r0, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =0x0203229c mov r12, r4 movs r7, 0x8D lsls r7, 4 @0807A05C: mov r1, r12 ldr r0, [r1] lsls r1, r3, 3 adds r2, r0, r1 adds r0, r2, r7 ldrb r0, [r0] cmp r0, 0 bne @0807A090 ldr r3, =0x000008d2 adds r0, r2, r3 strh r5, [r0] adds r3, 0x2 adds r0, r2, r3 strb r6, [r0] ldr r0, [r4] adds r0, r1 movs r1, 0x8D lsls r1, 4 adds r0, r1 movs r1, 0x1 strb r1, [r0] b @0807A096 .align 2, 0 .pool @0807A090: adds r3, 0x1 cmp r3, 0x3 ble @0807A05C @0807A096: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_807A048 thumb_func_start sub_807A09C sub_807A09C: ; 807A09C push {lr} movs r3, 0 ldr r0, =0x0203229c ldr r0, [r0] movs r2, 0x8D lsls r2, 4 adds r1, r0, r2 movs r2, 0x3 @0807A0AC: ldrb r0, [r1] adds r3, r0 adds r1, 0x8 subs r2, 0x1 cmp r2, 0 bge @0807A0AC adds r0, r3, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_807A09C thumb_func_start sub_807A0C4 sub_807A0C4: ; 807A0C4 push {r4,r5,lr} movs r4, 0 ldr r3, =0x0203229c @0807A0CA: ldr r0, [r3] lsls r1, r4, 3 adds r2, r0, r1 movs r5, 0x8D lsls r5, 4 adds r0, r2, r5 ldrb r0, [r0] adds r5, r1, 0 cmp r0, 0 beq @0807A18C ldr r0, =0x000008d2 adds r1, r2, r0 ldrh r0, [r1] cmp r0, 0 beq @0807A0F8 subs r0, 0x1 strh r0, [r1] b @0807A18C .align 2, 0 .pool @0807A0F8: ldr r1, =0x000008d4 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x8 bhi @0807A17A lsls r0, 2 ldr r1, =@0807A114 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807A114: .4byte @0807A138 .4byte @0807A14C .4byte @0807A154 .4byte @0807A15C .4byte @0807A15C .4byte @0807A15C .4byte @0807A164 .4byte @0807A16C .4byte @0807A174 @0807A138: ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0x80 movs r1, 0x14 bl sub_8077170 b @0807A17A .align 2, 0 .pool @0807A14C: movs r0, 0 bl sub_807A19C b @0807A17A @0807A154: movs r0, 0x2 bl sub_807A19C b @0807A17A @0807A15C: movs r0, 0x3 bl sub_807A19C b @0807A17A @0807A164: movs r0, 0x6 bl sub_807A19C b @0807A17A @0807A16C: movs r0, 0x7 bl sub_807A19C b @0807A17A @0807A174: movs r0, 0x8 bl sub_807A19C @0807A17A: ldr r0, =0x0203229c ldr r1, [r0] adds r1, r5 movs r2, 0x8D lsls r2, 4 adds r1, r2 movs r2, 0 strb r2, [r1] adds r3, r0, 0 @0807A18C: adds r4, 0x1 cmp r4, 0x3 ble @0807A0CA pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807A0C4 thumb_func_start sub_807A19C sub_807A19C: ; 807A19C push {r4,lr} sub sp, 0xC adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r0, =gUnknown_0832DEBC lsls r4, 2 adds r4, r0 ldr r2, [r4] movs r0, 0x1 str r0, [sp] movs r0, 0xFF str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print movs r0, 0 movs r1, 0x14 movs r2, 0xC bl sub_8098858 movs r0, 0 bl Window_WriteStandardTileMap movs r0, 0 movs r1, 0x3 bl Window_CopyToVram add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807A19C thumb_func_start sub_807A1F0 sub_807A1F0: ; 807A1F0 push {r4,lr} sub sp, 0x8 ldr r0, =0x0203229c ldr r1, [r0] adds r3, r1, 0 adds r3, 0xA8 ldrb r1, [r3] adds r4, r0, 0 cmp r1, 0xD bhi @0807A22C ldr r1, =0x02032188 ldrb r0, [r3] lsls r0, 2 adds r0, r1 ldr r0, [r0] str r0, [sp] ldr r0, =0xffff0000 ldr r2, [sp, 0x4] ands r2, r0 movs r0, 0x80 lsls r0, 1 orrs r2, r0 str r2, [sp, 0x4] ldrb r1, [r3] adds r1, 0xC8 lsls r1, 16 ldr r0, =0x0000ffff ands r0, r2 orrs r0, r1 str r0, [sp, 0x4] @0807A22C: ldr r0, [r4] adds r0, 0xA8 ldrb r0, [r0] cmp r0, 0x11 bhi @0807A2FC lsls r0, 2 ldr r1, =@0807A254 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807A254: .4byte @0807A29C .4byte @0807A29C .4byte @0807A29C .4byte @0807A29C .4byte @0807A29C .4byte @0807A29C .4byte @0807A29C .4byte @0807A29C .4byte @0807A2A0 .4byte @0807A2B8 .4byte @0807A2B8 .4byte @0807A2B8 .4byte @0807A2B8 .4byte @0807A2B8 .4byte @0807A2BC .4byte @0807A2C8 .4byte @0807A2D4 .4byte @0807A2F0 @0807A29C: mov r0, sp b @0807A2D6 @0807A2A0: mov r0, sp bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r1, =0x0203229c ldr r1, [r1] adds r2, r1, 0 adds r2, 0x72 strh r0, [r2] b @0807A2DE .align 2, 0 .pool @0807A2B8: mov r0, sp b @0807A2D6 @0807A2BC: ldr r0, =gUnknown_0832DCE4 bl gpu_pal_obj_alloc_tag_and_apply b @0807A2DA .align 2, 0 .pool @0807A2C8: ldr r0, =gUnknown_0832DC44 bl gpu_pal_obj_alloc_tag_and_apply b @0807A2DA .align 2, 0 .pool @0807A2D4: ldr r0, =gUnknown_0832DC3C @0807A2D6: bl gpu_tile_obj_alloc_tag_and_copy_to_vram @0807A2DA: ldr r0, =0x0203229c ldr r1, [r0] @0807A2DE: adds r1, 0xA8 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0807A2FC .align 2, 0 .pool @0807A2F0: ldr r0, [r4] adds r0, 0xA8 movs r1, 0 strb r1, [r0] movs r0, 0x1 b @0807A2FE @0807A2FC: movs r0, 0 @0807A2FE: add sp, 0x8 pop {r4} pop {r1} bx r1 thumb_func_end sub_807A1F0 thumb_func_start sub_807A308 sub_807A308: ; 807A308 push {lr} sub sp, 0x4 movs r2, 0x6 str r2, [sp] movs r2, 0 movs r3, 0 bl sub_80C6D80 add sp, 0x4 pop {r0} bx r0 thumb_func_end sub_807A308 thumb_func_start sub_807A320 sub_807A320: ; 807A320 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 cmp r0, 0 beq @0807A338 cmp r0, 0x1 beq @0807A3CC b @0807A458 @0807A338: movs r7, 0 ldr r1, =0x0203229c ldr r0, [r1] adds r0, 0x36 ldrb r0, [r0] cmp r7, r0 blt @0807A348 b @0807A458 @0807A348: adds r6, r1, 0 movs r5, 0 mov r9, r5 @0807A34E: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr adds r1, r0, 0 cmp r1, 0x1 bne @0807A380 ldr r0, [r6] adds r0, 0x45 adds r0, r5 mov r2, r9 strb r2, [r0] ldr r0, [r6] adds r0, 0x51 adds r0, r5 b @0807A3B0 .align 2, 0 .pool @0807A380: adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr adds r1, r0, 0 cmp r1, 0 bne @0807A39E ldr r0, [r6] adds r0, 0x45 adds r0, r5 strb r1, [r0] ldr r0, [r6] adds r0, 0x51 adds r0, r5 b @0807A3B0 @0807A39E: ldr r0, [r6] adds r0, 0x45 adds r0, r5 movs r1, 0x1 strb r1, [r0] ldr r0, [r6] adds r0, 0x51 adds r0, r5 mov r1, r9 @0807A3B0: strb r1, [r0] ldr r0, =0x0203229c adds r5, 0x1 adds r7, 0x1 ldr r0, [r0] adds r0, 0x36 add r0, r8 ldrb r0, [r0] cmp r7, r0 blt @0807A34E b @0807A458 .align 2, 0 .pool @0807A3CC: movs r7, 0 ldr r1, =0x0203229c ldr r0, [r1] adds r0, 0x37 ldrb r0, [r0] cmp r7, r0 bge @0807A458 adds r6, r1, 0 movs r5, 0x6 movs r2, 0 mov r9, r2 @0807A3E2: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x02024744 adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr adds r1, r0, 0 cmp r1, 0x1 bne @0807A414 ldr r0, [r6] adds r0, 0x45 adds r0, r5 mov r2, r9 strb r2, [r0] ldr r0, [r6] adds r0, 0x51 adds r0, r5 b @0807A444 .align 2, 0 .pool @0807A414: adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr adds r1, r0, 0 cmp r1, 0 bne @0807A432 ldr r0, [r6] adds r0, 0x45 adds r0, r5 strb r1, [r0] ldr r0, [r6] adds r0, 0x51 adds r0, r5 b @0807A444 @0807A432: ldr r0, [r6] adds r0, 0x45 adds r0, r5 movs r1, 0x1 strb r1, [r0] ldr r0, [r6] adds r0, 0x51 adds r0, r5 mov r1, r9 @0807A444: strb r1, [r0] ldr r0, =0x0203229c adds r5, 0x1 adds r7, 0x1 ldr r0, [r0] adds r0, 0x36 add r0, r8 ldrb r0, [r0] cmp r7, r0 blt @0807A3E2 @0807A458: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807A320 thumb_func_start sub_807A468 sub_807A468: ; 807A468 push {r4-r7,lr} lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @0807A478 cmp r0, 0x1 beq @0807A4D8 b @0807A52C @0807A478: movs r6, 0 ldr r1, =0x0203229c ldr r0, [r1] adds r0, 0x36 ldrb r0, [r0] cmp r6, r0 bcs @0807A52C adds r7, r1, 0 @0807A488: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr adds r1, r0, 0 lsls r0, r5, 16 asrs r0, 16 lsls r1, 16 asrs r1, 16 bl sub_8075060 ldr r1, [r7] adds r1, 0x5D adds r1, r6 strb r0, [r1] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 ldr r0, [r7] adds r0, 0x36 ldrb r0, [r0] cmp r6, r0 bcc @0807A488 b @0807A52C .align 2, 0 .pool @0807A4D8: movs r6, 0 ldr r1, =0x0203229c ldr r0, [r1] adds r0, 0x37 ldrb r0, [r0] cmp r6, r0 bcs @0807A52C adds r7, r1, 0 @0807A4E8: movs r0, 0x64 adds r4, r6, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr adds r1, r0, 0 lsls r0, r5, 16 asrs r0, 16 lsls r1, 16 asrs r1, 16 bl sub_8075060 ldr r1, [r7] adds r1, 0x63 adds r1, r6 strb r0, [r1] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 ldr r0, [r7] adds r0, 0x37 ldrb r0, [r0] cmp r6, r0 bcc @0807A4E8 @0807A52C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807A468 thumb_func_start sub_807A53C sub_807A53C: ; 807A53C push {r4-r7,lr} mov r7, r8 push {r7} movs r5, 0 @0807A544: movs r4, 0 ldr r2, =0x0203229c ldr r0, [r2] adds r0, 0x36 adds r0, r5 adds r1, r5, 0x1 mov r8, r1 ldrb r0, [r0] cmp r4, r0 bge @0807A596 adds r6, r2, 0 lsls r0, r5, 1 adds r0, r5 lsls r7, r0, 1 @0807A560: ldr r2, [r6] adds r3, r4, r7 adds r0, r2, 0 adds r0, 0x28 adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 adds r2, 0x5D adds r2, r3 ldrb r2, [r2] movs r1, 0x4 subs r1, r2 lsls r1, 24 lsrs r1, 24 bl sub_80D32C8 adds r4, 0x1 ldr r0, [r6] adds r0, 0x36 adds r0, r5 ldrb r0, [r0] cmp r4, r0 blt @0807A560 @0807A596: mov r5, r8 cmp r5, 0x1 ble @0807A544 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807A53C thumb_func_start sub_807A5B0 sub_807A5B0: ; 807A5B0 push {r4,r5,lr} movs r3, 0 ldr r5, =0x03005d8c ldr r4, =0x000031a8 @0807A5B8: ldr r0, [r5] adds r0, r4 adds r2, r0, r3 ldrb r0, [r2] cmp r0, 0 bne @0807A5DA ldr r0, =0x0203229c ldr r0, [r0] adds r0, 0xA9 adds r0, r3 ldrb r0, [r0] adds r1, r0, 0 cmp r1, 0 beq @0807A5DA cmp r1, 0x3F bhi @0807A5DA strb r0, [r2] @0807A5DA: adds r3, 0x1 cmp r3, 0xA ble @0807A5B8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807A5B0 thumb_func_start sub_807A5F4 sub_807A5F4: ; 807A5F4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x30 mov r8, r0 adds r7, r1, 0 mov r9, r2 movs r5, 0 cmp r5, r7 bge @0807A62E mov r6, sp @0807A60C: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 add r4, r8 adds r0, r4, 0 movs r1, 0x41 bl pokemon_getattr str r0, [r6, 0x18] adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr stm r6!, {r0} adds r5, 0x1 cmp r5, r7 blt @0807A60C @0807A62E: bl sub_809D42C mov r1, r9 lsls r4, r1, 2 cmp r0, 0 bne @0807A65C add r0, sp, 0x18 adds r0, r4 ldr r1, [r0] movs r0, 0xCE lsls r0, 1 cmp r1, r0 bne @0807A64C movs r0, 0x3 b @0807A718 @0807A64C: lsls r0, r1, 16 lsrs r0, 16 bl sub_806E3F8 cmp r0, 0 bne @0807A65C movs r0, 0x2 b @0807A718 @0807A65C: bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r0, =0x020229e8 adds r1, r0 ldrb r0, [r1] subs r0, 0x1 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bls @0807A6AC ldrb r1, [r1, 0x12] movs r0, 0xF ands r0, r1 cmp r0, 0 bne @0807A6AC add r0, sp, 0x18 adds r0, r4 ldr r1, [r0] movs r0, 0xCE lsls r0, 1 cmp r1, r0 bne @0807A6A0 movs r0, 0x5 b @0807A718 .align 2, 0 .pool @0807A6A0: lsls r0, r1, 16 lsrs r0, 16 bl sub_806E3F8 cmp r0, 0 beq @0807A6D2 @0807A6AC: mov r1, sp adds r0, r1, r4 ldr r1, [r0] movs r0, 0xCD lsls r0, 1 cmp r1, r0 beq @0807A6BE cmp r1, 0x97 bne @0807A6D6 @0807A6BE: movs r0, 0x64 mov r1, r9 muls r1, r0 adds r0, r1, 0 add r0, r8 movs r1, 0x50 bl pokemon_getattr cmp r0, 0 bne @0807A6D6 @0807A6D2: movs r0, 0x4 b @0807A718 @0807A6D6: cmp r7, 0 ble @0807A6F4 movs r3, 0xCE lsls r3, 1 movs r2, 0 add r1, sp, 0x18 adds r5, r7, 0 @0807A6E4: ldr r0, [r1] cmp r0, r3 bne @0807A6EC str r2, [r1] @0807A6EC: adds r1, 0x4 subs r5, 0x1 cmp r5, 0 bne @0807A6E4 @0807A6F4: movs r2, 0 movs r5, 0 cmp r2, r7 bge @0807A70E add r1, sp, 0x18 @0807A6FE: cmp r5, r9 beq @0807A706 ldr r0, [r1] adds r2, r0 @0807A706: adds r1, 0x4 adds r5, 0x1 cmp r5, r7 blt @0807A6FE @0807A70E: cmp r2, 0 bne @0807A716 movs r0, 0x1 b @0807A718 @0807A716: movs r0, 0 @0807A718: add sp, 0x30 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_807A5F4 thumb_func_start sub_807A728 sub_807A728: ; 807A728 push {r4-r7,lr} ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0807A7B4 movs r4, 0 bl link_get_multiplayer_id ldr r5, =0x020229e8 movs r7, 0x1 eors r0, r7 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r1, [r1] subs r0, r1, 0x1 lsls r0, 16 lsrs r0, 16 cmp r0, 0x2 bls @0807A7B4 subs r0, r1, 0x4 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @0807A762 movs r4, 0x2 @0807A762: cmp r4, 0 ble @0807A7B4 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r1, [r1, 0x12] movs r6, 0xF0 adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @0807A7B0 cmp r4, 0x2 bne @0807A7B4 bl link_get_multiplayer_id eors r0, r7 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r5 ldrb r1, [r1, 0x12] adds r0, r6, 0 ands r0, r1 cmp r0, 0 bne @0807A7B4 movs r0, 0x2 b @0807A7B6 .align 2, 0 .pool @0807A7B0: movs r0, 0x1 b @0807A7B6 @0807A7B4: movs r0, 0 @0807A7B6: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_807A728 thumb_func_start sub_807A7BC sub_807A7BC: ; 807A7BC push {lr} lsls r0, 16 lsrs r2, r0, 16 lsls r1, 24 lsrs r1, 24 movs r0, 0xCD lsls r0, 1 cmp r2, r0 beq @0807A7D2 cmp r2, 0x97 bne @0807A7DA @0807A7D2: cmp r1, 0 bne @0807A7DA movs r0, 0x1 b @0807A7DC @0807A7DA: movs r0, 0 @0807A7DC: pop {r1} bx r1 thumb_func_end sub_807A7BC thumb_func_start sub_807A7E0 sub_807A7E0: ; 807A7E0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r4, [sp, 0x20] ldr r5, [sp, 0x24] ldr r6, [sp, 0x28] lsls r2, 16 lsrs r7, r2, 16 lsls r3, 16 lsrs r3, 16 mov r8, r3 lsls r4, 24 lsrs r4, 24 lsls r5, 16 lsrs r5, 16 lsls r6, 24 lsrs r6, 24 lsls r2, r0, 23 lsrs r2, 31 mov r9, r2 lsls r0, 24 lsrs r2, r0, 31 lsls r0, r1, 23 lsrs r0, 31 mov r10, r0 lsls r0, r1, 24 lsrs r0, 31 lsls r1, 18 lsrs r1, 28 cmp r1, 0x3 beq @0807A832 cmp r2, 0 bne @0807A82A movs r0, 0x8 b @0807A8C0 @0807A82A: cmp r0, 0 bne @0807A832 movs r0, 0x9 b @0807A8C0 @0807A832: adds r0, r5, 0 adds r1, r6, 0 bl sub_807A7BC cmp r0, 0 bne @0807A898 movs r0, 0xCE lsls r0, 1 cmp r8, r0 bne @0807A84E cmp r7, r8 beq @0807A86C movs r0, 0x2 b @0807A8C0 @0807A84E: ldr r0, =gBaseStats lsls r1, r7, 3 subs r1, r7 lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x6] cmp r0, r4 beq @0807A86C ldrb r0, [r1, 0x7] cmp r0, r4 beq @0807A86C movs r0, 0x1 b @0807A8C0 .align 2, 0 .pool @0807A86C: movs r0, 0xCE lsls r0, 1 cmp r7, r0 bne @0807A87C cmp r7, r8 beq @0807A87C movs r0, 0x3 b @0807A8C0 @0807A87C: mov r0, r9 cmp r0, 0 bne @0807A8AA movs r0, 0xCE lsls r0, 1 cmp r7, r0 bne @0807A88E movs r0, 0x6 b @0807A8C0 @0807A88E: adds r0, r7, 0 bl sub_806E3F8 cmp r0, 0 bne @0807A89C @0807A898: movs r0, 0x4 b @0807A8C0 @0807A89C: mov r0, r8 bl sub_806E3F8 cmp r0, 0 bne @0807A8AA movs r0, 0x5 b @0807A8C0 @0807A8AA: mov r0, r10 cmp r0, 0 bne @0807A8BE adds r0, r7, 0 bl sub_806E3F8 cmp r0, 0 bne @0807A8BE movs r0, 0x7 b @0807A8C0 @0807A8BE: movs r0, 0 @0807A8C0: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_807A7E0 thumb_func_start sub_807A8D0 sub_807A8D0: ; 807A8D0 push {r4-r6,lr} lsls r1, 16 lsrs r5, r1, 16 adds r6, r5, 0 lsls r2, 16 lsrs r2, 16 lsls r3, 24 lsrs r3, 24 lsls r0, 23 lsrs r4, r0, 31 adds r0, r2, 0 adds r1, r3, 0 bl sub_807A7BC cmp r0, 0 bne @0807A90A cmp r4, 0 bne @0807A90E movs r0, 0xCE lsls r0, 1 cmp r5, r0 bne @0807A900 movs r0, 0x2 b @0807A910 @0807A900: adds r0, r6, 0 bl sub_806E3F8 cmp r0, 0 bne @0807A90E @0807A90A: movs r0, 0x1 b @0807A910 @0807A90E: movs r0, 0 @0807A910: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_807A8D0 thumb_func_start sub_807A918 sub_807A918: ; 807A918 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x18 adds r6, r0, 0 lsls r1, 16 lsrs r1, 16 mov r8, r1 movs r5, 0 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r5, r0 bge @0807A95A mov r4, sp @0807A934: movs r0, 0x64 muls r0, r5 adds r0, r6, r0 movs r1, 0x41 bl pokemon_getattr str r0, [r4] movs r1, 0xCE lsls r1, 1 cmp r0, r1 bne @0807A94E movs r0, 0 str r0, [r4] @0807A94E: adds r4, 0x4 adds r5, 0x1 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r5, r0 blt @0807A934 @0807A95A: movs r7, 0 movs r6, 0x1 movs r5, 0 ldr r4, =0x020229e8 b @0807A980 .align 2, 0 .pool @0807A96C: ldrb r0, [r4] subs r0, 0x4 cmp r0, 0x1 bhi @0807A978 movs r7, 0 b @0807A97C @0807A978: movs r0, 0x1 orrs r7, r0 @0807A97C: adds r4, 0x1C adds r5, 0x1 @0807A980: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 blt @0807A96C movs r5, 0 movs r4, 0 b @0807A9B4 @0807A992: ldr r0, =0x020229e8 adds r2, r4, r0 ldrb r1, [r2, 0x10] movs r0, 0xF ands r0, r1 cmp r0, 0 bne @0807A9A2 movs r6, 0 @0807A9A2: cmp r7, 0 beq @0807A9B0 ldrb r0, [r2, 0x10] lsrs r0, 4 cmp r0, 0 beq @0807A9B0 movs r6, 0 @0807A9B0: adds r4, 0x1C adds r5, 0x1 @0807A9B4: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 blt @0807A992 cmp r6, 0 bne @0807A9EA mov r1, r8 lsls r0, r1, 2 mov r1, sp adds r4, r1, r0 ldrh r0, [r4] bl sub_806E3F8 cmp r0, 0 bne @0807A9E0 movs r0, 0x2 b @0807AA1A .align 2, 0 .pool @0807A9E0: ldr r0, [r4] cmp r0, 0 bne @0807A9EA movs r0, 0x3 b @0807AA1A @0807A9EA: movs r2, 0 movs r5, 0 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r2, r0 bge @0807AA0A adds r3, r0, 0 mov r1, sp @0807A9FA: cmp r8, r5 beq @0807AA02 ldr r0, [r1] adds r2, r0 @0807AA02: adds r1, 0x4 adds r5, 0x1 cmp r5, r3 blt @0807A9FA @0807AA0A: cmp r2, 0 beq @0807AA18 movs r0, 0 b @0807AA1A .align 2, 0 .pool @0807AA18: movs r0, 0x1 @0807AA1A: add sp, 0x18 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_807A918 thumb_func_start sub_807AA28 sub_807AA28: ; 807AA28 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0xA bne @0807AA44 movs r0, 0x17 bl audio_play movs r0, 0 strh r0, [r4, 0x2E] @0807AA44: pop {r4} pop {r0} bx r0 thumb_func_end sub_807AA28 thumb_func_start sub_807AA4C sub_807AA4C: ; 807AA4C push {r4,r5,lr} adds r4, r0, 0 adds r0, 0x3E ldrb r1, [r0] movs r0, 0x4 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @0807AA76 ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0xA bne @0807AA76 movs r0, 0xC2 bl audio_play strh r5, [r4, 0x2E] @0807AA76: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_807AA4C thumb_func_start sub_807AA7C sub_807AA7C: ; 807AA7C push {lr} adds r2, r0, 0 movs r0, 0x30 ldrsh r1, [r2, r0] cmp r1, 0 bne @0807AAB2 ldrh r0, [r2, 0x2E] adds r0, 0x1 strh r0, [r2, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0xC bne @0807AA98 strh r1, [r2, 0x2E] @0807AA98: movs r1, 0x2E ldrsh r0, [r2, r1] lsls r0, 1 ldr r1, =gUnknown_08338EA4 adds r0, r1 ldrb r1, [r2, 0x5] lsrs r1, 4 adds r1, 0x10 lsls r1, 4 adds r1, 0x4 movs r2, 0x2 bl gpu_pal_apply @0807AAB2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807AA7C thumb_func_start sub_807AABC sub_807AABC: ; 807AABC push {lr} adds r2, r0, 0 ldrh r1, [r2, 0x2E] adds r1, 0x1 strh r1, [r2, 0x2E] ldrh r0, [r2, 0x26] adds r0, 0x1 strh r0, [r2, 0x26] lsls r1, 16 asrs r1, 16 cmp r1, 0xA bne @0807AADA adds r0, r2, 0 bl 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, =0x020322a0 ldr r0, [r0] mov r12, r0 adds r0, 0xD4 ldrh r1, [r0] lsls r1, 8 adds r0, 0x2 ldrh r2, [r0] lsls r2, 8 adds r0, 0x6 movs r4, 0 ldrsh r3, [r0, r4] adds r0, 0x2 movs r5, 0 ldrsh r0, [r0, r5] str r0, [sp] mov r4, r12 adds r4, 0xE8 movs r5, 0 ldrsh r0, [r4, r5] str r0, [sp, 0x4] movs r5, 0 ldrsh r0, [r4, r5] str r0, [sp, 0x8] mov r0, r12 adds r0, 0xEC ldrh r0, [r0] str r0, [sp, 0xC] add r0, sp, 0x10 bl sub_806F6C0 add r0, sp, 0x10 ldrh r1, [r0] movs r0, 0x20 bl 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 .pool thumb_func_end sub_807AB28 thumb_func_start sub_807ABCC sub_807ABCC: ; 807ABCC push {r4,lr} ldr r4, =0x020322a0 ldr r0, [r4] adds r0, 0xE0 ldrh r1, [r0] movs r0, 0x16 bl 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 .pool @0807AC18: bl sub_807AB28 @0807AC1C: pop {r4} pop {r0} bx r0 thumb_func_end sub_807ABCC thumb_func_start sub_807AC24 sub_807AC24: ; 807AC24 push {lr} bl sub_807ABCC bl 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, =0x020322a0 ldr r1, [r3] movs r0, 0x8A adds r0, r1 mov r12, r0 movs r2, 0 movs r0, 0 mov r4, r12 strh r0, [r4] adds r1, 0x88 strb r2, [r1] ldr r0, [r3] adds r0, 0x89 strb r2, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807AC3C thumb_func_start sub_807AC64 sub_807AC64: ; 807AC64 push {r4,r5,lr} ldr r0, =0x020322a0 ldr r2, [r0] adds r1, r2, 0 adds r1, 0x88 adds r3, r2, 0 adds r3, 0x89 ldrb r1, [r1] adds r5, r0, 0 ldrb r3, [r3] cmp r1, r3 bne @0807AC8C adds r1, r2, 0 adds r1, 0x8A ldrh r0, [r1] adds r0, 0x1 b @0807AC92 .align 2, 0 .pool @0807AC8C: adds r1, r2, 0 adds r1, 0x8A movs r0, 0 @0807AC92: strh r0, [r1] adds r4, r5, 0 ldr r0, [r4] adds r0, 0x8A ldrh r1, [r0] movs r0, 0x96 lsls r0, 1 cmp r1, r0 bls @0807ACC4 bl sub_80097E8 ldr r0, =c2_800ACD4 bl 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 .pool thumb_func_end sub_807AC64 thumb_func_start sub_807ACDC sub_807ACDC: ; 807ACDC push {lr} ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0807ACF0 movs r0, 0 b @0807ACF8 .align 2, 0 .pool @0807ACF0: bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 @0807ACF8: pop {r1} bx r1 thumb_func_end sub_807ACDC thumb_func_start sub_807ACFC sub_807ACFC: ; 807ACFC push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r5, r1, 24 movs r4, 0 mov r8, r4 cmp r6, 0 bne @0807AD22 ldr r0, =0x02032298 ldrb r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 mov r8, r1 movs r4, 0x1 @0807AD22: cmp r6, 0x1 bne @0807AD40 ldr r0, =0x02032298 ldrb r0, [r0, 0x1] movs r1, 0x6 bl __umodsi3 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 mov r8, r1 movs r4, 0x3 @0807AD40: cmp r5, 0 beq @0807AD58 cmp r5, 0x1 beq @0807ADE0 b @0807AE36 .align 2, 0 .pool @0807AD58: mov r0, r8 movs r1, 0x41 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 mov r0, r8 movs r1, 0 bl pokemon_getattr adds r7, r0, 0 cmp r6, 0 bne @0807AD94 lsls r0, r5, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] ldr r1, [r1, 0x8] adds r2, r5, 0 adds r3, r7, 0 bl help_system_enable_unless_flashback__sp199 movs r4, 0 b @0807ADB2 .align 2, 0 .pool @0807AD94: lsls r0, r5, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r2, [r1] lsls r4, r6, 1 adds r1, r4, 0x1 lsls r1, 2 adds r2, 0x4 adds r2, r1 ldr r1, [r2] adds r2, r5, 0 adds r3, r7, 0 bl sub_8034B50 @0807ADB2: mov r0, r8 bl sub_806E794 bl gpu_pal_obj_decompress_and_apply ldr r0, =0x020322a0 ldr r1, [r0] adds r0, r1, 0 adds r0, 0xF0 adds r0, r4 strh r5, [r0] lsls r0, r6, 2 adds r1, 0x68 adds r1, r0 str r7, [r1] b @0807AE36 .align 2, 0 .pool @0807ADE0: mov r0, r8 bl sub_806E794 ldrh r0, [r0, 0x4] adds r1, r4, 0 bl sub_806A068 ldr r0, =0x0202499c movs r1, 0x78 movs r2, 0x3C movs r3, 0x6 bl obj_add_from_template_forward_search ldr r4, =0x020322a0 ldr r1, [r4] adds r1, 0x8E adds r1, r6 strb r0, [r1] ldr r3, =0x02020630 ldr r0, [r4] adds r0, 0x8E adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] ldr r0, [r4] adds r0, 0x8E adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r3, 0x1C adds r0, r3 ldr r1, =nullsub_12 str r1, [r0] @0807AE36: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807ACFC thumb_func_start sub_807AE50 sub_807AE50: ; 807AE50 push {r4,r5,lr} sub sp, 0x4 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0xC bls @0807AE66 b @0807B116 @0807AE66: lsls r0, 2 ldr r1, =@0807AE78 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807AE78: .4byte @0807AEAC .4byte @0807AF58 .4byte @0807AF9C .4byte @0807AFBC .4byte @0807B006 .4byte @0807B034 .4byte @0807B058 .4byte @0807B070 .4byte @0807B07A .4byte @0807B094 .4byte @0807B0B0 .4byte @0807B0D4 .4byte @0807B0F0 @0807AEAC: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0807AEC0 ldr r1, =0x020229c6 ldr r2, =0x00001144 adds r0, r2, 0 strh r0, [r1] bl sub_80097E8 @0807AEC0: ldr r4, =0x020322a0 movs r5, 0x80 lsls r5, 1 adds r0, r5, 0 bl 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, =sub_807AC24 bl SetVBlankCallback bl sub_807B170 bl sub_807AC3C ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] ldr r1, [r4] adds r0, r1, 0 adds r0, 0x8C strh r2, [r0] adds r0, 0x8 strh r2, [r0] adds r1, 0xEE movs r0, 0x1 strb r0, [r1] ldr r3, [r4] adds r0, r3, 0 adds r0, 0xD4 movs r1, 0x40 strh r1, [r0] adds r0, 0x2 strh r1, [r0] adds r0, 0x2 strh r2, [r0] adds r0, 0x2 strh r2, [r0] adds r1, r3, 0 adds r1, 0xDC movs r0, 0x78 strh r0, [r1] adds r1, 0x2 movs r0, 0x50 strh r0, [r1] adds r0, r3, 0 adds r0, 0xE8 strh r5, [r0] adds r0, 0x4 strh r2, [r0] b @0807B116 .align 2, 0 .pool @0807AF58: ldr r0, =0x03003124 ldrb r5, [r0] cmp r5, 0 bne @0807AF90 ldr r4, =0x020322a0 ldr r0, [r4] adds r0, 0xFA movs r1, 0x1 strb r1, [r0] bl sub_8009734 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r4] str r5, [r0, 0x64] b @0807B116 .align 2, 0 .pool @0807AF90: movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 movs r0, 0x4 strb r0, [r1] b @0807B116 @0807AF9C: ldr r0, =0x020322a0 ldr r1, [r0] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x3C bhi @0807AFAC b @0807B116 @0807AFAC: movs r0, 0 str r0, [r1, 0x64] movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 b @0807B0E4 .align 2, 0 .pool @0807AFBC: bl sub_800ABBC lsls r0, 24 cmp r0, 0 bne @0807AFC8 b @0807B0DC @0807AFC8: bl sub_800ABAC adds r4, r0, 0 bl sub_800AA48 lsls r4, 24 lsls r0, 24 cmp r4, r0 bcc @0807B000 ldr r0, =0x020322a0 ldr r1, [r0] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x1E bhi @0807AFEA b @0807B116 @0807AFEA: bl sub_800A620 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @0807B0E4 .align 2, 0 .pool @0807B000: bl sub_807AC64 b @0807B116 @0807B006: bl sub_807AC64 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 beq @0807B014 b @0807B116 @0807B014: bl sub_800A23C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0807B022 b @0807B116 @0807B022: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @0807B0E4 .align 2, 0 .pool @0807B034: ldr r2, =0x020322a0 ldr r0, [r2] adds r0, 0x72 movs r1, 0 strb r1, [r0] ldr r0, [r2] adds r0, 0x73 strb r1, [r0] ldr r0, [r2] adds r0, 0x93 strb r1, [r0] movs r0, 0 bl sub_807ACFC b @0807B0DC .align 2, 0 .pool @0807B058: movs r0, 0 movs r1, 0x1 bl sub_807ACFC ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @0807B0E4 .align 2, 0 .pool @0807B070: movs r0, 0x1 movs r1, 0 bl sub_807ACFC b @0807B0DC @0807B07A: movs r0, 0x1 movs r1, 0x1 bl sub_807ACFC bl sub_807B154 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @0807B0E4 .align 2, 0 .pool @0807B094: bl sub_807BA94 ldr r0, =gUnknown_08338D18 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08338D20 bl gpu_pal_obj_alloc_tag_and_apply b @0807B0DC .align 2, 0 .pool @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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @0807B0E4 .align 2, 0 .pool @0807B0D4: bl sub_807B140 bl sub_807BAD8 @0807B0DC: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @0807B0E4: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0807B116 .align 2, 0 .pool @0807B0F0: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0807B116 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @0807B110 bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 @0807B110: ldr r0, =sub_807EA2C bl 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 .pool thumb_func_end sub_807AE50 thumb_func_start sub_807B140 sub_807B140: ; 807B140 push {lr} movs r0, 0x5 bl sub_807B62C movs r0, 0 bl sub_807B62C pop {r0} bx r0 thumb_func_end sub_807B140 thumb_func_start sub_807B154 sub_807B154: ; 807B154 push {lr} movs r0, 0 movs r1, 0xFF bl 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, =gUnknown_08339014 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, =gUnknown_08C00000 mov r10, r0 movs r0, 0 mov r9, r0 str r0, [sp] mov r1, r10 movs r2, 0 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree ldr r0, =gUnknown_08C00524 mov r8, r0 ldr r4, =0x0201c000 adds r1, r4, 0 bl 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, =gUnknown_08C004E0 adds r0, r6, 0 movs r1, 0 movs r2, 0x20 bl decompress_palette ldr r0, =gUnknown_08338FFC 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 .pool thumb_func_end sub_807B170 thumb_func_start sub_807B270 sub_807B270: ; 807B270 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0xC ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r0, [r0] cmp r0, 0xC bls @0807B288 b @0807B43E @0807B288: lsls r0, 2 ldr r1, =@0807B29C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807B29C: .4byte @0807B2D0 .4byte @0807B43E .4byte @0807B43E .4byte @0807B43E .4byte @0807B43E .4byte @0807B3AC .4byte @0807B3B6 .4byte @0807B3C0 .4byte @0807B3D0 .4byte @0807B3F0 .4byte @0807B40C .4byte @0807B414 .4byte @0807B438 @0807B2D0: ldr r1, =0x02032298 ldr r0, =0x020375e2 ldrh r0, [r0] movs r6, 0 strb r0, [r1] movs r0, 0x6 strb r0, [r1, 0x1] ldr r4, =0x020229f0 ldr r0, =0x03005d90 ldr r1, [r0] adds r0, r4, 0 bl gf_strcpy ldr r5, =0x02024744 adds r0, r5, 0 movs r1, 0x7 mov r2, sp bl pokemon_getattr adds r0, r4, 0 adds r0, 0x1C mov r1, sp bl 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, =0x020322a0 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, =sub_807AC24 bl SetVBlankCallback bl sub_807B170 ldr r0, [r4] adds r0, 0xEE mov r1, r8 strb r1, [r0] ldr r2, [r4] adds r0, r2, 0 adds r0, 0x8C strh r6, [r0] adds r0, 0x8 strh r6, [r0] adds r0, 0x40 movs r1, 0x40 strh r1, [r0] adds r0, 0x2 strh r1, [r0] adds r0, 0x2 strh r6, [r0] adds r0, 0x2 strh r6, [r0] adds r1, r2, 0 adds r1, 0xDC movs r0, 0x78 strh r0, [r1] adds r1, 0x2 movs r0, 0x50 strh r0, [r1] adds r0, r2, 0 adds r0, 0xE8 strh r5, [r0] adds r0, 0x4 strh r6, [r0] str r6, [r2, 0x64] ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x5 strb r1, [r0] b @0807B43E .align 2, 0 .pool @0807B3AC: movs r0, 0 movs r1, 0 bl sub_807ACFC b @0807B424 @0807B3B6: movs r0, 0 movs r1, 0x1 bl sub_807ACFC b @0807B424 @0807B3C0: movs r0, 0x1 movs r1, 0 bl sub_807ACFC movs r0, 0 bl 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, =gUnknown_08338D18 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08338D20 bl gpu_pal_obj_alloc_tag_and_apply b @0807B424 .align 2, 0 .pool @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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0807B43E .align 2, 0 .pool @0807B438: ldr r0, =sub_807B60C 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 .pool thumb_func_end sub_807B270 thumb_func_start sub_807B464 sub_807B464: ; 807B464 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0807B4B8 adds r0, r5, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 movs r1, 0 movs r2, 0 bl pokemon_getattr adds r5, r0, 0 adds r0, r4, 0 bl SpeciesToNationalPokedexNum adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r4, 0 movs r1, 0x2 bl pokedex_flag_operation adds r0, r4, 0 movs r1, 0x3 adds r2, r5, 0 bl sub_806F01C @0807B4B8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807B464 thumb_func_start sub_807B4C4 sub_807B4C4: ; 807B4C4 push {lr} bl link_get_multiplayer_id pop {r0} bx r0 thumb_func_end sub_807B4C4 thumb_func_start sub_807B4D0 sub_807B4D0: ; 807B4D0 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 mov r9, r0 lsls r4, 24 lsrs r4, 24 movs r5, 0x64 mov r1, r9 muls r1, r5 ldr r0, =0x020244ec adds r7, r1, r0 adds r0, r7, 0 movs r1, 0x40 bl pokemon_getattr lsls r0, 16 lsrs r6, r0, 16 adds r1, r4, 0 muls r1, r5 ldr r0, =0x02024744 adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x40 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r8, r0 cmp r6, 0xFF beq @0807B52A ldr r0, =0x03005d8c lsls r1, r6, 3 adds r1, r6 lsls r1, 2 ldr r2, =0x00002be0 adds r1, r2 ldr r0, [r0] adds r0, r1 bl sub_80D439C @0807B52A: ldr r4, =0x020322a0 ldr r0, [r4] adds r1, r7, 0 movs r2, 0x64 bl memcpy adds r0, r7, 0 adds r1, r5, 0 movs r2, 0x64 bl memcpy ldr r1, [r4] adds r0, r5, 0 movs r2, 0x64 bl memcpy movs r1, 0x46 mov r0, sp strb r1, [r0] adds r0, r7, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0807B566 adds r0, r7, 0 movs r1, 0x20 mov r2, sp bl pokemon_setattr @0807B566: mov r0, r8 cmp r0, 0xFF beq @0807B57C lsls r1, r0, 3 add r1, r8 lsls r1, 2 ldr r0, =0x020321c0 adds r1, r0 adds r0, r7, 0 bl sub_80D460C @0807B57C: mov r0, r9 bl sub_807B464 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0807B58E bl sub_807B4C4 @0807B58E: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807B4D0 thumb_func_start sub_807B5B8 sub_807B5B8: ; 807B5B8 push {r4,lr} ldr r4, =0x020322a0 ldr r0, [r4] adds r0, 0x93 ldrb r0, [r0] cmp r0, 0x1 beq @0807B5D0 cmp r0, 0x2 beq @0807B5F6 b @0807B600 .align 2, 0 .pool @0807B5D0: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0807B5F6 bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, [r4] adds r1, 0x74 movs r2, 0x14 bl link_0800A448 ldr r1, [r4] adds r1, 0x93 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0807B5F6: ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x93 movs r1, 0 strb r1, [r0] @0807B600: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =@0807B648 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807B648: .4byte @0807B668 .4byte @0807B6DC .4byte @0807B784 .4byte @0807B7F8 .4byte @0807B840 .4byte @0807B90C .4byte @0807B924 .4byte @0807B9FC @0807B668: ldr r0, =0x020322a0 ldr r1, [r0] adds r2, r1, 0 adds r2, 0xE4 movs r0, 0 strh r0, [r2] adds r1, 0xE6 movs r0, 0xB4 strh r0, [r1] movs r1, 0xAA lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r1, =0x00005206 movs r0, 0xC bl lcd_io_set ldr r0, =gUnknown_08DD7300 movs r1, 0x10 movs r2, 0x60 bl gpu_pal_apply ldr r3, =gUnknown_08DD7360 ldr r4, =0x06004000 movs r5, 0xA1 lsls r5, 5 ldr r1, =0x040000d4 ldr r6, =0x80000800 movs r2, 0x80 lsls r2, 5 movs r7, 0x80 lsls r7, 24 @0807B6AA: str r3, [r1] str r4, [r1, 0x4] str r6, [r1, 0x8] ldr r0, [r1, 0x8] adds r3, r2 adds r4, r2 subs r5, r2 cmp r5, r2 bhi @0807B6AA b @0807BA4C .align 2, 0 .pool @0807B6DC: ldr r4, =0x020322a0 ldr r2, [r4] adds r1, r2, 0 adds r1, 0xE2 movs r0, 0 strh r0, [r1] adds r2, 0xE0 movs r1, 0xAE lsls r1, 1 strh r1, [r2] movs r0, 0x16 bl lcd_io_set ldr r1, =0x00008502 movs r0, 0xA bl lcd_io_set ldr r1, =0x00009206 movs r0, 0xC bl lcd_io_set ldr r0, [r4] adds r0, 0xFA ldrb r0, [r0] cmp r0, 0 beq @0807B724 ldr r1, =gUnknown_083369A0 b @0807B726 .align 2, 0 .pool @0807B724: ldr r1, =gUnknown_083359A0 @0807B726: ldr r2, =0x06002800 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x80000800 str r1, [r0, 0x8] ldr r0, [r0, 0x8] ldr r3, =gUnknown_08DD7360 movs r4, 0xC0 lsls r4, 19 movs r5, 0xA1 lsls r5, 5 ldr r1, =0x040000d4 ldr r6, =0x80000800 movs r2, 0x80 lsls r2, 5 movs r7, 0x80 lsls r7, 24 @0807B74A: str r3, [r1] str r4, [r1, 0x4] str r6, [r1, 0x8] ldr r0, [r1, 0x8] adds r3, r2 adds r4, r2 subs r5, r2 cmp r5, r2 bhi @0807B74A str r3, [r1] str r4, [r1, 0x4] lsrs r0, r5, 1 orrs r0, r7 str r0, [r1, 0x8] ldr r0, [r1, 0x8] movs r1, 0x92 lsls r1, 5 b @0807B820 .align 2, 0 .pool @0807B784: ldr r0, =0x020322a0 ldr r2, [r0] adds r0, r2, 0 adds r0, 0xE0 movs r1, 0 strh r1, [r0] adds r0, 0x2 strh r1, [r0] adds r0, 0x18 ldrb r0, [r0] cmp r0, 0 bne @0807B7C0 ldr r1, =0x00001241 movs r0, 0 bl lcd_io_set ldr r0, =gUnknown_083379A0 ldr r1, =0x06002800 bl LZ77UnCompVram movs r0, 0x8 b @0807B7DA .align 2, 0 .pool @0807B7C0: ldr r1, =0x00001241 movs r0, 0 bl lcd_io_set ldr r1, =gUnknown_0832FFC0 ldr r2, =0x06002800 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x80000400 str r1, [r0, 0x8] ldr r0, [r0, 0x8] movs r0, 0x1 @0807B7DA: movs r1, 0x10 movs r2, 0 bl sub_80A2A20 b @0807BA68 .align 2, 0 .pool @0807B7F8: ldr r0, =gUnknown_08337EA0 movs r1, 0x30 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_08337EC0 ldr r1, =0x06004000 bl LZ77UnCompVram ldr r0, =gUnknown_08338550 ldr r1, =0x06009000 bl LZ77UnCompVram ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0xE4 movs r1, 0x50 strh r1, [r0] movs r1, 0xB2 lsls r1, 5 @0807B820: movs r0, 0 bl lcd_io_set b @0807BA68 .align 2, 0 .pool @0807B840: ldr r1, =0x00001441 movs r0, 0 bl lcd_io_set ldr r1, =0x00001287 movs r0, 0xC bl lcd_io_set ldr r0, =0x020322a0 ldr r3, [r0] adds r1, r3, 0 adds r1, 0xD4 movs r2, 0 movs r0, 0x40 strh r0, [r1] adds r1, 0x2 movs r0, 0x5C strh r0, [r1] adds r1, 0x12 movs r0, 0x20 strh r0, [r1] adds r1, 0x2 movs r0, 0x80 lsls r0, 3 strh r0, [r1] adds r0, r3, 0 adds r0, 0xEC strh r2, [r0] ldr r3, =gUnknown_08332F60 ldr r4, =0x06004000 movs r5, 0xA1 lsls r5, 6 ldr r1, =0x040000d4 ldr r6, =0x80000800 movs r2, 0x80 lsls r2, 5 movs r7, 0x80 lsls r7, 24 @0807B88C: str r3, [r1] str r4, [r1, 0x4] str r6, [r1, 0x8] ldr r0, [r1, 0x8] adds r3, r2 adds r4, r2 subs r5, r2 cmp r5, r2 bhi @0807B88C str r3, [r1] str r4, [r1, 0x4] lsrs r0, r5, 1 orrs r0, r7 str r0, [r1, 0x8] ldr r0, [r1, 0x8] ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0xFA ldrb r0, [r0] cmp r0, 0 beq @0807B8EC ldr r1, =gUnknown_083357A0 ldr r2, =0x06009000 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x80000080 b @0807BA64 .align 2, 0 .pool @0807B8EC: ldr r1, =gUnknown_083358A0 ldr r2, =0x06009000 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x80000080 b @0807BA64 .align 2, 0 .pool @0807B90C: ldr r0, =0x020322a0 ldr r0, [r0] adds r1, r0, 0 adds r1, 0xE0 movs r2, 0 strh r2, [r1] adds r0, 0xE2 strh r2, [r0] b @0807BA68 .align 2, 0 .pool @0807B924: ldr r1, =0x00001441 movs r0, 0 bl lcd_io_set ldr r1, =0x00001287 movs r0, 0xC bl lcd_io_set ldr r0, =0x020322a0 ldr r3, [r0] adds r1, r3, 0 adds r1, 0xD4 movs r2, 0 movs r0, 0x40 strh r0, [r1] adds r1, 0x2 movs r0, 0x5C strh r0, [r1] adds r1, 0x12 adds r0, 0xA4 strh r0, [r1] adds r1, 0x2 movs r0, 0x80 strh r0, [r1] subs r1, 0xE movs r0, 0x78 strh r0, [r1] adds r1, 0x2 movs r0, 0x50 strh r0, [r1] adds r0, r3, 0 adds r0, 0xEC strh r2, [r0] ldr r3, =gUnknown_08332F60 ldr r4, =0x06004000 movs r5, 0xA1 lsls r5, 6 ldr r1, =0x040000d4 ldr r6, =0x80000800 movs r2, 0x80 lsls r2, 5 movs r7, 0x80 lsls r7, 24 @0807B97A: str r3, [r1] str r4, [r1, 0x4] str r6, [r1, 0x8] ldr r0, [r1, 0x8] adds r3, r2 adds r4, r2 subs r5, r2 cmp r5, r2 bhi @0807B97A str r3, [r1] str r4, [r1, 0x4] lsrs r0, r5, 1 orrs r0, r7 str r0, [r1, 0x8] ldr r0, [r1, 0x8] ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0xFA ldrb r0, [r0] cmp r0, 0 beq @0807B9DC ldr r1, =gUnknown_083357A0 ldr r2, =0x06009000 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x80000080 b @0807BA64 .align 2, 0 .pool @0807B9DC: ldr r1, =gUnknown_083358A0 ldr r2, =0x06009000 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x80000080 b @0807BA64 .align 2, 0 .pool @0807B9FC: ldr r0, =0x020322a0 ldr r0, [r0] adds r1, r0, 0 adds r1, 0xE4 movs r2, 0 strh r2, [r1] adds r0, 0xE6 strh r2, [r0] movs r0, 0x50 movs r1, 0 bl lcd_io_set ldr r1, =0x00005206 movs r0, 0xC bl lcd_io_set ldr r0, =gUnknown_08DD7300 movs r1, 0x10 movs r2, 0x60 bl gpu_pal_apply ldr r3, =gUnknown_08DD7360 ldr r4, =0x06004000 movs r5, 0xA1 lsls r5, 5 ldr r1, =0x040000d4 ldr r6, =0x80000800 movs r2, 0x80 lsls r2, 5 movs r7, 0x80 lsls r7, 24 @0807BA3A: str r3, [r1] str r4, [r1, 0x4] str r6, [r1, 0x8] ldr r0, [r1, 0x8] adds r3, r2 adds r4, r2 subs r5, r2 cmp r5, r2 bhi @0807BA3A @0807BA4C: str r3, [r1] str r4, [r1, 0x4] lsrs r0, r5, 1 orrs r0, r7 str r0, [r1, 0x8] ldr r0, [r1, 0x8] ldr r1, =gUnknown_08331F60 ldr r2, =0x06009000 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x80000800 @0807BA64: str r1, [r0, 0x8] ldr r0, [r0, 0x8] @0807BA68: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807B62C thumb_func_start sub_807BA94 sub_807BA94: ; 807BA94 push {lr} ldr r0, =gUnknown_08338D70 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08338DC0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08338DF4 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08338E6C bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08338D78 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_08338D80 bl gpu_pal_obj_alloc_tag_and_apply pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807BA94 thumb_func_start sub_807BAD8 sub_807BAD8: ; 807BAD8 push {r4,r5,lr} sub sp, 0x14 ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0xEE ldrb r0, [r0] cmp r0, 0 beq @0807BB68 bl link_get_multiplayer_id lsls r0, 24 ldr r3, =0x02021cc4 movs r2, 0x80 lsls r2, 17 eors r2, r0 lsrs r2, 24 lsls r1, r2, 3 subs r1, r2 lsls r1, 2 ldr r0, =0x020229f0 adds r1, r0 adds r0, r3, 0 bl gf_strcpy ldr r5, =0x02032298 ldrb r0, [r5, 0x1] movs r1, 0x6 bl __umodsi3 lsls r0, 24 lsrs r0, 24 movs r4, 0x64 muls r0, r4 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr ldr r0, =0x02021ec4 mov r1, sp bl strcpy_limit_10_chars ldrb r0, [r5] muls r0, r4 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr ldr r0, =0x02021dc4 mov r1, sp bl strcpy_limit_10_chars b @0807BBA4 .align 2, 0 .pool @0807BB68: ldr r0, =0x020375e0 ldrh r0, [r0] lsls r4, r0, 4 subs r4, r0 lsls r4, 2 ldr r0, =gUnknown_08338ED0 adds r4, r0 ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x2B bl gf_strcpy ldr r0, =0x02021ec4 adds r1, r4, 0 bl strcpy_limit_10_chars ldr r0, =0x020375e2 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr ldr r0, =0x02021dc4 mov r1, sp bl strcpy_limit_10_chars @0807BBA4: add sp, 0x14 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807BAD8 thumb_func_start sub_807BBC8 sub_807BBC8: ; 807BBC8 push {lr} ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0xFA ldrb r0, [r0] cmp r0, 0 bne @0807BBE0 bl sub_807CFC8 b @0807BBE4 .align 2, 0 .pool @0807BBE0: bl sub_807BBEC @0807BBE4: lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_807BBC8 thumb_func_start sub_807BBEC sub_807BBEC: ; 807BBEC push {r4-r7,lr} sub sp, 0x14 ldr r0, =0x020322a0 ldr r1, [r0] adds r1, 0x94 ldrh r5, [r1] ldr r1, =0x0000010b adds r7, r0, 0 cmp r5, r1 bls @0807BC04 bl @0807CFB4 @0807BC04: lsls r0, r5, 2 ldr r1, =@0807BC1C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807BC1C: .4byte @0807C04C .4byte @0807C0C4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807C120 .4byte @0807C168 .4byte @0807C1DC .4byte @0807CFB4 .4byte @0807C248 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807C26C .4byte @0807C29C .4byte @0807C2AE .4byte @0807C2D0 .4byte @0807C318 .4byte @0807C348 .4byte @0807C390 .4byte @0807C3E0 .4byte @0807C434 .4byte @0807C4B8 .4byte @0807C4DC .4byte @0807C528 .4byte @0807C574 .4byte @0807C5D0 .4byte @0807C630 .4byte @0807C644 .4byte @0807C658 .4byte @0807C66C .4byte @0807C794 .4byte @0807C864 .4byte @0807C8EC .4byte @0807C964 .4byte @0807C974 .4byte @0807C994 .4byte @0807C9E4 .4byte @0807CA02 .4byte @0807CA40 .4byte @0807CA50 .4byte @0807CAC8 .4byte @0807CFB4 .4byte @0807CAF0 .4byte @0807CB30 .4byte @0807CB70 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CB90 .4byte @0807CBB8 .4byte @0807CBD4 .4byte @0807CBF4 .4byte @0807CC9C .4byte @0807CCD0 .4byte @0807CD1C .4byte @0807CDDC .4byte @0807CE54 .4byte @0807CEA0 .4byte @0807CEB0 .4byte @0807CEB6 .4byte @0807CEDC .4byte @0807CF38 .4byte @0807CF5C .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CE18 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807C460 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CFB4 .4byte @0807CE38 @0807C04C: ldr r3, =0x02020630 ldr r0, [r7] adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] ldr r4, [r7] adds r2, r4, 0 adds r2, 0x8E ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldr r1, =0x0000ff4c strh r1, [r0, 0x24] ldrb r0, [r2] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r3 ldr r2, =gUnknown_08300D38 adds r0, r4, 0 adds r0, 0xF0 ldrh r0, [r0] lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] strh r0, [r1, 0x26] adds r1, r4, 0 adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] bl current_map_music_get ldr r1, [r7] adds r1, 0xF4 strh r0, [r1] ldr r0, =0x00000179 bl current_map_music_set bl @0807CFB4 .align 2, 0 .pool @0807C0C4: ldr r5, [r7] adds r6, r5, 0 adds r6, 0xE6 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 ble @0807C0F8 ldr r2, =0x02020630 adds r0, r5, 0 adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x24] adds r1, 0x3 strh r1, [r0, 0x24] ldrh r0, [r6] subs r0, 0x3 strh r0, [r6] bl @0807CFB4 .align 2, 0 .pool @0807C0F8: ldr r2, =0x02020630 adds r0, r5, 0 adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strh r1, [r0, 0x24] strh r1, [r6] adds r1, r5, 0 adds r1, 0x94 movs r0, 0xA strh r0, [r1] bl @0807CFB4 .align 2, 0 .pool @0807C120: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE942 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0 bl sub_807F1A8 ldr r4, =0x020322a0 ldr r0, [r4] adds r2, r0, 0 adds r2, 0xF0 ldrh r1, [r2] movs r0, 0xCE lsls r0, 1 cmp r1, r0 beq @0807C14E adds r0, r1, 0 movs r1, 0 bl cry_related @0807C14E: ldr r3, [r4] adds r1, r3, 0 adds r1, 0x94 movs r2, 0 movs r0, 0xB bl @0807CE06 .align 2, 0 .pool @0807C168: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x50 beq @0807C178 bl @0807CFB4 @0807C178: adds r0, r1, 0 adds r0, 0x8E ldrb r0, [r0] ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r1, [r1, 0x5] lsrs r1, 4 movs r2, 0x2 str r2, [sp] movs r2, 0x1 str r2, [sp, 0x4] movs r2, 0x14 str r2, [sp, 0x8] ldr r2, =0x000fffff str r2, [sp, 0xC] movs r2, 0x78 movs r3, 0x20 bl sub_807671C ldr r1, [r7] adds r1, 0xD2 strb r0, [r1] ldr r1, [r7] adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE959 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0 bl sub_807F1A8 bl @0807CFB4 .align 2, 0 .pool @0807C1DC: ldr r5, =0x02020630 ldr r0, [r7] adds r0, 0xD2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r5, 0 adds r4, 0x1C adds r0, r4 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @0807C1FC bl @0807CFB4 @0807C1FC: ldr r0, =gUnknown_08338D28 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, =sub_807E5D8 str r1, [r0] adds r2, 0xD2 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 bl obj_delete_and_free_tiles ldr r1, [r7] bl @0807CF4C .align 2, 0 .pool @0807C248: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0x14 strh r1, [r0] bl @0807CFB4 .align 2, 0 .pool @0807C26C: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807C27C bl @0807CFB4 @0807C27C: movs r0, 0x4 bl sub_807B62C movs r0, 0 movs r1, 0xFF bl Window_FastFillPixels movs r0, 0 movs r1, 0x3 bl Window_CopyToVram bl @0807CF48 .align 2, 0 .pool @0807C29C: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0x10 movs r3, 0 bl @0807CF44 @0807C2AE: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807C2BE bl @0807CFB4 @0807C2BE: ldr r0, [r7] adds r0, 0x94 movs r1, 0x17 strh r1, [r0] bl @0807CFB4 .align 2, 0 .pool @0807C2D0: ldr r4, =0x020322a0 ldr r0, [r4] adds r2, r0, 0 adds r2, 0xEA ldrh r1, [r2] movs r0, 0x80 lsls r0, 1 cmp r1, r0 bls @0807C2F0 adds r0, r1, 0 subs r0, 0x34 strh r0, [r2] b @0807C30C .align 2, 0 .pool @0807C2F0: movs r0, 0x1 bl sub_807B62C ldr r3, [r4] adds r1, r3, 0 adds r1, 0xEA movs r2, 0 movs r0, 0x80 strh r0, [r1] subs r1, 0x56 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] str r2, [r3, 0x64] @0807C30C: ldr r0, =0x020322a0 ldr r4, [r0] bl @0807CB5C .align 2, 0 .pool @0807C318: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x14 bhi @0807C328 bl @0807CFB4 @0807C328: bl sub_807AB28 ldr r0, =gUnknown_08338E74 movs r1, 0x78 movs r2, 0x50 movs r3, 0 bl obj_add_from_template_forward_search ldr r1, [r7] adds r1, 0x91 strb r0, [r1] ldr r1, [r7] bl @0807CF4C .align 2, 0 .pool @0807C348: ldr r2, =0x02020630 ldr r0, [r7] adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 27 cmp r0, 0 blt @0807C368 bl @0807CFB4 @0807C368: adds r0, r1, 0 bl obj_delete_and_free_tiles movs r1, 0xC8 lsls r1, 3 movs r0, 0x50 bl lcd_io_set ldr r1, =0x0000040c movs r0, 0x52 bl lcd_io_set ldr r1, [r7] bl @0807CF4C .align 2, 0 .pool @0807C390: ldr r2, [r7] adds r0, r2, 0 adds r0, 0xE0 ldrh r1, [r0] subs r1, 0x1 strh r1, [r0] lsls r1, 16 movs r0, 0x9E lsls r0, 17 cmp r1, r0 bne @0807C3B0 adds r1, r2, 0 adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0807C3B0: ldr r0, [r7] adds r0, 0xE0 movs r2, 0 ldrsh r1, [r0, r2] movs r0, 0xA4 lsls r0, 1 cmp r1, r0 beq @0807C3C4 bl @0807CFB4 @0807C3C4: ldr r0, =gUnknown_08338DFC movs r1, 0x80 movs r2, 0x41 movs r3, 0 bl obj_add_from_template_forward_search ldr r1, [r7] adds r1, 0x92 strb r0, [r1] bl @0807CFB4 .align 2, 0 .pool @0807C3E0: ldr r0, =gUnknown_08338D88 movs r1, 0x80 movs r2, 0x50 movs r3, 0x3 bl obj_add_from_template_forward_search ldr r4, =0x020322a0 ldr r1, [r4] adds r1, 0x90 strb r0, [r1] ldr r0, =gUnknown_08338DC8 movs r1, 0x80 movs r2, 0x50 movs r3, 0 bl 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, =0x02020630 adds r0, r1 movs r1, 0x1 bl obj_anim_image_start ldr r1, [r4] bl @0807CF4C .align 2, 0 .pool @0807C434: ldr r2, [r7] adds r1, r2, 0 adds r1, 0xE0 ldrh r0, [r1] subs r0, 0x2 strh r0, [r1] lsls r0, 16 asrs r0, 16 cmp r0, 0xA6 bne @0807C44E subs r1, 0x4C movs r0, 0xC8 strh r0, [r1] @0807C44E: ldr r1, =0x00001241 movs r0, 0 bl lcd_io_set bl @0807CFB4 .align 2, 0 .pool @0807C460: ldr r2, =0x02020630 ldr r4, [r7] adds r3, r4, 0 adds r3, 0x90 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x22] subs r1, 0x2 strh r1, [r0, 0x22] adds r0, r4, 0 adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x22] subs r1, 0x2 strh r1, [r0, 0x22] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r3, 0x22 ldrsh r1, [r0, r3] movs r0, 0x8 negs r0, r0 cmp r1, r0 blt @0807C4A6 bl @0807CFB4 @0807C4A6: adds r1, r4, 0 adds r1, 0x94 movs r0, 0x1D strh r0, [r1] bl @0807CFB4 .align 2, 0 .pool @0807C4B8: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0x1E strh r1, [r0] bl @0807CFB4 .align 2, 0 .pool @0807C4DC: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807C4EC bl @0807CFB4 @0807C4EC: ldr r0, [r7] adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl 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 .pool @0807C528: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r5, =gUnknown_08338DC8 adds r0, r5, 0 movs r1, 0x6F movs r2, 0xAA movs r3, 0 bl obj_add_from_template_forward_search ldr r4, =0x020322a0 ldr r1, [r4] adds r1, 0x90 strb r0, [r1] movs r2, 0xA negs r2, r2 adds r0, r5, 0 movs r1, 0x81 movs r3, 0 bl obj_add_from_template_forward_search ldr r1, [r4] adds r1, 0x91 strb r0, [r1] ldr r1, [r4] bl @0807CF4C .align 2, 0 .pool @0807C574: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0807C592 movs r0, 0x2E bl audio_play ldr r0, =0x020322a0 ldr r1, [r0] adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0807C592: ldr r3, =0x02020630 ldr r0, =0x020322a0 ldr r2, [r0] adds r0, r2, 0 adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x26] subs r1, 0x3 strh r1, [r0, 0x26] adds r2, 0x91 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] bl @0807CFB4 .align 2, 0 .pool @0807C5D0: ldr r5, =0x02020630 ldr r4, [r7] adds r2, r4, 0 adds r2, 0x90 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x26] subs r1, 0x3 strh r1, [r0, 0x26] adds r6, r4, 0 adds r6, 0x91 ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r3, r0, r5 movs r0, 0x26 ldrsh r1, [r3, r0] movs r0, 0x5A negs r0, r0 cmp r1, r0 ble @0807C616 bl @0807CFB4 @0807C616: movs r2, 0x1 strh r2, [r3, 0x30] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x30] adds r1, r4, 0 bl @0807CF4C .align 2, 0 .pool @0807C630: ldr r2, =0x0000ffff movs r0, 0x1 movs r1, 0x10 bl sub_80A2A20 bl @0807CF48 .align 2, 0 .pool @0807C644: ldr r2, =0x0000ffff movs r0, 0x1 movs r1, 0 bl sub_80A2A20 bl @0807CF48 .align 2, 0 .pool @0807C658: ldr r2, =0x0000ffff movs r0, 0x1 movs r1, 0x10 bl sub_80A2A20 bl @0807CF48 .align 2, 0 .pool @0807C66C: ldr r5, =0x020322a0 ldr r0, [r5] adds r0, 0xF0 ldrh r0, [r0] bl sub_806E840 lsls r0, 24 cmp r0, 0 bne @0807C6E4 ldr r4, =0x02020630 ldr r2, [r5] adds r2, 0x8E ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x10 adds r0, r1 ldr r1, =gUnknown_08338ECC str r1, [r0] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0, 0x1] movs r2, 0x3 orrs r1, r2 strb r1, [r0, 0x1] ldr r0, [r5] adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0 movs r2, 0x3 movs r3, 0x3 bl 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 .pool @0807C6E4: ldr r0, [r5] adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 bl sub_8008258 @0807C6FA: ldr r5, =0x020322a0 ldr r0, [r5] adds r0, 0x8F ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 movs r1, 0 bl 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, =0x0000ffe0 strh r1, [r0, 0x22] ldrb r0, [r3] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 adds r1, 0x3E ldrb r3, [r1] movs r2, 0x5 negs r2, r2 adds r0, r2, 0 ands r0, r3 strb r0, [r1] ldr r0, [r5] adds r0, 0x8F ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] ands r2, r1 strb r2, [r0] ldr r1, [r5] bl @0807CF4C .align 2, 0 .pool @0807C794: ldr r4, =0x02020630 ldr r2, [r7] adds r3, r2, 0 adds r3, 0x8E ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x26] subs r1, 0x3 movs r5, 0 strh r1, [r0, 0x26] adds r2, 0x8F ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r0, [r0, 0x26] adds r0, 0xA3 lsls r0, 16 lsrs r0, 16 cmp r0, 0x2 bhi @0807C7DC movs r0, 0x2D bl audio_play @0807C7DC: ldr r2, [r7] adds r3, r2, 0 adds r3, 0x8E ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r6, 0x26 ldrsh r1, [r0, r6] movs r0, 0xDE negs r0, r0 cmp r1, r0 blt @0807C7FC bl @0807CFB4 @0807C7FC: adds r0, r2, 0 adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r5, [r0, 0x30] adds r0, r2, 0 adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r5, [r0, 0x30] adds r1, r2, 0 adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] ldr r0, [r7] adds r0, 0x8F ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] orrs r1, r2 strb r1, [r0] ldr r2, =0x0000ffff movs r0, 0x1 movs r1, 0 bl sub_80A2A20 b @0807CFB4 .align 2, 0 .pool @0807C864: ldr r4, =0x02020630 ldr r2, [r7] adds r3, r2, 0 adds r3, 0x90 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x26] subs r1, 0x3 strh r1, [r0, 0x26] adds r2, 0x91 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r2, 0x26 ldrsh r1, [r0, r2] movs r0, 0xDE negs r0, r0 cmp r1, r0 ble @0807C8A6 b @0807CFB4 @0807C8A6: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0 movs r3, 0x10 bl 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 .pool @0807C8EC: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807C8FA b @0807CFB4 @0807C8FA: ldr r1, [r7] adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] movs r0, 0x1 bl sub_807B62C ldr r0, [r7] adds r0, 0xE0 movs r1, 0xA6 strh r1, [r0] ldr r0, =gUnknown_08338D88 movs r4, 0x14 negs r4, r4 movs r1, 0x80 adds r2, r4, 0 movs r3, 0x3 bl obj_add_from_template_forward_search ldr r1, [r7] adds r1, 0x90 strb r0, [r1] ldr r0, =gUnknown_08338DC8 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, =0x02020630 adds r0, r1 movs r1, 0x1 bl obj_anim_image_start b @0807CFB4 .align 2, 0 .pool @0807C964: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0x10 movs r3, 0 b @0807CF44 @0807C974: movs r1, 0x92 lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807C98C b @0807CFB4 @0807C98C: b @0807CF48 .align 2, 0 .pool @0807C994: ldr r2, =0x02020630 ldr r4, [r7] adds r3, r4, 0 adds r3, 0x90 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] adds r0, r4, 0 adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r3, 0x26 ldrsh r1, [r0, r3] movs r6, 0x22 ldrsh r0, [r0, r6] adds r1, r0 cmp r1, 0x40 beq @0807C9DA b @0807CFB4 @0807C9DA: adds r1, r4, 0 b @0807CF4C .align 2, 0 .pool @0807C9E4: ldr r1, [r7] adds r5, r1, 0 adds r5, 0xE0 ldrh r0, [r5] adds r0, 0x2 strh r0, [r5] lsls r0, 16 asrs r0, 16 movs r6, 0x9E lsls r6, 1 cmp r0, r6 bgt @0807C9FE b @0807CFB4 @0807C9FE: strh r6, [r5] b @0807CF4C @0807CA02: ldr r0, [r7] adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl 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 .pool @0807CA40: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0xA beq @0807CA4E b @0807CFB4 @0807CA4E: b @0807CF4C @0807CA50: ldr r1, [r7] adds r2, r1, 0 adds r2, 0xE0 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] lsls r0, 16 asrs r0, 16 movs r3, 0xAE lsls r3, 1 cmp r0, r3 ble @0807CA72 strh r3, [r2] adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0807CA72: ldr r2, [r7] adds r0, r2, 0 adds r0, 0xE0 movs r3, 0 ldrsh r1, [r0, r3] movs r0, 0xA4 lsls r0, 1 cmp r1, r0 beq @0807CA86 b @0807CFB4 @0807CA86: adds r0, r2, 0 adds r0, 0xFA ldrb r0, [r0] cmp r0, 0 bne @0807CA92 b @0807CFB4 @0807CA92: ldr r0, =gUnknown_08338DFC movs r1, 0x80 movs r2, 0x41 movs r3, 0 bl obj_add_from_template_forward_search ldr r1, [r7] adds r1, 0x92 strb r0, [r1] ldr r2, =0x02020630 ldr r0, [r7] adds r0, 0x92 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_807AAE0 str r1, [r0] b @0807CFB4 .align 2, 0 .pool @0807CAC8: ldr r0, =gUnknown_08338E74 movs r1, 0x78 movs r2, 0x50 movs r3, 0 bl obj_add_from_template_forward_search ldr r2, =0x020322a0 ldr r1, [r2] adds r1, 0x91 strb r0, [r1] ldr r0, [r2] adds r0, 0x94 movs r1, 0x32 strh r1, [r0] b @0807CFB4 .align 2, 0 .pool @0807CAF0: ldr r2, =0x02020630 ldr r0, [r7] adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 27 cmp r0, 0 blt @0807CB0E b @0807CFB4 @0807CB0E: adds r0, r1, 0 bl 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 .pool @0807CB30: ldr r1, [r7] adds r2, r1, 0 adds r2, 0xEA ldrh r3, [r2] ldr r0, =0x000003ff cmp r3, r0 bhi @0807CB4C adds r0, r3, 0 adds r0, 0x34 strh r0, [r2] b @0807CB5A .align 2, 0 .pool @0807CB4C: movs r0, 0x80 lsls r0, 3 strh r0, [r2] adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0807CB5A: ldr r4, [r7] @0807CB5C: adds r0, r4, 0 adds r0, 0xEA ldrh r1, [r0] movs r0, 0x80 lsls r0, 8 bl __divsi3 adds r4, 0xE8 strh r0, [r4] b @0807CFB4 @0807CB70: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0x3C strh r1, [r0] b @0807CFB4 .align 2, 0 .pool @0807CB90: ldr r4, =0x02037fd4 ldrb r1, [r4, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807CB9E b @0807CFB4 @0807CB9E: movs r0, 0x5 bl sub_807B62C movs r0, 0x7 bl sub_807B62C ldrb r0, [r4, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r4, 0x8] b @0807CF48 .align 2, 0 .pool @0807CBB8: ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 b @0807CF44 .align 2, 0 .pool @0807CBD4: movs r1, 0xA2 lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807CBEC b @0807CFB4 @0807CBEC: b @0807CF48 .align 2, 0 .pool @0807CBF4: ldr r0, =gUnknown_08338D28 movs r2, 0x8 negs r2, r2 movs r1, 0x78 movs r3, 0 bl obj_add_from_template_forward_search ldr r5, =0x020322a0 ldr r1, [r5] adds r1, 0xD3 movs r6, 0 strb r0, [r1] ldr r4, =0x02020630 ldr r2, [r5] adds r2, 0xD3 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x4A strh r1, [r0, 0x34] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_807E6AC str r1, [r0] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x1 bl 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, =0x0000ffff movs r1, 0x10 bl sub_80A2A20 ldr r2, [r5] adds r1, r2, 0 adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] str r6, [r2, 0x64] b @0807CFB4 .align 2, 0 .pool @0807CC9C: ldr r2, =0x02020630 ldr r0, [r7] adds r0, 0xD3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x5] lsrs r1, 4 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0x1 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r1, [r7] b @0807CF4C .align 2, 0 .pool @0807CCD0: ldr r2, =0x02020630 ldr r3, [r7] adds r0, r3, 0 adds r0, 0xD3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @0807CCEE b @0807CFB4 @0807CCEE: adds r0, r3, 0 adds r0, 0xF2 ldrh r2, [r0] lsls r0, r2, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] ldr r1, [r1, 0x10] ldr r3, [r3, 0x6C] bl help_system_enable_unless_flashback__sp199 ldr r1, [r7] b @0807CF4C .align 2, 0 .pool @0807CD1C: ldr r4, =0x02020630 ldr r2, [r7] adds r6, r2, 0 adds r6, 0x8F ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r5, 0 movs r1, 0x78 strh r1, [r0, 0x20] ldrb r0, [r6] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 ldr r3, =gUnknown_08300D38 adds r2, 0xF2 ldrh r0, [r2] lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x1] adds r0, 0x3C strh r0, [r1, 0x22] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r5, [r0, 0x24] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r5, [r0, 0x26] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0 bl 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, =0x000fffff str r2, [sp, 0xC] adds r3, 0xF2 ldrh r2, [r3] str r2, [sp, 0x10] movs r2, 0x78 movs r3, 0x54 bl sub_8076438 ldr r0, [r7] adds r0, 0xD3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_free_rotscale_entry ldr r0, [r7] adds r0, 0xD3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, [r7] b @0807CF4C .align 2, 0 .pool @0807CDDC: movs r1, 0xAA lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE966 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0 bl sub_807F1A8 ldr r0, =0x020322a0 ldr r3, [r0] adds r1, r3, 0 adds r1, 0x94 movs r2, 0 movs r0, 0xA7 @0807CE06: strh r0, [r1] str r2, [r3, 0x64] b @0807CFB4 .align 2, 0 .pool @0807CE18: ldr r3, [r7] ldr r0, [r3, 0x64] adds r0, 0x1 str r0, [r3, 0x64] cmp r0, 0x3C bhi @0807CE26 b @0807CFB4 @0807CE26: adds r0, r3, 0 adds r0, 0x94 movs r2, 0 ldr r1, =0x0000010b strh r1, [r0] str r2, [r3, 0x64] b @0807CFB4 .align 2, 0 .pool @0807CE38: bl sub_80A3678 lsls r0, 24 cmp r0, 0 bne @0807CE44 b @0807CFB4 @0807CE44: ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0x44 strh r1, [r0] b @0807CFB4 .align 2, 0 .pool @0807CE54: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0xA bne @0807CE66 ldr r0, =0x00000173 bl fanfare_play @0807CE66: ldr r1, [r7] ldr r0, [r1, 0x64] cmp r0, 0xFA beq @0807CE70 b @0807CFB4 @0807CE70: adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 movs r5, 0 strh r0, [r1] ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE977 adds r0, r4, 0 bl 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 .pool @0807CEA0: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x3C beq @0807CEAE b @0807CFB4 @0807CEAE: b @0807CF4C @0807CEB0: bl sub_807F14C b @0807CF48 @0807CEB6: ldr r2, [r7] adds r0, r2, 0 adds r0, 0xEE ldrb r0, [r0] cmp r0, 0 beq @0807CEC6 movs r0, 0x1 b @0807CFB6 @0807CEC6: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0807CFB4 adds r1, r2, 0 b @0807CF4C .align 2, 0 .pool @0807CEDC: ldr r0, =0x020375e2 ldrb r0, [r0] movs r1, 0 bl sub_807B4D0 ldr r1, =0x030061e8 ldr r0, =sub_807B60C str r0, [r1] ldr r7, =0x02032298 ldrb r0, [r7] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0x1 movs r2, 0 bl GetEvolutionTargetSpecies lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 beq @0807CF48 ldrb r3, [r7] adds r0, r3, 0 muls r0, r6 adds r0, r5 ldr r1, =0x020322a0 ldr r1, [r1] adds r1, 0x8F ldrb r2, [r1] adds r1, r4, 0 bl sub_813E1D4 b @0807CF48 .align 2, 0 .pool @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, =0x020322a0 ldr r1, [r0] @0807CF4C: adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0807CFB4 .align 2, 0 .pool @0807CF5C: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @0807CFB4 ldr r0, [r7] adds r0, 0xF4 ldrh r0, [r0] bl current_map_music_set ldr r0, [r7] cmp r0, 0 beq @0807CFAA bl 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, =c2_exit_to_overworld_2_switch bl set_callback2 bl sub_807E784 @0807CFB4: movs r0, 0 @0807CFB6: add sp, 0x14 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_807BBEC thumb_func_start sub_807CFC8 sub_807CFC8: ; 807CFC8 push {r4-r7,lr} sub sp, 0x14 ldr r0, =0x020322a0 ldr r1, [r0] adds r1, 0x94 ldrh r5, [r1] ldr r1, =0x0000010b adds r7, r0, 0 cmp r5, r1 bls @0807CFE0 bl @0807E400 @0807CFE0: lsls r0, r5, 2 ldr r1, =@0807CFF8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807CFF8: .4byte @0807D428 .4byte @0807D4A0 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807D4FC .4byte @0807D544 .4byte @0807D5B8 .4byte @0807E400 .4byte @0807D624 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807D648 .4byte @0807D678 .4byte @0807D68A .4byte @0807D6AC .4byte @0807E400 .4byte @0807E400 .4byte @0807D7A4 .4byte @0807D7C4 .4byte @0807D830 .4byte @0807D8B4 .4byte @0807D8D8 .4byte @0807D924 .4byte @0807D970 .4byte @0807D9CC .4byte @0807DA38 .4byte @0807DA4C .4byte @0807DA60 .4byte @0807DA74 .4byte @0807DB9C .4byte @0807DC6C .4byte @0807DCF4 .4byte @0807DD94 .4byte @0807DDA4 .4byte @0807DDC4 .4byte @0807E400 .4byte @0807E400 .4byte @0807DEE8 .4byte @0807DEF8 .4byte @0807DF16 .4byte @0807E400 .4byte @0807DF3C .4byte @0807DF7C .4byte @0807DFBC .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807DFDC .4byte @0807E004 .4byte @0807E020 .4byte @0807E040 .4byte @0807E0E8 .4byte @0807E11C .4byte @0807E168 .4byte @0807E228 .4byte @0807E2A0 .4byte @0807E2EC .4byte @0807E2FC .4byte @0807E302 .4byte @0807E328 .4byte @0807E384 .4byte @0807E3A8 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807D6F4 .4byte @0807D728 .4byte @0807D77C .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807DE1C .4byte @0807DE84 .4byte @0807DEC0 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E264 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807D85C .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E400 .4byte @0807E284 @0807D428: ldr r3, =0x02020630 ldr r0, [r7] adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] ldr r4, [r7] adds r2, r4, 0 adds r2, 0x8E ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldr r1, =0x0000ff4c strh r1, [r0, 0x24] ldrb r0, [r2] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r3 ldr r2, =gUnknown_08300D38 adds r0, r4, 0 adds r0, 0xF0 ldrh r0, [r0] lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1] strh r0, [r1, 0x26] adds r1, r4, 0 adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] bl current_map_music_get ldr r1, [r7] adds r1, 0xF4 strh r0, [r1] ldr r0, =0x00000179 bl current_map_music_set bl @0807E400 .align 2, 0 .pool @0807D4A0: ldr r5, [r7] adds r6, r5, 0 adds r6, 0xE6 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 ble @0807D4D4 ldr r2, =0x02020630 adds r0, r5, 0 adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x24] adds r1, 0x3 strh r1, [r0, 0x24] ldrh r0, [r6] subs r0, 0x3 strh r0, [r6] bl @0807E400 .align 2, 0 .pool @0807D4D4: ldr r2, =0x02020630 adds r0, r5, 0 adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strh r1, [r0, 0x24] strh r1, [r6] adds r1, r5, 0 adds r1, 0x94 movs r0, 0xA strh r0, [r1] bl @0807E400 .align 2, 0 .pool @0807D4FC: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE942 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0 bl sub_807F1A8 ldr r4, =0x020322a0 ldr r0, [r4] adds r2, r0, 0 adds r2, 0xF0 ldrh r1, [r2] movs r0, 0xCE lsls r0, 1 cmp r1, r0 beq @0807D52A adds r0, r1, 0 movs r1, 0 bl cry_related @0807D52A: ldr r3, [r4] adds r1, r3, 0 adds r1, 0x94 movs r2, 0 movs r0, 0xB bl @0807E252 .align 2, 0 .pool @0807D544: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x50 beq @0807D554 bl @0807E400 @0807D554: adds r0, r1, 0 adds r0, 0x8E ldrb r0, [r0] ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r1, [r1, 0x5] lsrs r1, 4 movs r2, 0x2 str r2, [sp] movs r2, 0x1 str r2, [sp, 0x4] movs r2, 0x14 str r2, [sp, 0x8] ldr r2, =0x000fffff str r2, [sp, 0xC] movs r2, 0x78 movs r3, 0x20 bl sub_807671C ldr r1, [r7] adds r1, 0xD2 strb r0, [r1] ldr r1, [r7] adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE959 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0 bl sub_807F1A8 bl @0807E400 .align 2, 0 .pool @0807D5B8: ldr r5, =0x02020630 ldr r0, [r7] adds r0, 0xD2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r5, 0 adds r4, 0x1C adds r0, r4 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @0807D5D8 bl @0807E400 @0807D5D8: ldr r0, =gUnknown_08338D28 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, =sub_807E5D8 str r1, [r0] adds r2, 0xD2 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 bl obj_delete_and_free_tiles ldr r1, [r7] bl @0807E398 .align 2, 0 .pool @0807D624: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0x14 strh r1, [r0] bl @0807E400 .align 2, 0 .pool @0807D648: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807D658 bl @0807E400 @0807D658: movs r0, 0x4 bl sub_807B62C movs r0, 0 movs r1, 0xFF bl Window_FastFillPixels movs r0, 0 movs r1, 0x3 bl Window_CopyToVram bl @0807E394 .align 2, 0 .pool @0807D678: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0x10 movs r3, 0 bl @0807E390 @0807D68A: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807D69A bl @0807E400 @0807D69A: ldr r0, [r7] adds r0, 0x94 movs r1, 0x17 strh r1, [r0] bl @0807E400 .align 2, 0 .pool @0807D6AC: ldr r4, =0x020322a0 ldr r0, [r4] adds r2, r0, 0 adds r2, 0xEA ldrh r1, [r2] movs r0, 0x80 lsls r0, 1 cmp r1, r0 bls @0807D6CC adds r0, r1, 0 subs r0, 0x34 strh r0, [r2] b @0807D6E6 .align 2, 0 .pool @0807D6CC: movs r0, 0x1 bl sub_807B62C ldr r3, [r4] adds r1, r3, 0 adds r1, 0xEA movs r2, 0 movs r0, 0x80 strh r0, [r1] subs r1, 0x56 movs r0, 0x7C strh r0, [r1] str r2, [r3, 0x64] @0807D6E6: ldr r0, =0x020322a0 ldr r4, [r0] bl @0807DFA8 .align 2, 0 .pool @0807D6F4: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x14 bhi @0807D704 bl @0807E400 @0807D704: movs r0, 0x3 bl sub_807B62C ldr r0, =gUnknown_08338E8C movs r1, 0x78 movs r2, 0x50 movs r3, 0 bl obj_add_from_template_forward_search ldr r1, [r7] adds r1, 0x91 strb r0, [r1] ldr r1, [r7] bl @0807E398 .align 2, 0 .pool @0807D728: ldr r2, =0x02020630 ldr r0, [r7] adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 27 cmp r0, 0 blt @0807D748 bl @0807E400 @0807D748: adds r0, r1, 0 bl obj_delete_and_free_tiles ldr r1, =0x00000452 movs r0, 0x50 bl lcd_io_set movs r1, 0x82 lsls r1, 3 movs r0, 0x52 bl lcd_io_set ldr r0, =c3_08054588 movs r1, 0x5 bl AddTask ldr r1, [r7] bl @0807E398 .align 2, 0 .pool @0807D77C: ldr r0, =c3_08054588 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @0807D78C bl @0807E400 @0807D78C: ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0x1A strh r1, [r0] bl @0807E400 .align 2, 0 .pool @0807D7A4: ldr r2, [r7] adds r0, r2, 0 adds r0, 0xE0 ldrh r1, [r0] subs r1, 0x1 strh r1, [r0] lsls r1, 16 movs r0, 0x9E lsls r0, 17 cmp r1, r0 beq @0807D7BE bl @0807E400 @0807D7BE: adds r1, r2, 0 bl @0807E398 @0807D7C4: ldr r0, =gUnknown_08338D88 movs r1, 0x78 movs r2, 0x50 movs r3, 0x3 bl obj_add_from_template_forward_search ldr r4, =0x020322a0 ldr r1, [r4] adds r1, 0x90 strb r0, [r1] ldr r5, =0x02020630 ldr r0, [r4] adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_807AA4C str r1, [r0] ldr r0, =gUnknown_08338DC8 movs r1, 0x78 movs r2, 0x50 movs r3, 0 bl 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 .pool @0807D830: ldr r2, [r7] adds r1, r2, 0 adds r1, 0xE0 ldrh r0, [r1] subs r0, 0x3 strh r0, [r1] lsls r0, 16 asrs r0, 16 cmp r0, 0xA6 bne @0807D84A subs r1, 0x4C movs r0, 0xC8 strh r0, [r1] @0807D84A: ldr r1, =0x00001241 movs r0, 0 bl lcd_io_set bl @0807E400 .align 2, 0 .pool @0807D85C: ldr r2, =0x02020630 ldr r4, [r7] adds r3, r4, 0 adds r3, 0x90 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x22] subs r1, 0x2 strh r1, [r0, 0x22] adds r0, r4, 0 adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x22] subs r1, 0x2 strh r1, [r0, 0x22] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r2, 0x22 ldrsh r1, [r0, r2] movs r0, 0x8 negs r0, r0 cmp r1, r0 blt @0807D8A2 bl @0807E400 @0807D8A2: adds r1, r4, 0 adds r1, 0x94 movs r0, 0x1D strh r0, [r1] bl @0807E400 .align 2, 0 .pool @0807D8B4: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0x1E strh r1, [r0] bl @0807E400 .align 2, 0 .pool @0807D8D8: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807D8E8 bl @0807E400 @0807D8E8: ldr r0, [r7] adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl 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 .pool @0807D924: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r5, =gUnknown_08338DC8 adds r0, r5, 0 movs r1, 0x6F movs r2, 0xAA movs r3, 0 bl obj_add_from_template_forward_search ldr r4, =0x020322a0 ldr r1, [r4] adds r1, 0x90 strb r0, [r1] movs r2, 0xA negs r2, r2 adds r0, r5, 0 movs r1, 0x81 movs r3, 0 bl obj_add_from_template_forward_search ldr r1, [r4] adds r1, 0x91 strb r0, [r1] ldr r1, [r4] bl @0807E398 .align 2, 0 .pool @0807D970: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0807D98E movs r0, 0x2E bl audio_play ldr r0, =0x020322a0 ldr r1, [r0] adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0807D98E: ldr r3, =0x02020630 ldr r0, =0x020322a0 ldr r2, [r0] adds r0, r2, 0 adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x26] subs r1, 0x3 strh r1, [r0, 0x26] adds r2, 0x91 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] bl @0807E400 .align 2, 0 .pool @0807D9CC: ldr r5, =0x02020630 ldr r4, [r7] adds r2, r4, 0 adds r2, 0x90 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x26] subs r1, 0x3 strh r1, [r0, 0x26] adds r6, r4, 0 adds r6, 0x91 ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r3, r0, r5 movs r0, 0x26 ldrsh r1, [r3, r0] movs r0, 0x5A negs r0, r0 cmp r1, r0 ble @0807DA12 bl @0807E400 @0807DA12: movs r2, 0x1 strh r2, [r3, 0x30] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x30] adds r1, r4, 0 adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] ldr r0, =c3_0805465C b @0807DC5A .align 2, 0 .pool @0807DA38: ldr r2, =0x0000ffff movs r0, 0x8 movs r1, 0x10 bl sub_80A2A20 bl @0807E394 .align 2, 0 .pool @0807DA4C: ldr r2, =0x0000ffff movs r0, 0x8 movs r1, 0x10 bl sub_80A2A20 bl @0807E394 .align 2, 0 .pool @0807DA60: ldr r2, =0x0000ffff movs r0, 0x8 movs r1, 0x10 bl sub_80A2A20 bl @0807E394 .align 2, 0 .pool @0807DA74: ldr r5, =0x020322a0 ldr r0, [r5] adds r0, 0xF0 ldrh r0, [r0] bl sub_806E840 lsls r0, 24 cmp r0, 0 bne @0807DAEC ldr r4, =0x02020630 ldr r2, [r5] adds r2, 0x8E ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x10 adds r0, r1 ldr r1, =gUnknown_08338ECC str r1, [r0] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0, 0x1] movs r2, 0x3 orrs r1, r2 strb r1, [r0, 0x1] ldr r0, [r5] adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0 movs r2, 0x3 movs r3, 0x3 bl 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 .pool @0807DAEC: ldr r0, [r5] adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 bl sub_8008258 @0807DB02: ldr r5, =0x020322a0 ldr r0, [r5] adds r0, 0x8F ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 movs r1, 0 bl 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, =0x0000ffe0 strh r1, [r0, 0x22] ldrb r0, [r3] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 adds r1, 0x3E ldrb r3, [r1] movs r2, 0x5 negs r2, r2 adds r0, r2, 0 ands r0, r3 strb r0, [r1] ldr r0, [r5] adds r0, 0x8F ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] ands r2, r1 strb r2, [r0] ldr r1, [r5] bl @0807E398 .align 2, 0 .pool @0807DB9C: ldr r4, =0x02020630 ldr r2, [r7] adds r3, r2, 0 adds r3, 0x8E ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x26] subs r1, 0x3 movs r5, 0 strh r1, [r0, 0x26] adds r2, 0x8F ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r0, [r0, 0x26] adds r0, 0xA3 lsls r0, 16 lsrs r0, 16 cmp r0, 0x2 bhi @0807DBE4 movs r0, 0x2D bl audio_play @0807DBE4: ldr r2, [r7] adds r3, r2, 0 adds r3, 0x8E ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r6, 0x26 ldrsh r1, [r0, r6] movs r0, 0xDE negs r0, r0 cmp r1, r0 blt @0807DC04 bl @0807E400 @0807DC04: adds r0, r2, 0 adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r5, [r0, 0x30] adds r0, r2, 0 adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r5, [r0, 0x30] adds r1, r2, 0 adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] ldr r0, [r7] adds r0, 0x8F ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r0, 0x3E ldrb r1, [r0] orrs r1, r2 strb r1, [r0] ldr r0, =sub_807F39C @0807DC5A: movs r1, 0x5 bl AddTask b @0807E400 .align 2, 0 .pool @0807DC6C: ldr r4, =0x02020630 ldr r2, [r7] adds r3, r2, 0 adds r3, 0x90 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x26] subs r1, 0x3 strh r1, [r0, 0x26] adds r2, 0x91 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x26] adds r1, 0x3 strh r1, [r0, 0x26] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r2, 0x26 ldrsh r1, [r0, r2] movs r0, 0xDE negs r0, r0 cmp r1, r0 ble @0807DCAE b @0807E400 @0807DCAE: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0 movs r3, 0x10 bl 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 .pool @0807DCF4: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807DD02 b @0807E400 @0807DD02: ldr r1, [r7] adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] movs r0, 0x1 bl sub_807B62C ldr r0, [r7] adds r0, 0xE0 movs r1, 0xA6 strh r1, [r0] movs r0, 0x3 bl sub_807B62C ldr r0, [r7] adds r0, 0xE4 movs r1, 0xCE lsls r1, 1 strh r1, [r0] ldr r0, =gUnknown_08338D88 movs r4, 0x14 negs r4, r4 movs r1, 0x78 adds r2, r4, 0 movs r3, 0x3 bl obj_add_from_template_forward_search ldr r1, [r7] adds r1, 0x90 strb r0, [r1] ldr r5, =0x02020630 ldr r0, [r7] adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_807AA4C str r1, [r0] ldr r0, =gUnknown_08338DC8 movs r1, 0x78 adds r2, r4, 0 movs r3, 0 bl 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 .pool @0807DD94: movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0x10 movs r3, 0 b @0807E390 @0807DDA4: movs r1, 0x92 lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807DDBC b @0807E400 @0807DDBC: b @0807E394 .align 2, 0 .pool @0807DDC4: ldr r2, =0x02020630 ldr r4, [r7] adds r3, r4, 0 adds r3, 0x90 ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x26] adds r1, 0x4 strh r1, [r0, 0x26] adds r0, r4, 0 adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x26] adds r1, 0x4 strh r1, [r0, 0x26] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r6, 0x26 ldrsh r1, [r0, r6] movs r2, 0x22 ldrsh r0, [r0, r2] adds r1, r0 cmp r1, 0x40 beq @0807DE0A b @0807E400 @0807DE0A: adds r0, r4, 0 adds r0, 0x94 movs r1, 0x90 strh r1, [r0] movs r0, 0 str r0, [r4, 0x64] b @0807E400 .align 2, 0 .pool @0807DE1C: movs r1, 0xB2 lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r4, =0x020322a0 ldr r2, [r4] adds r1, r2, 0 adds r1, 0xE0 ldrh r0, [r1] adds r0, 0x3 strh r0, [r1] adds r1, 0x4 ldrh r0, [r1] adds r0, 0x3 strh r0, [r1] ldr r0, [r2, 0x64] adds r0, 0x1 str r0, [r2, 0x64] cmp r0, 0xA bne @0807DE60 ldr r0, =c3_08054588 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0x1 strh r0, [r1, 0xC] @0807DE60: ldr r1, [r4] adds r3, r1, 0 adds r3, 0xE0 movs r6, 0 ldrsh r0, [r3, r6] movs r2, 0x9E lsls r2, 1 cmp r0, r2 bgt @0807DE74 b @0807E400 @0807DE74: strh r2, [r3] b @0807E398 .align 2, 0 .pool @0807DE84: ldr r0, [r7] adds r0, 0x90 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl 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 .pool @0807DEC0: ldr r0, =c3_08054588 bl is_function_an_active_task lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @0807DED0 b @0807E400 @0807DED0: ldr r0, =0x020322a0 ldr r2, [r0] adds r1, r2, 0 adds r1, 0x94 movs r0, 0x2E strh r0, [r1] str r3, [r2, 0x64] b @0807E400 .align 2, 0 .pool @0807DEE8: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0xA beq @0807DEF6 b @0807E400 @0807DEF6: b @0807E398 @0807DEF8: ldr r1, [r7] adds r5, r1, 0 adds r5, 0xE0 ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] lsls r0, 16 asrs r0, 16 movs r6, 0xAE lsls r6, 1 cmp r0, r6 bgt @0807DF12 b @0807E400 @0807DF12: strh r6, [r5] b @0807E398 @0807DF16: ldr r0, =gUnknown_08338E74 movs r1, 0x78 movs r2, 0x50 movs r3, 0 bl obj_add_from_template_forward_search ldr r2, =0x020322a0 ldr r1, [r2] adds r1, 0x91 strb r0, [r1] ldr r0, [r2] adds r0, 0x94 movs r1, 0x32 strh r1, [r0] b @0807E400 .align 2, 0 .pool @0807DF3C: ldr r2, =0x02020630 ldr r0, [r7] adds r0, 0x91 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 27 cmp r0, 0 blt @0807DF5A b @0807E400 @0807DF5A: adds r0, r1, 0 bl 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 .pool @0807DF7C: ldr r1, [r7] adds r2, r1, 0 adds r2, 0xEA ldrh r3, [r2] ldr r0, =0x000003ff cmp r3, r0 bhi @0807DF98 adds r0, r3, 0 adds r0, 0x34 strh r0, [r2] b @0807DFA6 .align 2, 0 .pool @0807DF98: movs r0, 0x80 lsls r0, 3 strh r0, [r2] adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0807DFA6: ldr r4, [r7] @0807DFA8: adds r0, r4, 0 adds r0, 0xEA ldrh r1, [r0] movs r0, 0x80 lsls r0, 8 bl __divsi3 adds r4, 0xE8 strh r0, [r4] b @0807E400 @0807DFBC: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0x3C strh r1, [r0] b @0807E400 .align 2, 0 .pool @0807DFDC: ldr r4, =0x02037fd4 ldrb r1, [r4, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807DFEA b @0807E400 @0807DFEA: movs r0, 0x5 bl sub_807B62C movs r0, 0x7 bl sub_807B62C ldrb r0, [r4, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r4, 0x8] b @0807E394 .align 2, 0 .pool @0807E004: ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 b @0807E390 .align 2, 0 .pool @0807E020: movs r1, 0xA2 lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0807E038 b @0807E400 @0807E038: b @0807E394 .align 2, 0 .pool @0807E040: ldr r0, =gUnknown_08338D28 movs r2, 0x8 negs r2, r2 movs r1, 0x78 movs r3, 0 bl obj_add_from_template_forward_search ldr r5, =0x020322a0 ldr r1, [r5] adds r1, 0xD3 movs r6, 0 strb r0, [r1] ldr r4, =0x02020630 ldr r2, [r5] adds r2, 0xD3 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x4A strh r1, [r0, 0x34] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_807E6AC str r1, [r0] ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x1 bl 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, =0x0000ffff movs r1, 0x10 bl sub_80A2A20 ldr r2, [r5] adds r1, r2, 0 adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] str r6, [r2, 0x64] b @0807E400 .align 2, 0 .pool @0807E0E8: ldr r2, =0x02020630 ldr r0, [r7] adds r0, 0xD3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x5] lsrs r1, 4 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0x1 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r1, [r7] b @0807E398 .align 2, 0 .pool @0807E11C: ldr r2, =0x02020630 ldr r3, [r7] adds r0, r3, 0 adds r0, 0xD3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @0807E13A b @0807E400 @0807E13A: adds r0, r3, 0 adds r0, 0xF2 ldrh r2, [r0] lsls r0, r2, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] ldr r1, [r1, 0x10] ldr r3, [r3, 0x6C] bl help_system_enable_unless_flashback__sp199 ldr r1, [r7] b @0807E398 .align 2, 0 .pool @0807E168: ldr r4, =0x02020630 ldr r2, [r7] adds r6, r2, 0 adds r6, 0x8F ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r5, 0 movs r1, 0x78 strh r1, [r0, 0x20] ldrb r0, [r6] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 ldr r3, =gUnknown_08300D38 adds r2, 0xF2 ldrh r0, [r2] lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x1] adds r0, 0x3C strh r0, [r1, 0x22] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r5, [r0, 0x24] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r5, [r0, 0x26] ldrb r1, [r6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0 bl 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, =0x000fffff str r2, [sp, 0xC] adds r3, 0xF2 ldrh r2, [r3] str r2, [sp, 0x10] movs r2, 0x78 movs r3, 0x54 bl sub_8076438 ldr r0, [r7] adds r0, 0xD3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_free_rotscale_entry ldr r0, [r7] adds r0, 0xD3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, [r7] b @0807E398 .align 2, 0 .pool @0807E228: movs r1, 0xAA lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE966 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0 bl sub_807F1A8 ldr r0, =0x020322a0 ldr r3, [r0] adds r1, r3, 0 adds r1, 0x94 movs r2, 0 movs r0, 0xA7 @0807E252: strh r0, [r1] str r2, [r3, 0x64] b @0807E400 .align 2, 0 .pool @0807E264: ldr r3, [r7] ldr r0, [r3, 0x64] adds r0, 0x1 str r0, [r3, 0x64] cmp r0, 0x3C bhi @0807E272 b @0807E400 @0807E272: adds r0, r3, 0 adds r0, 0x94 movs r2, 0 ldr r1, =0x0000010b strh r1, [r0] str r2, [r3, 0x64] b @0807E400 .align 2, 0 .pool @0807E284: bl sub_80A3678 lsls r0, 24 cmp r0, 0 bne @0807E290 b @0807E400 @0807E290: ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0x44 strh r1, [r0] b @0807E400 .align 2, 0 .pool @0807E2A0: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0xA bne @0807E2B2 ldr r0, =0x00000173 bl fanfare_play @0807E2B2: ldr r1, [r7] ldr r0, [r1, 0x64] cmp r0, 0xFA beq @0807E2BC b @0807E400 @0807E2BC: adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 movs r5, 0 strh r0, [r1] ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE977 adds r0, r4, 0 bl 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 .pool @0807E2EC: ldr r1, [r7] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x3C beq @0807E2FA b @0807E400 @0807E2FA: b @0807E398 @0807E2FC: bl sub_807F14C b @0807E394 @0807E302: ldr r2, [r7] adds r0, r2, 0 adds r0, 0xEE ldrb r0, [r0] cmp r0, 0 beq @0807E312 movs r0, 0x1 b @0807E402 @0807E312: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0807E400 adds r1, r2, 0 b @0807E398 .align 2, 0 .pool @0807E328: ldr r0, =0x020375e2 ldrb r0, [r0] movs r1, 0 bl sub_807B4D0 ldr r1, =0x030061e8 ldr r0, =sub_807B60C str r0, [r1] ldr r7, =0x02032298 ldrb r0, [r7] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0x1 movs r2, 0 bl GetEvolutionTargetSpecies lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 beq @0807E394 ldrb r3, [r7] adds r0, r3, 0 muls r0, r6 adds r0, r5 ldr r1, =0x020322a0 ldr r1, [r1] adds r1, 0x8F ldrb r2, [r1] adds r1, r4, 0 bl sub_813E1D4 b @0807E394 .align 2, 0 .pool @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, =0x020322a0 ldr r1, [r0] @0807E398: adds r1, 0x94 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0807E400 .align 2, 0 .pool @0807E3A8: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @0807E400 ldr r0, [r7] adds r0, 0xF4 ldrh r0, [r0] bl current_map_music_set ldr r0, [r7] cmp r0, 0 beq @0807E3F6 bl 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, =c2_exit_to_overworld_2_switch bl set_callback2 bl sub_807E784 @0807E400: movs r0, 0 @0807E402: add sp, 0x14 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_807CFC8 thumb_func_start c2_08053788 c2_08053788: ; 807E414 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0 beq @0807E434 cmp r0, 0x4 beq @0807E444 b @0807E4B4 .align 2, 0 .pool @0807E434: movs r0, 0x4 strb r0, [r1] ldr r1, =0x03002700 movs r0, 0x1 b @0807E4B2 .align 2, 0 .pool @0807E444: ldr r0, =0x030061e8 ldr r1, =sub_807EB50 mov r8, r1 str r1, [r0] ldr r7, =0x02032298 ldrb r0, [r7] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0x1 movs r2, 0 bl GetEvolutionTargetSpecies lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 beq @0807E494 ldrb r3, [r7] adds r0, r3, 0 muls r0, r6 adds r0, r5 ldr r1, =0x020322a0 ldr r1, [r1] adds r1, 0x8F ldrb r2, [r1] adds r1, r4, 0 bl sub_813E1D4 b @0807E4AE .align 2, 0 .pool @0807E494: bl sub_8077260 cmp r0, 0 beq @0807E4A8 ldr r0, =sub_807F464 bl set_callback2 b @0807E4AE .align 2, 0 .pool @0807E4A8: mov r0, r8 bl set_callback2 @0807E4AE: ldr r1, =0x02032298 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 .pool thumb_func_end c2_08053788 thumb_func_start sub_807E4DC sub_807E4DC: ; 807E4DC push {r4-r6,lr} bl sub_807ACDC bl sub_800A550 lsls r0, 24 lsrs r5, r0, 24 movs r6, 0x1 adds r0, r5, 0 ands r0, r6 cmp r0, 0 beq @0807E51A ldr r4, =0x020223c4 ldrh r1, [r4] ldr r0, =0x0000dcba cmp r1, r0 bne @0807E504 ldr r0, =c2_08053788 bl set_callback2 @0807E504: ldrh r1, [r4] ldr r0, =0x0000abcd cmp r1, r0 bne @0807E514 ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x72 strb r6, [r0] @0807E514: movs r0, 0 bl sub_800A5EC @0807E51A: movs r0, 0x2 ands r0, r5 cmp r0, 0 beq @0807E542 ldr r0, =0x020223c4 movs r1, 0x80 lsls r1, 1 adds r0, r1 ldrh r1, [r0] ldr r0, =0x0000abcd cmp r1, r0 bne @0807E53C ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x73 movs r1, 0x1 strb r1, [r0] @0807E53C: movs r0, 0x1 bl sub_800A5EC @0807E542: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807E4DC thumb_func_start sub_807E55C sub_807E55C: ; 807E55C push {r4,r5,lr} adds r5, r0, 0 movs r1, 0x2E ldrsh r0, [r5, r1] movs r1, 0xA bl __divsi3 ldrh r4, [r5, 0x22] adds r4, r0 strh r4, [r5, 0x22] ldrh r0, [r5, 0x30] ldrh r2, [r5, 0x38] adds r0, r2 strh r0, [r5, 0x38] movs r1, 0x38 ldrsh r0, [r5, r1] movs r1, 0xA bl __divsi3 strh r0, [r5, 0x20] lsls r4, 16 asrs r4, 16 cmp r4, 0x4C ble @0807E5AA movs r0, 0x4C strh r0, [r5, 0x22] movs r2, 0x2E ldrsh r1, [r5, r2] movs r2, 0x32 ldrsh r0, [r5, r2] muls r0, r1 negs r0, r0 movs r1, 0x64 bl __divsi3 strh r0, [r5, 0x2E] ldrh r0, [r5, 0x34] adds r0, 0x1 strh r0, [r5, 0x34] @0807E5AA: movs r1, 0x20 ldrsh r0, [r5, r1] cmp r0, 0x78 bne @0807E5B6 movs r0, 0 strh r0, [r5, 0x30] @0807E5B6: ldrh r0, [r5, 0x36] ldrh r2, [r5, 0x2E] adds r0, r2 strh r0, [r5, 0x2E] movs r1, 0x34 ldrsh r0, [r5, r1] cmp r0, 0x4 bne @0807E5CE movs r0, 0x1 strh r0, [r5, 0x3C] ldr r0, =nullsub_12 str r0, [r5, 0x1C] @0807E5CE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807E55C thumb_func_start sub_807E5D8 sub_807E5D8: ; 807E5D8 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 ldr r1, =gUnknown_08339024 movs r2, 0x2E ldrsh r0, [r4, r2] adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] movs r2, 0x2E ldrsh r0, [r4, r2] cmp r0, 0x16 bne @0807E600 movs r0, 0x38 bl audio_play @0807E600: ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0x2C bne @0807E636 movs r0, 0x8C bl audio_play ldr r0, =sub_807E64C str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x2E] ldrb r1, [r4, 0x5] lsrs r1, 4 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 movs r1, 0x1 negs r1, r1 ldr r2, =0x0000ffff str r2, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 @0807E636: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807E5D8 thumb_func_start sub_807E64C sub_807E64C: ; 807E64C push {r4,lr} adds r4, r0, 0 movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x14 bne @0807E660 adds r0, r4, 0 movs r1, 0x1 bl 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, =gUnknown_08339024 movs r2, 0x2E ldrsh r0, [r4, r2] adds r0, r1 movs r1, 0 ldrsb r1, [r0, r1] ldrh r0, [r4, 0x26] subs r0, r1 strh r0, [r4, 0x26] ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0x17 bne @0807E69E adds r0, r4, 0 bl obj_delete_and_free_tiles ldr r0, =0x020322a0 ldr r0, [r0] adds r0, 0x94 movs r1, 0xE strh r1, [r0] @0807E69E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807E64C thumb_func_start sub_807E6AC sub_807E6AC: ; 807E6AC push {r4,lr} adds r4, r0, 0 ldrh r2, [r4, 0x32] movs r1, 0x32 ldrsh r0, [r4, r1] cmp r0, 0 bne @0807E6DC ldrh r0, [r4, 0x22] adds r0, 0x4 strh r0, [r4, 0x22] lsls r0, 16 asrs r0, 16 movs r3, 0x34 ldrsh r1, [r4, r3] cmp r0, r1 ble @0807E72C adds r0, r2, 0x1 strh r0, [r4, 0x32] movs r0, 0x16 strh r0, [r4, 0x2E] movs r0, 0x38 bl audio_play b @0807E72C @0807E6DC: movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0x42 bne @0807E6EA movs r0, 0x39 bl audio_play @0807E6EA: movs r2, 0x2E ldrsh r0, [r4, r2] cmp r0, 0x5C bne @0807E6F8 movs r0, 0x3A bl audio_play @0807E6F8: movs r3, 0x2E ldrsh r0, [r4, r3] cmp r0, 0x6B bne @0807E706 movs r0, 0x3B bl audio_play @0807E706: ldr r1, =gUnknown_08339024 movs r2, 0x2E ldrsh r0, [r4, r2] adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 ldrh r3, [r4, 0x26] adds r0, r3 strh r0, [r4, 0x26] ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0x6C bne @0807E72C ldr r0, =nullsub_12 str r0, [r4, 0x1C] @0807E72C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807E6AC thumb_func_start sub_807E73C sub_807E73C: ; 807E73C push {r4-r6,lr} ldr r0, =0x020375e0 ldrh r0, [r0] lsls r4, r0, 4 subs r4, r0 lsls r4, 2 ldr r0, =gUnknown_08338ED0 adds r4, r0 ldr r0, =0x02021cc4 ldrh r1, [r4, 0x38] movs r6, 0xB muls r1, r6 ldr r5, =gSpeciesNames adds r1, r5 bl gf_strcpy ldr r0, =0x02021dc4 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 .pool thumb_func_end sub_807E73C thumb_func_start sub_807E784 sub_807E784: ; 807E784 push {r4,lr} sub sp, 0x20 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r4, r0, 4 subs r4, r0 lsls r4, 2 ldr r0, =gUnknown_08338ED0 adds r4, r0 ldr r0, =0x020375e2 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr ldr r0, =0x02021cc4 mov r1, sp bl strcpy_limit_10_chars ldr r0, =0x02021dc4 ldrh r2, [r4, 0xC] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy add sp, 0x20 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807E784 thumb_func_start sub_807E7E8 sub_807E7E8: ; 807E7E8 push {r4-r7,lr} sub sp, 0x38 lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, r1, 4 subs r2, r1 lsls r2, 2 ldr r1, =gUnknown_08338ED0 adds r5, r2, r1 movs r1, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 bl pokemon_getattr adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 add r4, sp, 0x34 movs r0, 0xFE strb r0, [r4] ldr r6, =0x02024744 ldrh r1, [r5, 0xC] movs r3, 0x1 str r3, [sp] ldr r0, [r5, 0x24] str r0, [sp, 0x4] str r3, [sp, 0x8] ldr r0, [r5, 0x18] str r0, [sp, 0xC] adds r0, r6, 0 movs r3, 0x20 bl create_pokemon_set_level adds r2, r5, 0 adds r2, 0xE adds r0, r6, 0 movs r1, 0x27 bl pokemon_setattr adds r2, r5, 0 adds r2, 0xF adds r0, r6, 0 movs r1, 0x28 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x10 adds r0, r6, 0 movs r1, 0x29 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x11 adds r0, r6, 0 movs r1, 0x2A bl pokemon_setattr adds r2, r5, 0 adds r2, 0x12 adds r0, r6, 0 movs r1, 0x2B bl pokemon_setattr adds r2, r5, 0 adds r2, 0x13 adds r0, r6, 0 movs r1, 0x2C bl pokemon_setattr adds r0, r6, 0 movs r1, 0x2 adds r2, r5, 0 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x2B adds r0, r6, 0 movs r1, 0x7 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x36 adds r0, r6, 0 movs r1, 0x31 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x14 adds r0, r6, 0 movs r1, 0x2E bl pokemon_setattr adds r2, r5, 0 adds r2, 0x1D adds r0, r6, 0 movs r1, 0x17 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x1E adds r0, r6, 0 movs r1, 0x18 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x1C adds r0, r6, 0 movs r1, 0x16 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x1F adds r0, r6, 0 movs r1, 0x21 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x20 adds r0, r6, 0 movs r1, 0x2F bl pokemon_setattr adds r2, r5, 0 adds r2, 0x37 adds r0, r6, 0 movs r1, 0x30 bl pokemon_setattr adds r0, r6, 0 movs r1, 0x23 adds r2, r4, 0 bl pokemon_setattr mov r4, sp adds r4, 0x35 movs r0, 0 strb r0, [r4] ldrh r0, [r5, 0x28] cmp r0, 0 beq @0807E960 bl itemid_is_mail lsls r0, 24 cmp r0, 0 beq @0807E954 add r0, sp, 0x10 adds r1, r5, 0 bl sub_807E974 ldr r0, =0x020321c0 add r1, sp, 0x10 ldm r1!, {r2,r3,r7} stm r0!, {r2,r3,r7} ldm r1!, {r2,r3,r7} stm r0!, {r2,r3,r7} ldm r1!, {r2,r3,r7} stm r0!, {r2,r3,r7} adds r0, r6, 0 movs r1, 0x40 adds r2, r4, 0 bl pokemon_setattr adds r2, r5, 0 adds r2, 0x28 adds r0, r6, 0 movs r1, 0xC bl pokemon_setattr b @0807E960 .align 2, 0 .pool @0807E954: adds r2, r5, 0 adds r2, 0x28 adds r0, r6, 0 movs r1, 0xC bl pokemon_setattr @0807E960: ldr r0, =0x02024744 bl pokemon_calc_effective_stats add sp, 0x38 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807E7E8 thumb_func_start sub_807E974 sub_807E974: ; 807E974 push {r4-r6,lr} adds r5, r0, 0 adds r6, r1, 0 ldr r2, =gUnknown_08338FC0 adds r0, r6, 0 adds r0, 0x2A ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r2, r0, r2 adds r1, r5, 0 movs r3, 0x8 @0807E98E: ldrh r0, [r2] strh r0, [r1] adds r2, 0x2 adds r1, 0x2 subs r3, 0x1 cmp r3, 0 bge @0807E98E adds r4, r5, 0 adds r4, 0x12 adds r1, r6, 0 adds r1, 0x2B adds r0, r4, 0 bl 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 .pool thumb_func_end sub_807E974 thumb_func_start sub_807E9D4 sub_807E9D4: ; 807E9D4 push {r4-r6,lr} ldr r6, =0x020375e2 ldrh r0, [r6] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0807EA08 ldrh r0, [r6] muls r0, r5 adds r0, r4 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 b @0807EA0A .align 2, 0 .pool @0807EA08: movs r0, 0 @0807EA0A: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_807E9D4 thumb_func_start sub_807EA10 sub_807EA10: ; 807EA10 push {lr} ldr r0, =0x020375e2 ldrb r0, [r0] ldr r1, =0x020375e0 ldrb r1, [r1] bl sub_807E7E8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807EA10 thumb_func_start sub_807EA2C sub_807EA2C: ; 807EA2C push {r4-r6,lr} bl sub_807BBC8 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x1 bne @0807EA96 ldr r5, =0x020322a0 ldr r0, [r5] adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl 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, =0x02032298 ldrb r4, [r0] ldrb r0, [r0, 0x1] movs r1, 0x6 bl __umodsi3 adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_807B4D0 bl sub_8077260 cmp r0, 0 bne @0807EA90 ldr r0, [r5] adds r2, r0, 0 adds r2, 0x74 ldr r1, =0x0000abcd strh r1, [r2] adds r0, 0x93 strb r6, [r0] @0807EA90: ldr r0, =sub_807EACC bl 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 .pool thumb_func_end sub_807EA2C thumb_func_start sub_807EACC sub_807EACC: ; 807EACC push {r4,lr} bl sub_807ACDC lsls r0, 24 lsrs r4, r0, 24 bl sub_8077260 cmp r0, 0 beq @0807EAEC ldr r0, =c2_08053788 bl set_callback2 b @0807EB2C .align 2, 0 .pool @0807EAEC: bl sub_807E4DC cmp r4, 0 bne @0807EB2C ldr r4, =0x020322a0 ldr r2, [r4] adds r0, r2, 0 adds r0, 0x72 ldrh r1, [r0] ldr r0, =0x00000101 cmp r1, r0 bne @0807EB2C adds r1, r2, 0 adds r1, 0x74 ldr r0, =0x0000dcba strh r0, [r1] bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 ldr r1, [r4] adds r1, 0x74 movs r2, 0x14 bl link_0800A448 ldr r0, [r4] adds r0, 0x72 movs r1, 0x2 strb r1, [r0] ldr r0, [r4] adds r0, 0x73 strb r1, [r0] @0807EB2C: bl 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 .pool thumb_func_end sub_807EACC thumb_func_start sub_807EB50 sub_807EB50: ; 807EB50 push {r4,lr} sub sp, 0x4 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0x65 bls @0807EB66 b @0807F03A @0807EB66: lsls r0, 2 ldr r1, =@0807EB78 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807EB78: .4byte @0807ED10 .4byte @0807ED2C .4byte @0807ED98 .4byte @0807F03A .4byte @0807EE78 .4byte @0807EF3C .4byte @0807EF64 .4byte @0807EF7E .4byte @0807EFA4 .4byte @0807EFF0 .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807EE9C .4byte @0807EEEC .4byte @0807EF1A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807EDC0 .4byte @0807EE1C .4byte @0807EE38 .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807F03A .4byte @0807ED44 .4byte @0807ED7C @0807ED10: movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EF6D2 b @0807EDA6 .align 2, 0 .pool @0807ED2C: movs r0, 0 bl sub_8077288 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r2, 0 movs r1, 0x64 b @0807EE88 .align 2, 0 .pool @0807ED44: ldr r0, =0x020322a0 ldr r3, [r0] ldr r0, [r3, 0x64] adds r0, 0x1 str r0, [r3, 0x64] cmp r0, 0xB4 bls @0807ED60 movs r1, 0x87 lsls r1, 3 adds r0, r2, r1 movs r2, 0 movs r1, 0x65 strb r1, [r0] str r2, [r3, 0x64] @0807ED60: bl sub_8077294 cmp r0, 0 bne @0807ED6A b @0807F03A @0807ED6A: ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 b @0807ED8E .align 2, 0 .pool @0807ED7C: bl sub_8077294 cmp r0, 0 bne @0807ED86 b @0807F03A @0807ED86: ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 @0807ED8E: movs r1, 0x2 strb r1, [r0] b @0807F03A .align 2, 0 .pool @0807ED98: movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 movs r0, 0x32 strb r0, [r1] ldr r4, =0x02021fc4 ldr r1, =gUnknown_082C8959 @0807EDA6: adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0 bl sub_807F1A8 b @0807F03A .align 2, 0 .pool @0807EDC0: bl in_trade_center cmp r0, 0 bne @0807EDCE movs r0, 0x15 bl sav12_xor_increment @0807EDCE: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @0807EDF6 ldr r4, =0x020229e8 bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r4, 0x4 adds r1, r4 ldr r1, [r1] movs r0, 0x2 bl sub_801B990 @0807EDF6: bl sub_8076D5C bl sub_8153380 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] b @0807EE8A .align 2, 0 .pool @0807EE1C: ldr r0, =0x020322a0 ldr r1, [r0] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x5 beq @0807EE2C b @0807F03A @0807EE2C: movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 b @0807EFE4 .align 2, 0 .pool @0807EE38: bl sub_81533AC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @0807EE5C bl sav2_gender2_inplace_and_xFE ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x4 strb r1, [r0] b @0807F03A .align 2, 0 .pool @0807EE5C: ldr r0, =0x020322a0 ldr r0, [r0] str r1, [r0, 0x64] ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x33 strb r1, [r0] b @0807F03A .align 2, 0 .pool @0807EE78: bl sub_81533E0 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r2, 0 movs r1, 0x28 @0807EE88: strb r1, [r0] @0807EE8A: ldr r0, =0x020322a0 ldr r0, [r0] str r2, [r0, 0x64] b @0807F03A .align 2, 0 .pool @0807EE9C: ldr r4, =0x020322a0 ldr r1, [r4] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x32 bhi @0807EEAC b @0807F03A @0807EEAC: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @0807EED4 bl GenerateRandomNumber ldr r4, [r4] lsls r0, 16 lsrs r0, 16 movs r1, 0x1E bl __umodsi3 lsls r0, 16 lsrs r0, 16 str r0, [r4, 0x64] b @0807EEDA .align 2, 0 .pool @0807EED4: ldr r1, [r4] movs r0, 0 str r0, [r1, 0x64] @0807EEDA: ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x29 strb r1, [r0] b @0807F03A .align 2, 0 .pool @0807EEEC: ldr r0, =0x020322a0 ldr r1, [r0] ldr r0, [r1, 0x64] cmp r0, 0 bne @0807EF14 movs r0, 0x1 bl sub_8077288 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x2A strb r1, [r0] b @0807F03A .align 2, 0 .pool @0807EF14: subs r0, 0x1 str r0, [r1, 0x64] b @0807F03A @0807EF1A: bl sub_8077294 cmp r0, 0 bne @0807EF24 b @0807F03A @0807EF24: bl sub_8153408 ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x5 strb r1, [r0] b @0807F03A .align 2, 0 .pool @0807EF3C: ldr r0, =0x020322a0 ldr r1, [r0] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x3C bls @0807F03A movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r0, 0x2 bl sub_8077288 b @0807F03A .align 2, 0 .pool @0807EF64: bl sub_8077294 cmp r0, 0 beq @0807F03A movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @0807EFDC @0807EF7E: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0807F03A movs r0, 0x3 bl play_sound_effect ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0807EFE4 .align 2, 0 .pool @0807EFA4: bl sub_80A3258 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0807F03A ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @0807EFD8 ldr r0, =0x030022c0 ldr r1, [r0, 0x8] ldr r0, =sub_80773AC cmp r1, r0 bne @0807EFD8 movs r0, 0x3 bl sub_8077288 b @0807EFDC .align 2, 0 .pool @0807EFD8: bl sub_800AC34 @0807EFDC: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @0807EFE4: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0807F03A .align 2, 0 .pool @0807EFF0: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @0807F028 ldr r1, [r2, 0x8] ldr r0, =sub_80773AC cmp r1, r0 bne @0807F028 bl sub_8077294 cmp r0, 0 beq @0807F03A ldr r0, =0x03002700 movs r1, 0 strb r1, [r0] ldr r0, =c2_080543C4 bl set_callback2 b @0807F03A .align 2, 0 .pool @0807F028: ldr r0, =0x03003124 ldrb r1, [r0] cmp r1, 0 bne @0807F03A ldr r0, =0x03002700 strb r1, [r0] ldr r0, =c2_080543C4 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 .pool thumb_func_end sub_807EB50 thumb_func_start c2_080543C4 c2_080543C4: ; 807F068 push {r4,r5,lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @0807F0BE bl 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, =0x020322a0 ldr r0, [r4] bl free str r5, [r4] ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @0807F0B6 bl sub_800E084 @0807F0B6: ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl 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 .pool thumb_func_end c2_080543C4 thumb_func_start sub_807F0E4 sub_807F0E4: ; 807F0E4 push {lr} sub sp, 0x4 bl script_env_2_enable ldr r0, =sub_807F110 movs r1, 0xA bl AddTask movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807F0E4 thumb_func_start sub_807F110 sub_807F110: ; 807F110 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0807F134 ldr r0, =sub_807B270 bl set_callback2 ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] adds r0, r4, 0 bl remove_task @0807F134: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807F110 thumb_func_start sub_807F14C sub_807F14C: ; 807F14C push {r4,r5,lr} movs r5, 0 movs r4, 0 @0807F152: ldr r0, =0x02032298 ldrb r0, [r0, 0x1] movs r1, 0x6 bl __umodsi3 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 adds r1, r4, 0 adds r1, 0x43 bl pokemon_getattr adds r0, r5, r0 lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xB bls @0807F152 cmp r5, 0 beq @0807F18A ldr r0, =0x0000089b bl flag_set @0807F18A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807F14C thumb_func_start sub_807F19C sub_807F19C: ; 807F19C push {lr} bl sub_807B170 pop {r0} bx r0 thumb_func_end sub_807F19C thumb_func_start sub_807F1A8 sub_807F1A8: ; 807F1A8 push {r4-r6,lr} sub sp, 0x14 adds r5, r0, 0 adds r6, r1, 0 adds r4, r2, 0 lsls r5, 24 lsrs r5, 24 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0xFF bl Window_FastFillPixels ldr r2, =0x020322a0 ldr r0, [r2] adds r0, 0xF6 movs r3, 0 movs r1, 0xF strb r1, [r0] ldr r0, [r2] adds r0, 0xF7 movs r1, 0x1 strb r1, [r0] ldr r0, [r2] adds r0, 0xF8 movs r1, 0x6 strb r1, [r0] str r3, [sp] str r3, [sp, 0x4] ldr r0, [r2] adds r0, 0xF6 str r0, [sp, 0x8] lsls r4, 24 asrs r4, 24 str r4, [sp, 0xC] str r6, [sp, 0x10] adds r0, r5, 0 movs r1, 0x1 movs r2, 0 movs r3, 0x2 bl 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 .pool thumb_func_end sub_807F1A8 thumb_func_start c3_08054588 c3_08054588: ; 807F210 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldr r1, =gUnknown_08339090 movs r2, 0 ldrsh r0, [r4, r2] lsls r0, 1 adds r0, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r2, r1, 0 movs r3, 0x4 ldrsh r0, [r4, r3] cmp r0, 0 bne @0807F254 movs r0, 0x80 lsls r0, 1 cmp r1, r0 beq @0807F25C lsls r0, r1, 1 ldr r1, =gUnknown_08337AA0 adds r0, r1 b @0807F25E .align 2, 0 .pool @0807F254: movs r0, 0x80 lsls r0, 1 cmp r1, r0 bne @0807F26C @0807F25C: ldr r0, =gUnknown_08337EA0 @0807F25E: movs r1, 0x30 movs r2, 0x20 bl gpu_pal_apply b @0807F27A .align 2, 0 .pool @0807F26C: lsls r0, r2, 1 ldr r1, =gUnknown_08337CA0 adds r0, r1 movs r1, 0x30 movs r2, 0x20 bl gpu_pal_apply @0807F27A: ldr r0, =gUnknown_08339090 movs r2, 0 ldrsh r1, [r4, r2] lsls r1, 1 adds r1, r0 ldrb r0, [r1] cmp r0, 0 bne @0807F298 movs r3, 0x2 ldrsh r0, [r4, r3] cmp r0, 0 bne @0807F298 movs r0, 0xC3 bl audio_play @0807F298: movs r0, 0x2 ldrsh r2, [r4, r0] ldr r1, =gUnknown_08339090 movs r3, 0 ldrsh r0, [r4, r3] lsls r0, 1 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] cmp r2, r0 bne @0807F2D8 ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] movs r0, 0 strh r0, [r4, 0x2] movs r2, 0 ldrsh r0, [r4, r2] lsls r0, 1 adds r0, r1 ldrb r0, [r0] cmp r0, 0xFF bne @0807F2DE adds r0, r5, 0 bl remove_task b @0807F2DE .align 2, 0 .pool @0807F2D8: ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] @0807F2DE: pop {r4,r5} pop {r0} bx r0 thumb_func_end c3_08054588 thumb_func_start c3_0805465C c3_0805465C: ; 807F2E4 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 adds r6, r0, 0 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 movs r0, 0 ldrsh r4, [r5, r0] cmp r4, 0 bne @0807F336 ldr r2, =0x020322a0 ldr r0, [r2] adds r3, r0, 0 adds r3, 0xFD movs r1, 0x78 strb r1, [r3] adds r0, 0xFB strb r1, [r0] ldr r0, [r2] adds r0, 0xFC strb r4, [r0] ldr r0, [r2] adds r0, 0xFE movs r1, 0xA0 strb r1, [r0] movs r1, 0x80 lsls r1, 6 movs r0, 0 bl 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, =0x020322a0 ldr r0, [r4] adds r1, r0, 0 adds r1, 0xFD ldrb r1, [r1] adds r0, 0xFB ldrb r0, [r0] lsls r0, 8 orrs r1, r0 movs r0, 0x40 bl 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 .pool thumb_func_end c3_0805465C thumb_func_start sub_807F39C sub_807F39C: ; 807F39C push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 adds r6, r0, 0 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0 bne @0807F3D8 ldr r2, =0x020322a0 ldr r0, [r2] adds r0, 0xFB movs r1, 0x50 strb r1, [r0] ldr r0, [r2] adds r0, 0xFD movs r1, 0xA0 strb r1, [r0] movs r0, 0x4A movs r1, 0x10 bl lcd_io_set movs r0, 0x48 movs r1, 0x13 bl lcd_io_set @0807F3D8: ldr r4, =0x020322a0 ldr r0, [r4] adds r1, r0, 0 adds r1, 0xFD ldrb r1, [r1] adds r0, 0xFB ldrb r0, [r0] lsls r0, 8 orrs r1, r0 movs r0, 0x40 bl 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, =0x0000ffff movs r0, 0x8 movs r1, 0 bl sub_80A2A20 b @0807F45C .align 2, 0 .pool @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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0xC bls @0807F47A b @0807F70C @0807F47A: lsls r0, 2 ldr r1, =@0807F48C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807F48C: .4byte @0807F4C0 .4byte @0807F4E8 .4byte @0807F500 .4byte @0807F550 .4byte @0807F570 .4byte @0807F5AC .4byte @0807F5D0 .4byte @0807F620 .4byte @0807F64E .4byte @0807F66C .4byte @0807F694 .4byte @0807F6C4 .4byte @0807F6F8 @0807F4C0: movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 movs r0, 0x1 strb r0, [r1] ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EF6D2 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0 bl sub_807F1A8 b @0807F70C .align 2, 0 .pool @0807F4E8: movs r0, 0 bl sub_8077288 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r2, 0 movs r1, 0x2 b @0807F5BC .align 2, 0 .pool @0807F500: bl sub_8077294 cmp r0, 0 bne @0807F50A b @0807F70C @0807F50A: ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r5, 0 movs r1, 0x3 strb r1, [r0] ldr r4, =0x02021fc4 ldr r1, =gUnknown_082C8959 adds r0, r4, 0 bl 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, =0x020322a0 ldr r0, [r0] str r5, [r0, 0x64] b @0807F70C .align 2, 0 .pool @0807F550: ldr r0, =0x020322a0 ldr r1, [r0] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x5 beq @0807F560 b @0807F70C @0807F560: movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 movs r0, 0x4 strb r0, [r1] b @0807F70C .align 2, 0 .pool @0807F570: bl sub_81533AC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @0807F590 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x5 strb r1, [r0] b @0807F70C .align 2, 0 .pool @0807F590: ldr r0, =0x020322a0 ldr r0, [r0] str r1, [r0, 0x64] ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x3 strb r1, [r0] b @0807F70C .align 2, 0 .pool @0807F5AC: bl sub_81533E0 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r2, 0 movs r1, 0x6 @0807F5BC: strb r1, [r0] ldr r0, =0x020322a0 ldr r0, [r0] str r2, [r0, 0x64] b @0807F70C .align 2, 0 .pool @0807F5D0: ldr r4, =0x020322a0 ldr r1, [r4] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0xA bhi @0807F5E0 b @0807F70C @0807F5E0: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @0807F608 bl GenerateRandomNumber ldr r4, [r4] lsls r0, 16 lsrs r0, 16 movs r1, 0x1E bl __umodsi3 lsls r0, 16 lsrs r0, 16 str r0, [r4, 0x64] b @0807F60E .align 2, 0 .pool @0807F608: ldr r1, [r4] movs r0, 0 str r0, [r1, 0x64] @0807F60E: ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x7 strb r1, [r0] b @0807F70C .align 2, 0 .pool @0807F620: ldr r0, =0x020322a0 ldr r1, [r0] ldr r0, [r1, 0x64] cmp r0, 0 bne @0807F648 movs r0, 0x1 bl sub_8077288 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x8 strb r1, [r0] b @0807F70C .align 2, 0 .pool @0807F648: subs r0, 0x1 str r0, [r1, 0x64] b @0807F70C @0807F64E: bl sub_8077294 cmp r0, 0 beq @0807F70C bl sub_8153408 ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x9 strb r1, [r0] b @0807F70C .align 2, 0 .pool @0807F66C: ldr r0, =0x020322a0 ldr r1, [r0] ldr r0, [r1, 0x64] adds r0, 0x1 str r0, [r1, 0x64] cmp r0, 0x3C bls @0807F70C movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r0, 0x2 bl sub_8077288 b @0807F70C .align 2, 0 .pool @0807F694: bl sub_8077294 cmp r0, 0 beq @0807F70C movs r0, 0x3 bl play_sound_effect movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0xB strb r1, [r0] b @0807F70C .align 2, 0 .pool @0807F6C4: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0807F70C bl sub_80A3258 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0807F70C movs r0, 0x3 bl sub_8077288 ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0xC strb r1, [r0] b @0807F70C .align 2, 0 .pool @0807F6F8: bl sub_8077294 cmp r0, 0 beq @0807F70C ldr r0, =0x03002700 movs r1, 0 strb r1, [r0] ldr r0, =c2_080543C4 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 .pool thumb_func_end sub_807F464 thumb_func_start sub_807F738 sub_807F738: ; 807F738 push {lr} ldr r0, =0x03007630 ldr r1, =0x0000ffff ldr r2, =0x020322a4 ldr r2, [r2] adds r2, 0x4C movs r3, 0 ldrsh r2, [r2, r3] subs r2, 0x80 lsls r2, 17 asrs r2, 16 bl MPlayPitchControl pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807F738 thumb_func_start sub_807F764 sub_807F764: ; 807F764 push {r4,lr} sub sp, 0x10 bl sub_8082DF4 ldr r0, =0x020322a4 ldr r0, [r0] mov r12, r0 movs r0, 0xA0 lsls r0, 1 add r0, r12 ldr r1, [r0] movs r0, 0xA2 lsls r0, 1 add r0, r12 ldr r2, [r0] movs r0, 0xA4 lsls r0, 1 add r0, r12 movs r4, 0 ldrsh r3, [r0, r4] movs r0, 0xA5 lsls r0, 1 add r0, r12 movs r4, 0 ldrsh r0, [r0, r4] str r0, [sp] movs r0, 0xA6 lsls r0, 1 add r0, r12 movs r4, 0 ldrsh r0, [r0, r4] str r0, [sp, 0x4] movs r0, 0xA7 lsls r0, 1 add r0, r12 movs r4, 0 ldrsh r0, [r0, r4] str r0, [sp, 0x8] movs r0, 0xA8 lsls r0, 1 add r0, r12 ldrh r0, [r0] str r0, [sp, 0xC] movs r0, 0x2 bl 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 .pool thumb_func_end sub_807F764 thumb_func_start sub_807F7D8 sub_807F7D8: ; 807F7D8 push {r4,r5,lr} ldr r1, =0x020322a4 ldr r0, [r1] ldrb r0, [r0, 0x1] adds r5, r1, 0 cmp r0, 0x9 bls @0807F7E8 b @0807F9C8 @0807F7E8: lsls r0, 2 ldr r1, =@0807F7FC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807F7FC: .4byte @0807F824 .4byte @0807F854 .4byte @0807F880 .4byte @0807F8AC .4byte @0807F8C8 .4byte @0807F8F4 .4byte @0807F910 .4byte @0807F940 .4byte @0807F950 .4byte @0807F980 @0807F824: ldr r5, =gUnknown_08D91598 adds r0, r5, 0 bl sub_8034974 adds r0, 0x64 bl malloc_and_clear adds r1, r0, 0 ldr r4, =0x020322a4 ldr r0, [r4] ldr r2, =0x000011bc adds r0, r2 str r1, [r0] adds r0, r5, 0 bl call_LZZUnCompWram ldr r1, [r4] b @0807F966 .align 2, 0 .pool @0807F854: ldr r1, =gUnknown_083390F4 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, =gUnknown_083390D4 movs r2, 0x80 lsls r2, 1 movs r1, 0 bl gpu_pal_apply b @0807F962 .align 2, 0 .pool @0807F880: ldr r0, [r5] ldr r1, =0x000011bc adds r0, r1 ldr r4, [r0] ldr r0, =gUnknown_08D91598 bl sub_8034974 adds r2, r0, 0 lsls r2, 16 lsrs r2, 16 movs r0, 0x2 adds r1, r4, 0 movs r3, 0 bl gpu_copy_bg_tile_pattern_data_to_vram ldr r1, [r5] b @0807F966 .align 2, 0 .pool @0807F8AC: ldr r0, =gUnknown_08D91DB8 ldr r1, [r5] ldr r2, =0x000011bc adds r1, r2 ldr r1, [r1] bl call_LZZUnCompWram ldr r1, [r5] b @0807F966 .align 2, 0 .pool @0807F8C8: ldr r0, [r5] ldr r1, =0x000011bc adds r0, r1 ldr r4, [r0] ldr r0, =gUnknown_08D91DB8 bl sub_8034974 adds r2, r0, 0 lsls r2, 16 lsrs r2, 16 movs r0, 0x1 adds r1, r4, 0 movs r3, 0 bl gpu_copy_bg_tile_pattern_data_to_vram ldr r1, [r5] b @0807F966 .align 2, 0 .pool @0807F8F4: ldr r0, =gUnknown_08D927EC ldr r1, [r5] ldr r2, =0x000011bc adds r1, r2 ldr r1, [r1] bl call_LZZUnCompWram ldr r1, [r5] b @0807F966 .align 2, 0 .pool @0807F910: ldr r0, [r5] ldr r1, =0x000011bc adds r0, r1 ldr r4, [r0] ldr r0, =gUnknown_08D927EC bl sub_8034974 adds r2, r0, 0 lsls r2, 16 lsrs r2, 16 movs r0, 0x1 adds r1, r4, 0 movs r3, 0 bl 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 .pool @0807F940: ldr r0, =gUnknown_083394F4 movs r1, 0x80 movs r2, 0x20 bl gpu_pal_apply b @0807F962 .align 2, 0 .pool @0807F950: ldr r0, =gUnknown_08339AC0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08339BD8 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08339B38 bl gpu_tile_obj_alloc_tag_and_copy_to_vram @0807F962: ldr r0, =0x020322a4 ldr r1, [r0] @0807F966: ldrb r0, [r1, 0x1] adds r0, 0x1 strb r0, [r1, 0x1] b @0807F9C8 .align 2, 0 .pool @0807F980: ldr r0, =gUnknown_08339C24 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08339C58 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08339AD0 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_08339AC8 bl gpu_pal_obj_alloc_tag_and_apply ldr r4, =0x020322a4 ldr r0, [r4] ldr r2, =0x000011bc adds r0, r2 ldr r0, [r0] bl free ldr r1, [r4] movs r0, 0 strb r0, [r1, 0x1] movs r0, 0x1 b @0807F9CA .align 2, 0 .pool @0807F9C8: movs r0, 0 @0807F9CA: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_807F7D8 thumb_func_start sub_807F9D0 sub_807F9D0: ; 807F9D0 push {lr} sub sp, 0x8 movs r0, 0x1E str r0, [sp] movs r0, 0x14 str r0, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =gUnknown_08339980 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 .pool thumb_func_end sub_807FA34 thumb_func_start sub_807FA80 sub_807FA80: ; 807FA80 push {r4,lr} ldr r4, =0x020322a4 ldr r0, [r4] cmp r0, 0 bne @0807FA94 movs r0, 0x8F lsls r0, 5 bl 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, =0x020375e0 ldrb r0, [r0] bl sub_807FE54 ldr r0, =sub_807FAC8 bl set_callback2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807FA80 thumb_func_start sub_807FAC8 sub_807FAC8: ; 807FAC8 push {r4-r6,lr} sub sp, 0x4 ldr r1, =0x020322a4 ldr r0, [r1] ldrb r0, [r0] adds r6, r1, 0 cmp r0, 0x6 bls @0807FADA b @0807FCE2 @0807FADA: lsls r0, 2 ldr r1, =@0807FAEC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0807FAEC: .4byte @0807FB08 .4byte @0807FBAC .4byte @0807FC38 .4byte @0807FC4E .4byte @0807FC64 .4byte @0807FC90 .4byte @0807FCB0 @0807FB08: movs r0, 0 movs r1, 0 bl 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, =gUnknown_08339974 movs r0, 0x1 movs r2, 0x3 bl bg_vram_setup ldr r4, =0x020322a4 ldr r1, [r4] movs r0, 0xDC lsls r0, 1 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x000009b8 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 .pool @0807FBAC: bl sub_807F7D8 lsls r0, 24 cmp r0, 0 bne @0807FBB8 b @0807FCE2 @0807FBB8: movs r4, 0 ldr r5, =gUnknown_083399C8 ldr r6, =0x020322a4 @0807FBBE: ldrb r1, [r5] ldrb r2, [r5, 0x1] ldr r0, =gUnknown_08339AD8 movs r3, 0x1 bl 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, =0x02020630 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, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0807FC14 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @0807FC14 bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 @0807FC14: ldr r0, =sub_807F764 bl SetVBlankCallback b @0807FCA0 .align 2, 0 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0807FCE2 b @0807FCA0 .align 2, 0 .pool @0807FC64: ldr r4, [r6] ldr r0, =0x000011b8 adds r4, r0 ldr r5, =gUnknown_0833973A bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 bl sub_808417C cmp r0, 0 beq @0807FCE2 ldr r1, [r6] b @0807FCA4 .align 2, 0 .pool @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, =0x020322a4 ldr r1, [r0] @0807FCA4: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0807FCE2 .align 2, 0 .pool @0807FCB0: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @0807FCE2 bl Window_FreeMemory movs r0, 0x2 bl bg_unset_tilemap movs r0, 0x1 bl bg_unset_tilemap movs r0, 0 bl SetVBlankCallback ldr r0, =sub_807FFA4 bl sub_81AABF0 ldr r0, =0x020322a4 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 .pool thumb_func_end sub_807FAC8 thumb_func_start sub_807FD08 sub_807FD08: ; 807FD08 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x3A] ldrh r1, [r4, 0x30] adds r0, r1 strh r0, [r4, 0x30] ldrh r1, [r4, 0x32] ldrh r2, [r4, 0x36] subs r1, r2 ldrh r0, [r4, 0x3C] adds r1, r0 strh r1, [r4, 0x32] ldrh r3, [r4, 0x2E] adds r0, r3 strh r0, [r4, 0x2E] subs r2, 0x1 strh r2, [r4, 0x36] lsls r0, 16 lsls r1, 16 cmp r0, r1 bge @0807FD56 ldrh r0, [r4, 0x34] subs r0, 0x1 strh r0, [r4, 0x36] strh r0, [r4, 0x34] ldrh r0, [r4, 0x38] adds r0, 0x1 strh r0, [r4, 0x38] lsls r0, 16 asrs r0, 16 cmp r0, 0x3 ble @0807FD50 adds r0, r4, 0 bl 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, =sub_807FD08 str r1, [r0, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807FD64 thumb_func_start sub_807FD90 sub_807FD90: ; 807FD90 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x8 adds r6, r1, 0 lsls r6, 24 lsrs r6, 24 lsls r0, 24 movs r1, 0xF6 lsls r1, 23 adds r0, r1 lsrs r0, 24 movs r3, 0x1 ands r3, r6 movs r1, 0 movs r2, 0x50 bl sub_80D511C lsls r0, 24 lsrs r0, 24 lsls r2, r0, 4 mov r8, r2 add r8, r0 mov r3, r8 lsls r3, 2 mov r8, r3 ldr r0, =0x02020630 add r8, r0 ldr r5, =gUnknown_08339C78 lsls r4, r6, 2 adds r4, r6 lsls r4, 1 adds r0, r4, r5 movs r6, 0 ldrsh r1, [r0, r6] adds r0, r5, 0x2 adds r0, r4, r0 movs r3, 0 ldrsh r2, [r0, r3] adds r0, r5, 0x4 adds r0, r4, r0 movs r6, 0 ldrsh r3, [r0, r6] adds r0, r5, 0x6 adds r0, r4, r0 movs r6, 0 ldrsh r0, [r0, r6] str r0, [sp] adds r5, 0x8 adds r4, r5 movs r5, 0 ldrsh r0, [r4, r5] str r0, [sp, 0x4] mov r0, r8 bl sub_807FD64 add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807FD90 thumb_func_start sub_807FE14 sub_807FE14: ; 807FE14 push {r4-r6,lr} adds r6, r0, 0 lsls r5, r1, 16 lsrs r5, 16 adds r0, r5, 0 adds r0, 0x7C lsls r0, 24 lsrs r0, 24 bl 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, =0x03005d98 strb r5, [r0] b @0807FF88 .align 2, 0 .pool @0807FE7C: ldr r0, =0x03005d98 strb r5, [r0] ldr r0, =0x020322a4 ldr r0, [r0] adds r0, 0x7C movs r1, 0x2 strb r1, [r0] ldr r4, =0x020229f0 ldr r0, =0x03005d90 ldr r1, [r0] adds r0, r4, 0 bl 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, =gUnknown_083397D0 ldr r1, [r1, 0xC] bl gf_strcpy b @0807FED4 .align 2, 0 .pool @0807FEC8: adds r0, r4, 0 adds r0, 0x1C ldr r1, =gUnknown_083397D0 ldr r1, [r1] bl gf_strcpy @0807FED4: ldr r1, =0x020229e8 movs r0, 0x2 strh r0, [r1, 0x1A] strh r0, [r1, 0x36] b @0807FF88 .align 2, 0 .pool @0807FEE8: ldr r0, =0x03005d98 strb r5, [r0] ldr r0, =0x020322a4 ldr r0, [r0] adds r0, 0x7C movs r1, 0x3 strb r1, [r0] ldr r6, =0x020229f0 ldr r0, =0x03005d90 ldr r1, [r0] adds r0, r6, 0 bl gf_strcpy adds r0, r6, 0 adds r0, 0x1C ldr r4, =gUnknown_083397D0 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 .pool @0807FF3C: ldr r0, =0x03005d98 strb r5, [r0] ldr r0, =0x020322a4 ldr r0, [r0] adds r0, 0x7C movs r1, 0x4 strb r1, [r0] ldr r5, =0x020229f0 ldr r0, =0x03005d90 ldr r1, [r0] adds r0, r5, 0 bl gf_strcpy adds r0, r5, 0 adds r0, 0x1C ldr r4, =gUnknown_083397D0 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 .pool thumb_func_end sub_807FE54 thumb_func_start sub_807FFA4 sub_807FFA4: ; 807FFA4 push {r4,r5,lr} movs r0, 0 movs r1, 0 bl lcd_io_set ldr r4, =0x020322a4 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, =0x020375e0 movs r3, 0 @0807FFD6: ldr r0, [r4] lsls r1, r2, 1 adds r0, 0x74 adds r0, r1 strh r3, [r0] adds r2, 0x1 cmp r2, 0x3 ble @0807FFD6 ldrb r0, [r5] bl sub_807FE54 ldrh r0, [r5] cmp r0, 0 bne @08080008 ldr r0, =sub_8080018 bl set_callback2 b @0808000E .align 2, 0 .pool @08080008: ldr r0, =sub_80808D4 bl set_callback2 @0808000E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_807FFA4 thumb_func_start sub_8080018 sub_8080018: ; 8080018 push {r4-r7,lr} sub sp, 0x4 ldr r1, =0x020322a4 ldr r0, [r1] ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0x15 bls @0808002A b @08080546 @0808002A: lsls r0, 2 ldr r1, =@0808003C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0808003C: .4byte @08080094 .4byte @08080100 .4byte @08080120 .4byte @0808019C .4byte @080801AE .4byte @080801C8 .4byte @08080546 .4byte @08080546 .4byte @080801F8 .4byte @08080248 .4byte @0808026C .4byte @08080302 .4byte @0808035C .4byte @080803D4 .4byte @08080408 .4byte @0808049C .4byte @080804D0 .4byte @08080546 .4byte @080804F8 .4byte @080804E4 .4byte @080804EA .4byte @08080508 @08080094: bl sub_8080588 ldr r1, =0x020229c6 ldr r2, =0x00004422 adds r0, r2, 0 strh r0, [r1] ldr r2, =0x020322a4 ldr r0, [r2] adds r0, 0x72 movs r1, 0 strb r1, [r0] movs r5, 0 movs r6, 0 movs r7, 0x92 lsls r7, 1 @080800B2: ldr r0, [r2] lsls r1, r5, 1 adds r0, 0x64 adds r0, r1 strh r6, [r0] adds r4, r5, 0x1 adds r1, r5 lsls r1, 1 movs r3, 0x2 @080800C4: ldr r0, [r2] adds r0, r7 adds r0, r1 strh r6, [r0] adds r1, 0x2 subs r3, 0x1 cmp r3, 0 bge @080800C4 adds r5, r4, 0 cmp r5, 0x3 ble @080800B2 ldr r3, =0x020322a4 ldr r4, [r3] adds r1, r4, 0 adds r1, 0x70 movs r2, 0 movs r0, 0 strh r0, [r1] subs r1, 0x22 strh r0, [r1] strb r2, [r4, 0x1] ldr r1, [r3] b @080804FC .align 2, 0 .pool @08080100: bl sub_807F7D8 lsls r0, 24 cmp r0, 0 bne @0808010C b @08080546 @0808010C: ldr r0, =0x020322a4 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] bl sub_8082D28 b @08080546 .align 2, 0 .pool @08080120: movs r5, 0 ldr r4, =gUnknown_083399C8 ldr r6, =0x020322a4 @08080126: ldrb r1, [r4] ldrb r2, [r4, 0x1] ldr r0, =gUnknown_08339AD8 movs r3, 0x1 bl 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, =0x02020630 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, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0808016A b @080804F8 @0808016A: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08080174 b @080804F8 @08080174: bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 b @080804F8 .align 2, 0 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080801C0 b @08080546 @080801C0: b @080804F8 .align 2, 0 .pool @080801C8: ldr r4, =0x020322a4 ldr r0, [r4] ldr r3, =0x000011b8 adds r0, r3 ldr r1, =gUnknown_0833981A movs r2, 0 bl sub_808417C ldr r1, [r4] movs r2, 0 movs r0, 0x8 strb r0, [r1] ldr r0, [r4] movs r1, 0x84 lsls r1, 1 adds r0, r1 str r2, [r0] b @08080546 .align 2, 0 .pool @080801F8: ldr r4, =0x020322a4 ldr r1, [r4] ldrb r0, [r1] adds r0, 0x1 movs r6, 0 strb r0, [r1] ldr r0, [r4] movs r2, 0x8A lsls r2, 1 adds r0, r2 strb r6, [r0] ldr r0, [r4] movs r5, 0xAC lsls r5, 1 adds r0, r5 ldr r1, =0x0203ce7c ldrh r1, [r1] bl sub_807FE14 ldr r0, =0x020228c4 ldr r1, [r4] adds r1, r5 movs r2, 0x10 bl memcpy bl sub_800ADF8 ldr r0, [r4] movs r3, 0x84 lsls r3, 1 adds r0, r3 str r6, [r0] b @08080546 .align 2, 0 .pool @08080248: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @08080254 b @08080546 @08080254: bl sub_800A5B4 bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 beq @08080264 b @080804F8 @08080264: movs r0, 0x4 bl sub_800A4D8 b @080804F8 @0808026C: ldr r6, =0x020322a4 ldr r1, [r6] movs r0, 0x84 lsls r0, 1 adds r1, r0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x14 bgt @08080282 b @08080546 @08080282: movs r0, 0x4 movs r1, 0x1 bl sub_8197DF8 bl sub_800A550 adds r4, r0, 0 bl sub_800A9D8 lsls r4, 24 lsls r0, 24 cmp r4, r0 beq @0808029E b @08080546 @0808029E: movs r5, 0 adds r7, r6, 0 movs r6, 0xAC lsls r6, 1 b @080802D4 .align 2, 0 .pool @080802AC: ldr r0, [r7] lsls r4, r5, 4 adds r0, r4, r0 adds r0, r6 lsls r1, r5, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x10 bl memcpy ldr r0, [r7] lsls r2, r5, 1 adds r1, r0, 0 adds r1, 0x74 adds r1, r2 adds r0, r4 adds r0, r6 ldrh r0, [r0] strh r0, [r1] adds r5, 0x1 @080802D4: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 blt @080802AC bl sub_800A5B4 b @080804F8 .align 2, 0 .pool @080802EC: ldrb r1, [r4] lsls r1, 1 adds r0, r2, 0 adds r0, 0x74 adds r0, r1 ldrh r0, [r0] lsls r1, r5, 24 lsrs r1, 24 bl sub_807FD90 b @08080336 @08080302: bl sub_8009FCC ldr r2, =0x020322a4 ldr r1, [r2] adds r1, 0x7C strb r0, [r1] movs r5, 0 ldr r2, [r2] movs r1, 0x8A lsls r1, 1 adds r4, r2, r1 ldr r1, =gUnknown_083399D0 adds r0, r2, 0 adds r0, 0x7C ldrb r0, [r0] subs r0, 0x2 lsls r0, 2 ldrb r3, [r4] adds r0, r1 @08080328: ldrb r1, [r0] cmp r3, r1 beq @080802EC adds r0, 0x1 adds r5, 0x1 cmp r5, 0x3 ble @08080328 @08080336: ldr r3, =0x020322a4 ldr r1, [r3] movs r0, 0x84 lsls r0, 1 adds r2, r1, r0 movs r0, 0 str r0, [r2] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r1, [r3] movs r2, 0x8A lsls r2, 1 adds r1, r2 b @080804FC .align 2, 0 .pool @0808035C: ldr r3, [r2] movs r0, 0x84 lsls r0, 1 adds r1, r3, r0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x3C bgt @08080370 b @08080546 @08080370: movs r1, 0x8A lsls r1, 1 adds r0, r3, r1 adds r1, r3, 0 adds r1, 0x7C ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bcc @080803B8 ldrb r0, [r3] adds r0, 0x1 strb r0, [r3] ldr r2, [r2] ldr r3, =gUnknown_083399DC ldr r1, =gUnknown_083399E4 adds r0, r2, 0 adds r0, 0x7C ldrb r0, [r0] subs r0, 0x2 adds r0, r1 ldrb r0, [r0] lsls r0, 1 adds r0, r3 ldr r3, =0xffffa800 adds r1, r3, 0 ldrh r0, [r0] adds r1, r0 adds r2, 0x4A strh r1, [r2] b @080803BE .align 2, 0 .pool @080803B8: ldrb r0, [r3] subs r0, 0x1 strb r0, [r3] @080803BE: ldr r0, =0x020322a4 ldr r0, [r0] movs r1, 0x84 lsls r1, 1 adds r0, r1 movs r1, 0 str r1, [r0] b @08080546 .align 2, 0 .pool @080803D4: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @080803E0 b @08080546 @080803E0: ldr r2, =0x020322a4 ldr r1, [r2] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r2] movs r2, 0xA0 lsls r2, 1 adds r0, r2 bl sub_8082CB4 movs r0, 0x2B bl audio_play movs r0, 0x2 bl gpu_sync_bg_show b @08080546 .align 2, 0 .pool @08080408: movs r1, 0x80 lsls r1, 3 movs r0, 0 bl lcd_io_set_bits ldr r4, =0x020322a4 ldr r2, [r4] adds r1, r2, 0 adds r1, 0x4A movs r3, 0x80 lsls r3, 2 adds r0, r3, 0 ldrh r3, [r1] adds r0, r3 strh r0, [r1] movs r0, 0x8D lsls r0, 1 adds r1, r2, r0 ldrh r0, [r1] adds r0, 0x4 strh r0, [r1] lsls r0, 16 lsrs r0, 16 cmp r0, 0xFF bls @0808048C movs r0, 0xC movs r1, 0x2 bl 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, =gUnknown_083399DC ldr r1, =gUnknown_083399E4 adds r0, r3, 0 adds r0, 0x7C ldrb r0, [r0] subs r0, 0x2 adds r0, r1 ldrb r0, [r0] lsls r0, 1 adds r0, r2 ldrh r0, [r0] adds r1, r3, 0 adds r1, 0x4A strh r0, [r1] movs r0, 0x84 lsls r0, 1 adds r1, r3, r0 movs r0, 0 str r0, [r1] movs r0, 0x34 bl audio_play bl sub_808074C bl sub_80807BC @0808048C: ldr r0, [r4] b @080804BE .align 2, 0 .pool @0808049C: bl sub_8083380 lsls r0, 24 cmp r0, 0 beq @080804BA ldr r0, =0x020322a4 ldr r1, [r0] movs r3, 0x84 lsls r3, 1 adds r2, r1, r3 movs r0, 0 str r0, [r2] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @080804BA: ldr r0, =0x020322a4 ldr r0, [r0] @080804BE: movs r1, 0xA0 lsls r1, 1 adds r0, r1 bl sub_8082CB4 b @08080546 .align 2, 0 .pool @080804D0: ldr r0, =gUnknown_08339C2C movs r2, 0x10 negs r2, r2 movs r1, 0x78 movs r3, 0x3 bl obj_add_from_template_forward_search b @080804F8 .align 2, 0 .pool @080804E4: bl sub_800ADF8 b @080804F8 @080804EA: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @08080546 bl sub_800A418 @080804F8: ldr r0, =0x020322a4 ldr r1, [r0] @080804FC: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08080546 .align 2, 0 .pool @08080508: ldr r5, =0x020322a4 ldr r3, [r5] adds r1, r3, 0 adds r1, 0x4C movs r2, 0 movs r0, 0x80 strh r0, [r1] movs r1, 0x82 lsls r1, 1 adds r0, r3, r1 str r2, [r0] ldr r0, =sub_8081898 bl set_callback2 bl current_map_music_get lsls r0, 16 lsrs r0, 16 ldr r4, =0x00000193 cmp r0, r4 beq @08080540 bl current_map_music_get ldr r1, [r5] movs r2, 0xAA lsls r2, 1 adds r1, r2 strh r0, [r1] @08080540: adds r0, r4, 0 bl song_play_for_text @08080546: ldr r0, =0x020322a4 ldr r1, [r0] movs r3, 0x8E lsls r3, 1 adds r0, r1, r3 movs r2, 0 ldrsh r0, [r0, r2] adds r3, 0x2 adds r1, r3 movs r2, 0 ldrsh r1, [r1, r2] bl nullsub_31 bl 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 .pool 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, =sub_807F764 bl SetVBlankCallback movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_08339974 movs r0, 0x1 movs r2, 0x3 bl bg_vram_setup ldr r4, =0x020322a4 ldr r1, [r4] movs r0, 0xDC lsls r0, 1 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r3, =0x000009b8 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 .pool thumb_func_end sub_8080588 thumb_func_start task_tutorial_oak_boy_girl task_tutorial_oak_boy_girl: ; 8080624 push {lr} lsls r0, 16 lsls r1, 24 lsrs r0, 24 adds r2, r0, 0 adds r2, 0x18 ldr r0, =0x020322a4 ldr r0, [r0] lsrs r1, 23 adds r0, 0x96 adds r0, r1 ldrb r0, [r0] ldr r1, =gUnknown_083399E7 adds r0, r1 ldrb r1, [r0] cmp r2, r1 bcc @0808066C adds r0, r1, 0 adds r0, 0x30 cmp r2, r0 bcs @0808066C subs r0, 0x1C cmp r2, r0 bcc @08080668 adds r0, 0x8 cmp r2, r0 bcs @08080668 movs r0, 0x2 b @0808066E .align 2, 0 .pool @08080668: movs r0, 0x1 b @0808066E @0808066C: movs r0, 0 @0808066E: pop {r1} bx r1 thumb_func_end task_tutorial_oak_boy_girl thumb_func_start sub_8080674 sub_8080674: ; 8080674 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 16 lsrs r5, r0, 16 lsls r1, 24 lsrs r1, 24 movs r6, 0 cmp r5, 0xAF bne @080806AC movs r4, 0 subs r7, r1, 0x1 adds r2, 0x9 @08080690: adds r0, r2, r6 adds r1, r2, r4 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bls @0808069E adds r6, r4, 0 @0808069E: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x4 bls @08080690 adds r0, r6, 0x5 b @080806C4 @080806AC: adds r0, r5, 0 subs r0, 0x85 lsls r0, 16 lsrs r6, r0, 16 subs r7, r1, 0x1 cmp r6, 0x4 bls @080806C8 adds r0, r6, 0 movs r1, 0x5 bl __umodsi3 adds r0, 0x5 @080806C4: lsls r0, 16 lsrs r6, r0, 16 @080806C8: movs r4, 0 cmp r4, r7 bge @08080734 ldr r0, =gUnknown_08339CA0 mov r9, r0 adds r0, r5, 0 subs r0, 0xA3 lsls r0, 16 lsrs r0, 16 mov r8, r0 @080806DC: lsls r0, r6, 1 adds r0, r6 adds r0, r4, r0 add r0, r9 ldrb r5, [r0] movs r0, 0xD0 lsls r0, 2 bl flag_check lsls r0, 24 cmp r0, 0 bne @0808071A ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0x1 bne @0808071A adds r0, r6, 0 movs r1, 0x5 bl __umodsi3 lsls r0, 16 lsrs r6, r0, 16 ldr r0, =gUnknown_08339CBE adds r0, r6, r0 ldrb r5, [r0] mov r0, r8 cmp r0, 0x4 bhi @0808071A subs r0, r5, 0x5 lsls r0, 16 lsrs r5, r0, 16 @0808071A: adds r4, 0x1 lsls r0, r4, 24 lsrs r0, 24 adds r1, r5, 0 adds r1, 0x85 lsls r1, 16 lsrs r1, 16 bl sub_8082FDC lsls r4, 16 lsrs r4, 16 cmp r4, r7 blt @080806DC @08080734: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8080674 thumb_func_start sub_808074C sub_808074C: ; 808074C push {r4-r7,lr} movs r4, 0 ldr r7, =0x020322a4 movs r6, 0xFF ldr r5, =gUnknown_083399D0 @08080756: ldr r3, [r7] lsls r2, r4, 1 adds r0, r3, 0 adds r0, 0x96 adds r0, r2 strh r6, [r0] adds r1, r3, 0 adds r1, 0x8E adds r1, r2 adds r0, r3, 0 adds r0, 0x7C ldrb r0, [r0] subs r0, 0x2 lsls r0, 2 adds r0, r4, r0 adds r0, r5 ldrb r0, [r0] strh r0, [r1] adds r4, 0x1 cmp r4, 0x3 ble @08080756 movs r3, 0 ldr r7, =0x020322a4 @08080784: movs r4, 0 adds r6, r3, 0x1 lsls r5, r3, 1 @0808078A: ldr r2, [r7] lsls r0, r4, 1 adds r1, r2, 0 adds r1, 0x8E adds r1, r0 ldrh r0, [r1] cmp r0, r3 bne @080807A2 adds r0, r2, 0 adds r0, 0x96 adds r0, r5 strh r4, [r0] @080807A2: adds r4, 0x1 cmp r4, 0x3 ble @0808078A adds r3, r6, 0 cmp r3, 0x3 ble @08080784 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808074C thumb_func_start sub_80807BC sub_80807BC: ; 80807BC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x1C movs r0, 0 mov r10, r0 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080807DE bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 mov r10, r0 @080807DE: movs r6, 0 ldr r7, =0x020322a4 mov r8, r6 @080807E4: ldr r2, [r7] lsls r5, r6, 1 adds r0, r2, 0 adds r0, 0x8E adds r3, r0, r5 ldrh r0, [r3] cmp r0, 0xFF beq @080808B6 adds r1, r2, 0 adds r1, 0x50 ldrh r3, [r3] adds r1, r3 adds r0, r2, 0 adds r0, 0x54 adds r0, r6 ldrb r0, [r0] movs r2, 0 mov r9, r2 strb r0, [r1] ldr r0, [r7] adds r1, r0, 0 adds r1, 0x8E adds r1, r5 adds r0, 0x50 ldrh r1, [r1] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 mov r1, r8 lsrs r4, r1, 24 adds r1, r4, 0 bl 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, =0x020229f0 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 .pool @08080890: lsls r2, 24 lsrs r2, 24 mov r1, r9 str r1, [sp] movs r0, 0x1 str r0, [sp, 0x4] adds r0, r4, 0 add r1, sp, 0x8 movs r3, 0x1 bl sub_80840D4 @080808A6: lsrs r4, r5, 24 adds r0, r4, 0 bl 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, =0x020322a4 ldr r0, [r1] ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0x15 bls @080808E6 b @08080DAE @080808E6: lsls r0, 2 ldr r1, =@080808F8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080808F8: .4byte @08080950 .4byte @080809E4 .4byte @08080A04 .4byte @08080A58 .4byte @08080A84 .4byte @08080DAE .4byte @08080DAE .4byte @08080DAE .4byte @08080ABC .4byte @08080DAE .4byte @08080DAE .4byte @08080AEC .4byte @08080B3C .4byte @08080BB0 .4byte @08080BDC .4byte @08080C78 .4byte @08080CA0 .4byte @08080DAE .4byte @08080CAE .4byte @08080CAE .4byte @08080CAE .4byte @08080CC4 @08080950: bl sub_800B4C0 bl sub_8080588 ldr r4, =0x0203ce7c ldrh r1, [r4] movs r0, 0 bl sub_8082FDC ldr r5, =0x020322a4 ldr r0, [r5] movs r6, 0xAC lsls r6, 1 adds r0, r6 ldrh r1, [r4] bl sub_807FE14 ldrh r0, [r4] ldr r2, [r5] adds r1, r2, 0 adds r1, 0x7C ldrb r1, [r1] adds r2, r6 bl sub_8080674 movs r4, 0 movs r6, 0 ldr r0, =0x020229c6 mov r12, r0 movs r7, 0x92 lsls r7, 1 @0808098E: ldr r0, [r5] lsls r1, r4, 1 adds r0, 0x64 adds r0, r1 strh r6, [r0] adds r3, r4, 0x1 adds r1, r4 lsls r1, 1 movs r2, 0x2 @080809A0: ldr r0, [r5] adds r0, r7 adds r0, r1 strh r6, [r0] adds r1, 0x2 subs r2, 0x1 cmp r2, 0 bge @080809A0 adds r4, r3, 0 cmp r4, 0x3 ble @0808098E ldr r4, =0x020322a4 ldr r3, [r4] adds r1, r3, 0 adds r1, 0x70 movs r2, 0 movs r0, 0 strh r0, [r1] strb r2, [r3, 0x1] ldr r1, =0x00004422 adds r0, r1, 0 mov r2, r12 strh r0, [r2] ldr r1, [r4] b @08080CB2 .align 2, 0 .pool @080809E4: bl sub_807F7D8 lsls r0, 24 cmp r0, 0 bne @080809F0 b @08080DAE @080809F0: ldr r0, =0x020322a4 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] bl sub_8082D28 b @08080DAE .align 2, 0 .pool @08080A04: movs r4, 0 ldr r5, =gUnknown_083399C8 ldr r6, =0x020322a4 @08080A0A: ldrb r1, [r5] ldrb r2, [r5, 0x1] ldr r0, =gUnknown_08339AD8 movs r3, 0x1 bl 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, =0x02020630 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 .pool @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, =0x020322a4 ldr r1, [r2] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r2] movs r3, 0x84 lsls r3, 1 adds r0, r3 str r4, [r0] b @08080DAE .align 2, 0 .pool @08080A84: ldr r4, =0x020322a4 ldr r1, [r4] movs r5, 0x84 lsls r5, 1 adds r1, r5 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x2 bne @08080A9C bl sub_807F9D0 @08080A9C: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08080AAA b @08080DAE @08080AAA: ldr r1, [r4] movs r0, 0x8 strb r0, [r1] b @08080DAE .align 2, 0 .pool @08080ABC: ldr r2, =0x020322a4 ldr r1, [r2] movs r3, 0 movs r0, 0xB strb r0, [r1] ldr r0, [r2] movs r1, 0x8A lsls r1, 1 adds r0, r1 strb r3, [r0] b @08080DAE .align 2, 0 .pool @08080AD8: lsls r1, 1 adds r0, r3, 0 adds r0, 0x74 adds r0, r1 ldrh r0, [r0] lsls r1, r4, 24 lsrs r1, 24 bl sub_807FD90 b @08080B16 @08080AEC: movs r4, 0 ldr r2, =gUnknown_083399D0 ldr r0, =0x020322a4 ldr r3, [r0] adds r0, r3, 0 adds r0, 0x7C ldrb r0, [r0] subs r0, 0x2 lsls r0, 2 movs r5, 0x8A lsls r5, 1 adds r1, r3, r5 ldrb r1, [r1] adds r0, r2 @08080B08: ldrb r2, [r0] cmp r1, r2 beq @08080AD8 adds r0, 0x1 adds r4, 0x1 cmp r4, 0x3 ble @08080B08 @08080B16: ldr r3, =0x020322a4 ldr r1, [r3] movs r5, 0x84 lsls r5, 1 adds r2, r1, r5 movs r0, 0 str r0, [r2] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r1, [r3] movs r0, 0x8A lsls r0, 1 adds r1, r0 b @08080CB2 .align 2, 0 .pool @08080B3C: ldr r3, [r2] movs r2, 0x84 lsls r2, 1 adds r1, r3, r2 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x3C bgt @08080B50 b @08080DAE @08080B50: movs r5, 0x8A lsls r5, 1 adds r0, r3, r5 adds r4, r3, 0 adds r4, 0x7C ldrb r0, [r0] ldrb r1, [r4] cmp r0, r1 bcc @08080B94 ldr r2, =gUnknown_083399DC ldr r1, =gUnknown_083399E4 ldrb r0, [r4] subs r0, 0x2 adds r0, r1 ldrb r0, [r0] lsls r0, 1 adds r0, r2 ldr r2, =0xffffa800 adds r1, r2, 0 ldrh r0, [r0] adds r1, r0 adds r0, r3, 0 adds r0, 0x4A strh r1, [r0] ldrb r0, [r3] adds r0, 0x1 b @08080B98 .align 2, 0 .pool @08080B94: ldrb r0, [r3] subs r0, 0x1 @08080B98: strb r0, [r3] ldr r0, =0x020322a4 ldr r0, [r0] movs r3, 0x84 lsls r3, 1 adds r0, r3 movs r1, 0 str r1, [r0] b @08080DAE .align 2, 0 .pool @08080BB0: ldr r4, =0x020322a4 ldr r1, [r4] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] bl sub_808074C movs r0, 0x2B bl audio_play ldr r0, [r4] movs r5, 0xA0 lsls r5, 1 adds r0, r5 bl sub_8082CB4 movs r0, 0x2 bl gpu_sync_bg_show b @08080DAE .align 2, 0 .pool @08080BDC: movs r1, 0x80 lsls r1, 3 movs r0, 0 bl lcd_io_set_bits ldr r4, =0x020322a4 ldr r2, [r4] adds r1, r2, 0 adds r1, 0x4A movs r3, 0x80 lsls r3, 2 adds r0, r3, 0 ldrh r5, [r1] adds r0, r5 strh r0, [r1] movs r0, 0x8D lsls r0, 1 adds r1, r2, r0 ldrh r0, [r1] adds r0, 0x4 strh r0, [r1] lsls r0, 16 lsrs r0, 16 cmp r0, 0xFF bls @08080C5C ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] ldr r3, [r4] movs r2, 0x8D lsls r2, 1 adds r1, r3, r2 movs r0, 0x80 lsls r0, 1 strh r0, [r1] ldr r2, =gUnknown_083399DC ldr r1, =gUnknown_083399E4 adds r0, r3, 0 adds r0, 0x7C ldrb r0, [r0] subs r0, 0x2 adds r0, r1 ldrb r0, [r0] lsls r0, 1 adds r0, r2 ldrh r1, [r0] adds r0, r3, 0 adds r0, 0x4A strh r1, [r0] movs r0, 0xC movs r1, 0x2 bl 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 .pool @08080C78: bl sub_8083380 lsls r0, 24 cmp r0, 0 beq @08080C8C ldr r0, =0x020322a4 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @08080C8C: ldr r0, =0x020322a4 ldr r0, [r0] movs r1, 0xA0 lsls r1, 1 adds r0, r1 bl sub_8082CB4 b @08080DAE .align 2, 0 .pool @08080CA0: ldr r0, =gUnknown_08339C2C movs r2, 0x10 negs r2, r2 movs r1, 0x78 movs r3, 0x3 bl obj_add_from_template_forward_search @08080CAE: ldr r0, =0x020322a4 ldr r1, [r0] @08080CB2: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08080DAE .align 2, 0 .pool @08080CC4: bl sub_8080DF8 ldr r5, =0x020322a4 ldr r4, [r5] adds r1, r4, 0 adds r1, 0x4C movs r3, 0 movs r2, 0 movs r0, 0x80 strh r0, [r1] movs r1, 0x82 lsls r1, 1 adds r0, r4, r1 str r2, [r0] ldr r2, =0x00000123 adds r0, r4, r2 strb r3, [r0] ldr r0, [r5] adds r0, 0x72 strb r3, [r0] ldr r0, =sub_8081898 bl set_callback2 ldr r0, =0x020375e0 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, =sub_8081224 movs r1, 0xA bl AddTask ldr r1, [r5] movs r3, 0x90 lsls r3, 1 adds r1, r3 b @08080D42 .align 2, 0 .pool @08080D30: ldr r0, =gUnknown_083399EC ldr r0, [r0] movs r1, 0xA bl AddTask ldr r1, [r5] movs r5, 0x90 lsls r5, 1 adds r1, r5 @08080D42: strb r0, [r1] @08080D44: ldr r1, =0x020375e0 ldrh r0, [r1] cmp r0, 0x1 bls @08080D80 movs r4, 0 ldrh r1, [r1] cmp r4, r1 bge @08080D80 movs r5, 0xA0 lsls r5, 20 ldr r6, =gUnknown_083399EC @08080D5A: ldm r6!, {r0} lsrs r1, r5, 24 bl AddTask ldr r1, =0x020322a4 ldr r1, [r1] movs r2, 0x90 lsls r2, 1 adds r1, r2 adds r1, r4 strb r0, [r1] movs r3, 0x80 lsls r3, 17 adds r5, r3 adds r4, 0x1 ldr r0, =0x020375e0 ldrh r0, [r0] cmp r4, r0 blt @08080D5A @08080D80: bl current_map_music_get lsls r0, 16 lsrs r0, 16 ldr r4, =0x00000193 cmp r0, r4 beq @08080D9E bl current_map_music_get ldr r1, =0x020322a4 ldr r1, [r1] movs r5, 0xAA lsls r5, 1 adds r1, r5 strh r0, [r1] @08080D9E: adds r0, r4, 0 bl song_play_for_text movs r0, 0x35 bl audio_play bl sub_807F738 @08080DAE: ldr r0, =0x020322a4 ldr r1, [r0] movs r2, 0x8E lsls r2, 1 adds r0, r1, r2 movs r3, 0 ldrsh r0, [r0, r3] movs r5, 0x8F lsls r5, 1 adds r1, r5 movs r2, 0 ldrsh r1, [r1, r2] bl nullsub_31 bl 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 .pool thumb_func_end sub_80808D4 thumb_func_start sub_8080DF8 sub_8080DF8: ; 8080DF8 push {lr} ldr r3, =0x03003110 movs r0, 0 ldr r1, =0x03003090 movs r2, 0x3 @08080E02: strh r0, [r3] strh r0, [r3, 0x4] strh r0, [r1] strh r0, [r1, 0x4] adds r1, 0x10 subs r2, 0x1 cmp r2, 0 bge @08080E02 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8080DF8 thumb_func_start sub_8080E20 sub_8080E20: ; 8080E20 push {r4,lr} lsls r0, 24 lsrs r3, r0, 24 ldr r1, =0x03005e00 lsls r0, r3, 2 adds r0, r3 lsls r0, 3 adds r2, r0, r1 ldrh r0, [r2, 0x8] adds r0, 0x1 strh r0, [r2, 0x8] lsls r0, 16 asrs r0, 16 movs r4, 0xA ldrsh r1, [r2, r4] cmp r0, r1 ble @08080E58 ldr r0, =0x03003090 movs r4, 0xC ldrsh r1, [r2, r4] lsls r1, 4 adds r0, 0x4 adds r1, r0 ldr r0, =0x00002345 strh r0, [r1] adds r0, r3, 0 bl remove_task @08080E58: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8080E20 thumb_func_start sub_8080E6C sub_8080E6C: ; 8080E6C push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 lsls r5, 24 lsrs r5, 24 lsls r4, 24 lsrs r4, 24 ldr r0, =sub_8080E20 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xA] strh r5, [r1, 0xC] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8080E6C thumb_func_start sub_8080EA4 sub_8080EA4: ; 8080EA4 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r4, =0x020322a4 ldr r0, [r4] adds r0, 0x4A ldrh r0, [r0] movs r1, 0x1 bl task_tutorial_oak_boy_girl lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 beq @08080EC2 b @08080FB8 @08080EC2: ldr r2, =0x03005e00 lsls r1, r5, 2 adds r0, r1, r5 lsls r0, 3 adds r0, r2 movs r2, 0x8 ldrsh r0, [r0, r2] adds r6, r1, 0 cmp r0, 0 beq @08080ED8 b @08080FC6 @08080ED8: ldr r0, [r4] ldr r1, =0x00000123 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @08080F9A bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000028f bl __udivsi3 lsls r0, 24 lsrs r1, r0, 24 adds r3, r1, 0 ldr r0, [r4] adds r0, 0x4C movs r4, 0 ldrsh r2, [r0, r4] ldr r0, =0x000001f3 cmp r2, r0 bgt @08080F40 cmp r1, 0x4B bls @08080F2C ldr r1, =0x03003090 ldr r0, =0x00004523 b @08080F30 .align 2, 0 .pool @08080F2C: ldr r1, =0x03003090 ldr r0, =0x00005432 @08080F30: strh r0, [r1, 0x14] ldr r0, =0x00005432 b @08080F9E .align 2, 0 .pool @08080F40: ldr r0, =0x000005db cmp r2, r0 bgt @08080F6E cmp r1, 0x50 bhi @08080F9A adds r0, r1, 0 subs r0, 0x15 lsls r0, 24 lsrs r0, 24 cmp r0, 0x3B bhi @08080F68 ldr r1, =0x03003090 ldr r0, =0x00005432 b @08080F9E .align 2, 0 .pool @08080F68: cmp r1, 0x9 bhi @08080FA0 b @08080F90 @08080F6E: cmp r1, 0x5A bhi @08080F9A adds r0, r1, 0 subs r0, 0x47 lsls r0, 24 lsrs r0, 24 cmp r0, 0x13 bhi @08080F8C ldr r1, =0x03003090 ldr r0, =0x00005432 b @08080F9E .align 2, 0 .pool @08080F8C: cmp r3, 0x1D bhi @08080FA0 @08080F90: movs r0, 0x1 movs r1, 0x5 bl sub_8080E6C b @08080FA0 @08080F9A: ldr r1, =0x03003090 ldr r0, =0x00004523 @08080F9E: strh r0, [r1, 0x14] @08080FA0: ldr r0, =0x03005e00 adds r1, r6, r5 lsls r1, 3 adds r1, r0 movs r0, 0x1 b @08080FC4 .align 2, 0 .pool @08080FB8: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 movs r0, 0 @08080FC4: strh r0, [r1, 0x8] @08080FC6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8080EA4 thumb_func_start sub_8080FD0 sub_8080FD0: ; 8080FD0 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r6, =0x020322a4 ldr r3, [r6] adds r0, r3, 0 adds r0, 0x4A ldrh r0, [r0] movs r1, 0xC0 lsls r1, 5 adds r0, r1 ldr r1, =0x0000ffff ands r0, r1 adds r1, r3, 0 adds r1, 0x9A ldrb r1, [r1] lsrs r2, r0, 8 ldr r0, =gUnknown_083399E7 adds r1, r0 ldrb r1, [r1] adds r0, r1, 0 adds r0, 0x14 cmp r2, r0 bls @080810E0 adds r0, 0x14 cmp r2, r0 bcs @080810E0 ldr r2, =0x03005e00 lsls r1, r4, 2 adds r0, r1, r4 lsls r0, 3 adds r2, r0, r2 movs r5, 0x8 ldrsh r0, [r2, r5] adds r5, r1, 0 cmp r0, 0 bne @080810EE ldr r1, =0x00000123 adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0 bne @080810CC bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000028f bl __udivsi3 lsls r0, 24 lsrs r2, r0, 24 adds r3, r2, 0 ldr r0, [r6] adds r0, 0x4C movs r6, 0 ldrsh r1, [r0, r6] ldr r0, =0x000001f3 cmp r1, r0 bgt @08081088 cmp r2, 0x42 bls @08081078 ldr r1, =0x03003090 ldr r0, =0x00004523 strh r0, [r1, 0x24] b @080810B0 .align 2, 0 .pool @08081078: ldr r1, =0x03003090 ldr r0, =0x00005432 strh r0, [r1, 0x24] b @080810B0 .align 2, 0 .pool @08081088: cmp r2, 0x41 bls @08081092 ldr r1, =0x03003090 ldr r0, =0x00004523 strh r0, [r1, 0x24] @08081092: adds r0, r2, 0 subs r0, 0x29 lsls r0, 24 lsrs r0, 24 cmp r0, 0x18 bhi @080810A4 ldr r1, =0x03003090 ldr r0, =0x00005432 strh r0, [r1, 0x24] @080810A4: cmp r3, 0x9 bhi @080810B0 movs r0, 0x2 movs r1, 0x5 bl sub_8080E6C @080810B0: ldr r0, =0x03005e00 adds r1, r5, r4 lsls r1, 3 adds r1, r0 movs r0, 0x1 b @080810EC .align 2, 0 .pool @080810CC: ldr r0, =0x03003090 ldr r1, =0x00004523 strh r1, [r0, 0x24] movs r0, 0x1 strh r0, [r2, 0x8] b @080810EE .align 2, 0 .pool @080810E0: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 movs r0, 0 @080810EC: strh r0, [r1, 0x8] @080810EE: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8080FD0 thumb_func_start sub_80810F8 sub_80810F8: ; 80810F8 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r5, =0x020322a4 ldr r3, [r5] adds r0, r3, 0 adds r0, 0x4A ldrh r0, [r0] movs r1, 0xC0 lsls r1, 5 adds r0, r1 ldr r1, =0x0000ffff ands r0, r1 adds r1, r3, 0 adds r1, 0x9C ldrb r1, [r1] lsrs r2, r0, 8 ldr r0, =gUnknown_083399E7 adds r1, r0 ldrb r1, [r1] adds r0, r1, 0 adds r0, 0x14 cmp r2, r0 bls @0808120C adds r0, 0x14 cmp r2, r0 bcs @0808120C ldr r2, =0x03005e00 lsls r1, r4, 2 adds r0, r1, r4 lsls r0, 3 adds r2, r0, r2 movs r6, 0x8 ldrsh r0, [r2, r6] adds r6, r1, 0 cmp r0, 0 bne @0808121A ldr r1, =0x00000123 adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0 bne @080811F8 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000028f bl __udivsi3 lsls r0, 24 lsrs r2, r0, 24 ldr r0, [r5] adds r0, 0x4C movs r3, 0 ldrsh r1, [r0, r3] ldr r0, =0x000001f3 cmp r1, r0 bgt @080811AC cmp r2, 0x58 bls @0808119C ldr r1, =0x03003090 ldr r0, =0x00004523 strh r0, [r1, 0x34] b @080811DE .align 2, 0 .pool @0808119C: ldr r1, =0x03003090 ldr r0, =0x00005432 strh r0, [r1, 0x34] b @080811DE .align 2, 0 .pool @080811AC: cmp r2, 0x3C bls @080811C0 ldr r1, =0x03003090 ldr r0, =0x00004523 b @080811D0 .align 2, 0 .pool @080811C0: adds r0, r2, 0 subs r0, 0x38 lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bhi @080811D2 ldr r1, =0x03003090 ldr r0, =0x00005432 @080811D0: strh r0, [r1, 0x34] @080811D2: cmp r2, 0x4 bhi @080811DE movs r0, 0x3 movs r1, 0x5 bl sub_8080E6C @080811DE: ldr r0, =0x03005e00 adds r1, r6, r4 lsls r1, 3 adds r1, r0 movs r0, 0x1 b @08081218 .align 2, 0 .pool @080811F8: ldr r0, =0x03003090 ldr r1, =0x00004523 strh r1, [r0, 0x34] movs r0, 0x1 strh r0, [r2, 0x8] b @0808121A .align 2, 0 .pool @0808120C: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 movs r0, 0 @08081218: strh r0, [r1, 0x8] @0808121A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80810F8 thumb_func_start sub_8081224 sub_8081224: ; 8081224 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x020322a4 ldr r0, [r0] adds r0, 0x4A ldrh r0, [r0] movs r1, 0x1 bl task_tutorial_oak_boy_girl lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @08081270 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r2, r1, r0 movs r1, 0x8 ldrsh r0, [r2, r1] cmp r0, 0 bne @0808127E ldr r0, =0x03003090 ldr r1, =0x00004523 strh r1, [r0, 0x14] movs r0, 0x1 strh r0, [r2, 0x8] b @0808127E .align 2, 0 .pool @08081270: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 movs r0, 0 strh r0, [r1, 0x8] @0808127E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8081224 thumb_func_start sub_8081288 sub_8081288: ; 8081288 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 16 lsrs r7, r0, 16 mov r8, r7 lsls r1, 24 ldr r0, =gUnknown_08339B40 ldr r4, =gUnknown_083399C8 lsrs r1, 23 adds r2, r1, r4 ldrb r6, [r2] ldr r5, =gUnknown_083399C0 adds r2, r1, r5 movs r3, 0 ldrsb r3, [r2, r3] lsls r2, r3, 2 adds r2, r3 lsls r2, 1 subs r6, r2 adds r4, 0x1 adds r4, r1, r4 ldrb r2, [r4] adds r5, 0x1 adds r1, r5 movs r3, 0 ldrsb r3, [r1, r3] lsls r1, r3, 2 adds r1, r3 lsls r1, 1 subs r2, r1 adds r1, r6, 0 movs r3, 0x1 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r1, r0, 24 adds r2, r1, 0 ldr r0, =0x00004523 cmp r7, r0 bne @08081314 lsls r4, r1, 4 adds r4, r1 lsls r4, 2 ldr r5, =0x02020630 adds r0, r4, r5 movs r1, 0x2 bl obj_anim_image_start adds r5, 0x1C adds r4, r5 ldr r0, =sub_8082F9C str r0, [r4] movs r0, 0x28 bl audio_play b @08081358 .align 2, 0 .pool @08081314: ldr r0, =0x00005432 cmp r7, r0 bne @0808133C lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 bl obj_anim_image_start movs r0, 0x1F bl audio_play b @08081358 .align 2, 0 .pool @0808133C: ldr r0, =0x00002345 cmp r8, r0 bne @08081358 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x1 bl 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 .pool thumb_func_end sub_8081288 thumb_func_start sub_8081370 sub_8081370: ; 8081370 push {r4-r7,lr} lsls r0, 16 lsrs r4, r0, 16 adds r5, r4, 0 bl sub_807F738 ldr r0, =0x00004523 cmp r4, r0 beq @080813A4 cmp r4, r0 bgt @08081398 ldr r0, =0x00002345 cmp r4, r0 beq @08081474 b @080814A0 .align 2, 0 .pool @08081398: ldr r0, =0x00005432 cmp r5, r0 beq @0808143C b @080814A0 .align 2, 0 .pool @080813A4: ldr r7, =0x020322a4 ldr r4, [r7] adds r5, r4, 0 adds r5, 0x4C ldrh r6, [r5] movs r0, 0 ldrsh r1, [r5, r0] ldr r0, =0x000005db cmp r1, r0 bgt @080813E0 ldr r1, =gUnknown_08339CC3 adds r0, r4, 0 adds r0, 0x7C ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] movs r0, 0xC0 lsls r0, 1 bl __divsi3 adds r0, r6, r0 strh r0, [r5] b @080814A0 .align 2, 0 .pool @080813E0: ldr r1, =gUnknown_08339CC3 adds r0, r4, 0 adds r0, 0x7C ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] movs r0, 0x80 bl __divsi3 adds r0, r6, r0 strh r0, [r5] movs r1, 0x8E lsls r1, 1 adds r4, r1 movs r1, 0 ldrsh r0, [r5, r1] movs r1, 0x64 bl __divsi3 adds r1, r0, 0 subs r1, 0xA lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_80832BC ldr r0, [r7] movs r1, 0x8F lsls r1, 1 adds r4, r0, r1 adds r0, 0x4C movs r1, 0 ldrsh r0, [r0, r1] movs r1, 0x64 bl __divsi3 adds r1, r0, 0 subs r1, 0xA lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_80832BC b @080814A0 .align 2, 0 .pool @0808143C: ldr r0, =0x020322a4 ldr r2, [r0] adds r4, r2, 0 adds r4, 0x4C ldrh r5, [r4] movs r0, 0 ldrsh r1, [r4, r0] ldr r0, =0x000005db cmp r1, r0 bgt @080814A0 ldr r1, =gUnknown_08339CC3 adds r0, r2, 0 adds r0, 0x7C ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] movs r0, 0x80 lsls r0, 1 bl __divsi3 adds r0, r5, r0 b @0808149E .align 2, 0 .pool @08081474: ldr r0, =0x020322a4 ldr r0, [r0] adds r4, r0, 0 adds r4, 0x4C ldr r1, =gUnknown_08339CC3 adds r0, 0x7C ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] movs r0, 0x80 lsls r0, 1 bl __divsi3 ldrh r1, [r4] subs r1, r0 strh r1, [r4] lsls r1, 16 asrs r1, 16 cmp r1, 0x7F bgt @080814A0 movs r0, 0x80 @0808149E: strh r0, [r4] @080814A0: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8081370 thumb_func_start sub_80814B0 sub_80814B0: ; 80814B0 push {lr} lsls r0, 16 lsrs r3, r0, 16 lsls r1, 16 lsrs r1, 16 lsls r2, 16 lsrs r2, 16 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080814E4 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080814E4 movs r0, 0xFF lsls r0, 8 ands r0, r3 cmp r0, r2 bne @080814EC movs r0, 0x1 b @080814EE .align 2, 0 .pool @080814E4: cmp r3, r1 bne @080814EC movs r0, 0x1 b @080814EE @080814EC: movs r0, 0 @080814EE: pop {r1} bx r1 thumb_func_end sub_80814B0 thumb_func_start sub_80814F4 sub_80814F4: ; 80814F4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0 beq @0808153C ldr r3, =0x03003110 ldrh r0, [r3, 0x4] ldr r2, =0x03003090 cmp r0, 0 beq @0808151C movs r1, 0 strh r0, [r2, 0x4] ldr r0, =0x00004444 strh r0, [r2] strh r1, [r3, 0x4] @0808151C: ldr r0, =0x03003090 ldr r3, =0x00004444 adds r1, r2, 0 adds r1, 0x10 adds r2, r0, 0 adds r2, 0x14 movs r7, 0x2 @0808152A: ldrh r0, [r2] cmp r0, 0 beq @08081532 strh r3, [r1] @08081532: adds r1, 0x10 adds r2, 0x10 subs r7, 0x1 cmp r7, 0 bge @0808152A @0808153C: movs r7, 0 ldr r1, =0x020322a4 ldr r0, [r1] adds r0, 0x7C ldrb r0, [r0] cmp r7, r0 blt @0808154C b @080816F6 @0808154C: ldr r0, =0x03003090 adds r2, r0, 0 adds r2, 0x20 str r2, [sp] movs r1, 0 mov r9, r1 movs r2, 0 str r2, [sp, 0x4] mov r8, r0 ldr r0, =0x00005432 mov r10, r0 @08081562: mov r1, r8 ldrh r0, [r1] ldr r1, =0x00004444 movs r2, 0x88 lsls r2, 7 bl sub_80814B0 cmp r0, 0 bne @08081576 b @080816D2 @08081576: ldr r6, =0x020322a4 ldr r0, [r6] adds r0, 0x96 ldr r2, [sp, 0x4] adds r0, r2 ldrh r5, [r0] mov r0, r8 ldrh r4, [r0, 0x4] ldr r1, =0x00004523 cmp r4, r1 bne @080815F4 adds r0, r1, 0 bl sub_8081370 ldr r0, [r6] movs r2, 0x8B lsls r2, 1 adds r4, r0, r2 adds r0, 0x4C movs r1, 0 ldrsh r0, [r0, r1] movs r1, 0x37 bl __divsi3 ldrh r1, [r4] adds r1, r0 strh r1, [r4] lsls r1, 16 ldr r0, =0x03e70000 cmp r1, r0 bls @080815BA movs r0, 0xFA lsls r0, 2 strh r0, [r4] @080815BA: lsls r1, r5, 24 lsrs r1, 24 ldr r0, =0x00004523 bl sub_8081288 ldr r1, [r6] movs r2, 0x92 lsls r2, 1 adds r1, r2 add r1, r9 ldrh r0, [r1] adds r0, 0x1 b @0808165E .align 2, 0 .pool @080815F4: cmp r4, r10 bne @08081632 mov r0, r10 bl sub_8081370 ldr r0, [r6] movs r1, 0x8B lsls r1, 1 adds r4, r0, r1 adds r0, 0x4C movs r2, 0 ldrsh r0, [r0, r2] movs r1, 0x46 bl __divsi3 ldrh r1, [r4] adds r1, r0 strh r1, [r4] lsls r1, r5, 24 lsrs r1, 24 mov r0, r10 bl sub_8081288 ldr r1, [r6] movs r0, 0x93 lsls r0, 1 adds r1, r0 add r1, r9 ldrh r0, [r1] adds r0, 0x1 b @0808165E @08081632: ldr r0, =0x00002345 cmp r4, r0 bne @0808166A lsls r1, r5, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_8081288 adds r0, r4, 0 bl sub_8081370 ldr r0, [r6] movs r1, 0x94 lsls r1, 1 adds r0, r1 mov r2, r9 adds r1, r0, r2 ldrh r2, [r1] ldr r0, =0x000003e6 cmp r2, r0 bhi @08081660 adds r0, r2, 0x1 @0808165E: strh r0, [r1] @08081660: mov r0, r8 ldrh r1, [r0, 0x4] ldr r0, =0x00002345 cmp r1, r0 beq @08081678 @0808166A: ldr r1, [sp] ldrh r0, [r1] ldr r2, =0x00004523 cmp r0, r2 beq @08081678 cmp r0, r10 bne @080816D2 @08081678: ldr r0, =0x020322a4 ldr r0, [r0] adds r2, r0, 0 adds r2, 0x4C movs r0, 0 ldrsh r1, [r2, r0] ldr r0, =0x000005dc cmp r1, r0 ble @080816C8 adds r0, r1, 0 ldr r2, =0xfffffd12 adds r0, r2 movs r1, 0x14 bl __divsi3 adds r1, r0, 0 movs r0, 0x80 lsls r0, 1 adds r1, r0 lsls r1, 16 lsrs r1, 16 ldr r0, =0x03007420 bl MPlayTempoControl b @080816D2 .align 2, 0 .pool @080816C8: ldr r0, =0x03007420 movs r1, 0x80 lsls r1, 1 bl MPlayTempoControl @080816D2: ldr r1, [sp] adds r1, 0x2 str r1, [sp] movs r2, 0x6 add r9, r2 ldr r0, [sp, 0x4] adds r0, 0x2 str r0, [sp, 0x4] movs r1, 0x10 add r8, r1 adds r7, 0x1 ldr r0, =0x020322a4 ldr r0, [r0] adds r0, 0x7C ldrb r0, [r0] cmp r7, r0 bge @080816F6 b @08081562 @080816F6: ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0 beq @08081722 movs r7, 0 ldr r3, =0x020322a4 ldr r0, [r3] adds r0, 0x7C ldrb r0, [r0] cmp r7, r0 bge @08081722 movs r2, 0 ldr r1, =0x03003090 @08081710: strh r2, [r1] strh r2, [r1, 0x4] adds r1, 0x10 adds r7, 0x1 ldr r0, [r3] adds r0, 0x7C ldrb r0, [r0] cmp r7, r0 blt @08081710 @08081722: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80814F4 thumb_func_start sub_8081744 sub_8081744: ; 8081744 push {r4-r6,lr} movs r4, 0 movs r6, 0 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0808175A bl link_get_multiplayer_id lsls r0, 24 lsrs r6, r0, 24 @0808175A: ldr r3, =0x020322a4 ldr r1, [r3] lsls r2, r6, 1 adds r0, r1, 0 adds r0, 0x96 adds r0, r2 ldrb r5, [r0] adds r1, 0x63 ldrb r0, [r1] cmp r0, 0 bne @0808182C ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x2 bne @080817A8 ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080817B6 ldrh r2, [r2, 0x28] ldr r1, =0x00000201 adds r0, r1, 0 ands r0, r2 cmp r0, r1 beq @080817B6 b @080817BA .align 2, 0 .pool @080817A8: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080817B6 movs r4, 0x1 @080817B6: cmp r4, 0 beq @0808182C @080817BA: ldr r4, =0x020322a4 ldr r1, [r4] lsls r2, r5, 1 adds r0, r1, 0 adds r0, 0x8E adds r0, r2 adds r1, 0x50 ldrh r0, [r0] adds r1, r0 ldrb r1, [r1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 adds r1, r5, 0x4 lsls r1, 24 lsrs r1, 24 bl 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, =0x03003110 ldr r0, =0x00004523 b @08081828 .align 2, 0 .pool @08081810: cmp r0, 0x1 bne @08081824 ldr r1, =0x03003110 ldr r0, =0x00005432 b @08081828 .align 2, 0 .pool @08081824: ldr r1, =0x03003110 ldr r0, =0x00002345 @08081828: strh r0, [r1, 0x4] adds r3, r4, 0 @0808182C: ldr r1, [r3] adds r1, 0x72 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 bls @0808185A ldr r0, [r3] adds r1, r0, 0 adds r1, 0x4C ldrh r2, [r1] movs r4, 0 ldrsh r0, [r1, r4] cmp r0, 0x80 ble @08081852 subs r0, r2, 0x1 strh r0, [r1] @08081852: ldr r0, [r3] adds r0, 0x72 movs r1, 0 strb r1, [r0] @0808185A: ldr r0, =0x020322d5 ldrb r0, [r0] cmp r0, 0 beq @0808187E ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x80 lsls r0, 2 ands r0, r1 cmp r0, 0 beq @0808187E ldr r0, [r3] ldr r1, =0x00000123 adds r2, r0, r1 ldrb r0, [r2] movs r1, 0x1 eors r0, r1 strb r0, [r2] @0808187E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8081744 thumb_func_start sub_8081898 sub_8081898: ; 8081898 push {r4-r6,lr} bl sub_8082D28 ldr r4, =0x020322a4 ldr r0, [r4] movs r1, 0x82 lsls r1, 1 adds r2, r0, r1 ldr r1, [r2] ldr r0, =0x00057e03 cmp r1, r0 bhi @080818B4 adds r0, r1, 0x1 str r0, [r2] @080818B4: bl sub_8081744 ldr r1, [r4] adds r0, r1, 0 adds r0, 0x4C ldrh r0, [r0] movs r5, 0x8B lsls r5, 1 adds r1, r5 ldrh r1, [r1] bl sub_800A994 bl sub_80814F4 ldr r0, [r4] adds r0, r5 ldrh r0, [r0] movs r6, 0xFA lsls r6, 2 adds r1, r6, 0 bl sub_8083140 ldr r0, [r4] adds r0, 0x4C ldrh r0, [r0] bl sub_8083230 bl sub_808330C bl sub_8082AD4 ldr r2, [r4] adds r3, r2, 0 adds r3, 0x63 ldrb r0, [r3] cmp r0, 0 bne @0808191A movs r1, 0x8C lsls r1, 1 adds r0, r2, r1 ldrh r1, [r0] ldr r0, =0x000003e7 cmp r1, r0 bls @0808191A adds r0, r2, r5 strh r6, [r0] movs r0, 0x1 strb r0, [r3] ldr r0, =sub_8081FC8 bl set_callback2 @0808191A: ldr r0, =0x020322a4 ldr r1, [r0] movs r2, 0x8E lsls r2, 1 adds r0, r1, r2 movs r2, 0 ldrsh r0, [r0, r2] movs r2, 0x8F lsls r2, 1 adds r1, r2 movs r2, 0 ldrsh r1, [r1, r2] bl nullsub_31 bl 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 .pool thumb_func_end sub_8081898 thumb_func_start nullsub_31 nullsub_31: ; 8081960 bx lr thumb_func_end nullsub_31 thumb_func_start help_system_is_not_first_time help_system_is_not_first_time: ; 8081964 push {r4,r5,lr} lsls r1, 24 lsls r2, 24 lsrs r1, 20 adds r4, r1, r0 lsrs r2, 20 adds r5, r2, r0 ldrh r0, [r4] ldrh r1, [r5] cmp r0, r1 bne @080819A2 adds r0, r4, 0x2 adds r1, r5, 0x2 bl sub_8008C44 cmp r0, 0 bne @080819B0 ldr r0, [r4, 0x8] ldr r2, =0xffffff00 ands r0, r2 ldr r1, [r5, 0x8] ands r1, r2 cmp r0, r1 bne @080819B0 ldr r0, [r4, 0xC] ldr r2, =0x00ffffff ands r0, r2 ldr r1, [r5, 0xC] ands r1, r2 cmp r0, r1 bne @080819B0 @080819A2: movs r0, 0x1 b @080819B2 .align 2, 0 .pool @080819B0: movs r0, 0 @080819B2: pop {r4,r5} pop {r1} bx r1 thumb_func_end help_system_is_not_first_time thumb_func_start sub_80819B8 sub_80819B8: ; 80819B8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x14 mov r10, r0 lsls r2, 24 lsrs r2, 24 str r2, [sp, 0x10] lsls r3, 24 lsrs r3, 24 mov r2, sp movs r4, 0x5 @080819D4: ldrh r0, [r1] strh r0, [r2] adds r1, 0x2 adds r2, 0x2 subs r4, 0x1 cmp r4, 0 bge @080819D4 movs r6, 0 mov r1, sp movs r4, 0x4 @080819E8: movs r2, 0 ldrsh r0, [r1, r2] cmp r0, 0 bne @080819F2 adds r6, 0x1 @080819F2: adds r1, 0x2 subs r4, 0x1 cmp r4, 0 bge @080819E8 cmp r6, 0x5 beq @08081A46 cmp r3, 0x3 bhi @08081A46 movs r4, 0 ldr r3, [sp, 0x10] cmp r4, r3 bge @08081A5E mov r3, r10 @08081A0C: movs r6, 0 ldr r7, [sp, 0x10] cmp r6, r7 bge @08081A54 mov r9, r3 mov r5, r10 lsls r0, r4, 24 mov r8, r0 @08081A1C: mov r1, r9 ldrh r0, [r1] ldrh r2, [r5] cmp r0, r2 bne @08081A4A cmp r4, r6 beq @08081A4A cmp r0, 0xAF bne @08081A46 lsls r2, r6, 24 lsrs r2, 24 mov r0, r10 mov r7, r8 lsrs r1, r7, 24 str r3, [sp, 0xC] bl help_system_is_not_first_time lsls r0, 24 ldr r3, [sp, 0xC] cmp r0, 0 beq @08081A4A @08081A46: movs r0, 0xC b @08081B9E @08081A4A: adds r5, 0x10 adds r6, 0x1 ldr r0, [sp, 0x10] cmp r6, r0 blt @08081A1C @08081A54: adds r3, 0x10 adds r4, 0x1 ldr r1, [sp, 0x10] cmp r4, r1 blt @08081A0C @08081A5E: movs r2, 0 mov r1, sp movs r4, 0x4 @08081A64: movs r3, 0 ldrsh r0, [r1, r3] cmp r0, 0 ble @08081A72 adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 @08081A72: adds r1, 0x2 subs r4, 0x1 cmp r4, 0 bge @08081A64 cmp r2, 0x3 bls @08081A82 movs r0, 0xD b @08081B9E @08081A82: cmp r2, 0x3 bne @08081A8A movs r0, 0xB b @08081B9E @08081A8A: movs r4, 0 mov r1, sp @08081A8E: movs r7, 0 ldrsh r0, [r1, r7] cmp r0, 0x32 ble @08081A98 b @08081B98 @08081A98: adds r1, 0x2 adds r4, 0x1 cmp r4, 0x4 ble @08081A8E cmp r2, 0x1 bne @08081AEA mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 ble @08081AB2 movs r0, 0x1 b @08081B9E @08081AB2: mov r0, sp ldrh r0, [r0, 0x2] lsls r0, 16 cmp r0, 0 ble @08081AC0 movs r0, 0x2 b @08081B9E @08081AC0: mov r0, sp movs r3, 0x4 ldrsh r0, [r0, r3] cmp r0, 0 ble @08081ACE movs r0, 0x3 b @08081B9E @08081ACE: mov r0, sp movs r4, 0x6 ldrsh r0, [r0, r4] cmp r0, 0 ble @08081ADC movs r0, 0x4 b @08081B9E @08081ADC: mov r0, sp movs r7, 0x8 ldrsh r0, [r0, r7] cmp r0, 0 ble @08081AEA movs r0, 0x5 b @08081B9E @08081AEA: cmp r2, 0x2 bne @08081B9C movs r4, 0 ldr r5, =0x03000df8 mov r1, sp adds r2, r5, 0 @08081AF6: movs r3, 0 ldrsh r0, [r1, r3] cmp r0, 0 ble @08081B02 strh r4, [r2] adds r2, 0x2 @08081B02: adds r1, 0x2 adds r4, 0x1 cmp r4, 0x4 ble @08081AF6 movs r4, 0 ldrsh r3, [r5, r4] lsls r0, r3, 1 mov r7, sp adds r1, r7, r0 movs r0, 0x2 ldrsh r2, [r5, r0] lsls r0, r2, 1 add r0, sp movs r4, 0 ldrsh r1, [r1, r4] movs r7, 0 ldrsh r0, [r0, r7] cmp r1, r0 blt @08081B58 adds r0, r3, 0 cmp r0, 0 bne @08081B38 lsls r0, r2, 16 b @08081B62 .align 2, 0 .pool @08081B38: cmp r0, 0x1 bne @08081B40 lsls r0, r2, 16 b @08081B6E @08081B40: cmp r0, 0x2 bne @08081B48 lsls r0, r2, 16 b @08081B7A @08081B48: cmp r0, 0x3 bne @08081B50 lsls r0, r2, 16 b @08081B86 @08081B50: cmp r0, 0x4 bne @08081B9C lsls r0, r2, 16 b @08081B92 @08081B58: movs r2, 0x2 ldrsh r0, [r5, r2] cmp r0, 0 bne @08081B68 lsls r0, r3, 16 @08081B62: movs r1, 0x6 orrs r0, r1 b @08081B9E @08081B68: cmp r0, 0x1 bne @08081B74 lsls r0, r3, 16 @08081B6E: movs r1, 0x7 orrs r0, r1 b @08081B9E @08081B74: cmp r0, 0x2 bne @08081B80 lsls r0, r3, 16 @08081B7A: movs r1, 0x8 orrs r0, r1 b @08081B9E @08081B80: cmp r0, 0x3 bne @08081B8C lsls r0, r3, 16 @08081B86: movs r1, 0x9 orrs r0, r1 b @08081B9E @08081B8C: cmp r0, 0x4 bne @08081B9C lsls r0, r3, 16 @08081B92: movs r1, 0xA orrs r0, r1 b @08081B9E @08081B98: movs r0, 0xE b @08081B9E @08081B9C: movs r0, 0 @08081B9E: add sp, 0x14 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80819B8 thumb_func_start sub_8081BB0 sub_8081BB0: ; 8081BB0 ldr r1, =0x03000e04 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8081BB0 thumb_func_start sub_8081BBC sub_8081BBC: ; 8081BBC ldr r0, =0x03000e04 movs r1, 0 ldrsh r0, [r0, r1] bx lr .align 2, 0 .pool thumb_func_end sub_8081BBC thumb_func_start sub_8081BC8 sub_8081BC8: ; 8081BC8 ldr r1, =0x03000e06 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8081BC8 thumb_func_start sub_8081BD4 sub_8081BD4: ; 8081BD4 ldr r0, =0x03000e06 movs r1, 0 ldrsh r0, [r0, r1] bx lr .align 2, 0 .pool thumb_func_end sub_8081BD4 thumb_func_start sub_8081BE0 sub_8081BE0: ; 8081BE0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 str r0, [sp] mov r8, r1 str r3, [sp, 0x4] ldr r0, [sp, 0x30] lsls r2, 24 lsrs r2, 24 mov r9, r2 lsls r0, 16 lsrs r0, 16 str r0, [sp, 0x8] ldr r7, =0x03000de8 adds r2, r7, 0 movs r1, 0 adds r0, r7, 0 adds r0, 0xA @08081C0A: strh r1, [r0] subs r0, 0x2 cmp r0, r2 bge @08081C0A movs r6, 0 cmp r6, r9 bge @08081C40 ldr r0, =0x03000de8 mov r12, r0 ldr r5, [sp] adds r5, 0x9 @08081C20: movs r3, 0 adds r4, r5, 0 mov r2, r12 @08081C26: adds r1, r4, r3 ldrh r0, [r2] ldrb r1, [r1] adds r0, r1 strh r0, [r2] adds r2, 0x2 adds r3, 0x1 cmp r3, 0x5 ble @08081C26 adds r5, 0x10 adds r6, 0x1 cmp r6, r9 blt @08081C20 @08081C40: movs r1, 0 ldrsh r3, [r7, r1] ldrh r0, [r7] ldrh r1, [r7, 0x2] subs r0, r1 strh r0, [r7] ldrh r0, [r7, 0x4] subs r1, r0 strh r1, [r7, 0x2] ldrh r1, [r7, 0x6] subs r0, r1 strh r0, [r7, 0x4] ldrh r0, [r7, 0x8] subs r1, r0 strh r1, [r7, 0x6] subs r0, r3 strh r0, [r7, 0x8] movs r3, 0 movs r2, 0 adds r1, r7, 0 movs r6, 0x4 @08081C6A: movs r4, 0 ldrsh r0, [r1, r4] cmp r0, 0 bge @08081C76 strh r2, [r1] adds r3, 0x1 @08081C76: adds r1, 0x2 subs r6, 0x1 cmp r6, 0 bge @08081C6A lsls r0, r3, 24 lsrs r0, 24 mov r10, r0 movs r4, 0 ldr r1, =0x03000de8 movs r6, 0x4 @08081C8A: ldrh r2, [r1] movs r5, 0 ldrsh r0, [r1, r5] cmp r0, 0 ble @08081CA4 cmp r0, r3 bge @08081CA0 strh r4, [r1] b @08081CA4 .align 2, 0 .pool @08081CA0: subs r0, r2, r3 strh r0, [r1] @08081CA4: adds r1, 0x2 subs r6, 0x1 cmp r6, 0 bge @08081C8A ldr r1, =0x03000de8 ldr r2, =0x020322a8 movs r6, 0x4 @08081CB2: movs r3, 0 ldrsh r0, [r1, r3] stm r2!, {r0} adds r1, 0x2 subs r6, 0x1 cmp r6, 0 bge @08081CB2 ldr r1, =0x0000014d ldr r0, [sp, 0x8] bl __udivsi3 lsls r0, 16 lsrs r0, 16 adds r3, r0, 0 adds r3, 0x64 ldr r4, =0x020322d0 str r3, [r4] movs r6, 0x4 @08081CD6: movs r0, 0 ldrsh r5, [r7, r0] adds r0, r5, 0 muls r0, r3 movs r1, 0xA str r3, [sp, 0xC] bl __divsi3 adds r5, r0, 0 movs r1, 0xA bl __modsi3 adds r4, r0, 0 adds r0, r5, 0 movs r1, 0xA bl __divsi3 adds r5, r0, 0 ldr r3, [sp, 0xC] cmp r4, 0x4 ble @08081D02 adds r5, 0x1 @08081D02: strh r5, [r7] adds r7, 0x2 subs r6, 0x1 cmp r6, 0 bge @08081CD6 ldr r1, =0x03000de8 ldr r2, =0x020322bc movs r6, 0x4 @08081D12: movs r3, 0 ldrsh r0, [r1, r3] stm r2!, {r0} adds r1, 0x2 subs r6, 0x1 cmp r6, 0 bge @08081D12 ldr r4, =0x03000de8 ldr r0, [sp] adds r1, r4, 0 mov r2, r9 mov r3, r10 bl sub_80819B8 mov r5, r8 strb r0, [r5] movs r1, 0xA ldrsh r0, [r4, r1] mov r1, r9 bl __divsi3 mov r3, r9 subs r0, r3 strh r0, [r4, 0xA] lsls r0, 16 cmp r0, 0 bge @08081D4C movs r0, 0 strh r0, [r4, 0xA] @08081D4C: mov r5, r8 ldrb r0, [r5] cmp r0, 0xC bne @08081DA6 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0xA bl __umodsi3 lsls r0, 16 lsrs r3, r0, 16 movs r6, 0 ldr r0, =gUnknown_08339CC8 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0 movs r4, 0x1 movs r3, 0x2 @08081D74: adds r2, r0, 0 asrs r2, r6 ands r2, r4 cmp r2, 0 beq @08081D9C strh r3, [r1] b @08081D9E .align 2, 0 .pool @08081D9C: strh r2, [r1] @08081D9E: adds r1, 0x2 adds r6, 0x1 cmp r6, 0x4 ble @08081D74 @08081DA6: ldr r7, =0x03000de8 movs r2, 0xFF adds r1, r7, 0 movs r6, 0x5 @08081DAE: movs r3, 0 ldrsh r0, [r1, r3] cmp r0, 0xFF ble @08081DB8 strh r2, [r1] @08081DB8: adds r1, 0x2 subs r6, 0x1 cmp r6, 0 bge @08081DAE ldrh r0, [r7] mov r4, r8 strb r0, [r4, 0x1] ldrh r0, [r7, 0x2] strb r0, [r4, 0x2] ldrh r0, [r7, 0x4] strb r0, [r4, 0x3] ldrh r0, [r7, 0x6] strb r0, [r4, 0x4] ldrh r0, [r7, 0x8] strb r0, [r4, 0x5] ldrh r0, [r7, 0xA] strb r0, [r4, 0x6] movs r6, 0 adds r2, r7, 0 @08081DDE: ldr r5, [sp, 0x4] adds r1, r5, r6 ldrh r0, [r2] strb r0, [r1] adds r2, 0x2 adds r6, 0x1 cmp r6, 0x5 ble @08081DDE add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8081BE0 thumb_func_start sub_8081E04 sub_8081E04: ; 8081E04 push {r4,lr} sub sp, 0x4 ldr r4, [sp, 0xC] lsls r2, 24 lsrs r2, 24 lsls r4, 16 lsrs r4, 16 str r4, [sp] bl sub_8081BE0 add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end sub_8081E04 thumb_func_start sub_8081E20 sub_8081E20: ; 8081E20 push {r4-r6,lr} ldr r0, =0x020322a4 ldr r0, [r0] movs r2, 0x82 lsls r2, 1 adds r1, r0, r2 ldrh r1, [r1] adds r0, 0x4E ldrh r4, [r0] movs r2, 0 ldr r5, =0x00000383 cmp r1, r5 bhi @08081E48 movs r2, 0x5 b @08081E9A .align 2, 0 .pool @08081E48: ldr r3, =0xfffffc7c adds r0, r1, r3 lsls r0, 16 lsrs r0, 16 ldr r3, =0x00000257 cmp r0, r3 bhi @08081E64 movs r2, 0x4 b @08081E9A .align 2, 0 .pool @08081E64: ldr r6, =0xfffffa24 adds r0, r1, r6 lsls r0, 16 lsrs r0, 16 cmp r0, r3 bhi @08081E78 movs r2, 0x3 b @08081E9A .align 2, 0 .pool @08081E78: ldr r3, =0xfffff7cc adds r0, r1, r3 lsls r0, 16 lsrs r0, 16 cmp r0, r5 bhi @08081E8C movs r2, 0x2 b @08081E9A .align 2, 0 .pool @08081E8C: ldr r6, =0xfffff31c adds r0, r1, r6 lsls r0, 16 ldr r1, =0x012b0000 cmp r0, r1 bhi @08081E9A movs r2, 0x1 @08081E9A: lsls r0, r2, 16 asrs r0, 16 bl sub_8081BC8 movs r2, 0 cmp r4, 0x40 bhi @08081F7C adds r0, r4, 0 subs r0, 0x32 lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bhi @08081EC4 ldr r2, =0x0000ffff b @08081F7C .align 2, 0 .pool @08081EC4: adds r0, r4, 0 subs r0, 0x64 lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bhi @08081ED8 ldr r2, =0x0000fffe b @08081F7C .align 2, 0 .pool @08081ED8: adds r0, r4, 0 subs r0, 0x96 lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bhi @08081EEC ldr r2, =0x0000fffd b @08081F7C .align 2, 0 .pool @08081EEC: adds r0, r4, 0 subs r0, 0xC8 lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bhi @08081F00 ldr r2, =0x0000fffc b @08081F7C .align 2, 0 .pool @08081F00: adds r0, r4, 0 subs r0, 0xFA lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bhi @08081F14 ldr r2, =0x0000fffb b @08081F7C .align 2, 0 .pool @08081F14: ldr r1, =0xfffffea2 adds r0, r4, r1 lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bhi @08081F2C ldr r2, =0x0000fffa b @08081F7C .align 2, 0 .pool @08081F2C: ldr r3, =0xfffffe70 adds r0, r4, r3 lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bhi @08081F44 ldr r2, =0x0000fff9 b @08081F7C .align 2, 0 .pool @08081F44: ldr r6, =0xfffffe0c adds r0, r4, r6 lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bhi @08081F5C ldr r2, =0x0000fff8 b @08081F7C .align 2, 0 .pool @08081F5C: ldr r1, =0xfffffdda adds r0, r4, r1 lsls r0, 16 lsrs r0, 16 cmp r0, 0x31 bhi @08081F74 ldr r2, =0x0000fff7 b @08081F7C .align 2, 0 .pool @08081F74: ldr r0, =0x00000257 cmp r4, r0 bls @08081F7C ldr r2, =0x0000fff6 @08081F7C: lsls r0, r2, 16 asrs r0, 16 bl sub_8081BB0 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8081E20 thumb_func_start sub_8081F94 sub_8081F94: ; 8081F94 push {lr} adds r1, r0, 0 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08081FB8 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08081FB8 movs r2, 0xBC lsls r2, 6 b @08081FBA .align 2, 0 .pool @08081FB8: ldr r2, =0x00002fff @08081FBA: adds r0, r2, 0 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8081F94 thumb_func_start sub_8081FC8 sub_8081FC8: ; 8081FC8 push {r4-r7,lr} mov r7, r8 push {r7} ldr r4, =0x020322a4 ldr r0, [r4] adds r0, 0x63 ldrb r0, [r0] cmp r0, 0x2 bhi @08081FDE bl sub_8082D28 @08081FDE: bl link_get_multiplayer_id ldr r0, [r4] adds r0, 0x63 ldrb r0, [r0] subs r0, 0x1 cmp r0, 0xC bls @08081FF0 b @0808249E @08081FF0: lsls r0, 2 ldr r1, =@08082004 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08082004: .4byte @08082038 .4byte @08082078 .4byte @080820D4 .4byte @080821C8 .4byte @08082278 .4byte @08082286 .4byte @080822B0 .4byte @08082458 .4byte @080822E4 .4byte @08082308 .4byte @080823B0 .4byte @08082430 .4byte @0808246C @08082038: ldr r0, =0x03007420 movs r1, 0x80 lsls r1, 1 bl MPlayTempoControl movs r4, 0 b @08082064 .align 2, 0 .pool @0808204C: ldr r0, =0x020322a4 ldr r0, [r0] movs r1, 0x90 lsls r1, 1 adds r0, r1 adds r0, r4 ldrb r0, [r0] bl remove_task adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @08082064: ldr r0, =0x020375e0 ldrh r0, [r0] cmp r4, r0 bcc @0808204C b @08082458 .align 2, 0 .pool @08082078: ldr r4, =0x020322a4 ldr r1, [r4] adds r1, 0x4C ldrh r0, [r1] subs r0, 0x20 strh r0, [r1] lsls r0, 16 cmp r0, 0 bgt @080820C6 bl sub_8009F8C ldr r2, [r4] adds r1, r2, 0 adds r1, 0x4C movs r0, 0 strh r0, [r1] ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080820B0 adds r1, 0x17 ldrb r0, [r1] adds r0, 0x1 b @080820B6 .align 2, 0 .pool @080820B0: adds r1, r2, 0 adds r1, 0x63 movs r0, 0x5 @080820B6: strb r0, [r1] ldr r0, =0x020322a4 ldr r1, [r0] movs r0, 0 strb r0, [r1] ldr r0, =0x03007630 bl MPlayStop_rev01 @080820C6: bl sub_807F738 b @0808249E .align 2, 0 .pool @080820D4: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 beq @080820E0 b @08082458 @080820E0: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @080820EC b @0808249E @080820EC: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @0808218C ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @0808218C ldr r3, =0x020322a4 ldr r1, [r3] movs r4, 0x8E lsls r4, 5 adds r2, r1, r4 movs r5, 0x82 lsls r5, 1 adds r0, r1, r5 ldr r0, [r0] str r0, [r2] adds r0, r1, 0 adds r0, 0x4E ldrh r0, [r0] ldr r2, =0x000011c4 adds r1, r2 strh r0, [r1] movs r4, 0 mov r8, r3 mov r12, r8 ldr r7, =0x000011c8 movs r6, 0x92 lsls r6, 1 @08082128: movs r3, 0 adds r5, r4, 0x1 lsls r0, r4, 1 adds r0, r4 lsls r4, r0, 1 @08082132: mov r1, r12 ldr r0, [r1] lsls r1, r3, 1 adds r1, r4 adds r2, r0, r7 adds r2, r1 adds r0, r6 adds r0, r1 ldrh r0, [r0] strh r0, [r2] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x2 bls @08082132 lsls r0, r5, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @08082128 mov r2, r8 ldr r1, [r2] movs r4, 0x8E lsls r4, 5 adds r1, r4 movs r0, 0 movs r2, 0x20 bl link_0800A448 lsls r0, 24 cmp r0, 0 bne @08082172 b @0808249E @08082172: mov r5, r8 ldr r1, [r5] b @0808245C .align 2, 0 .pool @0808218C: ldr r4, =0x020322a4 ldr r3, [r4] movs r0, 0xCC lsls r0, 1 adds r1, r3, r0 movs r2, 0x82 lsls r2, 1 adds r0, r3, r2 ldr r0, [r0] str r0, [r1] adds r0, r3, 0 adds r0, 0x4E ldrh r2, [r0] movs r5, 0xCE lsls r5, 1 adds r0, r3, r5 strh r2, [r0] movs r0, 0 movs r2, 0x28 bl link_0800A448 lsls r0, 24 cmp r0, 0 bne @080821BE b @0808249E @080821BE: ldr r1, [r4] b @0808245C .align 2, 0 .pool @080821C8: bl sub_800A550 lsls r0, 24 cmp r0, 0 bne @080821D4 b @0808249E @080821D4: bl sub_800A5B4 ldr r5, =0x020322a4 ldr r1, [r5] adds r1, 0x63 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08082254 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08082254 ldr r2, =0x020223c4 ldr r3, [r5] ldrh r0, [r2, 0x4] adds r1, r3, 0 adds r1, 0x4E strh r0, [r1] movs r0, 0x82 lsls r0, 1 adds r1, r3, r0 ldr r0, [r2] str r0, [r1] movs r4, 0 adds r7, r2, 0 adds r7, 0x8 adds r6, r5, 0 movs r2, 0x92 lsls r2, 1 @08082216: movs r3, 0 adds r5, r4, 0x1 lsls r0, r4, 1 adds r0, r4 lsls r4, r0, 1 @08082220: ldr r1, [r6] lsls r0, r3, 1 adds r0, r4 adds r1, r2 adds r1, r0 adds r0, r7, r0 ldrh r0, [r0] strh r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x2 bls @08082220 lsls r0, r5, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @08082216 b @0808249E .align 2, 0 .pool @08082254: ldr r2, =0x020223c4 ldr r0, =0x020322a4 ldr r3, [r0] ldrh r0, [r2, 0x4] adds r1, r3, 0 adds r1, 0x4E strh r0, [r1] movs r4, 0x82 lsls r4, 1 adds r1, r3, r4 ldr r0, [r2] str r0, [r1] b @0808249E .align 2, 0 .pool @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, =0x03005d98 ldrb r0, [r0] cmp r0, 0 bne @080822A8 movs r0, 0x22 bl sav12_xor_increment b @08082458 .align 2, 0 .pool @080822A8: movs r0, 0x21 bl sav12_xor_increment b @08082458 @080822B0: ldr r6, =0x020322a4 ldr r4, [r6] ldr r5, =0x000011b8 adds r4, r5 ldr r5, =gUnknown_08339831 bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 bl sub_808417C cmp r0, 0 bne @080822D2 b @0808249E @080822D2: ldr r1, [r6] b @0808245C .align 2, 0 .pool @080822E4: ldr r4, =0x020322a4 ldr r0, [r4] adds r0, 0x9E movs r1, 0 strb r1, [r0] ldr r0, =gUnknown_083399B8 movs r1, 0x1 movs r2, 0xD movs r3, 0 bl sub_81996C0 ldr r1, [r4] b @0808245C .align 2, 0 .pool @08082308: bl sub_8198C58 lsls r0, 24 asrs r2, r0, 24 cmp r2, 0 beq @0808236C cmp r2, 0 bgt @08082322 movs r0, 0x1 negs r0, r0 cmp r2, r0 beq @08082328 b @0808249E @08082322: cmp r2, 0x1 beq @08082328 b @0808249E @08082328: ldr r2, =0x020322a4 ldr r0, [r2] adds r0, 0x9E movs r1, 0x1 strb r1, [r0] ldr r1, [r2] adds r1, 0x63 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r4, 0 @0808233E: ldr r0, =0x020322a4 ldr r0, [r0] lsls r1, r4, 1 adds r0, 0x8E adds r0, r1 ldrh r0, [r0] cmp r0, 0xFF beq @0808235C adds r0, r4, 0 bl 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 .pool @0808236C: ldr r1, =0x020322a4 ldr r0, [r1] adds r0, 0x9E strb r2, [r0] ldr r1, [r1] adds r1, 0x63 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r4, 0 @08082380: ldr r0, =0x020322a4 ldr r0, [r0] lsls r1, r4, 1 adds r0, 0x8E adds r0, r1 ldrh r0, [r0] cmp r0, 0xFF beq @0808239E adds r0, r4, 0 bl 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 .pool @080823B0: ldr r6, =0x03003110 adds r0, r6, 0 bl sub_8081F94 ldr r4, =0x020322a4 ldr r2, [r4] adds r0, r2, 0 adds r0, 0x9E ldrb r5, [r0] cmp r5, 0 bne @0808241C movs r0, 0x4 bl sub_80D66EC lsls r0, 24 cmp r0, 0 bne @080823EC ldr r0, [r4] adds r0, 0x70 movs r1, 0x2 strh r1, [r0] ldr r0, =0x00009999 b @08082414 .align 2, 0 .pool @080823EC: bl sub_8136EF4 lsls r0, 24 asrs r0, 24 movs r1, 0x1 negs r1, r1 cmp r0, r1 bne @0808240C ldr r0, [r4] adds r0, 0x70 movs r1, 0x3 strh r1, [r0] ldr r0, =0x0000aaaa b @08082414 .align 2, 0 .pool @0808240C: ldr r0, [r4] adds r0, 0x70 strh r5, [r0] ldr r0, =0x00007779 @08082414: strh r0, [r6, 0x2] b @08082458 .align 2, 0 .pool @0808241C: adds r1, r2, 0 adds r1, 0x70 movs r0, 0x1 strh r0, [r1] ldr r0, =0x00008888 strh r0, [r6, 0x2] subs r1, 0xD b @0808245E .align 2, 0 .pool @08082430: ldr r0, =0x03005d98 ldrb r0, [r0] cmp r0, 0 beq @08082458 ldr r0, =sub_8082924 bl set_callback2 ldr r2, =0x020322a4 ldr r0, [r2] adds r0, 0x63 movs r1, 0 strb r1, [r0] ldr r0, [r2] b @0808249C .align 2, 0 .pool @08082458: ldr r0, =0x020322a4 ldr r1, [r0] @0808245C: adds r1, 0x63 @0808245E: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0808249E .align 2, 0 .pool @0808246C: ldr r6, =0x020322a4 ldr r4, [r6] ldr r0, =0x000011b8 adds r4, r0 ldr r5, =gUnknown_0833981A bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 bl sub_808417C cmp r0, 0 beq @0808249E ldr r0, =sub_8082644 bl 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, =0x020322a4 ldr r0, [r4] adds r0, 0x4C ldrh r0, [r0] bl sub_8083230 bl sub_8082AD4 ldr r1, [r4] movs r2, 0x8E lsls r2, 1 adds r0, r1, r2 movs r4, 0 ldrsh r0, [r0, r4] movs r5, 0x8F lsls r5, 1 adds r1, r5 movs r2, 0 ldrsh r1, [r1, r2] bl nullsub_31 bl 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 .pool thumb_func_end sub_8081FC8 thumb_func_start sub_80824FC sub_80824FC: ; 80824FC push {r4,lr} ldr r1, =0x020322a4 ldr r0, [r1] movs r2, 0xD0 lsls r2, 1 adds r0, r2 ldr r0, [r0] adds r4, r1, 0 cmp r0, 0x6 bls @08082512 b @0808263C @08082512: lsls r0, 2 ldr r1, =@08082524 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08082524: .4byte @08082540 .4byte @08082558 .4byte @08082584 .4byte @08082594 .4byte @080825BA .4byte @08082600 .4byte @0808261A @08082540: bl sub_800ADF8 ldr r0, =0x020322a4 ldr r2, [r0] movs r3, 0xD0 lsls r3, 1 adds r1, r2, r3 movs r0, 0x1 b @0808260C .align 2, 0 .pool @08082558: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0808263C ldr r0, =0x020322a4 ldr r1, [r0] movs r2, 0xD0 lsls r2, 1 adds r1, r2 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r1, =0x03002700 movs r0, 0x1 strb r0, [r1] b @0808263C .align 2, 0 .pool @08082584: bl sub_8153430 ldr r0, =0x020322a4 ldr r2, [r0] b @08082602 .align 2, 0 .pool @08082594: ldr r1, [r4] movs r2, 0x84 lsls r2, 1 adds r1, r2 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0xA bne @0808263C bl sub_800ADF8 ldr r1, [r4] movs r3, 0xD0 lsls r3, 1 adds r1, r3 ldr r0, [r1] adds r0, 0x1 str r0, [r1] b @0808263C @080825BA: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @0808263C bl sub_8153474 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 beq @080825E4 ldr r0, =0x020322a4 ldr r0, [r0] movs r1, 0xD0 lsls r1, 1 adds r0, r1 movs r1, 0x5 str r1, [r0] b @0808263C .align 2, 0 .pool @080825E4: ldr r0, =0x020322a4 ldr r1, [r0] movs r3, 0x84 lsls r3, 1 adds r0, r1, r3 str r2, [r0] movs r0, 0xD0 lsls r0, 1 adds r1, r0 movs r0, 0x3 str r0, [r1] b @0808263C .align 2, 0 .pool @08082600: ldr r2, [r4] @08082602: movs r3, 0xD0 lsls r3, 1 adds r1, r2, r3 ldr r0, [r1] adds r0, 0x1 @0808260C: str r0, [r1] movs r0, 0x84 lsls r0, 1 adds r1, r2, r0 movs r0, 0 str r0, [r1] b @0808263C @0808261A: ldr r1, [r4] movs r2, 0x84 lsls r2, 1 adds r1, r2 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x5 ble @0808263C ldr r1, =0x03002700 movs r0, 0 strb r0, [r1] movs r0, 0x1 b @0808263E .align 2, 0 .pool @0808263C: movs r0, 0 @0808263E: pop {r4} pop {r1} bx r1 thumb_func_end sub_80824FC thumb_func_start sub_8082644 sub_8082644: ; 8082644 push {r4-r6,lr} sub sp, 0x4 ldr r1, =0x020322a4 ldr r0, [r1] adds r0, 0x63 ldrb r0, [r0] adds r6, r1, 0 cmp r0, 0xC bls @08082658 b @080828DC @08082658: lsls r0, 2 ldr r1, =@0808266C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0808266C: .4byte @080826A0 .4byte @080826EC .4byte @0808271C .4byte @08082754 .4byte @0808278C .4byte @080827AA .4byte @080827C8 .4byte @080827FC .4byte @08082818 .4byte @08082828 .4byte @0808284C .4byte @080828A4 .4byte @080828C6 @080826A0: ldr r1, [r6] adds r0, r1, 0 adds r0, 0x64 ldrh r2, [r0] ldr r0, =0x00002222 cmp r2, r0 bne @080826B0 b @080827A2 @080826B0: ldr r0, =0x00001111 cmp r2, r0 beq @080826B8 b @080828DC @080826B8: adds r0, r1, 0 adds r0, 0x6C ldrh r2, [r0] ldr r0, =0x00009999 cmp r2, r0 bne @080826D8 adds r1, 0x63 movs r0, 0x2 strb r0, [r1] b @080828DC .align 2, 0 .pool @080826D8: ldr r0, =0x0000aaaa cmp r2, r0 bne @080827A2 adds r1, 0x63 movs r0, 0x1 strb r0, [r1] b @080828DC .align 2, 0 .pool @080826EC: ldr r0, [r6] adds r0, 0x63 movs r1, 0x3 strb r1, [r0] ldr r4, =0x02021fc4 ldr r0, [r6] adds r0, 0x6E ldrh r0, [r0] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r0, =0x020229f0 adds r1, r0 adds r0, r4, 0 bl gf_strcpy ldr r1, =gUnknown_083398DD b @08082740 .align 2, 0 .pool @0808271C: ldr r1, [r6] adds r1, 0x63 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r4, =0x02021fc4 ldr r0, [r6] adds r0, 0x6E ldrh r0, [r0] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r0, =0x020229f0 adds r1, r0 adds r0, r4, 0 bl gf_strcpy ldr r1, =gUnknown_083398B0 @08082740: adds r0, r4, 0 bl gf_strcat b @080828DC .align 2, 0 .pool @08082754: ldr r4, [r6] ldr r0, =0x000011b8 adds r4, r0 ldr r5, =0x02021fc4 bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 bl sub_808417C cmp r0, 0 bne @08082774 b @080828DC @08082774: ldr r1, [r6] movs r0, 0x84 lsls r0, 1 adds r2, r1, r0 movs r0, 0 str r0, [r2] b @080828BC .align 2, 0 .pool @0808278C: ldr r4, [r6] movs r2, 0x84 lsls r2, 1 adds r1, r4, r2 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x3C bgt @080827A0 b @080828DC @080827A0: adds r1, r4, 0 @080827A2: adds r1, 0x63 movs r0, 0x5 strb r0, [r1] b @080828DC @080827AA: ldr r0, [r6] ldr r1, =0x000011b8 adds r0, r1 ldr r1, =gUnknown_085EE42D movs r2, 0 bl sub_808417C bl sub_800ADF8 b @080828BA .align 2, 0 .pool @080827C8: bl sub_800A520 lsls r0, 24 cmp r0, 0 bne @080827D4 b @080828DC @080827D4: ldr r3, =0x020322a4 ldr r1, [r3] movs r2, 0x84 lsls r2, 1 adds r0, r1, r2 movs r2, 0 str r2, [r0] adds r1, 0x63 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r3] movs r1, 0xD0 lsls r1, 1 adds r0, r1 str r2, [r0] b @080828DC .align 2, 0 .pool @080827FC: bl sub_80824FC lsls r0, 24 cmp r0, 0 beq @080828DC movs r0, 0x37 bl audio_play ldr r0, =0x020322a4 ldr r1, [r0] b @080828BC .align 2, 0 .pool @08082818: ldr r1, [r6] adds r1, 0x63 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] bl sub_800ADF8 b @080828DC @08082828: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080828DC movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x020322a4 ldr r1, [r0] b @080828BC .align 2, 0 .pool @0808284C: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @080828DC ldr r2, [r6] adds r0, r2, 0 adds r0, 0x64 ldrh r1, [r0] ldr r0, =0x00002222 cmp r1, r0 bne @08082898 bl 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, =sub_807FA80 bl set_callback2 b @080828DC .align 2, 0 .pool @08082898: movs r1, 0x84 lsls r1, 1 adds r0, r2, r1 str r4, [r0] adds r1, r2, 0 b @080828BC @080828A4: ldr r1, [r6] movs r2, 0x84 lsls r2, 1 adds r1, r2 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x1E ble @080828DC bl sub_800AC34 @080828BA: ldr r1, [r6] @080828BC: adds r1, 0x63 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080828DC @080828C6: ldr r0, =0x03003124 ldrb r4, [r0] cmp r4, 0 bne @080828DC ldr r0, [r6] bl free str r4, [r6] ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 @080828DC: bl sub_8082AD4 ldr r0, =0x020322a4 ldr r1, [r0] movs r2, 0x8E lsls r2, 1 adds r0, r1, r2 movs r2, 0 ldrsh r0, [r0, r2] movs r2, 0x8F lsls r2, 1 adds r1, r2 movs r2, 0 ldrsh r1, [r1, r2] bl nullsub_31 bl 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 .pool thumb_func_end sub_8082644 thumb_func_start sub_8082924 sub_8082924: ; 8082924 push {r4-r6,lr} ldr r1, =0x020322a4 ldr r0, [r1] adds r0, 0x63 ldrb r0, [r0] adds r6, r1, 0 cmp r0, 0xA bls @08082936 b @08082A92 @08082936: lsls r0, 2 ldr r1, =@08082948 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08082948: .4byte @08082974 .4byte @080829AA .4byte @080829D4 .4byte @08082A00 .4byte @08082A92 .4byte @08082A92 .4byte @08082A92 .4byte @08082A92 .4byte @08082A92 .4byte @08082A30 .4byte @08082A48 @08082974: ldr r1, [r6] adds r0, r1, 0 adds r0, 0x70 ldrh r0, [r0] cmp r0, 0x1 bhi @08082986 adds r1, 0x63 movs r0, 0x9 strb r0, [r1] @08082986: ldr r2, [r6] adds r0, r2, 0 adds r0, 0x70 ldrh r1, [r0] cmp r1, 0x2 bne @08082996 subs r0, 0xD strb r1, [r0] @08082996: ldr r1, [r6] adds r0, r1, 0 adds r0, 0x70 ldrh r0, [r0] cmp r0, 0x3 bne @08082A92 adds r1, 0x63 movs r0, 0x1 strb r0, [r1] b @08082A92 @080829AA: ldr r0, [r6] adds r0, 0x63 movs r2, 0 movs r1, 0x3 strb r1, [r0] ldr r0, [r6] ldr r1, =0x000011b8 adds r0, r1 strh r2, [r0] ldr r0, =0x02021fc4 ldr r1, =gUnknown_08339896 bl gf_strcpy b @08082A92 .align 2, 0 .pool @080829D4: ldr r1, [r6] adds r1, 0x63 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] ldr r0, [r6] ldr r1, =0x000011b8 adds r0, r1 strh r2, [r0] ldr r0, =0x02021fc4 ldr r1, =gUnknown_08339858 bl gf_strcpy b @08082A92 .align 2, 0 .pool @08082A00: ldr r4, [r6] ldr r2, =0x000011b8 adds r4, r2 ldr r5, =0x02021fc4 bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 bl sub_808417C cmp r0, 0 beq @08082A92 ldr r0, [r6] adds r0, 0x63 movs r1, 0x9 strb r1, [r0] b @08082A92 .align 2, 0 .pool @08082A30: movs r0, 0x3 bl sub_80A2390 ldr r0, =0x020322a4 ldr r1, [r0] adds r1, 0x63 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08082A92 .align 2, 0 .pool @08082A48: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08082A92 ldr r0, [r6] adds r0, 0x70 ldrh r0, [r0] cmp r0, 0 bne @08082A70 ldr r0, =sub_807FA80 bl set_callback2 b @08082A76 .align 2, 0 .pool @08082A70: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 @08082A76: bl Window_FreeMemory movs r0, 0x2 bl bg_unset_tilemap movs r0, 0x1 bl bg_unset_tilemap ldr r4, =0x020322a4 ldr r0, [r4] bl free movs r0, 0 str r0, [r4] @08082A92: bl sub_8082AD4 ldr r0, =0x020322a4 ldr r1, [r0] movs r2, 0x8E lsls r2, 1 adds r0, r1, r2 movs r2, 0 ldrsh r0, [r0, r2] movs r2, 0x8F lsls r2, 1 adds r1, r2 movs r2, 0 ldrsh r1, [r1, r2] bl nullsub_31 bl 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 .pool thumb_func_end sub_8082924 thumb_func_start sub_8082AD4 sub_8082AD4: ; 8082AD4 push {r4-r7,lr} ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08082AE0 b @08082CA4 @08082AE0: ldr r4, =0x03003090 ldrh r0, [r4] ldr r1, =0x00002fff movs r2, 0xBC lsls r2, 6 bl sub_80814B0 cmp r0, 0 beq @08082B66 ldrh r1, [r4, 0x2] ldr r0, =0x00001111 cmp r1, r0 bne @08082B58 ldrh r3, [r4, 0x4] ldr r0, =0x00009999 cmp r3, r0 beq @08082B38 cmp r3, r0 bgt @08082B24 ldr r0, =0x00008888 b @08082B26 .align 2, 0 .pool @08082B24: ldr r0, =0x0000aaaa @08082B26: cmp r3, r0 beq @08082B38 ldr r2, =0x020322a4 b @08082B48 .align 2, 0 .pool @08082B38: ldr r2, =0x020322a4 ldr r0, [r2] adds r1, r0, 0 adds r1, 0x6C strh r3, [r1] ldrh r1, [r4, 0x6] adds r0, 0x6E strh r1, [r0] @08082B48: ldr r0, [r2] adds r0, 0x64 ldr r1, =0x00001111 b @08082B64 .align 2, 0 .pool @08082B58: ldr r0, =0x00002222 cmp r1, r0 bne @08082B66 ldr r0, =0x020322a4 ldr r0, [r0] adds r0, 0x64 @08082B64: strh r1, [r0] @08082B66: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 beq @08082B72 b @08082CA4 @08082B72: ldr r2, =0x020322a4 ldr r0, [r2] adds r0, 0x64 ldrh r1, [r0] ldr r0, =0x00001111 cmp r1, r0 bne @08082B82 b @08082CA4 @08082B82: ldr r0, =0x00002222 cmp r1, r0 bne @08082B8A b @08082CA4 @08082B8A: movs r5, 0 adds r7, r2, 0 b @08082BF4 .align 2, 0 .pool @08082B9C: ldr r6, =0x03003090 lsls r4, r5, 4 adds r0, r4, r6 ldrh r0, [r0] ldr r1, =0x00002fff movs r2, 0xBC lsls r2, 6 bl sub_80814B0 cmp r0, 0 beq @08082BEE adds r0, r6, 0x2 adds r0, r4, r0 ldrh r2, [r0] ldr r0, =0x00008888 cmp r2, r0 beq @08082BE4 cmp r2, r0 bgt @08082BD8 ldr r0, =0x00007779 b @08082BE0 .align 2, 0 .pool @08082BD8: ldr r0, =0x00009999 cmp r2, r0 beq @08082BE4 ldr r0, =0x0000aaaa @08082BE0: cmp r2, r0 bne @08082BEE @08082BE4: ldr r0, [r7] lsls r1, r5, 1 adds r0, 0x64 adds r0, r1 strh r2, [r0] @08082BEE: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @08082BF4: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 bcc @08082B9C movs r5, 0 b @08082C12 .align 2, 0 .pool @08082C0C: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @08082C12: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 bcs @08082C2E ldr r0, =0x020322a4 ldr r0, [r0] lsls r1, r5, 1 adds r0, 0x64 adds r0, r1 ldrh r0, [r0] cmp r0, 0 bne @08082C0C @08082C2E: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 bne @08082CA4 movs r5, 0 ldr r4, =0x00007779 b @08082C4E .align 2, 0 .pool @08082C48: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @08082C4E: bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 bcs @08082C6A ldr r0, =0x020322a4 ldr r0, [r0] lsls r1, r5, 1 adds r0, 0x64 adds r0, r1 ldrh r0, [r0] cmp r0, r4 beq @08082C48 @08082C6A: ldr r4, =0x03003110 adds r0, r4, 0 bl sub_8081F94 bl sub_8009FCC lsls r0, 24 lsrs r0, 24 cmp r5, r0 bne @08082C90 ldr r0, =0x00002222 strh r0, [r4, 0x2] b @08082CA4 .align 2, 0 .pool @08082C90: ldr r0, =0x00001111 strh r0, [r4, 0x2] ldr r0, =0x020322a4 ldr r0, [r0] lsls r1, r5, 1 adds r0, 0x64 adds r0, r1 ldrh r0, [r0] strh r0, [r4, 0x4] strh r5, [r4, 0x6] @08082CA4: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8082AD4 thumb_func_start sub_8082CB4 sub_8082CB4: ; 8082CB4 push {r4,lr} sub sp, 0x14 movs r1, 0xF0 lsls r1, 7 str r1, [sp] movs r1, 0xA0 lsls r1, 7 str r1, [sp, 0x4] mov r3, sp ldr r1, =0x020322a4 ldr r1, [r1] mov r12, r1 movs r1, 0x8E lsls r1, 1 add r1, r12 ldrh r2, [r1] movs r1, 0x78 subs r1, r2 strh r1, [r3, 0x8] movs r1, 0x8F lsls r1, 1 add r1, r12 ldrh r2, [r1] movs r1, 0x50 subs r1, r2 strh r1, [r3, 0xA] mov r2, sp movs r3, 0x8D lsls r3, 1 add r3, r12 ldrh r1, [r3] strh r1, [r2, 0xC] ldrh r1, [r3] strh r1, [r2, 0xE] mov r1, r12 adds r1, 0x4A ldrh r1, [r1] strh r1, [r2, 0x10] mov r1, sp ldm r1!, {r2-r4} stm r0!, {r2-r4} ldm r1!, {r2,r3} stm r0!, {r2,r3} add sp, 0x14 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8082CB4 thumb_func_start sub_8082D18 sub_8082D18: ; 8082D18 ldr r0, =0x020322a4 ldr r0, [r0] adds r0, 0x4A ldrh r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8082D18 thumb_func_start sub_8082D28 sub_8082D28: ; 8082D28 push {r4,lr} movs r1, 0 ldr r4, =0x03003124 ldrb r0, [r4] cmp r0, 0 beq @08082D3C bl link_get_multiplayer_id lsls r0, 24 lsrs r1, r0, 24 @08082D3C: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08082DCC ldrb r0, [r4] cmp r0, 0 beq @08082DCC cmp r1, 0 bne @08082D90 ldr r0, =0x020322a4 ldr r3, [r0] adds r2, r3, 0 adds r2, 0x4A adds r0, r3, 0 adds r0, 0x4C ldrh r0, [r0] ldrh r1, [r2] adds r0, r1 strh r0, [r2] ldr r1, =0x03003110 movs r4, 0x8B lsls r4, 1 adds r0, r3, r4 ldrh r0, [r0] strh r0, [r1, 0xA] ldrh r0, [r2] strh r0, [r1, 0xC] movs r1, 0xA0 lsls r1, 1 adds r0, r3, r1 bl sub_8082CB4 b @08082DEA .align 2, 0 .pool @08082D90: ldr r3, =0x03003090 ldrh r0, [r3] movs r1, 0xFF lsls r1, 8 ands r1, r0 movs r0, 0x88 lsls r0, 7 cmp r1, r0 bne @08082DEA ldr r0, =0x020322a4 ldr r2, [r0] ldrh r0, [r3, 0xA] movs r4, 0x8B lsls r4, 1 adds r1, r2, r4 strh r0, [r1] ldrh r0, [r3, 0xC] adds r1, r2, 0 adds r1, 0x4A strh r0, [r1] movs r1, 0xA0 lsls r1, 1 adds r0, r2, r1 bl sub_8082CB4 b @08082DEA .align 2, 0 .pool @08082DCC: ldr r0, =0x020322a4 ldr r1, [r0] adds r2, r1, 0 adds r2, 0x4A adds r0, r1, 0 adds r0, 0x4C ldrh r0, [r0] ldrh r3, [r2] adds r0, r3 strh r0, [r2] movs r4, 0xA0 lsls r4, 1 adds r0, r1, r4 bl sub_8082CB4 @08082DEA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8082D28 thumb_func_start sub_8082DF4 sub_8082DF4: ; 8082DF4 push {r4-r6,lr} ldr r4, =0x020322a4 ldr r0, [r4] movs r6, 0x8E lsls r6, 1 adds r0, r6 ldrh r1, [r0] movs r0, 0x14 bl 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 .pool thumb_func_end sub_8082DF4 thumb_func_start sub_8082E3C sub_8082E3C: ; 8082E3C push {lr} adds r2, r0, 0 ldrh r0, [r2, 0x2E] ldrh r1, [r2, 0x32] adds r0, r1 strh r0, [r2, 0x32] ldrh r0, [r2, 0x30] ldrh r1, [r2, 0x34] adds r0, r1 strh r0, [r2, 0x34] movs r1, 0x32 ldrsh r0, [r2, r1] cmp r0, 0 bge @08082E5A adds r0, 0x7 @08082E5A: asrs r0, 3 strh r0, [r2, 0x24] movs r1, 0x34 ldrsh r0, [r2, r1] cmp r0, 0 bge @08082E68 adds r0, 0x7 @08082E68: asrs r0, 3 strh r0, [r2, 0x26] adds r0, r2, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08082E80 adds r0, r2, 0 bl 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, =gUnknown_08329F40 mov r9, r0 ldr r2, =0x02020630 mov r10, r2 adds r6, r1, 0x1 movs r3, 0x1F mov r8, r3 movs r7, 0x10 @08082EB0: bl GenerateRandomNumber ldr r1, =0x020322a4 ldr r4, [r1] adds r4, 0x4A lsls r0, 16 lsrs r0, 16 movs r1, 0x14 bl __umodsi3 ldrh r1, [r4] adds r1, r0 lsls r1, 16 movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r2, r0, 16 adds r0, r2, 0 adds r0, 0x40 lsls r0, 1 add r0, r9 movs r3, 0 ldrsh r1, [r0, r3] cmp r1, 0 bge @08082EE4 adds r1, 0x3 @08082EE4: asrs r1, 2 lsls r0, r2, 1 add r0, r9 movs r2, 0 ldrsh r0, [r0, r2] cmp r0, 0 bge @08082EF4 adds r0, 0x3 @08082EF4: asrs r2, r0, 2 adds r1, 0x78 adds r2, 0x50 ldr r0, =gUnknown_08339BE0 movs r3, 0x1 bl 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, =0x0202064c adds r5, r3 ldr r0, =sub_8082E3C str r0, [r5] subs r6, 0x1 cmp r6, 0 bne @08082EB0 @08082F40: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8082E84 thumb_func_start sub_8082F68 sub_8082F68: ; 8082F68 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] movs r1, 0x2E ldrsh r0, [r4, r1] movs r1, 0x3 bl __divsi3 negs r0, r0 strh r0, [r4, 0x26] adds r0, r4, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08082F94 adds r0, r4, 0 bl 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, =0x0000fff4 strh r0, [r2, 0x26] @08082FC0: adds r0, r2, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08082FD4 adds r0, r2, 0 bl obj_delete_and_free_tiles @08082FD4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8082F9C thumb_func_start sub_8082FDC sub_8082FDC: ; 8082FDC push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r1, 16 ldr r2, =0x020322a4 ldr r3, [r2] lsls r4, r0, 1 adds r2, r3, 0 adds r2, 0x74 adds r2, r4 strh r1, [r2] lsls r0, 4 movs r2, 0xAC lsls r2, 1 adds r0, r2 adds r3, r0 adds r0, r3, 0 bl sub_807FE14 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8082FDC thumb_func_start sub_8083010 sub_8083010: ; 8083010 push {r4,lr} adds r4, r0, 0 movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0x1 beq @0808304C cmp r0, 0x1 bgt @08083026 cmp r0, 0 beq @0808302C b @080830B2 @08083026: cmp r0, 0x2 beq @08083066 b @080830B2 @0808302C: ldrh r0, [r4, 0x30] adds r0, 0x8 strh r0, [r4, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x58 ble @080830B2 movs r0, 0x58 strh r0, [r4, 0x30] ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] movs r0, 0x38 bl audio_play b @080830B2 @0808304C: ldrh r0, [r4, 0x32] adds r0, 0x1 strh r0, [r4, 0x32] lsls r0, 16 asrs r0, 16 cmp r0, 0x14 ble @080830B2 ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] movs r0, 0 strh r0, [r4, 0x32] b @080830B2 @08083066: ldrh r0, [r4, 0x30] adds r0, 0x4 strh r0, [r4, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0xB0 ble @080830B2 ldrh r0, [r4, 0x34] adds r0, 0x1 adds r1, r0, 0 strh r0, [r4, 0x34] lsls r0, 16 asrs r0, 16 cmp r0, 0x3 bne @080830A0 adds r0, r4, 0 bl obj_delete_and_free_tiles ldr r0, =gUnknown_08339C60 movs r2, 0x14 negs r2, r2 movs r1, 0x78 movs r3, 0x2 bl obj_add_from_template_forward_search b @080830B2 .align 2, 0 .pool @080830A0: movs r0, 0 strh r0, [r4, 0x2E] ldr r0, =0x0000fff0 strh r0, [r4, 0x30] lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl obj_anim_image_start @080830B2: ldrh r0, [r4, 0x30] strh r0, [r4, 0x26] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8083010 thumb_func_start sub_80830C0 sub_80830C0: ; 80830C0 push {r4,lr} adds r4, r0, 0 movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0x1 beq @080830FC cmp r0, 0x1 bgt @080830D6 cmp r0, 0 beq @080830DC b @08083130 @080830D6: cmp r0, 0x2 beq @08083112 b @08083130 @080830DC: ldrh r0, [r4, 0x30] adds r0, 0x8 strh r0, [r4, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x5C ble @08083130 movs r0, 0x5C strh r0, [r4, 0x30] ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] movs r0, 0x15 bl audio_play b @08083130 @080830FC: ldrh r0, [r4, 0x32] adds r0, 0x1 strh r0, [r4, 0x32] lsls r0, 16 asrs r0, 16 cmp r0, 0x14 ble @08083130 ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] b @08083130 @08083112: ldrh r0, [r4, 0x30] adds r0, 0x4 strh r0, [r4, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0xB0 ble @08083130 ldr r0, =0x020322a4 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] adds r0, r4, 0 bl obj_delete_and_free_tiles @08083130: ldrh r0, [r4, 0x30] strh r0, [r4, 0x26] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80830C0 thumb_func_start sub_8083140 sub_8083140: ; 8083140 push {lr} lsls r0, 16 lsrs r0, 16 lsls r1, 16 lsrs r3, r1, 16 ldr r1, =0x020322a4 ldr r1, [r1] movs r2, 0x8C lsls r2, 1 adds r1, r2 ldrh r2, [r1] cmp r2, r0 bcs @08083166 adds r0, r2, 0x2 strh r0, [r1] ldrh r0, [r1] adds r1, r3, 0 bl sub_8083170 @08083166: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8083140 thumb_func_start sub_8083170 sub_8083170: ; 8083170 push {r4-r7,lr} lsls r0, 16 lsls r1, 16 lsrs r1, 16 ldr r7, =0x06006000 lsrs r0, 10 bl __divsi3 adds r1, r0, 0 cmp r1, 0 bge @08083188 adds r0, r1, 0x7 @08083188: asrs r4, r0, 3 movs r3, 0 cmp r3, r4 bge @080831B0 ldr r0, =0x000080e9 adds r6, r0, 0 adds r0, 0x10 adds r5, r0, 0 adds r2, r7, 0 adds r2, 0x56 adds r0, r7, 0 adds r3, r4, 0 @080831A0: strh r6, [r0, 0x16] strh r5, [r2] adds r2, 0x2 adds r0, 0x2 subs r3, 0x1 cmp r3, 0 bne @080831A0 adds r3, r4, 0 @080831B0: adds r0, r1, 0 cmp r1, 0 bge @080831B8 adds r0, r1, 0x7 @080831B8: asrs r2, r0, 3 lsls r0, r2, 3 subs r2, r1, r0 cmp r2, 0 beq @080831D6 lsls r0, r3, 1 adds r0, r7 ldr r4, =0xffff80e1 adds r1, r2, r4 strh r1, [r0, 0x16] adds r0, 0x56 adds r4, 0x10 adds r1, r2, r4 strh r1, [r0] adds r3, 0x1 @080831D6: cmp r3, 0x7 bgt @080831FA ldr r0, =0x000080e1 adds r4, r0, 0 adds r0, 0x10 adds r2, r0, 0 lsls r1, r3, 1 adds r0, r1, 0 adds r0, 0x56 adds r0, r7 adds r1, r7 @080831EC: strh r4, [r1, 0x16] strh r2, [r0] adds r0, 0x2 adds r1, 0x2 adds r3, 0x1 cmp r3, 0x7 ble @080831EC @080831FA: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8083170 thumb_func_start sub_8083210 sub_8083210: ; 8083210 push {lr} lsls r0, 16 lsrs r0, 16 ldr r1, =0x00057e40 muls r0, r1 cmp r0, 0 bge @08083222 ldr r1, =0x0000ffff adds r0, r1 @08083222: asrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8083210 thumb_func_start sub_8083230 sub_8083230: ; 8083230 push {r4-r6,lr} sub sp, 0x8 lsls r0, 16 lsrs r0, 16 bl sub_8083210 adds r5, r0, 0 ldr r0, =0x020322a4 ldr r0, [r0] adds r1, r0, 0 adds r1, 0x4E ldrh r0, [r1] cmp r0, r5 bcs @0808324E strh r5, [r1] @0808324E: movs r6, 0 @08083250: mov r0, sp adds r4, r0, r6 adds r0, r5, 0 movs r1, 0xA bl __umodsi3 strb r0, [r4] adds r0, r5, 0 movs r1, 0xA bl __udivsi3 adds r5, r0, 0 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x4 bls @08083250 ldr r2, =0x06006458 mov r0, sp ldr r3, =0x00008072 adds r1, r3, 0 ldrb r0, [r0, 0x4] adds r0, r1, r0 strh r0, [r2] adds r2, 0x2 mov r0, sp ldrb r0, [r0, 0x3] adds r0, r1 strh r0, [r2] adds r2, 0x2 mov r0, sp ldrb r0, [r0, 0x2] adds r0, r1 strh r0, [r2] adds r2, 0x4 mov r0, sp ldrb r0, [r0, 0x1] adds r0, r1 strh r0, [r2] adds r2, 0x2 mov r0, sp ldrb r0, [r0] adds r1, r0 strh r1, [r2] add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8083230 thumb_func_start sub_80832BC sub_80832BC: ; 80832BC push {r4-r6,lr} adds r6, r0, 0 lsls r4, r1, 16 lsrs r5, r4, 16 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 bne @080832E0 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 bl __umodsi3 lsrs r1, r4, 17 subs r0, r1 strh r0, [r6] @080832E0: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_80832BC thumb_func_start sub_80832E8 sub_80832E8: ; 80832E8 push {lr} adds r1, r0, 0 ldrh r2, [r1] movs r3, 0 ldrsh r0, [r1, r3] cmp r0, 0 bge @080832FA adds r0, r2, 0x1 strh r0, [r1] @080832FA: ldrh r2, [r1] movs r3, 0 ldrsh r0, [r1, r3] cmp r0, 0 ble @08083308 subs r0, r2, 0x1 strh r0, [r1] @08083308: pop {r0} bx r0 thumb_func_end sub_80832E8 thumb_func_start sub_808330C sub_808330C: ; 808330C push {r4,lr} ldr r4, =0x020322a4 ldr r0, [r4] movs r1, 0x8E lsls r1, 1 adds r0, r1 bl sub_80832E8 ldr r0, [r4] movs r1, 0x8F lsls r1, 1 adds r0, r1 bl sub_80832E8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808330C thumb_func_start sub_8083334 sub_8083334: ; 8083334 push {r4,r5,lr} adds r4, r0, 0 lsls r1, 16 lsrs r1, 16 movs r5, 0x8 cmp r1, 0x9 bhi @08083344 movs r5, 0x10 @08083344: ldrh r0, [r4] movs r2, 0 ldrsh r1, [r4, r2] cmp r1, 0 bne @08083362 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 adds r1, r5, 0 bl __modsi3 lsrs r1, r5, 1 subs r0, r1 b @08083376 @08083362: cmp r1, 0 bge @0808336A adds r0, 0x1 strh r0, [r4] @0808336A: ldrh r1, [r4] movs r2, 0 ldrsh r0, [r4, r2] cmp r0, 0 ble @08083378 subs r0, r1, 0x1 @08083376: strh r0, [r4] @08083378: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_8083334 thumb_func_start sub_8083380 sub_8083380: ; 8083380 push {r4,r5,lr} ldr r5, =0x020322a4 ldr r2, [r5] movs r4, 0x84 lsls r4, 1 adds r0, r2, r4 ldr r1, [r0] cmp r1, 0 bne @080833A0 movs r3, 0x8E lsls r3, 1 adds r0, r2, r3 strh r1, [r0] adds r3, 0x2 adds r0, r2, r3 strh r1, [r0] @080833A0: ldr r0, [r5] adds r2, r0, r4 ldr r1, [r2] adds r1, 0x1 str r1, [r2] movs r2, 0x8E lsls r2, 1 adds r0, r2 lsls r1, 16 lsrs r1, 16 bl sub_8083334 ldr r1, [r5] movs r3, 0x8F lsls r3, 1 adds r0, r1, r3 adds r1, r4 ldrh r1, [r1] bl sub_8083334 ldr r2, [r5] adds r0, r2, r4 ldr r0, [r0] cmp r0, 0x14 beq @080833DC movs r0, 0 b @080833F0 .align 2, 0 .pool @080833DC: movs r1, 0x8E lsls r1, 1 adds r0, r2, r1 movs r1, 0 strh r1, [r0] movs r3, 0x8F lsls r3, 1 adds r0, r2, r3 strh r1, [r0] movs r0, 0x1 @080833F0: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8083380 thumb_func_start sub_80833F8 sub_80833F8: ; 80833F8 ldr r1, =0x020322a4 ldr r2, [r1] movs r3, 0x8E lsls r3, 1 adds r1, r2, r3 ldrh r1, [r1] negs r1, r1 strh r1, [r0, 0x24] adds r3, 0x2 adds r1, r2, r3 ldrh r1, [r1] negs r1, r1 strh r1, [r0, 0x26] bx lr .align 2, 0 .pool thumb_func_end sub_80833F8 thumb_func_start sub_8083418 sub_8083418: ; 8083418 push {lr} ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, =0x020322a4 ldr r1, [r0] adds r0, r1, 0 adds r0, 0x7C ldrb r0, [r0] subs r0, 0x2 lsls r0, 1 ldr r3, =0x000009bc adds r2, r3 adds r2, r0 adds r1, 0x4E ldrh r1, [r1] ldrh r0, [r2] cmp r0, r1 bcs @0808343E strh r1, [r2] @0808343E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x020322a4 ldr r0, [r1] ldrb r0, [r0] adds r4, r1, 0 cmp r0, 0x6 bls @0808346A b @08083898 @0808346A: lsls r0, 2 ldr r1, =@0808347C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0808347C: .4byte @08083498 .4byte @080834AE .4byte @080834C8 .4byte @08083518 .4byte @08083790 .4byte @080837A8 .4byte @0808386C @08083498: ldr r1, [r4] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r4] movs r1, 0x84 lsls r1, 1 adds r0, r1 movs r1, 0x11 str r1, [r0] b @08083898 @080834AE: ldr r1, [r4] movs r3, 0x84 lsls r3, 1 adds r2, r1, r3 ldr r0, [r2] subs r0, 0xA str r0, [r2] cmp r0, 0 blt @080834C2 b @08083898 @080834C2: movs r0, 0 str r0, [r2] b @08083854 @080834C8: ldr r1, [r4] movs r0, 0x84 lsls r0, 1 adds r1, r0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x14 bgt @080834DC b @08083898 @080834DC: movs r6, 0 @080834DE: ldr r4, =0x020322a4 ldr r0, [r4] adds r0, 0x46 adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl 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 .pool @08083518: ldr r4, =gUnknown_083398F5 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, =0x020322a4 ldr r0, [r1] adds r2, r0, 0 adds r2, 0x7C ldrb r0, [r2] movs r3, 0x15 mov r9, r3 cmp r0, 0x4 bne @08083550 movs r0, 0x11 mov r9, r0 @08083550: movs r6, 0 mov r3, sp adds r3, 0x10 str r3, [sp, 0x48] ldrb r2, [r2] cmp r6, r2 bcs @0808361A adds r7, r1, 0 movs r0, 0x3 mov r10, r0 @08083564: ldr r0, [r7] movs r2, 0x9E lsls r2, 1 adds r1, r0, r2 adds r1, r6 ldrb r5, [r1] adds r0, 0x9F adds r6, 0x1 mov r8, r6 mov r1, r8 movs r2, 0 movs r3, 0x1 bl decimal_int_to_string ldr r0, [r7] adds r0, 0x9F ldr r1, =gUnknown_08339941 bl gf_strcat ldr r0, [r7] adds r0, 0x9F ldr r1, =gUnknown_085E8D5E bl gf_strcat ldr r0, [r7] adds r0, 0x9F lsls r4, r5, 3 subs r4, r5 lsls r4, 2 ldr r3, =0x020229f0 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, =0x020229e8 adds r4, r2 ldrb r1, [r4, 0x1A] bl sub_8009308 ldr r0, [r7] adds r0, 0x9F ldr r1, =gUnknown_08339914 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, =gUnknown_0833992E movs r3, 0xFF mov r10, r3 str r3, [sp] movs r0, 0x3 mov r9, r0 str r0, [sp, 0x4] movs r0, 0x5 movs r2, 0 movs r3, 0x51 bl sub_80840D4 ldr r6, =0x020322a4 ldr r0, [r6] adds r4, r0, 0 adds r4, 0x9F adds r0, 0x4E ldrh r0, [r0] movs r1, 0x64 bl __udivsi3 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r0, [r6] adds r0, 0x9F ldr r1, =gUnknown_08339941 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, =gUnknown_0833993C 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, =gUnknown_0833991B mov r2, r10 str r2, [sp] mov r3, r9 str r3, [sp, 0x4] movs r0, 0x5 movs r2, 0 movs r3, 0x61 bl sub_80840D4 ldr r5, [r6] movs r1, 0x82 lsls r1, 1 adds r0, r5, r1 ldr r0, [r0] mov r8, r0 movs r1, 0x3C bl __udivsi3 movs r1, 0x3C bl __umodsi3 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 movs r1, 0xE1 lsls r1, 4 mov r0, r8 bl __udivsi3 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r5, 0x9F adds r0, r5, 0 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r0, [r6] adds r0, 0x9F ldr r1, =gUnknown_08339921 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, =gUnknown_08339928 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 .pool @08083790: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0808379E b @08083898 @0808379E: ldr r1, [r4] b @08083854 .align 2, 0 .pool @080837A8: movs r0, 0x5 movs r1, 0x1 bl sub_8198070 movs r6, 0 add r7, sp, 0x40 ldr r5, =0x020322a4 @080837B6: ldr r0, [r5] lsls r2, r6, 1 adds r0, 0x74 adds r0, r2 ldrh r1, [r0] cmp r1, 0 beq @080837CC add r0, sp, 0x38 adds r0, r2 subs r1, 0x85 strh r1, [r0] @080837CC: ldr r0, [r5] adds r0, 0x8E adds r0, r2 ldrh r0, [r0] cmp r0, 0xFF beq @080837EA lsls r4, r6, 24 lsrs r4, 24 adds r0, r4, 0 bl 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, =0x020322a4 ldr r3, [r4] movs r1, 0xAC lsls r1, 1 adds r0, r3, r1 adds r1, r3, 0 adds r1, 0x7C ldrb r2, [r1] subs r1, 0x2E ldrh r1, [r1] str r1, [sp] adds r1, r7, 0 add r3, sp, 0x8 bl sub_8081BE0 ldr r1, [r4] adds r1, 0x9F adds r0, r7, 0 bl sub_80838AC ldr r1, [r4] movs r2, 0xD4 lsls r2, 1 adds r1, r2 adds r0, r7, 0 bl sub_8083F94 ldr r0, =sub_8083F3C movs r1, 0x6 bl AddTask bl sub_80EECEC ldr r0, =0x0203ce7c ldrh r0, [r0] movs r1, 0x1 bl sub_80D6AA4 adds r0, r7, 0 bl sub_8136F2C ldr r1, [r4] ldr r3, =0x000011b8 adds r2, r1, r3 movs r0, 0 strh r0, [r2] @08083854: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08083898 .align 2, 0 .pool @0808386C: ldr r4, [r4] ldr r0, =0x000011b8 adds r5, r4, r0 adds r4, 0x9F bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r5, 0 adds r1, r4, 0 bl sub_808417C cmp r0, 0 beq @08083898 bl sub_8083418 movs r0, 0x1 b @0808389A .align 2, 0 .pool @08083898: movs r0, 0 @0808389A: add sp, 0x4C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end 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, =gUnknown_085B262C ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, [r0] adds r0, r6, 0 bl gf_strcpy ldr r1, =gUnknown_0833979D adds r0, r6, 0 bl gf_strcat ldr r1, =gUnknown_08339943 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, =gUnknown_0833994F 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, =gUnknown_0833995D 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, =gUnknown_08339970 adds r0, r6, 0 bl gf_strcat ldr r1, =gUnknown_0833979B adds r0, r6, 0 bl gf_strcat add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80838AC thumb_func_start sub_808395C sub_808395C: ; 808395C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} mov r9, r0 mov r12, r2 lsls r1, 24 lsrs r7, r1, 24 movs r0, 0 cmp r0, r7 bge @080839A8 @08083972: movs r5, 0 adds r1, r0, 0x1 mov r8, r1 cmp r5, r7 bge @080839A2 mov r1, r9 adds r6, r1, r0 @08083980: ldrb r4, [r6] lsls r1, r4, 2 add r1, r12 mov r0, r9 adds r2, r0, r5 ldrb r3, [r2] lsls r0, r3, 2 add r0, r12 ldr r1, [r1] ldr r0, [r0] cmp r1, r0 bls @0808399C strb r3, [r6] strb r4, [r2] @0808399C: adds r5, 0x1 cmp r5, r7 blt @08083980 @080839A2: mov r0, r8 cmp r0, r7 blt @08083972 @080839A8: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_808395C thumb_func_start sub_80839B4 sub_80839B4: ; 80839B4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x14 movs r5, 0 ldr r2, =0x020322a4 ldr r0, [r2] adds r0, 0x7C adds r1, r2, 0 add r3, sp, 0x4 mov r10, r3 b @080839E4 .align 2, 0 .pool @080839D4: mov r4, sp adds r0, r4, r5 strb r5, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 ldr r0, [r2] adds r0, 0x7C @080839E4: ldrb r0, [r0] cmp r5, r0 bcc @080839D4 movs r5, 0 ldr r0, [r1] adds r1, r0, 0 adds r1, 0x7C ldrb r2, [r1] cmp r5, r2 bcs @08083A5E mov r9, r10 movs r3, 0x92 lsls r3, 1 adds r3, r0 mov r8, r3 mov r12, r1 movs r4, 0x93 lsls r4, 1 adds r7, r0, r4 movs r1, 0x94 lsls r1, 1 adds r6, r0, r1 @08083A10: lsls r4, r5, 2 add r4, r9 lsls r3, r5, 1 adds r3, r5 lsls r3, 1 mov r2, r8 adds r0, r2, r3 ldrh r2, [r0] lsls r0, r2, 5 subs r0, r2 lsls r1, r0, 6 subs r1, r0 lsls r1, 3 adds r1, r2 lsls r1, 6 str r1, [r4] adds r0, r7, r3 ldrh r2, [r0] lsls r0, r2, 5 subs r0, r2 lsls r0, 2 adds r0, r2 lsls r0, 3 adds r1, r0 str r1, [r4] movs r0, 0xFA lsls r0, 2 adds r1, r0 adds r3, r6, r3 ldrh r0, [r3] subs r1, r0 str r1, [r4] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 mov r1, r12 ldrb r1, [r1] cmp r5, r1 bcc @08083A10 @08083A5E: ldr r4, =0x020322a4 ldr r0, [r4] adds r0, 0x7C ldrb r1, [r0] mov r0, sp mov r2, r10 bl sub_808395C movs r5, 0 ldr r0, [r4] adds r0, 0x7C ldrb r0, [r0] cmp r5, r0 bcs @08083A9E adds r2, r4, 0 movs r3, 0x9E lsls r3, 1 @08083A80: ldr r1, [r2] adds r1, r3 adds r1, r5 mov r4, sp adds r0, r4, r5 ldrb r0, [r0] strb r0, [r1] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 ldr r0, [r2] adds r0, 0x7C ldrb r0, [r0] cmp r5, r0 bcc @08083A80 @08083A9E: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08083AB4 movs r3, 0 b @08083ABC .align 2, 0 .pool @08083AB4: bl link_get_multiplayer_id lsls r0, 24 lsrs r3, r0, 24 @08083ABC: movs r5, 0 ldr r1, =0x020322a4 ldr r0, [r1] adds r0, 0x7C ldrb r0, [r0] cmp r5, r0 bcs @08083AF2 movs r6, 0x9E lsls r6, 1 movs r4, 0xD2 lsls r4, 1 @08083AD2: ldr r2, [r1] adds r0, r2, r6 adds r0, r5 ldrb r0, [r0] cmp r0, r3 bne @08083AE2 adds r0, r2, r4 strb r5, [r0] @08083AE2: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 ldr r0, [r1] adds r0, 0x7C ldrb r0, [r0] cmp r5, r0 bcc @08083AD2 @08083AF2: add sp, 0x14 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80839B4 thumb_func_start sub_8083B08 sub_8083B08: ; 8083B08 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC ldr r1, =0x020322a4 ldr r0, [r1] ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0x6 bls @08083B22 b @08083E12 @08083B22: lsls r0, 2 ldr r1, =@08083B34 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08083B34: .4byte @08083B50 .4byte @08083B66 .4byte @08083B80 .4byte @08083B9A .4byte @08083DC8 .4byte @08083DE2 .4byte @08083E08 @08083B50: ldr r1, [r2] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r2] movs r1, 0x84 lsls r1, 1 adds r0, r1 movs r1, 0xFF str r1, [r0] b @08083E12 @08083B66: ldr r1, [r2] movs r3, 0x84 lsls r3, 1 adds r2, r1, r3 ldr r0, [r2] subs r0, 0xA str r0, [r2] cmp r0, 0 blt @08083B7A b @08083E12 @08083B7A: movs r0, 0 str r0, [r2] b @08083DF8 @08083B80: ldr r1, [r2] movs r0, 0x84 lsls r0, 1 adds r2, r1, r0 ldr r0, [r2] adds r0, 0x1 str r0, [r2] cmp r0, 0x14 bgt @08083B94 b @08083E12 @08083B94: movs r0, 0 str r0, [r2] b @08083DF8 @08083B9A: movs r0, 0x5 movs r1, 0 movs r2, 0x1 movs r3, 0xD bl SetWindowBorderStyle ldr r4, =gUnknown_08339947 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xA8 bl 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, =gUnknown_08339B40 mov r8, r1 mov r0, r8 movs r1, 0x80 movs r2, 0x34 movs r3, 0 bl obj_add_from_template_forward_search ldr r7, =0x020322a4 ldr r1, [r7] adds r1, 0x46 strb r0, [r1] ldr r0, [r7] adds r0, 0x46 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r6, =0x02020630 adds r0, r6 movs r1, 0x3 bl 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, =nullsub_12 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, =gUnknown_08339941 bl gf_strcat ldr r0, [r7] adds r0, 0x9F ldr r1, =gUnknown_085E8D5E bl gf_strcat ldr r0, [r7] adds r0, 0x9F lsls r1, r5, 3 subs r1, r5 lsls r1, 2 ldr r2, =0x020229f0 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, =0x020322a4 ldr r1, [r0] movs r3, 0x84 lsls r3, 1 adds r2, r1, r3 movs r0, 0 str r0, [r2] b @08083DF8 .align 2, 0 .pool @08083DC8: ldr r2, [r2] movs r0, 0x84 lsls r0, 1 adds r1, r2, r0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] cmp r0, 0x14 ble @08083E12 ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] b @08083E12 @08083DE2: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08083E12 movs r0, 0x5 bl audio_play ldr r0, =0x020322a4 ldr r1, [r0] @08083DF8: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08083E12 .align 2, 0 .pool @08083E08: ldr r1, [r2] movs r0, 0 strb r0, [r1] movs r0, 0x1 b @08083E14 @08083E12: movs r0, 0 @08083E14: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8083B08 thumb_func_start sub_8083E24 sub_8083E24: ; 8083E24 push {r4-r7,lr} sub sp, 0x34 ldr r0, =gUnknown_08339D14 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x2C] str r1, [sp, 0x30] ldr r5, =0x0203ab74 add r0, sp, 0x2C bl 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, =gUnknown_085EE44F 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, =gUnknown_085EE473 movs r1, 0x29 str r1, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0x4 bl Print movs r6, 0 movs r7, 0xA4 lsls r7, 22 @08083E8A: ldr r0, =0x03005d8c ldr r0, [r0] lsls r1, r6, 1 ldr r2, =0x000009bc adds r0, r2 adds r0, r1 ldrh r4, [r0] adds r0, r4, 0 movs r1, 0x64 bl __udivsi3 adds r1, r0, 0 add r0, sp, 0xC movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string adds r5, r0, 0 ldr r1, =gUnknown_08339941 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, =gUnknown_0833993C bl gf_strcat movs r0, 0x1 add r1, sp, 0xC movs r2, 0x8C bl sub_81DB368 adds r3, r0, 0 ldr r4, =0x0203ab74 ldrb r0, [r4] lsls r3, 24 lsrs r3, 24 lsrs r1, r7, 24 str r1, [sp] movs r1, 0 str r1, [sp, 0x4] str r1, [sp, 0x8] movs r1, 0x1 add r2, sp, 0xC bl Print movs r0, 0x80 lsls r0, 21 adds r7, r0 adds r6, 0x1 cmp r6, 0x2 ble @08083E8A ldrb r0, [r4] bl Window_WriteStandardTileMap ldrb r0, [r4] movs r1, 0x3 bl Window_CopyToVram add sp, 0x34 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bne @08083F62 ldr r0, =0x0000016f bl fanfare_play ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @08083F62: bl task_is_not_running_overworld_fanfare lsls r0, 24 cmp r0, 0 beq @08083F82 ldr r0, =0x020322a4 ldr r0, [r0] movs r1, 0xAA lsls r1, 1 adds r0, r1 ldrh r0, [r0] bl song_play_for_text adds r0, r5, 0 bl remove_task @08083F82: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8083F3C thumb_func_start sub_8083F94 sub_8083F94: ; 8083F94 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 adds r6, r0, 0 adds r7, r1, 0 bl sub_8136EA4 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 bl sub_8136EDC adds r1, r0, 0 lsls r0, r4, 2 adds r0, r4 lsls r0, 1 lsls r1, 24 lsrs r1, 24 bl __divsi3 lsls r0, 16 lsrs r3, r0, 16 strb r3, [r7, 0xD] ldrb r0, [r6] strb r0, [r7, 0xC] movs r0, 0xFF strb r0, [r7] ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080840C4 ldr r0, =0x020322a4 ldr r2, [r0] movs r4, 0xD2 lsls r4, 1 adds r1, r2, r4 ldrb r1, [r1] mov r8, r0 cmp r1, 0 bne @08084058 cmp r3, 0x14 bls @08084058 adds r0, r2, 0 adds r0, 0x7C ldrb r1, [r0] subs r1, 0x1 movs r0, 0x9E lsls r0, 1 mov r9, r0 adds r0, r2, r0 adds r0, r1 ldrb r0, [r0] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r5, =0x020229f0 adds r1, r5 adds r0, r7, 0 bl 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 .pool @08084058: mov r0, r8 ldr r2, [r0] movs r1, 0xD2 lsls r1, 1 adds r0, r2, r1 ldrb r1, [r0] adds r0, r2, 0 adds r0, 0x7C ldrb r0, [r0] subs r0, 0x1 cmp r1, r0 bne @080840C4 cmp r3, 0x14 bhi @080840C4 movs r4, 0x9E lsls r4, 1 adds r0, r2, r4 ldrb r0, [r0] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r5, =0x020229f0 adds r1, r5 adds r0, r7, 0 bl 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 .pool @080840C4: movs r0, 0 @080840C6: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8083F94 thumb_func_start sub_80840D4 sub_80840D4: ; 80840D4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x18 mov r9, r1 ldr r4, [sp, 0x38] lsls r0, 24 lsrs r6, r0, 24 lsls r2, 24 lsrs r2, 24 mov r8, r2 lsls r3, 24 lsrs r7, r3, 24 movs r5, 0 cmp r4, 0x1 beq @08084116 cmp r4, 0x1 bgt @08084100 cmp r4, 0 beq @08084108 b @08084132 @08084100: cmp r4, 0x2 beq @08084124 cmp r4, 0x3 bne @08084136 @08084108: add r1, sp, 0x14 movs r0, 0x1 strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] movs r0, 0x3 b @08084130 @08084116: add r0, sp, 0x14 strb r5, [r0] adds r1, r0, 0 movs r0, 0x2 strb r0, [r1, 0x1] movs r0, 0x3 b @08084130 @08084124: add r0, sp, 0x14 strb r5, [r0] adds r1, r0, 0 movs r0, 0x4 strb r0, [r1, 0x1] movs r0, 0x5 @08084130: strb r0, [r1, 0x2] @08084132: cmp r4, 0x3 beq @08084148 @08084136: add r0, sp, 0x14 ldrb r0, [r0] lsls r1, r0, 4 orrs r1, r0 lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 bl 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, =0x03000e08 movs r0, 0 strb r0, [r1] ldr r2, =0x03005d90 ldr r3, [r2] movs r1, 0 movs r0, 0 strh r0, [r3, 0xE] strb r1, [r3, 0x10] ldr r0, [r2] strb r1, [r0, 0x11] ldr r0, [r2] strb r1, [r0, 0x12] bx lr .align 2, 0 .pool thumb_func_end reset_playtime thumb_func_start set_max_playtime_if_appropriate set_max_playtime_if_appropriate: ; 8084208 push {lr} ldr r1, =0x03000e08 movs r0, 0x1 strb r0, [r1] ldr r0, =0x03005d90 ldr r0, [r0] ldrh r1, [r0, 0xE] ldr r0, =0x000003e7 cmp r1, r0 bls @08084220 bl set_max_playtime @08084220: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end set_max_playtime_if_appropriate thumb_func_start sub_8084230 sub_8084230: ; 8084230 ldr r1, =0x03000e08 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8084230 thumb_func_start gametime_increment gametime_increment: ; 808423C push {lr} ldr r0, =0x03000e08 ldrb r0, [r0] cmp r0, 0x1 bne @08084294 ldr r2, =0x03005d90 ldr r0, [r2] ldrb r1, [r0, 0x12] adds r1, 0x1 movs r3, 0 strb r1, [r0, 0x12] ldr r1, [r2] ldrb r0, [r1, 0x12] cmp r0, 0x3B bls @08084294 strb r3, [r1, 0x12] ldr r0, [r2] ldrb r1, [r0, 0x11] adds r1, 0x1 strb r1, [r0, 0x11] ldr r1, [r2] ldrb r0, [r1, 0x11] cmp r0, 0x3B bls @08084294 strb r3, [r1, 0x11] ldr r0, [r2] ldrb r1, [r0, 0x10] adds r1, 0x1 strb r1, [r0, 0x10] ldr r1, [r2] ldrb r0, [r1, 0x10] cmp r0, 0x3B bls @08084294 strb r3, [r1, 0x10] ldr r0, [r2] ldrh r1, [r0, 0xE] adds r1, 0x1 strh r1, [r0, 0xE] lsls r1, 16 ldr r0, =0x03e70000 cmp r1, r0 bls @08084294 bl set_max_playtime @08084294: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end gametime_increment thumb_func_start set_max_playtime set_max_playtime: ; 80842A4 ldr r1, =0x03000e08 movs r0, 0x2 strb r0, [r1] ldr r2, =0x03005d90 ldr r3, [r2] ldr r0, =0x000003e7 strh r0, [r3, 0xE] movs r1, 0x3B strb r1, [r3, 0x10] ldr r0, [r2] strb r1, [r0, 0x11] ldr r0, [r2] strb r1, [r0, 0x12] bx lr .align 2, 0 .pool thumb_func_end set_max_playtime thumb_func_start write_word_to_mem ; void write_word_to_mem(int value, int *mem) write_word_to_mem: ; 80842CC strb r0, [r1] lsrs r2, r0, 8 strb r2, [r1, 0x1] lsrs r2, r0, 16 strb r2, [r1, 0x2] lsrs r0, 24 strb r0, [r1, 0x3] bx lr thumb_func_end write_word_to_mem thumb_func_start sub_80842DC sub_80842DC: ; 80842DC adds r2, r0, 0 ldrb r0, [r2, 0x3] lsls r0, 24 ldrb r1, [r2, 0x2] lsls r1, 16 orrs r0, r1 ldrb r1, [r2, 0x1] lsls r1, 8 orrs r0, r1 ldrb r1, [r2] orrs r0, r1 bx lr thumb_func_end sub_80842DC thumb_func_start sub_80842F4 sub_80842F4: ; 80842F4 push {r4,lr} adds r4, r0, 0 adds r3, r1, 0 movs r2, 0 @080842FC: adds r0, r4, r2 adds r1, r3, r2 ldrb r1, [r1] strb r1, [r0] adds r2, 0x1 cmp r2, 0x3 ble @080842FC pop {r4} pop {r0} bx r0 thumb_func_end sub_80842F4 thumb_func_start set_player_trainer_id set_player_trainer_id: ; 8084310 push {r4,lr} bl GenerateRandomNumber adds r4, r0, 0 bl get_trainer_id_hi lsls r4, 16 lsls r0, 16 lsrs r0, 16 orrs r4, r0 ldr r0, =0x03005d90 ldr r1, [r0] adds r1, 0xA adds r0, r4, 0 bl write_word_to_mem pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end set_player_trainer_id thumb_func_start init_options init_options: ; 808433C ldr r3, =0x03005d90 ldr r2, [r3] ldrb r1, [r2, 0x14] movs r0, 0x8 negs r0, r0 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x14] ldr r2, [r3] ldrb r1, [r2, 0x14] movs r0, 0x7 ands r0, r1 strb r0, [r2, 0x14] ldr r2, [r3] ldrb r1, [r2, 0x15] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2, 0x15] ldr r2, [r3] ldrb r1, [r2, 0x15] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r2, 0x15] ldr r2, [r3] ldrb r1, [r2, 0x15] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2, 0x15] ldr r2, [r3] ldrb r1, [r2, 0x15] movs r0, 0x9 negs r0, r0 ands r0, r1 strb r0, [r2, 0x15] bx lr .align 2, 0 .pool thumb_func_end init_options thumb_func_start sub_8084390 sub_8084390: ; 8084390 push {r4,lr} ldr r1, =0x030060b0 movs r0, 0 strb r0, [r1] ldr r4, =0x03005d90 ldr r0, [r4] adds r0, 0x28 movs r1, 0 movs r2, 0x34 bl memset ldr r0, [r4] adds r0, 0x5C movs r1, 0 movs r2, 0x34 bl memset pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084390 thumb_func_start sub_80843C0 sub_80843C0: ; 80843C0 push {r4-r7,lr} bl sub_80DF040 movs r2, 0x8 ldr r0, =0x03005d8c mov r12, r0 ldr r4, =0x00002e90 ldr r3, =gUnknown_08339D1C @080843D0: mov r1, r12 ldr r0, [r1] lsls r1, r2, 5 adds r0, r1 adds r0, r4 adds r1, r3, 0 ldm r1!, {r5-r7} stm r0!, {r5-r7} ldm r1!, {r5-r7} stm r0!, {r5-r7} ldm r1!, {r5,r6} stm r0!, {r5,r6} adds r2, 0x1 cmp r2, 0xC ble @080843D0 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80843C0 thumb_func_start sub_8084400 sub_8084400: ; 8084400 push {r4,lr} sub sp, 0x4 movs r0, 0 str r0, [sp] ldr r4, =0x03005d90 ldr r1, [r4] ldr r0, =0x0000064c adds r1, r0 ldr r2, =0x05000238 mov r0, sp bl CpuSet ldr r0, [r4] ldr r1, =0x00000ee1 adds r0, r1 movs r1, 0xFF strb r1, [r0] ldr r0, [r4] ldr r1, =0x00000ee9 adds r0, r1 movs r1, 0x1 negs r1, r1 strb r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084400 thumb_func_start sub_808444C sub_808444C: ; 808444C push {lr} sub sp, 0x4 movs r3, 0x1 negs r3, r3 str r3, [sp] movs r0, 0x19 movs r1, 0x28 adds r2, r3, 0 bl warp1_set bl warp_in add sp, 0x4 pop {r0} bx r0 thumb_func_end sub_808444C thumb_func_start init_sav2 init_sav2: ; 808446C push {lr} bl memclr_stdsav2 bl init_options pop {r0} bx r0 thumb_func_end init_sav2 thumb_func_start sub_808447C sub_808447C: ; 808447C push {lr} ldr r1, =0x020322d4 movs r0, 0 strb r0, [r1] bl sub_80BB358 bl zero_player_party_data bl zero_enemy_party_data bl sub_81AAB70 bl sub_813624C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808447C thumb_func_start new_game_init_data new_game_init_data: ; 80844A0 push {r4,r5,lr} ldr r0, =0x03006210 ldrh r0, [r0] cmp r0, 0 beq @080844AE cmp r0, 0x2 bne @080844B2 @080844AE: bl sub_802F3F8 @080844B2: ldr r1, =0x020322d4 movs r0, 0x1 strb r0, [r1] ldr r4, =0x03005d90 ldr r0, [r4] adds r0, 0xAC movs r5, 0 str r5, [r0] bl zero_player_party_data bl zero_enemy_party_data bl sub_80BB2D0 bl sub_8084400 bl clear_sav1 bl sub_80D436C ldr r0, [r4] strb r5, [r0, 0x9] ldr r0, [r4] adds r0, 0xA8 str r5, [r0] bl set_player_trainer_id bl reset_playtime bl sub_8084390 bl sub_809D300 bl sub_80EBEE0 bl sub_80EC21C bl sub_80E8B28 bl sub_80E1794 ldr r4, =0x03005d8c ldr r0, [r4] movs r1, 0x92 lsls r1, 3 adds r0, r1 ldr r1, =0x00000bb8 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, =0x020244e9 strb r5, [r0] bl zero_player_party_data bl sub_80C7770 bl sub_8161B34 bl sub_8161B60 ldr r0, [r4] ldr r1, =0x00000496 adds r0, r1 strh r5, [r0] bl sub_80D7094 bl sub_816ADF4 bl sub_8136E88 bl sub_81618B4 bl sub_811F184 bl sub_8120160 bl sub_81224D4 bl sub_813BA10 bl sub_8177558 bl sub_808444C ldr r0, =gUnknown_082715DE bl script_env_2_execute_new_script bl sub_80845CC bl copy_strings_to_sav1 bl sub_818DA30 bl sub_819FAA0 bl sub_81A4B14 bl sub_8195E10 bl sub_801AFD8 bl sub_800E5AC bl sub_81D54BC bl sub_80DED74 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r1, [r4] movs r0, 0xF6 lsls r0, 1 adds r1, r0 ldr r6, =0x01000008 mov r0, sp adds r2, r6, 0 bl CpuSet ldr r0, [r4] movs r1, 0xFA lsls r1, 1 adds r0, r1 movs r1, 0 bl sub_802467C bl sub_802E33C mov r0, sp adds r0, 0x2 strh r5, [r0] ldr r1, [r4] movs r2, 0x83 lsls r2, 2 adds r1, r2 adds r2, r6, 0 bl CpuSet add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80845CC thumb_func_start sub_8084620 sub_8084620: ; 8084620 push {r4,lr} ldr r0, =gUnknown_08271857 bl script_env_2_execute_new_script ldr r0, =0x03005d8c ldr r4, [r0] movs r0, 0x92 lsls r0, 3 adds r4, r0 adds r0, r4, 0 bl 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 .pool thumb_func_end sub_8084620 thumb_func_start flag_var_implications_of_teleport_ flag_var_implications_of_teleport_: ; 8084660 push {lr} bl player_avatar_init_params_reset ldr r0, =0x0000088b bl flag_clear ldr r0, =0x0000088d bl flag_clear ldr r0, =0x0000088c bl flag_clear ldr r0, =0x00000889 bl flag_clear ldr r0, =0x00000888 bl flag_clear pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000088b bl flag_clear ldr r0, =0x0000088d bl flag_clear ldr r0, =0x0000088c bl flag_clear ldr r0, =0x00000889 bl flag_clear ldr r0, =0x00000888 bl flag_clear ldr r0, =gUnknown_08271862 bl script_env_2_execute_new_script pop {r0} bx r0 .align 2, 0 .pool thumb_func_end new_game thumb_func_start flagmods_08054D70 flagmods_08054D70: ; 80846E4 push {lr} bl player_avatar_init_params_reset ldr r0, =0x0000088b bl flag_clear ldr r0, =0x0000088d bl flag_clear ldr r0, =0x0000088c bl flag_clear ldr r0, =0x00000889 bl flag_clear ldr r0, =0x00000888 bl flag_clear pop {r0} bx r0 .align 2, 0 .pool thumb_func_end flagmods_08054D70 thumb_func_start sub_8084720 sub_8084720: ; 8084720 push {r4,lr} bl player_avatar_init_params_reset ldr r0, =0x0000088b bl flag_clear ldr r0, =0x0000088d bl flag_clear ldr r0, =0x0000088c bl flag_clear ldr r0, =0x00000889 bl flag_clear ldr r0, =0x00000888 bl flag_clear ldr r4, =0x00004039 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, =0x00004037 movs r1, 0 bl var_set @08084764: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084720 thumb_func_start sub_8084788 sub_8084788: ; 8084788 push {lr} ldr r0, =0x0000088c 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 .pool thumb_func_end sub_8084788 thumb_func_start sub_80847A8 sub_80847A8: ; 80847A8 push {r4,lr} movs r4, 0 @080847AC: lsls r0, r4, 24 lsrs r0, 24 movs r1, 0 bl sav12_xor_set adds r4, 0x1 cmp r4, 0x3F ble @080847AC pop {r4} pop {r0} bx r0 thumb_func_end sub_80847A8 thumb_func_start sav12_xor_increment sav12_xor_increment: ; 80847C4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x33 bhi @080847EC adds r0, r4, 0 bl sub_80847F8 adds r1, r0, 0 ldr r0, =0x00fffffe cmp r1, r0 bhi @080847E4 adds r1, 0x1 b @080847E6 .align 2, 0 .pool @080847E4: ldr r1, =0x00ffffff @080847E6: adds r0, r4, 0 bl sav12_xor_set @080847EC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sav12_xor_increment thumb_func_start sub_80847F8 sub_80847F8: ; 80847F8 push {lr} lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x33 bhi @08084828 ldr r0, =0x03005d8c ldr r2, [r0] lsls r0, r1, 2 ldr r1, =0x0000159c adds r2, r1 adds r2, r0 ldr r0, =0x03005d90 ldr r1, [r0] adds r1, 0xAC ldr r0, [r2] ldr r1, [r1] eors r0, r1 b @0808482A .align 2, 0 .pool @08084828: movs r0, 0 @0808482A: pop {r1} bx r1 thumb_func_end sub_80847F8 thumb_func_start sav12_xor_set sav12_xor_set: ; 8084830 push {lr} adds r3, r1, 0 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x33 bhi @08084854 ldr r0, =0x03005d8c ldr r1, [r0] lsls r0, r2, 2 ldr r2, =0x0000159c adds r1, r2 adds r1, r0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xAC ldr r0, [r0] eors r0, r3 str r0, [r1] @08084854: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sav12_xor_set thumb_func_start sub_8084864 sub_8084864: ; 8084864 push {r4-r6,lr} adds r5, r0, 0 movs r4, 0 ldr r6, =0x03005d8c @0808486C: lsls r1, r4, 2 ldr r0, =0x0000159c adds r1, r0 ldr r0, [r6] adds r0, r1 adds r1, r5, 0 bl apply_u32_xor_crypto adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3F bls @0808486C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r1, [r5] movs r4, 0xC7 lsls r4, 4 adds r1, r4 ldr r2, =0x05000180 mov r0, sp bl CpuSet ldr r0, =0x02037318 ldr r2, [r0, 0x4] ldr r0, [r2, 0x4] ldr r1, [r5] adds r1, r4 ldrb r3, [r2] lsls r2, r3, 1 adds r2, r3 lsls r2, 1 movs r3, 0x80 lsls r3, 19 orrs r2, r3 bl CpuSet add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084894 thumb_func_start sub_80848E0 sub_80848E0: ; 80848E0 push {lr} ldr r0, =0x02037318 ldr r1, [r0, 0x4] ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, [r1, 0x4] movs r3, 0xC7 lsls r3, 4 adds r1, r0, r3 movs r3, 0x3F @080848F4: ldr r0, [r2, 0x10] str r0, [r1, 0x10] adds r2, 0x18 adds r1, 0x18 subs r3, 0x1 cmp r3, 0 bge @080848F4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] movs r1, 0 movs r6, 0xC7 lsls r6, 4 adds r3, r0, r6 @0808492A: ldrb r0, [r3] cmp r0, r5 bne @0808493C strh r4, [r3, 0x4] strh r2, [r3, 0x6] b @08084944 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] movs r3, 0 movs r5, 0xC7 lsls r5, 4 adds r2, r0, r5 @08084962: ldrb r0, [r2] cmp r0, r4 bne @08084970 strb r1, [r2, 0x9] b @08084978 .align 2, 0 .pool @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, =0x02037318 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 .pool thumb_func_end mapdata_load_assets_to_gpu_and_full_redraw thumb_func_start get_mapdata_header ; mapdata_header *get_mapdata_header() get_mapdata_header: ; 80849A8 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x32] cmp r1, 0 bne @080849BC movs r0, 0 b @080849C6 .align 2, 0 .pool @080849BC: ldr r0, =gUnknown_08481DD4 subs r1, 0x1 lsls r1, 2 adds r1, r0 ldr r0, [r1] @080849C6: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end get_mapdata_header thumb_func_start warp_shift ; void warp_shift() warp_shift: ; 80849D0 ldr r3, =0x020322dc ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, [r2, 0x4] ldr r1, [r2, 0x8] str r0, [r3] str r1, [r3, 0x4] ldr r0, =0x020322e4 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r2, 0x4] str r1, [r2, 0x8] ldr r2, =0x020322ec ldr r0, =gUnknown_08339D3C ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r2] str r1, [r2, 0x4] ldr r2, =0x020322f4 str r0, [r2] str r1, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end warp_shift thumb_func_start set_warp2_warp3_to_neg_1 ; void set_warp2_warp3_to_neg_1() set_warp2_warp3_to_neg_1: ; 8084A14 ldr r2, =0x020322ec ldr r0, =gUnknown_08339D3C ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r2] str r1, [r2, 0x4] ldr r2, =0x020322f4 str r0, [r2] str r1, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end set_warp2_warp3_to_neg_1 thumb_func_start warp_set ; void warp_set(warpdata *warp, char bank, char map, char warpid, char enter_x, char enter_y) warp_set: ; 8084A34 push {r4,r5,lr} ldr r4, [sp, 0xC] ldr r5, [sp, 0x10] strb r1, [r0] strb r2, [r0, 0x1] strb r3, [r0, 0x2] lsls r4, 24 asrs r4, 24 strh r4, [r0, 0x4] lsls r5, 24 asrs r5, 24 strh r5, [r0, 0x6] pop {r4,r5} pop {r0} bx r0 thumb_func_end warp_set thumb_func_start warp_data_is_not_neg_1 ; int warp_data_is_not_neg_1(warpdata *warp) warp_data_is_not_neg_1: ; 8084A54 push {lr} adds r1, r0, 0 movs r2, 0 ldrsb r2, [r1, r2] movs r0, 0x1 negs r0, r0 cmp r2, r0 bne @08084A88 movs r0, 0x1 ldrsb r0, [r1, r0] cmp r0, r2 bne @08084A88 movs r2, 0x2 ldrsb r2, [r1, r2] cmp r2, r0 bne @08084A88 movs r0, 0x4 ldrsh r3, [r1, r0] cmp r3, r2 bne @08084A88 movs r2, 0x6 ldrsh r0, [r1, r2] cmp r0, r3 bne @08084A88 movs r0, 0x1 b @08084A8A @08084A88: movs r0, 0 @08084A8A: pop {r1} bx r1 thumb_func_end warp_data_is_not_neg_1 thumb_func_start get_mapheader_by_bank_and_number ; struct mapheader *get_mapheader_by_bank_and_number(unsigned int bank, unsigned int num) get_mapheader_by_bank_and_number: ; 8084A90 lsls r0, 16 lsls r1, 16 ldr r2, =gUnknown_08486578 lsrs r0, 14 adds r0, r2 ldr r0, [r0] lsrs r1, 14 adds r1, r0 ldr r0, [r1] bx lr .align 2, 0 .pool thumb_func_end get_mapheader_by_bank_and_number thumb_func_start warp1_get_mapheader ; struct mapheader *warp1_get_mapheader() warp1_get_mapheader: ; 8084AA8 push {lr} ldr r1, =0x020322e4 movs r0, 0 ldrsb r0, [r1, r0] lsls r0, 16 lsrs r0, 16 ldrb r1, [r1, 0x1] lsls r1, 24 asrs r1, 24 lsls r1, 16 lsrs r1, 16 bl get_mapheader_by_bank_and_number pop {r1} bx r1 .align 2, 0 .pool thumb_func_end warp1_get_mapheader thumb_func_start set_current_map_header_from_sav1_save_old_name ; void set_current_map_header_from_sav1_save_old_name() set_current_map_header_from_sav1_save_old_name: ; 8084ACC push {r4-r6,lr} ldr r1, =0x020322fc ldr r4, =0x02037318 ldrb r0, [r4, 0x14] strh r0, [r1] ldr r5, =0x03005d8c ldr r1, [r5] movs r0, 0x4 ldrsb r0, [r1, r0] lsls r0, 16 lsrs r0, 16 ldrb r1, [r1, 0x5] lsls r1, 24 asrs r1, 24 lsls r1, 16 lsrs r1, 16 bl get_mapheader_by_bank_and_number adds r1, r4, 0 ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} ldm r0!, {r2,r3,r6} stm r1!, {r2,r3,r6} ldr r0, [r0] str r0, [r1] ldr r1, [r5] ldrh r0, [r4, 0x12] strh r0, [r1, 0x32] bl get_mapdata_header str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end set_current_map_header_from_sav1_save_old_name thumb_func_start set_current_map_header_from_sav1 set_current_map_header_from_sav1: ; 8084B1C push {r4,r5,lr} ldr r4, =0x02037318 ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] lsls r0, 16 lsrs r0, 16 ldrb r1, [r1, 0x5] lsls r1, 24 asrs r1, 24 lsls r1, 16 lsrs r1, 16 bl get_mapheader_by_bank_and_number adds r1, r4, 0 ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldm r0!, {r2,r3,r5} stm r1!, {r2,r3,r5} ldr r0, [r0] str r0, [r1] bl get_mapdata_header str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end set_current_map_header_from_sav1 thumb_func_start update_camera_pos_from_warpid ; void update_camera_pos_from_warpid() update_camera_pos_from_warpid: ; 8084B5C push {r4,r5,lr} ldr r0, =0x03005d8c ldr r2, [r0] movs r1, 0x6 ldrsb r1, [r2, r1] adds r4, r0, 0 cmp r1, 0 blt @08084B94 ldr r3, =0x02037318 ldr r0, [r3, 0x4] ldrb r5, [r0, 0x1] cmp r1, r5 bge @08084B94 ldr r0, [r0, 0x8] lsls r1, 3 adds r0, r1, r0 ldrh r0, [r0] strh r0, [r2] ldr r0, [r3, 0x4] ldr r0, [r0, 0x8] adds r1, r0 ldrh r0, [r1, 0x2] strh r0, [r2, 0x2] b @08084BCC .align 2, 0 .pool @08084B94: ldr r1, [r4] ldrh r3, [r1, 0x8] movs r2, 0x8 ldrsh r0, [r1, r2] cmp r0, 0 blt @08084BB0 ldrh r2, [r1, 0xA] movs r5, 0xA ldrsh r0, [r1, r5] cmp r0, 0 blt @08084BB0 strh r3, [r1] strh r2, [r1, 0x2] b @08084BCC @08084BB0: ldr r3, [r4] ldr r2, =0x02037318 ldr r0, [r2] ldr r0, [r0] lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 strh r0, [r3] ldr r0, [r2] ldr r0, [r0, 0x4] lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 strh r0, [r3, 0x2] @08084BCC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end update_camera_pos_from_warpid thumb_func_start warp_in warp_in: ; 8084BD8 push {lr} bl warp_shift bl set_current_map_header_from_sav1_save_old_name bl update_camera_pos_from_warpid pop {r0} bx r0 thumb_func_end warp_in thumb_func_start warp1_set ; void warp1_set(char bank, char map, char warpid, char enter_x, char enter_y) warp1_set: ; 8084BEC push {r4-r6,lr} sub sp, 0x8 adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 ldr r1, [sp, 0x18] ldr r0, =0x020322e4 lsls r4, 24 asrs r4, 24 lsls r5, 24 asrs r5, 24 lsls r6, 24 asrs r6, 24 lsls r3, 24 asrs r3, 24 str r3, [sp] lsls r1, 24 asrs r1, 24 str r1, [sp, 0x4] adds r1, r4, 0 adds r2, r5, 0 adds r3, r6, 0 bl warp_set add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end warp1_set thumb_func_start warp1_set_2 ; void warp1_set_2(char bank, char map, char warpid) warp1_set_2: ; 8084C28 push {lr} sub sp, 0x4 lsls r0, 24 asrs r0, 24 lsls r1, 24 asrs r1, 24 lsls r2, 24 asrs r2, 24 movs r3, 0x1 negs r3, r3 str r3, [sp] bl warp1_set add sp, 0x4 pop {r0} bx r0 thumb_func_end warp1_set_2 thumb_func_start saved_warp2_set ; void saved_warp2_set(char bank, char map, char warpid) saved_warp2_set: ; 8084C48 push {r4,r5,lr} sub sp, 0x8 ldr r0, =0x03005d8c ldr r5, [r0] adds r0, r5, 0 adds r0, 0x14 lsls r1, 24 asrs r1, 24 lsls r2, 24 asrs r2, 24 lsls r3, 24 asrs r3, 24 movs r4, 0 ldrsb r4, [r5, r4] str r4, [sp] movs r4, 0x2 ldrsb r4, [r5, r4] str r4, [sp, 0x4] bl warp_set add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end saved_warp2_set thumb_func_start saved_warp2_set_2 saved_warp2_set_2: ; 8084C7C push {r4,r5,lr} sub sp, 0x8 ldr r4, [sp, 0x14] ldr r5, [sp, 0x18] ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x14 lsls r1, 24 asrs r1, 24 lsls r2, 24 asrs r2, 24 lsls r3, 24 asrs r3, 24 lsls r4, 24 asrs r4, 24 str r4, [sp] lsls r5, 24 asrs r5, 24 str r5, [sp, 0x4] bl warp_set add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end saved_warp2_set_2 thumb_func_start copy_saved_warp2_bank_and_enter_x_to_warp1 copy_saved_warp2_bank_and_enter_x_to_warp1: ; 8084CB4 ldr r2, =0x020322e4 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, [r0, 0x18] ldr r0, [r0, 0x14] str r0, [r2] str r1, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end copy_saved_warp2_bank_and_enter_x_to_warp1 thumb_func_start sub_8084CCC ; void sub_8084CCC(int a1) sub_8084CCC: ; 8084CCC push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 bl sub_8122CBC adds r4, r0, 0 cmp r4, 0 beq @08084CFA movs r0, 0 ldrsb r0, [r4, r0] movs r1, 0x1 ldrsb r1, [r4, r1] movs r2, 0x1 negs r2, r2 movs r3, 0x2 ldrsb r3, [r4, r3] ldrb r4, [r4, 0x4] lsls r4, 24 asrs r4, 24 str r4, [sp] bl warp1_set @08084CFA: add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end sub_8084CCC thumb_func_start copy_saved_warp3_bank_and_enter_x_to_warp1 ; void copy_saved_warp3_bank_and_enter_x_to_warp1() copy_saved_warp3_bank_and_enter_x_to_warp1: ; 8084D04 ldr r2, =0x020322e4 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, [r0, 0x20] ldr r0, [r0, 0x1C] str r0, [r2] str r1, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end copy_saved_warp3_bank_and_enter_x_to_warp1 thumb_func_start sub_8084D1C sub_8084D1C: ; 8084D1C push {r4,r5,lr} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 bl sub_8122CBC adds r5, r0, 0 cmp r5, 0 beq @08084D50 ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x1C movs r1, 0 ldrsb r1, [r5, r1] movs r2, 0x1 ldrsb r2, [r5, r2] movs r3, 0x1 negs r3, r3 movs r4, 0x2 ldrsb r4, [r5, r4] str r4, [sp] movs r4, 0x4 ldrsb r4, [r5, r4] str r4, [sp, 0x4] bl warp_set @08084D50: add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084D1C thumb_func_start sub_8084D5C sub_8084D5C: ; 8084D5C push {r4-r7,lr} sub sp, 0x4 lsls r0, 16 lsrs r6, r0, 16 lsls r1, 16 lsrs r7, r1, 16 bl sav1_map_get_light_level adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r1, =0x020322e4 movs r0, 0 ldrsb r0, [r1, r0] ldrb r1, [r1, 0x1] lsls r1, 24 asrs r1, 24 bl get_map_light_level_by_bank_and_number lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 bl is_light_level_1_2_3_5_or_6 lsls r0, 24 cmp r0, 0 beq @08084DC4 adds r0, r5, 0 bl is_light_level_1_2_3_5_or_6 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08084DC4 ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] ldrb r1, [r1, 0x5] lsls r1, 24 asrs r1, 24 movs r2, 0x1 negs r2, r2 subs r3, r6, 0x7 lsls r3, 24 asrs r3, 24 subs r4, r7, 0x6 lsls r4, 24 asrs r4, 24 str r4, [sp] bl sub_8084DD4 @08084DC4: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084D5C thumb_func_start sub_8084DD4 sub_8084DD4: ; 8084DD4 push {r4-r6,lr} sub sp, 0x8 adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 ldr r1, [sp, 0x18] ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x24 lsls r4, 24 asrs r4, 24 lsls r5, 24 asrs r5, 24 lsls r6, 24 asrs r6, 24 lsls r3, 24 asrs r3, 24 str r3, [sp] lsls r1, 24 asrs r1, 24 str r1, [sp, 0x4] adds r1, r4, 0 adds r2, r5, 0 adds r3, r6, 0 bl warp_set add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084DD4 thumb_func_start sub_8084E14 sub_8084E14: ; 8084E14 ldr r2, =0x020322e4 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, [r0, 0x28] ldr r0, [r0, 0x24] str r0, [r2] str r1, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_8084E14 thumb_func_start sub_8084E2C sub_8084E2C: ; 8084E2C push {r4-r6,lr} sub sp, 0x8 adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 ldr r1, [sp, 0x18] ldr r0, =0x020322ec lsls r4, 24 asrs r4, 24 lsls r5, 24 asrs r5, 24 lsls r6, 24 asrs r6, 24 lsls r3, 24 asrs r3, 24 str r3, [sp] lsls r1, 24 asrs r1, 24 str r1, [sp, 0x4] adds r1, r4, 0 adds r2, r5, 0 adds r3, r6, 0 bl warp_set add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084E2C thumb_func_start warp1_set_to_warp2 warp1_set_to_warp2: ; 8084E68 ldr r2, =0x020322e4 ldr r0, =0x020322ec ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r2] str r1, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end warp1_set_to_warp2 thumb_func_start sub_8084E80 sub_8084E80: ; 8084E80 push {r4-r6,lr} sub sp, 0x8 adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 ldr r1, [sp, 0x18] ldr r0, =0x020322f4 lsls r4, 24 asrs r4, 24 lsls r5, 24 asrs r5, 24 lsls r6, 24 asrs r6, 24 lsls r3, 24 asrs r3, 24 str r3, [sp] lsls r1, 24 asrs r1, 24 str r1, [sp, 0x4] adds r1, r4, 0 adds r2, r5, 0 adds r3, r6, 0 bl warp_set add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084E80 thumb_func_start sub_8084EBC sub_8084EBC: ; 8084EBC push {r4-r6,lr} sub sp, 0x4 lsls r0, 16 lsrs r5, r0, 16 lsls r1, 16 lsrs r6, r1, 16 ldr r4, =0x020322f4 adds r0, r4, 0 bl warp_data_is_not_neg_1 cmp r0, 0x1 bne @08084EF0 ldr r2, =0x020322e4 ldr r0, =0x020322dc ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r2] str r1, [r2, 0x4] b @08084F0A .align 2, 0 .pool @08084EF0: movs r0, 0 ldrsb r0, [r4, r0] movs r1, 0x1 ldrsb r1, [r4, r1] movs r2, 0x1 negs r2, r2 lsls r3, r5, 24 asrs r3, 24 lsls r4, r6, 24 asrs r4, 24 str r4, [sp] bl warp1_set @08084F0A: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8084EBC thumb_func_start warp1_set_to_sav1w warp1_set_to_sav1w: ; 8084F14 ldr r2, =0x020322e4 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, [r0, 0x10] ldr r0, [r0, 0xC] str r0, [r2] str r1, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end warp1_set_to_sav1w thumb_func_start sub_8084F2C sub_8084F2C: ; 8084F2C push {r4-r6,lr} sub sp, 0x8 adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 ldr r1, [sp, 0x18] ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0xC lsls r4, 24 asrs r4, 24 lsls r5, 24 asrs r5, 24 lsls r6, 24 asrs r6, 24 lsls r3, 24 asrs r3, 24 str r3, [sp] lsls r1, 24 asrs r1, 24 str r1, [sp, 0x4] adds r1, r4, 0 adds r2, r5, 0 adds r3, r6, 0 bl warp_set add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084F2C thumb_func_start sub_8084F6C sub_8084F6C: ; 8084F6C push {r4,r5,lr} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 bl sub_8122CBC adds r5, r0, 0 cmp r5, 0 beq @08084FA0 ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0xC movs r1, 0 ldrsb r1, [r5, r1] movs r2, 0x1 ldrsb r2, [r5, r2] movs r3, 0x1 negs r3, r3 movs r4, 0x2 ldrsb r4, [r5, r4] str r4, [sp] movs r4, 0x4 ldrsb r4, [r5, r4] str r4, [sp, 0x4] bl warp_set @08084FA0: add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8084F6C thumb_func_start sub_8084FAC sub_8084FAC: ; 8084FAC ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, [r2, 0x14] ldr r1, [r2, 0x18] str r0, [r2, 0xC] str r1, [r2, 0x10] bx lr .align 2, 0 .pool thumb_func_end sub_8084FAC thumb_func_start sub_8084FC0 sub_8084FC0: ; 8084FC0 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02037318 ldr r0, [r0, 0xC] ldr r3, [r0] ldr r1, [r0, 0x4] cmp r1, 0 bne @08084FDC b @08084FF0 .align 2, 0 .pool @08084FD8: adds r0, r1, 0 b @08084FF2 @08084FDC: movs r2, 0 cmp r2, r3 bge @08084FF0 @08084FE2: ldrb r0, [r1] cmp r0, r4 beq @08084FD8 adds r2, 0x1 adds r1, 0xC cmp r2, r3 blt @08084FE2 @08084FF0: movs r0, 0 @08084FF2: pop {r4} pop {r1} bx r1 thumb_func_end sub_8084FC0 thumb_func_start sub_8084FF8 sub_8084FF8: ; 8084FF8 push {r4,r5,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r4, r1, 16 lsls r2, 16 lsrs r5, r2, 16 bl sub_8084FC0 adds r1, r0, 0 cmp r1, 0 beq @08085030 movs r0, 0x8 ldrsb r0, [r1, r0] ldrb r1, [r1, 0x9] lsls r1, 24 asrs r1, 24 movs r2, 0x1 negs r2, r2 lsls r3, r4, 24 asrs r3, 24 lsls r4, r5, 24 asrs r4, 24 str r4, [sp] bl warp1_set b @0808504C @08085030: bl mapheader_run_script_with_tag_x6 ldr r0, =0x020322ec bl warp_data_is_not_neg_1 cmp r0, 0 beq @08085048 movs r0, 0 b @0808504E .align 2, 0 .pool @08085048: bl warp1_set_to_warp2 @0808504C: movs r0, 0x1 @0808504E: add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8084FF8 thumb_func_start sub_8085058 sub_8085058: ; 8085058 push {lr} adds r3, r0, 0 adds r2, r1, 0 lsls r3, 16 lsrs r3, 16 lsls r2, 16 lsrs r2, 16 movs r0, 0x6 adds r1, r3, 0 bl sub_8084FF8 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_8085058 thumb_func_start sub_8085078 sub_8085078: ; 8085078 push {lr} adds r3, r0, 0 adds r2, r1, 0 lsls r3, 16 lsrs r3, 16 lsls r2, 16 lsrs r2, 16 movs r0, 0x5 adds r1, r3, 0 bl sub_8084FF8 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_8085078 thumb_func_start mliX_load_map mliX_load_map: ; 8085098 push {r4-r6,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 adds r6, r0, 0 lsls r1, 24 lsrs r1, 24 adds r5, r1, 0 lsls r0, r6, 24 asrs r0, 24 lsls r1, r5, 24 asrs r1, 24 movs r3, 0x1 negs r3, r3 str r3, [sp] adds r2, r3, 0 bl warp1_set ldr r4, =0x02037318 ldrb r0, [r4, 0x14] cmp r0, 0x3A beq @080850C8 bl sub_8085810 @080850C8: bl warp_shift bl set_current_map_header_from_sav1_save_old_name bl 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, =0x02037318 ldrb r0, [r2, 0x14] cmp r0, 0x3A bne @0808514C ldr r1, =0x020322fc 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 .pool thumb_func_end mliX_load_map thumb_func_start mli0_load_map mli0_load_map: ; 8085160 push {r4-r7,lr} adds r7, r0, 0 bl set_current_map_header_from_sav1_save_old_name ldr r0, =0x020322d8 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080851A2 ldr r0, =0x02037318 ldrh r1, [r0, 0x12] ldr r0, =0x00000169 cmp r1, r0 bne @08085190 bl sub_81AA1D8 b @080851A2 .align 2, 0 .pool @08085190: bl sub_81D6074 cmp r0, 0 beq @0808519E bl sub_81D5DF8 b @080851A2 @0808519E: bl sub_8084894 @080851A2: ldr r4, =0x02037318 ldrb r0, [r4, 0x17] bl is_light_level_1_2_3_5_or_6 lsls r0, 24 lsrs r5, r0, 24 ldrb r0, [r4, 0x17] bl is_light_level_8_or_9 lsls r0, 24 lsrs r6, r0, 24 bl sub_80EB218 bl sav2_set_x9_depending_on_sav1_map bl sub_809D344 bl wild_pokemon_reroll bl prev_quest_postbuffer_cursor_backup_reset ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] lsls r0, 16 lsrs r0, 16 ldrb r1, [r1, 0x5] lsls r1, 24 asrs r1, 24 lsls r1, 16 lsrs r1, 16 bl sub_80B21B4 cmp r7, 0x1 beq @080851EE bl sub_809E7B0 @080851EE: bl sub_80AEDBC bl sub_8085B2C cmp r5, 0 beq @08085200 ldr r0, =0x00000888 bl 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, =0x00000169 cmp r1, r0 bne @08085234 movs r0, 0 bl sub_8087DAC b @08085246 .align 2, 0 .pool @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, =0x03005dc0 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 .pool thumb_func_end mli0_load_map thumb_func_start player_avatar_init_params_reset player_avatar_init_params_reset: ; 8085268 ldr r1, =0x02032300 movs r0, 0x1 strb r0, [r1, 0x1] strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end player_avatar_init_params_reset thumb_func_start walkrun_find_lowest_active_bit_in_bitfield walkrun_find_lowest_active_bit_in_bitfield: ; 8085278 push {r4,lr} bl player_get_direction__sp1AA ldr r4, =0x02032300 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 .pool @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, =0x02032300 adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 bl sub_808532C adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r0, =0xffffff00 ands r7, r0 orrs r7, r1 adds r0, r6, 0 adds r2, r4, 0 adds r3, r5, 0 bl sub_808538C lsls r0, 24 lsrs r0, 16 ldr r1, =0xffff00ff ands r7, r1 orrs r7, r0 str r7, [r6] adds r0, r6, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80852D4 thumb_func_start sub_808532C sub_808532C: ; 808532C push {r4-r6,lr} adds r6, r0, 0 lsls r1, 16 lsrs r5, r1, 16 lsls r2, 24 lsrs r4, r2, 24 cmp r4, 0x8 beq @08085348 ldr r0, =0x0000088d bl flag_check lsls r0, 24 cmp r0, 0 bne @08085382 @08085348: cmp r4, 0x5 bne @08085354 movs r0, 0x10 b @08085384 .align 2, 0 .pool @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, =0x0000088d 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 .pool @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, =0x03005d8c ldr r1, [r0] movs r2, 0 ldrsh r0, [r1, r2] adds r0, 0x7 movs r2, 0x2 ldrsh r1, [r1, r2] adds r1, 0x7 bl cur_mapdata_block_get_role_at lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end cur_mapdata_block_role_at_screen_center_acc_to_sav1 thumb_func_start sav1_map_is_biking_allowed sav1_map_is_biking_allowed: ; 8085474 push {lr} ldr r0, =0x02037318 ldrb r1, [r0, 0x1A] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0808548C movs r0, 0x1 b @0808548E .align 2, 0 .pool @0808548C: movs r0, 0 @0808548E: pop {r1} bx r1 thumb_func_end sav1_map_is_biking_allowed thumb_func_start update_sav1_flash_used_on_map update_sav1_flash_used_on_map: ; 8085494 push {lr} ldr r0, =0x02037318 ldrb r1, [r0, 0x15] cmp r1, 0 bne @080854B0 ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x30 strb r1, [r0] b @080854DE .align 2, 0 .pool @080854B0: ldr r0, =0x00000888 bl flag_check lsls r0, 24 cmp r0, 0 beq @080854D0 ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x30 movs r1, 0x1 strb r1, [r0] b @080854DE .align 2, 0 .pool @080854D0: ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =gUnknown_0854FE78 ldr r0, [r0] subs r0, 0x1 adds r1, 0x30 strb r0, [r1] @080854DE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end update_sav1_flash_used_on_map thumb_func_start sub_80854EC sub_80854EC: ; 80854EC push {lr} adds r1, r0, 0 cmp r1, 0 blt @080854FC ldr r0, =gUnknown_0854FE78 ldr r0, [r0] cmp r1, r0 ble @080854FE @080854FC: movs r1, 0 @080854FE: ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x30 strb r1, [r0] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80854EC thumb_func_start sav1_get_flash_used_on_map sav1_get_flash_used_on_map: ; 8085514 ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x30 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sav1_get_flash_used_on_map thumb_func_start sub_8085524 sub_8085524: ; 8085524 push {lr} ldr r1, =0x03005d8c ldr r1, [r1] strh r0, [r1, 0x32] bl get_mapdata_header ldr r1, =0x02037318 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8085524 thumb_func_start sub_8085540 sub_8085540: ; 8085540 ldr r1, =0x020322d8 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8085540 thumb_func_start sub_808554C sub_808554C: ; 808554C ldr r0, =0x020322d8 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_808554C thumb_func_start sub_8085558 sub_8085558: ; 8085558 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0000088a bl 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, =0x0000405e 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 .pool @080855AC: movs r0, 0 @080855AE: pop {r4} pop {r1} bx r1 thumb_func_end sub_8085558 thumb_func_start sub_80855B4 sub_80855B4: ; 80855B4 push {r4,lr} adds r4, r0, 0 ldr r0, =0x000040ca bl 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 .pool @080855E0: movs r0, 0x1 @080855E2: pop {r4} pop {r1} bx r1 thumb_func_end sub_80855B4 thumb_func_start sub_80855E8 sub_80855E8: ; 80855E8 push {r4,lr} adds r4, r0, 0 ldr r0, =0x000040b3 bl 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 .pool @08085610: movs r0, 0x1 @08085612: pop {r4} pop {r1} bx r1 thumb_func_end sub_80855E8 thumb_func_start sub_8085618 sub_8085618: ; 8085618 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0000405d adds r0, r4, 0 bl 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 .pool @08085654: movs r0, 0x1 @08085656: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8085618 thumb_func_start warp_target_get_music warp_target_get_music: ; 808565C push {r4,lr} adds r4, r0, 0 bl sub_80855B4 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bne @08085674 ldr r0, =0x0000ffff b @080856CE .align 2, 0 .pool @08085674: adds r0, r4, 0 bl sub_8085558 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bne @0808568C ldr r0, =0x000001bb b @080856CE .align 2, 0 .pool @0808568C: adds r0, r4, 0 bl sub_8085618 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bne @080856A4 ldr r0, =0x000001b9 b @080856CE .align 2, 0 .pool @080856A4: adds r0, r4, 0 bl sub_80855E8 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 beq @080856CA movs r0, 0 ldrsb r0, [r4, r0] lsls r0, 16 lsrs r0, 16 movs r1, 0x1 ldrsb r1, [r4, r1] lsls r1, 16 lsrs r1, 16 bl get_mapheader_by_bank_and_number ldrh r0, [r0, 0x10] b @080856CE @080856CA: movs r0, 0xCB lsls r0, 1 @080856CE: pop {r4} pop {r1} bx r1 thumb_func_end warp_target_get_music thumb_func_start sav1_map_get_music sav1_map_get_music: ; 80856D4 push {r4,lr} ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xD0 lsls r0, 5 cmp r1, r0 bne @080856FC bl sav1_get_weather_probably lsls r0, 24 lsrs r0, 24 cmp r0, 0x8 bne @080856FC ldr r0, =0x00000199 b @08085730 .align 2, 0 .pool @080856FC: ldr r4, =0x03005d8c ldr r0, [r4] adds r0, 0x4 bl warp_target_get_music lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x00007fff cmp r1, r0 beq @0808571C adds r0, r1, 0 b @08085730 .align 2, 0 .pool @0808571C: ldr r0, [r4] movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x17 ble @0808572C movs r0, 0xC9 lsls r0, 1 b @08085730 @0808572C: movs r0, 0xB4 lsls r0, 1 @08085730: pop {r4} pop {r1} bx r1 thumb_func_end sav1_map_get_music thumb_func_start warp1_target_get_music warp1_target_get_music: ; 8085738 push {lr} ldr r0, =0x020322e4 bl warp_target_get_music lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x00007fff cmp r1, r0 beq @08085758 adds r0, r1, 0 b @08085774 .align 2, 0 .pool @08085758: ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0x80 lsls r0, 2 cmp r1, r0 beq @08085770 subs r0, 0x6E b @08085774 .align 2, 0 .pool @08085770: movs r0, 0xB4 lsls r0, 1 @08085774: pop {r1} bx r1 thumb_func_end warp1_target_get_music thumb_func_start call_map_music_set_to_zero call_map_music_set_to_zero: ; 8085778 push {lr} bl map_music_set_to_zero pop {r0} bx r0 thumb_func_end call_map_music_set_to_zero thumb_func_start sub_8085784 sub_8085784: ; 8085784 push {r4,lr} bl sav1_map_get_music lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x000001bb cmp r4, r0 beq @080857D6 ldr r0, =0x0000ffff cmp r4, r0 beq @080857D6 ldr r0, =0x03005d8c ldr r1, [r0] ldrh r0, [r1, 0x2C] cmp r0, 0 beq @080857B4 adds r4, r0, 0 b @080857D6 .align 2, 0 .pool @080857B4: bl sav1_map_get_light_level lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 bne @080857C8 ldr r4, =0x0000019b b @080857D6 .align 2, 0 .pool @080857C8: movs r0, 0x8 bl walkrun_bitfield_and_r0 lsls r0, 24 cmp r0, 0 beq @080857D6 ldr r4, =0x0000016d @080857D6: bl current_map_music_get lsls r0, 16 lsrs r0, 16 cmp r4, r0 beq @080857E8 adds r0, r4, 0 bl current_map_music_set @080857E8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8085784 thumb_func_start sav1_set_x2C sav1_set_x2C: ; 80857F4 ldr r1, =0x03005d8c ldr r1, [r1] strh r0, [r1, 0x2C] bx lr .align 2, 0 .pool thumb_func_end sav1_set_x2C thumb_func_start sav1_reset_x2C sav1_reset_x2C: ; 8085800 ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x2C] bx lr .align 2, 0 .pool thumb_func_end sav1_reset_x2C thumb_func_start sub_8085810 sub_8085810: ; 8085810 push {r4-r6,lr} ldr r0, =0x00004001 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, =0x000001bb cmp r4, r0 beq @08085856 ldr r0, =0x0000ffff cmp r4, r0 beq @08085856 ldr r0, =0x0000019b cmp r5, r0 beq @08085890 ldr r6, =0x0000016d cmp r5, r6 beq @08085890 movs r0, 0x8 bl 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 .pool @08085888: adds r0, r4, 0 movs r1, 0x8 bl sub_80A2F88 @08085890: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8085810 thumb_func_start sub_8085898 sub_8085898: ; 8085898 push {r4,lr} bl current_map_music_get adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl sav1_map_get_music lsls r0, 16 lsrs r0, 16 cmp r4, r0 beq @080858BE bl sav1_map_get_music lsls r0, 16 lsrs r0, 16 movs r1, 0x8 bl sub_80A2F88 @080858BE: pop {r4} pop {r0} bx r0 thumb_func_end sub_8085898 thumb_func_start sub_80858C4 sub_80858C4: ; 80858C4 push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 bl current_map_music_get lsls r0, 16 lsrs r1, r0, 16 cmp r1, r4 beq @080858E4 ldr r0, =0x000001bb cmp r1, r0 beq @080858E4 adds r0, r4, 0 movs r1, 0x8 bl sub_80A2F88 @080858E4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80858C4 thumb_func_start is_warp1_light_level_8_or_9 is_warp1_light_level_8_or_9: ; 80858F0 push {lr} bl warp1_get_mapheader ldrb r0, [r0, 0x17] bl is_light_level_8_or_9 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08085908 movs r0, 0x4 b @0808590A @08085908: movs r0, 0x2 @0808590A: pop {r1} bx r1 thumb_func_end is_warp1_light_level_8_or_9 thumb_func_start music_something music_something: ; 8085910 push {r4,r5,lr} bl current_map_music_get lsls r0, 16 lsrs r5, r0, 16 bl warp1_target_get_music lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x00004001 bl 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, =0x0000016d cmp r5, r0 bne @08085972 ldr r0, =0x000040ca bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x2 bne @08085972 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000ffff ldrh r2, [r0, 0x4] movs r0, 0xE0 lsls r0, 3 cmp r2, r0 bne @08085972 ldr r3, =0x020322e4 ldrh r0, [r3] ands r1, r0 cmp r1, r2 bne @08085972 ldr r1, [r3, 0x4] ldr r0, =0x0035001d cmp r1, r0 beq @0808597E @08085972: bl is_warp1_light_level_8_or_9 lsls r0, 24 lsrs r0, 24 bl sub_80A2F50 @0808597E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end music_something thumb_func_start sub_80859A0 sub_80859A0: ; 80859A0 push {lr} bl sub_80A303C lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_80859A0 thumb_func_start sub_80859B0 sub_80859B0: ; 80859B0 push {lr} movs r0, 0x4 bl sub_80A2F50 pop {r0} bx r0 thumb_func_end sub_80859B0 thumb_func_start sub_80859BC sub_80859BC: ; 80859BC push {r4,lr} sub sp, 0x4 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl player_get_pos_to ldr r0, =0x02032306 ldrb r0, [r0] cmp r0, 0x1 bne @080859F0 mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] bl 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, =0x02032304 ldrh r0, [r0] lsls r4, 24 asrs r4, 24 lsls r2, 24 asrs r2, 24 adds r1, r4, 0 movs r3, 0x1 bl sub_80A32C0 @08085A2C: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80859BC thumb_func_start wild_encounter_related wild_encounter_related: ; 8085A3C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r6, r0, 0 adds r7, r1, 0 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0x4 bhi @08085B20 lsls r0, 2 ldr r1, =@08085A60 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08085A60: .4byte @08085A74 .4byte @08085A88 .4byte @08085AA4 .4byte @08085B0C .4byte @08085B20 @08085A74: ldr r0, =0x02032304 ldrh r0, [r0] cmp r0, 0 bne @08085A84 movs r0, 0x4 b @08085B1E .align 2, 0 .pool @08085A84: movs r0, 0x1 b @08085B1E @08085A88: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x96 lsls r1, 4 bl __umodsi3 movs r1, 0x96 lsls r1, 3 adds r0, r1 strh r0, [r7] movs r0, 0x3 b @08085B1E @08085AA4: movs r0, 0x1 mov r9, r0 bl calc_player_party_count lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r5, 0 b @08085ABC @08085AB6: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @08085ABC: cmp r5, r8 bcs @08085AE4 movs r0, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x6 bl pokemon_getattr cmp r0, 0 bne @08085AB6 adds r0, r4, 0 bl 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 .pool @08085B0C: ldrh r0, [r7] subs r0, 0x1 strh r0, [r7] lsls r0, 16 cmp r0, 0 bne @08085B20 bl sub_80859BC movs r0, 0x2 @08085B1E: strh r0, [r6] @08085B20: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end wild_encounter_related thumb_func_start sub_8085B2C sub_8085B2C: ; 8085B2C push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xB4 lsls r0, 6 cmp r1, r0 bne @08085B5C bl sub_813793C lsls r0, 24 cmp r0, 0 bne @08085B5C ldr r1, =0x02032306 movs r0, 0x1 strb r0, [r1] bl sub_80B582C b @08085B62 .align 2, 0 .pool @08085B5C: ldr r0, =0x02032306 bl wild_pokemon_rand_for_map @08085B62: ldr r1, =0x02032304 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8085B2C thumb_func_start get_map_light_level_by_bank_and_number ; int get_map_light_level_by_bank_and_number(int bank, int number) get_map_light_level_by_bank_and_number: ; 8085B74 push {lr} lsls r0, 24 asrs r0, 8 lsrs r0, 16 lsls r1, 24 asrs r1, 8 lsrs r1, 16 bl get_mapheader_by_bank_and_number ldrb r0, [r0, 0x17] pop {r1} bx r1 thumb_func_end get_map_light_level_by_bank_and_number thumb_func_start get_map_light_level_from_warp ; int get_map_light_level_from_warp(warpdata *warp) get_map_light_level_from_warp: ; 8085B8C push {lr} movs r2, 0 ldrsb r2, [r0, r2] movs r1, 0x1 ldrsb r1, [r0, r1] adds r0, r2, 0 bl get_map_light_level_by_bank_and_number lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end get_map_light_level_from_warp thumb_func_start sav1_map_get_light_level sav1_map_get_light_level: ; 8085BA4 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x4 bl get_map_light_level_from_warp lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sav1_map_get_light_level thumb_func_start get_map_light_from_warp0 get_map_light_from_warp0: ; 8085BBC push {lr} ldr r0, =0x020322dc bl get_map_light_level_from_warp lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end get_map_light_from_warp0 thumb_func_start is_light_level_1_2_3_5_or_6 is_light_level_1_2_3_5_or_6: ; 8085BD0 push {lr} lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 beq @08085BEA cmp r0, 0x1 beq @08085BEA cmp r0, 0x5 beq @08085BEA cmp r0, 0x2 beq @08085BEA cmp r0, 0x6 bne @08085BEE @08085BEA: movs r0, 0x1 b @08085BF0 @08085BEE: movs r0, 0 @08085BF0: pop {r1} bx r1 thumb_func_end is_light_level_1_2_3_5_or_6 thumb_func_start is_light_level_1_2_3_or_6 is_light_level_1_2_3_or_6: ; 8085BF4 push {lr} lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 beq @08085C0A cmp r0, 0x1 beq @08085C0A cmp r0, 0x6 beq @08085C0A cmp r0, 0x2 bne @08085C0E @08085C0A: movs r0, 0x1 b @08085C10 @08085C0E: movs r0, 0 @08085C10: pop {r1} bx r1 thumb_func_end is_light_level_1_2_3_or_6 thumb_func_start is_light_level_8_or_9 is_light_level_8_or_9: ; 8085C14 push {lr} lsls r0, 24 movs r1, 0xF8 lsls r1, 24 adds r0, r1 lsrs r0, 24 cmp r0, 0x1 bls @08085C28 movs r0, 0 b @08085C2A @08085C28: movs r0, 0x1 @08085C2A: pop {r1} bx r1 thumb_func_end is_light_level_8_or_9 thumb_func_start sav1_saved_warp2_map_get_name sav1_saved_warp2_map_get_name: ; 8085C30 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0x14 ldrsb r0, [r1, r0] lsls r0, 16 lsrs r0, 16 ldrb r1, [r1, 0x15] lsls r1, 24 asrs r1, 24 lsls r1, 16 lsrs r1, 16 bl get_mapheader_by_bank_and_number ldrb r0, [r0, 0x14] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sav1_saved_warp2_map_get_name thumb_func_start sav1_map_get_name sav1_map_get_name: ; 8085C58 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] lsls r0, 16 lsrs r0, 16 ldrb r1, [r1, 0x5] lsls r1, 24 asrs r1, 24 lsls r1, 16 lsrs r1, 16 bl get_mapheader_by_bank_and_number ldrb r0, [r0, 0x14] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sav1_map_get_name thumb_func_start sav1_map_get_battletype sav1_map_get_battletype: ; 8085C80 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] lsls r0, 16 lsrs r0, 16 ldrb r1, [r1, 0x5] lsls r1, 24 asrs r1, 24 lsls r1, 16 lsrs r1, 16 bl get_mapheader_by_bank_and_number ldrb r0, [r0, 0x1B] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sav1_map_get_battletype thumb_func_start overworld_bg_setup ; void overworld_bg_setup() overworld_bg_setup: ; 8085CA8 push {r4-r6,lr} mov r6, r8 push {r6} ldr r1, =gUnknown_08339DAC movs r0, 0 movs r2, 0x4 bl 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, =0x03005da0 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, =0x03005d9c adds r0, r4, 0 bl malloc_and_clear str r0, [r6] ldr r5, =0x03005da4 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 .pool thumb_func_end overworld_bg_setup thumb_func_start overworld_free_bg_tilemaps overworld_free_bg_tilemaps: ; 8085D34 push {r4,lr} bl sub_81BE72C bl sub_81971F4 ldr r4, =0x03005da4 ldr r0, [r4] cmp r0, 0 beq @08085D4E bl free movs r0, 0 str r0, [r4] @08085D4E: ldr r4, =0x03005d9c ldr r0, [r4] cmp r0, 0 beq @08085D5E bl free movs r0, 0 str r0, [r4] @08085D5E: ldr r4, =0x03005da0 ldr r0, [r4] cmp r0, 0 beq @08085D6E bl free movs r0, 0 str r0, [r4] @08085D6E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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 ; _BOOL4 is_c1_link_related_active() is_c1_link_related_active: ; 8085D8C push {lr} ldr r0, =0x030022c0 ldr r1, [r0] ldr r0, =c1_link_related cmp r1, r0 beq @08085DA4 movs r0, 0 b @08085DA6 .align 2, 0 .pool @08085DA4: movs r0, 0x1 @08085DA6: pop {r1} bx r1 thumb_func_end is_c1_link_related_active thumb_func_start c1_overworld_normal ; void c1_overworld_normal(int buttons_new, int buttons_held) c1_overworld_normal: ; 8085DAC push {r4-r6,lr} sub sp, 0x4 lsls r0, 16 lsrs r0, 16 adds r5, r0, 0 lsls r1, 16 lsrs r1, 16 adds r4, r1, 0 bl sub_808B578 mov r6, sp mov r0, sp bl sub_809BEDC mov r0, sp adds r1, r5, 0 adds r2, r4, 0 bl process_overworld_input bl script_env_2_is_enabled lsls r0, 24 cmp r0, 0 bne @08085DFA mov r0, sp bl sub_809C014 cmp r0, 0x1 bne @08085DF0 bl script_env_2_enable bl 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, =0x030022c0 ldr r1, [r2, 0x4] ldr r0, =c2_overworld cmp r1, r0 bne @08085E18 ldrh r0, [r2, 0x2E] ldrh r1, [r2, 0x2C] bl c1_overworld_normal @08085E18: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r0, [r0, 0x7] lsrs r0, 7 adds r4, r0, 0 cmp r4, 0 beq @08085E70 movs r0, 0 bl SetVBlankCallback @08085E70: bl c2_overworld_basic cmp r4, 0 beq @08085E7C bl set_vblank_callback_8086390 @08085E7C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_overworld thumb_func_start set_callback1 set_callback1: ; 8085E88 ldr r1, =0x030022c0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end set_callback1 thumb_func_start sub_8085E94 sub_8085E94: ; 8085E94 ldr r1, =0x03000e0c str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8085E94 thumb_func_start map_post_load_hook_exec map_post_load_hook_exec: ; 8085EA0 push {r4,lr} ldr r4, =0x03005db0 ldr r0, [r4] cmp r0, 0 beq @08085ECC bl _call_via_r0 lsls r0, 24 cmp r0, 0 bne @08085EBC movs r0, 0 b @08085EEC .align 2, 0 .pool @08085EBC: movs r1, 0 str r1, [r4] ldr r0, =0x03005dac str r1, [r0] b @08085EEA .align 2, 0 .pool @08085ECC: ldr r0, =0x03005dac ldr r0, [r0] cmp r0, 0 beq @08085EE0 bl _call_via_r0 b @08085EE4 .align 2, 0 .pool @08085EE0: bl mapldr_default @08085EE4: ldr r1, =0x03005dac movs r0, 0 str r0, [r1] @08085EEA: movs r0, 0x1 @08085EEC: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005dac ldr r0, =sub_80FB4E0 str r0, [r1] ldr r1, =0x03005db0 movs r0, 0 str r0, [r1] ldr r0, =0x030026f8 bl do_load_map_stuff_loop bl set_vblank_callback_8086390 ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_new_game thumb_func_start c2_whiteout c2_whiteout: ; 8085F58 push {lr} sub sp, 0x4 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x77 bls @08085FB0 bl sub_808631C bl sub_80A2F30 bl 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, =0x03005dac ldr r0, =sub_80AF3C8 str r0, [r1] mov r1, sp movs r0, 0 strb r0, [r1] mov r0, sp bl do_load_map_stuff_loop bl set_vblank_callback_8086390 ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld bl set_callback2 @08085FB0: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_whiteout thumb_func_start c2_load_new_map c2_load_new_map: ; 8085FCC push {lr} bl sub_808631C bl script_env_1_init bl script_env_2_disable movs r0, 0 bl set_callback1 ldr r0, =c2_change_map bl set_callback2 ldr r1, =0x030022c0 ldr r0, =c2_load_new_map_2 str r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_load_new_map thumb_func_start c2_load_new_map_2 c2_load_new_map_2: ; 8085FFC push {lr} ldr r0, =0x030026f8 bl do_load_map_stuff_loop bl set_vblank_callback_8086390 ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_load_new_map_2 thumb_func_start sub_8086024 sub_8086024: ; 8086024 push {r4,lr} ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r4, r0, r1 ldrb r0, [r4] cmp r0, 0 bne @08086046 bl sub_808631C bl script_env_1_init bl script_env_2_disable movs r0, 0 bl set_callback1 @08086046: adds r0, r4, 0 movs r1, 0x1 bl load_map_stuff cmp r0, 0 beq @08086062 bl set_vblank_callback_8086390 ldr r0, =c1_overworld bl set_callback1 ldr r0, =c2_overworld bl set_callback2 @08086062: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086024 thumb_func_start sub_8086074 sub_8086074: ; 8086074 push {lr} bl sub_808631C ldr r0, =0x03005dac ldr r1, =sub_80AF314 str r1, [r0] ldr r0, =c2_80567AC bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086074 thumb_func_start c2_80567AC c2_80567AC: ; 8086098 push {lr} ldr r0, =0x030026f8 bl map_loading_iteration_3 cmp r0, 0 beq @080860B8 bl set_vblank_callback_8086390 ldr r0, =c1_link_related bl set_callback1 bl sub_8086C2C ldr r0, =c2_overworld bl set_callback2 @080860B8: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_80567AC thumb_func_start c2_exit_to_overworld_2_switch c2_exit_to_overworld_2_switch: ; 80860C8 push {lr} bl is_c1_link_related_active cmp r0, 0x1 bne @080860E0 ldr r0, =c2_exit_to_overworld_2_link bl set_callback2 b @080860EA .align 2, 0 .pool @080860E0: bl sub_808631C ldr r0, =c2_exit_to_overworld_2_local bl set_callback2 @080860EA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_exit_to_overworld_2_switch thumb_func_start c2_exit_to_overworld_2_local c2_exit_to_overworld_2_local: ; 80860F4 push {lr} ldr r0, =0x030026f8 bl sub_8086638 cmp r0, 0 beq @0808610A bl set_vblank_callback_8086390 ldr r0, =c2_overworld bl set_callback2 @0808610A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_exit_to_overworld_2_local thumb_func_start c2_exit_to_overworld_2_link c2_exit_to_overworld_2_link: ; 8086118 push {lr} bl sub_8087598 cmp r0, 0 bne @08086132 ldr r0, =0x030026f8 bl map_loading_iteration_2_link cmp r0, 0 beq @08086132 ldr r0, =c2_overworld bl set_callback2 @08086132: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_exit_to_overworld_2_link thumb_func_start c2_8056854 c2_8056854: ; 8086140 push {lr} bl sub_808631C bl sub_80A2F30 ldr r0, =c1_link_related bl set_callback1 bl sub_8086C2C ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08086174 ldr r1, =0x03005dac ldr r0, =sub_80AF314 b @08086178 .align 2, 0 .pool @08086174: ldr r1, =0x03005dac ldr r0, =sub_80AF214 @08086178: str r0, [r1] bl script_env_1_init bl script_env_2_disable bl c2_exit_to_overworld_2_switch pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_8056854 thumb_func_start sub_8086194 sub_8086194: ; 8086194 push {lr} bl sub_808631C ldr r1, =0x03005db0 ldr r0, =sub_80AF6A4 str r0, [r1] bl c2_exit_to_overworld_2_switch pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086194 thumb_func_start sub_80861B0 sub_80861B0: ; 80861B0 push {lr} bl sub_808631C ldr r1, =0x03005dac ldr r0, =sub_80AF188 str r0, [r1] bl c2_exit_to_overworld_2_switch pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80861B0 thumb_func_start c2_exit_to_overworld_1_continue_scripts_restart_music c2_exit_to_overworld_1_continue_scripts_restart_music: ; 80861CC push {lr} bl sub_808631C ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] bl c2_exit_to_overworld_2_switch pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_exit_to_overworld_1_continue_scripts_restart_music thumb_func_start sub_80861E8 sub_80861E8: ; 80861E8 push {lr} bl sub_808631C ldr r1, =0x03005dac ldr r0, =sub_80AF3C8 str r0, [r1] bl c2_exit_to_overworld_2_switch pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80861E8 thumb_func_start sub_8086204 sub_8086204: ; 8086204 push {lr} ldr r0, =0x02037318 ldrb r1, [r0, 0x1A] movs r0, 0xF8 ands r0, r1 cmp r0, 0x8 bne @08086222 bl sub_80E909C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08086222 bl sub_80D47E4 @08086222: bl sub_80AF3C8 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006210 ldrh r0, [r0] cmp r0, 0xFF bne @0808624A bl sub_81A3908 @0808624A: bl set_current_map_header_from_sav1 bl set_warp2_warp3_to_neg_1 bl sub_81D609C lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02037318 ldrh r1, [r0, 0x12] ldr r0, =0x00000169 cmp r1, r0 bne @08086278 bl sub_81AA2F8 b @0808628A .align 2, 0 .pool @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, =0x02037318 ldrh r1, [r0, 0x12] ldr r0, =0x00000169 cmp r1, r0 bne @080862B0 movs r0, 0x1 bl sub_8087DAC b @080862BE .align 2, 0 .pool @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, =c2_load_new_map bl set_callback2 b @08086308 .align 2, 0 .pool @080862F4: bl sub_80EDB44 ldr r0, =0x03005dac ldr r1, =sub_8086204 str r1, [r0] ldr r0, =c1_overworld bl set_callback1 bl c2_exit_to_overworld_2_switch @08086308: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086230 thumb_func_start sub_808631C ; void sub_808631C() sub_808631C: ; 808631C push {r4,lr} bl warp0_in_pokecenter lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0808632E bl sub_80097E8 @0808632E: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08086348 movs r0, 0xC5 bl enable_irqs movs r0, 0x2 bl disable_irqs b @08086362 .align 2, 0 .pool @08086348: ldr r4, =0x04000208 ldrh r3, [r4] strh r0, [r4] ldr r2, =0x04000200 ldrh r1, [r2] ldr r0, =0x0000fffd ands r0, r1 strh r0, [r2] ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] strh r3, [r4] @08086362: movs r0, 0 bl SetVBlankCallback movs r0, 0 bl SetHBlankCallback pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808631C thumb_func_start set_vblank_callback_8086390 set_vblank_callback_8086390: ; 8086380 push {lr} ldr r0, =vblank_cb_8086390 bl SetVBlankCallback pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08339DBC ldr r0, [r2] ldr r1, [r2, 0x4] ldr r2, [r2, 0x8] bl sub_80BA038 b @080863F0 .align 2, 0 .pool @080863D4: bl sav1_get_flash_used_on_map lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @080863F0 bl sub_80B00E8 ldr r2, =gUnknown_08339DBC ldr r0, [r2] ldr r1, [r2, 0x4] ldr r2, [r2, 0x8] bl sub_80BA038 @080863F0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80863B0 thumb_func_start map_loading_iteration_3 map_loading_iteration_3: ; 80863F8 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0xD bls @08086404 b @08086512 @08086404: lsls r0, 2 ldr r1, =@08086414 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08086414: .4byte @0808644C .4byte @08086462 .4byte @0808646A .4byte @08086472 .4byte @08086484 .4byte @08086492 .4byte @08086498 .4byte @080864A8 .4byte @080864B8 .4byte @080864D4 .4byte @080864DA .4byte @080864E0 .4byte @080864FC .4byte @0808650E @0808644C: bl overworld_bg_setup bl script_env_1_init bl script_env_2_disable bl saveblock_randomize_and_relocate_ bl sub_80867D8 b @08086506 @08086462: movs r0, 0x1 bl mli0_load_map b @08086506 @0808646A: movs r0, 0x1 bl sub_8086988 b @08086506 @08086472: bl sub_8086AE4 bl sub_80869DC bl sub_8086B14 bl sub_8086AAC b @08086506 @08086484: bl sub_80863B0 bl map_loading_lcd_reset bl sub_8197200 b @08086506 @08086492: bl move_tilemap_camera_to_upper_left_corner b @08086506 @08086498: ldr r0, =0x02037318 ldr r0, [r0] bl copy_map_tileset1_to_vram b @08086506 .align 2, 0 .pool @080864A8: ldr r0, =0x02037318 ldr r0, [r0] bl copy_map_tileset2_to_vram b @08086506 .align 2, 0 .pool @080864B8: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08086512 ldr r0, =0x02037318 ldr r0, [r0] bl apply_map_tileset1_tileset2_palette b @08086506 .align 2, 0 .pool @080864D4: bl cur_mapdata_full_redraw b @08086506 @080864DA: bl cur_mapheader_run_tileset_funcs_after_some_cpuset b @08086506 @080864E0: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08086506 bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 b @08086506 .align 2, 0 .pool @080864FC: bl map_post_load_hook_exec lsls r0, 24 cmp r0, 0 beq @08086512 @08086506: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @08086512 @0808650E: movs r0, 0x1 b @08086514 @08086512: movs r0, 0 @08086514: pop {r4} pop {r1} bx r1 thumb_func_end map_loading_iteration_3 thumb_func_start load_map_stuff ; int load_map_stuff(u8 *a1, int a2) load_map_stuff: ; 808651C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4] cmp r0, 0xD bls @0808652A b @0808662E @0808652A: lsls r0, 2 ldr r1, =@08086538 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08086538: .4byte @08086570 .4byte @0808657C .4byte @08086586 .4byte @0808658E .4byte @08086598 .4byte @080865A6 .4byte @080865AC .4byte @080865BC .4byte @080865CC .4byte @080865E8 .4byte @080865EE .4byte @080865F4 .4byte @08086618 .4byte @0808662A @08086570: bl sub_808631C adds r0, r5, 0 bl mli0_load_map b @08086622 @0808657C: bl saveblock_randomize_and_relocate_ bl sub_80867D8 b @08086622 @08086586: adds r0, r5, 0 bl sub_8086988 b @08086622 @0808658E: bl mli4_mapscripts_and_other bl sub_8086A80 b @08086622 @08086598: bl sub_80863B0 bl map_loading_lcd_reset bl sub_8197200 b @08086622 @080865A6: bl move_tilemap_camera_to_upper_left_corner b @08086622 @080865AC: ldr r0, =0x02037318 ldr r0, [r0] bl copy_map_tileset1_to_vram b @08086622 .align 2, 0 .pool @080865BC: ldr r0, =0x02037318 ldr r0, [r0] bl copy_map_tileset2_to_vram b @08086622 .align 2, 0 .pool @080865CC: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0808662E ldr r0, =0x02037318 ldr r0, [r0] bl apply_map_tileset1_tileset2_palette b @08086622 .align 2, 0 .pool @080865E8: bl cur_mapdata_full_redraw b @08086622 @080865EE: bl cur_mapheader_run_tileset_funcs_after_some_cpuset b @08086622 @080865F4: ldr r0, =0x02037318 ldrb r1, [r0, 0x1A] movs r0, 0xF8 ands r0, r1 cmp r0, 0x8 bne @08086622 bl sub_80E909C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08086622 bl sub_80D47E4 b @08086622 .align 2, 0 .pool @08086618: bl map_post_load_hook_exec lsls r0, 24 cmp r0, 0 beq @0808662E @08086622: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @0808662E @0808662A: movs r0, 0x1 b @08086630 @0808662E: movs r0, 0 @08086630: pop {r4,r5} pop {r1} bx r1 thumb_func_end load_map_stuff thumb_func_start sub_8086638 sub_8086638: ; 8086638 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0x1 beq @0808666E cmp r0, 0x1 bgt @0808664C cmp r0, 0 beq @08086656 b @0808668E @0808664C: cmp r0, 0x2 beq @08086678 cmp r0, 0x3 beq @0808668A b @0808668E @08086656: bl saveblock_randomize_and_relocate_ bl sub_80867D8 movs r0, 0 bl sub_8086988 bl sub_8086A68 bl sub_8086A80 b @08086682 @0808666E: bl sub_8086860 bl sub_81D64C0 b @08086682 @08086678: bl map_post_load_hook_exec lsls r0, 24 cmp r0, 0 beq @0808668E @08086682: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @0808668E @0808668A: movs r0, 0x1 b @08086690 @0808668E: movs r0, 0 @08086690: pop {r4} pop {r1} bx r1 thumb_func_end sub_8086638 thumb_func_start map_loading_iteration_2_link map_loading_iteration_2_link: ; 8086698 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0xD bls @080866A4 b @080867A8 @080866A4: lsls r0, 2 ldr r1, =@080866B4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080866B4: .4byte @080866EC .4byte @080866FA .4byte @08086702 .4byte @08086710 .4byte @0808671E .4byte @08086724 .4byte @08086734 .4byte @08086744 .4byte @08086760 .4byte @08086766 .4byte @08086792 .4byte @0808676C .4byte @08086788 .4byte @0808679A @080866EC: bl sub_808631C bl saveblock_randomize_and_relocate_ bl sub_80867D8 b @08086792 @080866FA: movs r0, 0x1 bl sub_8086988 b @08086792 @08086702: bl sub_8086B9C bl sub_8086A68 bl sub_8086AC8 b @08086792 @08086710: bl sub_80863B0 bl map_loading_lcd_reset bl sub_8197200 b @08086792 @0808671E: bl move_tilemap_camera_to_upper_left_corner b @08086792 @08086724: ldr r0, =0x02037318 ldr r0, [r0] bl copy_map_tileset1_to_vram b @08086792 .align 2, 0 .pool @08086734: ldr r0, =0x02037318 ldr r0, [r0] bl copy_map_tileset2_to_vram b @08086792 .align 2, 0 .pool @08086744: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080867A8 ldr r0, =0x02037318 ldr r0, [r0] bl apply_map_tileset1_tileset2_palette b @08086792 .align 2, 0 .pool @08086760: bl cur_mapdata_full_redraw b @08086792 @08086766: bl cur_mapheader_run_tileset_funcs_after_some_cpuset b @08086792 @0808676C: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08086792 bl sub_800E0E8 movs r0, 0 movs r1, 0 bl sub_800DFB4 b @08086792 .align 2, 0 .pool @08086788: bl map_post_load_hook_exec lsls r0, 24 cmp r0, 0 beq @080867A8 @08086792: ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @080867A8 @0808679A: bl 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, =0x05000002 mov r1, sp movs r0, 0 strh r0, [r1] ldr r1, =0x040000d4 mov r0, sp str r0, [r1] str r2, [r1, 0x4] ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] movs r2, 0xC0 lsls r2, 19 movs r3, 0xC0 lsls r3, 9 mov r4, sp movs r6, 0 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 movs r0, 0x81 lsls r0, 24 mov r12, r0 @08086816: strh r6, [r4] mov r0, sp str r0, [r1] str r2, [r1, 0x4] str r7, [r1, 0x8] ldr r0, [r1, 0x8] adds r2, r5 subs r3, r5 cmp r3, r5 bhi @08086816 strh r6, [r4] mov r0, sp str r0, [r1] str r2, [r1, 0x4] lsrs r0, r3, 1 mov r2, r12 orrs r0, r2 str r0, [r1, 0x8] ldr r0, [r1, 0x8] movs r0, 0 movs r1, 0x80 bl reset_super_sprites bl copy_super_sprites_to_oam add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80867D8 thumb_func_start sub_8086860 sub_8086860: ; 8086860 push {lr} bl sub_80863B0 bl map_loading_lcd_reset bl sub_8197200 bl mapdata_load_assets_to_gpu_and_full_redraw pop {r0} bx r0 thumb_func_end sub_8086860 thumb_func_start map_loading_lcd_reset map_loading_lcd_reset: ; 8086878 push {r4,lr} bl clear_scheduled_bg_copies_to_vram bl reset_temp_tile_data_buffers movs r0, 0x4C movs r1, 0 bl lcd_io_set ldr r1, =0x00001f1f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00000101 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, =0x0000ffff movs r0, 0x42 adds r1, r4, 0 bl lcd_io_set movs r0, 0x46 adds r1, r4, 0 bl lcd_io_set ldr r0, =gUnknown_82EC7C4 ldrh r1, [r0, 0x2] ldrh r2, [r0, 0x4] orrs r1, r2 ldrh r0, [r0, 0x6] orrs r1, r0 movs r2, 0x82 lsls r2, 5 adds r0, r2, 0 orrs r1, r0 movs r0, 0x50 bl lcd_io_set ldr r1, =0x0000070d 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, =0x00007060 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 .pool thumb_func_end map_loading_lcd_reset thumb_func_start sub_8086988 sub_8086988: ; 8086988 push {r4,lr} adds r4, r0, 0 bl clear_tasks bl 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, =0x03005dec movs r1, 0 strh r1, [r0] ldr r0, =0x03005de8 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 .pool thumb_func_end sub_80869DC thumb_func_start mli4_mapscripts_and_other mli4_mapscripts_and_other: ; 8086A04 push {r4,r5,lr} sub sp, 0x4 ldr r0, =0x03005dec movs r1, 0 strh r1, [r0] ldr r0, =0x03005de8 strh r1, [r0] bl sub_808D438 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl sav1_camera_get_focus_coords bl sub_80852D4 adds r5, r0, 0 mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] ldrb r2, [r5, 0x1] ldr r3, =0x03005d90 ldr r3, [r3] ldrb r3, [r3, 0x8] bl 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 .pool thumb_func_end mli4_mapscripts_and_other thumb_func_start sub_8086A68 sub_8086A68: ; 8086A68 push {lr} movs r0, 0 movs r1, 0 bl sub_808E16C bl sub_80FBED0 bl mapheader_run_script_with_tag_x7 pop {r0} bx r0 thumb_func_end sub_8086A68 thumb_func_start sub_8086A80 sub_8086A80: ; 8086A80 push {lr} ldr r2, =0x02037350 ldr r3, =0x02037590 ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x80 orrs r1, r2 strb r1, [r0, 0x1] ldrb r0, [r3, 0x4] bl sub_808A134 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086A80 thumb_func_start sub_8086AAC sub_8086AAC: ; 8086AAC push {lr} ldr r0, =0x03005db4 ldrb r0, [r0] bl sub_8087858 lsls r0, 24 lsrs r0, 24 bl sub_808A134 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086AAC thumb_func_start sub_8086AC8 sub_8086AC8: ; 8086AC8 push {lr} ldr r0, =0x03005db4 ldrb r0, [r0] bl sub_8087858 lsls r0, 24 lsrs r0, 24 bl sub_808A134 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086AC8 thumb_func_start sub_8086AE4 sub_8086AE4: ; 8086AE4 push {r4,lr} sub sp, 0x4 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl sav1_camera_get_focus_coords mov r2, sp ldr r0, =0x03005db4 ldrb r1, [r0] ldrh r0, [r2] adds r0, r1 lsls r0, 16 lsrs r0, 16 ldrh r1, [r4] bl sub_8088B3C add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086AE4 thumb_func_start sub_8086B14 sub_8086B14: ; 8086B14 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl sav1_camera_get_focus_coords mov r3, sp mov r2, sp ldr r0, =0x03005db4 ldrb r1, [r0] ldrh r0, [r2] subs r0, r1 strh r0, [r3] movs r6, 0 ldr r0, =0x03005db8 mov r8, r4 ldrb r0, [r0] cmp r6, r0 bcs @08086B7E ldr r7, =0x020229e8 @08086B44: lsls r5, r6, 24 lsrs r5, 24 mov r0, sp ldrh r1, [r0] adds r1, r6, r1 lsls r1, 16 asrs r1, 16 mov r0, r8 movs r3, 0 ldrsh r2, [r0, r3] lsls r4, r6, 3 subs r4, r6 lsls r4, 2 adds r4, r7 ldrb r3, [r4, 0x13] adds r0, r5, 0 bl sub_80876F0 ldrb r1, [r4] adds r0, r5, 0 bl sub_8087BCC adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 ldr r0, =0x03005db8 ldrb r0, [r0] cmp r6, r0 bcc @08086B44 @08086B7E: bl sub_8086C40 add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086B14 thumb_func_start sub_8086B9C sub_8086B9C: ; 8086B9C push {r4,r5,lr} movs r4, 0 ldr r0, =0x03005db8 ldrb r0, [r0] cmp r4, r0 bcs @08086BCA ldr r5, =0x020229e8 @08086BAA: lsls r0, r4, 24 lsrs r0, 24 lsls r1, r4, 3 subs r1, r4 lsls r1, 2 adds r1, r5 ldrb r1, [r1] bl sub_8087BCC adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x03005db8 ldrb r0, [r0] cmp r4, r0 bcc @08086BAA @08086BCA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086B9C thumb_func_start c1_link_related c1_link_related: ; 8086BD8 push {r4,lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08086BF2 bl sub_800F0B8 cmp r0, 0 beq @08086BF2 bl sub_8009F3C cmp r0, 0 bne @08086C14 @08086BF2: ldr r0, =0x03005db4 ldrb r4, [r0] ldr r0, =0x03003020 adds r1, r4, 0 bl sub_8086F38 ldr r0, =0x03000e14 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 16 lsrs r0, 16 bl sub_8086FA0 bl sub_8086C40 @08086C14: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c1_link_related thumb_func_start sub_8086C2C sub_8086C2C: ; 8086C2C push {lr} bl sub_8086C90 ldr r0, =sub_80870B0 bl c1_link_related_func_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086C2C thumb_func_start sub_8086C40 sub_8086C40: ; 8086C40 push {lr} ldr r0, =0x03003020 bl sub_808709C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086C40 thumb_func_start c1_link_related_func_set c1_link_related_func_set: ; 8086C50 ldr r2, =0x03000e19 movs r1, 0 strb r1, [r2] ldr r1, =0x03000e14 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end c1_link_related_func_set thumb_func_start sub_8086C64 sub_8086C64: ; 8086C64 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08086C82 ldr r1, =0x03000e19 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x3C bls @08086C82 bl sub_8010198 @08086C82: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086C64 thumb_func_start sub_8086C90 sub_8086C90: ; 8086C90 push {lr} ldr r1, =0x03000e10 movs r2, 0x80 adds r0, r1, 0x3 @08086C98: strb r2, [r0] subs r0, 0x1 cmp r0, r1 bge @08086C98 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086C90 thumb_func_start sub_8086CA8 sub_8086CA8: ; 8086CA8 push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 ldr r0, =0x03005db8 ldrb r2, [r0] movs r1, 0 cmp r1, r2 bge @08086CD6 ldr r4, =0x03000e10 @08086CBA: adds r0, r1, r4 ldrb r0, [r0] cmp r0, r3 beq @08086CD0 movs r0, 0 b @08086CD8 .align 2, 0 .pool @08086CD0: adds r1, 0x1 cmp r1, r2 blt @08086CBA @08086CD6: movs r0, 0x1 @08086CD8: pop {r4} pop {r1} bx r1 thumb_func_end sub_8086CA8 thumb_func_start sub_8086CE0 sub_8086CE0: ; 8086CE0 push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 ldr r0, =0x03005db8 ldrb r2, [r0] movs r1, 0 cmp r1, r2 bge @08086D0E ldr r4, =0x03000e10 @08086CF2: adds r0, r1, r4 ldrb r0, [r0] cmp r0, r3 bne @08086D08 movs r0, 0x1 b @08086D10 .align 2, 0 .pool @08086D08: adds r1, 0x1 cmp r1, r2 blt @08086CF2 @08086D0E: movs r0, 0 @08086D10: pop {r4} pop {r1} bx r1 thumb_func_end sub_8086CE0 thumb_func_start sub_8086D18 sub_8086D18: ; 8086D18 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r7, r0, 0 adds r6, r2, 0 mov r9, r3 lsls r1, 16 lsrs r1, 16 mov r8, r1 ldr r0, =0x03000e10 adds r5, r7, r0 ldrb r0, [r5] cmp r0, 0x80 beq @08086D38 b @08086EB2 @08086D38: adds r0, r6, 0 bl sub_8087370 adds r4, r0, 0 cmp r4, 0 beq @08086D70 bl sub_8087480 mov r1, r9 strh r0, [r1] movs r0, 0x81 strb r0, [r5] ldrb r0, [r6, 0x1] cmp r0, 0 bne @08086D58 b @08086F26 @08086D58: ldr r0, =sub_80870F8 bl c1_link_related_func_set adds r0, r4, 0 bl sub_8087530 b @08086F26 .align 2, 0 .pool @08086D70: movs r0, 0x83 bl sub_8086CE0 cmp r0, 0x1 bne @08086D98 movs r0, 0x81 strb r0, [r5] ldrb r0, [r6, 0x1] cmp r0, 0 bne @08086D86 b @08086F26 @08086D86: ldr r0, =sub_80870F8 bl c1_link_related_func_set bl sub_8087584 b @08086F26 .align 2, 0 .pool @08086D98: mov r0, r8 subs r0, 0x12 cmp r0, 0xA bls @08086DA2 b @08086EB2 @08086DA2: lsls r0, 2 ldr r1, =@08086DB0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08086DB0: .4byte @08086E08 .4byte @08086EB2 .4byte @08086EB2 .4byte @08086EB2 .4byte @08086EB2 .4byte @08086EB2 .4byte @08086DDC .4byte @08086E34 .4byte @08086EB2 .4byte @08086E64 .4byte @08086E90 @08086DDC: adds r0, r6, 0 bl sub_8087358 cmp r0, 0 beq @08086EB2 ldr r0, =0x03000e10 adds r0, r7, r0 movs r1, 0x81 strb r1, [r0] ldrb r0, [r6, 0x1] cmp r0, 0 beq @08086EB2 ldr r0, =sub_80870F8 bl c1_link_related_func_set bl sub_808751C b @08086EB2 .align 2, 0 .pool @08086E08: adds r0, r6, 0 bl sub_8087388 cmp r0, 0x1 bne @08086EB2 ldr r0, =0x03000e10 adds r0, r7, r0 movs r1, 0x81 strb r1, [r0] ldrb r0, [r6, 0x1] cmp r0, 0 beq @08086EB2 ldr r0, =sub_80870F8 bl c1_link_related_func_set bl sub_808754C b @08086EB2 .align 2, 0 .pool @08086E34: adds r0, r6, 0 bl sub_80873B4 adds r4, r0, 0 cmp r4, 0 beq @08086EB2 ldr r0, =0x03000e10 adds r0, r7, r0 movs r1, 0x81 strb r1, [r0] ldrb r0, [r6, 0x1] cmp r0, 0 beq @08086EB2 ldr r0, =sub_80870F8 bl c1_link_related_func_set adds r0, r4, 0 bl sub_8087568 b @08086EB2 .align 2, 0 .pool @08086E64: adds r0, r6, 0 bl sub_8087340 cmp r0, 0 beq @08086EB2 ldr r0, =0x03000e10 adds r0, r7, r0 movs r1, 0x81 strb r1, [r0] ldrb r0, [r6, 0x1] cmp r0, 0 beq @08086EB2 ldr r0, =sub_808711C bl c1_link_related_func_set bl sub_8087510 b @08086EB2 .align 2, 0 .pool @08086E90: adds r0, r6, 0 bl sub_8087340 cmp r0, 0 beq @08086EB2 ldr r0, =0x03000e10 adds r0, r7, r0 movs r1, 0x81 strb r1, [r0] ldrb r0, [r6, 0x1] cmp r0, 0 beq @08086EB2 ldr r0, =sub_8087140 bl c1_link_related_func_set bl sub_8087510 @08086EB2: mov r0, r8 cmp r0, 0x17 beq @08086ED8 cmp r0, 0x17 bgt @08086ECC cmp r0, 0x16 beq @08086EE8 b @08086F26 .align 2, 0 .pool @08086ECC: mov r1, r8 cmp r1, 0x1A beq @08086EF8 cmp r1, 0x1D beq @08086F18 b @08086F26 @08086ED8: ldr r0, =0x03000e10 adds r0, r7, r0 movs r1, 0x83 strb r1, [r0] b @08086F26 .align 2, 0 .pool @08086EE8: ldr r0, =0x03000e10 adds r0, r7, r0 movs r1, 0x82 strb r1, [r0] b @08086F26 .align 2, 0 .pool @08086EF8: ldr r0, =0x03000e10 adds r0, r7, r0 movs r1, 0x80 strb r1, [r0] ldrb r0, [r6, 0x1] cmp r0, 0 beq @08086F26 ldr r0, =sub_80870B0 bl c1_link_related_func_set b @08086F26 .align 2, 0 .pool @08086F18: ldr r0, =0x03000e10 adds r1, r7, r0 ldrb r0, [r1] cmp r0, 0x82 bne @08086F26 movs r0, 0x81 strb r0, [r1] @08086F26: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086D18 thumb_func_start sub_8086F38 sub_8086F38: ; 8086F38 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x14 mov r8, r1 movs r6, 0 add r5, sp, 0x10 mov r9, r5 adds r7, r0, 0 @08086F4C: ldrb r4, [r7] movs r0, 0 strh r0, [r5] adds r0, r6, 0 mov r1, r8 mov r2, sp bl sub_80872D8 adds r0, r6, 0 adds r1, r4, 0 mov r2, sp adds r3, r5, 0 bl sub_8086D18 ldr r0, =0x03000e10 adds r0, r6, r0 ldrb r0, [r0] cmp r0, 0x80 bne @08086F7C adds r0, r4, 0 bl sub_8087068 mov r1, r9 strh r0, [r1] @08086F7C: lsls r0, r6, 24 lsrs r0, 24 ldrb r1, [r5] bl sub_808796C adds r7, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @08086F4C add sp, 0x14 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086F38 thumb_func_start sub_8086FA0 sub_8086FA0: ; 8086FA0 push {r4,lr} lsls r0, 16 lsrs r4, r0, 16 ldr r1, =0xffef0000 adds r0, r1 lsrs r0, 16 cmp r0, 0xC bhi @08086FC0 ldr r0, =0x03005da8 strh r4, [r0] b @08086FC6 .align 2, 0 .pool @08086FC0: ldr r1, =0x03005da8 movs r0, 0x11 strh r0, [r1] @08086FC6: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08086FFC bl sub_8087690 cmp r0, 0x1 bls @08086FFC bl is_c1_link_related_active cmp r0, 0x1 bne @08086FFC bl sub_8009F3C cmp r0, 0x1 bne @08086FFC cmp r4, 0x11 blt @08086FFC cmp r4, 0x15 ble @08086FF6 cmp r4, 0x19 bgt @08086FFC cmp r4, 0x18 blt @08086FFC @08086FF6: ldr r1, =0x03005da8 movs r0, 0 strh r0, [r1] @08086FFC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8086FA0 thumb_func_start sub_808700C sub_808700C: ; 808700C push {lr} ldr r2, =0x030022c0 ldrh r1, [r2, 0x2C] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @08087024 movs r0, 0x13 b @08087064 .align 2, 0 .pool @08087024: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08087030 movs r0, 0x12 b @08087064 @08087030: movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @0808703C movs r0, 0x14 b @08087064 @0808703C: movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08087048 movs r0, 0x15 b @08087064 @08087048: ldrh r1, [r2, 0x2E] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @08087056 movs r0, 0x18 b @08087064 @08087056: movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08087062 movs r0, 0x11 b @08087064 @08087062: movs r0, 0x19 @08087064: pop {r1} bx r1 thumb_func_end sub_808700C thumb_func_start sub_8087068 sub_8087068: ; 8087068 push {lr} lsls r0, 16 lsrs r0, 16 adds r1, r0, 0 cmp r0, 0x13 beq @0808708E cmp r0, 0x13 bgt @0808707E cmp r0, 0x12 beq @08087092 b @08087096 @0808707E: cmp r1, 0x14 beq @0808708A cmp r1, 0x15 bne @08087096 movs r0, 0x4 b @08087098 @0808708A: movs r0, 0x3 b @08087098 @0808708E: movs r0, 0x1 b @08087098 @08087092: movs r0, 0x2 b @08087098 @08087096: movs r0, 0 @08087098: pop {r1} bx r1 thumb_func_end sub_8087068 thumb_func_start sub_808709C sub_808709C: ; 808709C push {lr} movs r2, 0x11 adds r1, r0, 0x6 @080870A2: strh r2, [r1] subs r1, 0x2 cmp r1, r0 bge @080870A2 pop {r0} bx r0 thumb_func_end sub_808709C thumb_func_start sub_80870B0 sub_80870B0: ; 80870B0 push {r4,lr} adds r4, r0, 0 bl script_env_2_is_enabled lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080870C4 movs r0, 0x11 b @080870E6 @080870C4: bl sub_800B4DC cmp r0, 0x4 bls @080870D0 movs r0, 0x1B b @080870E6 @080870D0: bl sub_8087690 cmp r0, 0x4 bls @080870DC movs r0, 0x1C b @080870E6 @080870DC: adds r0, r4, 0 bl sub_808700C lsls r0, 16 lsrs r0, 16 @080870E6: pop {r4} pop {r1} bx r1 thumb_func_end sub_80870B0 thumb_func_start sub_80870EC sub_80870EC: ; 80870EC push {lr} bl sub_8086C64 movs r0, 0x11 pop {r1} bx r1 thumb_func_end sub_80870EC thumb_func_start sub_80870F8 sub_80870F8: ; 80870F8 push {r4,lr} bl script_env_2_is_enabled lsls r0, 24 lsrs r0, 24 movs r4, 0x11 cmp r0, 0x1 beq @08087110 movs r4, 0x1A ldr r0, =sub_80870EC bl c1_link_related_func_set @08087110: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80870F8 thumb_func_start sub_808711C sub_808711C: ; 808711C push {r4,lr} bl sub_800B4DC movs r4, 0x11 cmp r0, 0x2 bhi @08087134 movs r4, 0x1A bl script_env_2_disable ldr r0, =sub_80870EC bl c1_link_related_func_set @08087134: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808711C thumb_func_start sub_8087140 sub_8087140: ; 8087140 push {r4,lr} bl sub_8087690 movs r4, 0x11 cmp r0, 0x2 bhi @08087158 movs r4, 0x1A bl script_env_2_disable ldr r0, =sub_80870EC bl c1_link_related_func_set @08087158: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8087140 thumb_func_start sub_8087164 sub_8087164: ; 8087164 push {lr} bl sub_8086C64 movs r0, 0x11 pop {r1} bx r1 thumb_func_end sub_8087164 thumb_func_start sub_8087170 sub_8087170: ; 8087170 push {lr} ldr r1, =0x03000e10 adds r0, r1 ldrb r0, [r0] cmp r0, 0x82 bne @080871A0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080871A4 ldr r0, =sub_8087164 bl c1_link_related_func_set movs r0, 0x1D b @080871A6 .align 2, 0 .pool @080871A0: bl sub_8086C64 @080871A4: movs r0, 0x11 @080871A6: pop {r1} bx r1 thumb_func_end sub_8087170 thumb_func_start sub_80871AC sub_80871AC: ; 80871AC push {lr} ldr r0, =sub_8087170 bl c1_link_related_func_set movs r0, 0x16 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80871AC thumb_func_start sub_80871C0 sub_80871C0: ; 80871C0 movs r0, 0x11 bx lr thumb_func_end sub_80871C0 thumb_func_start sub_80871C4 sub_80871C4: ; 80871C4 push {lr} ldr r1, =0x03000e10 adds r0, r1 ldrb r0, [r0] cmp r0, 0x83 beq @080871D4 bl sub_8086C64 @080871D4: movs r0, 0x83 bl sub_8086CA8 cmp r0, 0x1 bne @080871EA ldr r0, =gUnknown_08277513 bl script_env_1_execute_new_script ldr r0, =sub_80871C0 bl c1_link_related_func_set @080871EA: movs r0, 0x11 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80871C4 thumb_func_start sub_80871FC sub_80871FC: ; 80871FC push {lr} ldr r0, =sub_80871C4 bl c1_link_related_func_set movs r0, 0x17 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80871FC thumb_func_start sub_8087210 sub_8087210: ; 8087210 movs r0, 0x11 bx lr thumb_func_end sub_8087210 thumb_func_start sub_8087214 sub_8087214: ; 8087214 push {lr} movs r0, 0x83 bl sub_8086CE0 cmp r0, 0x1 beq @08087250 ldr r0, =0x03000e14 ldr r2, [r0] ldr r1, =sub_8087170 adds r3, r0, 0 cmp r2, r1 bne @0808723A ldr r1, =0x03000e10 ldr r0, =0x03005db4 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] cmp r0, 0x82 bne @08087272 @0808723A: ldr r1, [r3] ldr r0, =sub_8087164 cmp r1, r0 bne @08087268 ldr r1, =0x03000e10 ldr r0, =0x03005db4 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] cmp r0, 0x81 bne @08087268 @08087250: movs r0, 0x2 b @08087278 .align 2, 0 .pool @08087268: movs r0, 0x82 bl sub_8086CA8 cmp r0, 0 bne @08087276 @08087272: movs r0, 0 b @08087278 @08087276: movs r0, 0x1 @08087278: pop {r1} bx r1 thumb_func_end sub_8087214 thumb_func_start sub_808727C sub_808727C: ; 808727C push {lr} movs r0, 0x83 bl sub_8086CE0 pop {r1} bx r1 thumb_func_end sub_808727C thumb_func_start sub_8087288 sub_8087288: ; 8087288 push {lr} ldr r0, =sub_80871AC bl c1_link_related_func_set movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8087288 thumb_func_start sub_808729C sub_808729C: ; 808729C push {lr} ldr r0, =sub_80870F8 bl c1_link_related_func_set movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808729C thumb_func_start sub_80872B0 sub_80872B0: ; 80872B0 push {lr} ldr r0, =sub_80871FC bl c1_link_related_func_set movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80872B0 thumb_func_start sub_80872C4 sub_80872C4: ; 80872C4 push {lr} ldr r0, =sub_8087210 bl c1_link_related_func_set movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80872C4 thumb_func_start sub_80872D8 sub_80872D8: ; 80872D8 push {r4-r6,lr} sub sp, 0x4 adds r4, r0, 0 adds r6, r2, 0 strb r4, [r6] movs r0, 0 cmp r4, r1 bne @080872EA movs r0, 0x1 @080872EA: strb r0, [r6, 0x1] ldr r1, =0x02032308 lsls r0, r4, 2 adds r0, r1 ldrb r0, [r0, 0x3] strb r0, [r6, 0x2] lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 bl sub_80878A0 strb r0, [r6, 0x3] mov r5, sp adds r5, 0x2 adds r0, r4, 0 mov r1, sp adds r2, r5, 0 bl sub_8087878 mov r0, sp ldrh r0, [r0] strh r0, [r6, 0x4] ldrh r0, [r5] strh r0, [r6, 0x6] adds r0, r4, 0 bl sub_80878C0 strb r0, [r6, 0x8] mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] bl cur_mapdata_block_get_role_at strh r0, [r6, 0xC] add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80872D8 thumb_func_start sub_8087340 sub_8087340: ; 8087340 push {lr} ldrb r0, [r0, 0x2] cmp r0, 0x2 beq @0808734C cmp r0, 0 bne @08087350 @0808734C: movs r0, 0x1 b @08087352 @08087350: movs r0, 0 @08087352: pop {r1} bx r1 thumb_func_end sub_8087340 thumb_func_start sub_8087358 sub_8087358: ; 8087358 push {lr} ldrb r0, [r0, 0x2] cmp r0, 0x2 beq @08087364 cmp r0, 0 bne @08087368 @08087364: movs r0, 0x1 b @0808736A @08087368: movs r0, 0 @0808736A: pop {r1} bx r1 thumb_func_end sub_8087358 thumb_func_start sub_8087370 sub_8087370: ; 8087370 push {lr} adds r1, r0, 0 ldrb r0, [r1, 0x2] cmp r0, 0x2 bne @08087382 adds r0, r1, 0x4 bl sub_809D0F4 b @08087384 @08087382: movs r0, 0 @08087384: pop {r1} bx r1 thumb_func_end sub_8087370 thumb_func_start sub_8087388 sub_8087388: ; 8087388 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4, 0x2] cmp r0, 0x2 beq @08087396 cmp r0, 0 bne @080873AC @08087396: ldrb r0, [r4, 0xC] bl 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, =gUnknown_08339D64 ldrb r0, [r4, 0x3] lsls r0, 3 adds r0, r3 ldr r0, [r0] mov r1, sp ldrh r1, [r1] adds r0, r1 lsls r0, 16 lsrs r0, 16 ldr r1, =0xffff0000 ldr r2, [sp] ands r2, r1 orrs r2, r0 str r2, [sp] asrs r1, r2, 16 ldrb r0, [r4, 0x3] lsls r0, 3 adds r3, 0x4 adds r0, r3 ldr r0, [r0] adds r0, r1 lsls r0, 16 ldr r1, =0x0000ffff ands r1, r2 orrs r1, r0 str r1, [sp] ldr r2, =0xffffff00 ldr r0, [sp, 0x4] ands r0, r2 str r0, [sp, 0x4] mov r0, sp movs r2, 0 ldrsh r0, [r0, r2] asrs r1, 16 bl sub_808790C lsls r0, 24 lsrs r1, r0, 24 adds r2, r1, 0 cmp r1, 0x4 beq @0808746C ldrb r0, [r4, 0x1] cmp r0, 0 beq @08087434 ldr r0, =0x03000e10 adds r0, r1, r0 ldrb r0, [r0] cmp r0, 0x80 beq @08087450 @08087434: ldr r0, =gUnknown_0827749C b @08087476 .align 2, 0 .pool @08087450: adds r0, r2, 0 bl sub_80B39D4 cmp r0, 0 bne @08087464 ldr r0, =gUnknown_0827747E b @08087476 .align 2, 0 .pool @08087464: ldr r0, =gUnknown_0827748D b @08087476 .align 2, 0 .pool @0808746C: ldrb r1, [r4, 0xC] ldrb r2, [r4, 0x3] mov r0, sp bl sub_809C2C8 @08087476: add sp, 0x8 pop {r4} pop {r1} bx r1 thumb_func_end sub_80873B4 thumb_func_start sub_8087480 sub_8087480: ; 8087480 push {lr} adds r1, r0, 0 ldr r0, =gUnknown_08277388 cmp r1, r0 beq @080874C6 ldr r0, =gUnknown_082773A3 cmp r1, r0 beq @08087508 ldr r0, =gUnknown_082773BE cmp r1, r0 beq @080874C6 ldr r0, =gUnknown_082773D9 cmp r1, r0 beq @08087508 ldr r0, =gUnknown_0827741D cmp r1, r0 beq @080874C6 ldr r0, =gUnknown_08277432 cmp r1, r0 beq @08087508 ldr r0, =gUnknown_08277447 cmp r1, r0 beq @080874C6 ldr r0, =gUnknown_0827745C cmp r1, r0 beq @08087508 ldr r0, =gUnknown_08277374 cmp r1, r0 beq @080874C6 ldr r0, =gUnknown_0827737E cmp r1, r0 beq @08087508 ldr r0, =gUnknown_082773F5 cmp r1, r0 bne @080874F8 @080874C6: movs r0, 0xA b @0808750A .align 2, 0 .pool @080874F8: ldr r0, =gUnknown_082773FF cmp r1, r0 beq @08087508 movs r0, 0 b @0808750A .align 2, 0 .pool @08087508: movs r0, 0x9 @0808750A: pop {r1} bx r1 thumb_func_end sub_8087480 thumb_func_start sub_8087510 sub_8087510: ; 8087510 push {lr} bl script_env_2_enable pop {r0} bx r0 thumb_func_end sub_8087510 thumb_func_start sub_808751C sub_808751C: ; 808751C push {lr} movs r0, 0x6 bl audio_play bl sub_809FA9C bl script_env_2_enable pop {r0} bx r0 thumb_func_end sub_808751C thumb_func_start sub_8087530 sub_8087530: ; 8087530 push {r4,lr} adds r4, r0, 0 movs r0, 0x5 bl audio_play adds r0, r4, 0 bl script_env_1_execute_new_script bl script_env_2_enable pop {r4} pop {r0} bx r0 thumb_func_end sub_8087530 thumb_func_start sub_808754C sub_808754C: ; 808754C push {lr} movs r0, 0x6 bl audio_play ldr r0, =gUnknown_082774EF bl script_env_1_execute_new_script bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808754C thumb_func_start sub_8087568 sub_8087568: ; 8087568 push {r4,lr} adds r4, r0, 0 movs r0, 0x5 bl audio_play adds r0, r4, 0 bl script_env_1_execute_new_script bl script_env_2_enable pop {r4} pop {r0} bx r0 thumb_func_end sub_8087568 thumb_func_start sub_8087584 sub_8087584: ; 8087584 push {lr} ldr r0, =gUnknown_08277509 bl script_env_1_execute_new_script bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8087584 thumb_func_start sub_8087598 sub_8087598: ; 8087598 push {lr} bl is_c1_link_related_active cmp r0, 0 bne @080875A6 movs r0, 0 b @080875C0 @080875A6: bl sub_800B4DC cmp r0, 0x2 bls @080875B8 ldr r1, =0x03000e18 movs r0, 0x1 b @080875BC .align 2, 0 .pool @080875B8: ldr r1, =0x03000e18 movs r0, 0 @080875BC: strb r0, [r1] ldrb r0, [r1] @080875C0: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8087598 thumb_func_start sub_80875C8 sub_80875C8: ; 80875C8 push {lr} bl sub_800B4DC cmp r0, 0x1 bls @0808762C bl is_c1_link_related_active cmp r0, 0x1 bne @0808762C bl sub_8009F3C cmp r0, 0x1 bne @0808762C ldr r0, =0x03000e14 ldr r1, [r0] ldr r0, =sub_808711C cmp r1, r0 beq @08087614 ldr r0, =sub_80870F8 cmp r1, r0 bne @0808762C ldr r0, =0x03000e18 ldrb r2, [r0] movs r1, 0 strb r1, [r0] cmp r2, 0x1 beq @08087614 ldr r2, =0x02037fd4 ldrb r1, [r2, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0808762C ldrb r1, [r2, 0xA] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0808762C @08087614: movs r0, 0x1 b @0808762E .align 2, 0 .pool @0808762C: movs r0, 0 @0808762E: pop {r1} bx r1 thumb_func_end sub_80875C8 thumb_func_start sub_8087634 sub_8087634: ; 8087634 push {lr} bl sub_8087690 cmp r0, 0x1 bls @08087658 bl is_c1_link_related_active cmp r0, 0x1 bne @08087658 bl sub_8009F3C cmp r0, 0x1 bne @08087658 ldr r0, =0x03000e14 ldr r1, [r0] ldr r0, =sub_8087140 cmp r1, r0 beq @08087664 @08087658: movs r0, 0 b @08087666 .align 2, 0 .pool @08087664: movs r0, 0x1 @08087666: pop {r1} bx r1 thumb_func_end sub_8087634 thumb_func_start sub_808766C sub_808766C: ; 808766C push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08087688 bl sub_8009F3C cmp r0, 0 beq @08087688 movs r0, 0x1 b @0808768A .align 2, 0 .pool @08087688: movs r0, 0 @0808768A: pop {r1} bx r1 thumb_func_end sub_808766C thumb_func_start sub_8087690 sub_8087690: ; 8087690 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @080876B0 ldr r0, =0x03003170 ldr r1, =0x00000339 adds r0, r1 ldrb r0, [r0] b @080876B8 .align 2, 0 .pool @080876B0: ldr r0, =0x03005000 ldr r1, =0x00000c1a adds r0, r1 ldrb r0, [r0] @080876B8: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8087690 thumb_func_start sub_80876C4 sub_80876C4: ; 80876C4 movs r1, 0 str r1, [r0] bx lr thumb_func_end sub_80876C4 thumb_func_start strange_npc_table_clear strange_npc_table_clear: ; 80876CC push {lr} ldr r0, =0x02032308 movs r1, 0 movs r2, 0x10 bl memset pop {r0} bx r0 .align 2, 0 .pool thumb_func_end strange_npc_table_clear thumb_func_start sub_80876E0 sub_80876E0: ; 80876E0 push {lr} movs r1, 0 movs r2, 0x24 bl memset pop {r0} bx r0 thumb_func_end sub_80876E0 thumb_func_start sub_80876F0 sub_80876F0: ; 80876F0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} mov r9, r1 mov r10, r2 mov r8, r3 lsls r0, 24 lsrs r7, r0, 24 mov r0, r9 lsls r0, 16 lsrs r0, 16 mov r9, r0 mov r1, r10 lsls r1, 16 lsrs r1, 16 mov r10, r1 mov r2, r8 lsls r2, 24 lsrs r2, 24 mov r8, r2 bl sub_808D4F4 adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 lsls r4, r7, 2 ldr r0, =0x02032308 adds r4, r0 lsls r5, r6, 3 adds r5, r6 lsls r5, 2 ldr r0, =0x02037350 adds r5, r0 adds r0, r4, 0 bl sub_80876C4 adds r0, r5, 0 bl sub_80876E0 movs r2, 0 movs r1, 0x1 movs r0, 0x1 strb r0, [r4] strb r7, [r4, 0x1] strb r6, [r4, 0x2] strb r2, [r4, 0x3] ldrb r0, [r5] orrs r0, r1 mov r2, r8 ands r2, r1 lsls r2, 1 movs r1, 0x3 negs r1, r1 ands r0, r1 orrs r0, r2 strb r0, [r5] movs r0, 0x2 strb r0, [r5, 0x19] movs r0, 0x40 strb r0, [r5, 0x4] mov r0, r9 lsls r0, 16 asrs r0, 16 mov r9, r0 mov r1, r10 lsls r1, 16 asrs r1, 16 mov r10, r1 adds r0, r5, 0 mov r1, r9 mov r2, r10 bl sub_808779C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80876F0 thumb_func_start sub_808779C sub_808779C: ; 808779C push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 adds r1, r2, 0 lsls r0, 16 lsrs r0, 16 lsls r1, 16 lsrs r1, 16 strh r0, [r4, 0x10] strh r1, [r4, 0x12] strh r0, [r4, 0x14] strh r1, [r4, 0x16] lsls r0, 16 asrs r0, 16 lsls r1, 16 asrs r1, 16 adds r2, r4, 0 adds r2, 0xC adds r3, r4, 0 adds r3, 0xE bl sub_8093038 ldrh r0, [r4, 0xC] adds r0, 0x8 strh r0, [r4, 0xC] adds r0, r4, 0 bl 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, =0x02032308 lsrs r0, 22 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 beq @080877FE ldrb r0, [r1, 0x2] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 ldr r0, =0x02037350 adds r1, r0 strb r2, [r1, 0x19] @080877FE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80877DC thumb_func_start sub_808780C sub_808780C: ; 808780C push {r4,r5,lr} lsls r0, 24 lsrs r0, 22 ldr r1, =0x02032308 adds r5, r0, r1 ldrb r1, [r5, 0x2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 ldrb r0, [r4, 0x4] cmp r0, 0x40 beq @08087838 adds r1, r0, 0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl 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 .pool thumb_func_end sub_808780C thumb_func_start sub_8087858 sub_8087858: ; 8087858 lsls r0, 24 ldr r1, =0x02032308 lsrs r0, 22 adds r0, r1 ldrb r1, [r0, 0x2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldrb r0, [r0, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_8087858 thumb_func_start sub_8087878 sub_8087878: ; 8087878 lsls r0, 24 ldr r3, =0x02032308 lsrs r0, 22 adds r0, r3 ldrb r3, [r0, 0x2] lsls r0, r3, 3 adds r0, r3 lsls r0, 2 ldr r3, =0x02037350 adds r0, r3 ldrh r3, [r0, 0x10] strh r3, [r1] ldrh r0, [r0, 0x12] strh r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_8087878 thumb_func_start sub_80878A0 sub_80878A0: ; 80878A0 lsls r0, 24 ldr r1, =0x02032308 lsrs r0, 22 adds r0, r1 ldrb r1, [r0, 0x2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldrb r0, [r0, 0x19] bx lr .align 2, 0 .pool thumb_func_end sub_80878A0 thumb_func_start sub_80878C0 sub_80878C0: ; 80878C0 lsls r0, 24 ldr r1, =0x02032308 lsrs r0, 22 adds r0, r1 ldrb r1, [r0, 0x2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldrb r0, [r0, 0xB] lsls r0, 28 lsrs r0, 28 bx lr .align 2, 0 .pool thumb_func_end sub_80878C0 thumb_func_start sub_80878E4 sub_80878E4: ; 80878E4 lsls r0, 24 ldr r1, =0x02032308 lsrs r0, 22 adds r0, r1 ldrb r1, [r0, 0x2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 adds r0, 0x21 movs r1, 0 ldrsb r1, [r0, r1] movs r0, 0x10 subs r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_80878E4 thumb_func_start sub_808790C sub_808790C: ; 808790C push {r4-r6,lr} movs r2, 0 ldr r5, =0x02032308 lsls r0, 16 asrs r4, r0, 16 lsls r1, 16 asrs r3, r1, 16 @0808791A: lsls r0, r2, 2 adds r1, r0, r5 ldrb r0, [r1] cmp r0, 0 beq @08087958 ldrb r0, [r1, 0x3] cmp r0, 0 beq @0808792E cmp r0, 0x2 bne @08087958 @0808792E: ldrb r1, [r1, 0x2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r1, r0, r1 movs r6, 0x10 ldrsh r0, [r1, r6] cmp r0, r4 bne @08087958 movs r6, 0x12 ldrsh r0, [r1, r6] cmp r0, r3 bne @08087958 adds r0, r2, 0 b @08087964 .align 2, 0 .pool @08087958: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @0808791A movs r0, 0x4 @08087964: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_808790C thumb_func_start sub_808796C sub_808796C: ; 808796C push {r4-r6,lr} lsls r0, 24 lsls r1, 24 lsrs r3, r1, 24 adds r2, r3, 0 lsrs r0, 22 ldr r1, =0x02032308 adds r5, r0, r1 ldrb r1, [r5, 0x2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r6, r0, r1 ldrb r0, [r5] cmp r0, 0 beq @080879C8 cmp r3, 0xA bls @080879A4 ldrb r0, [r6] movs r1, 0x4 orrs r0, r1 strb r0, [r6] b @080879C8 .align 2, 0 .pool @080879A4: ldr r4, =gUnknown_08339E00 ldr r1, =gUnknown_08339DC8 ldrb r0, [r5, 0x3] lsls r0, 2 adds r0, r1 ldr r3, [r0] adds r0, r5, 0 adds r1, r6, 0 bl _call_via_r3 lsls r0, 24 lsrs r0, 22 adds r0, r4 ldr r2, [r0] adds r0, r5, 0 adds r1, r6, 0 bl _call_via_r2 @080879C8: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808796C thumb_func_start sub_80879D8 sub_80879D8: ; 80879D8 push {r4,lr} lsls r2, 24 lsrs r2, 24 ldr r4, =gUnknown_08339DD4 lsls r3, r2, 2 adds r3, r4 ldr r3, [r3] bl _call_via_r3 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80879D8 thumb_func_start sub_80879F8 sub_80879F8: ; 80879F8 movs r0, 0x1 bx lr thumb_func_end sub_80879F8 thumb_func_start sub_80879FC sub_80879FC: ; 80879FC push {r4,lr} lsls r2, 24 lsrs r2, 24 ldr r4, =gUnknown_08339DD4 lsls r3, r2, 2 adds r3, r4 ldr r3, [r3] bl _call_via_r3 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80879FC thumb_func_start sub_8087A1C sub_8087A1C: ; 8087A1C movs r0, 0 bx lr thumb_func_end sub_8087A1C thumb_func_start sub_8087A20 sub_8087A20: ; 8087A20 push {r4-r6,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 lsls r0, r2, 24 lsrs r0, 24 ldrb r1, [r5, 0x19] bl npc_something3 strb r0, [r5, 0x19] ldrb r1, [r5, 0x19] mov r6, sp adds r6, 0x2 adds r0, r5, 0 mov r2, sp adds r3, r6, 0 bl 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, =@08087B00 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08087B00: .4byte @08087B28 .4byte @08087B2C .4byte @08087B30 .4byte @08087B34 .4byte @08087B38 .4byte @08087B38 .4byte @08087B28 .4byte @08087B2C .4byte @08087B30 .4byte @08087B34 @08087B28: movs r0, 0x2 b @08087B3A @08087B2C: movs r0, 0x1 b @08087B3A @08087B30: movs r0, 0x3 b @08087B3A @08087B34: movs r0, 0x4 b @08087B3A @08087B38: adds r0, r2, 0 @08087B3A: pop {r1} bx r1 thumb_func_end npc_something3 thumb_func_start npc_080587EC npc_080587EC: ; 8087B40 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r2, 16 lsrs r2, 16 mov r12, r2 lsls r3, 16 movs r4, 0 ldr r0, =0x02037350 mov r9, r0 lsrs r2, r3, 16 mov r10, r2 asrs r6, r3, 16 @08087B64: mov r7, r12 lsls r3, r7, 16 mov r0, r10 lsls r5, r0, 16 cmp r4, r8 beq @08087BA8 lsls r0, r4, 3 adds r0, r4 lsls r0, 2 mov r2, r9 adds r1, r0, r2 movs r7, 0x10 ldrsh r0, [r1, r7] asrs r2, r3, 16 cmp r0, r2 bne @08087B8C movs r7, 0x12 ldrsh r0, [r1, r7] cmp r0, r6 beq @08087B9E @08087B8C: movs r7, 0x14 ldrsh r0, [r1, r7] cmp r0, r2 bne @08087BA8 movs r0, 0x16 ldrsh r1, [r1, r0] asrs r0, r5, 16 cmp r1, r0 bne @08087BA8 @08087B9E: movs r0, 0x1 b @08087BBE .align 2, 0 .pool @08087BA8: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @08087B64 asrs r0, r3, 16 asrs r1, r5, 16 bl 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, =0x02032308 adds r2, r0 ldrb r1, [r2, 0x2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 ldrb r0, [r2] cmp r0, 0 beq @08087C7A subs r0, r3, 0x1 cmp r0, 0x4 bhi @08087C56 lsls r0, 2 ldr r1, =@08087C0C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08087C0C: .4byte @08087C2C .4byte @08087C2C .4byte @08087C38 .4byte @08087C20 .4byte @08087C20 @08087C20: ldrb r0, [r4] lsls r0, 30 lsrs r0, 31 bl sub_808BD6C b @08087C44 @08087C2C: ldrb r0, [r4] lsls r0, 30 lsrs r0, 31 bl sub_808BD7C b @08087C44 @08087C38: ldrb r1, [r4] lsls r1, 30 lsrs r1, 31 movs r0, 0 bl sub_808BD3C @08087C44: lsls r0, 24 lsrs r0, 24 ldr r1, =sub_8087C8C movs r2, 0 str r2, [sp] movs r3, 0 bl sub_808DD68 strb r0, [r4, 0x4] @08087C56: ldrb r1, [r4, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 adds r3, r0, 0 adds r3, 0x3E ldrb r1, [r3] movs r2, 0x2 orrs r1, r2 strb r1, [r3] strh r5, [r0, 0x2E] ldrb r1, [r4] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r4] @08087C7A: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8087BCC thumb_func_start sub_8087C8C sub_8087C8C: ; 8087C8C push {r4-r6,lr} adds r5, r0, 0 movs r0, 0x2E ldrsh r4, [r5, r0] lsls r4, 2 ldr r0, =0x02032308 adds r4, r0 ldrb r1, [r4, 0x2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r6, r0, r1 ldrh r0, [r6, 0xC] strh r0, [r5, 0x20] ldrh r0, [r6, 0xE] strh r0, [r5, 0x22] ldrb r0, [r6, 0xB] lsrs r0, 4 adds r1, r5, 0 movs r2, 0x1 bl 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 .pool @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, =0x02037318 adds r0, r4, 0 bl mapheader_copy_mapdata_with_padding ldr r0, [r4, 0x4] bl sub_80E8EE0 bl mapheader_run_script_with_tag_x1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8087D54 thumb_func_start sub_8087D74 sub_8087D74: ; 8087D74 push {r4,lr} ldr r4, =0x02037318 adds r0, r4, 0 bl mapheader_copy_mapdata_with_padding movs r0, 0 bl sub_80E9238 ldr r0, [r4, 0x4] bl sub_80E8EE0 bl mapdata_from_sav2 bl mapheader_run_script_with_tag_x1 ldr r1, =0x03005dc0 ldr r0, [r1] ldr r1, [r1, 0x4] bl per_step_2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03ff03ff str r0, [sp] ldr r5, =0x02032318 ldr r2, =0x01001400 mov r0, sp adds r1, r5, 0 bl CpuFastSet adds r0, r5, 0 adds r1, r4, 0 bl sub_81AA078 add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8087DAC thumb_func_start sub_8087DE4 sub_8087DE4: ; 8087DE4 push {r4,lr} sub sp, 0x4 ldr r0, =0x03ff03ff str r0, [sp] ldr r4, =0x02032318 ldr r2, =0x01001400 mov r0, sp adds r1, r4, 0 bl CpuFastSet adds r0, r4, 0 bl sub_81D5FB4 add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03ff03ff str r0, [sp] ldr r4, =0x02032318 ldr r2, =0x01001400 mov r0, sp adds r1, r4, 0 bl CpuFastSet ldr r2, =0x03005dc0 str r4, [r2, 0x8] ldr r1, [r5] adds r1, 0xF str r1, [r2] ldr r0, [r5, 0x4] adds r0, 0xE str r0, [r2, 0x4] muls r1, r0 movs r0, 0xA0 lsls r0, 6 cmp r1, r0 bgt @08087E56 ldr r0, [r5, 0xC] ldrh r1, [r5] ldrh r2, [r5, 0x4] bl map_copy_with_padding adds r0, r6, 0 bl mapheader_copy_mapdata_of_adjacent_maps @08087E56: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end mapheader_copy_mapdata_with_padding thumb_func_start map_copy_with_padding ; int map_copy_with_padding(void *src) map_copy_with_padding: ; 8087E70 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r7, r0, 0 lsls r1, 16 lsrs r1, 16 mov r8, r1 lsls r2, 16 lsrs r2, 16 ldr r0, =0x03005dc0 ldr r4, [r0, 0x8] ldr r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 1 adds r0, 0xE adds r4, r0 cmp r2, 0 beq @08087EB8 mov r0, r8 lsls r6, r0, 1 adds r5, r2, 0 movs r0, 0x1E adds r0, r6 mov r9, r0 @08087EA4: adds r0, r7, 0 adds r1, r4, 0 mov r2, r8 bl CpuSet add r4, r9 adds r7, r6 subs r5, 0x1 cmp r5, 0 bne @08087EA4 @08087EB8: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037340 ldr r0, =gUnknown_08486EF8 ldr r0, [r0] str r0, [r2] cmp r1, 0 ble @08087F4C adds r4, r2, 0 adds r7, r1, 0 @08087EE6: adds r0, r5, 0 bl mapconnection_get_mapheader adds r1, r0, 0 ldr r2, [r5, 0x4] ldrb r0, [r5] cmp r0, 0x2 beq @08087F1E cmp r0, 0x2 bgt @08087F08 cmp r0, 0x1 beq @08087F12 b @08087F44 .align 2, 0 .pool @08087F08: cmp r0, 0x3 beq @08087F2A cmp r0, 0x4 beq @08087F36 b @08087F44 @08087F12: adds r0, r6, 0 bl sub_8087FB8 ldrb r0, [r4] movs r1, 0x1 b @08087F40 @08087F1E: adds r0, r6, 0 bl sub_8088020 ldrb r0, [r4] movs r1, 0x2 b @08087F40 @08087F2A: adds r0, r6, 0 bl sub_8088080 ldrb r0, [r4] movs r1, 0x4 b @08087F40 @08087F36: adds r0, r6, 0 bl sub_80880E0 ldrb r0, [r4] movs r1, 0x8 @08087F40: orrs r0, r1 strb r0, [r4] @08087F44: subs r7, 0x1 adds r5, 0xC cmp r7, 0 bne @08087EE6 @08087F4C: pop {r4-r7} pop {r0} bx r0 thumb_func_end mapheader_copy_mapdata_of_adjacent_maps thumb_func_start sub_8087F54 sub_8087F54: ; 8087F54 push {r4-r7,lr} mov r7, r8 push {r7} ldr r5, [sp, 0x18] ldr r4, [r2] ldr r7, [r4] adds r2, r7, 0 muls r2, r5 adds r2, r3 lsls r2, 1 ldr r3, [r4, 0xC] adds r6, r3, r2 ldr r3, =0x03005dc0 ldr r2, [r3] muls r1, r2 adds r1, r0 lsls r1, 1 ldr r0, [r3, 0x8] adds r5, r0, r1 ldr r0, [sp, 0x20] cmp r0, 0 ble @08087FA6 adds r4, r0, 0 ldr r3, =0x001fffff mov r8, r3 @08087F86: adds r0, r6, 0 adds r1, r5, 0 ldr r2, [sp, 0x1C] mov r3, r8 ands r2, r3 bl CpuSet ldr r0, =0x03005dc0 ldr r0, [r0] lsls r0, 1 adds r5, r0 lsls r0, r7, 1 adds r6, r0 subs r4, 0x1 cmp r4, 0 bne @08087F86 @08087FA6: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8087F54 thumb_func_start sub_8087FB8 sub_8087FB8: ; 8087FB8 push {r4-r7,lr} sub sp, 0xC adds r3, r0, 0 adds r5, r1, 0 cmp r5, 0 beq @08088012 ldr r0, [r5] ldr r4, [r0] adds r2, 0x7 ldr r0, [r3] ldr r0, [r0, 0x4] adds r7, r0, 0x7 cmp r2, 0 bge @08087FEC negs r6, r2 adds r2, r4 ldr r0, =0x03005dc0 ldr r3, [r0] cmp r2, r3 bge @08087FE2 adds r3, r2, 0 @08087FE2: movs r2, 0 b @08087FFC .align 2, 0 .pool @08087FEC: movs r6, 0 adds r0, r2, r4 ldr r1, =0x03005dc0 ldr r1, [r1] subs r3, r1, r2 cmp r0, r1 bge @08087FFC adds r3, r4, 0 @08087FFC: movs r0, 0 str r0, [sp] str r3, [sp, 0x4] movs r0, 0x7 str r0, [sp, 0x8] adds r0, r2, 0 adds r1, r7, 0 adds r2, r5, 0 adds r3, r6, 0 bl sub_8087F54 @08088012: add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8087FB8 thumb_func_start sub_8088020 sub_8088020: ; 8088020 push {r4-r7,lr} sub sp, 0xC adds r5, r1, 0 cmp r5, 0 beq @08088074 ldr r0, [r5] ldr r4, [r0] ldr r0, [r0, 0x4] adds r2, 0x7 subs r7, r0, 0x7 cmp r2, 0 bge @08088050 negs r6, r2 adds r2, r4 ldr r0, =0x03005dc0 ldr r3, [r0] cmp r2, r3 bge @08088046 adds r3, r2, 0 @08088046: movs r2, 0 b @08088060 .align 2, 0 .pool @08088050: movs r6, 0 adds r0, r2, r4 ldr r1, =0x03005dc0 ldr r1, [r1] subs r3, r1, r2 cmp r0, r1 bge @08088060 adds r3, r4, 0 @08088060: str r7, [sp] str r3, [sp, 0x4] movs r0, 0x7 str r0, [sp, 0x8] adds r0, r2, 0 movs r1, 0 adds r2, r5, 0 adds r3, r6, 0 bl sub_8087F54 @08088074: add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8088020 thumb_func_start sub_8088080 sub_8088080: ; 8088080 push {r4-r7,lr} sub sp, 0xC adds r5, r1, 0 cmp r5, 0 beq @080880D4 ldr r0, [r5] ldr r1, [r0] ldr r4, [r0, 0x4] adds r2, 0x7 subs r7, r1, 0x7 cmp r2, 0 bge @080880B0 negs r6, r2 adds r1, r2, r4 ldr r0, =0x03005dc0 ldr r3, [r0, 0x4] cmp r1, r3 bge @080880A6 adds r3, r1, 0 @080880A6: movs r2, 0 b @080880C0 .align 2, 0 .pool @080880B0: movs r6, 0 adds r0, r2, r4 ldr r1, =0x03005dc0 ldr r1, [r1, 0x4] subs r3, r1, r2 cmp r0, r1 bge @080880C0 adds r3, r4, 0 @080880C0: str r6, [sp] movs r0, 0x7 str r0, [sp, 0x4] str r3, [sp, 0x8] movs r0, 0 adds r1, r2, 0 adds r2, r5, 0 adds r3, r7, 0 bl sub_8087F54 @080880D4: add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8088080 thumb_func_start sub_80880E0 sub_80880E0: ; 80880E0 push {r4-r7,lr} sub sp, 0xC adds r3, r0, 0 adds r5, r1, 0 cmp r5, 0 beq @08088138 ldr r0, [r5] ldr r4, [r0, 0x4] ldr r0, [r3] ldr r0, [r0] adds r7, r0, 0x7 adds r2, 0x7 cmp r2, 0 bge @08088114 negs r6, r2 adds r1, r2, r4 ldr r0, =0x03005dc0 ldr r3, [r0, 0x4] cmp r1, r3 bge @0808810A adds r3, r1, 0 @0808810A: movs r2, 0 b @08088124 .align 2, 0 .pool @08088114: movs r6, 0 adds r0, r2, r4 ldr r1, =0x03005dc0 ldr r1, [r1, 0x4] subs r3, r1, r2 cmp r0, r1 bge @08088124 adds r3, r4, 0 @08088124: str r6, [sp] movs r0, 0x8 str r0, [sp, 0x4] str r3, [sp, 0x8] adds r0, r7, 0 adds r1, r2, 0 adds r2, r5, 0 movs r3, 0 bl sub_8087F54 @08088138: add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005dc0 ldr r3, [r1] cmp r2, r3 bge @08088174 cmp r4, 0 blt @08088174 ldr r0, [r1, 0x4] cmp r4, r0 bge @08088174 adds r0, r3, 0 muls r0, r4 adds r0, r2, r0 ldr r1, [r1, 0x8] lsls r0, 1 adds r0, r1 ldrh r1, [r0] b @08088196 .align 2, 0 .pool @08088174: ldr r0, =0x02037318 ldr r3, [r0] adds r1, r2, 0x1 movs r2, 0x1 ands r1, r2 adds r0, r4, 0x1 ands r0, r2 lsls r0, 1 adds r1, r0 ldr r0, [r3, 0x8] lsls r1, 1 adds r1, r0 ldrh r1, [r1] movs r2, 0xC0 lsls r2, 4 adds r0, r2, 0 orrs r1, r0 @08088196: ldr r0, =0x000003ff cmp r1, r0 beq @080881A8 lsrs r0, r1, 12 b @080881AA .align 2, 0 .pool @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, =0x03005dc0 ldr r3, [r1] cmp r2, r3 bge @080881E0 cmp r4, 0 blt @080881E0 ldr r0, [r1, 0x4] cmp r4, r0 bge @080881E0 adds r0, r3, 0 muls r0, r4 adds r0, r2, r0 ldr r1, [r1, 0x8] lsls r0, 1 adds r0, r1 ldrh r1, [r0] b @08088202 .align 2, 0 .pool @080881E0: ldr r0, =0x02037318 ldr r3, [r0] adds r1, r2, 0x1 movs r2, 0x1 ands r1, r2 adds r0, r4, 0x1 ands r0, r2 lsls r0, 1 adds r1, r0 ldr r0, [r3, 0x8] lsls r1, 1 adds r1, r0 ldrh r1, [r1] movs r2, 0xC0 lsls r2, 4 adds r0, r2, 0 orrs r1, r0 @08088202: ldr r0, =0x000003ff cmp r1, r0 beq @0808821C movs r0, 0xC0 lsls r0, 4 ands r1, r0 lsrs r0, r1, 10 b @0808821E .align 2, 0 .pool @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 ; int cur_mapdata_get_blockid_at(int x, int y) 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, =0x03005dc0 ldr r2, [r1] cmp r5, r2 bge @08088254 cmp r6, 0 blt @08088254 ldr r0, [r1, 0x4] cmp r6, r0 bge @08088254 adds r0, r2, 0 muls r0, r6 adds r0, r5, r0 ldr r1, [r1, 0x8] lsls r0, 1 adds r0, r1 ldrh r4, [r0] b @08088278 .align 2, 0 .pool @08088254: ldr r0, =0x02037318 ldr r3, [r0] adds r1, r5, 0x1 movs r2, 0x1 ands r1, r2 adds r0, r6, 0x1 ands r0, r2 lsls r0, 1 adds r1, r0 ldr r0, [r3, 0x8] lsls r1, 1 adds r1, r0 ldrh r1, [r1] movs r2, 0xC0 lsls r2, 4 adds r0, r2, 0 adds r4, r0, 0 orrs r4, r1 @08088278: ldr r0, =0x000003ff cmp r4, r0 beq @0808828C ands r4, r0 adds r0, r4, 0 b @080882B0 .align 2, 0 .pool @0808828C: ldr r0, =0x02037318 ldr r3, [r0] adds r1, r5, 0x1 movs r2, 0x1 ands r1, r2 adds r0, r6, 0x1 ands r0, r2 lsls r0, 1 adds r1, r0 ldr r0, [r3, 0x8] lsls r1, 1 adds r1, r0 ldrh r0, [r1] movs r2, 0xC0 lsls r2, 4 adds r1, r2, 0 orrs r0, r1 ands r0, r4 @080882B0: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end cur_mapdata_get_blockid_at thumb_func_start cur_mapdata_block_get_role_at ; int cur_mapdata_block_get_role_at(int x, int y) 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 ; int cur_mapdata_block_get_bgs_at(int x, int y) 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, =0x03005dc0 ldr r4, [r2] cmp r3, r4 bge @08088328 cmp r1, 0 blt @08088328 ldr r0, [r2, 0x4] cmp r1, r0 bge @08088328 muls r1, r4 adds r1, r3, r1 ldr r0, [r2, 0x8] lsls r1, 1 adds r1, r0 ldrh r0, [r1] movs r2, 0xF0 lsls r2, 8 ands r2, r0 ldr r0, =0x00000fff ands r0, r5 orrs r2, r0 strh r2, [r1] @08088328: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005dc0 ldr r4, [r2] cmp r3, r4 bge @08088364 cmp r1, 0 blt @08088364 ldr r0, [r2, 0x4] cmp r1, r0 bge @08088364 adds r0, r4, 0 muls r0, r1 adds r0, r3, r0 ldr r1, [r2, 0x8] lsls r0, 1 adds r0, r1 strh r5, [r0] @08088364: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8088338 thumb_func_start cur_mapdata_get_behaviour_by_blockid ; int cur_mapdata_get_behaviour_by_blockid(u16 block_id) cur_mapdata_get_behaviour_by_blockid: ; 8088370 push {lr} lsls r0, 16 lsrs r2, r0, 16 adds r3, r2, 0 ldr r0, =0x000001ff cmp r2, r0 bhi @08088394 ldr r0, =0x02037318 ldr r0, [r0] ldr r0, [r0, 0x10] ldr r1, [r0, 0x10] lsls r0, r2, 1 b @080883B2 .align 2, 0 .pool @08088394: ldr r0, =0x000003ff cmp r2, r0 bls @080883A4 movs r0, 0xFF b @080883B6 .align 2, 0 .pool @080883A4: ldr r0, =0x02037318 ldr r0, [r0] ldr r0, [r0, 0x14] ldr r1, [r0, 0x10] lsls r0, r3, 1 adds r0, r1 ldr r1, =0xfffffc00 @080883B2: adds r0, r1 ldrh r0, [r0] @080883B6: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d8c ldr r1, [r0] adds r4, r1, 0 adds r4, 0x34 ldr r0, =0x03005dc0 ldr r0, [r0] mov r8, r0 movs r0, 0 ldrsh r6, [r1, r0] movs r2, 0x2 ldrsh r0, [r1, r2] adds r1, r0, 0 adds r1, 0xE cmp r0, r1 bge @08088420 mov r12, r1 ldr r1, =0x02032318 mov r9, r1 lsls r7, r6, 1 @080883F2: adds r1, r6, 0 adds r3, r1, 0 adds r3, 0xF adds r5, r0, 0x1 cmp r1, r3 bge @0808841A mov r2, r8 muls r2, r0 adds r0, r2, 0 lsls r0, 1 add r0, r9 adds r2, r7, r0 subs r1, r3, r1 @0808840C: ldrh r0, [r2] strh r0, [r4] adds r4, 0x2 adds r2, 0x2 subs r1, 0x1 cmp r1, 0 bne @0808840C @0808841A: adds r0, r5, 0 cmp r0, r12 blt @080883F2 @08088420: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end save_serialize_map thumb_func_start sub_8088438 sub_8088438: ; 8088438 push {r4,lr} movs r2, 0 movs r1, 0 ldr r0, =0x03005d8c ldr r0, [r0] adds r3, r0, 0 adds r3, 0x34 ldr r4, =0x000001ff @08088448: lsls r0, r1, 1 adds r0, r3, r0 ldrh r0, [r0] orrs r2, r0 adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, r4 bls @08088448 cmp r2, 0 beq @0808846C movs r0, 0 b @0808846E .align 2, 0 .pool @0808846C: movs r0, 0x1 @0808846E: pop {r4} pop {r1} bx r1 thumb_func_end sub_8088438 thumb_func_start sav2_mapdata_clear sav2_mapdata_clear: ; 8088474 push {lr} sub sp, 0x4 mov r1, sp movs r0, 0 strh r0, [r1] ldr r0, =0x03005d8c ldr r1, [r0] adds r1, 0x34 ldr r2, =0x01000100 mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sav2_mapdata_clear thumb_func_start mapdata_from_sav2 mapdata_from_sav2: ; 808849C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 ldr r4, =0x03005d8c ldr r0, [r4] adds r7, r0, 0 adds r7, 0x34 bl sub_8088438 cmp r0, 0 bne @080885AC ldr r0, =0x03005dc0 ldr r0, [r0] str r0, [sp] ldr r0, [r4] movs r2, 0 ldrsh r1, [r0, r2] mov r10, r1 movs r2, 0x2 ldrsh r1, [r0, r2] mov r8, r1 mov r6, r8 adds r0, r6, 0 adds r0, 0xE cmp r6, r0 bge @0808855A @080884D6: cmp r6, r8 bne @080884EC cmp r6, 0 beq @080884EC movs r0, 0 mov r9, r0 b @08088508 .align 2, 0 .pool @080884EC: mov r0, r8 adds r0, 0xD movs r1, 0xFF mov r9, r1 cmp r6, r0 bne @08088508 ldr r0, =0x02037318 ldr r0, [r0] ldr r0, [r0, 0x4] subs r0, 0x1 cmp r6, r0 beq @08088508 movs r2, 0x1 mov r9, r2 @08088508: mov r5, r10 adds r0, r5, 0 adds r0, 0xF mov r1, r8 adds r1, 0xE str r1, [sp, 0x8] adds r2, r6, 0x1 str r2, [sp, 0x4] cmp r5, r0 bge @08088552 ldr r0, [sp] lsls r3, r0, 16 @08088520: ldr r1, [sp] adds r0, r1, 0 muls r0, r6 adds r0, r5, r0 lsls r0, 1 ldr r1, =0x02032318 adds r4, r0, r1 adds r0, r4, 0 lsrs r1, r3, 16 mov r2, r9 str r3, [sp, 0xC] bl sub_8088BF0 lsls r0, 24 ldr r3, [sp, 0xC] cmp r0, 0 bne @08088546 ldrh r0, [r7] strh r0, [r4] @08088546: adds r7, 0x2 adds r5, 0x1 mov r0, r10 adds r0, 0xF cmp r5, r0 blt @08088520 @08088552: ldr r6, [sp, 0x4] ldr r2, [sp, 0x8] cmp r6, r2 blt @080884D6 @0808855A: mov r5, r10 adds r0, r5, 0 adds r0, 0xF cmp r5, r0 bge @080885A8 mov r0, r8 subs r0, 0x1 lsls r0, 16 mov r9, r0 lsls r4, r5, 16 mov r0, r8 adds r0, 0xD lsls r7, r0, 16 @08088574: mov r0, r8 cmp r0, 0 beq @08088584 asrs r0, r4, 16 mov r2, r9 asrs r1, r2, 16 bl sub_80D423C @08088584: ldr r0, =0x02037318 ldr r0, [r0] ldr r0, [r0, 0x4] subs r0, 0x1 cmp r6, r0 bge @08088598 asrs r0, r4, 16 asrs r1, r7, 16 bl 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 .pool thumb_func_end mapdata_from_sav2 thumb_func_start sub_80885C4 sub_80885C4: ; 80885C4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC lsls r0, 24 lsrs r3, r0, 24 adds r2, r3, 0 ldr r0, =0x03005d8c ldr r1, [r0] adds r0, r1, 0 adds r0, 0x34 str r0, [sp, 0x4] ldr r0, =0x03005dc0 ldr r0, [r0] str r0, [sp] movs r4, 0 mov r9, r4 mov r8, r4 movs r0, 0 ldrsh r6, [r1, r0] str r6, [sp, 0x8] movs r4, 0x2 ldrsh r5, [r1, r4] movs r7, 0xF movs r6, 0xE mov r12, r6 cmp r3, 0x2 beq @0808861E cmp r3, 0x2 bgt @08088614 cmp r3, 0x1 beq @08088626 b @0808863E .align 2, 0 .pool @08088614: cmp r2, 0x3 beq @08088630 cmp r2, 0x4 beq @08088638 b @0808863E @0808861E: adds r5, 0x1 movs r0, 0xD mov r12, r0 b @0808863E @08088626: movs r1, 0x1 mov r8, r1 movs r3, 0xD mov r12, r3 b @0808863E @08088630: ldr r4, [sp, 0x8] adds r4, 0x1 str r4, [sp, 0x8] b @0808863C @08088638: movs r6, 0x1 mov r9, r6 @0808863C: movs r7, 0xE @0808863E: movs r1, 0 cmp r1, r12 bge @08088682 ldr r0, =0x02032318 mov r10, r0 @08088648: adds r4, r1, 0x1 cmp r7, 0 beq @0808867C adds r0, r1, r5 ldr r3, [sp] adds r2, r3, 0 muls r2, r0 add r1, r8 lsls r0, r1, 4 subs r0, r1 add r0, r9 ldr r6, [sp, 0x8] adds r2, r6, r2 adds r3, r7, 0 lsls r2, 1 add r2, r10 lsls r0, 1 ldr r6, [sp, 0x4] adds r1, r0, r6 @0808866E: ldrh r0, [r1] strh r0, [r2] adds r1, 0x2 adds r2, 0x2 subs r3, 0x1 cmp r3, 0 bne @0808866E @0808867C: adds r1, r4, 0 cmp r1, r12 blt @08088648 @08088682: bl sav2_mapdata_clear add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005dc0 ldr r2, [r1] cmp r4, r2 bge @080886D8 cmp r5, 0 blt @080886D8 ldr r0, [r1, 0x4] cmp r5, r0 bge @080886D8 adds r0, r2, 0 muls r0, r5 adds r0, r4, r0 ldr r1, [r1, 0x8] lsls r0, 1 adds r0, r1 ldrh r1, [r0] ldr r0, =0x000003ff cmp r1, r0 beq @08088770 b @08088700 .align 2, 0 .pool @080886D8: ldr r0, =0x02037318 ldr r3, [r0] adds r1, r4, 0x1 movs r2, 0x1 ands r1, r2 adds r0, r5, 0x1 ands r0, r2 lsls r0, 1 adds r1, r0 ldr r0, [r3, 0x8] lsls r1, 1 adds r1, r0 ldrh r1, [r1] movs r2, 0xC0 lsls r2, 4 adds r0, r2, 0 orrs r0, r1 ldr r1, =0x000003ff cmp r0, r1 beq @08088770 @08088700: ldr r1, =0x03005dc0 ldr r0, [r1] subs r0, 0x8 cmp r4, r0 blt @0808872C ldr r0, =0x02037340 ldrb r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @08088770 movs r0, 0x4 b @08088782 .align 2, 0 .pool @0808872C: cmp r4, 0x6 bgt @08088744 ldr r0, =0x02037340 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08088770 movs r0, 0x3 b @08088782 .align 2, 0 .pool @08088744: ldr r0, [r1, 0x4] subs r0, 0x7 cmp r5, r0 blt @08088760 ldr r0, =0x02037340 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08088770 movs r0, 0x1 b @08088782 .align 2, 0 .pool @08088760: cmp r5, 0x6 bgt @08088780 ldr r0, =0x02037340 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0808877C @08088770: movs r0, 0x1 negs r0, r0 b @08088782 .align 2, 0 .pool @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, =0x03005d8c ldr r1, [r1] movs r4, 0 ldrsh r2, [r1, r4] adds r0, 0x7 adds r2, r0 movs r0, 0x2 ldrsh r1, [r1, r0] adds r3, 0x7 adds r1, r3 adds r0, r2, 0 bl mapborder_visible_from_position pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8088788 thumb_func_start sub_80887B0 sub_80887B0: ; 80887B0 push {r4,r5,lr} ldr r1, =0x03005d8c ldr r4, [r1] movs r1, 0 ldrsh r3, [r4, r1] ldr r2, =gUnknown_08339D64 lsls r0, 3 adds r1, r0, r2 ldr r1, [r1] adds r1, 0x7 adds r3, r1 movs r5, 0x2 ldrsh r1, [r4, r5] adds r2, 0x4 adds r0, r2 ldr r0, [r0] adds r0, 0x7 adds r1, r0 adds r0, r3, 0 bl mapborder_visible_from_position movs r1, 0x1 negs r1, r1 cmp r0, r1 beq @080887F0 movs r0, 0x1 b @080887F2 .align 2, 0 .pool @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, =0x03005d8c 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 .pool @08088834: ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, [r3] ldr r0, [r0] strh r0, [r1] ldr r2, [r5, 0x4] ldrh r0, [r1, 0x2] subs r0, r2 b @08088870 .align 2, 0 .pool @0808884C: ldr r0, =0x03005d8c ldr r1, [r0] ldr r2, [r5, 0x4] ldrh r0, [r1] subs r0, r2 strh r0, [r1] negs r0, r7 b @08088870 .align 2, 0 .pool @08088860: ldr r0, =0x03005d8c ldr r1, [r0] ldr r2, [r5, 0x4] ldrh r0, [r1] subs r0, r2 strh r0, [r1] ldr r0, [r3] ldr r0, [r0, 0x4] @08088870: strh r0, [r1, 0x2] @08088872: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037334 ldrb r0, [r1] movs r1, 0x2 negs r1, r1 ands r1, r0 ldr r2, =0x02037334 strb r1, [r2] mov r0, r10 mov r1, r9 bl sub_8088788 adds r7, r0, 0 adds r0, r7, 0x1 cmp r0, 0x1 bhi @080888C4 ldr r0, =0x03005d8c ldr r1, [r0] ldrh r0, [r1] add r0, r10 strh r0, [r1] ldrh r0, [r1, 0x2] add r0, r9 strh r0, [r1, 0x2] b @08088932 .align 2, 0 .pool @080888C4: bl save_serialize_map bl sub_81BE72C ldr r1, =0x03005d8c ldr r0, [r1] movs r2, 0 ldrsh r5, [r0, r2] movs r1, 0x2 ldrsh r6, [r0, r1] lsls r2, r7, 24 lsrs r2, 24 mov r8, r2 mov r0, r8 adds r1, r5, 0 adds r2, r6, 0 bl sub_8088950 adds r4, r0, 0 adds r1, r7, 0 mov r2, r10 mov r3, r9 bl sub_80887F8 ldrb r0, [r4, 0x8] ldrb r1, [r4, 0x9] bl mliX_load_map ldr r1, =0x02037334 ldrb r0, [r1] movs r1, 0x1 orrs r0, r1 ldr r2, =0x02037334 strb r0, [r2] ldr r0, =0x03005d8c ldr r1, [r0] movs r2, 0 ldrsh r0, [r1, r2] subs r5, r0 ldr r0, =0x02037334 str r5, [r0, 0x4] movs r2, 0x2 ldrsh r0, [r1, r2] subs r6, r0 ldr r0, =0x02037334 str r6, [r0, 0x8] ldrh r0, [r1] add r0, r10 strh r0, [r1] ldrh r0, [r1, 0x2] add r0, r9 strh r0, [r1, 0x2] mov r0, r8 bl sub_80885C4 @08088932: ldr r0, =0x02037334 ldrb r0, [r0] lsls r0, 31 lsrs r0, 31 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037318 ldr r0, [r0, 0xC] ldr r7, [r0] ldr r4, [r0, 0x4] movs r5, 0 cmp r5, r7 bge @08088998 @0808896E: ldrb r0, [r4] cmp r0, r6 bne @08088990 adds r0, r6, 0 mov r1, r9 mov r2, r8 adds r3, r4, 0 bl sub_80889A8 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08088990 adds r0, r4, 0 b @0808899A .align 2, 0 .pool @08088990: adds r5, 0x1 adds r4, 0xC cmp r5, r7 blt @0808896E @08088998: movs r0, 0 @0808899A: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8088950 thumb_func_start sub_80889A8 sub_80889A8: ; 80889A8 push {r4-r7,lr} mov r7, r8 push {r7} adds r7, r1, 0 mov r8, r2 adds r5, r3, 0 lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 adds r0, r5, 0 bl mapconnection_get_mapheader adds r2, r0, 0 cmp r4, 0x1 blt @08088A00 cmp r4, 0x2 bgt @080889E0 ldr r0, =0x02037318 ldr r0, [r0] ldr r1, [r0] ldr r0, [r2] ldr r2, [r0] ldr r3, [r5, 0x4] adds r0, r7, 0 b @080889F2 .align 2, 0 .pool @080889E0: cmp r6, 0x4 bgt @08088A00 ldr r0, =0x02037318 ldr r0, [r0] ldr r1, [r0, 0x4] ldr r0, [r2] ldr r2, [r0, 0x4] ldr r3, [r5, 0x4] mov r0, r8 @080889F2: bl sub_8088A0C lsls r0, 24 lsrs r0, 24 b @08088A02 .align 2, 0 .pool @08088A00: movs r0, 0 @08088A02: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80889A8 thumb_func_start sub_8088A0C sub_8088A0C: ; 8088A0C push {r4,lr} adds r4, r0, 0 adds r0, r2, 0 adds r2, r3, 0 cmp r3, 0 bge @08088A1A movs r3, 0 @08088A1A: adds r2, r0, r2 cmp r2, r1 bge @08088A22 adds r1, r2, 0 @08088A22: cmp r3, r4 bgt @08088A2E cmp r4, r1 bgt @08088A2E movs r0, 0x1 b @08088A30 @08088A2E: movs r0, 0 @08088A30: pop {r4} pop {r1} bx r1 thumb_func_end sub_8088A0C thumb_func_start sub_8088A38 sub_8088A38: ; 8088A38 push {lr} cmp r0, 0 blt @08088A46 cmp r0, r1 bge @08088A46 movs r0, 0x1 b @08088A48 @08088A46: movs r0, 0 @08088A48: pop {r1} bx r1 thumb_func_end sub_8088A38 thumb_func_start sub_8088A4C sub_8088A4C: ; 8088A4C push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 bl mapconnection_get_mapheader adds r1, r0, 0 ldrb r0, [r4] cmp r0, 0x1 blt @08088A84 cmp r0, 0x2 bgt @08088A72 ldr r0, [r4, 0x4] subs r0, r5, r0 ldr r1, [r1] ldr r1, [r1] bl sub_8088A38 b @08088A86 @08088A72: cmp r0, 0x4 bgt @08088A84 ldr r0, [r4, 0x4] subs r0, r6, r0 ldr r1, [r1] ldr r1, [r1, 0x4] bl sub_8088A38 b @08088A86 @08088A84: movs r0, 0 @08088A86: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8088A4C thumb_func_start sub_8088A8C sub_8088A8C: ; 8088A8C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 16 lsrs r0, 16 mov r8, r0 lsls r1, 16 lsrs r1, 16 ldr r2, =0x02037318 ldr r0, [r2, 0xC] cmp r0, 0 bne @08088AB4 b @08088B2A .align 2, 0 .pool @08088AB0: adds r0, r4, 0 b @08088B2C @08088AB4: ldr r7, [r0] ldr r4, [r0, 0x4] movs r6, 0 cmp r6, r7 bge @08088B2A lsls r0, r1, 16 asrs r5, r0, 16 mov r9, r2 mov r1, r8 lsls r0, r1, 16 asrs r0, 16 mov r10, r0 @08088ACC: ldrb r1, [r4] adds r3, r1, 0 subs r0, r1, 0x5 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @08088B22 cmp r1, 0x2 bne @08088AE2 cmp r5, 0x6 bgt @08088B22 @08088AE2: cmp r1, 0x1 bne @08088AF2 mov r2, r9 ldr r0, [r2] ldr r0, [r0, 0x4] adds r0, 0x7 cmp r5, r0 blt @08088B22 @08088AF2: mov r0, r8 lsls r2, r0, 16 cmp r1, 0x3 bne @08088B00 mov r1, r10 cmp r1, 0x6 bgt @08088B22 @08088B00: cmp r3, 0x4 bne @08088B12 asrs r1, r2, 16 mov r3, r9 ldr r0, [r3] ldr r0, [r0] adds r0, 0x7 cmp r1, r0 blt @08088B22 @08088B12: asrs r1, r2, 16 subs r1, 0x7 adds r0, r4, 0 subs r2, r5, 0x7 bl sub_8088A4C cmp r0, 0x1 beq @08088AB0 @08088B22: adds r6, 0x1 adds r4, 0xC cmp r6, r7 blt @08088ACC @08088B2A: movs r0, 0 @08088B2C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8088A8C thumb_func_start sub_8088B3C sub_8088B3C: ; 8088B3C lsls r0, 16 lsrs r0, 16 lsls r1, 16 lsrs r1, 16 ldr r2, =0x03005d8c ldr r2, [r2] subs r0, 0x7 strh r0, [r2] subs r1, 0x7 strh r1, [r2, 0x2] bx lr .align 2, 0 .pool thumb_func_end sub_8088B3C thumb_func_start sav1_camera_get_focus_coords sav1_camera_get_focus_coords: ; 8088B58 ldr r2, =0x03005d8c ldr r3, [r2] ldrh r2, [r3] adds r2, 0x7 strh r2, [r0] ldrh r0, [r3, 0x2] adds r0, 0x7 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sav1_camera_get_focus_coords thumb_func_start sub_8088B70 sub_8088B70: ; 8088B70 ldr r2, =0x03005d8c ldr r2, [r2] strh r0, [r2] strh r1, [r2, 0x2] bx lr .align 2, 0 .pool thumb_func_end sub_8088B70 thumb_func_start sub_8088B80 sub_8088B80: ; 8088B80 ldr r2, =0x03005d8c ldr r3, [r2] ldrh r2, [r3] strh r2, [r0] ldrh r0, [r3, 0x2] strh r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005dc0 ldr r1, [r2] cmp r4, r1 bge @08088BE6 cmp r3, 0 blt @08088BE6 ldr r0, [r2, 0x4] cmp r3, r0 bge @08088BE6 cmp r5, 0 beq @08088BD4 adds r0, r1, 0 muls r0, r3 adds r0, r4, r0 ldr r1, [r2, 0x8] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r3, 0xC0 lsls r3, 4 adds r2, r3, 0 orrs r1, r2 strh r1, [r0] b @08088BE6 .align 2, 0 .pool @08088BD4: muls r1, r3 adds r1, r4, r1 ldr r0, [r2, 0x8] lsls r1, 1 adds r1, r0 ldrh r2, [r1] ldr r0, =0x0000f3ff ands r0, r2 strh r0, [r1] @08088BE6: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8088B94 thumb_func_start sub_8088BF0 sub_8088BF0: ; 8088BF0 push {lr} adds r3, r0, 0 lsls r1, 16 lsrs r0, r1, 16 adds r1, r0, 0 lsls r2, 24 lsrs r2, 24 cmp r2, 0xFF beq @08088C24 cmp r2, 0 bne @08088C0C lsls r0, 1 subs r3, r0 b @08088C10 @08088C0C: lsls r0, r1, 1 adds r3, r0 @08088C10: ldrh r1, [r3] ldr r0, =0x000003ff ands r0, r1 adds r1, r2, 0 bl sub_80FADE4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08088C2C @08088C24: movs r0, 0 b @08088C2E .align 2, 0 .pool @08088C2C: movs r0, 0x1 @08088C2E: pop {r1} bx r1 thumb_func_end sub_8088BF0 thumb_func_start copy_tileset_patterns_to_vram ; void copy_tileset_patterns_to_vram(tileset *tileset, int num_tiles, int offset) copy_tileset_patterns_to_vram: ; 8088C34 push {r4-r7,lr} sub sp, 0x4 adds r3, r0, 0 lsls r1, 16 lsrs r4, r1, 16 adds r6, r4, 0 lsls r2, 16 lsrs r5, r2, 16 adds r7, r5, 0 cmp r3, 0 beq @08088C70 ldrb r0, [r3] cmp r0, 0 bne @08088C60 ldr r1, [r3, 0x4] lsls r2, r4, 21 lsrs r2, 16 movs r0, 0x2 adds r3, r5, 0 bl 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 ; void copy_tileset_patterns_to_vram2(tileset *tileset, int num_tiles, int offset) copy_tileset_patterns_to_vram2: ; 8088C78 push {r4-r7,lr} sub sp, 0x4 adds r3, r0, 0 lsls r1, 16 lsrs r4, r1, 16 adds r6, r4, 0 lsls r2, 16 lsrs r5, r2, 16 adds r7, r5, 0 cmp r3, 0 beq @08088CB4 ldrb r0, [r3] cmp r0, 0 bne @08088CA4 ldr r1, [r3, 0x4] lsls r2, r4, 21 lsrs r2, 16 movs r0, 0x2 adds r3, r5, 0 bl 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 ; void apply_map_tileset_palette(tileset *tileset, int dest_offset, int size) apply_map_tileset_palette: ; 8088CC4 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 adds r4, r0, 0 lsls r1, 16 lsrs r5, r1, 16 mov r8, r5 lsls r6, r2, 16 lsrs r7, r6, 16 adds r2, r7, 0 movs r1, 0 mov r0, sp strh r1, [r0] cmp r4, 0 beq @08088D42 ldrb r0, [r4, 0x1] cmp r0, 0 bne @08088D18 mov r0, sp adds r1, r5, 0 movs r2, 0x2 bl gpu_pal_apply ldr r0, [r4, 0x8] adds r0, 0x2 adds r5, 0x1 lsls r5, 16 lsrs r5, 16 subs r4, r7, 0x2 lsls r2, r4, 16 lsrs r2, 16 adds r1, r5, 0 bl gpu_pal_apply lsls r4, 15 lsrs r4, 16 adds r0, r5, 0 adds r1, r4, 0 bl nullsub_3 b @08088D42 @08088D18: cmp r0, 0x1 bne @08088D32 ldr r0, [r4, 0x8] adds r0, 0xC0 adds r1, r5, 0 adds r2, r7, 0 bl gpu_pal_apply lsrs r1, r6, 17 adds r0, r5, 0 bl nullsub_3 b @08088D42 @08088D32: ldr r0, [r4, 0x8] mov r1, r8 bl decompress_palette lsrs r1, r6, 17 mov r0, r8 bl nullsub_3 @08088D42: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end apply_map_tileset_palette thumb_func_start copy_map_tileset1_to_vram ; void copy_map_tileset1_to_vram(mapdata_header *a1) copy_map_tileset1_to_vram: ; 8088D50 push {lr} ldr r0, [r0, 0x10] movs r1, 0x80 lsls r1, 2 movs r2, 0 bl copy_tileset_patterns_to_vram pop {r0} bx r0 thumb_func_end copy_map_tileset1_to_vram thumb_func_start copy_map_tileset2_to_vram ; void copy_map_tileset2_to_vram(mapdata_header *a1) copy_map_tileset2_to_vram: ; 8088D64 push {lr} ldr r0, [r0, 0x14] movs r2, 0x80 lsls r2, 2 adds r1, r2, 0 bl copy_tileset_patterns_to_vram pop {r0} bx r0 thumb_func_end copy_map_tileset2_to_vram thumb_func_start copy_map_tileset2_to_vram_2 ; void copy_map_tileset2_to_vram_2(mapdata_header *a1) copy_map_tileset2_to_vram_2: ; 8088D78 push {lr} ldr r0, [r0, 0x14] movs r2, 0x80 lsls r2, 2 adds r1, r2, 0 bl copy_tileset_patterns_to_vram2 pop {r0} bx r0 thumb_func_end copy_map_tileset2_to_vram_2 thumb_func_start apply_map_tileset1_palette ; void apply_map_tileset1_palette(mapdata_header *a1) apply_map_tileset1_palette: ; 8088D8C push {lr} ldr r0, [r0, 0x10] movs r1, 0 movs r2, 0xC0 bl apply_map_tileset_palette pop {r0} bx r0 thumb_func_end apply_map_tileset1_palette thumb_func_start apply_map_tileset2_palette ; void apply_map_tileset2_palette(mapdata_header *a1) apply_map_tileset2_palette: ; 8088D9C push {lr} ldr r0, [r0, 0x14] movs r1, 0x60 movs r2, 0xE0 bl apply_map_tileset_palette pop {r0} bx r0 thumb_func_end apply_map_tileset2_palette thumb_func_start copy_map_tileset1_tileset2_to_vram ; void copy_map_tileset1_tileset2_to_vram(mapdata_header *a1) copy_map_tileset1_tileset2_to_vram: ; 8088DAC push {r4,r5,lr} adds r5, r0, 0 cmp r5, 0 beq @08088DCC ldr r0, [r5, 0x10] movs r4, 0x80 lsls r4, 2 adds r1, r4, 0 movs r2, 0 bl copy_tileset_patterns_to_vram2 ldr r0, [r5, 0x14] adds r1, r4, 0 adds r2, r4, 0 bl copy_tileset_patterns_to_vram2 @08088DCC: pop {r4,r5} pop {r0} bx r0 thumb_func_end copy_map_tileset1_tileset2_to_vram thumb_func_start apply_map_tileset1_tileset2_palette ; void apply_map_tileset1_tileset2_palette(mapdata_header *a1) apply_map_tileset1_tileset2_palette: ; 8088DD4 push {r4,lr} adds r4, r0, 0 cmp r4, 0 beq @08088DE6 bl apply_map_tileset1_palette adds r0, r4, 0 bl apply_map_tileset2_palette @08088DE6: pop {r4} pop {r0} bx r0 thumb_func_end apply_map_tileset1_tileset2_palette thumb_func_start 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, =gUnknown_08486EFC 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 .pool @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, =gUnknown_08486EFC 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 .pool @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_ ; void move_tilemap_camera_to_upper_left_corner_(struc_28 *a1) move_tilemap_camera_to_upper_left_corner_: ; 8089B58 movs r1, 0 strb r1, [r0, 0x2] strb r1, [r0, 0x3] strb r1, [r0] strb r1, [r0, 0x1] movs r1, 0x1 strb r1, [r0, 0x4] bx lr thumb_func_end move_tilemap_camera_to_upper_left_corner_ thumb_func_start tilemap_move_something 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 ; void move_tilemap_camera_to_upper_left_corner() move_tilemap_camera_to_upper_left_corner: ; 8089B94 push {lr} ldr r0, =0x03000e20 bl move_tilemap_camera_to_upper_left_corner_ pop {r0} bx r0 .align 2, 0 .pool thumb_func_end move_tilemap_camera_to_upper_left_corner thumb_func_start sub_8089BA4 sub_8089BA4: ; 8089BA4 push {r4,r5,lr} ldr r1, =0x03000e20 ldr r0, =0x03000e28 movs r2, 0 ldrsh r5, [r0, r2] ldrb r0, [r1] adds r5, r0 ldr r0, =0x03000e2a movs r2, 0 ldrsh r4, [r0, r2] ldrb r1, [r1, 0x1] adds r4, r1 adds r4, 0x8 lsls r5, 16 lsrs r5, 16 movs r0, 0x14 adds r1, r5, 0 bl 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 .pool thumb_func_end sub_8089BA4 thumb_func_start sub_8089C08 sub_8089C08: ; 8089C08 push {r4,lr} ldr r3, =0x03000e20 ldr r2, =0x03000e28 ldrh r2, [r2] ldrb r4, [r3] adds r2, r4 strh r2, [r0] ldr r0, =0x03000e2a ldrh r0, [r0] ldrb r3, [r3, 0x1] adds r0, r3 adds r0, 0x8 strh r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8089C08 thumb_func_start cur_mapdata_full_redraw ; void cur_mapdata_full_redraw() cur_mapdata_full_redraw: ; 8089C34 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] movs r2, 0 ldrsh r0, [r1, r2] movs r2, 0x2 ldrsh r1, [r1, r2] ldr r2, =0x02037318 ldr r2, [r2] bl cur_mapdata_redraw_all_blocks_at ldr r1, =0x03000e20 movs r0, 0x1 strb r0, [r1, 0x4] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end cur_mapdata_full_redraw thumb_func_start cur_mapdata_redraw_all_blocks_at ; void cur_mapdata_redraw_all_blocks_at(int x, int y, mapdata_header *mapdata_header) 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, =0x03000e20 ldrb r0, [r2, 0x3] adds r0, r1, r0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1F bls @08089C88 subs r0, 0x20 lsls r0, 24 lsrs r0, 24 @08089C88: lsls r6, r0, 5 movs r4, 0 adds r7, r1, 0x2 str r7, [sp] lsrs r5, r1, 1 @08089C92: ldr r1, =0x03000e20 ldrb r0, [r1, 0x2] adds r0, r4, r0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1F bls @08089CA6 subs r0, 0x20 lsls r0, 24 lsrs r0, 24 @08089CA6: adds r1, r6, r0 lsls r1, 16 lsrs r1, 16 lsrs r2, r4, 1 add r2, r10 mov r0, r8 mov r7, r9 adds r3, r7, r5 bl 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 .pool 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, =0x02037318 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 .pool 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, =0x03005d8c ldr r3, [r0] movs r0, 0 ldrsh r2, [r3, r0] lsrs r0, r4, 1 adds r2, r0 movs r0, 0x2 ldrsh r3, [r3, r0] adds r3, 0xE adds r0, r7, 0 bl 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 .pool 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, =0x03005d8c ldr r3, [r0] movs r0, 0 ldrsh r2, [r3, r0] lsrs r0, r4, 1 adds r2, r0 movs r0, 0x2 ldrsh r3, [r3, r0] adds r0, r7, 0 bl 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 .pool 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, =0x03005d8c ldr r0, [r0] movs r3, 0 ldrsh r2, [r0, r3] movs r7, 0x2 ldrsh r3, [r0, r7] lsrs r0, r4, 1 adds r3, r0 mov r0, r8 bl 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 .pool 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, =0x03005d8c ldr r0, [r0] movs r3, 0 ldrsh r2, [r0, r3] adds r2, 0xE movs r7, 0x2 ldrsh r3, [r0, r7] lsrs r0, r4, 1 adds r3, r0 mov r0, r8 bl 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 .pool 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, =0x03000e20 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, =0x02037318 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 .pool 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, =0x03000e20 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 .pool thumb_func_end overworld_draw_block_type1_on_map_coord thumb_func_start cur_mapdata_draw_block_at_internal ; void cur_mapdata_draw_block_at_internal(mapdata_header *mapdata_header, u16 offset, int x, int y) 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, =0x000001ff cmp r4, r0 bhi @08089F48 ldr r0, [r5, 0x10] ldr r5, [r0, 0xC] b @08089F54 .align 2, 0 .pool @08089F48: ldr r0, [r5, 0x14] ldr r5, [r0, 0xC] ldr r1, =0xfffffe00 adds r0, r4, r1 lsls r0, 16 lsrs r4, r0, 16 @08089F54: adds r0, r6, 0 adds r1, r7, 0 bl 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 .pool thumb_func_end cur_mapdata_draw_block_at_internal thumb_func_start overworld_draw_block ; void overworld_draw_block(int bg, void *block, u16 offset) 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, =0x03005da4 ldr r0, [r0] lsls r3, r2, 1 adds r0, r3, r0 ldrh r1, [r4] strh r1, [r0] ldrh r1, [r4, 0x2] strh r1, [r0, 0x2] adds r2, r0, 0 adds r2, 0x40 ldrh r1, [r4, 0x4] strh r1, [r2] adds r0, 0x42 ldrh r1, [r4, 0x6] strh r1, [r0] ldr r0, =0x03005d9c ldr r0, [r0] adds r0, r3, r0 movs r2, 0 strh r2, [r0] strh r2, [r0, 0x2] adds r1, r0, 0 adds r1, 0x40 strh r2, [r1] adds r0, 0x42 strh r2, [r0] b @0808A066 .align 2, 0 .pool @08089FD0: ldr r0, =0x03005da4 ldr r0, [r0] lsls r3, r2, 1 adds r0, r3, r0 ldrh r1, [r4] strh r1, [r0] ldrh r1, [r4, 0x2] strh r1, [r0, 0x2] adds r2, r0, 0 adds r2, 0x40 ldrh r1, [r4, 0x4] strh r1, [r2] adds r0, 0x42 ldrh r1, [r4, 0x6] strh r1, [r0] ldr r0, =0x03005d9c ldr r0, [r0] adds r0, r3, r0 ldrh r1, [r4, 0x8] strh r1, [r0] ldrh r1, [r4, 0xA] strh r1, [r0, 0x2] adds r2, r0, 0 adds r2, 0x40 ldrh r1, [r4, 0xC] strh r1, [r2] adds r0, 0x42 ldrh r1, [r4, 0xE] strh r1, [r0] ldr r0, =0x03005da0 ldr r0, [r0] adds r3, r0 movs r1, 0 strh r1, [r3] strh r1, [r3, 0x2] adds r0, r3, 0 adds r0, 0x40 strh r1, [r0] adds r3, 0x42 strh r1, [r3] b @0808A082 .align 2, 0 .pool @0808A030: ldr r0, =0x03005da4 ldr r0, [r0] lsls r3, r2, 1 adds r0, r3, r0 ldr r1, =0x00003014 adds r2, r1, 0 strh r2, [r0] strh r2, [r0, 0x2] adds r1, r0, 0 adds r1, 0x40 strh r2, [r1] adds r0, 0x42 strh r2, [r0] ldr r0, =0x03005d9c ldr r0, [r0] adds r0, r3, r0 ldrh r1, [r4] strh r1, [r0] ldrh r1, [r4, 0x2] strh r1, [r0, 0x2] adds r2, r0, 0 adds r2, 0x40 ldrh r1, [r4, 0x4] strh r1, [r2] adds r0, 0x42 ldrh r1, [r4, 0x6] strh r1, [r0] @0808A066: ldr r0, =0x03005da0 ldr r0, [r0] adds r3, r0 ldrh r0, [r4, 0x8] strh r0, [r3] ldrh r0, [r4, 0xA] strh r0, [r3, 0x2] adds r1, r3, 0 adds r1, 0x40 ldrh r0, [r4, 0xC] strh r0, [r1] adds r3, 0x42 ldrh r0, [r4, 0xE] strh r0, [r3] @0808A082: movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram movs r0, 0x3 bl schedule_bg_copy_tilemap_to_vram pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r3, [r0] movs r5, 0 ldrsh r0, [r3, r5] subs r1, r0 lsls r1, 1 cmp r1, 0x1F bhi @0808A0D6 ldrb r0, [r4, 0x2] adds r1, r0 cmp r1, 0x1F ble @0808A0CA subs r1, 0x20 @0808A0CA: movs r5, 0x2 ldrsh r0, [r3, r5] subs r0, r2, r0 lsls r2, r0, 1 cmp r2, 0x1F bls @0808A0E0 @0808A0D6: movs r0, 0x1 negs r0, r0 b @0808A0EE .align 2, 0 .pool @0808A0E0: ldrb r0, [r4, 0x3] adds r2, r0 cmp r2, 0x1F ble @0808A0EA subs r2, 0x20 @0808A0EA: lsls r0, r2, 5 adds r0, r1 @0808A0EE: pop {r4,r5} pop {r1} bx r1 thumb_func_end 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, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 movs r2, 0x32 ldrsh r1, [r0, r2] str r1, [r3, 0x8] movs r1, 0x34 ldrsh r0, [r0, r1] str r0, [r3, 0xC] @0808A114: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808A0F4 thumb_func_start clear_all_callback6 clear_all_callback6: ; 808A11C ldr r1, =0x03005dd0 movs r0, 0 str r0, [r1, 0x8] str r0, [r1, 0xC] str r0, [r1, 0x10] str r0, [r1, 0x14] str r0, [r1, 0x4] str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005dd0 ldr r1, [r4, 0x4] cmp r1, 0 beq @0808A150 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl 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, =sub_808A0F4 str r0, [r4] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808A134 thumb_func_start camera_update camera_update: ; 808A174 push {r4-r7,lr} mov r7, r8 push {r7} ldr r6, =0x03005dd0 ldr r1, [r6] cmp r1, 0 beq @0808A188 adds r0, r6, 0 bl _call_via_r1 @0808A188: ldr r7, [r6, 0x8] ldr r0, [r6, 0xC] mov r8, r0 movs r4, 0 movs r5, 0 ldr r1, [r6, 0x10] ldr r0, [r6, 0x14] cmp r1, 0 bne @0808A1A6 cmp r7, 0 beq @0808A1A6 subs r4, 0x1 cmp r7, 0 ble @0808A1A6 movs r4, 0x1 @0808A1A6: cmp r0, 0 bne @0808A1BA mov r2, r8 cmp r2, 0 beq @0808A1BA movs r5, 0x1 negs r5, r5 cmp r2, 0 ble @0808A1BA movs r5, 0x1 @0808A1BA: cmp r1, 0 beq @0808A1CC cmn r1, r7 bne @0808A1CC movs r4, 0x1 negs r4, r4 cmp r7, 0 ble @0808A1CC movs r4, 0x1 @0808A1CC: cmp r0, 0 beq @0808A1E0 mov r3, r8 cmn r0, r3 bne @0808A1E0 movs r4, 0x1 negs r4, r4 cmp r3, 0 ble @0808A1E0 movs r4, 0x1 @0808A1E0: ldr r2, =0x03005dd0 ldr r0, [r2, 0x10] adds r1, r0, r7 str r1, [r2, 0x10] adds r0, r1, 0 cmp r1, 0 bge @0808A1F0 adds r0, 0xF @0808A1F0: asrs r0, 4 lsls r0, 4 subs r0, r1, r0 str r0, [r2, 0x10] ldr r0, [r2, 0x14] mov r3, r8 adds r1, r0, r3 str r1, [r2, 0x14] adds r0, r1, 0 cmp r1, 0 bge @0808A208 adds r0, 0xF @0808A208: asrs r0, 4 lsls r0, 4 subs r0, r1, r0 str r0, [r2, 0x14] cmp r4, 0 bne @0808A218 cmp r5, 0 beq @0808A24E @0808A218: adds r0, r4, 0 adds r1, r5, 0 bl 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, =0x03000e20 lsls r4, 1 lsls r5, 1 adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 bl tilemap_move_something adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 bl cur_mapheader_draw_map_slice @0808A24E: ldr r0, =0x03000e20 adds r1, r7, 0 mov r2, r8 bl coords8_add ldr r1, =0x03005dec ldrh r0, [r1] subs r0, r7 strh r0, [r1] ldr r1, =0x03005de8 ldrh r0, [r1] mov r2, r8 subs r0, r2 strh r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005dec lsls r4, 4 ldrh r0, [r1] subs r0, r4 strh r0, [r1] ldr r1, =0x03005de8 lsls r5, 4 ldrh r0, [r1] subs r0, r5 strh r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end camera_move_and_redraw thumb_func_start sub_808A2C0 sub_808A2C0: ; 808A2C0 ldr r1, =0x03000e30 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_808A2C0 thumb_func_start sub_808A2CC sub_808A2CC: ; 808A2CC ldr r2, =0x03000e28 strh r0, [r2] ldr r0, =0x03000e2a lsls r1, 16 asrs r1, 16 adds r1, 0x20 strh r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_808A2CC thumb_func_start sub_808A2E4 sub_808A2E4: ; 808A2E4 ldr r1, =0x03000e30 ldr r0, =nu_805AE74 str r0, [r1] ldr r1, =0x03000e2c movs r0, 0 strb r0, [r1] ldr r1, =0x03000e28 movs r0, 0 strh r0, [r1] ldr r1, =0x03000e2a movs r0, 0x20 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_808A2E4 thumb_func_start sub_808A314 sub_808A314: ; 808A314 push {lr} ldr r0, =0x03000e30 ldr r0, [r0] cmp r0, 0 beq @0808A322 bl _call_via_r0 @0808A322: ldr r2, =0x02021bbc ldr r0, =0x03005dec ldr r1, =0x03000e28 ldrh r0, [r0] ldrh r1, [r1] subs r0, r1 strh r0, [r2] ldr r2, =0x02021bbe ldr r0, =0x03005de8 ldr r1, =0x03000e2a ldrh r0, [r0] ldrh r1, [r1] subs r0, r1 subs r0, 0x8 strh r0, [r2] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808A314 thumb_func_start nu_805AE74 nu_805AE74: ; 808A360 push {lr} ldr r0, =0x02037348 ldrb r0, [r0] cmp r0, 0 bne @0808A374 bl sub_808A2E4 b @0808A3FC .align 2, 0 .pool @0808A374: ldr r0, =0x02037590 ldrb r0, [r0, 0x3] cmp r0, 0x1 bne @0808A394 ldr r0, =0x03000e2c ldrb r1, [r0] movs r2, 0x1 eors r1, r2 strb r1, [r0] cmp r1, 0 beq @0808A3FC b @0808A39A .align 2, 0 .pool @0808A394: ldr r1, =0x03000e2c 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, =0x03000e2a ldrh r3, [r2] movs r0, 0 ldrsh r1, [r2, r0] movs r0, 0x8 negs r0, r0 cmp r1, r0 ble @0808A3FC subs r0, r3, 0x2 b @0808A3FA .align 2, 0 .pool @0808A3C4: cmp r0, 0x1 bne @0808A3E0 ldr r1, =0x03000e2a ldrh r2, [r1] movs r3, 0 ldrsh r0, [r1, r3] cmp r0, 0x47 bgt @0808A3FC adds r0, r2, 0x2 strh r0, [r1] b @0808A3FC .align 2, 0 .pool @0808A3E0: ldr r2, =0x03000e2a ldrh r0, [r2] movs r3, 0 ldrsh r1, [r2, r3] cmp r1, 0x1F bgt @0808A3F4 adds r0, 0x2 b @0808A3FA .align 2, 0 .pool @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, =0x06007e00 movs r2, 0x80 bl CpuFastSet b @0808A42E .align 2, 0 .pool @0808A420: ldrh r1, [r1, 0x2] ldr r0, [r2, 0x4] adds r0, r1 ldr r1, =0x06007f00 movs r2, 0x40 bl CpuFastSet @0808A42E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808A400 thumb_func_start door_build_blockdef door_build_blockdef: ; 808A438 push {r4-r6,lr} adds r6, r0, 0 lsls r1, 16 lsrs r5, r1, 16 movs r4, 0 adds r1, r6, 0 @0808A444: ldrb r0, [r2] lsls r0, 28 lsrs r3, r0, 16 adds r2, 0x1 adds r0, r5, r4 orrs r3, r0 strh r3, [r1] adds r1, 0x2 adds r4, 0x1 cmp r4, 0x3 ble @0808A444 cmp r4, 0x7 bgt @0808A472 lsls r0, r4, 1 adds r1, r0, r6 @0808A462: ldrb r0, [r2] lsls r3, r0, 12 adds r2, 0x1 strh r3, [r1] adds r1, 0x2 adds r4, 0x1 cmp r4, 0x7 ble @0808A462 @0808A472: pop {r4-r6} pop {r0} bx r0 thumb_func_end door_build_blockdef thumb_func_start door_patch_tilemap door_patch_tilemap: ; 808A478 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x30 adds r7, r1, 0 mov r9, r2 adds r5, r3, 0 ldrb r0, [r0, 0x3] cmp r0, 0x2 bne @0808A4F4 add r4, sp, 0x10 movs r1, 0xFC lsls r1, 2 adds r0, r4, 0 adds r2, r5, 0 bl door_build_blockdef mov r6, r9 subs r6, 0x1 adds r0, r7, 0 adds r1, r6, 0 adds r2, r4, 0 bl 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, =0x0000ffff cmp r1, r0 bne @0808A5B0 adds r0, r4, 0 adds r1, r6, 0 adds r2, r7, 0 bl sub_808A530 bl sub_808A964 lsls r0, 24 cmp r0, 0 beq @0808A5E2 ldr r0, =0x020375e0 ldrh r1, [r0] adds r1, 0x7 ldr r0, =0x020375e2 ldrh r2, [r0] adds r2, 0x7 adds r0, r4, 0 bl sub_808A530 b @0808A5E2 .align 2, 0 .pool @0808A5B0: adds r0, r4, 0 adds r1, r5, 0 bl sub_808A400 ldr r3, [r4, 0x8] adds r0, r4, 0 adds r1, r6, 0 adds r2, r7, 0 bl door_patch_tilemap bl sub_808A964 lsls r0, 24 cmp r0, 0 beq @0808A5E2 ldr r0, =0x020375e0 ldrh r1, [r0] adds r1, 0x7 ldr r0, =0x020375e2 ldrh r2, [r0] adds r2, 0x7 ldr r3, [r4, 0x8] adds r0, r4, 0 bl door_patch_tilemap @0808A5E2: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808A568 thumb_func_start sub_808A5F0 sub_808A5F0: ; 808A5F0 push {r4-r6,lr} adds r6, r0, 0 adds r5, r1, 0 adds r4, r2, 0 movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0 bne @0808A616 movs r2, 0x8 ldrsh r1, [r4, r2] lsls r1, 2 adds r1, r5, r1 movs r0, 0xC ldrsh r2, [r4, r0] movs r0, 0xE ldrsh r3, [r4, r0] adds r0, r6, 0 bl sub_808A568 @0808A616: movs r2, 0xA ldrsh r1, [r4, r2] movs r2, 0x8 ldrsh r0, [r4, r2] lsls r0, 2 adds r0, r5 ldrb r0, [r0] cmp r1, r0 bne @0808A644 movs r0, 0 strh r0, [r4, 0xA] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldrb r0, [r0] cmp r0, 0 bne @0808A64A movs r0, 0 b @0808A64C @0808A644: ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] @0808A64A: movs r0, 0x1 @0808A64C: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_808A5F0 thumb_func_start task50_overworld_door task50_overworld_door: ; 808A654 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r2, r4, 2 adds r2, r4 lsls r2, 3 ldr r0, =0x03005e08 adds r2, r0 ldrh r1, [r2] lsls r1, 16 ldrh r0, [r2, 0x2] orrs r1, r0 ldrh r0, [r2, 0x4] lsls r0, 16 ldrh r3, [r2, 0x6] orrs r0, r3 bl sub_808A5F0 cmp r0, 0 bne @0808A682 adds r0, r4, 0 bl remove_task @0808A682: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task50_overworld_door thumb_func_start door_frame_last door_frame_last: ; 808A68C push {lr} adds r1, r0, 0 b @0808A694 @0808A692: adds r1, 0x4 @0808A694: ldrb r0, [r1] cmp r0, 0 bne @0808A692 subs r0, r1, 0x4 pop {r1} bx r1 thumb_func_end door_frame_last thumb_func_start door_find door_find: ; 808A6A0 push {lr} adds r2, r0, 0 lsls r1, 16 lsrs r1, 16 b @0808A6B6 @0808A6AA: ldrh r0, [r2] cmp r0, r1 bne @0808A6B4 adds r0, r2, 0 b @0808A6BE @0808A6B4: adds r2, 0xC @0808A6B6: ldr r0, [r2, 0x4] cmp r0, 0 bne @0808A6AA movs r0, 0 @0808A6BE: pop {r1} bx r1 thumb_func_end door_find thumb_func_start task_overworld_door_add_if_inactive task_overworld_door_add_if_inactive: ; 808A6C4 push {r4-r7,lr} mov r7, r8 push {r7} adds r6, r0, 0 adds r5, r1, 0 adds r7, r2, 0 mov r8, r3 ldr r4, =task50_overworld_door adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0808A718 adds r0, r4, 0 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r2, =0x03005e08 adds r1, r2 strh r7, [r1, 0xC] mov r2, r8 strh r2, [r1, 0xE] strh r5, [r1, 0x2] lsrs r2, r5, 16 strh r2, [r1] strh r6, [r1, 0x6] lsrs r2, r6, 16 strh r2, [r1, 0x4] lsls r0, 24 asrs r0, 24 b @0808A71C .align 2, 0 .pool @0808A718: movs r0, 0x1 negs r0, r0 @0808A71C: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end task_overworld_door_add_if_inactive thumb_func_start sub_808A728 sub_808A728: ; 808A728 push {lr} bl sub_808A530 pop {r0} bx r0 thumb_func_end sub_808A728 thumb_func_start sub_808A734 sub_808A734: ; 808A734 push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 adds r0, r5, 0 adds r1, r6, 0 bl 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, =gUnknown_08496F8C adds r0, r1, 0 bl door_frame_last adds r1, r0, 0 adds r0, r4, 0 adds r2, r5, 0 adds r3, r6, 0 bl sub_808A568 @0808A76A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08496F8C adds r0, r2, 0 b @0808A7B4 .align 2, 0 .pool @0808A7B0: ldr r1, =gUnknown_08496FB4 adds r0, r4, 0 @0808A7B4: adds r2, r5, 0 adds r3, r6, 0 bl task_overworld_door_add_if_inactive lsls r0, 24 asrs r0, 24 @0808A7C0: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end task_overworld_door_add_for_opening_door_at thumb_func_start sub_808A7CC sub_808A7CC: ; 808A7CC push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 adds r0, r5, 0 adds r1, r6, 0 bl 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, =gUnknown_08496FA0 adds r2, r5, 0 adds r3, r6, 0 bl task_overworld_door_add_if_inactive lsls r0, 24 asrs r0, 24 b @0808A804 .align 2, 0 .pool @0808A800: movs r0, 0x1 negs r0, r0 @0808A804: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_808A7CC thumb_func_start cur_mapdata_get_door_x2_at cur_mapdata_get_door_x2_at: ; 808A80C push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 adds r1, r2, 0 bl 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, =gUnknown_08497174 adds r1, r3, 0 bl task_overworld_door_add_for_opening_door_at pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808A83C thumb_func_start sub_808A854 sub_808A854: ; 808A854 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl 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, =gUnknown_08497174 adds r1, r4, 0 adds r2, r5, 0 bl sub_808A734 @0808A876: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808A854 thumb_func_start sub_808A880 sub_808A880: ; 808A880 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl 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, =gUnknown_08497174 adds r1, r4, 0 adds r2, r5, 0 bl sub_808A728 @0808A8A2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808A880 thumb_func_start sub_808A8AC sub_808A8AC: ; 808A8AC push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl 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, =gUnknown_08497174 adds r1, r4, 0 adds r2, r5, 0 bl sub_808A7CC lsls r0, 24 asrs r0, 24 b @0808A8DC .align 2, 0 .pool @0808A8D8: movs r0, 0x1 negs r0, r0 @0808A8DC: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_808A8AC thumb_func_start task_overworld_door_add_if_role_69_for_opening_door_at task_overworld_door_add_if_role_69_for_opening_door_at: ; 808A8E4 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl 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, =gUnknown_08497174 adds r1, r4, 0 adds r2, r5, 0 bl task_overworld_door_add_for_opening_door_at lsls r0, 24 asrs r0, 24 b @0808A914 .align 2, 0 .pool @0808A910: movs r0, 0x1 negs r0, r0 @0808A914: pop {r4,r5} pop {r1} bx r1 thumb_func_end task_overworld_door_add_if_role_69_for_opening_door_at thumb_func_start sub_808A91C sub_808A91C: ; 808A91C push {lr} ldr r0, =task50_overworld_door bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808A91C thumb_func_start cur_mapdata_get_door_sound_at cur_mapdata_get_door_sound_at: ; 808A930 push {lr} adds r3, r0, 0 adds r2, r1, 0 ldr r0, =gUnknown_08497174 adds r1, r3, 0 bl cur_mapdata_get_door_x2_at lsls r0, 24 asrs r0, 24 cmp r0, 0 beq @0808A958 cmp r0, 0x1 bne @0808A954 movs r0, 0x12 b @0808A95E .align 2, 0 .pool @0808A954: cmp r0, 0x2 beq @0808A95C @0808A958: movs r0, 0x8 b @0808A95E @0808A95C: movs r0, 0x2F @0808A95E: pop {r1} bx r1 thumb_func_end cur_mapdata_get_door_sound_at thumb_func_start sub_808A964 sub_808A964: ; 808A964 push {lr} ldr r0, =0x00004002 bl flag_check lsls r0, 24 cmp r0, 0 beq @0808A990 ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000101a cmp r1, r0 bne @0808A990 movs r0, 0x1 b @0808A992 .align 2, 0 .pool @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, =0x02037350 adds r0, r2 ldr r2, =sub_808A9BC bl meta_step pop {r0} bx r0 .align 2, 0 .pool 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 ; void player_step(int dpad_direction, int buttons_new, int buttons_held) player_step: ; 808A9C0 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r1, 16 lsrs r7, r1, 16 lsls r2, 16 lsrs r6, r2, 16 ldr r4, =0x02037590 ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r5, r0, r1 adds r0, r5, 0 bl sub_808C280 ldrb r0, [r4, 0x6] cmp r0, 0 bne @0808AA26 adds r0, r7, 0 adds r1, r6, 0 bl sub_8119C3C adds r0, r5, 0 mov r1, r8 bl 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 .pool 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 ; int npc_clear_strange_bits(npc_state *) npc_clear_strange_bits: ; 808AA9C ldrb r2, [r0, 0x1] movs r1, 0x11 negs r1, r1 ands r1, r2 movs r2, 0x5 negs r2, r2 ands r1, r2 adds r2, 0x2 ands r1, r2 strb r1, [r0, 0x1] ldr r2, =0x02037590 ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] bx lr .align 2, 0 .pool thumb_func_end npc_clear_strange_bits thumb_func_start player_step_by_keypad ; void player_step_by_keypad(int dpad_direction, int buttons_new, int buttons_held) 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, =0x02037590 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 .pool @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, =0x02037590 ldrb r0, [r2, 0x2] cmp r0, 0x2 bne @0808AB0A ldrb r1, [r2] movs r0, 0xDF ands r0, r1 strb r0, [r2] @0808AB0A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end walkrun_clear_x20_when_running_fast thumb_func_start sub_808AB14 sub_808AB14: ; 808AB14 push {r4,lr} ldr r4, =gUnknown_08497444 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 .pool thumb_func_end sub_808AB14 thumb_func_start sub_808AB38 sub_808AB38: ; 808AB38 push {r4-r6,lr} ldr r3, =0x02037590 ldrb r1, [r3] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0808AB8A ldr r2, =0x02037350 ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r5, [r0, 0x1E] movs r4, 0 ldr r6, =gUnknown_084973FC @0808AB58: lsls r0, r4, 2 adds r0, r6 ldr r1, [r0] adds r0, r5, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 beq @0808AB80 adds r0, r4, 0x1 lsls r0, 24 lsrs r0, 24 b @0808AB8C .align 2, 0 .pool @0808AB80: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x11 bls @0808AB58 @0808AB8A: movs r0, 0 @0808AB8C: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_808AB38 thumb_func_start sub_808AB94 sub_808AB94: ; 808AB94 push {r4,lr} ldr r4, =0x02037590 ldrb r1, [r4] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0808ABCE ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldrb r2, [r0, 0x1] movs r1, 0x3 negs r1, r1 ands r1, r2 movs r2, 0x8 orrs r1, r2 strb r1, [r0, 0x1] ldrb r1, [r0, 0x18] lsls r1, 28 lsrs r1, 28 bl 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 .pool 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, =0x02037590 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 .pool @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, =0x02037590 ldrb r2, [r0, 0x5] lsls r0, r2, 3 adds r0, r2 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 ldrb r2, [r0, 0x1] movs r3, 0x4 orrs r2, r3 strb r2, [r0, 0x1] ldrb r0, [r0, 0x18] lsrs r0, 4 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808AC58 thumb_func_start sub_808AC8C sub_808AC8C: ; 808AC8C push {lr} ldr r0, =sub_808B738 bl sub_808AC58 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808AC8C thumb_func_start sub_808ACA0 sub_808ACA0: ; 808ACA0 push {lr} ldr r1, =sub_808B720 movs r0, 0x1 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808ACA0 thumb_func_start sub_808ACB8 sub_808ACB8: ; 808ACB8 push {lr} ldr r1, =sub_808B720 movs r0, 0x2 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808ACB8 thumb_func_start sub_808ACD0 sub_808ACD0: ; 808ACD0 push {lr} ldr r1, =sub_808B720 movs r0, 0x3 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808ACD0 thumb_func_start sub_808ACE8 sub_808ACE8: ; 808ACE8 push {lr} ldr r1, =sub_808B720 movs r0, 0x4 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808ACE8 thumb_func_start sub_808AD00 sub_808AD00: ; 808AD00 push {lr} ldr r1, =sub_808B750 movs r0, 0x1 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808AD00 thumb_func_start sub_808AD18 sub_808AD18: ; 808AD18 push {lr} ldr r1, =sub_808B750 movs r0, 0x2 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808AD18 thumb_func_start sub_808AD30 sub_808AD30: ; 808AD30 push {lr} ldr r1, =sub_808B750 movs r0, 0x3 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808AD30 thumb_func_start sub_808AD48 sub_808AD48: ; 808AD48 push {lr} ldr r1, =sub_808B750 movs r0, 0x4 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808AD48 thumb_func_start sub_808AD60 sub_808AD60: ; 808AD60 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x02037590 ldrb r3, [r2, 0x5] lsls r2, r3, 3 adds r2, r3 lsls r2, 2 ldr r3, =0x02037350 adds r2, r3 ldrb r3, [r2, 0x1] movs r4, 0x4 orrs r3, r4 movs r4, 0x2 orrs r3, r4 strb r3, [r2, 0x1] bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808AD60 thumb_func_start sub_808AD98 sub_808AD98: ; 808AD98 push {lr} ldr r1, =sub_808B738 movs r0, 0x1 bl sub_808AD60 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808AD98 thumb_func_start sub_808ADB0 sub_808ADB0: ; 808ADB0 push {lr} ldr r1, =sub_808B738 movs r0, 0x2 bl sub_808AD60 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808ADB0 thumb_func_start sub_808ADC8 sub_808ADC8: ; 808ADC8 push {lr} ldr r1, =sub_808B738 movs r0, 0x3 bl sub_808AD60 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808ADC8 thumb_func_start sub_808ADE0 sub_808ADE0: ; 808ADE0 push {lr} ldr r1, =sub_808B738 movs r0, 0x4 bl sub_808AD60 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 ldrb r1, [r4, 0x18] movs r0, 0xF0 ands r0, r1 cmp r0, 0x20 bne @0808AE36 bl sub_811A138 lsls r0, 16 asrs r0, 16 cmp r0, 0x3 bgt @0808AE60 @0808AE36: movs r0, 0 bl sub_811A114 ldrb r0, [r4, 0x1] movs r1, 0x2 orrs r0, r1 strb r0, [r4, 0x1] ldr r1, =sub_808B738 movs r0, 0x1 bl sub_808ABE0 lsls r0, 24 lsrs r0, 24 b @0808AE62 .align 2, 0 .pool @0808AE60: movs r0, 0 @0808AE62: pop {r4} pop {r1} bx r1 thumb_func_end sub_808AE10 thumb_func_start dp04_continue_movement ; void dp04_continue_movement(int dpad_direction, int buttons_held) 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, =gUnknown_08497490 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 .pool 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, =0x02037590 strb r4, [r0, 0x2] movs r0, 0 b @0808AED2 .align 2, 0 .pool @0808AEB0: bl player_get_direction_upper_4bits lsls r0, 24 lsrs r0, 24 cmp r4, r0 beq @0808AECC ldr r1, =0x02037590 ldrb r0, [r1, 0x2] cmp r0, 0x2 beq @0808AECC movs r0, 0x1 b @0808AED0 .align 2, 0 .pool @0808AECC: ldr r1, =0x02037590 movs r0, 0x2 @0808AED0: strb r0, [r1, 0x2] @0808AED2: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037590 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 .pool @0808AF68: movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @0808AFB0 movs r0, 0x2 ands r6, r0 cmp r6, 0 beq @0808AFB0 movs r0, 0x8C lsls r0, 4 bl flag_check lsls r0, 24 cmp r0, 0 beq @0808AFB0 ldr r2, =0x02037350 ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1E] bl 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 .pool @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, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 ldrh r1, [r4, 0x10] add r0, sp, 0x4 strh r1, [r0] ldrh r0, [r4, 0x12] mov r5, sp adds r5, 0x6 strh r0, [r5] adds r0, r6, 0 add r1, sp, 0x4 adds r2, r5, 0 bl 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 .pool 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, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 ldrh r1, [r4, 0x10] add r0, sp, 0x4 strh r1, [r0] ldrh r0, [r4, 0x12] mov r5, sp adds r5, 0x6 strh r0, [r5] adds r0, r6, 0 add r1, sp, 0x4 adds r2, r5, 0 bl 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 .pool 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, =0x02037590 ldrb r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @0808B20C lsls r5, r3, 16 asrs r0, r5, 16 lsls r4, 16 asrs r1, r4, 16 bl 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 .pool @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, =0x00000889 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, =0x02037350 lsls r1, r6, 3 adds r1, r6 lsls r1, 2 adds r4, r1, r0 ldrb r0, [r4, 0x5] cmp r0, 0x57 bne @0808B2D8 ldrh r1, [r4, 0x10] mov r0, sp strh r1, [r0] ldrh r0, [r4, 0x12] strh r0, [r5] adds r0, r7, 0 mov r1, sp adds r2, r5, 0 bl 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 .pool @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, =gUnknown_0849749C @0808B2F0: lsls r0, r4, 2 adds r0, r7 ldr r1, [r0] adds r0, r5, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 beq @0808B314 ldr r0, =gUnknown_084974B0 adds r0, r4, r0 ldrb r0, [r0] strb r0, [r6] b @0808B31E .align 2, 0 .pool @0808B314: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x4 bls @0808B2F0 @0808B31E: pop {r4-r7} pop {r0} bx r0 thumb_func_end 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, =0x02037590 ldrb r2, [r1, 0x5] lsls r1, r2, 3 adds r1, r2 lsls r1, 2 ldr r5, =0x02037350 adds r3, r1, r5 ldrh r2, [r3, 0x10] mov r1, sp strh r2, [r1] ldrh r1, [r3, 0x12] mov r4, sp adds r4, 0x2 strh r1, [r4] mov r1, sp adds r2, r4, 0 bl 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 .pool @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, =0x02037590 ldrb r1, [r2, 0x1] orrs r0, r1 strb r0, [r2, 0x1] bl bike_related pop {r0} bx r0 .align 2, 0 .pool thumb_func_end walkrun_set_bike_bits thumb_func_start bike_related bike_related: ; 808B3E8 push {r4,r5,lr} ldr r0, =0x02037590 ldrb r4, [r0, 0x1] cmp r4, 0 beq @0808B428 movs r5, 0 @0808B3F4: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @0808B416 ldr r0, =gUnknown_084974B8 lsls r2, r5, 2 adds r2, r0 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldr r1, [r2] bl _call_via_r1 @0808B416: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 lsrs r4, 1 cmp r5, 0x7 bls @0808B3F4 ldr r1, =0x02037590 movs r0, 0 strb r0, [r1, 0x1] @0808B428: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 movs r2, 0x10 ldrsh r0, [r4, r2] str r0, [r1] movs r2, 0x12 ldrsh r0, [r4, r2] str r0, [r1, 0x4] ldr r0, =0x02037590 ldrb r0, [r0, 0x5] str r0, [r1, 0x8] movs r0, 0x8 bl 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 .pool 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, =0x02037590 ldrb r1, [r2] movs r0, 0x20 orrs r0, r1 strb r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_808B568 thumb_func_start sub_808B578 sub_808B578: ; 808B578 push {r4,lr} ldr r4, =0x02037590 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 .pool @0808B5A8: bl sub_808B618 lsls r0, 24 cmp r0, 0 bne @0808B5B6 movs r0, 0x2 @0808B5B4: strb r0, [r4, 0x3] @0808B5B6: pop {r4} pop {r0} bx r0 thumb_func_end sub_808B578 thumb_func_start sub_808B5BC sub_808B5BC: ; 808B5BC push {lr} ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1C] cmp r1, 0x3 bls @0808B602 adds r0, r1, 0 subs r0, 0x10 lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bls @0808B602 adds r0, r1, 0 subs r0, 0x19 lsls r0, 24 lsrs r0, 24 cmp r0, 0xF bls @0808B602 adds r0, r1, 0 subs r0, 0x64 lsls r0, 24 lsrs r0, 24 cmp r0, 0xB bls @0808B602 adds r0, r1, 0 subs r0, 0x7C lsls r0, 24 lsrs r0, 24 cmp r0, 0x3 bhi @0808B610 @0808B602: movs r0, 0x1 b @0808B612 .align 2, 0 .pool @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, =0x02037590 ldrb r0, [r0, 0x2] cmp r0, 0x1 beq @0808B634 movs r0, 0x1 b @0808B636 .align 2, 0 .pool @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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 bl npc_is_visible_or_is_x40 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end player_bits_x42 thumb_func_start sub_808B660 sub_808B660: ; 808B660 push {lr} ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 bl npc_get_bit7_or_const_x10_when_inactive lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808B660 thumb_func_start player_set_x22 player_set_x22: ; 808B684 ldr r3, =0x02037350 ldr r1, =0x02037590 ldrb r2, [r1, 0x5] lsls r1, r2, 3 adds r1, r2 lsls r1, 2 adds r1, r3 adds r1, 0x22 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end player_set_x22 thumb_func_start player_get_x22 player_get_x22: ; 808B6A0 ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x22 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end player_get_x22 thumb_func_start sub_808B6BC sub_808B6BC: ; 808B6BC push {lr} adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r0, =0x02037590 ldrb r2, [r0, 0x5] lsls r0, r2, 3 adds r0, r2 lsls r0, 2 ldr r2, =0x02037350 adds r0, r2 bl sub_8093208 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 adds r1, r5, 0 bl npc_set_state_2 @0808B712: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037590 ldrb r0, [r4, 0x3] cmp r0, 0x2 beq @0808B872 cmp r0, 0 bne @0808B89A @0808B872: bl player_should_look_direction_be_enforced_upon_movement lsls r0, 24 cmp r0, 0 beq @0808B89A ldr r2, =0x02037350 ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x18] lsls r0, 28 lsrs r0, 28 bl d2s_look1 lsls r0, 24 lsrs r0, 24 bl sub_808B6BC @0808B89A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808B864 thumb_func_start sub_808B8A8 sub_808B8A8: ; 808B8A8 push {lr} lsls r0, 24 lsrs r0, 24 bl sub_8093648 lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 thumb_func_end sub_808B8A8 thumb_func_start sub_808B8C0 sub_808B8C0: ; 808B8C0 push {lr} lsls r0, 24 lsrs r0, 24 bl sub_8093674 lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 thumb_func_end sub_808B8C0 thumb_func_start sub_808B8D8 sub_808B8D8: ; 808B8D8 push {lr} lsls r0, 24 lsrs r0, 24 bl sub_80936A0 lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 thumb_func_end sub_808B8D8 thumb_func_start sub_808B8F0 sub_808B8F0: ; 808B8F0 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x22 bl audio_play adds r0, r4, 0 bl sub_80936CC lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl player_npc_set_state_and_x22_etc pop {r4} pop {r0} bx r0 thumb_func_end sub_808B8F0 thumb_func_start sub_808B914 sub_808B914: ; 808B914 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x22 bl audio_play adds r0, r4, 0 bl sub_80936F8 lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r4} pop {r0} bx r0 thumb_func_end sub_808B914 thumb_func_start sub_808B938 sub_808B938: ; 808B938 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x22 bl audio_play adds r0, r4, 0 bl sub_8093724 lsls r0, 24 lsrs r0, 24 movs r1, 0x8 bl player_npc_set_state_and_x22_etc pop {r4} pop {r0} bx r0 thumb_func_end sub_808B938 thumb_func_start sub_808B95C sub_808B95C: ; 808B95C push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x22 bl audio_play adds r0, r4, 0 bl sub_80934E8 lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl player_npc_set_state_and_x22_etc pop {r4} pop {r0} bx r0 thumb_func_end sub_808B95C thumb_func_start sub_808B980 sub_808B980: ; 808B980 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x7 bl audio_play adds r0, r4, 0 bl sub_8093750 lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r4} pop {r0} bx r0 thumb_func_end sub_808B980 thumb_func_start sub_808B9A4 sub_808B9A4: ; 808B9A4 push {lr} lsls r0, 24 lsrs r0, 24 bl sub_809377C lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 thumb_func_end sub_808B9A4 thumb_func_start sub_808B9BC sub_808B9BC: ; 808B9BC push {lr} lsls r0, 24 lsrs r0, 24 bl sub_80937A8 lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 thumb_func_end sub_808B9BC thumb_func_start npc_use_some_d2s npc_use_some_d2s: ; 808B9D4 push {lr} lsls r0, 24 lsrs r0, 24 bl d2s_08064034 lsls r0, 24 lsrs r0, 24 movs r1, 0x2 bl player_npc_set_state_and_x22_etc pop {r0} bx r0 thumb_func_end npc_use_some_d2s thumb_func_start tile_conditional_sound tile_conditional_sound: ; 808B9EC push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1E] ldr r2, =gUnknown_084974D8 subs r1, r4, 0x1 lsls r1, 2 adds r1, r2 ldr r1, [r1] bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @0808BA54 cmp r4, 0x2 bne @0808BA4E mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl 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 .pool 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, =0x02037350 ldr r2, =0x02037590 ldrb r1, [r2, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r0, [r0, 0x10] strh r0, [r4] ldrb r1, [r2, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r0, [r0, 0x12] strh r0, [r5] bl player_get_direction__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 .pool thumb_func_end player_get_pos_to_plus_one_step_in_direction_player_is_facing thumb_func_start player_get_pos_to ; void player_get_pos_to(int *x, int *y) player_get_pos_to: ; 808BAAC push {r4,r5,lr} ldr r5, =0x02037350 ldr r4, =0x02037590 ldrb r3, [r4, 0x5] lsls r2, r3, 3 adds r2, r3 lsls r2, 2 adds r2, r5 ldrh r2, [r2, 0x10] strh r2, [r0] ldrb r2, [r4, 0x5] lsls r0, r2, 3 adds r0, r2 lsls r0, 2 adds r0, r5 ldrh r0, [r0, 0x12] strh r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r3, r0, r1 ldrb r1, [r3] movs r0, 0xC0 ands r0, r1 cmp r0, 0x40 beq @0808BAFC b @0808BC24 @0808BAFC: ldr r2, =0x02020630 ldrb r1, [r3, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x32 ldrsh r0, [r0, r1] cmp r0, 0 beq @0808BB12 b @0808BC24 @0808BB12: ldrh r0, [r3, 0x10] strh r0, [r4] ldrh r0, [r3, 0x12] strh r0, [r5] ldrb r0, [r3, 0x1C] subs r0, 0x8 cmp r0, 0x30 bls @0808BB24 b @0808BC24 @0808BB24: lsls r0, 2 ldr r1, =@0808BB40 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0808BB40: .4byte @0808BC04 .4byte @0808BC0A .4byte @0808BC14 .4byte @0808BC1A .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC24 .4byte @0808BC04 .4byte @0808BC0A .4byte @0808BC14 .4byte @0808BC1A @0808BC04: ldrh r0, [r5] adds r0, 0x1 b @0808BC0E @0808BC0A: ldrh r0, [r5] subs r0, 0x1 @0808BC0E: strh r0, [r5] movs r0, 0x1 b @0808BC30 @0808BC14: ldrh r0, [r4] subs r0, 0x1 b @0808BC1E @0808BC1A: ldrh r0, [r4] adds r0, 0x1 @0808BC1E: strh r0, [r4] movs r0, 0x1 b @0808BC30 @0808BC24: movs r1, 0x1 negs r1, r1 adds r0, r1, 0 strh r0, [r4] strh r0, [r5] movs r0, 0 @0808BC30: pop {r4,r5} pop {r1} bx r1 thumb_func_end plaer_get_pos_including_state_based_drift thumb_func_start player_get_direction__sp1AA player_get_direction__sp1AA: ; 808BC38 ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x18] lsls r0, 28 lsrs r0, 28 bx lr .align 2, 0 .pool thumb_func_end player_get_direction__sp1AA thumb_func_start player_get_direction_upper_4bits player_get_direction_upper_4bits: ; 808BC58 ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x18] lsrs r0, 4 bx lr .align 2, 0 .pool thumb_func_end player_get_direction_upper_4bits thumb_func_start player_get_height player_get_height: ; 808BC74 ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0xB] lsrs r0, 4 bx lr .align 2, 0 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 lsls r3, 16 asrs r3, 16 lsls r2, 16 asrs r2, 16 adds r1, r3, 0 bl sub_808EB08 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808BC90 thumb_func_start walkrun_bitfield_and_r0 walkrun_bitfield_and_r0: ; 808BCC0 ldr r1, =0x02037590 ldrb r1, [r1] ands r1, r0 adds r0, r1, 0 bx lr .align 2, 0 .pool thumb_func_end walkrun_bitfield_and_r0 thumb_func_start sub_808BCD0 sub_808BCD0: ; 808BCD0 ldr r0, =0x02037590 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_808BCD0 thumb_func_start sub_808BCDC sub_808BCDC: ; 808BCDC ldr r0, =0x02037590 ldrb r0, [r0, 0x4] bx lr .align 2, 0 .pool 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, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 adds r0, r4, 0 bl npc_clear_strange_bits ldrb r1, [r4, 0x18] lsls r1, 28 lsrs r1, 28 adds r0, r4, 0 bl 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 .pool thumb_func_end sub_808BCF4 thumb_func_start sub_808BD3C sub_808BD3C: ; 808BD3C lsls r0, 24 lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_084974E8 lsrs r0, 23 adds r1, r0 adds r1, r2 ldrb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_808BD3C thumb_func_start sub_808BD54 sub_808BD54: ; 808BD54 lsls r0, 24 lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_084974F8 lsrs r0, 23 adds r1, r0 adds r1, r2 ldrb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_808BD54 thumb_func_start sub_808BD6C sub_808BD6C: ; 808BD6C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_08497508 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_808BD6C thumb_func_start sub_808BD7C sub_808BD7C: ; 808BD7C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0849750A adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_808BD7C thumb_func_start sub_808BD8C sub_808BD8C: ; 808BD8C push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02037590 ldrb r1, [r1, 0x7] bl sub_808BD54 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 bne @0808BE12 @0808BE44: movs r0, 0 @0808BE46: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 ldrh r1, [r4, 0x10] mov r0, sp strh r1, [r0] ldrh r0, [r4, 0x12] mov r5, sp adds r5, 0x2 strh r0, [r5] ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 mov r1, sp adds r2, r5, 0 bl 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 .pool @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, =0x02037590 movs r1, 0 movs r2, 0x24 bl memset pop {r0} bx r0 .align 2, 0 .pool thumb_func_end walkrun_state_clear thumb_func_start sub_808BF14 sub_808BF14: ; 808BF14 lsls r0, 24 lsrs r0, 24 ldr r3, =0x02037590 ldrb r2, [r3] movs r1, 0xE0 ands r1, r2 orrs r0, r1 strb r0, [r3] bx lr .align 2, 0 .pool 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, =gUnknown_0849750C lsls r0, r1, 2 adds r0, r1 lsls r4, r0, 1 adds r6, r3, 0x1 @0808BF42: lsls r0, r2, 1 adds r1, r0, r4 adds r0, r1, r3 ldrb r0, [r0] cmp r0, r5 bne @0808BF58 adds r0, r1, r6 ldrb r0, [r0] b @0808BF64 .align 2, 0 .pool @0808BF58: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x4 bls @0808BF42 movs r0, 0x1 @0808BF64: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_808BF2C thumb_func_start sub_808BF6C sub_808BF6C: ; 808BF6C push {r4-r6,lr} ldr r0, =0x02037590 ldrb r5, [r0] movs r2, 0 ldr r3, =gUnknown_0849750C ldrb r1, [r0, 0x7] lsls r0, r1, 2 adds r0, r1 lsls r4, r0, 1 adds r6, r3, 0x1 @0808BF80: lsls r0, r2, 1 adds r1, r0, r4 adds r0, r1, r6 ldrb r0, [r0] ands r0, r5 cmp r0, 0 beq @0808BF9C adds r0, r1, r3 ldrb r0, [r0] b @0808BFA8 .align 2, 0 .pool @0808BF9C: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x4 bls @0808BF80 movs r0, 0 @0808BFA8: pop {r4-r6} pop {r1} bx r1 thumb_func_end 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, =0x02037590 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 .pool 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, =0x02037350 adds r4, r0 ldrb r0, [r4, 0x2] movs r1, 0x1 orrs r0, r1 strb r0, [r4, 0x2] bl sub_8154228 strb r0, [r4, 0x1B] adds r0, r4, 0 mov r1, r9 bl npc_turn bl walkrun_state_clear ldr r0, =0x02037590 strb r6, [r0, 0x2] strb r6, [r0, 0x3] strb r5, [r0, 0x5] ldrb r1, [r4, 0x4] strb r1, [r0, 0x4] mov r1, r8 strb r1, [r0, 0x7] movs r0, 0x21 bl sub_808BF14 add sp, 0x18 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 ldr r5, =0x02037590 ldrb r0, [r5, 0x5] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 adds r1, r6 movs r0, 0x1 ands r4, r0 lsls r3, r4, 5 ldrb r2, [r1, 0x1] movs r0, 0x21 negs r0, r0 ands r0, r2 orrs r0, r3 strb r0, [r1, 0x1] movs r0, 0x8 bl walkrun_bitfield_and_r0 lsls r0, 24 cmp r0, 0 beq @0808C100 ldr r2, =0x02020630 ldrb r1, [r5, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x1A] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 adds r1, 0x3E lsls r3, r4, 2 ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 orrs r0, r3 strb r0, [r1] @0808C100: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808C0A8 thumb_func_start sub_808C114 sub_808C114: ; 808C114 push {r4,r5,lr} ldr r5, =0x02037590 ldrb r0, [r5, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 movs r0, 0x5 bl 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, =0x02020630 adds r0, r1 movs r1, 0 bl obj_anim_image_start pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808C114 thumb_func_start sub_808C15C sub_808C15C: ; 808C15C push {r4-r6,lr} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r6, =0x02037590 ldrb r0, [r6, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 movs r0, 0x6 bl 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, =0x02020630 adds r4, r0 adds r0, r5, 0 bl sub_8092A0C adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl obj_anim_image_start pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808C15C thumb_func_start sub_808C1B4 sub_808C1B4: ; 808C1B4 push {r4-r6,lr} mov r6, r8 push {r6} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r6, =0x02037590 ldrb r0, [r6, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 movs r0, 0x2 bl 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, =0x02020630 mov r8, r0 add r4, r8 adds r0, r5, 0 bl sub_80929BC adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl 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 .pool thumb_func_end sub_808C1B4 thumb_func_start sub_808C228 sub_808C228: ; 808C228 push {r4-r6,lr} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r6, =0x02037590 ldrb r0, [r6, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 movs r0, 0x7 bl 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, =0x02020630 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 .pool thumb_func_end sub_808C228 thumb_func_start sub_808C280 sub_808C280: ; 808C280 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 adds r5, r0, 0 ldrb r0, [r5, 0x1E] mov r8, r0 movs r1, 0 mov r0, sp strh r1, [r0] movs r6, 0x1 ldr r1, =gUnknown_08497520 mov r9, r1 mov r4, sp mov r7, sp adds r7, 0x2 @0808C2A2: movs r1, 0 ldrsh r0, [r4, r1] lsls r0, 2 add r0, r9 ldr r1, [r0] mov r0, r8 bl _call_via_r1 lsls r0, 24 cmp r0, 0 beq @0808C2E8 ldrb r0, [r5, 0x18] lsrs r0, 4 cmp r6, r0 bne @0808C2E8 ldrh r0, [r5, 0x10] strh r0, [r4] ldrh r0, [r5, 0x12] strh r0, [r7] adds r0, r6, 0 mov r1, sp adds r2, r7, 0 bl 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 .pool @0808C2E8: ldrh r1, [r4] adds r1, 0x1 strh r1, [r4] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 lsls r1, 16 asrs r1, 16 cmp r1, 0x3 ble @0808C2A2 ldrb r0, [r5, 0x1B] bl objid_set_invisible @0808C302: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_808C280 thumb_func_start task_add_bump_boulder task_add_bump_boulder: ; 808C310 push {r4-r6,lr} adds r4, r0, 0 adds r5, r1, 0 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 ldr r6, =taskFF_bump_boulder adds r0, r6, 0 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xA] strh r5, [r1, 0xC] bl _call_via_r6 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_add_bump_boulder thumb_func_start taskFF_bump_boulder taskFF_bump_boulder: ; 808C34C push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 ldr r6, =gUnknown_08497530 ldr r2, =0x03005e00 ldr r5, =0x02037350 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @0808C360: movs r0, 0x8 ldrsh r3, [r4, r0] lsls r3, 2 adds r3, r6 ldr r0, =0x02037590 ldrb r0, [r0, 0x5] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 adds r1, r5 movs r2, 0xA ldrsh r0, [r4, r2] lsls r2, r0, 3 adds r2, r0 lsls r2, 2 adds r2, r5 ldr r3, [r3] adds r0, r4, 0 bl _call_via_r3 lsls r0, 24 cmp r0, 0 bne @0808C360 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end taskFF_bump_boulder thumb_func_start sub_808C3A4 sub_808C3A4: ; 808C3A4 push {r4,lr} adds r4, r0, 0 bl script_env_2_enable ldr r1, =0x02037590 movs r0, 0x1 strb r0, [r1, 0x6] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038c08 movs r1, 0x10 ldrsh r0, [r4, r1] str r0, [r2] movs r1, 0x12 ldrsh r0, [r4, r1] str r0, [r2, 0x4] ldrb r0, [r4, 0xB] lsrs r0, 4 str r0, [r2, 0x8] ldr r3, =0x02020630 ldrb r1, [r4, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x5] lsls r0, 28 lsrs r0, 30 str r0, [r2, 0xC] movs r0, 0xA bl 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 .pool 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, =0x02037590 movs r0, 0 strb r0, [r1, 0x6] bl script_env_2_disable ldr r0, =taskFF_bump_boulder bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @0808C4C6: movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808C484 thumb_func_start sub_808C4D8 sub_808C4D8: ; 808C4D8 push {r4,lr} ldr r4, =sub_808C4F8 adds r0, r4, 0 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 bl _call_via_r4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808C4D8 thumb_func_start sub_808C4F8 sub_808C4F8: ; 808C4F8 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_0849753C ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @0808C50A: movs r0, 0x8 ldrsh r2, [r4, r0] lsls r2, 2 adds r2, r5 ldr r0, =0x02037590 ldrb r0, [r0, 0x5] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 ldr r0, =0x02037350 adds r1, r0 ldr r2, [r2] adds r0, r4, 0 bl _call_via_r2 lsls r0, 24 cmp r0, 0 bne @0808C50A pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808C4F8 thumb_func_start sub_808C544 sub_808C544: ; 808C544 push {r4-r6,lr} adds r6, r0, 0 adds r4, r1, 0 ldr r5, =0x02037590 movs r0, 0x1 strb r0, [r5, 0x6] adds r0, r4, 0 bl 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, =sub_808C4F8 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @0808C5A0: movs r0, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808C544 thumb_func_start sub_808C5B0 sub_808C5B0: ; 808C5B0 push {r4,lr} ldr r4, =sub_808C5D0 adds r0, r4, 0 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 bl _call_via_r4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808C5B0 thumb_func_start sub_808C5D0 sub_808C5D0: ; 808C5D0 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_08497540 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @0808C5E2: movs r0, 0x8 ldrsh r2, [r4, r0] lsls r2, 2 adds r2, r5 ldr r0, =0x02037590 ldrb r0, [r0, 0x5] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 ldr r0, =0x02037350 adds r1, r0 ldr r2, [r2] adds r0, r4, 0 bl _call_via_r2 lsls r0, 24 cmp r0, 0 bne @0808C5E2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808C5D0 thumb_func_start sub_808C61C sub_808C61C: ; 808C61C push {lr} ldrh r2, [r0, 0x8] adds r2, 0x1 strh r2, [r0, 0x8] ldrb r1, [r1, 0x18] lsrs r1, 4 strh r1, [r0, 0xA] ldr r1, =0x02037590 movs r0, 0x1 strb r0, [r1, 0x6] bl script_env_2_enable movs r0, 0x2D bl audio_play movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808C61C thumb_func_start sub_808C644 sub_808C644: ; 808C644 push {r4-r6,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_08497550 mov r0, sp movs r2, 0x4 bl memcpy adds r0, r5, 0 bl 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 .pool thumb_func_end sub_808C644 thumb_func_start sub_808C6BC sub_808C6BC: ; 808C6BC push {r4,r5,lr} sub sp, 0x8 adds r5, r0, 0 adds r4, r1, 0 ldr r1, =gUnknown_08497554 mov r0, sp movs r2, 0x5 bl memcpy adds r0, r4, 0 bl 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 .pool thumb_func_end sub_808C6BC thumb_func_start sub_808C6FC sub_808C6FC: ; 808C6FC push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl 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, =0x02037590 movs r0, 0 strb r0, [r1, 0x6] ldr r0, =sub_808C5D0 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @0808C740: movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808C6FC thumb_func_start sub_808C750 sub_808C750: ; 808C750 push {r4,r5,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 bl script_env_2_enable bl sav1_reset_x2C bl sub_8085898 ldr r2, =0x02037590 ldrb r1, [r2] movs r0, 0xF7 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2] movs r0, 0x1 strb r0, [r2, 0x6] ldr r5, =taskFF_0805D1D4 adds r0, r5, 0 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] bl _call_via_r5 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808C750 thumb_func_start taskFF_0805D1D4 taskFF_0805D1D4: ; 808C7A8 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r5, r0, r1 adds r0, r5, 0 bl 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, =0x03005e00 lsls r4, r6, 2 adds r4, r6 lsls r4, 3 adds r4, r0 ldrb r0, [r4, 0x8] bl sub_8093540 adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 bl npc_set_state_2 ldr r0, =sub_808C814 str r0, [r4] @0808C7FC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end taskFF_0805D1D4 thumb_func_start sub_808C814 sub_808C814: ; 808C814 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r6, =0x02037590 ldrb r1, [r6, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 bl 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, =0x02020630 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 .pool 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, =sub_808C8C0 adds r0, r5, 0 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x26] bl _call_via_r5 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0849755C ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @0808C8D2: movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @0808C8D2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037590 movs r0, 0x1 strb r0, [r1, 0x6] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808C8F8 thumb_func_start fish1 fish1: ; 808C918 push {r4-r6,lr} sub sp, 0x10 adds r5, r0, 0 ldr r1, =gUnknown_0849759C mov r0, sp movs r2, 0x6 bl memcpy add r4, sp, 0x8 ldr r1, =gUnknown_084975A2 adds r0, r4, 0 movs r2, 0x6 bl memcpy movs r0, 0 strh r0, [r5, 0x20] bl GenerateRandomNumber movs r2, 0x26 ldrsh r1, [r5, r2] lsls r1, 1 mov r2, sp adds r6, r2, r1 lsls r0, 16 lsrs r0, 16 adds r4, r1 movs r2, 0 ldrsh r1, [r4, r2] bl __modsi3 ldrh r1, [r6] adds r1, r0 strh r1, [r5, 0x22] ldr r3, =0x02037350 ldr r2, =0x02037590 ldrb r1, [r2, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x5] strh r0, [r5, 0x24] ldrb r0, [r2, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 adds r4, r3 adds r0, r4, 0 bl 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 .pool thumb_func_end fish1 thumb_func_start fish2 fish2: ; 808C9B0 push {r4,lr} adds r4, r0, 0 bl sub_808CF78 ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] lsls r0, 16 asrs r0, 16 cmp r0, 0x3B ble @0808C9CC ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @0808C9CC: movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end fish2 thumb_func_start 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, =gUnknown_084975A8 add r0, sp, 0xC movs r2, 0x2 bl memcpy bl sub_808CF78 ldrh r0, [r4, 0xA] adds r1, r0, 0x1 strh r1, [r4, 0xA] ldr r0, =0x030022c0 ldrh r0, [r0, 0x2E] movs r5, 0x1 adds r2, r5, 0 ands r2, r0 cmp r2, 0 beq @0808CA64 movs r0, 0xB strh r0, [r4, 0x8] movs r1, 0x20 ldrsh r0, [r4, r1] cmp r0, 0 beq @0808CA58 movs r0, 0xC strh r0, [r4, 0x8] @0808CA58: movs r0, 0x1 b @0808CAB4 .align 2, 0 .pool @0808CA64: lsls r0, r1, 16 asrs r0, 16 cmp r0, 0x13 ble @0808CAB2 strh r2, [r4, 0xA] movs r3, 0xC ldrsh r1, [r4, r3] movs r3, 0xE ldrsh r0, [r4, r3] cmp r1, r0 blt @0808CA94 ldrh r0, [r4, 0x8] adds r1, r0, 0x1 strh r1, [r4, 0x8] ldrh r2, [r4, 0x20] movs r3, 0x20 ldrsh r0, [r4, r3] cmp r0, 0 beq @0808CA8E adds r0, r1, 0x1 strh r0, [r4, 0x8] @0808CA8E: adds r0, r2, 0x1 strh r0, [r4, 0x20] b @0808CAB2 @0808CA94: movs r0, 0xC ldrsh r3, [r4, r0] lsls r3, 27 lsrs r3, 24 str r5, [sp] str r2, [sp, 0x4] str r2, [sp, 0x8] movs r0, 0 movs r1, 0x1 add r2, sp, 0xC bl Print ldrh r0, [r4, 0xC] adds r0, 0x1 strh r0, [r4, 0xC] @0808CAB2: movs r0, 0 @0808CAB4: add sp, 0x10 pop {r4,r5} pop {r1} bx r1 thumb_func_end 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, =0x020244ec 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 .pool @0808CB30: movs r6, 0x1 @0808CB32: cmp r6, 0x1 bne @0808CB5C ldr r0, =0x02037590 ldrb r0, [r0, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 bl player_get_direction__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 .pool 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, =gUnknown_085EE8F7 movs r0, 0x11 str r0, [sp] movs r4, 0 str r4, [sp, 0x4] str r4, [sp, 0x8] movs r0, 0 movs r1, 0x1 movs r3, 0 bl Print ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] strh r4, [r5, 0xA] movs r0, 0 add sp, 0xC pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808CB6C thumb_func_start fish7 fish7: ; 808CBA4 push {r4,lr} sub sp, 0x8 adds r4, r0, 0 ldr r1, =gUnknown_084975AA mov r0, sp movs r2, 0x6 bl memcpy bl sub_808CF78 ldrh r1, [r4, 0xA] adds r1, 0x1 strh r1, [r4, 0xA] movs r2, 0x26 ldrsh r0, [r4, r2] lsls r0, 1 add r0, sp lsls r1, 16 asrs r1, 16 movs r2, 0 ldrsh r0, [r0, r2] cmp r1, r0 blt @0808CBDC movs r0, 0xC b @0808CBEC .align 2, 0 .pool @0808CBDC: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0808CBEE ldrh r0, [r4, 0x8] adds r0, 0x1 @0808CBEC: strh r0, [r4, 0x8] @0808CBEE: movs r0, 0 add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end fish7 thumb_func_start fish8 fish8: ; 808CBFC push {r4,lr} sub sp, 0xC adds r4, r0, 0 ldr r1, =gUnknown_084975B0 mov r0, sp movs r2, 0xC bl memcpy bl sub_808CF78 ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] movs r0, 0x20 ldrsh r1, [r4, r0] movs r2, 0x22 ldrsh r0, [r4, r2] cmp r1, r0 blt @0808CC52 cmp r1, 0x1 bgt @0808CC56 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x64 bl __umodsi3 movs r3, 0x20 ldrsh r2, [r4, r3] lsls r2, 1 movs r3, 0x26 ldrsh r1, [r4, r3] lsls r1, 2 adds r2, r1 mov r3, sp adds r1, r3, r2 movs r2, 0 ldrsh r1, [r1, r2] lsls r0, 16 asrs r0, 16 cmp r1, r0 ble @0808CC56 @0808CC52: movs r0, 0x3 strh r0, [r4, 0x8] @0808CC56: movs r0, 0 add sp, 0xC pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE903 movs r5, 0 str r5, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 movs r3, 0x1 bl 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 .pool 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, =0x02037590 ldrb r0, [r7, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 mov r8, r0 add r4, r8 ldrh r1, [r5, 0x24] lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl 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, =0x02020630 ldrb r1, [r7, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r6, [r0, 0x24] ldrb r1, [r7, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r6, [r0, 0x26] movs r0, 0 movs r1, 0x1 bl sub_8197434 ldrh r0, [r5, 0xA] adds r0, 0x1 strh r0, [r5, 0xA] b @0808CD80 .align 2, 0 .pool @0808CD50: movs r1, 0xA ldrsh r0, [r5, r1] cmp r0, 0 beq @0808CD80 @0808CD58: ldr r1, =0x02037590 movs r0, 0 strb r0, [r1, 0x6] bl script_env_2_disable ldrh r0, [r5, 0x26] lsls r0, 24 lsrs r0, 24 bl sub_80B5734 movs r0, 0x1 bl sub_80ED950 ldr r0, =sub_808C8C0 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 .pool 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, =0x02037590 ldrb r0, [r0, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 bl player_get_direction__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, =gUnknown_085EE91E movs r0, 0 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 movs r3, 0x1 bl 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 .pool 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, =0x02037590 ldrb r0, [r0, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 bl player_get_direction__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, =gUnknown_085EE933 movs r0, 0 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 movs r3, 0x1 bl 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 .pool 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, =0x02020630 ldr r5, =0x02037590 ldrb r0, [r5, 0x4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r7 adds r1, 0x3F ldrb r0, [r1] lsls r0, 27 cmp r0, 0 bge @0808CF12 ldrb r0, [r5, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 mov r8, r0 add r4, r8 ldrh r1, [r6, 0x24] lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl 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 .pool 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, =0x02037590 strb r1, [r0, 0x6] bl script_env_2_disable bl sub_809757C movs r0, 0 movs r1, 0x1 bl sub_8197434 movs r0, 0 bl sub_80ED950 ldr r0, =sub_808C8C0 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 .pool thumb_func_end fishF thumb_func_start sub_808CF78 sub_808CF78: ; 808CF78 push {r4-r7,lr} ldr r0, =0x02037590 ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r4, r0, r1 adds r0, r4, 0 bl 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, =0x0000fff8 strh r0, [r4, 0x24] @0808D022: cmp r5, 0x5 bne @0808D02A ldr r0, =0x0000fff8 strh r0, [r4, 0x26] @0808D02A: adds r0, r5, 0 subs r0, 0xA lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @0808D03A movs r0, 0x8 strh r0, [r4, 0x26] @0808D03A: ldr r3, =0x02037590 ldrb r1, [r3] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @0808D05E ldr r2, =0x02037350 ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1A] movs r1, 0x26 ldrsh r2, [r4, r1] movs r1, 0x1 bl sub_8155604 @0808D05E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808CF78 thumb_func_start sub_808D074 sub_808D074: ; 808D074 ldr r1, =0x0203734c strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_808D074 thumb_func_start sub_808D080 sub_808D080: ; 808D080 push {lr} ldr r1, =0x0203734c ldrb r0, [r1] cmp r0, 0 bne @0808D08C movs r0, 0x1 @0808D08C: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808D080 thumb_func_start sub_808D094 sub_808D094: ; 808D094 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r0, 24 adds r2, r0, 0 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 ldrb r1, [r4, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r7, r0, r1 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 movs r0, 0 ldrsh r6, [r5, r0] cmp r6, 0x1 beq @0808D14A cmp r6, 0x1 bgt @0808D0E8 cmp r6, 0 beq @0808D0EE b @0808D18A .align 2, 0 .pool @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, =0x03005de8 movs r2, 0 ldrsh r0, [r0, r2] adds r1, r0 movs r0, 0x20 negs r0, r0 cmp r1, r0 bge @0808D18A ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] b @0808D18A .align 2, 0 .pool @0808D184: adds r0, r2, 0 bl remove_task @0808D18A: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_808D094 thumb_func_start sub_808D194 sub_808D194: ; 808D194 push {r4,lr} ldr r4, =sub_808D1FC adds r0, r4, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 bl _call_via_r4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808D194 thumb_func_start sub_808D1B4 sub_808D1B4: ; 808D1B4 push {lr} ldr r0, =sub_808D1FC bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808D1B4 thumb_func_start sub_808D1C8 sub_808D1C8: ; 808D1C8 push {r4,lr} ldr r4, =sub_808D094 adds r0, r4, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 bl _call_via_r4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808D1C8 thumb_func_start sub_808D1E8 sub_808D1E8: ; 808D1E8 push {lr} ldr r0, =sub_808D094 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_808D1E8 thumb_func_start sub_808D1FC sub_808D1FC: ; 808D1FC push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 ldrb r1, [r4, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r7, r0, r1 mov r1, r8 lsls r0, r1, 2 add r0, r8 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 movs r2, 0 ldrsh r6, [r5, r2] cmp r6, 0x1 beq @0808D2DE cmp r6, 0x1 bgt @0808D254 cmp r6, 0 beq @0808D25E b @0808D37E .align 2, 0 .pool @0808D254: cmp r6, 0x2 beq @0808D31C cmp r6, 0x3 beq @0808D33A b @0808D37E @0808D25E: bl sub_808D080 lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0xA] ldr r1, =gUnknown_084975BC movs r3, 0xA ldrsh r0, [r5, r3] adds r0, r1 ldrb r0, [r0] bl 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 .pool @0808D31C: adds r1, r5, 0x2 adds r0, r4, 0 bl sub_808D38C ldrh r0, [r5, 0x10] adds r0, 0x1 strh r0, [r5, 0x10] lsls r0, 16 asrs r0, 16 cmp r0, 0x8 ble @0808D37E @0808D332: ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] b @0808D37E @0808D33A: movs r0, 0xA ldrsh r6, [r5, r0] adds r1, r5, 0x2 adds r0, r4, 0 bl sub_808D38C lsls r0, 24 lsrs r0, 24 cmp r6, r0 bne @0808D37E ldrb r1, [r4, 0x3] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r4, 0x3] movs r0, 0x3 ldrb r1, [r5, 0xC] ands r1, r0 lsls r1, 2 ldrb r2, [r7, 0x5] movs r0, 0xD negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r7, 0x5] ldrh r1, [r5, 0xE] adds r0, r7, 0 adds r0, 0x43 strb r1, [r0] bl 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, =gUnknown_084975BC 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 .pool @0808D3E4: ldrb r0, [r5, 0x18] lsls r0, 28 lsrs r0, 28 @0808D3EA: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_808D38C thumb_func_start npc_clear_ids_and_state npc_clear_ids_and_state: ; 808D3F0 push {r4,lr} adds r4, r0, 0 movs r1, 0 movs r2, 0x24 bl memset movs r0, 0xFF strb r0, [r4, 0x8] movs r0, 0x1 negs r0, r0 strb r0, [r4, 0x9] strb r0, [r4, 0xA] strb r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 thumb_func_end npc_clear_ids_and_state thumb_func_start npcs_clear_ids_and_state npcs_clear_ids_and_state: ; 808D410 push {r4,r5,lr} movs r4, 0 ldr r5, =0x02037350 @0808D416: lsls r0, r4, 3 adds r0, r4 lsls r0, 2 adds r0, r5 bl npc_clear_ids_and_state adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @0808D416 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end npcs_clear_ids_and_state thumb_func_start sub_808D438 sub_808D438: ; 808D438 push {lr} bl strange_npc_table_clear bl npcs_clear_ids_and_state bl 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, =gUnknown_085059F8 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, =0x02020630 mov r10, r1 lsls r4, r0, 4 adds r4, r0 lsls r4, 2 add r4, r10 ldrb r1, [r4, 0x1] movs r5, 0x4 negs r5, r5 adds r0, r5, 0 ands r0, r1 movs r1, 0x1 mov r8, r1 mov r1, r8 orrs r0, r1 strb r0, [r4, 0x1] adds r0, r4, 0 bl obj_alloc_rotscale_entry adds r0, r4, 0 movs r1, 0 bl 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 .pool thumb_func_end sub_808D450 thumb_func_start sub_808D4F4 sub_808D4F4: ; 808D4F4 push {lr} movs r1, 0 ldr r2, =0x02037350 ldrb r0, [r2] b @0808D518 .align 2, 0 .pool @0808D504: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0xF bhi @0808D51E lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] @0808D518: lsls r0, 31 cmp r0, 0 bne @0808D504 @0808D51E: adds r0, r1, 0 pop {r1} bx r1 thumb_func_end sub_808D4F4 thumb_func_start 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, =0x02037350 lsls r0, 16 asrs r4, r0, 16 lsls r1, 16 asrs r1, 16 @0808D582: lsls r0, r3, 3 adds r0, r3 lsls r0, 2 adds r2, r0, r5 ldrb r0, [r2] lsls r0, 31 cmp r0, 0 beq @0808D5A2 movs r6, 0x10 ldrsh r0, [r2, r6] cmp r0, r4 bne @0808D5A2 movs r6, 0x12 ldrsh r0, [r2, r6] cmp r0, r1 beq @0808D5AC @0808D5A2: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0xF bls @0808D582 @0808D5AC: adds r0, r3, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 @0808D5CA: lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r3, r0, r6 ldrb r0, [r3] lsls r0, 31 cmp r0, 0 beq @0808D5F4 ldrb r0, [r3, 0x8] cmp r0, r5 bne @0808D5F4 ldrb r0, [r3, 0x9] cmp r0, r4 bne @0808D5F4 ldrb r0, [r3, 0xA] cmp r0, r2 bne @0808D5F4 adds r0, r1, 0 b @0808D600 .align 2, 0 .pool @0808D5F4: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0xF bls @0808D5CA movs r0, 0x10 @0808D600: pop {r4-r6} pop {r1} bx r1 thumb_func_end 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, =0x02037350 @0808D612: lsls r0, r2, 3 adds r0, r2 lsls r0, 2 adds r1, r0, r4 ldrb r0, [r1] lsls r0, 31 cmp r0, 0 beq @0808D630 ldrb r0, [r1, 0x8] cmp r0, r3 bne @0808D630 adds r0, r2, 0 b @0808D63C .align 2, 0 .pool @0808D630: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xF bls @0808D612 movs r0, 0x10 @0808D63C: pop {r4} pop {r1} bx r1 thumb_func_end 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, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 bl npc_clear_ids_and_state ldrh r3, [r5, 0x4] adds r3, 0x7 lsls r3, 16 lsrs r3, 16 ldrh r2, [r5, 0x6] adds r2, 0x7 lsls r2, 16 lsrs r2, 16 ldrb r0, [r4] movs r1, 0x1 orrs r0, r1 movs r1, 0x4 orrs r0, r1 strb r0, [r4] ldrb r0, [r5, 0x1] strb r0, [r4, 0x5] ldrb r0, [r5, 0x9] strb r0, [r4, 0x6] ldrb r0, [r5] strb r0, [r4, 0x8] strb r6, [r4, 0x9] strb r7, [r4, 0xA] strh r3, [r4, 0xC] strh r2, [r4, 0xE] strh r3, [r4, 0x10] strh r2, [r4, 0x12] strh r3, [r4, 0x14] strh r2, [r4, 0x16] ldrb r0, [r5, 0x8] movs r7, 0xF adds r1, r7, 0 ands r1, r0 ldrb r2, [r4, 0xB] movs r0, 0x10 negs r0, r0 mov r8, r0 ands r0, r2 orrs r0, r1 strb r0, [r4, 0xB] ldrb r1, [r5, 0x8] lsls r1, 4 ands r0, r7 orrs r0, r1 strb r0, [r4, 0xB] ldrb r1, [r5, 0xA] lsls r1, 28 movs r0, 0xF mov r9, r0 lsrs r1, 28 ldrb r2, [r4, 0x19] mov r0, r8 ands r0, r2 orrs r0, r1 strb r0, [r4, 0x19] ldrb r1, [r5, 0xA] lsrs r1, 4 lsls r1, 4 ands r0, r7 orrs r0, r1 strb r0, [r4, 0x19] ldrh r0, [r5, 0xC] strb r0, [r4, 0x7] ldrh r0, [r5, 0xE] strb r0, [r4, 0x1D] ldr r1, =gUnknown_085055CD ldrb r0, [r5, 0x9] adds r0, r1 ldrb r1, [r0] adds r0, r4, 0 adds r0, 0x20 strb r1, [r0] ldrb r1, [r0] adds r0, r4, 0 bl npc_set_direction adds r0, r4, 0 bl sub_808E6DC ldr r1, =gUnknown_0850557C ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @0808D75E ldrb r2, [r4, 0x19] adds r0, r7, 0 ands r0, r2 cmp r0, 0 bne @0808D746 lsls r0, r2, 28 lsrs r0, 28 adds r0, 0x1 mov r1, r9 ands r0, r1 mov r1, r8 ands r1, r2 orrs r1, r0 strb r1, [r4, 0x19] @0808D746: ldrb r2, [r4, 0x19] movs r0, 0xF0 ands r0, r2 cmp r0, 0 bne @0808D75E lsrs r1, r2, 4 adds r1, 0x1 lsls r1, 4 adds r0, r7, 0 ands r0, r2 orrs r0, r1 strb r0, [r4, 0x19] @0808D75E: mov r0, sp ldrb r0, [r0] @0808D762: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037318 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 .pool @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, =0x03005d8c @0808D7D2: lsls r0, r5, 1 adds r0, r5 lsls r0, 3 movs r1, 0xC7 lsls r1, 4 adds r0, r1 ldr r1, [r7] adds r4, r1, r0 ldrb r0, [r4] cmp r0, r8 bne @0808D7F4 ldrh r0, [r4, 0x14] bl 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 .pool 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, =0x02037350 ldrb r0, [r1] lsls r0, 31 adds r7, r1, 0 cmp r0, 0 beq @0808D864 adds r3, r1, 0 @0808D830: lsls r0, r2, 3 adds r0, r2 lsls r0, 2 adds r1, r0, r3 ldrb r0, [r1, 0x8] cmp r0, r6 bne @0808D84A ldrb r0, [r1, 0x9] cmp r0, r5 bne @0808D84A ldrb r0, [r1, 0xA] cmp r0, r4 beq @0808D868 @0808D84A: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xF bhi @0808D868 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 adds r0, r7 ldrb r0, [r0] lsls r0, 31 cmp r0, 0 bne @0808D830 @0808D864: cmp r2, 0xF bls @0808D870 @0808D868: movs r0, 0x1 b @0808D8A4 .align 2, 0 .pool @0808D870: mov r0, r12 strb r2, [r0] ldr r1, =0x02037350 @0808D876: lsls r0, r2, 3 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r0, [r3] lsls r0, 31 cmp r0, 0 beq @0808D898 ldrb r0, [r3, 0x8] cmp r0, r6 bne @0808D898 ldrb r0, [r3, 0x9] cmp r0, r5 bne @0808D898 ldrb r0, [r3, 0xA] cmp r0, r4 beq @0808D868 @0808D898: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xF bls @0808D876 movs r0, 0 @0808D8A4: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r1 bl npc_hide @0808D902: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r1 orrs r0, r2 str r0, [sp, 0x4] ldr r2, =0x02020630 ldrb r1, [r4, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r2, 0 adds r1, 0xC adds r0, r1 mov r1, sp str r1, [r0] ldrb r1, [r4, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 bl obj_delete_and_free_tiles add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037590 ldrb r0, [r0, 0x5] cmp r4, r0 beq @0808D972 lsls r0, r4, 3 adds r0, r4 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 bl 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 .pool 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, =0x02037350 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 .pool @0808D9F4: cmp r5, 0xA bne @0808DA02 ldrh r0, [r7, 0x2] movs r1, 0xA bl npc_load_two_palettes__and_record b @0808DA16 @0808DA02: cmp r5, 0xF bls @0808DA16 adds r0, r5, 0 subs r0, 0x10 lsls r0, 24 lsrs r5, r0, 24 ldrh r0, [r7, 0x2] adds r1, r5, 0 bl sub_808EAB0 @0808DA16: ldrb r0, [r6, 0x6] cmp r0, 0x4C bne @0808DA24 ldrb r0, [r6, 0x1] movs r1, 0x20 orrs r0, r1 strb r0, [r6, 0x1] @0808DA24: ldr r1, =0x0000ffff adds r0, r1, 0 mov r2, r8 strh r0, [r2, 0x2] mov r0, r8 movs r1, 0 movs r2, 0 movs r3, 0 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 mov r8, r0 cmp r0, 0x40 bne @0808DA64 ldr r0, =0x02037350 mov r2, r9 adds r1, r4, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1] movs r0, 0x10 b @0808DB2C .align 2, 0 .pool @0808DA64: mov r1, r8 lsls r0, r1, 4 add r0, r8 lsls r0, 2 ldr r1, =0x02020630 adds r4, r0, r1 mov r2, r10 lsls r0, r2, 16 asrs r0, 16 ldrh r1, [r6, 0x10] adds r0, r1 lsls r0, 16 asrs r0, 16 ldr r2, [sp] lsls r1, r2, 16 asrs r1, 16 ldrh r2, [r6, 0x12] adds r1, r2 lsls r1, 16 asrs r1, 16 adds r2, r4, 0 adds r2, 0x20 adds r3, r4, 0 adds r3, 0x22 bl sub_8092FF0 ldrh r0, [r7, 0x8] lsls r0, 16 asrs r0, 17 negs r0, r0 adds r1, r4, 0 adds r1, 0x28 strb r0, [r1] ldrh r0, [r7, 0xA] lsls r0, 16 asrs r0, 17 negs r0, r0 adds r2, r4, 0 adds r2, 0x29 strb r0, [r2] ldrh r0, [r4, 0x20] adds r0, 0x8 strh r0, [r4, 0x20] ldrh r1, [r4, 0x22] adds r1, 0x10 movs r0, 0 ldrsb r0, [r2, r0] adds r0, r1 strh r0, [r4, 0x22] lsls r2, r5, 4 ldrb r1, [r4, 0x5] movs r0, 0xF ands r0, r1 orrs r0, r2 strb r0, [r4, 0x5] adds r2, r4, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x2 orrs r0, r1 strb r0, [r2] mov r0, r9 strh r0, [r4, 0x2E] mov r1, r8 strb r1, [r6, 0x4] ldrb r1, [r7, 0xC] lsls r1, 25 lsrs r1, 31 lsls r1, 4 ldrb r2, [r6, 0x1] movs r0, 0x11 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r6, 0x1] lsls r0, 27 cmp r0, 0 blt @0808DB16 ldrb r0, [r6, 0x18] lsls r0, 28 lsrs r0, 28 bl 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 .pool 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, =0xffff0000 add r1, sp, 0x24 ldr r0, [r1, 0x4] ands r0, r2 orrs r0, r3 str r0, [r1, 0x4] str r1, [sp, 0x14] lsls r4, 16 asrs r4, 16 str r4, [sp] lsls r5, 16 asrs r5, 16 str r5, [sp, 0x4] mov r0, r9 add r1, sp, 0x8 adds r2, r6, 0 mov r3, r8 bl 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 .pool @0808DBBC: ldr r4, =0x02020630 ldr r1, =0x02037350 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r1, [r3, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0xC adds r0, r1 ldr r1, [r7, 0x1C] str r1, [r0] ldr r2, [sp, 0x20] cmp r2, 0 beq @0808DBF0 ldrb r1, [r3, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 adds r1, r2, 0 bl 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 .pool 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, =0x03005d8c ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] add r0, sp, 0x4 movs r6, 0 ldrsh r3, [r0, r6] movs r6, 0 ldrsh r0, [r4, r6] str r0, [sp] adds r0, r5, 0 bl npc_instanciation_something lsls r0, 24 lsrs r0, 24 add sp, 0x8 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0xfff90000 adds r3, r5 lsrs r3, 16 lsls r4, 16 adds r4, r5 lsrs r4, 16 mov r5, sp movs r6, 0 strb r2, [r5] mov r2, sp strb r0, [r2, 0x1] mov r0, sp strb r6, [r0, 0x2] movs r5, 0 strh r3, [r0, 0x4] strh r4, [r0, 0x6] mov r2, r8 strb r2, [r0, 0x8] strb r1, [r0, 0x9] mov r2, sp ldrb r1, [r2, 0xA] movs r0, 0x10 negs r0, r0 ands r0, r1 strb r0, [r2, 0xA] mov r0, sp strb r5, [r0, 0xA] strh r6, [r0, 0xC] strh r6, [r0, 0xE] bl 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 .pool 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, =gUnknown_08505438 lsrs r1, 14 adds r1, r4 ldr r1, [r1] bl sub_808DCFC pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff cmp r1, r0 beq @0808DDAE adds r0, r1, 0 bl sub_808E894 @0808DDAE: mov r0, r8 lsls r1, r0, 16 asrs r1, 16 lsls r2, r7, 16 asrs r2, 16 adds r0, r6, 0 mov r3, r9 bl 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, =0x02020630 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 .pool 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, =sub_8097AC8 add r3, sp, 0x1C adds r0, r5, 0 mov r2, sp bl sub_808DCFC mov r1, sp ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r1, 0x2] mov r1, r8 movs r2, 0 ldrsh r0, [r1, r2] adds r0, 0x7 strh r0, [r1] movs r1, 0 ldrsh r0, [r6, r1] adds r0, 0x7 strh r0, [r6] mov r0, r8 adds r1, r6, 0 movs r2, 0x8 movs r3, 0x10 bl sub_80930E0 mov r2, r8 movs r0, 0 ldrsh r1, [r2, r0] movs r0, 0 ldrsh r2, [r6, r0] mov r0, sp movs r3, 0 bl 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, =0x02020630 adds r5, r0, r1 ldrh r0, [r4, 0x8] lsls r0, 16 asrs r0, 17 negs r0, r0 adds r1, r5, 0 adds r1, 0x28 strb r0, [r1] ldrh r0, [r4, 0xA] lsls r0, 16 asrs r0, 17 negs r0, r0 adds r1, 0x1 strb r0, [r1] movs r0, 0 ldrsb r0, [r1, r0] ldrh r1, [r5, 0x22] adds r0, r1 strh r0, [r5, 0x22] ldrb r0, [r4, 0xC] lsls r0, 28 lsrs r0, 24 ldrb r1, [r5, 0x5] movs r3, 0xF adds r2, r3, 0 ands r2, r1 orrs r2, r0 strb r2, [r5, 0x5] lsls r1, r2, 24 lsrs r0, r1, 28 cmp r0, 0xF bls @0808DEE4 subs r0, 0x10 lsls r0, 4 ands r2, r3 orrs r2, r0 strb r2, [r5, 0x5] @0808DEE4: adds r2, r5, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x2 orrs r0, r1 strb r0, [r2] mov r2, r9 strh r2, [r5, 0x2E] strh r7, [r5, 0x30] ldrb r1, [r4, 0xC] adds r0, r3, 0 ands r0, r1 cmp r0, 0xA bne @0808DF18 ldrh r0, [r4, 0x2] lsls r1, 28 lsrs r1, 28 bl npc_load_two_palettes__and_record b @0808DF2C .align 2, 0 .pool @0808DF18: lsls r1, 28 lsrs r0, r1, 28 cmp r0, 0xF bls @0808DF2C ldrh r0, [r4, 0x2] lsrs r2, r1, 28 movs r1, 0xF0 orrs r1, r2 bl sub_808EAB0 @0808DF2C: ldr r1, [sp, 0x1C] cmp r1, 0 beq @0808DF48 adds r0, r5, 0 bl 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, =0x02037318 ldr r0, [r5, 0x4] cmp r0, 0 beq @0808E078 ldr r0, =0x03005d8c ldr r2, [r0] ldrh r1, [r2] subs r0, r1, 0x2 lsls r0, 16 lsrs r0, 16 mov r8, r0 adds r1, 0x11 lsls r1, 16 lsrs r1, 16 str r1, [sp, 0xC] ldrh r4, [r2, 0x2] adds r0, r4, 0 adds r0, 0x10 lsls r0, 16 lsrs r0, 16 mov r10, r0 bl 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 .pool @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, =0x03005d8c ldr r1, [r3] adds r4, r1, r0 ldrh r0, [r4, 0x4] adds r0, 0x7 lsls r0, 16 lsrs r2, r0, 16 ldrh r0, [r4, 0x6] adds r0, 0x7 lsls r0, 16 asrs r1, r0, 16 cmp r9, r1 bgt @0808E06E mov r7, r10 lsls r0, r7, 16 asrs r0, 16 cmp r0, r1 blt @0808E06E lsls r0, r2, 16 asrs r1, r0, 16 cmp r8, r1 bgt @0808E06E ldr r2, [sp, 0xC] lsls r0, r2, 16 asrs r0, 16 cmp r0, r1 blt @0808E06E ldrh r0, [r4, 0x14] bl flag_check lsls r0, 24 cmp r0, 0 bne @0808E06E ldr r3, =0x03005d8c ldr r0, [r3] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] ldr r7, [sp, 0x4] lsls r3, r7, 16 ldr r7, [sp, 0x8] lsls r0, r7, 16 asrs r0, 16 str r0, [sp] adds r0, r4, 0 asrs r3, 16 bl 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 .pool thumb_func_end npc_culling_maybe thumb_func_start sub_808E08C sub_808E08C: ; 808E08C push {r4-r6,lr} movs r3, 0 ldr r6, =0x02032308 @0808E092: movs r2, 0 movs r4, 0 adds r5, r3, 0x1 @0808E098: lsls r0, r2, 2 adds r1, r0, r6 ldrb r0, [r1] cmp r0, 0 beq @0808E0AA ldrb r1, [r1, 0x2] cmp r3, r1 bne @0808E0AA movs r4, 0x1 @0808E0AA: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @0808E098 cmp r4, 0 bne @0808E0D2 lsls r0, r3, 3 adds r0, r3 lsls r0, 2 ldr r1, =0x02037350 adds r2, r0, r1 ldr r0, [r2] ldr r1, =0x00010001 ands r0, r1 cmp r0, 0x1 bne @0808E0D2 adds r0, r2, 0 bl 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 .pool thumb_func_end sub_808E08C thumb_func_start sub_808E0EC sub_808E0EC: ; 808E0EC push {r4-r7,lr} adds r3, r0, 0 ldr r0, =0x03005d8c ldr r2, [r0] ldrh r0, [r2] subs r1, r0, 0x2 lsls r1, 16 adds r0, 0x11 lsls r0, 16 lsrs r5, r0, 16 ldrh r4, [r2, 0x2] adds r0, r4, 0 adds r0, 0x10 lsls r0, 16 lsrs r6, r0, 16 movs r0, 0x10 ldrsh r2, [r3, r0] lsrs r7, r1, 16 asrs r1, 16 cmp r2, r1 blt @0808E132 lsls r0, r5, 16 asrs r0, 16 cmp r2, r0 bgt @0808E132 movs r0, 0x12 ldrsh r1, [r3, r0] lsls r0, r4, 16 asrs r0, 16 cmp r1, r0 blt @0808E132 lsls r0, r6, 16 asrs r0, 16 cmp r1, r0 ble @0808E160 @0808E132: movs r0, 0xC ldrsh r1, [r3, r0] lsls r0, r7, 16 asrs r0, 16 cmp r1, r0 blt @0808E15A lsls r0, r5, 16 asrs r0, 16 cmp r1, r0 bgt @0808E15A movs r0, 0xE ldrsh r1, [r3, r0] lsls r0, r4, 16 asrs r0, 16 cmp r1, r0 blt @0808E15A lsls r0, r6, 16 asrs r0, 16 cmp r1, r0 ble @0808E160 @0808E15A: adds r0, r3, 0 bl npc_hide @0808E160: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 lsls r4, 16 lsls r5, 16 @0808E186: lsls r0, r6, 3 adds r0, r6 lsls r0, 2 adds r0, r7 ldrb r0, [r0] lsls r0, 31 cmp r0, 0 beq @0808E1A0 adds r0, r6, 0 asrs r1, r4, 16 asrs r2, r5, 16 bl sub_808E1B8 @0808E1A0: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0xF bls @0808E186 bl sub_808D450 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808E16C thumb_func_start sub_808E1B8 sub_808E1B8: ; 808E1B8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x28 lsls r0, 24 lsrs r0, 24 mov r9, r0 lsls r1, 16 lsrs r1, 16 mov r10, r1 lsls r2, 16 lsrs r2, 16 str r2, [sp, 0x24] movs r7, 0 ldr r2, =0x02032308 @0808E1DA: lsls r0, r7, 2 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0 beq @0808E1EC ldrb r1, [r1, 0x2] cmp r9, r1 bne @0808E1EC b @0808E374 @0808E1EC: adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 cmp r7, 0x3 bls @0808E1DA mov r1, r9 lsls r0, r1, 3 add r0, r9 lsls r0, 2 ldr r1, =0x02037350 adds r6, r0, r1 movs r0, 0 str r0, [sp, 0x20] ldrb r0, [r6, 0x5] bl npc_get_type adds r5, r0, 0 ldrh r2, [r5, 0x6] ldr r1, =0xffff0000 add r4, sp, 0x18 ldr r0, [r4, 0x4] ands r0, r1 orrs r0, r2 str r0, [r4, 0x4] ldrb r0, [r6, 0x5] ldrb r1, [r6, 0x6] add r3, sp, 0x20 mov r2, sp bl npc_to_objtemplate__with_indexed_objfunc str r4, [sp, 0xC] mov r1, sp ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r1, 0x2] ldrb r0, [r5, 0xC] lsls r1, r0, 28 lsrs r0, r1, 28 mov r8, r0 cmp r0, 0 bne @0808E258 ldrh r0, [r5, 0x2] lsrs r1, 28 bl npc_load_two_palettes__no_record b @0808E27E .align 2, 0 .pool @0808E258: mov r2, r8 cmp r2, 0xA bne @0808E268 ldrh r0, [r5, 0x2] lsrs r1, 28 bl npc_load_two_palettes__and_record b @0808E27E @0808E268: mov r0, r8 cmp r0, 0xF bls @0808E27E subs r0, 0x10 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldrh r0, [r5, 0x2] mov r1, r8 bl sub_808EAB0 @0808E27E: mov r1, sp ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r1, 0x2] mov r0, sp movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =0x02020630 adds r4, r0, r1 mov r1, r10 lsls r0, r1, 16 asrs r0, 16 ldrh r2, [r6, 0x10] adds r0, r2 lsls r0, 16 asrs r0, 16 ldr r2, [sp, 0x24] lsls r1, r2, 16 asrs r1, 16 ldrh r2, [r6, 0x12] adds r1, r2 lsls r1, 16 asrs r1, 16 adds r2, r4, 0 adds r2, 0x20 adds r3, r4, 0 adds r3, 0x22 bl sub_8092FF0 ldrh r0, [r5, 0x8] lsls r0, 16 asrs r0, 17 negs r0, r0 adds r1, r4, 0 adds r1, 0x28 strb r0, [r1] ldrh r0, [r5, 0xA] lsls r0, 16 asrs r0, 17 negs r0, r0 adds r2, r4, 0 adds r2, 0x29 strb r0, [r2] ldrh r0, [r4, 0x20] adds r0, 0x8 strh r0, [r4, 0x20] ldrh r1, [r4, 0x22] adds r1, 0x10 movs r0, 0 ldrsb r0, [r2, r0] adds r0, r1 strh r0, [r4, 0x22] ldr r0, [r5, 0x1C] str r0, [r4, 0xC] ldrb r0, [r6, 0x6] cmp r0, 0xB bne @0808E312 mov r0, r9 adds r1, r7, 0 bl 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 .pool 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, =0x02037590 strb r0, [r5, 0x5] strb r1, [r5, 0x4] ldr r1, =0x02037350 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 adds r4, r1 ldrb r0, [r4, 0x5] bl 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 .pool 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, =0x02020630 adds r4, r0, r1 ldrb r0, [r6, 0xC] lsls r1, r0, 28 lsrs r5, r1, 28 cmp r5, 0 bne @0808E434 ldrh r0, [r6, 0x2] adds r1, r5, 0 bl pal_patch_for_npc b @0808E456 .align 2, 0 .pool @0808E434: cmp r5, 0xA bne @0808E442 ldrh r0, [r6, 0x2] lsrs r1, 28 bl npc_load_two_palettes__and_record b @0808E456 @0808E442: cmp r5, 0xF bls @0808E456 adds r0, r5, 0 subs r0, 0x10 lsls r0, 24 lsrs r5, r0, 24 ldrh r0, [r6, 0x2] adds r1, r5, 0 bl sub_808EAB0 @0808E456: ldr r0, [r6, 0x10] ldrb r2, [r0, 0x1] lsrs r2, 6 lsls r2, 6 ldrb r3, [r4, 0x1] movs r1, 0x3F adds r0, r1, 0 ands r0, r3 orrs r0, r2 strb r0, [r4, 0x1] ldr r0, [r6, 0x10] ldrb r0, [r0, 0x3] lsrs r0, 6 lsls r0, 6 ldrb r2, [r4, 0x3] ands r1, r2 orrs r1, r0 strb r1, [r4, 0x3] ldr r0, [r6, 0x1C] str r0, [r4, 0xC] ldr r0, [r6, 0x18] str r0, [r4, 0x8] ldr r0, [r6, 0x14] str r0, [r4, 0x18] lsls r2, r5, 4 ldrb r1, [r4, 0x5] movs r0, 0xF ands r0, r1 orrs r0, r2 strb r0, [r4, 0x5] ldrb r1, [r6, 0xC] lsls r1, 25 lsrs r1, 31 lsls r1, 4 ldrb r2, [r7, 0x1] movs r0, 0x11 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r7, 0x1] mov r0, r8 strb r0, [r7, 0x5] movs r1, 0x10 ldrsh r0, [r7, r1] movs r2, 0x12 ldrsh r1, [r7, r2] adds r2, r4, 0 adds r2, 0x20 adds r3, r4, 0 adds r3, 0x22 bl sub_8093038 ldrh r0, [r6, 0x8] lsls r0, 16 asrs r0, 17 negs r0, r0 adds r1, r4, 0 adds r1, 0x28 strb r0, [r1] ldrh r0, [r6, 0xA] lsls r0, 16 asrs r0, 17 negs r0, r0 adds r2, r4, 0 adds r2, 0x29 strb r0, [r2] ldrh r0, [r4, 0x20] adds r0, 0x8 strh r0, [r4, 0x20] ldrh r1, [r4, 0x22] adds r1, 0x10 movs r0, 0 ldrsb r0, [r2, r0] adds r0, r1 strh r0, [r4, 0x22] ldrb r0, [r7, 0x1] lsrs r0, 7 cmp r0, 0 beq @0808E4F8 bl 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, =0x02037350 adds r0, r1 adds r1, r4, 0 bl sub_808E3F8 @0808E538: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool 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, =0x02037350 adds r0, r1 adds r1, r4, 0 bl npc_turn @0808E5C8: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 bl npc_turn pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850C908 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, =gUnknown_0850C7B0 adds r0, r4, r0 ldr r0, [r0] str r0, [r7, 0xC] ldr r0, =gUnknown_0850C85C 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 .pool 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, =gUnknown_085059DC lsrs r0, 22 adds r0, r1 ldr r0, [r0] b @0808E6D2 .align 2, 0 .pool @0808E6C4: cmp r1, 0xEE bls @0808E6CA movs r1, 0x5 @0808E6CA: ldr r0, =gUnknown_08505620 lsls r1, 2 adds r1, r0 ldr r0, [r1] @0808E6D2: pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 mov r0, sp ldrb r0, [r0] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 adds r1, r2 movs r0, 0x1 adds r2, r4, 0 ands r2, r0 lsls r2, 5 ldrb r3, [r1, 0x1] movs r0, 0x21 negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1, 0x1] @0808E73A: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 adds r0, r1 ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @0808E784: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808E75C thumb_func_start sub_808E78C sub_808E78C: ; 808E78C push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r4, r3, 24 mov r3, sp bl 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, =0x02037350 adds r2, r0 ldrb r1, [r2, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 ldrb r1, [r2, 0x3] movs r3, 0x4 orrs r1, r3 strb r1, [r2, 0x3] adds r0, 0x43 strb r4, [r0] @0808E7D2: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808E78C thumb_func_start sub_808E7E4 sub_808E7E4: ; 808E7E4 push {lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 mov r3, sp bl 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, =0x02037350 adds r1, r0 ldrb r2, [r1, 0x3] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1, 0x3] ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] @0808E820: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808E7E4 thumb_func_start sub_808E82C sub_808E82C: ; 808E82C push {r4,r5,lr} sub sp, 0x4 ldr r4, [sp, 0x10] lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 16 lsrs r5, r3, 16 lsls r4, 16 lsrs r4, 16 mov r3, sp bl npc_id_by_local_id_and_map_ret_success lsls r0, 24 cmp r0, 0 bne @0808E870 ldr r2, =0x02037350 mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 strh r5, [r0, 0x24] strh r4, [r0, 0x26] @0808E870: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808E82C thumb_func_start gpu_pal_allocator_reset__manage_upper_four gpu_pal_allocator_reset__manage_upper_four: ; 808E880 push {lr} bl gpu_pal_allocator_reset ldr r1, =0x0300301c movs r0, 0xC strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end gpu_pal_allocator_reset__manage_upper_four thumb_func_start sub_808E894 sub_808E894: ; 808E894 push {lr} lsls r0, 16 lsrs r0, 16 bl npc_pal_idx_for_given_tag lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x000011ff cmp r1, r0 beq @0808E8B2 lsls r0, r1, 3 ldr r1, =gUnknown_0850BBC8 adds r0, r1 bl sub_808E8F4 @0808E8B2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808E894 thumb_func_start sub_808E8C0 sub_808E8C0: ; 808E8C0 push {r4-r6,lr} adds r5, r0, 0 movs r4, 0 ldrh r0, [r5] ldr r1, =0x000011ff cmp r0, r1 beq @0808E8EA adds r6, r1, 0 @0808E8D0: lsls r0, r4, 1 adds r0, r5 ldrh r0, [r0] bl sub_808E894 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 1 adds r0, r5 ldrh r0, [r0] cmp r0, r6 bne @0808E8D0 @0808E8EA: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850BBC8 lsrs r0, 21 adds r0, r1 ldr r0, [r0] lsls r4, 20 movs r1, 0x80 lsls r1, 17 adds r4, r1 lsrs r4, 16 adds r1, r4, 0 movs r2, 0x20 bl gpu_pal_apply pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850BBC8 ldrh r1, [r0, 0x4] ldr r3, =0x000011ff adds r4, r0, 0 cmp r1, r3 beq @0808E9C0 adds r6, r4, 0 adds r1, r3, 0 @0808E998: lsls r0, r2, 3 adds r0, r6 ldrh r0, [r0, 0x4] cmp r0, r5 bne @0808E9B0 adds r0, r2, 0 b @0808E9C2 .align 2, 0 .pool @0808E9B0: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 lsls r0, r2, 3 adds r0, r4 ldrh r0, [r0, 0x4] cmp r0, r1 bne @0808E998 @0808E9C0: movs r0, 0xFF @0808E9C2: pop {r4-r6} pop {r1} bx r1 thumb_func_end 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, =gUnknown_0850BD00 ldrh r0, [r1] ldr r2, =0x000011ff cmp r0, r2 beq @0808EA30 ldr r0, =gUnknown_084975C4 adds r5, r0 adds r6, r2, 0 @0808E9EC: lsls r2, r3, 3 adds r0, r2, r1 ldrh r0, [r0] cmp r0, r4 bne @0808EA20 adds r1, 0x4 adds r1, r2, r1 ldr r0, =0x020375b4 ldrb r0, [r0] ldr r1, [r1] lsls r0, 1 adds r0, r1 ldrh r0, [r0] ldrb r1, [r5] bl pal_patch_for_npc b @0808EA30 .align 2, 0 .pool @0808EA20: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 lsls r0, r3, 3 adds r0, r1 ldrh r0, [r0] cmp r0, r6 bne @0808E9EC @0808EA30: pop {r4-r6} pop {r0} bx r0 thumb_func_end npc_load_two_palettes__no_record thumb_func_start npc_load_two_palettes__and_record npc_load_two_palettes__and_record: ; 808EA38 push {r4-r6,lr} lsls r0, 16 lsrs r4, r0, 16 lsls r1, 24 lsrs r5, r1, 24 ldr r0, =0x020375b6 strh r4, [r0] adds r0, r4, 0 adds r1, r5, 0 bl pal_patch_for_npc movs r3, 0 ldr r1, =gUnknown_0850BD78 ldrh r0, [r1] ldr r2, =0x000011ff cmp r0, r2 beq @0808EAA8 ldr r0, =gUnknown_084975C4 adds r5, r0 adds r6, r2, 0 @0808EA60: lsls r2, r3, 3 adds r0, r2, r1 ldrh r0, [r0] cmp r0, r4 bne @0808EA98 adds r1, 0x4 adds r1, r2, r1 ldr r0, =0x020375b4 ldrb r0, [r0] ldr r1, [r1] lsls r0, 1 adds r0, r1 ldrh r0, [r0] ldrb r1, [r5] bl pal_patch_for_npc b @0808EAA8 .align 2, 0 .pool @0808EA98: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 lsls r0, r3, 3 adds r0, r1 ldrh r0, [r0] cmp r0, r6 bne @0808EA60 @0808EAA8: pop {r4-r6} pop {r0} bx r0 thumb_func_end npc_load_two_palettes__and_record thumb_func_start sub_808EAB0 sub_808EAB0: ; 808EAB0 push {lr} lsls r0, 16 lsrs r0, 16 lsls r1, 24 lsrs r1, 24 bl pal_patch_for_npc pop {r0} bx r0 thumb_func_end sub_808EAB0 thumb_func_start sub_808EAC4 sub_808EAC4: ; 808EAC4 push {r4,lr} ldrh r3, [r0, 0x10] strh r3, [r0, 0x14] ldrh r4, [r0, 0x12] strh r4, [r0, 0x16] lsls r1, 16 asrs r1, 16 adds r1, r3 strh r1, [r0, 0x10] lsls r2, 16 asrs r2, 16 adds r2, r4 strh r2, [r0, 0x12] pop {r4} pop {r0} bx r0 thumb_func_end sub_808EAC4 thumb_func_start npc_coords_shift 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, =0x02020630 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 .pool thumb_func_end sub_808EB08 thumb_func_start sub_808EBA8 sub_808EBA8: ; 808EBA8 push {r4,r5,lr} sub sp, 0x4 ldr r4, [sp, 0x10] lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 16 lsrs r5, r3, 16 lsls r4, 16 lsrs r4, 16 mov r3, sp bl 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, =0x02037350 adds r0, r3 movs r3, 0xE0 lsls r3, 11 adds r1, r3 asrs r1, 16 adds r2, r3 asrs r2, 16 bl sub_808EB08 @0808EBF0: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037334 ldrb r1, [r2] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0808EC68 movs r3, 0 ldr r5, =0x02037350 movs r0, 0x4 ldrsh r4, [r2, r0] movs r0, 0x8 ldrsh r1, [r2, r0] @0808EC2A: lsls r0, r3, 3 adds r0, r3 lsls r0, 2 adds r2, r0, r5 ldrb r0, [r2] lsls r0, 31 cmp r0, 0 beq @0808EC5E ldrh r0, [r2, 0xC] subs r0, r4 strh r0, [r2, 0xC] ldrh r0, [r2, 0xE] subs r0, r1 strh r0, [r2, 0xE] ldrh r0, [r2, 0x10] subs r0, r4 strh r0, [r2, 0x10] ldrh r0, [r2, 0x12] subs r0, r1 strh r0, [r2, 0x12] ldrh r0, [r2, 0x14] subs r0, r4 strh r0, [r2, 0x14] ldrh r0, [r2, 0x16] subs r0, r1 strh r0, [r2, 0x16] @0808EC5E: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0xF bls @0808EC2A @0808EC68: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 mov r8, r0 @0808EC90: lsls r0, r4, 3 adds r0, r4 lsls r0, 2 mov r2, r8 adds r1, r0, r2 ldrb r0, [r1] lsls r0, 31 cmp r0, 0 beq @0808ECC8 movs r2, 0x10 ldrsh r0, [r1, r2] cmp r0, r7 bne @0808ECC8 movs r2, 0x12 ldrsh r0, [r1, r2] cmp r0, r6 bne @0808ECC8 adds r0, r1, 0 adds r1, r5, 0 bl npc_does_height_match lsls r0, 24 cmp r0, 0 beq @0808ECC8 adds r0, r4, 0 b @0808ECD4 .align 2, 0 .pool @0808ECC8: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @0808EC90 movs r0, 0x10 @0808ECD4: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end 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, =gUnknown_084975D4 movs r1, 0 movs r2, 0 movs r3, 0x4 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 movs r2, 0x3E adds r2, r1 mov r12, r2 ldrb r2, [r2] movs r3, 0x4 orrs r2, r3 mov r3, r12 strb r2, [r3] strh r4, [r1, 0x2E] pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_084975EC ldm r1!, {r3-r5} stm r2!, {r3-r5} movs r2, 0x30 ldrsh r1, [r0, r2] lsls r1, 2 add r1, sp ldr r1, [r1] bl _call_via_r1 add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end oac_0805F994 thumb_func_start sub_808EDA0 sub_808EDA0: ; 808EDA0 push {lr} ldr r3, =0x02020630 movs r1, 0x2E ldrsh r2, [r0, r1] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r3 ldrh r1, [r1, 0x20] strh r1, [r0, 0x20] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r3 ldrh r1, [r1, 0x22] strh r1, [r0, 0x22] adds r3, r0, 0 adds r3, 0x3E ldrb r1, [r3] movs r2, 0x4 orrs r1, r2 strb r1, [r3] movs r1, 0x1 strh r1, [r0, 0x30] bl sub_808EDDC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808EDA0 thumb_func_start sub_808EDDC sub_808EDDC: ; 808EDDC push {r4,r5,lr} ldr r3, =0x02020630 movs r1, 0x2E ldrsh r2, [r0, r1] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r3 ldrh r3, [r1, 0x22] ldrh r2, [r0, 0x20] ldrh r4, [r1, 0x20] movs r5, 0x20 ldrsh r1, [r1, r5] subs r1, r2 strh r1, [r0, 0x32] ldrh r2, [r0, 0x22] lsls r1, r3, 16 asrs r1, 16 subs r1, r2 strh r1, [r0, 0x34] strh r4, [r0, 0x20] strh r3, [r0, 0x22] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808EDDC thumb_func_start sub_808EE14 sub_808EE14: ; 808EE14 push {r4,lr} ldr r4, =0x02020630 movs r1, 0x2E ldrsh r2, [r0, r1] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r4 ldrh r1, [r1, 0x20] movs r3, 0 strh r1, [r0, 0x20] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r4 ldrh r1, [r1, 0x22] strh r1, [r0, 0x22] strh r3, [r0, 0x32] strh r3, [r0, 0x34] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 adds r5, r4, 0 adds r5, 0x1C @0808EE4E: lsls r0, r3, 4 adds r0, r3 lsls r1, r0, 2 adds r2, r1, r4 adds r0, r2, 0 adds r0, 0x3E ldrb r0, [r0] lsls r0, 31 cmp r0, 0 beq @0808EE78 adds r0, r1, r5 ldr r1, [r0] ldr r0, =oac_0805F994 cmp r1, r0 bne @0808EE78 adds r0, r2, 0 b @0808EE84 .align 2, 0 .pool @0808EE78: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x3F bls @0808EE4E movs r0, 0 @0808EE84: pop {r4,r5} pop {r1} bx r1 thumb_func_end 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, =0x02020630 @0808EF06: lsls r0, r5, 4 adds r0, r5 lsls r0, 2 adds r4, r0, r1 adds r0, r4, 0 adds r0, 0x3E ldrb r0, [r0] lsls r0, 31 cmp r0, 0 bne @0808EF38 adds r0, r4, 0 mov r1, r12 movs r2, 0x44 bl memcpy mov r0, r8 strh r0, [r4, 0x20] strh r6, [r4, 0x22] adds r0, r4, 0 adds r0, 0x43 strb r7, [r0] b @0808EF42 .align 2, 0 .pool @0808EF38: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x3F bls @0808EF06 @0808EF42: adds r0, r5, 0 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_808EEEC thumb_func_start obj_unfreeze obj_unfreeze: ; 808EF50 push {r4-r7,lr} mov r7, r8 push {r7} mov r12, r0 lsls r1, 16 lsrs r1, 16 mov r8, r1 lsls r2, 16 lsrs r6, r2, 16 lsls r3, 24 lsrs r7, r3, 24 movs r5, 0x3F ldr r3, =0x02020630 movs r2, 0x1 negs r2, r2 @0808EF6E: lsls r0, r5, 16 asrs r1, r0, 16 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r3 adds r0, r4, 0 adds r0, 0x3E ldrb r0, [r0] lsls r0, 31 cmp r0, 0 bne @0808EFA8 adds r0, r4, 0 mov r1, r12 movs r2, 0x44 bl memcpy mov r0, r8 strh r0, [r4, 0x20] strh r6, [r4, 0x22] adds r0, r4, 0 adds r0, 0x43 strb r7, [r0] lsls r0, r5, 24 lsrs r0, 24 b @0808EFB6 .align 2, 0 .pool @0808EFA8: subs r0, r1, 0x1 lsls r0, 16 lsrs r5, r0, 16 asrs r0, 16 cmp r0, r2 bgt @0808EF6E movs r0, 0x40 @0808EFB6: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end obj_unfreeze thumb_func_start 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, =0x02037350 lsls r2, r0, 3 adds r2, r0 lsls r2, 2 adds r2, r1 ldrb r0, [r2, 0x8] ldrb r1, [r2, 0x9] ldrb r2, [r2, 0xA] bl npc_script_by_local_id_and_map pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 lsls r2, r0, 3 adds r2, r0 lsls r2, 2 adds r2, r1 ldrb r0, [r2, 0x8] ldrb r1, [r2, 0x9] ldrb r2, [r2, 0xA] bl rom_npc_id_in_script_by_local_id_and_map lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x7] b @0808F0B6 .align 2, 0 .pool @0808F0B4: movs r0, 0xFF @0808F0B6: add sp, 0x4 pop {r1} bx r1 thumb_func_end sub_808F080 thumb_func_start sub_808F0BC sub_808F0BC: ; 808F0BC lsls r0, 24 lsrs r0, 24 ldr r2, =0x02037350 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x7] bx lr .align 2, 0 .pool thumb_func_end sub_808F0BC thumb_func_start sub_808F0D4 sub_808F0D4: ; 808F0D4 push {lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 mov r3, sp bl npc_id_by_local_id_and_map_ret_success lsls r0, 24 cmp r0, 0 bne @0808F108 ldr r2, =0x02037350 mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1D] b @0808F10A .align 2, 0 .pool @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, =0x02037350 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x1D] bx lr .align 2, 0 .pool 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, =0x03005d8c ldr r1, [r0] movs r0, 0x5 ldrsb r0, [r1, r0] cmp r0, r3 bne @0808F160 movs r0, 0x4 ldrsb r0, [r1, r0] cmp r0, r2 bne @0808F160 movs r0, 0xC7 lsls r0, 4 adds r1, r0 ldr r0, =0x02037318 ldr r0, [r0, 0x4] b @0808F16C .align 2, 0 .pool @0808F160: adds r0, r2, 0 adds r1, r3, 0 bl get_mapheader_by_bank_and_number ldr r0, [r0, 0x4] ldr r1, [r0, 0x4] @0808F16C: ldrb r2, [r0] adds r0, r4, 0 bl 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, =0x03005d8c ldr r2, [r1] movs r1, 0x5 ldrsb r1, [r2, r1] cmp r0, r1 bne @0808F200 ldrb r1, [r3, 0xA] movs r0, 0x4 ldrsb r0, [r2, r0] cmp r1, r0 beq @0808F1E2 b @0808F200 .align 2, 0 .pool @0808F1D8: movs r1, 0xC7 lsls r1, 4 adds r0, r1 adds r0, r4, r0 b @0808F202 @0808F1E2: movs r1, 0 adds r4, r2, 0 ldrb r3, [r3, 0x8] movs r5, 0xC7 lsls r5, 4 adds r2, r4, r5 movs r0, 0 @0808F1F0: ldrb r5, [r2] cmp r3, r5 beq @0808F1D8 adds r2, 0x18 adds r0, 0x18 adds r1, 0x1 cmp r1, 0x3F ble @0808F1F0 @0808F200: movs r0, 0 @0808F202: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_808F1B4 thumb_func_start sub_808F208 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, =0x02037350 adds r0, r1 bl sub_808F208 @0808F282: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808F254 thumb_func_start sub_808F28C sub_808F28C: ; 808F28C push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r4, r3, 24 mov r3, sp bl 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, =0x02037350 adds r0, r1 ldr r1, =gUnknown_082766A2 bl sub_808F228 b @0808F2E8 .align 2, 0 .pool @0808F2D4: mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldr r1, =gUnknown_082766A6 bl sub_808F228 @0808F2E8: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808F28C thumb_func_start npc_paltag_set_load npc_paltag_set_load: ; 808F2F8 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 bl gpu_pal_allocator_reset__manage_upper_four ldr r1, =0x020375b6 ldr r2, =0x000011ff adds r0, r2, 0 strh r0, [r1] ldr r2, =0x020375b4 strb r4, [r2] cmp r4, 0x1 bne @0808F344 ldr r1, =gUnknown_0850BE38 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r0, [r0] movs r1, 0 movs r2, 0x6 bl pal_patch_for_npc_range ldr r1, =0x0300301c movs r0, 0x8 strb r0, [r1] b @0808F356 .align 2, 0 .pool @0808F344: ldr r0, =gUnknown_0850BE38 ldrb r1, [r2] lsls r1, 2 adds r1, r0 ldr r0, [r1] movs r1, 0 movs r2, 0xA bl pal_patch_for_npc_range @0808F356: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end npc_paltag_set_load thumb_func_start npc_paltag_by_palslot npc_paltag_by_palslot: ; 808F360 push {r4-r6,lr} lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x9 bhi @0808F39C ldr r1, =gUnknown_0850BE38 ldr r0, =0x020375b4 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, [r0] lsls r0, r2, 1 b @0808F390 .align 2, 0 .pool @0808F384: adds r1, r4, 0x4 adds r1, r2, r1 ldr r0, =0x020375b4 ldrb r0, [r0] ldr r1, [r1] lsls r0, 1 @0808F390: adds r0, r1 ldrh r0, [r0] b @0808F3CE .align 2, 0 .pool @0808F39C: movs r3, 0 ldr r0, =gUnknown_0850BD78 ldrh r1, [r0] ldr r2, =0x000011ff adds r4, r0, 0 cmp r1, r2 beq @0808F3CC adds r6, r4, 0 ldr r0, =0x020375b6 ldrh r1, [r0] adds r5, r2, 0 @0808F3B2: lsls r2, r3, 3 adds r0, r2, r6 ldrh r0, [r0] cmp r0, r1 beq @0808F384 adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 lsls r0, r3, 3 adds r0, r4 ldrh r0, [r0] cmp r0, r5 bne @0808F3B2 @0808F3CC: ldr r0, =0x000011ff @0808F3CE: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_808F404 bl meta_step pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_808F42C bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808F408 thumb_func_start sub_808F42C sub_808F42C: ; 808F42C push {r4,lr} ldr r3, =gUnknown_0850D6F4 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850D6DC bl GenerateRandomNumber movs r4, 0x3 adds r1, r4, 0 ands r1, r0 lsls r1, 1 adds r1, r5 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r6, 0 bl sub_8097978 strh r4, [r6, 0x30] movs r0, 0x1 b @0808F4C2 .align 2, 0 .pool @0808F4C0: movs r0, 0 @0808F4C2: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_808F48C thumb_func_start sub_808F4C8 sub_808F4C8: ; 808F4C8 push {r4,lr} adds r4, r1, 0 adds r0, r4, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @0808F4DC movs r0, 0 b @0808F4E2 @0808F4DC: movs r0, 0x4 strh r0, [r4, 0x30] movs r0, 0x1 @0808F4E2: pop {r4} pop {r1} bx r1 thumb_func_end sub_808F4C8 thumb_func_start sub_808F4E8 sub_808F4E8: ; 808F4E8 push {r4-r6,lr} sub sp, 0x4 adds r5, r0, 0 adds r6, r1, 0 ldr r1, =gUnknown_0850D710 mov r0, sp movs r2, 0x4 bl memcpy bl GenerateRandomNumber movs r1, 0x3 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r4, [r0] adds r0, r5, 0 adds r1, r4, 0 bl 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 .pool thumb_func_end sub_808F4E8 thumb_func_start sub_808F534 sub_808F534: ; 808F534 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsrs r0, 4 bl 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, =gUnknown_0850D714 lsls r4, r6, 2 adds r4, r0 mov r0, sp movs r6, 0 ldrsh r0, [r0, r6] movs r6, 0 ldrsh r1, [r5, r6] lsls r2, 16 asrs r2, 16 lsls r3, 16 asrs r3, 16 ldr r4, [r4] bl _call_via_r4 lsls r0, 24 lsrs r0, 24 @0808F938: add sp, 0x4 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_808F968 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808F944 thumb_func_start sub_808F968 sub_808F968: ; 808F968 push {r4,lr} ldr r3, =gUnknown_0850D740 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850D6DC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @0808F9FE: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850D710 mov r0, sp movs r2, 0x4 bl memcpy adds r0, r4, 0 movs r1, 0 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @0808FA6C bl GenerateRandomNumber movs r1, 0x3 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @0808FA6C: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_808FAA8 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808FA84 thumb_func_start sub_808FAA8 sub_808FAA8: ; 808FAA8 push {r4,lr} ldr r3, =gUnknown_0850D754 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850D6DC bl GenerateRandomNumber movs r4, 0x3 adds r1, r4, 0 ands r1, r0 lsls r1, 1 adds r1, r5 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r6, 0 bl sub_8097978 strh r4, [r6, 0x30] movs r0, 0x1 b @0808FB3E .align 2, 0 .pool @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, =gUnknown_0850D770 mov r0, sp movs r2, 0x2 bl memcpy bl GenerateRandomNumber movs r7, 0x1 adds r1, r7, 0 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r4, [r0] adds r0, r5, 0 adds r1, r4, 0 bl 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 .pool thumb_func_end sub_808FB64 thumb_func_start sub_808FBB0 sub_808FBB0: ; 808FBB0 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsrs r0, 4 bl 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, =0x02037350 adds r0, r2 ldr r2, =sub_808FC2C bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808FC08 thumb_func_start sub_808FC2C sub_808FC2C: ; 808FC2C push {r4,lr} ldr r3, =gUnknown_0850D774 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850D6DC bl GenerateRandomNumber movs r4, 0x3 adds r1, r4, 0 ands r1, r0 lsls r1, 1 adds r1, r5 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r6, 0 bl sub_8097978 strh r4, [r6, 0x30] movs r0, 0x1 b @0808FCC2 .align 2, 0 .pool @0808FCC0: movs r0, 0 @0808FCC2: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_808FC8C thumb_func_start sub_808FCC8 sub_808FCC8: ; 808FCC8 push {r4,lr} adds r4, r1, 0 adds r0, r4, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @0808FCDC movs r0, 0 b @0808FCE2 @0808FCDC: movs r0, 0x4 strh r0, [r4, 0x30] movs r0, 0x1 @0808FCE2: pop {r4} pop {r1} bx r1 thumb_func_end sub_808FCC8 thumb_func_start sub_808FCE8 sub_808FCE8: ; 808FCE8 push {r4-r7,lr} sub sp, 0x4 adds r5, r0, 0 adds r6, r1, 0 ldr r1, =gUnknown_0850D790 mov r0, sp movs r2, 0x2 bl memcpy bl GenerateRandomNumber movs r7, 0x1 adds r1, r7, 0 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r4, [r0] adds r0, r5, 0 adds r1, r4, 0 bl 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 .pool thumb_func_end sub_808FCE8 thumb_func_start sub_808FD34 sub_808FD34: ; 808FD34 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsrs r0, 4 bl 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, =0x02037350 adds r0, r2 ldr r2, =sub_808FDB0 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808FD8C thumb_func_start sub_808FDB0 sub_808FDB0: ; 808FDB0 push {r4,lr} ldr r3, =gUnknown_0850D794 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r5, r0, r1 ldrh r1, [r4, 0x3C] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0808FE58 adds r0, r5, 0 adds r1, r4, 0 bl sub_808E5F4 ldrh r1, [r4, 0x3C] movs r0, 0x1 orrs r0, r1 strh r0, [r4, 0x3C] @0808FE58: ldr r2, =sub_808FE70 adds r0, r5, 0 adds r1, r4, 0 bl meta_step pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_808FE2C thumb_func_start sub_808FE70 sub_808FE70: ; 808FE70 push {r4,lr} ldr r3, =gUnknown_0850D7A0 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038c08 movs r2, 0x10 ldrsh r0, [r4, r2] str r0, [r1] movs r2, 0x12 ldrsh r0, [r4, r2] str r0, [r1, 0x4] adds r0, r5, 0 adds r0, 0x43 ldrb r0, [r0] subs r0, 0x1 str r0, [r1, 0x8] ldrb r0, [r5, 0x5] lsls r0, 28 lsrs r0, 30 str r0, [r1, 0xC] movs r0, 0x17 bl oe_exec strb r7, [r6] @0808FEF6: movs r0, 0 b @0808FF42 .align 2, 0 .pool @0808FF00: ldrb r1, [r4, 0x1] movs r0, 0x21 negs r0, r0 ands r0, r1 strb r0, [r4, 0x1] ldrb r1, [r6] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r6] subs r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 adds r0, r5, 0 adds r0, 0x2A ldrb r0, [r0] cmp r0, r7 bne @0808FF3C adds r0, r4, 0 adds r1, r5, 0 bl 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, =0x02038c08 movs r4, 0x10 ldrsh r2, [r0, r4] str r2, [r3] movs r2, 0x12 ldrsh r0, [r0, r2] str r0, [r3, 0x4] adds r0, r1, 0 adds r0, 0x43 ldrb r0, [r0] subs r0, 0x1 str r0, [r3, 0x8] ldrb r0, [r1, 0x5] lsls r0, 28 lsrs r0, 30 str r0, [r3, 0xC] movs r0, 0x17 bl oe_exec movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8090074 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090050 thumb_func_start sub_8090074 sub_8090074: ; 8090074 push {r4,lr} ldr r3, =gUnknown_0850D7B4 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850D6DC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @0809010A: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80900D4 thumb_func_start sub_8090118 sub_8090118: ; 8090118 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @08090136 adds r0, r4, 0 bl 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, =gUnknown_0850D770 mov r0, sp movs r2, 0x2 bl memcpy adds r0, r4, 0 movs r1, 0x1 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08090178 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @08090178: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80901B4 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090190 thumb_func_start sub_80901B4 sub_80901B4: ; 80901B4 push {r4,lr} ldr r3, =gUnknown_0850D7C8 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850D6DC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @0809024A: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090214 thumb_func_start sub_8090258 sub_8090258: ; 8090258 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @08090276 adds r0, r4, 0 bl 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, =gUnknown_0850D790 mov r0, sp movs r2, 0x2 bl memcpy adds r0, r4, 0 movs r1, 0x2 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @080902B8 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @080902B8: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80902F4 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80902D0 thumb_func_start sub_80902F4 sub_80902F4: ; 80902F4 push {r4,lr} ldr r3, =gUnknown_0850D7DC movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850D6EC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @0809038A: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090354 thumb_func_start sub_8090398 sub_8090398: ; 8090398 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @080903B6 adds r0, r4, 0 bl 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, =gUnknown_0850D7F0 mov r0, sp movs r2, 0x2 bl memcpy adds r0, r4, 0 movs r1, 0x3 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @080903F8 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @080903F8: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8090434 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090410 thumb_func_start sub_8090434 sub_8090434: ; 8090434 push {r4,lr} ldr r3, =gUnknown_0850D7F4 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090434 thumb_func_start sub_8090454 sub_8090454: ; 8090454 push {r4,lr} adds r4, r1, 0 bl npc_reset movs r0, 0x1 strh r0, [r4, 0x30] pop {r4} pop {r1} bx r1 thumb_func_end sub_8090454 thumb_func_start sub_8090468 sub_8090468: ; 8090468 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850D6EC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @080904CA: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090494 thumb_func_start sub_80904D8 sub_80904D8: ; 80904D8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @080904F6 adds r0, r4, 0 bl 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, =gUnknown_0850D808 mov r0, sp movs r2, 0x2 bl memcpy adds r0, r4, 0 movs r1, 0x4 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08090538 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @08090538: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8090574 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090550 thumb_func_start sub_8090574 sub_8090574: ; 8090574 push {r4,lr} ldr r3, =gUnknown_0850D80C movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090574 thumb_func_start sub_8090594 sub_8090594: ; 8090594 push {r4,lr} adds r4, r1, 0 bl npc_reset movs r0, 0x1 strh r0, [r4, 0x30] pop {r4} pop {r1} bx r1 thumb_func_end sub_8090594 thumb_func_start sub_80905A8 sub_80905A8: ; 80905A8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850D6EC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @0809060A: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80905D4 thumb_func_start sub_8090618 sub_8090618: ; 8090618 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @08090636 adds r0, r4, 0 bl 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, =gUnknown_0850D820 mov r0, sp movs r2, 0x2 bl memcpy adds r0, r4, 0 movs r1, 0x5 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08090678 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @08090678: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80906B4 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090690 thumb_func_start sub_80906B4 sub_80906B4: ; 80906B4 push {r4,lr} ldr r3, =gUnknown_0850D824 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80906B4 thumb_func_start sub_80906D4 sub_80906D4: ; 80906D4 push {r4,lr} adds r4, r1, 0 bl npc_reset movs r0, 0x1 strh r0, [r4, 0x30] pop {r4} pop {r1} bx r1 thumb_func_end sub_80906D4 thumb_func_start sub_80906E8 sub_80906E8: ; 80906E8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850D6EC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @0809074A: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090714 thumb_func_start sub_8090758 sub_8090758: ; 8090758 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @08090776 adds r0, r4, 0 bl 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, =gUnknown_0850D838 mov r0, sp movs r2, 0x2 bl memcpy adds r0, r4, 0 movs r1, 0x6 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @080907B8 bl GenerateRandomNumber movs r1, 0x1 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @080907B8: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80907F4 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80907D0 thumb_func_start sub_80907F4 sub_80907F4: ; 80907F4 push {r4,lr} ldr r3, =gUnknown_0850D83C movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80907F4 thumb_func_start sub_8090814 sub_8090814: ; 8090814 push {r4,lr} adds r4, r1, 0 bl npc_reset movs r0, 0x1 strh r0, [r4, 0x30] pop {r4} pop {r1} bx r1 thumb_func_end sub_8090814 thumb_func_start sub_8090828 sub_8090828: ; 8090828 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850D6EC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @0809088A: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090854 thumb_func_start sub_8090898 sub_8090898: ; 8090898 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @080908B6 adds r0, r4, 0 bl 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, =gUnknown_0850D850 mov r0, sp movs r2, 0x4 bl memcpy adds r0, r4, 0 movs r1, 0x7 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @080908F8 bl GenerateRandomNumber movs r1, 0x3 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @080908F8: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8090934 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090910 thumb_func_start sub_8090934 sub_8090934: ; 8090934 push {r4,lr} ldr r3, =gUnknown_0850D854 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090934 thumb_func_start sub_8090954 sub_8090954: ; 8090954 push {r4,lr} adds r4, r1, 0 bl npc_reset movs r0, 0x1 strh r0, [r4, 0x30] pop {r4} pop {r1} bx r1 thumb_func_end sub_8090954 thumb_func_start sub_8090968 sub_8090968: ; 8090968 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850D6EC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @080909CA: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090994 thumb_func_start sub_80909D8 sub_80909D8: ; 80909D8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @080909F6 adds r0, r4, 0 bl 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, =gUnknown_0850D868 mov r0, sp movs r2, 0x4 bl memcpy adds r0, r4, 0 movs r1, 0x8 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08090A38 bl GenerateRandomNumber movs r1, 0x3 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @08090A38: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8090A74 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090A50 thumb_func_start sub_8090A74 sub_8090A74: ; 8090A74 push {r4,lr} ldr r3, =gUnknown_0850D86C movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090A74 thumb_func_start sub_8090A94 sub_8090A94: ; 8090A94 push {r4,lr} adds r4, r1, 0 bl npc_reset movs r0, 0x1 strh r0, [r4, 0x30] pop {r4} pop {r1} bx r1 thumb_func_end sub_8090A94 thumb_func_start sub_8090AA8 sub_8090AA8: ; 8090AA8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850D6EC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @08090B0A: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090AD4 thumb_func_start sub_8090B18 sub_8090B18: ; 8090B18 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @08090B36 adds r0, r4, 0 bl 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, =gUnknown_0850D880 mov r0, sp movs r2, 0x4 bl memcpy adds r0, r4, 0 movs r1, 0x9 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08090B78 bl GenerateRandomNumber movs r1, 0x3 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @08090B78: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8090BB4 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090B90 thumb_func_start sub_8090BB4 sub_8090BB4: ; 8090BB4 push {r4,lr} ldr r3, =gUnknown_0850D884 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090BB4 thumb_func_start sub_8090BD4 sub_8090BD4: ; 8090BD4 push {r4,lr} adds r4, r1, 0 bl npc_reset movs r0, 0x1 strh r0, [r4, 0x30] pop {r4} pop {r1} bx r1 thumb_func_end sub_8090BD4 thumb_func_start sub_8090BE8 sub_8090BE8: ; 8090BE8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850D6EC bl GenerateRandomNumber movs r5, 0x3 adds r1, r5, 0 ands r1, r0 lsls r1, 1 adds r1, r4 movs r0, 0 ldrsh r1, [r1, r0] adds r0, r7, 0 bl sub_8097978 ldrb r1, [r6] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r6] strh r5, [r7, 0x30] @08090C4A: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090C14 thumb_func_start sub_8090C58 sub_8090C58: ; 8090C58 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r0, r5, 0 bl sub_809797C lsls r0, 24 cmp r0, 0 bne @08090C76 adds r0, r4, 0 bl 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, =gUnknown_0850D898 mov r0, sp movs r2, 0x4 bl memcpy adds r0, r4, 0 movs r1, 0xA bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08090CB8 bl GenerateRandomNumber movs r1, 0x3 ands r1, r0 mov r2, sp adds r0, r2, r1 ldrb r1, [r0] @08090CB8: adds r0, r4, 0 bl npc_set_direction movs r0, 0x1 strh r0, [r5, 0x30] add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8090CF4 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090CD0 thumb_func_start sub_8090CF4 sub_8090CF4: ; 8090CF4 push {r4,lr} ldr r3, =gUnknown_0850D89C movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090CF4 thumb_func_start sub_8090D14 sub_8090D14: ; 8090D14 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl npc_reset ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850D8AC mov r0, sp movs r2, 0x5 bl memcpy adds r0, r4, 0 movs r1, 0 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08090DBC ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 add r0, sp ldrb r1, [r0] @08090DBC: adds r0, r4, 0 bl 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 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8090DF8 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090DD4 thumb_func_start sub_8090DF8 sub_8090DF8: ; 8090DF8 push {r4,lr} ldr r3, =gUnknown_0850D8B4 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090DF8 thumb_func_start sub_8090E18 sub_8090E18: ; 8090E18 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl npc_reset ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850D8C4 mov r0, sp movs r2, 0x5 bl memcpy adds r0, r4, 0 movs r1, 0 bl sub_808F8BC lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08090EC0 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 add r0, sp ldrb r1, [r0] @08090EC0: adds r0, r4, 0 bl 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 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8090EFC bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8090ED8 thumb_func_start sub_8090EFC sub_8090EFC: ; 8090EFC push {r4,lr} ldr r3, =gUnknown_0850D8CC movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8090EFC thumb_func_start sub_8090F1C sub_8090F1C: ; 8090F1C push {r4,lr} adds r4, r1, 0 bl npc_reset movs r0, 0x1 strh r0, [r4, 0x30] pop {r4} pop {r1} bx r1 thumb_func_end sub_8090F1C thumb_func_start sub_8090F30 sub_8090F30: ; 8090F30 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldr r0, =gUnknown_085055CD ldrb r1, [r4, 0x6] adds r1, r0 ldrb r1, [r1] adds r0, r4, 0 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0 beq @08090F52 adds r0, r1, 0 bl 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 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_809115C bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091138 thumb_func_start sub_809115C sub_809115C: ; 809115C push {r4,lr} ldr r3, =gUnknown_0850D8DC movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809115C thumb_func_start sub_809117C sub_809117C: ; 809117C push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D8E8 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @080911A8 movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @080911A8 movs r0, 0x3 strb r0, [r2] @080911A8: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80911E8 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80911C4 thumb_func_start sub_80911E8 sub_80911E8: ; 80911E8 push {r4,lr} ldr r3, =gUnknown_0850D8EC movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80911E8 thumb_func_start sub_8091208 sub_8091208: ; 8091208 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D8F8 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x1 bne @08091234 movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091234 movs r0, 0x2 strb r0, [r2] @08091234: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091274 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091250 thumb_func_start sub_8091274 sub_8091274: ; 8091274 push {r4,lr} ldr r3, =gUnknown_0850D8FC movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091274 thumb_func_start sub_8091294 sub_8091294: ; 8091294 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D908 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x1 bne @080912C0 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @080912C0 movs r0, 0x2 strb r0, [r2] @080912C0: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091300 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80912DC thumb_func_start sub_8091300 sub_8091300: ; 8091300 push {r4,lr} ldr r3, =gUnknown_0850D90C movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091300 thumb_func_start sub_8091320 sub_8091320: ; 8091320 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D918 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @0809134C movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @0809134C movs r0, 0x3 strb r0, [r2] @0809134C: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_809138C bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091368 thumb_func_start sub_809138C sub_809138C: ; 809138C push {r4,lr} ldr r3, =gUnknown_0850D91C movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850D928 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @080913D8 movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @080913D8 movs r0, 0x3 strb r0, [r2] @080913D8: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091418 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80913F4 thumb_func_start sub_8091418 sub_8091418: ; 8091418 push {r4,lr} ldr r3, =gUnknown_0850D92C movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091418 thumb_func_start sub_8091438 sub_8091438: ; 8091438 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D938 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x1 bne @08091464 movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091464 movs r0, 0x2 strb r0, [r2] @08091464: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80914A4 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091480 thumb_func_start sub_80914A4 sub_80914A4: ; 80914A4 push {r4,lr} ldr r3, =gUnknown_0850D93C movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80914A4 thumb_func_start sub_80914C4 sub_80914C4: ; 80914C4 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D710 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x1 bne @080914F0 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @080914F0 movs r0, 0x2 strb r0, [r2] @080914F0: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091530 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809150C thumb_func_start sub_8091530 sub_8091530: ; 8091530 push {r4,lr} ldr r3, =gUnknown_0850D948 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091530 thumb_func_start sub_8091550 sub_8091550: ; 8091550 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D954 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @0809157C movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @0809157C movs r0, 0x3 strb r0, [r2] @0809157C: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80915BC bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091598 thumb_func_start sub_80915BC sub_80915BC: ; 80915BC push {r4,lr} ldr r3, =gUnknown_0850D958 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80915BC thumb_func_start sub_80915DC sub_80915DC: ; 80915DC push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D964 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091608 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091608 movs r0, 0x3 strb r0, [r2] @08091608: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091648 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091624 thumb_func_start sub_8091648 sub_8091648: ; 8091648 push {r4,lr} ldr r3, =gUnknown_0850D968 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091648 thumb_func_start sub_8091668 sub_8091668: ; 8091668 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D974 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x1 bne @08091694 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091694 movs r0, 0x2 strb r0, [r2] @08091694: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80916D4 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80916B0 thumb_func_start sub_80916D4 sub_80916D4: ; 80916D4 push {r4,lr} ldr r3, =gUnknown_0850D978 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80916D4 thumb_func_start sub_80916F4 sub_80916F4: ; 80916F4 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D984 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x1 bne @08091720 movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091720 movs r0, 0x2 strb r0, [r2] @08091720: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091760 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809173C thumb_func_start sub_8091760 sub_8091760: ; 8091760 push {r4,lr} ldr r3, =gUnknown_0850D988 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091760 thumb_func_start sub_8091780 sub_8091780: ; 8091780 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D994 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @080917AC movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @080917AC movs r0, 0x3 strb r0, [r2] @080917AC: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80917EC bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80917C8 thumb_func_start sub_80917EC sub_80917EC: ; 80917EC push {r4,lr} ldr r3, =gUnknown_0850D998 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80917EC thumb_func_start sub_809180C sub_809180C: ; 809180C push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D9A4 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091838 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091838 movs r0, 0x3 strb r0, [r2] @08091838: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091878 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091854 thumb_func_start sub_8091878 sub_8091878: ; 8091878 push {r4,lr} ldr r3, =gUnknown_0850D9A8 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091878 thumb_func_start sub_8091898 sub_8091898: ; 8091898 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D9B4 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x1 bne @080918C4 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @080918C4 movs r0, 0x2 strb r0, [r2] @080918C4: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091904 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80918E0 thumb_func_start sub_8091904 sub_8091904: ; 8091904 push {r4,lr} ldr r3, =gUnknown_0850D9B8 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091904 thumb_func_start sub_8091924 sub_8091924: ; 8091924 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D9C4 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x1 bne @08091950 movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091950 movs r0, 0x2 strb r0, [r2] @08091950: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091990 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809196C thumb_func_start sub_8091990 sub_8091990: ; 8091990 push {r4,lr} ldr r3, =gUnknown_0850D9C8 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091990 thumb_func_start sub_80919B0 sub_80919B0: ; 80919B0 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D9D4 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @080919DC movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @080919DC movs r0, 0x3 strb r0, [r2] @080919DC: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091A1C bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80919F8 thumb_func_start sub_8091A1C sub_8091A1C: ; 8091A1C push {r4,lr} ldr r3, =gUnknown_0850D9D8 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091A1C thumb_func_start sub_8091A3C sub_8091A3C: ; 8091A3C push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D9E4 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091A68 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091A68 movs r0, 0x3 strb r0, [r2] @08091A68: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091AA8 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091A84 thumb_func_start sub_8091AA8 sub_8091AA8: ; 8091AA8 push {r4,lr} ldr r3, =gUnknown_0850D9E8 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091AA8 thumb_func_start sub_8091AC8 sub_8091AC8: ; 8091AC8 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850D9F4 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091AF4 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091AF4 movs r0, 0x3 strb r0, [r2] @08091AF4: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091B34 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091B10 thumb_func_start sub_8091B34 sub_8091B34: ; 8091B34 push {r4,lr} ldr r3, =gUnknown_0850D9F8 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091B34 thumb_func_start sub_8091B54 sub_8091B54: ; 8091B54 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850DA04 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091B80 movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091B80 movs r0, 0x3 strb r0, [r2] @08091B80: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091BC0 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091B9C thumb_func_start sub_8091BC0 sub_8091BC0: ; 8091BC0 push {r4,lr} ldr r3, =gUnknown_0850DA08 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091BC0 thumb_func_start sub_8091BE0 sub_8091BE0: ; 8091BE0 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850DA14 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091C0C movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091C0C movs r0, 0x3 strb r0, [r2] @08091C0C: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091C4C bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091C28 thumb_func_start sub_8091C4C sub_8091C4C: ; 8091C4C push {r4,lr} ldr r3, =gUnknown_0850DA18 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091C4C thumb_func_start sub_8091C6C sub_8091C6C: ; 8091C6C push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850DA24 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091C98 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091C98 movs r0, 0x3 strb r0, [r2] @08091C98: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091CD8 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091CB4 thumb_func_start sub_8091CD8 sub_8091CD8: ; 8091CD8 push {r4,lr} ldr r3, =gUnknown_0850DA28 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091CD8 thumb_func_start sub_8091CF8 sub_8091CF8: ; 8091CF8 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850DA34 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091D24 movs r0, 0xE ldrsh r1, [r4, r0] movs r3, 0x12 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091D24 movs r0, 0x3 strb r0, [r2] @08091D24: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091D64 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091D40 thumb_func_start sub_8091D64 sub_8091D64: ; 8091D64 push {r4,lr} ldr r3, =gUnknown_0850DA38 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091D64 thumb_func_start sub_8091D84 sub_8091D84: ; 8091D84 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850DA44 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091DB0 movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091DB0 movs r0, 0x3 strb r0, [r2] @08091DB0: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091DF0 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091DCC thumb_func_start sub_8091DF0 sub_8091DF0: ; 8091DF0 push {r4,lr} ldr r3, =gUnknown_0850DA48 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8091DF0 thumb_func_start sub_8091E10 sub_8091E10: ; 8091E10 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r1, =gUnknown_0850DA54 mov r0, sp movs r2, 0x4 bl memcpy adds r2, r4, 0 adds r2, 0x21 ldrb r0, [r2] cmp r0, 0x2 bne @08091E3C movs r0, 0xC ldrsh r1, [r4, r0] movs r3, 0x10 ldrsh r0, [r4, r3] cmp r1, r0 bne @08091E3C movs r0, 0x3 strb r0, [r2] @08091E3C: adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl sub_809105C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8091E7C bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8091E58 thumb_func_start sub_8091E7C sub_8091E7C: ; 8091E7C push {r4,lr} ldr r3, =gUnknown_0850DA58 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 ldr r3, =0x02037590 ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1C] cmp r0, 0xFF beq @08091EE0 ldrb r0, [r3, 0x3] cmp r0, 0x2 bne @08091EEC @08091EE0: movs r0, 0 b @08091F14 .align 2, 0 .pool @08091EEC: ldr r5, =gUnknown_0850DA64 bl player_get_x22 adds r4, r0, 0 lsls r4, 24 lsrs r4, 22 adds r4, r5 bl player_get_direction_upper_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 .pool thumb_func_end sub_8091EC0 thumb_func_start sub_8091F20 sub_8091F20: ; 8091F20 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl 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, =gUnknown_085055CD ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] adds r1, r4, 0 adds r1, 0x21 ldrb r1, [r1] bl state_to_direction bl 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 .pool thumb_func_end sub_8091F4C thumb_func_start sub_8091F94 sub_8091F94: ; 8091F94 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 adds r4, r0, 0 adds r7, r1, 0 mov r8, r3 lsls r2, 24 lsrs r5, r2, 24 adds r6, r5, 0 bl 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, =gUnknown_085055CD ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] adds r1, r4, 0 adds r1, 0x21 ldrb r1, [r1] adds r2, r5, 0 bl state_to_direction adds r5, r0, 0 mov r3, sp adds r3, 0x2 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp bl 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 .pool @08091FFC: ldr r1, =gUnknown_085055CD ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] adds r1, r4, 0 adds r1, 0x21 ldrb r1, [r1] adds r2, r5, 0 bl state_to_direction adds r5, r0, 0 @08092012: mov r6, sp adds r6, 0x2 adds r0, r4, 0 adds r1, r5, 0 mov r2, sp adds r3, r6, 0 bl 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 .pool thumb_func_end sub_8091F94 thumb_func_start sub_80920A4 sub_80920A4: ; 80920A4 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 adds r4, r0, 0 adds r7, r1, 0 mov r8, r3 lsls r2, 24 lsrs r6, r2, 24 ldr r1, =gUnknown_085055CD ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] adds r1, r4, 0 adds r1, 0x21 ldrb r1, [r1] adds r2, r6, 0 bl state_to_direction adds r6, r0, 0 mov r5, sp adds r5, 0x2 adds r0, r4, 0 adds r1, r6, 0 mov r2, sp adds r3, r5, 0 bl 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 .pool thumb_func_end sub_80920A4 thumb_func_start sub_809215C sub_809215C: ; 809215C push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 adds r4, r0, 0 adds r7, r1, 0 mov r8, r3 lsls r2, 24 lsrs r6, r2, 24 ldr r1, =gUnknown_085055CD ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] adds r1, r4, 0 adds r1, 0x21 ldrb r1, [r1] adds r2, r6, 0 bl state_to_direction adds r6, r0, 0 mov r5, sp adds r5, 0x2 adds r0, r4, 0 adds r1, r6, 0 mov r2, sp adds r3, r5, 0 bl 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 .pool thumb_func_end sub_809215C thumb_func_start sub_8092214 sub_8092214: ; 8092214 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 adds r4, r0, 0 adds r7, r1, 0 mov r8, r3 lsls r2, 24 lsrs r6, r2, 24 ldr r1, =gUnknown_085055CD ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] adds r1, r4, 0 adds r1, 0x21 ldrb r1, [r1] adds r2, r6, 0 bl state_to_direction adds r6, r0, 0 mov r5, sp adds r5, 0x2 adds r0, r4, 0 adds r1, r6, 0 mov r2, sp adds r3, r5, 0 bl 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 .pool thumb_func_end sub_8092214 thumb_func_start cph_IM_DIFFERENT cph_IM_DIFFERENT: ; 80922CC push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 lsls r2, 24 lsrs r2, 24 ldr r1, =gUnknown_085055CD ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] adds r1, r4, 0 adds r1, 0x21 ldrb r1, [r1] bl state_to_direction bl sub_80934BC adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 bl 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 .pool thumb_func_end cph_IM_DIFFERENT thumb_func_start sub_8092314 sub_8092314: ; 8092314 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 adds r4, r0, 0 adds r7, r1, 0 mov r8, r3 lsls r2, 24 lsrs r6, r2, 24 ldr r1, =gUnknown_085055CD ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] adds r1, r4, 0 adds r1, 0x21 ldrb r1, [r1] adds r2, r6, 0 bl state_to_direction adds r6, r0, 0 mov r5, sp adds r5, 0x2 adds r0, r4, 0 adds r1, r6, 0 mov r2, sp adds r3, r5, 0 bl 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 .pool thumb_func_end sub_8092314 thumb_func_start oac_hopping oac_hopping: ; 80923CC push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x8 adds r4, r0, 0 adds r7, r1, 0 mov r8, r3 lsls r2, 24 lsrs r6, r2, 24 ldr r1, =gUnknown_085055CD ldrb r0, [r4, 0x6] adds r0, r1 ldrb r0, [r0] adds r1, r4, 0 adds r1, 0x21 ldrb r1, [r1] adds r2, r6, 0 bl state_to_direction adds r6, r0, 0 ldrh r1, [r4, 0x10] add r0, sp, 0x4 strh r1, [r0] ldrh r0, [r4, 0x12] mov r5, sp adds r5, 0x6 strh r0, [r5] movs r0, 0x2 str r0, [sp] adds r0, r6, 0 add r1, sp, 0x4 adds r2, r5, 0 movs r3, 0x2 bl sub_8092F88 adds r0, r6, 0 bl 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 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_80924B8 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8092494 thumb_func_start sub_80924B8 sub_80924B8: ; 80924B8 push {r4,lr} ldr r3, =gUnknown_0850DA90 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80924B8 thumb_func_start mss_08062EA4 mss_08062EA4: ; 80924D8 push {r4-r7,lr} adds r6, r0, 0 adds r7, r1, 0 ldr r2, =0x02037350 ldr r3, =0x02037590 ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1C] cmp r0, 0xFF beq @080924F8 ldrb r0, [r3, 0x3] cmp r0, 0x2 bne @08092504 @080924F8: movs r0, 0 b @0809252C .align 2, 0 .pool @08092504: ldr r5, =gUnknown_0850DA64 bl player_get_x22 adds r4, r0, 0 lsls r4, 24 lsrs r4, 22 adds r4, r5 bl player_get_direction_upper_4bits adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 ldr r3, =sub_8088E64 ldr r4, [r4] adds r0, r6, 0 adds r1, r7, 0 bl _call_via_r4 lsls r0, 24 lsrs r0, 24 @0809252C: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r4, r1, r0 adds r6, r4, 0 adds r6, 0x21 ldrb r0, [r6] cmp r0, 0 beq @08092564 cmp r0, 0x1 bne @08092584 movs r1, 0x3C ldrsh r0, [r5, r1] cmp r0, 0 bne @08092584 @08092564: ldr r1, =0x02038c08 adds r2, r1, 0x4 adds r3, r1, 0 adds r3, 0x8 adds r0, r4, 0 bl 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, =0x02037350 adds r0, r1 ldr r2, =sub_80925AC adds r1, r5, 0 bl meta_step pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 adds r4, r1, r0 adds r6, r4, 0 adds r6, 0x21 ldrb r0, [r6] cmp r0, 0 beq @080925E0 cmp r0, 0x1 bne @08092600 movs r1, 0x3C ldrsh r0, [r5, r1] cmp r0, 0 bne @08092600 @080925E0: ldr r1, =0x02038c08 adds r2, r1, 0x4 adds r3, r1, 0 adds r3, 0x8 adds r0, r4, 0 bl 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, =0x02037350 adds r0, r1 ldr r2, =sub_80925AC adds r1, r5, 0 bl meta_step pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 cmp r0, 0 bne @08092668 movs r0, 0x2E ldrsh r1, [r3, r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r4 ldrb r1, [r0, 0x3] movs r2, 0x4 orrs r1, r2 strb r1, [r0, 0x3] adds r2, r3, 0 adds r2, 0x42 ldrb r1, [r2] movs r0, 0x3F ands r0, r1 movs r1, 0x80 orrs r0, r1 strb r0, [r2] ldrb r0, [r3, 0x5] movs r1, 0xC orrs r0, r1 strb r0, [r3, 0x5] ldrh r0, [r3, 0x3C] adds r0, 0x1 strh r0, [r3, 0x3C] @08092668: movs r0, 0x2E ldrsh r1, [r3, r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r2, =sub_809268C adds r1, r3, 0 bl meta_step pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8092628 thumb_func_start sub_809268C sub_809268C: ; 809268C push {r4,lr} ldr r3, =gUnknown_0850DA9C movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809268C thumb_func_start sub_80926AC sub_80926AC: ; 80926AC push {lr} bl npc_reset movs r0, 0 pop {r1} bx r1 thumb_func_end sub_80926AC thumb_func_start sub_80926B8 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, =0x02037350 adds r0, r2 ldr r2, =sub_80926F8 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80926D4 thumb_func_start sub_80926F8 sub_80926F8: ; 80926F8 push {r4,lr} ldr r3, =gUnknown_0850DAA0 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80926F8 thumb_func_start sub_8092718 sub_8092718: ; 8092718 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl npc_reset ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =0x02037350 adds r0, r2 ldr r2, =sub_8092768 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8092744 thumb_func_start sub_8092768 sub_8092768: ; 8092768 push {r4,lr} ldr r3, =gUnknown_0850DAA8 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8092768 thumb_func_start sub_8092788 sub_8092788: ; 8092788 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl npc_reset ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =0x02037350 adds r0, r2 ldr r2, =sub_80927D8 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80927B4 thumb_func_start sub_80927D8 sub_80927D8: ; 80927D8 push {r4,lr} ldr r3, =gUnknown_0850DAB0 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 adds r0, r2 ldr r2, =sub_8092848 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8092824 thumb_func_start sub_8092848 sub_8092848: ; 8092848 push {r4,lr} ldr r3, =gUnknown_0850DAB8 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8092848 thumb_func_start sub_8092868 sub_8092868: ; 8092868 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl npc_reset ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =0x02037350 adds r0, r2 ldr r2, =sub_80928B8 bl meta_step pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8092894 thumb_func_start sub_80928B8 sub_80928B8: ; 80928B8 push {r4,lr} ldr r3, =gUnknown_0850DAC0 movs r4, 0x30 ldrsh r2, [r1, r4] lsls r2, 2 adds r2, r3 ldr r2, [r2] bl _call_via_r2 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80928B8 thumb_func_start sub_80928D8 sub_80928D8: ; 80928D8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl npc_reset ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850DACC adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_0850DAD5 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end an_run_any__impl_pulse thumb_func_start sub_809297C sub_809297C: ; 809297C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DADE adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_809297C thumb_func_start sub_809298C sub_809298C: ; 809298C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DAE7 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_809298C thumb_func_start sub_809299C sub_809299C: ; 809299C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DAF0 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_809299C thumb_func_start sub_80929AC sub_80929AC: ; 80929AC lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DAF9 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80929AC thumb_func_start sub_80929BC sub_80929BC: ; 80929BC lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB02 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80929BC thumb_func_start sub_80929CC sub_80929CC: ; 80929CC lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB0B adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80929CC thumb_func_start sub_80929DC sub_80929DC: ; 80929DC lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB14 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80929DC thumb_func_start sub_80929EC sub_80929EC: ; 80929EC lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB1D adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80929EC thumb_func_start sub_80929FC sub_80929FC: ; 80929FC lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB26 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80929FC thumb_func_start sub_8092A0C sub_8092A0C: ; 8092A0C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB2F adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8092A0C thumb_func_start sub_8092A1C sub_8092A1C: ; 8092A1C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB38 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8092A1C thumb_func_start sub_8092A2C sub_8092A2C: ; 8092A2C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB41 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8092A2C thumb_func_start sub_8092A3C sub_8092A3C: ; 8092A3C lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB4A adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8092A3C thumb_func_start sub_8092A4C sub_8092A4C: ; 8092A4C push {lr} adds r2, r0, 0 ldr r1, =gUnknown_085094AC b @08092A64 .align 2, 0 .pool @08092A58: ldr r0, [r1] cmp r0, r2 bne @08092A62 adds r0, r1, 0 b @08092A6C @08092A62: adds r1, 0x8 @08092A64: ldr r0, [r1] cmp r0, 0 bne @08092A58 movs r0, 0 @08092A6C: pop {r1} bx r1 thumb_func_end sub_8092A4C thumb_func_start npc_apply_anim_looping 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, =0x02020630 mov r0, r12 ldrb r2, [r0, 0x4] lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r2, r4, 0 adds r2, 0x1C adds r0, r2 ldr r2, =gUnknown_08505438 lsls r1, 2 adds r1, r2 ldr r1, [r1] str r1, [r0] mov r0, r12 ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r3, [r0, 0x30] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end npc_set_running_behaviour_etc thumb_func_start npc_running_behaviour_by_direction npc_running_behaviour_by_direction: ; 8092B78 lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850DB53 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end npc_running_behaviour_by_direction thumb_func_start sub_8092B88 sub_8092B88: ; 8092B88 push {r4-r6,lr} sub sp, 0x4 adds r6, r0, 0 lsls r5, r1, 24 lsrs r5, 24 ldrh r1, [r6, 0x10] mov r0, sp strh r1, [r0] ldrh r0, [r6, 0x12] mov r4, sp adds r4, 0x2 strh r0, [r4] adds r0, r5, 0 mov r1, sp adds r2, r4, 0 bl 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, =gUnknown_0850DB5C lsrs r3, 22 subs r5, r3, 0x4 adds r1, r5, r1 ldrb r0, [r0, 0x1E] ldr r1, [r1] bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @08092E0A ldr r4, =gUnknown_0850DB6C adds r4, r5, r4 lsls r0, r6, 16 asrs r0, 16 lsls r1, r7, 16 asrs r1, 16 bl 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 .pool @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, =0x02037350 adds r2, r0, r1 ldrb r0, [r2] lsls r0, 31 cmp r0, 0 beq @08092E88 cmp r2, r6 beq @08092E88 movs r0, 0x10 ldrsh r1, [r2, r0] lsls r0, r7, 16 asrs r3, r0, 16 cmp r1, r3 bne @08092E58 movs r1, 0x12 ldrsh r0, [r2, r1] cmp r0, r5 beq @08092E68 @08092E58: movs r1, 0x14 ldrsh r0, [r2, r1] cmp r0, r3 bne @08092E88 movs r1, 0x16 ldrsh r0, [r2, r1] cmp r0, r5 bne @08092E88 @08092E68: ldrb r0, [r6, 0xB] lsls r0, 28 lsrs r0, 28 ldrb r1, [r2, 0xB] lsls r1, 28 lsrs r1, 28 bl r0r1_zero_or_same lsls r0, 24 cmp r0, 0 beq @08092E88 movs r0, 0x1 b @08092E94 .align 2, 0 .pool @08092E88: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @08092E2E movs r0, 0 @08092E94: pop {r4-r7} pop {r1} bx r1 thumb_func_end 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, =0x02020630 ldr r2, =0x02037350 mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x3C] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08092EE8 movs r0, 0x1 b @08092EEA .align 2, 0 .pool @08092EE8: movs r0, 0 @08092EEA: add sp, 0x4 pop {r1} bx r1 thumb_func_end sub_8092E9C thumb_func_start sub_8092EF0 sub_8092EF0: ; 8092EF0 push {lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 mov r3, sp bl npc_id_by_local_id_and_map_ret_success lsls r0, 24 cmp r0, 0 bne @08092F2E ldr r3, =0x02020630 ldr r2, =0x02037350 mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r3 ldrh r2, [r1, 0x3C] movs r0, 0x4 orrs r0, r2 strh r0, [r1, 0x3C] @08092F2E: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8092EF0 thumb_func_start numbers_move_direction numbers_move_direction: ; 8092F3C push {r4,lr} lsls r0, 24 ldr r3, =gUnknown_0850DB7C lsrs r0, 22 adds r0, r3 ldrh r3, [r0] ldrh r4, [r1] adds r3, r4 strh r3, [r1] ldrh r0, [r0, 0x2] ldrh r1, [r2] adds r0, r1 strh r0, [r2] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end numbers_move_direction thumb_func_start sub_8092F60 sub_8092F60: ; 8092F60 push {r4,lr} lsls r0, 24 ldr r3, =gUnknown_0850DB7C lsrs r0, 22 adds r0, r3 ldrh r3, [r0] lsls r3, 4 ldrh r4, [r1] adds r3, r4 strh r3, [r1] ldrh r0, [r0, 0x2] lsls r0, 4 ldrh r1, [r2] adds r0, r1 strh r0, [r2] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8092F60 thumb_func_start sub_8092F88 sub_8092F88: ; 8092F88 push {r4-r7,lr} adds r4, r1, 0 ldr r1, [sp, 0x14] lsls r0, 24 lsls r3, 16 lsrs r3, 16 adds r7, r3, 0 lsls r1, 16 lsrs r6, r1, 16 mov r12, r6 ldr r1, =gUnknown_0850DB7C lsrs r0, 22 adds r5, r0, r1 movs r0, 0 ldrsh r1, [r5, r0] cmp r1, 0 ble @08092FB4 lsls r0, r3, 16 asrs r0, 16 ldrh r3, [r4] adds r0, r3 strh r0, [r4] @08092FB4: cmp r1, 0 bge @08092FC2 ldrh r1, [r4] lsls r0, r7, 16 asrs r0, 16 subs r1, r0 strh r1, [r4] @08092FC2: movs r0, 0x2 ldrsh r1, [r5, r0] cmp r1, 0 ble @08092FD4 lsls r0, r6, 16 asrs r0, 16 ldrh r3, [r2] adds r0, r3 strh r0, [r2] @08092FD4: cmp r1, 0 bge @08092FE4 ldrh r1, [r2] mov r3, r12 lsls r0, r3, 16 asrs r0, 16 subs r1, r0 strh r1, [r2] @08092FE4: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8092F88 thumb_func_start sub_8092FF0 sub_8092FF0: ; 8092FF0 push {r4,r5,lr} ldr r5, =0x03005d8c ldr r4, [r5] ldrh r4, [r4] lsls r0, 16 asrs r0, 16 subs r0, r4 lsls r0, 4 strh r0, [r2] ldr r0, [r5] ldrh r0, [r0, 0x2] lsls r1, 16 asrs r1, 16 subs r1, r0 lsls r1, 4 strh r1, [r3] ldr r1, =0x03005dec ldrh r0, [r2] ldrh r1, [r1] subs r0, r1 strh r0, [r2] ldr r1, =0x03005de8 ldrh r0, [r3] ldrh r1, [r1] subs r0, r1 strh r0, [r3] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8092FF0 thumb_func_start sub_8093038 sub_8093038: ; 8093038 push {r4-r7,lr} adds r7, r2, 0 mov r12, r3 lsls r0, 16 lsrs r5, r0, 16 lsls r1, 16 lsrs r6, r1, 16 ldr r0, =0x03005dec ldrh r0, [r0] negs r0, r0 ldr r1, =0x03005dd0 ldr r2, [r1, 0x10] subs r0, r2 lsls r0, 16 lsrs r3, r0, 16 ldr r0, =0x03005de8 ldrh r0, [r0] negs r0, r0 ldr r1, [r1, 0x14] subs r0, r1 lsls r0, 16 lsrs r4, r0, 16 cmp r2, 0 ble @08093072 lsls r0, r3, 16 movs r3, 0x80 lsls r3, 13 adds r0, r3 lsrs r3, r0, 16 @08093072: cmp r2, 0 bge @0809307E lsls r0, r3, 16 ldr r2, =0xfff00000 adds r0, r2 lsrs r3, r0, 16 @0809307E: cmp r1, 0 ble @0809308C lsls r0, r4, 16 movs r2, 0x80 lsls r2, 13 adds r0, r2 lsrs r4, r0, 16 @0809308C: cmp r1, 0 bge @08093098 lsls r0, r4, 16 ldr r1, =0xfff00000 adds r0, r1 lsrs r4, r0, 16 @08093098: ldr r2, =0x03005d8c ldr r0, [r2] ldrh r1, [r0] lsls r0, r5, 16 asrs r0, 16 subs r0, r1 lsls r0, 4 lsls r1, r3, 16 asrs r1, 16 adds r1, r0 strh r1, [r7] ldr r0, [r2] ldrh r1, [r0, 0x2] lsls r0, r6, 16 asrs r0, 16 subs r0, r1 lsls r0, 4 lsls r1, r4, 16 asrs r1, 16 adds r1, r0 mov r2, r12 strh r1, [r2] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8093038 thumb_func_start sub_80930E0 sub_80930E0: ; 80930E0 push {r4-r6,lr} mov r6, r8 push {r6} adds r6, r0, 0 mov r8, r1 adds r4, r2, 0 adds r5, r3, 0 lsls r4, 16 lsrs r4, 16 lsls r5, 16 lsrs r5, 16 movs r1, 0 ldrsh r0, [r6, r1] mov r2, r8 movs r3, 0 ldrsh r1, [r2, r3] adds r2, r6, 0 mov r3, r8 bl sub_8093038 lsls r4, 16 asrs r4, 16 ldrh r0, [r6] adds r4, r0 strh r4, [r6] lsls r5, 16 asrs r5, 16 mov r1, r8 ldrh r1, [r1] adds r5, r1 mov r2, r8 strh r5, [r2] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_80930E0 thumb_func_start sub_809312C sub_809312C: ; 809312C push {lr} adds r2, r0, 0 movs r0, 0 strh r0, [r2] strh r0, [r1] ldr r3, =0x03005dd0 ldr r0, [r3, 0x10] cmp r0, 0 ble @08093142 movs r0, 0x1 strh r0, [r2] @08093142: ldr r0, [r3, 0x10] cmp r0, 0 bge @0809314E ldrh r0, [r2] subs r0, 0x1 strh r0, [r2] @0809314E: ldr r2, [r3, 0x14] cmp r2, 0 ble @0809315A ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0809315A: cmp r2, 0 bge @08093164 ldrh r0, [r1] subs r0, 0x1 strh r0, [r1] @08093164: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldrb r1, [r4, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r6, [r0, 0x32] movs r0, 0 b @08093202 .align 2, 0 .pool @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, =0x02020630 ldrb r2, [r0, 0x4] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r3 movs r2, 0 strh r2, [r1, 0x30] ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 strh r2, [r0, 0x32] bx lr .align 2, 0 .pool 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, =gUnknown_0850DBA0 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093348 movs r4, 0 @08093348: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBA5 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093374 movs r4, 0 @08093374: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBAA mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080933A0 movs r4, 0 @080933A0: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBAF mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080933CC movs r4, 0 @080933CC: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBB4 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080933F8 movs r4, 0 @080933F8: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBB9 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093424 movs r4, 0 @08093424: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBBE mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093450 movs r4, 0 @08093450: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBC3 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @0809347C movs r4, 0 @0809347C: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBC8 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080934A8 movs r4, 0 @080934A8: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBCD mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080934D4 movs r4, 0 @080934D4: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBD2 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093500 movs r4, 0 @08093500: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBD7 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @0809352C movs r4, 0 @0809352C: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBDC mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093558 movs r4, 0 @08093558: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBE1 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093584 movs r4, 0 @08093584: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBE6 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080935B0 movs r4, 0 @080935B0: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBEB mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080935DC movs r4, 0 @080935DC: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBF0 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093608 movs r4, 0 @08093608: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DBF5 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093660 movs r4, 0 @08093660: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8093648 thumb_func_start sub_8093674 sub_8093674: ; 8093674 push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gUnknown_0850DBFA mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @0809368C movs r4, 0 @0809368C: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8093674 thumb_func_start sub_80936A0 sub_80936A0: ; 80936A0 push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gUnknown_0850DBFF mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080936B8 movs r4, 0 @080936B8: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80936A0 thumb_func_start sub_80936CC sub_80936CC: ; 80936CC push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gUnknown_0850DC04 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080936E4 movs r4, 0 @080936E4: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80936CC thumb_func_start sub_80936F8 sub_80936F8: ; 80936F8 push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gUnknown_0850DC09 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093710 movs r4, 0 @08093710: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80936F8 thumb_func_start sub_8093724 sub_8093724: ; 8093724 push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gUnknown_0850DC0E mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @0809373C movs r4, 0 @0809373C: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8093724 thumb_func_start sub_8093750 sub_8093750: ; 8093750 push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gUnknown_0850DC13 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093768 movs r4, 0 @08093768: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8093750 thumb_func_start sub_809377C sub_809377C: ; 809377C push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gUnknown_0850DC18 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @08093794 movs r4, 0 @08093794: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809377C thumb_func_start sub_80937A8 sub_80937A8: ; 80937A8 push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gUnknown_0850DC1D mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080937C0 movs r4, 0 @080937C0: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80937A8 thumb_func_start d2s_08064034 d2s_08064034: ; 80937D4 push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r1, =gUnknown_0850DC22 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x4 bls @080937EC movs r4, 0 @080937EC: mov r1, sp adds r0, r1, r4 ldrb r0, [r0] add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DC27 mov r0, sp movs r2, 0x8 bl memcpy subs r1, r4, 0x1 lsls r0, r1, 24 lsrs r0, 24 cmp r0, 0x7 bhi @08093828 mov r2, sp adds r0, r2, r1 ldrb r0, [r0] b @0809382A .align 2, 0 .pool @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, =gUnknown_0850DC2F lsrs r0, 22 subs r0, 0x5 adds r1, r0 adds r1, r2 ldrb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end zffu_offset_calc thumb_func_start state_to_direction state_to_direction: ; 809384C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 lsrs r1, 24 adds r0, r1, 0 lsls r2, 24 lsrs r2, 24 cmp r1, 0 beq @0809386C cmp r2, 0 beq @0809386C cmp r1, 0x4 bhi @0809386C cmp r2, 0x4 bls @08093870 @0809386C: movs r0, 0 b @08093882 @08093870: adds r1, r2, 0 bl zffu_offset_calc ldr r2, =gUnknown_0850DC3F lsls r1, r4, 2 subs r1, 0x5 adds r0, r1 adds r0, r2 ldrb r0, [r0] @08093882: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0850DC50 ldrb r0, [r4, 0x1C] lsls r0, 2 adds r0, r2 movs r3, 0x32 ldrsh r2, [r1, r3] ldr r0, [r0] lsls r2, 2 adds r2, r0 ldr r2, [r2] adds r0, r4, 0 bl _call_via_r2 lsls r0, 24 cmp r0, 0 beq @080938B8 ldrb r0, [r4] movs r1, 0x80 orrs r0, r1 strb r0, [r4] @080938B8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850DC50 ldrb r0, [r4, 0x1C] lsls r0, 2 adds r0, r1 movs r2, 0x32 ldrsh r1, [r5, r2] ldr r0, [r0] lsls r1, 2 adds r1, r0 ldr r2, [r1] adds r0, r4, 0 adds r1, r5, 0 bl _call_via_r2 lsls r0, 24 cmp r0, 0 bne @080938F4 movs r0, 0 b @080938FE .align 2, 0 .pool @080938F4: movs r0, 0xFF strb r0, [r4, 0x1C] movs r0, 0 strh r0, [r5, 0x32] movs r0, 0x1 @080938FE: pop {r4,r5} pop {r1} bx r1 thumb_func_end 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, =0x020375b8 ldr r0, [r0] cmp r0, 0 beq @08093A0E adds r0, r7, 0 bl sub_8097F78 lsls r0, 24 lsrs r0, 24 cmp r0, 0x10 beq @08093A0E ldrb r0, [r4] movs r1, 0x40 orrs r0, r1 strb r0, [r4] @08093A0E: ldrb r0, [r7] movs r1, 0x4 orrs r0, r1 strb r0, [r7] movs r0, 0x1 mov r1, r8 strh r0, [r1, 0x32] add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850DEE8 ldm r0!, {r3,r6,r7} stm r1!, {r3,r6,r7} ldm r0!, {r3,r6} stm r1!, {r3,r6} adds r0, r5, 0 mov r1, r8 adds r3, r4, 0 bl npc_apply_direction lsls r4, 2 mov r7, sp adds r1, r7, r4 ldrb r0, [r5, 0x18] lsls r0, 28 lsrs r0, 28 ldr r1, [r1] bl _call_via_r1 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r5, 0 mov r1, r8 bl npc_apply_anim_looping add sp, 0x14 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850DFBC add r0, sp, 0x4 movs r2, 0x6 bl memcpy add r5, sp, 0xC movs r0, 0 strh r0, [r5] mov r6, sp adds r6, 0xE strh r0, [r6] adds r0, r7, 0 adds r1, r4, 0 bl 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 .pool thumb_func_end sub_8093FC4 thumb_func_start maybe_shadow_1 maybe_shadow_1: ; 8094080 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 ldr r0, [sp, 0x10] lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 lsls r0, 24 lsrs r0, 24 str r0, [sp] adds r0, r4, 0 bl sub_8093FC4 ldrb r0, [r4, 0x18] lsls r0, 28 lsrs r0, 28 bl 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, =gUnknown_0850DFC2 add r0, sp, 0x4 movs r2, 0x6 bl memcpy adds r0, r7, 0 bl _call_via_r4 lsls r0, 24 lsrs r0, 24 mov r8, r0 cmp r0, 0x1 bne @08094154 movs r1, 0x36 ldrsh r0, [r7, r1] lsls r0, 1 add r0, sp adds r0, 0x4 movs r2, 0 ldrsh r0, [r0, r2] cmp r0, 0 beq @08094154 add r4, sp, 0xC movs r0, 0 strh r0, [r4] mov r5, sp adds r5, 0xE strh r0, [r5] ldrb r0, [r6, 0x18] lsrs r0, 4 movs r2, 0x36 ldrsh r1, [r7, r2] lsls r1, 1 add r1, sp adds r1, 0x4 movs r2, 0 ldrsh r3, [r1, r2] str r3, [sp] adds r1, r4, 0 adds r2, r5, 0 bl sub_8092F88 ldrh r1, [r4] ldrh r0, [r6, 0x10] adds r1, r0 lsls r1, 16 asrs r1, 16 ldrh r2, [r5] ldrh r0, [r6, 0x12] adds r2, r0 lsls r2, 16 asrs r2, 16 adds r0, r6, 0 bl npc_coords_shift ldrb r0, [r6] movs r1, 0x4 orrs r0, r1 movs r1, 0x10 orrs r0, r1 strb r0, [r6] b @08094178 .align 2, 0 .pool @08094154: mov r1, r8 cmp r1, 0xFF bne @08094178 adds r0, r6, 0 bl npc_coords_shift_still ldrb r0, [r6] movs r1, 0x8 orrs r0, r1 movs r1, 0x20 orrs r0, r1 strb r0, [r6] adds r2, r7, 0 adds r2, 0x2C ldrb r0, [r2] movs r1, 0x40 orrs r0, r1 strb r0, [r2] @08094178: mov r0, r8 add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80940C4 thumb_func_start sub_8094188 sub_8094188: ; 8094188 push {lr} ldr r2, =sub_809785C bl sub_80940C4 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8094188 thumb_func_start sub_809419C sub_809419C: ; 809419C push {lr} ldr r2, =sub_80978E4 bl sub_80940C4 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809419C thumb_func_start sub_80941B0 sub_80941B0: ; 80941B0 push {lr} bl sub_8094188 lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @080941C2 movs r0, 0 b @080941C4 @080941C2: movs r0, 0x1 @080941C4: pop {r1} bx r1 thumb_func_end sub_80941B0 thumb_func_start sub_80941C8 sub_80941C8: ; 80941C8 push {lr} bl sub_809419C lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @080941DA movs r0, 0 b @080941DC @080941DA: movs r0, 0x1 @080941DC: pop {r1} bx r1 thumb_func_end sub_80941C8 thumb_func_start sub_80941E0 sub_80941E0: ; 80941E0 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_8094188 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080941FA cmp r0, 0xFF bne @08094226 movs r0, 0x1 b @08094228 @080941FA: ldrb r0, [r4, 0x18] lsrs r0, 4 bl 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, =0x02037350 mov r2, sp ldrb r2, [r2] lsls r3, r2, 3 adds r3, r2 lsls r3, 2 adds r3, r4 movs r4, 0x10 ldrsh r2, [r3, r4] movs r4, 0x12 ldrsh r3, [r3, r4] bl sub_8092AF8 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r5, 0 adds r1, r6, 0 bl an_look_any @08094F82: movs r0, 0x1 strh r0, [r6, 0x32] add sp, 0x4 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8094F38 thumb_func_start sub_8094F94 sub_8094F94: ; 8094F94 push {r4-r6,lr} sub sp, 0x4 adds r5, r0, 0 adds r6, r1, 0 movs r0, 0xFF movs r1, 0 movs r2, 0 mov r3, sp bl 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, =0x02037350 mov r2, sp ldrb r2, [r2] lsls r3, r2, 3 adds r3, r2 lsls r3, 2 adds r3, r4 movs r4, 0x10 ldrsh r2, [r3, r4] movs r4, 0x12 ldrsh r3, [r3, r4] bl sub_8092AF8 lsls r0, 24 lsrs r0, 24 bl 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 .pool thumb_func_end sub_8094F94 thumb_func_start sub_8094FF8 sub_8094FF8: ; 8094FF8 ldrb r2, [r0, 0x1] movs r3, 0x2 orrs r2, r3 strb r2, [r0, 0x1] movs r0, 0x1 strh r0, [r1, 0x32] bx lr thumb_func_end sub_8094FF8 thumb_func_start sub_8095008 sub_8095008: ; 8095008 ldrb r3, [r0, 0x1] movs r2, 0x3 negs r2, r2 ands r2, r3 strb r2, [r0, 0x1] movs r0, 0x1 strh r0, [r1, 0x32] bx lr thumb_func_end sub_8095008 thumb_func_start sub_8095018 sub_8095018: ; 8095018 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 str r0, [sp] adds r0, r4, 0 movs r2, 0x1 movs r3, 0x1 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_8095044 lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095018 thumb_func_start sub_8095044 sub_8095044: ; 8095044 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941B0 lsls r0, 24 cmp r0, 0 bne @08095058 movs r0, 0 b @08095068 @08095058: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @08095068: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095044 thumb_func_start sub_8095070 sub_8095070: ; 8095070 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 str r0, [sp] adds r0, r4, 0 movs r2, 0x2 movs r3, 0x1 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_809509C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095070 thumb_func_start sub_809509C sub_809509C: ; 809509C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941B0 lsls r0, 24 cmp r0, 0 bne @080950B0 movs r0, 0 b @080950C0 @080950B0: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @080950C0: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_809509C thumb_func_start sub_80950C8 sub_80950C8: ; 80950C8 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 str r0, [sp] adds r0, r4, 0 movs r2, 0x3 movs r3, 0x1 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_80950F4 lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80950C8 thumb_func_start sub_80950F4 sub_80950F4: ; 80950F4 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941B0 lsls r0, 24 cmp r0, 0 bne @08095108 movs r0, 0 b @08095118 @08095108: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @08095118: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80950F4 thumb_func_start sub_8095120 sub_8095120: ; 8095120 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 str r0, [sp] adds r0, r4, 0 movs r2, 0x4 movs r3, 0x1 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_809514C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095120 thumb_func_start sub_809514C sub_809514C: ; 809514C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941B0 lsls r0, 24 cmp r0, 0 bne @08095160 movs r0, 0 b @08095170 @08095160: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @08095170: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_809514C thumb_func_start sub_8095178 sub_8095178: ; 8095178 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r2, 0x1 movs r3, 0 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_80951A4 lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095178 thumb_func_start sub_80951A4 sub_80951A4: ; 80951A4 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941B0 lsls r0, 24 cmp r0, 0 bne @080951B8 movs r0, 0 b @080951C8 @080951B8: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @080951C8: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80951A4 thumb_func_start sub_80951D0 sub_80951D0: ; 80951D0 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r2, 0x2 movs r3, 0 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_80951FC lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80951D0 thumb_func_start sub_80951FC sub_80951FC: ; 80951FC push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941B0 lsls r0, 24 cmp r0, 0 bne @08095210 movs r0, 0 b @08095220 @08095210: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @08095220: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80951FC thumb_func_start sub_8095228 sub_8095228: ; 8095228 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r2, 0x3 movs r3, 0 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_8095254 lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095228 thumb_func_start sub_8095254 sub_8095254: ; 8095254 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941B0 lsls r0, 24 cmp r0, 0 bne @08095268 movs r0, 0 b @08095278 @08095268: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @08095278: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095254 thumb_func_start sub_8095280 sub_8095280: ; 8095280 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r2, 0x4 movs r3, 0 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_80952AC lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095280 thumb_func_start sub_80952AC sub_80952AC: ; 80952AC push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941B0 lsls r0, 24 cmp r0, 0 bne @080952C0 movs r0, 0 b @080952D0 @080952C0: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @080952D0: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80952AC thumb_func_start sub_80952D8 sub_80952D8: ; 80952D8 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 str r0, [sp] adds r0, r4, 0 movs r2, 0x1 movs r3, 0 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_8095304 lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80952D8 thumb_func_start sub_8095304 sub_8095304: ; 8095304 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941E0 lsls r0, 24 cmp r0, 0 bne @08095318 movs r0, 0 b @08095328 @08095318: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @08095328: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095304 thumb_func_start sub_8095330 sub_8095330: ; 8095330 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 str r0, [sp] adds r0, r4, 0 movs r2, 0x2 movs r3, 0 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_809535C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095330 thumb_func_start sub_809535C sub_809535C: ; 809535C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941E0 lsls r0, 24 cmp r0, 0 bne @08095370 movs r0, 0 b @08095380 @08095370: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @08095380: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_809535C thumb_func_start sub_8095388 sub_8095388: ; 8095388 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 str r0, [sp] adds r0, r4, 0 movs r2, 0x3 movs r3, 0 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_80953B4 lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8095388 thumb_func_start sub_80953B4 sub_80953B4: ; 80953B4 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941E0 lsls r0, 24 cmp r0, 0 bne @080953C8 movs r0, 0 b @080953D8 @080953C8: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @080953D8: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80953B4 thumb_func_start sub_80953E0 sub_80953E0: ; 80953E0 push {r4,r5,lr} sub sp, 0x4 adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x2 str r0, [sp] adds r0, r4, 0 movs r2, 0x4 movs r3, 0 bl maybe_shadow_1 adds r0, r4, 0 adds r1, r5, 0 bl sub_809540C lsls r0, 24 lsrs r0, 24 add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80953E0 thumb_func_start sub_809540C sub_809540C: ; 809540C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80941E0 lsls r0, 24 cmp r0, 0 bne @08095420 movs r0, 0 b @08095430 @08095420: ldrb r0, [r4, 0x2] movs r1, 0x41 negs r1, r1 ands r1, r0 strb r1, [r4, 0x2] movs r0, 0x2 strh r0, [r5, 0x32] movs r0, 0x1 @08095430: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_809540C thumb_func_start sub_8095438 sub_8095438: ; 8095438 push {lr} ldr r3, =gUnknown_085055CD ldrb r2, [r0, 0x6] adds r2, r3 ldrb r2, [r2] bl an_look_any movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8095438 thumb_func_start sub_8095450 sub_8095450: ; 8095450 push {lr} movs r2, 0x1 movs r3, 0x14 bl npc_set_direction_and_anim__an_proceed movs r0, 0 pop {r1} bx r1 thumb_func_end sub_8095450 thumb_func_start sub_8095460 sub_8095460: ; 8095460 ldrb r3, [r0, 0x3] movs r2, 0x3 negs r2, r2 ands r2, r3 strb r2, [r0, 0x3] movs r0, 0x1 strh r0, [r1, 0x32] bx lr thumb_func_end sub_8095460 thumb_func_start sub_8095470 sub_8095470: ; 8095470 ldrb r2, [r0, 0x3] movs r3, 0x2 orrs r2, r3 strb r2, [r0, 0x3] movs r0, 0x1 strh r0, [r1, 0x32] bx lr thumb_func_end sub_8095470 thumb_func_start sub_8095480 sub_8095480: ; 8095480 ldrb r2, [r0, 0x1] movs r3, 0x10 orrs r2, r3 strb r2, [r0, 0x1] movs r0, 0x1 strh r0, [r1, 0x32] bx lr thumb_func_end sub_8095480 thumb_func_start sub_8095490 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, =0x02038c08 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 .pool thumb_func_end sub_80954DC thumb_func_start sub_8095500 sub_8095500: ; 8095500 push {r4,lr} adds r4, r1, 0 ldr r1, =0x02038c08 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 .pool thumb_func_end sub_8095500 thumb_func_start sub_8095524 sub_8095524: ; 8095524 push {r4,lr} adds r4, r1, 0 ldr r1, =0x02038c08 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 .pool 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, =0x02021bbc adds r0, r1 ldrh r2, [r2] adds r0, r2 lsls r0, 16 lsrs r3, r0, 16 ldrh r1, [r4, 0x26] ldrh r0, [r4, 0x22] adds r1, r0 adds r0, r4, 0 adds r0, 0x29 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 ldr r2, =0x02021bbe adds r0, r1 ldrh r2, [r2] adds r0, r2 b @080965BC .align 2, 0 .pool @08096594: ldrh r1, [r4, 0x24] ldrh r0, [r4, 0x20] adds r1, r0 adds r0, r4, 0 adds r0, 0x28 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 adds r0, r1 lsls r0, 16 lsrs r3, r0, 16 ldrh r1, [r4, 0x26] ldrh r0, [r4, 0x22] adds r1, r0 adds r0, r4, 0 adds r0, 0x29 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 adds r0, r1 @080965BC: lsls r0, 16 lsrs r2, r0, 16 ldrh r0, [r6, 0x8] adds r0, r3 lsls r0, 16 lsrs r1, r0, 16 ldrh r0, [r6, 0xA] adds r0, r2 lsls r0, 16 lsrs r4, r0, 16 lsls r0, r3, 16 asrs r0, 16 cmp r0, 0xFF bgt @080965E4 lsls r0, r1, 16 asrs r0, 16 movs r1, 0x10 negs r1, r1 cmp r0, r1 bge @080965EC @080965E4: ldrb r0, [r5, 0x1] movs r1, 0x40 orrs r0, r1 strb r0, [r5, 0x1] @080965EC: lsls r0, r2, 16 asrs r0, 16 cmp r0, 0xAF bgt @08096600 lsls r0, r4, 16 asrs r0, 16 movs r1, 0x10 negs r1, r1 cmp r0, r1 bge @08096608 @08096600: ldrb r0, [r5, 0x1] movs r1, 0x40 orrs r0, r1 strb r0, [r5, 0x1] @08096608: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_8096530 thumb_func_start npc_update_obj_anim_flag 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, =gUnknown_0850E5DC 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 .pool @08096798: ldrb r1, [r4, 0x2] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r4, 0x2] @080967A2: add sp, 0x8 pop {r4,r5} pop {r0} bx r0 thumb_func_end 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, =0x02000020 ands r0, r1 cmp r0, 0x20 bne @08096A82 movs r5, 0 ldr r0, =gUnknown_0850E5E4 mov r8, r0 @08096A4A: lsls r4, r5, 2 mov r0, r8 adds r1, r4, r0 ldrb r0, [r7, 0x1E] ldr r1, [r1] bl _call_via_r1 lsls r0, 24 cmp r0, 0 beq @08096A78 ldr r0, =gUnknown_0850E5FC adds r0, r4, r0 ldr r1, [r6] ldr r0, [r0] orrs r1, r0 str r1, [r6] b @08096A82 .align 2, 0 .pool @08096A78: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x5 bls @08096A4A @08096A82: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end 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, =gUnknown_0850E614 lsls r1, r4, 2 adds r1, r2 ldr r1, [r1] bl _call_via_r1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08096C5C @08096C52: movs r0, 0 b @08096C62 .align 2, 0 .pool @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, =gUnknown_0850E644 ldrb r2, [r4, 0xB] lsls r2, 24 lsrs r0, r2, 28 adds r0, r1 ldrb r0, [r0] adds r4, r5, 0 adds r4, 0x42 movs r1, 0x3F ands r1, r0 ldrb r3, [r4] movs r0, 0x40 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r4] ldr r0, =gUnknown_0850E634 lsrs r2, 28 adds r2, r0 movs r0, 0x3 ldrb r1, [r2] ands r1, r0 lsls r1, 2 ldrb r2, [r5, 0x5] movs r0, 0xD negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x5] @08096D4E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8096D00 thumb_func_start sub_8096D5C sub_8096D5C: ; 8096D5C push {r4,lr} lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_0850E644 adds r2, r1, r2 ldrb r2, [r2] movs r3, 0x42 adds r3, r0 mov r12, r3 movs r3, 0x3F ands r3, r2 mov r2, r12 ldrb r4, [r2] movs r2, 0x40 negs r2, r2 ands r2, r4 orrs r2, r3 mov r3, r12 strb r2, [r3] ldr r2, =gUnknown_0850E634 adds r1, r2 movs r3, 0x3 ldrb r2, [r1] ands r2, r3 lsls r2, 2 ldrb r3, [r0, 0x5] movs r1, 0xD negs r1, r1 ands r1, r3 orrs r1, r2 strb r1, [r0, 0x5] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8096D5C thumb_func_start sub_8096DA8 sub_8096DA8: ; 8096DA8 lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0850E634 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x02021bbe subs r4, r5 ldrh r3, [r3] adds r4, r3 adds r4, 0x8 movs r3, 0xFF ands r4, r3 lsrs r4, 4 movs r3, 0x10 subs r3, r4 lsls r3, 17 ldr r4, =gUnknown_0850E624 adds r0, r4 lsrs r3, 16 ldrb r0, [r0] adds r3, r0 adds r2, r3 adds r1, 0x43 strb r2, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 movs r2, 0x10 ldrsh r1, [r0, r2] str r1, [r3] movs r2, 0x12 ldrsh r1, [r0, r2] str r1, [r3, 0x4] ldrb r1, [r0, 0xB] lsrs r1, 4 str r1, [r3, 0x8] movs r1, 0x2 str r1, [r3, 0xC] ldrb r1, [r0, 0x8] lsls r1, 8 ldrb r2, [r0, 0x9] orrs r1, r2 str r1, [r3, 0x10] ldrb r0, [r0, 0xA] str r0, [r3, 0x14] ldr r0, =0x03005d8c ldr r1, [r0] ldrb r0, [r1, 0x5] lsls r0, 8 ldrb r1, [r1, 0x4] orrs r0, r1 str r0, [r3, 0x18] movs r0, 0x1 str r0, [r3, 0x1C] movs r0, 0x4 bl oe_exec pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp03_step_grass_normal thumb_func_start dp03_step_grass_elastic dp03_step_grass_elastic: ; 8096EDC push {lr} ldr r3, =0x02038c08 movs r2, 0x10 ldrsh r1, [r0, r2] str r1, [r3] movs r2, 0x12 ldrsh r1, [r0, r2] str r1, [r3, 0x4] ldrb r1, [r0, 0xB] lsrs r1, 4 str r1, [r3, 0x8] movs r1, 0x2 str r1, [r3, 0xC] ldrb r1, [r0, 0x8] lsls r1, 8 ldrb r2, [r0, 0x9] orrs r1, r2 str r1, [r3, 0x10] ldrb r0, [r0, 0xA] str r0, [r3, 0x14] ldr r0, =0x03005d8c ldr r1, [r0] ldrb r0, [r1, 0x5] lsls r0, 8 ldrb r1, [r1, 0x4] orrs r0, r1 str r0, [r3, 0x18] movs r0, 0 str r0, [r3, 0x1C] movs r0, 0x4 bl oe_exec pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 movs r2, 0x10 ldrsh r1, [r0, r2] str r1, [r3] movs r2, 0x12 ldrsh r1, [r0, r2] str r1, [r3, 0x4] ldrb r1, [r0, 0xB] lsrs r1, 4 str r1, [r3, 0x8] movs r1, 0x2 str r1, [r3, 0xC] ldrb r1, [r0, 0x8] lsls r1, 8 ldrb r2, [r0, 0x9] orrs r1, r2 str r1, [r3, 0x10] ldrb r0, [r0, 0xA] str r0, [r3, 0x14] ldr r0, =0x03005d8c ldr r1, [r0] ldrb r0, [r1, 0x5] lsls r0, 8 ldrb r1, [r1, 0x4] orrs r0, r1 str r0, [r3, 0x18] movs r0, 0x1 str r0, [r3, 0x1C] movs r0, 0x11 bl oe_exec pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 movs r2, 0x10 ldrsh r1, [r0, r2] str r1, [r3] movs r2, 0x12 ldrsh r1, [r0, r2] str r1, [r3, 0x4] ldrb r1, [r0, 0xB] lsrs r1, 4 str r1, [r3, 0x8] movs r1, 0x2 str r1, [r3, 0xC] ldrb r1, [r0, 0x8] lsls r1, 8 ldrb r2, [r0, 0x9] orrs r1, r2 str r1, [r3, 0x10] ldrb r0, [r0, 0xA] str r0, [r3, 0x14] ldr r0, =0x03005d8c ldr r1, [r0] ldrb r0, [r1, 0x5] lsls r0, 8 ldrb r1, [r1, 0x4] orrs r0, r1 str r0, [r3, 0x18] movs r0, 0 str r0, [r3, 0x1C] movs r0, 0x11 bl oe_exec pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850E654 ldrb r0, [r0, 0xD] lsls r0, 2 adds r0, r1 ldr r3, [r0] adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 bl _call_via_r3 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850E654 ldrb r0, [r0, 0xD] lsls r0, 2 adds r0, r1 ldr r3, [r0] adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x1 bl _call_via_r3 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850E660 mov r0, sp movs r2, 0x4 bl memcpy ldr r1, =0x02038c08 movs r2, 0x14 ldrsh r0, [r5, r2] str r0, [r1] movs r2, 0x16 ldrsh r0, [r5, r2] str r0, [r1, 0x4] movs r0, 0x95 str r0, [r1, 0x8] movs r0, 0x2 str r0, [r1, 0xC] ldrb r0, [r5, 0x18] lsls r0, 28 lsrs r0, 28 str r0, [r1, 0x10] lsls r4, 1 mov r1, sp adds r0, r1, r4 ldrb r0, [r0] bl oe_exec add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 movs r1, 0x14 ldrsh r0, [r4, r1] str r0, [r2] movs r1, 0x16 ldrsh r0, [r4, r1] str r0, [r2, 0x4] movs r0, 0x95 str r0, [r2, 0x8] movs r0, 0x2 str r0, [r2, 0xC] ldr r3, =gUnknown_0850E664 ldrb r1, [r4, 0x18] lsls r1, 28 lsrs r1, 28 adds r0, r4, 0 adds r0, 0x20 ldrb r0, [r0] lsls r0, 2 subs r0, 0x5 adds r1, r0 adds r1, r3 ldrb r0, [r1] str r0, [r2, 0x10] movs r0, 0x23 bl oe_exec @080970D6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 movs r2, 0x10 ldrsh r0, [r5, r2] str r0, [r1] movs r4, 0x12 ldrsh r0, [r5, r4] str r0, [r1, 0x4] ldrb r0, [r5, 0xB] lsrs r0, 4 str r0, [r1, 0x8] movs r0, 0x2 str r0, [r1, 0xC] movs r0, 0xC bl 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 .pool thumb_func_end dp03_step_grass_thin thumb_func_start dp03_step_grass_heavy dp03_step_grass_heavy: ; 8097168 push {lr} ldr r2, =0x02038c08 movs r3, 0x10 ldrsh r1, [r0, r3] str r1, [r2] movs r3, 0x12 ldrsh r1, [r0, r3] str r1, [r2, 0x4] ldrb r0, [r0, 0xB] lsrs r0, 4 str r0, [r2, 0x8] movs r0, 0x2 str r0, [r2, 0xC] movs r0, 0x12 bl oe_exec pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 movs r4, 0x10 ldrsh r2, [r0, r4] str r2, [r3] movs r4, 0x12 ldrsh r2, [r0, r4] str r2, [r3, 0x4] ldrb r0, [r0, 0xB] lsrs r0, 4 str r0, [r3, 0x8] ldrb r0, [r1, 0x5] lsls r0, 28 lsrs r0, 30 str r0, [r3, 0xC] movs r0, 0x10 bl oe_exec pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 movs r4, 0x10 ldrsh r2, [r0, r4] str r2, [r3] movs r4, 0x12 ldrsh r2, [r0, r4] str r2, [r3, 0x4] ldrb r0, [r0, 0xB] lsrs r0, 4 str r0, [r3, 0x8] ldrb r0, [r1, 0x5] lsls r0, 28 lsrs r0, 30 str r0, [r3, 0xC] movs r0, 0xE bl oe_exec pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp03_step_drop_water thumb_func_start dp03_step_dust dp03_step_dust: ; 80971F0 push {r4,lr} ldr r3, =0x02038c08 movs r4, 0x10 ldrsh r2, [r0, r4] str r2, [r3] movs r4, 0x12 ldrsh r2, [r0, r4] str r2, [r3, 0x4] ldrb r0, [r0, 0xB] lsrs r0, 4 str r0, [r3, 0x8] ldrb r0, [r1, 0x5] lsls r0, 28 lsrs r0, 30 str r0, [r3, 0xC] movs r0, 0xA bl oe_exec pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 movs r3, 0x10 ldrsh r1, [r0, r3] str r1, [r2] movs r1, 0x12 ldrsh r0, [r0, r1] str r0, [r2, 0x4] movs r0, 0x35 bl oe_exec pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0850E674 mov r8, r0 @0809728A: movs r0, 0x1 ands r0, r5 cmp r0, 0 beq @080972A0 lsls r0, r4, 2 add r0, r8 ldr r2, [r0] adds r0, r6, 0 adds r1, r7, 0 bl _call_via_r2 @080972A0: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 lsrs r5, 1 cmp r4, 0x13 bls @0809728A @080972AC: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0xfff9f7bd ands r0, r1 str r0, [r3] @080972EA: pop {r0} bx r0 .align 2, 0 .pool 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, =0xfffffbff ands r0, r1 str r0, [r2] @08097308: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x2C ldrb r1, [r0] lsls r1, 25 lsrs r1, 31 lsls r1, 7 ldrb r2, [r5, 0x2] movs r0, 0x7F ands r0, r2 orrs r0, r1 strb r0, [r5, 0x2] ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x2C ldrb r1, [r0] lsrs r1, 7 ands r1, r4 ldrb r2, [r5, 0x3] movs r0, 0x2 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x3] ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x2C ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x2C ldrb r1, [r0] movs r2, 0x80 orrs r1, r2 strb r1, [r0] movs r0, 0 b @0809748E .align 2, 0 .pool @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, =0x02037350 @0809749A: lsls r0, r4, 3 adds r0, r4 lsls r0, 2 adds r1, r0, r5 ldrb r0, [r1] lsls r0, 31 cmp r0, 0 beq @080974B8 ldr r0, =0x02037590 ldrb r0, [r0, 0x5] cmp r4, r0 beq @080974B8 adds r0, r1, 0 bl sub_8097404 @080974B8: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @0809749A pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end player_bitmagic thumb_func_start sub_80974D0 sub_80974D0: ; 80974D0 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 ldr r6, =0x02037350 @080974DA: cmp r4, r5 beq @080974FC lsls r0, r4, 3 adds r0, r4 lsls r0, 2 adds r1, r0, r6 ldrb r0, [r1] lsls r0, 31 cmp r0, 0 beq @080974FC ldr r0, =0x02037590 ldrb r0, [r0, 0x5] cmp r4, r0 beq @080974FC adds r0, r1, 0 bl sub_8097404 @080974FC: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @080974DA pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000101 adds r0, r1, 0 ands r0, r2 cmp r0, r1 bne @0809756C ldrb r1, [r5, 0x1] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r5, 0x1] ldr r4, =0x02020630 ldrb r0, [r5, 0x4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 ldrb r2, [r5, 0x2] adds r1, 0x2C lsrs r2, 7 lsls r2, 6 ldrb r3, [r1] movs r0, 0x41 negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1] ldrb r0, [r5, 0x4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r4 ldrb r1, [r5, 0x3] lsls r1, 31 lsrs r1, 31 adds r2, 0x2C lsls r1, 7 ldrb r3, [r2] movs r0, 0x7F ands r0, r3 orrs r0, r1 strb r0, [r2] @0809756C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end npc_sync_anim_pause_bits thumb_func_start sub_809757C sub_809757C: ; 809757C push {r4,r5,lr} movs r4, 0 ldr r5, =0x02037350 @08097582: lsls r0, r4, 3 adds r0, r4 lsls r0, 2 adds r1, r0, r5 ldrb r0, [r1] lsls r0, 31 cmp r0, 0 beq @08097598 adds r0, r1, 0 bl npc_sync_anim_pause_bits @08097598: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @08097582 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809757C thumb_func_start little_step little_step: ; 80975AC lsls r1, 24 ldr r2, =gUnknown_0850DB7C lsrs r1, 22 adds r1, r2 ldrh r2, [r1] ldrh r3, [r0, 0x20] adds r2, r3 strh r2, [r0, 0x20] ldrh r1, [r1, 0x2] ldrh r2, [r0, 0x22] adds r1, r2 strh r1, [r0, 0x22] bx lr .align 2, 0 .pool thumb_func_end little_step thumb_func_start double_little_steps double_little_steps: ; 80975CC lsls r1, 24 ldr r2, =gUnknown_0850DB7C lsrs r1, 22 adds r1, r2 ldrh r2, [r1] lsls r2, 1 ldrh r3, [r0, 0x20] adds r2, r3 strh r2, [r0, 0x20] ldrh r1, [r1, 0x2] lsls r1, 1 ldrh r2, [r0, 0x22] adds r1, r2 strh r1, [r0, 0x22] bx lr .align 2, 0 .pool thumb_func_end double_little_steps thumb_func_start triple_little_steps triple_little_steps: ; 80975F0 lsls r1, 24 ldr r2, =gUnknown_0850DB7C lsrs r1, 22 adds r1, r2 ldrh r2, [r1] lsls r3, r2, 1 adds r2, r3 ldrh r3, [r0, 0x20] adds r2, r3 strh r2, [r0, 0x20] ldrh r1, [r1, 0x2] lsls r2, r1, 1 adds r1, r2 ldrh r2, [r0, 0x22] adds r1, r2 strh r1, [r0, 0x22] bx lr .align 2, 0 .pool thumb_func_end triple_little_steps thumb_func_start quad_little_steps quad_little_steps: ; 8097618 lsls r1, 24 ldr r2, =gUnknown_0850DB7C lsrs r1, 22 adds r1, r2 ldrh r2, [r1] lsls r2, 2 ldrh r3, [r0, 0x20] adds r2, r3 strh r2, [r0, 0x20] ldrh r1, [r1, 0x2] lsls r1, 2 ldrh r2, [r0, 0x22] adds r1, r2 strh r1, [r0, 0x22] bx lr .align 2, 0 .pool thumb_func_end quad_little_steps thumb_func_start oct_little_steps oct_little_steps: ; 809763C lsls r1, 24 ldr r2, =gUnknown_0850DB7C lsrs r1, 22 adds r1, r2 ldrh r2, [r1] lsls r2, 3 ldrh r3, [r0, 0x20] adds r2, r3 strh r2, [r0, 0x20] ldrh r1, [r1, 0x2] lsls r1, 3 ldrh r2, [r0, 0x22] adds r1, r2 strh r1, [r0, 0x22] bx lr .align 2, 0 .pool 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, =gUnknown_0850E768 movs r0, 0x36 ldrsh r2, [r4, r0] lsls r0, r2, 1 adds r0, r5 movs r3, 0x38 ldrsh r1, [r4, r3] movs r3, 0 ldrsh r0, [r0, r3] cmp r1, r0 bge @080976D4 ldr r1, =gUnknown_0850E754 lsls r0, r2, 2 adds r0, r1 movs r1, 0x38 ldrsh r2, [r4, r1] ldr r0, [r0] lsls r2, 2 adds r2, r0 ldrh r1, [r4, 0x34] lsls r1, 24 lsrs r1, 24 ldr r2, [r2] adds r0, r4, 0 bl _call_via_r2 ldrh r0, [r4, 0x38] adds r0, 0x1 strh r0, [r4, 0x38] movs r2, 0x36 ldrsh r1, [r4, r2] lsls r1, 1 adds r1, r5 lsls r0, 16 asrs r0, 16 movs r3, 0 ldrsh r1, [r1, r3] cmp r0, r1 blt @080976D4 movs r0, 0x1 b @080976D6 .align 2, 0 .pool @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, =gUnknown_0850E7BA lsls r0, 16 asrs r0, 16 adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 bx lr .align 2, 0 .pool thumb_func_end sub_8097728 thumb_func_start sub_809773C sub_809773C: ; 809773C ldr r1, =gUnknown_0850E772 lsls r0, 16 asrs r0, 16 adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 bx lr .align 2, 0 .pool thumb_func_end sub_809773C thumb_func_start sub_8097750 sub_8097750: ; 8097750 movs r1, 0 strh r1, [r0, 0x3A] strh r1, [r0, 0x3C] bx lr thumb_func_end sub_8097750 thumb_func_start sub_8097758 sub_8097758: ; 8097758 push {r4-r6,lr} adds r5, r0, 0 movs r6, 0 movs r1, 0x3C ldrsh r0, [r5, r1] cmp r0, 0x1 beq @0809778E cmp r0, 0x1 bgt @08097770 cmp r0, 0 beq @0809777A b @080977F2 @08097770: cmp r0, 0x2 beq @080977B6 cmp r0, 0x3 beq @080977CA b @080977F2 @0809777A: movs r2, 0x3A ldrsh r0, [r5, r2] bl sub_809773C ldrh r1, [r5, 0x24] adds r0, r1 strh r0, [r5, 0x24] movs r2, 0x3A ldrsh r0, [r5, r2] b @080977E8 @0809778E: ldrh r0, [r5, 0x3A] movs r4, 0x47 subs r0, r4, r0 lsls r0, 16 asrs r0, 16 bl sub_809773C ldrh r1, [r5, 0x24] subs r1, r0 strh r1, [r5, 0x24] ldrh r0, [r5, 0x3A] subs r4, r0 lsls r4, 16 asrs r4, 16 adds r0, r4, 0 bl sub_8097728 ldrh r2, [r5, 0x26] adds r0, r2 b @080977F0 @080977B6: movs r1, 0x3A ldrsh r0, [r5, r1] bl sub_809773C ldrh r1, [r5, 0x24] subs r1, r0 strh r1, [r5, 0x24] movs r2, 0x3A ldrsh r0, [r5, r2] b @080977E8 @080977CA: ldrh r0, [r5, 0x3A] movs r4, 0x47 subs r0, r4, r0 lsls r0, 16 asrs r0, 16 bl sub_809773C ldrh r2, [r5, 0x24] adds r0, r2 strh r0, [r5, 0x24] ldrh r0, [r5, 0x3A] subs r4, r0 lsls r4, 16 asrs r4, 16 adds r0, r4, 0 @080977E8: bl sub_8097728 ldrh r1, [r5, 0x26] adds r0, r1 @080977F0: strh r0, [r5, 0x26] @080977F2: ldrh r0, [r5, 0x3A] adds r0, 0x1 movs r1, 0 strh r0, [r5, 0x3A] lsls r0, 16 asrs r0, 16 cmp r0, 0x48 bne @0809780A strh r1, [r5, 0x3A] ldrh r0, [r5, 0x3C] adds r0, 0x1 strh r0, [r5, 0x3C] @0809780A: movs r2, 0x3C ldrsh r0, [r5, r2] cmp r0, 0x4 bne @08097818 strh r1, [r5, 0x26] strh r1, [r5, 0x24] movs r6, 0x1 @08097818: adds r0, r6, 0 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8097758 thumb_func_start sub_8097820 sub_8097820: ; 8097820 lsls r1, 24 ldr r2, =gUnknown_0850E834 lsrs r1, 22 adds r1, r2 lsls r0, 16 asrs r0, 16 ldr r1, [r1] adds r1, r0 movs r0, 0 ldrsb r0, [r1, r0] bx lr .align 2, 0 .pool thumb_func_end sub_8097820 thumb_func_start sub_809783C sub_809783C: ; 809783C push {r4,lr} lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 movs r4, 0 strh r1, [r0, 0x34] strh r2, [r0, 0x36] strh r3, [r0, 0x38] strh r4, [r0, 0x3A] pop {r4} pop {r0} bx r0 thumb_func_end sub_809783C thumb_func_start sub_809785C sub_809785C: ; 809785C push {r4-r6,lr} sub sp, 0xC adds r4, r0, 0 ldr r1, =gUnknown_0850E840 mov r0, sp movs r2, 0x6 bl memcpy add r5, sp, 0x8 ldr r1, =gUnknown_0850E846 adds r0, r5, 0 movs r2, 0x3 bl memcpy movs r6, 0 movs r1, 0x36 ldrsh r0, [r4, r1] cmp r0, 0 beq @0809788E ldrh r1, [r4, 0x34] lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl little_step @0809788E: movs r2, 0x3A ldrsh r0, [r4, r2] movs r2, 0x36 ldrsh r1, [r4, r2] adds r1, r5, r1 ldrb r1, [r1] asrs r0, r1 ldrh r1, [r4, 0x38] lsls r1, 24 lsrs r1, 24 bl sub_8097820 strh r0, [r4, 0x26] ldrh r1, [r4, 0x3A] adds r1, 0x1 strh r1, [r4, 0x3A] movs r2, 0x36 ldrsh r0, [r4, r2] lsls r0, 1 add r0, sp ldrh r0, [r0] lsls r0, 16 asrs r2, r0, 16 lsls r1, 16 asrs r1, 16 asrs r0, 17 cmp r1, r0 bne @080978C8 movs r6, 0x1 @080978C8: cmp r1, r2 blt @080978D2 movs r0, 0 strh r0, [r4, 0x26] movs r6, 0xFF @080978D2: adds r0, r6, 0 add sp, 0xC pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809785C thumb_func_start sub_80978E4 sub_80978E4: ; 80978E4 push {r4-r6,lr} sub sp, 0xC adds r5, r0, 0 ldr r1, =gUnknown_0850E84A mov r0, sp movs r2, 0x6 bl memcpy add r4, sp, 0x8 ldr r1, =gUnknown_0850E850 adds r0, r4, 0 movs r2, 0x3 bl memcpy movs r6, 0 movs r1, 0x36 ldrsh r0, [r5, r1] cmp r0, 0 beq @08097920 ldrh r1, [r5, 0x3A] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @08097920 ldrh r1, [r5, 0x34] lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 bl little_step @08097920: movs r2, 0x3A ldrsh r0, [r5, r2] movs r2, 0x36 ldrsh r1, [r5, r2] adds r1, r4, r1 ldrb r1, [r1] asrs r0, r1 ldrh r1, [r5, 0x38] lsls r1, 24 lsrs r1, 24 bl sub_8097820 strh r0, [r5, 0x26] ldrh r1, [r5, 0x3A] adds r1, 0x1 strh r1, [r5, 0x3A] movs r2, 0x36 ldrsh r0, [r5, r2] lsls r0, 1 add r0, sp ldrh r0, [r0] lsls r0, 16 asrs r2, r0, 16 lsls r1, 16 asrs r1, 16 asrs r0, 17 cmp r1, r0 bne @0809795A movs r6, 0x1 @0809795A: cmp r1, r2 blt @08097964 movs r0, 0 strh r0, [r5, 0x26] movs r6, 0xFF @08097964: adds r0, r6, 0 add sp, 0xC pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02021bbc adds r0, r1 ldrh r2, [r2] adds r0, r2 lsls r0, 16 lsrs r6, r0, 16 mov r0, r12 ldrh r1, [r0, 0x26] ldrh r2, [r0, 0x22] adds r1, r2 subs r3, 0x15 movs r0, 0 ldrsb r0, [r3, r0] ldr r2, =0x02021bbe adds r0, r1 ldrh r2, [r2] adds r0, r2 lsls r0, 16 lsrs r5, r0, 16 adds r2, r3, 0 b @08097A6A .align 2, 0 .pool @08097A3C: mov r0, r12 ldrh r1, [r0, 0x24] ldrh r2, [r0, 0x20] adds r1, r2 mov r3, r12 adds r3, 0x28 movs r0, 0 ldrsb r0, [r3, r0] adds r0, r1 lsls r0, 16 lsrs r6, r0, 16 mov r0, r12 ldrh r1, [r0, 0x26] ldrh r2, [r0, 0x22] adds r1, r2 mov r2, r12 adds r2, 0x29 movs r0, 0 ldrsb r0, [r2, r0] adds r0, r1 lsls r0, 16 lsrs r5, r0, 16 adds r4, r3, 0 @08097A6A: ldrb r0, [r4] lsls r0, 24 asrs r0, 25 subs r0, r6, r0 lsls r0, 16 lsrs r3, r0, 16 ldrb r0, [r2] lsls r0, 24 asrs r0, 25 subs r0, r5, r0 lsls r0, 16 lsrs r2, r0, 16 lsls r0, r6, 16 asrs r0, 16 cmp r0, 0xFF bgt @08097A96 lsls r0, r3, 16 asrs r0, 16 movs r1, 0x10 negs r1, r1 cmp r0, r1 bge @08097AA2 @08097A96: mov r4, r12 adds r4, 0x3E ldrb r0, [r4] movs r1, 0x4 orrs r0, r1 strb r0, [r4] @08097AA2: lsls r0, r5, 16 asrs r0, 16 cmp r0, 0xAF bgt @08097AB6 lsls r0, r2, 16 asrs r0, 16 movs r1, 0x10 negs r1, r1 cmp r0, r1 bge @08097AC2 @08097AB6: mov r0, r12 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @08097AC2: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_80979D4 thumb_func_start sub_8097AC8 sub_8097AC8: ; 8097AC8 push {r4,lr} adds r4, r0, 0 bl sub_8097D68 ldrh r0, [r4, 0x30] lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 movs r2, 0x1 bl 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, =0x02020630 adds r2, r5, r0 adds r0, r2, 0 adds r0, 0x3E ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08097B16 ldr r1, [r2, 0x1C] ldr r0, =sub_8097AC8 cmp r1, r0 bne @08097B16 adds r0, r2, 0 bl 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 .pool thumb_func_end sub_8097AF0 thumb_func_start sub_8097B2C sub_8097B2C: ; 8097B2C push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 movs r3, 0 ldr r6, =0x02020630 movs r4, 0 @08097B38: adds r2, r4, r6 adds r0, r2, 0 adds r0, 0x3E ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08097B68 ldr r1, [r2, 0x1C] ldr r0, =sub_8097AC8 cmp r1, r0 bne @08097B68 ldrh r0, [r2, 0x2E] lsls r0, 24 lsrs r0, 24 cmp r0, r5 bne @08097B68 adds r0, r3, 0 b @08097B72 .align 2, 0 .pool @08097B68: adds r4, 0x44 adds r3, 0x1 cmp r3, 0x3F ble @08097B38 movs r0, 0x40 @08097B72: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8097B2C thumb_func_start sub_8097B78 sub_8097B78: ; 8097B78 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r5, r1, 24 bl sub_8097B2C lsls r0, 24 lsrs r0, 24 cmp r0, 0x40 beq @08097BAA lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 adds r0, r5, 0 bl 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 .pool thumb_func_end sub_8097B78 thumb_func_start sub_8097BB4 sub_8097BB4: ; 8097BB4 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r5, r1, 24 bl sub_8097B2C adds r1, r0, 0 cmp r1, 0x40 beq @08097C3E lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r4, r0, r1 adds r0, r5, 0 bl 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, =0xfffffc00 ands r1, r2 orrs r1, r3 strh r1, [r4, 0x4] ldrb r2, [r0, 0xC] lsls r2, 28 lsrs r2, 24 ldrb r3, [r4, 0x5] movs r1, 0xF ands r1, r3 orrs r1, r2 strb r1, [r4, 0x5] ldr r1, [r0, 0x1C] str r1, [r4, 0xC] ldr r1, [r0, 0x14] cmp r1, 0 bne @08097C20 str r1, [r4, 0x18] adds r0, r4, 0 adds r0, 0x42 strb r1, [r0] b @08097C36 .align 2, 0 .pool @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, =0x02020630 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 .pool @08097C74: ldr r1, =0x02020630 lsls r0, r3, 4 adds r0, r3 lsls r0, 2 adds r0, r1 strh r4, [r0, 0x32] @08097C80: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8097C44 thumb_func_start sub_8097C8C sub_8097C8C: ; 8097C8C push {lr} lsls r0, 24 lsrs r0, 24 bl sub_8097B2C lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x40 bne @08097CA2 movs r0, 0 b @08097CBA @08097CA2: movs r3, 0 ldr r0, =0x02020630 lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r0 movs r2, 0x32 ldrsh r0, [r1, r2] cmp r0, 0x1 bne @08097CB8 movs r3, 0x1 @08097CB8: adds r0, r3, 0 @08097CBA: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8097C8C thumb_func_start sub_8097CC4 sub_8097CC4: ; 8097CC4 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r4, r1, 24 bl sub_8097B2C lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x40 beq @08097CEA ldr r0, =0x02020630 lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r0 movs r0, 0 strh r4, [r1, 0x34] strh r0, [r1, 0x36] @08097CEA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8097CC4 thumb_func_start sub_8097CF4 sub_8097CF4: ; 8097CF4 push {lr} adds r2, r0, 0 movs r1, 0x36 ldrsh r0, [r2, r1] cmp r0, 0 beq @08097D06 cmp r0, 0x1 beq @08097D0E b @08097D2C @08097D06: strh r0, [r2, 0x26] ldrh r0, [r2, 0x36] adds r0, 0x1 strh r0, [r2, 0x36] @08097D0E: ldrh r0, [r2, 0x26] subs r0, 0x8 movs r3, 0 strh r0, [r2, 0x26] lsls r0, 16 asrs r0, 16 movs r1, 0xA0 negs r1, r1 cmp r0, r1 bne @08097D2C strh r3, [r2, 0x26] movs r0, 0x1 strh r0, [r2, 0x32] strh r3, [r2, 0x34] strh r3, [r2, 0x36] @08097D2C: pop {r0} bx r0 thumb_func_end sub_8097CF4 thumb_func_start sub_8097D30 sub_8097D30: ; 8097D30 push {lr} adds r1, r0, 0 movs r2, 0x36 ldrsh r0, [r1, r2] cmp r0, 0 beq @08097D42 cmp r0, 0x1 beq @08097D4C b @08097D5E @08097D42: ldr r0, =0x0000ff60 strh r0, [r1, 0x26] ldrh r0, [r1, 0x36] adds r0, 0x1 strh r0, [r1, 0x36] @08097D4C: ldrh r0, [r1, 0x26] adds r0, 0x8 strh r0, [r1, 0x26] lsls r0, 16 asrs r0, 16 cmp r0, 0 bne @08097D5E strh r0, [r1, 0x34] strh r0, [r1, 0x36] @08097D5E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8097D30 thumb_func_start sub_8097D68 sub_8097D68: ; 8097D68 push {lr} adds r1, r0, 0 movs r2, 0x34 ldrsh r0, [r1, r2] cmp r0, 0x1 beq @08097D84 cmp r0, 0x1 bgt @08097D7E cmp r0, 0 beq @08097D98 b @08097D94 @08097D7E: cmp r0, 0x2 beq @08097D8C b @08097D94 @08097D84: adds r0, r1, 0 bl sub_8097D30 b @08097D98 @08097D8C: adds r0, r1, 0 bl sub_8097CF4 b @08097D98 @08097D94: movs r0, 0 strh r0, [r1, 0x34] @08097D98: pop {r0} bx r0 thumb_func_end sub_8097D68 thumb_func_start sub_8097D9C sub_8097D9C: ; 8097D9C push {lr} lsls r0, 24 lsrs r0, 24 bl sub_8097B2C lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x40 beq @08097DC0 ldr r0, =0x02020630 lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r0 movs r2, 0x34 ldrsh r0, [r1, r2] cmp r0, 0 bne @08097DC8 @08097DC0: movs r0, 0 b @08097DCA .align 2, 0 .pool @08097DC8: movs r0, 0x1 @08097DCA: pop {r1} bx r1 thumb_func_end sub_8097D9C thumb_func_start oe_exec_and_other_stuff oe_exec_and_other_stuff: ; 8097DD0 push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 lsls r4, 24 lsrs r4, 24 ldr r1, =0x02038c08 adds r2, r1, 0x4 adds r3, r1, 0 adds r3, 0x8 bl npc_get_local_id_and_mapnumbers adds r0, r4, 0 bl oe_exec pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038c08 movs r3, 0x20 ldrsh r1, [r4, r3] str r1, [r2] movs r3, 0x22 ldrsh r1, [r4, r3] ldrh r0, [r0, 0xA] lsls r0, 16 asrs r0, 17 adds r1, r0 subs r1, 0x2 str r1, [r2, 0x4] movs r0, 0x97 str r0, [r2, 0x8] movs r0, 0x3 str r0, [r2, 0xC] movs r0, 0x5 bl oe_exec pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375b8 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 .pool @08097E80: movs r2, 0x10 movs r5, 0 movs r1, 0 adds r3, r6, 0 b @08097E90 @08097E8A: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 @08097E90: cmp r1, 0xF bhi @08097EB2 cmp r2, 0x10 bne @08097EA4 ldr r0, [r3] adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @08097EA4 adds r2, r1, 0 @08097EA4: ldr r0, [r3] adds r0, r1 ldrb r0, [r0] ldrb r7, [r4, 0x8] cmp r0, r7 bne @08097E8A movs r5, 0x1 @08097EB2: cmp r5, 0 bne @08097ECE cmp r2, 0x10 beq @08097ECE ldr r0, [r6] adds r0, r2 ldrb r1, [r4, 0x8] strb r1, [r0] ldr r1, [r6] ldrb r0, [r1, 0x10] adds r0, 0x1 strb r0, [r1, 0x10] movs r0, 0x1 @08097ECC: mov r12, r0 @08097ECE: mov r1, r12 cmp r1, 0x1 bne @08097EE0 ldrb r0, [r4, 0x1] movs r1, 0x10 orrs r0, r1 movs r1, 0x2 orrs r0, r1 strb r0, [r4, 0x1] @08097EE0: movs r0, 0x1 mov r7, r8 strh r0, [r7, 0x32] pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8097E50 thumb_func_start sub_8097EF0 sub_8097EF0: ; 8097EF0 push {r4-r7,lr} mov r7, r8 push {r7} adds r6, r0, 0 mov r8, r1 movs r0, 0x1 strh r0, [r1, 0x32] ldr r5, =0x020375b8 ldr r0, [r5] cmp r0, 0 beq @08097F68 movs r7, 0 adds r0, r6, 0 bl sub_8097F78 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x10 beq @08097F28 ldr r0, [r5] adds r0, r1 movs r1, 0 strb r1, [r0] ldr r1, [r5] ldrb r0, [r1, 0x10] subs r0, 0x1 strb r0, [r1, 0x10] movs r7, 0x1 @08097F28: ldr r0, [r5] ldrb r4, [r0, 0x10] cmp r4, 0 bne @08097F36 bl free str r4, [r5] @08097F36: cmp r7, 0x1 bne @08097F68 ldrb r0, [r6, 0x5] bl 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 .pool thumb_func_end sub_8097EF0 thumb_func_start sub_8097F78 sub_8097F78: ; 8097F78 push {lr} movs r2, 0 ldr r1, =0x020375b8 ldr r1, [r1] ldrb r3, [r0, 0x8] @08097F82: adds r0, r1, r2 ldrb r0, [r0] cmp r0, r3 bne @08097F94 adds r0, r2, 0 b @08097FA0 .align 2, 0 .pool @08097F94: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xF bls @08097F82 movs r0, 0x10 @08097FA0: pop {r1} bx r1 thumb_func_end sub_8097F78 thumb_func_start sub_8097FA4 sub_8097FA4: ; 8097FA4 push {r4-r6,lr} adds r6, r0, 0 ldr r0, =sub_8097FE4 movs r1, 0xFF bl AddTask adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 ldr r0, =0x03005e00 adds r4, r0 adds r0, r4, 0 adds r0, 0x8 adds r1, r6, 0 bl sub_806F67C strb r5, [r6, 0x1B] ldr r0, =0x0000ffff strh r0, [r4, 0xE] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8097FA4 thumb_func_start sub_8097FE4 sub_8097FE4: ; 8097FE4 push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e00 adds r4, r1, r0 adds r0, r4, 0 adds r0, 0x8 mov r1, sp bl sub_806F684 ldr r0, [sp] ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r2, r0, r1 ldrh r1, [r4, 0xC] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @08098020 ldrh r0, [r4, 0xE] ldrh r1, [r2, 0x26] adds r0, r1 strh r0, [r2, 0x26] @08098020: ldrh r1, [r4, 0xC] movs r0, 0xF ands r0, r1 cmp r0, 0 bne @08098030 ldrh r0, [r4, 0xE] negs r0, r0 strh r0, [r4, 0xE] @08098030: adds r0, r1, 0x1 strh r0, [r4, 0xC] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8097FE4 thumb_func_start sub_8098044 sub_8098044: ; 8098044 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e00 adds r0, r1 adds r0, 0x8 mov r1, sp bl sub_806F684 adds r0, r4, 0 bl remove_task add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8098044 thumb_func_start sub_8098074 sub_8098074: ; 8098074 push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r5, r1, 24 movs r4, 0 ldr r7, =0x02037350 @08098082: cmp r4, r6 beq @080980A8 cmp r4, r5 beq @080980A8 lsls r0, r4, 3 adds r0, r4 lsls r0, 2 adds r1, r0, r7 ldrb r0, [r1] lsls r0, 31 cmp r0, 0 beq @080980A8 ldr r0, =0x02037590 ldrb r0, [r0, 0x5] cmp r4, r0 beq @080980A8 adds r0, r1, 0 bl sub_8097404 @080980A8: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @08098082 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8098074 thumb_func_start sub_80980C0 sub_80980C0: ; 80980C0 movs r0, 0 strh r0, [r1, 0x26] ldrh r0, [r1, 0x32] adds r0, 0x1 strh r0, [r1, 0x32] movs r0, 0 bx lr thumb_func_end sub_80980C0 thumb_func_start sub_80980D0 sub_80980D0: ; 80980D0 push {lr} adds r2, r1, 0 ldrh r0, [r2, 0x26] subs r0, 0x8 strh r0, [r2, 0x26] lsls r0, 16 asrs r0, 16 movs r1, 0xA0 negs r1, r1 cmp r0, r1 bne @080980EC ldrh r0, [r2, 0x32] adds r0, 0x1 strh r0, [r2, 0x32] @080980EC: movs r0, 0 pop {r1} bx r1 thumb_func_end sub_80980D0 thumb_func_start sub_80980F4 sub_80980F4: ; 80980F4 ldr r0, =0x0000ff60 strh r0, [r1, 0x26] ldrh r0, [r1, 0x32] adds r0, 0x1 strh r0, [r1, 0x32] movs r0, 0 bx lr .align 2, 0 .pool thumb_func_end sub_80980F4 thumb_func_start sub_8098108 sub_8098108: ; 8098108 push {lr} ldrh r0, [r1, 0x26] adds r0, 0x8 strh r0, [r1, 0x26] lsls r0, 16 cmp r0, 0 bne @0809811C ldrh r0, [r1, 0x32] adds r0, 0x1 strh r0, [r1, 0x32] @0809811C: movs r0, 0 pop {r1} bx r1 thumb_func_end sub_8098108 thumb_func_start sub_8098124 sub_8098124: ; 8098124 movs r0, 0x1 bx lr thumb_func_end sub_8098124 thumb_func_start sub_8098128 sub_8098128: ; 8098128 ldr r1, =0x020375bc movs r0, 0 strb r0, [r1] ldr r2, =0x03003014 ldrb r1, [r2] movs r0, 0x2 negs r0, r0 ands r0, r1 movs r1, 0x3 negs r1, r1 ands r0, r1 subs r1, 0x2 ands r0, r1 subs r1, 0x4 ands r0, r1 strb r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_8098128 thumb_func_start sub_8098154 sub_8098154: ; 8098154 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x1 beq @08098188 cmp r0, 0x1 bgt @0809817C cmp r0, 0 beq @08098182 b @080981B0 .align 2, 0 .pool @0809817C: cmp r0, 0x2 beq @08098198 b @080981B0 @08098182: bl sub_81973A4 b @08098190 @08098188: movs r0, 0 movs r1, 0x1 bl sub_81973C4 @08098190: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @080981B0 @08098198: bl sub_8197224 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 beq @080981B0 ldr r1, =0x020375bc movs r0, 0 strb r0, [r1] adds r0, r5, 0 bl remove_task @080981B0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8098154 thumb_func_start task_add_textbox task_add_textbox: ; 80981BC push {lr} ldr r0, =sub_8098154 movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_add_textbox thumb_func_start task_del_textbox task_del_textbox: ; 80981D0 push {lr} ldr r0, =sub_8098154 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @080981E4 bl remove_task @080981E4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_del_textbox thumb_func_start box_related_two__2 box_related_two__2: ; 80981EC push {r4,lr} adds r1, r0, 0 ldr r4, =0x020375bc ldrb r0, [r4] cmp r0, 0 bne @0809820C adds r0, r1, 0 movs r1, 0x1 bl textbox_fdecode_auto_and_task_add movs r0, 0x2 strb r0, [r4] movs r0, 0x1 b @0809820E .align 2, 0 .pool @0809820C: movs r0, 0 @0809820E: pop {r4} pop {r1} bx r1 thumb_func_end box_related_two__2 thumb_func_start sub_8098214 sub_8098214: ; 8098214 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_8196094 adds r1, r0, 0 cmp r1, 0 bne @0809822E ldr r0, =0x020375bc strb r1, [r0] adds r0, r4, 0 bl remove_task @0809822E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8098214 thumb_func_start sub_8098238 sub_8098238: ; 8098238 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x020375bc ldrb r0, [r5] cmp r0, 0 bne @08098270 ldr r0, =0x02021fc4 adds r1, r4, 0 bl ExpandTextCodes ldr r0, =sub_8098214 movs r1, 0 bl AddTask adds r0, r4, 0 bl sub_8196080 movs r0, 0x2 strb r0, [r5] movs r0, 0x1 b @08098272 .align 2, 0 .pool @08098270: movs r0, 0 @08098272: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_8098238 thumb_func_start box_related_two__3 box_related_two__3: ; 8098278 push {lr} adds r1, r0, 0 ldr r2, =0x020375bc ldrb r0, [r2] cmp r0, 0 bne @08098298 movs r0, 0x3 strb r0, [r2] adds r0, r1, 0 movs r1, 0 bl textbox_fdecode_auto_and_task_add movs r0, 0x1 b @0809829A .align 2, 0 .pool @08098298: movs r0, 0 @0809829A: pop {r1} bx r1 thumb_func_end box_related_two__3 thumb_func_start sub_80982A0 sub_80982A0: ; 80982A0 push {lr} ldr r2, =0x020375bc movs r1, 0x3 strb r1, [r2] movs r1, 0x1 bl textbox_fdecode_auto_and_task_add movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80982A0 thumb_func_start sub_80982B8 sub_80982B8: ; 80982B8 push {lr} ldr r1, =0x020375bc ldrb r0, [r1] cmp r0, 0 bne @080982D4 movs r0, 0x2 strb r0, [r1] bl textbox_auto_and_task_add movs r0, 0x1 b @080982D6 .align 2, 0 .pool @080982D4: movs r0, 0 @080982D6: pop {r1} bx r1 thumb_func_end sub_80982B8 thumb_func_start textbox_fdecode_auto_and_task_add textbox_fdecode_auto_and_task_add: ; 80982DC push {r4,lr} adds r2, r0, 0 adds r4, r1, 0 ldr r0, =0x02021fc4 adds r1, r2, 0 bl 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 .pool thumb_func_end textbox_fdecode_auto_and_task_add thumb_func_start textbox_auto_and_task_add textbox_auto_and_task_add: ; 8098304 push {lr} movs r0, 0x1 bl 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, =0x020375bc movs r0, 0 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end textbox_close thumb_func_start textbox_any_visible textbox_any_visible: ; 8098330 ldr r0, =0x020375bc ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end textbox_any_visible thumb_func_start sub_809833C sub_809833C: ; 809833C push {lr} ldr r0, =0x020375bc ldrb r0, [r0] cmp r0, 0 beq @08098350 movs r0, 0 b @08098352 .align 2, 0 .pool @08098350: movs r0, 0x1 @08098352: pop {r1} bx r1 thumb_func_end sub_809833C thumb_func_start sub_8098358 sub_8098358: ; 8098358 push {lr} bl task_del_textbox movs r0, 0 movs r1, 0x1 bl sub_81973FC ldr r1, =0x020375bc movs r0, 0 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8098358 thumb_func_start sub_8098374 sub_8098374: ; 8098374 push {lr} bl task_del_textbox ldr r1, =0x020375bc movs r0, 0 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8098374 thumb_func_start walkrun_is_standing_still walkrun_is_standing_still: ; 8098388 push {lr} ldr r0, =0x02037590 ldrb r0, [r0, 0x3] cmp r0, 0x1 beq @0809839C movs r0, 0x1 b @0809839E .align 2, 0 .pool @0809839C: movs r0, 0 @0809839E: pop {r1} bx r1 thumb_func_end walkrun_is_standing_still thumb_func_start sub_80983A4 sub_80983A4: ; 80983A4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl walkrun_is_standing_still lsls r0, 24 cmp r0, 0 beq @080983BE bl sub_808B864 adds r0, r4, 0 bl remove_task @080983BE: pop {r4} pop {r0} bx r0 thumb_func_end sub_80983A4 thumb_func_start sub_80983C4 sub_80983C4: ; 80983C4 push {lr} ldr r0, =sub_80983A4 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080983E0 bl sub_808BCF4 movs r0, 0x1 b @080983E2 .align 2, 0 .pool @080983E0: movs r0, 0 @080983E2: pop {r1} bx r1 thumb_func_end sub_80983C4 thumb_func_start sub_80983E8 sub_80983E8: ; 80983E8 push {lr} bl player_bitmagic ldr r0, =sub_80983A4 movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80983E8 thumb_func_start sub_8098400 sub_8098400: ; 8098400 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e00 adds r5, r0, r1 movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0 bne @0809842A bl walkrun_is_standing_still lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x1 bne @0809842A bl sub_808B864 strh r4, [r5, 0x8] @0809842A: movs r1, 0xA ldrsh r0, [r5, r1] cmp r0, 0 bne @08098452 ldr r2, =0x02037350 ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r1, r0, r2 ldrb r0, [r1] lsls r0, 30 cmp r0, 0 blt @08098452 adds r0, r1, 0 bl sub_8097404 movs r0, 0x1 strh r0, [r5, 0xA] @08098452: movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0 beq @08098468 movs r1, 0xA ldrsh r0, [r5, r1] cmp r0, 0 beq @08098468 adds r0, r6, 0 bl remove_task @08098468: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8098400 thumb_func_start sub_809847C sub_809847C: ; 809847C push {lr} ldr r0, =sub_8098400 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @08098498 bl sub_808BCF4 movs r0, 0x1 b @0809849A .align 2, 0 .pool @08098498: movs r0, 0 @0809849A: pop {r1} bx r1 thumb_func_end sub_809847C thumb_func_start sub_80984A0 sub_80984A0: ; 80984A0 push {r4,r5,lr} ldr r4, =0x03005df0 ldrb r0, [r4] bl sub_80974D0 ldr r0, =sub_8098400 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r5, r0, 24 ldr r2, =0x02037350 ldrb r1, [r4] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r1, r0, r2 ldrb r0, [r1] lsls r0, 30 cmp r0, 0 blt @080984DE adds r0, r1, 0 bl sub_8097404 ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 movs r0, 0x1 strh r0, [r1, 0xA] @080984DE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80984A0 thumb_func_start sub_80984F4 sub_80984F4: ; 80984F4 push {lr} movs r0, 0xFF movs r1, 0 movs r2, 0 bl 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, =0x02037350 adds r0, r1 bl sub_8093284 bl sub_80D338C bl sub_809757C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80984F4 thumb_func_start sub_8098524 sub_8098524: ; 8098524 push {r4,lr} ldr r4, =0x02037350 ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r1, r0, r4 ldrb r0, [r1] lsls r0, 31 cmp r0, 0 beq @08098542 adds r0, r1, 0 bl 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 .pool thumb_func_end sub_8098524 thumb_func_start sub_8098574 sub_8098574: ; 8098574 push {lr} ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldr r1, =0x020375f4 ldrb r1, [r1] bl npc_reciprocate_look pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8098574 thumb_func_start sub_809859C sub_809859C: ; 809859C push {lr} ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 bl npc_hide_and_trainer_flag_clear_on_tile_x66_at_pos pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809859C thumb_func_start sub_80985BC sub_80985BC: ; 80985BC push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e00 adds r5, r0, r1 ldrb r7, [r5, 0xC] movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0 bne @080985E8 bl walkrun_is_standing_still lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x1 bne @080985E8 bl sub_808B864 strh r4, [r5, 0x8] @080985E8: movs r1, 0xA ldrsh r0, [r5, r1] cmp r0, 0 bne @0809860C ldr r0, =0x02037350 lsls r1, r7, 3 adds r1, r7 lsls r1, 2 adds r1, r0 ldrb r0, [r1] lsls r0, 30 cmp r0, 0 blt @0809860C adds r0, r1, 0 bl sub_8097404 movs r0, 0x1 strh r0, [r5, 0xA] @0809860C: movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0 beq @08098622 movs r1, 0xA ldrsh r0, [r5, r1] cmp r0, 0 beq @08098622 adds r0, r6, 0 bl remove_task @08098622: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80985BC thumb_func_start sub_8098630 sub_8098630: ; 8098630 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r0, 0 bl sub_80B47E0 lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x030060a8 ldrb r0, [r0] cmp r0, 0x2 bne @080986E0 movs r0, 0x1 bl sub_80B47E0 lsls r0, 24 lsrs r0, 24 adds r5, r0, 0 adds r0, r4, 0 adds r1, r5, 0 bl sub_8098074 ldr r7, =sub_80985BC adds r0, r7, 0 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x03005e00 mov r9, r0 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 mov r1, r9 adds r6, r0, r1 strh r4, [r6, 0xC] ldr r2, =0x02037350 mov r8, r2 lsls r0, r4, 3 adds r0, r4 lsls r0, 2 adds r1, r0, r2 ldrb r0, [r1] lsls r0, 30 cmp r0, 0 blt @0809869A adds r0, r1, 0 bl sub_8097404 movs r0, 0x1 strh r0, [r6, 0xA] @0809869A: adds r0, r7, 0 movs r1, 0x51 bl AddTask lsls r0, 24 lsrs r2, r0, 24 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 mov r1, r9 adds r4, r0, r1 strh r5, [r4, 0xC] lsls r0, r5, 3 adds r0, r5 lsls r0, 2 mov r2, r8 adds r1, r0, r2 ldrb r0, [r1] lsls r0, 30 cmp r0, 0 blt @0809871A adds r0, r1, 0 bl sub_8097404 movs r0, 0x1 strh r0, [r4, 0xA] b @0809871A .align 2, 0 .pool @080986E0: adds r0, r4, 0 bl sub_80974D0 ldr r0, =sub_80985BC movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r5, r0, r1 strh r4, [r5, 0xC] ldr r1, =0x02037350 lsls r0, r4, 3 adds r0, r4 lsls r0, 2 adds r1, r0, r1 ldrb r0, [r1] lsls r0, 30 cmp r0, 0 blt @0809871A adds r0, r1, 0 bl sub_8097404 movs r0, 0x1 strh r0, [r5, 0xA] @0809871A: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8098630 thumb_func_start sub_8098734 sub_8098734: ; 8098734 push {lr} ldr r0, =sub_80985BC bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @08098750 bl sub_808BCF4 movs r0, 0x1 b @08098752 .align 2, 0 .pool @08098750: movs r0, 0 @08098752: pop {r1} bx r1 thumb_func_end sub_8098734 thumb_func_start sub_8098758 sub_8098758: ; 8098758 push {lr} lsls r0, 24 lsrs r0, 24 cmp r0, 0x13 bhi @08098770 lsls r0, 3 ldr r1, =gUnknown_0851021C adds r0, r1 b @08098772 .align 2, 0 .pool @08098770: ldr r0, =gUnknown_0851021C @08098772: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8098758 thumb_func_start copy_textbox_border_tile_patterns_to_vram ; void copy_textbox_border_tile_patterns_to_vram(u8 rbox_id, u16 tile_pattern_dest_offset, u8 pal_dest_offset) copy_textbox_border_tile_patterns_to_vram: ; 809877C push {r4,r5,lr} adds r4, r1, 0 adds r5, r2, 0 lsls r0, 24 lsrs r0, 24 lsls r4, 16 lsrs r4, 16 lsls r5, 24 lsrs r5, 24 movs r1, 0 bl Window_GetField lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_08DDD748 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 .pool thumb_func_end copy_textbox_border_tile_patterns_to_vram thumb_func_start box_border_load_tiles_and_pal box_border_load_tiles_and_pal: ; 80987BC push {lr} lsls r0, 24 lsrs r0, 24 lsls r1, 16 lsrs r1, 16 lsls r2, 24 lsrs r2, 24 bl sub_809882C pop {r0} bx r0 thumb_func_end box_border_load_tiles_and_pal thumb_func_start sub_80987D4 sub_80987D4: ; 80987D4 push {r4-r6,lr} mov r6, r8 push {r6} adds r4, r1, 0 adds r6, r2, 0 mov r8, r3 lsls r0, 24 lsrs r0, 24 lsls r4, 24 lsrs r4, 24 lsls r6, 16 lsrs r6, 16 mov r1, r8 lsls r1, 24 lsrs r1, 24 mov r8, r1 movs r1, 0 bl Window_GetField lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_0851021C lsls r4, 3 adds r1, r4, r5 ldr r1, [r1] movs r2, 0x90 lsls r2, 1 adds r3, r6, 0 bl 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 .pool thumb_func_end sub_80987D4 thumb_func_start sub_809882C sub_809882C: ; 809882C push {r4,lr} adds r4, r1, 0 adds r3, r2, 0 lsls r0, 24 lsrs r0, 24 lsls r4, 16 lsrs r4, 16 lsls r3, 24 lsrs r3, 24 ldr r1, =0x03005d90 ldr r1, [r1] ldrb r1, [r1, 0x14] lsrs r1, 3 adds r2, r4, 0 bl sub_80987D4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809882C thumb_func_start sub_8098858 sub_8098858: ; 8098858 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x20 adds r4, r0, 0 adds r5, r1, 0 lsls r4, 24 lsrs r4, 24 lsls r5, 16 lsrs r5, 16 lsls r2, 24 lsrs r2, 24 str r2, [sp, 0xC] adds r0, r4, 0 movs r1, 0 bl 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, =@08098C30 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08098C30: .4byte @08098C44 .4byte @08098C48 .4byte @08098C4C .4byte @08098C50 .4byte @08098C54 @08098C44: movs r0, 0 b @08098C56 @08098C48: movs r0, 0x10 b @08098C56 @08098C4C: movs r0, 0x20 b @08098C56 @08098C50: movs r0, 0x30 b @08098C56 @08098C54: movs r0, 0x40 @08098C56: lsls r0, 1 ldr r1, =gUnknown_0851017C adds r0, r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end stdpal_get thumb_func_start sub_8098C64 sub_8098C64: ; 8098C64 ldr r0, =gUnknown_08DDD728 bx lr .align 2, 0 .pool thumb_func_end sub_8098C64 thumb_func_start sub_8098C6C sub_8098C6C: ; 8098C6C push {r4,r5,lr} adds r3, r1, 0 adds r4, r2, 0 lsls r0, 24 lsrs r0, 24 lsls r3, 16 lsrs r3, 16 lsls r4, 24 lsrs r4, 24 ldr r2, =gUnknown_0851021C ldr r5, =0x03005d90 ldr r1, [r5] ldrb r1, [r1, 0x14] lsrs r1, 3 lsls r1, 3 adds r1, r2 ldr r1, [r1] movs r2, 0x90 lsls r2, 1 bl 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 .pool thumb_func_end sub_8098C6C thumb_func_start script_env_init ; void script_env_init(script_env *env, int a2, int a3) script_env_init: ; 8098CB8 push {lr} adds r3, r0, 0 movs r0, 0 strb r0, [r3, 0x1] str r0, [r3, 0x8] strb r0, [r3] str r0, [r3, 0x4] str r1, [r3, 0x5C] str r2, [r3, 0x60] movs r2, 0 movs r1, 0x3 adds r0, r3, 0 adds r0, 0x70 @08098CD2: str r2, [r0] subs r0, 0x4 subs r1, 0x1 cmp r1, 0 bge @08098CD2 adds r1, r3, 0 adds r1, 0xC movs r2, 0 adds r0, r3, 0 adds r0, 0x58 @08098CE6: str r2, [r0] subs r0, 0x4 cmp r0, r1 bge @08098CE6 pop {r0} bx r0 thumb_func_end script_env_init thumb_func_start script_setup_bytecode_script ; int script_setup_bytecode_script(script_env *env, void *script_ptr) script_setup_bytecode_script: ; 8098CF4 str r1, [r0, 0x8] movs r1, 0x1 strb r1, [r0, 0x1] movs r0, 0x1 bx lr thumb_func_end script_setup_bytecode_script thumb_func_start script_setup_asm_script script_setup_asm_script: ; 8098D00 movs r2, 0x2 strb r2, [r0, 0x1] str r1, [r0, 0x4] bx lr thumb_func_end script_setup_asm_script thumb_func_start script_stop ; void script_stop(script_env *env) script_stop: ; 8098D08 movs r1, 0 strb r1, [r0, 0x1] str r1, [r0, 0x8] bx lr thumb_func_end script_stop thumb_func_start script_main_handler ; int script_main_handler(script_env *env) script_main_handler: ; 8098D10 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4, 0x1] cmp r0, 0 bne @08098D1E @08098D1A: movs r0, 0 b @08098D90 @08098D1E: ldrb r0, [r4, 0x1] cmp r0, 0x1 beq @08098D56 cmp r0, 0x1 bgt @08098D2E cmp r0, 0 beq @08098D1A b @08098D8E @08098D2E: cmp r0, 0x2 bne @08098D8E ldr r0, [r4, 0x4] cmp r0, 0 beq @08098D52 bl _call_via_r0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08098D8E strb r0, [r4, 0x1] b @08098D8E @08098D48: strb r2, [r4, 0x1] b @08098D1A @08098D4C: movs r0, 0 strb r0, [r4, 0x1] b @08098D90 @08098D52: movs r0, 0x1 strb r0, [r4, 0x1] @08098D56: ldr r2, [r4, 0x8] cmp r2, 0 beq @08098D48 ldr r0, =gUnknown_085102BC ldr r0, [r0] cmp r2, r0 bne @08098D6C @08098D64: swi 0x2 b @08098D64 .align 2, 0 .pool @08098D6C: ldrb r1, [r2] adds r0, r2, 0x1 str r0, [r4, 0x8] lsls r1, 2 ldr r0, [r4, 0x5C] adds r1, r0, r1 ldr r0, [r4, 0x60] cmp r1, r0 bcs @08098D4C ldr r1, [r1] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08098D56 @08098D8E: movs r0, 0x1 @08098D90: pop {r4} pop {r1} bx r1 thumb_func_end script_main_handler thumb_func_start script_stack_push ; int script_stack_push(script_env *env, int value) script_stack_push: ; 8098D98 push {lr} adds r2, r0, 0 adds r3, r1, 0 ldrb r1, [r2] adds r0, r1, 0x1 cmp r0, 0x13 bgt @08098DBA lsls r0, r1, 2 adds r1, r2, 0 adds r1, 0xC adds r1, r0 str r3, [r1] ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] movs r0, 0 b @08098DBC @08098DBA: movs r0, 0x1 @08098DBC: pop {r1} bx r1 thumb_func_end script_stack_push thumb_func_start script_stack_pop ; int script_stack_pop(script_env *env) script_stack_pop: ; 8098DC0 push {lr} adds r2, r0, 0 ldrb r0, [r2] cmp r0, 0 beq @08098DDC subs r0, 0x1 strb r0, [r2] ldrb r1, [r2] lsls r1, 2 adds r0, r2, 0 adds r0, 0xC adds r0, r1 ldr r0, [r0] b @08098DDE @08098DDC: movs r0, 0 @08098DDE: pop {r1} bx r1 thumb_func_end script_stack_pop thumb_func_start script_jump ; void script_jump(script_env *env, int address) script_jump: ; 8098DE4 str r1, [r0, 0x8] bx lr thumb_func_end script_jump thumb_func_start script_call ; void script_call(script_env *env, int address) script_call: ; 8098DE8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldr r1, [r4, 0x8] bl script_stack_push str r5, [r4, 0x8] pop {r4,r5} pop {r0} bx r0 thumb_func_end script_call thumb_func_start script_return ; void script_return(script_env *env) script_return: ; 8098DFC push {r4,lr} adds r4, r0, 0 bl script_stack_pop str r0, [r4, 0x8] pop {r4} pop {r0} bx r0 thumb_func_end script_return thumb_func_start script_read_halfword ; int script_read_halfword(script_env *env) script_read_halfword: ; 8098E0C adds r3, r0, 0 ldr r2, [r3, 0x8] ldrb r0, [r2] adds r2, 0x1 str r2, [r3, 0x8] ldrb r1, [r2] lsls r1, 8 orrs r0, r1 adds r2, 0x1 str r2, [r3, 0x8] bx lr thumb_func_end script_read_halfword thumb_func_start script_read_word ; int script_read_word(script_env *env) script_read_word: ; 8098E24 push {r4-r6,lr} adds r3, r0, 0 ldr r0, [r3, 0x8] ldrb r6, [r0] adds r0, 0x1 str r0, [r3, 0x8] ldrb r5, [r0] adds r2, r0, 0x1 str r2, [r3, 0x8] ldrb r4, [r0, 0x1] adds r1, r2, 0x1 str r1, [r3, 0x8] ldrb r0, [r2, 0x1] adds r1, 0x1 str r1, [r3, 0x8] lsls r0, 8 adds r0, r4 lsls r0, 8 adds r0, r5 lsls r0, 8 adds r0, r6 pop {r4-r6} pop {r1} bx r1 thumb_func_end script_read_word thumb_func_start script_env_2_enable script_env_2_enable: ; 8098E54 ldr r1, =0x03000f2c movs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end script_env_2_enable thumb_func_start script_env_2_disable script_env_2_disable: ; 8098E60 ldr r1, =0x03000f2c movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end script_env_2_disable thumb_func_start script_env_2_is_enabled ; int script_env_2_is_enabled() script_env_2_is_enabled: ; 8098E6C ldr r0, =0x03000f2c ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end script_env_2_is_enabled thumb_func_start script_env_context_is_running ; int script_env_context_is_running() script_env_context_is_running: ; 8098E78 push {lr} ldr r0, =0x03000e38 ldrb r0, [r0] cmp r0, 0 beq @08098E8C movs r0, 0 b @08098E8E .align 2, 0 .pool @08098E8C: movs r0, 0x1 @08098E8E: pop {r1} bx r1 thumb_func_end script_env_context_is_running thumb_func_start script_env_1_init script_env_1_init: ; 8098E94 push {lr} ldr r0, =0x03000e40 ldr r1, =gEventScriptCommandFunctionTable ldr r2, =gUnknown_081DBA08 bl script_env_init ldr r1, =0x03000e38 movs r0, 0x2 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end script_env_1_init thumb_func_start script_env_2_run_current_script script_env_2_run_current_script: ; 8098EBC push {r4,lr} ldr r4, =0x03000e38 ldrb r0, [r4] cmp r0, 0x2 beq @08098EF0 cmp r0, 0x1 beq @08098EF0 bl script_env_2_enable ldr r0, =0x03000e40 bl script_main_handler lsls r0, 24 cmp r0, 0 beq @08098EE8 movs r0, 0x1 b @08098EF2 .align 2, 0 .pool @08098EE8: movs r0, 0x2 strb r0, [r4] bl script_env_2_disable @08098EF0: movs r0, 0 @08098EF2: pop {r4} pop {r1} bx r1 thumb_func_end script_env_2_run_current_script thumb_func_start script_env_1_execute_new_script script_env_1_execute_new_script: ; 8098EF8 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x03000e40 ldr r1, =gEventScriptCommandFunctionTable ldr r2, =gUnknown_081DBA08 adds r0, r4, 0 bl script_env_init adds r0, r4, 0 adds r1, r5, 0 bl script_setup_bytecode_script bl script_env_2_enable ldr r1, =0x03000e38 movs r0, 0 strb r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end script_env_1_execute_new_script thumb_func_start script_env_2_set_ctx_paused script_env_2_set_ctx_paused: ; 8098F30 ldr r1, =0x03000e38 movs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end script_env_2_set_ctx_paused thumb_func_start script_env_2_enable_and_set_ctx_running script_env_2_enable_and_set_ctx_running: ; 8098F3C push {lr} ldr r1, =0x03000e38 movs r0, 0 strb r0, [r1] bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end script_env_2_enable_and_set_ctx_running thumb_func_start script_env_2_execute_new_script ; void script_env_2_execute_new_script(void *script_ptr) script_env_2_execute_new_script: ; 8098F50 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x03000eb8 ldr r1, =gEventScriptCommandFunctionTable ldr r2, =gUnknown_081DBA08 adds r0, r4, 0 bl script_env_init adds r0, r4, 0 adds r1, r5, 0 bl script_setup_bytecode_script @08098F68: ldr r0, =0x03000eb8 bl script_main_handler lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08098F68 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end script_env_2_execute_new_script thumb_func_start mapheader_get_tagged_pointer mapheader_get_tagged_pointer: ; 8098F88 push {lr} lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x02037318 ldr r2, [r0, 0x8] cmp r2, 0 beq @08098F9C @08098F96: ldrb r0, [r2] cmp r0, 0 bne @08098FA4 @08098F9C: movs r0, 0 b @08098FC2 .align 2, 0 .pool @08098FA4: cmp r0, r1 beq @08098FAC adds r2, 0x5 b @08098F96 @08098FAC: adds r2, 0x1 ldrb r0, [r2] ldrb r1, [r2, 0x1] lsls r1, 8 adds r0, r1 ldrb r1, [r2, 0x2] lsls r1, 16 adds r0, r1 ldrb r1, [r2, 0x3] lsls r1, 24 adds r0, r1 @08098FC2: pop {r1} bx r1 thumb_func_end mapheader_get_tagged_pointer thumb_func_start mapheader_run_script_by_tag mapheader_run_script_by_tag: ; 8098FC8 push {lr} lsls r0, 24 lsrs r0, 24 bl mapheader_get_tagged_pointer cmp r0, 0 beq @08098FDA bl script_env_2_execute_new_script @08098FDA: pop {r0} bx r0 thumb_func_end mapheader_run_script_by_tag thumb_func_start mapheader_get_first_match_from_tagged_ptr_list ; int mapheader_get_first_match_from_tagged_ptr_list(int tag) mapheader_get_first_match_from_tagged_ptr_list: ; 8098FE0 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 bl mapheader_get_tagged_pointer adds r6, r0, 0 cmp r6, 0 beq @08098FFC @08098FF0: ldrb r1, [r6] ldrb r0, [r6, 0x1] lsls r0, 8 orrs r1, r0 cmp r1, 0 bne @08099000 @08098FFC: movs r0, 0 b @0809903A @08099000: adds r6, 0x2 ldrb r5, [r6] ldrb r0, [r6, 0x1] lsls r0, 8 orrs r5, r0 adds r6, 0x2 adds r0, r1, 0 bl 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 ; int mapheader_run_first_tag2_script_list_match() mapheader_run_first_tag2_script_list_match: ; 809907C push {lr} movs r0, 0x2 bl mapheader_get_first_match_from_tagged_ptr_list cmp r0, 0 beq @08099090 bl script_env_1_execute_new_script movs r0, 0x1 b @08099092 @08099090: movs r0, 0 @08099092: pop {r1} bx r1 thumb_func_end mapheader_run_first_tag2_script_list_match thumb_func_start mapheader_run_first_tag4_script_list_match ; void mapheader_run_first_tag4_script_list_match() mapheader_run_first_tag4_script_list_match: ; 8099098 push {lr} movs r0, 0x4 bl mapheader_get_first_match_from_tagged_ptr_list cmp r0, 0 beq @080990A8 bl script_env_2_execute_new_script @080990A8: pop {r0} bx r0 thumb_func_end mapheader_run_first_tag4_script_list_match thumb_func_start sub_80990AC sub_80990AC: ; 80990AC push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000372c adds r0, r1 movs r1, 0xFA lsls r1, 2 bl sub_806F928 lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80990AC thumb_func_start killram killram: ; 80990D0 push {lr} sub sp, 0x4 movs r0, 0 str r0, [sp] ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003728 adds r1, r0 ldr r2, =0x050000fb mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end killram thumb_func_start sub_80990FC sub_80990FC: ; 80990FC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 str r0, [sp] ldr r0, [sp, 0x24] lsls r1, 16 lsrs r1, 16 mov r8, r1 lsls r2, 24 lsrs r2, 24 mov r9, r2 lsls r3, 24 lsrs r7, r3, 24 lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x03005d8c mov r10, r0 ldr r5, [r0] ldr r1, =0x0000372c adds r4, r5, r1 bl killram ldr r0, =0x000003e3 cmp r8, r0 bhi @08099174 movs r0, 0x33 strb r0, [r4] mov r2, r9 strb r2, [r4, 0x1] strb r7, [r4, 0x2] strb r6, [r4, 0x3] ldr r1, =0x00003730 adds r0, r5, r1 ldr r1, [sp] mov r2, r8 bl memcpy bl sub_80990AC mov r2, r10 ldr r1, [r2] ldr r2, =0x00003728 adds r1, r2 str r0, [r1] movs r0, 0x1 b @08099176 .align 2, 0 .pool @08099174: movs r0, 0 @08099176: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80990FC thumb_func_start sub_8099188 sub_8099188: ; 8099188 push {r4-r7,lr} adds r4, r1, 0 lsls r0, 24 lsrs r3, r0, 24 ldr r6, =0x03005d8c ldr r5, [r6] ldr r0, =0x0000372c adds r2, r5, r0 ldr r7, =0x020375c0 movs r0, 0 str r0, [r7] ldrb r0, [r2] cmp r0, 0x33 bne @080991F0 ldrb r1, [r2, 0x1] movs r0, 0x4 ldrsb r0, [r5, r0] cmp r1, r0 bne @080991F0 ldrb r1, [r2, 0x2] movs r0, 0x5 ldrsb r0, [r5, r0] cmp r1, r0 bne @080991F0 ldrb r0, [r2, 0x3] cmp r0, r3 bne @080991F0 bl sub_80990AC ldr r1, [r6] ldr r2, =0x00003728 adds r1, r2 ldr r1, [r1] cmp r0, r1 bne @080991EC str r4, [r7] ldr r1, =0x00003730 adds r0, r5, r1 b @080991F2 .align 2, 0 .pool @080991EC: bl killram @080991F0: adds r0, r4, 0 @080991F2: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_8099188 thumb_func_start sub_80991F8 sub_80991F8: ; 80991F8 push {r4,lr} ldr r4, =0x03005d8c ldr r0, [r4] ldr r2, =0x0000372c adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0x33 bne @0809923C ldrb r0, [r1, 0x1] cmp r0, 0xFF bne @0809923C ldrb r0, [r1, 0x2] cmp r0, 0xFF bne @0809923C ldrb r0, [r1, 0x3] cmp r0, 0xFF bne @0809923C bl sub_80990AC ldr r1, [r4] ldr r2, =0x00003728 adds r1, r2 ldr r1, [r1] cmp r0, r1 bne @0809923C movs r0, 0x1 b @0809923E .align 2, 0 .pool @0809923C: movs r0, 0 @0809923E: pop {r4} pop {r1} bx r1 thumb_func_end sub_80991F8 thumb_func_start sub_8099244 sub_8099244: ; 8099244 push {r4-r6,lr} ldr r6, =0x03005d8c ldr r5, [r6] ldr r0, =0x0000372c adds r4, r5, r0 bl sub_801B27C cmp r0, 0 beq @08099298 ldrb r0, [r4] cmp r0, 0x33 bne @08099298 ldrb r0, [r4, 0x1] cmp r0, 0xFF bne @08099298 ldrb r0, [r4, 0x2] cmp r0, 0xFF bne @08099298 ldrb r0, [r4, 0x3] cmp r0, 0xFF bne @08099298 bl sub_80990AC ldr r1, [r6] ldr r2, =0x00003728 adds r1, r2 ldr r1, [r1] cmp r0, r1 bne @08099294 ldr r1, =0x00003730 adds r0, r5, r1 b @0809929A .align 2, 0 .pool @08099294: bl killram @08099298: movs r0, 0 @0809929A: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_8099244 thumb_func_start sub_80992A0 sub_80992A0: ; 80992A0 push {lr} sub sp, 0x4 adds r2, r0, 0 lsls r1, 16 lsrs r1, 16 ldr r0, =0x000003e3 cmp r1, r0 bls @080992B2 adds r1, r0, 0 @080992B2: movs r0, 0xFF str r0, [sp] adds r0, r2, 0 movs r2, 0xFF movs r3, 0xFF bl sub_80990FC add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80992A0 thumb_func_start s00_nop s00_nop: ; 80992CC movs r0, 0 bx lr thumb_func_end s00_nop thumb_func_start s01_nop s01_nop: ; 80992D0 movs r0, 0 bx lr thumb_func_end s01_nop thumb_func_start s02_end s02_end: ; 80992D4 push {lr} bl script_stop movs r0, 0 pop {r1} bx r1 thumb_func_end s02_end thumb_func_start s24_execute_ASM_2 s24_execute_ASM_2: ; 80992E0 push {r4,lr} adds r4, r0, 0 bl script_read_word adds r1, r0, 0 adds r0, r4, 0 bl script_setup_asm_script movs r0, 0x1 pop {r4} pop {r1} bx r1 thumb_func_end s24_execute_ASM_2 thumb_func_start s25_extended_cmd s25_extended_cmd: ; 80992F8 push {lr} bl script_read_halfword lsls r0, 16 ldr r1, =gUnknown_081DBA64 lsrs r0, 14 adds r0, r1 ldr r0, [r0] bl _call_via_r0 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s25_extended_cmd thumb_func_start s26_extended_cmd_setvar s26_extended_cmd_setvar: ; 8099318 push {r4-r6,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get_pointer adds r6, r0, 0 ldr r4, =gUnknown_081DBA64 adds r0, r5, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 14 adds r0, r4 ldr r0, [r0] bl _call_via_r0 strh r0, [r6] movs r0, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s26_extended_cmd_setvar thumb_func_start s23_execute_ASM s23_execute_ASM: ; 809934C push {lr} bl script_read_word bl _call_via_r0 movs r0, 0 pop {r1} bx r1 thumb_func_end s23_execute_ASM thumb_func_start s27_set_to_waitstate s27_set_to_waitstate: ; 809935C push {lr} bl script_env_2_set_ctx_paused movs r0, 0x1 pop {r1} bx r1 thumb_func_end s27_set_to_waitstate thumb_func_start s05_goto s05_goto: ; 8099368 push {r4,lr} adds r4, r0, 0 bl script_read_word adds r1, r0, 0 adds r0, r4, 0 bl script_jump movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end s05_goto thumb_func_start s03_return s03_return: ; 8099380 push {lr} bl script_return movs r0, 0 pop {r1} bx r1 thumb_func_end s03_return thumb_func_start s04_call s04_call: ; 809938C push {r4,lr} adds r4, r0, 0 bl script_read_word adds r1, r0, 0 adds r0, r4, 0 bl script_call movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end s04_call thumb_func_start s06_if_jump ; int s06_if_jump(script_env *env) s06_if_jump: ; 80993A4 push {r4,r5,lr} adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r4, [r0] adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 bl script_read_word adds r2, r0, 0 ldr r1, =gUnknown_085102C0 lsls r0, r4, 1 adds r0, r4 ldrb r3, [r5, 0x2] adds r0, r3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @080993D2 adds r0, r5, 0 adds r1, r2, 0 bl script_jump @080993D2: movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s06_if_jump thumb_func_start s07_if_call s07_if_call: ; 80993E0 push {r4,r5,lr} adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r4, [r0] adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 bl script_read_word adds r2, r0, 0 ldr r1, =gUnknown_085102C0 lsls r0, r4, 1 adds r0, r4 ldrb r3, [r5, 0x2] adds r0, r3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @0809940E adds r0, r5, 0 adds r1, r2, 0 bl script_call @0809940E: movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s07_if_call thumb_func_start sB8_set_virtual_address ; int sB8_set_virtual_address(script_env *env) sB8_set_virtual_address: ; 809941C push {r4,lr} ldr r4, [r0, 0x8] subs r4, 0x1 bl script_read_word ldr r1, =0x020375c4 subs r0, r4 str r0, [r1] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sB8_set_virtual_address thumb_func_start sB9_virtual_jump ; int sB9_virtual_jump(script_env *env) sB9_virtual_jump: ; 8099438 push {r4,lr} adds r4, r0, 0 bl script_read_word adds r1, r0, 0 ldr r0, =0x020375c4 ldr r0, [r0] subs r1, r0 adds r0, r4, 0 bl script_jump movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sB9_virtual_jump thumb_func_start sBA_virtual_call sBA_virtual_call: ; 809945C push {r4,lr} adds r4, r0, 0 bl script_read_word adds r1, r0, 0 ldr r0, =0x020375c4 ldr r0, [r0] subs r1, r0 adds r0, r4, 0 bl script_call movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sBA_virtual_call thumb_func_start sBB_virtual_if_jump sBB_virtual_if_jump: ; 8099480 push {r4,r5,lr} adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r4, [r0] adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 bl script_read_word ldr r1, =0x020375c4 ldr r1, [r1] subs r2, r0, r1 ldr r1, =gUnknown_085102C0 lsls r0, r4, 1 adds r0, r4 ldrb r3, [r5, 0x2] adds r0, r3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @080994B2 adds r0, r5, 0 adds r1, r2, 0 bl script_jump @080994B2: movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sBB_virtual_if_jump thumb_func_start sBC_virtual_if_call sBC_virtual_if_call: ; 80994C4 push {r4,r5,lr} adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r4, [r0] adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 bl script_read_word ldr r1, =0x020375c4 ldr r1, [r1] subs r2, r0, r1 ldr r1, =gUnknown_085102C0 lsls r0, r4, 1 adds r0, r4 ldrb r3, [r5, 0x2] adds r0, r3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @080994F6 adds r0, r5, 0 adds r1, r2, 0 bl script_call @080994F6: movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sBC_virtual_if_call thumb_func_start s08_jumpstd s08_jumpstd: ; 8099508 push {lr} adds r2, r0, 0 ldr r0, [r2, 0x8] ldrb r1, [r0] adds r0, 0x1 str r0, [r2, 0x8] lsls r1, 2 ldr r0, =gUnknown_081DC2A0 adds r1, r0 ldr r0, =gUnknown_081DC2CC cmp r1, r0 bcs @08099528 ldr r1, [r1] adds r0, r2, 0 bl script_jump @08099528: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s08_jumpstd thumb_func_start s09_callstd s09_callstd: ; 8099538 push {lr} adds r2, r0, 0 ldr r0, [r2, 0x8] ldrb r1, [r0] adds r0, 0x1 str r0, [r2, 0x8] lsls r1, 2 ldr r0, =gUnknown_081DC2A0 adds r1, r0 ldr r0, =gUnknown_081DC2CC cmp r1, r0 bcs @08099558 ldr r1, [r1] adds r0, r2, 0 bl script_call @08099558: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s09_callstd thumb_func_start s0A_jumpstd_if s0A_jumpstd_if: ; 8099568 push {r4,lr} adds r3, r0, 0 ldr r0, [r3, 0x8] ldrb r2, [r0] adds r0, 0x1 str r0, [r3, 0x8] ldrb r4, [r0] adds r0, 0x1 str r0, [r3, 0x8] ldr r1, =gUnknown_085102C0 lsls r0, r2, 1 adds r0, r2 ldrb r2, [r3, 0x2] adds r0, r2 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @080995A0 lsls r0, r4, 2 ldr r1, =gUnknown_081DC2A0 adds r1, r0, r1 ldr r0, =gUnknown_081DC2CC cmp r1, r0 bcs @080995A0 ldr r1, [r1] adds r0, r3, 0 bl script_jump @080995A0: movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s0A_jumpstd_if thumb_func_start s0B_callstd_if s0B_callstd_if: ; 80995B4 push {r4,lr} adds r3, r0, 0 ldr r0, [r3, 0x8] ldrb r2, [r0] adds r0, 0x1 str r0, [r3, 0x8] ldrb r4, [r0] adds r0, 0x1 str r0, [r3, 0x8] ldr r1, =gUnknown_085102C0 lsls r0, r2, 1 adds r0, r2 ldrb r2, [r3, 0x2] adds r0, r2 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @080995EC lsls r0, r4, 2 ldr r1, =gUnknown_081DC2A0 adds r1, r0, r1 ldr r0, =gUnknown_081DC2CC cmp r1, r0 bcs @080995EC ldr r1, [r1] adds r0, r3, 0 bl script_call @080995EC: movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s0B_callstd_if thumb_func_start s0C_restore_execution_after_sCF s0C_restore_execution_after_sCF: ; 8099600 push {lr} ldr r1, =0x020375c0 ldr r1, [r1] bl script_jump movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s0C_restore_execution_after_sCF thumb_func_start s0D_endscript_killram s0D_endscript_killram: ; 8099614 push {r4,lr} adds r4, r0, 0 bl killram adds r0, r4, 0 bl script_stop movs r0, 0x1 pop {r4} pop {r1} bx r1 thumb_func_end s0D_endscript_killram thumb_func_start s0E_set_byte s0E_set_byte: ; 809962C push {lr} ldr r1, [r0, 0x8] ldrb r2, [r1] adds r1, 0x1 str r1, [r0, 0x8] adds r0, r2, 0 bl sub_81538C4 movs r0, 0 pop {r1} bx r1 thumb_func_end s0E_set_byte thumb_func_start s0F_u32_var_to_const ; int s0F_u32_var_to_const(script_env *env) s0F_u32_var_to_const: ; 8099644 push {r4,r5,lr} adds r4, r0, 0 ldr r0, [r4, 0x8] ldrb r5, [r0] adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 bl script_read_word lsls r5, 2 adds r4, 0x64 adds r4, r5 str r0, [r4] movs r0, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end s0F_u32_var_to_const thumb_func_start s12_u32_var_to_ptr ; int s12_u32_var_to_ptr(script_env *env) s12_u32_var_to_ptr: ; 8099668 push {r4,r5,lr} adds r4, r0, 0 ldr r0, [r4, 0x8] ldrb r5, [r0] adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 bl script_read_word lsls r5, 2 adds r4, 0x64 adds r4, r5 ldrb r0, [r0] str r0, [r4] movs r0, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end s12_u32_var_to_ptr thumb_func_start s11_u8_ptr_to_const ; int s11_u8_ptr_to_const(script_env *env) s11_u8_ptr_to_const: ; 809968C push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_word strb r4, [r0] movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end s11_u8_ptr_to_const thumb_func_start s10_u8_var_to_const ; int s10_u8_var_to_const(script_env *env) s10_u8_var_to_const: ; 80996A4 ldr r1, [r0, 0x8] ldrb r3, [r1] adds r1, 0x1 str r1, [r0, 0x8] lsls r3, 2 adds r2, r0, 0 adds r2, 0x64 adds r2, r3 ldrb r3, [r1] str r3, [r2] adds r1, 0x1 str r1, [r0, 0x8] movs r0, 0 bx lr thumb_func_end s10_u8_var_to_const thumb_func_start s13_u8_var_to_ptr ; int s13_u8_var_to_ptr(script_env *env) s13_u8_var_to_ptr: ; 80996C0 push {r4,r5,lr} adds r4, r0, 0 ldr r0, [r4, 0x8] ldrb r5, [r0] adds r0, 0x1 str r0, [r4, 0x8] adds r0, r4, 0 bl script_read_word lsls r5, 2 adds r4, 0x64 adds r4, r5 ldr r1, [r4] strb r1, [r0] movs r0, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end s13_u8_var_to_ptr thumb_func_start s14_u32_var_to_var s14_u32_var_to_var: ; 80996E4 ldr r1, [r0, 0x8] ldrb r3, [r1] adds r1, 0x1 str r1, [r0, 0x8] ldrb r2, [r1] adds r1, 0x1 str r1, [r0, 0x8] lsls r3, 2 adds r0, 0x64 adds r3, r0, r3 lsls r2, 2 adds r0, r2 ldr r0, [r0] str r0, [r3] movs r0, 0 bx lr thumb_func_end s14_u32_var_to_var thumb_func_start s15_u8_ptr_to_ptr s15_u8_ptr_to_ptr: ; 8099704 push {r4,r5,lr} adds r4, r0, 0 bl script_read_word adds r5, r0, 0 adds r0, r4, 0 bl script_read_word ldrb r0, [r0] strb r0, [r5] movs r0, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end s15_u8_ptr_to_ptr thumb_func_start s16_u16_gvar_to_const s16_u16_gvar_to_const: ; 8099720 push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 bl __umodsi3 strh r0, [r5] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s8F_get_random_val thumb_func_start sub_80999A0 sub_80999A0: ; 80999A0 push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl bag_add_item lsls r0, 24 lsrs r0, 24 strh r0, [r5] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80999A0 thumb_func_start sub_80999E4 sub_80999E4: ; 80999E4 push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 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 .pool thumb_func_end sub_80999E4 thumb_func_start sub_8099A28 sub_8099A28: ; 8099A28 push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_80D6800 lsls r0, 24 lsrs r0, 24 strh r0, [r5] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8099A28 thumb_func_start sub_8099A6C sub_8099A6C: ; 8099A6C push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_80D6724 lsls r0, 24 lsrs r0, 24 strh r0, [r5] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8099A6C thumb_func_start s48_get_item_type s48_get_item_type: ; 8099AB0 push {r4,lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 ldr r4, =0x020375f0 bl sub_80D6C68 lsls r0, 24 lsrs r0, 24 strh r0, [r4] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s48_get_item_type thumb_func_start sub_8099ADC sub_8099ADC: ; 8099ADC push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 adds r0, r4, 0 bl sub_80D6D70 lsls r0, 24 lsrs r0, 24 strh r0, [r5] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8099ADC thumb_func_start sub_8099B20 sub_8099B20: ; 8099B20 push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 adds r0, r4, 0 bl sub_80D6D1C lsls r0, 24 lsrs r0, 24 strh r0, [r5] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8099B20 thumb_func_start sub_8099B64 sub_8099B64: ; 8099B64 push {r4,lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get ldr r4, =0x020375f0 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 .pool thumb_func_end sub_8099B64 thumb_func_start sub_8099B90 sub_8099B90: ; 8099B90 push {r4,lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get ldr r4, =0x020375f0 lsls r0, 24 lsrs r0, 24 bl sub_81619DC lsls r0, 24 asrs r0, 24 strh r0, [r4] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8099B90 thumb_func_start sub_8099BBC sub_8099BBC: ; 8099BBC push {r4,lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get ldr r4, =0x020375f0 lsls r0, 24 lsrs r0, 24 bl sub_81619A8 lsls r0, 24 lsrs r0, 24 strh r0, [r4] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8099BBC thumb_func_start sub_8099BE8 sub_8099BE8: ; 8099BE8 push {r4,lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get ldr r4, =0x020375f0 lsls r0, 24 lsrs r0, 24 bl sub_8161918 lsls r0, 24 lsrs r0, 24 strh r0, [r4] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8099BE8 thumb_func_start s29_flag_set ; int s29_flag_set(script_env *env) s29_flag_set: ; 8099C14 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl flag_set movs r0, 0 pop {r1} bx r1 thumb_func_end s29_flag_set thumb_func_start s2A_flag_clear ; int s2A_flag_clear(script_env *env) s2A_flag_clear: ; 8099C28 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl flag_clear movs r0, 0 pop {r1} bx r1 thumb_func_end s2A_flag_clear thumb_func_start s2B_flag_check ; int s2B_flag_check(script_env *env) s2B_flag_check: ; 8099C3C push {r4,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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 ; int sC3_unknown(script_env *env) sC3_unknown: ; 8099C58 push {lr} ldr r1, [r0, 0x8] ldrb r2, [r1] adds r1, 0x1 str r1, [r0, 0x8] adds r0, r2, 0 bl sav12_xor_increment movs r0, 0 pop {r1} bx r1 thumb_func_end sC3_unknown thumb_func_start s9A_unknown ; int s9A_unknown(script_env *env) s9A_unknown: ; 8099C70 push {lr} ldr r1, [r0, 0x8] ldrb r2, [r1] adds r1, 0x1 str r1, [r0, 0x8] adds r0, r2, 0 bl sub_80B009C bl script_env_2_set_ctx_paused movs r0, 0x1 pop {r1} bx r1 thumb_func_end s9A_unknown thumb_func_start s99_unknown ; int s99_unknown(script_env *env) s99_unknown: ; 8099C8C push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08099CC0 movs r0, 0 b @08099CC2 .align 2, 0 .pool @08099CC0: movs r0, 0x1 @08099CC2: pop {r1} bx r1 thumb_func_end sub_8099CA8 thumb_func_start s97_screen_special_effect ; int s97_screen_special_effect(script_env *env) s97_screen_special_effect: ; 8099CC8 push {r4,lr} adds r4, r0, 0 ldr r1, [r4, 0x8] ldrb r0, [r1] adds r1, 0x1 str r1, [r4, 0x8] movs r1, 0 bl fade_screen ldr r1, =sub_8099CA8 adds r0, r4, 0 bl script_setup_asm_script movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s97_screen_special_effect thumb_func_start s98_refade_with_timer ; int s98_refade_with_timer(script_env *env) s98_refade_with_timer: ; 8099CF0 push {r4,lr} adds r4, r0, 0 ldr r2, [r4, 0x8] ldrb r0, [r2] adds r2, 0x1 str r2, [r4, 0x8] ldrb r1, [r2] adds r2, 0x1 str r2, [r4, 0x8] lsls r1, 24 asrs r1, 24 bl fade_screen ldr r1, =sub_8099CA8 adds r0, r4, 0 bl script_setup_asm_script movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s98_refade_with_timer thumb_func_start sub_8099D20 ; int sub_8099D20(script_env *env) sub_8099D20: ; 8099D20 push {r4,r5,lr} adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r4, [r0] adds r0, 0x1 str r0, [r5, 0x8] cmp r4, 0x1 beq @08099D3E cmp r4, 0x1 bgt @08099D3A cmp r4, 0 beq @08099D60 b @08099D3E @08099D3A: cmp r4, 0x2 beq @08099D60 @08099D3E: ldr r0, =0x02037714 ldr r1, =0x02037fe8 ldr r2, =0x04000100 bl CpuSet adds r0, r4, 0 movs r1, 0 bl fade_screen b @08099D72 .align 2, 0 .pool @08099D60: ldr r0, =0x02037fe8 ldr r1, =0x02037714 ldr r2, =0x04000100 bl CpuSet adds r0, r4, 0 movs r1, 0 bl fade_screen @08099D72: ldr r1, =sub_8099CA8 adds r0, r5, 0 bl script_setup_asm_script movs r0, 0x1 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8099D20 thumb_func_start s28_pause_asm s28_pause_asm: ; 8099D94 push {lr} ldr r1, =0x020375c8 ldrh r0, [r1] subs r0, 0x1 strh r0, [r1] lsls r0, 16 cmp r0, 0 beq @08099DAC movs r0, 0 b @08099DAE .align 2, 0 .pool @08099DAC: movs r0, 0x1 @08099DAE: pop {r1} bx r1 thumb_func_end s28_pause_asm thumb_func_start s28_pause ; int s28_pause(script_env *env) s28_pause: ; 8099DB4 push {r4,lr} adds r4, r0, 0 bl script_read_halfword ldr r1, =0x020375c8 strh r0, [r1] ldr r1, =s28_pause_asm adds r0, r4, 0 bl script_setup_asm_script movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s28_pause thumb_func_start s2C_unknown ; int s2C_unknown(script_env *env) s2C_unknown: ; 8099DD8 push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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 ; int s2D_unknown(script_env *env) s2D_unknown: ; 8099E10 push {lr} bl sub_809E7B0 movs r0, 0 pop {r1} bx r1 thumb_func_end s2D_unknown thumb_func_start s2E_unknown ; int s2E_unknown(script_env *env) s2E_unknown: ; 8099E1C push {lr} bl sub_802F588 ldr r2, =0x020375d8 ldr r1, =0x03005cf8 movs r0, 0x2 ldrsb r0, [r1, r0] strh r0, [r2] ldr r2, =0x020375da movs r0, 0x3 ldrsb r0, [r1, r0] strh r0, [r2] ldr r2, =0x020375dc movs r0, 0x4 ldrsb r0, [r1, r0] strh r0, [r2] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s2E_unknown thumb_func_start sA4_set_weather_data ; int sA4_set_weather_data(script_env *env) sA4_set_weather_data: ; 8099E54 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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 ; int sA3_set_standard_weather_data(script_env *env) sA3_set_standard_weather_data: ; 8099E70 push {lr} bl sub_80AEDBC movs r0, 0 pop {r1} bx r1 thumb_func_end sA3_set_standard_weather_data thumb_func_start sub_8099E7C ; int sub_8099E7C(script_env *env) sub_8099E7C: ; 8099E7C push {lr} bl sub_80AEE20 movs r0, 0 pop {r1} bx r1 thumb_func_end sub_8099E7C thumb_func_start sA6_activate_per_step_callback_eg_ash ; int sA6_activate_per_step_callback_eg_ash(script_env *env) sA6_activate_per_step_callback_eg_ash: ; 8099E88 push {lr} ldr r1, [r0, 0x8] ldrb r2, [r1] adds r1, 0x1 str r1, [r0, 0x8] adds r0, r2, 0 bl activate_per_step_callback movs r0, 0 pop {r1} bx r1 thumb_func_end sA6_activate_per_step_callback_eg_ash thumb_func_start sA7_set_new_map_footer ; int sA7_set_new_map_footer(script_env *env) sA7_set_new_map_footer: ; 8099EA0 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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 ; int s39_warp_sfx(script_env *env) s39_warp_sfx: ; 8099EBC push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x4 adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r1, [r0] mov r9, r1 adds r0, 0x1 str r0, [r5, 0x8] ldrb r1, [r0] mov r8, r1 adds r1, r0, 0x1 str r1, [r5, 0x8] ldrb r6, [r0, 0x1] adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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 ; int s3A_warp_new_music(script_env *env) s3A_warp_new_music: ; 8099F44 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x4 adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r1, [r0] mov r9, r1 adds r0, 0x1 str r0, [r5, 0x8] ldrb r1, [r0] mov r8, r1 adds r1, r0, 0x1 str r1, [r5, 0x8] ldrb r6, [r0, 0x1] adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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 ; int s3B_warp_keep_music(script_env *env) s3B_warp_keep_music: ; 8099FCC push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x4 adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r1, [r0] mov r9, r1 adds r0, 0x1 str r0, [r5, 0x8] ldrb r1, [r0] mov r8, r1 adds r1, r0, 0x1 str r1, [r5, 0x8] ldrb r6, [r0, 0x1] adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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 ; int s42_get_map_camera_pos(script_env *env) s42_get_map_camera_pos: ; 809A45C push {r4,r5,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x03005d8c ldr r1, [r2] ldrh r1, [r1] strh r1, [r5] ldr r1, [r2] ldrh r1, [r1, 0x2] strh r1, [r0] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s42_get_map_camera_pos thumb_func_start s43_get_player_party_count s43_get_player_party_count: ; 809A498 push {r4,lr} ldr r4, =0x020375f0 bl calc_player_party_count lsls r0, 24 lsrs r0, 24 strh r0, [r4] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s43_get_player_party_count thumb_func_start s2F_music_play s2F_music_play: ; 809A4B4 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl audio_play movs r0, 0 pop {r1} bx r1 thumb_func_end s2F_music_play thumb_func_start s30_music_check_asm s30_music_check_asm: ; 809A4C8 push {lr} bl mplay_has_finished_maybe lsls r0, 24 cmp r0, 0 beq @0809A4D8 movs r0, 0 b @0809A4DA @0809A4D8: movs r0, 0x1 @0809A4DA: pop {r1} bx r1 thumb_func_end s30_music_check_asm thumb_func_start s30_music_check s30_music_check: ; 809A4E0 push {lr} ldr r1, =s30_music_check_asm bl script_setup_asm_script movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s30_music_check thumb_func_start s31_fanfare_play s31_fanfare_play: ; 809A4F4 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl fanfare_play movs r0, 0 pop {r1} bx r1 thumb_func_end s31_fanfare_play thumb_func_start s32_fanfare_wait_asm s32_fanfare_wait_asm: ; 809A508 push {lr} bl task_is_not_running_overworld_fanfare lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end s32_fanfare_wait_asm thumb_func_start s32_fanfare_wait s32_fanfare_wait: ; 809A518 push {lr} ldr r1, =s32_fanfare_wait_asm bl script_setup_asm_script movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s32_fanfare_wait thumb_func_start s33_play_music ; int s33_play_music(script_env *env) s33_play_music: ; 809A52C push {r4,r5,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r2, r0, 16 adds r5, r2, 0 ldr r0, [r4, 0x8] ldrb r1, [r0] adds r0, 0x1 str r0, [r4, 0x8] cmp r1, 0x1 bne @0809A54C adds r0, r2, 0 bl sav1_set_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, =sub_80A3200 adds r0, r4, 0 bl script_setup_asm_script movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s37_fadeout thumb_func_start s38_fadein s38_fadein: ; 809A5C4 push {lr} ldr r1, [r0, 0x8] ldrb r2, [r1] adds r1, 0x1 str r1, [r0, 0x8] cmp r2, 0 beq @0809A5DC lsls r0, r2, 26 lsrs r0, 24 bl sub_80A3228 b @0809A5E2 @0809A5DC: movs r0, 0x4 bl sub_80A3228 @0809A5E2: movs r0, 0 pop {r1} bx r1 thumb_func_end s38_fadein thumb_func_start s4F_execute_movement s4F_execute_movement: ; 809A5E8 push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl exec_movement ldr r0, =0x020375ca strh r4, [r0] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s4F_execute_movement thumb_func_start s50_execute_movement_remote s50_execute_movement_remote: ; 809A62C push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375ca strh r4, [r0] movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s50_execute_movement_remote thumb_func_start s51a_0806B288 s51a_0806B288: ; 809A670 push {lr} ldr r0, =0x020375ca ldrb r0, [r0] ldr r1, =0x020375ce ldrb r1, [r1] ldr r2, =0x020375cc ldrb r2, [r2] bl sub_80D3340 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s51a_0806B288 thumb_func_start s51_waitmove s51_waitmove: ; 809A698 push {r4,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @0809A6B4 ldr r0, =0x020375ca strh r1, [r0] @0809A6B4: ldr r1, =0x020375cc ldr r0, =0x03005d8c ldr r2, [r0] movs r0, 0x4 ldrsb r0, [r2, r0] strh r0, [r1] ldr r1, =0x020375ce movs r0, 0x5 ldrsb r0, [r2, r0] strh r0, [r1] ldr r1, =s51a_0806B288 adds r0, r4, 0 bl script_setup_asm_script movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s51_waitmove thumb_func_start s52_waitmove_remote s52_waitmove_remote: ; 809A6EC push {r4,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @0809A708 ldr r0, =0x020375ca strh r1, [r0] @0809A708: ldr r0, [r4, 0x8] ldrb r2, [r0] adds r0, 0x1 str r0, [r4, 0x8] ldrb r1, [r0] adds r0, 0x1 str r0, [r4, 0x8] ldr r0, =0x020375cc strh r2, [r0] ldr r0, =0x020375ce strh r1, [r0] ldr r1, =s51a_0806B288 adds r0, r4, 0 bl script_setup_asm_script movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s52_waitmove_remote thumb_func_start s53_hide_sprite s53_hide_sprite: ; 809A740 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005d8c 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 .pool thumb_func_end s53_hide_sprite thumb_func_start s54_hide_sprite_set_coords s54_hide_sprite_set_coords: ; 809A768 push {r4,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl show_sprite movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s55_show_sprite thumb_func_start s56_show_sprite_set_coords s56_show_sprite_set_coords: ; 809A7C0 push {r4,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] lsls r4, 16 asrs r4, 16 lsls r0, 16 asrs r0, 16 str r0, [sp] adds r0, r5, 0 adds r3, r4, 0 bl sub_808EBA8 movs r0, 0 add sp, 0x4 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s57_move_sprites thumb_func_start s63_new_sprite_location_permanent s63_new_sprite_location_permanent: ; 809A858 push {r4-r6,lr} adds r6, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl sub_808F254 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s64_set_sprite_top_left_corner thumb_func_start s58_npc_f1_clear_x20 s58_npc_f1_clear_x20: ; 809A8D8 push {r4,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x02037350 ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r4, r0, r2 ldrb r0, [r4] lsls r0, 31 cmp r0, 0 beq @0809A9CC bl player_get_direction__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 .pool thumb_func_end s5A_face_player thumb_func_start s5B_npc_set_direction s5B_npc_set_direction: ; 809A9DC push {r4,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get ldr r1, [r4, 0x8] ldrb r3, [r1] adds r1, 0x1 str r1, [r4, 0x8] lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl npc_turn_by_local_id_and_map movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s5B_npc_set_direction thumb_func_start s65_set_sprite_behaviour s65_set_sprite_behaviour: ; 809AA10 push {r4,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =sub_80983C4 adds r0, r4, 0 bl script_setup_asm_script movs r0, 0x1 b @0809AAE6 .align 2, 0 .pool @0809AAE4: movs r0, 0 @0809AAE6: pop {r4} pop {r1} bx r1 thumb_func_end sub_809AAC4 thumb_func_start sub_809AAEC sub_809AAEC: ; 809AAEC push {r4,lr} adds r4, r0, 0 bl is_c1_link_related_active cmp r0, 0 beq @0809AAFC movs r0, 0 b @0809AB3A @0809AAFC: ldr r2, =0x02037350 ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] lsls r0, 31 cmp r0, 0 beq @0809AB2C bl sub_80984A0 ldr r1, =sub_809847C adds r0, r4, 0 bl script_setup_asm_script b @0809AB38 .align 2, 0 .pool @0809AB2C: bl sub_80983E8 ldr r1, =sub_80983C4 adds r0, r4, 0 bl script_setup_asm_script @0809AB38: movs r0, 0x1 @0809AB3A: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809AAEC thumb_func_start s6B_release s6B_release: ; 809AB44 push {lr} bl textbox_close movs r0, 0xFF movs r1, 0 movs r2, 0 bl 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, =0x02037350 adds r0, r1 bl sub_8093284 bl sub_80D338C bl sub_809757C movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s6B_release thumb_func_start s6C_release_2 s6C_release_2: ; 809AB7C push {r4,lr} bl textbox_close ldr r4, =0x02037350 ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r1, r0, r4 ldrb r0, [r1] lsls r0, 31 cmp r0, 0 beq @0809AB9E adds r0, r1, 0 bl 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 .pool thumb_func_end s6C_release_2 thumb_func_start s67_execute_box s67_execute_box: ; 809ABD4 push {r4,lr} adds r4, r0, 0 bl script_read_word cmp r0, 0 bne @0809ABE2 ldr r0, [r4, 0x64] @0809ABE2: bl box_related_two__2 movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end s67_execute_box thumb_func_start sub_809ABF0 sub_809ABF0: ; 809ABF0 push {r4,lr} adds r4, r0, 0 bl script_read_word cmp r0, 0 bne @0809ABFE ldr r0, [r4, 0x64] @0809ABFE: bl sub_8098238 movs r0, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_809ABF0 thumb_func_start s9B_unknown s9B_unknown: ; 809AC0C push {r4,lr} adds r4, r0, 0 bl script_read_word adds r3, r0, 0 cmp r3, 0 bne @0809AC1C ldr r3, [r4, 0x64] @0809AC1C: ldr r2, =0x03003014 ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 movs r1, 0x8 orrs r0, r1 strb r0, [r2] adds r0, r3, 0 bl box_related_two__3 movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =sub_809833C bl script_setup_asm_script movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809AC78 thumb_func_start s68_close_box s68_close_box: ; 809AC8C push {lr} bl textbox_close movs r0, 0 pop {r1} bx r1 thumb_func_end s68_close_box thumb_func_start sub_809AC98 sub_809AC98: ; 809AC98 push {lr} ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0809ACB8 movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0809ACB8 movs r0, 0 b @0809ACBA .align 2, 0 .pool @0809ACB8: movs r0, 0x1 @0809ACBA: pop {r1} bx r1 thumb_func_end sub_809AC98 thumb_func_start sub_809ACC0 sub_809ACC0: ; 809ACC0 push {lr} ldr r1, =sub_809AC98 bl script_setup_asm_script movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809ACC0 thumb_func_start s6E_yes_no s6E_yes_no: ; 809ACD4 push {lr} ldr r2, [r0, 0x8] ldrb r3, [r2] adds r2, 0x1 str r2, [r0, 0x8] ldrb r1, [r2] adds r2, 0x1 str r2, [r0, 0x8] adds r0, r3, 0 bl yes_no_box lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809ACF6 movs r0, 0 b @0809ACFC @0809ACF6: bl script_env_2_set_ctx_paused movs r0, 0x1 @0809ACFC: pop {r1} bx r1 thumb_func_end s6E_yes_no thumb_func_start 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, =0x02021fc4 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, =0x03000f30 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, =0x02021fc4 str r4, [sp] movs r1, 0xFF str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x6 adds r3, r6, 0 bl Print ldrb r0, [r5] movs r1, 0x3 bl Window_CopyToVram movs r0, 0 add sp, 0x20 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809AE6C thumb_func_start sub_809AF94 sub_809AF94: ; 809AF94 push {lr} bl sub_809BDB4 movs r0, 0 pop {r1} bx r1 thumb_func_end sub_809AF94 thumb_func_start sBD_virtual_message sBD_virtual_message: ; 809AFA0 push {lr} bl script_read_word ldr r1, =0x020375c4 ldr r1, [r1] subs r0, r1 bl box_related_two__2 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sBD_virtual_message thumb_func_start s7D_load_pokename s7D_load_pokename: ; 809AFBC push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 ldr r1, =gUnknown_085102D4 lsls r4, 2 adds r4, r1 ldr r2, [r4] movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r2, 0 bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s7D_load_pokename thumb_func_start s7E_load_first_pokenames s7E_load_first_pokenames: ; 809AFFC push {r4,lr} ldr r1, [r0, 0x8] ldrb r2, [r1] adds r1, 0x1 str r1, [r0, 0x8] ldr r0, =gUnknown_085102D4 lsls r2, 2 adds r2, r0 ldr r4, [r2] bl sub_8139688 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s7E_load_first_pokenames thumb_func_start s7F_load_pokename_team s7F_load_pokename_team: ; 809B048 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 movs r1, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =gUnknown_085102D4 lsls r4, 2 adds r4, r1 ldr r4, [r4] movs r1, 0x2 adds r2, r4, 0 bl pokemon_getattr adds r0, r4, 0 bl get_end_of_string_ptr_limit_10_chars movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s7F_load_pokename_team thumb_func_start s80_load_item_name s80_load_item_name: ; 809B090 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 ldr r1, =gUnknown_085102D4 lsls r4, 2 adds r4, r1 ldr r1, [r4] bl itemid_get_name movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s80_load_item_name thumb_func_start sub_809B0C4 sub_809B0C4: ; 809B0C4 push {r4-r6,lr} adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r6, [r0] adds r0, 0x1 str r0, [r5, 0x8] adds r0, r5, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =gUnknown_085102D4 lsls r6, 2 adds r6, r0 ldr r1, [r6] adds r0, r4, 0 bl sub_80D6660 movs r0, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809B0C4 thumb_func_start sub_809B114 sub_809B114: ; 809B114 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get adds r1, r0, 0 lsls r1, 16 ldr r0, =gUnknown_085102D4 lsls r4, 2 adds r4, r0 ldr r0, [r4] lsrs r1, 11 ldr r2, =gUnknown_085A5C09 adds r1, r2 bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809B114 thumb_func_start s82_load_item_name s82_load_item_name: ; 809B150 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 ldr r1, =gUnknown_085102D4 lsls r4, 2 adds r4, r1 ldr r2, [r4] movs r1, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 adds r0, r2, 0 bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s82_load_item_name thumb_func_start s83_load_textvar_var s83_load_textvar_var: ; 809B190 push {r4,r5,lr} ldr r1, [r0, 0x8] ldrb r5, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =gUnknown_085102D4 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 .pool thumb_func_end s83_load_textvar_var thumb_func_start s84_load_textvar_std_expression s84_load_textvar_std_expression: ; 809B1D4 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 ldr r1, =gUnknown_085102D4 lsls r4, 2 adds r4, r1 ldr r2, [r4] ldr r1, =gUnknown_0858BAF0 lsrs r0, 14 adds r0, r1 ldr r1, [r0] adds r0, r2, 0 bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s84_load_textvar_std_expression thumb_func_start sub_809B214 sub_809B214: ; 809B214 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get adds r1, r0, 0 ldr r0, =gUnknown_085102D4 lsls r4, 2 adds r4, r0 ldr r0, [r4] lsls r1, 24 lsrs r1, 24 bl sub_818E868 movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809B214 thumb_func_start s85_load_textvar_pointer s85_load_textvar_pointer: ; 809B248 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_word adds r1, r0, 0 ldr r0, =gUnknown_085102D4 lsls r4, 2 adds r4, r0 ldr r0, [r4] bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s85_load_textvar_pointer thumb_func_start sBE_virtual_load_text sBE_virtual_load_text: ; 809B270 push {lr} bl script_read_word adds r1, r0, 0 ldr r0, =0x020375c4 ldr r0, [r0] subs r1, r0 ldr r0, =0x02021fc4 bl ExpandTextCodes movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sBE_virtual_load_text thumb_func_start sBF_virtual_load_textbuffer sBF_virtual_load_textbuffer: ; 809B294 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_word adds r1, r0, 0 ldr r0, =0x020375c4 ldr r0, [r0] subs r1, r0 ldr r0, =gUnknown_085102D4 lsls r4, 2 adds r4, r0 ldr r0, [r4] bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sBF_virtual_load_textbuffer thumb_func_start sC6_load_textvar_box_label sC6_load_textvar_box_label: ; 809B2C8 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get ldr r1, =gUnknown_085102D4 lsls r4, 2 adds r4, r1 ldr r4, [r4] lsls r0, 24 lsrs r0, 24 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sC6_load_textvar_box_label thumb_func_start s79_give_pokemon s79_give_pokemon: ; 809B304 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x8 adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 str r0, [sp] str r2, [sp, 0x4] adds r0, r6, 0 mov r1, r9 adds r2, r5, 0 mov r3, r8 bl sub_80F9244 lsls r0, 24 lsrs r0, 24 strh r0, [r4] movs r0, 0 add sp, 0x8 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s79_give_pokemon thumb_func_start s7A_create_egg s7A_create_egg: ; 809B384 push {r4,lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 ldr r4, =0x020375f0 bl sub_80F92C8 lsls r0, 24 lsrs r0, 24 strh r0, [r4] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s7A_create_egg thumb_func_start s7B_change_pokedata_AP s7B_change_pokedata_AP: ; 809B3B0 push {r4,r5,lr} ldr r1, [r0, 0x8] ldrb r5, [r1] adds r1, 0x1 str r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r5, 0 adds r2, r4, 0 bl sub_80F9400 movs r0, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end s7B_change_pokedata_AP thumb_func_start sub_809B3DC sub_809B3DC: ; 809B3DC push {r4-r7,lr} bl script_read_halfword lsls r0, 16 lsrs r7, r0, 16 ldr r1, =0x020375f0 movs r0, 0x6 strh r0, [r1] movs r6, 0 b @0809B42A .align 2, 0 .pool @0809B3F4: adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @0809B424 adds r0, r4, 0 adds r1, r7, 0 bl pokemon_has_move lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809B424 ldr r0, =0x020375f0 strh r6, [r0] ldr r0, =0x020375e0 strh r5, [r0] b @0809B44A .align 2, 0 .pool @0809B424: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @0809B42A: cmp r6, 0x5 bhi @0809B44A movs r0, 0x64 adds r1, r6, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0 bne @0809B3F4 @0809B44A: movs r0, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809B3DC thumb_func_start s90_add_money ; int s90_add_money(script_env *env) s90_add_money: ; 809B458 push {r4,lr} adds r4, r0, 0 bl script_read_word adds r2, r0, 0 ldr r0, [r4, 0x8] ldrb r1, [r0] adds r0, 0x1 str r0, [r4, 0x8] cmp r1, 0 bne @0809B47E ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 adds r1, r2, 0 bl add_money @0809B47E: movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s90_add_money thumb_func_start s91_subtract_money ; int s91_subtract_money(script_env *env) s91_subtract_money: ; 809B48C push {r4,lr} adds r4, r0, 0 bl script_read_word adds r2, r0, 0 ldr r0, [r4, 0x8] ldrb r1, [r0] adds r0, 0x1 str r0, [r4, 0x8] cmp r1, 0 bne @0809B4B2 ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 adds r1, r2, 0 bl subtract_money @0809B4B2: movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s91_subtract_money thumb_func_start s92_check_money ; int s92_check_money(script_env *env) s92_check_money: ; 809B4C0 push {r4,lr} adds r4, r0, 0 bl script_read_word adds r2, r0, 0 ldr r0, [r4, 0x8] ldrb r1, [r0] adds r0, 0x1 str r0, [r4, 0x8] cmp r1, 0 bne @0809B4EE ldr r4, =0x020375f0 ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 adds r1, r2, 0 bl 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 .pool thumb_func_end s92_check_money thumb_func_start s93_display_money ; int s93_display_money(script_env *env) s93_display_money: ; 809B500 push {r4,r5,lr} ldr r1, [r0, 0x8] ldrb r5, [r1] adds r1, 0x1 str r1, [r0, 0x8] ldrb r4, [r1] adds r2, r1, 0x1 str r2, [r0, 0x8] ldrb r1, [r1, 0x1] adds r2, 0x1 str r2, [r0, 0x8] cmp r1, 0 bne @0809B530 ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 bl 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 .pool thumb_func_end s93_display_money thumb_func_start s94_hide_money s94_hide_money: ; 809B53C push {lr} bl sub_80E5384 movs r0, 0 pop {r1} bx r1 thumb_func_end s94_hide_money thumb_func_start s95_update_money ; int s95_update_money(script_env *env) s95_update_money: ; 809B548 push {lr} ldr r1, [r0, 0x8] adds r1, 0x1 adds r2, r1, 0x1 str r2, [r0, 0x8] ldrb r1, [r1, 0x1] adds r2, 0x1 str r2, [r0, 0x8] cmp r1, 0 bne @0809B56E ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 bl decrypt_money bl sub_80E52D4 @0809B56E: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s95_update_money thumb_func_start sub_809B578 sub_809B578: ; 809B578 push {r4,r5,lr} ldr r1, [r0, 0x8] ldrb r5, [r1] adds r1, 0x1 str r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl 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, =c2_exit_to_overworld_1_continue_scripts_restart_music bl sub_812A540 bl script_env_2_set_ctx_paused movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool 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, =0x020375f0 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 .pool thumb_func_end sub_809B758 thumb_func_start sub_809B784 sub_809B784: ; 809B784 push {lr} bl sub_81B9404 bl script_env_2_set_ctx_paused movs r0, 0x1 pop {r1} bx r1 thumb_func_end sub_809B784 thumb_func_start sub_809B794 sub_809B794: ; 809B794 push {lr} bl sub_80F840C bl script_env_2_set_ctx_paused movs r0, 0x1 pop {r1} bx r1 thumb_func_end sub_809B794 thumb_func_start sub_809B7A4 sub_809B7A4: ; 809B7A4 push {lr} bl sub_80F8484 bl script_env_2_set_ctx_paused movs r0, 0x1 pop {r1} bx r1 thumb_func_end sub_809B7A4 thumb_func_start sub_809B7B4 sub_809B7B4: ; 809B7B4 push {lr} ldr r0, =0x02039f2c ldrb r0, [r0] bl sub_80F84C4 bl script_env_2_set_ctx_paused movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809B7B4 thumb_func_start s9C_execute_HM s9C_execute_HM: ; 809B7CC push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 ldr r1, =0x020375d0 strh r0, [r1] lsls r0, 24 lsrs r0, 24 bl oe_exec movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s9C_execute_HM thumb_func_start s9D_set_HM_animation_data s9D_set_HM_animation_data: ; 809B7F4 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get ldr r1, =0x02038c08 lsls r4, 2 adds r4, r1 lsls r0, 16 asrs r0, 16 str r0, [r4] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s9D_set_HM_animation_data thumb_func_start sub_809B824 sub_809B824: ; 809B824 push {lr} ldr r0, =0x020375d0 ldrb r0, [r0] bl oe_active_list_contains lsls r0, 24 cmp r0, 0 beq @0809B83C movs r0, 0 b @0809B83E .align 2, 0 .pool @0809B83C: movs r0, 0x1 @0809B83E: pop {r1} bx r1 thumb_func_end sub_809B824 thumb_func_start s9E_checkarray_HM_animation s9E_checkarray_HM_animation: ; 809B844 push {r4,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get ldr r1, =0x020375d0 strh r0, [r1] ldr r1, =sub_809B824 adds r0, r4, 0 bl script_setup_asm_script movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end s9E_checkarray_HM_animation thumb_func_start s9F_changeposition_fly s9F_changeposition_fly: ; 809B870 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] strh r0, [r1] movs r0, 0 bx lr .align 2, 0 .pool thumb_func_end sA0_check_gender thumb_func_start sA1_play_cry sA1_play_cry: ; 809B8A4 push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =sub_80A3678 bl script_setup_asm_script movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809B8DC thumb_func_start sA2_setmaptile sA2_setmaptile: ; 809B8F0 push {r4-r7,lr} adds r4, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =sub_809BA0C bl script_setup_asm_script movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809BA24 thumb_func_start sub_809BA38 sub_809BA38: ; 809BA38 push {r4,r5,lr} adds r5, r0, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020375f0 movs r0, 0 b @0809BB4C .align 2, 0 .pool @0809BB48: ldr r1, =0x020375f0 movs r0, 0x1 @0809BB4C: strh r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809BB20 thumb_func_start sub_809BB58 sub_809BB58: ; 809BB58 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 bl sub_8145CCC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809BB80 ldr r1, =0x020375f0 movs r0, 0 b @0809BB84 .align 2, 0 .pool @0809BB80: ldr r1, =0x020375f0 movs r0, 0x1 @0809BB84: strh r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809BB58 thumb_func_start sub_809BB90 sub_809BB90: ; 809BB90 push {lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 24 lsrs r0, 24 bl sub_81A89A0 ldr r1, =0x020375ca strh r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809BB90 thumb_func_start sub_809BBB4 sub_809BBB4: ; 809BBB4 push {lr} bl sub_81A8AF8 movs r0, 0 pop {r1} bx r1 thumb_func_end sub_809BBB4 thumb_func_start 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, =0x03005df0 strb r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809BBE8 thumb_func_start sub_809BBFC sub_809BBFC: ; 809BBFC push {r4,lr} adds r4, r0, 0 bl is_c1_link_related_active cmp r0, 0 beq @0809BC0C movs r0, 0 b @0809BC30 @0809BC0C: ldr r2, =0x02037350 ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0] lsls r0, 31 cmp r0, 0 beq @0809BC2E bl sub_8098630 ldr r1, =sub_8098734 adds r0, r4, 0 bl script_setup_asm_script @0809BC2E: movs r0, 0x1 @0809BC30: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809BBFC thumb_func_start sCD_set_obedient_bit sCD_set_obedient_bit: ; 809BC44 push {lr} sub sp, 0x4 movs r2, 0x1 mov r1, sp strb r2, [r1] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 movs r1, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x50 mov r2, sp bl pokemon_setattr movs r0, 0 add sp, 0x4 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sCD_set_obedient_bit thumb_func_start sCE_check_obedient_bit sCE_check_obedient_bit: ; 809BC7C push {r4,lr} bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 ldr r4, =0x020375f0 movs r1, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x50 movs r2, 0 bl pokemon_getattr strh r0, [r4] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sCE_check_obedient_bit thumb_func_start sCF_execute_RAM_script_DMA sCF_execute_RAM_script_DMA: ; 809BCB4 push {r4,lr} adds r4, r0, 0 bl sub_8099244 adds r2, r0, 0 cmp r2, 0 beq @0809BCD0 ldr r1, =0x020375c0 ldr r0, [r4, 0x8] str r0, [r1] adds r0, r4, 0 adds r1, r2, 0 bl script_jump @0809BCD0: movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sCF_execute_RAM_script_DMA thumb_func_start sD1_warp_v5 sD1_warp_v5: ; 809BCDC push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x4 adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r1, [r0] mov r9, r1 adds r0, 0x1 str r0, [r5, 0x8] ldrb r1, [r0] mov r8, r1 adds r1, r0, 0x1 str r1, [r5, 0x8] ldrb r6, [r0, 0x1] adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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, =0x020244ec adds r0, r1 movs r1, 0x23 mov r2, sp bl pokemon_setattr @0809BDA6: movs r0, 0 add sp, 0x4 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809BD70 thumb_func_start sub_809BDB4 sub_809BDB4: ; 809BDB4 push {r4,lr} ldr r4, =0x03000f30 ldrb r0, [r4] movs r1, 0x1 bl sub_819746C ldrb r0, [r4] bl Window_Remove pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809BDB4 thumb_func_start sub_809BDD0 sub_809BDD0: ; 809BDD0 push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 ldr r1, =gUnknown_085102D4 lsls r4, 2 adds r4, r1 ldr r4, [r4] bl sub_806F07C adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809BDD0 thumb_func_start sub_809BE0C sub_809BE0C: ; 809BE0C push {r4,lr} ldr r1, [r0, 0x8] ldrb r4, [r1] adds r1, 0x1 str r1, [r0, 0x8] bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl var_get lsls r0, 16 lsrs r0, 16 ldr r1, =gUnknown_085102D4 lsls r4, 2 adds r4, r1 ldr r4, [r4] bl sub_806F0B0 adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809BE0C thumb_func_start sub_809BE48 sub_809BE48: ; 809BE48 ldr r1, =0x020375ca strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_809BE48 thumb_func_start sub_809BE54 sub_809BE54: ; 809BE54 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x4 adds r5, r0, 0 ldr r0, [r5, 0x8] ldrb r1, [r0] mov r9, r1 adds r0, 0x1 str r0, [r5, 0x8] ldrb r1, [r0] mov r8, r1 adds r1, r0, 0x1 str r1, [r5, 0x8] ldrb r6, [r0, 0x1] adds r1, 0x1 str r1, [r5, 0x8] adds r0, r5, 0 bl script_read_halfword lsls r0, 16 lsrs r0, 16 bl 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 ; void process_overworld_input(overworld_input_data *input_data, char buttons_new, char buttons_held) process_overworld_input: ; 809BF08 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r4, r0, 0 lsls r1, 16 lsrs r5, r1, 16 lsls r2, 16 lsrs r2, 16 mov r8, r2 ldr r0, =0x02037590 ldrb r6, [r0, 0x3] ldrb r0, [r0, 0x2] mov r9, r0 bl cur_mapdata_block_role_at_player_pos lsls r0, 24 lsrs r0, 24 bl sub_808904C lsls r0, 24 lsrs r7, r0, 24 cmp r6, 0x2 bne @0809BF3C cmp r7, 0 beq @0809BF40 @0809BF3C: cmp r6, 0 bne @0809BFA2 @0809BF40: bl sub_811A138 lsls r0, 16 asrs r0, 16 cmp r0, 0x4 beq @0809BF8C movs r0, 0x8 ands r0, r5 cmp r0, 0 beq @0809BF5C ldrb r0, [r4] movs r1, 0x4 orrs r0, r1 strb r0, [r4] @0809BF5C: movs r0, 0x4 ands r0, r5 cmp r0, 0 beq @0809BF6C ldrb r0, [r4] movs r1, 0x8 orrs r0, r1 strb r0, [r4] @0809BF6C: movs r0, 0x1 ands r0, r5 cmp r0, 0 beq @0809BF7C ldrb r0, [r4] movs r1, 0x1 orrs r0, r1 strb r0, [r4] @0809BF7C: movs r0, 0x2 ands r0, r5 cmp r0, 0 beq @0809BF8C ldrb r0, [r4] movs r1, 0x80 orrs r0, r1 strb r0, [r4] @0809BF8C: movs r0, 0xF0 mov r1, r8 ands r0, r1 cmp r0, 0 beq @0809BFA2 ldrb r0, [r4] movs r1, 0x10 orrs r0, r1 movs r1, 0x20 orrs r0, r1 strb r0, [r4] @0809BFA2: cmp r7, 0 bne @0809BFC8 cmp r6, 0x2 bne @0809BFB8 mov r0, r9 cmp r0, 0x2 bne @0809BFB8 ldrb r0, [r4] movs r1, 0x40 orrs r0, r1 strb r0, [r4] @0809BFB8: cmp r7, 0 bne @0809BFC8 cmp r6, 0x2 bne @0809BFC8 ldrb r0, [r4] movs r1, 0x2 orrs r0, r1 strb r0, [r4] @0809BFC8: movs r0, 0x40 mov r1, r8 ands r0, r1 cmp r0, 0 beq @0809BFDC movs r0, 0x2 b @0809C004 .align 2, 0 .pool @0809BFDC: movs r0, 0x80 mov r1, r8 ands r0, r1 cmp r0, 0 beq @0809BFEA movs r0, 0x1 b @0809C004 @0809BFEA: movs r0, 0x20 mov r1, r8 ands r0, r1 cmp r0, 0 beq @0809BFF8 movs r0, 0x3 b @0809C004 @0809BFF8: movs r0, 0x10 mov r1, r8 ands r0, r1 cmp r0, 0 beq @0809C006 movs r0, 0x4 @0809C004: strb r0, [r4, 0x2] @0809C006: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end process_overworld_input thumb_func_start sub_809C014 ; int sub_809C014(overworld_input_data *input_data) sub_809C014: ; 809C014 push {r4-r6,lr} sub sp, 0x8 adds r5, r0, 0 ldr r0, =0x020375f2 movs r1, 0 strh r1, [r0] ldr r0, =0x03005df0 strb r1, [r0] bl player_get_direction__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 .pool @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, =gUnknown_081F860D cmp r4, r0 beq @0809C244 ldr r0, =gUnknown_081F9553 cmp r4, r0 beq @0809C244 ldr r0, =gUnknown_0823B4BB cmp r4, r0 beq @0809C244 ldr r0, =gUnknown_0823B589 cmp r4, r0 beq @0809C244 ldr r0, =gUnknown_082766A2 cmp r4, r0 beq @0809C244 ldr r0, =gUnknown_082766A6 cmp r4, r0 beq @0809C244 ldr r0, =gUnknown_08271D92 cmp r4, r0 beq @0809C244 movs r0, 0x5 bl audio_play @0809C244: adds r0, r4, 0 bl script_env_1_execute_new_script movs r0, 0x1 @0809C24C: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_08339D64 lsls r2, r6, 3 adds r0, r2, r1 ldr r3, [r0] ldrh r0, [r4] adds r0, r3 lsls r0, 16 lsrs r0, 16 adds r1, 0x4 adds r2, r1 ldr r2, [r2] ldrh r1, [r4, 0x2] adds r1, r2 lsls r1, 16 lsrs r1, 16 @0809C30E: ldrb r2, [r4, 0x4] bl npc_id_by_pos_and_height lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x10 beq @0809C32E ldr r1, =0x02037350 lsls r2, r3, 3 adds r0, r2, r3 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x8] adds r5, r1, 0 cmp r0, 0xFF bne @0809C33C @0809C32E: movs r0, 0 b @0809C36E .align 2, 0 .pool @0809C33C: movs r4, 0 ldr r1, =0x02032308 @0809C340: ldrb r0, [r1] cmp r0, 0x1 bne @0809C34C ldrb r0, [r1, 0x2] cmp r0, r3 beq @0809C32E @0809C34C: adds r1, 0x4 adds r4, 0x1 cmp r4, 0x3 ble @0809C340 ldr r0, =0x03005df0 strb r3, [r0] ldr r1, =0x020375f2 adds r0, r2, r3 lsls r0, 2 adds r0, r5 ldrb r0, [r0, 0x8] strh r0, [r1] ldr r0, =0x020375f4 strh r6, [r0] adds r0, r3, 0 bl npc_get_script_by_npc_id @0809C36E: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 lsls r2, r4, 3 adds r0, r2, r4 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x8] adds r3, r1, 0 cmp r0, 0xFF bne @0809C40C @0809C3B4: adds r0, r6, 0 bl is_tile_x80 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C400 ldr r1, =gUnknown_08339D64 lsls r2, r7, 3 adds r0, r2, r1 ldr r3, [r0] ldrh r0, [r5] adds r0, r3 lsls r0, 16 lsrs r0, 16 adds r1, 0x4 adds r2, r1 ldr r2, [r2] ldrh r1, [r5, 0x2] adds r1, r2 lsls r1, 16 lsrs r1, 16 ldrb r2, [r5, 0x4] bl npc_id_by_pos_and_height lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x10 beq @0809C400 ldr r1, =0x02037350 lsls r2, r4, 3 adds r0, r2, r4 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0x8] adds r3, r1, 0 cmp r0, 0xFF bne @0809C40C @0809C400: movs r0, 0 b @0809C44E .align 2, 0 .pool @0809C40C: ldr r0, =0x03005df0 strb r4, [r0] ldr r1, =0x020375f2 adds r0, r2, r4 lsls r0, 2 adds r0, r3 ldrb r0, [r0, 0x8] strh r0, [r1] ldr r0, =0x020375f4 strh r7, [r0] bl sub_81D6074 cmp r0, 0x1 bne @0809C43C bl sub_81D62AC b @0809C442 .align 2, 0 .pool @0809C43C: adds r0, r4, 0 bl npc_get_script_by_npc_id @0809C442: adds r1, r0, 0 ldr r0, =0x020375f2 ldrb r0, [r0] bl sub_8099188 adds r1, r0, 0 @0809C44E: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037318 ldrh r1, [r0] subs r1, 0x7 lsls r1, 16 lsrs r1, 16 ldrh r2, [r0, 0x2] subs r2, 0x7 lsls r2, 16 lsrs r2, 16 ldrb r3, [r0, 0x4] adds r0, r4, 0 bl sub_809D11C cmp r0, 0 beq @0809C4CC ldr r2, [r0, 0x8] cmp r2, 0 bne @0809C490 ldr r0, =gUnknown_082C8436 b @0809C532 .align 2, 0 .pool @0809C490: ldrb r0, [r0, 0x5] cmp r0, 0x8 bhi @0809C530 lsls r0, 2 ldr r1, =@0809C4A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0809C4A4: .4byte @0809C530 .4byte @0809C4C8 .4byte @0809C4D0 .4byte @0809C4D6 .4byte @0809C4DC .4byte @0809C4E2 .4byte @0809C4E2 .4byte @0809C4E2 .4byte @0809C510 @0809C4C8: cmp r5, 0x2 beq @0809C530 @0809C4CC: movs r0, 0 b @0809C532 @0809C4D0: cmp r5, 0x1 beq @0809C530 b @0809C4CC @0809C4D6: cmp r5, 0x4 beq @0809C530 b @0809C4CC @0809C4DC: cmp r5, 0x3 beq @0809C530 b @0809C4CC @0809C4E2: ldr r1, =0x020375e0 lsrs r0, r2, 16 movs r3, 0xFA lsls r3, 1 adds r0, r3 strh r0, [r1] ldr r0, =0x020375e2 strh r2, [r0] ldrh r0, [r1] bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809C4CC ldr r0, =gUnknown_08271CB7 b @0809C532 .align 2, 0 .pool @0809C510: cmp r5, 0x2 bne @0809C4CC ldr r0, =0x020375e0 strh r2, [r0] bl sub_80E9680 lsls r0, 24 cmp r0, 0 beq @0809C4CC ldr r0, =gUnknown_082759F1 b @0809C532 .align 2, 0 .pool @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, =gUnknown_0827EE0B b @0809C7E4 .align 2, 0 .pool @0809C55C: adds r0, r5, 0 bl IsMetatileComputer lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C574 ldr r0, =gUnknown_08271D92 b @0809C7E4 .align 2, 0 .pool @0809C574: adds r0, r5, 0 bl is_tile_x8B lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C58C ldr r0, =gUnknown_081E615D b @0809C7E4 .align 2, 0 .pool @0809C58C: adds r0, r5, 0 bl is_tile_xEA lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C5A4 ldr r0, =gUnknown_082393F9 b @0809C7E4 .align 2, 0 .pool @0809C5A4: adds r0, r5, 0 bl is_tile_x84 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C5B4 b @0809C6E4 @0809C5B4: adds r0, r5, 0 bl is_tile_x87 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C5CC ldr r0, =gUnknown_082A4BAC b @0809C7E4 .align 2, 0 .pool @0809C5CC: adds r0, r5, 0 bl is_tile_x8C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C5E4 ldr r0, =gUnknown_0826A22A b @0809C7E4 .align 2, 0 .pool @0809C5E4: adds r0, r5, 0 bl is_tile_x85 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C5FC ldr r0, =gUnknown_0827208F b @0809C7E4 .align 2, 0 .pool @0809C5FC: adds r0, r5, 0 bl sub_8089A1C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C614 ldr r0, =gUnknown_08292DE5 b @0809C7E4 .align 2, 0 .pool @0809C614: adds r0, r5, 0 bl sub_8089A30 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C62C ldr r0, =gUnknown_082725CE b @0809C7E4 .align 2, 0 .pool @0809C62C: adds r0, r5, 0 bl sub_8089A44 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C644 ldr r0, =gUnknown_082725D7 b @0809C7E4 .align 2, 0 .pool @0809C644: adds r0, r5, 0 bl sub_8089A58 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C65C ldr r0, =gUnknown_082725E0 b @0809C7E4 .align 2, 0 .pool @0809C65C: adds r0, r5, 0 bl sub_8089A6C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C674 ldr r0, =gUnknown_082725E9 b @0809C7E4 .align 2, 0 .pool @0809C674: adds r0, r5, 0 bl sub_8089A80 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C68C ldr r0, =gUnknown_082725F2 b @0809C7E4 .align 2, 0 .pool @0809C68C: adds r0, r5, 0 bl sub_8089A94 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C6A4 ldr r0, =gUnknown_082725FB b @0809C7E4 .align 2, 0 .pool @0809C6A4: adds r0, r5, 0 bl sub_8089AA8 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C6BC ldr r0, =gUnknown_08272604 b @0809C7E4 .align 2, 0 .pool @0809C6BC: adds r0, r5, 0 adds r1, r4, 0 bl sub_8089AD0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C6D4 ldr r0, =gUnknown_08277B8A b @0809C7E4 .align 2, 0 .pool @0809C6D4: adds r0, r5, 0 adds r1, r4, 0 bl sub_8089AEC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C6EC @0809C6E4: ldr r0, =gUnknown_08277365 b @0809C7E4 .align 2, 0 .pool @0809C6EC: adds r0, r5, 0 bl is_tile_x8F lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C704 ldr r0, =gUnknown_0827381B b @0809C7E4 .align 2, 0 .pool @0809C704: adds r0, r5, 0 bl sub_8089B44 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C71C ldr r0, =gUnknown_082C8393 b @0809C7E4 .align 2, 0 .pool @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, =gUnknown_0823B4BB b @0809C7E4 .align 2, 0 .pool @0809C74C: adds r0, r5, 0 bl sub_808929C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C764 ldr r0, =gUnknown_0823B589 b @0809C7E4 .align 2, 0 .pool @0809C764: adds r0, r5, 0 bl sub_80893DC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C77C ldr r0, =gUnknown_0823B684 b @0809C7E4 .align 2, 0 .pool @0809C77C: adds r0, r5, 0 bl sub_80893F0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C794 ldr r0, =gUnknown_0823B68C b @0809C7E4 .align 2, 0 .pool @0809C794: adds r0, r5, 0 bl sub_80892EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C7A8 bl sub_80EB56C b @0809C7E2 @0809C7A8: adds r0, r5, 0 bl sub_8089364 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C7BC bl sub_80EB9E0 b @0809C7E2 @0809C7BC: adds r0, r5, 0 bl sub_8089350 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C7E2 bl sub_80EBB28 b @0809C7E2 @0809C7D0: adds r0, r5, 0 bl sub_8089300 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C7E2 bl sub_80EB498 @0809C7E2: movs r0, 0 @0809C7E4: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_809C538 thumb_func_start sub_809C7EC sub_809C7EC: ; 809C7EC push {r4,lr} lsls r1, 24 lsrs r4, r1, 24 ldr r0, =0x0000086b 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, =gUnknown_08271EA0 b @0809C862 .align 2, 0 .pool @0809C824: adds r0, r4, 0 bl is_tile_x13_waterfall lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C860 ldr r0, =0x0000086e 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, =gUnknown_08290A49 b @0809C862 .align 2, 0 .pool @0809C858: ldr r0, =gUnknown_08290A83 b @0809C862 .align 2, 0 .pool @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, =0x0000086d 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, =gUnknown_08290B0F bl script_env_1_execute_new_script movs r0, 0x1 b @0809C896 .align 2, 0 .pool @0809C894: movs r0, 0 @0809C896: pop {r1} bx r1 thumb_func_end sub_809C868 thumb_func_start sub_809C89C sub_809C89C: ; 809C89C push {lr} ldr r0, =0x0000086d bl flag_check lsls r0, 24 cmp r0, 0 beq @0809C8D4 ldr r0, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x5 bne @0809C8D4 bl sub_809D1E8 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C8D4 ldr r0, =gUnknown_08290B5A bl script_env_1_execute_new_script movs r0, 0x1 b @0809C8D6 .align 2, 0 .pool @0809C8D4: movs r0, 0 @0809C8D6: pop {r1} bx r1 thumb_func_end sub_809C89C thumb_func_start sub_809C8DC sub_809C8DC: ; 809C8DC push {r4-r6,lr} adds r5, r0, 0 lsls r1, 16 lsrs r4, r1, 16 adds r6, r4, 0 bl mapheader_trigger_activate_at__run_now lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809C92E adds r0, r5, 0 adds r1, r4, 0 bl sub_809CC9C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809C92E adds r0, r4, 0 bl sub_809C96C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809C92E adds r0, r6, 0 bl per_step_scripts lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809C92E bl sub_80B5870 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809C92E movs r0, 0 b @0809C930 @0809C92E: movs r0, 0x1 @0809C930: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_809C8DC thumb_func_start mapheader_trigger_activate_at__run_now mapheader_trigger_activate_at__run_now: ; 809C938 push {r4,lr} ldr r4, =0x02037318 ldrh r1, [r0] subs r1, 0x7 lsls r1, 16 lsrs r1, 16 ldrh r2, [r0, 0x2] subs r2, 0x7 lsls r2, 16 lsrs r2, 16 ldrb r3, [r0, 0x4] adds r0, r4, 0 bl mapheader_trigger_activate_at cmp r0, 0 beq @0809C964 bl script_env_1_execute_new_script movs r0, 0x1 b @0809C966 .align 2, 0 .pool @0809C964: movs r0, 0 @0809C966: pop {r4} pop {r1} bx r1 thumb_func_end mapheader_trigger_activate_at__run_now thumb_func_start sub_809C96C sub_809C96C: ; 809C96C push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl sub_8089918 lsls r0, 24 cmp r0, 0 beq @0809C988 ldr r0, =gUnknown_082A8337 b @0809C996 .align 2, 0 .pool @0809C988: adds r0, r4, 0 bl sub_8089ABC lsls r0, 24 cmp r0, 0 beq @0809C9A4 ldr r0, =gUnknown_08252BE8 @0809C996: bl script_env_1_execute_new_script movs r0, 0x1 b @0809C9EA .align 2, 0 .pool @0809C9A4: adds r0, r4, 0 bl sub_80893C8 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C9B8 bl sub_80FA9D0 b @0809C9E8 @0809C9B8: adds r0, r4, 0 bl sub_80893B4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809C9E8 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl 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, =0x02037590 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0809CAF8 lsls r0, r4, 24 lsrs r0, 24 bl sub_808904C lsls r0, 24 cmp r0, 0 bne @0809CAF8 bl overworld_poison_step lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CA48 ldr r0, =gUnknown_082736BC bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CA48: bl sub_8070BD0 lsls r0, 24 cmp r0, 0 beq @0809CA64 movs r0, 0xD bl sav12_xor_increment ldr r0, =gUnknown_08291FC0 bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CA64: bl sub_813B3B0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CA7C ldr r0, =gUnknown_08273D1F bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CA7C: bl sub_8179A04 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CA94 ldr r0, =gUnknown_08238EAF bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CA94: bl is_tile_that_overrides_player_control cmp r0, 0x1 bne @0809CAA8 ldr r0, =gUnknown_081DF7BA bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CAA8: bl sub_8138120 cmp r0, 0x1 bne @0809CABC ldr r0, =gUnknown_081F49EC bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CABC: bl sub_8138168 cmp r0, 0x1 bne @0809CAD0 ldr r0, =gUnknown_081FA4D6 bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CAD0: bl sub_81381B0 cmp r0, 0x1 bne @0809CAE4 ldr r0, =gUnknown_0821307B bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CAE4: bl sub_81381F8 cmp r0, 0x1 bne @0809CAF8 ldr r0, =gUnknown_08224175 bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CAF8: bl safari_step lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809CB28 movs r0, 0x1 bl sub_8137FC0 cmp r0, 0x1 bne @0809CB1C ldr r0, =gUnknown_0823C050 bl script_env_1_execute_new_script b @0809CB28 .align 2, 0 .pool @0809CB1C: bl sub_8196034 cmp r0, 0 bne @0809CB28 @0809CB24: movs r0, 0 b @0809CB2A @0809CB28: movs r0, 0x1 @0809CB2A: pop {r4} pop {r1} bx r1 thumb_func_end per_step_scripts thumb_func_start sub_809CB30 sub_809CB30: ; 809CB30 push {lr} ldr r0, =0x0000402a movs r1, 0 bl var_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809CB30 thumb_func_start happiness_algorithm_step happiness_algorithm_step: ; 809CB44 push {r4,r5,lr} ldr r0, =0x0000402a 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, =0x020244ec movs r4, 0x5 @0809CB62: adds r0, r5, 0 movs r1, 0x5 bl happiness_algorithm adds r5, 0x64 subs r4, 0x1 cmp r4, 0 bge @0809CB62 @0809CB72: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end happiness_algorithm_step thumb_func_start overworld_poison_timer_set overworld_poison_timer_set: ; 809CB80 push {lr} ldr r0, =0x0000402b movs r1, 0 bl var_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end overworld_poison_timer_set thumb_func_start overworld_poison_step overworld_poison_step: ; 809CB94 push {lr} ldr r0, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x9 beq @0809CBD4 ldr r0, =0x0000402b bl 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 .pool @0809CBD4: movs r0, 0 @0809CBD6: pop {r1} bx r1 thumb_func_end overworld_poison_step thumb_func_start prev_quest_postbuffer_cursor_backup_reset prev_quest_postbuffer_cursor_backup_reset: ; 809CBDC ldr r1, =0x020375d4 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end prev_quest_postbuffer_cursor_backup_reset thumb_func_start is_it_battle_time_3 is_it_battle_time_3: ; 809CBE8 push {r4-r7,lr} lsls r0, 16 lsrs r4, r0, 16 adds r7, r4, 0 ldr r6, =0x020375d4 ldrb r0, [r6] cmp r0, 0x3 bhi @0809CC0C adds r0, 0x1 strb r0, [r6] ldr r0, =0x020375d6 strh r4, [r0] movs r0, 0 b @0809CC30 .align 2, 0 .pool @0809CC0C: ldr r5, =0x020375d6 ldrh r1, [r5] adds r0, r4, 0 bl is_it_battle_time_2 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809CC28 strh r4, [r5] movs r0, 0 b @0809CC30 .align 2, 0 .pool @0809CC28: movs r0, 0 strb r0, [r6] strh r7, [r5] movs r0, 0x1 @0809CC30: pop {r4-r7} pop {r1} bx r1 thumb_func_end is_it_battle_time_3 thumb_func_start mapheader_run_first_tag2_script_list_match_conditionally mapheader_run_first_tag2_script_list_match_conditionally: ; 809CC38 push {r4-r7,lr} mov r7, r8 push {r7} adds r7, r0, 0 adds r4, r1, 0 adds r5, r2, 0 lsls r4, 16 lsrs r4, 16 lsls r5, 24 lsrs r5, 24 ldr r0, =0x02037318 mov r8, r0 adds r1, r7, 0 bl map_warp_check_packed lsls r0, 24 lsrs r6, r0, 24 adds r0, r4, 0 adds r1, r5, 0 bl is_non_stair_warp_tile lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CC90 lsls r0, r6, 24 asrs r4, r0, 24 movs r0, 0x1 negs r0, r0 cmp r4, r0 beq @0809CC90 bl walkrun_find_lowest_active_bit_in_bitfield mov r0, r8 adds r1, r4, 0 adds r2, r7, 0 bl sub_809CEB0 bl sub_80AF734 movs r0, 0x1 b @0809CC92 .align 2, 0 .pool @0809CC90: movs r0, 0 @0809CC92: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end mapheader_run_first_tag2_script_list_match_conditionally thumb_func_start sub_809CC9C sub_809CC9C: ; 809CC9C push {r4-r7,lr} adds r6, r0, 0 lsls r1, 16 lsrs r5, r1, 16 ldr r7, =0x02037318 adds r0, r7, 0 adds r1, r6, 0 bl map_warp_check_packed lsls r0, 24 asrs r4, r0, 24 movs r0, 0x1 negs r0, r0 cmp r4, r0 beq @0809CD8A adds r0, r5, 0 bl is_warp_tile lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CD8A bl walkrun_find_lowest_active_bit_in_bitfield adds r0, r7, 0 adds r1, r4, 0 adds r2, r6, 0 bl sub_809CEB0 lsls r0, r5, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl 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 .pool @0809CCF8: adds r0, r4, 0 bl sub_8089870 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CD0E bl sub_80AF828 movs r0, 0x1 b @0809CD8C @0809CD0E: adds r0, r4, 0 bl is_role_x68 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CD24 bl sub_80AF838 movs r0, 0x1 b @0809CD8C @0809CD24: adds r0, r4, 0 bl 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, =gUnknown_082A8350 bl script_env_1_execute_new_script movs r0, 0x1 b @0809CD8C .align 2, 0 .pool @0809CD6C: adds r0, r4, 0 bl sub_80898C0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CD82 bl sub_80AF87C movs r0, 0x1 b @0809CD8C @0809CD82: bl sub_80AF734 movs r0, 0x1 b @0809CD8C @0809CD8A: movs r0, 0 @0809CD8C: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_809CC9C thumb_func_start is_warp_tile is_warp_tile: ; 809CD94 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl is_tile_x69_2_warp_door lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809CE2A adds r0, r4, 0 bl 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, =0x02037318 ldr r0, [r0, 0x4] ldr r5, [r0, 0x8] b @0809CF0E .align 2, 0 .pool @0809CEE8: bl sub_81D6120 adds r5, r0, 0 b @0809CF0E @0809CEF0: cmp r6, 0x5 bne @0809CF00 lsls r4, 24 lsrs r0, r4, 24 bl sub_81D6134 adds r5, r0, 0 b @0809CF0E @0809CF00: ldr r0, =0x02037318 ldr r0, [r0, 0x4] lsls r2, r4, 24 asrs r1, r2, 21 ldr r0, [r0, 0x8] adds r5, r0, r1 adds r4, r2, 0 @0809CF0E: ldrb r0, [r5, 0x6] cmp r0, 0x7F bne @0809CF20 ldrb r0, [r5, 0x5] bl copy_saved_warp2_bank_and_enter_x_to_warp1 b @0809CF6E .align 2, 0 .pool @0809CF20: movs r0, 0x7 ldrsb r0, [r5, r0] movs r1, 0x6 ldrsb r1, [r5, r1] movs r2, 0x5 ldrsb r2, [r5, r2] bl warp1_set_2 movs r1, 0 ldrsh r0, [r7, r1] movs r2, 0x2 ldrsh r1, [r7, r2] bl sub_8084D5C ldrb r0, [r5, 0x7] ldrb r1, [r5, 0x6] bl get_mapheader_by_bank_and_number ldr r1, [r0, 0x4] ldrb r0, [r5, 0x5] ldr r1, [r1, 0x8] lsls r0, 3 adds r0, r1 ldrb r0, [r0, 0x6] cmp r0, 0x7F bne @0809CF6E asrs r3, r4, 24 lsls r0, r3, 3 adds r0, r1 ldrb r0, [r0, 0x5] ldr r1, =0x03005d8c ldr r2, [r1] movs r1, 0x4 ldrsb r1, [r2, r1] ldrb r2, [r2, 0x5] lsls r2, 24 asrs r2, 24 bl saved_warp2_set @0809CF6E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809CEB0 thumb_func_start map_warp_consider_2_to_inside map_warp_consider_2_to_inside: ; 809CF78 push {r4-r7,lr} adds r5, r0, 0 lsls r1, 16 lsrs r0, r1, 16 adds r7, r0, 0 lsls r2, 24 lsrs r2, 24 cmp r2, 0x2 bne @0809CFFC lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl sub_8089210 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CFB0 ldr r0, =0x02037318 ldr r1, [r0, 0x4] adds r0, r5, 0 bl sub_80E9668 movs r0, 0x1 b @0809CFFE .align 2, 0 .pool @0809CFB0: adds r0, r4, 0 bl is_tile_x69_2_warp_door lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CFFC ldr r6, =0x02037318 adds r0, r6, 0 adds r1, r5, 0 bl map_warp_check_packed lsls r0, 24 asrs r4, r0, 24 movs r0, 0x1 negs r0, r0 cmp r4, r0 beq @0809CFFC adds r0, r7, 0 bl is_warp_tile lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809CFFC bl walkrun_find_lowest_active_bit_in_bitfield adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 bl sub_809CEB0 bl sub_80AF7D0 movs r0, 0x1 b @0809CFFE .align 2, 0 .pool @0809CFFC: movs r0, 0 @0809CFFE: pop {r4-r7} pop {r1} bx r1 thumb_func_end map_warp_consider_2_to_inside thumb_func_start map_warp_check map_warp_check: ; 809D004 push {r4-r6,lr} lsls r1, 16 lsrs r6, r1, 16 lsls r2, 16 lsrs r5, r2, 16 lsls r3, 24 lsrs r4, r3, 24 ldr r0, [r0, 0x4] ldr r1, [r0, 0x8] ldrb r3, [r0, 0x1] movs r2, 0 cmp r2, r3 bge @0809D042 @0809D01E: ldrh r0, [r1] cmp r0, r6 bne @0809D03A ldrh r0, [r1, 0x2] cmp r0, r5 bne @0809D03A ldrb r0, [r1, 0x4] cmp r0, r4 beq @0809D034 cmp r0, 0 bne @0809D03A @0809D034: lsls r0, r2, 24 asrs r0, 24 b @0809D046 @0809D03A: adds r2, 0x1 adds r1, 0x8 cmp r2, r3 blt @0809D01E @0809D042: movs r0, 0x1 negs r0, r0 @0809D046: pop {r4-r6} pop {r1} bx r1 thumb_func_end map_warp_check thumb_func_start trigger_activate trigger_activate: ; 809D04C push {r4,lr} adds r4, r0, 0 cmp r4, 0 beq @0809D082 ldr r1, [r4, 0xC] cmp r1, 0 bne @0809D062 ldrb r0, [r4, 0x6] bl trigger_activate_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, =0x02037318 ldrh r1, [r0] subs r1, 0x7 lsls r1, 16 lsrs r1, 16 ldrh r2, [r0, 0x2] subs r2, 0x7 lsls r2, 16 lsrs r2, 16 ldrb r3, [r0, 0x4] adds r0, r4, 0 bl mapheader_trigger_activate_at pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x5 bne @0809D1A4 lsls r0, r5, 24 lsrs r0, 24 bl sub_80895D0 lsls r0, 24 cmp r0, 0 bne @0809D1A4 ldrh r0, [r4] subs r0, 0x7 lsls r0, 16 lsrs r0, 16 ldrh r1, [r4, 0x2] subs r1, 0x7 lsls r1, 16 lsrs r1, 16 bl sub_8085058 b @0809D1C8 .align 2, 0 .pool @0809D1A4: lsls r0, r5, 24 lsrs r0, 24 bl sub_80895B0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809D1E0 ldrh r0, [r4] subs r0, 0x7 lsls r0, 16 lsrs r0, 16 ldrh r1, [r4, 0x2] subs r1, 0x7 lsls r1, 16 lsrs r1, 16 bl sub_8085078 @0809D1C8: lsls r0, 24 cmp r0, 0 beq @0809D1E0 bl walkrun_find_lowest_active_bit_in_bitfield bl sp13E_warp_to_last_warp movs r0, 0xE9 bl audio_play movs r0, 0x1 b @0809D1E2 @0809D1E0: movs r0, 0 @0809D1E2: pop {r4,r5} pop {r1} bx r1 thumb_func_end dive_warp thumb_func_start sub_809D1E8 sub_809D1E8: ; 809D1E8 push {r4,r5,lr} sub sp, 0x4 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl 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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x5 bne @0809D244 adds r0, r5, 0 bl sub_80895D0 lsls r0, 24 cmp r0, 0 bne @0809D244 mov r0, sp ldrh r0, [r0] subs r0, 0x7 lsls r0, 16 lsrs r0, 16 ldrh r1, [r4] subs r1, 0x7 lsls r1, 16 lsrs r1, 16 bl sub_8085058 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809D274 movs r0, 0x1 b @0809D276 .align 2, 0 .pool @0809D244: adds r0, r5, 0 bl sub_80895B0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809D274 mov r0, sp ldrh r0, [r0] subs r0, 0x7 lsls r0, 16 lsrs r0, 16 ldrh r1, [r4] subs r1, 0x7 lsls r1, 16 lsrs r1, 16 bl sub_8085078 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809D274 movs r0, 0x2 b @0809D276 @0809D274: movs r0, 0 @0809D276: add sp, 0x4 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_809D1E8 thumb_func_start 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, =0x02037318 adds r0, r4, 0 mov r1, sp bl map_warp_check_packed adds r1, r0, 0 lsls r1, 24 asrs r1, 24 adds r0, r4, 0 mov r2, sp bl sub_809CEB0 movs r0, 0 add sp, 0x8 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809D2BC thumb_func_start sub_809D300 sub_809D300: ; 809D300 push {r4,lr} ldr r4, =0x03005d8c ldr r0, [r4] ldr r1, =0x00001270 adds r0, r1 movs r2, 0x96 lsls r2, 1 movs r1, 0 bl memset ldr r0, [r4] ldr r1, =0x0000139c adds r0, r1 movs r2, 0x80 lsls r2, 2 movs r1, 0 bl memset ldr r0, =0x020375fc movs r1, 0 movs r2, 0x10 bl memset pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D300 thumb_func_start sub_809D344 sub_809D344: ; 809D344 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00001270 adds r2, r0, r1 movs r1, 0 str r1, [r2] ldr r1, =0x0000139c adds r0, r1 movs r1, 0 movs r2, 0x20 bl memset ldr r0, =0x000008ad bl flag_clear ldr r0, =0x000008ae bl flag_clear ldr r0, =0x00000889 bl flag_clear ldr r0, =0x000008c1 bl flag_clear movs r0, 0x88 lsls r0, 4 bl flag_clear pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D344 thumb_func_start sub_809D3A0 sub_809D3A0: ; 809D3A0 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00001394 adds r0, r1 movs r1, 0 movs r2, 0x8 bl memset pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D3A0 thumb_func_start sub_809D3C0 sub_809D3C0: ; 809D3C0 push {lr} ldr r0, =0x00004046 bl var_get_pointer ldr r1, =0x03005d90 ldr r2, [r1] movs r1, 0 strb r1, [r2, 0x1A] strh r1, [r0] ldr r0, =0x00000896 bl flag_clear pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D3C0 thumb_func_start sub_809D3E8 sub_809D3E8: ; 809D3E8 push {r4,r5,lr} ldr r0, =0x00004046 bl var_get_pointer ldr r4, =0x03005d90 ldr r2, [r4] movs r5, 0 movs r1, 0xDA strb r1, [r2, 0x1A] ldr r2, =0x00000302 adds r1, r2, 0 strh r1, [r0] ldr r0, =0x00000896 bl 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 .pool thumb_func_end sub_809D3E8 thumb_func_start sub_809D42C sub_809D42C: ; 809D42C push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x1A] cmp r0, 0xDA bne @0809D468 ldr r0, =0x00004046 bl var_get lsls r0, 16 ldr r1, =0x03020000 cmp r0, r1 bne @0809D468 ldr r0, =0x00000896 bl flag_check lsls r0, 24 cmp r0, 0 beq @0809D468 movs r0, 0x1 b @0809D46A .align 2, 0 .pool @0809D468: movs r0, 0 @0809D46A: pop {r1} bx r1 thumb_func_end sub_809D42C thumb_func_start sub_809D470 sub_809D470: ; 809D470 push {lr} ldr r0, =0x000008ac bl flag_clear pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D470 thumb_func_start sub_809D480 sub_809D480: ; 809D480 push {lr} ldr r0, =0x000008ac bl flag_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D480 thumb_func_start sub_809D490 sub_809D490: ; 809D490 push {lr} ldr r0, =0x000008ac bl flag_check lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809D490 thumb_func_start sub_809D4A4 sub_809D4A4: ; 809D4A4 push {lr} ldr r0, =0x000008db bl flag_clear pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D4A4 thumb_func_start sub_809D4B4 sub_809D4B4: ; 809D4B4 push {lr} ldr r0, =0x000008db bl flag_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D4B4 thumb_func_start sub_809D4C4 sub_809D4C4: ; 809D4C4 push {lr} ldr r0, =0x000008db bl flag_check lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x000001e5 bl flag_clear movs r0, 0xF3 lsls r0, 1 bl flag_clear ldr r0, =0x000001e7 bl flag_clear movs r0, 0xF4 lsls r0, 1 bl flag_clear ldr r0, =0x000001e9 bl flag_clear movs r0, 0xF5 lsls r0, 1 bl flag_clear ldr r0, =0x000001eb bl flag_clear movs r0, 0xF6 lsls r0, 1 bl flag_clear ldr r0, =0x000001ed bl flag_clear movs r0, 0xF7 lsls r0, 1 bl flag_clear ldr r0, =0x000001ef bl flag_clear movs r0, 0xF8 lsls r0, 1 bl flag_clear ldr r0, =0x000001f1 bl flag_clear movs r0, 0xF9 lsls r0, 1 bl flag_clear ldr r0, =0x000001f3 bl flag_clear pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D4D8 thumb_func_start sub_809D570 sub_809D570: ; 809D570 push {lr} ldr r0, =0x000040dd movs r1, 0 bl var_set ldr r0, =0x000040de movs r1, 0 bl var_set ldr r0, =0x000040df movs r1, 0 bl var_set ldr r0, =0x000040e0 movs r1, 0 bl var_set ldr r0, =0x000040e1 movs r1, 0 bl var_set ldr r0, =0x000040e2 movs r1, 0 bl var_set ldr r0, =0x000040e3 movs r1, 0 bl var_set ldr r0, =0x000040e4 movs r1, 0 bl var_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D570 thumb_func_start sub_809D5D8 sub_809D5D8: ; 809D5D8 push {lr} ldr r0, =0x0000402c movs r1, 0 bl var_set ldr r0, =0x000008c2 bl flag_clear pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D5D8 thumb_func_start sub_809D5F4 sub_809D5F4: ; 809D5F4 push {lr} ldr r0, =0x0000402c movs r1, 0x92 lsls r1, 4 bl var_set ldr r0, =0x000008c2 bl flag_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D5F4 thumb_func_start sub_809D614 sub_809D614: ; 809D614 push {lr} ldr r0, =0x000008c2 bl flag_check lsls r0, 24 cmp r0, 0 beq @0809D640 ldr r0, =0x0000402c 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 .pool @0809D640: movs r0, 0 @0809D642: pop {r1} bx r1 thumb_func_end sub_809D614 thumb_func_start var_get_pointer ; u16 *var_get_pointer(u16 var_id) var_get_pointer: ; 809D648 push {lr} lsls r0, 16 lsrs r1, r0, 16 adds r2, r1, 0 ldr r0, =0x00003fff cmp r1, r0 bhi @0809D660 movs r0, 0 b @0809D688 .align 2, 0 .pool @0809D660: lsls r0, r1, 16 cmp r0, 0 bge @0809D67C ldr r0, =gUnknown_081DBA0C ldr r2, =0xffff8000 adds r1, r2 lsls r1, 2 adds r1, r0 ldr r0, [r1] b @0809D688 .align 2, 0 .pool @0809D67C: ldr r0, =0x03005d8c lsls r1, r2, 1 ldr r2, =0xffff939c adds r1, r2 ldr r0, [r0] adds r0, r1 @0809D688: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end var_get_pointer thumb_func_start var_get ; u16 var_get(u16 var_id) 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 ; bool var_set(u16 var_id, u16 value) 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, =0x40100000 adds r0, r1 lsrs r0, 16 bl var_get lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end var_load_x4010_plus_r0 thumb_func_start flag_get_pointer ; u8 *flag_get_pointer(u16 flag_id) 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, =0x00003fff cmp r2, r0 bhi @0809D71C ldr r0, =0x03005d8c lsrs r1, 19 ldr r2, =0x00001270 adds r1, r2 ldr r0, [r0] b @0809D72C .align 2, 0 .pool @0809D71C: ldr r1, =0xffffc000 adds r0, r3, r1 cmp r0, 0 bge @0809D728 ldr r2, =0xffffc007 adds r0, r3, r2 @0809D728: asrs r0, 3 ldr r1, =0x020375fc @0809D72C: adds r0, r1 @0809D72E: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end flag_get_pointer thumb_func_start flag_set ; bool flag_set(u16 flag_id) 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 ; bool flag_clear(u16 flag_id) 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 ; bool flag_check(u16 flag_id) 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, =gUnknown_085102E0 @0809D862: lsls r1, r2, 3 adds r0, r1, r3 ldrb r0, [r0] cmp r0, r4 bne @0809D87C adds r0, r3, 0x4 adds r0, r1, r0 ldr r0, [r0] bl _call_via_r0 b @0809D886 .align 2, 0 .pool @0809D87C: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xC bls @0809D862 @0809D886: pop {r4} pop {r0} bx r0 thumb_func_end trigger_activate_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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0x8 ldrsh r1, [r1, r2] ldr r2, =gUnknown_08510348 lsls r1, 2 adds r1, r2 ldr r1, [r1] bl _call_via_r1 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_per_step_callback_manager thumb_func_start sub_809D8B8 sub_809D8B8: ; 809D8B8 push {r4,lr} adds r4, r0, 0 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0 beq @0809D8CA cmp r0, 0x1 beq @0809D8E8 b @0809D8FC @0809D8CA: ldr r0, =0x030022c0 ldr r0, [r0, 0x20] movs r1, 0x80 lsls r1, 5 ands r0, r1 cmp r0, 0 beq @0809D8FC bl sub_809E7B0 ldrh r0, [r4] adds r0, 0x1 b @0809D8FA .align 2, 0 .pool @0809D8E8: ldr r0, =0x030022c0 ldr r0, [r0, 0x20] movs r1, 0x80 lsls r1, 5 ands r0, r1 cmp r0, 0 bne @0809D8FC ldrh r0, [r4] subs r0, 0x1 @0809D8FA: strh r0, [r4] @0809D8FC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D8B8 thumb_func_start sub_809D908 sub_809D908: ; 809D908 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r4, r1, r0 bl script_env_2_is_enabled lsls r0, 24 cmp r0, 0 bne @0809D930 adds r0, r4, 0 bl sub_809D8B8 adds r0, r4, 0x2 adds r1, r4, 0x4 bl wild_encounter_related @0809D930: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809D908 thumb_func_start overworld_ensure_per_step_coros_running overworld_ensure_per_step_coros_running: ; 809D93C push {r4,r5,lr} ldr r5, =task_per_step_callback_manager adds r0, r5, 0 bl is_function_an_active_task lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @0809D966 adds r0, r5, 0 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] @0809D966: ldr r4, =sub_809E638 adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @0809D97C adds r0, r4, 0 movs r1, 0x50 bl AddTask @0809D97C: ldr r4, =sub_809D908 adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @0809D992 adds r0, r4, 0 movs r1, 0x50 bl AddTask @0809D992: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end overworld_ensure_per_step_coros_running thumb_func_start activate_per_step_callback activate_per_step_callback: ; 809D9A8 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =task_per_step_callback_manager bl get_task_id_by_function lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0xFF beq @0809D9EA lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =0x03005e08 adds r1, r0, r1 movs r2, 0 adds r0, r1, 0 adds r0, 0x1E @0809D9CC: strh r2, [r0] subs r0, 0x2 cmp r0, r1 bge @0809D9CC cmp r4, 0x7 bls @0809D9E8 movs r0, 0 strh r0, [r1] b @0809D9EA .align 2, 0 .pool @0809D9E8: strh r4, [r1] @0809D9EA: pop {r4} pop {r0} bx r0 thumb_func_end activate_per_step_callback thumb_func_start wild_encounter_reset_coro_args wild_encounter_reset_coro_args: ; 809D9F0 push {lr} ldr r0, =task_per_step_callback_manager bl get_task_id_by_function lsls r0, 24 lsrs r1, r0, 24 ldr r0, =sub_809D908 bl get_task_id_by_function lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0xFF beq @0809DA1A lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =0x03005e08 adds r0, r1 movs r1, 0 strh r1, [r0, 0x2] strh r1, [r0, 0x4] @0809DA1A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end wild_encounter_reset_coro_args thumb_func_start nullsub_34 nullsub_34: ; 809DA2C bx lr thumb_func_end nullsub_34 thumb_func_start sub_809DA30 sub_809DA30: ; 809DA30 push {r4,r5,lr} adds r5, r0, 0 lsls r1, 24 lsrs r4, r1, 24 adds r0, r4, 0 bl sub_8089764 lsls r0, 24 cmp r0, 0 beq @0809DA48 adds r0, r5, 0 b @0809DA80 @0809DA48: adds r0, r4, 0 bl sub_8089778 lsls r0, 24 cmp r0, 0 beq @0809DA5A adds r0, r5, 0 adds r0, 0x8 b @0809DA80 @0809DA5A: adds r0, r4, 0 bl sub_808978C lsls r0, 24 cmp r0, 0 beq @0809DA6C adds r0, r5, 0 adds r0, 0x10 b @0809DA80 @0809DA6C: adds r0, r4, 0 bl sub_80897A0 lsls r0, 24 cmp r0, 0 bne @0809DA7C movs r0, 0 b @0809DA80 @0809DA7C: adds r0, r5, 0 adds r0, 0x18 @0809DA80: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_809DA30 thumb_func_start sub_809DA88 sub_809DA88: ; 809DA88 push {r4-r7,lr} mov r7, r8 push {r7} adds r5, r0, 0 mov r8, r3 lsls r1, 16 asrs r6, r1, 16 lsls r2, 16 asrs r7, r2, 16 adds r0, r6, 0 adds r1, r7, 0 bl 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, =gUnknown_08510368 lsls r4, 16 asrs r4, 16 lsls r5, 16 asrs r5, 16 adds r1, r4, 0 adds r2, r5, 0 bl sub_809DA88 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809DB10 thumb_func_start sub_809DB34 sub_809DB34: ; 809DB34 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r3, r2, 0 ldr r0, =gUnknown_08510388 lsls r4, 16 asrs r4, 16 lsls r5, 16 asrs r5, 16 adds r1, r4, 0 adds r2, r5, 0 bl sub_809DA88 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809DB34 thumb_func_start sub_809DB58 sub_809DB58: ; 809DB58 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 adds r3, r2, 0 ldr r0, =gUnknown_085103A8 lsls r4, 16 asrs r4, 16 lsls r5, 16 asrs r5, 16 adds r1, r4, 0 adds r2, r5, 0 bl sub_809DA88 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809DB58 thumb_func_start sub_809DB7C sub_809DB7C: ; 809DB7C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 16 lsrs r0, 16 mov r8, r0 mov r10, r8 lsls r1, 16 lsrs r7, r1, 16 mov r9, r7 lsls r2, 16 asrs r6, r2, 16 lsls r3, 16 asrs r5, r3, 16 adds r0, r6, 0 adds r1, r5, 0 bl 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, =0x03005e08 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 .pool @0809DCEC: cmp r0, 0x2 beq @0809DDDC b @0809DE1E @0809DCF2: mov r0, sp ldrh r0, [r0] strh r0, [r4, 0x4] ldrh r0, [r5] strh r0, [r4, 0x6] mov r0, sp movs r2, 0 ldrsh r0, [r0, r2] movs r3, 0 ldrsh r1, [r5, r3] movs r2, 0x1 bl sub_809DB34 b @0809DE1A @0809DD0E: mov r0, sp movs r7, 0 ldrsh r1, [r0, r7] movs r2, 0x4 ldrsh r0, [r4, r2] cmp r1, r0 bne @0809DD28 movs r3, 0 ldrsh r1, [r5, r3] movs r7, 0x6 ldrsh r0, [r4, r7] cmp r1, r0 beq @0809DE1E @0809DD28: mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] movs r3, 0x4 ldrsh r2, [r4, r3] movs r5, 0x6 ldrsh r3, [r4, r5] bl sub_809DB7C cmp r0, 0 beq @0809DD70 movs r7, 0x4 ldrsh r0, [r4, r7] movs r2, 0x6 ldrsh r1, [r4, r2] movs r2, 0x1 bl sub_809DB10 movs r3, 0x4 ldrsh r0, [r4, r3] movs r5, 0x6 ldrsh r1, [r4, r5] movs r2, 0 bl sub_809DB58 ldrh r0, [r4, 0x4] strh r0, [r4, 0x8] ldrh r0, [r4, 0x6] strh r0, [r4, 0xA] movs r0, 0x2 strh r0, [r4, 0x2] movs r0, 0x8 strh r0, [r4, 0xC] b @0809DD7A @0809DD70: movs r7, 0x1 negs r7, r7 adds r0, r7, 0 strh r0, [r4, 0x8] strh r0, [r4, 0xA] @0809DD7A: mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] adds r5, r6, 0 movs r2, 0 ldrsh r1, [r5, r2] movs r3, 0x4 ldrsh r2, [r4, r3] movs r7, 0x6 ldrsh r3, [r4, r7] bl sub_809DC18 cmp r0, 0 beq @0809DDAE mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] movs r2, 0x1 bl sub_809DB10 movs r0, 0x2 strh r0, [r4, 0x2] movs r0, 0x8 strh r0, [r4, 0xC] @0809DDAE: mov r0, sp ldrh r0, [r0] strh r0, [r4, 0x4] ldrh r0, [r6] strh r0, [r4, 0x6] mov r0, sp movs r3, 0 ldrsh r0, [r0, r3] movs r5, 0 ldrsh r1, [r6, r5] bl 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, =0x0000024e cmp r1, r0 beq @0809DE68 adds r0, 0x8 cmp r1, r0 beq @0809DE78 b @0809DE82 .align 2, 0 .pool @0809DE68: ldr r2, =0x0000024f adds r0, r4, 0 adds r1, r5, 0 bl setmaptile_0 b @0809DE82 .align 2, 0 .pool @0809DE78: ldr r2, =0x00000257 adds r0, r4, 0 adds r1, r5, 0 bl setmaptile_0 @0809DE82: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809DE28 thumb_func_start sub_809DE8C sub_809DE8C: ; 809DE8C push {r4,r5,lr} lsls r0, 16 lsrs r4, r0, 16 lsls r1, 16 lsrs r5, r1, 16 bl 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, =0x0000024f cmp r1, r0 beq @0809DECC adds r0, 0x8 cmp r1, r0 beq @0809DEDC b @0809DEE6 .align 2, 0 .pool @0809DECC: ldr r2, =0x0000024e adds r0, r4, 0 adds r1, r5, 0 bl setmaptile_0 b @0809DEE6 .align 2, 0 .pool @0809DEDC: ldr r2, =0x00000256 adds r0, r4, 0 adds r1, r5, 0 bl setmaptile_0 @0809DEE6: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809DE8C thumb_func_start sub_809DEF0 sub_809DEF0: ; 809DEF0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r6, r1, r0 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl 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 .pool @0809DF30: cmp r5, 0x2 bne @0809DF36 b @0809E064 @0809DF36: b @0809E0F6 @0809DF38: mov r0, sp ldrh r0, [r0] strh r0, [r6, 0x4] mov r1, r9 ldrh r0, [r1] strh r0, [r6, 0x6] mov r0, sp movs r2, 0 ldrsh r0, [r0, r2] movs r3, 0 ldrsh r1, [r1, r3] bl 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, =@0809E094 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0809E094: .4byte @0809E0B4 .4byte @0809E0EA .4byte @0809E0EA .4byte @0809E0EA .4byte @0809E0C6 .4byte @0809E0EA .4byte @0809E0EA .4byte @0809E0EA @0809E0B4: mov r2, r10 lsls r0, r2, 16 asrs r0, 16 mov r3, r8 lsls r1, r3, 16 asrs r1, 16 bl 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, =0xfffd0000 adds r0, r2 lsrs r0, 16 cmp r0, 0xA bhi @0809E144 lsls r0, r1, 16 asrs r1, r0, 16 ldr r2, =0xfffa0000 adds r0, r2 lsrs r0, 16 cmp r0, 0xD bhi @0809E144 ldr r0, =gUnknown_085103C8 lsls r1, 1 adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @0809E144 movs r0, 0x1 b @0809E146 .align 2, 0 .pool @0809E144: movs r0, 0 @0809E146: pop {r1} bx r1 thumb_func_end sub_809E108 thumb_func_start sub_809E14C sub_809E14C: ; 809E14C push {r4,r5,lr} lsls r0, 16 asrs r5, r0, 16 lsls r1, 16 asrs r4, r1, 16 adds r0, r5, 0 adds r1, r4, 0 bl sub_809E108 cmp r0, 0 beq @0809E17A ldr r1, =gUnknown_085103C8 lsls r0, r4, 1 adds r0, r1 ldrh r0, [r0] bl 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 .pool thumb_func_end sub_809E14C thumb_func_start sub_809E184 sub_809E184: ; 809E184 push {r4,r5,lr} lsls r0, 16 asrs r5, r0, 16 lsls r1, 16 asrs r4, r1, 16 adds r0, r5, 0 adds r1, r4, 0 bl sub_809E108 cmp r0, 0 beq @0809E1B6 ldr r1, =gUnknown_085103C8 lsls r0, r4, 1 adds r0, r1 ldrh r0, [r0] bl 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 .pool @0809E1C0: movs r0, 0x1 @0809E1C2: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_809E184 thumb_func_start sub_809E1C8 sub_809E1C8: ; 809E1C8 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x02037318 ldr r0, [r0] ldr r1, [r0] mov r9, r1 ldr r7, [r0, 0x4] movs r5, 0 cmp r5, r9 bge @0809E210 @0809E1E0: movs r4, 0 adds r0, r5, 0x1 mov r8, r0 cmp r4, r7 bge @0809E20A lsls r6, r5, 16 @0809E1EC: lsls r1, r4, 16 asrs r1, 16 asrs r0, r6, 16 bl sub_809E184 cmp r0, 0x1 bne @0809E204 adds r1, r4, 0x7 adds r0, r5, 0x7 ldr r2, =0x0000020e bl 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 .pool thumb_func_end sub_809E1C8 thumb_func_start sub_809E224 sub_809E224: ; 809E224 push {r4-r7,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r5, r1, r0 movs r1, 0x2 ldrsh r0, [r5, r1] cmp r0, 0x1 beq @0809E270 cmp r0, 0x1 bgt @0809E24C cmp r0, 0 beq @0809E258 b @0809E3A6 .align 2, 0 .pool @0809E24C: cmp r0, 0x2 beq @0809E306 cmp r0, 0x3 bne @0809E256 b @0809E360 @0809E256: b @0809E3A6 @0809E258: mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl 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, =0x00004022 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 .pool @0809E2E0: adds r0, r4, 0 bl sub_8089618 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809E3A6 movs r0, 0 strh r0, [r6] movs r0, 0x4 strh r0, [r5, 0xC] movs r0, 0x3 @0809E2F8: strh r0, [r5, 0x2] mov r0, sp ldrh r0, [r0] strh r0, [r5, 0x8] ldrh r0, [r7] strh r0, [r5, 0xA] b @0809E3A6 @0809E306: ldrh r1, [r5, 0xC] movs r3, 0xC ldrsh r0, [r5, r3] cmp r0, 0 bne @0809E36A mov r1, sp ldrh r0, [r5, 0x8] strh r0, [r1] mov r4, sp adds r4, 0x2 ldrh r0, [r5, 0xA] strh r0, [r4] movs r0, 0x2A bl audio_play mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] ldr r2, =0x0000020e bl 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 .pool @0809E360: ldrh r1, [r5, 0xC] movs r3, 0xC ldrsh r0, [r5, r3] cmp r0, 0 beq @0809E370 @0809E36A: subs r0, r1, 0x1 strh r0, [r5, 0xC] b @0809E3A6 @0809E370: mov r1, sp ldrh r0, [r5, 0x8] strh r0, [r1] mov r4, sp adds r4, 0x2 ldrh r0, [r5, 0xA] strh r0, [r4] movs r0, 0x29 bl audio_play mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] ldr r2, =0x00000206 bl 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 .pool thumb_func_end sub_809E224 thumb_func_start sub_809E3B4 sub_809E3B4: ; 809E3B4 push {r4,r5,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r5, r1, r0 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl 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, =0x0000020a cmp r0, r1 bne @0809E444 mov r0, sp movs r3, 0 ldrsh r0, [r0, r3] movs r2, 0 ldrsh r1, [r4, r2] ldr r2, =0x00000212 movs r3, 0x4 bl ash b @0809E456 .align 2, 0 .pool @0809E444: mov r0, sp movs r3, 0 ldrsh r0, [r0, r3] movs r2, 0 ldrsh r1, [r4, r2] ldr r2, =0x00000206 movs r3, 0x4 bl ash @0809E456: movs r0, 0x87 lsls r0, 1 movs r1, 0x1 bl sub_80D6724 lsls r0, 24 cmp r0, 0 beq @0809E47A ldr r0, =0x00004048 bl var_get_pointer adds r2, r0, 0 ldrh r1, [r2] ldr r0, =0x0000270e cmp r1, r0 bhi @0809E47A adds r0, r1, 0x1 strh r0, [r2] @0809E47A: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809E3B4 thumb_func_start sub_809E490 sub_809E490: ; 809E490 push {r4,r5,lr} lsls r0, 16 asrs r5, r0, 16 lsls r1, 16 asrs r4, r1, 16 adds r0, r5, 0 adds r1, r4, 0 bl cur_mapdata_get_blockid_at ldr r1, =0x0000022f ldr r2, =0x00000237 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 .pool thumb_func_end sub_809E490 thumb_func_start sub_809E4CC sub_809E4CC: ; 809E4CC push {r4-r7,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r5, r1, r0 mov r4, sp adds r4, 0x2 mov r0, sp adds r1, r4, 0 bl 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, =0x00004022 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, =0x00004022 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 .pool @0809E5BC: movs r2, 0xE ldrsh r0, [r5, r2] cmp r0, 0 bne @0809E5D2 movs r0, 0x3 strh r0, [r5, 0xE] mov r0, sp ldrh r0, [r0] strh r0, [r5, 0x10] ldrh r0, [r7] strh r0, [r5, 0x12] @0809E5D2: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_809E4CC thumb_func_start sub_809E5DC sub_809E5DC: ; 809E5DC push {r4,r5,lr} adds r3, r0, 0 lsls r1, 16 lsrs r5, r1, 16 lsls r2, 16 lsrs r4, r2, 16 ldrh r0, [r3] subs r0, 0x1 strh r0, [r3] lsls r0, 16 cmp r0, 0 bne @0809E5F8 movs r2, 0xE8 b @0809E60C @0809E5F8: ldr r1, =gUnknown_085103FC movs r2, 0 ldrsh r0, [r3, r2] cmp r0, 0 bge @0809E604 adds r0, 0x7 @0809E604: asrs r0, 3 lsls r0, 1 adds r0, r1 ldrh r2, [r0] @0809E60C: lsls r5, 16 asrs r5, 16 lsls r4, 16 asrs r4, 16 adds r0, r5, 0 adds r1, r4, 0 bl 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 .pool thumb_func_end sub_809E5DC thumb_func_start sub_809E638 sub_809E638: ; 809E638 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r4, r1, r0 mov r5, sp adds r5, 0x2 mov r0, sp adds r1, r5, 0 bl player_get_pos_to ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] lsls r1, 8 ldrb r0, [r0, 0x5] lsls r0, 24 asrs r0, 24 orrs r0, r1 lsls r0, 16 lsrs r7, r0, 16 movs r0, 0x2 ldrsh r1, [r4, r0] mov r8, r5 cmp r1, 0 beq @0809E688 cmp r1, 0x1 beq @0809E6B4 b @0809E708 .align 2, 0 .pool @0809E688: strh r7, [r4] mov r0, sp ldrh r0, [r0] strh r0, [r4, 0x4] ldrh r0, [r5] strh r0, [r4, 0x6] movs r0, 0x1 strh r0, [r4, 0x2] strh r1, [r4, 0x8] strh r1, [r4, 0xE] strh r1, [r4, 0x14] strh r1, [r4, 0x1A] b @0809E708 @0809E6A2: movs r0, 0x20 strh r0, [r1] mov r0, sp ldrh r0, [r0] strh r0, [r1, 0x2] mov r2, r8 ldrh r0, [r2] strh r0, [r1, 0x4] b @0809E708 @0809E6B4: mov r0, sp movs r3, 0x4 ldrsh r1, [r4, r3] ldrh r2, [r0] movs r3, 0 ldrsh r0, [r0, r3] cmp r1, r0 bne @0809E6D0 movs r0, 0x6 ldrsh r1, [r4, r0] movs r3, 0 ldrsh r0, [r5, r3] cmp r1, r0 beq @0809E708 @0809E6D0: strh r2, [r4, 0x4] ldrh r0, [r5] strh r0, [r4, 0x6] mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r5, r2] bl 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, =0x02037334 ldrb r1, [r2] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0809E728 movs r1, 0 ldrsh r0, [r4, r1] cmp r7, r0 beq @0809E728 strh r7, [r4] ldrh r0, [r2, 0x4] ldrh r1, [r2, 0x8] b @0809E72C .align 2, 0 .pool @0809E728: movs r0, 0 movs r1, 0 @0809E72C: lsls r0, 16 asrs r0, 16 mov r8, r0 lsls r0, r1, 16 asrs r7, r0, 16 adds r5, r4, 0 adds r5, 0x8 adds r4, r5, 0 movs r6, 0x9 @0809E73E: movs r2, 0 ldrsh r0, [r4, r2] cmp r0, 0 beq @0809E762 ldrh r0, [r4, 0x2] mov r3, r8 subs r0, r3 strh r0, [r4, 0x2] ldrh r0, [r4, 0x4] subs r0, r7 strh r0, [r4, 0x4] movs r0, 0x2 ldrsh r1, [r4, r0] movs r3, 0x4 ldrsh r2, [r4, r3] adds r0, r5, 0 bl sub_809E5DC @0809E762: adds r4, 0x6 adds r5, 0x6 subs r6, 0x3 cmp r6, 0 bge @0809E73E add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_809E638 thumb_func_start sub_809E778 sub_809E778: ; 809E778 push {lr} ldr r0, =0x00000895 bl flag_set bl sub_802F588 ldr r0, =0x03005d90 ldr r2, [r0] adds r2, 0xA0 ldr r3, =0x03005cf8 ldr r0, [r3] ldr r1, [r3, 0x4] str r0, [r2] str r1, [r2, 0x4] ldr r0, =0x00004040 ldrh r1, [r3] bl var_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809E778 thumb_func_start sub_809E7B0 sub_809E7B0: ; 809E7B0 push {r4,lr} ldr r0, =0x00000895 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, =0x03005cf8 adds r0, r4, 0 bl sub_809E7E8 adds r0, r4, 0 bl sub_809E858 @0809E7DA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809E7B0 thumb_func_start sub_809E7E8 sub_809E7E8: ; 809E7E8 push {r4-r6,lr} adds r5, r0, 0 ldr r0, =0x00004040 bl 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 .pool thumb_func_end sub_809E7E8 thumb_func_start sub_809E858 sub_809E858: ; 809E858 push {r4-r6,lr} sub sp, 0x8 adds r5, r0, 0 mov r4, sp ldr r6, =0x03005d90 ldr r1, [r6] adds r1, 0xA0 mov r0, sp adds r2, r5, 0 bl 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 .pool thumb_func_end sub_809E858 thumb_func_start sub_809E8B4 sub_809E8B4: ; 809E8B4 push {lr} bl sub_809E778 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809E8B4 thumb_func_start sub_809E8C8 sub_809E8C8: ; 809E8C8 push {lr} ldr r0, =sub_81349F4 bl set_callback2 ldr r1, =0x030022c0 ldr r0, =sub_809E8B4 str r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809E8C8 thumb_func_start sub_809E8E8 sub_809E8E8: ; 809E8E8 push {lr} adds r3, r0, 0 ldr r2, =0x03005e00 movs r0, 0x2E ldrsh r1, [r3, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 movs r2, 0xC ldrsh r1, [r0, r2] movs r2, 0x30 ldrsh r0, [r3, r2] cmp r1, r0 beq @0809E9FE strh r1, [r3, 0x30] subs r0, r1, 0x1 cmp r0, 0x5 bhi @0809E9FE lsls r0, 2 ldr r1, =@0809E920 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0809E920: .4byte @0809E938 .4byte @0809E95C .4byte @0809E980 .4byte @0809E9A4 .4byte @0809E9CE .4byte @0809E9F8 @0809E938: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r1, r3, 0 adds r1, 0x2A movs r0, 0x1 strb r0, [r1] subs r2, 0x12 ldrb r1, [r2] subs r0, 0x41 ands r0, r1 strb r0, [r2] movs r0, 0x35 b @0809E9C6 @0809E95C: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r1, r3, 0 adds r1, 0x2A movs r0, 0x1 strb r0, [r1] subs r2, 0x12 ldrb r1, [r2] subs r0, 0x41 ands r0, r1 strb r0, [r2] movs r0, 0x56 b @0809E9C6 @0809E980: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r1, r3, 0 adds r1, 0x2A movs r0, 0x1 strb r0, [r1] subs r2, 0x12 ldrb r1, [r2] subs r0, 0x41 ands r0, r1 strb r0, [r2] movs r0, 0x65 b @0809E9C6 @0809E9A4: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r1, r3, 0 adds r1, 0x2A movs r0, 0x1 strb r0, [r1] subs r2, 0x12 ldrb r1, [r2] subs r0, 0x41 ands r0, r1 strb r0, [r2] movs r0, 0x74 @0809E9C6: strh r0, [r3, 0x20] movs r0, 0x44 strh r0, [r3, 0x22] b @0809E9FE @0809E9CE: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r1, r3, 0 adds r1, 0x2A movs r0, 0x2 strb r0, [r1] subs r2, 0x12 ldrb r1, [r2] subs r0, 0x42 ands r0, r1 strb r0, [r2] movs r0, 0x99 strh r0, [r3, 0x20] movs r0, 0x50 strh r0, [r3, 0x22] b @0809E9FE @0809E9F8: adds r0, r3, 0 bl 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, =0x03005e00 movs r0, 0x2E ldrsh r1, [r3, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 movs r2, 0xC ldrsh r1, [r0, r2] movs r2, 0x30 ldrsh r0, [r3, r2] cmp r1, r0 beq @0809EAFE strh r1, [r3, 0x30] subs r0, r1, 0x1 cmp r0, 0x5 bhi @0809EAFE lsls r0, 2 ldr r1, =@0809EA3C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0809EA3C: .4byte @0809EA54 .4byte @0809EA78 .4byte @0809EA9C .4byte @0809EAC0 .4byte @0809EAEA .4byte @0809EAF8 @0809EA54: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r1, r3, 0 adds r1, 0x2A movs r0, 0 strb r0, [r1] subs r2, 0x12 ldrb r1, [r2] subs r0, 0x40 ands r0, r1 strb r0, [r2] movs r0, 0x35 b @0809EAE2 @0809EA78: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r1, r3, 0 adds r1, 0x2A movs r0, 0 strb r0, [r1] subs r2, 0x12 ldrb r1, [r2] subs r0, 0x40 ands r0, r1 strb r0, [r2] movs r0, 0x56 b @0809EAE2 @0809EA9C: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r1, r3, 0 adds r1, 0x2A movs r0, 0 strb r0, [r1] subs r2, 0x12 ldrb r1, [r2] subs r0, 0x40 ands r0, r1 strb r0, [r2] movs r0, 0x65 b @0809EAE2 @0809EAC0: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] adds r1, r3, 0 adds r1, 0x2A movs r0, 0 strb r0, [r1] subs r2, 0x12 ldrb r1, [r2] subs r0, 0x40 ands r0, r1 strb r0, [r2] movs r0, 0x74 @0809EAE2: strh r0, [r3, 0x20] movs r0, 0x5C strh r0, [r3, 0x22] b @0809EAFE @0809EAEA: adds r0, r3, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] b @0809EAFE @0809EAF8: adds r0, r3, 0 bl 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, =gUnknown_085104C4 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_085104F0 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, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r6, 0 adds r4, 0x1C adds r2, r0, r4 ldr r1, =sub_809E8E8 str r1, [r2] adds r0, r6 strh r5, [r0, 0x2E] ldr r1, =0x0000ffff strh r1, [r0, 0x30] mov r0, r8 movs r1, 0x35 movs r2, 0x44 movs r3, 0 bl 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, =sub_809EA04 str r1, [r4] adds r0, r6 strh r5, [r0, 0x2E] movs r1, 0x1 negs r1, r1 strh r1, [r0, 0x30] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809EB04 thumb_func_start sub_809EB8C sub_809EB8C: ; 809EB8C push {lr} ldr r0, =gUnknown_085104C4 ldrh r0, [r0, 0x4] bl gpu_pal_free_tag pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809EB8C thumb_func_start sub_809EBA0 sub_809EBA0: ; 809EBA0 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 movs r1, 0 bl sub_8198070 adds r0, r4, 0 bl 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, =0x02021fc4 ldr r4, =0x02021cc4 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, =gUnknown_085EE68A 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, =gUnknown_085EE68E 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, =0x02021fc4 mov r0, r9 str r0, [sp] movs r0, 0xFF str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] mov r0, r10 movs r1, 0x1 ldr r3, [sp, 0xC] bl Print add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809EBC4 thumb_func_start sub_809ECB4 sub_809ECB4: ; 809ECB4 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0xC adds r4, r0, 0 mov r9, r1 adds r5, r2, 0 adds r6, r3, 0 ldr r0, [sp, 0x24] mov r8, r0 lsls r4, 24 lsrs r4, 24 mov r0, r9 lsls r0, 16 lsrs r0, 16 mov r9, r0 lsls r5, 24 lsrs r5, 24 lsls r6, 24 lsrs r6, 24 mov r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r2, 0x85 lsls r2, 2 adds r0, r4, 0 movs r1, 0 movs r3, 0xE bl SetWindowBorderStyle str r5, [sp] str r6, [sp, 0x4] mov r0, r8 str r0, [sp, 0x8] adds r0, r4, 0 movs r1, 0 movs r2, 0x1 mov r3, r9 bl sub_809EBC4 ldr r2, =gUnknown_085EE690 movs r0, 0x1 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] str r0, [sp, 0x8] adds r0, r4, 0 movs r1, 0x1 movs r3, 0x7E bl Print movs r0, 0 bl schedule_bg_copy_tilemap_to_vram add sp, 0xC pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809ECB4 thumb_func_start sub_809ED38 sub_809ED38: ; 809ED38 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 lsls r3, 16 lsrs r3, 16 adds r1, r3, 0 movs r0, 0x80 ands r0, r3 cmp r0, 0 beq @0809ED52 ldrh r0, [r4] subs r0, 0x1 b @0809ED6C @0809ED52: movs r0, 0x40 ands r0, r3 cmp r0, 0 beq @0809ED60 ldrh r0, [r4] adds r0, 0x1 b @0809ED8A @0809ED60: movs r0, 0x20 ands r0, r3 cmp r0, 0 beq @0809ED7A ldrh r0, [r4] subs r0, 0xA @0809ED6C: strh r0, [r4] movs r1, 0 ldrsh r0, [r4, r1] cmp r0, r5 bge @0809ED96 strh r2, [r4] b @0809ED96 @0809ED7A: movs r0, 0x10 ands r1, r0 cmp r1, 0 bne @0809ED86 movs r0, 0 b @0809ED98 @0809ED86: ldrh r0, [r4] adds r0, 0xA @0809ED8A: strh r0, [r4] movs r1, 0 ldrsh r0, [r4, r1] cmp r0, r2 ble @0809ED96 strh r5, [r4] @0809ED96: movs r0, 0x1 @0809ED98: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_809ED38 thumb_func_start sub_809EDA0 sub_809EDA0: ; 809EDA0 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0x1 strh r0, [r1, 0x8] bx lr .align 2, 0 .pool thumb_func_end sub_809EDA0 thumb_func_start sub_809EDB8 sub_809EDB8: ; 809EDB8 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r5, =0x03005e08 adds r0, r4, r5 ldrb r0, [r0, 0x10] bl sub_809EBA0 bl sub_809EB8C subs r5, 0x8 adds r4, r5 ldr r0, =sub_809EDA0 str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809EDB8 thumb_func_start sub_809EDE8 sub_809EDE8: ; 809EDE8 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0xC lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r7, r0, 3 ldr r0, =0x03005e08 mov r8, r0 adds r5, r7, r0 ldrb r4, [r5, 0x4] lsls r0, r4, 1 adds r0, r4 lsls r0, 2 ldr r1, =gUnknown_0851041C adds r2, r0, r1 ldr r1, =0x030022c0 ldrh r3, [r1, 0x2E] movs r0, 0x2 ands r0, r3 mov r12, r1 cmp r0, 0 beq @0809EE3C mov r0, r8 subs r0, 0x8 adds r0, r7, r0 ldr r1, =sub_809EDB8 str r1, [r0] movs r0, 0 strh r0, [r5, 0x2] movs r0, 0x6 b @0809EE5C .align 2, 0 .pool @0809EE3C: movs r0, 0x10 ands r0, r3 cmp r0, 0 beq @0809EE4A ldrb r0, [r2, 0x7] cmp r0, 0 bne @0809EE5C @0809EE4A: mov r3, r12 ldrh r1, [r3, 0x2E] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @0809EE66 ldrb r0, [r2, 0x6] cmp r0, 0 beq @0809EE66 @0809EE5C: strh r0, [r5, 0x4] movs r0, 0x5 bl audio_play b @0809EEF4 @0809EE66: cmp r4, 0x5 bne @0809EEB4 mov r0, r12 ldrh r1, [r0, 0x2E] movs r4, 0x1 adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @0809EEF4 ldr r1, =0x03005cf8 ldrh r0, [r5, 0x6] strh r0, [r1] ldrh r0, [r5, 0x8] strb r0, [r1, 0x2] ldrh r0, [r5, 0xA] strb r0, [r1, 0x3] ldrh r0, [r5, 0xC] strb r0, [r1, 0x4] movs r0, 0x5 bl audio_play ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_809EDB8 str r1, [r0] strh r4, [r5, 0x2] movs r0, 0x6 strh r0, [r5, 0x4] b @0809EEF4 .align 2, 0 .pool @0809EEB4: ldrb r0, [r2] lsls r0, 1 adds r0, r5, r0 ldrh r1, [r2, 0x2] ldrh r2, [r2, 0x4] mov r3, r12 ldrh r4, [r3, 0x30] movs r3, 0xC0 ands r3, r4 bl sub_809ED38 cmp r0, 0 beq @0809EEF4 movs r0, 0x5 bl audio_play ldrb r0, [r5, 0x10] ldrh r3, [r5, 0x6] ldrb r1, [r5, 0x8] str r1, [sp] ldrb r1, [r5, 0xA] str r1, [sp, 0x4] ldrb r1, [r5, 0xC] str r1, [sp, 0x8] movs r1, 0 movs r2, 0x1 bl sub_809EBC4 ldrb r0, [r5, 0x10] movs r1, 0x2 bl 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, =0x03005e08 mov r9, r0 adds r5, r6, r0 movs r0, 0 strh r0, [r5] ldr r1, =0x03005cf8 ldrh r0, [r1] strh r0, [r5, 0x6] movs r0, 0x2 ldrsb r0, [r1, r0] strh r0, [r5, 0x8] movs r0, 0x3 ldrsb r0, [r1, r0] strh r0, [r5, 0xA] movs r0, 0x4 ldrsb r0, [r1, r0] strh r0, [r5, 0xC] ldr r0, =gUnknown_08510420 bl 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, =sub_809EDE8 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 .pool thumb_func_end sub_809EF00 thumb_func_start sub_809EF88 sub_809EF88: ; 809EF88 push {r4-r7,lr} sub sp, 0x4 movs r0, 0 movs r1, 0 bl 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, =0x040000d4 mov r0, sp str r0, [r1] str r2, [r1, 0x4] ldr r0, =0x81000200 str r0, [r1, 0x8] ldr r0, [r1, 0x8] movs r2, 0xC0 lsls r2, 19 movs r3, 0xC0 lsls r3, 9 mov r4, sp movs r6, 0 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 movs r0, 0x81 lsls r0, 24 mov r12, r0 @0809EFCA: strh r6, [r4] mov r0, sp str r0, [r1] str r2, [r1, 0x4] str r7, [r1, 0x8] ldr r0, [r1, 0x8] adds r2, r5 subs r3, r5 cmp r3, r5 bhi @0809EFCA strh r6, [r4] mov r0, sp str r0, [r1] str r2, [r1, 0x4] lsrs r0, r3, 1 mov r2, r12 orrs r0, r2 str r0, [r1, 0x8] ldr r0, [r1, 0x8] movs r0, 0 movs r1, 0x80 bl 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, =sub_809F0AC bl SetVBlankCallback ldr r0, =sub_809F090 bl set_callback2 ldr r0, =sub_809F200 movs r1, 0x50 bl AddTask add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809EF88 thumb_func_start sub_809F048 sub_809F048: ; 809F048 push {lr} bl clear_scheduled_bg_copies_to_vram movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_08510404 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, =gUnknown_08510408 bl Window_InitFromTemplates bl TextBox_ResetSomeField bl sub_81973A4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @0809F11C: movs r2, 0x85 lsls r2, 2 movs r0, 0 movs r1, 0 movs r3, 0xE bl SetWindowBorderStyle ldr r2, =gUnknown_085ECA0D movs r0, 0x1 str r0, [sp] movs r4, 0xFF str r4, [sp, 0x4] str r5, [sp, 0x8] movs r0, 0 movs r1, 0x1 movs r3, 0 bl Print ldr r1, =0x03005cf8 ldrh r3, [r1] ldrb r0, [r1, 0x2] str r0, [sp] ldrb r0, [r1, 0x3] str r0, [sp, 0x4] ldrb r0, [r1, 0x4] str r0, [sp, 0x8] movs r0, 0 movs r1, 0 movs r2, 0x11 bl sub_809EBC4 ldr r2, =gUnknown_085ECA22 movs r0, 0x21 str r0, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] movs r0, 0 movs r1, 0x1 movs r3, 0 bl Print ldr r0, =0x03005d90 ldr r1, [r0] adds r0, r1, 0 adds r0, 0xA0 ldrh r3, [r0] adds r0, 0x2 ldrb r0, [r0] str r0, [sp] adds r0, r1, 0 adds r0, 0xA3 ldrb r0, [r0] str r0, [sp, 0x4] adds r0, r1, 0 adds r0, 0xA4 ldrb r0, [r0] str r0, [sp, 0x8] movs r0, 0 movs r1, 0 movs r2, 0x31 bl sub_809EBC4 ldr r0, =gUnknown_085EC9EC bl sub_809F0C0 movs r0, 0 movs r1, 0x2 bl Window_CopyToVram movs r0, 0 bl schedule_bg_copy_tilemap_to_vram ldrh r0, [r6] adds r0, 0x1 strh r0, [r6] @0809F1B2: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0809F1E4 adds r0, r7, 0 bl remove_task bl do_reset b @0809F1F8 .align 2, 0 .pool @0809F1E4: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0809F1F8 movs r0, 0x5 bl audio_play adds r0, r7, 0 bl remove_task @0809F1F8: add sp, 0xC pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_809F0F8 thumb_func_start sub_809F200 sub_809F200: ; 809F200 push {r4,r5,lr} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0x6 bls @0809F21C b @0809F404 @0809F21C: lsls r0, 2 ldr r1, =@0809F230 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0809F230: .4byte @0809F24C .4byte @0809F268 .4byte @0809F2B4 .4byte @0809F310 .4byte @0809F398 .4byte @0809F3C8 .4byte @0809F3EA @0809F24C: movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0x1 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 movs r0, 0x1 strh r0, [r5] b @0809F404 .align 2, 0 .pool @0809F268: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0809F276 b @0809F404 @0809F276: ldr r0, =0x03006210 ldrh r0, [r0] cmp r0, 0 beq @0809F282 cmp r0, 0x2 bne @0809F29C @0809F282: ldr r0, =gUnknown_085ECAA7 bl sub_809F0C0 movs r0, 0x5 strh r0, [r5] b @0809F404 .align 2, 0 .pool @0809F29C: bl sub_802F588 ldr r0, =sub_809F0F8 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x2] b @0809F334 .align 2, 0 .pool @0809F2B4: ldr r2, =0x03005e00 movs r0, 0x2 ldrsh r1, [r5, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x4] cmp r0, 0x1 bne @0809F2CA b @0809F404 @0809F2CA: movs r0, 0 movs r1, 0 bl sub_8198070 ldr r0, =gUnknown_085ECA38 bl sub_809F0C0 ldr r2, =0x03005cf8 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xA0 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r2] str r1, [r2, 0x4] ldr r0, =sub_809EF00 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x2] movs r0, 0x3 strh r0, [r5] b @0809F404 .align 2, 0 .pool @0809F310: ldr r2, =0x03005e00 movs r0, 0x2 ldrsh r1, [r5, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r1, r0, r2 movs r2, 0x8 ldrsh r0, [r1, r2] cmp r0, 0 beq @0809F404 movs r2, 0xA ldrsh r0, [r1, r2] cmp r0, 0 bne @0809F340 ldrb r0, [r5, 0x2] bl remove_task @0809F334: movs r0, 0x2 strh r0, [r5] b @0809F404 .align 2, 0 .pool @0809F340: ldrb r0, [r5, 0x2] bl remove_task bl sub_802F3F8 ldr r4, =0x03005cf8 movs r1, 0 ldrsh r0, [r4, r1] movs r1, 0x2 ldrsb r1, [r4, r1] movs r2, 0x3 ldrsb r2, [r4, r2] movs r3, 0x4 ldrsb r3, [r4, r3] bl sub_802F5C8 ldr r0, =0x03005d90 ldr r2, [r0] adds r2, 0xA0 ldr r0, [r4] ldr r1, [r4, 0x4] str r0, [r2] str r1, [r2, 0x4] ldr r0, =0x00004040 ldrh r1, [r4] bl var_set bl sub_809D5D8 ldr r0, =gUnknown_085ECA4F bl sub_809F0C0 movs r0, 0x4 strh r0, [r5] b @0809F404 .align 2, 0 .pool @0809F398: movs r0, 0 bl save_game_when_memory_present lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809F3B8 ldr r0, =gUnknown_085ECA8A bl sub_809F0C0 movs r0, 0x49 bl audio_play b @0809F3C4 .align 2, 0 .pool @0809F3B8: ldr r0, =gUnknown_085ECA9A bl sub_809F0C0 movs r0, 0x16 bl audio_play @0809F3C4: movs r0, 0x5 strh r0, [r5] @0809F3C8: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0809F404 movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0x1 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 movs r0, 0x6 strh r0, [r5] @0809F3EA: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0809F404 adds r0, r4, 0 bl remove_task bl Window_FreeMemory bl do_reset @0809F404: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809F200 thumb_func_start sub_809F41C sub_809F41C: ; 809F41C push {lr} ldr r0, =0x00000861 bl flag_set movs r0, 0x86 lsls r0, 4 bl flag_set ldr r0, =0x00000862 bl flag_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809F41C thumb_func_start start_menu_compose start_menu_compose: ; 809F440 push {lr} ldr r0, =0x0203760f 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 .pool @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, =0x02037610 ldr r1, =0x0203760f bl append_byte pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809F4B0 thumb_func_start sub_809F4CC sub_809F4CC: ; 809F4CC push {lr} ldr r0, =0x00000861 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, =0x00000862 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 .pool 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, =0x00000862 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 .pool 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, =0x00000862 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 .pool 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, =0x0203760c ldr r0, =gUnknown_08510508 bl Window_AddFromTemplate strb r0, [r4] ldrb r0, [r4] bl Window_WriteStandardTileMap ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldr r0, =0x02021cc4 ldr r1, =0x0203a04c ldrb r1, [r1] movs r2, 0x1 movs r3, 0x2 bl decimal_int_to_string ldr r5, =0x02021fc4 ldr r1, =gUnknown_085EE6FF 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 .pool thumb_func_end sub_809F654 thumb_func_start sub_809F6C8 sub_809F6C8: ; 809F6C8 push {r4,r5,lr} sub sp, 0xC ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 ldrh r0, [r0] cmp r0, 0x7 bne @0809F6F0 ldr r4, =0x0203760d ldr r0, =gUnknown_08510538 b @0809F6F4 .align 2, 0 .pool @0809F6F0: ldr r4, =0x0203760d ldr r0, =gUnknown_08510530 @0809F6F4: bl Window_AddFromTemplate strb r0, [r4] ldr r4, =0x0203760d ldrb r0, [r4] bl Window_WriteStandardTileMap ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldr r0, =0x02021cc4 ldr r2, =gUnknown_08510510 ldr r1, =0x03005d90 ldr r1, [r1] ldr r3, =0x00000cb2 adds r1, r3 ldrh r1, [r1] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r5, =0x02021fc4 ldr r1, =gUnknown_085EE716 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 .pool 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, =0x0203760c 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, =0x0203760d 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 .pool 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, =gUnknown_08510540 mov r9, r0 ldr r1, =0x02021fc4 mov r10, r1 @0809F7DA: ldr r0, =0x02037610 lsls r2, 24 asrs r4, r2, 24 adds r5, r4, r0 ldrb r0, [r5] lsls r3, r0, 3 mov r0, r9 adds r0, 0x4 adds r0, r3, r0 ldr r1, [r0] ldr r0, =sub_809FC8C 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 .pool @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, =0x0203760f ldrb r0, [r0] cmp r1, r0 bge @0809F87C subs r6, 0x1 cmp r6, 0 bne @0809F7DA mov r1, r8 strb r2, [r1] movs r0, 0 b @0809F882 .align 2, 0 .pool @0809F87C: mov r0, r8 strb r2, [r0] movs r0, 0x1 @0809F882: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_809F7C0 thumb_func_start sub_809F894 sub_809F894: ; 809F894 push {r4,lr} sub sp, 0xC ldr r0, =0x02037619 movs r1, 0 ldrsb r1, [r0, r1] adds r2, r0, 0 cmp r1, 0x5 bhi @0809F98C lsls r0, r1, 2 ldr r1, =@0809F8B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0809F8B8: .4byte @0809F8D0 .4byte @0809F8D8 .4byte @0809F8E4 .4byte @0809F90C .4byte @0809F930 .4byte @0809F94C @0809F8D0: ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] b @0809F98C @0809F8D8: bl start_menu_compose ldr r1, =0x02037619 b @0809F940 .align 2, 0 .pool @0809F8E4: bl sub_81973A4 ldr r0, =0x0203760f ldrb r0, [r0] bl sub_81979C4 lsls r0, 24 lsrs r0, 24 movs r1, 0 bl sub_81973FC ldr r1, =0x02037619 movs r0, 0 strb r0, [r1, 0x1] b @0809F940 .align 2, 0 .pool @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, =0x02037619 b @0809F940 .align 2, 0 .pool @0809F930: ldr r4, =0x0203761a 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 .pool @0809F94C: bl sub_8197A08 lsls r0, 24 lsrs r0, 24 movs r1, 0x10 str r1, [sp] ldr r1, =0x0203760f ldrb r1, [r1] str r1, [sp, 0x4] ldr r4, =0x0203760e ldrb r1, [r4] str r1, [sp, 0x8] movs r1, 0x1 movs r2, 0 movs r3, 0x9 bl sub_81983AC strb r0, [r4] bl sub_8197A08 lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl Window_CopyToVram movs r0, 0x1 b @0809F98E .align 2, 0 .pool @0809F98C: movs r0, 0 @0809F98E: add sp, 0xC pop {r4} pop {r1} bx r1 thumb_func_end sub_809F894 thumb_func_start sub_809F998 sub_809F998: ; 809F998 push {lr} ldr r1, =0x02037619 movs r0, 0 strb r0, [r1] strb r0, [r1, 0x1] @0809F9A2: bl sub_809F894 cmp r0, 0 beq @0809F9A2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809F998 thumb_func_start task50_startmenu task50_startmenu: ; 809F9B4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_809F894 cmp r0, 0x1 bne @0809F9C8 adds r0, r4, 0 bl set_task_function_to_args_14_15 @0809F9C8: pop {r4} pop {r0} bx r0 thumb_func_end task50_startmenu thumb_func_start sub_809F9D0 sub_809F9D0: ; 809F9D0 push {r4,r5,lr} adds r5, r0, 0 ldr r1, =0x02037619 movs r0, 0 strb r0, [r1] strb r0, [r1, 0x1] ldr r4, =task50_startmenu adds r0, r4, 0 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 adds r2, r5, 0 bl set_task_function_and_args_14_15 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809F9D0 thumb_func_start sub_809FA00 sub_809FA00: ; 809FA00 push {lr} bl sub_809F894 cmp r0, 0 beq @0809FA12 bl sub_80AF688 movs r0, 0x1 b @0809FA14 @0809FA12: movs r0, 0 @0809FA14: pop {r1} bx r1 thumb_func_end sub_809FA00 thumb_func_start sub_809FA18 sub_809FA18: ; 809FA18 ldr r1, =0x02037619 movs r0, 0 strb r0, [r1] strb r0, [r1, 0x1] ldr r1, =0x03005db0 ldr r0, =sub_809FA00 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_809FA18 thumb_func_start sub_809FA34 sub_809FA34: ; 809FA34 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @0809FA58 cmp r0, 0x1 beq @0809FA7C b @0809FA92 .align 2, 0 .pool @0809FA58: bl in_trade_center cmp r0, 0x1 bne @0809FA64 bl var_800D_set_xB @0809FA64: ldr r1, =0x03005df4 ldr r0, =sub_809FAC4 str r0, [r1] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @0809FA92 .align 2, 0 .pool @0809FA7C: ldr r0, =0x03005df4 ldr r0, [r0] bl _call_via_r0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0809FA92 adds r0, r5, 0 bl remove_task @0809FA92: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809FA34 thumb_func_start sub_809FA9C sub_809FA9C: ; 809FA9C push {lr} bl is_c1_link_related_active cmp r0, 0 bne @0809FAB2 bl player_bitmagic bl sub_808B864 bl sub_808BCF4 @0809FAB2: ldr r0, =sub_809FA34 bl sub_809F9D0 bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809FA9C thumb_func_start sub_809FAC4 sub_809FAC4: ; 809FAC4 push {r4,lr} ldr r4, =0x030022c0 ldrh r1, [r4, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0809FAE4 movs r0, 0x5 bl audio_play movs r0, 0x1 negs r0, r0 bl MoveMenuCursor ldr r1, =0x0203760e strb r0, [r1] @0809FAE4: ldrh r1, [r4, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0809FAFE movs r0, 0x5 bl audio_play movs r0, 0x1 bl MoveMenuCursor ldr r1, =0x0203760e strb r0, [r1] @0809FAFE: ldrh r1, [r4, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0809FB98 movs r0, 0x5 bl audio_play ldr r1, =gUnknown_08510540 ldr r2, =0x02037610 ldr r0, =0x0203760e ldrb r0, [r0] adds r0, r2 ldrb r0, [r0] lsls r0, 3 adds r1, 0x4 adds r0, r1 ldr r1, [r0] ldr r0, =sm_pokedex cmp r1, r0 bne @0809FB34 movs r0, 0 bl pokedex_count lsls r0, 16 cmp r0, 0 beq @0809FBA0 @0809FB34: ldr r3, =0x03005df4 ldr r1, =gUnknown_08510540 ldr r2, =0x02037610 ldr r0, =0x0203760e ldrb r0, [r0] adds r0, r2 ldrb r0, [r0] lsls r0, 3 adds r1, 0x4 adds r0, r1 ldr r1, [r0] str r1, [r3] ldr r0, =sub_809FCFC cmp r1, r0 beq @0809FBA0 ldr r0, =sub_809FD64 cmp r1, r0 beq @0809FBA0 ldr r0, =sub_809FD74 cmp r1, r0 beq @0809FBA0 ldr r0, =sub_809FDC0 cmp r1, r0 beq @0809FBA0 movs r0, 0x1 movs r1, 0 bl fade_screen b @0809FBA0 .align 2, 0 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0809FBCC movs r0, 0 b @0809FBE6 .align 2, 0 .pool @0809FBCC: movs r0, 0x29 bl sav12_xor_increment bl play_some_sound bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =sub_80BB534 bl set_callback2 movs r0, 0x1 @0809FBE6: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sm_pokedex thumb_func_start sub_809FBF0 sub_809FBF0: ; 809FBF0 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0809FC08 movs r0, 0 b @0809FC1C .align 2, 0 .pool @0809FC08: bl play_some_sound bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =sub_81B7F34 bl set_callback2 movs r0, 0x1 @0809FC1C: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809FBF0 thumb_func_start sub_809FC24 sub_809FC24: ; 809FC24 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0809FC3C movs r0, 0 b @0809FC50 .align 2, 0 .pool @0809FC3C: bl play_some_sound bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =c2_bag bl set_callback2 movs r0, 0x1 @0809FC50: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809FC24 thumb_func_start sub_809FC58 sub_809FC58: ; 809FC58 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0809FC70 movs r0, 0 b @0809FC84 .align 2, 0 .pool @0809FC70: bl play_some_sound bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =sub_81C7250 bl set_callback2 movs r0, 0x1 @0809FC84: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809FC58 thumb_func_start sub_809FC8C sub_809FC8C: ; 809FC8C push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0809FCF4 bl play_some_sound bl 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, =sub_8086194 bl sub_80C4DDC b @0809FCEA .align 2, 0 .pool @0809FCC8: ldr r0, =0x000008d2 bl flag_check lsls r0, 24 cmp r0, 0 beq @0809FCE4 ldr r0, =sub_8086194 bl sub_80C51C4 b @0809FCEA .align 2, 0 .pool @0809FCE4: ldr r0, =sub_8086194 bl sub_80C4DDC @0809FCEA: movs r0, 0x1 b @0809FCF6 .align 2, 0 .pool @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, =0x03005df4 ldr r0, =sub_809FE28 str r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809FCFC thumb_func_start sub_809FD20 sub_809FD20: ; 809FD20 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0809FD38 movs r0, 0 b @0809FD52 .align 2, 0 .pool @0809FD38: bl play_some_sound bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =c2_options_menu bl set_callback2 ldr r1, =0x030022c0 ldr r0, =sub_8086194 str r0, [r1, 0x8] movs r0, 0x1 @0809FD52: pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0809FDA0 movs r0, 0 b @0809FDB4 .align 2, 0 .pool @0809FDA0: bl play_some_sound bl overworld_free_bg_tilemaps ldr r0, =0x03005db4 ldrb r0, [r0] ldr r1, =sub_8086194 bl sub_80C4E74 movs r0, 0x1 @0809FDB4: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809FD88 thumb_func_start sub_809FDC0 sub_809FDC0: ; 809FDC0 ldr r1, =0x03005df4 ldr r0, =sub_809FE9C str r0, [r1] movs r0, 0 bx lr .align 2, 0 .pool 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, =sub_809FA34 bl sub_809F9D0 bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end atk17_seteffectuser thumb_func_start sub_809FDF4 sub_809FDF4: ; 809FDF4 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0809FE0C movs r0, 0 b @0809FE20 .align 2, 0 .pool @0809FE0C: bl play_some_sound bl sub_809F774 bl overworld_free_bg_tilemaps ldr r0, =sub_81C4EFC bl set_callback2 movs r0, 0x1 @0809FE20: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809FDF4 thumb_func_start sub_809FE28 sub_809FE28: ; 809FE28 push {lr} bl sub_809FF28 ldr r1, =0x03005df4 ldr r0, =sub_809FE44 str r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809FE28 thumb_func_start sub_809FE44 sub_809FE44: ; 809FE44 push {lr} bl sub_809FF4C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809FE7C cmp r0, 0x1 ble @0809FE94 cmp r0, 0x2 beq @0809FE60 cmp r0, 0x3 beq @0809FE7C b @0809FE94 @0809FE60: movs r0, 0 movs r1, 0 bl sub_8197DF8 bl sub_809F998 ldr r1, =0x03005df4 ldr r0, =sub_809FAC4 str r0, [r1] b @0809FE94 .align 2, 0 .pool @0809FE7C: movs r0, 0 movs r1, 0x1 bl sub_8197DF8 bl sub_80984F4 bl script_env_2_disable bl sub_81A9EC8 movs r0, 0x1 b @0809FE96 @0809FE94: movs r0, 0 @0809FE96: pop {r1} bx r1 thumb_func_end sub_809FE44 thumb_func_start sub_809FE9C sub_809FE9C: ; 809FE9C push {lr} bl sub_80A0340 ldr r1, =0x03005df4 ldr r0, =sub_809FED4 str r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809FE9C thumb_func_start sub_809FEB8 sub_809FEB8: ; 809FEB8 push {lr} bl sub_809F998 ldr r1, =0x03005df4 ldr r0, =sub_809FAC4 str r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_809FEB8 thumb_func_start sub_809FED4 sub_809FED4: ; 809FED4 push {lr} bl sub_809FF4C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0809FEEC cmp r0, 0x1 ble @0809FF20 cmp r0, 0x2 beq @0809FF00 b @0809FF20 @0809FEEC: bl sub_809F774 ldr r1, =0x03005df4 ldr r0, =sub_809FEB8 str r0, [r1] b @0809FF20 .align 2, 0 .pool @0809FF00: movs r0, 0 movs r1, 0x1 bl sub_8197DF8 bl sub_80984F4 bl script_env_2_disable ldr r0, =gUnknown_08252C88 bl script_env_1_execute_new_script movs r0, 0x1 b @0809FF22 .align 2, 0 .pool @0809FF20: movs r0, 0 @0809FF22: pop {r1} bx r1 thumb_func_end sub_809FED4 thumb_func_start sub_809FF28 sub_809FF28: ; 809FF28 push {lr} bl save_serialize_map ldr r1, =0x0203761c ldr r0, =sub_80A00A0 str r0, [r1] ldr r1, =0x02037621 movs r0, 0 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809FF28 thumb_func_start sub_809FF4C sub_809FF4C: ; 809FF4C push {lr} bl sub_8197224 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 beq @0809FF78 ldr r1, =0x02037621 movs r0, 0 strb r0, [r1] ldr r0, =0x0203761c ldr r0, [r0] bl _call_via_r0 lsls r0, 24 lsrs r0, 24 b @0809FF7A .align 2, 0 .pool @0809FF78: movs r0, 0 @0809FF7A: pop {r1} bx r1 thumb_func_end sub_809FF4C thumb_func_start sub_809FF80 sub_809FF80: ; 809FF80 push {lr} bl sub_809FF28 ldr r0, =task50_save_game movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809FF80 thumb_func_start sub_809FF98 sub_809FF98: ; 809FF98 push {r4,lr} adds r2, r0, 0 adds r4, r1, 0 ldr r0, =0x02021fc4 adds r1, r2, 0 bl ExpandTextCodes movs r0, 0 movs r1, 0x1 bl sub_819786C movs r0, 0x1 bl sub_8197310 ldr r1, =0x02037621 movs r0, 0x1 strb r0, [r1] ldr r0, =0x0203761c str r4, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_809FF98 thumb_func_start task50_save_game task50_save_game: ; 809FFD0 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_809FF4C lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x1 beq @0809FFFC cmp r1, 0x1 bgt @0809FFEC cmp r1, 0 beq @080A000A b @080A0000 @0809FFEC: cmp r1, 0x3 bgt @080A0000 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] b @080A0000 .align 2, 0 .pool @0809FFFC: ldr r0, =0x020375f0 strh r1, [r0] @080A0000: adds r0, r4, 0 bl remove_task bl script_env_2_enable_and_set_ctx_running @080A000A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task50_save_game thumb_func_start sub_80A0014 sub_80A0014: ; 80A0014 push {lr} movs r0, 0 movs r1, 0x1 bl sub_8197434 pop {r0} bx r0 thumb_func_end sub_80A0014 thumb_func_start sub_80A0024 sub_80A0024: ; 80A0024 push {lr} bl sub_80A0888 pop {r0} bx r0 thumb_func_end sub_80A0024 thumb_func_start sub_80A0030 sub_80A0030: ; 80A0030 ldr r1, =0x02037620 movs r0, 0x3C strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0030 thumb_func_start sub_80A003C sub_80A003C: ; 80A003C push {lr} ldr r1, =0x02037620 ldrb r0, [r1] subs r2, r0, 0x1 strb r2, [r1] ldr r0, =0x030022c0 ldrh r1, [r0, 0x2C] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080A0064 lsls r0, r2, 24 cmp r0, 0 beq @080A006A movs r0, 0 b @080A006C .align 2, 0 .pool @080A0064: movs r0, 0x5 bl audio_play @080A006A: movs r0, 0x1 @080A006C: pop {r1} bx r1 thumb_func_end sub_80A003C thumb_func_start sub_80A0070 sub_80A0070: ; 80A0070 push {lr} ldr r1, =0x02037620 ldrb r0, [r1] cmp r0, 0 bne @080A0094 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2C] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080A0098 movs r0, 0x1 b @080A009A .align 2, 0 .pool @080A0094: subs r0, 0x1 strb r0, [r1] @080A0098: movs r0, 0 @080A009A: pop {r1} bx r1 thumb_func_end sub_80A0070 thumb_func_start sub_80A00A0 sub_80A00A0: ; 80A00A0 push {lr} bl 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, =gUnknown_08252CA7 ldr r1, =sub_80A00EC bl sub_809FF98 b @080A00DC .align 2, 0 .pool @080A00D4: ldr r0, =gUnknown_082C87B4 ldr r1, =sub_80A00EC bl sub_809FF98 @080A00DC: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A00A0 thumb_func_start sub_80A00EC sub_80A00EC: ; 80A00EC push {lr} bl sub_8197930 ldr r1, =0x0203761c ldr r0, =sub_80A0108 str r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A00EC thumb_func_start sub_80A0108 sub_80A0108: ; 80A0108 push {lr} bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @080A012A cmp r1, 0 bgt @080A0124 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @080A0168 b @080A0174 @080A0124: cmp r1, 0x1 beq @080A0168 b @080A0174 @080A012A: ldr r0, =0x03006210 ldrh r0, [r0] cmp r0, 0 beq @080A0136 cmp r0, 0x2 bne @080A013E @080A0136: ldr r0, =0x020322d4 ldrb r0, [r0] cmp r0, 0 bne @080A0158 @080A013E: ldr r1, =0x0203761c ldr r0, =sub_80A017C str r0, [r1] b @080A0174 .align 2, 0 .pool @080A0158: ldr r1, =0x0203761c ldr r0, =sub_80A0234 str r0, [r1] b @080A0174 .align 2, 0 .pool @080A0168: bl sub_80A0024 bl sub_80A0014 movs r0, 0x2 b @080A0176 @080A0174: movs r0, 0 @080A0176: pop {r1} bx r1 thumb_func_end sub_80A0108 thumb_func_start sub_80A017C sub_80A017C: ; 80A017C push {lr} ldr r0, =0x020322d4 ldrb r0, [r0] cmp r0, 0x1 bne @080A019C ldr r0, =gUnknown_082C8845 ldr r1, =sub_80A01B4 bl sub_809FF98 b @080A01A4 .align 2, 0 .pool @080A019C: ldr r0, =gUnknown_082C87D5 ldr r1, =sub_80A01D0 bl sub_809FF98 @080A01A4: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A017C thumb_func_start sub_80A01B4 sub_80A01B4: ; 80A01B4 push {lr} movs r0, 0x1 bl sub_8197948 ldr r1, =0x0203761c ldr r0, =sub_80A01EC str r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A01B4 thumb_func_start sub_80A01D0 sub_80A01D0: ; 80A01D0 push {lr} bl sub_8197930 ldr r1, =0x0203761c ldr r0, =sub_80A01EC str r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A01D0 thumb_func_start sub_80A01EC sub_80A01EC: ; 80A01EC push {lr} bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @080A020E cmp r1, 0 bgt @080A0208 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @080A0220 b @080A022C @080A0208: cmp r1, 0x1 beq @080A0220 b @080A022C @080A020E: ldr r1, =0x0203761c ldr r0, =sub_80A0234 str r0, [r1] b @080A022C .align 2, 0 .pool @080A0220: bl sub_80A0024 bl sub_80A0014 movs r0, 0x2 b @080A022E @080A022C: movs r0, 0 @080A022E: pop {r1} bx r1 thumb_func_end sub_80A01EC thumb_func_start sub_80A0234 sub_80A0234: ; 80A0234 push {lr} ldr r0, =gUnknown_082C8810 ldr r1, =sub_80A024C bl sub_809FF98 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A0234 thumb_func_start sub_80A024C sub_80A024C: ; 80A024C push {r4,lr} movs r0, 0 bl sav12_xor_increment bl sub_81A9E90 ldr r4, =0x020322d4 ldrb r0, [r4] cmp r0, 0x1 bne @080A0274 movs r0, 0x4 bl save_game_when_memory_present lsls r0, 24 lsrs r1, r0, 24 movs r0, 0 strb r0, [r4] b @080A027E .align 2, 0 .pool @080A0274: movs r0, 0 bl save_game_when_memory_present lsls r0, 24 lsrs r1, r0, 24 @080A027E: cmp r1, 0x1 bne @080A0294 ldr r0, =gUnknown_082C8832 ldr r1, =sub_80A02B0 bl sub_809FF98 b @080A029C .align 2, 0 .pool @080A0294: ldr r0, =gUnknown_082C892A ldr r1, =sub_80A02FC bl sub_809FF98 @080A029C: bl sub_80A0030 movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203761c ldr r0, =sub_80A02D8 str r0, [r1] @080A02CA: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A02B0 thumb_func_start sub_80A02D8 sub_80A02D8: ; 80A02D8 push {lr} bl mplay_has_finished_maybe lsls r0, 24 cmp r0, 0 bne @080A02F6 bl sub_80A003C lsls r0, 24 cmp r0, 0 beq @080A02F6 bl sub_80A0024 movs r0, 0x1 b @080A02F8 @080A02F6: movs r0, 0 @080A02F8: pop {r1} bx r1 thumb_func_end sub_80A02D8 thumb_func_start sub_80A02FC sub_80A02FC: ; 80A02FC push {lr} movs r0, 0 bl a_pressed_maybe lsls r0, 16 cmp r0, 0 bne @080A0316 movs r0, 0x16 bl audio_play ldr r1, =0x0203761c ldr r0, =sub_80A0324 str r0, [r1] @080A0316: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A02FC thumb_func_start sub_80A0324 sub_80A0324: ; 80A0324 push {lr} bl sub_80A0070 lsls r0, 24 cmp r0, 0 beq @080A0338 bl sub_80A0024 movs r0, 0x3 b @080A033A @080A0338: movs r0, 0 @080A033A: pop {r1} bx r1 thumb_func_end sub_80A0324 thumb_func_start sub_80A0340 sub_80A0340: ; 80A0340 ldr r1, =0x0203761c ldr r0, =sub_80A035C str r0, [r1] ldr r1, =0x02037621 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_08252CFB ldr r1, =sub_80A0388 bl sub_809FF98 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A035C thumb_func_start sub_80A0388 sub_80A0388: ; 80A0388 push {lr} movs r0, 0x1 bl sub_8197948 ldr r1, =0x0203761c ldr r0, =sub_80A03A4 str r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A0388 thumb_func_start sub_80A03A4 sub_80A03A4: ; 80A03A4 push {lr} bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 beq @080A03C6 cmp r1, 0 bgt @080A03C0 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @080A03CA b @080A03D2 @080A03C0: cmp r1, 0x1 beq @080A03CA b @080A03D2 @080A03C6: movs r0, 0x2 b @080A03D4 @080A03CA: bl sub_80A0014 movs r0, 0x1 b @080A03D4 @080A03D2: movs r0, 0 @080A03D4: pop {r1} bx r1 thumb_func_end sub_80A03A4 thumb_func_start sub_80A03D8 sub_80A03D8: ; 80A03D8 push {lr} bl copy_pal_bg_faded_to_pal_ram pop {r0} bx r0 thumb_func_end sub_80A03D8 thumb_func_start sub_80A03E4 sub_80A03E4: ; 80A03E4 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 mov r8, r0 ldrb r0, [r0] cmp r0, 0x4 bls @080A03F6 b @080A04FC @080A03F6: lsls r0, 2 ldr r1, =@080A0404 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x040000d4 mov r0, sp str r0, [r1] str r2, [r1, 0x4] ldr r0, =0x81000200 str r0, [r1, 0x8] ldr r0, [r1, 0x8] movs r2, 0xC0 lsls r2, 19 movs r3, 0xC0 lsls r3, 9 mov r4, sp movs r6, 0 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 movs r0, 0x81 lsls r0, 24 mov r12, r0 @080A045A: strh r6, [r4] mov r0, sp str r0, [r1] str r2, [r1, 0x4] str r7, [r1, 0x8] ldr r0, [r1, 0x8] adds r2, r5 subs r3, r5 cmp r3, r5 bhi @080A045A strh r6, [r4] mov r0, sp str r0, [r1] str r2, [r1, 0x4] lsrs r0, r3, 1 mov r2, r12 orrs r0, r2 str r0, [r1, 0x8] ldr r0, [r1, 0x8] b @080A04FC .align 2, 0 .pool @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, =gUnknown_085105A8 movs r0, 0 movs r2, 0x1 bl bg_vram_setup ldr r0, =gUnknown_085105AC 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 .pool @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, =sub_80A03D8 bl SetVBlankCallback movs r0, 0x1 bl enable_irqs b @080A04FC .align 2, 0 .pool @080A04F8: movs r0, 0x1 b @080A0506 @080A04FC: mov r1, r8 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r0, 0 @080A0506: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80A03E4 thumb_func_start sub_80A0514 sub_80A0514: ; 80A0514 push {lr} ldr r0, =0x030026f8 bl sub_80A03E4 cmp r0, 0 beq @080A052E ldr r0, =sub_80A0550 movs r1, 0x50 bl AddTask ldr r0, =sub_80A0540 bl set_callback2 @080A052E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r5, r0, r1 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080A0570 b @080A06A8 @080A0570: movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0x6 bls @080A057A b @080A06A8 @080A057A: lsls r0, 2 ldr r1, =@080A0590 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080A0590: .4byte @080A05AC .4byte @080A0630 .4byte @080A063C .4byte @080A065C .4byte @080A0670 .4byte @080A0688 .4byte @080A0698 @080A05AC: movs r0, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r2, =gUnknown_082C8959 movs r4, 0 str r4, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r6, 0x1 str r6, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 movs r3, 0xFF bl 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, =0x030030fc 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 .pool @080A061C: movs r0, 0x5 b @080A06A6 @080A0620: ldr r0, =0x03002700 movs r1, 0x1 strb r1, [r0] movs r0, 0x1 b @080A06A6 .align 2, 0 .pool @080A0630: bl sub_8076D5C bl sub_8153430 movs r0, 0x2 b @080A06A6 @080A063C: bl sub_8153474 lsls r0, 24 cmp r0, 0 beq @080A06A8 bl sav2_gender2_inplace_and_xFE movs r0, 0x3 strh r0, [r5] ldr r1, =0x03002700 movs r0, 0 strb r0, [r1] b @080A06A8 .align 2, 0 .pool @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, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 adds r0, r4, 0 bl remove_task b @080A06A8 .align 2, 0 .pool @080A0688: ldr r0, =sub_8153688 movs r1, 0x5 bl AddTask movs r0, 0x6 b @080A06A6 .align 2, 0 .pool @080A0698: ldr r0, =sub_8153688 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080A06A8 movs r0, 0x3 @080A06A6: strh r0, [r5] @080A06A8: add sp, 0x10 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A0550 thumb_func_start sub_80A06B4 sub_80A06B4: ; 80A06B4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x14 ldr r0, =gUnknown_085105BC ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0xC] str r1, [sp, 0x10] ldr r0, =0x00000861 mov r10, r0 bl 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, =0xffffff00 ldr r0, [sp, 0x10] ands r0, r2 orrs r0, r1 str r0, [sp, 0x10] @080A06EC: ldr r6, =0x02037622 add r0, sp, 0xC bl Window_AddFromTemplate strb r0, [r6] ldrb r0, [r6] movs r1, 0 bl sub_81973FC ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] movs r1, 0x4 mov r9, r1 cmp r0, 0 bne @080A0710 movs r0, 0x8 mov r9, r0 @080A0710: movs r4, 0x1 ldr r5, =0x02021fc4 movs r0, 0x3 adds r1, r5, 0 movs r2, 0x6 bl sub_819A344 ldrb r0, [r6] str r4, [sp] movs r1, 0xFF mov r8, r1 str r1, [sp, 0x4] movs r7, 0 str r7, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 movs r3, 0 bl Print movs r4, 0x11 ldrb r0, [r6] ldr r2, =gUnknown_085EED26 str r4, [sp] mov r1, r8 str r1, [sp, 0x4] str r7, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print movs r0, 0 adds r1, r5, 0 mov r2, r9 bl sub_819A344 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x70 bl 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, =gUnknown_085EED2D str r4, [sp] mov r1, r8 str r1, [sp, 0x4] str r7, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print movs r0, 0x4 adds r1, r5, 0 mov r2, r9 bl sub_819A344 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x70 bl 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, =gUnknown_085EED34 str r4, [sp] mov r1, r8 str r1, [sp, 0x4] str r7, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print movs r0, 0x1 adds r1, r5, 0 mov r2, r9 bl sub_819A344 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x70 bl 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, =gUnknown_085EED3C lsls r4, 24 lsrs r4, 24 str r4, [sp] mov r1, r8 str r1, [sp, 0x4] str r7, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print movs r0, 0x2 adds r1, r5, 0 mov r2, r9 bl sub_819A344 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x70 bl 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 .pool thumb_func_end sub_80A06B4 thumb_func_start sub_80A0888 sub_80A0888: ; 80A0888 push {r4,lr} ldr r4, =0x02037622 ldrb r0, [r4] movs r1, 0 bl sub_819746C ldrb r0, [r4] bl Window_Remove pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A0888 thumb_func_start sub_80A08A4 sub_80A08A4: ; 80A08A4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =sub_8153688 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080A08C0 adds r0, r4, 0 bl remove_task bl script_env_2_enable_and_set_ctx_running @080A08C0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A08A4 thumb_func_start sub_80A08CC sub_80A08CC: ; 80A08CC push {r4,r5,lr} ldr r0, =sub_8153688 movs r1, 0x5 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r5, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r5 movs r1, 0x1 strh r1, [r0, 0xC] ldr r0, =sub_80A08A4 movs r1, 0x6 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r5 strh r4, [r1, 0xA] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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 ; void sub_80A0954() sub_80A0954: ; 80A0954 push {lr} sub sp, 0x4 ldr r1, =0x03000f34 movs r0, 0 strb r0, [r1] movs r0, 0 str r0, [sp] ldr r1, =0x02037624 ldr r2, =0x0500003c mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03000f34 ldrb r0, [r3] cmp r0, 0x13 bhi @080A09C0 ldr r2, =0x02037624 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 .pool thumb_func_end sub_80A0980 thumb_func_start sub_80A09D0 sub_80A09D0: ; 80A09D0 push {r4-r6,lr} movs r3, 0 ldr r4, =0x03000f34 adds r6, r4, 0 ldrb r0, [r4] cmp r3, r0 bge @080A0A02 ldr r2, =0x040000d4 ldr r1, =0x02037624 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 .pool 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, =0x03000f36 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] ldr r1, =0x03000f38 lsls r0, 16 lsrs r0, 16 ldrh r1, [r1] cmp r0, r1 bcc @080A0A56 movs r0, 0 strh r0, [r2] @080A0A56: ldr r4, =0x03000f3a ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] ldr r1, =0x03000f3c lsls r0, 16 lsrs r0, 16 ldrh r1, [r1] cmp r0, r1 bcc @080A0A6E movs r0, 0 strh r0, [r4] @080A0A6E: ldr r0, =0x03000f40 ldr r1, [r0] cmp r1, 0 beq @080A0A7C ldrh r0, [r2] bl _call_via_r1 @080A0A7C: ldr r0, =0x03000f44 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 .pool thumb_func_end sub_80A0A38 thumb_func_start cur_mapheader_run_tileset1_func cur_mapheader_run_tileset1_func: ; 80A0AA8 push {lr} ldr r0, =0x03000f36 movs r1, 0 strh r1, [r0] ldr r0, =0x03000f38 strh r1, [r0] ldr r1, =0x03000f40 movs r0, 0 str r0, [r1] ldr r0, =0x02037318 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 .pool 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, =0x03000f3a movs r1, 0 strh r1, [r0] ldr r0, =0x03000f3c strh r1, [r0] ldr r1, =0x03000f44 movs r0, 0 str r0, [r1] ldr r0, =0x02037318 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 .pool thumb_func_end cur_mapheader_run_tileset2_func thumb_func_start sub_80A0B20 sub_80A0B20: ; 80A0B20 ldr r1, =0x03000f36 movs r0, 0 strh r0, [r1] ldr r1, =0x03000f38 movs r2, 0x80 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x03000f40 ldr r0, =sub_80A0B70 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0B20 thumb_func_start sub_80A0B48 sub_80A0B48: ; 80A0B48 ldr r1, =0x03000f36 movs r0, 0 strh r0, [r1] ldr r1, =0x03000f38 movs r2, 0x80 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x03000f40 ldr r0, =sub_80A0BB4 str r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_08510764 lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06003f80 movs r2, 0x80 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08512574 lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x06003600 movs r2, 0xF0 lsls r2, 2 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08512E54 lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06003a00 movs r2, 0xA0 lsls r2, 1 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08513174 lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06003e00 movs r2, 0xC0 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A0C44 thumb_func_start sub_80A0C6C sub_80A0C6C: ; 80A0C6C ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0C6C thumb_func_start sub_80A0C94 sub_80A0C94: ; 80A0C94 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A103C str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0C94 thumb_func_start sub_80A0CC0 sub_80A0CC0: ; 80A0CC0 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A10B8 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0CC0 thumb_func_start sub_80A0CEC sub_80A0CEC: ; 80A0CEC ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A10D0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0CEC thumb_func_start sub_80A0D18 sub_80A0D18: ; 80A0D18 ldr r1, =0x03000f3a ldr r0, =0x03000f36 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A10E8 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0D18 thumb_func_start sub_80A0D48 sub_80A0D48: ; 80A0D48 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A115C str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0D48 thumb_func_start sub_80A0D74 sub_80A0D74: ; 80A0D74 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0D74 thumb_func_start sub_80A0D9C sub_80A0D9C: ; 80A0D9C ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0D9C thumb_func_start sub_80A0DC4 sub_80A0DC4: ; 80A0DC4 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0DC4 thumb_func_start sub_80A0DEC sub_80A0DEC: ; 80A0DEC ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0DEC thumb_func_start sub_80A0E14 sub_80A0E14: ; 80A0E14 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A1188 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0E14 thumb_func_start sub_80A0E40 sub_80A0E40: ; 80A0E40 ldr r1, =0x03000f3a ldr r0, =0x03000f36 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A11FC str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0E40 thumb_func_start sub_80A0E70 sub_80A0E70: ; 80A0E70 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A122C str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0E70 thumb_func_start sub_80A0E9C sub_80A0E9C: ; 80A0E9C ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A127C str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0E9C thumb_func_start sub_80A0EC8 sub_80A0EC8: ; 80A0EC8 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A1294 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0EC8 thumb_func_start sub_80A0EF4 sub_80A0EF4: ; 80A0EF4 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c movs r0, 0x80 strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A1244 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0EF4 thumb_func_start Tileset28AnimationHeader Tileset28AnimationHeader: ; 80A0F18 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c movs r0, 0xF0 strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A15D8 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end Tileset28AnimationHeader thumb_func_start sub_80A0F3C sub_80A0F3C: ; 80A0F3C ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A1260 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0F3C thumb_func_start sub_80A0F68 sub_80A0F68: ; 80A0F68 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c movs r0, 0x80 strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A15F0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0F68 thumb_func_start sub_80A0F8C sub_80A0F8C: ; 80A0F8C ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A15C0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0F8C thumb_func_start sub_80A0FB8 sub_80A0FB8: ; 80A0FB8 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A161C str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0FB8 thumb_func_start sub_80A0FE4 sub_80A0FE4: ; 80A0FE4 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A1634 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A0FE4 thumb_func_start sub_80A1010 sub_80A1010: ; 80A1010 ldr r1, =0x03000f3a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f3c ldr r0, =0x03000f38 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03000f44 ldr r0, =sub_80A1658 str r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_08513684 lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06003c00 movs r2, 0xA0 lsls r2, 1 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08513894 lsls r0, 2 adds r0, r5 ldr r0, [r0] ldr r1, =0x06006400 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, =0x06006480 movs r2, 0x80 bl sub_80A0980 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085143E4 lsrs r1, 22 adds r1, r0 ldr r0, [r1] ldr r1, =0x06007a00 movs r2, 0xF0 lsls r2, 2 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085145F4 lsrs r1, 22 adds r1, r0 ldr r0, [r1] ldr r1, =0x06007e00 movs r2, 0x80 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08514E04 lsrs r1, 22 adds r1, r0 ldr r0, [r1] ldr r1, =0x06007e00 movs r2, 0x80 lsls r2, 1 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08515384 lsrs r4, 14 adds r0, r4, r0 ldr r0, [r0] ldr r1, =gUnknown_08515344 lsls r5, r6, 2 adds r1, r5, r1 ldr r1, [r1] movs r2, 0x80 bl sub_80A0980 ldr r0, =gUnknown_085153B4 adds r4, r0 ldr r0, [r4] ldr r1, =gUnknown_08515364 adds r5, r1 ldr r1, [r5] movs r2, 0x80 bl sub_80A0980 b @080A141C .align 2, 0 .pool @080A13F0: movs r0, 0x3 ands r5, r0 ldr r0, =gUnknown_085153E4 lsls r5, 2 adds r0, r5, r0 ldr r0, [r0] ldr r1, =gUnknown_08515344 lsls r4, r6, 2 adds r1, r4, r1 ldr r1, [r1] movs r2, 0x80 bl sub_80A0980 ldr r0, =gUnknown_085153F4 adds r5, r0 ldr r0, [r5] ldr r1, =gUnknown_08515364 adds r4, r1 ldr r1, [r4] movs r2, 0x80 bl sub_80A0980 @080A141C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08515824 lsrs r1, 14 adds r1, r0 ldr r2, [r1] cmp r2, 0 beq @080A1464 ldr r0, =gUnknown_08515804 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 .pool 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, =gUnknown_08515964 lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x06007800 movs r2, 0x80 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08515D8C lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06005400 movs r2, 0x80 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085161DC lsrs r2, 14 adds r2, r0 ldr r0, [r2] ldr r2, =gUnknown_085161BC lsls r1, 2 adds r1, r2 ldr r1, [r1] movs r2, 0x80 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08515D8C lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06007400 movs r2, 0x80 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085164FC lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06005540 movs r2, 0xC0 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0851680C lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06005b40 movs r2, 0xC0 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08516B1C lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06005b40 movs r2, 0xC0 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08516D2C lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06005c00 movs r2, 0x80 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08516E3C lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x06003e00 movs r2, 0x80 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08517A44 lsrs r4, 14 adds r0, r4, r0 ldr r0, [r0] ldr r1, =0x06007e00 movs r2, 0xC0 lsls r2, 1 bl sub_80A0980 ldr r0, =gUnknown_08517A50 adds r4, r0 ldr r0, [r4] ldr r1, =0x06007a00 movs r2, 0xA0 lsls r2, 2 bl sub_80A0980 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08517BFC lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06007f00 movs r2, 0x20 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08517C0C lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x06007c00 movs r2, 0x80 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08518034 lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x06005200 movs r2, 0x80 lsls r2, 2 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0851829C lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =0x06007e00 movs r2, 0x90 lsls r2, 1 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085202C4 lsrs r1, 14 adds r1, r0 ldr r0, [r1] ldr r1, =0x06005e00 movs r2, 0xC0 lsls r2, 4 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08524864 lsrs r0, 14 adds r0, r1 ldr r0, [r0] ldr r1, =0x060052e0 movs r2, 0x80 lsls r2, 1 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08524870 lsrs r0, 14 adds r0, r1 ldr r0, [r0] ldr r1, =0x060050e0 movs r2, 0x80 lsls r2, 1 bl sub_80A0980 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A17EC thumb_func_start sub_80A1818 sub_80A1818: ; 80A1818 push {lr} lsls r0, 16 ldr r2, =gUnknown_0852487C movs r1, 0xC0 lsls r1, 10 ands r1, r0 lsrs r1, 14 adds r1, r2 ldr r0, [r1] ldr r1, =0x02037814 movs r2, 0x10 bl CpuSet ldr r0, =0x02037fd4 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, =sub_8149DFC bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @080A1862 ldr r1, =0x03000f44 ldr r0, =sub_80A1670 str r0, [r1] ldr r1, =0x03000f3c movs r0, 0x20 strh r0, [r1] @080A1862: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A1818 thumb_func_start sub_80A1884 sub_80A1884: ; 80A1884 push {lr} lsls r0, 16 ldr r2, =gUnknown_0852487C movs r1, 0xC0 lsls r1, 10 ands r1, r0 lsrs r1, 14 adds r1, r2 ldr r0, [r1] ldr r1, =0x02037814 movs r2, 0x10 bl CpuSet ldr r0, =sub_8149DFC bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @080A18D6 ldr r0, =0x02037fd4 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, =0x03000f3c ldrh r0, [r1] subs r0, 0x1 strh r0, [r1] lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 bne @080A18D6 ldr r0, =0x03000f44 str r1, [r0] @080A18D6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A1884 thumb_func_start decompress_palette ; void decompress_palette(void *src, u16 offset, u16 size) decompress_palette: ; 80A18F4 push {r4-r6,lr} adds r4, r1, 0 adds r5, r2, 0 lsls r4, 16 lsrs r4, 16 lsls r5, 16 ldr r6, =0x02037fe8 adds r1, r6, 0 bl call_LZZUnCompWram lsls r4, 1 ldr r1, =0x02037714 adds r1, r4, r1 lsrs r5, 17 adds r0, r6, 0 adds r2, r5, 0 bl CpuSet ldr r0, =0x02037b14 adds r4, r0 adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 bl CpuSet pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end decompress_palette thumb_func_start gpu_pal_apply ; void gpu_pal_apply(void *src, int dest_offset, int mode) gpu_pal_apply: ; 80A1938 push {r4-r6,lr} adds r6, r0, 0 adds r4, r1, 0 adds r5, r2, 0 lsls r4, 16 lsls r5, 16 lsrs r4, 15 ldr r1, =0x02037714 adds r1, r4, r1 lsrs r5, 17 adds r2, r5, 0 bl CpuSet ldr r0, =0x02037b14 adds r4, r0 adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 bl CpuSet pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end gpu_pal_apply thumb_func_start rboxid_80040B8 rboxid_80040B8: ; 80A1970 push {r4-r6,lr} sub sp, 0x4 adds r6, r0, 0 adds r4, r1, 0 adds r5, r2, 0 lsls r6, 16 lsrs r6, 16 lsls r4, 16 lsls r5, 16 mov r0, sp strh r6, [r0] lsrs r4, 15 ldr r1, =0x02037714 adds r1, r4, r1 lsrs r5, 17 movs r0, 0x80 lsls r0, 17 orrs r5, r0 mov r0, sp adds r2, r5, 0 bl CpuSet mov r0, sp adds r0, 0x2 strh r6, [r0] ldr r1, =0x02037b14 adds r4, r1 adds r1, r4, 0 adds r2, r5, 0 bl CpuSet add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end rboxid_80040B8 thumb_func_start copy_pal_bg_faded_to_pal_ram ; void copy_pal_bg_faded_to_pal_ram() copy_pal_bg_faded_to_pal_ram: ; 80A19C0 push {r4,r5,lr} ldr r4, =0x02037fd4 ldrb r1, [r4, 0x8] movs r5, 0x80 adds r0, r5, 0 ands r0, r1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 bne @080A1A02 ldr r1, =0x02037b14 movs r2, 0xA0 lsls r2, 19 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x80000200 str r1, [r0, 0x8] ldr r0, [r0, 0x8] ldr r0, =0x02037fe4 str r3, [r0] ldrb r1, [r4, 0x9] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 bne @080A1A02 ldrb r1, [r4, 0x7] adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @080A1A02 bl sub_80A2968 @080A1A02: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end copy_pal_bg_faded_to_pal_ram thumb_func_start fade_and_return_progress_probably ; int fade_and_return_progress_probably() fade_and_return_progress_probably: ; 80A1A1C push {lr} ldr r0, =0x02037fe4 ldr r0, [r0] cmp r0, 0 beq @080A1A30 movs r0, 0xFF b @080A1A68 .align 2, 0 .pool @080A1A30: ldr r0, =0x02037fd4 ldrb r0, [r0, 0x9] movs r1, 0x3 ands r1, r0 cmp r1, 0 bne @080A1A48 bl pal_fade__0 b @080A1A56 .align 2, 0 .pool @080A1A48: cmp r1, 0x1 bne @080A1A52 bl pal_fade__1 b @080A1A56 @080A1A52: bl pal_fade__2 @080A1A56: lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x02037fe4 ldr r0, =0x02037fd4 ldr r0, [r0] movs r1, 0 orrs r0, r1 str r0, [r2] adds r0, r3, 0 @080A1A68: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end fade_and_return_progress_probably thumb_func_start sub_80A1A74 sub_80A1A74: ; 80A1A74 push {r4,lr} movs r4, 0 @080A1A78: adds r0, r4, 0 bl palslot_dead_struct_update adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @080A1A78 bl pal_fade_control_reset_maybe pop {r4} pop {r0} bx r0 thumb_func_end sub_80A1A74 thumb_func_start sub_80A1A94 sub_80A1A94: ; 80A1A94 push {r4-r7,lr} movs r0, 0xA0 lsls r0, 19 mov r12, r0 movs r4, 0 ldr r7, =0x02037714 ldr r6, =0x02037b14 ldr r5, =0x000001ff @080A1AA4: lsls r1, r4, 1 adds r3, r1, r7 mov r0, r12 adds r2, r1, r0 ldrh r0, [r2] strh r0, [r3] adds r1, r6 ldrh r0, [r2] strh r0, [r1] adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, r5 bls @080A1AA4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r5, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080A1B08 movs r0, 0 b @080A1C00 .align 2, 0 .pool @080A1B08: ldrb r0, [r5, 0xA] movs r3, 0x79 negs r3, r3 adds r2, r3, 0 ands r2, r0 movs r0, 0x10 orrs r2, r0 strb r2, [r5, 0xA] lsls r0, r6, 24 asrs r1, r0, 24 cmp r1, 0 bge @080A1B36 lsls r0, r2, 25 lsrs r0, 28 negs r1, r1 adds r0, r1 movs r1, 0xF ands r0, r1 lsls r0, 3 ands r2, r3 orrs r2, r0 strb r2, [r5, 0xA] movs r6, 0 @080A1B36: str r4, [r5] movs r4, 0x3F adds r1, r6, 0 ands r1, r4 ldrb r2, [r5, 0x4] movs r3, 0x40 negs r3, r3 adds r0, r3, 0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x4] ands r6, r4 ldrb r0, [r5, 0x8] ands r3, r0 orrs r3, r6 strb r3, [r5, 0x8] movs r0, 0x1F mov r1, r12 ands r1, r0 lsls r1, 6 ldrh r2, [r5, 0x4] ldr r0, =0xfffff83f ands r0, r2 orrs r0, r1 strh r0, [r5, 0x4] lsls r2, r7, 3 ldrb r1, [r5, 0x5] movs r0, 0x7 ands r0, r1 orrs r0, r2 strb r0, [r5, 0x5] ldr r1, =0x00007fff mov r0, r8 ands r1, r0 ldrh r2, [r5, 0x6] ldr r0, =0xffff8000 ands r0, r2 orrs r0, r1 strh r0, [r5, 0x6] ldrb r0, [r5, 0x7] movs r1, 0x80 orrs r0, r1 strb r0, [r5, 0x7] ldrb r1, [r5, 0x9] movs r0, 0x4 negs r0, r0 ands r0, r1 strb r0, [r5, 0x9] cmp r12, r7 bcs @080A1BB0 movs r0, 0x41 negs r0, r0 ands r3, r0 b @080A1BB4 .align 2, 0 .pool @080A1BB0: movs r0, 0x40 orrs r3, r0 @080A1BB4: strb r3, [r5, 0x8] bl fade_and_return_progress_probably ldr r4, =0x02037fd4 ldrb r1, [r4, 0x8] lsrs r5, r1, 7 movs r0, 0x7F ands r0, r1 strb r0, [r4, 0x8] ldr r0, =0x02037b14 movs r1, 0xA0 lsls r1, 19 ldr r2, =0x04000100 bl CpuSet ldr r1, =0x02037fe4 movs r0, 0 str r0, [r1] ldrb r1, [r4, 0x9] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 bne @080A1BF0 ldrb r1, [r4, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080A1BF0 bl sub_80A2968 @080A1BF0: ldr r2, =0x02037fd4 lsls r3, r5, 7 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 orrs r0, r3 strb r0, [r2, 0x8] movs r0, 0x1 @080A1C00: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037f14 adds r4, r0, r1 ldrb r0, [r4, 0x4] lsls r0, 31 cmp r0, 0 beq @080A1CCC ldr r2, [r4] ldrb r0, [r2, 0x8] lsls r0, 31 lsrs r0, 31 cmp r0, r7 bne @080A1CCC ldrh r1, [r4, 0x6] lsls r1, 20 lsrs r1, 25 ldrb r0, [r2, 0xB] lsls r0, 27 lsrs r0, 27 cmp r1, r0 bne @080A1CAA adds r0, r4, 0 bl sub_80A1F00 ldrb r0, [r4, 0x4] lsls r0, 31 cmp r0, 0 beq @080A1CCC @080A1CAA: ldrb r0, [r4, 0x8] cmp r0, 0 bne @080A1CC0 adds r0, r4, 0 adds r1, r6, 0 bl sub_80A1CDC b @080A1CC4 .align 2, 0 .pool @080A1CC0: subs r0, 0x1 strb r0, [r4, 0x8] @080A1CC4: adds r0, r4, 0 adds r1, r6, 0 bl sub_80A1E40 @080A1CCC: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0xF bls @080A1C6E pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80A1C64 thumb_func_start sub_80A1CDC sub_80A1CDC: ; 80A1CDC push {r4-r7,lr} mov r7, r8 push {r7} adds r4, r0, 0 mov r8, r1 movs r6, 0 ldrh r1, [r4, 0x6] lsls r1, 20 lsrs r1, 25 ldr r3, [r4] ldrb r0, [r3, 0x9] lsls r2, r0, 25 lsrs r0, r2, 27 adds r5, r1, 0 muls r5, r0 ldrb r1, [r3, 0x8] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080A1D78 lsrs r0, r2, 27 cmp r6, r0 bcs @080A1DC4 ldr r0, =0x02037714 mov r12, r0 ldr r7, =0x02037b14 @080A1D10: ldr r0, [r4, 0x4] lsls r0, 11 lsrs r0, 22 lsls r0, 1 add r0, r12 ldr r1, [r3, 0x4] lsls r2, r5, 1 adds r1, r2, r1 ldrh r1, [r1] strh r1, [r0] ldr r0, [r4, 0x4] lsls r0, 11 lsrs r0, 22 lsls r0, 1 adds r0, r7 ldr r1, [r4] ldr r1, [r1, 0x4] adds r2, r1 ldrh r1, [r2] strh r1, [r0] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 ldr r2, [r4, 0x4] lsls r1, r2, 11 lsrs r1, 22 adds r1, 0x1 ldr r0, =0x000003ff ands r1, r0 lsls r1, 11 ldr r0, =0xffe007ff ands r0, r2 orrs r0, r1 str r0, [r4, 0x4] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 ldr r3, [r4] ldrb r0, [r3, 0x9] lsls r0, 25 lsrs r0, 27 cmp r6, r0 bcc @080A1D10 b @080A1DC4 .align 2, 0 .pool @080A1D78: lsrs r0, r2, 27 cmp r6, r0 bcs @080A1DC4 ldr r3, =0x02037b14 @080A1D80: ldr r1, [r4, 0x4] lsls r1, 11 lsrs r1, 22 lsls r1, 1 adds r1, r3 ldr r0, [r4] ldr r2, [r0, 0x4] lsls r0, r5, 1 adds r0, r2 ldrh r0, [r0] strh r0, [r1] adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 ldr r2, [r4, 0x4] lsls r1, r2, 11 lsrs r1, 22 adds r1, 0x1 ldr r0, =0x000003ff ands r1, r0 lsls r1, 11 ldr r0, =0xffe007ff ands r0, r2 orrs r0, r1 str r0, [r4, 0x4] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 ldr r0, [r4] ldrb r0, [r0, 0x9] lsls r0, 25 lsrs r0, 27 cmp r6, r0 bcc @080A1D80 @080A1DC4: ldrh r0, [r4, 0x4] lsls r0, 21 lsrs r0, 23 lsls r0, 11 ldr r1, [r4, 0x4] ldr r2, =0xffe007ff ands r1, r2 orrs r1, r0 str r1, [r4, 0x4] ldr r3, [r4] ldrb r0, [r3, 0xA] strb r0, [r4, 0x8] ldrh r2, [r4, 0x6] lsls r0, r2, 20 lsrs r0, 25 adds r0, 0x1 movs r1, 0x7F ands r0, r1 lsls r0, 5 ldr r5, =0xfffff01f adds r1, r5, 0 ands r1, r2 orrs r1, r0 strh r1, [r4, 0x6] lsls r1, 20 lsrs r1, 25 ldrb r0, [r3, 0xB] lsls r0, 27 lsrs r0, 27 cmp r1, r0 blt @080A1E14 ldrb r0, [r4, 0x9] cmp r0, 0 beq @080A1E0C subs r0, 0x1 strb r0, [r4, 0x9] @080A1E0C: ldrh r1, [r4, 0x6] adds r0, r5, 0 ands r0, r1 strh r0, [r4, 0x6] @080A1E14: ldrh r0, [r4, 0x4] lsls r0, 21 lsrs r0, 27 movs r1, 0x1 lsls r1, r0 mov r2, r8 ldr r0, [r2] orrs r0, r1 str r0, [r2] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A1CDC thumb_func_start sub_80A1E40 sub_80A1E40: ; 80A1E40 push {r4-r6,lr} adds r4, r0, 0 ldr r3, =0x02037fd4 ldrb r1, [r3, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080A1EF4 ldrh r0, [r4, 0x4] lsls r0, 21 lsrs r6, r0, 23 asrs r1, r6, 4 movs r5, 0x1 adds r0, r5, 0 lsls r0, r1 ldr r1, [r3] ands r0, r1 cmp r0, 0 beq @080A1EF4 ldr r2, [r4] ldrb r1, [r2, 0x8] adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @080A1E9C ldrb r1, [r3, 0x4] lsls r1, 26 ldrb r0, [r3, 0x8] lsls r0, 26 cmp r1, r0 beq @080A1EF4 adds r0, r6, 0 ldrb r1, [r2, 0x9] lsls r1, 25 lsrs r1, 27 ldrh r2, [r3, 0x4] lsls r2, 21 lsrs r2, 27 ldrh r3, [r3, 0x6] lsls r3, 17 lsrs r3, 17 bl pal_fade_1 b @080A1EF4 .align 2, 0 .pool @080A1E9C: ldrb r1, [r3, 0x4] movs r0, 0x3F ands r0, r1 cmp r0, 0 bne @080A1EF4 ldrb r0, [r4, 0x8] ldrb r1, [r2, 0xA] cmp r0, r1 beq @080A1EF4 ldrh r0, [r4, 0x6] lsls r0, 20 lsrs r0, 25 ldrb r1, [r2, 0x9] lsls r1, 25 lsrs r2, r1, 27 adds r5, r0, 0 muls r5, r2 movs r3, 0 adds r1, r2, 0 cmp r3, r1 bcs @080A1EF4 ldr r6, =0x02037b14 @080A1EC8: ldrh r1, [r4, 0x4] lsls r1, 21 lsrs r1, 23 adds r1, r3 lsls r1, 1 adds r1, r6 ldr r2, [r4] adds r0, r5, r3 ldr r2, [r2, 0x4] lsls r0, 1 adds r0, r2 ldrh r0, [r0] strh r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 ldr r0, [r4] ldrb r0, [r0, 0x9] lsls r0, 25 lsrs r0, 27 cmp r3, r0 bcc @080A1EC8 @080A1EF4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A1E40 thumb_func_start sub_80A1F00 sub_80A1F00: ; 80A1F00 push {lr} adds r3, r0, 0 ldrb r0, [r3, 0x9] cmp r0, 0 bne @080A1F50 ldr r2, [r3] ldrb r0, [r2, 0xB] lsrs r0, 5 cmp r0, 0 bne @080A1F40 ldrh r1, [r3, 0x6] ldr r0, =0xfffff01f ands r0, r1 strh r0, [r3, 0x6] ldrb r0, [r2, 0xA] strb r0, [r3, 0x8] ldrb r0, [r2, 0xC] strb r0, [r3, 0x9] ldrh r0, [r3, 0x4] lsls r0, 21 lsrs r0, 23 lsls r0, 11 ldr r1, [r3, 0x4] ldr r2, =0xffe007ff ands r1, r2 orrs r1, r0 str r1, [r3, 0x4] b @080A1F54 .align 2, 0 .pool @080A1F40: cmp r0, 0 blt @080A1F54 cmp r0, 0x2 bgt @080A1F54 ldrh r0, [r2] bl sub_80A1F58 b @080A1F54 @080A1F50: subs r0, 0x1 strb r0, [r3, 0x9] @080A1F54: pop {r0} bx r0 thumb_func_end sub_80A1F00 thumb_func_start sub_80A1F58 sub_80A1F58: ; 80A1F58 push {lr} lsls r0, 16 lsrs r0, 16 bl sub_80A20A4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x10 beq @080A1F6E bl palslot_dead_struct_update @080A1F6E: pop {r0} bx r0 thumb_func_end sub_80A1F58 thumb_func_start palslot_dead_struct_update palslot_dead_struct_update: ; 80A1F74 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02037f14 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldr r0, =gUnknown_0852488C str r0, [r1] ldrb r2, [r1, 0x4] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1, 0x4] ldrh r2, [r1, 0x4] ldr r0, =0xfffff803 ands r0, r2 strh r0, [r1, 0x4] ldr r0, [r1, 0x4] ldr r2, =0xffe007ff ands r0, r2 str r0, [r1, 0x4] ldrh r2, [r1, 0x6] ldr r0, =0xfffff01f ands r0, r2 strh r0, [r1, 0x6] ldrb r2, [r1, 0x4] movs r0, 0x3 negs r0, r0 ands r0, r2 strb r0, [r1, 0x4] movs r0, 0 strb r0, [r1, 0x8] strb r0, [r1, 0x9] bx lr .align 2, 0 .pool thumb_func_end palslot_dead_struct_update thumb_func_start pal_fade_control_reset_maybe pal_fade_control_reset_maybe: ; 80A1FD0 ldr r2, =0x02037fd4 movs r0, 0 str r0, [r2] subs r0, 0x40 ldrb r1, [r2, 0x4] ands r0, r1 strb r0, [r2, 0x4] ldrh r1, [r2, 0x4] ldr r0, =0xfffff83f ands r0, r1 strh r0, [r2, 0x4] ldrb r1, [r2, 0x5] movs r0, 0x7 ands r0, r1 strb r0, [r2, 0x5] ldrh r1, [r2, 0x6] ldr r0, =0xffff8000 ands r0, r1 strh r0, [r2, 0x6] ldrb r1, [r2, 0x7] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x7] movs r0, 0 strb r0, [r2, 0x8] ldrb r1, [r2, 0x9] movs r3, 0x5 negs r3, r3 adds r0, r3, 0 ands r0, r1 movs r1, 0x9 negs r1, r1 ands r0, r1 strb r0, [r2, 0x9] ldrb r1, [r2, 0xA] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r2, 0xA] ldr r0, [r2, 0x8] ldr r1, =0xfffe0fff ands r0, r1 str r0, [r2, 0x8] ldrb r0, [r2, 0xA] ands r3, r0 movs r0, 0x79 negs r0, r0 ands r3, r0 movs r0, 0x10 orrs r3, r0 strb r3, [r2, 0xA] bx lr .align 2, 0 .pool thumb_func_end pal_fade_control_reset_maybe thumb_func_start sub_80A2048 sub_80A2048: ; 80A2048 push {lr} lsls r0, 16 lsrs r0, 16 bl sub_80A20A4 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x10 beq @080A206C ldr r1, =0x02037f14 lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x4] movs r2, 0x2 orrs r1, r2 strb r1, [r0, 0x4] @080A206C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2048 thumb_func_start sub_80A2074 sub_80A2074: ; 80A2074 push {lr} lsls r0, 16 lsrs r0, 16 bl sub_80A20A4 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x10 beq @080A209A ldr r0, =0x02037f14 lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x4] movs r0, 0x3 negs r0, r0 ands r0, r2 strb r0, [r1, 0x4] @080A209A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2074 thumb_func_start sub_80A20A4 sub_80A20A4: ; 80A20A4 push {lr} lsls r0, 16 lsrs r2, r0, 16 movs r1, 0 ldr r3, =0x02037f14 @080A20AE: lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldr r0, [r0] ldrh r0, [r0] cmp r0, r2 bne @080A20C8 adds r0, r1, 0 b @080A20D4 .align 2, 0 .pool @080A20C8: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0xF bls @080A20AE movs r0, 0x10 @080A20D4: pop {r1} bx r1 thumb_func_end sub_80A20A4 thumb_func_start pal_fade__0 pal_fade__0: ; 80A20D8 push {r4-r7,lr} ldr r4, =0x02037fd4 ldrb r1, [r4, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080A20F0 movs r0, 0 b @080A220C .align 2, 0 .pool @080A20F0: bl sub_80A29BC lsls r0, 24 cmp r0, 0 beq @080A20FE ldrb r0, [r4, 0x7] b @080A220A @080A20FE: ldrb r1, [r4, 0xA] movs r0, 0x4 ands r0, r1 cmp r0, 0 bne @080A2132 ldrb r2, [r4, 0x4] lsls r1, r2, 26 ldrb r0, [r4, 0x8] lsls r0, 26 cmp r1, r0 bcs @080A212A lsrs r0, r1, 26 adds r0, 0x1 movs r1, 0x3F ands r0, r1 movs r1, 0x40 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r4, 0x4] movs r0, 0x2 b @080A220C @080A212A: movs r0, 0x40 negs r0, r0 ands r0, r2 strb r0, [r4, 0x4] @080A2132: movs r5, 0 ldr r2, =0x02037fd4 ldrb r1, [r2, 0xA] movs r0, 0x4 ands r0, r1 adds r7, r2, 0 cmp r0, 0 bne @080A214C ldrh r4, [r7] b @080A2152 .align 2, 0 .pool @080A214C: ldrh r4, [r7, 0x2] movs r5, 0x80 lsls r5, 1 @080A2152: cmp r4, 0 beq @080A2184 ldr r7, =0x02037fd4 adds r6, r7, 0 @080A215A: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @080A2176 ldrh r2, [r6, 0x4] lsls r2, 21 lsrs r2, 27 ldrh r3, [r6, 0x6] lsls r3, 17 lsrs r3, 17 adds r0, r5, 0 movs r1, 0x10 bl pal_fade_1 @080A2176: lsrs r4, 1 adds r0, r5, 0 adds r0, 0x10 lsls r0, 16 lsrs r5, r0, 16 cmp r4, 0 bne @080A215A @080A2184: ldrb r2, [r7, 0xA] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r4, 0x5 negs r4, r4 ands r4, r2 orrs r4, r1 strb r4, [r7, 0xA] movs r0, 0x4 ands r0, r4 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 bne @080A2208 ldrh r6, [r7, 0x4] lsls r2, r6, 21 ldrb r0, [r7, 0x5] lsls r5, r0, 24 lsrs r1, r2, 27 lsrs r0, r5, 27 cmp r1, r0 bne @080A21C4 str r3, [r7] movs r0, 0x2 orrs r4, r0 strb r4, [r7, 0xA] b @080A2208 .align 2, 0 .pool @080A21C4: ldrb r1, [r7, 0x8] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @080A21E0 lsrs r3, r2, 27 lsls r0, r4, 25 lsrs r0, 28 adds r3, r0, r3 lsrs r0, r5, 27 cmp r3, r0 ble @080A21F6 adds r3, r0, 0 b @080A21F6 @080A21E0: lsrs r3, r2, 27 lsls r0, r4, 25 lsrs r0, 28 subs r0, r3, r0 lsls r0, 24 lsrs r3, r0, 24 asrs r0, 24 lsrs r1, r5, 27 cmp r0, r1 bge @080A21F6 adds r3, r1, 0 @080A21F6: lsls r0, r3, 24 asrs r0, 24 movs r1, 0x1F ands r0, r1 lsls r0, 6 ldr r1, =0xfffff83f ands r1, r6 orrs r1, r0 strh r1, [r7, 0x4] @080A2208: ldrb r0, [r7, 0x7] @080A220A: lsrs r0, 7 @080A220C: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end pal_fade__0 thumb_func_start sub_80A2218 sub_80A2218: ; 80A2218 push {r4-r7,lr} adds r1, r0, 0 movs r3, 0 cmp r1, 0 beq @080A2256 ldr r7, =0x02037b14 @080A2224: movs r0, 0x1 ands r0, r1 lsrs r4, r1, 1 adds r5, r3, 0 adds r5, 0x10 cmp r0, 0 beq @080A224C movs r2, 0 adds r6, r7, 0 @080A2236: adds r0, r3, r2 lsls r0, 1 adds r0, r6 ldrh r1, [r0] mvns r1, r1 strh r1, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xF bls @080A2236 @080A224C: adds r1, r4, 0 lsls r0, r5, 16 lsrs r3, r0, 16 cmp r1, 0 bne @080A2224 @080A2256: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2218 thumb_func_start sub_80A2260 sub_80A2260: ; 80A2260 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 adds r4, r0, 0 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 str r2, [sp] lsls r3, 24 lsrs r3, 24 str r3, [sp, 0x4] movs r0, 0 mov r9, r0 cmp r4, 0 beq @080A231C lsls r1, 24 str r1, [sp, 0x8] @080A228A: movs r0, 0x1 ands r0, r4 lsrs r4, 1 str r4, [sp, 0xC] movs r1, 0x10 add r1, r9 mov r10, r1 cmp r0, 0 beq @080A230E movs r4, 0 ldr r2, =0x02037b14 mov r8, r2 ldr r1, [sp] lsls r0, r1, 24 ldr r2, [sp, 0x4] lsls r1, r2, 24 ldr r2, [sp, 0x8] asrs r2, 24 mov r12, r2 movs r5, 0x1F asrs r7, r0, 24 asrs r6, r1, 24 @080A22B6: mov r0, r9 adds r2, r0, r4 lsls r2, 1 add r2, r8 ldr r1, [r2] lsls r1, 27 lsrs r1, 27 add r1, r12 ands r1, r5 ldrb r3, [r2] movs r0, 0x20 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] ldr r1, [r2] lsls r1, 22 lsrs r1, 27 adds r1, r7 movs r0, 0x1F ands r1, r0 lsls r1, 5 ldrh r3, [r2] ldr r0, =0xfffffc1f ands r0, r3 orrs r0, r1 strh r0, [r2] ldr r1, [r2] lsls r1, 17 lsrs r1, 27 adds r1, r6 ands r1, r5 lsls r1, 2 ldrb r3, [r2, 0x1] movs r0, 0x7D negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2, 0x1] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0xF bls @080A22B6 @080A230E: ldr r4, [sp, 0xC] mov r1, r10 lsls r0, r1, 16 lsrs r0, 16 mov r9, r0 cmp r4, 0 bne @080A228A @080A231C: add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2260 thumb_func_start sub_80A2334 sub_80A2334: ; 80A2334 push {r4-r7,lr} mov r7, r8 push {r7} adds r1, r0, 0 movs r3, 0 cmp r1, 0 beq @080A237E ldr r0, =0x02037b14 mov r8, r0 ldr r0, =0x02037714 mov r12, r0 @080A234A: movs r0, 0x1 ands r0, r1 lsrs r4, r1, 1 adds r5, r3, 0 adds r5, 0x10 cmp r0, 0 beq @080A2374 movs r2, 0 mov r7, r8 mov r6, r12 @080A235E: adds r0, r3, r2 lsls r0, 1 adds r1, r0, r7 adds r0, r6 ldrh r0, [r0] strh r0, [r1] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xF bls @080A235E @080A2374: adds r1, r4, 0 lsls r0, r5, 16 lsrs r3, r0, 16 cmp r1, 0 bne @080A234A @080A237E: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2334 thumb_func_start sub_80A2390 sub_80A2390: ; 80A2390 push {lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x02037fd4 ldrb r2, [r3, 0xA] movs r1, 0x79 negs r1, r1 ands r1, r2 movs r2, 0x10 orrs r1, r2 strb r1, [r3, 0xA] bl sub_80A23B4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2390 thumb_func_start sub_80A23B4 sub_80A23B4: ; 80A23B4 push {r4,lr} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 adds r4, r0, 0 ldr r2, =0x02037fd4 ldrh r0, [r2, 0x4] movs r3, 0xF8 lsls r3, 3 adds r1, r3, 0 orrs r0, r1 strh r0, [r2, 0x4] movs r1, 0x3F ands r1, r4 ldrb r3, [r2, 0x8] movs r0, 0x40 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2, 0x8] ldrb r0, [r2, 0x7] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x7] ldrb r1, [r2, 0x9] movs r0, 0x4 negs r0, r0 ands r0, r1 movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x9] cmp r4, 0x2 bne @080A2406 mov r1, sp movs r0, 0 strh r0, [r1] ldr r1, =0x02037b14 ldr r2, =0x01000200 mov r0, sp bl CpuSet @080A2406: cmp r4, 0 bne @080A241C mov r0, sp adds r0, 0x2 ldr r2, =0x00007fff adds r1, r2, 0 strh r1, [r0] ldr r1, =0x02037b14 ldr r2, =0x01000200 bl CpuSet @080A241C: bl fade_and_return_progress_probably add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A23B4 thumb_func_start pal_fade__1 pal_fade__1: ; 80A2438 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 ldr r4, =0x02037fd4 ldrb r1, [r4, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080A2458 movs r0, 0 b @080A2792 .align 2, 0 .pool @080A2458: bl sub_80A29BC lsls r0, 24 cmp r0, 0 beq @080A2466 ldrb r0, [r4, 0x7] b @080A2790 @080A2466: ldrb r1, [r4, 0xA] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080A247C movs r2, 0x80 lsls r2, 1 movs r0, 0x80 lsls r0, 2 mov r10, r0 b @080A2484 @080A247C: movs r2, 0 movs r1, 0x80 lsls r1, 1 mov r10, r1 @080A2484: ldr r1, =0x02037fd4 ldrb r0, [r1, 0x8] lsls r0, 26 lsrs r0, 26 cmp r0, 0x1 beq @080A2544 cmp r0, 0x1 bgt @080A24A0 cmp r0, 0 beq @080A24AE b @080A2694 .align 2, 0 .pool @080A24A0: cmp r0, 0x2 bne @080A24A6 b @080A25A8 @080A24A6: cmp r0, 0x3 bne @080A24AC b @080A2630 @080A24AC: b @080A2694 @080A24AE: adds r7, r2, 0 cmp r7, r10 bcc @080A24B6 b @080A2694 @080A24B6: lsls r2, r7, 1 ldr r0, =0x02037714 adds r0, r2, r0 ldr r1, [r0] lsls r3, r1, 27 lsls r0, r1, 22 lsrs r0, 27 mov r12, r0 lsls r1, 17 lsrs r1, 27 mov r8, r1 ldr r0, =0x02037b14 adds r2, r0 mov r9, r2 ldr r1, [r2] lsls r2, r1, 27 lsrs r2, 3 movs r4, 0xFE lsls r4, 24 adds r2, r4 lsls r0, r1, 22 lsrs r0, 27 subs r0, 0x2 lsls r0, 24 lsrs r5, r0, 24 lsls r1, 17 lsrs r1, 27 subs r1, 0x2 lsls r1, 24 lsrs r4, r1, 24 lsrs r6, r2, 24 asrs r2, 24 lsrs r3, 3 asrs r0, r3, 24 cmp r2, r0 bge @080A2500 lsrs r6, r3, 24 @080A2500: lsls r0, r5, 24 asrs r0, 24 mov r2, r12 lsls r1, r2, 24 cmp r0, r12 bge @080A250E lsrs r5, r1, 24 @080A250E: lsls r0, r4, 24 asrs r0, 24 mov r3, r8 lsls r1, r3, 24 cmp r0, r8 bge @080A251C lsrs r4, r1, 24 @080A251C: lsls r1, r6, 24 asrs r1, 24 lsls r0, r5, 24 asrs r0, 19 orrs r1, r0 lsls r0, r4, 24 asrs r0, 14 orrs r1, r0 mov r4, r9 strh r1, [r4] adds r0, r7, 0x1 lsls r0, 16 lsrs r7, r0, 16 cmp r7, r10 bcc @080A24B6 b @080A2694 .align 2, 0 .pool @080A2544: adds r7, r2, 0 cmp r7, r10 bcc @080A254C b @080A2694 @080A254C: lsls r1, r7, 1 ldr r0, =0x02037b14 adds r2, r1, r0 ldr r1, [r2] lsls r0, r1, 27 lsrs r0, 3 movs r3, 0x80 lsls r3, 18 adds r0, r3 lsrs r6, r0, 24 lsls r0, r1, 22 lsrs r0, 27 adds r5, r0, 0x2 lsls r1, 17 lsrs r1, 27 adds r4, r1, 0x2 cmp r6, 0x1F ble @080A2572 movs r6, 0x1F @080A2572: lsls r0, r5, 24 asrs r0, 24 cmp r0, 0x1F ble @080A257C movs r5, 0x1F @080A257C: lsls r0, r4, 24 asrs r0, 24 cmp r0, 0x1F ble @080A2586 movs r4, 0x1F @080A2586: lsls r1, r6, 24 asrs r1, 24 lsls r0, r5, 24 asrs r0, 19 orrs r1, r0 lsls r0, r4, 24 asrs r0, 14 orrs r1, r0 strh r1, [r2] adds r0, r7, 0x1 lsls r0, 16 lsrs r7, r0, 16 cmp r7, r10 bcc @080A254C b @080A2694 .align 2, 0 .pool @080A25A8: adds r7, r2, 0 cmp r7, r10 bcs @080A2694 @080A25AE: lsls r2, r7, 1 ldr r0, =0x02037714 adds r0, r2, r0 ldr r1, [r0] lsls r3, r1, 27 lsls r0, r1, 22 lsrs r0, 27 mov r12, r0 lsls r1, 17 lsrs r1, 27 mov r8, r1 ldr r0, =0x02037b14 adds r2, r0 ldr r1, [r2] lsls r0, r1, 27 lsrs r0, 3 movs r4, 0x80 lsls r4, 18 adds r0, r4 lsrs r6, r0, 24 lsls r0, r1, 22 lsrs r0, 27 adds r5, r0, 0x2 lsls r1, 17 lsrs r1, 27 adds r4, r1, 0x2 lsrs r3, 3 asrs r0, r3, 24 cmp r6, r0 ble @080A25EC lsrs r6, r3, 24 @080A25EC: lsls r0, r5, 24 asrs r0, 24 mov r3, r12 lsls r1, r3, 24 cmp r0, r12 ble @080A25FA lsrs r5, r1, 24 @080A25FA: lsls r0, r4, 24 asrs r0, 24 mov r3, r8 lsls r1, r3, 24 cmp r0, r8 ble @080A2608 lsrs r4, r1, 24 @080A2608: lsls r1, r6, 24 asrs r1, 24 lsls r0, r5, 24 asrs r0, 19 orrs r1, r0 lsls r0, r4, 24 asrs r0, 14 orrs r1, r0 strh r1, [r2] adds r0, r7, 0x1 lsls r0, 16 lsrs r7, r0, 16 cmp r7, r10 bcc @080A25AE b @080A2694 .align 2, 0 .pool @080A2630: adds r7, r2, 0 cmp r7, r10 bcs @080A2694 ldr r4, =0x02037b14 mov r8, r4 @080A263A: lsls r0, r7, 1 mov r1, r8 adds r3, r0, r1 ldr r1, [r3] lsls r2, r1, 27 lsrs r2, 3 movs r4, 0xFE lsls r4, 24 adds r2, r4 lsls r0, r1, 22 lsrs r0, 27 subs r0, 0x2 lsls r0, 24 lsrs r5, r0, 24 lsls r1, 17 lsrs r1, 27 subs r1, 0x2 lsls r1, 24 lsrs r4, r1, 24 lsrs r6, r2, 24 cmp r2, 0 bge @080A2668 movs r6, 0 @080A2668: lsls r0, r5, 24 cmp r0, 0 bge @080A2670 movs r5, 0 @080A2670: lsls r0, r4, 24 cmp r0, 0 bge @080A2678 movs r4, 0 @080A2678: lsls r1, r6, 24 asrs r1, 24 lsls r0, r5, 24 asrs r0, 19 orrs r1, r0 lsls r0, r4, 24 asrs r0, 14 orrs r1, r0 strh r1, [r3] adds r0, r7, 0x1 lsls r0, 16 lsrs r7, r0, 16 cmp r7, r10 bcc @080A263A @080A2694: ldr r0, =0x02037fd4 ldrb r2, [r0, 0xA] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r3, 0x5 negs r3, r3 ands r3, r2 orrs r3, r1 ldr r1, =0x02037fd4 strb r3, [r1, 0xA] movs r0, 0x4 ands r0, r3 cmp r0, 0 beq @080A26C4 ldrb r0, [r1, 0x7] b @080A2790 .align 2, 0 .pool @080A26C4: ldr r2, =0x02037fd4 ldrh r4, [r2, 0x4] lsls r5, r4, 21 lsrs r0, r5, 27 lsls r2, r3, 25 lsrs r1, r2, 28 subs r0, r1 cmp r0, 0 bge @080A26E8 ldr r0, =0xfffff83f ands r0, r4 ldr r3, =0x02037fd4 strh r0, [r3, 0x4] b @080A26FE .align 2, 0 .pool @080A26E8: lsrs r1, r5, 27 lsrs r0, r2, 28 subs r1, r0 movs r0, 0x1F ands r1, r0 lsls r1, 6 ldr r0, =0xfffff83f ands r0, r4 orrs r0, r1 ldr r4, =0x02037fd4 strh r0, [r4, 0x4] @080A26FE: ldr r1, =0x02037fd4 ldrh r0, [r1, 0x4] movs r1, 0xF8 lsls r1, 3 ands r1, r0 cmp r1, 0 bne @080A278C ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] lsls r0, 26 lsrs r0, 26 cmp r0, 0x1 beq @080A2750 cmp r0, 0x1 bgt @080A272C cmp r0, 0 beq @080A2736 b @080A2778 .align 2, 0 .pool @080A272C: cmp r0, 0x2 beq @080A2736 cmp r0, 0x3 beq @080A276C b @080A2778 @080A2736: ldr r0, =0x02037714 ldr r1, =0x02037b14 ldr r2, =0x04000100 bl CpuSet b @080A2778 .align 2, 0 .pool @080A2750: movs r0, 0x1 negs r0, r0 str r0, [sp] ldr r1, =0x02037b14 ldr r2, =0x05000100 mov r0, sp bl CpuSet b @080A2778 .align 2, 0 .pool @080A276C: str r1, [sp, 0x4] add r0, sp, 0x4 ldr r1, =0x02037b14 ldr r2, =0x05000100 bl CpuSet @080A2778: ldr r2, =0x02037fd4 ldrb r1, [r2, 0x9] movs r0, 0x4 negs r0, r0 ands r0, r1 strb r0, [r2, 0x9] ldrb r0, [r2, 0xA] movs r1, 0x2 orrs r0, r1 strb r0, [r2, 0xA] @080A278C: ldr r3, =0x02037fd4 ldrb r0, [r3, 0x7] @080A2790: lsrs r0, 7 @080A2792: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end pal_fade__1 thumb_func_start sub_80A27B0 sub_80A27B0: ; 80A27B0 push {r4-r7,lr} ldr r5, [sp, 0x14] lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 lsls r5, 24 lsrs r5, 24 ldr r7, =0x02037fd4 str r0, [r7] movs r0, 0x3F ands r1, r0 ldrb r4, [r7, 0x4] movs r6, 0x40 negs r6, r6 adds r0, r6, 0 ands r0, r4 orrs r0, r1 strb r0, [r7, 0x4] ldrb r0, [r7, 0x8] ands r6, r0 orrs r6, r1 strb r6, [r7, 0x8] movs r0, 0x1F adds r1, r2, 0 ands r1, r0 lsls r1, 6 ldrh r4, [r7, 0x4] ldr r0, =0xfffff83f ands r0, r4 orrs r0, r1 strh r0, [r7, 0x4] lsls r4, r3, 3 ldrb r1, [r7, 0x5] movs r0, 0x7 ands r0, r1 orrs r0, r4 strb r0, [r7, 0x5] ldrb r0, [r7, 0x7] movs r1, 0x80 orrs r0, r1 strb r0, [r7, 0x7] ldrb r1, [r7, 0x9] movs r0, 0x4 negs r0, r0 ands r0, r1 movs r1, 0x2 orrs r0, r1 movs r1, 0x1 ands r5, r1 lsls r5, 2 subs r1, 0x6 ands r0, r1 orrs r0, r5 subs r1, 0x4 ands r0, r1 strb r0, [r7, 0x9] cmp r2, r3 bcs @080A2840 movs r0, 0x41 negs r0, r0 ands r6, r0 b @080A2844 .align 2, 0 .pool @080A2840: movs r0, 0x40 orrs r6, r0 @080A2844: strb r6, [r7, 0x8] pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80A27B0 thumb_func_start pal_fade__2 pal_fade__2: ; 80A284C push {r4-r7,lr} ldr r2, =0x02037fd4 ldrb r1, [r2, 0x7] movs r0, 0x80 ands r0, r1 adds r4, r2, 0 cmp r0, 0 bne @080A2864 movs r0, 0 b @080A295C .align 2, 0 .pool @080A2864: ldrb r2, [r4, 0x4] lsls r1, r2, 26 ldrb r3, [r4, 0x8] lsls r0, r3, 26 cmp r1, r0 bcs @080A2886 lsrs r0, r1, 26 adds r0, 0x1 movs r1, 0x3F ands r0, r1 movs r1, 0x40 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r4, 0x4] movs r0, 0x2 b @080A295C @080A2886: movs r0, 0x40 negs r0, r0 ands r0, r2 strb r0, [r4, 0x4] movs r0, 0x40 ands r0, r3 cmp r0, 0 bne @080A28E4 ldrh r1, [r4, 0x4] lsls r0, r1, 21 lsrs r0, 27 adds r0, 0x1 movs r7, 0x1F ands r0, r7 lsls r0, 6 ldr r6, =0xfffff83f adds r3, r6, 0 ands r3, r1 orrs r3, r0 strh r3, [r4, 0x4] lsls r5, r3, 21 ldrb r0, [r4, 0x5] lsrs r1, r5, 27 lsrs r0, 3 cmp r1, r0 bls @080A2930 ldrb r2, [r4, 0x9] lsls r1, r2, 28 lsrs r1, 31 adds r1, 0x1 movs r0, 0x1 ands r1, r0 lsls r1, 3 movs r0, 0x9 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r4, 0x9] lsrs r0, r5, 27 subs r0, 0x1 ands r0, r7 lsls r0, 6 ands r3, r6 b @080A292C .align 2, 0 .pool @080A28E4: ldrh r2, [r4, 0x4] lsls r1, r2, 21 lsrs r0, r1, 27 subs r0, 0x1 movs r6, 0x1F ands r0, r6 lsls r0, 6 ldr r5, =0xfffff83f adds r3, r5, 0 ands r3, r2 orrs r3, r0 strh r3, [r4, 0x4] lsrs r1, 27 subs r1, 0x1 ldrb r0, [r4, 0x5] lsrs r0, 3 cmp r1, r0 bge @080A2930 ldrb r2, [r4, 0x9] lsls r1, r2, 28 lsrs r1, 31 adds r1, 0x1 movs r0, 0x1 ands r1, r0 lsls r1, 3 movs r0, 0x9 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r4, 0x9] lsls r0, r3, 21 lsrs r0, 27 adds r0, 0x1 ands r0, r6 lsls r0, 6 ands r3, r5 @080A292C: orrs r3, r0 strh r3, [r4, 0x4] @080A2930: ldrb r1, [r4, 0x9] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @080A2958 movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080A294E movs r0, 0 str r0, [r4] ldrh r1, [r4, 0x4] ldr r0, =0xfffff83f ands r0, r1 strh r0, [r4, 0x4] @080A294E: ldrb r1, [r4, 0x9] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r4, 0x9] @080A2958: ldrb r0, [r4, 0x7] lsrs r0, 7 @080A295C: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end pal_fade__2 thumb_func_start sub_80A2968 sub_80A2968: ; 80A2968 push {r4,lr} ldr r4, =0x02037fd4 ldrh r1, [r4] movs r0, 0x50 bl 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, =0xfffff83f ands r0, r1 strh r0, [r4, 0x4] ldrb r1, [r4, 0x7] movs r0, 0x7F ands r0, r1 strb r0, [r4, 0x7] @080A29AC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2968 thumb_func_start sub_80A29BC sub_80A29BC: ; 80A29BC push {r4,lr} ldr r3, =0x02037fd4 ldrb r4, [r3, 0xA] movs r0, 0x2 ands r0, r4 cmp r0, 0 beq @080A2A18 ldr r2, [r3, 0x8] movs r0, 0xF8 lsls r0, 9 ands r0, r2 movs r1, 0x80 lsls r1, 7 cmp r0, r1 bne @080A29FC ldrb r1, [r3, 0x7] movs r0, 0x7F ands r0, r1 strb r0, [r3, 0x7] movs r0, 0x3 negs r0, r0 ands r0, r4 strb r0, [r3, 0xA] ldr r0, [r3, 0x8] ldr r1, =0xfffe0fff ands r0, r1 str r0, [r3, 0x8] b @080A2A10 .align 2, 0 .pool @080A29FC: lsls r0, r2, 15 lsrs r0, 27 adds r0, 0x1 movs r1, 0x1F ands r0, r1 lsls r0, 12 ldr r1, =0xfffe0fff ands r1, r2 orrs r1, r0 str r1, [r3, 0x8] @080A2A10: movs r0, 0x1 b @080A2A1A .align 2, 0 .pool @080A2A18: movs r0, 0 @080A2A1A: pop {r4} pop {r1} bx r1 thumb_func_end sub_80A29BC thumb_func_start sub_80A2A20 sub_80A2A20: ; 80A2A20 push {r4-r7,lr} adds r4, r0, 0 lsls r1, 24 lsrs r7, r1, 24 lsls r2, 16 lsrs r6, r2, 16 movs r5, 0 cmp r4, 0 beq @080A2A54 @080A2A32: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @080A2A46 adds r0, r5, 0 movs r1, 0x10 adds r2, r7, 0 adds r3, r6, 0 bl pal_fade_1 @080A2A46: lsrs r4, 1 adds r0, r5, 0 adds r0, 0x10 lsls r0, 16 lsrs r5, r0, 16 cmp r4, 0 bne @080A2A32 @080A2A54: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80A2A20 thumb_func_start sub_80A2A5C sub_80A2A5C: ; 80A2A5C push {r4,r5,lr} lsls r1, 24 lsrs r1, 24 lsls r2, 16 lsrs r2, 16 ldr r4, =0x02037714 ldr r5, =0x02037b14 ldr r3, =0x040000d4 str r4, [r3] str r5, [r3, 0x4] ldr r4, =0x84000100 str r4, [r3, 0x8] ldr r3, [r3, 0x8] bl sub_80A2A20 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2A5C thumb_func_start TintPalette_GrayScale TintPalette_GrayScale: ; 80A2A90 push {r4-r6,lr} adds r4, r0, 0 lsls r1, 16 lsrs r1, 16 cmp r1, 0 beq @080A2AD8 movs r6, 0x1F adds r5, r1, 0 @080A2AA0: ldrh r1, [r4] movs r2, 0x1F ands r2, r1 lsls r1, 16 lsrs r3, r1, 21 ands r3, r6 lsrs r1, 26 ands r1, r6 movs r0, 0x4C muls r2, r0 movs r0, 0x97 muls r0, r3 adds r2, r0 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r1 adds r2, r0 asrs r2, 8 lsls r0, r2, 10 lsls r1, r2, 5 orrs r0, r1 orrs r0, r2 strh r0, [r4] adds r4, 0x2 subs r5, 0x1 cmp r5, 0 bne @080A2AA0 @080A2AD8: pop {r4-r6} pop {r0} bx r0 thumb_func_end TintPalette_GrayScale thumb_func_start sub_80A2AE0 sub_80A2AE0: ; 80A2AE0 push {r4-r7,lr} adds r4, r0, 0 lsls r1, 16 lsrs r1, 16 cmp r1, 0 beq @080A2B34 movs r6, 0x1F ldr r7, =gUnknown_0852489C adds r5, r1, 0 @080A2AF2: ldrh r1, [r4] movs r2, 0x1F ands r2, r1 lsls r1, 16 lsrs r3, r1, 21 ands r3, r6 lsrs r1, 26 ands r1, r6 movs r0, 0x4C muls r2, r0 movs r0, 0x97 muls r0, r3 adds r2, r0 lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r1 adds r2, r0 asrs r2, 8 cmp r2, 0x1F bls @080A2B1E movs r2, 0x1F @080A2B1E: adds r0, r2, r7 ldrb r2, [r0] lsls r0, r2, 10 lsls r1, r2, 5 orrs r0, r1 orrs r0, r2 strh r0, [r4] adds r4, 0x2 subs r5, 0x1 cmp r5, 0 bne @080A2AF2 @080A2B34: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2AE0 thumb_func_start TintPalette_SepiaTone TintPalette_SepiaTone: ; 80A2B40 push {r4-r7,lr} adds r5, r0, 0 lsls r1, 16 lsrs r1, 16 cmp r1, 0 beq @080A2BA2 movs r7, 0x1F adds r6, r1, 0 @080A2B50: ldrh r0, [r5] movs r1, 0x1F ands r1, r0 lsls r0, 16 lsrs r2, r0, 21 ands r2, r7 lsrs r3, r0, 26 ands r3, r7 movs r0, 0x4C muls r1, r0 movs r0, 0x97 muls r0, r2 adds r1, r0 lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r3 adds r1, r0 asrs r1, 8 ldr r0, =0x00000133 muls r0, r1 lsls r0, 16 lsrs r2, r0, 24 lsls r0, r1, 24 lsrs r4, r0, 24 lsls r0, r1, 4 subs r0, r1 lsls r0, 20 lsrs r3, r0, 24 cmp r2, 0x1F ble @080A2B90 movs r2, 0x1F @080A2B90: lsls r0, r3, 10 lsls r1, r4, 5 orrs r0, r1 orrs r0, r2 strh r0, [r5] adds r5, 0x2 subs r6, 0x1 cmp r6, 0 bne @080A2B50 @080A2BA2: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end TintPalette_SepiaTone thumb_func_start sub_80A2BAC sub_80A2BAC: ; 80A2BAC push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r5, r0, 0 ldr r0, [sp, 0x1C] lsls r1, 16 lsrs r1, 16 lsls r2, 16 lsrs r2, 16 mov r9, r2 lsls r3, 16 lsrs r3, 16 mov r8, r3 lsls r0, 16 lsrs r0, 16 mov r12, r0 cmp r1, 0 beq @080A2C38 movs r7, 0x1F adds r6, r1, 0 @080A2BD6: ldrh r0, [r5] movs r1, 0x1F ands r1, r0 lsls r0, 16 lsrs r2, r0, 21 ands r2, r7 lsrs r3, r0, 26 ands r3, r7 movs r0, 0x4C muls r1, r0 movs r0, 0x97 muls r0, r2 adds r1, r0 lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r3 adds r1, r0 asrs r1, 8 mov r0, r9 muls r0, r1 lsls r0, 16 lsrs r4, r0, 24 mov r0, r8 muls r0, r1 lsls r0, 16 lsrs r2, r0, 24 mov r0, r12 muls r0, r1 lsls r0, 16 lsrs r3, r0, 24 cmp r4, 0x1F ble @080A2C1A movs r4, 0x1F @080A2C1A: cmp r2, 0x1F ble @080A2C20 movs r2, 0x1F @080A2C20: cmp r3, 0x1F ble @080A2C26 movs r3, 0x1F @080A2C26: lsls r0, r3, 10 lsls r1, r2, 5 orrs r0, r1 orrs r0, r4 strh r0, [r5] adds r5, 0x2 subs r6, 0x1 cmp r6, 0 bne @080A2BD6 @080A2C38: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80A2BAC thumb_func_start sub_80A2C44 sub_80A2C44: ; 80A2C44 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} mov r10, r0 adds r4, r1, 0 ldr r0, [sp, 0x20] ldr r1, [sp, 0x24] ldr r5, [sp, 0x28] lsls r4, 24 lsrs r4, 24 lsls r2, 24 lsrs r7, r2, 24 lsls r3, 24 lsrs r6, r3, 24 lsls r0, 16 lsrs r0, 16 mov r9, r0 lsls r1, 24 lsrs r1, 24 lsls r5, 24 lsrs r5, 24 mov r8, r5 ldr r0, =sub_80A2D54 bl AddTask lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r1, r0, r1 strh r7, [r1, 0x8] strh r6, [r1, 0xA] lsls r4, 24 asrs r4, 24 cmp r4, 0 blt @080A2CA4 strh r4, [r1, 0xE] movs r0, 0x1 b @080A2CAC .align 2, 0 .pool @080A2CA4: movs r0, 0 strh r0, [r1, 0xE] negs r0, r4 adds r0, 0x1 @080A2CAC: strh r0, [r1, 0xC] lsls r4, r5, 2 cmp r6, r7 bcs @080A2CC4 ldr r0, =0x03005e00 adds r1, r4, r5 lsls r1, 3 adds r1, r0 movs r2, 0xC ldrsh r0, [r1, r2] negs r0, r0 strh r0, [r1, 0xC] @080A2CC4: adds r0, r5, 0 movs r1, 0x5 mov r2, r10 bl set_word_task_arg ldr r0, =0x03005e00 adds r1, r4, r5 lsls r1, 3 adds r1, r0 mov r0, r9 strh r0, [r1, 0x16] mov r2, r8 strh r2, [r1, 0x18] ldr r1, [r1] adds r0, r5, 0 bl _call_via_r1 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2C44 thumb_func_start sub_80A2CF8 sub_80A2CF8: ; 80A2CF8 push {r4,r5,lr} lsls r0, 24 lsrs r3, r0, 24 movs r2, 0 ldr r4, =sub_80A2D54 ldr r1, =0x03005e00 @080A2D04: ldrb r0, [r1, 0x4] cmp r0, 0x1 bne @080A2D24 ldr r0, [r1] cmp r0, r4 bne @080A2D24 movs r5, 0x18 ldrsh r0, [r1, r5] cmp r0, r3 bne @080A2D24 movs r0, 0x1 b @080A2D2E .align 2, 0 .pool @080A2D24: adds r1, 0x28 adds r2, 0x1 cmp r2, 0xF ble @080A2D04 movs r0, 0 @080A2D2E: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80A2CF8 thumb_func_start sub_80A2D34 sub_80A2D34: ; 80A2D34 push {lr} b @080A2D3C @080A2D38: bl remove_task @080A2D3C: ldr r0, =sub_80A2D54 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @080A2D38 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2D34 thumb_func_start sub_80A2D54 sub_80A2D54: ; 80A2D54 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 adds r0, r5, 0 movs r1, 0x5 bl get_word_task_arg adds r3, r0, 0 ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] lsls r0, 16 asrs r0, 16 movs r2, 0x6 ldrsh r1, [r4, r2] cmp r0, r1 ble @080A2DCC movs r0, 0 strh r0, [r4, 0x8] ldrb r1, [r4] ldrh r2, [r4, 0xE] adds r0, r3, 0 bl sub_80A2A20 ldrh r1, [r4] movs r6, 0 ldrsh r0, [r4, r6] ldrh r3, [r4, 0x2] movs r6, 0x2 ldrsh r2, [r4, r6] cmp r0, r2 bne @080A2DAC adds r0, r5, 0 bl remove_task b @080A2DCC .align 2, 0 .pool @080A2DAC: ldrh r0, [r4, 0x4] adds r1, r0 strh r1, [r4] lsls r0, 16 cmp r0, 0 blt @080A2DC2 lsls r0, r1, 16 asrs r0, 16 cmp r0, r2 blt @080A2DCC b @080A2DCA @080A2DC2: lsls r0, r1, 16 asrs r0, 16 cmp r0, r2 bgt @080A2DCC @080A2DCA: strh r3, [r4] @080A2DCC: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_80A2D54 thumb_func_start sound_sources_off sound_sources_off: ; 80A2DD4 push {lr} ldr r1, =0x03005df8 movs r0, 0 strb r0, [r1] bl map_music_set_to_zero pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sound_sources_off thumb_func_start sound_something sound_something: ; 80A2DE8 push {r4,r5,lr} ldr r0, =0x03000f4c ldrb r1, [r0] adds r2, r0, 0 cmp r1, 0x7 bhi @080A2ECA lsls r0, r1, 2 ldr r1, =@080A2E08 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080A2E08: .4byte @080A2ECA .4byte @080A2E28 .4byte @080A2ECA .4byte @080A2ECA .4byte @080A2ECA .4byte @080A2E3C .4byte @080A2E5C .4byte @080A2E98 @080A2E28: movs r0, 0x2 strb r0, [r2] ldr r0, =0x03000f48 ldrh r0, [r0] bl song_play_for_text b @080A2ECA .align 2, 0 .pool @080A2E3C: bl sub_80A3258 lsls r0, 24 cmp r0, 0 beq @080A2ECA ldr r0, =0x03000f4a movs r1, 0 strh r1, [r0] ldr r0, =0x03000f4c strb r1, [r0] b @080A2ECA .align 2, 0 .pool @080A2E5C: bl sub_80A3258 lsls r0, 24 cmp r0, 0 beq @080A2ECA bl task_is_not_running_overworld_fanfare lsls r0, 24 cmp r0, 0 beq @080A2ECA ldr r2, =0x03000f48 ldr r1, =0x03000f4a ldrh r0, [r1] strh r0, [r2] movs r0, 0 strh r0, [r1] ldr r1, =0x03000f4c movs r0, 0x2 strb r0, [r1] ldrh r0, [r2] bl song_play_for_text b @080A2ECA .align 2, 0 .pool @080A2E98: bl sub_80A3258 lsls r0, 24 cmp r0, 0 beq @080A2ECA bl task_is_not_running_overworld_fanfare lsls r0, 24 cmp r0, 0 beq @080A2ECA ldr r4, =0x03000f4a ldrh r0, [r4] ldr r5, =0x03000f4d ldrb r1, [r5] bl sub_80A3194 ldr r1, =0x03000f48 ldrh r0, [r4] strh r0, [r1] movs r2, 0 strh r2, [r4] ldr r1, =0x03000f4c movs r0, 0x2 strb r0, [r1] strb r2, [r5] @080A2ECA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sound_something thumb_func_start map_music_set_to_zero map_music_set_to_zero: ; 80A2EE0 ldr r0, =0x03000f48 movs r1, 0 strh r1, [r0] ldr r0, =0x03000f4a strh r1, [r0] ldr r0, =0x03000f4c strb r1, [r0] ldr r0, =0x03000f4d strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end map_music_set_to_zero thumb_func_start current_map_music_get current_map_music_get: ; 80A2F04 ldr r0, =0x03000f48 ldrh r0, [r0] bx lr .align 2, 0 .pool thumb_func_end current_map_music_get thumb_func_start current_map_music_set current_map_music_set: ; 80A2F10 ldr r1, =0x03000f48 strh r0, [r1] ldr r1, =0x03000f4a movs r0, 0 strh r0, [r1] ldr r1, =0x03000f4c movs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end current_map_music_set thumb_func_start sub_80A2F30 sub_80A2F30: ; 80A2F30 ldr r0, =0x03000f48 movs r1, 0 strh r1, [r0] ldr r0, =0x03000f4a strh r1, [r0] ldr r1, =0x03000f4c movs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80A2F30 thumb_func_start sub_80A2F50 sub_80A2F50: ; 80A2F50 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_80A303C lsls r0, 24 cmp r0, 0 beq @080A2F66 adds r0, r4, 0 bl play_sound_effect @080A2F66: ldr r0, =0x03000f48 movs r1, 0 strh r1, [r0] ldr r0, =0x03000f4a strh r1, [r0] ldr r1, =0x03000f4c movs r0, 0x5 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2F50 thumb_func_start sub_80A2F88 sub_80A2F88: ; 80A2F88 push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 lsls r4, 16 lsrs r4, 16 lsls r0, 24 lsrs r0, 24 bl sub_80A2F50 ldr r1, =0x03000f48 movs r0, 0 strh r0, [r1] ldr r0, =0x03000f4a strh r4, [r0] ldr r1, =0x03000f4c movs r0, 0x6 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2F88 thumb_func_start sub_80A2FBC sub_80A2FBC: ; 80A2FBC push {r4,r5,lr} adds r4, r0, 0 adds r0, r1, 0 adds r5, r2, 0 lsls r4, 16 lsrs r4, 16 lsls r0, 24 lsrs r0, 24 lsls r5, 24 lsrs r5, 24 bl sub_80A2F50 ldr r1, =0x03000f48 movs r0, 0 strh r0, [r1] ldr r0, =0x03000f4a strh r4, [r0] ldr r1, =0x03000f4c movs r0, 0x7 strb r0, [r1] ldr r0, =0x03000f4d strb r5, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A2FBC thumb_func_start sub_80A3000 sub_80A3000: ; 80A3000 push {r4,lr} adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_80A3194 ldr r0, =0x03000f48 strh r4, [r0] ldr r0, =0x03000f4a movs r2, 0 strh r2, [r0] ldr r1, =0x03000f4c movs r0, 0x2 strb r0, [r1] ldr r0, =0x03000f4d strb r2, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3000 thumb_func_start sub_80A303C sub_80A303C: ; 80A303C push {lr} ldr r0, =0x03000f4c ldrb r0, [r0] cmp r0, 0x6 beq @080A3058 cmp r0, 0x5 beq @080A3058 cmp r0, 0x7 beq @080A3058 movs r0, 0x1 b @080A305A .align 2, 0 .pool @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, =0x03007420 bl MPlayStop_rev01 ldr r0, =gUnknown_085248BC lsls r4, 2 adds r4, r0 ldrh r0, [r4] ldr r2, =0x03000f4e ldrh r1, [r4, 0x2] strh r1, [r2] bl m4aSongNumStart pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end pause_music_for_sound_maybe thumb_func_start ducking_tick ducking_tick: ; 80A3094 push {lr} lsls r0, 24 lsrs r1, r0, 24 ldr r2, =0x03000f4e ldrh r0, [r2] cmp r0, 0 beq @080A30B0 subs r0, 0x1 strh r0, [r2] movs r0, 0 b @080A30C8 .align 2, 0 .pool @080A30B0: cmp r1, 0 bne @080A30C0 ldr r0, =0x03007420 bl m4aMPlayContinue b @080A30C6 .align 2, 0 .pool @080A30C0: movs r0, 0 bl m4aSongNumStart @080A30C6: movs r0, 0x1 @080A30C8: pop {r1} bx r1 thumb_func_end ducking_tick thumb_func_start sub_80A30CC sub_80A30CC: ; 80A30CC push {lr} lsls r0, 24 ldr r1, =gUnknown_085248BC lsrs r0, 22 adds r0, r1 ldrh r0, [r0] bl m4aSongNumStop pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085248BC @080A30EE: ldrh r0, [r2] cmp r0, r3 bne @080A3108 lsls r0, r1, 24 lsrs r0, 24 bl pause_music_for_sound_maybe bl task_add_50_overworld_fanfare_if_not_running b @080A311A .align 2, 0 .pool @080A3108: adds r2, 0x4 adds r1, 0x1 cmp r1, 0x11 bls @080A30EE movs r0, 0 bl pause_music_for_sound_maybe bl task_add_50_overworld_fanfare_if_not_running @080A311A: pop {r0} bx r0 thumb_func_end fanfare_play thumb_func_start task_is_not_running_overworld_fanfare task_is_not_running_overworld_fanfare: ; 80A3120 push {lr} ldr r0, =task50_overworld_fanfare bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080A3138 movs r0, 0x1 b @080A313A .align 2, 0 .pool @080A3138: movs r0, 0 @080A313A: pop {r1} bx r1 thumb_func_end task_is_not_running_overworld_fanfare thumb_func_start task50_overworld_fanfare task50_overworld_fanfare: ; 80A3140 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x03000f4e ldrh r0, [r1] cmp r0, 0 beq @080A3158 subs r0, 0x1 strh r0, [r1] b @080A3164 .align 2, 0 .pool @080A3158: ldr r0, =0x03007420 bl m4aMPlayContinue adds r0, r4, 0 bl remove_task @080A3164: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =task50_overworld_fanfare adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080A318A adds r0, r4, 0 movs r1, 0x50 bl AddTask @080A318A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_add_50_overworld_fanfare_if_not_running thumb_func_start sub_80A3194 sub_80A3194: ; 80A3194 push {r4-r7,lr} lsls r0, 16 lsrs r5, r0, 16 lsls r1, 24 lsrs r7, r1, 24 ldr r0, =0x03005df8 ldrb r0, [r0] cmp r0, 0 beq @080A31A8 movs r5, 0 @080A31A8: ldr r6, =0x0000ffff cmp r5, r6 bne @080A31B0 movs r5, 0 @080A31B0: adds r0, r5, 0 bl m4aSongNumStart ldr r4, =0x03007420 adds r0, r4, 0 bl m4aMPlayImmInit adds r0, r4, 0 adds r1, r6, 0 movs r2, 0 bl MPlayVolumeControl adds r0, r5, 0 bl m4aSongNumStop adds r0, r4, 0 adds r1, r7, 0 bl sub_82E0328 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3194 thumb_func_start sub_80A31E8 sub_80A31E8: ; 80A31E8 push {lr} adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r0, =0x03007420 bl sub_82E0308 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A31E8 thumb_func_start sub_80A3200 sub_80A3200: ; 80A3200 push {lr} ldr r0, =0x03007420 ldr r1, [r0, 0x4] cmp r1, 0 blt @080A3220 ldr r0, =0x0000ffff ands r1, r0 cmp r1, 0 beq @080A3220 movs r0, 0 b @080A3222 .align 2, 0 .pool @080A3220: movs r0, 0x1 @080A3222: pop {r1} bx r1 thumb_func_end sub_80A3200 thumb_func_start sub_80A3228 sub_80A3228: ; 80A3228 push {lr} adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r0, =0x03007420 bl sub_82E0328 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3228 thumb_func_start play_sound_effect ; void play_sound_effect(u8 a1) play_sound_effect: ; 80A3240 push {lr} adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r0, =0x03007420 bl m4aMPlayFadeOut pop {r0} bx r0 .align 2, 0 .pool thumb_func_end play_sound_effect thumb_func_start sub_80A3258 sub_80A3258: ; 80A3258 push {lr} ldr r0, =0x03007420 ldrh r0, [r0, 0x4] cmp r0, 0 beq @080A326C movs r0, 0 b @080A326E .align 2, 0 .pool @080A326C: movs r0, 0x1 @080A326E: pop {r1} bx r1 thumb_func_end sub_80A3258 thumb_func_start cry_related cry_related: ; 80A3274 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 adds r4, r1, 0 lsls r5, 16 lsrs r5, 16 lsls r4, 24 lsrs r4, 24 ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x55 bl MPlayVolumeControl lsls r4, 24 asrs r4, 24 movs r0, 0 str r0, [sp] adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x78 movs r3, 0xA bl sub_80A344C ldr r1, =0x020383ec movs r0, 0x2 strb r0, [r1] bl sub_80A3754 add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end cry_related thumb_func_start sub_80A32C0 sub_80A32C0: ; 80A32C0 push {r4,lr} sub sp, 0x4 lsls r0, 16 lsrs r0, 16 lsls r3, 24 lsrs r3, 24 lsls r1, 24 asrs r1, 24 lsls r2, 24 asrs r2, 24 movs r4, 0 str r4, [sp] bl sub_80A344C add sp, 0x4 pop {r4} pop {r0} bx r0 thumb_func_end sub_80A32C0 thumb_func_start sub_80A32E4 sub_80A32E4: ; 80A32E4 push {r4-r6,lr} sub sp, 0x4 lsls r0, 16 lsrs r6, r0, 16 lsls r1, 24 lsrs r5, r1, 24 lsls r2, 24 lsrs r4, r2, 24 cmp r4, 0x1 bne @080A330A lsls r1, r5, 24 asrs r1, 24 str r4, [sp] adds r0, r6, 0 movs r2, 0x78 movs r3, 0xA bl sub_80A344C b @080A332E @080A330A: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x55 bl MPlayVolumeControl lsls r1, r5, 24 asrs r1, 24 str r4, [sp] adds r0, r6, 0 movs r2, 0x78 movs r3, 0xA bl sub_80A344C ldr r1, =0x020383ec movs r0, 0x2 strb r0, [r1] bl sub_80A3754 @080A332E: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A32E4 thumb_func_start sub_80A3344 sub_80A3344: ; 80A3344 push {r4-r6,lr} sub sp, 0x4 lsls r0, 16 lsrs r0, 16 adds r6, r0, 0 lsls r1, 24 lsrs r1, 24 adds r5, r1, 0 lsls r2, 24 lsrs r2, 24 adds r4, r2, 0 cmp r2, 0x1 bne @080A336E lsls r1, 24 asrs r1, 24 str r2, [sp] movs r2, 0x78 movs r3, 0xA bl sub_80A344C b @080A3394 @080A336E: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @080A3384 ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x55 bl MPlayVolumeControl @080A3384: lsls r1, r5, 24 asrs r1, 24 str r4, [sp] adds r0, r6, 0 movs r2, 0x78 movs r3, 0xA bl sub_80A344C @080A3394: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3344 thumb_func_start play_cry_maybe play_cry_maybe: ; 80A33A8 push {r4-r6,lr} sub sp, 0x4 lsls r0, 16 lsrs r6, r0, 16 lsls r1, 24 lsrs r5, r1, 24 lsls r2, 24 lsrs r4, r2, 24 cmp r4, 0x1 bne @080A33CE lsls r1, r5, 24 asrs r1, 24 str r4, [sp] adds r0, r6, 0 movs r2, 0x78 movs r3, 0xA bl sub_80A344C b @080A33EE @080A33CE: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x55 bl MPlayVolumeControl lsls r1, r5, 24 asrs r1, 24 str r4, [sp] adds r0, r6, 0 movs r2, 0x78 movs r3, 0xA bl sub_80A344C ldr r1, =0x020383ec movs r0, 0x2 strb r0, [r1] @080A33EE: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end play_cry_maybe thumb_func_start sub_80A3404 sub_80A3404: ; 80A3404 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 adds r4, r1, 0 lsls r5, 16 lsrs r5, 16 lsls r4, 24 lsrs r4, 24 ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x55 bl MPlayVolumeControl str r4, [sp] adds r0, r5, 0 movs r1, 0 movs r2, 0x78 movs r3, 0xA bl sub_80A344C ldr r1, =0x020383ec movs r0, 0x2 strb r0, [r1] bl sub_80A3754 add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3404 thumb_func_start sub_80A344C sub_80A344C: ; 80A344C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 ldr r4, [sp, 0x24] lsls r0, 16 lsls r1, 24 lsrs r1, 24 mov r10, r1 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 str r3, [sp] lsls r4, 24 lsrs r1, r4, 24 ldr r3, =0xffff0000 adds r0, r3 lsrs r7, r0, 16 movs r6, 0x8C movs r0, 0 mov r9, r0 movs r5, 0 movs r4, 0xF0 lsls r4, 6 mov r8, r5 cmp r1, 0xC bhi @080A3562 lsls r0, r1, 2 ldr r1, =@080A349C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080A349C: .4byte @080A3562 .4byte @080A34D0 .4byte @080A34D6 .4byte @080A34E4 .4byte @080A34F8 .4byte @080A3510 .4byte @080A351C .4byte @080A352C .4byte @080A3536 .4byte @080A3540 .4byte @080A3550 .4byte @080A3560 .4byte @080A355C @080A34D0: movs r6, 0x14 movs r5, 0xE1 b @080A3562 @080A34D6: movs r5, 0xE1 ldr r4, =0x00003cf0 movs r1, 0x14 b @080A3504 .align 2, 0 .pool @080A34E4: movs r6, 0x32 movs r5, 0xC8 ldr r4, =0x00003db8 movs r3, 0x14 mov r8, r3 movs r2, 0x5A b @080A3562 .align 2, 0 .pool @080A34F8: movs r6, 0x19 movs r0, 0x1 mov r9, r0 movs r5, 0x64 ldr r4, =0x00003cf0 movs r1, 0xC0 @080A3504: mov r8, r1 movs r2, 0x5A b @080A3562 .align 2, 0 .pool @080A3510: movs r5, 0xC8 ldr r4, =0x00003868 b @080A3562 .align 2, 0 .pool @080A351C: movs r5, 0xDC ldr r4, =0x00003cc3 movs r3, 0xC0 mov r8, r3 movs r2, 0x46 b @080A3562 .align 2, 0 .pool @080A352C: movs r6, 0xA movs r5, 0x64 movs r4, 0xE8 lsls r4, 6 b @080A3562 @080A3536: movs r6, 0x3C movs r5, 0xE1 movs r4, 0xF4 lsls r4, 6 b @080A3562 @080A3540: movs r6, 0xF movs r0, 0x1 mov r9, r0 movs r5, 0x7D ldr r4, =0x00003b60 b @080A3562 .align 2, 0 .pool @080A3550: movs r6, 0x64 movs r5, 0xE1 ldr r4, =0x00003b60 b @080A3562 .align 2, 0 .pool @080A355C: movs r6, 0x14 movs r5, 0xE1 @080A3560: ldr r4, =0x00003a98 @080A3562: adds r0, r2, 0 bl sub_82E1744 mov r1, r10 lsls r0, r1, 24 asrs r0, 24 bl sub_82E1758 adds r0, r4, 0 bl sub_82E1770 adds r0, r6, 0 bl sub_82E17A8 movs r0, 0 bl sub_82E17C0 adds r0, r5, 0 bl sub_82E17B4 mov r3, r8 lsls r0, r3, 24 asrs r0, 24 bl sub_82E17E4 ldr r0, [sp] bl sub_82E1850 adds r0, r7, 0 bl speciesid_conv adds r7, r0, 0 movs r1, 0x7F ands r1, r7 lsrs r0, r7, 7 lsls r0, 24 lsrs r0, 24 adds r2, r0, 0 cmp r0, 0x1 beq @080A35F0 cmp r0, 0x1 bgt @080A35C0 cmp r0, 0 beq @080A35CA b @080A365E .align 2, 0 .pool @080A35C0: cmp r2, 0x2 beq @080A3614 cmp r2, 0x3 beq @080A3638 b @080A365E @080A35CA: mov r0, r9 cmp r0, 0 beq @080A35E0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_0869EF24 b @080A3654 .align 2, 0 .pool @080A35E0: lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_0869DCF4 b @080A3654 .align 2, 0 .pool @080A35F0: mov r3, r9 cmp r3, 0 beq @080A3604 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_0869F524 b @080A3654 .align 2, 0 .pool @080A3604: lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_0869E2F4 b @080A3654 .align 2, 0 .pool @080A3614: mov r0, r9 cmp r0, 0 beq @080A3628 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_0869FB24 b @080A3654 .align 2, 0 .pool @080A3628: lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_0869E8F4 b @080A3654 .align 2, 0 .pool @080A3638: mov r3, r9 cmp r3, 0 beq @080A364C lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_086A0124 b @080A3654 .align 2, 0 .pool @080A364C: lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_0869EEF4 @080A3654: adds r0, r1 bl sub_82E1674 ldr r1, =0x020383e8 str r0, [r1] @080A365E: add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A344C thumb_func_start sub_80A3678 sub_80A3678: ; 80A3678 push {lr} ldr r0, =sub_80A370C bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080A3694 bl sub_8000964 movs r0, 0x1 b @080A3696 .align 2, 0 .pool @080A3694: movs r0, 0 @080A3696: pop {r1} bx r1 thumb_func_end sub_80A3678 thumb_func_start sub_80A369C sub_80A369C: ; 80A369C push {lr} ldr r0, =0x020383e8 ldr r0, [r0] bl MPlayStop_rev01 bl sub_8000964 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A369C thumb_func_start sub_80A36B4 sub_80A36B4: ; 80A36B4 push {lr} ldr r0, =0x020383e8 ldr r0, [r0] bl MPlayStop_rev01 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A36B4 thumb_func_start sub_80A36C8 sub_80A36C8: ; 80A36C8 push {lr} ldr r0, =0x020383e8 ldr r0, [r0] bl sub_82E17CC cmp r0, 0 bne @080A36E4 bl sub_8000964 movs r0, 0 b @080A36E6 .align 2, 0 .pool @080A36E4: movs r0, 0x1 @080A36E6: pop {r1} bx r1 thumb_func_end sub_80A36C8 thumb_func_start sub_80A36EC sub_80A36EC: ; 80A36EC push {lr} ldr r0, =0x020383e8 ldr r0, [r0] bl sub_82E17CC cmp r0, 0 bne @080A3704 movs r0, 0 b @080A3706 .align 2, 0 .pool @080A3704: movs r0, 0x1 @080A3706: pop {r1} bx r1 thumb_func_end sub_80A36EC thumb_func_start sub_80A370C sub_80A370C: ; 80A370C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x020383ec ldrb r0, [r1] cmp r0, 0 beq @080A3724 subs r0, 0x1 strb r0, [r1] b @080A3742 .align 2, 0 .pool @080A3724: ldr r0, =0x020383e8 ldr r0, [r0] bl sub_82E17CC cmp r0, 0 bne @080A3742 ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl adds r0, r4, 0 bl remove_task @080A3742: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A370C thumb_func_start sub_80A3754 sub_80A3754: ; 80A3754 push {r4,lr} ldr r4, =sub_80A370C adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080A376E adds r0, r4, 0 movs r1, 0x50 bl AddTask @080A376E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3754 thumb_func_start song_play_for_text song_play_for_text: ; 80A3778 push {lr} lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x03005df8 ldrb r0, [r0] cmp r0, 0 beq @080A3788 movs r1, 0 @080A3788: ldr r0, =0x0000ffff cmp r1, r0 bne @080A3790 movs r1, 0 @080A3790: adds r0, r1, 0 bl m4aSongNumStart pop {r0} bx r0 .align 2, 0 .pool thumb_func_end song_play_for_text thumb_func_start audio_play audio_play: ; 80A37A4 push {lr} lsls r0, 16 lsrs r0, 16 bl m4aSongNumStart pop {r0} bx r0 thumb_func_end audio_play thumb_func_start audio_play_and_stuff audio_play_and_stuff: ; 80A37B4 push {r4-r6,lr} mov r6, r8 push {r6} adds r4, r1, 0 lsls r0, 16 lsrs r0, 16 lsls r4, 24 lsrs r4, 24 bl m4aSongNumStart ldr r6, =0x030075f0 adds r0, r6, 0 bl m4aMPlayImmInit ldr r0, =0x03007630 mov r8, r0 bl m4aMPlayImmInit ldr r5, =0x0000ffff lsls r4, 24 asrs r4, 24 adds r0, r6, 0 adds r1, r5, 0 adds r2, r4, 0 bl MPlayPanpotControl mov r0, r8 adds r1, r5, 0 adds r2, r4, 0 bl MPlayPanpotControl pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end audio_play_and_stuff thumb_func_start sub_80A3808 sub_80A3808: ; 80A3808 push {r4,r5,lr} adds r4, r1, 0 lsls r0, 16 lsrs r0, 16 lsls r4, 24 lsrs r4, 24 bl m4aSongNumStart ldr r5, =0x030075f0 adds r0, r5, 0 bl m4aMPlayImmInit ldr r1, =0x0000ffff lsls r4, 24 asrs r4, 24 adds r0, r5, 0 adds r2, r4, 0 bl MPlayPanpotControl pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3808 thumb_func_start sub_80A383C sub_80A383C: ; 80A383C push {r4,r5,lr} adds r4, r1, 0 lsls r0, 16 lsrs r0, 16 lsls r4, 24 lsrs r4, 24 bl m4aSongNumStart ldr r5, =0x03007630 adds r0, r5, 0 bl m4aMPlayImmInit ldr r1, =0x0000ffff lsls r4, 24 asrs r4, 24 adds r0, r5, 0 adds r2, r4, 0 bl MPlayPanpotControl pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A383C thumb_func_start sub_80A3870 sub_80A3870: ; 80A3870 push {r4,r5,lr} adds r4, r0, 0 ldr r0, =0x030075f0 ldr r5, =0x0000ffff lsls r4, 24 asrs r4, 24 adds r1, r5, 0 adds r2, r4, 0 bl MPlayPanpotControl ldr r0, =0x03007630 adds r1, r5, 0 adds r2, r4, 0 bl MPlayPanpotControl pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3870 thumb_func_start mplay_has_finished_maybe mplay_has_finished_maybe: ; 80A38A0 push {lr} ldr r0, =0x030075f0 ldr r1, [r0, 0x4] movs r2, 0x80 lsls r2, 24 adds r3, r0, 0 cmp r1, 0 bge @080A38BA ldr r0, =0x03007630 ldr r0, [r0, 0x4] ands r0, r2 cmp r0, 0 bne @080A38CC @080A38BA: ldr r1, =0x0000ffff ldrh r0, [r3, 0x4] cmp r0, 0 bne @080A38DC ldr r0, =0x03007630 ldr r0, [r0, 0x4] ands r0, r1 cmp r0, 0 bne @080A38DC @080A38CC: movs r0, 0 b @080A38DE .align 2, 0 .pool @080A38DC: movs r0, 0x1 @080A38DE: pop {r1} bx r1 thumb_func_end mplay_has_finished_maybe thumb_func_start sub_80A38E4 sub_80A38E4: ; 80A38E4 push {lr} ldr r0, =0x03007420 ldr r1, [r0, 0x4] cmp r1, 0 blt @080A3904 ldr r0, =0x0000ffff ands r1, r0 cmp r1, 0 beq @080A3904 movs r0, 0x1 b @080A3906 .align 2, 0 .pool @080A3904: movs r0, 0 @080A3906: pop {r1} bx r1 thumb_func_end sub_80A38E4 thumb_func_start sub_80A390C sub_80A390C: ; 80A390C push {lr} ldr r0, =0x03007800 ldr r1, [r0, 0x4] cmp r1, 0 blt @080A392C ldr r0, =0x0000ffff ands r1, r0 cmp r1, 0 beq @080A392C movs r0, 0x1 b @080A392E .align 2, 0 .pool @080A392C: movs r0, 0 @080A392E: pop {r1} bx r1 thumb_func_end sub_80A390C thumb_func_start sub_80A3934 sub_80A3934: ; 80A3934 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x020383fc movs r1, 0 strb r1, [r0] ldr r0, =0x020383fd strb r1, [r0] ldr r0, =0x020383fe strb r1, [r0] ldr r0, =0x020383ff strb r1, [r0] ldr r0, =0x02038400 movs r1, 0 str r1, [r0] ldr r0, =0x02038404 str r1, [r0] ldr r0, =0x02038408 movs r2, 0 strh r1, [r0] ldr r0, =0x0203841a strb r2, [r0] ldr r4, =0x02038430 ldr r5, =0x02038432 ldr r6, =0x02038433 ldr r7, =0x02038434 ldr r0, =0x02038436 mov r12, r0 ldr r1, =0x02038437 mov r8, r1 ldr r0, =0x02038440 mov r9, r0 ldr r1, =0x0000ffff adds r3, r1, 0 ldr r1, =0x0203840a movs r2, 0x7 @080A397E: ldrh r0, [r1] orrs r0, r3 strh r0, [r1] adds r1, 0x2 subs r2, 0x1 cmp r2, 0 bge @080A397E ldr r1, =0x0203841e movs r2, 0 adds r0, r1, 0 adds r0, 0xE @080A3994: strh r2, [r0] subs r0, 0x2 cmp r0, r1 bge @080A3994 movs r1, 0 movs r0, 0xFF strb r0, [r4] movs r0, 0x1 negs r0, r0 strb r0, [r4, 0x1] strb r1, [r5] strb r1, [r6] movs r0, 0 strh r1, [r7] mov r1, r12 strb r0, [r1] mov r1, r8 strb r0, [r1] mov r1, r9 strb r0, [r1] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3934 thumb_func_start move_anim_start_t1 move_anim_start_t1: ; 80A3A10 push {lr} adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 ldr r2, =0x02038436 ldr r0, =0x0202420b ldrb r0, [r0] strb r0, [r2] ldr r2, =0x02038437 ldr r0, =0x0202420c ldrb r0, [r0] strb r0, [r2] ldr r0, =gUnknown_082C8D6C movs r2, 0x1 bl move_something pop {r0} bx r0 .align 2, 0 .pool thumb_func_end move_anim_start_t1 thumb_func_start move_something move_something: ; 80A3A48 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 str r0, [sp] lsls r1, 16 lsrs r1, 16 mov r8, r1 lsls r2, 24 lsrs r2, 24 mov r9, r2 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A3AE8 bl sub_80A8278 movs r0, 0 bl sub_8072A88 movs r4, 0 mov r0, r8 lsls r0, 2 mov r10, r0 ldr r6, =0x0202406e movs r7, 0x64 ldr r5, =0x02038438 @080A3A84: lsls r0, r4, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A3AA8 ldrh r0, [r6] muls r0, r7 ldr r1, =0x02024744 b @080A3AAE .align 2, 0 .pool @080A3AA8: ldrh r0, [r6] muls r0, r7 ldr r1, =0x020244ec @080A3AAE: adds r0, r1 movs r1, 0xB bl pokemon_getattr strh r0, [r5] adds r6, 0x2 adds r5, 0x2 adds r4, 0x1 cmp r4, 0x3 ble @080A3A84 ldr r3, =0x02038434 ldr r5, =0x02038430 ldr r1, =0x020383fd mov r12, r1 ldr r7, =0x020383f8 ldr r6, =move_anim_execute b @080A3B10 .align 2, 0 .pool @080A3AE8: ldr r3, =0x02038434 ldr r5, =0x02038430 mov r0, r8 lsls r0, 2 mov r10, r0 ldr r1, =0x020383fd mov r12, r1 ldr r7, =0x020383f8 ldr r6, =move_anim_execute ldr r2, =0x02039f34 ldr r1, =0x02038438 movs r4, 0x3 @080A3B00: ldr r0, [r2] ldr r0, [r0, 0x18] ldrh r0, [r0] strh r0, [r1] adds r1, 0x2 subs r4, 0x1 cmp r4, 0 bge @080A3B00 @080A3B10: mov r0, r9 cmp r0, 0 bne @080A3B38 strh r0, [r3] b @080A3B3C .align 2, 0 .pool @080A3B38: mov r1, r8 strh r1, [r3] @080A3B3C: ldr r1, =0x0203841e movs r2, 0 adds r0, r1, 0 adds r0, 0xE @080A3B44: strh r2, [r0] subs r0, 0x2 cmp r0, r1 bge @080A3B44 movs r0, 0xFF strb r0, [r5] movs r0, 0x1 negs r0, r0 strb r0, [r5, 0x1] ldr r0, [sp] add r0, r10 ldr r0, [r0] ldr r1, =0x020383f0 str r0, [r1] movs r0, 0x1 mov r1, r12 strb r0, [r1] movs r0, 0 ldr r1, =0x020383fc strb r0, [r1] str r6, [r7] ldr r0, =0x0000ffff adds r2, r0, 0 ldr r1, =0x0203840a movs r4, 0x7 @080A3B76: ldrh r0, [r1] orrs r0, r2 strh r0, [r1] adds r1, 0x2 subs r4, 0x1 cmp r4, 0 bge @080A3B76 mov r1, r9 cmp r1, 0 beq @080A3BC2 movs r4, 0 ldr r2, =gUnknown_082C8D64 b @080A3BAA .align 2, 0 .pool @080A3BA8: adds r4, 0x1 @080A3BAA: lsls r0, r4, 1 adds r0, r2 ldrh r0, [r0] ldr r1, =0x0000ffff cmp r0, r1 beq @080A3BC2 cmp r8, r0 bne @080A3BA8 ldr r0, =0x03007420 movs r2, 0x80 bl MPlayVolumeControl @080A3BC2: ldr r0, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r0, =0x02022e28 strh r1, [r0] ldr r0, =0x02022e2a strh r1, [r0] add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end move_something thumb_func_start move_anim_8072740 move_anim_8072740: ; 80A3BFC push {r4,lr} adds r4, r0, 0 bl obj_free_rotscale_entry adds r0, r4, 0 bl obj_delete_and_free_tiles ldr r1, =0x020383fe ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end move_anim_8072740 thumb_func_start move_anim_task_del move_anim_task_del: ; 80A3C1C push {lr} lsls r0, 24 lsrs r0, 24 bl remove_task ldr r1, =0x020383fe ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end move_anim_task_del thumb_func_start move_anim_related_task_del move_anim_related_task_del: ; 80A3C38 push {lr} lsls r0, 24 lsrs r0, 24 bl remove_task ldr r1, =0x020383ff ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end move_anim_related_task_del thumb_func_start sub_80A3C54 sub_80A3C54: ; 80A3C54 push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 ldr r4, =0x0000ffff ldr r1, =0x0203840a @080A3C60: ldrh r0, [r1] cmp r0, r4 bne @080A3C74 strh r3, [r1] b @080A3C7C .align 2, 0 .pool @080A3C74: adds r1, 0x2 adds r2, 0x1 cmp r2, 0x7 ble @080A3C60 @080A3C7C: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A3C54 thumb_func_start sub_80A3C84 sub_80A3C84: ; 80A3C84 push {r4,lr} lsls r0, 16 lsrs r3, r0, 16 movs r2, 0 ldr r0, =0x0000ffff adds r4, r0, 0 ldr r1, =0x0203840a @080A3C92: ldrh r0, [r1] cmp r0, r3 bne @080A3CA8 orrs r0, r4 strh r0, [r1] b @080A3CB0 .align 2, 0 .pool @080A3CA8: adds r1, 0x2 adds r2, 0x1 cmp r2, 0x7 ble @080A3C92 @080A3CB0: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A3C84 thumb_func_start move_anim_waiter move_anim_waiter: ; 80A3CB8 push {lr} ldr r2, =0x020383fc ldrb r1, [r2] movs r0, 0 ldrsb r0, [r2, r0] cmp r0, 0 bgt @080A3CDC ldr r0, =0x020383f8 ldr r1, =move_anim_execute str r1, [r0] movs r0, 0 b @080A3CDE .align 2, 0 .pool @080A3CDC: subs r0, r1, 0x1 @080A3CDE: strb r0, [r2] pop {r0} bx r0 thumb_func_end move_anim_waiter thumb_func_start move_anim_execute move_anim_execute: ; 80A3CE4 push {r4,lr} ldr r4, =gUnknown_08525E98 @080A3CE8: ldr r0, =0x020383f0 ldr r0, [r0] ldrb r0, [r0] lsls r0, 2 adds r0, r4 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fc ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 bne @080A3D0C ldr r0, =0x020383fd ldrb r0, [r0] cmp r0, 0 bne @080A3CE8 @080A3D0C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end move_anim_execute thumb_func_start ma00_load_graphics ma00_load_graphics: ; 80A3D24 push {r4-r6,lr} ldr r6, =0x020383f0 ldr r0, [r6] adds r1, r0, 0x1 str r1, [r6] ldrb r4, [r0, 0x1] ldrb r0, [r1, 0x1] lsls r0, 8 orrs r4, r0 lsls r5, r4, 3 ldr r0, =gUnknown_085112C4 adds r0, r5, r0 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_08511BCC 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, =0xffffd8f0 adds r4, r0 lsls r4, 16 lsrs r4, 16 adds r0, r4, 0 bl sub_80A3C54 ldr r1, =0x020383fc movs r0, 0x1 strb r0, [r1] ldr r1, =0x020383f8 ldr r0, =move_anim_waiter str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma00_load_graphics thumb_func_start ma01_080728D0 ; void ma01_080728D0() ma01_080728D0: ; 80A3D8C push {r4-r6,lr} ldr r6, =0x020383f0 ldr r0, [r6] adds r1, r0, 0x1 str r1, [r6] ldrb r4, [r0, 0x1] ldrb r0, [r1, 0x1] lsls r0, 8 orrs r4, r0 ldr r1, =gUnknown_08524B44 ldr r0, =0xffffd8f0 adds r4, r0 lsls r0, r4, 3 adds r0, r1 ldrh r5, [r0, 0x6] adds r0, r5, 0 bl 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 .pool thumb_func_end ma01_080728D0 thumb_func_start ma02_instanciate_template ma02_instanciate_template: ; 80A3DD8 push {r4-r7,lr} ldr r5, =0x020383f0 ldr r1, [r5] adds r3, r1, 0x1 str r3, [r5] ldrb r2, [r1, 0x1] ldrb r0, [r3, 0x1] lsls r0, 8 adds r2, r0 ldrb r0, [r3, 0x2] lsls r0, 16 adds r2, r0 ldrb r0, [r3, 0x3] lsls r0, 24 adds r7, r2, r0 adds r0, r1, 0x5 str r0, [r5] ldrb r4, [r1, 0x5] adds r0, r1, 0x6 str r0, [r5] ldrb r0, [r1, 0x6] adds r1, 0x7 str r1, [r5] cmp r0, 0 beq @080A3E28 adds r6, r5, 0 ldr r5, =0x0203841e adds r3, r0, 0 @080A3E10: ldr r2, [r6] ldrb r1, [r2] ldrb r0, [r2, 0x1] lsls r0, 8 orrs r1, r0 strh r1, [r5] adds r2, 0x2 str r2, [r6] adds r5, 0x2 subs r3, 0x1 cmp r3, 0 bne @080A3E10 @080A3E28: movs r0, 0x80 ands r0, r4 cmp r0, 0 beq @080A3E58 movs r0, 0x80 eors r4, r0 cmp r4, 0x3F bls @080A3E48 adds r0, r4, 0 subs r0, 0x40 b @080A3E4A .align 2, 0 .pool @080A3E48: negs r0, r4 @080A3E4A: lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02038437 b @080A3E6A .align 2, 0 .pool @080A3E58: cmp r4, 0x3F bls @080A3E62 adds r0, r4, 0 subs r0, 0x40 b @080A3E64 @080A3E62: negs r0, r4 @080A3E64: lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02038436 @080A3E6A: ldrb r0, [r0] bl sub_80A82E4 lsls r0, 24 lsrs r0, 24 lsls r1, r4, 24 asrs r1, 24 adds r0, r1 lsls r0, 16 lsrs r6, r0, 16 lsls r0, r6, 16 asrs r0, 16 cmp r0, 0x2 bgt @080A3E88 movs r6, 0x3 @080A3E88: ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 lsls r3, r6, 24 lsrs r3, 24 adds r0, r7, 0 adds r1, r4, 0 bl obj_add_from_template_call_callback_once ldr r1, =0x020383fe ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma02_instanciate_template thumb_func_start sub_80A3ECC sub_80A3ECC: ; 80A3ECC push {r4-r7,lr} ldr r4, =0x020383f0 ldr r1, [r4] adds r3, r1, 0x1 str r3, [r4] ldrb r2, [r1, 0x1] ldrb r0, [r3, 0x1] lsls r0, 8 adds r2, r0 ldrb r0, [r3, 0x2] lsls r0, 16 adds r2, r0 ldrb r0, [r3, 0x3] lsls r0, 24 adds r6, r2, r0 adds r0, r1, 0x5 str r0, [r4] ldrb r7, [r1, 0x5] adds r0, r1, 0x6 str r0, [r4] ldrb r0, [r1, 0x6] adds r1, 0x7 str r1, [r4] cmp r0, 0 beq @080A3F1C adds r5, r4, 0 ldr r4, =0x0203841e adds r3, r0, 0 @080A3F04: ldr r2, [r5] ldrb r1, [r2] ldrb r0, [r2, 0x1] lsls r0, 8 orrs r1, r0 strh r1, [r4] adds r2, 0x2 str r2, [r5] adds r4, 0x2 subs r3, 0x1 cmp r3, 0 bne @080A3F04 @080A3F1C: adds r0, r6, 0 adds r1, r7, 0 bl AddTask lsls r0, 24 lsrs r0, 24 bl _call_via_r6 ldr r1, =0x020383fe ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3ECC thumb_func_start ma04_wait_countdown ma04_wait_countdown: ; 80A3F48 push {r4,lr} ldr r1, =0x020383f0 ldr r0, [r1] adds r2, r0, 0x1 str r2, [r1] ldr r3, =0x020383fc ldrb r0, [r0, 0x1] strb r0, [r3] lsls r0, 24 cmp r0, 0 bne @080A3F66 movs r4, 0x1 negs r4, r4 adds r0, r4, 0 strb r0, [r3] @080A3F66: adds r0, r2, 0x1 str r0, [r1] ldr r1, =0x020383f8 ldr r0, =move_anim_waiter str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma04_wait_countdown thumb_func_start sub_80A3F88 sub_80A3F88: ; 80A3F88 push {lr} ldr r0, =0x020383fe ldrb r2, [r0] cmp r2, 0 bne @080A3FAC ldr r0, =0x020383f0 ldr r1, [r0] adds r1, 0x1 str r1, [r0] ldr r0, =0x020383fc strb r2, [r0] b @080A3FB2 .align 2, 0 .pool @080A3FAC: ldr r1, =0x020383fc movs r0, 0x1 strb r0, [r1] @080A3FB2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3F88 thumb_func_start nullsub_6 nullsub_6: ; 80A3FBC bx lr thumb_func_end nullsub_6 thumb_func_start nullsub_7 nullsub_7: ; 80A3FC0 bx lr thumb_func_end nullsub_7 thumb_func_start sub_80A3FC4 sub_80A3FC4: ; 80A3FC4 push {r4-r7,lr} mov r7, r8 push {r7} movs r0, 0 mov r8, r0 ldr r0, =0x020383fe ldrb r0, [r0] cmp r0, 0 bne @080A3FEC ldr r0, =0x020383ff ldrb r0, [r0] cmp r0, 0 bne @080A3FEC ldr r1, =0x02038430 ldrb r0, [r1] cmp r0, 0xFF bne @080A3FEC ldrb r0, [r1, 0x1] cmp r0, 0xFF beq @080A4004 @080A3FEC: ldr r1, =0x0203842e movs r0, 0 strh r0, [r1] b @080A401E .align 2, 0 .pool @080A4004: bl mplay_has_finished_maybe lsls r0, 24 cmp r0, 0 beq @080A403C ldr r1, =0x0203842e ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] lsls r0, 16 lsrs r0, 16 cmp r0, 0x5A bhi @080A4030 @080A401E: ldr r1, =0x020383fc movs r0, 0x1 strb r0, [r1] b @080A40A2 .align 2, 0 .pool @080A4030: ldr r0, =0x030075f0 bl MPlayStop_rev01 ldr r0, =0x03007630 bl MPlayStop_rev01 @080A403C: ldr r1, =0x0203842e movs r0, 0 strh r0, [r1] movs r5, 0 ldr r7, =0x0000ffff ldr r6, =gUnknown_08524B44 ldr r4, =0x0203840a @080A404A: ldrh r0, [r4] cmp r0, r7 beq @080A406E lsls r0, 3 adds r0, r6 ldrh r0, [r0, 0x6] bl 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, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A409C bl sub_80A8278 movs r0, 0x1 bl sub_8072A88 @080A409C: ldr r0, =0x020383fd mov r1, r8 strb r1, [r0] @080A40A2: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A3FC4 thumb_func_start ma09_play_sound ma09_play_sound: ; 80A40CC push {r4,lr} ldr r4, =0x020383f0 ldr r0, [r4] adds r1, r0, 0x1 str r1, [r4] ldrb r0, [r0, 0x1] ldrb r1, [r1, 0x1] lsls r1, 8 orrs r0, r1 bl audio_play ldr r0, [r4] adds r0, 0x2 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma09_play_sound thumb_func_start sub_80A40F4 sub_80A40F4: ; 80A40F4 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r7, r0, 24 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 ldr r1, =0x03005e08 mov r8, r1 adds r6, r0, r1 ldr r1, =0x020241e4 movs r2, 0 ldrsh r0, [r6, r2] adds r0, r1 ldrb r5, [r0] ldr r1, =0x02020630 lsls r0, r5, 4 adds r0, r5 lsls r0, 2 adds r4, r0, r1 adds r2, r4, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] movs r3, 0x4 ldrsh r0, [r6, r3] cmp r0, 0 bne @080A4148 adds r0, r7, 0 bl move_anim_task_del b @080A41BE .align 2, 0 .pool @080A4148: ldr r0, =task_pA_ma0A_obj_to_bg_pal movs r1, 0xA bl AddTask lsls r0, 24 lsrs r2, r0, 24 mov r1, r8 subs r1, 0x8 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r1, r0, r1 strh r5, [r1, 0x8] ldrh r0, [r4, 0x24] ldrh r3, [r4, 0x20] adds r0, r3 strh r0, [r1, 0xA] ldrh r0, [r4, 0x26] ldrh r4, [r4, 0x22] adds r0, r4 strh r0, [r1, 0xC] movs r3, 0x2 ldrsh r0, [r6, r3] cmp r0, 0 bne @080A4190 ldr r0, =0x02022e18 ldrh r0, [r0] strh r0, [r1, 0xE] ldr r0, =0x02022e1a b @080A4198 .align 2, 0 .pool @080A4190: ldr r0, =0x02022e1c ldrh r0, [r0] strh r0, [r1, 0xE] ldr r0, =0x02022e1e @080A4198: ldrh r0, [r0] strh r0, [r1, 0x10] ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 ldrh r1, [r6, 0x2] strh r1, [r0, 0x12] ldrh r1, [r6] strh r1, [r0, 0x14] ldr r1, =0x02038430 movs r3, 0x6 ldrsh r0, [r6, r3] adds r0, r1 strb r2, [r0] adds r0, r7, 0 bl move_anim_task_del @080A41BE: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A40F4 thumb_func_start sub_80A41D8 sub_80A41D8: ; 80A41D8 push {r4,r5,lr} ldr r1, =0x020383f0 ldr r2, [r1] adds r0, r2, 0x1 str r0, [r1] ldrb r0, [r2, 0x1] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @080A41F8 ldr r0, =0x02038437 b @080A41FA .align 2, 0 .pool @080A41F8: ldr r0, =0x02038436 @080A41FA: ldrb r4, [r0] adds r0, r4, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A4266 adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 movs r1, 0xFF lsls r1, 24 adds r0, r1 lsrs r0, 24 cmp r0, 0x1 bls @080A4226 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A4230 @080A4226: movs r5, 0 b @080A4232 .align 2, 0 .pool @080A4230: movs r5, 0x1 @080A4232: adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 bl sub_80A438C ldr r0, =sub_80A40F4 movs r1, 0xA bl AddTask lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x020383fe ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 movs r2, 0 strh r4, [r0, 0x8] strh r5, [r0, 0xA] movs r1, 0x1 strh r1, [r0, 0xC] strh r2, [r0, 0xE] @080A4266: movs r0, 0x2 eors r4, r0 adds r0, r4, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A42D8 adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 movs r1, 0xFF lsls r1, 24 adds r0, r1 lsrs r0, 24 cmp r0, 0x1 bls @080A4294 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A42A4 @080A4294: movs r5, 0 b @080A42A6 .align 2, 0 .pool @080A42A4: movs r5, 0x1 @080A42A6: adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 bl sub_80A438C ldr r0, =sub_80A40F4 movs r1, 0xA bl AddTask lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x020383fe ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 strh r4, [r0, 0x8] strh r5, [r0, 0xA] movs r1, 0x1 strh r1, [r0, 0xC] strh r1, [r0, 0xE] @080A42D8: ldr r1, =0x020383f0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r1, =0x020383fc movs r0, 0x1 strb r0, [r1] ldr r1, =0x020383f8 ldr r0, =move_anim_waiter str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A41D8 thumb_func_start b_side_obj__get_some_boolean b_side_obj__get_some_boolean: ; 80A4310 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A4330 ldr r0, =0x02038436 ldrb r0, [r0] cmp r4, r0 beq @080A4374 b @080A4384 .align 2, 0 .pool @080A4330: adds r0, r4, 0 bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @080A4384 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A4374 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r5, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080A4374 ldr r2, =0x02020630 ldr r0, =0x020241e4 adds r0, r5, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @080A4384 @080A4374: movs r0, 0x1 b @080A4386 .align 2, 0 .pool @080A4384: movs r0, 0 @080A4386: pop {r4,r5} pop {r1} bx r1 thumb_func_end b_side_obj__get_some_boolean thumb_func_start sub_80A438C sub_80A438C: ; 80A438C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x28 lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 lsls r1, 24 lsls r2, 24 lsrs r2, 24 mov r9, r2 cmp r1, 0 beq @080A43AA b @080A455E @080A43AA: bl sub_80A4DF0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080A43DC ldr r1, =0x06008000 movs r2, 0x80 lsls r2, 6 movs r0, 0 movs r3, 0x1 bl RequestDma3Fill ldr r1, =0x0600f000 movs r2, 0x80 lsls r2, 5 movs r0, 0xFF movs r3, 0 bl RequestDma3Fill b @080A43F8 .align 2, 0 .pool @080A43DC: ldr r1, =0x06004000 movs r2, 0x80 lsls r2, 6 movs r0, 0 movs r3, 0x1 bl RequestDma3Fill ldr r1, =0x0600e000 movs r2, 0x80 lsls r2, 5 movs r0, 0xFF movs r3, 0 bl RequestDma3Fill @080A43F8: add r0, sp, 0x10 bl sub_80A6B30 add r0, sp, 0x20 movs r1, 0 strh r1, [r0] ldr r1, [sp, 0x10] ldr r2, =0x01000800 bl CpuSet mov r0, sp adds r0, 0x22 movs r1, 0xFF strh r1, [r0] ldr r1, [sp, 0x14] ldr r2, =0x01000400 bl CpuSet movs r0, 0x1 movs r1, 0x4 movs r2, 0x2 bl lcd_bg_operations movs r0, 0x1 movs r1, 0 movs r2, 0x1 bl lcd_bg_operations movs r0, 0x1 movs r1, 0x1 movs r2, 0 bl lcd_bg_operations ldr r0, =0x020241e4 adds r0, r6, r0 ldrb r4, [r0] ldr r5, =0x02022e18 ldr r0, =0x02020630 lsls r1, r4, 4 adds r1, r4 lsls r1, 2 adds r1, r0 ldrh r0, [r1, 0x24] ldrh r1, [r1, 0x20] adds r0, r1 negs r0, r0 adds r0, 0x20 strh r0, [r5] bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A447A ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r0, [r0] bl sub_80DB2A8 lsls r0, 24 cmp r0, 0 beq @080A447A ldrh r0, [r5] subs r0, 0x1 strh r0, [r5] @080A447A: ldr r5, =0x02022e1a ldr r2, =0x02020630 lsls r1, r4, 4 adds r1, r4 lsls r1, 2 adds r1, r2 ldrh r0, [r1, 0x26] ldrh r1, [r1, 0x22] adds r0, r1 negs r0, r0 adds r0, 0x20 strh r0, [r5] mov r0, r9 cmp r0, 0 beq @080A44B0 ldr r0, =0x020241e4 adds r0, r6, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @080A44B0: ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 bl lcd_io_set ldrh r1, [r5] movs r0, 0x16 bl lcd_io_set lsls r4, r6, 5 ldr r0, =0x02037914 adds r4, r0 add r0, sp, 0x10 ldrb r1, [r0, 0x8] lsls r1, 4 adds r0, r4, 0 movs r2, 0x20 bl gpu_pal_apply add r0, sp, 0x10 ldrb r1, [r0, 0x8] lsls r1, 5 movs r0, 0xA0 lsls r0, 19 adds r1, r0 ldr r2, =0x04000008 adds r0, r4, 0 bl CpuSet bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A4524 movs r3, 0 b @080A452E .align 2, 0 .pool @080A4524: adds r0, r6, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r3, r0, 24 @080A452E: add r0, sp, 0x10 ldrb r0, [r0, 0x8] str r0, [sp] ldr r0, [sp, 0x10] str r0, [sp, 0x4] ldr r0, [sp, 0x14] str r0, [sp, 0x8] add r0, sp, 0x10 ldrh r0, [r0, 0xA] str r0, [sp, 0xC] movs r0, 0x1 movs r1, 0 movs r2, 0 bl sub_8118FBC bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A4558 b @080A4666 @080A4558: bl sub_80A46A0 b @080A4666 @080A455E: ldr r1, =0x06006000 movs r2, 0x80 lsls r2, 6 movs r0, 0 movs r3, 0x1 bl RequestDma3Fill ldr r1, =0x0600f000 movs r7, 0x80 lsls r7, 5 movs r0, 0 adds r2, r7, 0 movs r3, 0x1 bl RequestDma3Fill add r0, sp, 0x10 movs r1, 0x2 bl sub_80A6B90 add r0, sp, 0x24 movs r4, 0 strh r4, [r0] ldr r1, [sp, 0x10] adds r1, r7 ldr r2, =0x01000800 bl CpuSet mov r0, sp adds r0, 0x26 strh r4, [r0] ldr r1, [sp, 0x14] movs r2, 0x80 lsls r2, 4 mov r8, r2 add r1, r8 ldr r2, =0x01000400 bl CpuSet movs r0, 0x2 movs r1, 0x4 movs r2, 0x2 bl lcd_bg_operations movs r0, 0x2 movs r1, 0 movs r2, 0x1 bl lcd_bg_operations movs r0, 0x2 movs r1, 0x1 movs r2, 0 bl lcd_bg_operations ldr r0, =0x020241e4 adds r2, r5, r0 ldrb r4, [r2] ldr r5, =0x02022e1c ldr r3, =0x02020630 lsls r1, r4, 4 adds r1, r4 lsls r1, 2 adds r1, r3 ldrh r0, [r1, 0x24] ldrh r4, [r1, 0x20] adds r0, r4 negs r0, r0 adds r0, 0x20 strh r0, [r5] ldr r4, =0x02022e1e ldrh r0, [r1, 0x26] ldrh r1, [r1, 0x22] adds r0, r1 negs r0, r0 adds r0, 0x20 strh r0, [r4] mov r0, r9 cmp r0, 0 beq @080A460E ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @080A460E: ldrh r1, [r5] movs r0, 0x18 bl lcd_io_set ldrh r1, [r4] movs r0, 0x1A bl lcd_io_set lsls r4, r6, 5 ldr r0, =0x02037914 adds r4, r0 adds r0, r4, 0 movs r1, 0x90 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0x05000120 ldr r2, =0x04000008 adds r0, r4, 0 bl CpuSet adds r0, r6, 0 bl battle_get_per_side_status adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 add r0, sp, 0x10 ldrb r0, [r0, 0x8] str r0, [sp] ldr r0, [sp, 0x10] adds r0, r7 str r0, [sp, 0x4] ldr r0, [sp, 0x14] add r0, r8 str r0, [sp, 0x8] add r0, sp, 0x10 ldrh r0, [r0, 0xA] str r0, [sp, 0xC] movs r0, 0x2 movs r1, 0 movs r2, 0 bl sub_8118FBC @080A4666: add sp, 0x28 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A438C thumb_func_start sub_80A46A0 sub_80A46A0: ; 80A46A0 push {r4-r7,lr} sub sp, 0x10 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r0, [r0] bl sub_80DB2A8 lsls r0, 24 cmp r0, 0 beq @080A4712 mov r0, sp bl sub_80A6B30 ldr r6, [sp, 0x4] movs r5, 0 movs r0, 0x7 mov r12, r0 movs r7, 0 @080A46C6: movs r4, 0 adds r3, r7, r6 mov r1, r12 lsls r0, r1, 1 adds r2, r0, r6 @080A46D0: ldrh r1, [r3] ldrh r0, [r2] strh r0, [r3] strh r1, [r2] adds r3, 0x2 subs r2, 0x2 adds r4, 0x1 cmp r4, 0x3 ble @080A46D0 movs r0, 0x20 add r12, r0 adds r7, 0x40 adds r5, 0x1 cmp r5, 0x7 ble @080A46C6 movs r5, 0 movs r1, 0x80 lsls r1, 3 adds r3, r1, 0 @080A46F6: adds r2, r5, 0x1 lsls r0, r5, 6 adds r1, r0, r6 movs r4, 0x7 @080A46FE: ldrh r0, [r1] eors r0, r3 strh r0, [r1] adds r1, 0x2 subs r4, 0x1 cmp r4, 0 bge @080A46FE adds r5, r2, 0 cmp r5, 0x7 ble @080A46F6 @080A4712: add sp, 0x10 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A46A0 thumb_func_start sub_80A4720 sub_80A4720: ; 80A4720 push {r4-r7,lr} mov r7, r8 push {r7} mov r8, r1 adds r6, r2, 0 lsls r0, 16 lsrs r5, r0, 16 lsls r3, 24 movs r0, 0x40 mov r12, r0 cmp r3, 0 bne @080A473C movs r1, 0x20 mov r12, r1 @080A473C: lsls r0, r5, 28 lsrs r5, r0, 16 movs r0, 0 cmp r0, r12 bge @080A476C ldr r7, =0x00000fff @080A4748: adds r4, r0, 0x1 lsls r0, 6 mov r1, r8 adds r3, r0, r1 movs r2, 0x1F @080A4752: ldrh r1, [r3] adds r0, r7, 0 ands r0, r1 orrs r0, r5 adds r0, r6 strh r0, [r3] adds r3, 0x2 subs r2, 0x1 cmp r2, 0 bge @080A4752 adds r0, r4, 0 cmp r0, r12 blt @080A4748 @080A476C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A4720 thumb_func_start sub_80A477C sub_80A477C: ; 80A477C push {r4,lr} sub sp, 0x10 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 mov r0, sp bl sub_80A6B30 cmp r4, 0 beq @080A479C bl sub_80A4DF0 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @080A47B8 @080A479C: movs r0, 0x1 bl sub_80A6C68 ldr r0, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] b @080A47C6 .align 2, 0 .pool @080A47B8: movs r0, 0x2 bl sub_80A6C68 ldr r0, =0x02022e1c strh r4, [r0] ldr r0, =0x02022e1e strh r4, [r0] @080A47C6: add sp, 0x10 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A477C thumb_func_start task_pA_ma0A_obj_to_bg_pal ; void task_pA_ma0A_obj_to_bg_pal(int task_id) task_pA_ma0A_obj_to_bg_pal: ; 80A47D8 push {r4-r6,lr} sub sp, 0x10 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r5, r1, r2 ldrb r4, [r5, 0x8] ldrb r6, [r5, 0x14] mov r0, sp bl sub_80A6B30 ldr r0, =0x02020630 lsls r1, r4, 4 adds r1, r4 lsls r1, 2 adds r1, r0 ldrh r2, [r1, 0x24] ldrh r0, [r1, 0x20] adds r2, r0 ldrh r0, [r5, 0xA] subs r0, r2 lsls r0, 16 lsrs r3, r0, 16 ldrh r2, [r1, 0x26] ldrh r1, [r1, 0x22] adds r2, r1 ldrh r0, [r5, 0xC] subs r0, r2 lsls r0, 16 lsrs r2, r0, 16 movs r1, 0x12 ldrsh r0, [r5, r1] cmp r0, 0 bne @080A4870 ldr r1, =0x02022e18 lsls r0, r3, 16 asrs r0, 16 ldrh r3, [r5, 0xE] adds r0, r3 strh r0, [r1] ldr r1, =0x02022e1a lsls r0, r2, 16 asrs r0, 16 ldrh r5, [r5, 0x10] adds r0, r5 strh r0, [r1] lsls r0, r6, 5 ldr r2, =0x02037d14 adds r0, r2 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 5 ldr r3, =0xfffffe00 adds r2, r3 adds r1, r2 ldr r2, =0x04000008 bl CpuSet b @080A4896 .align 2, 0 .pool @080A4870: ldr r1, =0x02022e1c lsls r0, r3, 16 asrs r0, 16 ldrh r3, [r5, 0xE] adds r0, r3 strh r0, [r1] ldr r1, =0x02022e1e lsls r0, r2, 16 asrs r0, 16 ldrh r5, [r5, 0x10] adds r0, r5 strh r0, [r1] lsls r0, r6, 5 ldr r1, =0x02037d14 adds r0, r1 subs r1, 0xE0 ldr r2, =0x04000008 bl CpuSet @080A4896: add sp, 0x10 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_pA_ma0A_obj_to_bg_pal thumb_func_start ma0B_0807324C ma0B_0807324C: ; 80A48B0 push {r4,r5,lr} ldr r0, =0x020383f0 ldr r2, [r0] adds r1, r2, 0x1 str r1, [r0] ldrb r4, [r2, 0x1] cmp r4, 0 bne @080A48C8 movs r4, 0x2 b @080A48D2 .align 2, 0 .pool @080A48C8: cmp r4, 0x1 bne @080A48CE movs r4, 0x3 @080A48CE: cmp r4, 0 beq @080A48D6 @080A48D2: cmp r4, 0x2 bne @080A48E0 @080A48D6: ldr r0, =0x02038436 b @080A48E2 .align 2, 0 .pool @080A48E0: ldr r0, =0x02038437 @080A48E2: ldrb r5, [r0] ldr r3, =0x02038430 ldrb r0, [r3] cmp r0, 0xFF beq @080A4908 ldr r2, =0x02020630 ldr r0, =0x020241e4 adds r0, r5, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] @080A4908: cmp r4, 0x1 bls @080A4948 ldrb r0, [r3, 0x1] cmp r0, 0xFF beq @080A4948 ldr r3, =0x02020630 ldr r2, =0x020241e4 movs r1, 0x2 adds r0, r5, 0 eors r0, r1 adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] b @080A494A .align 2, 0 .pool @080A4948: movs r4, 0 @080A494A: ldr r0, =sub_80A4980 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] strh r5, [r1, 0xC] ldr r1, =0x020383f0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma0B_0807324C thumb_func_start sub_80A4980 sub_80A4980: ; 80A4980 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r1, r0, r1 ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] lsls r0, 16 asrs r0, 16 cmp r0, 0x1 beq @080A4A0A ldrb r0, [r1, 0xC] bl battle_get_per_side_status lsls r0, 24 movs r1, 0xFF lsls r1, 24 adds r0, r1 lsrs r0, 24 cmp r0, 0x1 bls @080A49BC bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A49C4 @080A49BC: movs r4, 0 b @080A49C6 .align 2, 0 .pool @080A49C4: movs r4, 0x1 @080A49C6: ldr r6, =0x02038430 ldrb r0, [r6] cmp r0, 0xFF beq @080A49DE adds r0, r4, 0 bl sub_80A477C ldrb r0, [r6] bl remove_task movs r0, 0xFF strb r0, [r6] @080A49DE: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 movs r2, 0x8 ldrsh r0, [r1, r2] cmp r0, 0x1 ble @080A4A04 movs r0, 0x1 eors r4, r0 adds r0, r4, 0 bl sub_80A477C ldrb r0, [r6, 0x1] bl remove_task movs r0, 0xFF strb r0, [r6, 0x1] @080A4A04: adds r0, r5, 0 bl remove_task @080A4A0A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A4980 thumb_func_start sub_80A4A18 sub_80A4A18: ; 80A4A18 push {r4,r5,lr} ldr r0, =0x020383f0 ldr r2, [r0] adds r1, r2, 0x1 str r1, [r0] ldrb r5, [r2, 0x1] cmp r5, 0 bne @080A4A30 movs r5, 0x2 b @080A4A3A .align 2, 0 .pool @080A4A30: cmp r5, 0x1 bne @080A4A36 movs r5, 0x3 @080A4A36: cmp r5, 0 beq @080A4A3E @080A4A3A: cmp r5, 0x2 bne @080A4A48 @080A4A3E: ldr r0, =0x02038436 b @080A4A4A .align 2, 0 .pool @080A4A48: ldr r0, =0x02038437 @080A4A4A: ldrb r4, [r0] adds r0, r4, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A4A8A adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 movs r1, 0xFF lsls r1, 24 adds r0, r1 lsrs r0, 24 cmp r0, 0x1 bls @080A4A76 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A4A80 @080A4A76: movs r1, 0 b @080A4A82 .align 2, 0 .pool @080A4A80: movs r1, 0x1 @080A4A82: adds r0, r4, 0 movs r2, 0 bl sub_80A438C @080A4A8A: movs r0, 0x2 eors r4, r0 cmp r5, 0x1 bls @080A4ACA adds r0, r4, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A4ACA adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 movs r1, 0xFF lsls r1, 24 adds r0, r1 lsrs r0, 24 cmp r0, 0x1 bls @080A4ABC bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A4AC0 @080A4ABC: movs r1, 0 b @080A4AC2 @080A4AC0: movs r1, 0x1 @080A4AC2: adds r0, r4, 0 movs r2, 0 bl sub_80A438C @080A4ACA: ldr r1, =0x020383f0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A4A18 thumb_func_start ma23_8073484 ma23_8073484: ; 80A4ADC push {r4-r6,lr} ldr r0, =0x020383f0 ldr r2, [r0] adds r1, r2, 0x1 str r1, [r0] ldrb r5, [r2, 0x1] cmp r5, 0 bne @080A4AF4 movs r5, 0x2 b @080A4AFE .align 2, 0 .pool @080A4AF4: cmp r5, 0x1 bne @080A4AFA movs r5, 0x3 @080A4AFA: cmp r5, 0 beq @080A4B02 @080A4AFE: cmp r5, 0x2 bne @080A4B0C @080A4B02: ldr r0, =0x02038436 b @080A4B0E .align 2, 0 .pool @080A4B0C: ldr r0, =0x02038437 @080A4B0E: ldrb r6, [r0] adds r0, r6, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A4B38 ldr r2, =0x02020630 ldr r0, =0x020241e4 adds r0, r6, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] @080A4B38: cmp r5, 0x1 bls @080A4B78 movs r0, 0x2 adds r4, r6, 0 eors r4, r0 adds r0, r4, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A4B78 ldr r2, =0x02020630 ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] b @080A4B7A .align 2, 0 .pool @080A4B78: movs r5, 0 @080A4B7A: ldr r0, =sub_80A4BB0 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r5, [r1, 0x8] strh r6, [r1, 0xC] ldr r1, =0x020383f0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma23_8073484 thumb_func_start sub_80A4BB0 sub_80A4BB0: ; 80A4BB0 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r1, r0, r1 ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] lsls r0, 16 asrs r0, 16 cmp r0, 0x1 beq @080A4C3E ldrb r4, [r1, 0xC] adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 movs r1, 0xFF lsls r1, 24 adds r0, r1 lsrs r0, 24 cmp r0, 0x1 bls @080A4BEE bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A4BF8 @080A4BEE: movs r5, 0 b @080A4BFA .align 2, 0 .pool @080A4BF8: movs r5, 0x1 @080A4BFA: adds r0, r4, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A4C0C adds r0, r5, 0 bl sub_80A477C @080A4C0C: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 movs r2, 0x8 ldrsh r0, [r1, r2] cmp r0, 0x1 ble @080A4C38 movs r0, 0x2 eors r4, r0 adds r0, r4, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A4C38 movs r0, 0x1 eors r5, r0 adds r0, r5, 0 bl sub_80A477C @080A4C38: adds r0, r6, 0 bl remove_task @080A4C3E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A4BB0 thumb_func_start ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument: ; 80A4C48 push {r4,r5,lr} ldr r2, =0x020383f0 ldr r0, [r2] adds r1, r0, 0x1 str r1, [r2] ldrb r5, [r0, 0x1] adds r0, r1, 0x1 str r0, [r2] ldrb r4, [r1, 0x1] lsls r4, 8 adds r0, 0x1 str r0, [r2] movs r1, 0xFD lsls r1, 6 movs r0, 0x50 bl 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 .pool thumb_func_end ma0C_set_BLDCNT_to_x3F40_and_BLDALPHA_to_argument thumb_func_start ma1E_set_BLDCNT ma1E_set_BLDCNT: ; 80A4C80 push {lr} ldr r3, =0x020383f0 ldr r0, [r3] adds r2, r0, 0x1 str r2, [r3] ldrb r1, [r0, 0x1] adds r0, r2, 0x1 str r0, [r3] ldrb r2, [r2, 0x1] lsls r2, 8 adds r0, 0x1 str r0, [r3] orrs r1, r2 movs r0, 0x50 bl lcd_io_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma1E_set_BLDCNT thumb_func_start ma0D_reset_BLDCNT_and_BLDALPHA ma0D_reset_BLDCNT_and_BLDALPHA: ; 80A4CA8 push {lr} ldr r1, =0x020383f0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] movs r0, 0x50 movs r1, 0 bl lcd_io_set movs r0, 0x52 movs r1, 0 bl lcd_io_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma0D_reset_BLDCNT_and_BLDALPHA thumb_func_start ma0E_call ma0E_call: ; 80A4CCC push {r4,lr} ldr r4, =0x020383f0 ldr r1, [r4] adds r3, r1, 0x1 str r3, [r4] ldr r2, =0x020383f4 adds r0, r1, 0x5 str r0, [r2] ldrb r1, [r1, 0x1] ldrb r0, [r3, 0x1] lsls r0, 8 adds r1, r0 ldrb r0, [r3, 0x2] lsls r0, 16 adds r1, r0 ldrb r0, [r3, 0x3] lsls r0, 24 adds r1, r0 str r1, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma0E_call thumb_func_start sub_80A4D00 sub_80A4D00: ; 80A4D00 ldr r0, =0x020383f0 ldr r1, =0x020383f4 ldr r1, [r1] str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80A4D00 thumb_func_start ma10_080736AC ma10_080736AC: ; 80A4D14 push {r4,r5,lr} ldr r5, =0x020383f0 ldr r1, [r5] adds r0, r1, 0x1 str r0, [r5] ldrb r2, [r1, 0x1] adds r3, r0, 0x1 str r3, [r5] ldrb r4, [r0, 0x1] ldrb r0, [r3, 0x1] lsls r0, 8 orrs r4, r0 adds r1, 0x4 str r1, [r5] ldr r0, =0x0203841e lsls r2, 1 adds r2, r0 strh r4, [r2] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma10_080736AC thumb_func_start ma11_if_else ma11_if_else: ; 80A4D48 push {lr} ldr r3, =0x020383f0 ldr r2, [r3] adds r0, r2, 0x1 str r0, [r3] ldr r0, =0x02038432 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080A4D62 adds r0, r2, 0x5 str r0, [r3] @080A4D62: ldr r2, [r3] ldrb r1, [r2] ldrb r0, [r2, 0x1] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x2] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 24 adds r1, r0 str r1, [r3] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma11_if_else thumb_func_start ma12_cond_if ma12_cond_if: ; 80A4D88 push {r4,r5,lr} ldr r5, =0x020383f0 ldr r4, [r5] adds r2, r4, 0x1 str r2, [r5] ldrb r1, [r4, 0x1] adds r3, r2, 0x1 str r3, [r5] ldr r0, =0x02038432 ldrb r0, [r0] cmp r1, r0 bne @080A4DC0 ldrb r1, [r2, 0x1] ldrb r0, [r3, 0x1] lsls r0, 8 adds r1, r0 ldrb r0, [r3, 0x2] lsls r0, 16 adds r1, r0 ldrb r0, [r3, 0x3] lsls r0, 24 adds r1, r0 str r1, [r5] b @080A4DC4 .align 2, 0 .pool @080A4DC0: adds r0, r4, 0x6 str r0, [r5] @080A4DC4: pop {r4,r5} pop {r0} bx r0 thumb_func_end ma12_cond_if thumb_func_start ma13_goto ma13_goto: ; 80A4DCC ldr r3, =0x020383f0 ldr r0, [r3] adds r2, r0, 0x1 str r2, [r3] ldrb r1, [r0, 0x1] ldrb r0, [r2, 0x1] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x2] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 24 adds r1, r0 str r1, [r3] bx lr .align 2, 0 .pool thumb_func_end ma13_goto thumb_func_start sub_80A4DF0 sub_80A4DF0: ; 80A4DF0 push {lr} ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080A4E10 movs r0, 0 b @080A4E12 .align 2, 0 .pool @080A4E10: movs r0, 0x1 @080A4E12: pop {r1} bx r1 thumb_func_end sub_80A4DF0 thumb_func_start ma14_load_background ma14_load_background: ; 80A4E18 push {r4,lr} ldr r1, =0x020383f0 ldr r2, [r1] adds r0, r2, 0x1 str r0, [r1] ldrb r4, [r2, 0x1] adds r0, 0x1 str r0, [r1] ldr r0, =task_p5_load_battle_screen_elements movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] ldr r1, =0x02038433 movs r0, 0x1 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma14_load_background thumb_func_start sub_80A4E5C sub_80A4E5C: ; 80A4E5C push {r4-r7,lr} mov r7, r8 push {r7} ldr r2, =0x020383f0 ldr r1, [r2] adds r0, r1, 0x1 str r0, [r2] ldrb r3, [r1, 0x1] mov r8, r3 ldrb r7, [r0, 0x1] ldrb r6, [r0, 0x2] adds r1, 0x4 str r1, [r2] ldr r0, =task_p5_load_battle_screen_elements movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A4EA8 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 strh r6, [r0, 0x8] b @080A4EDA .align 2, 0 .pool @080A4EA8: ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080A4ECC ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 strh r7, [r0, 0x8] b @080A4EDA .align 2, 0 .pool @080A4ECC: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 mov r1, r8 strh r1, [r0, 0x8] @080A4EDA: ldr r1, =0x02038433 movs r0, 0x1 strb r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A4E5C thumb_func_start task_p5_load_battle_screen_elements task_p5_load_battle_screen_elements: ; 80A4EF4 push {r4-r7,lr} sub sp, 0x4 lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 ldrh r6, [r4, 0x1C] movs r0, 0x1C ldrsh r3, [r4, r0] adds r7, r1, 0 cmp r3, 0 bne @080A4F2C str r3, [sp] movs r0, 0xE8 movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A27B0 ldrh r0, [r4, 0x1C] adds r0, 0x1 strh r0, [r4, 0x1C] b @080A4FBC .align 2, 0 .pool @080A4F2C: ldr r2, =0x02037fd4 ldrb r1, [r2, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080A4FBC cmp r3, 0x1 bne @080A4F50 adds r0, r6, 0x1 strh r0, [r4, 0x1C] ldr r1, =0x02038433 movs r0, 0x2 strb r0, [r1] b @080A4F94 .align 2, 0 .pool @080A4F50: cmp r3, 0x2 bne @080A4F94 ldrh r0, [r4, 0x8] lsls r2, r0, 16 asrs r1, r2, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 bne @080A4F68 bl dp01t_11_3_message_for_player_only b @080A4F6E @080A4F68: lsrs r0, r2, 16 bl sub_80A4FC8 @080A4F6E: movs r0, 0x1 str r0, [sp] movs r0, 0xE8 movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A27B0 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldrh r1, [r0, 0x1C] adds r1, 0x1 strh r1, [r0, 0x1C] b @080A4FBC .align 2, 0 .pool @080A4F94: ldrb r1, [r2, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @080A4FBC lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r7 movs r1, 0x1C ldrsh r0, [r0, r1] cmp r0, 0x3 bne @080A4FBC adds r0, r5, 0 bl remove_task ldr r0, =0x02038433 strb r4, [r0] @080A4FBC: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_p5_load_battle_screen_elements thumb_func_start sub_80A4FC8 sub_80A4FC8: ; 80A4FC8 push {r4-r7,lr} lsls r0, 16 lsrs r7, r0, 16 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A5050 ldr r6, =gUnknown_08525D54 lsls r4, r7, 1 adds r4, r7 lsls r4, 2 adds r0, r6, 0 adds r0, 0x8 adds r0, r4, r0 ldr r0, [r0] ldr r5, =0x0201c000 adds r1, r5, 0 bl 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, =0x0600d000 ldr r0, =0x040000d4 str r5, [r0] str r1, [r0, 0x4] ldr r1, =0x84000200 str r1, [r0, 0x8] ldr r0, [r0, 0x8] adds r0, r4, r6 ldr r0, [r0] ldr r1, =0x06002000 bl 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 .pool @080A5050: ldr r5, =gUnknown_08525D54 lsls r4, r7, 1 adds r4, r7 lsls r4, 2 adds r0, r5, 0 adds r0, 0x8 adds r0, r4, r0 ldr r0, [r0] ldr r1, =0x0600d000 bl call_LZZUnCompVram adds r0, r4, r5 ldr r0, [r0] ldr r1, =0x06008000 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 .pool thumb_func_end sub_80A4FC8 thumb_func_start dp01t_11_3_message_for_player_only dp01t_11_3_message_for_player_only: ; 80A5090 push {lr} bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A50A2 bl sub_80D7724 b @080A50A6 @080A50A2: bl 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, =0x020383f0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r0, =task_p5_load_battle_screen_elements movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =0x0000ffff strh r0, [r1, 0x8] ldr r1, =0x02038433 movs r0, 0x1 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma15_load_battle_screen_elements thumb_func_start ma16_wait_for_battle_screen_elements_s2 ma16_wait_for_battle_screen_elements_s2: ; 80A50F0 push {lr} ldr r0, =0x02038433 ldrb r0, [r0] cmp r0, 0x2 bne @080A5114 ldr r1, =0x020383f0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r1, =0x020383fc movs r0, 0 b @080A5118 .align 2, 0 .pool @080A5114: ldr r1, =0x020383fc movs r0, 0x1 @080A5118: strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma16_wait_for_battle_screen_elements_s2 thumb_func_start sub_80A5124 sub_80A5124: ; 80A5124 push {lr} ldr r0, =0x02038433 ldrb r2, [r0] cmp r2, 0 bne @080A5148 ldr r0, =0x020383f0 ldr r1, [r0] adds r1, 0x1 str r1, [r0] ldr r0, =0x020383fc strb r2, [r0] b @080A514E .align 2, 0 .pool @080A5148: ldr r1, =0x020383fc movs r0, 0x1 strb r0, [r1] @080A514E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A5124 thumb_func_start ma18_load_background_probably ma18_load_background_probably: ; 80A5158 push {r4,lr} ldr r4, =0x020383f0 ldr r1, [r4] adds r0, r1, 0x1 str r0, [r4] ldrb r0, [r1, 0x1] bl sub_80A4FC8 ldr r0, [r4] adds r0, 0x1 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma18_load_background_probably thumb_func_start sub_80A5178 sub_80A5178: ; 80A5178 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A51C0 ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02038436 ldrb r2, [r0] ldr r1, [r1, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080A51C0 adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 movs r4, 0xC0 cmp r0, 0 beq @080A5252 movs r4, 0x3F b @080A5252 .align 2, 0 .pool @080A51C0: bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A51E8 ldr r0, =0x02038436 ldr r1, =0x02038437 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bne @080A524C cmp r0, 0x2 bne @080A524C cmp r4, 0x3F beq @080A525E b @080A524C .align 2, 0 .pool @080A51E8: ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080A5226 ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080A5252 lsls r0, r4, 24 asrs r1, r0, 24 cmp r1, 0x3F bne @080A5218 movs r4, 0xC0 b @080A5252 .align 2, 0 .pool @080A5218: movs r0, 0x40 negs r0, r0 cmp r1, r0 beq @080A5252 negs r0, r1 lsls r0, 24 b @080A5250 @080A5226: ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080A524C lsls r0, r4, 24 asrs r0, 24 movs r1, 0x40 negs r1, r1 cmp r0, r1 bne @080A5252 movs r4, 0x3F b @080A5252 .align 2, 0 .pool @080A524C: lsls r0, r4, 24 negs r0, r0 @080A5250: lsrs r4, r0, 24 @080A5252: lsls r0, r4, 24 asrs r0, 24 cmp r0, 0x3F ble @080A525E movs r4, 0x3F b @080A526C @080A525E: lsls r0, r4, 24 asrs r0, 24 movs r1, 0x40 negs r1, r1 cmp r0, r1 bge @080A526C movs r4, 0xC0 @080A526C: lsls r0, r4, 24 asrs r0, 24 pop {r4} pop {r1} bx r1 thumb_func_end sub_80A5178 thumb_func_start sub_80A5278 sub_80A5278: ; 80A5278 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A52C0 ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02038436 ldrb r2, [r0] ldr r1, [r1, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080A52C0 adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 movs r4, 0xC0 cmp r0, 0 beq @080A52DE movs r4, 0x3F b @080A52DE .align 2, 0 .pool @080A52C0: ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080A52D8 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A52DE @080A52D8: lsls r0, r4, 24 negs r0, r0 lsrs r4, r0, 24 @080A52DE: lsls r0, r4, 24 asrs r0, 24 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A5278 thumb_func_start sub_80A52EC sub_80A52EC: ; 80A52EC push {lr} lsls r0, 16 lsrs r1, r0, 16 asrs r2, r0, 16 cmp r2, 0x3F ble @080A52FC movs r1, 0x3F b @080A5306 @080A52FC: movs r0, 0x40 negs r0, r0 cmp r2, r0 bge @080A5306 ldr r1, =0x0000ffc0 @080A5306: lsls r0, r1, 16 asrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A52EC thumb_func_start sub_80A5314 sub_80A5314: ; 80A5314 push {lr} lsls r2, 16 lsrs r2, 16 adds r3, r2, 0 lsls r0, 16 asrs r0, 16 lsls r1, 16 asrs r1, 16 cmp r0, r1 bge @080A5332 lsls r0, r2, 16 asrs r0, 16 cmp r0, 0 bge @080A5342 b @080A5340 @080A5332: cmp r0, r1 ble @080A5348 lsls r0, r3, 16 asrs r0, 16 cmp r0, 0 bge @080A5340 negs r0, r0 @080A5340: negs r0, r0 @080A5342: lsls r0, 16 lsrs r0, 16 b @080A534A @080A5348: movs r0, 0 @080A534A: lsls r0, 16 asrs r0, 16 pop {r1} bx r1 thumb_func_end sub_80A5314 thumb_func_start ma19_08073BC8 ma19_08073BC8: ; 80A5354 push {r4,r5,lr} ldr r5, =0x020383f0 ldr r0, [r5] adds r1, r0, 0x1 str r1, [r5] ldrb r4, [r0, 0x1] ldrb r0, [r1, 0x1] lsls r0, 8 orrs r4, r0 movs r0, 0x2 ldrsb r0, [r1, r0] bl sub_80A5178 adds r1, r0, 0 lsls r1, 24 asrs r1, 24 adds r0, r4, 0 bl audio_play_and_stuff ldr r0, [r5] adds r0, 0x3 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma19_08073BC8 thumb_func_start ma1A_8073C00 ma1A_8073C00: ; 80A538C push {r4,lr} ldr r4, =0x020383f0 ldr r1, [r4] adds r0, r1, 0x1 str r0, [r4] movs r0, 0x1 ldrsb r0, [r1, r0] bl sub_80A5178 lsls r0, 24 asrs r0, 24 bl sub_80A3870 ldr r0, [r4] adds r0, 0x1 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma1A_8073C00 thumb_func_start ma1B_8073C2C ma1B_8073C2C: ; 80A53B8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x020383f0 mov r10, r0 ldr r0, [r0] adds r1, r0, 0x1 mov r2, r10 str r1, [r2] ldrb r0, [r0, 0x1] mov r9, r0 ldrb r0, [r1, 0x1] lsls r0, 8 mov r2, r9 orrs r2, r0 mov r9, r2 ldrb r4, [r1, 0x3] ldrb r6, [r1, 0x4] ldrb r7, [r1, 0x5] movs r0, 0x2 ldrsb r0, [r1, r0] bl sub_80A5178 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 lsls r4, 24 asrs r4, 24 adds r0, r4, 0 bl sub_80A5178 mov r8, r0 lsls r5, 24 asrs r5, 24 mov r0, r8 lsls r0, 24 asrs r0, 24 mov r8, r0 lsls r6, 24 asrs r6, 24 adds r0, r5, 0 mov r1, r8 adds r2, r6, 0 bl sub_80A5314 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =c3_08073CEC movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r5, [r1, 0x8] mov r2, r8 strh r2, [r1, 0xA] lsls r4, 24 asrs r4, 24 strh r4, [r1, 0xC] strh r7, [r1, 0xE] strh r5, [r1, 0x10] mov r0, r9 adds r1, r5, 0 bl audio_play_and_stuff ldr r1, =0x020383ff ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r1, r10 ldr r0, [r1] adds r0, 0x6 str r0, [r1] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma1B_8073C2C thumb_func_start c3_08073CEC c3_08073CEC: ; 80A5478 push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 movs r7, 0 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r2, r0, r1 ldrh r0, [r2, 0x18] adds r1, r0, 0x1 strh r1, [r2, 0x18] lsls r0, 16 asrs r0, 16 movs r3, 0xE ldrsh r1, [r2, r3] cmp r0, r1 blt @080A54FC strh r7, [r2, 0x18] ldrh r6, [r2, 0x8] ldrh r3, [r2, 0xA] movs r4, 0x10 ldrsh r0, [r2, r4] movs r4, 0xC ldrsh r1, [r2, r4] adds r0, r1 lsls r0, 16 lsrs r4, r0, 16 strh r4, [r2, 0x10] cmp r1, 0 bne @080A54C0 lsls r2, r3, 16 b @080A54E4 .align 2, 0 .pool @080A54C0: lsls r1, r6, 16 lsls r0, r3, 16 asrs r3, r0, 16 adds r2, r0, 0 cmp r1, r2 bge @080A54D6 lsls r0, r4, 16 asrs r0, 16 cmp r0, r3 blt @080A54E0 b @080A54E4 @080A54D6: lsls r0, r4, 16 asrs r0, 16 cmp r0, r3 bgt @080A54E0 movs r7, 0x1 @080A54E0: cmp r7, 0 beq @080A54F4 @080A54E4: lsrs r4, r2, 16 adds r0, r5, 0 bl remove_task ldr r1, =0x020383ff ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] @080A54F4: lsls r0, r4, 24 asrs r0, 24 bl sub_80A3870 @080A54FC: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c3_08073CEC thumb_func_start sub_80A5508 sub_80A5508: ; 80A5508 push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} ldr r0, =0x020383f0 mov r9, r0 ldr r0, [r0] adds r1, r0, 0x1 mov r2, r9 str r1, [r2] ldrb r0, [r0, 0x1] mov r8, r0 ldrb r0, [r1, 0x1] lsls r0, 8 mov r2, r8 orrs r2, r0 mov r8, r2 ldrb r4, [r1, 0x2] ldrb r5, [r1, 0x3] ldrb r6, [r1, 0x4] ldrb r1, [r1, 0x5] mov r10, r1 ldr r0, =c3_08073CEC movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 lsls r4, 24 asrs r4, 24 strh r4, [r1, 0x8] lsls r5, 24 asrs r5, 24 strh r5, [r1, 0xA] lsls r6, 24 asrs r6, 24 strh r6, [r1, 0xC] mov r0, r10 strh r0, [r1, 0xE] strh r4, [r1, 0x10] mov r0, r8 adds r1, r4, 0 bl audio_play_and_stuff ldr r1, =0x020383ff ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r1, r9 ldr r0, [r1] adds r0, 0x6 str r0, [r1] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A5508 thumb_func_start sub_80A559C sub_80A559C: ; 80A559C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x020383f0 mov r10, r0 ldr r0, [r0] adds r1, r0, 0x1 mov r2, r10 str r1, [r2] ldrb r0, [r0, 0x1] mov r9, r0 ldrb r0, [r1, 0x1] lsls r0, 8 mov r2, r9 orrs r2, r0 mov r9, r2 ldrb r4, [r1, 0x3] ldrb r0, [r1, 0x4] mov r8, r0 ldrb r7, [r1, 0x5] movs r0, 0x2 ldrsb r0, [r1, r0] bl sub_80A5278 adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 lsls r4, 24 asrs r4, 24 adds r0, r4, 0 bl sub_80A5278 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 mov r1, r8 lsls r1, 24 asrs r1, 24 mov r8, r1 mov r0, r8 bl sub_80A5278 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =c3_08073CEC movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 lsls r6, 24 asrs r6, 24 strh r6, [r1, 0x8] lsls r5, 24 asrs r5, 24 strh r5, [r1, 0xA] lsls r4, 24 asrs r4, 24 strh r4, [r1, 0xC] strh r7, [r1, 0xE] strh r6, [r1, 0x10] mov r0, r9 adds r1, r6, 0 bl audio_play_and_stuff ldr r1, =0x020383ff ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] mov r2, r10 ldr r0, [r2] adds r0, 0x6 str r0, [r2] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A559C thumb_func_start ma1C_8073ED0 ma1C_8073ED0: ; 80A565C push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} ldr r6, =0x020383f0 ldr r0, [r6] adds r1, r0, 0x1 str r1, [r6] ldrb r5, [r0, 0x1] ldrb r0, [r1, 0x1] lsls r0, 8 orrs r5, r0 ldrb r0, [r1, 0x3] mov r8, r0 ldrb r2, [r1, 0x4] mov r9, r2 movs r0, 0x2 ldrsb r0, [r1, r0] bl sub_80A5178 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =sub_80A56E4 movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r5, [r1, 0x8] lsls r4, 24 asrs r4, 24 strh r4, [r1, 0xA] mov r2, r8 strh r2, [r1, 0xC] mov r2, r9 strh r2, [r1, 0xE] mov r2, r8 strh r2, [r1, 0x18] ldr r1, [r1] bl _call_via_r1 ldr r1, =0x020383ff ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r6] adds r0, 0x5 str r0, [r6] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma1C_8073ED0 thumb_func_start sub_80A56E4 sub_80A56E4: ; 80A56E4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r2, r0, r1 ldrh r0, [r2, 0x18] adds r1, r0, 0x1 strh r1, [r2, 0x18] lsls r0, 16 asrs r0, 16 movs r3, 0xC ldrsh r1, [r2, r3] cmp r0, r1 blt @080A5732 movs r0, 0 strh r0, [r2, 0x18] ldrh r0, [r2, 0x8] ldrb r1, [r2, 0xA] ldrh r4, [r2, 0xE] subs r4, 0x1 strh r4, [r2, 0xE] lsls r4, 24 lsrs r4, 24 lsls r1, 24 asrs r1, 24 bl audio_play_and_stuff cmp r4, 0 bne @080A5732 adds r0, r5, 0 bl remove_task ldr r1, =0x020383ff ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] @080A5732: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A56E4 thumb_func_start ma1D_08073FB4 ma1D_08073FB4: ; 80A5740 push {r4-r6,lr} mov r6, r8 push {r6} ldr r6, =0x020383f0 ldr r0, [r6] adds r1, r0, 0x1 str r1, [r6] ldrb r5, [r0, 0x1] ldrb r0, [r1, 0x1] lsls r0, 8 orrs r5, r0 ldrb r0, [r1, 0x3] mov r8, r0 movs r0, 0x2 ldrsb r0, [r1, r0] bl sub_80A5178 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =sub_80A57B4 movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r5, [r1, 0x8] lsls r4, 24 asrs r4, 24 strh r4, [r1, 0xA] mov r0, r8 strh r0, [r1, 0xC] ldr r1, =0x020383ff ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, [r6] adds r0, 0x4 str r0, [r6] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma1D_08073FB4 thumb_func_start sub_80A57B4 sub_80A57B4: ; 80A57B4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r2, r0, r1 ldrh r0, [r2, 0xC] subs r1, r0, 0x1 strh r1, [r2, 0xC] lsls r0, 16 cmp r0, 0 bgt @080A57E8 ldrh r0, [r2, 0x8] movs r1, 0xA ldrsb r1, [r2, r1] bl audio_play_and_stuff adds r0, r4, 0 bl remove_task ldr r1, =0x020383ff ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] @080A57E8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A57B4 thumb_func_start sub_80A57F8 sub_80A57F8: ; 80A57F8 push {r4-r6,lr} ldr r4, =0x020383f0 ldr r1, [r4] adds r3, r1, 0x1 str r3, [r4] ldrb r2, [r1, 0x1] ldrb r0, [r3, 0x1] lsls r0, 8 adds r2, r0 ldrb r0, [r3, 0x2] lsls r0, 16 adds r2, r0 ldrb r0, [r3, 0x3] lsls r0, 24 adds r6, r2, r0 adds r0, r1, 0x5 str r0, [r4] ldrb r0, [r1, 0x5] adds r1, 0x6 str r1, [r4] cmp r0, 0 beq @080A5842 adds r5, r4, 0 ldr r4, =0x0203841e adds r3, r0, 0 @080A582A: ldr r2, [r5] ldrb r1, [r2] ldrb r0, [r2, 0x1] lsls r0, 8 orrs r1, r0 strh r1, [r4] adds r2, 0x2 str r2, [r5] adds r4, 0x2 subs r3, 0x1 cmp r3, 0 bne @080A582A @080A5842: adds r0, r6, 0 movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 bl _call_via_r6 ldr r1, =0x020383ff ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A57F8 thumb_func_start ma20_wait_for_something ma20_wait_for_something: ; 80A586C push {r4,r5,lr} ldr r0, =0x020383ff ldrb r5, [r0] cmp r5, 0 bne @080A58B4 bl mplay_has_finished_maybe lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @080A58CC ldr r4, =0x0203842e ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] lsls r0, 16 lsrs r0, 16 cmp r0, 0x5A bls @080A58BA ldr r0, =0x030075f0 bl MPlayStop_rev01 ldr r0, =0x03007630 bl MPlayStop_rev01 strh r5, [r4] b @080A58DE .align 2, 0 .pool @080A58B4: ldr r1, =0x0203842e movs r0, 0 strh r0, [r1] @080A58BA: ldr r1, =0x020383fc movs r0, 0x1 strb r0, [r1] b @080A58DE .align 2, 0 .pool @080A58CC: ldr r0, =0x0203842e movs r2, 0 strh r1, [r0] ldr r1, =0x020383f0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldr r0, =0x020383fc strb r2, [r0] @080A58DE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma20_wait_for_something thumb_func_start ma21_08074164 ma21_08074164: ; 80A58F0 push {r4-r6,lr} ldr r5, =0x020383f0 ldr r4, [r5] adds r3, r4, 0x1 str r3, [r5] ldrb r2, [r4, 0x1] ldrb r1, [r3, 0x1] ldrb r0, [r3, 0x2] lsls r0, 8 orrs r1, r0 ldr r0, =0x0203841e lsls r2, 1 adds r2, r0 lsls r1, 16 asrs r1, 16 movs r6, 0 ldrsh r0, [r2, r6] cmp r1, r0 bne @080A5938 ldrb r1, [r3, 0x3] ldrb r0, [r3, 0x4] lsls r0, 8 adds r1, r0 ldrb r0, [r3, 0x5] lsls r0, 16 adds r1, r0 ldrb r0, [r3, 0x6] lsls r0, 24 adds r1, r0 str r1, [r5] b @080A593E .align 2, 0 .pool @080A5938: adds r0, r4, 0 adds r0, 0x8 str r0, [r5] @080A593E: pop {r4-r6} pop {r0} bx r0 thumb_func_end ma21_08074164 thumb_func_start sub_80A5944 sub_80A5944: ; 80A5944 push {r4,lr} ldr r4, =0x020383f0 ldr r0, [r4] adds r0, 0x1 str r0, [r4] bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A5978 ldr r2, [r4] ldrb r1, [r2] ldrb r0, [r2, 0x1] lsls r0, 8 adds r1, r0 ldrb r0, [r2, 0x2] lsls r0, 16 adds r1, r0 ldrb r0, [r2, 0x3] lsls r0, 24 adds r1, r0 str r1, [r4] b @080A597E .align 2, 0 .pool @080A5978: ldr r0, [r4] adds r0, 0x4 str r0, [r4] @080A597E: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A5944 thumb_func_start sub_80A5984 sub_80A5984: ; 80A5984 push {r4,lr} ldr r0, =0x020383f0 ldr r1, [r0] ldrb r2, [r1, 0x1] adds r1, 0x2 str r1, [r0] cmp r2, 0 beq @080A59A0 ldr r0, =0x02038437 b @080A59A2 .align 2, 0 .pool @080A59A0: ldr r0, =0x02038436 @080A59A2: ldrb r0, [r0] bl battle_get_per_side_status lsls r0, 24 lsrs r4, r0, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A59D2 cmp r4, 0 beq @080A59BE cmp r4, 0x3 bne @080A59D2 @080A59BE: movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 bl lcd_bg_operations movs r0, 0x2 movs r1, 0x4 movs r2, 0x2 bl lcd_bg_operations @080A59D2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A5984 thumb_func_start sub_80A59DC sub_80A59DC: ; 80A59DC push {lr} ldr r0, =0x020383f0 ldr r1, [r0] adds r1, 0x1 str r1, [r0] bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A5A04 movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 bl lcd_bg_operations movs r0, 0x2 movs r1, 0x4 movs r2, 0x2 bl lcd_bg_operations @080A5A04: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A59DC thumb_func_start sub_80A5A0C sub_80A5A0C: ; 80A5A0C push {r4-r7,lr} ldr r1, =0x020383f0 ldr r0, [r1] ldrb r6, [r0, 0x1] adds r0, 0x2 str r0, [r1] ldr r7, =0x02038436 ldrb r0, [r7] bl battle_side_get_owner adds r4, r0, 0 ldr r5, =0x02038437 ldrb r0, [r5] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 beq @080A5A78 cmp r6, 0 beq @080A5A48 ldrb r0, [r5] b @080A5A4A .align 2, 0 .pool @080A5A48: ldrb r0, [r7] @080A5A4A: bl battle_get_per_side_status lsls r0, 24 lsrs r4, r0, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A5A78 cmp r4, 0 beq @080A5A64 cmp r4, 0x3 bne @080A5A78 @080A5A64: movs r0, 0x1 movs r1, 0x4 movs r2, 0x1 bl lcd_bg_operations movs r0, 0x2 movs r1, 0x4 movs r2, 0x2 bl lcd_bg_operations @080A5A78: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80A5A0C thumb_func_start ma2B_make_side_invisible ma2B_make_side_invisible: ; 80A5A80 push {r4,lr} ldr r4, =0x020383f0 ldr r0, [r4] ldrb r0, [r0, 0x1] bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @080A5AA8 ldr r1, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @080A5AA8: ldr r0, [r4] adds r0, 0x2 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma2B_make_side_invisible thumb_func_start ma2C_make_side_visible ma2C_make_side_visible: ; 80A5ABC push {r4,lr} ldr r4, =0x020383f0 ldr r0, [r4] ldrb r0, [r0, 0x1] bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @080A5AE6 ldr r1, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] @080A5AE6: ldr r0, [r4] adds r0, 0x2 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma2C_make_side_visible thumb_func_start sub_80A5AFC sub_80A5AFC: ; 80A5AFC push {r4-r7,lr} ldr r1, =0x020383f0 ldr r0, [r1] ldrb r7, [r0, 0x1] adds r0, 0x2 str r0, [r1] bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A5BA6 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @080A5BA6 ldr r6, =0x02038436 ldrb r0, [r6] bl battle_side_get_owner adds r4, r0, 0 ldr r5, =0x02038437 ldrb r0, [r5] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @080A5BA6 cmp r7, 0 bne @080A5B54 ldrb r0, [r6] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r4, r0, 24 movs r0, 0 b @080A5B60 .align 2, 0 .pool @080A5B54: ldrb r0, [r5] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r4, r0, 24 movs r0, 0x1 @080A5B60: bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @080A5BA6 ldr r1, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r2, r0, r1 adds r3, r2, 0 adds r3, 0x3E ldrb r1, [r3] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r3] cmp r4, 0x2 bne @080A5B90 ldrb r0, [r2, 0x5] movs r1, 0xC orrs r0, r1 strb r0, [r2, 0x5] @080A5B90: cmp r4, 0x1 bne @080A5BA0 movs r0, 0 bl sub_80A477C b @080A5BA6 .align 2, 0 .pool @080A5BA0: movs r0, 0x1 bl sub_80A477C @080A5BA6: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80A5AFC thumb_func_start sub_80A5BAC sub_80A5BAC: ; 80A5BAC push {r4-r7,lr} ldr r1, =0x020383f0 ldr r0, [r1] ldrb r7, [r0, 0x1] adds r0, 0x2 str r0, [r1] bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A5C38 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @080A5C38 ldr r6, =0x02038436 ldrb r0, [r6] bl battle_side_get_owner adds r4, r0, 0 ldr r5, =0x02038437 ldrb r0, [r5] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @080A5C38 cmp r7, 0 bne @080A5C04 ldrb r0, [r6] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r4, r0, 24 movs r0, 0 b @080A5C10 .align 2, 0 .pool @080A5C04: ldrb r0, [r5] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r4, r0, 24 movs r0, 0x1 @080A5C10: bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @080A5C38 cmp r4, 0x2 bne @080A5C38 ldr r1, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x5] movs r1, 0xD negs r1, r1 ands r1, r2 movs r2, 0x8 orrs r1, r2 strb r1, [r0, 0x5] @080A5C38: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A5BAC thumb_func_start ma2F_stop_music ma2F_stop_music: ; 80A5C44 push {lr} ldr r0, =0x030075f0 bl MPlayStop_rev01 ldr r0, =0x03007630 bl MPlayStop_rev01 ldr r1, =0x020383f0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ma2F_stop_music thumb_func_start sub_80A5C6C sub_80A5C6C: ; 80A5C6C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r1, 24 lsrs r4, r1, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A5C8A cmp r4, 0x3 bne @080A5C8A cmp r5, 0x3 bne @080A5C8A movs r4, 0x1 @080A5C8A: cmp r4, 0x4 bhi @080A5D00 lsls r0, r4, 2 ldr r1, =@080A5C9C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080A5C9C: .4byte @080A5CB0 .4byte @080A5CD8 .4byte @080A5CB0 .4byte @080A5D00 .4byte @080A5D00 @080A5CB0: ldr r4, =gUnknown_08525F58 adds r0, r5, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 22 ldr r1, =0x02022fec ldr r1, [r1] movs r2, 0x1 ands r1, r2 lsls r1, 4 adds r0, r1 adds r0, r4 ldrb r0, [r0] b @080A5DB0 .align 2, 0 .pool @080A5CD8: ldr r4, =gUnknown_08525F58 adds r0, r5, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 22 ldr r1, =0x02022fec ldr r1, [r1] movs r2, 0x1 ands r1, r2 lsls r1, 4 adds r0, r1 adds r0, r4 ldrb r0, [r0, 0x1] b @080A5DB0 .align 2, 0 .pool @080A5D00: bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A5D28 ldr r0, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0x18] ldrb r1, [r2, 0x4] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080A5D24 ldrh r1, [r2, 0x2] b @080A5D9A .align 2, 0 .pool @080A5D24: ldrh r1, [r2] b @080A5D9A @080A5D28: adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A5D60 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r5, 2 adds r1, r0, r1 ldrh r0, [r1, 0x2] cmp r0, 0 bne @080A5D98 ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @080A5D7E .align 2, 0 .pool @080A5D60: ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r5, 2 adds r1, r0, r1 ldrh r0, [r1, 0x2] cmp r0, 0 bne @080A5D98 ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @080A5D7E: adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r1, r0, 16 b @080A5D9A .align 2, 0 .pool @080A5D98: ldrh r1, [r1, 0x2] @080A5D9A: cmp r4, 0x3 bne @080A5DA4 adds r0, r5, 0 movs r2, 0x1 b @080A5DA8 @080A5DA4: adds r0, r5, 0 movs r2, 0 @080A5DA8: bl sub_80A600C lsls r0, 24 lsrs r0, 24 @080A5DB0: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80A5C6C thumb_func_start sub_80A5DB8 sub_80A5DB8: ; 80A5DB8 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 16 lsrs r5, r1, 16 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A5DDA bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A5DDA b @080A5EC8 @080A5DDA: cmp r5, 0xC9 bne @080A5E90 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A5E04 ldr r0, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0x18] ldrb r1, [r2, 0x4] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080A5E00 ldr r2, [r2, 0x10] b @080A5E42 .align 2, 0 .pool @080A5E00: ldr r2, [r2, 0x8] b @080A5E42 @080A5E04: ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] lsls r1, r4, 2 adds r0, r1, r0 ldrh r0, [r0, 0x2] cmp r0, 0 bne @080A5E3C ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0 bl pokemon_getattr adds r2, r0, 0 b @080A5E42 .align 2, 0 .pool @080A5E3C: ldr r0, =0x020244bc adds r0, r1, r0 ldr r2, [r0] @080A5E42: movs r0, 0xC0 lsls r0, 18 ands r0, r2 lsrs r0, 18 movs r1, 0xC0 lsls r1, 10 ands r1, r2 lsrs r1, 12 orrs r0, r1 movs r1, 0xC0 lsls r1, 2 ands r1, r2 lsrs r1, 6 orrs r0, r1 movs r1, 0x3 ands r1, r2 orrs r0, r1 movs r1, 0x1C bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @080A5E7C adds r0, r5, 0 b @080A5E86 .align 2, 0 .pool @080A5E7C: movs r1, 0xCE lsls r1, 1 adds r0, r1 lsls r0, 16 lsrs r0, 16 @080A5E86: ldr r1, =gUnknown_083021D8 lsls r0, 2 b @080A5F90 .align 2, 0 .pool @080A5E90: ldr r0, =0x00000181 cmp r5, r0 bne @080A5EB0 ldr r0, =gUnknown_08525F8C ldr r1, =0x020244e4 adds r1, r4, r1 ldrb r1, [r1] adds r1, r0 ldrb r0, [r1] b @080A5F94 .align 2, 0 .pool @080A5EB0: movs r0, 0xCE lsls r0, 1 cmp r5, r0 bls @080A5EC0 ldr r0, =gUnknown_083021D8 b @080A5F92 .align 2, 0 .pool @080A5EC0: ldr r1, =gUnknown_083021D8 b @080A5F8E .align 2, 0 .pool @080A5EC8: cmp r5, 0xC9 bne @080A5F58 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] lsls r1, r4, 2 adds r0, r1, r0 ldrh r0, [r0, 0x2] cmp r0, 0 bne @080A5F04 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0 bl pokemon_getattr adds r2, r0, 0 b @080A5F0A .align 2, 0 .pool @080A5F04: ldr r0, =0x020244bc adds r0, r1, r0 ldr r2, [r0] @080A5F0A: movs r0, 0xC0 lsls r0, 18 ands r0, r2 lsrs r0, 18 movs r1, 0xC0 lsls r1, 10 ands r1, r2 lsrs r1, 12 orrs r0, r1 movs r1, 0xC0 lsls r1, 2 ands r1, r2 lsrs r1, 6 orrs r0, r1 movs r1, 0x3 ands r1, r2 orrs r0, r1 movs r1, 0x1C bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @080A5F44 adds r0, r5, 0 b @080A5F4E .align 2, 0 .pool @080A5F44: movs r1, 0xCE lsls r1, 1 adds r0, r1 lsls r0, 16 lsrs r0, 16 @080A5F4E: ldr r1, =gUnknown_08300D38 lsls r0, 2 b @080A5F90 .align 2, 0 .pool @080A5F58: ldr r0, =0x00000181 cmp r5, r0 bne @080A5F7C ldr r0, =gUnknown_08525F78 ldr r1, =0x020244e4 adds r1, r4, r1 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldrb r0, [r1, 0x1] b @080A5F94 .align 2, 0 .pool @080A5F7C: movs r0, 0xCE lsls r0, 1 cmp r5, r0 bls @080A5F8C ldr r0, =gUnknown_08300D38 b @080A5F92 .align 2, 0 .pool @080A5F8C: ldr r1, =gUnknown_08300D38 @080A5F8E: lsls r0, r5, 2 @080A5F90: adds r0, r1 @080A5F92: ldrb r0, [r0, 0x1] @080A5F94: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A5DB8 thumb_func_start sub_80A5FA0 sub_80A5FA0: ; 80A5FA0 push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 16 lsrs r4, r1, 16 adds r7, r4, 0 movs r5, 0 adds r0, r6, 0 bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080A5FFE bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A5FFE ldr r0, =0x00000181 cmp r4, r0 bne @080A5FE8 ldr r0, =gUnknown_08525F88 ldr r1, =0x020244e4 adds r1, r6, r1 ldrb r1, [r1] adds r1, r0 ldrb r5, [r1] b @080A5FFE .align 2, 0 .pool @080A5FE8: movs r0, 0xCE lsls r0, 1 cmp r4, r0 bls @080A5FF8 ldr r0, =gUnknown_08305DCC b @080A5FFC .align 2, 0 .pool @080A5FF8: ldr r0, =gUnknown_08305DCC adds r0, r7, r0 @080A5FFC: ldrb r5, [r0] @080A5FFE: adds r0, r5, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A5FA0 thumb_func_start sub_80A600C sub_80A600C: ; 80A600C push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 16 lsrs r5, r1, 16 lsls r2, 24 lsrs r7, r2, 24 adds r0, r6, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A6030 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A603E @080A6030: adds r0, r6, 0 adds r1, r5, 0 bl sub_80A5DB8 lsls r0, 24 lsrs r4, r0, 24 b @080A605C @080A603E: adds r0, r6, 0 adds r1, r5, 0 bl sub_80A5DB8 lsls r0, 24 lsrs r4, r0, 24 adds r0, r6, 0 adds r1, r5, 0 bl sub_80A5FA0 lsls r0, 24 lsrs r0, 24 subs r0, r4, r0 lsls r0, 16 lsrs r4, r0, 16 @080A605C: adds r0, r6, 0 bl battle_get_per_side_status ldr r3, =gUnknown_08525F58 lsls r0, 24 lsrs r0, 22 ldr r1, =0x02022fec ldr r1, [r1] movs r2, 0x1 ands r1, r2 lsls r1, 4 adds r0, r1 adds r0, r3 ldrb r0, [r0, 0x1] adds r0, r4 lsls r0, 24 lsrs r4, r0, 24 cmp r7, 0 beq @080A609C adds r0, r6, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080A6096 adds r0, r4, 0 adds r0, 0x8 lsls r0, 24 lsrs r4, r0, 24 @080A6096: cmp r4, 0x68 bls @080A609C movs r4, 0x68 @080A609C: adds r0, r4, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A600C thumb_func_start sub_80A60AC sub_80A60AC: ; 80A60AC push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 lsrs r5, r1, 24 movs r0, 0xFD lsls r0, 24 adds r1, r0 lsrs r1, 24 cmp r1, 0x1 bhi @080A6126 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A60E8 ldr r0, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0x18] ldrb r1, [r2, 0x4] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080A60E4 ldrh r1, [r2, 0x2] b @080A610E .align 2, 0 .pool @080A60E4: ldrh r1, [r2] b @080A610E @080A60E8: ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r4, 2 adds r1, r0, r1 ldrh r0, [r1, 0x2] cmp r0, 0 bne @080A610C ldr r1, =0x02038438 lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] b @080A610E .align 2, 0 .pool @080A610C: ldrh r1, [r1, 0x2] @080A610E: cmp r5, 0x3 bne @080A611C adds r0, r4, 0 movs r2, 0x1 bl sub_80A600C b @080A612E @080A611C: adds r0, r4, 0 movs r2, 0 bl sub_80A600C b @080A612E @080A6126: adds r0, r4, 0 adds r1, r5, 0 bl sub_80A5C6C @080A612E: lsls r0, 24 lsrs r0, 24 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80A60AC thumb_func_start sub_80A6138 sub_80A6138: ; 80A6138 push {lr} lsls r0, 24 lsrs r0, 24 movs r1, 0x4 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_80A6138 thumb_func_start sub_80A614C sub_80A614C: ; 80A614C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A6170 adds r0, r4, 0 movs r1, 0x1 bl sub_80A5C6C lsls r0, 24 lsrs r0, 8 movs r1, 0x80 lsls r1, 13 b @080A6180 @080A6170: adds r0, r4, 0 movs r1, 0x1 bl sub_80A5C6C lsls r0, 24 lsrs r0, 8 movs r1, 0x88 lsls r1, 13 @080A6180: adds r0, r1 lsrs r0, 16 lsls r0, 24 lsrs r0, 24 pop {r4} pop {r1} bx r1 thumb_func_end sub_80A614C thumb_func_start sub_80A6190 sub_80A6190: ; 80A6190 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 adds r0, r5, 0 movs r1, 0x1 bl sub_80A5C6C lsls r0, 24 lsrs r6, r0, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A6238 adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A61E4 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r5, 2 adds r1, r0, r1 ldrh r0, [r1, 0x2] cmp r0, 0 bne @080A621C ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @080A6202 .align 2, 0 .pool @080A61E4: ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r5, 2 adds r1, r0, r1 ldrh r0, [r1, 0x2] cmp r0, 0 bne @080A621C ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @080A6202: adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 b @080A621E .align 2, 0 .pool @080A621C: ldrh r4, [r1, 0x2] @080A621E: adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A6238 adds r0, r5, 0 adds r1, r4, 0 bl sub_80A5FA0 subs r0, r6, r0 lsls r0, 24 lsrs r6, r0, 24 @080A6238: adds r0, r6, 0 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_80A6190 thumb_func_start obj_id_for_side_relative_to_move obj_id_for_side_relative_to_move: ; 80A6240 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 cmp r0, 0 bne @080A6268 ldr r4, =0x02038436 ldrb r0, [r4] bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @080A62B6 ldr r1, =0x020241e4 ldrb r0, [r4] b @080A62C6 .align 2, 0 .pool @080A6268: cmp r0, 0x1 bne @080A6288 ldr r4, =0x02038437 ldrb r0, [r4] bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @080A62B6 ldr r1, =0x020241e4 ldrb r0, [r4] b @080A62C6 .align 2, 0 .pool @080A6288: cmp r1, 0x2 bne @080A62A4 ldr r5, =0x02038436 ldrb r0, [r5] movs r4, 0x2 eors r0, r4 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A62B6 b @080A62C0 .align 2, 0 .pool @080A62A4: ldr r5, =0x02038437 ldrb r0, [r5] movs r4, 0x2 eors r0, r4 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 bne @080A62C0 @080A62B6: movs r0, 0xFF b @080A62CA .align 2, 0 .pool @080A62C0: ldr r1, =0x020241e4 ldrb r0, [r5] eors r0, r4 @080A62C6: adds r0, r1 ldrb r0, [r0] @080A62CA: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end obj_id_for_side_relative_to_move thumb_func_start oamt_set_x3A_32 oamt_set_x3A_32: ; 80A62D4 strh r1, [r0, 0x3A] lsrs r1, 16 strh r1, [r0, 0x3C] bx lr thumb_func_end oamt_set_x3A_32 thumb_func_start sub_80A62DC sub_80A62DC: ; 80A62DC ldrh r2, [r0, 0x3A] movs r3, 0x3C ldrsh r1, [r0, r3] lsls r1, 16 orrs r2, r1 str r2, [r0, 0x1C] bx lr thumb_func_end sub_80A62DC thumb_func_start sub_80A62EC sub_80A62EC: ; 80A62EC push {r4,lr} adds r4, r0, 0 movs r1, 0x34 ldrsh r0, [r4, r1] cmp r0, 0 beq @080A6340 movs r2, 0x2E ldrsh r0, [r4, r2] movs r2, 0x30 ldrsh r1, [r4, r2] bl sine strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] movs r2, 0x30 ldrsh r1, [r4, r2] bl cosine strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x2E] adds r1, r0, r2 strh r1, [r4, 0x2E] lsls r0, r1, 16 asrs r0, 16 cmp r0, 0xFF ble @080A632C ldr r2, =0xffffff00 b @080A6334 .align 2, 0 .pool @080A632C: cmp r0, 0 bge @080A6338 movs r2, 0x80 lsls r2, 1 @080A6334: adds r0, r1, r2 strh r0, [r4, 0x2E] @080A6338: ldrh r0, [r4, 0x34] subs r0, 0x1 strh r0, [r4, 0x34] b @080A6346 @080A6340: adds r0, r4, 0 bl sub_80A62DC @080A6346: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A62EC thumb_func_start sub_80A634C sub_80A634C: ; 80A634C push {r4,lr} adds r4, r0, 0 movs r1, 0x34 ldrsh r0, [r4, r1] cmp r0, 0 beq @080A63BC movs r2, 0x2E ldrsh r0, [r4, r2] ldrh r1, [r4, 0x38] lsls r1, 16 asrs r1, 24 ldrh r2, [r4, 0x30] adds r1, r2 lsls r1, 16 asrs r1, 16 bl sine strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] ldrh r1, [r4, 0x38] lsls r1, 16 asrs r1, 24 ldrh r2, [r4, 0x30] adds r1, r2 lsls r1, 16 asrs r1, 16 bl cosine strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x2E] adds r1, r0, r2 strh r1, [r4, 0x2E] ldrh r0, [r4, 0x36] ldrh r2, [r4, 0x38] adds r0, r2 strh r0, [r4, 0x38] lsls r0, r1, 16 asrs r0, 16 cmp r0, 0xFF ble @080A63A8 ldr r2, =0xffffff00 b @080A63B0 .align 2, 0 .pool @080A63A8: cmp r0, 0 bge @080A63B4 movs r2, 0x80 lsls r2, 1 @080A63B0: adds r0, r1, r2 strh r0, [r4, 0x2E] @080A63B4: ldrh r0, [r4, 0x34] subs r0, 0x1 strh r0, [r4, 0x34] b @080A63C2 @080A63BC: adds r0, r4, 0 bl sub_80A62DC @080A63C2: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A634C thumb_func_start sub_80A63C8 sub_80A63C8: ; 80A63C8 push {r4,lr} adds r4, r0, 0 movs r1, 0x34 ldrsh r0, [r4, r1] cmp r0, 0 beq @080A6444 movs r2, 0x2E ldrsh r0, [r4, r2] movs r2, 0x30 ldrsh r1, [r4, r2] bl sine strh r0, [r4, 0x24] movs r1, 0x36 ldrsh r0, [r4, r1] movs r2, 0x30 ldrsh r1, [r4, r2] bl cosine strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x2E] adds r1, r0, r2 strh r1, [r4, 0x2E] ldrh r0, [r4, 0x38] ldrh r2, [r4, 0x36] adds r0, r2 strh r0, [r4, 0x36] lsls r0, r1, 16 asrs r0, 16 cmp r0, 0xFF ble @080A6410 ldr r2, =0xffffff00 b @080A6418 .align 2, 0 .pool @080A6410: cmp r0, 0 bge @080A641C movs r2, 0x80 lsls r2, 1 @080A6418: adds r0, r1, r2 strh r0, [r4, 0x2E] @080A641C: ldrh r1, [r4, 0x36] movs r2, 0x36 ldrsh r0, [r4, r2] cmp r0, 0xFF ble @080A6430 ldr r2, =0xffffff00 b @080A6438 .align 2, 0 .pool @080A6430: cmp r0, 0 bge @080A643C movs r2, 0x80 lsls r2, 1 @080A6438: adds r0, r1, r2 strh r0, [r4, 0x36] @080A643C: ldrh r0, [r4, 0x34] subs r0, 0x1 strh r0, [r4, 0x34] b @080A644A @080A6444: adds r0, r4, 0 bl sub_80A62DC @080A644A: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A63C8 thumb_func_start sub_80A6450 sub_80A6450: ; 80A6450 push {r4,lr} adds r4, r0, 0 movs r1, 0x34 ldrsh r0, [r4, r1] cmp r0, 0 beq @080A64A4 movs r2, 0x2E ldrsh r0, [r4, r2] movs r2, 0x30 ldrsh r1, [r4, r2] bl sine strh r0, [r4, 0x24] movs r1, 0x2E ldrsh r0, [r4, r1] movs r2, 0x36 ldrsh r1, [r4, r2] bl cosine strh r0, [r4, 0x26] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x2E] adds r1, r0, r2 strh r1, [r4, 0x2E] lsls r0, r1, 16 asrs r0, 16 cmp r0, 0xFF ble @080A6490 ldr r2, =0xffffff00 b @080A6498 .align 2, 0 .pool @080A6490: cmp r0, 0 bge @080A649C movs r2, 0x80 lsls r2, 1 @080A6498: adds r0, r1, r2 strh r0, [r4, 0x2E] @080A649C: ldrh r0, [r4, 0x34] subs r0, 0x1 strh r0, [r4, 0x34] b @080A64AA @080A64A4: adds r0, r4, 0 bl sub_80A62DC @080A64AA: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A6450 thumb_func_start sub_80A64B0 sub_80A64B0: ; 80A64B0 push {lr} adds r1, r0, 0 ldrh r2, [r1, 0x2E] movs r3, 0x2E ldrsh r0, [r1, r3] cmp r0, 0 ble @080A64C4 subs r0, r2, 0x1 strh r0, [r1, 0x2E] b @080A64CA @080A64C4: adds r0, r1, 0 bl sub_80A62DC @080A64CA: pop {r0} bx r0 thumb_func_end sub_80A64B0 thumb_func_start sub_80A64D0 sub_80A64D0: ; 80A64D0 push {r4,lr} adds r4, r0, 0 bl sub_80A64EC ldr r1, =sub_80A653C str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A64D0 thumb_func_start sub_80A64EC sub_80A64EC: ; 80A64EC push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x30 ldrsh r1, [r4, r0] movs r2, 0x32 ldrsh r0, [r4, r2] cmp r1, r0 ble @080A6502 ldrh r0, [r4, 0x2E] negs r0, r0 strh r0, [r4, 0x2E] @080A6502: movs r1, 0x32 ldrsh r0, [r4, r1] movs r2, 0x30 ldrsh r1, [r4, r2] subs r0, r1 ldrh r5, [r4, 0x2E] movs r2, 0x2E ldrsh r1, [r4, r2] bl __divsi3 cmp r0, 0 bge @080A651C negs r0, r0 @080A651C: strh r0, [r4, 0x2E] movs r1, 0x36 ldrsh r0, [r4, r1] movs r2, 0x34 ldrsh r1, [r4, r2] subs r0, r1 movs r2, 0x2E ldrsh r1, [r4, r2] bl __divsi3 strh r0, [r4, 0x32] strh r5, [r4, 0x30] pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_80A64EC thumb_func_start sub_80A653C sub_80A653C: ; 80A653C push {lr} adds r1, r0, 0 ldrh r2, [r1, 0x2E] movs r3, 0x2E ldrsh r0, [r1, r3] cmp r0, 0 ble @080A6560 subs r0, r2, 0x1 strh r0, [r1, 0x2E] ldrh r0, [r1, 0x30] ldrh r2, [r1, 0x24] adds r0, r2 strh r0, [r1, 0x24] ldrh r0, [r1, 0x32] ldrh r3, [r1, 0x26] adds r0, r3 strh r0, [r1, 0x26] b @080A6566 @080A6560: adds r0, r1, 0 bl sub_80A62DC @080A6566: pop {r0} bx r0 thumb_func_end sub_80A653C thumb_func_start sub_80A656C sub_80A656C: ; 80A656C push {lr} adds r2, r0, 0 ldrh r1, [r2, 0x2E] movs r3, 0x2E ldrsh r0, [r2, r3] cmp r0, 0 ble @080A659C subs r0, r1, 0x1 strh r0, [r2, 0x2E] ldrh r0, [r2, 0x30] ldrh r1, [r2, 0x34] adds r0, r1 strh r0, [r2, 0x34] ldrh r1, [r2, 0x32] ldrh r3, [r2, 0x36] adds r1, r3 strh r1, [r2, 0x36] lsls r0, 16 asrs r0, 24 strh r0, [r2, 0x24] lsls r1, 16 asrs r1, 24 strh r1, [r2, 0x26] b @080A65A2 @080A659C: adds r0, r2, 0 bl sub_80A62DC @080A65A2: pop {r0} bx r0 thumb_func_end sub_80A656C thumb_func_start sub_80A65A8 sub_80A65A8: ; 80A65A8 push {r4,lr} adds r4, r0, 0 ldrh r1, [r4, 0x2E] movs r2, 0x2E ldrsh r0, [r4, r2] cmp r0, 0 ble @080A65D8 subs r0, r1, 0x1 strh r0, [r4, 0x2E] ldrh r0, [r4, 0x30] ldrh r1, [r4, 0x34] adds r0, r1 strh r0, [r4, 0x34] ldrh r1, [r4, 0x32] ldrh r2, [r4, 0x36] adds r1, r2 strh r1, [r4, 0x36] lsls r0, 16 asrs r0, 24 strh r0, [r4, 0x24] lsls r1, 16 asrs r1, 24 strh r1, [r4, 0x26] b @080A65DE @080A65D8: adds r0, r4, 0 bl sub_80A62DC @080A65DE: adds r0, r4, 0 bl sub_80D30DC pop {r4} pop {r0} bx r0 thumb_func_end sub_80A65A8 thumb_func_start sub_80A65EC sub_80A65EC: ; 80A65EC push {r4,r5,lr} adds r4, r0, 0 ldrh r0, [r4, 0x24] ldrh r1, [r4, 0x20] adds r0, r1 strh r0, [r4, 0x30] ldrh r0, [r4, 0x26] ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x34] ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] ldr r0, =sub_80A64D0 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A65EC thumb_func_start sub_80A6630 sub_80A6630: ; 80A6630 push {r4,lr} adds r3, r0, 0 ldrh r1, [r3, 0x2E] movs r2, 0x2E ldrsh r0, [r3, r2] cmp r0, 0 ble @080A6674 subs r0, r1, 0x1 strh r0, [r3, 0x2E] ldr r2, =0x02020630 movs r4, 0x34 ldrsh r1, [r3, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r3, 0x30] ldrh r4, [r0, 0x24] adds r1, r4 strh r1, [r0, 0x24] movs r0, 0x34 ldrsh r1, [r3, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r3, 0x32] ldrh r2, [r0, 0x26] adds r1, r2 strh r1, [r0, 0x26] b @080A667A .align 2, 0 .pool @080A6674: adds r0, r3, 0 bl sub_80A62DC @080A667A: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A6630 thumb_func_start sub_80A6680 sub_80A6680: ; 80A6680 push {r4,lr} adds r4, r0, 0 ldrh r1, [r4, 0x2E] movs r2, 0x2E ldrsh r0, [r4, r2] cmp r0, 0 ble @080A66D0 subs r0, r1, 0x1 strh r0, [r4, 0x2E] ldrh r1, [r4, 0x30] ldrh r0, [r4, 0x34] adds r1, r0 strh r1, [r4, 0x34] ldrh r0, [r4, 0x32] ldrh r2, [r4, 0x36] adds r0, r2 strh r0, [r4, 0x36] ldr r3, =0x02020630 movs r0, 0x38 ldrsh r2, [r4, r0] lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r3 lsls r1, 16 asrs r1, 24 strh r1, [r0, 0x24] movs r1, 0x38 ldrsh r0, [r4, r1] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r3 ldrh r0, [r4, 0x36] lsls r0, 16 asrs r0, 24 strh r0, [r1, 0x26] b @080A66D6 .align 2, 0 .pool @080A66D0: adds r0, r4, 0 bl sub_80A62DC @080A66D6: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A6680 thumb_func_start sub_80A66DC sub_80A66DC: ; 80A66DC push {r4,lr} adds r4, r0, 0 ldrh r1, [r4, 0x2E] movs r2, 0x2E ldrsh r0, [r4, r2] cmp r0, 0 ble @080A673E subs r0, r1, 0x1 strh r0, [r4, 0x2E] ldrh r1, [r4, 0x32] lsls r0, r1, 16 asrs r0, 24 strh r0, [r4, 0x24] ldrh r0, [r4, 0x30] adds r1, r0 strh r1, [r4, 0x32] ldrh r1, [r4, 0x36] lsls r0, r1, 16 asrs r0, 24 strh r0, [r4, 0x26] ldrh r0, [r4, 0x34] adds r1, r0 strh r1, [r4, 0x36] movs r1, 0x2E ldrsh r0, [r4, r1] movs r2, 0x38 ldrsh r1, [r4, r2] bl __modsi3 cmp r0, 0 bne @080A6744 movs r1, 0x38 ldrsh r0, [r4, r1] cmp r0, 0 beq @080A6744 adds r3, r4, 0 adds r3, 0x3E ldrb r2, [r3] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r0, 0x5 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] b @080A6744 @080A673E: adds r0, r4, 0 bl sub_80A62DC @080A6744: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A66DC thumb_func_start move_anim_8074EE0 move_anim_8074EE0: ; 80A674C push {r4,lr} adds r4, r0, 0 bl obj_free_rotscale_entry adds r0, r4, 0 bl move_anim_8072740 pop {r4} pop {r0} bx r0 thumb_func_end move_anim_8074EE0 thumb_func_start sub_80A6760 sub_80A6760: ; 80A6760 push {r4,r5,lr} adds r4, r0, 0 ldrh r0, [r4, 0x24] ldrh r1, [r4, 0x20] adds r0, r1 strh r0, [r4, 0x30] ldrh r0, [r4, 0x26] ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x34] ldr r5, =0x02038436 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] ldr r0, =sub_80A64D0 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A6760 thumb_func_start sub_80A67A4 sub_80A67A4: ; 80A67A4 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x38] bl sub_80A1F58 adds r0, r4, 0 bl move_anim_8074EE0 pop {r4} pop {r0} bx r0 thumb_func_end sub_80A67A4 thumb_func_start sub_80A67BC sub_80A67BC: ; 80A67BC push {lr} adds r2, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @080A67D2 adds r0, r2, 0 bl sub_80A62DC @080A67D2: pop {r0} bx r0 thumb_func_end sub_80A67BC thumb_func_start sub_80A67D8 sub_80A67D8: ; 80A67D8 push {lr} adds r2, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080A67EE adds r0, r2, 0 bl sub_80A62DC @080A67EE: pop {r0} bx r0 thumb_func_end sub_80A67D8 thumb_func_start sub_80A67F4 sub_80A67F4: ; 80A67F4 push {r4,lr} adds r4, r0, 0 movs r0, 0x50 movs r1, 0 bl 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, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A6838 thumb_func_start sub_80A6864 sub_80A6864: ; 80A6864 push {r4-r7,lr} mov r7, r8 push {r7} adds r4, r0, 0 lsls r1, 16 lsrs r5, r1, 16 mov r8, r5 ldr r7, =0x02038436 ldrb r0, [r7] movs r1, 0 bl sub_80A5C6C lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x02038437 ldrb r0, [r0] movs r1, 0 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 cmp r6, r0 bhi @080A68B0 cmp r6, r0 bcs @080A68A4 lsls r0, r5, 16 b @080A68C0 .align 2, 0 .pool @080A68A4: ldrb r0, [r7] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A68BC @080A68B0: ldrh r1, [r4, 0x20] lsls r0, r5, 16 asrs r0, 16 subs r1, r0 strh r1, [r4, 0x20] b @080A68C8 @080A68BC: mov r1, r8 lsls r0, r1, 16 @080A68C0: asrs r0, 16 ldrh r1, [r4, 0x20] adds r0, r1 strh r0, [r4, 0x20] @080A68C8: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80A6864 thumb_func_start sub_80A68D4 sub_80A68D4: ; 80A68D4 push {r4,r5,lr} adds r4, r0, 0 ldrh r0, [r4, 0x20] movs r5, 0 strh r0, [r4, 0x30] ldrh r0, [r4, 0x22] strh r0, [r4, 0x34] adds r0, r4, 0 bl obj_translate_based_on_private_1_2_3_4 movs r0, 0x2E ldrsh r1, [r4, r0] movs r0, 0x80 lsls r0, 8 bl __divsi3 strh r0, [r4, 0x3A] strh r5, [r4, 0x3C] pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_80A68D4 thumb_func_start sub_80A6900 sub_80A6900: ; 80A6900 push {r4,lr} adds r4, r0, 0 bl sub_80A6F3C lsls r0, 24 cmp r0, 0 bne @080A692C ldrh r0, [r4, 0x3A] ldrh r1, [r4, 0x3C] adds r0, r1 strh r0, [r4, 0x3C] lsls r0, 16 lsrs r0, 24 movs r2, 0x38 ldrsh r1, [r4, r2] bl sine ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] movs r0, 0 b @080A692E @080A692C: movs r0, 0x1 @080A692E: pop {r4} pop {r1} bx r1 thumb_func_end sub_80A6900 thumb_func_start sub_80A6934 sub_80A6934: ; 80A6934 push {r4,lr} adds r4, r0, 0 bl sub_80A6F3C lsls r0, 24 cmp r0, 0 bne @080A6960 ldrh r0, [r4, 0x3A] ldrh r1, [r4, 0x3C] adds r0, r1 strh r0, [r4, 0x3C] lsls r0, 16 lsrs r0, 24 movs r2, 0x38 ldrsh r1, [r4, r2] bl sine ldrh r1, [r4, 0x24] adds r0, r1 strh r0, [r4, 0x24] movs r0, 0 b @080A6962 @080A6960: movs r0, 0x1 @080A6962: pop {r4} pop {r1} bx r1 thumb_func_end sub_80A6934 thumb_func_start oamt_add_pos2_onto_pos1 oamt_add_pos2_onto_pos1: ; 80A6968 ldrh r1, [r0, 0x24] ldrh r2, [r0, 0x20] adds r1, r2 movs r2, 0 strh r1, [r0, 0x20] ldrh r1, [r0, 0x26] ldrh r3, [r0, 0x22] adds r1, r3 strh r1, [r0, 0x22] strh r2, [r0, 0x24] strh r2, [r0, 0x26] bx lr thumb_func_end oamt_add_pos2_onto_pos1 thumb_func_start sub_80A6980 sub_80A6980: ; 80A6980 push {r4,r5,lr} adds r5, r0, 0 lsls r1, 24 cmp r1, 0 bne @080A69A8 ldr r4, =0x02038437 ldrb r0, [r4] movs r1, 0 bl sub_80A60AC lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 bl sub_80A60AC lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @080A69A8: ldr r4, =0x0203841e movs r0, 0 ldrsh r1, [r4, r0] adds r0, r5, 0 bl sub_80A6864 ldrh r0, [r4, 0x2] ldrh r1, [r5, 0x22] adds r0, r1 strh r0, [r5, 0x22] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A6980 thumb_func_start sub_80A69CC sub_80A69CC: ; 80A69CC push {r4,r5,lr} adds r5, r0, 0 lsls r1, 24 cmp r1, 0 bne @080A69F0 ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0 bl sub_80A60AC lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 b @080A6A04 .align 2, 0 .pool @080A69F0: ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A60AC lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 @080A6A04: bl sub_80A60AC lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldr r4, =0x0203841e movs r0, 0 ldrsh r1, [r4, r0] adds r0, r5, 0 bl sub_80A6864 ldrh r0, [r4, 0x2] ldrh r1, [r5, 0x22] adds r0, r1 strh r0, [r5, 0x22] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A69CC thumb_func_start battle_side_get_owner battle_side_get_owner: ; 80A6A30 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02024076 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 bx lr .align 2, 0 .pool thumb_func_end battle_side_get_owner thumb_func_start battle_get_per_side_status battle_get_per_side_status: ; 80A6A44 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02024076 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end battle_get_per_side_status thumb_func_start battle_get_side_with_given_state battle_get_side_with_given_state: ; 80A6A54 push {r4,lr} lsls r0, 24 lsrs r3, r0, 24 movs r1, 0 ldr r0, =0x0202406c ldrb r2, [r0] cmp r1, r2 bcs @080A6A7E ldr r4, =0x02024076 ldrb r0, [r4] cmp r0, r3 beq @080A6A7E @080A6A6C: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, r2 bcs @080A6A7E adds r0, r1, r4 ldrb r0, [r0] cmp r0, r3 bne @080A6A6C @080A6A7E: adds r0, r1, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end battle_get_side_with_given_state thumb_func_start sub_80A6A90 sub_80A6A90: ; 80A6A90 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A6ABC ldr r0, =0x02038436 ldrb r0, [r0] cmp r0, r4 beq @080A6B0A ldr r0, =0x02038437 ldrb r0, [r0] cmp r0, r4 beq @080A6B0A b @080A6B18 .align 2, 0 .pool @080A6ABC: ldr r0, =0x02024076 adds r0, r4, r0 ldrb r0, [r0] cmp r0, 0xFF beq @080A6B18 adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A6AF0 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @080A6AFE .align 2, 0 .pool @080A6AF0: ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @080A6AFE: adds r0, r1 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @080A6B18 @080A6B0A: movs r0, 0x1 b @080A6B1A .align 2, 0 .pool @080A6B18: movs r0, 0 @080A6B1A: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_80A6A90 thumb_func_start battle_type_is_double battle_type_is_double: ; 80A6B20 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 bx lr .align 2, 0 .pool thumb_func_end battle_type_is_double thumb_func_start sub_80A6B30 sub_80A6B30: ; 80A6B30 push {r4,lr} adds r4, r0, 0 bl sub_80A4DF0 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @080A6B64 ldr r0, =0x0202305c ldr r0, [r0] str r0, [r4] ldr r0, =0x02023060 ldr r0, [r0] str r0, [r4, 0x4] movs r1, 0 movs r0, 0xE strb r0, [r4, 0x8] movs r0, 0x1 strb r0, [r4, 0x9] strh r1, [r4, 0xA] b @080A6B7E .align 2, 0 .pool @080A6B64: ldr r0, =0x0202305c ldr r0, [r0] str r0, [r4] ldr r0, =0x02023060 ldr r0, [r0] str r0, [r4, 0x4] movs r0, 0x8 strb r0, [r4, 0x8] movs r0, 0x1 strb r0, [r4, 0x9] movs r0, 0x80 lsls r0, 2 strh r0, [r4, 0xA] @080A6B7E: strh r1, [r4, 0xC] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A6B30 thumb_func_start sub_80A6B90 sub_80A6B90: ; 80A6B90 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 bl sub_80A4DF0 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @080A6BC4 ldr r0, =0x0202305c ldr r0, [r0] str r0, [r4] ldr r0, =0x02023060 ldr r0, [r0] str r0, [r4, 0x4] movs r1, 0 movs r0, 0xE strb r0, [r4, 0x8] movs r0, 0x1 strb r0, [r4, 0x9] strh r1, [r4, 0xA] b @080A6BEA .align 2, 0 .pool @080A6BC4: cmp r5, 0x1 bne @080A6BD0 adds r0, r4, 0 bl sub_80A6B30 b @080A6BEC @080A6BD0: ldr r0, =0x0202305c ldr r0, [r0] str r0, [r4] ldr r0, =0x02023060 ldr r0, [r0] str r0, [r4, 0x4] movs r0, 0x9 strb r0, [r4, 0x8] movs r0, 0x2 strb r0, [r4, 0x9] movs r0, 0xC0 lsls r0, 2 strh r0, [r4, 0xA] @080A6BEA: strh r1, [r4, 0xC] @080A6BEC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A6B90 thumb_func_start sub_80A6BFC sub_80A6BFC: ; 80A6BFC push {r4,r5,lr} adds r4, r0, 0 ldr r0, =0x0202305c ldr r0, [r0] str r0, [r4] ldr r0, =0x02023060 ldr r0, [r0] str r0, [r4, 0x4] bl sub_80A4DF0 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 beq @080A6C30 movs r0, 0 movs r1, 0xE strb r1, [r4, 0x8] movs r1, 0x1 strb r1, [r4, 0x9] strh r0, [r4, 0xA] strh r0, [r4, 0xC] b @080A6C60 .align 2, 0 .pool @080A6C30: ldr r0, =0x02038436 ldrb r0, [r0] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x1 bne @080A6C50 movs r0, 0x8 strb r0, [r4, 0x8] strb r1, [r4, 0x9] movs r0, 0x80 lsls r0, 2 b @080A6C5C .align 2, 0 .pool @080A6C50: movs r0, 0x9 strb r0, [r4, 0x8] movs r0, 0x2 strb r0, [r4, 0x9] movs r0, 0xC0 lsls r0, 2 @080A6C5C: strh r0, [r4, 0xA] strh r5, [r4, 0xC] @080A6C60: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_80A6BFC thumb_func_start sub_80A6C68 sub_80A6C68: ; 80A6C68 push {lr} sub sp, 0x20 adds r1, r0, 0 add r0, sp, 0xC bl sub_80A6B90 movs r0, 0 str r0, [sp, 0x1C] add r0, sp, 0x1C ldr r1, [sp, 0xC] ldr r2, =0x05000800 bl CpuSet add r0, sp, 0xC ldrb r0, [r0, 0x9] ldr r1, [sp, 0xC] movs r2, 0x80 lsls r2, 6 add r3, sp, 0xC ldrh r3, [r3, 0xA] bl 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 .pool thumb_func_end sub_80A6C68 thumb_func_start sub_80A6CC0 sub_80A6CC0: ; 80A6CC0 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x4 adds r5, r0, 0 mov r8, r1 adds r6, r2, 0 movs r0, 0 str r0, [sp] ldr r4, =0x0202305c ldr r1, [r4] ldr r2, =0x05000800 mov r0, sp bl CpuSet ldr r1, [r4] mov r0, r8 bl 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 .pool thumb_func_end sub_80A6CC0 thumb_func_start sub_80A6D10 sub_80A6D10: ; 80A6D10 push {r4,r5,lr} sub sp, 0xC adds r4, r0, 0 adds r5, r1, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x20 str r0, [sp] movs r0, 0x40 str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] adds r0, r4, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =sub_80A65A8 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A6DEC thumb_func_start sub_80A6E14 sub_80A6E14: ; 80A6E14 push {r4-r6,lr} adds r5, r0, 0 ldrh r0, [r5, 0x32] ldrh r1, [r5, 0x30] subs r0, r1 ldrh r4, [r5, 0x36] ldrh r1, [r5, 0x34] subs r4, r1 lsls r4, 24 lsrs r4, 16 lsls r0, 24 asrs r0, 16 movs r2, 0x2E ldrsh r1, [r5, r2] bl __divsi3 movs r6, 0 strh r0, [r5, 0x30] lsls r4, 16 asrs r4, 16 movs r0, 0x2E ldrsh r1, [r5, r0] adds r0, r4, 0 bl __divsi3 strh r0, [r5, 0x32] strh r6, [r5, 0x36] strh r6, [r5, 0x34] pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_80A6E14 thumb_func_start obj_translate_based_on_private_1_2_3_4 obj_translate_based_on_private_1_2_3_4: ; 80A6E54 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r7, r0, 0 movs r0, 0x32 ldrsh r1, [r7, r0] movs r2, 0x30 ldrsh r0, [r7, r2] subs r1, r0 movs r3, 0x36 ldrsh r2, [r7, r3] movs r3, 0x34 ldrsh r0, [r7, r3] subs r2, r0 lsrs r0, r1, 31 mov r8, r0 lsrs r3, r2, 31 mov r9, r3 cmp r1, 0 bge @080A6E80 negs r1, r1 @080A6E80: lsls r0, r1, 24 lsrs r6, r0, 16 adds r0, r2, 0 cmp r0, 0 bge @080A6E8C negs r0, r0 @080A6E8C: lsls r0, 24 lsrs r5, r0, 16 movs r0, 0x2E ldrsh r4, [r7, r0] adds r0, r6, 0 adds r1, r4, 0 bl __divsi3 lsls r0, 16 lsrs r6, r0, 16 adds r0, r5, 0 adds r1, r4, 0 bl __divsi3 lsls r0, 16 lsrs r5, r0, 16 mov r2, r8 cmp r2, 0 beq @080A6EB8 movs r0, 0x1 orrs r6, r0 b @080A6EBC @080A6EB8: ldr r0, =0x0000fffe ands r6, r0 @080A6EBC: mov r3, r9 cmp r3, 0 beq @080A6ECC movs r0, 0x1 orrs r5, r0 b @080A6ED0 .align 2, 0 .pool @080A6ECC: ldr r0, =0x0000fffe ands r5, r0 @080A6ED0: movs r0, 0 strh r6, [r7, 0x30] strh r5, [r7, 0x32] strh r0, [r7, 0x36] strh r0, [r7, 0x34] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end obj_translate_based_on_private_1_2_3_4 thumb_func_start sub_80A6EEC sub_80A6EEC: ; 80A6EEC push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x20] strh r0, [r4, 0x30] ldrh r0, [r4, 0x22] strh r0, [r4, 0x34] adds r0, r4, 0 bl obj_translate_based_on_private_1_2_3_4 ldr r1, =sub_80A6F98 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A6EEC thumb_func_start sub_80A6F14 sub_80A6F14: ; 80A6F14 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x20] strh r0, [r4, 0x30] ldrh r0, [r4, 0x22] strh r0, [r4, 0x34] adds r0, r4, 0 bl obj_translate_based_on_private_1_2_3_4 ldr r1, =sub_80A6FB4 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A6F14 thumb_func_start sub_80A6F3C sub_80A6F3C: ; 80A6F3C push {r4-r6,lr} adds r2, r0, 0 movs r1, 0x2E ldrsh r0, [r2, r1] cmp r0, 0 bne @080A6F4C movs r0, 0x1 b @080A6F90 @080A6F4C: ldrh r1, [r2, 0x30] ldrh r4, [r2, 0x32] ldrh r6, [r2, 0x34] ldrh r5, [r2, 0x36] adds r0, r6, r1 lsls r3, r0, 16 lsrs r6, r3, 16 adds r0, r5, r4 lsls r0, 16 lsrs r5, r0, 16 movs r0, 0x1 ands r1, r0 cmp r1, 0 beq @080A6F6E lsrs r0, r3, 24 negs r0, r0 b @080A6F70 @080A6F6E: lsrs r0, r3, 24 @080A6F70: strh r0, [r2, 0x24] movs r0, 0x1 ands r4, r0 cmp r4, 0 beq @080A6F80 lsrs r0, r5, 8 negs r0, r0 b @080A6F82 @080A6F80: lsrs r0, r5, 8 @080A6F82: strh r0, [r2, 0x26] strh r6, [r2, 0x34] strh r5, [r2, 0x36] ldrh r0, [r2, 0x2E] subs r0, 0x1 strh r0, [r2, 0x2E] movs r0, 0 @080A6F90: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_80A6F3C thumb_func_start sub_80A6F98 sub_80A6F98: ; 80A6F98 push {r4,lr} adds r4, r0, 0 bl sub_80A6F3C lsls r0, 24 cmp r0, 0 beq @080A6FAC adds r0, r4, 0 bl sub_80A62DC @080A6FAC: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A6F98 thumb_func_start sub_80A6FB4 sub_80A6FB4: ; 80A6FB4 push {r4,lr} adds r4, r0, 0 bl sub_8039E9C adds r0, r4, 0 bl sub_80A6F3C lsls r0, 24 cmp r0, 0 beq @080A6FCE adds r0, r4, 0 bl sub_80A62DC @080A6FCE: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A6FB4 thumb_func_start sub_80A6FD4 sub_80A6FD4: ; 80A6FD4 push {r4,lr} adds r4, r0, 0 movs r0, 0x32 ldrsh r1, [r4, r0] movs r2, 0x30 ldrsh r0, [r4, r2] subs r0, r1, r0 cmp r0, 0 bge @080A6FE8 negs r0, r0 @080A6FE8: lsls r0, 8 movs r2, 0x2E ldrsh r1, [r4, r2] bl __divsi3 strh r0, [r4, 0x2E] adds r0, r4, 0 bl obj_translate_based_on_private_1_2_3_4 pop {r4} pop {r0} bx r0 thumb_func_end sub_80A6FD4 thumb_func_start sub_80A7000 sub_80A7000: ; 80A7000 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x20] strh r0, [r4, 0x30] ldrh r0, [r4, 0x22] strh r0, [r4, 0x34] adds r0, r4, 0 bl sub_80A6FD4 ldr r1, =sub_80A6F98 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7000 thumb_func_start sub_80A7028 sub_80A7028: ; 80A7028 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r7, r0, 0 movs r0, 0x32 ldrsh r1, [r7, r0] movs r2, 0x30 ldrsh r0, [r7, r2] subs r1, r0 movs r3, 0x36 ldrsh r2, [r7, r3] movs r3, 0x34 ldrsh r0, [r7, r3] subs r2, r0 lsrs r0, r1, 31 mov r8, r0 lsrs r3, r2, 31 mov r9, r3 cmp r1, 0 bge @080A7054 negs r1, r1 @080A7054: lsls r0, r1, 20 lsrs r6, r0, 16 adds r0, r2, 0 cmp r0, 0 bge @080A7060 negs r0, r0 @080A7060: lsls r0, 20 lsrs r5, r0, 16 movs r0, 0x2E ldrsh r4, [r7, r0] adds r0, r6, 0 adds r1, r4, 0 bl __divsi3 lsls r0, 16 lsrs r6, r0, 16 adds r0, r5, 0 adds r1, r4, 0 bl __divsi3 lsls r0, 16 lsrs r5, r0, 16 mov r2, r8 cmp r2, 0 beq @080A708C movs r0, 0x1 orrs r6, r0 b @080A7090 @080A708C: ldr r0, =0x0000fffe ands r6, r0 @080A7090: mov r3, r9 cmp r3, 0 beq @080A70A0 movs r0, 0x1 orrs r5, r0 b @080A70A4 .align 2, 0 .pool @080A70A0: ldr r0, =0x0000fffe ands r5, r0 @080A70A4: movs r0, 0 strh r6, [r7, 0x30] strh r5, [r7, 0x32] strh r0, [r7, 0x36] strh r0, [r7, 0x34] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7028 thumb_func_start sub_80A70C0 sub_80A70C0: ; 80A70C0 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x20] strh r0, [r4, 0x30] ldrh r0, [r4, 0x22] strh r0, [r4, 0x34] adds r0, r4, 0 bl sub_80A7028 ldr r1, =sub_80A7144 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A70C0 thumb_func_start sub_80A70E8 sub_80A70E8: ; 80A70E8 push {r4-r6,lr} adds r2, r0, 0 movs r1, 0x2E ldrsh r0, [r2, r1] cmp r0, 0 bne @080A70F8 movs r0, 0x1 b @080A713C @080A70F8: ldrh r1, [r2, 0x30] ldrh r4, [r2, 0x32] ldrh r6, [r2, 0x34] ldrh r5, [r2, 0x36] adds r0, r6, r1 lsls r3, r0, 16 lsrs r6, r3, 16 adds r0, r5, r4 lsls r0, 16 lsrs r5, r0, 16 movs r0, 0x1 ands r1, r0 cmp r1, 0 beq @080A711A lsrs r0, r3, 20 negs r0, r0 b @080A711C @080A711A: lsrs r0, r3, 20 @080A711C: strh r0, [r2, 0x24] movs r0, 0x1 ands r4, r0 cmp r4, 0 beq @080A712C lsrs r0, r5, 4 negs r0, r0 b @080A712E @080A712C: lsrs r0, r5, 4 @080A712E: strh r0, [r2, 0x26] strh r6, [r2, 0x34] strh r5, [r2, 0x36] ldrh r0, [r2, 0x2E] subs r0, 0x1 strh r0, [r2, 0x2E] movs r0, 0 @080A713C: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_80A70E8 thumb_func_start sub_80A7144 sub_80A7144: ; 80A7144 push {r4,lr} adds r4, r0, 0 bl sub_80A70E8 lsls r0, 24 cmp r0, 0 beq @080A7158 adds r0, r4, 0 bl sub_80A62DC @080A7158: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A7144 thumb_func_start sub_80A7160 sub_80A7160: ; 80A7160 push {r4,lr} adds r4, r0, 0 movs r0, 0x32 ldrsh r1, [r4, r0] movs r2, 0x30 ldrsh r0, [r4, r2] subs r0, r1, r0 cmp r0, 0 bge @080A7174 negs r0, r0 @080A7174: lsls r0, 4 movs r2, 0x2E ldrsh r1, [r4, r2] bl __divsi3 strh r0, [r4, 0x2E] adds r0, r4, 0 bl sub_80A7028 pop {r4} pop {r0} bx r0 thumb_func_end sub_80A7160 thumb_func_start sub_80A718C sub_80A718C: ; 80A718C push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x20] strh r0, [r4, 0x30] ldrh r0, [r4, 0x22] strh r0, [r4, 0x34] adds r0, r4, 0 bl sub_80A7160 ldr r1, =sub_80A7144 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A718C thumb_func_start obj_id_set_rotscale obj_id_set_rotscale: ; 80A71B4 push {r4,r5,lr} sub sp, 0x10 lsls r0, 24 lsrs r4, r0, 24 lsls r1, 16 lsls r3, 16 lsrs r3, 16 ldr r5, =0xffff0000 lsls r2, 16 lsrs r1, 16 orrs r1, r2 str r1, [sp] ldr r0, [sp, 0x4] ands r0, r5 orrs r0, r3 str r0, [sp, 0x4] bl sub_80A7238 lsls r0, 24 cmp r0, 0 beq @080A71F0 mov r0, sp ldrh r0, [r0] negs r0, r0 lsls r0, 16 lsrs r0, 16 ldr r1, [sp] ands r1, r5 orrs r1, r0 str r1, [sp] @080A71F0: ldr r1, =0x02020630 lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r0, r1 ldrb r4, [r0, 0x3] lsls r4, 26 lsrs r4, 27 add r5, sp, 0x8 mov r0, sp adds r1, r5, 0 movs r2, 0x1 movs r3, 0x2 bl ObjAffineSet ldr r0, =0x02021bc0 lsls r4, 3 adds r4, r0 ldrh r0, [r5] strh r0, [r4] ldrh r0, [r5, 0x2] strh r0, [r4, 0x2] ldrh r0, [r5, 0x4] strh r0, [r4, 0x4] ldrh r0, [r5, 0x6] strh r0, [r4, 0x6] add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end obj_id_set_rotscale thumb_func_start sub_80A7238 sub_80A7238: ; 80A7238 push {r4,lr} bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A7268 ldr r4, =0x02020630 movs r0, 0 bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r0, 24 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 movs r2, 0x32 ldrsh r0, [r1, r2] cmp r0, 0xC9 beq @080A7268 movs r0, 0x1 b @080A726A .align 2, 0 .pool @080A7268: movs r0, 0 @080A726A: pop {r4} pop {r1} bx r1 thumb_func_end sub_80A7238 thumb_func_start sub_80A7270 sub_80A7270: ; 80A7270 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r1, 24 mov r8, r1 ldr r1, =0x02020630 lsls r0, r6, 4 adds r0, r6 lsls r0, 2 adds r4, r0, r1 ldrh r0, [r4, 0x2E] lsls r0, 24 lsrs r7, r0, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A72A6 adds r0, r7, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A72B4 @080A72A6: adds r2, r4, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] @080A72B4: ldr r1, =0x02020630 lsls r4, r6, 4 adds r0, r4, r6 lsls r0, 2 adds r5, r0, r1 movs r0, 0x3 mov r1, r8 ands r1, r0 lsls r1, 2 ldrb r2, [r5, 0x1] movs r0, 0xD negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x1] adds r2, r5, 0 adds r2, 0x2C ldrb r0, [r2] movs r1, 0x80 orrs r0, r1 strb r0, [r2] bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A7312 ldrb r0, [r5, 0x1] lsls r0, 30 cmp r0, 0 bne @080A7312 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r7, 1 adds r0, r7 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x6] movs r0, 0x1F ands r1, r0 lsls r1, 1 ldrb r2, [r5, 0x3] movs r0, 0x3F negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r5, 0x3] @080A7312: ldr r1, =0x02020630 adds r0, r4, r6 lsls r0, 2 adds r0, r1 ldrb r3, [r0, 0x1] movs r1, 0x3 orrs r3, r1 strb r3, [r0, 0x1] lsrs r1, r3, 6 ldrb r2, [r0, 0x3] lsrs r2, 6 lsls r3, 30 lsrs r3, 30 bl oam_center pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7270 thumb_func_start sub_80A7344 sub_80A7344: ; 80A7344 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r2, 0x80 lsls r2, 1 adds r0, r4, 0 adds r1, r2, 0 movs r3, 0 bl obj_id_set_rotscale ldr r1, =0x02020630 lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x1] movs r1, 0x4 negs r1, r1 ands r1, r2 movs r2, 0x1 orrs r1, r2 movs r2, 0xD negs r2, r2 ands r1, r2 strb r1, [r0, 0x1] adds r3, r0, 0 adds r3, 0x2C ldrb r2, [r3] movs r1, 0x7F ands r1, r2 strb r1, [r3] ldrb r3, [r0, 0x1] lsrs r1, r3, 6 ldrb r2, [r0, 0x3] lsrs r2, 6 lsls r3, 30 lsrs r3, 30 bl oam_center pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7344 thumb_func_start sub_80A73A0 sub_80A73A0: ; 80A73A0 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r2, r1, r2 ldrb r0, [r2, 0x3] lsls r0, 26 lsrs r0, 27 ldr r1, =0x02021bc0 lsls r0, 3 adds r0, r1 ldrh r1, [r0, 0x4] movs r3, 0x4 ldrsh r0, [r0, r3] cmp r0, 0 bge @080A73CC negs r0, r0 lsls r0, 16 lsrs r1, r0, 16 @080A73CC: lsls r0, r1, 16 asrs r0, 19 strh r0, [r2, 0x26] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A73A0 thumb_func_start sub_80A73E0 sub_80A73E0: ; 80A73E0 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x10 adds r4, r0, 0 ldr r0, [sp, 0x28] lsls r1, 24 lsrs r6, r1, 24 lsls r2, 16 lsrs r5, r2, 16 lsls r3, 16 lsrs r7, r3, 16 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldrb r0, [r4, 0x1] lsls r0, 30 lsrs r0, 30 movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @080A7486 adds r0, r4, 0 adds r0, 0x2C ldrb r1, [r0] movs r2, 0x80 orrs r1, r2 strb r1, [r0] cmp r6, 0 beq @080A742E ldrb r3, [r4, 0x1] lsrs r1, r3, 6 ldrb r2, [r4, 0x3] lsrs r2, 6 lsls r3, 30 lsrs r3, 30 adds r0, r4, 0 bl oam_center @080A742E: ldr r6, =0xffff0000 lsls r0, r7, 16 orrs r5, r0 str r5, [sp] ldr r0, [sp, 0x4] ands r0, r6 mov r1, r8 orrs r0, r1 str r0, [sp, 0x4] bl sub_80A7238 lsls r0, 24 cmp r0, 0 beq @080A745C mov r0, sp ldrh r0, [r0] negs r0, r0 lsls r0, 16 lsrs r0, 16 ldr r1, [sp] ands r1, r6 orrs r1, r0 str r1, [sp] @080A745C: ldrb r4, [r4, 0x3] lsls r4, 26 lsrs r4, 27 add r5, sp, 0x8 mov r0, sp adds r1, r5, 0 movs r2, 0x1 movs r3, 0x2 bl ObjAffineSet ldr r0, =0x02021bc0 lsls r4, 3 adds r4, r0 ldrh r0, [r5] strh r0, [r4] ldrh r0, [r5, 0x2] strh r0, [r4, 0x2] ldrh r0, [r5, 0x4] strh r0, [r4, 0x4] ldrh r0, [r5, 0x6] strh r0, [r4, 0x6] @080A7486: add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A73E0 thumb_func_start sub_80A749C sub_80A749C: ; 80A749C push {r4,lr} sub sp, 0x4 adds r4, r0, 0 movs r3, 0x80 lsls r3, 1 movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0x1 adds r2, r3, 0 bl sub_80A73E0 adds r2, r4, 0 adds r2, 0x2C ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] ldrb r3, [r4, 0x1] lsrs r1, r3, 6 ldrb r2, [r4, 0x3] lsrs r2, 6 lsls r3, 30 lsrs r3, 30 adds r0, r4, 0 bl 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, =0x02037714 ldr r1, =0x02037b14 lsls r0, 1 adds r4, r0, r1 adds r5, r0, r2 movs r6, 0xF @080A7524: ldr r0, [r5] lsls r2, r0, 27 lsrs r2, 27 lsls r1, r0, 22 lsrs r1, 27 adds r2, r1 lsls r0, 17 lsrs r0, 27 adds r0, r2 movs r1, 0x3 bl __udivsi3 lsls r0, 16 lsrs r0, 16 movs r1, 0x1F ands r0, r1 ldrb r1, [r4] movs r3, 0x20 negs r3, r3 adds r2, r3, 0 ands r1, r2 orrs r1, r0 strb r1, [r4] lsls r3, r0, 5 ldrh r1, [r4] ldr r7, =0xfffffc1f adds r2, r7, 0 ands r1, r2 orrs r1, r3 strh r1, [r4] lsls r0, 2 ldrb r1, [r4, 0x1] movs r3, 0x7D negs r3, r3 adds r2, r3, 0 ands r1, r2 orrs r1, r0 strb r1, [r4, 0x1] adds r4, 0x2 adds r5, 0x2 subs r6, 0x1 cmp r6, 0 bge @080A7524 b @080A7598 .align 2, 0 .pool @080A7588: lsls r1, r0, 1 ldr r0, =0x02037714 adds r0, r1, r0 ldr r2, =0x02037b14 adds r1, r2 ldr r2, =0x04000008 bl CpuSet @080A7598: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A750C thumb_func_start sub_80A75AC sub_80A75AC: ; 80A75AC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 ldr r4, [sp, 0x28] ldr r5, [sp, 0x2C] ldr r6, [sp, 0x30] lsls r0, 24 lsls r1, 24 lsrs r7, r1, 24 lsls r2, 24 lsrs r2, 24 mov r8, r2 lsls r3, 24 lsrs r3, 24 mov r9, r3 lsls r4, 24 lsrs r4, 24 mov r10, r4 lsls r5, 24 lsrs r5, 24 str r5, [sp] lsls r6, 24 lsrs r6, 24 str r6, [sp, 0x4] movs r4, 0 cmp r0, 0 beq @080A7602 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A75F6 movs r4, 0xE b @080A7602 @080A75F6: bl sub_80A6D94 lsls r0, 24 lsrs r0, 24 movs r4, 0x1 lsls r4, r0 @080A7602: cmp r7, 0 beq @080A7614 ldr r0, =0x02038436 ldrb r0, [r0] adds r1, r0, 0 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 orrs r4, r0 @080A7614: mov r0, r8 cmp r0, 0 beq @080A7628 ldr r0, =0x02038437 ldrb r0, [r0] adds r1, r0, 0 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 orrs r4, r0 @080A7628: mov r0, r9 cmp r0, 0 beq @080A764E ldr r6, =0x02038436 ldrb r0, [r6] movs r5, 0x2 eors r0, r5 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A764E ldrb r0, [r6] eors r0, r5 adds r1, r0, 0 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 orrs r4, r0 @080A764E: mov r0, r10 cmp r0, 0 beq @080A7674 ldr r6, =0x02038437 ldrb r0, [r6] movs r5, 0x2 eors r0, r5 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A7674 ldrb r0, [r6] eors r0, r5 adds r1, r0, 0 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 orrs r4, r0 @080A7674: ldr r0, [sp] cmp r0, 0 beq @080A769A bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A7694 movs r0, 0x80 lsls r0, 1 b @080A7698 .align 2, 0 .pool @080A7694: movs r0, 0x80 lsls r0, 7 @080A7698: orrs r4, r0 @080A769A: ldr r0, [sp, 0x4] cmp r0, 0 beq @080A76B0 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A76B0 movs r0, 0x80 lsls r0, 2 orrs r4, r0 @080A76B0: adds r0, r4, 0 add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80A75AC thumb_func_start sub_80A76C4 sub_80A76C4: ; 80A76C4 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r5, r0, 24 lsls r1, 24 lsrs r6, r1, 24 lsls r2, 24 lsrs r7, r2, 24 lsls r3, 24 lsrs r3, 24 mov r8, r3 movs r4, 0 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A76F2 cmp r5, 0 beq @080A77A0 movs r4, 0x80 lsls r4, 11 b @080A77A0 @080A76F2: cmp r5, 0 beq @080A771A movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A771A movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r0, 0x10 movs r4, 0x1 lsls r4, r0 @080A771A: cmp r6, 0 beq @080A7746 movs r0, 0x2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A7746 movs r0, 0x2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 orrs r4, r0 @080A7746: cmp r7, 0 beq @080A7772 movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A7772 movs r0, 0x1 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 orrs r4, r0 @080A7772: mov r0, r8 cmp r0, 0 beq @080A77A0 movs r0, 0x3 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A77A0 movs r0, 0x3 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 adds r1, 0x10 movs r0, 0x1 lsls r0, r1 orrs r4, r0 @080A77A0: adds r0, r4, 0 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80A76C4 thumb_func_start sub_80A77AC sub_80A77AC: ; 80A77AC lsls r0, 24 lsrs r0, 24 bx lr thumb_func_end sub_80A77AC thumb_func_start sub_80A77B4 sub_80A77B4: ; 80A77B4 push {lr} lsls r0, 24 lsrs r0, 24 bl battle_get_side_with_given_state lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 thumb_func_end sub_80A77B4 thumb_func_start sub_80A77C8 sub_80A77C8: ; 80A77C8 push {r4,lr} adds r4, r0, 0 movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0 bne @080A7806 ldr r2, =0x0203841e movs r3, 0x6 ldrsh r0, [r2, r3] movs r1, 0 cmp r0, 0 bne @080A77E2 movs r1, 0x1 @080A77E2: movs r3, 0x4 ldrsh r0, [r2, r3] cmp r0, 0 bne @080A77F8 adds r0, r4, 0 bl sub_80A69CC b @080A77FE .align 2, 0 .pool @080A77F8: adds r0, r4, 0 bl sub_80A6980 @080A77FE: ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] b @080A781A @080A7806: adds r0, r4, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x30 ands r0, r1 cmp r0, 0 beq @080A781A adds r0, r4, 0 bl move_anim_8074EE0 @080A781A: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A77C8 thumb_func_start sub_80A7820 sub_80A7820: ; 80A7820 push {r4-r7,lr} adds r5, r0, 0 ldr r6, =0x0203841e movs r1, 0xA ldrsh r0, [r6, r1] movs r1, 0xFF lsls r1, 8 ands r0, r1 movs r1, 0 cmp r0, 0 bne @080A7838 movs r1, 0x1 @080A7838: ldrb r0, [r6, 0xA] movs r7, 0x1 cmp r0, 0 bne @080A7842 movs r7, 0x3 @080A7842: adds r0, r5, 0 bl sub_80A69CC ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A785C ldrh r0, [r6, 0x4] negs r0, r0 strh r0, [r6, 0x4] @080A785C: ldrh r0, [r6, 0x8] strh r0, [r5, 0x2E] ldr r4, =0x02038437 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x4] adds r0, r1 strh r0, [r5, 0x32] ldrb r0, [r4] adds r1, r7, 0 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x6] adds r0, r6 strh r0, [r5, 0x36] ldr r0, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7820 thumb_func_start sub_80A78AC sub_80A78AC: ; 80A78AC push {r4-r6,lr} adds r6, r0, 0 movs r1, 0x1 bl sub_80A69CC ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A78CC ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @080A78CC: ldr r4, =0x0203841e ldrh r0, [r4, 0x8] strh r0, [r6, 0x2E] ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] adds r0, r1 strh r0, [r6, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x6] adds r0, r1 strh r0, [r6, 0x36] ldrh r0, [r4, 0xA] strh r0, [r6, 0x38] adds r0, r6, 0 bl sub_80A68D4 ldr r0, =sub_80A791C str r0, [r6, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A78AC thumb_func_start sub_80A791C sub_80A791C: ; 80A791C push {r4,lr} adds r4, r0, 0 bl sub_80A6900 lsls r0, 24 cmp r0, 0 beq @080A7930 adds r0, r4, 0 bl move_anim_8072740 @080A7930: pop {r4} pop {r0} bx r0 thumb_func_end sub_80A791C thumb_func_start sub_80A7938 sub_80A7938: ; 80A7938 push {r4-r7,lr} adds r5, r0, 0 ldr r0, =0x0203841e movs r2, 0xC ldrsh r1, [r0, r2] cmp r1, 0 bne @080A7950 movs r4, 0x1 movs r7, 0x3 b @080A7954 .align 2, 0 .pool @080A7950: movs r4, 0 movs r7, 0x1 @080A7954: movs r1, 0xA ldrsh r0, [r0, r1] cmp r0, 0 bne @080A796C adds r0, r5, 0 adds r1, r4, 0 bl sub_80A69CC ldr r0, =0x02038436 b @080A7976 .align 2, 0 .pool @080A796C: adds r0, r5, 0 adds r1, r4, 0 bl sub_80A6980 ldr r0, =0x02038437 @080A7976: ldrb r6, [r0] ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A798E ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @080A798E: adds r0, r5, 0 adds r1, r4, 0 bl sub_80A6980 ldr r4, =0x0203841e ldrh r0, [r4, 0x8] strh r0, [r5, 0x2E] adds r0, r6, 0 movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r2, [r4, 0x4] adds r0, r2 strh r0, [r5, 0x32] adds r0, r6, 0 adds r1, r7, 0 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x6] adds r0, r4 strh r0, [r5, 0x36] ldr r0, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7938 thumb_func_start duplicate_obj_of_side_rel2move_in_transparent_mode duplicate_obj_of_side_rel2move_in_transparent_mode: ; 80A79E8 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0xFF beq @080A7A52 movs r6, 0 ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r1, r0, 2 @080A7A04: lsls r0, r6, 4 adds r0, r6 lsls r0, 2 adds r4, r0, r2 adds r5, r4, 0 adds r5, 0x3E ldrb r0, [r5] lsls r0, 31 cmp r0, 0 bne @080A7A48 adds r0, r4, 0 adds r1, r2 movs r2, 0x44 bl memcpy ldrb r1, [r4, 0x1] movs r2, 0xD negs r2, r2 adds r0, r2, 0 ands r1, r0 movs r0, 0x4 orrs r1, r0 strb r1, [r4, 0x1] ldrb r0, [r5] adds r2, 0x8 adds r1, r2, 0 ands r0, r1 strb r0, [r5] lsls r0, r6, 16 asrs r0, 16 b @080A7A56 .align 2, 0 .pool @080A7A48: adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0x3F bls @080A7A04 @080A7A52: movs r0, 0x1 negs r0, r0 @080A7A56: pop {r4-r6} pop {r1} bx r1 thumb_func_end duplicate_obj_of_side_rel2move_in_transparent_mode thumb_func_start obj_delete_but_dont_free_vram obj_delete_but_dont_free_vram: ; 80A7A5C push {lr} adds r3, r0, 0 adds r3, 0x3F ldrb r1, [r3] movs r2, 0x40 orrs r1, r2 strb r1, [r3] bl 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, =0x0203841e movs r0, 0x4 ldrsh r1, [r2, r0] movs r4, 0 ldrsh r0, [r2, r4] cmp r1, r0 ble @080A7A8E movs r3, 0x1 @080A7A8E: cmp r1, r0 bge @080A7A94 ldr r3, =0x0000ffff @080A7A94: movs r0, 0x6 ldrsh r1, [r2, r0] movs r4, 0x2 ldrsh r0, [r2, r4] cmp r1, r0 ble @080A7AA2 movs r6, 0x1 @080A7AA2: cmp r1, r0 bge @080A7AA8 ldr r6, =0x0000ffff @080A7AA8: ldr r0, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r0 movs r1, 0 strh r1, [r4, 0x8] ldrh r0, [r2, 0x8] strh r0, [r4, 0xA] strh r1, [r4, 0xC] ldrh r0, [r2] strh r0, [r4, 0xE] ldrh r0, [r2, 0x2] strh r0, [r4, 0x10] strh r3, [r4, 0x12] strh r6, [r4, 0x14] ldrh r0, [r2, 0x4] strh r0, [r4, 0x16] ldrh r0, [r2, 0x6] strh r0, [r4, 0x18] ldrh r1, [r2, 0x2] lsls r1, 8 ldrh r0, [r2] orrs r1, r0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 bl lcd_io_set ldr r0, =sub_80A7AFC str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7A74 thumb_func_start sub_80A7AFC sub_80A7AFC: ; 80A7AFC push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e00 adds r4, r0, r1 ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] lsls r0, 16 asrs r0, 16 movs r2, 0xA ldrsh r1, [r4, r2] cmp r0, r1 ble @080A7B90 movs r0, 0 strh r0, [r4, 0x8] ldrh r0, [r4, 0xC] adds r0, 0x1 strh r0, [r4, 0xC] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @080A7B4C ldrh r2, [r4, 0xE] movs r3, 0xE ldrsh r1, [r4, r3] movs r3, 0x16 ldrsh r0, [r4, r3] cmp r1, r0 beq @080A7B60 ldrh r0, [r4, 0x12] adds r0, r2, r0 strh r0, [r4, 0xE] b @080A7B60 .align 2, 0 .pool @080A7B4C: ldrh r2, [r4, 0x10] movs r0, 0x10 ldrsh r1, [r4, r0] movs r3, 0x18 ldrsh r0, [r4, r3] cmp r1, r0 beq @080A7B60 ldrh r0, [r4, 0x14] adds r0, r2, r0 strh r0, [r4, 0x10] @080A7B60: ldrh r1, [r4, 0x10] lsls r1, 8 ldrh r0, [r4, 0xE] orrs r1, r0 lsls r1, 16 lsrs r1, 16 movs r0, 0x52 bl 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, =0x0203841e ldrb r0, [r0] bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0xFF bne @080A7BBC adds r0, r4, 0 bl move_anim_task_del b @080A7BE2 .align 2, 0 .pool @080A7BBC: ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r2, =0x02020630 lsls r1, r3, 4 adds r1, r3 lsls r1, 2 adds r1, r2 ldrb r1, [r1, 0x5] lsrs r1, 4 lsls r1, 4 ldr r3, =0x00000101 adds r2, r3, 0 adds r1, r2 strh r1, [r0, 0x8] bl sub_80A7BF4 @080A7BE2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7B98 thumb_func_start sub_80A7BF4 sub_80A7BF4: ; 80A7BF4 ldr r3, =0x0203841e ldrh r1, [r3, 0x2] movs r2, 0 strh r1, [r0, 0xA] strh r2, [r0, 0xC] ldrh r1, [r3, 0x4] strh r1, [r0, 0xE] strh r2, [r0, 0x10] ldrh r1, [r3, 0x6] strh r1, [r0, 0x12] strh r2, [r0, 0x14] ldrh r1, [r3, 0x8] strh r1, [r0, 0x16] ldr r1, =sub_80A7C1C str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80A7BF4 thumb_func_start sub_80A7C1C sub_80A7C1C: ; 80A7C1C push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 adds r5, r0, 0 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e00 adds r4, r0, r1 ldrh r0, [r4, 0x10] adds r0, 0x1 strh r0, [r4, 0x10] lsls r0, 16 asrs r0, 16 movs r2, 0x12 ldrsh r1, [r4, r2] cmp r0, r1 blt @080A7CAC movs r0, 0 strh r0, [r4, 0x10] movs r1, 0x14 ldrsh r0, [r4, r1] cmp r0, 0 bne @080A7C78 ldrh r2, [r4, 0xC] adds r2, 0x1 strh r2, [r4, 0xC] ldrh r0, [r4, 0x8] lsls r2, 24 lsrs r2, 24 ldrh r3, [r4, 0xA] movs r1, 0xF bl pal_fade_1 movs r2, 0xC ldrsh r1, [r4, r2] movs r2, 0xE ldrsh r0, [r4, r2] cmp r1, r0 bne @080A7CAC movs r0, 0x1 strh r0, [r4, 0x14] b @080A7CAC .align 2, 0 .pool @080A7C78: ldrh r2, [r4, 0xC] subs r2, 0x1 strh r2, [r4, 0xC] ldrh r0, [r4, 0x8] lsls r2, 24 lsrs r2, 24 ldrh r3, [r4, 0xA] movs r1, 0xF bl pal_fade_1 movs r0, 0xC ldrsh r1, [r4, r0] cmp r1, 0 bne @080A7CAC ldrh r0, [r4, 0x16] subs r0, 0x1 strh r0, [r4, 0x16] lsls r0, 16 cmp r0, 0 beq @080A7CA6 strh r1, [r4, 0x10] strh r1, [r4, 0x14] b @080A7CAC @080A7CA6: adds r0, r5, 0 bl move_anim_task_del @080A7CAC: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_80A7C1C thumb_func_start sub_80A7CB4 sub_80A7CB4: ; 80A7CB4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0203841e ldrh r0, [r0] bl 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 .pool @080A7CD8: ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 lsls r1, r2, 4 ldr r2, =0x00000101 adds r1, r2 strh r1, [r0, 0x8] bl sub_80A7BF4 @080A7CEE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7CB4 thumb_func_start sub_80A7CFC sub_80A7CFC: ; 80A7CFC push {r4,lr} adds r3, r0, 0 adds r4, r1, 0 lsls r4, 24 lsrs r4, 24 movs r1, 0 strh r1, [r3, 0x16] strh r1, [r3, 0x18] strh r1, [r3, 0x1A] strh r4, [r3, 0x26] movs r0, 0x80 lsls r0, 1 strh r0, [r3, 0x1C] strh r0, [r3, 0x1E] strh r1, [r3, 0x20] adds r0, r3, 0 adds r0, 0x22 adds r3, 0x24 adds r1, r3, 0 bl sub_80A8048 adds r0, r4, 0 movs r1, 0 bl sub_80A7270 pop {r4} pop {r0} bx r0 thumb_func_end sub_80A7CFC thumb_func_start sub_80A7D34 sub_80A7D34: ; 80A7D34 push {r4-r6,lr} adds r4, r0, 0 ldr r5, =0x02038444 movs r1, 0x22 ldrsh r0, [r4, r1] movs r2, 0x24 ldrsh r1, [r4, r2] bl sub_80A8050 movs r3, 0x16 ldrsh r1, [r4, r3] lsls r1, 3 adds r1, r0, r1 str r1, [r5] movs r6, 0 ldrsh r2, [r1, r6] ldr r0, =0x00007ffe cmp r2, r0 beq @080A7DDC cmp r2, r0 bgt @080A7E3C subs r0, 0x1 cmp r2, r0 beq @080A7DE2 ldrb r0, [r1, 0x5] cmp r0, 0 bne @080A7D82 ldrh r0, [r1] strh r0, [r4, 0x1C] ldrh r0, [r1, 0x2] strh r0, [r4, 0x1E] ldrb r0, [r1, 0x4] strh r0, [r4, 0x20] ldrh r0, [r4, 0x16] adds r0, 0x1 strh r0, [r4, 0x16] adds r0, r1, 0 adds r0, 0x8 str r0, [r5] @080A7D82: ldr r1, [r5] ldrh r0, [r1] ldrh r2, [r4, 0x1C] adds r0, r2 strh r0, [r4, 0x1C] ldrh r0, [r1, 0x2] ldrh r3, [r4, 0x1E] adds r0, r3 strh r0, [r4, 0x1E] ldrh r0, [r4, 0x20] ldrb r1, [r1, 0x4] adds r0, r1 strh r0, [r4, 0x20] ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 movs r6, 0x1C ldrsh r1, [r4, r6] movs r3, 0x1E ldrsh r2, [r4, r3] ldrh r3, [r4, 0x20] bl obj_id_set_rotscale ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 bl sub_80A7E6C ldrh r0, [r4, 0x18] adds r0, 0x1 strh r0, [r4, 0x18] lsls r0, 16 asrs r0, 16 ldr r1, [r5] ldrb r1, [r1, 0x5] cmp r0, r1 blt @080A7E62 movs r0, 0 strh r0, [r4, 0x18] b @080A7E34 .align 2, 0 .pool @080A7DDC: ldrh r0, [r1, 0x2] strh r0, [r4, 0x16] b @080A7E62 @080A7DE2: ldrh r2, [r1, 0x2] movs r6, 0x2 ldrsh r0, [r1, r6] cmp r0, 0 beq @080A7E34 ldrh r1, [r4, 0x1A] movs r3, 0x1A ldrsh r0, [r4, r3] cmp r0, 0 beq @080A7E02 subs r0, r1, 0x1 strh r0, [r4, 0x1A] lsls r0, 16 cmp r0, 0 bne @080A7E04 b @080A7E34 @080A7E02: strh r2, [r4, 0x1A] @080A7E04: movs r6, 0x16 ldrsh r0, [r4, r6] cmp r0, 0 beq @080A7E62 ldr r3, =0x02038444 ldr r5, =0x00007ffd @080A7E10: ldrh r2, [r4, 0x16] subs r1, r2, 0x1 strh r1, [r4, 0x16] ldr r0, [r3] subs r0, 0x8 str r0, [r3] movs r6, 0 ldrsh r0, [r0, r6] cmp r0, r5 beq @080A7E60 lsls r0, r1, 16 cmp r0, 0 bne @080A7E10 b @080A7E62 .align 2, 0 .pool @080A7E34: ldrh r0, [r4, 0x16] adds r0, 0x1 strh r0, [r4, 0x16] b @080A7E62 @080A7E3C: ldr r2, =0x02020630 movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strh r1, [r0, 0x26] ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 bl sub_80A7344 movs r0, 0 b @080A7E64 .align 2, 0 .pool @080A7E60: strh r2, [r4, 0x16] @080A7E62: movs r0, 0x1 @080A7E64: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_80A7D34 thumb_func_start sub_80A7E6C sub_80A7E6C: ; 80A7E6C push {r4,r5,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 bl sub_80A7F18 lsls r0, 16 lsrs r0, 15 movs r1, 0x40 subs r5, r1, r0 ldr r1, =0x02020630 lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r4, r0, r1 ldrb r1, [r4, 0x3] lsls r1, 26 lsrs r1, 27 lsls r0, r5, 8 ldr r2, =0x02021bc0 lsls r1, 3 adds r1, r2 movs r2, 0x6 ldrsh r1, [r1, r2] bl __divsi3 cmp r0, 0x80 ble @080A7EA8 movs r0, 0x80 @080A7EA8: subs r0, r5, r0 lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 strh r0, [r4, 0x26] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7E6C thumb_func_start sub_80A7EC0 sub_80A7EC0: ; 80A7EC0 push {r4,r5,lr} adds r4, r0, 0 adds r0, r1, 0 lsls r4, 24 lsrs r4, 24 lsls r0, 24 lsrs r0, 24 bl sub_80A7F18 lsls r0, 16 lsrs r0, 15 movs r1, 0x40 subs r5, r1, r0 ldr r1, =0x02020630 lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r4, r0, r1 ldrb r1, [r4, 0x3] lsls r1, 26 lsrs r1, 27 lsls r0, r5, 8 ldr r2, =0x02021bc0 lsls r1, 3 adds r1, r2 movs r2, 0x6 ldrsh r1, [r1, r2] bl __divsi3 cmp r0, 0x80 ble @080A7F00 movs r0, 0x80 @080A7F00: subs r0, r5, r0 lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 strh r0, [r4, 0x26] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A7EC0 thumb_func_start sub_80A7F18 sub_80A7F18: ; 80A7F18 push {r4-r7,lr} lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 ldrh r0, [r0, 0x2E] lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 ldr r1, =0x020241e4 ldr r7, =0x00000181 ldr r0, =0x020244e4 adds r6, r5, r0 @080A7F38: adds r0, r4, r1 ldrb r0, [r0] cmp r0, r2 beq @080A7F42 b @080A8034 @080A7F42: bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A7F78 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r2, [r0] ldr r1, =gUnknown_083021D8 lsls r0, r2, 2 adds r0, r1 ldrb r0, [r0, 0x1] b @080A8042 .align 2, 0 .pool @080A7F78: lsls r0, r4, 24 lsrs r0, 24 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080A7FD8 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r5, 2 adds r1, r0, r1 ldrh r0, [r1, 0x2] cmp r0, 0 bne @080A7FC0 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r2, r0, 16 b @080A7FC2 .align 2, 0 .pool @080A7FC0: ldrh r2, [r1, 0x2] @080A7FC2: cmp r2, r7 bne @080A7FD0 ldr r0, =gUnknown_08525F8C b @080A8018 .align 2, 0 .pool @080A7FD0: ldr r0, =gUnknown_083021D8 b @080A8026 .align 2, 0 .pool @080A7FD8: ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r5, 2 adds r1, r0, r1 ldrh r0, [r1, 0x2] cmp r0, 0 bne @080A8010 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r2, r0, 16 b @080A8012 .align 2, 0 .pool @080A8010: ldrh r2, [r1, 0x2] @080A8012: cmp r2, r7 bne @080A8024 ldr r0, =gUnknown_08525F88 @080A8018: ldrb r1, [r6] adds r1, r0 ldrb r0, [r1] b @080A8042 .align 2, 0 .pool @080A8024: ldr r0, =gUnknown_08300D38 @080A8026: lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1, 0x1] b @080A8042 .align 2, 0 .pool @080A8034: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x3 bhi @080A8040 b @080A7F38 @080A8040: movs r0, 0x40 @080A8042: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80A7F18 thumb_func_start sub_80A8048 sub_80A8048: ; 80A8048 strh r2, [r0] asrs r2, 16 strh r2, [r1] bx lr thumb_func_end sub_80A8048 thumb_func_start sub_80A8050 sub_80A8050: ; 80A8050 lsls r0, 16 lsrs r0, 16 lsls r1, 16 orrs r0, r1 bx lr thumb_func_end sub_80A8050 thumb_func_start sub_80A805C sub_80A805C: ; 80A805C push {r4-r6,lr} mov r6, r8 push {r6} mov r8, r0 adds r5, r3, 0 ldr r0, [sp, 0x14] ldr r4, [sp, 0x18] ldr r6, [sp, 0x1C] lsls r1, 24 lsrs r1, 24 lsls r2, 16 lsrs r2, 16 lsls r5, 16 lsrs r5, 16 lsls r0, 16 lsrs r0, 16 lsls r4, 16 lsrs r4, 16 lsls r6, 16 lsrs r6, 16 mov r3, r8 strh r6, [r3, 0x18] strh r1, [r3, 0x26] strh r2, [r3, 0x1A] strh r5, [r3, 0x1C] strh r0, [r3, 0x22] strh r4, [r3, 0x24] lsls r0, 16 asrs r0, 16 lsls r2, 16 asrs r2, 16 subs r0, r2 adds r1, r6, 0 bl __divsi3 mov r1, r8 strh r0, [r1, 0x1E] lsls r4, 16 asrs r4, 16 lsls r5, 16 asrs r5, 16 subs r4, r5 adds r0, r4, 0 adds r1, r6, 0 bl __divsi3 mov r3, r8 strh r0, [r3, 0x20] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_80A805C thumb_func_start sub_80A80C8 sub_80A80C8: ; 80A80C8 push {r4,lr} adds r4, r0, 0 ldrh r1, [r4, 0x18] movs r2, 0x18 ldrsh r0, [r4, r2] cmp r0, 0 bne @080A80DA movs r0, 0 b @080A8136 @080A80DA: subs r0, r1, 0x1 strh r0, [r4, 0x18] lsls r0, 16 cmp r0, 0 beq @080A80F4 ldrh r0, [r4, 0x1E] ldrh r3, [r4, 0x1A] adds r0, r3 strh r0, [r4, 0x1A] ldrh r0, [r4, 0x20] ldrh r1, [r4, 0x1C] adds r0, r1 b @080A80FA @080A80F4: ldrh r0, [r4, 0x22] strh r0, [r4, 0x1A] ldrh r0, [r4, 0x24] @080A80FA: strh r0, [r4, 0x1C] ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 movs r2, 0x1A ldrsh r1, [r4, r2] movs r3, 0x1C ldrsh r2, [r4, r3] movs r3, 0 bl obj_id_set_rotscale movs r0, 0x18 ldrsh r3, [r4, r0] cmp r3, 0 beq @080A8124 ldrh r0, [r4, 0x26] lsls r0, 24 lsrs r0, 24 bl sub_80A7E6C b @080A8134 @080A8124: ldr r2, =0x02020630 movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x26] @080A8134: ldrb r0, [r4, 0x18] @080A8136: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A80C8 thumb_func_start sub_80A8140 sub_80A8140: ; 80A8140 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x0203841a ldrb r0, [r0] movs r1, 0 cmp r0, 0x1E bls @080A815E movs r1, 0x1 cmp r0, 0x64 bls @080A815E movs r1, 0x3 cmp r0, 0xC8 bhi @080A815E movs r1, 0x2 @080A815E: ldr r0, =0x0203841e strh r1, [r0, 0xE] adds r0, r2, 0 bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8140 thumb_func_start sub_80A8174 sub_80A8174: ; 80A8174 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r4, r0, 24 adds r7, r4, 0 ldr r6, =0x02038437 ldrb r0, [r6] bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A81B4 ldr r2, =0x02020630 ldr r1, =0x020241e4 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 movs r0, 0x3 adds r2, r4, 0 ands r2, r0 lsls r2, 2 ldrb r3, [r1, 0x5] movs r0, 0xD negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1, 0x5] @080A81B4: ldr r0, =0x02038436 mov r8, r0 ldrb r0, [r0] bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A81EC ldr r2, =0x02020630 ldr r1, =0x020241e4 mov r3, r8 ldrb r0, [r3] adds r0, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 movs r0, 0x3 adds r2, r4, 0 ands r2, r0 lsls r2, 2 ldrb r3, [r1, 0x5] movs r0, 0xD negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1, 0x5] @080A81EC: ldrb r0, [r6] movs r5, 0x2 eors r0, r5 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A8224 ldr r2, =0x02020630 ldr r1, =0x020241e4 ldrb r0, [r6] eors r0, r5 adds r0, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 movs r0, 0x3 adds r2, r4, 0 ands r2, r0 lsls r2, 2 ldrb r3, [r1, 0x5] movs r0, 0xD negs r0, r0 ands r0, r3 orrs r0, r2 strb r0, [r1, 0x5] @080A8224: mov r1, r8 ldrb r0, [r1] eors r0, r5 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A825C ldr r2, =0x02020630 ldr r1, =0x020241e4 mov r3, r8 ldrb r0, [r3] eors r0, r5 adds r0, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 movs r0, 0x3 ands r7, r0 lsls r3, r7, 2 ldrb r2, [r1, 0x5] movs r0, 0xD negs r0, r0 ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] @080A825C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8174 thumb_func_start sub_80A8278 sub_80A8278: ; 80A8278 push {r4-r6,lr} movs r5, 0 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 bge @080A82D2 ldr r6, =0x02020630 @080A8286: lsls r0, r5, 24 lsrs r4, r0, 24 adds r0, r4, 0 bl b_side_obj__get_some_boolean lsls r0, 24 cmp r0, 0 beq @080A82C8 adds r0, r4, 0 bl sub_80A82E4 ldr r3, =0x020241e4 adds r3, r5, r3 ldrb r2, [r3] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r6 adds r1, 0x43 strb r0, [r1] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r2, [r0, 0x5] movs r3, 0xD negs r3, r3 adds r1, r3, 0 ands r2, r1 movs r1, 0x8 orrs r2, r1 strb r2, [r0, 0x5] @080A82C8: adds r5, 0x1 ldr r0, =0x0202406c ldrb r0, [r0] cmp r5, r0 blt @080A8286 @080A82D2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8278 thumb_func_start sub_80A82E4 sub_80A82E4: ; 80A82E4 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A8300 cmp r4, 0x2 bne @080A82FC movs r0, 0x1E b @080A8320 @080A82FC: movs r0, 0x28 b @080A8320 @080A8300: adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 movs r1, 0x1E cmp r0, 0 beq @080A831E movs r1, 0x14 cmp r0, 0x2 beq @080A831E movs r1, 0x32 cmp r0, 0x1 bne @080A831E movs r1, 0x28 @080A831E: adds r0, r1, 0 @080A8320: pop {r4} pop {r1} bx r1 thumb_func_end sub_80A82E4 thumb_func_start sub_80A8328 sub_80A8328: ; 80A8328 push {r4,lr} lsls r0, 24 lsrs r0, 24 bl battle_get_per_side_status lsls r0, 24 lsrs r4, r0, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A8344 movs r0, 0x2 b @080A835C @080A8344: cmp r4, 0 beq @080A834C cmp r4, 0x3 bne @080A8350 @080A834C: movs r0, 0x2 b @080A8352 @080A8350: movs r0, 0x1 @080A8352: movs r1, 0x4 bl sub_8118140 lsls r0, 24 lsrs r0, 24 @080A835C: pop {r4} pop {r1} bx r1 thumb_func_end sub_80A8328 thumb_func_start battle_get_per_side_status_permutated battle_get_per_side_status_permutated: ; 80A8364 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A838A adds r0, r4, 0 bl battle_get_per_side_status lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @080A8386 cmp r0, 0x3 bne @080A838A @080A8386: movs r0, 0x2 b @080A838C @080A838A: movs r0, 0x1 @080A838C: pop {r4} pop {r1} bx r1 thumb_func_end battle_get_per_side_status_permutated thumb_func_start sub_80A8394 sub_80A8394: ; 80A8394 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 ldr r4, [sp, 0x30] ldr r5, [sp, 0x34] ldr r6, [sp, 0x38] mov r8, r6 lsls r0, 16 lsrs r6, r0, 16 lsls r1, 24 lsrs r1, 24 mov r9, r1 lsls r2, 24 lsrs r7, r2, 24 lsls r3, 16 lsrs r3, 16 mov r10, r3 lsls r4, 16 lsrs r4, 16 str r4, [sp, 0x4] lsls r5, 24 lsrs r5, 24 str r5, [sp, 0x8] lsls r0, r7, 3 ldr r1, =gUnknown_08525FC0 adds r0, r1 bl gpu_tile_obj_alloc_tag_and_copy_to_vram lsls r0, 16 lsrs r0, 16 str r0, [sp, 0xC] ldr r1, =gUnknown_08525F90 lsls r0, r7, 1 adds r0, r7 lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x2] bl gpu_pal_alloc_new lsls r0, 24 lsrs r5, r0, 24 ldr r4, =0x020244d4 ldr r0, [r4] cmp r0, 0 beq @080A8412 movs r1, 0xBE lsls r1, 1 adds r0, r1 ldr r0, [r0] cmp r0, 0 bne @080A8412 movs r0, 0x80 lsls r0, 6 bl 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, =0x020244d0 ldr r0, [r0] ldr r1, [r0] ldr r2, [sp, 0x40] lsls r0, r2, 2 adds r0, r1 ldrh r0, [r0, 0x2] cmp r0, 0 beq @080A8488 @080A845E: lsls r0, r6, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] movs r3, 0xBE lsls r3, 1 adds r1, r3 ldr r1, [r1] movs r2, 0x1 b @080A850A .align 2, 0 .pool @080A8488: lsls r0, r6, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] movs r2, 0xBE lsls r2, 1 adds r1, r2 ldr r1, [r1] movs r2, 0x1 str r2, [sp] adds r2, r6, 0 mov r3, r8 bl load_poke_gfx_probably b @080A8540 .align 2, 0 .pool @080A84B0: adds r0, r6, 0 ldr r1, [sp, 0x3C] mov r2, r8 bl species_and_otid_get_pal lsls r1, r5, 20 movs r3, 0x80 lsls r3, 17 adds r1, r3 lsrs r1, 16 movs r2, 0x20 bl decompress_palette ldr r0, [sp, 0x44] cmp r0, 0x1 beq @080A84F6 ldr r2, [sp, 0x40] lsls r1, r2, 24 lsrs r1, 24 movs r0, 0x5 bl sub_80688F8 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080A84F6 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] ldr r3, [sp, 0x40] lsls r0, r3, 2 adds r0, r1 ldrh r2, [r0, 0x2] cmp r2, 0 beq @080A8524 @080A84F6: lsls r0, r6, 3 ldr r1, =gMonBackPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] movs r2, 0xBE lsls r2, 1 adds r1, r2 ldr r1, [r1] movs r2, 0 @080A850A: str r2, [sp] adds r2, r6, 0 mov r3, r8 bl sub_8034B7C b @080A8540 .align 2, 0 .pool @080A8524: lsls r0, r6, 3 ldr r1, =gMonBackPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] movs r3, 0xBE lsls r3, 1 adds r1, r3 ldr r1, [r1] str r2, [sp] adds r2, r6, 0 mov r3, r8 bl load_poke_gfx_probably @080A8540: ldr r5, =0x020244d4 ldr r0, [r5] movs r4, 0xBE lsls r4, 1 adds r0, r4 ldr r0, [r0] ldr r2, [sp, 0xC] lsls r1, r2, 5 ldr r3, =0x06010000 adds r1, r3 movs r2, 0x80 lsls r2, 4 movs r3, 0x1 bl RequestDma3Copy ldr r0, [r5] adds r0, r4 ldr r0, [r0] bl free ldr r0, [r5] adds r0, r4 movs r1, 0 str r1, [r0] mov r0, r9 cmp r0, 0 bne @080A85A0 lsls r0, r7, 1 adds r0, r7 lsls r0, 3 ldr r1, =gUnknown_08525F90 adds r0, r1 mov r2, r10 lsls r1, r2, 16 asrs r1, 16 ldr r3, =gUnknown_08300D38 b @080A85B2 .align 2, 0 .pool @080A85A0: lsls r0, r7, 1 adds r0, r7 lsls r0, 3 ldr r1, =gUnknown_08525F90 adds r0, r1 mov r2, r10 lsls r1, r2, 16 asrs r1, 16 ldr r3, =gUnknown_083021D8 @080A85B2: lsls r2, r6, 2 adds r2, r3 ldrb r2, [r2, 0x1] ldr r3, [sp, 0x4] adds r2, r3 lsls r2, 16 asrs r2, 16 ldr r3, [sp, 0x8] bl 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, =0x02020630 lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r1, r3, 0 adds r1, 0x10 adds r1, r0, r1 ldr r2, =gUnknown_082FF6C0 str r2, [r1] adds r0, r3 movs r1, 0 bl 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 .pool 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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0x18] ldrb r1, [r2, 0x4] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080A8654 ldrh r7, [r2, 0x2] ldr r2, [r2, 0x10] b @080A8658 .align 2, 0 .pool @080A8654: ldrh r7, [r2] ldr r2, [r2, 0x8] @080A8658: cmp r7, 0xC9 bne @080A86A4 movs r0, 0xC0 lsls r0, 18 ands r0, r2 lsrs r0, 18 movs r1, 0xC0 lsls r1, 10 ands r1, r2 lsrs r1, 12 orrs r0, r1 movs r1, 0xC0 lsls r1, 2 ands r1, r2 lsrs r1, 6 orrs r0, r1 movs r1, 0x3 ands r1, r2 orrs r0, r1 movs r1, 0x1C bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @080A8690 movs r0, 0xC9 b @080A869A @080A8690: movs r1, 0xCE lsls r1, 1 adds r0, r1 lsls r0, 16 lsrs r0, 16 @080A869A: lsls r1, r0, 2 ldr r0, =gUnknown_083021D8 b @080A8864 .align 2, 0 .pool @080A86A4: ldr r0, =0x00000181 cmp r7, r0 bne @080A86AC b @080A8834 @080A86AC: movs r0, 0xCE lsls r0, 1 cmp r7, r0 bhi @080A877C lsls r1, r7, 2 ldr r0, =gUnknown_083021D8 b @080A8864 .align 2, 0 .pool @080A86C4: mov r0, r8 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080A8790 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] mov r1, r8 lsls r2, r1, 2 adds r1, r2, r0 ldrh r0, [r1, 0x2] cmp r0, 0 bne @080A871C ldr r0, =0x0202406e mov r1, r8 lsls r4, r1, 1 adds r4, r0 ldrh r0, [r4] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r7, r0, 16 ldrh r0, [r4] muls r0, r6 adds r0, r5 movs r1, 0 bl pokemon_getattr adds r2, r0, 0 b @080A8724 .align 2, 0 .pool @080A871C: ldrh r7, [r1, 0x2] ldr r0, =0x020244bc adds r0, r2, r0 ldr r2, [r0] @080A8724: cmp r7, 0xC9 bne @080A8774 movs r0, 0xC0 lsls r0, 18 ands r0, r2 lsrs r0, 18 movs r1, 0xC0 lsls r1, 10 ands r1, r2 lsrs r1, 12 orrs r0, r1 movs r1, 0xC0 lsls r1, 2 ands r1, r2 lsrs r1, 6 orrs r0, r1 movs r1, 0x3 ands r1, r2 orrs r0, r1 movs r1, 0x1C bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @080A8760 movs r0, 0xC9 b @080A876A .align 2, 0 .pool @080A8760: movs r1, 0xCE lsls r1, 1 adds r0, r1 lsls r0, 16 lsrs r0, 16 @080A876A: lsls r1, r0, 2 ldr r0, =gUnknown_083021D8 b @080A8864 .align 2, 0 .pool @080A8774: movs r0, 0xCE lsls r0, 1 cmp r7, r0 bls @080A8784 @080A877C: ldr r4, =gUnknown_083021D8 b @080A8866 .align 2, 0 .pool @080A8784: lsls r1, r7, 2 ldr r0, =gUnknown_083021D8 b @080A8864 .align 2, 0 .pool @080A8790: ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] mov r1, r8 lsls r2, r1, 2 adds r1, r2, r0 ldrh r0, [r1, 0x2] cmp r0, 0 bne @080A87DC ldr r0, =0x0202406e mov r1, r8 lsls r4, r1, 1 adds r4, r0 ldrh r0, [r4] movs r6, 0x64 muls r0, r6 ldr r5, =0x02024744 adds r0, r5 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r7, r0, 16 ldrh r0, [r4] muls r0, r6 adds r0, r5 movs r1, 0 bl pokemon_getattr adds r2, r0, 0 b @080A87E4 .align 2, 0 .pool @080A87DC: ldrh r7, [r1, 0x2] ldr r0, =0x020244bc adds r0, r2, r0 ldr r2, [r0] @080A87E4: cmp r7, 0xC9 bne @080A882E movs r0, 0xC0 lsls r0, 18 ands r0, r2 lsrs r0, 18 movs r1, 0xC0 lsls r1, 10 ands r1, r2 lsrs r1, 12 orrs r0, r1 movs r1, 0xC0 lsls r1, 2 ands r1, r2 lsrs r1, 6 orrs r0, r1 movs r1, 0x3 ands r1, r2 orrs r0, r1 movs r1, 0x1C bl __umodsi3 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @080A8820 movs r0, 0xC9 b @080A882A .align 2, 0 .pool @080A8820: movs r1, 0xCE lsls r1, 1 adds r0, r1 lsls r0, 16 lsrs r0, 16 @080A882A: lsls r1, r0, 2 b @080A8862 @080A882E: ldr r0, =0x00000181 cmp r7, r0 bne @080A8850 @080A8834: ldr r0, =0x020244e4 add r0, r8 ldrb r0, [r0] lsls r0, 2 ldr r1, =gUnknown_08525F78 adds r4, r0, r1 b @080A8866 .align 2, 0 .pool @080A8850: movs r0, 0xCE lsls r0, 1 cmp r7, r0 bls @080A8860 ldr r4, =gUnknown_08300D38 b @080A8866 .align 2, 0 .pool @080A8860: lsls r1, r7, 2 @080A8862: ldr r0, =gUnknown_08300D38 @080A8864: adds r4, r1, r0 @080A8866: mov r0, r9 cmp r0, 0x6 bhi @080A8916 lsls r0, 2 ldr r1, =@080A8880 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080A8880: .4byte @080A889C .4byte @080A88A6 .4byte @080A88D2 .4byte @080A88EA .4byte @080A88AE .4byte @080A88C0 .4byte @080A8902 @080A889C: ldrb r1, [r4] movs r0, 0xF ands r0, r1 lsls r0, 3 b @080A8918 @080A88A6: ldrb r0, [r4] lsrs r0, 4 lsls r0, 3 b @080A8918 @080A88AE: mov r0, r8 movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrb r1, [r4] lsrs r1, 4 b @080A88E4 @080A88C0: mov r0, r8 movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrb r1, [r4] lsrs r1, 4 b @080A88FC @080A88D2: mov r0, r8 movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrb r2, [r4] movs r1, 0xF ands r1, r2 @080A88E4: lsls r1, 2 subs r0, r1 b @080A8918 @080A88EA: mov r0, r8 movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrb r2, [r4] movs r1, 0xF ands r1, r2 @080A88FC: lsls r1, 2 adds r0, r1 b @080A8918 @080A8902: mov r0, r8 movs r1, 0x1 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 adds r0, 0x1F ldrb r1, [r4, 0x1] subs r0, r1 b @080A8918 @080A8916: movs r0, 0 @080A8918: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_80A861C thumb_func_start sub_80A8924 sub_80A8924: ; 80A8924 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} mov r9, r2 mov r10, r3 lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 cmp r1, 0 bne @080A8942 movs r5, 0 movs r6, 0x1 b @080A8946 @080A8942: movs r5, 0x2 movs r6, 0x3 @080A8946: adds r0, r4, 0 adds r1, r5, 0 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 mov r8, r0 adds r0, r4, 0 adds r1, r6, 0 bl sub_80A5C6C lsls r0, 24 lsrs r7, r0, 24 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @080A8998 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @080A8998 movs r0, 0x2 eors r4, r0 adds r0, r4, 0 adds r1, r5, 0 bl sub_80A5C6C lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 adds r1, r6, 0 bl sub_80A5C6C lsls r0, 24 lsrs r3, r0, 24 mov r0, r8 lsls r1, r0, 16 lsls r2, r7, 16 b @080A89A4 @080A8998: mov r0, r8 lsls r1, r0, 16 lsrs r5, r1, 16 lsls r0, r7, 16 lsrs r3, r0, 16 adds r2, r0, 0 @080A89A4: asrs r0, r1, 16 adds r0, r5 asrs r0, 1 mov r1, r9 strh r0, [r1] asrs r0, r2, 16 adds r0, r3 asrs r0, 1 mov r1, r10 strh r0, [r1] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_80A8924 thumb_func_start sub_80A89C8 sub_80A89C8: ; 80A89C8 push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} sub sp, 0x4 lsls r6, r1, 24 lsrs r6, 24 ldr r0, =nullsub_12 mov r10, r0 bl object_new_hidden_with_callback mov r8, r0 mov r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r0, =0x02020630 mov r9, r0 mov r0, r8 lsls r3, r0, 4 add r3, r8 lsls r3, 2 mov r0, r9 adds r5, r3, r0 lsls r4, r6, 4 adds r4, r6 lsls r4, 2 add r4, r9 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x44 str r3, [sp] bl memcpy adds r2, r5, 0 adds r2, 0x3F ldrb r0, [r2] movs r1, 0x40 orrs r0, r1 strb r0, [r2] ldrb r2, [r5, 0x5] movs r1, 0xD negs r1, r1 adds r0, r1, 0 ands r0, r2 strb r0, [r5, 0x5] ldrb r0, [r5, 0x1] ands r1, r0 movs r0, 0x8 orrs r1, r0 strb r1, [r5, 0x1] ldrh r1, [r4, 0x4] lsls r1, 22 lsrs r1, 22 ldrh r2, [r5, 0x4] ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r5, 0x4] movs r0, 0x1C add r9, r0 ldr r3, [sp] add r3, r9 mov r0, r10 str r0, [r3] mov r0, r8 add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80A89C8 thumb_func_start sub_80A8A6C sub_80A8A6C: ; 80A8A6C push {r4,lr} adds r4, r0, 0 bl sub_80A6838 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A8AAC ldr r2, =0x0203841e ldrh r0, [r4, 0x20] ldrh r1, [r2] subs r0, r1 strh r0, [r4, 0x20] ldrh r0, [r2, 0x6] negs r0, r0 strh r0, [r2, 0x6] adds r3, r4, 0 adds r3, 0x3F ldrb r0, [r3] movs r1, 0x1 orrs r0, r1 strb r0, [r3] adds r1, r2, 0 b @080A8AB6 .align 2, 0 .pool @080A8AAC: ldr r1, =0x0203841e ldrh r0, [r1] ldrh r2, [r4, 0x20] adds r0, r2 strh r0, [r4, 0x20] @080A8AB6: ldrh r0, [r1, 0x2] ldrh r2, [r4, 0x22] adds r0, r2 strh r0, [r4, 0x22] ldrh r0, [r1, 0x4] strh r0, [r4, 0x2E] ldrh r0, [r1, 0x6] strh r0, [r4, 0x30] ldrh r0, [r1, 0x8] strh r0, [r4, 0x34] ldrh r0, [r1, 0xA] strh r0, [r4, 0x38] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A66DC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8A6C thumb_func_start sub_80A8AEC sub_80A8AEC: ; 80A8AEC push {r4,lr} adds r4, r0, 0 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A8B1C ldr r2, =0x0203841e ldrh r0, [r4, 0x20] ldrh r1, [r2] subs r0, r1 strh r0, [r4, 0x20] movs r1, 0x6 ldrsh r0, [r2, r1] negs r0, r0 strh r0, [r2, 0x6] adds r1, r2, 0 b @080A8B26 .align 2, 0 .pool @080A8B1C: ldr r1, =0x0203841e ldrh r0, [r1] ldrh r2, [r4, 0x20] adds r0, r2 strh r0, [r4, 0x20] @080A8B26: ldrh r0, [r1, 0x2] ldrh r2, [r4, 0x22] adds r0, r2 strh r0, [r4, 0x22] ldrh r0, [r1, 0x4] strh r0, [r4, 0x2E] ldrh r0, [r1, 0x6] strh r0, [r4, 0x30] ldrh r0, [r1, 0x8] strh r0, [r4, 0x34] ldrh r0, [r1, 0xA] strh r0, [r4, 0x38] ldrb r1, [r1, 0xC] adds r0, r4, 0 bl obj_anim_image_start ldr r1, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A66DC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8AEC thumb_func_start sub_80A8B64 sub_80A8B64: ; 80A8B64 push {r4,lr} adds r4, r0, 0 bl sub_80A6838 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080A8B90 ldr r0, =0x0203841e ldrh r1, [r4, 0x20] ldrh r2, [r0] subs r1, r2 strh r1, [r4, 0x20] b @080A8B9C .align 2, 0 .pool @080A8B90: ldr r1, =0x0203841e ldrh r0, [r1] ldrh r2, [r4, 0x20] adds r0, r2 strh r0, [r4, 0x20] adds r0, r1, 0 @080A8B9C: ldrh r0, [r0, 0x2] ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x22] ldr r0, =sub_80A67D8 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8B64 thumb_func_start sub_80A8BC4 sub_80A8BC4: ; 80A8BC4 push {r4-r7,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e00 adds r5, r1, r0 movs r0, 0 bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r0, 24 movs r6, 0 strh r0, [r5, 0x8] ldr r7, =0x02038436 ldrb r0, [r7] bl battle_side_get_owner lsls r0, 24 movs r1, 0x8 cmp r0, 0 beq @080A8BF8 movs r0, 0x8 negs r0, r0 adds r1, r0, 0 @080A8BF8: strh r1, [r5, 0xA] strh r6, [r5, 0xC] strh r6, [r5, 0xE] ldr r4, =0x02020630 movs r0, 0x8 ldrsh r1, [r5, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x24] ldrh r2, [r5, 0x8] subs r1, r2 strh r1, [r0, 0x24] ldr r0, =0x00002771 bl 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 .pool @080A8C68: movs r0, 0x3 @080A8C6A: strh r0, [r5, 0x14] lsls r0, r4, 1 ldr r1, =0x02037714 adds r0, r1 lsls r1, r6, 1 ldr r2, =0x02037b14 adds r1, r2 ldr r2, =0x04000008 bl CpuSet ldr r0, =0x0203841e ldrb r2, [r0, 0x2] ldrh r3, [r0] adds r0, r6, 0 movs r1, 0x10 bl pal_fade_1 ldr r0, =sub_80A8CAC str r0, [r5] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8BC4 thumb_func_start sub_80A8CAC sub_80A8CAC: ; 80A8CAC push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e00 adds r4, r0, r1 movs r1, 0xC ldrsh r0, [r4, r1] cmp r0, 0x1 beq @080A8D10 cmp r0, 0x1 bgt @080A8CD4 cmp r0, 0 beq @080A8CDA b @080A8D6C .align 2, 0 .pool @080A8CD4: cmp r0, 0x2 beq @080A8D58 b @080A8D6C @080A8CDA: adds r0, r4, 0 adds r1, r5, 0 bl sub_80A8D78 ldr r2, =0x02020630 movs r0, 0x8 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r4, 0xA] ldrh r2, [r0, 0x24] adds r1, r2 strh r1, [r0, 0x24] ldrh r1, [r4, 0xE] adds r0, r1, 0x1 strh r0, [r4, 0xE] lsls r0, 16 asrs r0, 16 cmp r0, 0x5 bne @080A8D6C strh r1, [r4, 0xE] b @080A8D4A .align 2, 0 .pool @080A8D10: adds r0, r4, 0 adds r1, r5, 0 bl sub_80A8D78 ldr r3, =0x02020630 movs r0, 0x8 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x24] ldrh r2, [r4, 0xA] subs r1, r2 strh r1, [r0, 0x24] ldrh r0, [r4, 0xE] subs r0, 0x1 strh r0, [r4, 0xE] lsls r0, 16 asrs r2, r0, 16 cmp r2, 0 bne @080A8D6C movs r1, 0x8 ldrsh r0, [r4, r1] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r3 strh r2, [r1, 0x24] @080A8D4A: ldrh r0, [r4, 0xC] adds r0, 0x1 strh r0, [r4, 0xC] b @080A8D6C .align 2, 0 .pool @080A8D58: movs r2, 0x12 ldrsh r0, [r4, r2] cmp r0, 0 bne @080A8D6C ldr r0, =0x00002771 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 .pool thumb_func_end sub_80A8CAC thumb_func_start sub_80A8D78 sub_80A8D78: ; 80A8D78 push {r4-r7,lr} mov r7, r8 push {r7} adds r6, r0, 0 lsls r1, 24 lsrs r1, 24 mov r8, r1 movs r0, 0 bl duplicate_obj_of_side_rel2move_in_transparent_mode lsls r0, 16 lsrs r7, r0, 16 asrs r0, 16 cmp r0, 0 blt @080A8DE8 ldr r5, =0x02020630 lsls r4, r0, 4 adds r4, r0 lsls r4, 2 adds r3, r4, r5 movs r0, 0x3 ldrb r1, [r6, 0x14] ands r1, r0 lsls r1, 2 ldrb r2, [r3, 0x5] movs r0, 0xD negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3, 0x5] ldrb r1, [r6, 0x10] lsls r1, 4 movs r2, 0xF ands r0, r2 orrs r0, r1 strb r0, [r3, 0x5] movs r0, 0x8 strh r0, [r3, 0x2E] mov r0, r8 strh r0, [r3, 0x30] strh r7, [r3, 0x32] movs r0, 0x8 ldrsh r1, [r6, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r0, [r0, 0x24] strh r0, [r3, 0x24] adds r5, 0x1C adds r4, r5 ldr r0, =sub_80A8DFC str r0, [r4] ldrh r0, [r6, 0x12] adds r0, 0x1 strh r0, [r6, 0x12] @080A8DE8: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8D78 thumb_func_start sub_80A8DFC sub_80A8DFC: ; 80A8DFC push {lr} adds r3, r0, 0 ldrh r0, [r3, 0x2E] subs r0, 0x1 strh r0, [r3, 0x2E] lsls r0, 16 cmp r0, 0 bne @080A8E26 ldr r2, =0x03005e00 movs r0, 0x30 ldrsh r1, [r3, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrh r1, [r0, 0x12] subs r1, 0x1 strh r1, [r0, 0x12] adds r0, r3, 0 bl obj_delete_but_dont_free_vram @080A8E26: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8DFC thumb_func_start sub_80A8E30 sub_80A8E30: ; 80A8E30 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080A8E68 movs r0, 0x5 b @080A8E6A .align 2, 0 .pool @080A8E68: ldr r0, =0x0000fff6 @080A8E6A: strh r0, [r5, 0x2E] ldr r0, =0x0000ffd8 strh r0, [r5, 0x30] ldr r0, =sub_80A8E88 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8E30 thumb_func_start sub_80A8E88 sub_80A8E88: ; 80A8E88 push {r4,r5,lr} adds r4, r0, 0 ldrh r0, [r4, 0x2E] ldrh r1, [r4, 0x32] adds r0, r1 strh r0, [r4, 0x32] ldrh r5, [r4, 0x30] ldrh r2, [r4, 0x34] adds r0, r5, r2 strh r0, [r4, 0x34] movs r1, 0x32 ldrsh r0, [r4, r1] movs r1, 0xA bl __divsi3 strh r0, [r4, 0x24] movs r2, 0x34 ldrsh r0, [r4, r2] movs r1, 0xA bl __divsi3 strh r0, [r4, 0x26] lsls r0, r5, 16 asrs r0, 16 movs r1, 0x14 negs r1, r1 cmp r0, r1 bge @080A8EC4 adds r0, r5, 0x1 strh r0, [r4, 0x30] @080A8EC4: movs r1, 0x22 ldrsh r0, [r4, r1] movs r2, 0x26 ldrsh r1, [r4, r2] adds r0, r1 movs r1, 0x20 negs r1, r1 cmp r0, r1 bge @080A8EDC adds r0, r4, 0 bl move_anim_8072740 @080A8EDC: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_80A8E88 thumb_func_start sub_80A8EE4 sub_80A8EE4: ; 80A8EE4 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e ldrh r0, [r5, 0x4] strh r0, [r4, 0x2E] ldrh r0, [r5, 0x8] ldrh r1, [r4, 0x20] adds r0, r1 strh r0, [r4, 0x32] ldrh r0, [r5, 0xA] ldrh r1, [r4, 0x22] adds r0, r1 strh r0, [r4, 0x36] ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080A8F24 ldrh r0, [r5, 0x8] adds r0, 0x1E ldrh r1, [r4, 0x20] adds r0, r1 strh r0, [r4, 0x20] ldrh r0, [r5, 0xA] subs r0, 0x14 b @080A8F32 .align 2, 0 .pool @080A8F24: ldrh r0, [r5, 0x8] subs r0, 0x1E ldrh r1, [r4, 0x20] adds r0, r1 strh r0, [r4, 0x20] ldrh r0, [r5, 0xA] subs r0, 0x50 @080A8F32: strh r0, [r4, 0x22] ldr r0, =sub_80A6EEC str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A8EE4 .include "asm/task.s" 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, =0x02037fd4 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, =0x02024474 adds r2, r0, 0 adds r2, 0x21 movs r1, 0 strb r1, [r2] adds r0, 0x22 strb r1, [r0] ldr r0, =c2_80777E8 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A92F8 thumb_func_start c2_80777E8 c2_80777E8: ; 80A933C push {r4-r7,lr} sub sp, 0x8 ldr r0, =0x02024474 adds r0, 0x21 ldrb r0, [r0] cmp r0, 0x13 bls @080A934C b @080A95A4 @080A934C: lsls r0, 2 ldr r1, =@080A9360 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r0, =0x02022e18 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] ldr r0, =0x02022e1c strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] ldr r0, =0x02022e20 strh r1, [r0] ldr r0, =0x02022e22 strh r1, [r0] b @080A95D2 .align 2, 0 .pool @080A942C: movs r0, 0 str r0, [sp, 0x4] movs r1, 0xC0 lsls r1, 19 ldr r2, =0x01006000 add r0, sp, 0x4 bl CpuFastSet b @080A95D2 .align 2, 0 .pool @080A9444: bl sub_8035AA4 b @080A95D2 @080A944A: bl reset_all_obj_data b @080A95D2 @080A9450: bl gpu_pal_allocator_reset ldr r1, =0x0300301c movs r0, 0x4 strb r0, [r1] b @080A95D2 .align 2, 0 .pool @080A9460: bl sub_805E350 b @080A95D2 @080A9466: ldr r5, =0x02024474 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 .pool @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, =0x02024474 @080A94AA: adds r1, 0x21 ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] b @080A95D2 .align 2, 0 .pool @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, =0x0202406e lsls r0, r4, 1 adds r0, r7 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x02024744 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, =0x020244ac ldr r0, =0x020244b8 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] movs r1, 0 bl sub_8059CB4 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080A95D2 ldr r0, =0x03003124 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 .pool @080A95A4: ldr r0, =vblank_cb_08078BB4 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, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] ldr r0, =sub_8038420 bl set_callback2 bl sub_805EF14 @080A95D2: ldr r1, =0x02024474 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 .pool thumb_func_end c2_80777E8 thumb_func_start sub_80A95F4 sub_80A95F4: ; 80A95F4 ldr r3, =0x0400000a ldrb r2, [r3] movs r1, 0xD negs r1, r1 adds r0, r1, 0 ands r0, r2 strb r0, [r3] ldr r2, =0x0400000c ldrb r0, [r2] ands r1, r0 strb r1, [r2] bx lr .align 2, 0 .pool 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, =0x0202406c 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, =0x020244d0 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, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 adds r1, r4, 0 bl sub_805DC0C b @080A96F4 .align 2, 0 .pool @080A966C: adds r0, r4, 0 movs r1, 0 bl sub_805E7DC b @080A96F4 @080A9676: ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0x80 ands r1, r2 cmp r1, 0 beq @080A9698 cmp r4, 0 bne @080A9698 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] b @080A96AA .align 2, 0 .pool @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, =0x020244d0 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, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 adds r1, r4, 0 bl sub_805DD7C b @080A96F4 .align 2, 0 .pool @080A96EC: adds r0, r4, 0 movs r1, 0 bl sub_805E7DC @080A96F4: ldr r0, =0x02024474 adds r0, 0x22 movs r1, 0 strb r1, [r0] @080A96FC: movs r0, 0x1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0202406c ldrb r0, [r0] cmp r7, r0 bcc @080A9722 b @080A9AA0 @080A9722: ldr r0, =0x020244d0 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 .pool @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, =0x0202406e 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, =0x02024744 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, =0x0202499c 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, =0x020241e4 adds r4, r7, r1 strb r0, [r4] ldr r5, =0x02020630 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, =nullsub_12 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, =0x020244e4 adds r1, r7, r1 ldrb r1, [r1] bl obj_anim_image_start ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] ldr r2, [sp] adds r0, r2, r0 b @080A9A50 .align 2, 0 .pool @080A986C: ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0x80 ands r1, r2 cmp r1, 0 beq @080A98D0 cmp r7, 0 bne @080A98D0 ldr r5, =0x03005d90 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, =0x0202499c ldr r1, =gUnknown_08305D2C 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 .pool @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, =0x0202499c ldr r0, =gUnknown_08305D2C 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, =0x020241e4 strb r0, [r3] ldr r4, =0x02020630 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, =nullsub_12 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 .pool @080A9968: ldr r1, =0x0202406e 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, =0x020244ec 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, =0x0202499c 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, =0x020241e4 adds r4, r7, r1 strb r0, [r4] ldr r5, =0x02020630 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, =nullsub_12 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, =0x020244e4 adds r1, r7, r1 ldrb r1, [r1] bl obj_anim_image_start ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0] ldr r1, [sp] adds r0, r1, r0 @080A9A50: ldrh r1, [r0, 0x2] ldr r0, =0x00000181 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, =gUnknown_08309AAC ldr r2, =0x00000604 adds r0, r2 ldr r0, [r0] str r0, [r1] @080A9A70: ldr r1, =0x02020630 ldr r0, =0x020241e4 adds r0, r7, r0 ldrb r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r1 ldr r0, =0x020244d0 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 .pool 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, =0x0202406c ldrb r0, [r0] cmp r5, r0 bcc @080A9AEC b @080A9C5E @080A9AEC: ldr r0, =0x02022fec 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 .pool @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, =0x03005d70 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, =0x0202406e lsls r4, r5, 1 adds r1, r4, r1 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe b @080A9BB8 .align 2, 0 .pool @080A9B6C: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 beq @080A9BA0 ldrb r0, [r4] ldr r1, =0x0202406e lsls r4, r5, 1 adds r1, r4, r1 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0xA bl healthbar_draw_field_maybe b @080A9BB8 .align 2, 0 .pool @080A9BA0: ldrb r0, [r4] ldr r1, =0x0202406e lsls r4, r5, 1 adds r1, r4, r1 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec 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, =0x03005d70 adds r0, r5, r0 ldrb r0, [r0] movs r1, 0x1 bl nullsub_30 b @080A9BFC .align 2, 0 .pool @080A9BF0: ldr r0, =0x03005d70 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, =0x0202406e adds r0, r4, r0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 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 .pool @080A9C34: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 ands r0, r1 cmp r0, 0 bne @080A9C5E ldr r0, =0x0202406e adds r0, r4, r0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool 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, =0x020241e4 adds r0, r4, r0 ldrb r6, [r0] ldr r0, =sub_80A9DB4 movs r1, 0xA bl AddTask lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r0, =gUnknown_08524F84 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_0852588C bl gpu_pal_obj_decompress_and_apply3 ldr r1, =0x03005e00 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, =0x02020630 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, =gUnknown_0853EF60 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 .pool @080A9D30: movs r0, 0xF8 lsls r0, 7 strh r0, [r1, 0xA] movs r5, 0 lsls r0, r6, 4 ldr r7, =0x02020630 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, =gUnknown_0853EF60 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, =0x02020630 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 .pool 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, =0x03005e00 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 .pool @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, =sub_80A9E78 str r1, [r2, 0x1C] adds r0, r2, 0 bl _call_via_r1 b @080A9E74 .align 2, 0 .pool @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, =0x02038437 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 8 ldr r1, =0xffe00000 adds r0, r1 lsrs r5, r0, 16 ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 8 ldr r1, =0xffdc0000 adds r0, r1 lsrs r4, r0, 16 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @080A9F32 lsls r0, r5, 16 ldr r1, =0xfffa0000 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, =gUnknown_0853EF48 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, =0x0000271a bl gpu_tile_obj_tag_get_range_start lsls r0, 16 ldr r1, =0xffff0000 cmp r0, r1 bne @080A9F7C ldr r1, =0x02020630 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, =0x02020630 adds r0, r1 ldr r1, =gUnknown_0853EF40 bl obj_set_f18_to_r0_f42_to_40 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 strh r4, [r0, 0x26] ldr r1, =sub_80A9FD0 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80A9EF4 thumb_func_start sub_80A9FD0 sub_80A9FD0: ; 80A9FD0 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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, =sub_80AA020 str r0, [r1] movs r0, 0 strh r0, [r1, 0xA] b @080AA01A .align 2, 0 .pool @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, =0x0000271a bl gpu_pal_tags_index_of lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005e00 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, =0x02037b14 lsls r2, 4 mov r12, r2 ldr r1, =0x0000010d 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, =0x0000010f 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, =sub_80AA0D0 str r0, [r5] @080AA0B0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AA020 thumb_func_start sub_80AA0D0 sub_80AA0D0: ; 80AA0D0 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r2, r1, r2 ldrh 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, =sub_80AA124 str r0, [r2] movs r0, 0 strh r0, [r2, 0xA] b @080AA11E .align 2, 0 .pool @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, =0x03005e00 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, =0x02020630 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 .pool @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, =0x020244d0 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, =@080AA1B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203841e movs r1, 0 strh r5, [r0] strh r2, [r0, 0x2] strh r1, [r0, 0x4] strh r1, [r0, 0x6] strh r3, [r0, 0x8] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8116EB4 str r1, [r0] adds r0, r4, 0 bl _call_via_r1 @080AA352: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 strb r4, [r0] ldr r0, =0x02038437 strb r4, [r0] ldr r0, =gUnknown_082C92FC movs r2, 0 bl move_something ldr r0, =task0A_80788BC movs r1, 0xA bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd ldrb r0, [r0] cmp r0, 0 bne @080AA3F6 ldr r0, =0x020244d0 ldr r2, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0x8 ldrsh r0, [r0, r1] ldr r2, [r2, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r2, [r1] movs r0, 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 .pool thumb_func_end task0A_80788BC thumb_func_start sub_80AA40C sub_80AA40C: ; 80AA40C push {lr} adds r3, r0, 0 ldr r2, =0x03005e00 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 .pool @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, =gUnknown_0853FF70 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 .pool thumb_func_end sub_80AA40C thumb_func_start sub_80AA474 sub_80AA474: ; 80AA474 push {lr} adds r3, r0, 0 ldr r2, =0x03005e00 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 .pool @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, =0xffc00000 adds r0, r2 lsrs r0, 16 movs r6, 0 lsls r7, r1, 16 @080AA4FA: lsls r5, r0, 16 asrs r5, 16 ldr r0, =gUnknown_085400D8 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, =0x02020630 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 .pool thumb_func_end sub_80AA4EC thumb_func_start sub_80AA548 sub_80AA548: ; 80AA548 push {r4-r6,lr} lsls r0, 16 ldr r2, =0xffc00000 adds r0, r2 lsrs r0, 16 movs r5, 0 lsls r6, r1, 16 @080AA556: lsls r4, r0, 16 asrs r4, 16 ldr r0, =gUnknown_085400D8 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, =0x02020630 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 .pool thumb_func_end sub_80AA548 thumb_func_start title_screen_logo_shine_obj_callback_type1 ; void title_screen_logo_shine_obj_callback_type1(struct obj *obj) 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, =0x0000010f 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 .pool @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, =0x02037b14 ldr r0, =0x000033f8 strh r0, [r1] b @080AA630 .align 2, 0 .pool @080AA62C: ldr r0, =0x02037b14 strh r2, [r0] @080AA630: adds r0, r4, 0x4 strh r0, [r3, 0x20] b @080AA648 .align 2, 0 .pool @080AA63C: ldr r1, =0x02037b14 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 .pool thumb_func_end title_screen_logo_shine_obj_callback_type1 thumb_func_start title_screen_logo_shine_obj_callback_type2 ; void title_screen_logo_shine_obj_callback_type2(struct obj *obj) 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, =0x0000010f cmp r1, r0 bgt @080AA670 adds r0, r3, 0 adds r0, 0x8 strh r0, [r2, 0x20] b @080AA676 .align 2, 0 .pool @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 ; void title_screen_add_logo_shine_obj(int a1) 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, =gUnknown_08540124 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, =0x02020630 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 .pool @080AA6D0: ldr r0, =gUnknown_08540124 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, =0x02020630 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, =title_screen_logo_shine_obj_callback_type2 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 .pool thumb_func_end title_screen_add_logo_shine_obj thumb_func_start title_screen_vblank_callback ; void 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, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 bl lcd_io_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end title_screen_vblank_callback thumb_func_start c2_title_screen_1 ; void c2_title_screen_1() c2_title_screen_1: ; 80AA7A4 push {r4,lr} sub sp, 0x14 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x5 bhi @080AA7E0 lsls r0, 2 ldr r1, =@080AA7C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00007fff 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, =0x040000d4 add r0, sp, 0xC str r0, [r1] movs r0, 0xC0 lsls r0, 19 str r0, [r1, 0x4] ldr r0, =0x8100c000 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, =0x85000100 str r0, [r1, 0x8] ldr r0, [r1, 0x8] add r0, sp, 0xC strh r2, [r0] str r0, [r1] ldr r0, =0x05000002 str r0, [r1, 0x4] ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] bl sub_80A1A74 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x1 strb r1, [r0] b @080AAB1E .align 2, 0 .pool @080AA8C4: ldr r0, =gUnknown_08DDE690 movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_08DE0644 ldr r1, =0x06004800 bl LZ77UnCompVram ldr r0, =gTitleScreenBgPalette movs r2, 0xF0 lsls r2, 1 movs r1, 0 bl gpu_pal_apply ldr r0, =gUnknown_0853F058 ldr r1, =0x06008000 bl LZ77UnCompVram ldr r0, =gUnknown_0853F83C ldr r1, =0x0600d000 bl LZ77UnCompVram ldr r0, =gUnknown_0853FC8C ldr r1, =0x0600c000 bl LZ77UnCompVram ldr r0, =gUnknown_08DDE458 ldr r1, =0x0600d800 bl LZ77UnCompVram bl remove_some_task bl clear_tasks bl reset_all_obj_data bl gpu_pal_allocator_reset ldr r1, =0x0300301c movs r0, 0x9 strb r0, [r1] ldr r0, =gUnknown_08540048 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085400F0 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0854013C bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08DDE438 movs r1, 0x80 lsls r1, 1 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_08540100 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x2 strb r1, [r0] b @080AAB1E .align 2, 0 .pool @080AA998: ldr r0, =task_title_screen_1 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0 movs r0, 0x80 lsls r0, 1 strh r0, [r1, 0x8] strh r2, [r1, 0xA] ldr r0, =0x0000fff0 strh r0, [r1, 0xC] subs r0, 0x10 strh r0, [r1, 0xE] ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x3 strb r1, [r0] b @080AAB1E .align 2, 0 .pool @080AA9E0: movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0x1 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =title_screen_vblank_callback bl SetVBlankCallback ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x4 strb r1, [r0] b @080AAB1E .align 2, 0 .pool @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, =0x0000ffff 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, =0x00001f1f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00003f1f 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, =0x00001a0b movs r0, 0x8 bl lcd_io_set ldr r1, =0x00001b0e movs r0, 0xA bl lcd_io_set ldr r1, =0x00004981 movs r0, 0xC bl lcd_io_set movs r0, 0x1 bl enable_irqs ldr r1, =0x0000b441 movs r0, 0 bl lcd_io_set ldr r0, =0x0000019d bl m4aSongNumStart ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x5 strb r1, [r0] b @080AAB1E .align 2, 0 .pool @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, =c2_title_screen_2 bl set_callback2 @080AAB1E: add sp, 0x14 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_title_screen_1 thumb_func_start c2_title_screen_2 ; void 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 ; void task_title_screen_1(int task_id) task_title_screen_1: ; 80AAB44 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF ands r0, r1 ldr r6, =0x03005e00 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 .pool @080AABA0: cmp r0, 0x40 bne @080AABAA movs r0, 0x2 bl title_screen_add_logo_shine_obj @080AABAA: ldr r0, =0x03005e00 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 .pool @080AABC0: ldr r1, =0x00001441 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, =0x00003f50 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, =gUnknown_08540018 movs r1, 0x62 movs r2, 0x2 movs r3, 0 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r4, =0x02020630 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, =gUnknown_08540030 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, =task_title_screen_2 str r0, [r6] @080AAC32: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_title_screen_1 thumb_func_start task_title_screen_2 ; void task_title_screen_2(int task_id) task_title_screen_2: ; 80AAC50 push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF ands r0, r1 ldr r2, =0x03005e00 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, =0x03005e00 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 .pool @080AACA8: movs r0, 0x1 strh r0, [r5, 0xA] ldr r1, =0x00002142 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000f06 movs r0, 0x52 bl lcd_io_set movs r0, 0x54 movs r1, 0 bl lcd_io_set ldr r1, =0x00001741 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, =task_title_screen_3 str r0, [r5] @080AACE2: ldr r2, =0x03005e00 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 .pool thumb_func_end task_title_screen_2 thumb_func_start task_title_screen_3 ; void task_title_screen_3(int task_id) task_title_screen_3: ; 80AAD64 push {r4,r5,lr} sub sp, 0x4 lsls r0, 24 lsrs r5, r0, 24 ldr r2, =0x030022c0 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, =0x0000ffff str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =c2_title_menu_1 bl set_callback2 b @080AAE98 .align 2, 0 .pool @080AADB0: ldrh r1, [r2, 0x2C] movs r0, 0x46 ands r0, r1 cmp r0, 0x46 bne @080AADC8 ldr r0, =c2_clear_save_data_screen_1 bl set_callback2 b @080AAE98 .align 2, 0 .pool @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, =c2_reset_rtc_screen_1 bl set_callback2 b @080AAE98 .align 2, 0 .pool @080AADFC: ldr r0, =0x030022c0 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, =c2_berry_program_update_screen_1 bl set_callback2 b @080AAE98 .align 2, 0 .pool @080AAE30: movs r0, 0x2C movs r1, 0 bl lcd_io_set movs r0, 0x2E movs r1, 0 bl lcd_io_set ldr r1, =0x03005e00 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, =0x02022e1a movs r1, 0x10 ldrsh r0, [r3, r1] lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 strh r0, [r2] ldr r1, =0x02022e18 movs r0, 0 strh r0, [r1] @080AAE72: ldrb r0, [r3, 0x8] bl title_screen_update_rayquaza_ring_palette ldr r0, =0x03007420 ldr r1, =0x0000ffff 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, =c2_show_copyright_and_intro_again_1 bl set_callback2 @080AAE98: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =c2_title_menu_2 bl set_callback2 @080AAECA: pop {r0} bx r0 .align 2, 0 .pool 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, =c2_show_copyright_and_intro_again_2 bl set_callback2 @080AAEE6: pop {r0} bx r0 .align 2, 0 .pool 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, =c2_clear_save_data_screen_2 bl set_callback2 @080AAF02: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_809EF88 bl set_callback2 @080AAF1E: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81BF384 bl set_callback2 @080AAF3E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_berry_program_update_screen_1 thumb_func_start title_screen_update_rayquaza_ring_palette ; void title_screen_update_rayquaza_ring_palette(u8 a1) 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 ; void sub_80AAFA4() sub_80AAFA4: ; 80AAFA4 push {r4-r6,lr} ldr r0, =sub_80AB1B0 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, =gUnknown_0854C270 lsls r1, r5, 5 ldr r2, =0x02037914 adds r1, r2 ldr r2, =0x04000008 bl CpuSet bl sub_80AB294 ldr r4, =0x02038454 ldr r1, =0x000006d5 adds r0, r4, r1 strb r5, [r0] ldr r0, =0x00001201 bl gpu_pal_alloc_new ldr r2, =0x000006d4 adds r1, r4, r2 strb r0, [r1] ldr r1, =0x000006da 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, =0x000006c6 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, =sub_80AB160 movs r1, 0x50 bl AddTask ldr r1, =0x000006c9 adds r4, r1 strb r0, [r4] @080AB060: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038454 ldr r2, =0x000006d1 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, =gUnknown_0854C150 lsls r1, r4, 4 adds r1, r0 ldr r0, [r1] bl _call_via_r0 @080AB0D2: ldr r1, =0x02038454 ldr r2, =0x000006d3 adds r0, r1, r2 movs r2, 0 strb r2, [r0] ldr r3, =0x000006d1 adds r0, r1, r3 strb r4, [r0] ldr r0, =0x000006ce adds r1, r0 strh r2, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038454 movs r2, 0xDA lsls r2, 3 adds r1, r0, r2 strb r4, [r1] ldr r1, =0x000006d1 adds r0, r1 strb r4, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038454 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 .pool 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, =0x02038454 movs r1, 0xD9 lsls r1, 3 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0 beq @080AB198 ldr r1, =gUnknown_0854C150 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80AB1B0 str r1, [r0] @080AB198: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038454 movs r0, 0xDA lsls r0, 3 adds r6, r5, r0 ldr r1, =0x000006d1 adds r7, r5, r1 ldrb r0, [r6] ldrb r2, [r7] cmp r0, r2 beq @080AB22C ldr r0, =gUnknown_0854C150 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, =0x000006c6 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, =0x000006c3 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 .pool @080AB22C: ldr r0, =gUnknown_0854C150 ldrb r1, [r6] lsls r1, 4 adds r0, 0x4 adds r1, r0 ldr r0, [r1] bl _call_via_r0 @080AB23C: ldr r1, =gUnknown_0854C240 ldr r0, =0x02038454 ldr r2, =0x000006c6 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 .pool thumb_func_end sub_80AB1B0 thumb_func_start sub_80AB26C sub_80AB26C: ; 80AB26C ldr r0, =0x02038454 ldr r2, =0x000006c1 adds r1, r0, r2 movs r2, 0 strb r2, [r1] ldr r1, =0x000006c2 adds r0, r1 strb r2, [r0] bx lr .align 2, 0 .pool 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, =0x03000f50 ldr r0, =gUnknown_0854C250 str r0, [r1] movs r0, 0 mov r12, r0 ldr r1, =0x020388b4 mov r10, r1 @080AB2AC: mov r7, r10 mov r0, r12 cmp r0, 0 bne @080AB2B8 ldr r1, =0xfffffda0 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 .pool @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, =0x02038454 ldr r1, =0x000006c6 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, =0x000006c1 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 .pool @080AB3E4: ldr r0, =0x000006c3 adds r2, r3, r0 ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] ldr r7, =0x000006c2 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 .pool @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, =0x02038454 ldr r0, =0x000006cb 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, =0x000006ca 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, =@080AB47C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02038454 movs r2, 0xD8 lsls r2, 3 adds r1, r0, r2 movs r2, 0x3 strb r2, [r1] ldr r3, =0x000006c6 adds r0, r3 strb r2, [r0] b @080AB53C .align 2, 0 .pool @080AB4D0: bl sub_80AB5AC lsls r0, 24 cmp r0, 0 bne @080AB53C ldr r1, =0x02038454 movs r0, 0xD8 lsls r0, 3 adds r2, r1, r0 movs r0, 0xFA strb r0, [r2] ldr r2, =0x000006c6 adds r1, r2 b @080AB538 .align 2, 0 .pool @080AB4F4: bl sub_80AB604 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 bne @080AB53C ldr r0, =0x02038454 movs r3, 0xD8 lsls r3, 3 adds r1, r0, r3 strb r2, [r1] ldr r1, =0x000006c6 adds r0, r1 movs r1, 0x3 strb r1, [r0] b @080AB53C .align 2, 0 .pool @080AB51C: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080AB53C ldr r3, =0x000006c1 adds r0, r2, r3 ldrb r1, [r0] subs r3, 0x1 adds r0, r2, r3 strb r1, [r0] ldr r0, =0x000006c6 adds r1, r2, r0 @080AB538: movs r0, 0x3 strb r0, [r1] @080AB53C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AB434 thumb_func_start sub_80AB54C sub_80AB54C: ; 80AB54C push {r4,lr} sub sp, 0x4 ldr r2, =0x02038454 ldr r0, =0x000006c7 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, =0x000006c4 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 .pool @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, =0x02038454 ldr r0, =0x000006c7 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, =0x000006c4 adds r2, r3 ldrh r2, [r2] bl sub_80AB990 movs r0, 0x1 b @080AB5FE .align 2, 0 .pool @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, =0x02038454 ldr r1, =0x000006c7 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, =0x000006c4 adds r1, r2, r3 ldrh r1, [r1] bl sub_80ABAB0 movs r0, 0x1 b @080AB63A .align 2, 0 .pool @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, =0x03000f50 ldr r0, [r0] adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @080AB6C0 lsls r1, r6, 1 ldr r0, =0x02037714 adds r0, r1, r0 ldr r2, =0x02037b14 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 .pool @080AB6C0: cmp r0, 0x2 beq @080AB6D4 adds r1, r4, 0 subs r1, 0x10 ldr r2, =0x02038454 ldr r3, =0x000006d5 adds r0, r2, r3 ldrb r0, [r0] cmp r1, r0 bne @080AB6E4 @080AB6D4: ldr r0, =0x020388b4 b @080AB6EA .align 2, 0 .pool @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, =0x02037b14 mov r10, r3 @080AB6FE: adds r2, r6, 0 lsls r0, r2, 1 ldr r1, =0x02037714 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 .pool @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, =0x03000f50 ldr r0, [r0] adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @080AB7AC lsls r1, r6, 1 ldr r0, =0x02037714 adds r0, r1, r0 ldr r2, =0x02037b14 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 .pool @080AB7AC: movs r7, 0 mov r0, r9 lsls r0, 16 mov r8, r0 adds r4, 0x1 mov r12, r4 ldr r1, =gUnknown_0854014C mov r10, r1 ldr r2, [sp] lsls r0, r2, 24 asrs r5, r0, 11 @080AB7C2: lsls r0, r6, 1 ldr r3, =0x02037b14 adds r4, r0, r3 ldr r1, =0x02037714 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 .pool @080AB81C: lsls r1, r4, 5 ldr r0, =0x02037714 adds r0, r1, r0 ldr r2, =0x02037b14 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 .pool 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, =0x03000f50 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 .pool @080AB8D4: cmp r0, 0x1 bne @080AB8E4 ldr r0, =0x02038654 ldr r1, [sp, 0x10] adds r5, r1, r0 b @080AB8EA .align 2, 0 .pool @080AB8E4: ldr r0, =0x020388b4 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, =0x02037714 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, =0x02037b14 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 .pool 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, =0x03000f50 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 .pool @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, =0x02037714 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, =gUnknown_0854014C 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, =0x02037b14 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 .pool 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, =0x02037714 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, =0x02037b14 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 .pool @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, =0x02038454 ldr r0, =0x000006fa adds r1, r3, r0 ldrb r0, [r1] cmp r0, 0x5 bhi @080ABBEE ldr r4, =0x000006f4 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 .pool 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, =0x02038454 ldr r4, =0x000006fa adds r0, r2, r4 ldrb r0, [r0] cmp r1, r0 bcs @080ABC3E ldr r5, =0x000006f4 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 .pool @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, =0x02038454 ldr r1, =0x000006c6 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 .pool 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, =0x02038454 ldr r0, =0x000006c6 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, =0x000006c2 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 .pool 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, =0x0000ffff movs r1, 0 b @080ABD10 .align 2, 0 .pool @080ABD08: movs r4, 0 b @080ABD0E @080ABD0C: ldr r4, =0x0000ffff @080ABD0E: movs r1, 0x1 @080ABD10: ldr r0, =0x02038454 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 .pool @080ABD38: movs r2, 0 @080ABD3A: cmp r1, 0 beq @080ABD7C cmp r2, 0 beq @080ABD4E ldr r0, =0x02037b14 ldr r1, =0x02037714 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, =0x02038454 ldr r3, =0x000006c6 adds r0, r3 movs r1, 0x2 strb r1, [r0] b @080ABDE4 .align 2, 0 .pool @080ABD7C: ldr r1, =0x02038454 ldr r3, =0x000006c4 adds r0, r1, r3 strh r4, [r0] cmp r2, 0 beq @080ABDA0 ldr r0, =0x000006c7 adds r1, r0 movs r0, 0 strb r0, [r1] b @080ABDB2 .align 2, 0 .pool @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, =0x02038454 ldr r1, =0x000006c6 adds r0, r4, r1 movs r1, 0 movs r5, 0x1 strb r5, [r0] ldr r2, =0x000006ca adds r0, r4, r2 strb r5, [r0] ldr r3, =0x000006cb 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 .pool thumb_func_end fade_screen thumb_func_start sub_80ABDFC sub_80ABDFC: ; 80ABDFC ldr r0, =0x02038454 ldr r1, =0x000006c6 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 .pool 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, =0x02038454 ldr r2, =0x000006c6 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 .pool @080ABE60: ldr r2, =0x000006ca 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, =0x02037b14 ldr r0, =0x000006c4 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 .pool @080ABEAC: lsls r0, r4, 20 lsrs r4, r0, 16 lsls r1, r4, 1 ldr r0, =0x02037b14 adds r0, r1, r0 ldr r2, =0x02037714 adds r1, r2 movs r2, 0x8 bl CpuFastSet ldr r0, =0x02037fd4 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 .pool @080ABEE4: lsls r0, r4, 20 lsrs r4, r0, 16 ldr r3, =0x000073fc 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 .pool thumb_func_end sub_80ABE18 thumb_func_start sub_80ABF00 sub_80ABF00: ; 80ABF00 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02038454 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 .pool thumb_func_end sub_80ABF00 thumb_func_start sub_80ABF20 sub_80ABF20: ; 80ABF20 push {lr} ldr r1, =0x02038454 ldr r2, =0x000006c6 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x1 beq @080ABF3C movs r0, 0 b @080ABF42 .align 2, 0 .pool @080ABF3C: ldr r2, =0x000006ca adds r0, r1, r2 ldrb r0, [r0] @080ABF42: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80ABF20 thumb_func_start sub_80ABF4C sub_80ABF4C: ; 80ABF4C push {r4,lr} ldr r4, =0x02038454 ldr r1, =0x000006d4 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 .pool 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, =0x02038454 ldr r2, =0x0000074d adds r1, r0, r2 movs r2, 0x1 strb r2, [r1] ldr r1, =0x0000074e adds r0, r1 strb r2, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80ABF84 thumb_func_start sub_80ABFA4 sub_80ABFA4: ; 80ABFA4 push {r4,lr} ldr r1, =0x02038454 ldr r0, =0x0000074d adds r4, r1, r0 movs r0, 0 ldrsb r0, [r4, r0] cmp r0, 0x1F bgt @080ABFD8 ldr r0, =0x0000074e 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 .pool @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, =0x02038454 ldr r2, =0x0000073c 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, =0x0000073e adds r1, r0 strh r2, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80ABFF0 thumb_func_start sub_80AC01C sub_80AC01C: ; 80AC01C push {r4-r7,lr} ldr r5, =0x02038454 ldr r0, =0x00000742 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 .pool @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, =0x0000073c 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, =0x0000073e adds r0, r5, r3 strh r1, [r0] movs r0, 0x1 strh r0, [r7] movs r0, 0x3C strh r0, [r6] b @080AC118 .align 2, 0 .pool @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, =gUnknown_08329F40 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, =0x0000073c adds r6, r5, r2 adds r2, r0, 0 strh r0, [r6] ldr r3, =0x0000073e 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 .pool @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, =0x0000073c 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 .pool 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, =0x02038454 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, =0x00000736 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 .pool 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, =0x02038454 ldr r5, =0x00000734 adds r4, r3, r5 movs r5, 0 strh r0, [r4] ldr r4, =0x00000736 adds r0, r3, r4 strh r1, [r0] ldr r1, =0x0000073a 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 .pool thumb_func_end sub_80AC164 thumb_func_start sub_80AC1A8 sub_80AC1A8: ; 80AC1A8 push {r4-r6,lr} ldr r0, =0x02038454 movs r1, 0xE6 lsls r1, 3 adds r3, r0, r1 ldr r2, [r3] ldr r6, =0x00000734 adds r4, r0, r6 ldr r1, [r4] adds r5, r0, 0 cmp r2, r1 beq @080AC26C ldr r0, =0x00000739 adds r2, r5, r0 ldrb r0, [r2] adds r0, 0x1 strb r0, [r2] ldr r6, =0x0000073a 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 .pool @080AC210: ldr r1, =0x00000732 adds r3, r5, r1 ldr r2, =0x00000736 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 .pool @080AC230: cmp r2, r0 bls @080AC238 subs r0, r1, 0x1 @080AC236: strh r0, [r3] @080AC238: ldr r6, =0x00000732 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, =0x00000734 adds r0, r5, r2 ldr r0, [r0] cmp r1, r0 beq @080AC26C movs r0, 0 b @080AC26E .align 2, 0 .pool @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, =@080AC290 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02038454 movs r1, 0xDA lsls r1, 3 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x02038454 ldr r3, =0x000006c6 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 .pool @080AC344: cmp r2, 0x55 bne @080AC36E ldr r0, =0x000006dd adds r1, r0 movs r0, 0 b @080AC366 .align 2, 0 .pool @080AC354: ldr r3, =0x000006dd adds r1, r3 movs r0, 0x1 b @080AC366 .align 2, 0 .pool @080AC360: ldr r0, =0x000006dd 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 .pool 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, =0x02038454 ldr r1, =0x000006dd 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 .pool @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, =0x02038454 ldr r1, =0x000006d3 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80AC3BC thumb_func_start sub_80AC3D0 sub_80AC3D0: ; 80AC3D0 ldr r0, =0x02038454 ldr r1, =0x000006c6 adds r0, r1 movs r1, 0x2 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80AC3D0 thumb_func_start sub_80AC3E4 sub_80AC3E4: ; 80AC3E4 ldr r0, =0x02038454 ldr r1, =0x000006c6 adds r0, r1 movs r1, 0x3 strb r1, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_0854C250 ldr r5, =0x02038ba4 adds r1, r5, 0 movs r2, 0x10 bl CpuSet adds r4, r5 movs r0, 0 strb r0, [r4] ldr r0, =0x03000f50 str r5, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AC3F8 thumb_func_start sub_80AC428 sub_80AC428: ; 80AC428 ldr r1, =0x03000f50 ldr r0, =gUnknown_0854C250 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80AC428 thumb_func_start sub_80AC438 sub_80AC438: ; 80AC438 push {lr} ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r2, =0x000006c1 adds r1, r0, r2 movs r2, 0 strb r2, [r1] ldr r1, =0x000006c2 adds r3, r0, r1 movs r1, 0x14 strb r1, [r3] ldr r3, =0x000006d2 adds r1, r0, r3 strb r2, [r1] subs r3, 0x6 adds r1, r0, r3 strh r2, [r1] ldr r1, =0x000006de 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 .pool thumb_func_end sub_80AC438 thumb_func_start sub_80AC484 sub_80AC484: ; 80AC484 push {r4,lr} bl sub_80AC438 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool thumb_func_end sub_80AC484 thumb_func_start sub_80AC4B4 sub_80AC4B4: ; 80AC4B4 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r5, [r0] ldr r0, =0x000006cc 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 .pool @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, =0x000006d2 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 .pool thumb_func_end sub_80AC4B4 thumb_func_start sub_80AC514 sub_80AC514: ; 80AC514 push {r4,lr} ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006ce 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 .pool @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, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006c1 adds r2, r1, r0 movs r0, 0 strb r0, [r2] ldr r0, =0x000006c2 adds r1, r0 movs r0, 0x14 strb r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006de adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @080AC650 ldr r0, =gUnknown_0854FB5C bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_0854C290 bl sub_80ABF4C movs r5, 0 @080AC5B2: ldr r0, =gUnknown_0854FB78 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, =gUnknown_0854C14C 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, =0x02020630 adds r4, r0 str r4, [r1] ldr r0, =gUnknown_0854FB50 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 .pool @080AC628: ldr r0, =gUnknown_0854C14C 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, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006de adds r0, r1 movs r1, 0x1 strb r1, [r0] @080AC650: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AC594 thumb_func_start sub_80AC660 sub_80AC660: ; 80AC660 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006de 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, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006de adds r0, r1 movs r1, 0 strb r1, [r0] @080AC6A4: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006cc adds r3, r1, r0 movs r2, 0 movs r0, 0 strh r0, [r3] ldr r3, =0x000006d2 adds r0, r1, r3 strb r2, [r0] subs r3, 0x11 adds r0, r1, r3 strb r2, [r0] ldr r0, =0x000006c2 adds r1, r0 strb r2, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80AC6D0 thumb_func_start sub_80AC704 sub_80AC704: ; 80AC704 push {r4,lr} bl sub_80AC6D0 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool thumb_func_end sub_80AC704 thumb_func_start sub_80AC734 sub_80AC734: ; 80AC734 push {lr} ldr r1, =gUnknown_0854C14C ldr r0, [r1] ldr r2, =0x000006cc adds r0, r2 ldrh r0, [r0] adds r2, r1, 0 cmp r0, 0x4 bhi @080AC810 lsls r0, 2 ldr r1, =@080AC75C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080AC75C: .4byte @080AC770 .4byte @080AC78C .4byte @080AC7A4 .4byte @080AC7C0 .4byte @080AC7D8 @080AC770: ldr r1, [r2] ldr r2, =0x000006c6 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080AC814 ldr r0, =0x000006cc adds r1, r0 b @080AC7F8 .align 2, 0 .pool @080AC78C: bl sub_80ABF84 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006cc adds r1, r2 b @080AC7F8 .align 2, 0 .pool @080AC7A4: bl sub_80ABFA4 lsls r0, 24 cmp r0, 0 bne @080AC814 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006cc adds r1, r0 b @080AC7F8 .align 2, 0 .pool @080AC7C0: bl sub_80ABFF0 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006cc adds r1, r2 b @080AC7F8 .align 2, 0 .pool @080AC7D8: bl sub_80AC01C ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r1, =0x0000073c adds r0, r2, r1 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x6 bne @080AC814 ldr r0, =0x000006d2 adds r1, r2, r0 movs r0, 0x1 strb r0, [r1] ldr r0, =0x000006cc adds r1, r2, r0 @080AC7F8: ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @080AC814 .align 2, 0 .pool @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, =task50_0807B6D4 movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x4 bhi @080AC922 lsls r0, 2 ldr r1, =@080AC85C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x04000048 ldrh r0, [r0] strh r0, [r4, 0xE] ldr r1, =0x00003f3f 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 .pool @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, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006cc adds r0, r1, r2 movs r3, 0 movs r2, 0 strh r2, [r0] ldr r4, =0x000006d2 adds r0, r1, r4 strb r3, [r0] adds r4, 0x4 adds r0, r1, r4 strh r2, [r0] ldr r0, =0x000006db adds r2, r1, r0 movs r0, 0x8 strb r0, [r2] ldr r2, =0x000006dc adds r0, r1, r2 strb r3, [r0] adds r4, 0x3 adds r2, r1, r4 movs r0, 0xA strb r0, [r2] ldr r0, =0x000006c1 adds r2, r1, r0 movs r0, 0x3 strb r0, [r2] ldr r2, =0x000006c2 adds r1, r2 movs r0, 0x14 strb r0, [r1] movs r0, 0x55 bl sub_80AC31C pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AC928 thumb_func_start sub_80AC994 sub_80AC994: ; 80AC994 push {r4,lr} bl sub_80AC928 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool thumb_func_end sub_80AC994 thumb_func_start sub_80AC9C4 sub_80AC9C4: ; 80AC9C4 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r5, [r0] ldr r0, =0x000006cc 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 .pool @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, =0x000006d2 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 .pool thumb_func_end sub_80AC9C4 thumb_func_start sub_80ACA24 sub_80ACA24: ; 80ACA24 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r1, =0x000006ce 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 .pool @080ACA48: ldr r5, =0x000006d1 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, =0x000006ce adds r0, r1 movs r1, 0xFF strh r1, [r0] movs r0, 0 b @080ACAAA .align 2, 0 .pool @080ACA70: ldr r4, =0x000006d9 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, =gUnknown_0854C14C ldr r1, [r0] ldr r5, =0x000006ce adds r1, r5 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] movs r0, 0 b @080ACAAA .align 2, 0 .pool @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, =0x00000169 strh r0, [r7, 0x30] @080ACAC4: movs r2, 0x30 ldrsh r1, [r7, r2] ldr r0, =0x41c64e6d muls r0, r1 ldr r3, =0x00003039 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, =gUnknown_0854FC4C ldr r0, =gUnknown_0854C14C ldr r5, [r0] ldr r2, =0x000006dc 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, =gUnknown_0854FC44 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 .pool 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, =gUnknown_0854FC44 ldr r4, =gUnknown_0854C14C ldr r2, [r4] ldr r0, =0x000006dc 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 .pool @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, =0x000006dc 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, =0x02021bbc ldrh r0, [r5, 0x20] ldrh r1, [r1] subs r0, r1 strh r0, [r5, 0x20] ldr r1, =0x02021bbe 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 .pool @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, =sub_80ACB84 str r0, [r4, 0x1C] b @080ACCAC .align 2, 0 .pool @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, =gUnknown_0854FC4C ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006dc 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, =0x0000ffff 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, =0x0000ffff 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 .pool @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, =gUnknown_0854FC54 bl gpu_tile_obj_alloc_tag_and_copy_to_vram pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0854C14C ldr r4, [r0] ldr r0, =0x000006da adds r2, r4, r0 ldrb r0, [r2] cmp r0, 0x18 bne @080ACD92 b @080ACE98 @080ACD92: ldrb r7, [r2] ldr r0, =gUnknown_0854FC2C ldr r2, =gUnknown_0854FB90 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, =0x02020630 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, =0x00000257 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, =0x02020630 adds r0, r6 ldr r3, =0xfffffda8 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, =gUnknown_0854C14C ldr r0, [r0] add r0, r10 str r4, [r0] b @080ACE46 .align 2, 0 .pool @080ACE40: adds r1, r4, r6 movs r0, 0 str r0, [r1] @080ACE46: ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r6, =0x000006da 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, =sub_80ACB84 ldr r4, =sub_80ACC88 @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 .pool @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, =gUnknown_0854C14C ldr r3, [r0] movs r0, 0xDB lsls r0, 3 adds r4, r3, r0 ldr r1, =0x000006d9 adds r5, r3, r1 ldrb r0, [r4] ldrb r7, [r5] cmp r0, r7 bne @080ACED0 movs r0, 0 b @080ACF32 .align 2, 0 .pool @080ACED0: ldr r0, =0x000006d6 adds r2, r3, r0 ldrh r0, [r2] adds r0, 0x1 movs r6, 0 strh r0, [r2] ldr r7, =0x000006db 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 .pool @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, =gUnknown_0854C14C ldr r2, [r0] ldr r3, =0x000006da 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, =0x000006da adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, =0x00001206 bl gpu_tile_obj_free_by_tag pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ACF38 thumb_func_start sub_80ACF8C sub_80ACF8C: ; 80ACF8C push {r4,lr} ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006cc adds r0, r1, r2 movs r2, 0 movs r3, 0 strh r3, [r0] ldr r4, =0x000006d2 adds r0, r1, r4 strb r2, [r0] ldr r0, =0x000006c1 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, =0x000006e5 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 .pool 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, =gUnknown_0854C14C ldr r1, [r2] ldr r3, =0x000006d2 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, =0x000006e4 adds r0, r3 ldrb r0, [r0] cmp r4, r0 bcs @080AD02C ldr r0, =gUnknown_0854C14C 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 .pool thumb_func_end sub_80ACFDC thumb_func_start snowflakes_progress2 snowflakes_progress2: ; 80AD048 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r5, [r0] ldr r0, =0x000006cc 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, =0x000006d2 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 .pool thumb_func_end snowflakes_progress2 thumb_func_start sub_80AD084 sub_80AD084: ; 80AD084 push {r4,lr} ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r0, =0x000006ce 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 .pool @080AD0A4: ldr r4, =0x000006e5 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, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006ce adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] movs r0, 0 b @080AD0E2 .align 2, 0 .pool @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, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006e4 adds r3, r1, r0 ldr r4, =0x000006e5 adds r2, r1, r4 ldrb r0, [r3] ldrb r4, [r2] cmp r0, r4 bne @080AD110 movs r0, 0 b @080AD152 .align 2, 0 .pool @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, =gUnknown_0854C14C ldr r0, [r0] ldr r2, =0x000006e4 adds r1, r0, r2 ldr r4, =0x000006e5 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 .pool thumb_func_end snowflakes_progress thumb_func_start snowflake_add snowflake_add: ; 80AD164 push {r4-r6,lr} ldr r0, =gUnknown_0854FC8C 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, =0x02020630 lsls r4, r1, 4 adds r4, r1 lsls r4, 2 adds r4, r0 ldr r0, =gUnknown_0854C14C ldr r5, [r0] ldr r0, =0x000006e4 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 .pool @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, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006e4 adds r2, r1, r0 ldrb r0, [r2] cmp r0, 0 bne @080AD1EC movs r0, 0 b @080AD200 .align 2, 0 .pool @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, =0x02021bbe 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, =0x02021bbc 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 .pool thumb_func_end sub_80AD204 thumb_func_start sub_80AD2B0 sub_80AD2B0: ; 80AD2B0 push {r4,lr} adds r3, r0, 0 ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006e2 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, =sub_80AD30C str r0, [r3, 0x1C] ldr r1, =0x02021bbe 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 .pool 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, =gUnknown_08329F40 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, =0x02021bbc ldrh r1, [r1] adds r3, r1, r0 ldr r2, =0x000001ff 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, =0xffffff00 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 .pool @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, =0x02021bbe 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 .pool @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, =sub_80AD2B0 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, =sub_80AD2B0 str r0, [r4, 0x1C] @080AD438: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AD30C thumb_func_start sub_80AD444 sub_80AD444: ; 80AD444 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006cc adds r0, r1, r2 movs r3, 0 movs r2, 0 strh r2, [r0] ldr r5, =0x000006d2 adds r4, r1, r5 strb r3, [r4] adds r5, 0x4 adds r0, r1, r5 strh r2, [r0] ldr r0, =0x000006db adds r2, r1, r0 movs r0, 0x4 strb r0, [r2] ldr r2, =0x000006dc adds r0, r1, r2 strb r3, [r0] adds r5, 0x3 adds r2, r1, r5 movs r0, 0x10 strb r0, [r2] ldr r0, =0x000006c1 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, =0x000006ed adds r1, r0 strb r3, [r1] movs r0, 0x51 bl sub_80AC31C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AD444 thumb_func_start sub_80AD4B8 sub_80AD4B8: ; 80AD4B8 push {r4,lr} bl sub_80AD444 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool thumb_func_end sub_80AD4B8 thumb_func_start sub_80AD4E8 sub_80AD4E8: ; 80AD4E8 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006cc adds r0, r1, r2 movs r4, 0 movs r2, 0 strh r2, [r0] ldr r5, =0x000006d2 adds r3, r1, r5 strb r4, [r3] adds r5, 0x4 adds r0, r1, r5 strh r2, [r0] ldr r0, =0x000006db 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, =0x000006d9 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, =0x000006c2 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 .pool thumb_func_end sub_80AD4E8 thumb_func_start sub_80AD554 sub_80AD554: ; 80AD554 push {r4,lr} bl sub_80AD4E8 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool thumb_func_end sub_80AD554 thumb_func_start sub_80AD584 sub_80AD584: ; 80AD584 push {r4,r5,lr} bl sub_80AD9F8 ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006cc adds r0, r1 ldrh r0, [r0] cmp r0, 0xE bls @080AD59A b @080AD8FA @080AD59A: lsls r0, 2 ldr r1, =@080AD5B0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006cc adds r1, r2 ldrh r0, [r1] adds r0, 0x1 b @080AD8F8 .align 2, 0 .pool @080AD608: bl sub_80ACD78 lsls r0, 24 cmp r0, 0 beq @080AD614 b @080AD8FA @080AD614: ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r3, =0x000006cc adds r1, r3 ldrh r0, [r1] adds r0, 0x1 b @080AD8F8 .align 2, 0 .pool @080AD62C: bl sub_80ACEAC lsls r0, 24 cmp r0, 0 beq @080AD638 b @080AD8FA @080AD638: ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006d2 adds r2, r1, r0 movs r0, 0x1 strb r0, [r2] ldr r2, =0x000006cc adds r1, r2 ldrh r0, [r1] adds r0, 0x1 b @080AD8F8 .align 2, 0 .pool @080AD65C: ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r3, =0x000006c6 adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @080AD66C b @080AD8FA @080AD66C: ldr r0, =0x000006cc adds r1, r0 movs r0, 0x6 b @080AD8F8 .align 2, 0 .pool @080AD680: ldr r0, =gUnknown_0854C14C ldr r4, [r0] ldr r2, =0x000006ea 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, =0x000006e6 adds r1, r4, r3 strh r0, [r1] ldr r0, =0x000006cc adds r4, r0 ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @080AD6B0: ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r3, =0x000006e6 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, =0x000006cc adds r1, r2, r0 ldrh r0, [r1] adds r0, 0x1 b @080AD8F8 .align 2, 0 .pool @080AD6E0: ldr r0, =gUnknown_0854C14C ldr r4, [r0] ldr r1, =0x000006ea adds r0, r4, r1 movs r5, 0x1 strb r5, [r0] bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 ands r0, r5 ldr r2, =0x000006eb adds r1, r4, r2 strb r0, [r1] b @080AD768 .align 2, 0 .pool @080AD70C: bl GenerateRandomNumber ldr r1, =gUnknown_0854C14C ldr r2, [r1] movs r1, 0x1 ands r1, r0 adds r1, 0x1 ldr r3, =0x000006ec adds r0, r2, r3 strb r1, [r0] ldr r0, =0x000006cc adds r2, r0 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] @080AD72A: movs r0, 0x13 bl sub_80ABC48 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006eb adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 bne @080AD74E ldr r3, =0x000006ec adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0x1 bne @080AD74E movs r0, 0x14 bl sub_80AD9BC @080AD74E: bl GenerateRandomNumber ldr r1, =gUnknown_0854C14C ldr r4, [r1] lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 adds r0, 0x6 ldr r2, =0x000006e6 adds r1, r4, r2 strh r0, [r1] @080AD768: ldr r3, =0x000006cc adds r4, r3 ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] b @080AD8FA .align 2, 0 .pool @080AD788: ldr r0, =gUnknown_0854C14C ldr r4, [r0] ldr r0, =0x000006e6 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, =0x000006ea adds r1, r4, r2 movs r0, 0x1 strb r0, [r1] ldr r3, =0x000006ec 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, =0x000006cc adds r1, r4, r0 movs r0, 0xA b @080AD8F8 .align 2, 0 .pool @080AD7E8: ldr r1, =0x000006eb adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 bne @080AD800 ldr r2, =0x000006cc adds r1, r4, r2 b @080AD8F6 .align 2, 0 .pool @080AD800: ldr r3, =0x000006cc adds r1, r4, r3 movs r0, 0xB b @080AD8F8 .align 2, 0 .pool @080AD80C: ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r0, =0x000006e6 adds r1, r2, r0 ldrh r0, [r1] subs r0, 0x1 strh r0, [r1] lsls r0, 16 cmp r0, 0 bne @080AD8FA ldr r3, =0x000006cc adds r1, r2, r3 movs r0, 0x8 b @080AD8F8 .align 2, 0 .pool @080AD834: bl GenerateRandomNumber ldr r1, =gUnknown_0854C14C ldr r2, [r1] lsls r0, 16 lsrs r0, 16 movs r1, 0xF ands r0, r1 adds r0, 0x3C ldr r3, =0x000006e6 adds r1, r2, r3 strh r0, [r1] ldr r0, =0x000006cc adds r2, r0 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] b @080AD8FA .align 2, 0 .pool @080AD864: ldr r0, =gUnknown_0854C14C ldr r5, [r0] ldr r1, =0x000006e6 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, =0x000006cc adds r1, r5, r2 ldrh r0, [r1] adds r0, 0x1 b @080AD8F8 .align 2, 0 .pool @080AD8A8: ldr r0, =gUnknown_0854C14C ldr r4, [r0] ldr r3, =0x000006e6 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, =0x000006cc adds r1, r4, r0 ldrh r0, [r1] adds r0, 0x1 b @080AD8F8 .align 2, 0 .pool @080AD8DC: ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r1, =0x000006c6 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x3 bne @080AD8FA ldr r3, =0x000006ea adds r1, r2, r3 movs r0, 0x1 strb r0, [r1] ldr r0, =0x000006cc adds r1, r2, r0 @080AD8F6: movs r0, 0x4 @080AD8F8: strh r0, [r1] @080AD8FA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AD584 thumb_func_start sub_80AD910 sub_80AD910: ; 80AD910 push {r4-r6,lr} ldr r0, =gUnknown_0854C14C ldr r6, [r0] ldr r0, =0x000006ce 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 .pool @080AD934: cmp r1, 0x2 beq @080AD990 b @080AD9AC @080AD93A: ldr r2, =0x000006ea adds r0, r6, r2 strb r1, [r0] ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] @080AD946: bl sub_80AD584 ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r1, =0x000006ea 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, =0x000006d9 adds r1, r2, r0 movs r0, 0 strb r0, [r1] ldr r0, =0x000006ce adds r1, r2, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @080AD9B4 .align 2, 0 .pool @080AD990: bl sub_80ACEAC lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @080AD9B4 bl sub_80ACF38 ldr r1, =0x000006ed 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 .pool @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, =gUnknown_0854C14C ldr r4, [r0] ldr r0, =0x000006ed 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 .pool thumb_func_end sub_80AD9BC thumb_func_start sub_80AD9F8 sub_80AD9F8: ; 80AD9F8 push {r4,lr} ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006ed 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 .pool @080ADA38: movs r0, 0x58 bl audio_play @080ADA3E: ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006ed adds r0, r1 movs r1, 0 strb r1, [r0] b @080ADA58 .align 2, 0 .pool @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, =gUnknown_0854C14C ldr r3, [r0] ldr r0, =0x000006cc adds r1, r3, r0 movs r2, 0 movs r0, 0 strh r0, [r1] ldr r1, =0x000006d2 adds r0, r3, r1 strb r2, [r0] subs r1, 0x11 adds r0, r3, r1 strb r2, [r0] ldr r2, =0x000006c2 adds r1, r3, r2 movs r0, 0x14 strb r0, [r1] ldr r1, =0x000006fb 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 .pool thumb_func_end sub_80ADA60 thumb_func_start sub_80ADAC0 sub_80ADAC0: ; 80ADAC0 push {r4,lr} bl sub_80ADA60 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool thumb_func_end sub_80ADAC0 thumb_func_start sub_80ADAF0 sub_80ADAF0: ; 80ADAF0 push {r4-r6,lr} ldr r0, =gUnknown_0854C14C ldr r6, [r0] ldr r0, =0x02021bbc ldr r1, =0x000006f2 adds r2, r6, r1 ldrh r0, [r0] ldrh r1, [r2] subs r0, r1 movs r1, 0xFF ands r0, r1 ldr r3, =0x000006ee 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, =0x000006cc adds r5, r6, r1 ldrh r4, [r5] cmp r4, 0 beq @080ADB50 cmp r4, 0x1 beq @080ADB90 b @080ADBA6 .align 2, 0 .pool @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, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006cc adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @080ADBA6 .align 2, 0 .pool @080ADB90: bl sub_80AC1A8 lsls r0, 24 cmp r0, 0 beq @080ADBA6 ldr r1, =0x000006d2 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 .pool thumb_func_end sub_80ADAF0 thumb_func_start sub_80ADBB0 sub_80ADBB0: ; 80ADBB0 push {r4,lr} ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r0, =0x02021bbc ldr r1, =0x000006f2 adds r3, r2, r1 ldrh r0, [r0] ldrh r1, [r3] subs r0, r1 movs r1, 0xFF ands r0, r1 ldr r4, =0x000006ee 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, =0x000006ce 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 .pool @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, =0x02021bbe ldrb r0, [r0] strh r0, [r3, 0x26] ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006ee 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, =0x010f0000 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, =0x000001ff ands r1, r0 strh r1, [r3, 0x20] @080ADC90: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ADC4C thumb_func_start sub_80ADCAC sub_80ADCAC: ; 80ADCAC push {r4,r5,lr} sub sp, 0x8 ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006fb adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080ADD56 ldr r0, =gUnknown_0854FD30 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, =gUnknown_0854FD18 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, =0x02020630 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, =gUnknown_0854C14C ldr r0, [r2] lsls r1, r5, 2 adds r0, 0xA0 adds r0, r1 str r4, [r0] b @080ADD42 .align 2, 0 .pool @080ADD34: ldr r2, =gUnknown_0854C14C 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, =0x000006fb adds r0, r1 movs r1, 0x1 strb r1, [r0] @080ADD56: add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ADCAC thumb_func_start sub_80ADD68 sub_80ADD68: ; 80ADD68 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006fb 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, =0x00001201 bl gpu_tile_obj_free_by_tag ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006fb adds r0, r1 movs r1, 0 strb r1, [r0] @080ADDA8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ADD68 thumb_func_start sub_80ADDBC sub_80ADDBC: ; 80ADDBC push {lr} ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006cc adds r2, r1, r0 movs r3, 0 movs r0, 0 strh r0, [r2] ldr r2, =0x000006d2 adds r0, r1, r2 strb r3, [r0] subs r2, 0x11 adds r0, r1, r2 strb r3, [r0] ldr r3, =0x000006c2 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 .pool thumb_func_end sub_80ADDBC thumb_func_start sub_80ADE18 sub_80ADE18: ; 80ADE18 push {r4,lr} bl sub_80ADDBC ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool thumb_func_end sub_80ADE18 thumb_func_start sub_80ADE48 sub_80ADE48: ; 80ADE48 push {r4,r5,lr} ldr r2, =gUnknown_0854C14C ldr r1, [r2] ldr r0, =0x02021bbc ldrh r0, [r0] ldr r3, =0x000001ff ands r3, r0 ldr r0, =0x000006fc 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, =0x000006cc 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 .pool @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, =0x000006d2 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 .pool @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, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006ce 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 .pool @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, =gUnknown_0854FD38 bl gpu_tile_obj_alloc_tag_and_copy_to_vram pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ADF5C thumb_func_start sub_80ADF6C sub_80ADF6C: ; 80ADF6C push {r4,r5,lr} ldr r0, =gUnknown_0854C14C 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, =gUnknown_0854FD58 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, =0x02020630 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, =gUnknown_0854C14C ldr r0, [r2] lsls r1, r5, 2 adds r0, 0xF0 adds r0, r1 str r4, [r0] b @080ADFF2 .align 2, 0 .pool @080ADFE4: ldr r2, =gUnknown_0854C14C 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 .pool thumb_func_end sub_80ADF6C thumb_func_start sub_80AE014 sub_80AE014: ; 80AE014 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C 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, =0x00001202 bl gpu_tile_obj_free_by_tag ldr r0, =gUnknown_0854C14C 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 .pool 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, =0x02021bbe ldrh r0, [r3, 0x2E] ldrh r1, [r1] adds r0, r1 strh r0, [r3, 0x22] ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006fc 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, =0x010f0000 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, =0x000001ff ands r1, r0 strh r1, [r3, 0x20] @080AE0C8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AE068 thumb_func_start sub_80AE0E4 sub_80AE0E4: ; 80AE0E4 push {r4,lr} ldr r0, =gUnknown_0854C14C ldr r3, [r0] ldr r1, =0x000006cc adds r0, r3, r1 movs r1, 0 movs r2, 0 strh r2, [r0] ldr r4, =0x000006d2 adds r0, r3, r4 strb r1, [r0] subs r4, 0x11 adds r0, r3, r4 strb r1, [r0] ldr r0, =0x000006c2 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, =0x00000724 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 .pool thumb_func_end sub_80AE0E4 thumb_func_start sub_80AE168 sub_80AE168: ; 80AE168 push {r4,lr} bl sub_80AE0E4 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool thumb_func_end sub_80AE168 thumb_func_start sub_80AE198 sub_80AE198: ; 80AE198 push {r4,r5,lr} bl sub_80AE25C ldr r0, =gUnknown_0854C14C ldr r5, [r0] ldr r0, =0x000006cc 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 .pool @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, =0x000006d2 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 .pool thumb_func_end sub_80AE198 thumb_func_start sub_80AE1FC sub_80AE1FC: ; 80AE1FC push {r4,lr} bl sub_80AE25C ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006ce 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 .pool @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, =gUnknown_0854C14C ldr r3, [r0] ldr r0, =0x0000071c adds r2, r3, r0 ldrh r0, [r2] adds r0, 0x1 movs r5, 0 strh r0, [r2] ldr r1, =0x0000ffff 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, =0x0000071e adds r2, r3, r1 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] ands r0, r4 cmp r0, 0x4 bls @080AE2A4 ldr r0, =0x00000722 adds r1, r3, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] strh r5, [r2] @080AE2A4: ldr r0, =0x02021bbc 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, =0x02021bbe 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 .pool thumb_func_end sub_80AE25C thumb_func_start sub_80AE2F0 sub_80AE2F0: ; 80AE2F0 push {r4-r6,lr} sub sp, 0x8 ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x00000724 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080AE396 ldr r0, =gUnknown_0854FD70 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, =gUnknown_0854FD8C 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, =0x02020630 adds r4, r0 adds r0, r6, 0 movs r1, 0x5 bl __umodsi3 strh r0, [r4, 0x2E] strh r5, [r4, 0x30] ldr r2, =gUnknown_0854C14C 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 .pool @080AE370: ldr r2, =gUnknown_0854C14C 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, =0x00000724 adds r0, r1 movs r1, 0x1 strb r1, [r0] @080AE396: add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AE2F0 thumb_func_start sub_80AE3A8 sub_80AE3A8: ; 80AE3A8 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x00000724 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, =0x00001203 bl gpu_tile_obj_free_by_tag ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x00000724 adds r0, r1 movs r1, 0 strb r1, [r0] @080AE3EA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AE3A8 thumb_func_start sub_80AE3FC sub_80AE3FC: ; 80AE3FC push {r4,lr} adds r3, r0, 0 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x0000071a 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, =0x010f0000 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, =0x000001ff ands r1, r0 strh r1, [r3, 0x20] @080AE444: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AE3FC thumb_func_start sub_80AE45C sub_80AE45C: ; 80AE45C push {r4,lr} ldr r0, =gUnknown_0854C14C ldr r3, [r0] ldr r0, =0x000006cc adds r1, r3, r0 movs r2, 0 movs r0, 0 strh r0, [r1] ldr r1, =0x000006d2 adds r0, r3, r1 strb r2, [r0] ldr r4, =0x000006c1 adds r0, r3, r4 strb r2, [r0] ldr r0, =0x000006c2 adds r1, r3, r0 movs r0, 0x14 strb r0, [r1] ldr r1, =0x00000716 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, =0x00000712 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 .pool thumb_func_end sub_80AE45C thumb_func_start sub_80AE4DC sub_80AE4DC: ; 80AE4DC push {r4,lr} bl sub_80AE45C ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool 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, =gUnknown_0854C14C ldr r5, [r0] ldr r0, =0x00000712 adds r1, r5, r0 ldrh r0, [r1] cmp r0, 0x5F bls @080AE528 movs r0, 0x20 strh r0, [r1] @080AE528: ldr r0, =0x000006cc 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 .pool @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, =0x000006d2 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 .pool thumb_func_end sub_80AE50C thumb_func_start sub_80AE588 sub_80AE588: ; 80AE588 push {r4,lr} bl sub_80AE624 bl sub_80AE5EC ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x000006ce 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 .pool @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, =gUnknown_0854C14C ldr r2, [r0] ldr r0, =0x00000714 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, =0x00000712 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 .pool thumb_func_end sub_80AE5EC thumb_func_start sub_80AE624 sub_80AE624: ; 80AE624 push {r4-r6,lr} ldr r0, =gUnknown_0854C14C ldr r2, [r0] ldr r0, =0x00000704 adds r4, r2, r0 ldr r6, =gUnknown_08329F40 ldr r1, =0x00000712 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, =0x02021bbc ldr r0, [r4] lsrs r0, 8 ldrh r1, [r1] adds r0, r1 movs r1, 0xFF ands r0, r1 ldr r4, =0x0000070e adds r1, r2, r4 strh r0, [r1] ldr r1, =0x02021bbe 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 .pool thumb_func_end sub_80AE624 thumb_func_start sub_80AE6A4 sub_80AE6A4: ; 80AE6A4 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x00000716 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, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x00000716 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, =0x00001204 bl gpu_tile_obj_free_by_tag @080AE6E6: ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x00000717 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, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x00000717 adds r0, r1 movs r1, 0 strb r1, [r0] @080AE720: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AE6A4 thumb_func_start sub_80AE738 sub_80AE738: ; 80AE738 push {r4-r7,lr} sub sp, 0x4 ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x00000716 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080AE7E6 ldr r0, =gUnknown_0854FDDC bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_0854C2B0 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, =gUnknown_0854FDC4 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, =gUnknown_0854C14C 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, =0x02020630 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 .pool @080AE7C0: ldr r2, =gUnknown_0854C14C 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, =0x00000716 adds r0, r1 movs r1, 0x1 strb r1, [r0] @080AE7E6: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0854C14C ldr r0, [r4] ldr r1, =0x00000717 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, =gUnknown_0854FDC4 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, =0x02020630 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, =0x00006730 strh r0, [r1, 0x36] ldr r1, [r4] ldr r0, =gUnknown_0854FDE4 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, =sub_80AE958 str r0, [r1, 0x1C] b @080AE8CE .align 2, 0 .pool @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, =0x00000717 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 .pool thumb_func_end sub_80AE7F8 thumb_func_start sub_80AE8F8 sub_80AE8F8: ; 80AE8F8 push {r4,lr} adds r3, r0, 0 ldr r0, =gUnknown_0854C14C ldr r1, [r0] movs r2, 0xE2 lsls r2, 3 adds r0, r1, r2 ldrh r0, [r0] strh r0, [r3, 0x26] ldr r4, =0x0000070e 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, =0x010f0000 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, =0x000001ff ands r1, r0 strh r1, [r3, 0x20] @080AE940: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80AE97C str r0, [r2, 0x1C] @080AE972: pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08329F40 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 .pool thumb_func_end sub_80AE97C thumb_func_start sub_80AE9F0 sub_80AE9F0: ; 80AE9F0 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x000006cc adds r2, r1, r0 movs r0, 0 strh r0, [r2] ldr r0, =0x000006c1 adds r2, r1, r0 movs r0, 0x3 strb r0, [r2] ldr r0, =0x000006c2 adds r1, r0 movs r0, 0x14 strb r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_0854C14C ldr r4, [r0] ldr r1, =0x0000072e adds r0, r4, r1 ldrb r5, [r0] cmp r5, 0 bne @080AEA6C ldr r0, =gUnknown_0854FDF8 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, =gUnknown_0854FDF0 ldrb r1, [r0] subs r2, 0x2 adds r0, r4, r2 strh r1, [r0] ldr r1, =0x0000072a 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 .pool thumb_func_end sub_80AEA34 thumb_func_start sub_80AEA88 sub_80AEA88: ; 80AEA88 push {r4,lr} bl sub_80AEA34 ldr r0, =gUnknown_0854C14C ldr r1, [r0] ldr r2, =0x000006d2 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 .pool thumb_func_end sub_80AEA88 thumb_func_start sub_80AEAB8 sub_80AEAB8: ; 80AEAB8 push {r4-r7,lr} bl sub_80ADAF0 ldr r0, =gUnknown_0854C14C ldr r5, [r0] ldr r0, =0x00000726 adds r4, r5, r0 ldrh r0, [r4] adds r0, 0x1 movs r6, 0 strh r0, [r4] ldr r1, =0x0000ffff adds r7, r1, 0 ldr r2, =gUnknown_0854FDF0 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, =0x0000072a 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 .pool 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, =gUnknown_0854FE00 lsrs r0, 14 adds r3, r0, r1 adds r1, 0x2 adds r0, r1 ldr r1, =0x02021bbe ldrh r2, [r0] ldrh r0, [r1] subs r2, r0 ldr r0, =gUnknown_0854FE44 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, =0x02020630 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, =gUnknown_0854C14C ldr r1, [r0] ldr r0, =0x0000072c adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @080AEBB0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AEB48 thumb_func_start sub_80AEBD0 sub_80AEBD0: ; 80AEBD0 push {r4,r5,lr} ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x0000072c adds r0, r1 ldrh r0, [r0] cmp r0, 0 beq @080AEC1A movs r4, 0 ldr r5, =0x02020630 @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, =gUnknown_0854FE44 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, =0x00001205 bl gpu_tile_obj_free_by_tag ldr r0, =gUnknown_0854C14C ldr r0, [r0] ldr r1, =0x0000072c adds r0, r1 movs r1, 0 strh r1, [r0] @080AEC1A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038bc4 strb r0, [r2] ldr r0, =0x02038bc6 strh r1, [r0] bx lr .align 2, 0 .pool 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, =0x03005e08 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 .pool @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, =0x02038bc4 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 .pool @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, =0x02038bc4 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 .pool thumb_func_end sub_80AECA8 thumb_func_start bag_add_task0_by_acit bag_add_task0_by_acit: ; 80AED28 push {lr} ldr r0, =sub_80AECA8 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r1, r0 movs r2, 0x96 lsls r2, 2 adds r0, r2, 0 strh r0, [r1, 0x1E] ldr r3, =0x02038bc4 ldrb r2, [r3] cmp r2, 0xD bne @080AED60 movs r0, 0xC b @080AED66 .align 2, 0 .pool @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, =0x03005d8c 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 .pool thumb_func_end sub_80AED7C thumb_func_start sav1_get_weather_probably sav1_get_weather_probably: ; 80AEDAC ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x2E ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sav1_get_weather_probably thumb_func_start sub_80AEDBC sub_80AEDBC: ; 80AEDBC push {r4,r5,lr} ldr r4, =0x03005d8c ldr r0, [r4] adds r0, 0x2E ldrb r5, [r0] ldr r0, =0x02037318 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 .pool 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, =sub_80AECA8 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080AEE3E bl bag_add_task0_by_acit @080AEE3E: ldr r0, =0x02038bc4 ldrb r4, [r0] b @080AEE6E .align 2, 0 .pool @080AEE4C: ldr r5, =sub_80AECA8 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, =0x02038bc4 movs r0, 0xD strb r0, [r1] @080AEE6E: adds r0, r4, 0 bl weather_set pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80AECA8 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080AEEA2 bl bag_add_task0_by_acit @080AEEA2: ldr r0, =0x02038bc4 ldrb r4, [r0] b @080AEED2 .align 2, 0 .pool @080AEEB0: ldr r5, =sub_80AECA8 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, =0x02038bc4 movs r0, 0xD strb r0, [r1] @080AEED2: adds r0, r4, 0 bl sub_80AB104 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =@080AEF00 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_0854FE5C b @080AEF9E .align 2, 0 .pool @080AEF9C: ldr r1, =gUnknown_0854FE60 @080AEF9E: ldr r0, =0x03005d8c ldr r0, [r0] adds r0, 0x2F ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] b @080AEFB6 .align 2, 0 .pool @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, =0x03005d8c 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 .pool 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, =0x7fff7fff str r0, [sp] ldr r1, =0x02037b14 ldr r2, =0x01000100 mov r0, sp bl CpuFastSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037b14 ldr r2, =0x01000100 mov r0, sp bl CpuFastSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =task0A_nop_for_a_while movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =task0A_asap_script_env_2_enable_and_set_ctx_running movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =task0A_asap_script_env_2_enable_and_set_ctx_running movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =task_mpl_807DD60 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =sub_80AF234 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80AF438 b @080AF37E .align 2, 0 .pool @080AF36C: adds r0, r4, 0 bl sub_8088F58 lsls r0, 24 lsrs r0, 24 ldr r1, =task_map_chg_seq_0807E2CC cmp r0, 0x1 bne @080AF37E ldr r1, =task_map_chg_seq_0807E20C @080AF37E: adds r0, r1, 0 movs r1, 0xA bl AddTask add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =task0A_mpl_807E31C movs r1, 0xA bl AddTask bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool 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, =task_map_chg_seq_0807E2CC movs r1, 0xA bl AddTask bl script_env_2_enable movs r0, 0xE bl sub_8085540 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@080AF46C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037350 adds r0, r1 movs r1, 0x8 bl npc_set_state_2 movs r0, 0x2 strh r0, [r5, 0x8] b @080AF54A .align 2, 0 .pool @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, =0x02037350 adds r0, r1 bl sub_8093284 movs r0, 0x3 strh r0, [r5, 0x8] b @080AF54A .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =0x02037350 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 .pool @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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @080AF634 cmp r0, 0x1 beq @080AF644 b @080AF65A .align 2, 0 .pool @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, =sub_809FA34 movs r1, 0x50 bl AddTask @080AF67C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AF660 thumb_func_start sub_80AF688 sub_80AF688: ; 80AF688 push {lr} bl pal_fill_black ldr r0, =sub_80AF660 movs r1, 0x50 bl AddTask bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool 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, =task_mpl_807E3C8 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =task_mpl_807E3C8 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AF6F0 thumb_func_start sub_80AF710 sub_80AF710: ; 80AF710 ldr r0, =0x02037fd4 ldrb r0, [r0, 0x7] lsrs r0, 7 bx lr .align 2, 0 .pool 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, =0x03005dac ldr r1, =mapldr_default str r1, [r0] ldr r0, =sub_80AFA0C movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005dac ldr r1, =mapldr_default str r1, [r0] ldr r0, =sub_80AFA0C movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005dac ldr r1, =sub_80AF3B0 str r1, [r0] ldr r0, =sub_80AFA0C movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AF79C thumb_func_start sub_80AF7D0 sub_80AF7D0: ; 80AF7D0 push {lr} bl script_env_2_enable ldr r0, =0x03005dac ldr r1, =mapldr_default str r1, [r0] ldr r0, =sub_80AFA88 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005dac ldr r0, =sub_80B6B68 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80AFA0C movs r1, 0xA bl AddTask ldr r1, =0x03005dac ldr r0, =sub_80AF3E8 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80AFA0C movs r1, 0xA bl AddTask ldr r1, =0x03005dac ldr r0, =sub_80AF40C str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80AFA0C movs r1, 0xA bl AddTask ldr r1, =0x03005dac ldr r0, =sub_80FB768 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =sub_8086074 bl set_callback2 adds r0, r5, 0 bl remove_task @080AF93E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80AF8E0 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @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, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080AF9E8 bl warp_in ldr r0, =c2_load_new_map bl set_callback2 adds r0, r5, 0 bl remove_task @080AF9E8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80AF96C thumb_func_start sub_80AF9F8 sub_80AF9F8: ; 80AF9F8 push {lr} ldr r0, =sub_80AF96C movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =c2_load_new_map bl set_callback2 adds r0, r6, 0 bl remove_task @080AFA7C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@080AFAC0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037350 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 .pool @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, =0x02037350 adds r0, r1 bl sub_8093284 movs r0, 0 bl sub_80AF0F4 movs r0, 0x3 strh r0, [r5, 0x8] b @080AFBE8 .align 2, 0 .pool @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, =sub_80AFA0C str r0, [r5] @080AFBE8: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =sub_8086024 bl set_callback2 adds r0, r5, 0 bl remove_task @080AFC56: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005dac ldr r1, =sub_80AF3C8 str r1, [r0] ldr r0, =task0A_fade_n_map_maybe movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @080AFE30: cmp r0, 0x2 beq @080AFEBC b @080AFEC6 @080AFE36: ldr r0, =0x02039b28 ldrb r1, [r0, 0x14] lsls r0, r1, 4 subs r0, r1 lsls r0, 7 ldr r1, =0x02038c28 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 .pool @080AFE64: ldr r0, =0x02039b28 ldrb r1, [r0, 0x14] lsls r0, r1, 4 subs r0, r1 lsls r0, 7 ldr r1, =0x02038c28 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 .pool @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, =0x03005e08 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 .pool @080AFEF4: cmp r0, 0x2 beq @080AFF80 b @080AFF8A @080AFEFA: ldr r0, =0x02039b28 ldrb r1, [r0, 0x14] lsls r0, r1, 4 subs r0, r1 lsls r0, 7 ldr r1, =0x02038c28 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 .pool @080AFF28: ldr r0, =0x02039b28 ldrb r1, [r0, 0x14] lsls r0, r1, 4 subs r0, r1 lsls r0, 7 ldr r1, =0x02038c28 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 .pool @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, =sub_80AFE08 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 .pool thumb_func_end sub_80AFF90 thumb_func_start sub_80AFFB8 sub_80AFFB8: ; 80AFFB8 push {r4,lr} ldr r4, =sub_80AFF90 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 .pool 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, =sub_80AFE08 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r2, r0, 24 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r1, =0x03005e08 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 .pool @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, =sub_80AFECC movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r2, r0, 24 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r1, =0x03005e08 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 .pool @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, =gUnknown_0854FE64 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 .pool 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, =0x02038c28 ldr r1, =gUnknown_0854FE64 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 .pool thumb_func_end sub_80B00E8 thumb_func_start door_upload_tiles door_upload_tiles: ; 80B0124 push {r4,lr} ldr r4, =0x02038c28 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e68 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 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @080B0184 cmp r0, 0x1 beq @080B0198 b @080B01B6 .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =c2_load_new_map bl set_callback2 adds r0, r5, 0 bl remove_task @080B023A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B01BC thumb_func_start sub_80B0244 sub_80B0244: ; 80B0244 push {lr} bl script_env_2_enable ldr r0, =sub_80AFA0C movs r1, 0xA bl AddTask ldr r1, =0x03005dac ldr r0, =sub_80AF3E8 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B0244 thumb_func_start sub_80B0268 sub_80B0268: ; 80B0268 push {lr} bl script_env_2_enable ldr r0, =0x03005dac ldr r1, =mapldr_default str r1, [r0] ldr r0, =sub_80B01BC movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x04000052 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 .pool @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, =0x03005e08 adds r5, r0, r1 movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0x7 bls @080B0334 b @080B052C @080B0334: lsls r0, 2 ldr r1, =@080B0348 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x04000050 ldrh r0, [r0] strh r0, [r5, 0xE] ldr r0, =0x04000052 ldrh r0, [r0] strh r0, [r5, 0x10] ldr r0, =0x04000048 ldrh r0, [r0] strh r0, [r5, 0x12] ldr r0, =0x0400004a ldrh r0, [r0] strh r0, [r5, 0x14] movs r1, 0x80 lsls r1, 7 movs r0, 0 bl lcd_io_clear_bits ldr r0, =gUnknown_82EC7CC ldrh r1, [r0] movs r0, 0x50 bl lcd_io_set_bits ldr r1, =0x0000070c 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, =0x02038c28 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, =gUnknown_0854FE7C 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 .pool @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, =sub_80AFECC 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 .pool @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, =sub_80B0318 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r1, r0 ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0 bne @080B0568 strh r0, [r1, 0x2] movs r0, 0x68 b @080B0580 .align 2, 0 .pool @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, =sub_80B0318 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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 .pool thumb_func_end sub_80B058C thumb_func_start sub_80B05B4 sub_80B05B4: ; 80B05B4 push {lr} bl sub_80859B0 ldr r0, =task50_0807F0C8 movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @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, =sub_8036760 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 .pool 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, =task01_battle_start movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh 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 .pool 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, =0x030022c0 ldr r0, =sub_80B0AF8 str r0, [r1, 0x8] ldr r4, =0x02022fec movs r0, 0 str r0, [r4] bl sub_81A9E40 lsls r0, 24 cmp r0, 0 beq @080B06F2 ldr r0, =0x0000400e 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 .pool 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, =0x030022c0 ldr r0, =sub_80B0AF8 str r0, [r1, 0x8] ldr r1, =0x02022fec 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 .pool 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, =0x030022c0 ldr r0, =sub_80FC190 str r0, [r1, 0x8] ldr r1, =0x02022fec 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 .pool 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, =0x030022c0 ldr r0, =sub_80B0AF8 str r0, [r1, 0x8] ldr r1, =0x02022fec 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 .pool 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, =0x02024744 movs r1, 0xC4 lsls r1, 1 movs r2, 0x5 bl sub_8067FF8 bl script_env_2_enable ldr r1, =0x030022c0 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music str r0, [r1, 0x8] ldr r1, =0x02022fec 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 .pool thumb_func_end sub_80B086C thumb_func_start sub_80B08A8 sub_80B08A8: ; 80B08A8 push {lr} bl script_env_2_enable ldr r1, =0x030022c0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] ldr r1, =0x02022fec 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 .pool thumb_func_end sub_80B08A8 thumb_func_start sub_80B08EC sub_80B08EC: ; 80B08EC push {lr} bl script_env_2_enable ldr r1, =0x030022c0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] ldr r1, =0x02022fec 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 .pool thumb_func_end sub_80B08EC thumb_func_start sub_80B0934 sub_80B0934: ; 80B0934 push {r4,lr} bl script_env_2_enable ldr r1, =0x030022c0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] ldr r4, =0x02022fec movs r0, 0x80 lsls r0, 6 str r0, [r4] ldr r0, =0x02024744 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, =0x00000229 b @080B09E6 .align 2, 0 .pool @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, =0x02022fec 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 .pool @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, =0x00000227 @080B09E6: movs r0, 0 bl task_add_01_battle_start b @080B09FE .align 2, 0 .pool @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, =0x030022c0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] ldr r1, =0x02022fec movs r0, 0xC0 lsls r0, 6 str r0, [r1] ldr r0, =gUnknown_82E9530 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 .pool @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, =0x030022c0 ldr r0, =sub_80B0B6C str r0, [r1, 0x8] ldr r1, =0x02022fec movs r0, 0xC0 lsls r0, 7 str r0, [r1] ldr r0, =0x02024744 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 .pool @080B0ABC: ldr r0, =0x00000193 cmp r2, r0 beq @080B0AD0 b @080B0AD4 .align 2, 0 .pool @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, =0x000001df 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 .pool 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, =0x01000100 mov r0, sp bl CpuSet movs r0, 0 movs r1, 0x80 bl reset_super_sprites ldr r0, =0x0202433a 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, =c2_whiteout bl set_callback2 b @080B0B58 .align 2, 0 .pool @080B0B4C: ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 ldr r1, =0x03005dac ldr r0, =sub_80AF6F0 str r0, [r1] @080B0B58: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x01000100 mov r0, sp bl CpuSet movs r0, 0 movs r1, 0x80 bl reset_super_sprites ldr r0, =0x0202433a 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, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 b @080B0BC6 .align 2, 0 .pool @080B0BB4: ldr r0, =c2_whiteout bl set_callback2 b @080B0BC6 .align 2, 0 .pool @080B0BC0: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 @080B0BC6: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037318 ldrb r0, [r0, 0x17] subs r0, 0x1 cmp r0, 0x8 bhi @080B0C9C lsls r0, 2 ldr r1, =@080B0C40 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c 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 .pool @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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x4 beq @080B0D78 cmp r0, 0x5 beq @080B0D7C movs r0, 0 b @080B0D7E .align 2, 0 .pool @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, =0x020244ec 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 .pool 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, =gTrainers 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 .pool @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, =0x02024744 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 .pool @080B0F04: ldr r0, =gUnknown_0854FE88 lsls r1, r5, 1 b @080B0F20 .align 2, 0 .pool @080B0F10: bl sub_81A9E40 lsls r0, 24 cmp r0, 0 bne @080B0F2C ldr r0, =gUnknown_0854FE88 lsls r1, r6, 1 adds r0, 0x1 @080B0F20: adds r1, r0 ldrb r0, [r1] b @080B0F2E .align 2, 0 .pool @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, =0x02038bca ldrh r1, [r4] movs r0, 0x80 lsls r0, 3 cmp r1, r0 beq @080B0F98 ldr r1, =gTrainers 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, =0x00000105 cmp r1, r0 bne @080B0F6C movs r0, 0xC b @080B1000 .align 2, 0 .pool @080B0F6C: movs r0, 0x83 lsls r0, 1 cmp r1, r0 bne @080B0F78 movs r0, 0xD b @080B1000 @080B0F78: ldr r0, =0x00000107 cmp r1, r0 bne @080B0F88 movs r0, 0xE b @080B1000 .align 2, 0 .pool @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, =gUnknown_0854FE90 lsls r1, r6, 1 adds r0, 0x1 b @080B0FFC .align 2, 0 .pool @080B0FF8: ldr r0, =gUnknown_0854FE90 lsls r1, r6, 1 @080B0FFC: adds r1, r0 ldrb r0, [r1] @080B1000: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B0F34 thumb_func_start sub_80B100C sub_80B100C: ; 80B100C push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x02024744 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 .pool @080B1040: cmp r5, 0xD bgt @080B106C movs r0, 0x4 b @080B1120 @080B1048: ldr r4, =gUnknown_0854FEA4 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 b @080B1114 .align 2, 0 .pool @080B105C: ldr r4, =gUnknown_0854FEA7 bl GenerateRandomNumber ands r5, r0 lsls r0, r5, 16 b @080B111A .align 2, 0 .pool @080B106C: ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x3 beq @080B10EC ldr r4, =gUnknown_0854FE98 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 b @080B1112 .align 2, 0 .pool @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, =gUnknown_0854FEA4 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 b @080B1114 .align 2, 0 .pool @080B10B8: ldr r4, =gUnknown_0854FEA7 bl GenerateRandomNumber ands r5, r0 lsls r0, r5, 16 b @080B111A .align 2, 0 .pool @080B10C8: ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x3 beq @080B10EC ldr r4, =gUnknown_0854FE98 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 b @080B1112 .align 2, 0 .pool @080B10EC: ldr r0, =0x03005d90 ldr r1, [r0] ldr r2, =0x00000cb2 adds r0, r1, r2 ldrh r0, [r0] lsls r2, r0, 2 ldr r3, =0x00000cb4 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, =gUnknown_0854FE98 @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 .pool thumb_func_end sub_80B100C thumb_func_start sub_80B1138 sub_80B1138: ; 80B1138 push {lr} ldr r0, =set_256color_bg_bg0 bl set_callback2 ldr r1, =0x030022c0 ldr r0, =sub_80B1158 str r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B1138 thumb_func_start sub_80B1158 sub_80B1158: ; 80B1158 push {lr} sub sp, 0x8 ldr r0, =0x00004023 bl var_get_pointer ldr r2, =0x020375f0 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, =sub_80B11A8 bl set_callback2 movs r0, 0 bl sub_8145F10 add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022fec movs r0, 0x10 str r0, [r1] ldr r1, =0x030022c0 ldr r0, =sub_80B1204 str r0, [r1, 0x8] bl Window_FreeMemory ldr r0, =sub_8036760 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 .pool thumb_func_end sub_80B11A8 thumb_func_start sub_80B1204 sub_80B1204: ; 80B1204 push {lr} bl sav1_reset_x2C ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038bca 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 .pool thumb_func_end trainerflag_opponent thumb_func_start sub_80B1290 sub_80B1290: ; 80B1290 ldr r1, =0x02038bcc 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 .pool 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, =@080B12C0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02038bca movs r1, 0 strh r1, [r0] ldr r0, =0x02038bcc strh r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80B12E8 thumb_func_start sub_80B12FC sub_80B12FC: ; 80B12FC push {lr} ldr r0, =0x02038bc8 movs r1, 0 strh r1, [r0] ldr r0, =0x02038bfc ldrb r1, [r0] cmp r1, 0 bne @080B132C ldr r0, =0x02038bd4 str r1, [r0] ldr r0, =0x02038bdc str r1, [r0] ldr r0, =0x02038bf0 b @080B1338 .align 2, 0 .pool @080B132C: ldr r0, =0x02038bd8 movs r1, 0 str r1, [r0] ldr r0, =0x02038be0 str r1, [r0] ldr r0, =0x02038bf4 @080B1338: str r1, [r0] ldr r1, =0x02038bd0 movs r0, 0 strh r0, [r1] ldr r0, =0x02038be4 movs r1, 0 str r1, [r0] ldr r0, =0x02038be8 str r1, [r0] ldr r0, =0x02038bec str r1, [r0] pop {r0} bx r0 .align 2, 0 .pool 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, =@080B138C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02038bd0 ldrh r1, [r0] cmp r1, 0 beq @080B141A ldr r0, =0x020375f2 strh r1, [r0] lsls r0, r1, 24 lsrs r0, 24 ldr r1, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl get_npc_id_by_local_id ldr r1, =0x03005df0 strb r0, [r1] @080B141A: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038bc8 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, =@080B1464 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_0854FF84 adds r1, r5, 0 bl battle_load_arguments ldr r0, =gUnknown_082713C2 b @080B161E .align 2, 0 .pool @080B14A8: ldr r0, =gUnknown_0854FF3C b @080B14D6 .align 2, 0 .pool @080B14B0: ldr r0, =0x02038bfc ldrb r0, [r0] cmp r0, 0 bne @080B14C4 ldr r0, =gUnknown_0854FEF4 b @080B15FE .align 2, 0 .pool @080B14C4: ldr r0, =gUnknown_0855005C b @080B1616 .align 2, 0 .pool @080B14CC: ldr r0, =gUnknown_0854FEF4 b @080B15FE .align 2, 0 .pool @080B14D4: ldr r0, =gUnknown_0854FFCC @080B14D6: adds r1, r5, 0 bl battle_load_arguments bl battle_80801F0 ldr r0, =gUnknown_0827138A b @080B161E .align 2, 0 .pool @080B14EC: ldr r0, =gUnknown_0854FF3C adds r1, r5, 0 bl battle_load_arguments bl battle_80801F0 ldr r4, =0x02038bca ldrh r0, [r4] bl sub_80B2234 strh r0, [r4] ldr r0, =gUnknown_082713F8 b @080B161E .align 2, 0 .pool @080B1514: ldr r0, =gUnknown_0854FEAC adds r1, r5, 0 bl battle_load_arguments bl battle_80801F0 ldr r4, =0x02038bca ldrh r0, [r4] bl sub_80B2234 strh r0, [r4] ldr r0, =gUnknown_082713D1 b @080B161E .align 2, 0 .pool @080B153C: ldr r0, =0x02038bfc ldrb r0, [r0] cmp r0, 0 bne @080B156C ldr r0, =gUnknown_0854FEAC adds r1, r5, 0 bl battle_load_arguments bl battle_80801F0 ldr r0, =0x020375f2 ldrb r0, [r0] bl sub_81A9AA8 ldr r1, =0x02038bca b @080B157E .align 2, 0 .pool @080B156C: ldr r0, =gUnknown_08550014 adds r1, r5, 0 bl battle_load_arguments ldr r0, =0x020375f2 ldrb r0, [r0] bl sub_81A9AA8 @080B157C: ldr r1, =0x02038bcc @080B157E: strh r0, [r1] b @080B161C .align 2, 0 .pool @080B1590: ldr r0, =gUnknown_0854FEAC b @080B159A .align 2, 0 .pool @080B1598: ldr r0, =gUnknown_08550014 @080B159A: adds r1, r5, 0 bl battle_load_arguments movs r0, 0 b @080B161E .align 2, 0 .pool @080B15A8: ldr r0, =0x02038bfc ldrb r0, [r0] cmp r0, 0 bne @080B15D8 ldr r0, =gUnknown_0854FEAC adds r1, r5, 0 bl battle_load_arguments bl battle_80801F0 ldr r0, =0x020375f2 ldrb r0, [r0] bl battle_init ldr r1, =0x02038bca b @080B157E .align 2, 0 .pool @080B15D8: ldr r0, =gUnknown_08550014 adds r1, r5, 0 bl battle_load_arguments ldr r0, =0x020375f2 ldrb r0, [r0] bl battle_init b @080B157C .align 2, 0 .pool @080B15F4: ldr r0, =0x02038bfc ldrb r0, [r0] cmp r0, 0 bne @080B1614 ldr r0, =gUnknown_0854FEAC @080B15FE: adds r1, r5, 0 bl battle_load_arguments bl battle_80801F0 b @080B161C .align 2, 0 .pool @080B1614: ldr r0, =gUnknown_08550014 @080B1616: adds r1, r5, 0 bl battle_load_arguments @080B161C: ldr r0, =gUnknown_08271362 @080B161E: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005df0 strb r0, [r2] ldr r4, =0x020375f2 ldr r3, =0x02037350 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, =gUnknown_08271354 bl script_env_1_execute_new_script bl script_env_2_enable pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B162C thumb_func_start sub_80B1670 sub_80B1670: ; 80B1670 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005df0 strb r0, [r2] ldr r4, =0x020375f2 ldr r3, =0x02037350 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 .pool thumb_func_end sub_80B1670 thumb_func_start sub_80B16A4 sub_80B16A4: ; 80B16A4 push {lr} ldr r0, =gUnknown_08271354 bl script_env_1_execute_new_script bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005df0 ldrb r0, [r0] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 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 .pool thumb_func_end sub_80B16D8 thumb_func_start sub_80B170C sub_80B170C: ; 80B170C ldr r0, =0x02038bc8 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x03005df0 ldrb r0, [r0] bl sub_81A9AC4 b @080B1752 .align 2, 0 .pool @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, =0x03005df0 ldrb r0, [r0] bl sub_81D619C @080B1752: lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038bcc 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 .pool 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, =0x030060a8 ldrb r0, [r0] cmp r0, 0x2 bne @080B17FC ldr r1, =0x02022fec ldr r0, =0x00008009 b @080B1800 .align 2, 0 .pool @080B17FC: ldr r1, =0x02022fec movs r0, 0x8 @080B1800: str r0, [r1] bl sub_81A9E40 lsls r0, 24 cmp r0, 0 beq @080B1884 ldr r0, =0x0000400e movs r1, 0 bl var_set ldr r2, =0x02022fec ldr r0, [r2] movs r1, 0x80 lsls r1, 14 orrs r0, r1 str r0, [r2] ldr r0, =0x030060a8 ldrb r0, [r0] cmp r0, 0x2 bne @080B1864 movs r0, 0x1 bl sub_816306C ldr r4, =0x020247a8 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 .pool @080B1864: movs r0, 0x1 bl sub_8163048 ldr r4, =0x020247a8 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 .pool @080B1884: bl sub_81D5C18 lsls r0, 24 cmp r0, 0 beq @080B18B8 ldr r2, =0x02022fec ldr r0, [r2] movs r1, 0x80 lsls r1, 19 orrs r0, r1 str r0, [r2] ldr r0, =0x030060a8 ldrb r0, [r0] cmp r0, 0x2 bne @080B18B0 bl sub_81D639C b @080B18B4 .align 2, 0 .pool @080B18B0: bl sub_81D6384 @080B18B4: bl sub_81D61E8 @080B18B8: ldr r1, =0x02038bf9 ldr r2, =0x030060a8 ldrb r0, [r2] strb r0, [r1] movs r1, 0 strb r1, [r2] ldr r0, =0x02038bf8 strb r1, [r0] ldr r1, =0x03006080 movs r0, 0 strh r0, [r1] ldr r1, =0x030022c0 ldr r0, =sub_80B1918 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 .pool @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, =0x02038bca ldrh r1, [r0] movs r0, 0x80 lsls r0, 3 cmp r1, r0 beq @080B1946 ldr r0, =0x0202433a 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, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 b @080B198A .align 2, 0 .pool @080B195C: ldr r0, =c2_whiteout bl set_callback2 b @080B198A .align 2, 0 .pool @080B1968: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music 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 .pool thumb_func_end sub_80B1918 thumb_func_start sub_80B1994 sub_80B1994: ; 80B1994 push {lr} ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0x80 lsls r0, 3 cmp r1, r0 bne @080B19B4 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 b @080B19E2 .align 2, 0 .pool @080B19B4: ldr r0, =0x0202433a ldrb r0, [r0] bl battle_exit_is_player_defeat cmp r0, 0x1 bne @080B19D0 ldr r0, =c2_whiteout bl set_callback2 b @080B19E2 .align 2, 0 .pool @080B19D0: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music 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 .pool thumb_func_end sub_80B1994 thumb_func_start sub_80B19EC sub_80B19EC: ; 80B19EC push {lr} ldr r1, =0x02022fec movs r0, 0x8 str r0, [r1] ldr r1, =0x030022c0 ldr r0, =sub_80B1994 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 .pool 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, =0x030060a8 ldrb r0, [r0] cmp r0, 0x1 bhi @080B1A44 ldr r0, =0x020375f2 ldrb r0, [r0] bl sub_81A9AA8 lsls r0, 16 lsrs r0, 16 bl sub_81A9EDC b @080B1AD8 .align 2, 0 .pool @080B1A44: ldr r3, =0x02037350 ldr r2, =0x03006090 ldr r0, =0x02038bfc 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 .pool @080B1A7C: bl sub_81D5C18 lsls r0, 24 cmp r0, 0 beq @080B1AEC ldr r0, =0x030060a8 ldrb r0, [r0] cmp r0, 0x1 bhi @080B1AAC ldr r0, =0x020375f2 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 .pool @080B1AAC: ldr r3, =0x02037350 ldr r2, =0x03006090 ldr r0, =0x02038bfc 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 .pool @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, =0x02038bec ldr r0, [r0] cmp r0, 0 bne @080B1B04 ldr r0, =gUnknown_082C8436 @080B1B04: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B1AF8 thumb_func_start sub_80B1B10 sub_80B1B10: ; 80B1B10 push {lr} ldr r1, =0x02038bf8 ldrb r2, [r1] cmp r2, 0 beq @080B1B3C movs r0, 0 strb r0, [r1] ldr r0, =0x02038bf4 ldr r2, [r0] cmp r2, 0 beq @080B1B54 ldr r1, =0x03006080 movs r0, 0x1 strh r0, [r1] adds r0, r2, 0 b @080B1B56 .align 2, 0 .pool @080B1B3C: ldr r0, =0x02038bf0 ldr r1, [r0] cmp r1, 0 beq @080B1B54 ldr r0, =0x03006080 strh r2, [r0] adds r0, r1, 0 b @080B1B56 .align 2, 0 .pool @080B1B54: ldr r0, =gUnknown_082742E6 @080B1B56: pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038bfc ldrb r0, [r0] cmp r0, 0 bne @080B1B88 ldr r0, =0x02038bca b @080B1B8A .align 2, 0 .pool @080B1B88: ldr r0, =0x02038bcc @080B1B8A: ldrh r1, [r0] ldr r0, =0x02038bc8 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, =@080B1BBC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00000197 b @080B1C5E .align 2, 0 .pool @080B1C04: ldr r0, =0x0000017b b @080B1C5E .align 2, 0 .pool @080B1C0C: movs r0, 0xD0 lsls r0, 1 b @080B1C5E @080B1C12: ldr r0, =0x000001a1 b @080B1C5E .align 2, 0 .pool @080B1C1C: ldr r0, =0x000001a3 b @080B1C5E .align 2, 0 .pool @080B1C24: ldr r0, =0x000001b9 b @080B1C5E .align 2, 0 .pool @080B1C2C: ldr r0, =0x00000181 b @080B1C5E .align 2, 0 .pool @080B1C34: ldr r0, =0x000001c1 b @080B1C5E .align 2, 0 .pool @080B1C3C: movs r0, 0xE1 lsls r0, 1 b @080B1C5E @080B1C42: ldr r0, =0x000001c3 b @080B1C5E .align 2, 0 .pool @080B1C4C: ldr r0, =0x000001c5 b @080B1C5E .align 2, 0 .pool @080B1C54: ldr r0, =0x0000018d b @080B1C5E .align 2, 0 .pool @080B1C5C: ldr r0, =0x000001a7 @080B1C5E: bl current_map_music_set @080B1C62: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B1B70 thumb_func_start sub_80B1C6C sub_80B1C6C: ; 80B1C6C push {lr} cmp r0, 0 bne @080B1C74 ldr r0, =gUnknown_085E8D03 @080B1C74: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B1C6C thumb_func_start sub_80B1C7C sub_80B1C7C: ; 80B1C7C push {lr} ldr r0, =0x02038bfc ldrb r0, [r0] cmp r0, 0 beq @080B1C94 ldr r0, =0x02038bd8 b @080B1C96 .align 2, 0 .pool @080B1C94: ldr r0, =0x02038bd4 @080B1C96: ldr r0, [r0] bl sub_80B1C6C pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B1C7C thumb_func_start sub_80B1CA4 sub_80B1CA4: ; 80B1CA4 push {r4,lr} ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0x80 lsls r0, 3 cmp r1, r0 bne @080B1CBC bl sub_80EA250 b @080B1CC0 .align 2, 0 .pool @080B1CBC: ldr r0, =0x02038bdc ldr r0, [r0] @080B1CC0: ldr r4, =0x02021fc4 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 .pool thumb_func_end sub_80B1CA4 thumb_func_start sub_80B1CE0 sub_80B1CE0: ; 80B1CE0 push {r4,lr} ldr r4, =0x02021fc4 ldr r0, =0x02038be0 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 .pool thumb_func_end sub_80B1CE0 thumb_func_start sub_80B1D04 sub_80B1D04: ; 80B1D04 push {lr} ldr r0, =0x02038be4 ldr r0, [r0] bl sub_80B1C6C pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B1D04 thumb_func_start sub_80B1D18 sub_80B1D18: ; 80B1D18 push {lr} ldr r0, =0x02038be8 ldr r0, [r0] bl sub_80B1C6C pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 adds r0, r6 strb r5, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000009ca 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 .pool thumb_func_end sub_80B1DFC thumb_func_start sub_80B1E94 sub_80B1E94: ; 80B1E94 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =gUnknown_085500A4 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 .pool 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, =0x03005d8c @080B1ED2: ldrh r0, [r3] cmp r0, r4 bne @080B1EF8 ldrh r0, [r3, 0x2] cmp r0, r2 bne @080B1EF8 ldr r0, [r5] ldr r6, =0x000009ca adds r0, r6 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080B1EF8 movs r0, 0x1 b @080B1F02 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r2, =0x000009ca adds r0, r2 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080B1F6C movs r0, 0x1 b @080B1F6E .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r2, =0x000009ca adds r0, r2 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080B1FA8 movs r0, 0x1 b @080B1FAA .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r2, =0x000009ca adds r0, r2 adds r0, r1 movs r1, 0 strb r1, [r0] @080B207E: pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085500A4 @080B2098: ldrh r0, [r2] cmp r0, r3 bne @080B20A8 adds r0, r1, r4 b @080B20B2 .align 2, 0 .pool @080B20A8: adds r2, 0x10 adds r1, 0x1 cmp r1, 0x4D ble @080B2098 ldr r0, =0x0000ffff @080B20B2: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B208C thumb_func_start sub_80B20BC sub_80B20BC: ; 80B20BC push {lr} ldr r0, =0x0000012f bl flag_check lsls r0, 24 cmp r0, 0 beq @080B20E2 ldr r0, =0x02038bca ldrh r0, [r0] bl sub_80B208C adds r1, r0, 0 ldr r0, =0x0000ffff cmp r1, r0 beq @080B20E2 lsls r0, r1, 16 lsrs r0, 16 bl flag_set @080B20E2: pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08550584 @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 .pool @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, =0x03005d8c ldr r0, [r0] ldr r2, =0x000009c8 adds r1, r0, r2 ldrh r0, [r1] cmp r0, 0xFE bls @080B2180 movs r0, 0xFF b @080B2182 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000009c8 adds r0, r1 ldrh r0, [r0] cmp r0, 0xFE bls @080B21AC movs r0, 0x1 b @080B21AE .align 2, 0 .pool @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, =gUnknown_085500A4 adds r1, r5, 0 adds r2, r4, 0 bl sub_80B1DFC cmp r0, 0x1 bne @080B21E0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000009c8 adds r0, r1 movs r1, 0 strh r1, [r0] @080B21E0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085500A4 adds r1, r3, 0 bl sub_80B1EC0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085500A4 adds r1, r3, 0 bl sub_80B1F08 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085500A4 bl sub_80B1FB0 lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085500A4 bl sub_80B2004 lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B2250 thumb_func_start sub_80B226C sub_80B226C: ; 80B226C push {r4,r5,lr} ldr r5, =gUnknown_085500A4 ldr r4, =0x02038bca 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 .pool @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, =gUnknown_085500A4 ldr r1, =0x02038bca ldrh r1, [r1] bl sub_80B1F74 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B22A0 thumb_func_start sub_80B22BC sub_80B22BC: ; 80B22BC push {lr} ldr r0, =gUnknown_085500A4 ldr r1, =0x02038bca ldrh r1, [r1] bl sub_80B205C bl rom_npc_set_flag_for_script_id pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B22BC thumb_func_start sub_80B22D8 sub_80B22D8: ; 80B22D8 push {lr} ldr r1, =0x02038bf9 ldrb r0, [r1] cmp r0, 0x1 bls @080B2300 movs r0, 0 strb r0, [r1] ldr r1, =0x02038bf8 movs r0, 0x1 strb r0, [r1] ldr r1, =0x020375f0 movs r0, 0x1 b @080B230A .align 2, 0 .pool @080B2300: ldr r1, =0x02038bf8 movs r0, 0 strb r0, [r1] ldr r1, =0x020375f0 movs r0, 0 @080B230A: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B22D8 thumb_func_start sub_80B2318 sub_80B2318: ; 80B2318 push {r4-r7,lr} lsls r0, 16 ldr r7, =gUnknown_085500A4 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 .pool @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, =sub_80B2634 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, =0x03005e00 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 .pool 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, =0x02021cc4 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, =0x02021fc4 ldr r1, =gUnknown_085EE667 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 .pool 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, =0x03005e08 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 .pool @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, =@080B24A0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 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 .pool @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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80B2D2C str r0, [r1] movs r0, 0x1 @080B251E: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x030022c0 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, =0x020229c6 strh r1, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80B2CEC str r1, [r0] movs r0, 0x1 b @080B2572 .align 2, 0 .pool @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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @080B25A4 movs r0, 0 b @080B25BA .align 2, 0 .pool @080B25A4: ldr r1, =0x020229c6 movs r0, 0 strh r0, [r1] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80B2CEC str r1, [r0] movs r0, 0x1 @080B25BA: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80B2D2C str r0, [r1] movs r0, 0x1 @080B25F2: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 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 .pool 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, =0x03005e08 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, =gUnknown_08550594 bl Window_AddFromTemplate strh r0, [r4, 0xA] b @080B2678 .align 2, 0 .pool @080B266C: cmp r2, 0x9 ble @080B2678 subs r0, 0x8 adds r0, r1, r0 ldr r1, =sub_80B2688 str r1, [r0] @080B2678: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_082780B3 bl box_related_two__3 ldr r0, =sub_80B270C b @080B26FA .align 2, 0 .pool @080B26EC: movs r0, 0x16 bl audio_play ldr r0, =gUnknown_08278131 bl box_related_two__3 ldr r0, =sub_80B2918 @080B26FA: str r0, [r4] @080B26FC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 strh r2, [r1, 0xE] ldr r0, =sub_80B275C str r0, [r1] @080B274C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x030022c0 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, =0x02021cc4 adds r1, r5, 0 movs r2, 0 movs r3, 0x1 bl decimal_int_to_string ldr r0, =gUnknown_082780F2 bl box_related_two__3 mov r0, r9 subs r0, 0x8 add r0, r8 ldr r1, =sub_80B2804 str r1, [r0] @080B27E4: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2C] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080B2878 @080B2852: ldr r0, =gUnknown_082780B3 bl box_related_two__3 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_80B270C str r1, [r0] b @080B2898 .align 2, 0 .pool @080B2878: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080B2898 movs r0, 0x5 bl audio_play bl sub_800A620 ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_80B28A8 str r0, [r1] @080B2898: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =sub_80B2D2C b @080B2908 .align 2, 0 .pool @080B28F4: ldr r4, =0x020375f0 adds r0, r7, 0 adds r1, r6, 0 bl sub_80B2478 strh r0, [r4] lsls r0, 16 cmp r0, 0 beq @080B290A ldr r0, =sub_80B2A08 @080B2908: str r0, [r5] @080B290A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x020375f0 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, =sub_80B2CB0 b @080B29E4 .align 2, 0 .pool @080B297C: cmp r2, 0x7 beq @080B2984 cmp r2, 0x9 bne @080B2994 @080B2984: bl sub_80097E8 bl textbox_close ldr r0, =sub_80B2CB0 b @080B29E4 .align 2, 0 .pool @080B2994: bl sub_800ABAC ldr r4, =0x03005db8 strb r0, [r4] bl link_get_multiplayer_id ldr r1, =0x03005db4 strb r0, [r1] ldrb r0, [r4] bl sub_800AA04 ldr r4, =0x020228c4 adds r0, r4, 0 bl sub_80C30A4 ldr r0, =0x0203cef8 mov r8, r0 ldrb r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x02024488 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, =sub_80B2C30 @080B29E4: str r0, [r7] @080B29E6: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375f0 ldrh r0, [r0] cmp r0, 0x4 bne @080B2A38 bl sub_800A064 cmp r0, 0 bne @080B2A4A bl sub_800AC34 b @080B2A4E .align 2, 0 .pool @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, =0x03005e00 lsls r1, r7, 2 adds r1, r7 lsls r1, 3 adds r1, r0 ldr r0, =sub_80B2CB0 str r0, [r1] b @080B2ACE .align 2, 0 .pool @080B2A6C: bl sub_800ABAC ldr r4, =0x03005db8 strb r0, [r4] bl link_get_multiplayer_id ldr r1, =0x03005db4 strb r0, [r1] ldrb r0, [r4] bl sub_800AA04 ldr r4, =0x020228c4 adds r0, r4, 0 bl sub_80C30A4 ldr r0, =0x0203cef8 mov r8, r0 ldrb r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x02024488 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_80B2C30 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 .pool 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, =0x02021cc4 movs r0, 0xFF strb r0, [r1] ldr r1, =0x02021dc4 movs r0, 0x1 negs r0, r0 strb r0, [r1] movs r1, 0 movs r0, 0xB mov r10, r0 ldr r0, =gSpeciesNames 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, =0x02021cc4 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, =0x02021dc4 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, =0x020375e2 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 .pool 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, =0x02039b58 ldrh r0, [r5] cmp r0, 0x1 bne @080B2C10 ldr r0, =0x020229c6 ldrh r2, [r0] ldr r0, =0x00002266 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80B2CB0 str r1, [r0] b @080B2C22 .align 2, 0 .pool @080B2BEC: ldr r1, =0x03005e00 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 .pool @080B2C10: bl sub_800AC34 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80B2CB0 str r0, [r1] @080B2C22: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020229e8 b @080B2C7E .align 2, 0 .pool @080B2C5C: movs r0, 0x64 muls r0, r4 ldr r1, =0x02039b58 adds r0, r1 lsls r1, r4, 8 ldr r2, =0x020223c4 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, =0x020375f0 adds r1, r5, 0 bl task_map_chg_seq_0807EC34 @080B2C9C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080B2CDE ldr r0, =0x03005e00 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 .pool 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, =0x020375f0 movs r0, 0x5 strh r0, [r1] ldr r0, =0x03005e00 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 .pool 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, =0x020375f0 movs r0, 0x6 strh r0, [r1] ldr r0, =0x03005e00 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 .pool thumb_func_end sub_80B2D2C thumb_func_start sub_80B2D6C sub_80B2D6C: ; 80B2D6C push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r2, r1, r2 ldrh 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 .pool @080B2D94: ldr r0, =sub_80B2D2C str r0, [r2] movs r0, 0x1 @080B2D9A: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B2D6C thumb_func_start sub_80B2DA4 sub_80B2DA4: ; 80B2DA4 push {r4,lr} movs r3, 0x2 movs r2, 0x2 ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0x2 beq @080B2DDC cmp r0, 0x2 bgt @080B2DC0 cmp r0, 0x1 beq @080B2DCA b @080B2E34 .align 2, 0 .pool @080B2DC0: cmp r0, 0x5 beq @080B2DEC cmp r0, 0x9 beq @080B2E00 b @080B2E34 @080B2DCA: movs r3, 0x2 ldr r1, =0x020229c6 ldr r4, =0x00002233 b @080B2E30 .align 2, 0 .pool @080B2DDC: movs r3, 0x2 ldr r1, =0x020229c6 ldr r4, =0x00002244 b @080B2E30 .align 2, 0 .pool @080B2DEC: movs r3, 0x4 movs r2, 0x4 ldr r1, =0x020229c6 ldr r4, =0x00002255 b @080B2E30 .align 2, 0 .pool @080B2E00: movs r3, 0x2 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r1, [r0] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @080B2E2C ldr r1, =0x020229c6 ldr r4, =0x00002266 b @080B2E30 .align 2, 0 .pool @080B2E2C: ldr r1, =0x020229c6 ldr r4, =0x00002277 @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 .pool thumb_func_end sub_80B2DA4 thumb_func_start sub_80B2E4C sub_80B2E4C: ; 80B2E4C push {lr} ldr r1, =0x020229c6 ldr r2, =0x00001133 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x02022fec movs r0, 0 str r0, [r1] movs r0, 0x2 movs r1, 0x2 bl sub_80B236C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B2E4C thumb_func_start sub_80B2E74 sub_80B2E74: ; 80B2E74 push {lr} ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r1, =0x020229c6 ldr r2, =0x00003311 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x02022fec movs r0, 0 str r0, [r1] movs r0, 0x2 movs r1, 0x4 bl sub_80B236C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B2E74 thumb_func_start sub_80B2EA8 sub_80B2EA8: ; 80B2EA8 push {r4,lr} ldr r4, =sub_80B2EE4 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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool @080B2F0C: ldr r0, =0x020375f0 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, =0x020229e8 ldrb r2, [r0] ldrh r3, [r0, 0x1A] subs r1, r2, 0x1 mov r12, r0 cmp r1, 0x1 bhi @080B2F4A b @080B2F6E .align 2, 0 .pool @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, =0x020375f0 movs r0, 0xC strh r0, [r1] bl sub_800AD10 ldr r1, =0x03005e00 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 .pool @080B2FA8: bl script_env_2_enable_and_set_ctx_running adds r0, r6, 0 bl remove_task b @080B2FC6 @080B2FB4: ldr r0, =0x03003124 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 .pool thumb_func_end sub_80B2EE4 thumb_func_start sub_80B2FD8 sub_80B2FD8: ; 80B2FD8 push {lr} ldr r1, =0x020229c6 ldr r2, =0x00004411 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x02022fec movs r0, 0 str r0, [r1] movs r0, 0x2 movs r1, 0x4 bl sub_80B236C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B2FD8 thumb_func_start sub_80B3000 sub_80B3000: ; 80B3000 push {lr} ldr r1, =0x020229c6 ldr r2, =0x00006601 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x02022fec movs r0, 0 str r0, [r1] movs r0, 0x4 movs r1, 0x4 bl sub_80B236C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B3000 thumb_func_start sub_80B3028 sub_80B3028: ; 80B3028 push {lr} ldr r1, =0x020229c6 ldr r2, =0x00006602 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x02022fec movs r0, 0 str r0, [r1] movs r0, 0x2 movs r1, 0x4 bl sub_80B236C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B3028 thumb_func_start sub_80B3050 sub_80B3050: ; 80B3050 push {lr} ldr r0, =sub_80B3144 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @080B3068 movs r0, 0xFF b @080B3134 .align 2, 0 .pool @080B3068: ldr r0, =0x020375e0 ldrh r0, [r0] subs r0, 0x1 cmp r0, 0x8 bhi @080B3128 lsls r0, 2 ldr r1, =@080B3084 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020229c6 ldr r2, =0x00002233 b @080B3124 .align 2, 0 .pool @080B30B8: ldr r1, =0x020229c6 ldr r2, =0x00002244 b @080B3124 .align 2, 0 .pool @080B30C8: ldr r1, =0x020229c6 ldr r2, =0x00002255 b @080B3124 .align 2, 0 .pool @080B30D8: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r1, [r0] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @080B3100 ldr r1, =0x020229c6 ldr r2, =0x00002266 b @080B3124 .align 2, 0 .pool @080B3100: ldr r1, =0x020229c6 ldr r2, =0x00002277 b @080B3124 .align 2, 0 .pool @080B3110: ldr r1, =0x020229c6 ldr r2, =0x00001111 b @080B3124 .align 2, 0 .pool @080B3120: ldr r1, =0x020229c6 ldr r2, =0x00003322 @080B3124: adds r0, r2, 0 strh r0, [r1] @080B3128: ldr r0, =sub_80B3144 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 @080B3134: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e08 adds r4, r1, r0 movs r3, 0 ldrsh r2, [r4, r3] cmp r2, 0 bne @080B3178 bl sub_8009734 bl sub_800A2BC ldr r0, =task00_08081A90 movs r1, 0x50 bl AddTask b @080B3184 .align 2, 0 .pool @080B3178: cmp r2, 0x9 ble @080B3184 subs r0, 0x8 adds r0, r1, r0 ldr r1, =sub_80B3194 str r1, [r0] @080B3184: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80B31E8 b @080B31D8 .align 2, 0 .pool @080B31CC: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80B3220 @080B31D8: str r0, [r1] @080B31DA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80B3220 str r0, [r1] @080B3212: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03003124 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 .pool 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, =0x02022fec movs r0, 0xA b @080B32A4 .align 2, 0 .pool @080B3284: ldr r1, =0x02022fec movs r0, 0xB b @080B32A4 .align 2, 0 .pool @080B3290: bl sub_80F94E8 ldr r1, =0x02022fec movs r0, 0x4B b @080B32A4 .align 2, 0 .pool @080B32A0: ldr r1, =0x02022fec ldr r0, =0x0000014b @080B32A4: str r0, [r1] @080B32A6: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x5 bhi @080B33A0 lsls r0, 2 ldr r1, =@080B32E0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020229c6 ldr r2, =0x00002211 adds r0, r2, 0 strh r0, [r1] bl sub_8009FAC b @080B3346 .align 2, 0 .pool @080B3318: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 b @080B3342 .align 2, 0 .pool @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, =0x03003124 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 .pool @080B3354: ldr r0, =0x020229e8 ldr r0, [r0, 0x4] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @080B3370 ldr r0, =0x000001dd bl current_map_music_set__default_for_battle b @080B3378 .align 2, 0 .pool @080B3370: movs r0, 0xEE lsls r0, 1 bl current_map_music_set__default_for_battle @080B3378: ldr r0, =0x020375e0 ldrh r0, [r0] bl sub_80B3260 bl overworld_free_bg_tilemaps ldr r1, =0x02038bca movs r2, 0x80 lsls r2, 4 adds r0, r2, 0 strh r0, [r1] ldr r0, =sub_8036760 bl set_callback2 ldr r1, =0x030022c0 ldr r0, =sub_80B360C str r0, [r1, 0x8] adds r0, r5, 0 bl remove_task @080B33A0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r6, r0, r1 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0x7 bls @080B33D6 b @080B3532 @080B33D6: lsls r0, 2 ldr r1, =@080B33E8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020229c6 ldr r2, =0x00002211 adds r1, r2, 0 strh r1, [r0] bl sub_8009FAC movs r0, 0x1 strh r0, [r6] b @080B3532 .align 2, 0 .pool @080B342C: ldr r0, =0x02037fd4 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 .pool @080B3444: ldr r1, =0x020229cc movs r0, 0 movs r2, 0x1C bl link_0800A448 movs r0, 0x3 strh r0, [r6] b @080B3532 .align 2, 0 .pool @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, =0x020229e8 b @080B349A .align 2, 0 .pool @080B3474: lsls r1, r4, 8 ldr r2, =0x020223c4 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 .pool @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, =0x020229e8 ldr r0, [r0, 0x4] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @080B34FC ldr r0, =0x000001dd bl current_map_music_set__default_for_battle b @080B3504 .align 2, 0 .pool @080B34FC: movs r0, 0xEE lsls r0, 1 bl current_map_music_set__default_for_battle @080B3504: ldr r1, =0x020229e8 ldr r0, =0x00002211 str r0, [r1, 0x14] ldr r0, =0x020375e0 ldrh r0, [r0] bl sub_80B3260 bl overworld_free_bg_tilemaps ldr r1, =0x02038bca movs r3, 0x80 lsls r3, 4 adds r0, r3, 0 strh r0, [r1] ldr r0, =sub_8036760 bl set_callback2 ldr r1, =0x030022c0 ldr r0, =sub_80B360C str r0, [r1, 0x8] adds r0, r4, 0 bl remove_task @080B3532: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B33BC thumb_func_start sub_80B3554 sub_80B3554: ; 80B3554 push {r4,lr} ldr r0, =0x030022c0 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 .pool @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, =0x020229e8 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, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x2 strb r1, [r0] b @080B35FE .align 2, 0 .pool @080B35C8: bl sub_800AC34 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x1 strb r1, [r0] b @080B35FE .align 2, 0 .pool @080B35E0: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080B35FE ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 b @080B35FE .align 2, 0 .pool @080B35F8: ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 @080B35FE: bl run_active_tasks pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B3554 thumb_func_start sub_80B360C sub_80B360C: ; 80B360C push {r4,r5,lr} ldr r2, =0x02022fec 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, =0x020375e0 ldrh r0, [r0] subs r0, 0x1 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @080B36B2 ldr r0, =0x03005db4 ldrb r0, [r0] movs r5, 0x1 eors r0, r5 bl sub_813C2A0 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080B36B2 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0x1 beq @080B3670 cmp r0, 0x2 beq @080B3694 b @080B36B2 .align 2, 0 .pool @080B3670: ldr r4, =0x020229e8 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 .pool @080B3694: ldr r4, =0x020229e8 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, =0x030022c0 ldr r0, =sub_80B3554 b @080B36D0 .align 2, 0 .pool @080B36CC: ldr r1, =0x030022c0 ldr r0, =c2_8056854 @080B36D0: str r0, [r1, 0x8] ldr r0, =sub_80A0514 bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B360C thumb_func_start sub_80B36EC sub_80B36EC: ; 80B36EC push {lr} ldr r0, =0x020375e0 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 .pool 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, =0x03005e00 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 .pool @080B3750: cmp r0, 0x2 beq @080B378C cmp r0, 0x3 beq @080B37B8 b @080B37CC @080B375A: ldr r0, =gUnknown_08278091 bl box_related_two__2 movs r0, 0x1 strh r0, [r5, 0x8] b @080B37CC .align 2, 0 .pool @080B376C: bl sub_809833C lsls r0, 24 cmp r0, 0 beq @080B37CC bl sub_8087288 ldr r0, =0x020375e2 ldrb r0, [r0] bl sub_8009628 movs r0, 0x2 strh r0, [r5, 0x8] b @080B37CC .align 2, 0 .pool @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, =sub_80B3728 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 .pool 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, =0x03005e00 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 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080B3884 b @080B3864 .align 2, 0 .pool @080B3854: ldr r1, =0x02032298 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 .pool @080B3870: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080B3884 ldr r0, =sub_80773AC bl set_callback2 adds r0, r5, 0 bl remove_task @080B3884: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080B391C b @080B38FC .align 2, 0 .pool @080B38EC: ldr r1, =0x02032298 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 .pool @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, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080B3940 ldr r0, =sub_80B3894 bl sub_80B37D4 b @080B3946 .align 2, 0 .pool @080B3940: ldr r0, =sub_80B37FC bl sub_80B37D4 @080B3946: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B3924 thumb_func_start sub_80B3950 sub_80B3950: ; 80B3950 push {lr} ldr r0, =sub_80B37FC movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x020229c6 ldr r2, =0x00002211 adds r0, r2, 0 strh r0, [r1] ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080B3994 ldr r0, =sub_80B33BC bl sub_80B37D4 b @080B399A .align 2, 0 .pool @080B3994: ldr r0, =sub_80B32B4 bl sub_80B37D4 @080B399A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B3968 thumb_func_start sub_80B39A4 sub_80B39A4: ; 80B39A4 push {lr} ldr r0, =sub_80B3728 movs r1, 0x50 bl AddTask bl script_env_2_set_ctx_paused pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B39A4 thumb_func_start sp02A_crash_sound sp02A_crash_sound: ; 80B39BC push {lr} ldr r0, =0x020375e4 ldrb r0, [r0] ldr r1, =c2_exit_to_overworld_1_continue_scripts_restart_music bl sub_80C4E74 pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375e4 strh r4, [r0] ldr r0, =0x02021cc4 lsls r1, r4, 3 subs r1, r4 lsls r1, 2 ldr r2, =0x020229f0 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, =0x02021dc4 ldr r2, =gUnknown_0855059C subs r1, 0x1 lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy movs r0, 0x1 b @080B3A2A .align 2, 0 .pool @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, =0x03005e00 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, =c2_800ACD4 bl set_callback2 adds r0, r4, 0 bl remove_task @080B3A62: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080B3AA6 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @080B3AA0 bl sub_800AA60 lsls r0, 24 cmp r0, 0 bne @080B3A86 bl sub_80097E8 ldr r0, =c2_800ACD4 bl set_callback2 @080B3A86: adds r0, r4, 0 bl remove_task b @080B3AA6 .align 2, 0 .pool @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, =0x03003124 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80B3AAC str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @080B3B20: cmp r0, 0x2 beq @080B3B68 cmp r0, 0x3 beq @080B3B9E b @080B3BB8 @080B3B2A: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080B3B40 adds r0, r4, 0 bl remove_task b @080B3BB8 .align 2, 0 .pool @080B3B40: bl sub_8009734 ldr r0, =task00_08081A90 movs r1, 0x1 bl AddTask b @080B3B96 .align 2, 0 .pool @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, =0x03003124 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 .pool thumb_func_end sub_80B3AF8 thumb_func_start sub_80B3BC4 sub_80B3BC4: ; 80B3BC4 push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @080B3BD6 ldr r1, =0x020229c6 ldr r2, =0x00002288 adds r0, r2, 0 strh r0, [r1] @080B3BD6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B3BC4 thumb_func_start sub_80B3BE8 sub_80B3BE8: ; 80B3BE8 push {r4-r7,lr} ldr r0, =0x030060a8 movs r1, 0 strb r1, [r0] ldr r0, =0x02038bfc strb r1, [r0] movs r4, 0 ldr r6, =0x02037350 @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, =0x030060a8 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, =0x030060a8 ldrb r4, [r0] adds r5, r0, 0 cmp r4, 0x1 bne @080B3C88 bl sub_80B12E8 ldr r2, =0x03006090 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, =0x030060ac strb r4, [r0] movs r0, 0x1 b @080B3CF4 .align 2, 0 .pool @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, =0x03006090 adds r7, r6, 0x4 ldr r5, =0x02038bfc @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, =0x030060a8 ldrb r0, [r0] cmp r4, r0 bcc @080B3CA0 @080B3CC6: bl sub_80B16A4 ldr r1, =0x02038bfc movs r0, 0 strb r0, [r1] ldr r1, =0x030060ac movs r0, 0x1 strb r0, [r1] movs r0, 0x1 b @080B3CF4 .align 2, 0 .pool @080B3CEC: ldr r1, =0x030060ac movs r0, 0 strb r0, [r1] movs r0, 0 @080B3CF4: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037350 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, =0x03006090 ldr r4, =0x030060a8 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, =0x02037350 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 .pool @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, =gUnknown_0855072C 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 .pool @080B3E4C: adds r0, r6, 0 b @080B3E90 @080B3E50: movs r5, 0 @080B3E52: ldr r0, =gUnknown_0855072C 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 .pool 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, =c3_8081EDC movs r1, 0x50 bl AddTask ldr r4, =0x03006090 ldr r3, =0x030060a8 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, =0x03005e00 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 .pool thumb_func_end sub_80B406C thumb_func_start sub_80B40C8 sub_80B40C8: ; 80B40C8 push {r4,r5,lr} adds r2, r0, 0 ldr r0, =0x02038bfc ldrb r0, [r0] cmp r0, 0 bne @080B40E4 ldr r0, =0x03006090 ldrb r5, [r0, 0x8] b @080B40E8 .align 2, 0 .pool @080B40E4: ldr r0, =0x03006090 ldrb r5, [r0, 0x14] @080B40E8: ldr r4, =c3_8081EDC adds r0, r5, 0 adds r1, r4, 0 bl set_task_function_and_args_14_15 ldr r1, =0x03005e00 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 .pool 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, =0x03005e00 adds r4, r0, r1 movs r0, 0x16 ldrsh r1, [r4, r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool @080B4150: ldr r7, =gUnknown_0855073C @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 .pool 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, =0x02038c08 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02038c08 movs r1, 0x10 ldrsh r0, [r4, r1] str r0, [r2] movs r1, 0x12 ldrsh r0, [r4, r1] str r0, [r2, 0x4] ldr r3, =0x02020630 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 .pool 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, =0x02020630 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 .pool 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, =0x03005e00 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, =gUnknown_0855076C 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 .pool @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, =sub_80B44C8 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, =0x03005e08 adds r0, r1 adds r0, 0x2 adds r1, r4, 0 bl sub_806F67C pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B4578 thumb_func_start sub_80B45AC sub_80B45AC: ; 80B45AC push {lr} ldr r0, =sub_80B45BC bl sub_80B40C8 pop {r0} bx r0 .align 2, 0 .pool 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, =0x030060a8 ldrb r0, [r0] cmp r0, 0x2 bne @080B4610 ldr r1, =0x02038bfc ldrb r0, [r1] cmp r0, 0 bne @080B460C adds r0, 0x1 strb r0, [r1] ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] bl sub_809757C ldr r0, =0x03006090 ldrb r0, [r0, 0xC] bl sub_80974D0 b @080B4616 .align 2, 0 .pool @080B460C: movs r0, 0 strb r0, [r1] @080B4610: ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] @080B4616: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B45D0 thumb_func_start oei_exclamation_mark oei_exclamation_mark: ; 80B4620 push {lr} ldr r0, =gUnknown_085507B4 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, =0x02020630 adds r0, r1 movs r1, 0 movs r2, 0 bl sub_80B46D8 @080B4648: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end oei_exclamation_mark thumb_func_start sub_80B4658 sub_80B4658: ; 80B4658 push {lr} ldr r0, =gUnknown_085507B4 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, =0x02020630 adds r0, r1 movs r1, 0x21 movs r2, 0x1 bl sub_80B46D8 @080B4680: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B4658 thumb_func_start sub_80B4690 sub_80B4690: ; 80B4690 push {r4,lr} ldr r0, =gUnknown_085507CC 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, =0x02020630 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 .pool 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, =0x02038c08 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, =0x0000fffb 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 .pool 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, =0x02037350 mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 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 .pool @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, =0x02038bfc ldrb r0, [r0] cmp r0, 0 beq @080B47D4 ldr r0, =0x03006090 ldrb r0, [r0, 0xC] b @080B47D8 .align 2, 0 .pool @080B47D4: ldr r0, =0x03006090 ldrb r0, [r0] @080B47D8: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03006090 ldrb r0, [r0, 0xC] b @080B4800 .align 2, 0 .pool @080B47FC: ldr r0, =0x03006090 ldrb r0, [r0] @080B4800: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B47E0 thumb_func_start sub_80B4808 sub_80B4808: ; 80B4808 push {lr} ldr r0, =0x030060ac ldrb r0, [r0] cmp r0, 0x1 bne @080B4870 ldr r2, =0x03006090 ldr r0, =0x03006080 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, =0x02037350 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, =0x03006084 strb r0, [r3] movs r0, 0xFE strb r0, [r3, 0x1] ldr r0, =0x03005d8c ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] movs r0, 0xFF bl exec_movement b @080B489E .align 2, 0 .pool @080B4870: ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldrb r0, [r0, 0x18] lsls r0, 28 lsrs r0, 28 bl d2s_look1 ldr r3, =0x03006084 strb r0, [r3] movs r0, 0xFE strb r0, [r3, 0x1] ldr r0, =0x03005d8c 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 .pool thumb_func_end sub_80B4808 thumb_func_start sub_80B48B8 sub_80B48B8: ; 80B48B8 ldr r1, =0x02038c00 strb r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_08553A7C 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, =0x02037318 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 .pool @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, =0x03005d8c 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, =gUnknown_08553A7C 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 .pool @080B4A04: movs r0, 0x1 b @080B4A7C @080B4A08: ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00002e6a adds r0, r3 ldrh r0, [r0] bl sub_80B4AB8 movs r5, 0 ldr r6, =0x000001bf @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 .pool thumb_func_end sub_80B4984 thumb_func_start sub_80B4A98 sub_80B4A98: ; 80B4A98 ldr r2, =0x02038c04 ldr r1, [r2] ldr r0, =0x41c64e6d muls r0, r1 ldr r1, =0x00003039 adds r0, r1 str r0, [r2] lsrs r0, 16 bx lr .align 2, 0 .pool thumb_func_end sub_80B4A98 thumb_func_start sub_80B4AB8 sub_80B4AB8: ; 80B4AB8 lsls r0, 16 lsrs r0, 16 ldr r1, =0x02038c04 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x020244ec 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 .pool @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, =gWildMonHeaders ldrb r1, [r0] adds r5, r0, 0 cmp r1, 0xFF beq @080B4D6C ldr r6, =0x00006a18 @080B4D08: lsls r0, r4, 2 adds r0, r4 lsls r0, 2 adds r3, r0, r5 ldrb r1, [r3] ldr r0, =0x03005d8c 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, =0x0000403e 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 .pool @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, =0x0000ffff @080B4D6E: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x020244ec 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 .pool @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, =gBaseStats 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, =0x020244ec 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 .pool @080B4F00: movs r4, 0xFE @080B4F02: bl sub_80B4D78 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02024744 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 .pool @080B4F28: bl sub_80B4D78 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02024744 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 .pool 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, =0x02037318 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 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002b94 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 .pool @080B508C: ldr r0, =0x03005d8c ldr r1, [r0] ldr r2, =0x00002b90 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, =0x03005d8c ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00002b98 adds r0, r2 adds r0, r1 ldrh r1, [r0] lsls r2, r4, 24 lsrs r2, 24 ldr r0, =0x02024744 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 .pool thumb_func_end sub_80B505C thumb_func_start sub_80B50DC sub_80B50DC: ; 80B50DC push {r4,lr} ldr r4, =0x03005d8c ldr r2, [r4] ldr r1, =0x00002b90 adds r0, r2, r1 ldrh r0, [r0] cmp r0, 0 beq @080B513C movs r1, 0x5 ldrsb r1, [r2, r1] ldr r3, =0x00002b92 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, =0x00002ba1 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 .pool @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, =0x020244ec 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, =0x02037318 ldrh r1, [r0, 0x12] ldr r0, =0x00000169 cmp r1, r0 bne @080B5210 ldr r1, [sp] lsls r0, r1, 1 adds r0, r1 lsrs r0, 2 b @080B5214 .align 2, 0 .pool @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, =0x03005d8c 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 .pool 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, =0x03005d8c 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 .pool @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, =0x02038c00 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, =0x0000ffff cmp r5, r0 bne @080B539C ldr r0, =0x02037318 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, =gUnknown_08553A14 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 .pool @080B5330: ldr r0, =0x00000169 cmp r1, r0 beq @080B5338 b @080B54FE @080B5338: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb2 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, =gUnknown_08553894 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 .pool @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, =gWildMonHeaders 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, =gWildMonHeaders 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, =gWildMonHeaders 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 .pool @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, =gWildMonHeaders 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, =gWildMonHeaders 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000031dc 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 .pool @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, =0x0000ffff cmp r2, r0 beq @080B5568 ldr r1, =gWildMonHeaders 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, =0x020375f0 strh r4, [r0] b @080B556E .align 2, 0 .pool @080B5568: ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] @080B556E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff cmp r4, r0 bne @080B562C ldr r0, =0x02037318 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, =gUnknown_08553A14 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 .pool @080B55E4: ldr r0, =0x00000169 cmp r1, r0 beq @080B55EC b @080B56F2 @080B55EC: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 ldrh r4, [r0] ldr r1, =gUnknown_08553894 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 .pool @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, =gWildMonHeaders 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 .pool @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, =gWildMonHeaders 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 .pool @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, =0x0000ffff cmp r2, r0 beq @080B572C ldr r0, =gWildMonHeaders 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 .pool @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, =gUnknown_08553A78 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 .pool @080B5764: ldr r4, =gWildMonHeaders 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 .pool 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, =0x0000ffff cmp r3, r0 beq @080B57D2 ldr r2, =gWildMonHeaders 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 .pool @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, =0x0000ffff cmp r2, r0 beq @080B5868 ldr r1, =gWildMonHeaders 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 .pool @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, =0x00004021 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, =gUnknown_082A4B2A bl script_env_1_execute_new_script movs r0, 0x1 b @080B58C6 .align 2, 0 .pool @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, =0x00004021 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, =0x020244ec 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 .pool @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, =0x020244ec 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 .pool @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, =gBaseStats 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 .pool @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, =0x020244ec 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 .pool @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, =0x000008ad 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 .pool @080B5AD0: ldr r0, =0x000008ae 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 .pool thumb_func_end sub_80B5AB0 thumb_func_start sub_80B5AF0 sub_80B5AF0: ; 80B5AF0 push {r4,lr} adds r4, r0, 0 ldr r0, =0x020244ec 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 .pool 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, =gUnknown_082DB9D4 lsls r4, 2 adds r4, r0 ldr r0, [r4] str r0, [sp] add r4, sp, 0x4 ldr r5, =gUnknown_0855C1F0 @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 .pool 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, =0xffff0000 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 .pool 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, =0x0000ffff cmp r3, r0 beq @080B5D58 movs r2, 0 ldr r5, =0x02020630 @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 .pool 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, =0x0000ffff cmp r5, r0 beq @080B5DB0 movs r2, 0 ldr r6, =0x02020630 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 .pool 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, =0x03000f58 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 .pool 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, =0x03000f58 @080B5DEE: adds r1, r2, r4 ldrb r0, [r1] cmp r0, 0xFF bne @080B5E00 strb r3, [r1] b @080B5E0A .align 2, 0 .pool @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, =0x03000f58 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 .pool @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, =0x03000f58 @080B5E4A: adds r0, r1, r3 ldrb r0, [r0] cmp r0, r2 bne @080B5E5C movs r0, 0x1 b @080B5E68 .align 2, 0 .pool @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, =gTrainerPaletteTable mov r8, r3 add r8, r4 mov r0, r8 adds r1, r7, 0 bl gpu_pal_obj_decompress_and_apply2 ldr r0, =gTrainerPicTable 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, =gUnknown_0855C210 str r0, [sp, 0x4] ldr r0, =gUnknown_082EC69C str r0, [sp, 0x8] str r2, [sp, 0xC] ldr r0, =gUnknown_082EC6A8 str r0, [sp, 0x10] ldr r0, =nullsub_12 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 .pool 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, =gTrainerPicTable lsrs r4, 21 adds r0, r4, r0 ldr r0, [r0] bl call_LZZUnCompVram ldr r0, =gTrainerPaletteTable 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 .pool 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, =gUnknown_0855C230 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_0855C244 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 .pool 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, =gMonPaletteTable 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, =0x0000ffff cmp r5, r0 beq @080B5FDC lsls r0, r5, 24 lsrs r0, 24 b @080B5FDE .align 2, 0 .pool @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, =0x0000ffff cmp r4, r0 beq @080B605C lsls r0, r4, 24 lsrs r0, 24 b @080B605E .align 2, 0 .pool @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, =0x02037714 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, =0x02037b14 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 .pool 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, =0x02037714 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, =0x02037b14 adds r0, r1 strh r4, [r0] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80B61E4 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e00 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 .pool 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, =0x03005e00 adds r1, r0 ldr r2, =gUnknown_0855C364 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 .pool 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, =0x02020630 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 .pool thumb_func_end sub_80B6250 thumb_func_start sub_80B628C sub_80B628C: ; 80B628C push {lr} adds r3, r0, 0 ldr r2, =0x02020630 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 .pool thumb_func_end sub_80B628C thumb_func_start sub_80B62B4 sub_80B62B4: ; 80B62B4 push {lr} ldr r2, =0x02020630 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, =sub_80B61E4 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @080B62E6: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80B6330 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e00 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 .pool 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, =0x03005e00 adds r1, r0 ldr r2, =gUnknown_0855C374 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 .pool 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, =sub_80B6330 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 .pool thumb_func_end sub_80B6360 thumb_func_start sub_80B63D4 sub_80B63D4: ; 80B63D4 push {lr} adds r3, r0, 0 ldr r2, =0x02020630 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 .pool thumb_func_end sub_80B63D4 thumb_func_start sub_80B6404 sub_80B6404: ; 80B6404 push {lr} adds r3, r0, 0 ldr r2, =0x02020630 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 .pool thumb_func_end sub_80B6404 thumb_func_start sub_80B642C sub_80B642C: ; 80B642C push {lr} ldr r2, =0x02020630 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, =sub_80B6330 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @080B645E: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80B64C0 bl obj_add_empty_with_callback lsls r0, 24 lsrs r0, 24 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r2, =0x02020630 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 .pool thumb_func_end sub_80B646C thumb_func_start sub_80B64C0 sub_80B64C0: ; 80B64C0 push {lr} ldr r2, =gUnknown_0855C384 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 .pool 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, =gUnknown_0855C304 ldr r1, =gUnknown_0855C3A4 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, =0x02020630 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 .pool 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, =0x00001007 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, =gUnknown_0855C3BC adds r1, r4, r6 ldrb r1, [r1] ldr r5, =gUnknown_0855C3C0 adds r2, r4, r5 ldrb r2, [r2] ldr r3, =gUnknown_0855C3C4 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, =0x01050000 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, =0x01030000 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 .pool 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, =0x00001007 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, =gUnknown_0855C3BC adds r1, r4, r1 ldrb r6, [r1] ldr r1, =gUnknown_0855C3C0 adds r1, r4, r1 ldrb r5, [r1] ldr r1, =gUnknown_0855C3C4 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, =0x01050000 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, =0x01030000 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 .pool 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, =0x02020630 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 .pool 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, =gUnknown_0855C31C 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, =0x02020630 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, =gUnknown_0855C2AC bl obj_set_f18_to_r0_f42_to_40 adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0855C334 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, =0x02020630 adds r0, r1 ldr r1, =gUnknown_0855C2C4 bl obj_set_f18_to_r0_f42_to_40 b @080B6948 .align 2, 0 .pool @080B6934: ldr r0, =gUnknown_0855C34C 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, =0x02020630 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 .pool thumb_func_end sub_80B68EC thumb_func_start sub_80B6970 sub_80B6970: ; 80B6970 push {lr} adds r3, r0, 0 ldr r2, =0x03005e00 movs r0, 0x2E ldrsh r1, [r3, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 movs 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 .pool thumb_func_end sub_80B6970 thumb_func_start sub_80B69DC sub_80B69DC: ; 80B69DC push {lr} ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 ldr r1, =0x03005dac ldr r0, =mapldr_080842E8 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B69DC thumb_func_start mapldr_080842E8 mapldr_080842E8: ; 80B69FC push {lr} bl pal_fill_black ldr r0, =task00_8084310 movs r1, 0 bl AddTask bl script_env_2_enable bl player_bitmagic ldr r1, =0x03005dac movs r0, 0 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02038c08 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, =c2_load_new_map bl set_callback2 ldr r1, =0x03005dac ldr r0, =mapldr_08084390 str r0, [r1] adds r0, r5, 0 bl remove_task @080B6A8A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =c3_080843F8 movs r1, 0 bl AddTask ldr r4, =0x02037350 ldr r3, =0x02037590 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, =0x03005dac movs r0, 0 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bne @080B6B3E ldr r0, =0x02037fd4 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 .pool 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, =sub_80B6B94 movs r1, 0 bl AddTask ldr r1, =0x03005dac movs r0, 0 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r1, r0 ldr r5, =gUnknown_0855C3C8 @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 .pool 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, =0x02037590 ldrb r0, [r6, 0x5] lsls r5, r0, 3 adds r5, r0 lsls r5, 2 ldr r0, =0x02037350 mov r8, r0 add r5, r8 ldrb r0, [r6, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool 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, =0x02037590 ldrb r0, [r6, 0x4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 ldr r0, =0x02020630 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, =0x02021bbe 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, =0x02037350 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 .pool thumb_func_end sub_80B6C90 thumb_func_start sub_80B6D04 sub_80B6D04: ; 80B6D04 push {r4-r6,lr} adds r4, r0, 0 ldr r2, =0x02037590 ldrb r1, [r2, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r6, r0, r1 ldrb r1, [r2, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool 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, =0x02037590 movs r0, 0 strb r0, [r1, 0x6] bl script_env_2_disable bl sub_808EE8C bl sub_809757C bl sub_808A2E4 ldr r0, =sub_80B6B94 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 .pool 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, =sub_80B6E88 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0xA] cmp r4, 0x6A bne @080B6E78 movs r0, 0x1 strh r0, [r1, 0xA] @080B6E78: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r1, r0 ldr r5, =gUnknown_0855C3E4 @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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02037590 ldrb r0, [r0, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool thumb_func_end sub_80B6FB8 thumb_func_start sub_80B7004 sub_80B7004: ; 80B7004 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x02037590 ldrb r0, [r0, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool 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, =0x02037fd4 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, =0x03005dac ldr r0, =sub_80B70B4 str r0, [r1] ldr r0, =c2_load_new_map bl set_callback2 ldr r0, =sub_80B6E88 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @080B709C: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80B70DC movs r1, 0 bl AddTask ldr r1, =0x03005dac movs r0, 0 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r1, r0 ldr r5, =gUnknown_0855C3FC @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 .pool 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, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 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 .pool @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, =0x02037590 ldrb r0, [r0, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool thumb_func_end sub_80B7190 thumb_func_start sub_80B71D0 sub_80B71D0: ; 80B71D0 push {r4,r5,lr} adds r4, r0, 0 ldr r0, =0x02037590 ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool thumb_func_end sub_80B71D0 thumb_func_start sub_80B7230 sub_80B7230: ; 80B7230 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x02037590 ldrb r0, [r0, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool thumb_func_end sub_80B7230 thumb_func_start sub_80B7270 sub_80B7270: ; 80B7270 push {r4,r5,lr} adds r4, r0, 0 ldr r0, =0x02037590 ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =sub_80B70DC 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 .pool thumb_func_end sub_80B72F4 thumb_func_start oei_waterfall oei_waterfall: ; 80B734C push {r4,lr} ldr r4, =sub_80B7384 adds r0, r4, 0 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =0x02038c08 ldr r2, [r2] strh r2, [r1, 0xA] bl _call_via_r4 movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0855C418 ldr r2, =0x03005e00 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, =0x02037590 ldrb r0, [r0, 0x5] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 ldr r0, =0x02037350 adds r1, r0 ldr r2, [r2] adds r0, r4, 0 bl _call_via_r2 lsls r0, 24 cmp r0, 0 bne @080B7396 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037590 movs r0, 0x1 strb r0, [r1, 0x6] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038c08 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 .pool 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, =0x02037590 strb r4, [r0, 0x6] ldr r0, =sub_80B7384 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 .pool @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, =sub_80B750C adds r0, r4, 0 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r3, =0x02038c08 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 .pool 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, =gUnknown_0855C42C ldr r2, =0x03005e00 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 .pool thumb_func_end sub_80B750C thumb_func_start dive_1_lock dive_1_lock: ; 80B7544 ldr r2, =0x02037590 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 .pool 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, =0x02038c08 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 .pool 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, =0x02037350 ldr r0, =0x02037590 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, =sub_80B750C 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 .pool 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, =sub_80B75F0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0855C438 ldr r2, =0x03005e00 ldr r5, =0x02037590 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, =0x02037350 adds r1, r0 ldrb r0, [r5, 0x4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 ldr r0, =0x02020630 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 .pool 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, =0x02037590 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 .pool 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, =0x02038c08 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 .pool 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, =0x02021bbe 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 .pool @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, =0x02037fd4 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, =0x03005dac ldr r0, =mapldr_080851BC str r0, [r1] ldr r0, =c2_load_new_map bl set_callback2 ldr r0, =sub_80B75F0 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 .pool 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, =0x03005dac movs r1, 0 str r1, [r0] ldr r0, =sub_80B7890 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0855C450 ldr r2, =0x03005e00 ldr r5, =0x02037590 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, =0x02037350 adds r1, r0 ldrb r0, [r5, 0x4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 ldr r0, =0x02020630 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 .pool 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, =0x02037590 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 .pool 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, =0x02038c08 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 .pool 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, =0x02020630 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 .pool 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, =0x02037590 movs r0, 0 strb r0, [r1, 0x6] bl script_env_2_disable bl sub_809757C ldr r0, =sub_80B7890 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 .pool thumb_func_end sub_80B79BC thumb_func_start sub_80B79F4 sub_80B79F4: ; 80B79F4 push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =sub_80B7A8C bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0855C460 ldr r2, =0x03005e00 ldr r5, =0x02037590 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, =0x02037350 adds r1, r0 ldrb r0, [r5, 0x4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 ldr r0, =0x02020630 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 .pool 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, =0x02037590 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 .pool 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, =0x02038c08 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 .pool @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, =0x02020630 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 .pool 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, =0x02037fd4 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, =0x03005dac ldr r0, =sub_80B6B68 str r0, [r1] ldr r0, =c2_load_new_map bl set_callback2 ldr r0, =sub_80B7A8C 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 .pool thumb_func_end sub_80B7BF4 thumb_func_start sub_80B7C48 sub_80B7C48: ; 80B7C48 push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =sub_80B7CE4 movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0855C474 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_0855C47C 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r5, r0, r1 adds r0, r5, 0 bl 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, =0x02037fd4 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, =0x03005dac ldr r0, =mapldr_080859D4 str r0, [r1] ldr r0, =c2_load_new_map bl set_callback2 ldr r0, =sub_80B7CE4 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task b @080B7E40 .align 2, 0 .pool @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, =0x03005dac movs r0, 0 str r0, [r1] ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x1] ldr r0, =sub_80B7E94 movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0855C484 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_0855C47C mov r0, sp movs r2, 0x5 bl memcpy ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =sub_80B7E94 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task b @080B7FC0 .align 2, 0 .pool @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, =sub_80B7FDC movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0855C48C ldr r2, =0x03005e00 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 .pool 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, =gUnknown_0855C47C mov r0, sp movs r2, 0x5 bl memcpy ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =gUnknown_0855C47C mov r0, sp movs r2, 0x5 bl memcpy ldr r2, =0x02037590 ldrb r1, [r2, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r3, r0, r1 ldrb r1, [r2, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool thumb_func_end sub_80B80C4 thumb_func_start sub_80B8198 sub_80B8198: ; 80B8198 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02037fd4 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, =c2_load_new_map bl set_callback2 ldr r1, =0x03005dac ldr r0, =mapldr_08085D88 str r0, [r1] ldr r0, =sub_80B7FDC 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 .pool 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, =0x03005dac movs r0, 0 str r0, [r1] ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x1] bl sub_808EEDC ldr r0, =sub_80B8250 movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0855C49C ldr r2, =0x03005e00 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 .pool 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, =0x02037590 ldrb r0, [r5, 0x4] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 ldr r0, =0x02020630 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, =0x02021bbe adds r1, r4 ldrh r3, [r3] adds r1, r3 asrs r0, 16 adds r0, r1 negs r0, r0 strh r0, [r2, 0x26] ldr r3, =0x02037350 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 .pool 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, =gUnknown_0855C47C mov r0, sp movs r2, 0x5 bl memcpy ldr r2, =0x02037590 ldrb r1, [r2, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r6, r0, r1 ldrb r1, [r2, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool @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, =gUnknown_0855C47C mov r0, sp movs r2, 0x5 bl memcpy ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =sub_80B8250 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 .pool 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, =sub_80B8554 b @080B84BE .align 2, 0 .pool @080B84BC: ldr r0, =sub_80B88B4 @080B84BE: movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r4, r0, 24 ldr r2, =0x02038c08 ldr r0, [r2] ldr r1, [r2, 0x4] ldr r2, [r2, 0x8] bl sub_80B8C60 ldr r2, =0x03005e00 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 .pool thumb_func_end sub_80B849C thumb_func_start sub_80B84F8 sub_80B84F8: ; 80B84F8 push {r4-r6,lr} ldr r5, =0x02038c08 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, =0x020244ec 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 .pool 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, =gUnknown_0855C4A8 ldr r2, =0x03005e00 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 .pool thumb_func_end sub_80B8554 thumb_func_start sub_80B8584 sub_80B8584: ; 80B8584 push {r4,lr} adds r4, r0, 0 ldr r0, =0x04000048 ldrh r0, [r0] strh r0, [r4, 0x1E] ldr r0, =0x0400004a ldrh r0, [r0] strh r0, [r4, 0x20] adds r0, r4, 0 adds r0, 0x22 ldr r1, =0x030022c0 ldr r1, [r1, 0xC] bl sub_806F67C ldr r1, =0x0000f0f1 strh r1, [r4, 0xA] ldr r0, =0x00005051 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, =sub_80B880C bl SetVBlankCallback ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x04000008 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, =gUnknown_0855AE50 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, =0x05000200 mov r0, sp adds r1, r5, 0 bl CpuSet ldr r0, =gUnknown_0855B050 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 .pool 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, =0x02020630 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, =sub_80B8CC0 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 .pool 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, =0x02020630 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 .pool 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, =0x04000008 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, =0x05000200 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 .pool 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, =0x02020630 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, =sub_80B8554 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 .pool thumb_func_end overworld_bg_setup_2 thumb_func_start sub_80B880C sub_80B880C: ; 80B880C push {r4,lr} sub sp, 0x4 ldr r0, =sub_80B8554 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e00 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 .pool 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, =0x06000140 adds r2, r0, r1 movs r1, 0 ldr r5, =gUnknown_0855B070 movs r0, 0xF0 lsls r0, 8 adds r4, r0, 0 ldr r3, =0x0000013f @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 .pool 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, =gUnknown_0855C4C4 ldr r2, =0x03005e00 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 .pool 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, =0x030022c0 ldr r1, [r1, 0xC] bl sub_806F67C ldr r0, =sub_80B8AE0 bl SetVBlankCallback ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x04000008 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, =gUnknown_0855B2F0 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, =0x05000200 mov r0, sp adds r1, r4, 0 bl CpuSet ldr r0, =gUnknown_0855B370 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 .pool 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, =0x00002878 movs r0, 0x46 bl lcd_io_set ldr r2, =0x02020630 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, =sub_80B8CC0 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 .pool 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, =0x02020630 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 .pool 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, =0x0000ffff 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 .pool 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, =0x04000008 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, =0x05000200 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, =0x02020630 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, =sub_80B88B4 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 .pool thumb_func_end sub_80B8A64 thumb_func_start sub_80B8AE0 sub_80B8AE0: ; 80B8AE0 push {r4,lr} sub sp, 0x4 ldr r0, =sub_80B88B4 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e00 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 .pool 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, =0x06000140 adds r1, r0 mov r8, r1 movs r4, 0 ldr r7, =gUnknown_0855B390 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 .pool 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, =0x06000140 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 .pool 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, =0x7fffffff 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, =0x02020630 adds r2, r1 ldr r1, =nullsub_12 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 .pool 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, =sub_80B8D04 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 .pool @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, =sub_80B8D20 str r0, [r1, 0x1C] @080B8D18: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80B8D84 movs r1, 0xFF bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =0x02038c08 ldr r0, [r0] strh r0, [r1, 0x26] bl sav1_reset_x2C ldr r0, =0x0000016d bl sub_80858C4 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0855C4E0 ldr r2, =0x03005e00 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 .pool 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, =0x02037590 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, =0x02037350 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 .pool thumb_func_end sub_80B8DB4 thumb_func_start sub_80B8E14 sub_80B8E14: ; 80B8E14 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 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 .pool thumb_func_end sub_80B8E14 thumb_func_start sub_80B8E60 sub_80B8E60: ; 80B8E60 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 bl npc_get_bit7_or_const_x10_when_inactive lsls r0, 24 cmp r0, 0 beq @080B8E96 ldr r2, =0x02038c08 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 .pool 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, =0x02037590 ldrb r0, [r5, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 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, =0x02038c08 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 .pool thumb_func_end sub_80B8EA8 thumb_func_start sub_80B8F24 sub_80B8F24: ; 80B8F24 push {r4,r5,lr} ldr r5, =0x02037590 ldrb r1, [r5, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =sub_80B8D84 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 .pool thumb_func_end sub_80B8F24 thumb_func_start sub_80B8F98 sub_80B8F98: ; 80B8F98 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =gUnknown_085059F8 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, =0x02020630 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, =0x0000ffff strh r0, [r1, 0x34] ldrh r0, [r1, 0x22] strh r0, [r1, 0x36] strh r2, [r1, 0x38] ldr r1, =0x00003e41 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000e0e movs r0, 0x52 bl lcd_io_set ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r0, =gUnknown_0855B610 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, =0x0600f800 ldr r0, =0x0000bff4 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, =gUnknown_0855B630 @080B904A: movs r4, 0 adds r7, r0, 0x1 lsls r6, r0, 5 @080B9050: lsls r1, r4, 2 adds r1, r6, r1 ldr r0, =0x06008020 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, =0x06008022 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 .pool thumb_func_end sub_80B8F98 thumb_func_start sub_80B90CC sub_80B90CC: ; 80B90CC push {r4,lr} ldr r0, =gUnknown_085059F8 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, =0x02020630 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, =sub_80B9128 str r0, [r2, 0x1C] ldr r0, =0x02038c08 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 .pool 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, =0x02020630 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 .pool thumb_func_end sub_80B9128 thumb_func_start sub_80B91A4 sub_80B91A4: ; 80B91A4 push {lr} ldr r0, =sub_80B91D4 movs r1, 0xFE bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =0x02038c08 ldr r0, [r0] strh r0, [r1, 0xA] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0855C4F4 ldr r2, =0x03005e00 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 .pool thumb_func_end sub_80B91D4 thumb_func_start sub_80B9204 sub_80B9204: ; 80B9204 push {r4-r6,lr} adds r5, r0, 0 ldr r6, =0x02037590 ldrb r1, [r6, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 bl 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 .pool thumb_func_end sub_80B9204 thumb_func_start sub_80B925C sub_80B925C: ; 80B925C push {r4,lr} adds r4, r0, 0 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =0x02038c08 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 movs r1, 0x2 bl npc_set_state_2 @080B932C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B92F8 thumb_func_start sub_80B933C sub_80B933C: ; 80B933C push {r4,lr} adds r4, r0, 0 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =0x02020630 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 .pool 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, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 adds r0, r4, 0 bl npc_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 .pool 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, =0x02037fd4 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, =sub_80B91D4 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @080B94B6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B9494 thumb_func_start sub_80B94C4 sub_80B94C4: ; 80B94C4 push {lr} ldr r0, =gUnknown_085059F8 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, =0x02020630 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, =sub_80B957C str r1, [r2, 0x1C] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80B94C4 thumb_func_start sub_80B9508 sub_80B9508: ; 80B9508 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 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 .pool 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, =0x02020630 adds r4, r0 ldr r0, =sub_80B963C 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 .pool 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, =0x02020630 lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 strh r1, [r2, 0x3A] bx lr .align 2, 0 .pool 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, =gUnknown_0855C548 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, =0x0000ffd0 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, =0x000007ff 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 .pool 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, =0x02020630 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 .pool 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, =gUnknown_0855C548 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, =0x0000ffe0 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 .pool 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, =0x02020630 lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80B96B0 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80B9794 thumb_func_start sub_80B97C0 sub_80B97C0: ; 80B97C0 push {lr} ldr r0, =sub_80B97D4 movs r1, 0xFE bl AddTask movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0855C550 ldr r2, =0x03005e00 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 .pool thumb_func_end sub_80B97D4 thumb_func_start sub_80B9804 sub_80B9804: ; 80B9804 push {r4-r6,lr} adds r5, r0, 0 ldr r6, =0x02037590 ldrb r1, [r6, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 adds r0, r4, 0 bl 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, =0x02020630 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldrb r0, [r0, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool 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, =gUnknown_0855C56C mov r0, sp movs r2, 0x24 bl memcpy ldr r0, =0x02037590 ldrb r0, [r0, 0x4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 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 .pool 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, =0x02037590 ldrb r0, [r0, 0x5] lsls r5, r0, 3 adds r5, r0 lsls r5, 2 ldr r0, =0x02037350 adds r5, r0 ldrb r0, [r5, 0x4] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool thumb_func_end sub_80B9978 thumb_func_start sub_80B99F0 sub_80B99F0: ; 80B99F0 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02020630 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 .pool 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, =0x02037590 ldrb r1, [r6, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =sub_80B97D4 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 .pool thumb_func_end fishE thumb_func_start sub_80B9ADC sub_80B9ADC: ; 80B9ADC push {r4,lr} sub sp, 0x4 ldr r4, =0x02038c08 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, =sub_80B9BE8 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 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 .pool @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, =0x03005e08 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 .pool @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, =0x03005e00 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 .pool 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, =0x03005e08 adds r4, r0 bl sub_808A2E4 movs r0, 0 bl sub_808A2C0 ldr r1, =gUnknown_0855C590 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 .pool thumb_func_end sub_80B9BE8 thumb_func_start sub_80B9C28 sub_80B9C28: ; 80B9C28 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =sub_80B9B3C 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 .pool 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, =0x02037350 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, =0x02020630 adds r4, r0 ldrb r0, [r1, 0x1] movs r2, 0x20 orrs r0, r2 strb r0, [r1, 0x1] ldr r6, =0x0000ffff ldr r5, =0x00007fff 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080B9D16 ldr r0, =sub_80B9B3C 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 .pool 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, =0x03005dec 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, =0x03005de8 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, =gUnknown_0855C5EC 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, =0x02020630 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 .pool 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, =0x02038c08 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, =0x02037350 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, =sub_80B9EDC movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 adds r2, r1 ldrb r0, [r4, 0x4] strh r0, [r2, 0xA] ldr r3, =0x02020630 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 .pool 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, =0x03005e08 adds r5, r0, r1 movs r0, 0x2 ldrsh r1, [r5, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool @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, =0x02037350 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 .pool thumb_func_end sub_80B9EDC thumb_func_start remove_some_task remove_some_task: ; 80B9FB8 push {r4,lr} ldr r4, =0x02039b28 movs r0, 0 strb r0, [r4, 0x15] ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff 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 .pool 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, =0x02038c28 ldr r2, =0x01000780 bl CpuSet ldr r0, =0x02039b28 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 .pool 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, =0xa2600001 cmp r1, r0 bne @080BA06C ldr r0, =0x02039b28 ldr r1, =0x02038c2a str r1, [r0] movs r2, 0xF0 lsls r2, 3 adds r1, r2 str r1, [r0, 0x4] ldr r1, =sub_80BA134 b @080BA07C .align 2, 0 .pool @080BA06C: ldr r0, =0x02039b28 ldr r1, =0x02038c2c str r1, [r0] movs r2, 0xF0 lsls r2, 3 adds r1, r2 str r1, [r0, 0x4] ldr r1, =sub_80BA154 @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 .pool thumb_func_end sub_80BA038 thumb_func_start sub_80BA0A8 sub_80BA0A8: ; 80BA0A8 push {r4,lr} ldr r4, =0x02039b28 ldrb r0, [r4, 0x15] cmp r0, 0 beq @080BA122 cmp r0, 0x3 bne @080BA0EC movs r0, 0 strb r0, [r4, 0x15] ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff ands r0, r2 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] ldr r1, =0x02039b44 movs r0, 0x1 strb r0, [r1] b @080BA122 .align 2, 0 .pool @080BA0EC: ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff 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 .pool thumb_func_end sub_80BA0A8 thumb_func_start sub_80BA134 sub_80BA134: ; 80BA134 ldr r0, =0x02039b28 ldr r2, [r0, 0x8] ldrb r1, [r0, 0x14] lsls r0, r1, 4 subs r0, r1 lsls r0, 7 ldr r1, =0x02038c28 adds r0, r1 ldrh r0, [r0] strh r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_80BA134 thumb_func_start sub_80BA154 sub_80BA154: ; 80BA154 ldr r0, =0x02039b28 ldr r2, [r0, 0x8] ldrb r1, [r0, 0x14] lsls r0, r1, 4 subs r0, r1 lsls r0, 7 ldr r1, =0x02038c28 adds r0, r1 ldr r0, [r0] str r0, [r2] bx lr .align 2, 0 .pool 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, =0x02039b44 ldrb r0, [r0] cmp r0, 0 beq @080BA1A4 mov r0, r12 bl remove_task ldr r1, =0x02039b28 movs r0, 0xFF strb r0, [r1, 0x18] b @080BA324 .align 2, 0 .pool @080BA1A4: ldr r1, =0x03005e00 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, =@080BA1D8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022e14 b @080BA24E .align 2, 0 .pool @080BA21C: ldr r0, =0x02022e16 b @080BA24E .align 2, 0 .pool @080BA224: ldr r0, =0x02022e18 b @080BA24E .align 2, 0 .pool @080BA22C: ldr r0, =0x02022e1a b @080BA24E .align 2, 0 .pool @080BA234: ldr r0, =0x02022e1c b @080BA24E .align 2, 0 .pool @080BA23C: ldr r0, =0x02022e1e b @080BA24E .align 2, 0 .pool @080BA244: ldr r0, =0x02022e20 b @080BA24E .align 2, 0 .pool @080BA24C: ldr r0, =0x02022e22 @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, =0x02038c28 ldr r0, =0x02039b28 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 .pool @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, =0x02038c28 adds r7, r1, 0 lsls r0, r2, 1 adds r4, r0, r5 ldr r0, =0x02039b28 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 .pool 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, =gUnknown_08329F40 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 .pool 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, =0x04000010 add r0, r9 str r0, [sp] ldr r0, =0xa2600001 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, =task00_for_dp12 movs r1, 0 bl AddTask lsls r0, 24 lsrs r7, r0, 24 ldr r0, =0x03005e00 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, =0x02039b28 strb r7, [r0, 0x18] ldr r0, =0x02039b44 movs r1, 0 strb r1, [r0] ldr r4, =0x02038ea8 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, =0xfffffd80 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 .pool 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, =0x030022c0 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, =@080BA508 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080BA7F4 .align 2, 0 .pool @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, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 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, =0x040000d4 mov r1, r8 str r1, [r2] str r0, [r2, 0x4] lsrs r0, r3, 2 movs r1, 0x85 lsls r1, 24 orrs r0, r1 str r0, [r2, 0x8] ldr r0, [r2, 0x8] movs r1, 0xA0 lsls r1, 19 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, =gUnknown_0855C698 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, =gUnknown_0855C680 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 .pool @080BA69C: bl sub_80A1A74 bl remove_some_task bl clear_tasks bl reset_all_obj_data ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080BA7F4 .align 2, 0 .pool @080BA6BC: ldr r0, =0x03005d90 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 .pool @080BA6E0: ldr r0, =gUnknown_0855C6A0 movs r1, 0 movs r2, 0x2 bl gpu_pal_apply ldr r0, =0x03005d90 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080BA7F4 .align 2, 0 .pool @080BA718: ldr r0, =gUnknown_0855C604 movs r1, 0x10 movs r2, 0x20 bl gpu_pal_apply b @080BA7EC .align 2, 0 .pool @080BA728: movs r0, 0 bl Window_WriteStandardTileMap bl sub_80BB0D0 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080BA7F4 .align 2, 0 .pool @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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @080BA760: bl sub_80BB154 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080BA7F4 .align 2, 0 .pool @080BA774: ldr r0, =sub_80BA83C movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 adds r4, r1 movs r0, 0 strh r0, [r4, 0x8] ldr r0, =0x03005d90 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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @080BA7F4: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080BA828 .align 2, 0 .pool @080BA80C: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =sub_80BA4C8 bl SetVBlankCallback ldr r0, =sub_80BA4B0 bl set_callback2 @080BA828: add sp, 0xC pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BA85C ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BA86C str r0, [r1] @080BA85C: pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080BA89C ldr r0, =0x03005e00 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 .pool @080BA89C: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080BA8BC ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 @080BA8AE: ldr r0, =sub_80BAA64 str r0, [r1] b @080BAA5A .align 2, 0 .pool @080BA8BC: movs r0, 0x40 ands r0, r1 lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0 beq @080BA8EC ldr r1, =0x03005e00 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 .pool @080BA8E8: movs r0, 0x6 b @080BA90C @080BA8EC: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080BA924 ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 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, =@080BA94C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039b48 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 .pool 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, =0x03005d90 ldr r3, [r6] ldr r1, =0x03005e00 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, =sub_80BAB08 str r0, [r4] add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80BAA64 thumb_func_start sub_80BAB08 sub_80BAB08: ; 80BAB08 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 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, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 @080BAB2C: pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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 .pool @080BAC00: movs r3, 0 @080BAC02: ldr r1, =0x02039b48 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 .pool @080BAC24: movs r3, 0x2 @080BAC26: ldr r1, =0x02039b48 movs r0, 0x1 strb r0, [r1] @080BAC2C: adds r0, r3, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE5D4 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, =gUnknown_085EE5DF mov r8, r0 movs r0, 0x1 mov r1, r8 movs r2, 0 bl font_get_width_of_string adds r5, r0, 0 ldr r6, =gUnknown_085EE5E9 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 .pool thumb_func_end sub_80BAC38 thumb_func_start sub_80BACE0 sub_80BACE0: ; 80BACE0 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x30 ands r0, r1 cmp r0, 0 beq @080BACFA movs r1, 0x1 eors r2, r1 ldr r0, =0x02039b48 strb r1, [r0] @080BACFA: adds r0, r2, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE5F4 mov r1, sp ldrb r3, [r1] movs r1, 0x68 movs r2, 0x10 bl sub_80BAB68 ldr r4, =gUnknown_085EE5FD 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 .pool thumb_func_end sub_80BAD08 thumb_func_start sub_80BAD5C sub_80BAD5C: ; 80BAD5C push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x30 ands r0, r1 cmp r0, 0 beq @080BAD76 movs r1, 0x1 eors r2, r1 ldr r0, =0x02039b48 strb r1, [r0] @080BAD76: adds r0, r2, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE607 mov r1, sp ldrb r3, [r1] movs r1, 0x68 movs r2, 0x20 bl sub_80BAB68 ldr r4, =gUnknown_085EE613 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 .pool 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, =0x030022c0 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, =0x02039b48 strb r4, [r0] @080BADF8: adds r0, r5, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE61D mov r1, sp ldrb r3, [r1] movs r1, 0x68 movs r2, 0x30 bl sub_80BAB68 ldr r4, =gUnknown_085EE628 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 .pool 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, =0x030022c0 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 .pool @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, =0x02039b48 movs r0, 0x1 strb r0, [r1] @080BAEAE: ldr r0, =0x030022c0 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 .pool @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, =0x02039b48 movs r0, 0x1 strb r0, [r1] @080BAEFE: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE640 ldrb r0, [r1] ldr r7, =gUnknown_085EE635 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 .pool @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, =0x030022c0 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 .pool @080BAFF0: movs r3, 0 @080BAFF2: ldr r1, =0x02039b48 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 .pool @080BB014: movs r3, 0x2 @080BB016: ldr r1, =0x02039b48 movs r0, 0x1 strb r0, [r1] @080BB01C: adds r0, r3, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE647 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, =gUnknown_085EE654 mov r8, r0 movs r0, 0x1 mov r1, r8 movs r2, 0 bl font_get_width_of_string adds r5, r0, 0 ldr r6, =gUnknown_085EE65D 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 .pool 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, =gUnknown_085EE589 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 .pool 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, =gUnknown_0855C664 @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 .pool 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, =0x000001a3 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, =0x000001a5 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, =0x000001a7 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, =0x000001a9 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, =0x000001a3 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, =0x000001a5 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, =0x000001a7 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 .pool thumb_func_end sub_80BB154 thumb_func_start sub_80BB2D0 sub_80BB2D0: ; 80BB2D0 push {r4-r6,lr} ldr r0, =0x02039b50 movs r2, 0 strh r2, [r0] ldr r1, =0x02039b52 movs r0, 0x40 strb r0, [r1] ldr r0, =0x030060b0 strb r2, [r0] ldr r4, =0x03005d90 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, =0x03005d8c ldr r6, =0x00000988 ldr r5, =0x00003b24 @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 .pool thumb_func_end sub_80BB2D0 thumb_func_start sub_80BB358 sub_80BB358: ; 80BB358 ldr r1, =0x02039b50 movs r0, 0 strh r0, [r1] ldr r1, =0x02039b52 movs r0, 0x40 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x0000ffff adds r7, r0, 0 movs r1, 0x2 negs r1, r1 mov r12, r1 movs r6, 0x3 negs r6, r6 ldr r5, =0x00000181 @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, =0x0000060a 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, =0x0000060c adds r0, r4, r1 strh r2, [r0] ldr r3, =0x0000060e 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, =0x0000061e adds r2, r4, r0 ldr r1, =0x0000ffff 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, =0x0000062a 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, =0x0000063a 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, =0x0000064a adds r0, r4, r1 movs r1, 0 strb r1, [r0] ldr r2, =0x0000064b adds r0, r4, r2 strb r1, [r0] ldr r0, =0x0000064c adds r3, r4, r0 ldrb r2, [r3] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r3] ldr r2, =0x0000064d adds r0, r4, r2 strb r1, [r0] ldr r3, =0x0000064e 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, =0x00000654 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, =0x0000065c 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 .pool 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, =0x030022c0 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, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 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, =0x040000d4 mov r1, r8 str r1, [r2] str r0, [r2, 0x4] lsrs r0, r3, 2 movs r1, 0x85 lsls r1, 24 orrs r0, r1 str r0, [r2, 0x8] ldr r0, [r2, 0x8] movs r1, 0xA0 lsls r1, 19 mov r0, sp strh r4, [r0] str r0, [r2] str r1, [r2, 0x4] lsrs r3, 1 movs r0, 0x81 lsls r0, 24 orrs r3, r0 str r3, [r2, 0x8] ldr r0, [r2, 0x8] ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x1 strb r1, [r0] b @080BB74C .align 2, 0 .pool @080BB5FC: bl remove_some_task bl clear_tasks bl reset_all_obj_data bl sub_80A1A74 bl gpu_pal_allocator_reset ldr r1, =0x0300301c movs r0, 0x8 strb r0, [r1] bl dp13_810BB8C ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @080BB74C .align 2, 0 .pool @080BB628: ldr r4, =0x02039b4c ldr r0, =0x00000664 bl malloc_and_clear str r0, [r4] bl sub_80BB384 ldr r0, =sub_80BB78C movs r1, 0 bl AddTask ldr r1, [r4] ldr r5, =0x03005d90 ldr r0, [r5] ldrb r0, [r0, 0x19] ldr r3, =0x00000612 adds r1, r3 strh r0, [r1] bl sub_809D42C adds r1, r0, 0 cmp r1, 0 bne @080BB65E ldr r0, [r4] ldr r2, =0x00000612 adds r0, r2 strh r1, [r0] @080BB65E: ldr r1, [r4] ldr r0, [r5] ldrb r2, [r0, 0x18] ldr r3, =0x00000616 adds r0, r1, r3 strh r2, [r0] ldr r0, =0x02039b50 ldrh r2, [r0] subs r3, 0x8 adds r0, r1, r3 strh r2, [r0] ldr r0, =0x02039b52 ldrb r0, [r0] ldr r2, =0x0000062c 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, =0x0000061a adds r1, r2 strh r0, [r1] movs r0, 0x1 bl sub_80C0844 b @080BB6E4 .align 2, 0 .pool @080BB6D0: movs r0, 0 bl pokedex_count ldr r1, [r4] ldr r2, =0x0000061a adds r1, r2 strh r0, [r1] movs r0, 0x1 bl pokedex_count @080BB6E4: ldr r1, [r4] ldr r3, =0x0000061c adds r1, r3 strh r0, [r1] ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000062d adds r0, r1 movs r1, 0x8 strb r1, [r0] ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080BB74C .align 2, 0 .pool @080BB71C: movs r0, 0x1 bl enable_irqs ldr r0, =sub_80BB370 bl SetVBlankCallback ldr r0, =sub_80BB774 bl set_callback2 ldr r0, =0x02039b4c ldr r1, [r0] ldr r3, =0x00000612 adds r0, r1, r3 ldrb r0, [r0] ldr r2, =0x00000616 adds r1, r2 ldrb r1, [r1] bl sub_80BC8D4 ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 bl MPlayVolumeControl @080BB74C: add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039b4c ldr r1, [r0] ldr r0, =0x0000064c 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BB7D4 str r0, [r1] @080BB7BE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039b4c ldr r0, [r7] ldr r4, =0x00000652 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 .pool @080BB810: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x1 mov r9, r0 ands r0, r1 cmp r0, 0 beq @080BB8A4 ldr r1, =0x0000060e 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, =0x02020630 ldr r0, [r7] ldr r5, =0x00000626 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, =sub_80BE470 str r1, [r0] ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BBBF4 str r1, [r0] movs r0, 0x15 b @080BB976 .align 2, 0 .pool @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, =0x02039b4c ldr r1, [r3] ldr r4, =0x00000652 adds r0, r1, r4 movs r2, 0 strh r2, [r0] ldr r0, =0x0000064f 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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BBA78 str r1, [r0] movs r0, 0x5 bl audio_play b @080BBA06 .align 2, 0 .pool @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, =0x03005e00 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, =0x02039b4c ldr r0, [r1] ldr r4, =0x0000064e adds r0, r4 strb r2, [r0] ldr r0, [r1] ldr r2, =0x0000062c adds r1, r0, r2 ldrb r2, [r1] subs r4, 0x24 adds r1, r0, r4 strh r2, [r1] ldr r2, =0x0000060e adds r1, r0, r2 ldrh r2, [r1] subs r4, 0x1A adds r1, r0, r4 strh r2, [r1] ldr r2, =0x00000612 adds r1, r0, r2 ldrh r2, [r1] adds r4, 0x4 adds r1, r0, r4 strh r2, [r1] ldr r2, =0x00000616 adds r1, r0, r2 ldrh r1, [r1] adds r4, 0x4 adds r0, r4 strh r1, [r0] ldr r0, =sub_80BBD1C str r0, [r3] movs r0, 0x2 @080BB976: bl audio_play bl sub_80BC890 b @080BBA06 .align 2, 0 .pool @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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BBDE8 str r1, [r0] movs r0, 0x3 bl audio_play b @080BBA06 .align 2, 0 .pool @080BB9D8: ldr r5, =0x02039b4c ldr r0, [r5] ldr r4, =0x0000060e adds r0, r4 ldrh r0, [r0] movs r1, 0xE bl sub_80BD69C ldr r1, [r5] adds r4, r1, r4 strh r0, [r4] ldr r0, =0x0000062e adds r1, r0 ldrb r0, [r1] cmp r0, 0 beq @080BBA06 ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BBA28 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 .pool 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, =0x02039b4c ldr r2, [r0] ldr r1, =0x0000062f adds r0, r2, r1 ldrb r0, [r0] ldr r3, =0x00000634 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BB7D4 str r0, [r1] @080BBA5C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039b4c ldr r0, [r6] ldr r4, =0x00000652 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 .pool @080BBAB0: ldr r5, =0x030022c0 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 .pool @080BBADC: ldr r4, =0x0000060e adds r1, r3, r4 movs r0, 0 strh r0, [r1] ldr r0, =0x0000062c adds r1, r3, r0 movs r0, 0x40 b @080BBB0C .align 2, 0 .pool @080BBAF4: ldr r1, =0x0000060c adds r2, r3, r1 ldrh r0, [r2] subs r0, 0x1 ldr r4, =0x0000060e adds r1, r3, r4 strh r0, [r1] ldrh r0, [r2] lsls r0, 4 adds r0, 0x30 ldr r2, =0x0000062c 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 .pool @080BBB34: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BBDE8 str r1, [r0] movs r0, 0x3 bl audio_play @080BBB58: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0xA ands r0, r1 cmp r0, 0 beq @080BBB98 ldr r0, =0x02039b4c ldr r0, [r0] ldr r3, =0x0000064f adds r0, r3 movs r1, 0 strb r1, [r0] ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BB7D4 str r1, [r0] b @080BBBB6 .align 2, 0 .pool @080BBB98: ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @080BBBC4 ldr r0, =0x02039b4c 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 .pool @080BBBC4: ldrh r1, [r2, 0x30] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080BBBE8 ldr r0, =0x02039b4c 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 .pool 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, =0x02020630 ldr r5, =0x02039b4c ldr r3, [r5] ldr r6, =0x00000626 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, =0x0000064a adds r0, r3, r1 ldrb r1, [r0] ldr r2, =0x0000064b 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, =0x03005e00 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, =sub_80BBC74 str r0, [r1] @080BBC52: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02039b4c ldr r0, [r5] ldr r1, =0x0000064a 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, =0x0000060e 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 .pool @080BBCE0: ldr r2, =0x02039b50 ldr r0, =0x02039b4c ldr r1, [r0] ldr r3, =0x0000060e adds r0, r1, r3 ldrh r0, [r0] strh r0, [r2] ldr r2, =0x02039b52 ldr r0, =0x0000062c adds r1, r0 ldrb r0, [r1] strb r0, [r2] ldr r0, =sub_80BB78C str r0, [r4] @080BBCFC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02039b4c ldr r2, [r5] ldr r1, =0x0000064e adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0 beq @080BBD7C ldr r3, =0x0000060e adds r0, r2, r3 strh r4, [r0] ldr r0, =0x0000062c adds r1, r2, r0 movs r0, 0x40 strb r0, [r1] ldr r0, =sub_80BBE70 b @080BBDC8 .align 2, 0 .pool @080BBD7C: ldr r1, =0x0000062a adds r0, r2, r1 ldrh r1, [r0] ldr r3, =0x0000062c 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, =0x00000614 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, =0x00000612 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, =0x00000616 adds r0, r2 strh r1, [r0] ldr r0, =sub_80BB78C @080BBDC8: str r0, [r6] @080BBDCA: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BBE4A ldr r4, =0x03005d90 ldr r0, [r4] ldr r5, =0x02039b4c ldr r1, [r5] ldr r2, =0x00000612 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, =0x00000616 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, =sub_8086194 bl set_callback2 ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl ldr r0, [r5] bl free @080BBE4A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039b4c ldr r1, [r0] ldr r0, =0x0000064c 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BBEB8 str r0, [r1] @080BBEA0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039b4c ldr r0, [r5] ldr r4, =0x00000652 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 .pool @080BBEEC: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r7, 0x1 adds r0, r7, 0 ands r0, r1 cmp r0, 0 beq @080BBF70 ldr r1, =0x0000060e 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, =0x02020630 ldr r0, [r5] ldr r2, =0x00000626 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, =sub_80BE470 str r1, [r2] mvns r0, r0 str r4, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BC2D4 str r1, [r0] movs r0, 0x15 b @080BC00A .align 2, 0 .pool @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, =0x02039b4c ldr r1, [r3] ldr r2, =0x00000652 adds r0, r1, r2 movs r2, 0 strh r2, [r0] ldr r0, =0x0000064f 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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BC0F8 str r1, [r0] movs r0, 0x5 bl audio_play b @080BC08A .align 2, 0 .pool @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, =0x03005e00 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, =0x02039b4c ldr r0, [r0] ldr r3, =0x0000064e adds r0, r3 strb r2, [r0] ldr r0, =sub_80BBD1C str r0, [r1] movs r0, 0x2 @080BC00A: bl audio_play bl sub_80BC890 b @080BC08A .align 2, 0 .pool @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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BC3DC str r1, [r0] movs r0, 0x3 bl audio_play b @080BC08A .align 2, 0 .pool @080BC05C: ldr r5, =0x02039b4c ldr r0, [r5] ldr r4, =0x0000060e adds r0, r4 ldrh r0, [r0] movs r1, 0xE bl sub_80BD69C ldr r1, [r5] adds r4, r1, r4 strh r0, [r4] ldr r0, =0x0000062e adds r1, r0 ldrb r0, [r1] cmp r0, 0 beq @080BC08A ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BC0A8 str r0, [r1] @080BC08A: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039b4c ldr r2, [r0] ldr r1, =0x0000062f adds r0, r2, r1 ldrb r0, [r0] ldr r3, =0x00000634 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BBEB8 str r0, [r1] @080BC0DC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039b4c ldr r0, [r5] ldr r4, =0x00000652 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 .pool @080BC130: ldr r0, =0x030022c0 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, =@080BC15C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080BC15C: .4byte @080BC1C2 .4byte @080BC170 .4byte @080BC194 .4byte @080BC1E4 .4byte @080BC214 @080BC170: ldr r5, =0x02039b4c ldr r1, [r5] ldr r4, =0x0000060e adds r2, r1, r4 movs r0, 0 strh r0, [r2] ldr r2, =0x0000062c adds r1, r2 movs r0, 0x40 strb r0, [r1] b @080BC1B2 .align 2, 0 .pool @080BC194: ldr r5, =0x02039b4c ldr r2, [r5] ldr r0, =0x0000060c adds r3, r2, r0 ldrh r0, [r3] subs r0, 0x1 ldr r4, =0x0000060e adds r1, r2, r4 strh r0, [r1] ldrh r0, [r3] lsls r0, 4 adds r0, 0x30 ldr r1, =0x0000062c 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, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x8 orrs r0, r1 strh r0, [r2, 0x2E] b @080BC238 .align 2, 0 .pool @080BC1E4: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BC3DC str r1, [r0] movs r0, 0x34 bl audio_play b @080BC238 .align 2, 0 .pool @080BC214: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BC47C str r1, [r0] movs r0, 0x3 bl audio_play @080BC238: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0xA ands r0, r1 cmp r0, 0 beq @080BC278 ldr r0, =0x02039b4c ldr r0, [r0] ldr r2, =0x0000064f adds r0, r2 movs r1, 0 strb r1, [r0] ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BBEB8 str r1, [r0] b @080BC296 .align 2, 0 .pool @080BC278: ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @080BC2A4 ldr r0, =0x02039b4c 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 .pool @080BC2A4: ldrh r1, [r2, 0x30] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080BC2C8 ldr r0, =0x02039b4c 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 .pool 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, =0x02020630 ldr r5, =0x02039b4c ldr r3, [r5] ldr r4, =0x00000626 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, =0x0000064a adds r0, r3, r1 ldrb r1, [r0] ldr r2, =0x0000064b 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, =0x03005e00 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, =0x0000ffff strh r2, [r0] ldr r0, =sub_80BC360 str r0, [r1] @080BC33A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02039b4c ldr r0, [r5] ldr r1, =0x0000064a 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, =0x0000060e 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 .pool @080BC3CC: ldr r0, =sub_80BBE70 str r0, [r4] @080BC3D0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BC450 ldr r4, =0x02039b4c ldr r0, [r4] ldr r2, =0x0000062a adds r1, r0, r2 ldrh r1, [r1] ldr r3, =0x0000062c 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, =0x00000614 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, =0x00000612 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, =0x00000616 adds r0, r2 strh r1, [r0] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BB78C str r1, [r0] bl sub_80BDA40 bl sub_80BC890 @080BC450: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BC4E8 ldr r4, =0x02039b4c ldr r0, [r4] ldr r2, =0x0000062a adds r1, r0, r2 ldrh r1, [r1] ldr r3, =0x0000062c 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, =0x00000614 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, =0x00000612 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, =0x00000616 adds r0, r2 strh r1, [r0] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BBDE8 str r1, [r0] @080BC4E8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =@080BC540 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080BC540: .4byte @080BC55C .4byte @080BC6CC .4byte @080BC6FC .4byte @080BC704 .4byte @080BC768 .4byte @080BC790 .4byte @080BC818 @080BC55C: ldr r0, =0x02037fd4 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, =0x02039b4c ldr r0, [r4] ldr r1, =0x0000064a adds r0, r1 strb r5, [r0] movs r0, 0 bl sub_80C09B0 ldr r0, [r4] ldr r2, =0x0000062d 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, =gUnknown_0855D298 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, =gUnknown_08DC1934 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, =gUnknown_08DC2C5C movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r1, =gUnknown_08DC2DAC movs r0, 0x3 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map cmp r5, 0 bne @080BC640 ldr r1, =gUnknown_08DC2A08 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 .pool @080BC640: ldr r1, =gUnknown_08DC2B1C 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, =0x02039b4c ldr r1, [r3] ldr r0, =0x0000064c adds r1, r0 ldrb r2, [r1] movs r0, 0x2 negs r0, r0 ands r0, r2 b @080BC682 .align 2, 0 .pool @080BC674: ldr r3, =0x02039b4c ldr r1, [r3] ldr r2, =0x0000064c adds r1, r2 ldrb r0, [r1] movs r2, 0x1 orrs r0, r2 @080BC682: strb r0, [r1] ldr r0, [r3] ldr r1, =0x0000064c adds r0, r1 ldrb r0, [r0] lsls r0, 31 lsrs r0, 31 bl sub_80BC844 ldr r0, =gUnknown_0855D2A8 bl Window_InitFromTemplates bl TextBox_ResetSomeField movs r0, 0 bl Window_WriteStandardTileMap movs r0, 0 movs r1, 0x3 bl Window_CopyToVram ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x1 strb r1, [r0] b @080BC838 .align 2, 0 .pool @080BC6CC: bl reset_all_obj_data bl gpu_pal_allocator_reset ldr r1, =0x0300301c movs r0, 0x8 strb r0, [r1] ldr r0, =gUnknown_0855D26C bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0855D27C bl gpu_pal_obj_alloc_and_load_multiple adds r0, r5, 0 bl sub_80BDB7C b @080BC7F8 .align 2, 0 .pool @080BC6FC: movs r2, 0x87 lsls r2, 3 adds r1, r3, r2 b @080BC800 @080BC704: cmp r5, 0 bne @080BC71C ldr r0, =0x02039b4c ldr r1, [r0] ldr r2, =0x00000612 adds r0, r1, r2 ldrb r0, [r0] adds r2, 0x4 adds r1, r2 ldrb r1, [r1] bl sub_80BC8D4 @080BC71C: ldr r4, =0x02039b4c ldr r0, [r4] ldr r1, =0x0000060e adds r0, r1 ldrh r0, [r0] movs r1, 0xE bl sub_80BD2B4 ldr r0, [r4] ldr r2, =0x0000064f 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 .pool @080BC768: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =sub_80BB370 bl SetVBlankCallback ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @080BC800 .align 2, 0 .pool @080BC790: ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00001d3f 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, =0x00009040 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @080BC800: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080BC838 .align 2, 0 .pool @080BC818: ldr r0, =0x02037fd4 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 .pool @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, =gUnknown_08DC17B6 b @080BC862 .align 2, 0 .pool @080BC858: bl sub_809D42C cmp r0, 0 bne @080BC870 ldr r0, =gUnknown_08DC16F6 @080BC862: movs r1, 0x1 movs r2, 0xBE bl gpu_pal_apply b @080BC87A .align 2, 0 .pool @080BC870: ldr r0, =gUnknown_08DC1876 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 .pool 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000060c 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 .pool @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, =@080BC940 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039b4c 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 HoennToNationalOrder 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, =0x0000060c 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 .pool @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, =0x02039b4c 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, =0x0000060c 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 .pool @080BCACC: movs r4, 0 mov r5, sp ldr r3, =0x02039b4c mov r8, r3 ldr r6, =0x0000060c movs r7, 0x1 mov r9, r7 @080BCADA: ldr r1, =gUnknown_0855C6A4 lsls r4, 16 asrs r0, r4, 15 adds r0, r1 ldrh r0, [r0] strh r0, [r5, 0x4] ldrh r0, [r5, 0x4] bl NationalToHoennOrder 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 .pool @080BCB78: ldr r4, =0x00000181 lsls r0, r4, 16 mov r5, sp ldr r7, =0x02039b4c ldr r6, =0x0000060c @080BCB82: ldr r1, =gUnknown_0855C9DA asrs r0, 15 adds r0, r1 ldrh r0, [r0] strh r0, [r5, 0x4] ldrh r0, [r5, 0x4] bl NationalToHoennOrder 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, =0xffff0000 adds r0, r4 lsrs r4, r0, 16 lsls r0, r4, 16 cmp r0, 0 bge @080BCB82 b @080BCDB4 .align 2, 0 .pool @080BCC08: movs r4, 0 mov r5, sp ldr r7, =0x02039b4c mov r8, r7 ldr r6, =0x0000060c ldr r0, =0x00000181 mov r9, r0 @080BCC16: ldr r1, =gUnknown_0855C9DA lsls r4, 16 asrs r0, r4, 15 adds r0, r1 ldrh r0, [r0] strh r0, [r5, 0x4] ldrh r0, [r5, 0x4] bl NationalToHoennOrder 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 .pool @080BCCA0: ldr r4, =0x00000181 lsls r0, r4, 16 mov r5, sp ldr r7, =0x02039b4c ldr r6, =0x0000060c @080BCCAA: ldr r1, =gUnknown_0855CCDE asrs r0, 15 adds r0, r1 ldrh r0, [r0] strh r0, [r5, 0x4] ldrh r0, [r5, 0x4] bl NationalToHoennOrder 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, =0xffff0000 adds r0, r3 lsrs r4, r0, 16 lsls r0, r4, 16 cmp r0, 0 bge @080BCCAA b @080BCDB4 .align 2, 0 .pool @080BCD30: movs r4, 0 mov r5, sp ldr r7, =0x02039b4c mov r8, r7 ldr r6, =0x0000060c ldr r0, =0x00000181 mov r9, r0 @080BCD3E: ldr r1, =gUnknown_0855CCDE lsls r4, 16 asrs r0, r4, 15 adds r0, r1 ldrh r0, [r0] strh r0, [r5, 0x4] ldrh r0, [r5, 0x4] bl NationalToHoennOrder 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, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c adds r0, r2 ldrh r4, [r0] lsls r3, r4, 16 asrs r0, r3, 16 ldr r2, =0x00000181 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, =0x0000ffff 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 .pool 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, =0x00000181 cmp r5, r1 bhi @080BCED2 ldr r2, =0x02039b4c mov r8, r2 ldr r0, [r2] mov r3, r10 asrs r6, r3, 14 adds r0, r6 ldrh r0, [r0] ldr r1, =0x0000ffff 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 .pool @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, =0x00000181 ldr r2, =0x02039b4c 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, =0x0000ffff 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 .pool @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, =0x02039b4c 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, =0x00000181 cmp r5, r0 bhi @080BD0B0 asrs r6, r1, 14 adds r0, r3, r6 ldrh r1, [r0] ldr r0, =0x0000ffff 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 .pool @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, =gUnknown_0855D2B8 add r0, sp, 0x4 movs r2, 0x6 bl memcpy ldr r0, =0x02039b4c ldr r0, [r0] lsls r4, 2 adds r4, r0, r4 ldrh r6, [r4] ldr r1, =0x00000612 adds r0, r1 ldrh r0, [r0] cmp r0, 0 bne @080BD194 adds r0, r6, 0 bl NationalToHoennOrder 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 .pool 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, =gUnknown_0855D2BE 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 .pool @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 NationalPokedexNumToSpecies adds r1, r0, 0 cmp r1, 0 beq @080BD264 movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r4, r1, r0 b @080BD266 .align 2, 0 .pool @080BD264: ldr r4, =gUnknown_0855D2FE @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 .pool 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, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] movs r2, 0 ldr r7, =0x02039b4c adds r5, r7, 0 ldr r4, =0x0000061e ldr r0, =0x0000ffff 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, =0x00000626 adds r0, r1 ldr r1, =0x0000ffff strh r1, [r0] subs r0, r6, 0x1 lsls r0, 16 lsrs r0, 16 bl sub_80BDA8C lsls r0, 16 lsrs r0, 16 ldr r4, =0x0000ffff cmp r0, r4 beq @080BD334 movs r1, 0x60 movs r2, 0x50 bl sub_80BDACC lsls r0, 24 lsrs r1, r0, 24 ldr r3, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r3, 0 adds r1, 0x1C adds r1, r0, r1 ldr r2, =sub_80BE4E0 str r2, [r1] adds r0, r3 ldr r1, =0x0000ffe0 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, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r3, 0 adds r1, 0x1C adds r1, r0, r1 ldr r2, =sub_80BE4E0 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, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r3, 0 adds r1, 0x1C adds r1, r0, r1 ldr r2, =sub_80BE4E0 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, =0x0000062d 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, =0x00000632 adds r0, r1 strh r2, [r0] ldr r2, =0x02037fd4 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 .pool 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, =0x02039b4c ldr r1, [r0] ldr r3, =0x0000062e 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 .pool @080BD440: movs r3, 0 ldr r4, =0x0000ffff mov r12, r4 ldr r0, =0x02020630 mov r8, r0 adds r2, r7, 0 @080BD44C: ldr r0, [r2] lsls r1, r3, 1 ldr r4, =0x0000061e 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, =0x0000062e 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, =0x0000062d adds r0, r4, r3 ldr r1, =0x00000632 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, =0x0000062c 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 .pool @080BD4DC: movs r3, 0 ldr r2, =0x0000ffff mov r12, r2 ldr r4, =0x02020630 mov r8, r4 adds r2, r7, 0 @080BD4E8: ldr r0, [r2] lsls r1, r3, 1 ldr r4, =0x0000061e 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, =0x0000062e 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, =0x0000062d adds r0, r4, r3 ldr r1, =0x00000632 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, =0x0000062c 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 .pool @080BD578: ldr r4, =0x0000062d 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 .pool 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, =0x02039b4c ldr r0, [r4] movs r5, 0xC6 lsls r5, 3 adds r1, r0, r5 ldrh r1, [r1] ldr r6, =0x00000632 adds r0, r6 strh r1, [r0] cmp r2, 0x1 beq @080BD5D8 cmp r2, 0x2 beq @080BD638 b @080BD694 .align 2, 0 .pool @080BD5D8: subs r0, r3, 0x1 lsls r0, 16 lsrs r0, 16 bl sub_80BDA8C lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x0000ffff 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, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r3, 0 adds r1, 0x1C adds r1, r0, r1 ldr r2, =sub_80BE4E0 str r2, [r1] adds r0, r3 ldr r1, =0x0000ffc0 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 .pool @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, =0x0000ffff 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, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r3, 0 adds r1, 0x1C adds r1, r0, r1 ldr r2, =sub_80BE4E0 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 .pool @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, =0x030022c0 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, =0x02039b4c ldr r0, [r0] ldr r2, =0x0000060c 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 .pool @080BD6FC: ldrh r1, [r2, 0x2C] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080BD74C ldr r0, =0x02039b4c ldr r0, [r0] ldr r3, =0x0000060c 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 .pool @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, =0x02039b4c ldr r0, [r5] ldr r2, =0x0000060c 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, =0x0000062c 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 .pool @080BD7B4: ldrh r1, [r2, 0x2E] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080BD81A ldr r0, =0x02039b4c ldr r0, [r0] ldr r3, =0x0000060c adds r0, r3 ldrh r0, [r0] subs r0, 0x1 cmp r7, r0 bge @080BD81A adds r6, r7, 0 movs r4, 0 @080BD7D2: ldr r5, =0x02039b4c ldr r0, [r5] ldr r1, =0x0000060c 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, =0x0000062c 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, =0x02039b4c ldr r0, [r0] movs r1, 0xC7 lsls r1, 3 adds r0, r1 mov r2, r10 strh r2, [r0] b @080BD8A2 .align 2, 0 .pool @080BD83C: ldr r1, =gUnknown_0855D28C ldr r6, =0x02039b4c 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, =gUnknown_0855D291 adds r0, r1 ldrb r3, [r0] ldr r0, =0x0000062e adds r2, r0 strb r3, [r2] ldr r1, [r6] ldr r2, =0x00000636 mov r8, r2 adds r0, r1, r2 strh r3, [r0] ldr r4, =0x00000634 adds r0, r1, r4 strh r5, [r0] ldr r3, =0x0000062f 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 .pool thumb_func_end sub_80BD69C thumb_func_start sub_80BD8D0 sub_80BD8D0: ; 80BD8D0 push {r4-r7,lr} movs r4, 0 ldr r0, =0x02039b4c mov r12, r0 ldr r6, =0x02020630 ldr r5, =0x0000ffff @080BD8DC: mov r1, r12 ldr r3, [r1] lsls r1, r4, 1 ldr r2, =0x0000061e 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, =0x00000626 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 .pool thumb_func_end sub_80BD8D0 thumb_func_start sub_80BD930 sub_80BD930: ; 80BD930 push {r4-r6,lr} ldr r3, =0x02039b4c ldr r0, [r3] ldr r1, =0x0000060e adds r0, r1 ldrh r4, [r0] ldr r2, =0x030022c0 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, =0x0000060c 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, =0x02039b4c ldr r1, [r0] ldr r0, =0x0000060e adds r2, r1, r0 ldrh r0, [r2] cmp r0, r4 bne @080BD9A4 b @080BDA38 .align 2, 0 .pool @080BD9A0: adds r4, r2, 0 b @080BD97E @080BD9A4: strh r4, [r2] ldr r0, =0x0000062c adds r1, r0 ldrb r0, [r1] subs r0, 0x10 b @080BDA20 .align 2, 0 .pool @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, =0x0000060c 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, =0x02039b4c ldr r1, [r0] ldr r0, =0x0000060e adds r2, r1, r0 ldrh r0, [r2] cmp r0, r4 beq @080BDA38 strh r4, [r2] ldr r0, =0x0000062c adds r1, r0 ldrb r0, [r1] adds r0, 0x10 @080BDA20: strb r0, [r1] movs r0, 0x1 b @080BDA3A .align 2, 0 .pool @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, =0x02039b4c ldr r7, =0x0000ffff @080BDA48: ldr r0, [r6] lsls r4, r5, 1 ldr r1, =0x0000061e adds r0, r1 adds r1, r0, r4 ldrh r0, [r1] cmp r0, r7 beq @080BDA6C bl sub_818D820 ldr r1, [r6] ldr r0, =0x0000061e 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 .pool thumb_func_end sub_80BDA40 thumb_func_start sub_80BDA8C sub_80BDA8C: ; 80BDA8C push {lr} lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x00000181 cmp r2, r0 bhi @080BDAA8 ldr r0, =0x02039b4c ldr r1, [r0] lsls r0, r2, 2 adds r2, r1, r0 ldrh r1, [r2] ldr r0, =0x0000ffff cmp r1, r0 bne @080BDAB8 @080BDAA8: ldr r0, =0x0000ffff b @080BDAC6 .align 2, 0 .pool @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, =0x02039b4c mov r9, r0 ldr r3, =0x0000ffff lsls r1, 16 @080BDAE8: mov r4, r9 ldr r0, [r4] lsls r7, r6, 1 ldr r4, =0x0000061e 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, =0x02020630 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 NationalPokedexNumToSpecies strh r0, [r4, 0x32] mov r4, r9 ldr r0, [r4] ldr r1, =0x0000061e adds r0, r1 adds r0, r7 strh r5, [r0] adds r0, r5, 0 b @080BDB6C .align 2, 0 .pool @080BDB60: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x3 bls @080BDAE8 ldr r0, =0x0000ffff @080BDB6C: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0855D1AC 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, =0x02020630 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, =gUnknown_0855D194 movs r1, 0xE6 movs r2, 0x14 movs r3, 0 bl obj_add_from_template_forward_search ldr r5, =gUnknown_0855D1C4 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, =gUnknown_0855D1DC 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, =gUnknown_0855D1F4 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, =gUnknown_0855D224 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061a 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 .pool @080BDD6C: adds r0, r4, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @080BDD78: ldr r0, =gUnknown_0855D224 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061a 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, =0x02020630 adds r0, r1 lsls r1, r5, 24 lsrs r1, 24 bl obj_anim_image_start b @080BDDE8 .align 2, 0 .pool @080BDDD4: ldr r1, =0x02020630 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, =gUnknown_0855D224 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, =0x02039b4c ldr r0, [r5] ldr r1, =0x0000061a 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, =0x02020630 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, =0x0000061c 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 .pool @080BDE80: adds r0, r4, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @080BDE8C: ldr r0, =gUnknown_0855D224 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061c 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, =0x02020630 adds r0, r1 lsls r1, r5, 24 lsrs r1, 24 bl obj_anim_image_start b @080BDEFC .align 2, 0 .pool @080BDEE8: ldr r1, =0x02020630 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, =gUnknown_0855D224 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061c 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, =0x02020630 adds r0, r2 lsls r1, 24 lsrs r1, 24 bl obj_anim_image_start b @080BE3E2 .align 2, 0 .pool @080BDF4C: ldr r4, =gUnknown_0855D1F4 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, =gUnknown_0855D20C 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, =gUnknown_0855D23C 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 .pool @080BE024: adds r0, r4, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @080BE030: ldr r0, =gUnknown_0855D23C 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, =0x02020630 adds r0, r1 lsls r1, r5, 24 lsrs r1, 24 bl obj_anim_image_start b @080BE090 .align 2, 0 .pool @080BE07C: ldr r1, =0x02020630 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, =gUnknown_0855D23C 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, =0x02020630 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061a 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 .pool @080BE11C: adds r0, r4, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @080BE128: ldr r0, =gUnknown_0855D23C 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061a 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, =0x02020630 adds r0, r1 lsls r1, r5, 24 lsrs r1, 24 bl obj_anim_image_start b @080BE198 .align 2, 0 .pool @080BE184: ldr r1, =0x02020630 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, =gUnknown_0855D23C 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061a 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, =0x02020630 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 .pool @080BE230: adds r0, r4, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @080BE23C: ldr r0, =gUnknown_0855D23C 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, =0x02020630 adds r0, r1 lsls r1, r5, 24 lsrs r1, 24 bl obj_anim_image_start b @080BE29C .align 2, 0 .pool @080BE288: ldr r1, =0x02020630 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, =gUnknown_0855D23C 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, =0x02020630 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061c 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 .pool @080BE328: adds r0, r4, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @080BE334: ldr r0, =gUnknown_0855D23C 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061c 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, =0x02020630 adds r0, r1 lsls r1, r5, 24 lsrs r1, 24 bl obj_anim_image_start b @080BE3A4 .align 2, 0 .pool @080BE390: ldr r1, =0x02020630 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, =gUnknown_0855D23C 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000061c 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, =0x02020630 adds r0, r2 lsls r1, 24 lsrs r1, 24 bl obj_anim_image_start @080BE3E2: ldr r0, =gUnknown_0855D254 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, =0x02020630 lsls r0, r7, 4 adds r0, r7 lsls r0, 2 adds r0, r1 b @080BE42C .align 2, 0 .pool @080BE414: ldr r0, =gUnknown_0855D254 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 .pool 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, =0x02039b4c ldr r0, [r0] ldr r2, =0x0000064a 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 .pool 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, =0x00380030 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 .pool @080BE4D4: ldr r0, =nullsub_38 str r0, [r2, 0x1C] @080BE4D8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039b4c ldr r1, [r7] ldr r2, =0x0000064a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080BE520 cmp r0, 0x3 beq @080BE520 lsls r5, r6, 1 ldr r4, =0x0000061e 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 .pool @080BE520: ldr r2, =gUnknown_08329F40 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, =0x0000ffff 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 .pool @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, =0x02039b4c ldr r0, [r5] lsls r6, 1 ldr r4, =0x0000061e adds r0, r4 adds r0, r6 ldrh r0, [r0] bl sub_818D820 ldr r0, [r5] adds r0, r4 adds r0, r6 @080BE5EC: ldr r1, =0x0000ffff strh r1, [r0] @080BE5F0: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80BE4E0 thumb_func_start sub_80BE604 sub_80BE604: ; 80BE604 push {r4,lr} adds r4, r0, 0 ldr r1, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000064a 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 .pool @080BE62C: ldr r2, [r1] ldr r1, =0x0000060e adds r0, r2, r1 ldrh r1, [r0] lsls r0, r1, 4 subs r0, r1 lsls r0, 3 ldr r1, =0x0000060c 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 .pool thumb_func_end sub_80BE604 thumb_func_start sub_80BE658 sub_80BE658: ; 80BE658 push {r4,r5,lr} adds r3, r0, 0 ldr r1, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000064a 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 .pool @080BE680: movs r1, 0x30 ldrsh r0, [r3, r1] cmp r0, 0 beq @080BE6C2 ldr r0, [r5] ldr r2, =0x0000060e 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 .pool @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, =0x0000060e 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 .pool @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, =gUnknown_08329F40 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, =0x0000064f 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 .pool @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, =0x02039b4c ldr r0, [r0] ldr r2, =0x0000064a 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 .pool 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, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000064a 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 .pool @080BE7AC: ldr r0, [r7] ldr r5, =0x0000062c adds r0, r5 ldrb r1, [r0] ldrh r0, [r6, 0x30] adds r1, r0 lsls r1, 24 lsrs r1, 24 ldr r4, =gUnknown_08329F40 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 .pool thumb_func_end sub_80BE780 thumb_func_start sub_80BE834 sub_80BE834: ; 80BE834 push {r4,lr} adds r3, r0, 0 ldr r1, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000064a 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 .pool @080BE85C: ldr r4, [r1] ldr r1, =0x0000064a adds r0, r4, r1 ldrb r0, [r0] movs r1, 0x60 cmp r0, 0 bne @080BE86C movs r1, 0x50 @080BE86C: ldr r2, =0x0000064f 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, =gUnknown_08329F40 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 .pool @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, =0x02039b54 str r0, [r1] ldr r0, =sub_80BEA24 movs r1, 0 bl AddTask adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r1, =0x03005e00 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, =gUnknown_0856E630 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, =gUnknown_0856E640 bl Window_InitFromTemplates bl TextBox_ResetSomeField adds r0, r5, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80BE91C thumb_func_start sub_80BE9C4 sub_80BE9C4: ; 80BE9C4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0x8 ldrsh r0, [r1, r2] cmp r0, 0 bne @080BE9F0 ldr r1, [r1] ldr r0, =sub_80BEDF4 cmp r1, r0 bne @080BE9F0 movs r0, 0 b @080BE9F2 .align 2, 0 .pool @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, =0x02039b54 str r2, [r1] ldr r2, =0x03005e00 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 .pool 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, =0x030022c0 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, =@080BEA50 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080BEA8A b @080BEDA0 @080BEA8A: ldr r0, =0x02039b4c ldr r0, [r0] ldr r3, =0x0000064a adds r0, r3 movs r6, 0x1 strb r6, [r0] ldr r1, =0x030060b4 ldr r0, [r5, 0xC] str r0, [r1] movs r0, 0 bl SetVBlankCallback movs r2, 0 ldr r1, =0x03005e00 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 .pool @080BEAF0: ldr r1, =gUnknown_08DC1934 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, =gUnknown_08DC3080 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, =0x02039b54 ldr r0, [r0] ldrh r1, [r0] movs r0, 0x1 bl sub_80C0D30 movs r0, 0x1 movs r1, 0x2 bl Window_CopyToVram ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080BED70 .align 2, 0 .pool @080BEB50: movs r0, 0xD bl sub_80BFCDC ldr r4, =0x02039b4c ldr r0, [r4] ldr r1, =0x0000064d adds r0, r1 ldrb r0, [r0] movs r1, 0xD bl sub_80BFD0C ldr r0, [r4] ldr r2, =0x0000064c adds r0, r2 ldrb r0, [r0] lsls r0, 31 lsrs r0, 31 bl sub_80BC844 ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080BED70 .align 2, 0 .pool @080BEB90: movs r0, 0x87 lsls r0, 3 adds r1, r5, r0 b @080BED70 @080BEB98: ldr r4, =0x02039b54 ldr r3, [r4] ldrh r0, [r3] ldr r1, =0x02039b4c ldr r1, [r1] ldr r2, =0x00000612 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, =0x02037716 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, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080BED70 .align 2, 0 .pool @080BEC08: ldr r0, =0x03005e00 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, =0x02039b54 ldr r0, [r0] ldrh r0, [r0] movs r1, 0x30 movs r2, 0x38 movs r3, 0 bl sub_80C0E9C strh r0, [r4, 0x10] ldr r2, =0x02020630 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080BED70 .align 2, 0 .pool @080BEC60: movs r3, 0 ldr r0, =0x03005e00 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, =0x02020630 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, =0x030060b4 ldr r0, [r0] bl SetVBlankCallback b @080BED68 .align 2, 0 .pool @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, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080BED70 .align 2, 0 .pool @080BED04: ldr r0, =0x02037fd4 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, =0x03005e00 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, =0x02039b54 ldr r0, [r0] ldrh r0, [r0] bl NationalPokedexNumToSpecies lsls r0, 16 lsrs r0, 16 movs r1, 0 movs r2, 0x7D movs r3, 0xA bl sub_80A32C0 b @080BEDA0 .align 2, 0 .pool @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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @080BED70: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080BEDA0 .align 2, 0 .pool @080BED7C: ldr r1, =0x03005e00 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, =sub_80BEDF4 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 .pool 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, =0x03005e00 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, =sub_80BF038 str r0, [r4] movs r0, 0x6C bl audio_play b @080BEFBA .align 2, 0 .pool @080BEE34: ldr r1, =0x030022c0 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 .pool @080BEE50: movs r0, 0x1 ands r0, r2 cmp r0, 0 beq @080BEF28 ldr r5, =0x02039b4c ldr r0, [r5] ldr r1, =0x0000064d 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 .pool @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, =0x0000064e adds r0, r3 movs r1, 0x1 b @080BEEF0 .align 2, 0 .pool @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, =0x0000064e adds r0, r1 movs r1, 0x2 b @080BEEF0 .align 2, 0 .pool @080BEEC0: ldr r0, =0x02039b54 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 .pool @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, =0x0000064e adds r0, r3 movs r1, 0x3 @080BEEF0: strb r1, [r0] ldr r0, =sub_80BEFD0 str r0, [r4] movs r0, 0x15 bl audio_play b @080BEFBA .align 2, 0 .pool @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, =sub_80BF070 str r0, [r4] movs r0, 0x3 bl audio_play b @080BEFBA .align 2, 0 .pool @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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 bne @080BEF78 @080BEF44: ldr r3, =0x02039b4c ldr r0, [r3] ldr r4, =0x0000064d 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 .pool @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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 bne @080BEFBA @080BEF96: ldr r2, =0x02039b4c ldr r0, [r2] ldr r3, =0x0000064d 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BF02C ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r4, r0, r1 ldrh r0, [r4, 0x10] bl sub_818D820 ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 ldrb r0, [r0] cmp r0, 0x2 beq @080BF020 cmp r0, 0x2 ble @080BF008 cmp r0, 0x3 beq @080BF028 @080BF008: ldr r0, =sub_80BF0AC b @080BF02A .align 2, 0 .pool @080BF020: ldr r0, =sub_80BF250 b @080BF02A .align 2, 0 .pool @080BF028: ldr r0, =sub_80BF82C @080BF02A: str r0, [r4] @080BF02C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BF05E ldr r0, =0x03005e00 lsls r4, r2, 2 adds r4, r2 lsls r4, 3 adds r4, r0 ldrh r0, [r4, 0x10] bl sub_818D820 ldr r0, =sub_80BEA24 str r0, [r4] @080BF05E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BF09C ldr r0, =0x03005e00 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 .pool 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, =0x030022c0 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @080BF196 ldr r4, =0x02039b4c ldr r0, [r4] ldr r1, =0x0000064a adds r0, r1 movs r1, 0x5 strb r1, [r0] ldr r1, =0x030060b4 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, =0x0000064d adds r0, r1 strb r5, [r0] movs r0, 0x1 strb r0, [r7] b @080BF196 .align 2, 0 .pool @080BF120: movs r0, 0xD bl sub_80BFCF4 movs r0, 0 movs r1, 0xD bl sub_80BFD7C ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064c 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 .pool @080BF15C: ldr r0, =0x02039b54 ldr r0, [r0] ldrh r0, [r0] bl NationalPokedexNumToSpecies lsls r0, 16 lsrs r0, 16 ldr r5, =0x02039b4c ldr r1, [r5] ldr r4, =0x0000064e adds r1, r4 bl sub_813D3D8 ldr r0, =0x030060b4 ldr r0, [r0] bl SetVBlankCallback ldr r0, [r5] adds r0, r4 movs r1, 0 strb r1, [r0] strb r1, [r7] ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BF1B4 str r1, [r0] @080BF196: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80BF0AC thumb_func_start sub_80BF1B4 sub_80BF1B4: ; 80BF1B4 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080BF1D6 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BF1EC str r0, [r1] @080BF1D6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80BF1B4 thumb_func_start sub_80BF1EC sub_80BF1EC: ; 80BF1EC push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BF242 ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @080BF210 cmp r0, 0x2 beq @080BF234 @080BF210: ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BEA24 b @080BF240 .align 2, 0 .pool @080BF234: ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_80BF250 @080BF240: str r0, [r1] @080BF242: pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =@080BF27C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080BF2B6 b @080BF5B2 @080BF2B6: ldr r0, =0x03007420 bl MPlayStop_rev01 ldr r5, =0x02039b4c ldr r0, [r5] ldr r3, =0x0000064a adds r0, r3 movs r1, 0x6 strb r1, [r0] ldr r1, =0x030060b4 ldr r4, =0x030022c0 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, =0x0000064d 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 .pool @080BF310: ldr r1, =gUnknown_08DC1934 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, =gUnknown_08DC3198 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, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080BF582 .align 2, 0 .pool @080BF360: movs r0, 0xD bl sub_80BFCF4 movs r0, 0x1 movs r1, 0xD bl sub_80BFD7C ldr r0, =0x02039b4c ldr r0, [r0] ldr r4, =0x0000064c adds r0, r4 ldrb r0, [r0] lsls r0, 31 lsrs r0, 31 bl sub_80BC844 b @080BF57A .align 2, 0 .pool @080BF38C: bl sub_80A1A74 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @080BF582 .align 2, 0 .pool @080BF3A0: ldr r0, =gUnknown_085E871B movs r1, 0x52 movs r2, 0x21 bl sub_80BE8DC ldr r0, =0x02039b54 ldr r0, [r0] ldrh r1, [r0] movs r0, 0 movs r2, 0x52 movs r3, 0x31 bl sub_80C0B44 ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @080BF582 .align 2, 0 .pool @080BF3D0: ldr r0, =0x02039b54 ldr r0, [r0] ldrh r0, [r0] movs r1, 0x30 movs r2, 0x38 movs r3, 0 bl sub_80C0E9C ldr r2, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r2 movs r3, 0 strh r0, [r1, 0x10] ldr r2, =0x02020630 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, =0x030061ec strb r3, [r0] b @080BF57A .align 2, 0 .pool @080BF41C: ldr r1, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r1 ldr r1, =0x00004020 orrs r0, r1 ldr r1, =0xff00ffff ands r0, r1 movs r1, 0xF8 lsls r1, 13 orrs r0, r1 ldr r1, =0x00ffffff ands r0, r1 movs r1, 0x80 lsls r1, 20 orrs r0, r1 str r0, [sp, 0x4] ldr r1, =0xffff00ff ldr r0, [sp, 0x8] ands r0, r1 movs r1, 0xF0 lsls r1, 5 orrs r0, r1 ldr r1, =0xffffff00 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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 ldrb r0, [r1] adds r0, 0x1 movs r2, 0 strb r0, [r1] ldr r0, =0x030061ec strb r2, [r0] b @080BF5B2 .align 2, 0 .pool @080BF498: ldr r1, =0x00ffffff ldr r0, [sp, 0xC] ands r0, r1 movs r1, 0x90 lsls r1, 20 orrs r0, r1 str r0, [sp, 0xC] ldr r2, =0xffffff00 add r0, sp, 0xC ldr r1, [r0, 0x4] ands r1, r2 movs r2, 0x12 orrs r1, r2 ldr r2, =0xffff00ff 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, =0x030022c0 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 .pool @080BF514: movs r0, 0x15 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =0x030060b4 ldr r0, [r0] bl SetVBlankCallback ldr r1, =0x030022c0 movs r4, 0x87 lsls r4, 3 adds r1, r4 b @080BF582 .align 2, 0 .pool @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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @080BF582: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080BF5B2 .align 2, 0 .pool @080BF590: ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 movs r1, 0 strb r1, [r0] movs r3, 0x87 lsls r3, 3 adds r0, r2, r3 strb r1, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BF5CC str r1, [r0] @080BF5B2: add sp, 0x14 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x02039b54 ldr r0, [r0] ldrh r0, [r0] bl NationalPokedexNumToSpecies lsls r0, 16 lsrs r0, 16 bl sub_8145534 b @080BF772 .align 2, 0 .pool @080BF624: ldr r0, =0x02037fd4 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, =0x03007420 bl m4aMPlayContinue ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 movs r1, 0x1 strb r1, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BF790 str r1, [r0] movs r0, 0x3 bl audio_play b @080BF772 .align 2, 0 .pool @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, =0x03005d90 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, =0x03007420 bl m4aMPlayContinue ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 movs r1, 0x2 strb r1, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BF790 str r1, [r0] movs r0, 0x6D bl audio_play b @080BF772 .align 2, 0 .pool @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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 bne @080BF772 @080BF71E: ldr r0, =0x02039b54 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 .pool @080BF73C: movs r0, 0x15 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x03007420 bl m4aMPlayContinue ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 movs r1, 0x3 strb r1, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BF790 str r1, [r0] movs r0, 0x6D bl audio_play @080BF772: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BF7F0 bl sub_8145914 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r4, r0, r1 ldrh r0, [r4, 0x10] bl sub_818D820 ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 ldrb r0, [r0] cmp r0, 0x2 beq @080BF7E4 cmp r0, 0x2 ble @080BF7CC cmp r0, 0x3 beq @080BF7EC @080BF7CC: ldr r0, =sub_80BEA24 b @080BF7EE .align 2, 0 .pool @080BF7E4: ldr r0, =sub_80BF0AC b @080BF7EE .align 2, 0 .pool @080BF7EC: ldr r0, =sub_80BF82C @080BF7EE: str r0, [r4] @080BF7F0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000392 b @080BF812 .align 2, 0 .pool @080BF810: ldr r1, =0x000002af @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 .pool 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, =0x030022c0 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, =@080BF858 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080BF88E b @080BFB94 @080BF88E: ldr r4, =0x02039b4c ldr r0, [r4] ldr r1, =0x0000064a adds r0, r1 movs r1, 0x7 strb r1, [r0] ldr r1, =0x030060b4 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, =0x0000064d 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 .pool @080BF8D8: ldr r1, =gUnknown_08DC1934 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, =gUnknown_08DC2E6C 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 .pool @080BF910: movs r0, 0xD bl sub_80BFCF4 movs r0, 0x2 movs r1, 0xD bl sub_80BFD7C ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064c adds r0, r1 ldrb r0, [r0] lsls r0, 31 lsrs r0, 31 bl sub_80BC844 b @080BFB4E .align 2, 0 .pool @080BF93C: ldr r1, =gUnknown_085E8723 add r0, sp, 0x4 bl gf_strcpy ldr r0, =0x03005d90 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080BFB56 .align 2, 0 .pool @080BF97C: bl sub_80A1A74 b @080BFB4E @080BF982: ldr r0, =0x03005d90 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, =0x02020630 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, =gPokedexEntries ldr r0, =0x02039b54 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, =gUnknown_0856E610 ldrb r1, [r4, 0x5] lsrs r1, 4 adds r1, 0x10 lsls r1, 4 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 strh r6, [r0, 0x12] ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080BFB56 .align 2, 0 .pool @080BFA34: ldr r5, =0x02039b54 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, =0x02020630 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, =gPokedexEntries 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, =gUnknown_0856E610 ldrb r1, [r4, 0x5] lsrs r1, 4 adds r1, 0x10 lsls r1, 4 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0x03005e00 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 .pool @080BFAE8: movs r0, 0x15 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =0x030060b4 ldr r0, [r0] bl SetVBlankCallback ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080BFB56 .align 2, 0 .pool @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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @080BFB56: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080BFB94 .align 2, 0 .pool @080BFB64: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 bne @080BFB94 ldr r0, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 strb r2, [r0] movs r1, 0x87 lsls r1, 3 adds r0, r5, r1 strb r2, [r0] ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BFBB0 str r1, [r0] @080BFB94: add sp, 0x44 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 movs r1, 0x1 strb r1, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BFC78 str r1, [r0] movs r0, 0x3 bl audio_play b @080BFC5C .align 2, 0 .pool @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, =0x03005d90 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 movs r1, 0x2 strb r1, [r0] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_80BFC78 str r1, [r0] movs r0, 0x6D bl audio_play @080BFC5C: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080BFCD0 ldr r1, =0x03005e00 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064e adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @080BFCB2 cmp r0, 0x2 beq @080BFCCC @080BFCB2: ldr r0, =sub_80BEA24 b @080BFCCE .align 2, 0 .pool @080BFCCC: ldr r0, =sub_80BF250 @080BFCCE: str r0, [r4] @080BFCD0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80BFC78 thumb_func_start sub_80BFCDC sub_80BFCDC: ; 80BFCDC push {lr} ldr r1, =gUnknown_08DC2F5C movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80BFCDC thumb_func_start sub_80BFCF4 sub_80BFCF4: ; 80BFCF4 push {lr} ldr r1, =gUnknown_08DC2FEC movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000fff @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 .pool 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, =0x00000fff @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 .pool 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, =sub_80BFE38 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0 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 .pool 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, =0x03005e00 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, =@080BFE68 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080BFE68: .4byte @080BFE84 .4byte @080BFF0C .4byte @080BFF78 .4byte @080BFF82 .4byte @080BFFA8 .4byte @080C0000 .4byte @080C0044 @080BFE84: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080BFE92 b @080C0074 @080BFE92: ldr r1, =0x030060b4 ldr r0, =0x030022c0 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, =gUnknown_0856E668 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, =gUnknown_0856E670 bl Window_InitFromTemplates bl TextBox_ResetSomeField ldr r1, =0x03005e00 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 .pool @080BFF0C: ldr r1, =gUnknown_08DC1934 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, =gUnknown_08DC3080 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, =0x03005e00 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 .pool @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, =0x02020630 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, =0x030060b4 ldr r0, [r0] bl SetVBlankCallback ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r4, [r0, 0xE] b @080C0038 .align 2, 0 .pool @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, =0x03005e00 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 .pool @080C0044: ldr r0, =0x02037fd4 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 NationalPokedexNumToSpecies lsls r0, 16 lsrs r0, 16 movs r1, 0 bl cry_related ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r6, [r0, 0xC] ldr r1, =sub_80C0088 str r1, [r0] @080C0074: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @080C00E8 ldr r0, =0x0000ffff movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r3, =0x02020630 ldr r0, =0x03005e00 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, =sub_80C01CC str r2, [r0] ldr r0, =blockset_load_palette_to_gpu str r0, [r1] b @080C011E .align 2, 0 .pool @080C00E8: ldr r1, =0x03005e00 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, =gUnknown_08DC16F6 movs r1, 0x31 movs r2, 0xE bl gpu_pal_apply b @080C011E .align 2, 0 .pool @080C0114: ldr r0, =gUnknown_08DC1756 movs r1, 0x31 movs r2, 0xE bl gpu_pal_apply @080C011E: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e00 lsls r4, r6, 2 adds r4, r6 lsls r4, 3 adds r4, r0 ldrh r0, [r4, 0xA] bl NationalPokedexNumToSpecies 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, =0x02020630 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 .pool 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, =gUnknown_085E8735 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 NationalToHoennOrder lsls r0, 16 lsrs r5, r0, 16 b @080C0250 .align 2, 0 .pool @080C024C: adds r5, r6, 0 lsls r4, r6, 16 @080C0250: ldr r1, =gUnknown_085E8D4F 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 NationalPokedexNumToSpecies lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @080C028C movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r0, r1, r0 b @080C028E .align 2, 0 .pool @080C028C: ldr r0, =gUnknown_0856E688 @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 .pool @080C02AC: ldr r0, =gUnknown_085E86B8 @080C02AE: movs r1, 0x64 movs r2, 0x29 bl sub_80BE8DC ldr r0, =gUnknown_085E8755 movs r1, 0x60 movs r2, 0x39 bl sub_80BE8DC ldr r0, =gUnknown_085E8758 movs r1, 0x60 movs r2, 0x49 bl sub_80BE8DC cmp r7, 0 beq @080C02FC ldr r0, =gPokedexEntries 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 .pool @080C02FC: ldr r0, =gUnknown_085E86C6 movs r1, 0x81 movs r2, 0x39 bl sub_80BE8DC ldr r0, =gUnknown_085E86D0 movs r1, 0x81 movs r2, 0x49 bl sub_80BE8DC @080C0310: cmp r7, 0 beq @080C032C ldr r0, =gPokedexEntries lsls r1, r6, 5 adds r0, 0x10 adds r1, r0 ldr r4, [r1] b @080C032E .align 2, 0 .pool @080C032C: ldr r4, =gUnknown_0855D30C @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 .pool 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, =0x00002710 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 .pool @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, =0x000186a0 muls r0, r5 ldr r1, =0x000011b8 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 .pool @080C04C0: movs r1, 0x1 mov r8, r1 movs r6, 0x1 @080C04C6: ldr r1, =0x000186a0 adds r0, r7, 0 bl __umodsi3 adds r7, r0, 0 mov r4, sp adds r4, 0x1 ldr r1, =0x00002710 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 .pool @080C0504: movs r3, 0x1 mov r8, r3 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 @080C050E: ldr r1, =0x00002710 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 .pool @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, =gPokedexEntries adds r0, r1 bx lr .align 2, 0 .pool 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, =gPokedexEntries lsls r1, r2, 5 adds r1, r0 ldrh r0, [r1, 0xC] b @080C065C .align 2, 0 .pool @080C0654: ldr r0, =gPokedexEntries lsls r1, r2, 5 adds r1, r0 ldrh r0, [r1, 0xE] @080C065C: pop {r1} bx r1 .align 2, 0 .pool 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, =0xffff0000 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 .pool @080C069C: cmp r3, 0x2 bne @080C06A2 b @080C079C @080C06A2: cmp r3, 0x3 bne @080C06A8 b @080C07D8 @080C06A8: b @080C07E8 @080C06AA: ldr r1, =0x03005d90 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, =0x03005d8c ldr r3, [r0] ldr r6, =0x00000988 adds r1, r3, r6 adds r1, r4 ldrb r1, [r1] ands r1, r5 adds r6, r0, 0 cmp r2, r1 bne @080C06E0 ldr r1, =0x00003b24 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 .pool @080C06FC: ldr r1, =0x03005d90 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, =0x03005d8c cmp r2, r0 bne @080C0754 ldr r1, [r6] ldr r3, =0x00000988 adds r0, r1, r3 adds r0, r4 ldrb r0, [r0] ands r0, r5 cmp r2, r0 bne @080C0754 ldr r3, =0x00003b24 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 .pool @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, =0x00000988 adds r1, r0 adds r1, r4 ldrb r2, [r1] adds r0, r3, 0 ands r0, r2 strb r0, [r1] ldr r0, [r6] ldr r1, =0x00003b24 adds r0, r1 adds r0, r4 ldrb r1, [r0] ands r3, r1 strb r3, [r0] movs r6, 0 b @080C07E8 .align 2, 0 .pool @080C079C: ldr r0, =0x03005d90 ldr r1, [r0] adds r1, 0x5C adds r1, r4 ldrb r2, [r1] adds r0, r5, 0 orrs r0, r2 strb r0, [r1] ldr r3, =0x03005d8c ldr r1, [r3] ldr r0, =0x00000988 adds r1, r0 adds r1, r4 ldrb r2, [r1] adds r0, r5, 0 orrs r0, r2 strb r0, [r1] ldr r1, [r3] ldr r3, =0x00003b24 adds r1, r3 b @080C07DE .align 2, 0 .pool @080C07D8: ldr r0, =0x03005d90 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 .pool 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, =0x00000181 @080C0800: cmp r6, 0 beq @080C0810 cmp r6, 0x1 beq @080C081A adds r4, r0, 0x1 b @080C0832 .align 2, 0 .pool @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 HoennToNationalOrder lsls r0, 16 lsrs r0, 16 movs r1, 0 b @080C087C @080C086C: adds r4, r0, 0x1 lsls r0, r4, 16 lsrs r0, 16 bl HoennToNationalOrder 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 HoennToNationalOrder 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, =0x0000017f @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 .pool @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, =0x0300301c movs r0, 0x8 strb r0, [r1] @080C0A7E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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 NationalPokedexNumToSpecies adds r5, r0, 0 cmp r5, 0 beq @080C0BC0 movs r4, 0 ldr r2, =gSpeciesNames 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 .pool @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, =gMonFootprintTable adds r0, r1, 0 bl NationalPokedexNumToSpecies 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 .pool 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, =0x06000232 adds r3, r0, r2 movs r4, 0xF0 lsls r4, 8 adds r2, r1, r4 strh r2, [r3] ldr r2, =0x06000234 adds r3, r0, r2 adds r4, 0x1 adds r2, r1, r4 strh r2, [r3] ldr r2, =0x06000272 adds r3, r0, r2 adds r4, 0x1 adds r2, r1, r4 strh r2, [r3] ldr r2, =0x06000274 adds r0, r2 adds r4, 0x1 adds r1, r4 strh r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r0] ldr r0, [r0, 0x20] b @080C0E96 .align 2, 0 .pool @080C0E88: ldr r0, =0x03005d90 ldr r0, [r0] ldr r0, [r0, 0x1C] b @080C0E96 .align 2, 0 .pool @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 NationalPokedexNumToSpecies 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, =0x0000ffff 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 .pool 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, =0x0000ffff 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 .pool 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, =0x00000181 ldr r3, =0x02039b4c @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, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c 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, =gUnknown_0856ED08 adds r0, 0x3 adds r0, r7, r0 str r0, [sp, 0xC] ldr r0, =gUnknown_0856ED08 adds r0, r7 mov r9, r0 @080C0FBA: ldr r1, =0x02039b4c ldr r0, [r1] lsls r4, r5, 2 adds r0, r4 ldrh r0, [r0] bl NationalPokedexNumToSpecies lsls r0, 16 lsrs r2, r0, 16 ldr r1, =gSpeciesNames 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, =gUnknown_0856ED08 adds r1, 0x1 adds r1, r7, r1 ldrb r1, [r1] adds r0, r1 cmp r2, r0 blt @080C100A @080C0FF2: ldr r0, =gUnknown_0856ED08 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, =0x02039b4c 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, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c adds r0, r2 ldrh r0, [r0] cmp r5, r0 bcc @080C0FBA @080C1032: ldr r1, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c adds r0, r2 strh r6, [r0] @080C103C: ldr r0, [sp, 0x4] cmp r0, 0xFF beq @080C10AC movs r5, 0 movs r6, 0 ldr r1, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c adds r0, r2 ldrh r0, [r0] cmp r6, r0 bcs @080C10A2 adds r7, r1, 0 ldr r0, =gBaseStats mov r8, r0 @080C105A: ldr r0, [r7] lsls r4, r5, 2 adds r0, r4 ldrh r0, [r0] bl NationalPokedexNumToSpecies 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, =0x0000060c adds r0, r2 ldrh r0, [r0] cmp r5, r0 bcc @080C105A @080C10A2: ldr r1, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c 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, =0x02039b4c ldr r0, [r2] ldr r1, =0x0000060c 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 NationalPokedexNumToSpecies lsls r0, 16 lsrs r2, r0, 16 ldr r1, =gBaseStats 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, =0x0000060c adds r0, r2 ldrh r0, [r0] cmp r5, r0 bcc @080C10E0 b @080C11D4 .align 2, 0 .pool @080C1158: movs r5, 0 movs r6, 0 ldr r1, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c 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 NationalPokedexNumToSpecies lsls r0, 16 lsrs r2, r0, 16 ldr r1, =gBaseStats 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, =0x02039b4c 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, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c adds r0, r2 ldrh r0, [r0] cmp r5, r0 bcc @080C116C @080C11D4: ldr r1, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c adds r0, r2 strh r6, [r0] @080C11DE: ldr r1, =0x02039b4c ldr r0, [r1] ldr r2, =0x0000060c adds r1, r0, r2 ldrh r0, [r1] cmp r0, 0 beq @080C1232 adds r5, r0, 0 ldr r0, =0x00000181 cmp r5, r0 bhi @080C1232 ldr r4, =0x02039b4c movs r1, 0x2 negs r1, r1 mov r10, r1 movs r2, 0x3 negs r2, r2 mov r9, r2 mov r8, r0 ldr r0, =0x0000ffff 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 .pool thumb_func_end sub_80C0F30 thumb_func_start sub_80C1258 sub_80C1258: ; 80C1258 push {lr} ldr r0, =sub_80C12E0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x030022c0 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, =@080C130C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080C130C: .4byte @080C1320 .4byte @080C1414 .4byte @080C1480 .4byte @080C14A0 .4byte @080C14F0 @080C1320: ldr r0, =0x02037fd4 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000064a 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, =gUnknown_0856EFF8 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, =gUnknown_0856F008 bl Window_InitFromTemplates bl TextBox_ResetSomeField movs r0, 0 bl Window_WriteStandardTileMap ldr r1, =gUnknown_08DC3304 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, =gUnknown_08DC3A0C movs r0, 0x3 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map b @080C13F0 .align 2, 0 .pool @080C13E4: ldr r1, =gUnknown_08DC3870 movs r0, 0x3 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map @080C13F0: ldr r0, =gUnknown_08DC3286 movs r1, 0x1 movs r2, 0x7E bl gpu_pal_apply ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x1 strb r1, [r0] b @080C1516 .align 2, 0 .pool @080C1414: ldr r0, =gUnknown_0855D26C bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0855D27C 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, =0x03005e08 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 .pool @080C1480: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @080C14E2 .align 2, 0 .pool @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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @080C14E2: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C1516 .align 2, 0 .pool @080C14F0: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 bne @080C1516 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80C1570 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 .pool 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, =0x03005e00 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, =sub_80C15B0 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080C15E4 movs r0, 0x3 bl audio_play ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80C1D38 str r0, [r1] b @080C16BC .align 2, 0 .pool @080C15E4: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080C1640 ldr r1, =0x03005e00 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 .pool @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, =sub_80C16CC str r0, [r5] b @080C16BC .align 2, 0 .pool @080C1630: movs r0, 0x3 bl audio_play ldr r0, =sub_80C1D38 str r0, [r5] b @080C16BC .align 2, 0 .pool @080C1640: movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @080C167C ldr r0, =0x03005e00 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080C16BC ldr r0, =0x03005e00 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 .pool 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, =0x03005e00 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, =sub_80C170C str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_0856EDB8 cmp r0, 0 bne @080C174C ldr r6, =gUnknown_0856EDF0 b @080C174C .align 2, 0 .pool @080C1740: bl sub_809D42C ldr r6, =gUnknown_0856ED9C cmp r0, 0 bne @080C174C ldr r6, =gUnknown_0856EDD4 @080C174C: ldr r0, =0x030022c0 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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80C1570 str r0, [r1] b @080C1994 .align 2, 0 .pool @080C178C: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080C1870 ldr r0, =0x03005e00 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, =0x02039b52 movs r0, 0x40 strb r0, [r1] ldr r7, =0x02039b4c ldr r1, [r7] ldr r0, =0x0000062a adds r2, r1, r0 movs r0, 0x40 strh r0, [r2] ldr r0, =0x02039b50 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, =0x03005d90 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, =0x00000614 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, =sub_80C1D38 str r0, [r6] b @080C1994 .align 2, 0 .pool @080C183C: ldr r0, =gUnknown_085E875B bl sub_80C2618 ldr r0, =sub_80C19A4 str r0, [r6] movs r0, 0x70 bl audio_play movs r0, 0 movs r1, 0x2 bl Window_CopyToVram b @080C1994 .align 2, 0 .pool @080C1860: movs r0, 0x15 bl audio_play ldr r0, =sub_80C1B64 str r0, [r6] b @080C1994 .align 2, 0 .pool @080C1870: movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @080C18B6 ldr r1, =0x03005e00 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080C1900 ldr r1, =0x03005e00 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @080C194A ldr r1, =0x03005e00 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080C1994 ldr r1, =0x03005e00 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 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_80C1A4C 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 .pool 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, =0x02039b4c ldr r0, [r0] ldr r1, =0x0000060c adds r0, r1 ldrh r0, [r0] cmp r0, 0 beq @080C1A84 movs r0, 0x1F bl audio_play ldr r0, =gUnknown_085E8773 bl sub_80C2618 b @080C1A90 .align 2, 0 .pool @080C1A84: movs r0, 0x20 bl audio_play ldr r0, =gUnknown_085E8785 bl sub_80C2618 @080C1A90: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80C1AB8 str r0, [r1] movs r0, 0 movs r1, 0x2 bl Window_CopyToVram @080C1AA6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080C1B54 ldr r5, =0x02039b4c ldr r1, [r5] ldr r3, =0x0000060c adds r0, r1, r3 ldrh r0, [r0] cmp r0, 0 beq @080C1B40 ldr r0, =0x0000064e 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, =0x00000612 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, =0x00000616 adds r1, r3 strh r0, [r1] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80C1D38 str r1, [r0] movs r0, 0x3 bl audio_play b @080C1B54 .align 2, 0 .pool @080C1B40: ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_80C16CC str r0, [r1] movs r0, 0x17 bl audio_play @080C1B54: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_0856EFC8 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, =sub_80C1BCC 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 .pool 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, =0x03005e00 lsls r2, r7, 2 adds r2, r7 lsls r2, 3 adds r5, r2, r3 ldrb r1, [r5, 0xA] ldr r0, =gUnknown_0856EFC8 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, =0x030022c0 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 .pool @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, =sub_80C16CC 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 .pool @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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80C1D70 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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 .pool 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, =0x00000fff 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 .pool 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, =@080C1E28 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_0856ED30 lsls r0, r4, 3 adds r0, r1 ldrb r1, [r0, 0x4] ldrb r2, [r0, 0x5] b @080C1EC2 .align 2, 0 .pool @080C1E64: ldr r2, =gUnknown_0856ED48 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, =gUnknown_0856ED48 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 .pool @080C1E94: ldr r0, =gUnknown_0856ED48 ldrb r1, [r0, 0x1C] ldrb r2, [r0, 0x1D] ldrb r3, [r0, 0x1E] b @080C1EC4 .align 2, 0 .pool @080C1EA4: bl sub_809D42C cmp r0, 0 bne @080C1ED0 ldr r2, =gUnknown_0856ED48 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 .pool @080C1ED0: ldr r2, =gUnknown_0856ED48 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 .pool 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, =gUnknown_0856ED30 lsls r4, 3 adds r4, r0 ldr r0, [r4] bl sub_80C2618 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =@080C2084 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_0856ED48 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 .pool 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, =0x03005e00 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, =gUnknown_0856EE5C 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, =gUnknown_0856EEB4 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, =gUnknown_0856EF14 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, =gUnknown_0856EE24 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, =gUnknown_0856EE0C 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 .pool 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, =0x00000c0b adds r0, r1, 0 strh r0, [r5, 0x22] movs r1, 0x12 ldr r0, =0x0000080d 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, =0x0000040a 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, =0x00000362 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 .pool @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, =gUnknown_0856EFC8 ldr r3, =0x03005e00 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 .pool @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, =0x03005e08 adds r1, r0 ldr r2, =gUnknown_0856EFC8 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, =@080C2364 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_0856EFAC b @080C23AC .align 2, 0 .pool @080C2388: ldr r0, =gUnknown_0856EFAE b @080C23AC .align 2, 0 .pool @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, =gUnknown_0856EFB4 @080C23AC: adds r0, r2, r0 ldrb r0, [r0] @080C23B0: pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039b4c ldr r0, [r1] ldr r2, =0x00000614 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 .pool @080C23E0: movs r3, 0x1 @080C23E2: ldr r1, =0x03005e00 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, =@080C2410 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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, =gUnknown_0856EFC8 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 .pool @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, =0x03005e00 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, =gUnknown_0856EFC8 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 .pool @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, =0x03005e00 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, =sub_80C1BCC 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 .pool @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, =gUnknown_08329F40 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 .pool @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, =gUnknown_0855D1AC 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, =0x02020630 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, =sub_80C24E0 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 .pool 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, =gUnknown_085E8B3A lsls r2, 4 adds r2, 0x9 movs r1, 0x90 bl sub_80C1270 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039ce8 ldr r0, [r0] ldrb r0, [r0, 0x9] cmp r0, 0 beq @080C26C0 ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @080C26C0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C2690 thumb_func_start sub_80C26D4 sub_80C26D4: ; 80C26D4 push {r4,lr} ldr r4, =0x04000208 ldrh r3, [r4] movs r0, 0 strh r0, [r4] ldr r1, =0x02038c28 ldr r0, =0x04000006 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, =0x04000012 strh r1, [r0] strh r3, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039ce8 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 .pool 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, =0x02039ce8 ldr r0, [r1] ldrb r0, [r0] adds r4, r1, 0 cmp r0, 0x10 bls @080C2776 b @080C2ACA @080C2776: lsls r0, 2 ldr r1, =@080C2788 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00000ef8 adds r0, r1 bl sub_80C4550 ldr r1, [r4] b @080C28D8 .align 2, 0 .pool @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, =0x030030fc ldrb r0, [r0] cmp r0, 0x1 bne @080C2852 ldr r0, =0x03003124 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, =0x02039ce8 ldr r0, [r4] ldr r5, =0x0000052c 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, =sub_80C2690 bl SetVBlankCallback ldr r1, [r4] b @080C28D8 .align 2, 0 .pool @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, =0x02039ce8 ldr r1, [r0] movs r0, 0xA strb r0, [r1] b @080C2ACA .align 2, 0 .pool @080C28C8: bl mplay_has_finished_maybe lsls r0, 24 cmp r0, 0 beq @080C28D4 b @080C2ACA @080C28D4: ldr r0, =0x02039ce8 ldr r1, [r0] @080C28D8: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C2ACA .align 2, 0 .pool @080C28E4: ldr r0, =0x03003124 ldrb r5, [r0] cmp r5, 0 bne @080C290A ldr r0, [r4] ldr r1, =0x00000529 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, =0x00000529 adds r0, r2 strb r5, [r0] @080C290A: ldr r0, =0x030022c0 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, =0x02039ce8 ldr r1, [r0] movs r0, 0xC strb r0, [r1] b @080C2ACA .align 2, 0 .pool @080C293C: movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @080C2946 b @080C2ACA @080C2946: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080C2960 ldr r4, =0x02039ce8 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, =0x02039ce8 b @080C2A74 .align 2, 0 .pool @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, =0x02039ce8 ldr r1, [r0] movs r0, 0xB strb r0, [r1] b @080C2ACA .align 2, 0 .pool @080C299C: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080C29F4 ldr r0, =0x03003124 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, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080C29DC movs r0, 0x1 negs r0, r0 ldr r4, =0x02039ce8 b @080C2A74 .align 2, 0 .pool @080C29DC: bl sub_80C4918 ldr r0, =0x02039ce8 ldr r1, [r0] movs r0, 0xD strb r0, [r1] movs r0, 0xF9 bl audio_play b @080C2ACA .align 2, 0 .pool @080C29F4: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080C2ACA ldr r0, =0x03003124 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 .pool @080C2A20: movs r0, 0x1 negs r0, r0 ldr r4, =0x02039ce8 b @080C2A74 .align 2, 0 .pool @080C2A2C: bl sub_800AC34 movs r0, 0 movs r1, 0x1 bl sub_81973C4 ldr r2, =gUnknown_085ED042 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, =0x02039ce8 ldr r1, [r0] movs r0, 0x10 strb r0, [r1] b @080C2ACA .align 2, 0 .pool @080C2A68: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080C2ACA movs r0, 0x1 negs r0, r0 @080C2A74: ldr r1, [r4] ldr r2, =0x0000052c 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 .pool @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, =0x02039ce8 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 .pool thumb_func_end sub_80C2760 thumb_func_start sub_80C2AD8 sub_80C2AD8: ; 80C2AD8 push {lr} ldr r0, =0x02039ce8 ldr r1, [r0] ldrb r0, [r1, 0x2] cmp r0, 0x5 bls @080C2AE6 b @080C2C64 @080C2AE6: lsls r0, 2 ldr r1, =@080C2AF8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080C2AF8: .4byte @080C2B10 .4byte @080C2B44 .4byte @080C2B78 .4byte @080C2BD0 .4byte @080C2C04 .4byte @080C2C38 @080C2B10: ldr r0, =0x02039ce8 ldr r1, [r0] ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080C2B34 ldr r0, =gUnknown_08DD1F78 ldr r2, =0x00000ef8 b @080C2C4A .align 2, 0 .pool @080C2B34: ldr r0, =gUnknown_08DD2AE0 ldr r2, =0x00000ef8 b @080C2C4A .align 2, 0 .pool @080C2B44: ldr r0, =0x02039ce8 ldr r1, [r0] ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080C2B68 ldr r0, =gUnknown_08DD21B0 ldr r2, =0x00000a48 b @080C2C4A .align 2, 0 .pool @080C2B68: ldr r0, =gUnknown_08DD2D30 ldr r2, =0x00000a48 b @080C2C4A .align 2, 0 .pool @080C2B78: ldr r0, =0x02039ce8 ldr r1, [r0] ldrb r0, [r1, 0x5] cmp r0, 0 bne @080C2BAC ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080C2BA0 ldr r0, =gUnknown_08DD2010 adds r2, 0x6E b @080C2C4A .align 2, 0 .pool @080C2BA0: ldr r0, =gUnknown_08DD2B78 movs r2, 0xB3 lsls r2, 3 b @080C2C4A .align 2, 0 .pool @080C2BAC: ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080C2BC4 ldr r0, =gUnknown_08DD228C adds r2, 0x6E b @080C2C4A .align 2, 0 .pool @080C2BC4: ldr r0, =gUnknown_08DD2E5C movs r2, 0xB3 lsls r2, 3 b @080C2C4A .align 2, 0 .pool @080C2BD0: ldr r0, =0x02039ce8 ldr r1, [r0] ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080C2BF4 ldr r0, =gUnknown_0856F5CC ldr r2, =0x000013a8 b @080C2C4A .align 2, 0 .pool @080C2BF4: ldr r0, =gUnknown_0856F814 ldr r2, =0x000013a8 b @080C2C4A .align 2, 0 .pool @080C2C04: ldr r0, =0x02039ce8 ldr r1, [r0] ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080C2C28 ldr r0, =gUnknown_08DD1AB8 ldr r2, =0x000019a8 b @080C2C4A .align 2, 0 .pool @080C2C28: ldr r0, =gUnknown_08DD246C ldr r2, =0x000019a8 b @080C2C4A .align 2, 0 .pool @080C2C38: ldr r0, =0x02039ce8 ldr r1, [r0] ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 bne @080C2C6C ldr r0, =gUnknown_0856F018 ldr r2, =0x000017a8 @080C2C4A: adds r1, r2 bl LZ77UnCompWram b @080C2C6C .align 2, 0 .pool @080C2C64: movs r0, 0 strb r0, [r1, 0x2] movs r0, 0x1 b @080C2C78 @080C2C6C: ldr r0, =0x02039ce8 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 .pool thumb_func_end sub_80C2AD8 thumb_func_start sub_80C2C80 sub_80C2C80: ; 80C2C80 push {lr} sub sp, 0x8 ldr r1, =0x030022c0 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, =@080C2CA8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080C2DCC .align 2, 0 .pool @080C2CEC: movs r1, 0xE0 lsls r1, 19 movs r0, 0 str r0, [sp] ldr r0, =0x040000d4 mov r2, sp str r2, [r0] str r1, [r0, 0x4] ldr r1, =0x85000100 str r1, [r0, 0x8] ldr r0, [r0, 0x8] movs r0, 0x87 lsls r0, 3 adds r1, r3, r0 b @080C2DCC .align 2, 0 .pool @080C2D14: ldr r0, =0x02039ce8 ldr r0, [r0] ldr r1, =0x0000052c 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, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x81000200 str r1, [r0, 0x8] ldr r0, [r0, 0x8] @080C2D36: movs r2, 0x87 lsls r2, 3 adds r1, r3, r2 b @080C2DCC .align 2, 0 .pool @080C2D50: bl reset_all_obj_data bl gpu_pal_allocator_reset bl sub_80A1A74 ldr r1, =0x030022c0 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 .pool @080C2D74: bl sub_80C41D8 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080C2DCC .align 2, 0 .pool @080C2D88: bl sub_80C2AD8 b @080C2DBC @080C2D8E: bl sub_80C4330 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080C2DCC .align 2, 0 .pool @080C2DA0: bl sub_80C3278 b @080C2DC4 @080C2DA6: bl sub_80C3548 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @080C2DCC .align 2, 0 .pool @080C2DB8: bl sub_80C43A8 @080C2DBC: lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080C2DDC @080C2DC4: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @080C2DCC: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C2DDC .align 2, 0 .pool @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, =0x000008c4 adds r0, r4, r1 bl flag_check lsls r0, 24 cmp r0, 0 beq @080C2E1E ldr r1, =0x000008c5 adds r0, r4, r1 bl flag_check lsls r0, 24 cmp r0, 0 bne @080C2E2C @080C2E1E: movs r0, 0 b @080C2E38 .align 2, 0 .pool @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, =0x03005d90 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, =0x000003e7 cmp r0, r1 bls @080C2F14 strh r1, [r5, 0x6] movs r0, 0x3B strh r0, [r5, 0x8] strh r0, [r5, 0xA] @080C2F14: ldr r0, =0x00000861 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, =0x0000270f 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, =0x0000ffff movs r0, 0x15 bl sav12_xor_get_clamped_above strh r0, [r5, 0x20] ldr r4, =0x03005d8c 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, =0x00002bb0 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, =0x03005d90 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 .pool @080C2FC0: mov r1, r8 cmp r1, 0x2 bne @080C3014 movs r0, 0 strh r0, [r5, 0x18] strh r0, [r5, 0x1A] @080C2FCC: ldr r1, =0x000003e7 movs r0, 0x23 bl sav12_xor_get_clamped_above strh r0, [r5, 0x1C] ldr r1, =0x0000ffff 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 .pool @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, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000eba 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, =gUnknown_08329D54 ldrh r0, [r4, 0xE] movs r1, 0x7 ands r0, r1 adds r0, 0x8 b @080C308C .align 2, 0 .pool @080C3084: ldr r2, =gUnknown_08329D54 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 .pool 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, =0x03005d90 ldr r1, [r1] ldr r2, =0x00000eba 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, =gUnknown_08329D54 ldrh r0, [r4, 0xE] movs r1, 0x7 ands r0, r1 adds r0, 0x8 b @080C3108 .align 2, 0 .pool @080C3100: ldr r2, =gUnknown_08329D54 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 .pool 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, =0x02039ce8 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, =0x00000536 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, =0x0000053a adds r0, r1, r3 ldrh r0, [r0] cmp r0, 0 bne @080C31E4 ldr r2, =0x0000053c 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, =0x02039ce8 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, =0x00000554 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, =0x0000054c 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, =0x00000867 @080C3228: lsls r0, r4, 16 lsrs r0, 16 bl flag_check lsls r0, 24 cmp r0, 0 beq @080C3244 ldr r0, =0x02039ce8 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, =0x0000086e cmp r4, r0 bls @080C3228 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080C32E0 movs r0, 0xC7 bl enable_irqs b @080C32E6 .align 2, 0 .pool @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, =0x02039ce8 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, =0x00007ca8 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 .pool 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, =gUnknown_0856FAB4 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, =gUnknown_0856FAC4 bl Window_InitFromTemplates bl TextBox_ResetSomeField bl sub_81973A4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3388 thumb_func_start sub_80C3404 sub_80C3404: ; 80C3404 push {lr} ldr r0, =sub_80C2710 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3404 thumb_func_start sub_80C3414 sub_80C3414: ; 80C3414 push {lr} bl clear_tasks bl remove_some_task ldr r0, =sub_80C2760 movs r1, 0 bl AddTask bl sub_80C4EE4 bl sub_80C3190 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3414 thumb_func_start sub_80C3438 sub_80C3438: ; 80C3438 push {lr} ldr r0, =0x02039ce8 ldr r1, [r0] ldrb r0, [r1, 0x1] cmp r0, 0x5 bhi @080C3494 lsls r0, 2 ldr r1, =@080C3458 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039ce8 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 .pool thumb_func_end sub_80C3438 thumb_func_start sub_80C34B0 sub_80C34B0: ; 80C34B0 push {lr} ldr r0, =0x02039ce8 ldr r1, [r0] ldrb r0, [r1, 0x1] cmp r0, 0x7 bhi @080C352C lsls r0, 2 ldr r1, =@080C34D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039ce8 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 .pool 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, =gUnknown_085ECF71 add r0, sp, 0xC bl gf_strcpy adds r5, r0, 0 ldr r4, =0x02039ce8 ldr r1, [r4] ldr r0, =0x00000564 adds r1, r0 adds r0, r5, 0 bl gf_strcpy ldr r0, [r4] ldr r1, =0x00007caa adds r0, r1 ldrb r1, [r0] adds r0, r5, 0 bl sub_8009308 ldr r0, [r4] ldr r1, =0x0000052a adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080C35E0 ldr r0, =gUnknown_0856FB0C 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 .pool @080C35E0: ldr r0, =gUnknown_0856FB0C 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 .pool thumb_func_end sub_80C3574 thumb_func_start sub_80C3608 sub_80C3608: ; 80C3608 push {r4,lr} sub sp, 0x2C ldr r1, =gUnknown_085ECF78 add r0, sp, 0xC bl gf_strcpy ldr r4, =0x02039ce8 ldr r1, [r4] ldr r2, =0x00000542 adds r1, r2 ldrh r1, [r1] movs r2, 0x2 movs r3, 0x5 bl decimal_int_to_string ldr r0, [r4] ldr r1, =0x0000052a 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 .pool @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, =gUnknown_0856FB0C 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 .pool thumb_func_end sub_80C3608 thumb_func_start sub_80C3684 sub_80C3684: ; 80C3684 push {r4,r5,lr} sub sp, 0xC ldr r0, =0x02039ce8 ldr r0, [r0] ldr r1, =0x0000052b adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080C36C4 ldr r0, =gUnknown_0856FB0C str r0, [sp] movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] ldr r0, =gUnknown_085ECF7E str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 movs r2, 0x14 movs r3, 0x38 bl box_print b @080C36DE .align 2, 0 .pool @080C36C4: ldr r0, =gUnknown_0856FB0C str r0, [sp] movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] ldr r0, =gUnknown_085ECF7E str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 movs r2, 0x10 movs r3, 0x39 bl box_print @080C36DE: ldr r0, =0x02021cc4 ldr r4, =0x02039ce8 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, =0x02021fc4 ldr r1, =gUnknown_085E969C adds r0, r5, 0 bl ExpandTextCodes ldr r0, [r4] ldr r1, =0x0000052b 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 .pool @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, =gUnknown_0856FB0C str r0, [sp] movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] ldr r0, =0x02021fc4 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 .pool 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, =0x00000861 bl flag_check lsls r0, 24 cmp r0, 0 beq @080C386E ldr r0, =0x02039ce8 ldr r0, [r0] ldr r1, =0x0000052b adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080C37DC ldr r0, =gUnknown_0856FB0C str r0, [sp] movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] ldr r0, =gUnknown_085ECF86 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 movs r2, 0x14 movs r3, 0x48 bl box_print b @080C37F6 .align 2, 0 .pool @080C37DC: ldr r0, =gUnknown_0856FB0C str r0, [sp] movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] ldr r0, =gUnknown_085ECF86 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 movs r2, 0x10 movs r3, 0x49 bl box_print @080C37F6: ldr r5, =0x02021fc4 ldr r4, =0x02039ce8 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, =gUnknown_085ECF8E bl gf_strcpy ldr r0, [r4] ldr r1, =0x0000052b 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 .pool @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, =gUnknown_0856FB0C str r0, [sp] movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] ldr r0, =0x02021fc4 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 .pool 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, =0x02039ce8 ldr r0, [r0] ldr r1, =0x0000052b adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080C38C8 ldr r0, =gUnknown_0856FB0C str r0, [sp] movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] ldr r0, =gUnknown_085ECF99 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 movs r2, 0x14 movs r3, 0x58 bl box_print b @080C38E2 .align 2, 0 .pool @080C38C8: ldr r0, =gUnknown_0856FB0C str r0, [sp] movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] ldr r0, =gUnknown_085ECF99 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 movs r2, 0x10 movs r3, 0x59 bl box_print @080C38E2: ldr r0, =0x02039ce8 ldr r1, [r0] ldrb r0, [r1, 0x5] cmp r0, 0 beq @080C390C ldr r2, =0x00000544 adds r0, r1, r2 ldrh r5, [r0] adds r2, 0x2 adds r0, r1, r2 ldrh r6, [r0] b @080C3914 .align 2, 0 .pool @080C390C: ldr r0, =0x03005d90 ldr r0, [r0] ldrh r5, [r0, 0xE] ldrb r6, [r0, 0x10] @080C3914: ldr r0, =0x000003e7 cmp r5, r0 bls @080C391C adds r5, r0, 0 @080C391C: cmp r6, 0x3B bls @080C3922 movs r6, 0x3B @080C3922: ldr r1, =gUnknown_085ECF8F movs r0, 0x1 movs r2, 0 bl font_get_width_of_string mov r10, r0 ldr r0, =0x02039ce8 ldr r0, [r0] ldr r1, =0x0000052b adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080C3958 movs r7, 0x90 movs r4, 0x58 b @080C395C .align 2, 0 .pool @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, =0x02021fc4 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, =gUnknown_0856FB0C 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, =gUnknown_0856FB40 ldr r0, =0x02039ce8 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, =gUnknown_085ECF8F 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 .pool 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, =0x02039ce8 ldr r1, [r7] ldrb r0, [r1, 0x5] cmp r0, 0 beq @080C3ACE ldr r0, =gUnknown_0856FB48 mov r8, r0 ldr r4, =0x0000052b adds r0, r1, r4 ldrb r0, [r0] add r0, r8 ldrb r3, [r0] ldr r6, =gUnknown_0856FB0C 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, =gUnknown_0856FB4A 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 .pool thumb_func_end sub_80C3A18 thumb_func_start sub_80C3AF0 sub_80C3AF0: ; 80C3AF0 push {r4,lr} ldr r4, =0x02039ce8 ldr r1, [r4] adds r0, r1, 0 adds r0, 0x4D ldr r2, =0x00000564 adds r1, r2 bl gf_strcpy ldr r1, [r4] adds r0, r1, 0 adds r0, 0x4D ldr r2, =0x00007caa adds r1, r2 ldrb r1, [r1] bl sub_8009308 ldr r1, [r4] ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080C3B30 ldr r0, =0x02021cc4 adds r1, 0x4D bl gf_strcpy ldr r0, [r4] adds r0, 0x4D ldr r1, =gUnknown_085ECFA6 bl ExpandTextCodes @080C3B30: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3AF0 thumb_func_start sub_80C3B50 sub_80C3B50: ; 80C3B50 push {r4,lr} sub sp, 0xC ldr r4, =0x02039ce8 ldr r1, [r4] ldr r2, =0x0000052b adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 bne @080C3B8C ldr r0, =gUnknown_0856FB0C 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 .pool @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, =gUnknown_0856FB0C 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 .pool thumb_func_end sub_80C3B50 thumb_func_start sub_80C3BC4 sub_80C3BC4: ; 80C3BC4 push {r4,lr} ldr r4, =0x02039ce8 ldr r1, [r4] ldrb r0, [r1, 0xB] cmp r0, 0 beq @080C3C0E ldr r0, =0x02021cc4 ldr r2, =0x0000053a adds r1, r2 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r0, =0x02021dc4 ldr r1, [r4] ldr r2, =0x0000053c adds r1, r2 ldrh r1, [r1] movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r0, =0x02021ec4 ldr r1, [r4] ldr r2, =0x0000053e 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, =gUnknown_0856FB4C bl ExpandTextCodes @080C3C0E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0856FB55 ldr r6, =0x02039ce8 ldr r0, [r6] ldr r5, =0x0000052b 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, =gUnknown_0856FB0C 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, =gUnknown_0856FB57 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 .pool thumb_func_end sub_80C3C34 thumb_func_start sub_80C3CCC sub_80C3CCC: ; 80C3CCC push {lr} ldr r0, =0x02039ce8 ldr r2, [r0] ldrb r0, [r2, 0xB] cmp r0, 0 beq @080C3CE4 ldr r1, =gUnknown_085ECFB8 adds r2, 0x93 ldr r3, =gUnknown_0856FB0F movs r0, 0 bl sub_80C3C34 @080C3CE4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3CCC thumb_func_start sub_80C3CF4 sub_80C3CF4: ; 80C3CF4 push {r4,lr} ldr r4, =0x02039ce8 ldr r1, [r4] ldrb r0, [r1, 0xC] cmp r0, 0 beq @080C3D40 adds r0, r1, 0 adds r0, 0xD9 ldr r2, =gUnknown_0856FB5C ldr r3, =0x0000052a adds r1, r3 ldrb r1, [r1] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r1, [r4] ldr r2, =0x00000165 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, =0x000001ab adds r0, r1, r2 ldr r3, =0x0000054a 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 .pool thumb_func_end sub_80C3CF4 thumb_func_start sub_80C3D60 sub_80C3D60: ; 80C3D60 push {r4,r5,lr} ldr r5, =0x02039ce8 ldr r1, [r5] ldrb r0, [r1, 0xC] cmp r0, 0 beq @080C3D9A ldr r0, =0x02021cc4 ldr r2, =0x00000165 adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 ldr r1, [r5] ldr r2, =0x000001ab adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085ECFED adds r0, r4, 0 bl ExpandTextCodes ldr r1, [r5] adds r1, 0xD9 ldr r3, =gUnknown_0856FB0C movs r0, 0x1 adds r2, r4, 0 bl sub_80C3C34 @080C3D9A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3D60 thumb_func_start sub_80C3DC0 sub_80C3DC0: ; 80C3DC0 push {lr} ldr r0, =0x02039ce8 ldr r1, [r0] ldrb r0, [r1, 0x10] cmp r0, 0 beq @080C3DDE ldr r2, =0x00000237 adds r0, r1, r2 ldr r2, =0x00000554 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 .pool thumb_func_end sub_80C3DC0 thumb_func_start sub_80C3DF0 sub_80C3DF0: ; 80C3DF0 push {lr} ldr r0, =0x02039ce8 ldr r2, [r0] ldrb r0, [r2, 0x10] cmp r0, 0 beq @080C3E0A ldr r1, =gUnknown_085ED010 ldr r0, =0x00000237 adds r2, r0 ldr r3, =gUnknown_0856FB0F movs r0, 0x2 bl sub_80C3C34 @080C3E0A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3DF0 thumb_func_start sub_80C3E20 sub_80C3E20: ; 80C3E20 push {lr} ldr r0, =0x02039ce8 ldr r2, [r0] ldr r1, =0x0000052a 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, =0x000002c3 adds r0, r2, r3 movs r2, 0x1 movs r3, 0x5 bl decimal_int_to_string @080C3E48: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3E20 thumb_func_start sub_80C3E58 sub_80C3E58: ; 80C3E58 push {lr} ldr r0, =0x02039ce8 ldr r2, [r0] ldr r1, =0x0000052a 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, =gUnknown_085ED036 ldr r0, =0x000002c3 adds r2, r0 ldr r3, =gUnknown_0856FB0F movs r0, 0x4 bl sub_80C3C34 @080C3E80: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3E58 thumb_func_start sub_80C3E98 sub_80C3E98: ; 80C3E98 push {lr} ldr r0, =0x02039ce8 ldr r2, [r0] ldr r1, =0x0000052a adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0 bne @080C3EBE ldr r3, =0x00000574 adds r0, r2, r3 ldr r1, [r0] cmp r1, 0 beq @080C3EBE ldr r3, =0x0000034f adds r0, r2, r3 movs r2, 0x1 movs r3, 0x5 bl decimal_int_to_string @080C3EBE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3E98 thumb_func_start sub_80C3ED4 sub_80C3ED4: ; 80C3ED4 push {lr} ldr r0, =0x02039ce8 ldr r2, [r0] ldr r1, =0x0000052a 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, =gUnknown_085ED01F ldr r0, =0x0000034f adds r2, r0 ldr r3, =gUnknown_0856FB0F movs r0, 0x3 bl sub_80C3C34 @080C3EFC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3ED4 thumb_func_start sub_80C3F14 sub_80C3F14: ; 80C3F14 push {r4,lr} ldr r4, =0x02039ce8 ldr r1, [r4] ldr r2, =0x0000052a adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080C3F46 ldr r0, =0x00000552 adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @080C3F46 ldr r0, =0x02021cc4 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x5 bl decimal_int_to_string ldr r0, [r4] ldr r1, =0x00000395 adds r0, r1 ldr r1, =gUnknown_085ED096 bl ExpandTextCodes @080C3F46: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3F14 thumb_func_start sub_80C3F64 sub_80C3F64: ; 80C3F64 push {lr} ldr r0, =0x02039ce8 ldr r2, [r0] ldr r1, =0x0000052a 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, =gUnknown_085ED085 ldr r0, =0x00000395 adds r2, r0 ldr r3, =gUnknown_0856FB0F movs r0, 0x3 bl sub_80C3C34 @080C3F8C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3F64 thumb_func_start sub_80C3FA4 sub_80C3FA4: ; 80C3FA4 push {lr} ldr r0, =0x02039ce8 ldr r1, [r0] ldr r2, =0x0000052a 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, =0x000003db 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 .pool thumb_func_end sub_80C3FA4 thumb_func_start sub_80C3FE0 sub_80C3FE0: ; 80C3FE0 push {lr} ldr r0, =0x02039ce8 ldr r2, [r0] ldr r1, =0x0000052a 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, =gUnknown_085ED09F ldr r0, =0x000003db adds r2, r0 ldr r3, =gUnknown_0856FB0F movs r0, 0x4 bl sub_80C3C34 @080C4008: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C3FE0 thumb_func_start sub_80C4020 sub_80C4020: ; 80C4020 push {r4,lr} ldr r4, =0x02039ce8 ldr r1, [r4] ldr r2, =0x0000052a 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 .pool @080C4044: ldrb r0, [r1, 0xD] cmp r0, 0 beq @080C40B6 ldr r0, =0x02021cc4 ldr r2, =0x0000054c adds r1, r2 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r0, =0x02021dc4 ldr r1, [r4] ldr r2, =0x0000054e adds r1, r2 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r0, [r4] ldr r1, =0x00000421 adds r0, r1 ldr r1, =gUnknown_085ED0E0 bl ExpandTextCodes b @080C40B6 .align 2, 0 .pool @080C4094: ldr r2, =0x00000596 adds r1, r2 ldrh r0, [r1] cmp r0, 0 beq @080C40B6 ldr r0, =0x02021cc4 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x5 bl decimal_int_to_string ldr r0, [r4] ldr r1, =0x00000421 adds r0, r1 ldr r1, =gUnknown_085ED0C8 bl ExpandTextCodes @080C40B6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C4020 thumb_func_start sub_80C40CC sub_80C40CC: ; 80C40CC push {lr} ldr r0, =0x02039ce8 ldr r2, [r0] ldr r1, =0x0000052a 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 .pool @080C40F0: ldrb r0, [r2, 0xD] cmp r0, 0 beq @080C412C ldr r1, =gUnknown_085ED0D3 ldr r0, =0x00000421 adds r2, r0 ldr r3, =gUnknown_0856FB0C movs r0, 0x5 bl sub_80C3C34 b @080C412C .align 2, 0 .pool @080C4114: ldr r1, =0x00000596 adds r0, r2, r1 ldrh r0, [r0] cmp r0, 0 beq @080C412C ldr r1, =gUnknown_085ED0B6 ldr r0, =0x00000421 adds r2, r0 ldr r3, =gUnknown_0856FB0F movs r0, 0x5 bl sub_80C3C34 @080C412C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C40CC thumb_func_start sub_80C4140 sub_80C4140: ; 80C4140 push {r4,r5,lr} sub sp, 0x20 ldr r1, =gUnknown_0856FB68 add r0, sp, 0x10 movs r2, 0x6 bl memcpy add r4, sp, 0x18 ldr r1, =gUnknown_0856FB6E adds r0, r4, 0 movs r2, 0x6 bl memcpy ldr r0, =0x02039ce8 ldr r0, [r0] ldr r1, =0x0000052a adds r0, r1 ldrb r0, [r0] adds r5, r4, 0 cmp r0, 0 bne @080C41C0 movs r4, 0 @080C416C: ldr r0, =0x02039ce8 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 .pool thumb_func_end sub_80C4140 thumb_func_start sub_80C41D8 sub_80C41D8: ; 80C41D8 push {r4,r5,lr} sub sp, 0x4 ldr r0, =gMonIconPalettes ldr r4, =0x02039ce8 ldr r1, [r4] movs r5, 0x8D lsls r5, 3 adds r1, r5 movs r2, 0x60 bl CpuSet ldr r4, [r4] ldr r1, =0x00000582 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 .pool @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, =0x02039ce8 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, =0x02039ce8 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 .pool thumb_func_end sub_80C41D8 thumb_func_start sub_80C42A4 sub_80C42A4: ; 80C42A4 push {r4,lr} sub sp, 0x14 ldr r1, =gUnknown_0856FB74 add r0, sp, 0x10 movs r2, 0x4 bl memcpy ldr r0, =0x02039ce8 ldr r1, [r0] ldr r2, =0x0000052a 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, =0x02039ce8 ldr r0, [r0] ldr r1, =0x00000584 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 .pool thumb_func_end sub_80C42A4 thumb_func_start sub_80C4330 sub_80C4330: ; 80C4330 push {lr} ldr r0, =gUnknown_0856F54C movs r1, 0xB0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_0856F56C movs r1, 0xC0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_0856F58C movs r1, 0xD0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_0856F5AC movs r1, 0xE0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =0x02039ce8 ldr r1, [r0] ldr r0, =0x000017a8 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 .pool 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, =0x02039ce8 ldr r0, [r0] ldrb r0, [r0, 0x3] cmp r0, 0x4 bls @080C43B8 b @080C4532 @080C43B8: lsls r0, 2 ldr r1, =@080C43CC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080C43CC: .4byte @080C43E0 .4byte @080C43F8 .4byte @080C4418 .4byte @080C44D8 .4byte @080C4500 @080C43E0: ldr r0, =0x02039ce8 ldr r1, [r0] ldr r0, =0x000013a8 adds r1, r0 movs r2, 0x80 lsls r2, 3 movs r0, 0x3 b @080C4406 .align 2, 0 .pool @080C43F8: ldr r0, =0x02039ce8 ldr r1, [r0] ldr r3, =0x000019a8 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 .pool @080C4418: ldr r4, =0x02039ce8 ldr r2, [r4] ldr r1, =0x0000052a adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0 beq @080C447C ldr r1, =gUnknown_0856FAE4 ldr r3, =0x00000535 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, =gUnknown_0856F4EC movs r1, 0x30 movs r2, 0x20 bl gpu_pal_apply ldr r0, [r4] ldr r1, =0x00000534 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080C44B2 ldr r0, =gUnknown_0856F4AC movs r1, 0x10 movs r2, 0x20 bl gpu_pal_apply b @080C44B2 .align 2, 0 .pool @080C447C: ldr r1, =gUnknown_0856FAF8 ldr r3, =0x00000535 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, =gUnknown_0856F50C movs r1, 0x30 movs r2, 0x20 bl gpu_pal_apply ldr r0, [r4] ldr r1, =0x00000534 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080C44B2 ldr r0, =gUnknown_0856F4CC movs r1, 0x10 movs r2, 0x20 bl gpu_pal_apply @080C44B2: ldr r0, =gUnknown_0856F52C movs r1, 0x40 movs r2, 0x20 bl gpu_pal_apply b @080C4536 .align 2, 0 .pool @080C44D8: ldr r4, =0x02039ce8 ldr r1, [r4] ldr r3, =0x00003ca8 adds r1, r3 movs r0, 0 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00005ca8 adds r1, r0 movs r0, 0x2 bl bg_set_tilemap b @080C4536 .align 2, 0 .pool @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, =0x02039ce8 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 .pool thumb_func_end sub_80C43A8 thumb_func_start sub_80C4550 sub_80C4550: ; 80C4550 push {r4-r7,lr} adds r7, r0, 0 ldr r0, =0x02039ce8 ldr r0, [r0] ldr r1, =0x00005ca8 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 .pool @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, =0x02039ce8 ldr r0, [r0] ldr r1, =0x00003ca8 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 .pool @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, =gUnknown_0856FB78 ldr r4, =0x02039ce8 ldr r1, [r4] ldr r3, =0x0000052b adds r0, r1, r3 ldrb r0, [r0] adds r0, r2 ldrb r3, [r0] ldr r0, =0x00000535 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, =0x02039ce8 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 .pool thumb_func_end sub_80C4630 thumb_func_start sub_80C474C sub_80C474C: ; 80C474C push {r4-r6,lr} sub sp, 0xC ldr r6, =0x02039ce8 ldr r1, [r6] ldr r2, =0x0000052a 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, =0x00000574 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 .pool @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, =0x02039ce8 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, =0x00000529 adds r0, r1 movs r1, 0x1 strb r1, [r0] @080C48F6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C48C8 thumb_func_start sub_80C4904 sub_80C4904: ; 80C4904 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02039b58 movs r1, 0x64 muls r0, r1 adds r0, r2 ldrb r0, [r0, 0x1] bx lr .align 2, 0 .pool thumb_func_end sub_80C4904 thumb_func_start sub_80C4918 sub_80C4918: ; 80C4918 push {r4,lr} ldr r4, =sub_80C4960 adds r0, r4, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 bl _call_via_r4 ldr r0, =sub_80C26D4 bl SetHBlankCallback pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C4918 thumb_func_start sub_80C4940 sub_80C4940: ; 80C4940 push {lr} ldr r0, =sub_80C4960 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 .pool @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, =gUnknown_0856FB28 ldr r2, =0x03005e00 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 .pool 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, =0x02038c28 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 .pool 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, =0x02039ce8 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 .pool @080C4A08: adds r0, r1, 0x7 mov r4, r8 strh r0, [r4, 0xA] @080C4A0E: ldr r0, =0x02039ce8 ldr r0, [r0] mov r2, r8 ldrh r1, [r2, 0xA] ldr r3, =0x00007ca8 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, =0xffff0000 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, =0x02038c28 @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, =0x02039ce8 mov r9, r4 ldr r4, [sp] lsrs r7, r4, 16 cmp r1, r0 bge @080C4AB0 ldr r0, =0x02038c28 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, =0x02038c28 @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 .pool 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, =0x02039ce8 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, =@080C4B3C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039ce8 ldr r1, [r0] ldrb r0, [r1, 0x8] cmp r0, 0 bne @080C4BA8 ldr r2, =0x00000a48 adds r0, r1, r2 bl sub_80C45C0 b @080C4BF6 .align 2, 0 .pool @080C4BA8: movs r0, 0x1 bl sub_80C438C b @080C4BF6 @080C4BB0: ldr r0, =0x02039ce8 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @080C4BC4 bl sub_80C474C b @080C4BF6 .align 2, 0 .pool @080C4BC4: movs r0, 0x2 movs r1, 0 bl Window_FastFillPixels b @080C4BF6 @080C4BCE: ldr r0, =0x02039ce8 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 beq @080C4BF6 bl sub_80C4FF0 b @080C4BF6 .align 2, 0 .pool @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, =0x02039ce8 ldr r1, [r2] ldrb r0, [r1, 0x4] adds r0, 0x1 strb r0, [r1, 0x4] ldr r0, =0x03003124 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 .pool thumb_func_end sub_80C4B08 thumb_func_start sub_80C4C1C sub_80C4C1C: ; 80C4C1C push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02039ce8 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, =0x00000ef8 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 .pool 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, =0x02039ce8 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 .pool @080C4CB0: subs r0, r1, 0x5 mov r1, r8 strh r0, [r1, 0xA] @080C4CB6: ldr r0, =0x02039ce8 ldr r0, [r0] mov r2, r8 ldrh r1, [r2, 0xA] ldr r3, =0x00007ca8 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, =0xffff0000 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, =0x02038c28 @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, =0x02039ce8 mov r9, r4 ldr r4, [sp] lsrs r7, r4, 16 cmp r1, r0 bge @080C4D56 ldr r0, =0x02038c28 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, =0x02038c28 @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 .pool 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, =sub_80C4960 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 .pool thumb_func_end sub_80C4DB0 thumb_func_start sub_80C4DDC sub_80C4DDC: ; 80C4DDC push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02039ce8 ldr r0, =0x00007cac 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, =sub_80C5868 cmp r5, r0 bne @080C4E18 ldr r0, =0x0000052c adds r1, r0 ldr r0, =0x00007fff b @080C4E1E .align 2, 0 .pool @080C4E18: ldr r2, =0x0000052c 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, =0x02039ce8 ldr r0, [r1] strb r3, [r0, 0x5] adds r2, r1, 0 b @080C4E44 .align 2, 0 .pool @080C4E3C: ldr r2, =0x02039ce8 ldr r1, [r2] movs r0, 0 strb r0, [r1, 0x5] @080C4E44: ldr r0, [r2] ldr r1, =0x00007caa adds r0, r1 movs r1, 0x2 strb r1, [r0] ldr r0, [r2] ldr r2, =0x00000534 adds r0, r2 bl sub_80C3020 ldr r0, =sub_80C2C80 bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039ce8 ldr r0, =0x00007cac 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, =0x00000534 adds r0, r1 ldr r2, =0x02039b58 movs r1, 0x64 muls r1, r4 adds r1, r2 movs r2, 0x64 bl memcpy ldr r1, [r5] ldr r2, =0x020229e8 lsls r0, r4, 3 subs r0, r4 lsls r0, 2 adds r0, r2 ldrh r0, [r0, 0x1A] ldr r2, =0x00007caa adds r1, r2 strb r0, [r1] ldr r0, =sub_80C2C80 bl set_callback2 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C4E74 thumb_func_start sub_80C4EE4 sub_80C4EE4: ; 80C4EE4 push {r4,r5,lr} ldr r4, =0x02039ce8 ldr r0, [r4] movs r1, 0 strb r1, [r0] ldr r2, [r4] ldr r0, =0x03005d90 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, =0x0000052a 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, =0x0000055c 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 .pool thumb_func_end sub_80C4EE4 thumb_func_start sub_80C4F50 sub_80C4F50: ; 80C4F50 push {lr} ldr r0, =0x02039ce8 ldr r1, [r0] cmp r1, 0 bne @080C4F7C ldr r0, =gUnknown_82E9530 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 .pool @080C4F74: cmp r1, 0x3 beq @080C4FC0 movs r0, 0x1 b @080C4FC2 @080C4F7C: ldr r2, =0x0000056c adds r0, r1, r2 ldrb r2, [r0] subs r0, r2, 0x4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @080C4FA0 ldr r0, =0x0000052b adds r1, r0 movs r0, 0 strb r0, [r1] b @080C4FC2 .align 2, 0 .pool @080C4FA0: lsls r0, r2, 24 lsrs r0, 24 cmp r0, 0x3 beq @080C4FB8 ldr r2, =0x0000052b adds r1, r2 movs r0, 0x1 strb r0, [r1] b @080C4FC2 .align 2, 0 .pool @080C4FB8: ldr r0, =0x0000052b adds r1, r0 movs r0, 0x1 strb r0, [r1] @080C4FC0: movs r0, 0x2 @080C4FC2: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 bne @080C5060 ldr r5, =0x02039ce8 ldr r0, [r5] ldr r1, =0x00000583 adds r0, r1 ldrb r0, [r0] bl sub_806EFF0 lsls r0, 16 lsrs r0, 16 ldr r4, =gUnknown_0856FB18 ldr r1, [r5] ldr r3, =0x00000534 adds r2, r1, r3 ldrb r3, [r2] lsls r3, 1 ldr r2, =0x0000052b 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 .pool @080C5060: ldr r2, =gUnknown_0856FB20 ldr r6, =0x02039ce8 ldr r0, [r6] ldr r5, =0x00000534 adds r1, r0, r5 ldr r3, =0x0000052a 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, =gUnknown_0856FB18 ldr r1, [r6] adds r5, r1, r5 ldrb r3, [r5] lsls r3, 1 ldr r2, =0x0000052b 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 .pool 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, =0x0100c000 mov r0, sp bl CpuSet movs r0, 0 str r0, [sp, 0x4] add r0, sp, 0x4 movs r1, 0xE0 lsls r1, 19 ldr r2, =0x05000100 bl CpuSet add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C50D0 thumb_func_start sub_80C51C4 sub_80C51C4: ; 80C51C4 push {lr} bl sub_80C51F0 ldr r0, =sub_80C544C bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C51C4 thumb_func_start sub_80C51D8 sub_80C51D8: ; 80C51D8 push {lr} ldr r0, =0x02039cec ldr r0, [r0] ldr r0, [r0] bl set_callback2 bl sub_80C52E4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C51D8 thumb_func_start sub_80C51F0 sub_80C51F0: ; 80C51F0 push {r4-r6,lr} adds r4, r0, 0 ldr r5, =0x02039cec ldr r0, [r5] cmp r0, 0 beq @080C5204 movs r0, 0x1 b @080C52C8 .align 2, 0 .pool @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, =0x02039cec 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, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000eb8 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, =0x000008c4 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, =0x000008c5 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 .pool thumb_func_end sub_80C51F0 thumb_func_start sub_80C52E4 sub_80C52E4: ; 80C52E4 push {r4,lr} ldr r4, =0x02039cec 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 .pool @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, =0x02039cf0 ldr r0, [r4] cmp r0, 0 beq @080C5324 movs r0, 0x1 b @080C533A .align 2, 0 .pool @080C5324: ldr r0, =0x00002434 bl malloc_and_clear str r0, [r4] cmp r0, 0 beq @080C5338 movs r0, 0 b @080C533A .align 2, 0 .pool @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, =0x02039cf0 ldr r0, [r4] cmp r0, 0 bne @080C5358 movs r0, 0x1 b @080C53A0 .align 2, 0 .pool @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, =0x00002434 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 .pool thumb_func_end sub_80C5340 thumb_func_start pokemon_details pokemon_details: ; 80C53AC push {r4-r7,lr} sub sp, 0x10 ldr r0, =0x02039cf0 ldr r6, [r0] adds r0, r6, 0 adds r0, 0x2C ldrb r0, [r0] cmp r0, 0 beq @080C5416 ldr r3, =gUnknown_085713E0 ldr r0, =0x02039cec 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 .pool 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, =sub_80C5A48 movs r1, 0 bl AddTask ldr r0, =sub_80C5438 bl set_callback2 @080C5464: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039cec ldr r0, [r0] ldrh r0, [r0, 0x4] cmp r0, 0xA bls @080C5498 b @080C56F4 @080C5498: lsls r0, 2 ldr r1, =@080C54AC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085713E8 movs r0, 0x1 movs r2, 0x3 bl bg_vram_setup ldr r4, =0x02039cf0 ldr r1, [r4] adds r1, 0x32 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001032 adds r1, r0 movs r0, 0x2 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00002032 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 .pool @080C5560: ldr r0, =gUnknown_08571400 bl Window_InitFromTemplates bl TextBox_ResetSomeField b @080C56F4 .align 2, 0 .pool @080C5570: ldr r0, =gUnknown_085712F8 add r1, sp, 0x8 bl malloc_and_decompress ldr r4, =0x02039cf0 ldr r1, [r4] str r0, [r1, 0x20] ldr r0, =gUnknown_08571060 add r1, sp, 0x8 bl malloc_and_decompress ldr r1, [r4] str r0, [r1, 0x24] ldr r0, =gUnknown_085712C0 add r1, sp, 0x8 bl malloc_and_decompress ldr r1, [r4] str r0, [r1, 0x28] ldr r1, =gUnknown_08DE08C8 movs r4, 0 str r4, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_08DE2084 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 .pool @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, =gUnknown_08DE07C8 movs r2, 0xD0 lsls r2, 1 adds r0, r4, 0 movs r1, 0 bl gpu_pal_apply ldr r5, =0x02039cec 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 .pool @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, =pokemon_details 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 .pool @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, =0x02039cec ldr r0, [r0] strh r1, [r0, 0x4] movs r0, 0x1 b @080C5700 .align 2, 0 .pool @080C56F4: ldr r0, =0x02039cec 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 .pool thumb_func_end sub_80C5484 thumb_func_start sub_80C570C sub_80C570C: ; 80C570C push {lr} sub sp, 0x4 ldr r1, =0x02039cec ldr r0, [r1] ldrh r0, [r0, 0x4] adds r2, r1, 0 cmp r0, 0x5 bhi @080C57E4 lsls r0, 2 ldr r1, =@080C5730 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039cec ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x4] movs r0, 0x1 b @080C57F0 .align 2, 0 .pool @080C57E4: ldr r0, =0x02039cec 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 .pool 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, =gUnknown_08571454 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, =0x02039cec 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 .pool @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, =0x02039cec 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, =sub_80C5BD8 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0x1 strh r0, [r1, 0x8] b @080C58C0 .align 2, 0 .pool @080C58AC: ldr r2, [r1] ldrb r1, [r2, 0xE] movs r0, 0xF negs r0, r0 ands r0, r1 strb r0, [r2, 0xE] ldr r0, =sub_80C5A48 movs r1, 0 bl AddTask @080C58C0: ldr r0, =sub_80C5438 bl set_callback2 @080C58C6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C5868 thumb_func_start sub_80C58D4 sub_80C58D4: ; 80C58D4 push {r4,lr} ldr r4, =0x02039cf8 ldr r0, [r4] bl sub_80C51F0 ldr r0, =0x02039cec 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 .pool @080C5914: ldr r0, =0x000001cd b @080C5920 .align 2, 0 .pool @080C591C: movs r0, 0xE7 lsls r0, 1 @080C5920: bl song_play_for_text @080C5924: ldr r0, =sub_80C5868 bl set_callback2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039cec 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 .pool @080C595C: cmp r0, 0x3 beq @080C5970 b @080C599A @080C5962: ldr r0, =sub_80C5868 bl sub_80C6454 b @080C599A .align 2, 0 .pool @080C5970: ldr r1, =0x02039cf8 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, =sub_80C58D4 bl sub_8185E24 b @080C599A .align 2, 0 .pool @080C5994: ldr r0, =sub_80C5868 bl sub_80C4DDC @080C599A: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039cec 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 .pool @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, =sub_80C5934 bl set_callback2 b @080C5A1A .align 2, 0 .pool @080C59F4: ldr r0, =0x02039cec 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80C5BD8 str r1, [r0] movs r1, 0 strh r1, [r0, 0x8] @080C5A1A: ldr r0, =0x02039cec ldr r2, [r0] ldr r0, =0x02039cf0 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 .pool 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, =0x030022c0 ldrh r1, [r2, 0x2C] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @080C5A80 ldr r0, =0x02039cf0 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, =0x02039cf0 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, =0x02039cf0 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, =0x02039cf0 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, =0x02039cec 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 .pool @080C5B48: cmp r3, 0x4 bne @080C5B5E movs r0, 0x3 bl audio_play ldr r0, =sub_80C5470 bl set_callback2 adds r0, r6, 0 bl remove_task @080C5B5E: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080C5BCA movs r0, 0x3 bl audio_play ldr r0, =sub_80C5470 bl set_callback2 adds r0, r6, 0 bl remove_task b @080C5BCA .align 2, 0 .pool @080C5B88: ldr r0, =0x02039cf0 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, =0x02039cec 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 .pool 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, =0x03005e08 mov r8, r0 adds r6, r5, r0 ldr r7, =0x02039cec 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 .pool @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, =0x00007fff str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @080C5CA4 .align 2, 0 .pool @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, =pokemon_details bl SetVBlankCallback movs r5, 0x1 negs r5, r5 ldr r4, =0x00007fff 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, =0x02039cf0 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 .pool @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, =0x02039cf0 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 .pool @080C5D1C: movs r0, 0x2 ldrsh r1, [r6, r0] movs r0, 0x80 lsls r0, 1 cmp r1, r0 bne @080C5DA6 b @080C5D9C @080C5D2A: ldr r0, =0x02039cf0 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, =sub_80C5934 bl set_callback2 b @080C5D82 .align 2, 0 .pool @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, =sub_80C5A48 str r1, [r0] @080C5D82: movs r0, 0x2 movs r1, 0x6 movs r2, 0 bl gpu_bg_config_set_field ldr r0, =0x02039cec ldr r1, [r0] movs r0, 0 b @080C5DA4 .align 2, 0 .pool @080C5D9C: ldr r0, =0x02039cec 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 .pool 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, =gUnknown_085ED8FF movs r0, 0x1 adds r1, r4, 0 movs r2, 0x60 bl sub_81DB35C lsls r2, r0, 24 lsrs r2, 24 ldr r6, =gUnknown_08571448 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, =gUnknown_085ED90E 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, =gUnknown_085ED91C str r0, [sp, 0x8] movs r0, 0x2 movs r1, 0x8 movs r2, 0x5 movs r3, 0x4 bl box_print ldr r4, =0x02021fc4 ldr r5, =0x02039cec 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 .pool 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, =0x02039cec ldr r0, [r0] ldrb r0, [r0, 0xE] movs r1, 0x1 ands r1, r0 cmp r1, 0 bne @080C5F18 ldr r0, =gUnknown_0857144B str r0, [sp] str r1, [sp, 0x4] ldr r0, =gUnknown_08571614 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 .pool @080C5F18: cmp r4, 0 beq @080C5F3A ldr r0, =gUnknown_0857144B str r0, [sp] movs r0, 0 str r0, [sp, 0x4] ldr r1, =gUnknown_08571614 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 .pool 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, =0x02039cec 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 .pool @080C5F80: cmp r2, 0 beq @080C5FA8 ldr r0, =0x02039cf0 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 .pool @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, =0x02039cf0 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 .pool @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, =gUnknown_085713E0 ldr r1, =0x02039cec 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 .pool @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, =gUnknown_085713E0 ldr r1, =0x02039cec 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 .pool 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, =0x02039cf0 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 .pool @080C614C: ldr r0, =0x02039cf0 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 .pool @080C6170: ldr r0, =0x02039cec ldr r0, [r0] ldrb r1, [r0, 0xE] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080C61C4 ldr r0, =0x02039cf0 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 .pool @080C61A4: ldr r1, =gUnknown_08DE3350 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 .pool @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, =0x02039cf0 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 .pool @080C620C: ldr r0, =0x02039cf0 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 .pool @080C6230: ldr r0, =0x02039cec ldr r0, [r0] ldrb r1, [r0, 0xE] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080C6294 ldr r0, =0x02039cf0 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 .pool @080C6264: ldr r1, =gUnknown_08DE3374 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 .pool @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, =gUnknown_08DE3060 movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r4, =0x02039cec 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 .pool 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, =gUnknown_085714E4 bl gpu_pal_obj_alloc_and_load_multiple ldr r4, =gUnknown_085714BC 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, =gUnknown_085715B4 ldr r1, =0x02039cec 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, =0x02039cf0 ldr r2, [r3] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 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, =0x02039cec 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, =gUnknown_085715E4 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, =0x0000ffff adds r0, r1 ldrb r2, [r2] adds r0, r2 strh r0, [r7, 0x2] ldr r1, =gUnknown_08571454 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, =0x02020630 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 .pool thumb_func_end sub_80C62DC thumb_func_start sub_80C63FC sub_80C63FC: ; 80C63FC push {r4-r6,lr} movs r5, 0 ldr r4, =0x02039cf0 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 .pool 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, =0x02039cf4 ldr r0, [r5] cmp r0, 0 beq @080C6466 adds r0, r4, 0 bl set_callback2 @080C6466: ldr r0, =0x00003014 bl malloc_and_clear str r0, [r5] str r4, [r0] bl clear_tasks ldr r0, =sub_80C67BC movs r1, 0 bl AddTask ldr r0, =sub_80C5438 bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C6454 thumb_func_start sub_80C6498 sub_80C6498: ; 80C6498 push {r4,lr} bl clear_tasks ldr r4, =0x02039cf4 ldr r0, [r4] ldr r0, [r0] bl set_callback2 ldr r0, [r4] ldr r2, =0x00003014 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 .pool thumb_func_end sub_80C6498 thumb_func_start sub_80C64CC sub_80C64CC: ; 80C64CC push {r4,r5,lr} sub sp, 0x8 ldr r0, =0x02039cec ldr r0, [r0] ldrh r0, [r0, 0x4] cmp r0, 0x7 bls @080C64DC b @080C6694 @080C64DC: lsls r0, 2 ldr r1, =@080C64F0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085713F4 movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r4, =0x02039cf4 ldr r1, [r4] adds r1, 0x12 movs r0, 0 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001012 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00002012 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 .pool @080C65C0: ldr r0, =gUnknown_08571428 bl Window_InitFromTemplates bl TextBox_ResetSomeField bl sub_80C6B94 ldr r1, =gUnknown_0856FBBC 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 .pool @080C65E8: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @080C669E ldr r0, =gUnknown_08DE07C8 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, =gUnknown_08570E00 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 .pool @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, =pokemon_details bl SetVBlankCallback movs r5, 0x1 negs r5, r5 ldr r4, =0x00007fff 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 .pool @080C6678: bl fade_and_return_progress_probably lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @080C669E ldr r0, =0x02039cec ldr r0, [r0] strh r1, [r0, 0x4] movs r0, 0x1 b @080C66A0 .align 2, 0 .pool @080C6694: ldr r0, =0x02039cec 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 .pool thumb_func_end sub_80C64CC thumb_func_start sub_80C66AC sub_80C66AC: ; 80C66AC push {r4,lr} sub sp, 0x4 ldr r0, =0x02039cec ldr r0, [r0] ldrh r0, [r0, 0x4] cmp r0, 0x5 bhi @080C67A4 lsls r0, 2 ldr r1, =@080C66CC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00007fff str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @080C67A4 .align 2, 0 .pool @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, =0x02039cf4 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 .pool @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, =0x02039cec ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x4] movs r0, 0x1 b @080C67B0 .align 2, 0 .pool @080C67A4: ldr r0, =0x02039cec 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 .pool 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, =0x03005e08 adds r4, r0, r1 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0x5 bls @080C67D6 b @080C68DA @080C67D6: lsls r0, 2 ldr r1, =@080C67E8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 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 .pool @080C6824: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080C6848 ldr r0, =0x02039cf4 ldr r0, [r0] ldrb r0, [r0, 0x10] cmp r0, 0x5 bls @080C6844 movs r0, 0 bl sub_80C6C70 b @080C68E0 .align 2, 0 .pool @080C6844: strh r2, [r4] b @080C68E0 @080C6848: movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @080C68E0 ldr r0, =0x02039cf4 ldr r0, [r0] ldrb r0, [r0, 0x10] cmp r0, 0 bne @080C6868 movs r0, 0x1 bl sub_80C6C70 b @080C68E0 .align 2, 0 .pool @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, =0x02039cf4 ldr r0, [r0] ldr r1, [r0, 0x4] ldrh r0, [r1, 0x22] adds r0, 0x4 b @080C68B4 .align 2, 0 .pool @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, =0x02039cf4 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 .pool @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, =0xfffb0000 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 .pool @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, =gUnknown_085714E4 bl gpu_pal_obj_alloc_and_load_multiple ldr r6, =gUnknown_085714BC adds r0, r6, 0 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085715B4 mov r8, r0 ldr r4, =0x02039cf4 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, =0x02020630 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, =gUnknown_08571650 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, =0x03005d8c 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 .pool @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, =0x03005d8c 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, =gUnknown_085714D4 bl gpu_tile_obj_decompress_and_load mov r1, sp ldr r0, =gUnknown_085715FC 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, =0x03005d90 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 .pool @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, =0x02039cf4 ldr r2, [r4] lsls r1, r3, 4 adds r1, r3 lsls r1, 2 ldr r0, =0x02020630 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, =0x03005d90 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 .pool 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, =gUnknown_08571650 @080C6BB8: ldr r0, =0x02039cf4 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, =gUnknown_0857144E 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 .pool @080C6BF0: lsls r1, r4, 4 adds r3, r1, 0x1 lsls r3, 24 lsrs r3, 24 ldr r0, =gUnknown_0857144B 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, =gUnknown_08571448 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] ldr r1, =gUnknown_08571650 ldr r0, =0x02039cf4 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 .pool 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, =0x02039cf4 ldr r4, [r0] ldrb r5, [r4, 0x10] adds r0, r5, 0x6 b @080C6C94 .align 2, 0 .pool @080C6C8C: ldr r0, =0x02039cf4 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, =gUnknown_0857144B str r6, [sp] movs r1, 0 mov r8, r1 str r1, [sp, 0x4] ldr r4, =gUnknown_08571650 adds r0, r4 ldr r0, [r0] str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x7 movs r2, 0x4 bl box_print ldr r5, =0x02039cf4 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 .pool 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, =0x00ffffff ldr r0, [sp, 0x1C] ands r0, r1 movs r1, 0xC0 lsls r1, 21 orrs r0, r1 str r0, [sp, 0x1C] ldr r1, =0xffffff00 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 .pool @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, =0x001fffff 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 .pool 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, =0x00ffffff ldr r1, [sp, 0x18] ands r1, r2 orrs r1, r0 str r1, [sp, 0x18] ldr r1, =0xffffff00 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 .pool 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, =0x020244ec 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 .pool 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, =0x020244ec 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 .pool thumb_func_end sub_80C7050 thumb_func_start sub_80C70AC sub_80C70AC: ; 80C70AC push {lr} ldr r0, =0x020375e0 ldrb r0, [r0] bl sub_80C7050 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x020244ec 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 .pool 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, =0x040000d4 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 .pool @080C7214: movs r4, 0 strh r4, [r5] ldr r1, =0x040000d4 mov r0, sp str r0, [r1] str r3, [r1, 0x4] ldr r0, =0x81000800 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 .pool 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, =0x03005e00 adds r5, r0, r1 movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0x4 bls @080C7284 b @080C756A @080C7284: lsls r0, 2 ldr r1, =@080C7298 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085716C0 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 .pool @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, =0x030022c0 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, =gUnknown_085716C0 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 .pool @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, =gUnknown_085EBCAD 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 .pool @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, =gUnknown_085EBC89 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 .pool @080C745C: movs r0, 0x1 movs r1, 0 bl fade_screen movs r0, 0x4 strh r0, [r5, 0x8] b @080C756A @080C746A: ldr r0, =0x030022c0 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, =gUnknown_085716C0 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 .pool @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, =gUnknown_085716C0 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 .pool @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, =gUnknown_085716C0 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 .pool @080C7544: ldr r0, =0x02037fd4 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 .pool thumb_func_end c3_0808C39C thumb_func_start sub_80C7578 sub_80C7578: ; 80C7578 push {lr} ldr r0, =c3_0808C39C movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0x8] strh r0, [r1, 0xA] bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C7578 thumb_func_start mapldr_0808C6D8 mapldr_0808C6D8: ; 80C75A8 push {r4,r5,lr} ldr r0, =0x030022c0 ldr r5, [r0, 0xC] movs r0, 0 bl SetVBlankCallback ldr r4, =c3_0808C39C adds r0, r4, 0 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0 strh r2, [r1, 0x8] ldr r2, =0x02039d00 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 .pool 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, =gUnknown_085716E8 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] ldr r0, =gUnknown_085716C0 mov r8, r0 movs r1, 0x5 bl GetMaxWidthInMenuTable lsls r0, 24 ldr r2, =0x00ffffff 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 .pool thumb_func_end sub_80C75FC thumb_func_start sub_80C7678 sub_80C7678: ; 80C7678 push {lr} bl sub_80CAEA0 ldr r1, =0x02039d00 strb r0, [r1] ldr r1, =0x03005dac ldr r0, =mapldr_0808C6D8 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff 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 .pool @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, =gUnknown_085EBCC1 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 .pool 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, =gUnknown_0857173C str r0, [sp, 0x18] ldr r1, =0xffff0000 add r4, sp, 0x18 ldr r0, [r4, 0x4] ands r0, r1 orrs r0, r7 str r0, [r4, 0x4] mov r1, sp ldr r0, =gUnknown_0857175C str r0, [sp] movs r0, 0x80 lsls r0, 4 strh r0, [r1, 0x4] strh r6, [r1, 0x6] ldr r0, =gUnknown_08571F5C 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, =0x02039d04 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 .pool thumb_func_end sub_80C77E8 thumb_func_start sub_80C7890 sub_80C7890: ; 80C7890 push {r4,r5,lr} ldr r5, =0x02039d04 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 .pool 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, =0x030022c0 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 .pool @080C790C: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080C792C movs r0, 0x5 bl audio_play ldr r0, =0x02039d04 ldr r0, [r0] movs r1, 0x91 lsls r1, 2 adds r0, r1 ldrb r0, [r0] b @080C7954 .align 2, 0 .pool @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, =0xffff0fff 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, =gUnknown_082EC69C str r0, [sp, 0x24] str r2, [sp, 0x28] ldr r0, =gUnknown_082EC6A8 str r0, [sp, 0x2C] ldr r0, =nullsub_12 str r0, [sp, 0x30] add r0, sp, 0x4 movs r2, 0x18 bl memcpy ldr r6, =0x02039d04 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, =0x00000242 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, =0x02020630 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, =gUnknown_08571710 str r0, [sp, 0xC] movs r4, 0 @080C7A10: ldr r0, [r6] ldr r1, =0x00000246 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, =0x02020630 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, =0x02039d04 @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, =0x00000246 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, =sub_80C7CF4 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 .pool thumb_func_end sub_80C7958 thumb_func_start sub_80C7B14 sub_80C7B14: ; 80C7B14 push {r4-r6,lr} ldr r4, =0x02039d04 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, =0x02039d04 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 .pool thumb_func_end sub_80C7B14 thumb_func_start sub_80C7B80 sub_80C7B80: ; 80C7B80 push {lr} ldr r2, =0x02039d04 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 .pool thumb_func_end sub_80C7B80 thumb_func_start sub_80C7BB4 sub_80C7BB4: ; 80C7BB4 push {lr} ldr r0, =0x02039d04 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 .pool @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, =0x02039d04 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, =gUnknown_08571734 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, =gUnknown_08571737 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, =0x06010100 adds r1, r0 ldr r2, =0x04000100 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 .pool 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, =0x02039d08 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 .pool 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, =0x02039d0d strb r5, [r0] ldr r4, =0x02039d08 ldr r0, =0x000062c4 bl malloc str r0, [r4] cmp r0, 0 bne @080C7DA8 ldr r0, =sub_80C7678 bl set_callback2 b @080C7DD4 .align 2, 0 .pool @080C7DA8: movs r2, 0 strb r5, [r0, 0x1] ldr r0, [r4] strb r2, [r0, 0x3] ldr r0, =0x02039d12 movs r1, 0 strh r2, [r0] ldr r0, [r4] strb r1, [r0] ldr r0, =task_box_related_3 movs r1, 0x3 bl AddTask ldr r1, [r4] strb r0, [r1, 0x4] bl get_preferred_box ldr r1, =0x02039d10 strb r0, [r1] ldr r0, =c2_Box bl set_callback2 @080C7DD4: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C7D74 thumb_func_start c2_808CE60 c2_808CE60: ; 80C7DEC push {r4,lr} bl clear_tasks ldr r4, =0x02039d08 ldr r0, =0x000062c4 bl malloc adds r1, r0, 0 str r1, [r4] cmp r1, 0 bne @080C7E18 ldr r0, =sub_80C7678 bl set_callback2 b @080C7E3C .align 2, 0 .pool @080C7E18: ldr r0, =0x02039d0d 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, =task_box_related_3 movs r1, 0x3 bl AddTask ldr r1, [r4] strb r0, [r1, 0x4] ldr r0, =c2_Box bl set_callback2 @080C7E3C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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 ClearDma3Requests ldr r1, =0x02021b3a movs r2, 0xA0 lsls r2, 2 adds r0, r2, 0 strh r0, [r1] ldr r4, =0x02039d08 ldr r1, [r4] adds r0, r1, 0 adds r0, 0x8 adds r1, 0x10 movs r2, 0x8 bl sub_80D2A90 ldr r1, =0x030022b0 movs r0, 0x14 strh r0, [r1] bl clear_scheduled_bg_copies_to_vram movs r0, 0x3 bl sub_80D259C ldr r2, =gUnknown_0857239C 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, =0x000002c7 adds r0, r1 movs r1, 0 strb r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C7E98 thumb_func_start sub_80C7F1C sub_80C7F1C: ; 80C7F1C push {lr} bl sub_80CDC0C ldr r2, =0x02039d0c movs r1, 0 ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 bne @080C7F32 movs r1, 0x1 @080C7F32: strb r1, [r2] ldr r1, =0x02039d0e movs r0, 0 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C7F1C thumb_func_start sub_80C7F4C sub_80C7F4C: ; 80C7F4C push {lr} ldr r0, =0x02039d08 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, =0x00000b07 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 .pool thumb_func_end sub_80C7F4C thumb_func_start add_to_c3_somehow add_to_c3_somehow: ; 80C7F80 push {r4,lr} ldr r4, =0x03005e00 ldr r1, =0x02039d08 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 .pool 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, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0xA bls @080C7FB8 b @080C81A2 @080C7FB8: lsls r0, 2 ldr r1, =@080C7FCC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x3] cmp r0, 0 beq @080C8046 ldr r0, =0x02039d0f ldrb r0, [r0] cmp r0, 0x1 beq @080C8036 cmp r0, 0x1 bgt @080C8030 cmp r0, 0 beq @080C803C b @080C8046 .align 2, 0 .pool @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, =0x05000080 mov r0, sp bl CpuSet movs r0, 0x1 movs r1, 0xB movs r2, 0xE0 bl sub_809882C b @080C8198 .align 2, 0 .pool @080C808C: bl sub_80C7E50 ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x3] cmp r0, 0 beq @080C809C b @080C8198 @080C809C: bl sub_80C7F1C b @080C8198 .align 2, 0 .pool @080C80A8: bl sub_80CAF04 ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x3] cmp r0, 0 bne @080C80C0 bl sub_80CD36C b @080C8198 .align 2, 0 .pool @080C80C0: bl sub_80CD3EC b @080C8198 @080C80C6: bl sub_80D0164 lsls r0, 24 cmp r0, 0 bne @080C80DC @080C80D0: ldr r0, =sub_80C9E50 bl add_to_c3_somehow b @080C81A2 .align 2, 0 .pool @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, =0x02039d08 ldr r2, [r0] ldrb r0, [r2, 0x1] cmp r0, 0x3 beq @080C8140 ldr r1, =0x00000da4 adds r0, r2, r1 movs r1, 0xD strh r1, [r0] ldr r1, =0x00000da6 adds r2, r1 ldr r1, =0x0000dace strh r1, [r2] bl sub_811F90C bl sub_811FA90 b @080C8198 .align 2, 0 .pool @080C8140: bl sub_80D0C60 bl sub_80CAEAC b @080C8198 @080C814A: bl sub_80C7F4C ldr r0, =0x02039d08 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, =sub_80C81AC bl add_to_c3_somehow b @080C8186 .align 2, 0 .pool @080C8174: movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r0, =box_related_2 bl add_to_c3_somehow @080C8186: ldr r0, =sub_80C7D28 bl SetVBlankCallback b @080C81A2 .align 2, 0 .pool @080C8198: ldr r0, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @080C81A2: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_box_related_3 thumb_func_start sub_80C81AC sub_80C81AC: ; 80C81AC push {r4,lr} ldr r4, =0x02039d08 ldr r0, [r4] ldrb r0, [r0] cmp r0, 0 beq @080C81C4 cmp r0, 0x1 beq @080C81DE b @080C81EE .align 2, 0 .pool @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, =task_pokemon_box_related bl add_to_c3_somehow @080C81EE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C81AC thumb_func_start box_related_2 box_related_2: ; 80C81F8 push {r4,lr} sub sp, 0x4 ldr r4, =0x02039d08 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 .pool @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, =0x02039d0f ldrb r0, [r0] cmp r0, 0x2 bne @080C825C ldr r0, =0x0203ce7c ldrh r0, [r0] cmp r0, 0 beq @080C825C movs r0, 0x1C bl sub_80CAC58 b @080C8282 .align 2, 0 .pool @080C825C: ldr r0, =task_pokemon_box_related bl add_to_c3_somehow b @080C82A0 .align 2, 0 .pool @080C8268: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @080C82A0 ldr r0, =0x030022c0 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 .pool @080C8290: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @080C82A0 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C82A0: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end box_related_2 thumb_func_start task_pokemon_box_related task_pokemon_box_related: ; 80C82AC push {r4,r5,lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0xB bls @080C82BA b @080C879E @080C82BA: lsls r0, 2 ldr r1, =@080C82CC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =@080C831C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 ldr r1, [r0] movs r0, 0x1 strb r0, [r1] b @080C879E .align 2, 0 .pool @080C8398: ldr r4, =0x02039d08 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 .pool @080C83BC: bl sub_80CDC0C ldr r0, =sub_80C87A8 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C83CC: ldr r4, =0x02039d08 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, =0x00000ce6 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 .pool @080C8400: cmp r0, 0x3 beq @080C8406 b @080C879E @080C8406: ldr r0, =sub_80C87E8 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C8414: ldr r0, =sub_80C9BE8 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C8420: ldr r0, =sub_80C9D1C bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C842C: movs r0, 0x5 bl audio_play ldr r0, =box_related bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C8440: ldr r0, =sub_80C8864 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C844C: movs r0, 0x5 bl audio_play bl get_preferred_box ldr r4, =0x02039d08 ldr r1, [r4] lsls r0, 24 lsrs r0, 24 adds r0, 0x1 ldr r2, =0x000002ca 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 .pool @080C8484: movs r0, 0x5 bl audio_play bl get_preferred_box ldr r4, =0x02039d08 ldr r1, [r4] lsls r0, 24 lsrs r0, 24 subs r0, 0x1 ldr r2, =0x000002ca 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 .pool @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, =0x02039d08 ldr r0, [r4] ldr r1, =0x00000ce6 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 .pool @080C84F8: movs r0, 0x5 bl audio_play ldr r0, =sub_80C8D78 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r0] movs r0, 0x4 strb r0, [r1] b @080C879E .align 2, 0 .pool @080C8538: movs r0, 0x5 bl audio_play ldr r0, =c3_0808DC50 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C854C: movs r0, 0x5 bl audio_play ldr r0, =sub_80C8C90 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C8560: movs r0, 0x5 bl audio_play ldr r0, =sub_80C8BEC bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C8574: movs r0, 0x5 bl audio_play ldr r0, =sub_80C9128 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C8588: movs r0, 0x5 bl audio_play ldr r0, =sub_80C91DC bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C859C: movs r0, 0x5 bl audio_play ldr r0, =sub_80C93B0 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C85B0: movs r0, 0x5 bl audio_play movs r0, 0 b @080C8600 @080C85BA: movs r0, 0x1 bl sub_80D01D0 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x8 strb r0, [r1] b @080C879E .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r0] movs r0, 0x9 strb r0, [r1] b @080C879E .align 2, 0 .pool @080C85F8: movs r0, 0x5 bl audio_play movs r0, 0x5 @080C8600: bl sub_80D01D0 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x7 strb r0, [r1] b @080C879E .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r4] ldr r1, =0x00000cea adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080C864E bl BoxSetMosaic @080C864E: ldr r1, [r4] b @080C86C8 .align 2, 0 .pool @080C865C: bl sub_80CC54C lsls r0, 24 cmp r0, 0 beq @080C8668 b @080C879E @080C8668: ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x000002ca adds r0, r1 ldrb r0, [r0] bl sub_80D1D18 ldr r0, =0x02039d0c 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, =0x02039d08 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 .pool @080C86B4: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C879E bl sub_80CADC4 ldr r0, =0x02039d08 ldr r1, [r0] @080C86C8: movs r0, 0 strb r0, [r1] b @080C879E .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r0] movs r0, 0x6 strb r0, [r1] b @080C879E .align 2, 0 .pool @080C86FC: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C879E bl sub_80CADC4 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C871C: bl sub_80D01E4 b @080C8790 @080C8722: bl sub_80D01E4 lsls r0, 24 cmp r0, 0 bne @080C879E @080C872C: ldr r0, =sub_80C8B90 bl add_to_c3_somehow b @080C879E .align 2, 0 .pool @080C8738: bl sub_80D01E4 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @080C879E ldr r5, =0x02039d08 ldr r0, [r5] ldr r1, =0x00000cea 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 .pool @080C8764: bl sub_80D1218 lsls r0, 24 cmp r0, 0 bne @080C879E ldr r4, =0x02039d08 ldr r0, [r4] ldr r1, =0x000002ca adds r0, r1 @080C8776: ldrb r0, [r0] bl sub_80CC464 ldr r1, [r4] movs r0, 0x2 strb r0, [r1] b @080C879E .align 2, 0 .pool @080C878C: bl sub_80D1218 @080C8790: lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @080C879E ldr r0, =0x02039d08 ldr r0, [r0] strb r1, [r0] @080C879E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_pokemon_box_related thumb_func_start sub_80C87A8 sub_80C87A8: ; 80C87A8 push {r4,lr} ldr r4, =0x02039d08 ldr r0, [r4] ldrb r0, [r0] cmp r0, 0 beq @080C87C0 cmp r0, 0x1 beq @080C87CE b @080C87DE .align 2, 0 .pool @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, =task_pokemon_box_related bl add_to_c3_somehow @080C87DE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C87A8 thumb_func_start sub_80C87E8 sub_80C87E8: ; 80C87E8 push {r4,lr} ldr r4, =0x02039d08 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 .pool @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, =0x00000cea adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080C8850 bl BoxSetMosaic @080C8850: ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C8856: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C87E8 thumb_func_start sub_80C8864 sub_80C8864: ; 80C8864 push {r4,lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x6 bls @080C8872 b @080C8B82 @080C8872: lsls r0, 2 ldr r1, =@080C8884 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 ldr r0, [r4] ldrb r0, [r0, 0x1] cmp r0, 0x3 beq @080C88C8 movs r0, 0x4 bl sub_80CAC58 b @080C88F2 .align 2, 0 .pool @080C88C8: bl sub_80D127C lsls r0, 24 cmp r0, 0 bne @080C88DE ldr r0, [r4] ldr r1, =0x00000ce6 adds r0, r1 ldrh r0, [r0] cmp r0, 0 beq @080C88EC @080C88DE: movs r0, 0x17 bl sub_80CAC58 b @080C88F2 .align 2, 0 .pool @080C88EC: movs r0, 0x18 bl sub_80CAC58 @080C88F2: bl sub_80CFFD0 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x1 strb r0, [r1] b @080C8B82 .align 2, 0 .pool @080C8904: bl sub_80D00A8 lsls r0, 24 cmp r0, 0 beq @080C8910 b @080C8B82 @080C8910: ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x2 strb r0, [r1] b @080C8B82 .align 2, 0 .pool @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, =@080C8940 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =task_pokemon_box_related bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C899C: bl sub_80CEA30 lsls r0, 24 cmp r0, 0 bne @080C8A52 movs r0, 0x5 bl audio_play bl sub_80CADC4 ldr r0, =sub_80C8B90 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C89BC: movs r0, 0x5 bl audio_play bl sub_80CADC4 ldr r0, =sub_80C8BEC bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C89D4: bl sub_80CEA6C lsls r0, 24 cmp r0, 0 beq @080C8A52 movs r0, 0x5 bl audio_play bl sub_80CADC4 ldr r0, =c3_0808DC50 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C89F4: movs r0, 0x5 bl audio_play bl sub_80CADC4 ldr r0, =sub_80C8C90 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8A0C: bl sub_80CEA30 lsls r0, 24 cmp r0, 0 bne @080C8A52 ldr r4, =0x02039d08 ldr r0, [r4] ldr r2, =0x00000ce6 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, =sub_80C8D78 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8A48: bl sub_80CEA30 lsls r0, 24 cmp r0, 0 beq @080C8A60 @080C8A52: ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x3 strb r0, [r1] b @080C8B82 .align 2, 0 .pool @080C8A60: ldr r4, =0x02039d08 ldr r1, [r4] ldr r2, =0x00000ced adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080C8A7C movs r0, 0x5 strb r0, [r1] b @080C8B82 .align 2, 0 .pool @080C8A7C: ldr r2, =0x00000ce6 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 .pool @080C8A98: movs r0, 0x5 bl audio_play ldr r0, =sub_80C8EB4 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8AAC: movs r0, 0x5 bl audio_play ldr r0, =sub_80C9B28 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8AC0: movs r0, 0x5 bl audio_play ldr r0, =sub_80C90A4 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8AD4: movs r0, 0x5 bl audio_play ldr r0, =sub_80C9128 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8AE8: movs r0, 0x5 bl audio_play ldr r0, =sub_80C91DC bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8AFC: ldr r0, =sub_80C9298 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8B08: movs r0, 0x5 bl audio_play ldr r0, =sub_80C93B0 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8B1C: movs r0, 0x5 bl audio_play ldr r0, =sub_80C9B88 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @080C8B30: ldr r0, =sub_80C9498 bl add_to_c3_somehow b @080C8B82 .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r0] movs r0, 0x6 strb r0, [r1] b @080C8B82 .align 2, 0 .pool @080C8B6C: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C8B82 bl sub_80CADC4 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C8B82: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C8864 thumb_func_start sub_80C8B90 sub_80C8B90: ; 80C8B90 push {r4,lr} ldr r4, =0x02039d08 ldr r0, [r4] ldrb r0, [r0] cmp r0, 0 beq @080C8BA8 cmp r0, 0x1 beq @080C8BB8 b @080C8BE2 .align 2, 0 .pool @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, =0x02039d0c ldrb r0, [r0] cmp r0, 0 beq @080C8BDC ldr r0, =sub_80C9670 bl add_to_c3_somehow b @080C8BE2 .align 2, 0 .pool @080C8BDC: ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C8BE2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C8B90 thumb_func_start sub_80C8BEC sub_80C8BEC: ; 80C8BEC push {r4,lr} ldr r4, =0x02039d08 ldr r0, [r4] ldrb r0, [r0] cmp r0, 0 beq @080C8C04 cmp r0, 0x1 beq @080C8C14 b @080C8C3E .align 2, 0 .pool @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, =0x02039d0c ldrb r0, [r0] cmp r0, 0 beq @080C8C38 ldr r0, =sub_80C9670 bl add_to_c3_somehow b @080C8C3E .align 2, 0 .pool @080C8C38: ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C8C3E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C8BEC thumb_func_start c3_0808DC50 c3_0808DC50: ; 80C8C48 push {r4,lr} ldr r4, =0x02039d08 ldr r0, [r4] ldrb r0, [r0] cmp r0, 0 beq @080C8C60 cmp r0, 0x1 beq @080C8C70 b @080C8C84 .align 2, 0 .pool @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, =task_pokemon_box_related bl add_to_c3_somehow @080C8C84: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c3_0808DC50 thumb_func_start sub_80C8C90 sub_80C8C90: ; 80C8C90 push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x5 bhi @080C8D6E lsls r0, 2 ldr r1, =@080C8CB0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 ldr r1, [r0] movs r0, 0x1 strb r0, [r1] b @080C8D6E .align 2, 0 .pool @080C8CE8: bl sub_80CDC18 movs r0, 0 bl sub_80CDC38 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x2 strb r0, [r1] b @080C8D6E .align 2, 0 .pool @080C8D00: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C8D6E bl sub_80CADC4 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow b @080C8D6E .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C8D6E .align 2, 0 .pool @080C8D68: ldr r0, =sub_80C87E8 bl add_to_c3_somehow @080C8D6E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C8C90 thumb_func_start sub_80C8D78 sub_80C8D78: ; 80C8D78 push {r4,lr} sub sp, 0x4 ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x4 bls @080C8D88 b @080C8EA2 @080C8D88: lsls r0, 2 ldr r1, =@080C8D9C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080C8D9C: .4byte @080C8DB0 .4byte @080C8DEC .4byte @080C8E4C .4byte @080C8E64 .4byte @080C8E88 @080C8DB0: movs r0, 0x6 bl sub_80CAC58 ldr r4, =0x02039d08 ldr r0, [r4] ldr r1, =0x00001e5c adds r0, r1 ldr r2, =0x0000dac7 movs r1, 0 str r1, [sp] movs r1, 0xA movs r3, 0x3 bl sub_80C77E8 ldr r0, =0x02039d0e ldrb r0, [r0] bl sub_80C78D4 ldr r1, [r4] ldrb r0, [r1] adds r0, 0x1 b @080C8EA0 .align 2, 0 .pool @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, =0x02039d0e strb r4, [r0] bl sub_80CADC4 bl sub_80C78E4 bl sub_80C7890 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x2 b @080C8EA0 .align 2, 0 .pool @080C8E38: movs r0, 0x8 bl sub_80CAC58 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x4 b @080C8EA0 .align 2, 0 .pool @080C8E4C: bl party_compaction bl sub_80CB950 ldr r0, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 b @080C8EA0 .align 2, 0 .pool @080C8E64: bl sub_80CB9BC lsls r0, 24 cmp r0, 0 bne @080C8EA2 bl sub_80CE22C bl BoxSetMosaic bl sub_80CAB20 @080C8E7A: ldr r0, =task_pokemon_box_related bl add_to_c3_somehow b @080C8EA2 .align 2, 0 .pool @080C8E88: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C8EA2 movs r0, 0x6 bl sub_80CAC58 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x1 @080C8EA0: strb r0, [r1] @080C8EA2: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C8D78 thumb_func_start sub_80C8EB4 sub_80C8EB4: ; 80C8EB4 push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0xD bls @080C8EC2 b @080C9096 @080C8EC2: lsls r0, 2 ldr r1, =@080C8ED4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 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 .pool @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, =0x030022c0 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 .pool @080C8FA4: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C9096 bl sub_80CADC4 ldr r0, =0x02039d0c ldrb r0, [r0] cmp r0, 0 beq @080C8FD0 bl party_compaction bl sub_80CB950 b @080C905C .align 2, 0 .pool @080C8FD0: ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x7 strb r0, [r1] b @080C9096 .align 2, 0 .pool @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, =task_pokemon_box_related bl add_to_c3_somehow b @080C9096 .align 2, 0 .pool @080C9004: movs r0, 0xA b @080C9058 @080C9008: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C9096 movs r0, 0x15 b @080C9058 .align 2, 0 .pool @080C901C: ldr r0, =0x030022c0 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 .pool @080C9038: bl sub_80CC0A0 lsls r0, 24 cmp r0, 0 bne @080C9096 bl sub_80CE324 movs r0, 0x13 b @080C9058 @080C904A: ldr r0, =0x030022c0 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, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C9096 .align 2, 0 .pool @080C9070: ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x8 strb r0, [r1] b @080C9096 .align 2, 0 .pool @080C9080: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C9096 bl sub_80CADC4 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C9096: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C8EB4 thumb_func_start sub_80C90A4 sub_80C90A4: ; 80C90A4 push {r4,lr} ldr r4, =0x02039d08 ldr r0, [r4] ldrb r0, [r0] cmp r0, 0 beq @080C90BC cmp r0, 0x1 beq @080C90F0 b @080C9118 .align 2, 0 .pool @080C90BC: movs r0, 0xC bl sub_80CAC58 ldr r0, [r4] ldr r2, =0x00000ceb adds r1, r0, r2 ldrb r1, [r1] ldr r3, =0x00000da8 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 .pool @080C90F0: bl sub_811FBA4 lsls r0, 24 cmp r0, 0 bne @080C9118 bl sub_811FAF8 bl sub_80CADC4 ldr r0, [r4] ldr r1, =0x00000da8 adds r0, r1 ldrb r0, [r0] bl sub_80CE9A8 bl sub_80CA230 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C9118: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C90A4 thumb_func_start sub_80C9128 sub_80C9128: ; 80C9128 push {r4,r5,lr} ldr r5, =0x02039d08 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 .pool @080C9144: cmp r1, 0x2 beq @080C919C cmp r1, 0x3 beq @080C91C2 b @080C91D2 @080C914E: ldr r1, =0x00000ce6 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 .pool @080C9168: ldr r0, =sub_80C96B8 bl add_to_c3_somehow b @080C91D2 .align 2, 0 .pool @080C9174: movs r0, 0x2 bl sub_80CFE54 ldr r0, =0x02039d0c 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 .pool @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, =task_pokemon_box_related bl add_to_c3_somehow @080C91D2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C9128 thumb_func_start sub_80C91DC sub_80C91DC: ; 80C91DC push {r4,lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x4 bhi @080C928C lsls r0, 2 ldr r1, =@080C91FC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080C91FC: .4byte @080C9264 .4byte @080C9210 .4byte @080C9238 .4byte @080C9258 .4byte @080C927C @080C9210: movs r0, 0x2 bl sub_80CFE54 ldr r0, =0x02039d0c 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 .pool @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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C928C @080C9264: bl sub_80CADC4 @080C9268: ldr r0, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C928C .align 2, 0 .pool @080C927C: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @080C928C ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C928C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C91DC thumb_func_start sub_80C9298 sub_80C9298: ; 80C9298 push {r4,r5,lr} ldr r1, =0x02039d08 ldr r0, [r1] ldrb r0, [r0] adds r5, r1, 0 cmp r0, 0x4 bls @080C92A8 b @080C93A2 @080C92A8: lsls r0, 2 ldr r1, =@080C92BC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080C92BC: .4byte @080C92D0 .4byte @080C9328 .4byte @080C9348 .4byte @080C938C .4byte @080C9374 @080C92D0: ldr r0, [r5] ldr r1, =0x00000ce6 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 .pool @080C92FC: movs r0, 0x5 bl audio_play ldr r0, =0x02039d0c 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 .pool @080C9328: bl sub_80D1218 lsls r0, 24 cmp r0, 0 bne @080C93A2 movs r0, 0x19 bl sub_80CAC58 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x2 strb r0, [r1] b @080C93A2 .align 2, 0 .pool @080C9348: ldr r0, =0x030022c0 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, =0x02039d08 ldr r1, [r0] movs r0, 0x4 strb r0, [r1] b @080C93A2 .align 2, 0 .pool @080C9374: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @080C93A2 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow b @080C93A2 .align 2, 0 .pool @080C938C: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C93A2 bl sub_80CADC4 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C93A2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C9298 thumb_func_start sub_80C93B0 sub_80C93B0: ; 80C93B0 push {r4,lr} ldr r1, =0x02039d08 ldr r0, [r1] ldrb r0, [r0] adds r4, r1, 0 cmp r0, 0x4 bhi @080C948C lsls r0, 2 ldr r1, =@080C93D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080C93D0: .4byte @080C93E4 .4byte @080C9410 .4byte @080C9438 .4byte @080C9458 .4byte @080C947C @080C93E4: ldr r0, [r4] ldr r1, =0x00000ce6 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 .pool @080C9404: ldr r0, =sub_80C96B8 bl add_to_c3_somehow b @080C948C .align 2, 0 .pool @080C9410: movs r0, 0x2 bl sub_80CFE54 ldr r0, =0x02039d0c 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 .pool @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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C948C bl sub_80CADC4 @080C9468: ldr r0, =0x02039d08 ldr r1, [r0] @080C946C: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C948C .align 2, 0 .pool @080C947C: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @080C948C ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C948C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C93B0 thumb_func_start sub_80C9498 sub_80C9498: ; 80C9498 push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x6 bhi @080C9544 lsls r0, 2 ldr r1, =@080C94B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 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 .pool @080C9518: bl sub_80D18E4 @080C951C: lsls r0, 24 cmp r0, 0 bne @080C9544 @080C9522: ldr r0, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C9544 .align 2, 0 .pool @080C9534: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @080C9544 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C9544: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C9498 thumb_func_start sub_80C954C sub_80C954C: ; 80C954C push {r4,lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x5 bls @080C955A b @080C9664 @080C955A: lsls r0, 2 ldr r1, =@080C956C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 ldr r1, [r0] movs r0, 0x1 strb r0, [r1] b @080C9664 .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r4] ldr r1, =0x00002234 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 .pool @080C95F4: movs r0, 0x1A bl sub_80CAC58 ldr r1, [r4] movs r0, 0x2 strb r0, [r1] b @080C9664 @080C9602: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C9664 bl sub_80CADC4 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x5 strb r0, [r1] b @080C9664 .align 2, 0 .pool @080C9624: bl sub_80D1194 ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x4 strb r0, [r1] b @080C9664 .align 2, 0 .pool @080C9638: bl sub_80D1218 lsls r0, 24 cmp r0, 0 bne @080C9664 movs r0, 0 bl sub_80CFE54 @080C9648: ldr r0, =task_pokemon_box_related bl add_to_c3_somehow b @080C9664 .align 2, 0 .pool @080C9654: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @080C9664 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C9664: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C954C thumb_func_start sub_80C9670 sub_80C9670: ; 80C9670 push {r4,lr} ldr r4, =0x02039d08 ldr r0, [r4] ldrb r0, [r0] cmp r0, 0 beq @080C9688 cmp r0, 0x1 beq @080C969A b @080C96AE .align 2, 0 .pool @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, =task_pokemon_box_related bl add_to_c3_somehow @080C96AE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C9670 thumb_func_start sub_80C96B8 sub_80C96B8: ; 80C96B8 push {r4,lr} ldr r4, =0x02039d08 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 .pool @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, =0x030022c0 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 .pool @080C9710: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @080C9720 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C9720: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C96B8 thumb_func_start box_related box_related: ; 80C972C push {r4,lr} ldr r4, =0x02039d08 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 .pool @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, =@080C9790 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =task_pokemon_box_related bl add_to_c3_somehow b @080C9818 .align 2, 0 .pool @080C97DC: movs r0, 0x5 bl audio_play ldr r0, =sub_80C9AC8 bl add_to_c3_somehow b @080C9818 .align 2, 0 .pool @080C97F0: movs r0, 0x5 bl audio_play bl sub_80CADC4 ldr r0, =sub_80C9824 bl add_to_c3_somehow b @080C9818 .align 2, 0 .pool @080C9808: movs r0, 0x5 bl audio_play bl sub_80CADC4 ldr r0, =sub_80C99D8 bl add_to_c3_somehow @080C9818: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end box_related thumb_func_start sub_80C9824 sub_80C9824: ; 80C9824 push {r4,r5,lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x6 bls @080C9832 b @080C99CC @080C9832: lsls r0, 2 ldr r1, =@080C9844 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 b @080C99CA .align 2, 0 .pool @080C9878: bl sub_80D00A8 lsls r0, 24 cmp r0, 0 beq @080C9884 b @080C99CC @080C9884: ldr r0, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 b @080C99CA .align 2, 0 .pool @080C9894: bl sub_80D00AC ldr r4, =0x02039d08 ldr r1, [r4] ldr r5, =0x0000078e 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 .pool @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, =0x02039d08 ldr r0, [r4] ldr r1, =0x0000078e 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 .pool @080C993C: bl sub_80D00AC ldr r4, =0x02039d08 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 .pool @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, =task_pokemon_box_related bl add_to_c3_somehow b @080C99CC .align 2, 0 .pool @080C99AC: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @080C99CC ldr r4, =0x02039d08 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 .pool thumb_func_end sub_80C9824 thumb_func_start sub_80C99D8 sub_80C99D8: ; 80C99D8 push {r4,r5,lr} sub sp, 0x4 ldr r5, =0x02039d08 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 .pool @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, =0x00001e5c adds r0, r1 ldr r2, =0x0000dac7 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 .pool @080C9A2C: bl sub_80C78F0 ldr r1, [r5] lsls r0, 24 lsrs r0, 24 ldr r2, =0x000002ca 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, =0x000002ca 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, =task_pokemon_box_related bl add_to_c3_somehow b @080C9AB8 .align 2, 0 .pool @080C9A84: ldr r1, =0x000002ca 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 .pool @080C9A9C: bl sub_80CC54C lsls r0, 24 cmp r0, 0 bne @080C9AB8 ldr r0, [r5] ldr r2, =0x000002ca adds r0, r2 ldrb r0, [r0] bl sub_80D1D18 ldr r0, =task_pokemon_box_related bl add_to_c3_somehow @080C9AB8: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C99D8 thumb_func_start sub_80C9AC8 sub_80C9AC8: ; 80C9AC8 push {r4,r5,lr} sub sp, 0x4 ldr r5, =0x02039d08 ldr r0, [r5] ldrb r4, [r0] cmp r4, 0 beq @080C9AE0 cmp r4, 0x1 beq @080C9AFE b @080C9B18 .align 2, 0 .pool @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, =0x02039d0f strb r4, [r0] ldr r1, [r5] movs r0, 0x2 strb r0, [r1, 0x2] ldr r0, =sub_80C9E50 bl add_to_c3_somehow @080C9B18: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C9AC8 thumb_func_start sub_80C9B28 sub_80C9B28: ; 80C9B28 push {r4,r5,lr} sub sp, 0x4 ldr r5, =0x02039d08 ldr r0, [r5] ldrb r4, [r0] cmp r4, 0 beq @080C9B40 cmp r4, 0x1 beq @080C9B5E b @080C9B78 .align 2, 0 .pool @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, =0x02039d0f strb r1, [r0] ldr r0, [r5] strb r4, [r0, 0x2] ldr r0, =sub_80C9E50 bl add_to_c3_somehow @080C9B78: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C9B28 thumb_func_start sub_80C9B88 sub_80C9B88: ; 80C9B88 push {r4,lr} sub sp, 0x4 ldr r4, =0x02039d08 ldr r0, [r4] ldrb r1, [r0] cmp r1, 0 beq @080C9BA0 cmp r1, 0x1 beq @080C9BBA b @080C9BD6 .align 2, 0 .pool @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, =0x02039d0f movs r0, 0x2 strb r0, [r1] ldr r1, [r4] movs r0, 0x3 strb r0, [r1, 0x2] ldr r0, =sub_80C9E50 bl add_to_c3_somehow @080C9BD6: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C9B88 thumb_func_start sub_80C9BE8 sub_80C9BE8: ; 80C9BE8 push {r4,lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x4 bls @080C9BF6 b @080C9D08 @080C9BF6: lsls r0, 2 ldr r1, =@080C9C08 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 ldr r1, [r0] movs r0, 0x1 strb r0, [r1] b @080C9D08 .align 2, 0 .pool @080C9C40: bl sub_80D127C lsls r0, 24 cmp r0, 0 beq @080C9C58 ldr r0, =sub_80C954C bl add_to_c3_somehow b @080C9D08 .align 2, 0 .pool @080C9C58: movs r0, 0x5 bl audio_play movs r0, 0 bl sub_80CAC58 movs r0, 0 bl sub_80CAD9C ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x2 strb r0, [r1] b @080C9D08 .align 2, 0 .pool @080C9C78: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C9D08 b @080C9CAA .align 2, 0 .pool @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, =task_pokemon_box_related bl add_to_c3_somehow b @080C9D08 .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C9D08 .align 2, 0 .pool @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, =0x020244e9 strb r0, [r1] ldr r0, =0x02039d08 ldr r0, [r0] strb r4, [r0, 0x2] ldr r0, =sub_80C9E50 bl add_to_c3_somehow @080C9D08: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C9BE8 thumb_func_start sub_80C9D1C sub_80C9D1C: ; 80C9D1C push {r4,lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x4 bls @080C9D2A b @080C9E3C @080C9D2A: lsls r0, 2 ldr r1, =@080C9D3C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 ldr r1, [r0] movs r0, 0x1 strb r0, [r1] b @080C9E3C .align 2, 0 .pool @080C9D74: bl sub_80D127C lsls r0, 24 cmp r0, 0 beq @080C9D8C ldr r0, =sub_80C954C bl add_to_c3_somehow b @080C9E3C .align 2, 0 .pool @080C9D8C: movs r0, 0x5 bl audio_play movs r0, 0x12 bl sub_80CAC58 movs r0, 0 bl sub_80CAD9C ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0x2 strb r0, [r1] b @080C9E3C .align 2, 0 .pool @080C9DAC: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0xF3 ands r0, r1 cmp r0, 0 beq @080C9E3C b @080C9DE0 .align 2, 0 .pool @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, =task_pokemon_box_related bl add_to_c3_somehow b @080C9E3C .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080C9E3C .align 2, 0 .pool @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, =0x020244e9 strb r0, [r1] ldr r0, =0x02039d08 ldr r0, [r0] strb r4, [r0, 0x2] ldr r0, =sub_80C9E50 bl add_to_c3_somehow @080C9E3C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 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, =0x02039d12 b @080C9E8C .align 2, 0 .pool @080C9E88: ldr r1, =0x02039d12 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, =sub_80C7678 bl set_callback2 b @080C9F56 .align 2, 0 .pool @080C9EB4: ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x0000218c 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, =0x00002188 adds r1, r0 ldrb r5, [r1] bl sub_80C9FC8 cmp r5, 0 bne @080C9F04 ldr r0, =0x02039d14 cmp r4, r0 bne @080C9F04 ldr r0, =c2_808CE60 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 .pool @080C9F04: ldr r0, =c2_808CE60 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 .pool @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, =c2_808CE60 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 .pool @080C9F48: bl sub_80C9FC8 ldr r2, =c2_808CE60 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 .pool thumb_func_end sub_80C9E50 thumb_func_start sub_80C9F6C sub_80C9F6C: ; 80C9F6C push {lr} sub sp, 0x4 ldr r0, =0x0203ce7c 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, =0x02039d0c ldrb r0, [r0] cmp r0, 0 beq @080C9FAC movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xC mov r2, sp bl pokemon_setattr b @080C9FB6 .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r4] bl free movs r0, 0 str r0, [r4] bl Window_FreeMemory pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80C9FC8 thumb_func_start sub_80C9FEC sub_80C9FEC: ; 80C9FEC push {lr} sub sp, 0x4 ldr r1, =0x00001f0f movs r0, 0xE bl lcd_io_set ldr r1, =gUnknown_085720DC 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, =gUnknown_08572174 ldr r1, =0x0600f800 bl LZ77UnCompVram add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08572734 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r1, =gUnknown_08DD2FE8 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, =gUnknown_085722A0 ldr r5, =0x02039d08 ldr r1, [r5] ldr r4, =0x00005ac4 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 .pool thumb_func_end sub_80CA044 thumb_func_start sub_80CA0A4 sub_80CA0A4: ; 80CA0A4 push {lr} ldr r0, =gUnknown_08572714 bl Window_InitFromTemplates lsls r0, 16 cmp r0, 0 beq @080CA0C0 bl TextBox_ResetSomeField movs r0, 0x1 b @080CA0C2 .align 2, 0 .pool @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, =gUnknown_08572744 bl gpu_pal_obj_alloc_tag_and_apply pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CA0C8 thumb_func_start sub_80CA0D8 sub_80CA0D8: ; 80CA0D8 push {lr} ldr r0, =gUnknown_085723DC movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085723FC movs r1, 0x20 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085726F4 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x3 beq @080CA124 ldr r0, =gUnknown_0857241C movs r1, 0x30 movs r2, 0x20 bl gpu_pal_apply b @080CA12E .align 2, 0 .pool @080CA124: ldr r0, =gUnknown_0857243C movs r1, 0x30 movs r2, 0x20 bl gpu_pal_apply @080CA12E: ldr r1, =0x00001e05 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 .pool thumb_func_end sub_80CA0D8 thumb_func_start sub_80CA154 sub_80CA154: ; 80CA154 push {r4,lr} ldr r1, =0x0000dac8 movs r0, 0x10 movs r2, 0 bl sub_811FFB4 ldr r4, =0x02039d08 ldr r1, [r4] ldr r3, =0x00000d94 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, =0x06010000 adds r0, r2 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CA154 thumb_func_start sub_80CA1C4 sub_80CA1C4: ; 80CA1C4 push {r4,lr} sub sp, 0x8 ldr r0, =gUnknown_0857274C 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, =gUnknown_085728BC movs r2, 0x9 movs r3, 0x2 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039d08 ldr r2, [r1] lsls r1, r4, 2 ldr r3, =0x00000d98 adds r2, r3 adds r2, r1 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 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 .pool thumb_func_end sub_80CA1C4 thumb_func_start sub_80CA230 sub_80CA230: ; 80CA230 push {lr} ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x00000ce4 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 .pool thumb_func_end sub_80CA230 thumb_func_start BoxSetMosaic BoxSetMosaic: ; 80CA260 push {lr} bl sub_80CA230 ldr r3, =0x02039d08 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, =BoxSetMosaic2 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 .pool thumb_func_end BoxSetMosaic thumb_func_start sub_80CA2B8 sub_80CA2B8: ; 80CA2B8 ldr r0, =0x02039d08 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 .pool 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, =nullsub_12 str r0, [r4, 0x1C] @080CA30E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end BoxSetMosaic2 thumb_func_start sub_80CA318 sub_80CA318: ; 80CA318 push {r4-r7,lr} sub sp, 0x28 ldr r0, =0x02039d08 mov r12, r0 ldr r1, [r0] ldr r4, =0x000022c4 adds r0, r1, r4 str r0, [sp, 0x18] add r3, sp, 0x18 movs r0, 0x82 lsls r0, 10 str r0, [r3, 0x4] ldr r5, =0x00002244 adds r1, r5 str r1, [sp, 0x20] ldr r0, =0x0000dac6 add r2, sp, 0x20 str r0, [r2, 0x4] mov r1, sp ldr r0, =gUnknown_08572754 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, =0x000007ff @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, =0x02039d08 ldr r4, =0x00002244 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, =0x02039d08 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 .pool @080CA3C4: ldr r0, =0x02039d08 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, =0x02020630 adds r0, r1 str r0, [r3] lsls r0, r4, 4 movs r1, 0x80 lsls r1, 1 adds r0, r1 ldr r3, =0x0000223a adds r1, r2, r3 strh r0, [r1] ldr r6, =0x0000223c adds r2, r6 lsls r0, r5, 5 ldr r7, =0x06010000 adds r0, r7 str r0, [r2] b @080CA420 .align 2, 0 .pool @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, =0x02039d08 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, =0x0000dac6 bl gpu_pal_free_tag @080CA43C: add sp, 0x28 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 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, =gMonFrontPicTable adds r0, r1 ldr r5, =0x000022c4 adds r1, r2, r5 movs r2, 0x1 str r2, [sp] adds r2, r4, 0 bl sub_8034654 ldr r1, [r6] ldr r2, =0x00000cdc adds r0, r1, r2 ldr r0, [r0] ldr r4, =0x00002244 adds r1, r4 bl LZ77UnCompWram ldr r0, [r6] adds r5, r0, r5 ldr r1, =0x0000223c adds r0, r1 ldr r1, [r0] ldr r2, =0x04000200 adds r0, r5, 0 bl CpuSet ldr r0, [r6] adds r4, r0, r4 ldr r2, =0x0000223a 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 .pool @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, =0x02039d08 ldr r2, [r6] ldrb r0, [r2, 0x1] cmp r0, 0x3 beq @080CA588 ldr r0, =0x00000cf9 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, =0x00000d1d 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, =0x00000d41 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, =0x00000d65 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 .pool @080CA588: ldr r0, =0x00000d65 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, =0x00000cf9 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, =0x00000d1d 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, =0x00000d41 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, =0x02039d08 ldr r1, [r4] ldr r2, =0x00000ce4 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, =0x00000d94 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 .pool @080CA640: ldr r2, =0x00000d94 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 .pool thumb_func_end sub_80CA4FC thumb_func_start sub_80CA65C sub_80CA65C: ; 80CA65C push {r4,lr} sub sp, 0x4 ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000ce4 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, =0x02039d08 ldr r0, [r0] lsls r1, r4, 2 ldr r2, =0x00000d98 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 .pool @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, =0x02039d08 ldr r0, [r0] lsls r1, r4, 2 ldr r2, =0x00000d98 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 .pool thumb_func_end sub_80CA65C thumb_func_start sub_80CA704 sub_80CA704: ; 80CA704 push {r4,lr} sub sp, 0x4 ldr r0, =gUnknown_08DD36C8 ldr r4, =0x02039d08 ldr r1, [r4] adds r1, 0xB0 bl LZ77UnCompWram ldr r0, =gUnknown_08DD36A8 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, =gUnknown_0857245C 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, =0x02039d0c 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 .pool @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, =0x02039d08 ldr r0, [r0] ldr r1, =0x000002c7 adds r0, r1 movs r1, 0 strb r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CA704 thumb_func_start sub_80CA7D4 sub_80CA7D4: ; 80CA7D4 push {lr} ldr r0, =0x02039d08 ldr r1, [r0] movs r0, 0xB0 lsls r0, 2 adds r2, r1, r0 movs r3, 0 movs r0, 0x14 strh r0, [r2] ldr r0, =0x000002c2 adds r2, r1, r0 movs r0, 0x2 strh r0, [r2] ldr r0, =0x000002c5 adds r1, r0 strb r3, [r1] movs r0, 0 bl sub_80CB7E8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CA7D4 thumb_func_start sub_80CA80C sub_80CA80C: ; 80CA80C push {r4,lr} ldr r4, =0x02039d08 ldr r2, [r4] ldr r1, =0x000002c5 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, =0x000002c2 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, =0x000002c5 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 .pool @080CA874: ldr r1, =0x02039d0c movs r0, 0x1 strb r0, [r1] @080CA87A: movs r0, 0 @080CA87C: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80CA80C thumb_func_start sub_80CA888 sub_80CA888: ; 80CA888 push {r4,lr} ldr r4, =0x02039d08 ldr r1, [r4] movs r0, 0xB0 lsls r0, 2 adds r2, r1, r0 movs r3, 0 movs r0, 0 strh r0, [r2] ldr r0, =0x000002c2 adds r2, r1, r0 movs r0, 0x16 strh r0, [r2] ldr r0, =0x000002c5 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 .pool thumb_func_end sub_80CA888 thumb_func_start sub_80CA8C8 sub_80CA8C8: ; 80CA8C8 push {r4,r5,lr} sub sp, 0x8 ldr r5, =0x02039d08 ldr r2, [r5] ldr r1, =0x000002c5 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, =0x000002c2 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, =0x000002c5 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 .pool @080CA94C: ldr r0, =0x02039d0c 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 .pool 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, =0x02039d08 ldr r0, [r2] ldr r1, =0x000002c7 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, =0x000002c9 adds r0, r1 strb r3, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80CA9C0 thumb_func_start sub_80CA9EC sub_80CA9EC: ; 80CA9EC push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldr r2, =0x000002c7 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 .pool thumb_func_end sub_80CA9EC thumb_func_start sub_80CAA14 sub_80CAA14: ; 80CAA14 push {r4,lr} ldr r3, =0x02039d08 ldr r1, [r3] ldr r2, =0x000002c7 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, =0x000002c9 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 .pool 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, =0x020244ec 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 .pool 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, =gUnknown_085724BC cmp r1, 0 beq @080CAAB8 ldr r7, =gUnknown_085724A4 @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, =0x02039d08 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 .pool 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, =0x02039d08 ldr r0, [r0] ldr r1, =0x000002c6 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 .pool thumb_func_end sub_80CAB4C thumb_func_start sub_80CAB70 sub_80CAB70: ; 80CAB70 push {r4,r5,lr} ldr r4, =0x02039d08 ldr r0, [r4] ldr r5, =0x000002c6 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 .pool @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, =0x00000cea 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 .pool @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, =0x02039d10 bl get_preferred_box ldrb r1, [r4] lsls r0, 24 lsrs r0, 24 cmp r1, r0 beq @080CAC0A ldr r0, =0x000008d7 bl flag_clear ldr r4, =0x00004036 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 .pool 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, =gUnknown_0857276C lsls r0, r6, 3 adds r0, r1 ldrb r0, [r0, 0x4] cmp r0, 0x7 bhi @080CAD30 lsls r0, 2 ldr r1, =@080CAC84 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080CAC84: .4byte @080CAD30 .4byte @080CACA4 .4byte @080CACA4 .4byte @080CACA4 .4byte @080CACB8 .4byte @080CACB8 .4byte @080CACB8 .4byte @080CACD0 @080CACA4: ldr r0, =0x02039d08 ldr r1, [r0] ldr r0, =0x00000cee adds r1, r0 b @080CACC0 .align 2, 0 .pool @080CACB8: ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x000021e0 adds r1, r2 @080CACC0: movs r0, 0 bl sub_81AFC0C b @080CAD30 .align 2, 0 .pool @080CACD0: bl sub_80D127C lsls r0, 24 cmp r0, 0 beq @080CACF4 ldr r0, =0x02039d08 ldr r4, [r0] ldr r0, =0x000021eb adds r4, r0 bl sub_80D12B8 adds r1, r0, 0 adds r0, r4, 0 b @080CAD00 .align 2, 0 .pool @080CACF4: ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x000021eb adds r0, r1, r2 ldr r2, =0x00000d65 adds r1, r2 @080CAD00: bl gf_strcpy adds r2, r0, 0 b @080CAD16 .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r0] ldr r0, =0x000021eb adds r1, r0 movs r0, 0 bl sub_81AFC0C @080CAD30: ldr r5, =0x02039d08 ldr r0, [r5] ldr r4, =0x00002190 adds r0, r4 ldr r2, =gUnknown_0857276C 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 .pool 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, =gUnknown_08572864 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 .pool 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, =0x02039d0d ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x02039d0c 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 .pool @080CAED8: bl sub_80CFE08 adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 movs r0, 0 bl sub_80D0D8C @080CAEE8: ldr r1, =0x02039d12 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 .pool 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, =0x02039d08 ldr r5, =0x00000b08 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, =0x02039d08 ldr r4, =0x00000b58 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, =0x02039d08 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, =0x02039d08 ldr r4, =0x00000a88 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, =0x00000a6c adds r1, r0, r2 movs r2, 0 str r2, [r1] ldr r1, =0x0000078c adds r0, r1 strh r2, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r0, [r5] ldr r4, =0x000020a4 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, =0x00000a6c adds r1, r2 str r0, [r1] ldr r1, =sub_80CC100 str r1, [r0, 0x1C] add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r1, [r1] mov r3, r8 lsls r2, r3, 2 ldr r3, =0x00000a88 adds r1, r3 adds r1, r2 str r0, [r1] b @080CB0C0 .align 2, 0 .pool @080CB0B0: ldr r0, =0x02039d08 ldr r0, [r0] mov r2, r8 lsls r1, r2, 2 ldr r3, =0x00000a88 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, =0x02039d08 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, =0x02039d08 ldr r0, [r0] lsls r1, r6, 2 ldr r3, =0x00000a88 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 .pool 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, =0x02039d08 ldr r2, [r0] lsls r1, r7, 2 ldr r4, =0x00000a88 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 .pool 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, =0x02039d08 ldr r6, =0x00000a88 movs r5, 0x1 ldr r4, =sub_80CB278 @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 .pool 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, =0x02039d08 ldr r1, [r0] ldr r3, =0x00000c66 adds r1, r3 ldrh r0, [r1] subs r0, 0x1 strh r0, [r1] ldrh r0, [r2, 0x34] strh r0, [r2, 0x20] ldr r0, =nullsub_12 str r0, [r2, 0x1C] @080CB266: pop {r0} bx r0 .align 2, 0 .pool 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, =nullsub_12 str r0, [r2, 0x1C] @080CB2A8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 @080CB2BA: ldr r0, [r7] lsls r4, r5, 2 ldr r1, =0x00000a88 adds r0, r1 adds r0, r4 ldr r0, [r0] cmp r0, 0 beq @080CB2DA bl sub_80CC314 ldr r0, [r7] ldr r1, =0x00000a88 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 .pool 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, =0x02039d08 ldr r0, [r1] ldrb r0, [r0, 0x1] cmp r0, 0x3 beq @080CB3F0 movs r7, 0x4 lsls r2, 16 mov r10, r2 @080CB358: ldr r6, =0x02039d08 ldr r2, [r6] lsls r0, r5, 1 ldr r3, =0x00000ba8 adds r1, r2, r3 adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @080CB3C2 lsls r4, r5, 2 ldr r6, =0x00000be4 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, =0x02039d08 ldr r0, [r1] ldr r3, =0x00000a88 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, =sub_80CB234 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 .pool @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, =0x00000ba8 adds r1, r2, r3 adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @080CB490 lsls r4, r5, 2 ldr r6, =0x00000be4 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, =0x00000a88 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, =sub_80CB234 str r0, [r1, 0x1C] ldr r1, =0x00000c5c 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, =0x00000a88 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 .pool 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, =0x02039d08 ldr r1, [r6] ldr r2, =0x00000c6a adds r1, r2 movs r5, 0 strb r5, [r1] ldr r1, [r6] ldr r3, =0x00000c6b adds r1, r3 strb r0, [r1] ldr r1, [r6] ldr r7, =0x00000c69 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, =0x00000c66 adds r3, r1 strh r5, [r3] bl sub_80CB6F0 cmp r4, 0 ble @080CB544 ldr r0, [r6] ldr r2, =0x00000c68 adds r0, r2 movs r1, 0 b @080CB54C .align 2, 0 .pool @080CB544: ldr r0, [r6] ldr r3, =0x00000c68 adds r0, r3 movs r1, 0x5 @080CB54C: strb r1, [r0] ldr r0, =0x02039d08 ldr r2, [r0] ldr r7, =0x00000c68 adds r0, r2, r7 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 3 adds r0, 0x64 ldr r3, =0x00000c62 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 .pool thumb_func_end sub_80CB4CC thumb_func_start sub_80CB584 sub_80CB584: ; 80CB584 push {r4-r6,lr} ldr r5, =0x02039d08 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, =0x00000c6a 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 .pool @080CB5B8: cmp r0, 0x2 bne @080CB5BE b @080CB6CC @080CB5BE: b @080CB6DE @080CB5C0: ldr r0, =0x00000c62 adds r1, r3, r0 ldr r2, =0x00000c64 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, =0x00000c68 adds r0, r3, r1 ldrb r0, [r0] bl sub_80CB2B0 ldr r2, [r5] ldr r0, =0x00000c62 adds r3, r2, r0 ldr r1, =0x00000c69 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 .pool @080CB61C: ldr r2, =0x00000c62 adds r1, r3, r2 ldr r6, =0x00000c64 adds r2, r3, r6 ldrh r0, [r2] ldrh r6, [r1] adds r0, r6 strh r0, [r1] ldr r6, =0x00000c68 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, =0x00000c66 adds r1, r2, r3 lsls r0, 24 lsrs r0, 24 ldrh r3, [r1] adds r0, r3 strh r0, [r1] ldr r1, =0x00000c69 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, =0x02039d08 ldr r1, [r0] ldr r2, =0x00000c6a adds r1, r2 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080CB6E8 .align 2, 0 .pool @080CB69C: ldr r3, =0x02039d08 ldr r0, [r3] ldr r6, =0x00000c68 adds r1, r0, r6 ldr r2, =0x00000c69 adds r0, r2 ldrb r0, [r0] ldrb r6, [r1] adds r0, r6 movs r2, 0 strb r0, [r1] ldr r0, [r3] ldr r1, =0x00000c6a adds r0, r1 strb r2, [r0] b @080CB6E8 .align 2, 0 .pool @080CB6CC: ldr r2, =0x00000c66 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 .pool @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, =0x02039d08 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, =0x00000ba8 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, =0x00000be4 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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000c5c 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 .pool thumb_func_end sub_80CB6F0 thumb_func_start sub_80CB778 sub_80CB778: ; 80CB778 push {r4,r5,lr} lsls r0, 24 ldr r5, =0x02039d08 ldr r1, [r5] lsrs r4, r0, 22 ldr r0, =0x00000a88 adds r1, r0 adds r1, r4 ldr r0, [r1] cmp r0, 0 beq @080CB79E bl sub_80CC314 ldr r0, [r5] ldr r1, =0x00000a88 adds r0, r1 adds r0, r4 movs r1, 0 str r1, [r0] @080CB79E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r1, [r1] lsrs r0, 22 ldr r3, =0x00000a88 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 .pool 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, =0x020244ec 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, =0x02039d08 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, =0x020244ec 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, =0x02039d08 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 .pool @080CB894: ldr r0, =0x02039d08 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, =0x02039d08 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, =0x020244ec 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 .pool thumb_func_end sub_80CB7E8 thumb_func_start sub_80CB950 sub_80CB950: ; 80CB950 push {r4-r7,lr} sub sp, 0x4 ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x00000c5e 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, =0x00000c5e 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 .pool thumb_func_end sub_80CB950 thumb_func_start sub_80CB9BC sub_80CB9BC: ; 80CB9BC ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000c5e adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =sub_80CBA3C str r0, [r2, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =nullsub_12 str r0, [r3, 0x1C] ldr r0, =0x02039d08 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, =0x00000c5e adds r2, r0 ldrb r0, [r2] subs r0, 0x1 strb r0, [r2] @080CBAB2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CBA3C thumb_func_start sub_80CBAC4 sub_80CBAC4: ; 80CBAC4 push {r4,lr} ldr r4, =0x02039d08 ldr r0, [r4] ldr r1, =0x00000a6c adds r0, r1 ldr r0, [r0] cmp r0, 0 beq @080CBAE2 bl sub_80CC314 ldr r0, [r4] ldr r1, =0x00000a6c adds r0, r1 movs r1, 0 str r1, [r0] @080CBAE2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CBAC4 thumb_func_start sub_80CBAF0 sub_80CBAF0: ; 80CBAF0 push {r4-r6,lr} movs r3, 0 ldr r6, =0x02039d08 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 .pool @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, =0x02039d08 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 .pool thumb_func_end sub_80CBB68 thumb_func_start sub_80CBB9C sub_80CBB9C: ; 80CBB9C push {r4-r6,lr} movs r5, 0 ldr r6, =0x02039d08 @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 .pool 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, =0x02039d08 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 .pool 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, =0x02039d08 ldr r0, [r3] ldr r5, =0x00000a6c 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 .pool @080CBC44: cmp r4, 0x1 bne @080CBC96 ldr r3, =0x02039d08 ldr r0, [r3] ldr r1, =0x00000a6c adds r2, r0, r1 lsls r1, r5, 2 ldr r4, =0x00000a88 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, =0x00000a6c adds r0, r4 ldr r1, [r0] ldr r0, =sub_80CC100 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 .pool 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, =0x02039d08 ldr r1, [r3] lsls r5, r6, 2 movs r4, 0xA7 lsls r4, 4 adds r0, r1, r4 adds r0, r5 ldr r2, =0x00000a6c 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 .pool @080CBCF8: ldr r5, =0x02039d08 ldr r1, [r5] lsls r4, r6, 2 ldr r3, =0x00000a88 adds r0, r1, r3 adds r0, r4 ldr r2, =0x00000a6c 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, =0x00000a6c adds r1, r0 ldr r2, [r1] ldr r0, =nullsub_12 str r0, [r2, 0x1C] movs r0, 0 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 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 .pool @080CBD80: ldr r3, =0x02039d08 ldr r1, [r3] movs r0, 0xB0 lsls r0, 4 adds r2, r1, r0 lsls r0, r4, 2 ldr r4, =0x00000a88 @080CBD8E: adds r0, r4 adds r1, r0 str r1, [r2] ldr r1, [r3] ldr r2, =0x00000a6c adds r0, r1, r2 ldr r2, [r0] ldr r0, =nullsub_12 str r0, [r2, 0x1C] ldr r4, =0x00000c5d adds r1, r4 movs r0, 0 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r0, [r6] ldr r1, =0x00000c5d mov r9, r1 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0x10 bne @080CBDE8 movs r0, 0 b @080CBEF4 .align 2, 0 .pool @080CBDE8: adds r0, 0x1 strb r0, [r1] ldr r2, [r6] ldr r5, =0x00000c5d 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, =0x00000a6c 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, =gUnknown_08329F40 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, =0x00000a6c 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, =sub_80CC100 str r0, [r2, 0x1C] adds r1, r7 ldr r0, [r1] ldr r1, [r0] ldr r0, =nullsub_12 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 .pool 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, =0x02039d08 ldr r1, [r3] ldr r0, =0x00000b04 adds r2, r1, r0 lsls r0, r4, 2 movs r4, 0xA7 lsls r4, 4 b @080CBF58 .align 2, 0 .pool @080CBF4C: ldr r3, =0x02039d08 ldr r1, [r3] ldr r0, =0x00000b04 adds r2, r1, r0 lsls r0, r4, 2 ldr r4, =0x00000a88 @080CBF58: adds r0, r4 adds r1, r0 str r1, [r2] adds r4, r3, 0 b @080CBF80 .align 2, 0 .pool @080CBF70: ldr r0, =0x02039d08 ldr r1, [r0] ldr r3, =0x00000b04 adds r2, r1, r3 ldr r4, =0x00000a6c adds r1, r4 str r1, [r2] adds r4, r0, 0 @080CBF80: ldr r0, [r4] ldr r1, =0x00000b04 adds r0, r1 ldr r0, [r0] ldr r0, [r0] cmp r0, 0 beq @080CBFC0 bl obj_alloc_rotscale_entry ldr r0, [r4] ldr r3, =0x00000b04 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, =gUnknown_0857291C 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 .pool thumb_func_end sub_80CBF14 thumb_func_start sub_80CBFD8 sub_80CBFD8: ; 80CBFD8 push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000b04 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 .pool @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, =0x02039d08 ldr r0, [r4] ldr r1, =0x00000b04 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, =0x00000b04 adds r0, r1 ldr r0, [r0] ldr r0, [r0] bl sub_80CC314 ldr r0, [r4] ldr r1, =0x00000b04 adds r0, r1 ldr r1, [r0] movs r0, 0 str r0, [r1] @080CC056: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CC020 thumb_func_start sub_80CC064 sub_80CC064: ; 80CC064 push {lr} ldr r3, =0x02039d08 ldr r0, [r3] ldr r1, =0x00000b04 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, =0x00000b04 adds r0, r1 ldr r0, [r0] ldr r0, [r0] movs r1, 0x1 bl sub_8008258 @080CC094: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CC064 thumb_func_start sub_80CC0A0 sub_80CC0A0: ; 80CC0A0 push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000b04 adds r2, r0, r1 ldr r0, [r2] cmp r0, 0 bne @080CC0BC movs r0, 0 b @080CC0D0 .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r1] ldr r2, =0x00000a6c 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 .pool thumb_func_end sub_80CC0D4 thumb_func_start sub_80CC100 sub_80CC100: ; 80CC100 ldr r1, =0x02039d08 ldr r1, [r1] ldr r2, =0x00000cb4 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 .pool 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, =0x02039d08 ldr r0, [r1] ldr r2, =0x00000b58 adds r0, r2 ldrh r0, [r0] adds r2, r1, 0 cmp r0, r3 beq @080CC158 adds r6, r2, 0 ldr r5, =0x00000b58 @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, =0x00000b58 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, =0x0000ffff b @080CC1CA .align 2, 0 .pool @080CC198: ldr r1, [r2] lsls r2, r4, 1 ldr r5, =0x00000b58 adds r0, r1, r5 adds r0, r2 strh r3, [r0] ldr r0, =0x00000b08 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, =0x06010000 adds r1, r2 ldr r2, =0x04000080 bl CpuSet adds r0, r4, 0 @080CC1CA: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039d08 @080CC1EA: ldr r1, [r6] lsls r2, r3, 1 ldr r4, =0x00000b58 adds r0, r1, r4 adds r4, r0, r2 ldrh r0, [r4] cmp r0, r5 bne @080CC220 ldr r0, =0x00000b08 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 .pool @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, =gUnknown_085728D4 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, =gMonIconPaletteIndices adds r1, r6, r1 ldr r3, =0x0000dac0 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, =0x0000ffff 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, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 ldr r2, =0x000003ff ands r2, r5 ldrh r3, [r0, 0x4] ldr r1, =0xfffffc00 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 .pool @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, =sub_80CC370 movs r1, 0x2 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xC] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CC32C thumb_func_start sub_80CC35C sub_80CC35C: ; 80CC35C push {lr} ldr r0, =sub_80CC370 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x4 bhi @080CC454 lsls r0, 2 ldr r1, =@080CC39C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080CC39C: .4byte @080CC3B0 .4byte @080CC3E8 .4byte @080CC41C .4byte @080CC426 .4byte @080CC44C @080CC3B0: ldr r1, =0x02039d08 ldr r0, [r1] ldr r2, =0x000002d2 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, =0x00004ac4 adds r1, r0 movs r2, 0x80 lsls r2, 5 movs r0, 0 movs r3, 0x1 bl RequestDma3Fill strh r0, [r4, 0xA] b @080CC458 .align 2, 0 .pool @080CC3E8: movs r1, 0xA ldrsh r0, [r4, r1] bl CheckForSpaceForDma3Request lsls r0, 16 asrs r0, 16 movs r1, 0x1 negs r1, r1 cmp r0, r1 beq @080CC45E ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x00004ac4 adds r1, r2 movs r0, 0x2 bl bg_set_tilemap movs r0, 0x2 bl gpu_sync_bg_show b @080CC458 .align 2, 0 .pool @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, =0x00005b0a movs r0, 0xC bl lcd_io_set b @080CC458 .align 2, 0 .pool @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, =0x02039d08 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, =0x000002ce adds r0, r2, r7 strh r1, [r0] movs r1, 0x2 cmp r3, 0 ble @080CC49E movs r1, 0x1 @080CC49E: ldr r7, =0x000002d3 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, =0x000002d6 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, =0x000002da 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, =0x000002de 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, =0x00000a64 adds r0, r2, r4 mov r7, r8 strb r7, [r0] ldr r0, [r5] ldr r1, =0x00000a65 adds r0, r1 strb r6, [r0] ldr r0, [r5] ldr r3, =0x00000a63 adds r0, r3 movs r1, 0 strb r1, [r0] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CC464 thumb_func_start sub_80CC54C sub_80CC54C: ; 80CC54C push {r4-r6,lr} ldr r4, =0x02039d08 ldr r1, [r4] ldr r5, =0x00000a63 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 .pool @080CC570: cmp r0, 0x2 beq @080CC5E4 b @080CC624 @080CC576: ldr r2, =0x00000a64 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, =0x02039d08 ldr r1, [r6] ldr r4, =0x00000a64 adds r0, r1, r4 ldrb r0, [r0] ldr r5, =0x00000a65 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 .pool @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, =0x02039d08 ldr r1, [r0] ldr r4, =0x00000a63 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 .pool 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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000a62 adds r0, r1 movs r1, 0 strb r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CC680 thumb_func_start sub_80CC6B0 sub_80CC6B0: ; 80CC6B0 push {r4,lr} sub sp, 0x4 ldr r1, =0x02039d08 ldr r0, [r1] ldr r2, =0x00000a62 adds r0, r2 ldrb r0, [r0] adds r4, r1, 0 cmp r0, 0x4 bhi @080CC794 lsls r0, 2 ldr r1, =@080CC6DC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0000ffff str r1, [sp] movs r1, 0x1 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, [r4] ldr r2, =0x00000a62 adds r1, r2 b @080CC77E .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r4] movs r1, 0xE7 lsls r1, 3 adds r0, r1 ldr r0, [r0] ldr r1, =0x0000ffff str r1, [sp] movs r1, 0x1 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r1, [r4] ldr r2, =0x00000a62 adds r1, r2 b @080CC77E .align 2, 0 .pool @080CC76C: bl fade_and_return_progress_probably lsls r0, 24 cmp r0, 0 bne @080CC794 @080CC776: ldr r0, =0x02039d08 ldr r1, [r0] ldr r0, =0x00000a62 adds r1, r0 @080CC77E: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080CC794 .align 2, 0 .pool @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, =0x02039d08 ldr r2, [r4] ldr r3, =0x000006f9 adds r2, r3 movs r3, 0 strb r3, [r2] ldr r2, [r4] ldr r3, =0x000006fa adds r2, r3 strb r0, [r2] ldr r0, [r4] ldr r2, =0x000006fb 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, =0x000002d2 adds r2, r1, r0 ldrb r0, [r2] cmp r0, 0 bne @080CC7DA movs r3, 0x1 @080CC7DA: strb r3, [r2] ldr r0, [r4] ldr r1, =0x00004ac4 adds r0, r1 bl sub_80CCAE0 @080CC7E6: ldr r7, =0x02039d08 ldr r0, [r7] ldr r2, =0x000006fa 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, =gUnknown_085775B8 adds r6, r0, r1 ldr r0, [r6, 0x4] ldr r1, [r7] ldr r5, =0x00000792 adds r1, r5 bl LZ77UnCompWram ldr r0, [r7] adds r5, r0, r5 ldr r4, =0x000006fb adds r1, r0, r4 ldrb r1, [r1] lsls r1, 24 asrs r1, 24 ldr r3, =0x000002d2 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, =0x000002d2 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 .pool @080CC874: ldr r0, [r6, 0x8] ldr r2, =0x000002d2 adds r1, r2 ldrb r1, [r1] lsls r1, 6 ldr r2, =0x02037794 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, =0x02039d08 ldr r3, [r0] ldr r2, =0x00000a68 adds r0, r3, r2 str r1, [r0] ldr r2, [sp] lsls r2, 16 lsrs r2, 16 ldr r0, =0x000002d2 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 .pool @080CC8C4: bl sub_80D24A8 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 ldr r0, =gUnknown_0857AF44 adds r6, r1, r0 ldr r0, [r6, 0x4] ldr r1, [r7] ldr r4, =0x00000792 adds r1, r4 bl LZ77UnCompWram ldr r2, [r7] adds r0, r2, r4 ldr r5, =0x000006fb adds r1, r2, r5 ldrb r1, [r1] lsls r1, 24 asrs r1, 24 ldr r3, =0x000002d2 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, =0x00000794 adds r1, r2 movs r2, 0x2 bl CpuSet bl sub_80D2510 ldr r1, [r7] ldr r3, =0x000007b4 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, =0x000002d2 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 .pool @080CC960: ldr r2, =0x00000792 adds r0, r1, r2 ldr r3, =0x000002d2 adds r1, r3 ldrb r1, [r1] lsls r1, 6 ldr r2, =0x02037794 adds r1, r2 movs r2, 0x20 bl CpuSet @080CC976: ldr r0, [r6] mov r1, sp bl malloc_and_decompress ldr r6, =0x02039d08 ldr r1, [r6] ldr r5, =0x00000a68 adds r1, r5 str r0, [r1] ldr r4, =gUnknown_0857B004 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, =0x000002d2 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 .pool 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, =0x02039d08 ldr r0, [r5] ldr r1, =0x00000a68 adds r0, r1 ldr r0, [r0] cmp r0, 0 beq @080CCA2C bl free ldr r0, [r5] ldr r1, =0x00000a68 adds r0, r1 str r4, [r0] @080CCA2C: movs r0, 0x1 @080CCA2E: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039d08 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 .pool @080CCAB0: lsls r0, r6, 16 ldr r3, =0xfffc0000 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 .pool thumb_func_end sub_80CCA3C thumb_func_start sub_80CCAE0 sub_80CCAE0: ; 80CCAE0 push {r4-r6,lr} adds r2, r0, 0 ldr r0, =0x02039d08 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 .pool @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, =0xfffff7c0 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 .pool 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, =0x02039d08 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, =0x00030200 str r0, [r3, 0x4] ldr r4, =0x000006fc adds r1, r4 str r1, [sp, 0x14] add r0, sp, 0x18 ldr r7, =0x0000dac9 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, =gUnknown_08577574 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, =0x0000071a 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, =0x0000071c 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, =0x0000071e 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, =0x000021b8 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, =gUnknown_0857B0A8 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, =0x02039d08 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, =0x02020630 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 .pool 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, =0x02039d08 ldr r2, [r4] movs r1, 0xBE lsls r1, 2 adds r0, r2, r1 str r0, [sp, 0x1C] add r3, sp, 0x1C ldr r5, =0x0000ffff mov r12, r5 movs r6, 0xC0 lsls r6, 10 mov r9, r6 ldr r0, =0x00030200 str r0, [r3, 0x4] add r1, sp, 0x4 ldr r0, =gUnknown_0857B0A8 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, =0x0000071c adds r0, r5 ldrh r0, [r0] mov r9, r0 b @080CCDB0 .align 2, 0 .pool @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, =0x0000071c adds r0, r3 ldrh r0, [r0] mov r9, r0 add r1, sp, 0x4 movs r0, 0x4 strh r0, [r1] ldr r0, =0x0000dac9 strh r0, [r1, 0x2] @080CCDB0: mov r5, r8 ldr r4, [r5] ldr r5, =0x000021b8 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, =gUnknown_08577574 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, =0x02020630 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, =sub_80CCF30 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, =sub_80CCF64 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 .pool thumb_func_end sub_80CCCFC thumb_func_start sub_80CCEE0 sub_80CCEE0: ; 80CCEE0 push {lr} ldr r0, =0x02039d08 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 .pool @080CCF00: movs r0, 0x3 bl gpu_tile_obj_free_by_tag @080CCF06: ldr r0, =0x02039d08 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, =0x00000724 adds r1, r0, r2 adds r3, 0x4 adds r0, r3 ldr r0, [r0] str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =nullsub_12 str r0, [r2, 0x1C] @080CCF5C: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 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, =gUnknown_08577574 adds r0, r1 adds r3, 0x24 adds r1, r2, r3 ldrh r1, [r1] lsls r1, 1 ldr r2, =0x02037714 adds r1, r2 movs r2, 0x2 bl CpuSet b @080CCFFC .align 2, 0 .pool @080CCFE4: lsls r0, r1, 2 ldr r1, =gUnknown_08577574 adds r0, r1 ldr r3, =0x0000071e adds r1, r2, r3 ldrh r1, [r1] lsls r1, 1 ldr r2, =0x02037714 adds r1, r2 movs r2, 0x2 bl CpuSet @080CCFFC: pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0857B080 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, =gUnknown_0857B0E0 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, =0x02020630 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, =0x02039d08 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 .pool 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, =0x02039d08 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, =0x00000734 adds r1, r0 ldr r2, [r1] movs r0, 0x5 strh r0, [r2, 0x30] ldr r0, [r3] movs r2, 0x48 b @080CD130 .align 2, 0 .pool @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, =0x00000734 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, =0x00000734 adds r1, r0 ldr r1, [r1] movs r0, 0x1 strh r0, [r1, 0x3C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 @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 .pool 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, =0x02039d08 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 .pool @080CD1E4: movs r2, 0 ldr r5, =0x02039d08 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 .pool 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, =@080CD22C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d08 ldr r1, [r0] ldr r0, =0x000002ce 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 .pool @080CD2CC: ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x000002ce 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 .pool 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, =gUnknown_0857B0E0 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, =0x02020630 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, =nullsub_12 str r0, [r4] adds r0, r6, 0 b @080CD362 .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r0] ldrb r1, [r0, 0x1] cmp r1, 0x1 beq @080CD388 ldr r1, =0x02039d78 movs r0, 0 strb r0, [r1] b @080CD38C .align 2, 0 .pool @080CD388: ldr r0, =0x02039d78 strb r1, [r0] @080CD38C: ldr r0, =0x02039d79 movs r1, 0 strb r1, [r0] ldr r0, =0x02039d7a strb r1, [r0] ldr r0, =0x02039d7b strb r1, [r0] ldr r0, =0x02039d7c strb r1, [r0] ldr r0, =0x02039d7d strb r1, [r0] bl sub_80CDC0C bl sub_80CFC14 ldr r2, =0x02039d08 ldr r0, [r2] ldr r1, =0x00000cd6 adds r0, r1 movs r3, 0 movs r1, 0x1 strb r1, [r0] ldr r0, [r2] ldr r1, =0x000021ff adds r0, r1 strb r3, [r0] bl sub_80CEB40 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CD36C thumb_func_start sub_80CD3EC sub_80CD3EC: ; 80CD3EC push {lr} bl sub_80CFC14 bl sub_80CEBDC ldr r3, =0x02039d08 ldr r0, [r3] ldr r1, =0x00000cd6 adds r0, r1 movs r2, 0 movs r1, 0x1 strb r1, [r0] ldr r0, [r3] ldr r1, =0x000021ff adds r0, r1 strb r2, [r0] ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CD426 ldr r0, [r3] ldr r1, =0x000020a4 adds r0, r1 ldr r1, =0x02039d14 movs r2, 0x64 bl memcpy bl sub_80CAFC4 @080CD426: pop {r0} bx r0 .align 2, 0 .pool 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, =@080CD464 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d7a 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 .pool @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, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 beq @080CD538 cmp r0, 0x1 bne @080CD54C ldr r0, =0x02039d79 movs r1, 0 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr b @080CD542 .align 2, 0 .pool @080CD538: ldr r0, =0x02039d79 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 .pool @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, =0x02039d08 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 .pool @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, =0x00000cbc adds r4, r5, r1 ldr r2, =0x00000cc4 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, =0x00000cb4 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, =0xffffff00 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, =0x00000cd7 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 .pool @080CD67C: ldr r3, =0x00000cb4 adds r2, r5, r3 ldr r1, [r2] ldr r4, =0x00000ccc adds r0, r5, r4 ldrh r0, [r0] strh r0, [r1, 0x20] ldr r1, [r2] ldr r2, =0x00000cce 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 .pool 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, =0x02039d08 ldr r0, [r1] ldr r2, =0x00000cd4 adds r0, r2 strb r4, [r0] ldr r0, [r1] ldr r3, =0x00000cd5 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, =0x00000cce adds r1, r2 strh r0, [r1] add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CD6AC thumb_func_start sub_80CD70C sub_80CD70C: ; 80CD70C push {r4-r7,lr} ldr r0, =0x02039d08 ldr r2, [r0] ldr r3, =0x00000cd2 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 .pool @080CD730: movs r3, 0xCD lsls r3, 4 adds r1, r2, r3 movs r0, 0x6 @080CD738: strh r0, [r1] ldr r1, [r4] ldr r0, =0x00000cd7 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, =0x00000cd2 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, =0x00000cce adds r0, r2, r3 movs r3, 0 ldrsh r1, [r0, r3] ldr r3, =0x00000cb4 adds r0, r2, r3 ldr r0, [r0] movs r2, 0x22 ldrsh r0, [r0, r2] b @080CD7C0 .align 2, 0 .pool @080CD78C: ldr r3, =0x00000cce adds r0, r2, r3 movs r3, 0 ldrsh r1, [r0, r3] ldr r3, =0x00000cb4 adds r0, r2, r3 ldr r0, [r0] movs r2, 0x22 ldrsh r0, [r0, r2] adds r0, 0xC0 b @080CD7C0 .align 2, 0 .pool @080CD7AC: ldr r3, =0x00000cce adds r0, r2, r3 movs r3, 0 ldrsh r1, [r0, r3] ldr r3, =0x00000cb4 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, =0x00000cd3 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, =0x00000ccc adds r0, r2, r1 movs r3, 0 ldrsh r1, [r0, r3] ldr r3, =0x00000cb4 adds r0, r2, r3 ldr r0, [r0] movs r2, 0x20 ldrsh r0, [r0, r2] b @080CD830 .align 2, 0 .pool @080CD7FC: ldr r3, =0x00000ccc adds r0, r2, r3 movs r3, 0 ldrsh r1, [r0, r3] ldr r3, =0x00000cb4 adds r0, r2, r3 ldr r0, [r0] movs r2, 0x20 ldrsh r0, [r0, r2] adds r0, 0xC0 b @080CD830 .align 2, 0 .pool @080CD81C: ldr r3, =0x00000ccc adds r0, r2, r3 movs r3, 0 ldrsh r1, [r0, r3] ldr r3, =0x00000cb4 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, =0x00000cc4 adds r6, r4, r3 movs r1, 0xCD lsls r1, 4 adds r5, r4, r1 ldrh r1, [r5] bl __divsi3 str r0, [r6] ldr r2, =0x00000cc8 adds r6, r4, r2 ldrh r1, [r5] adds r0, r7, 0 bl __divsi3 str r0, [r6] ldr r3, =0x00000cbc adds r2, r4, r3 ldr r0, =0x00000cb4 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 .pool 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, =0x02039d08 ldr r1, [r5] ldrb r0, [r1, 0x1] cmp r0, 0x3 beq @080CD8E4 ldr r2, =0x000021ff adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 bne @080CD8FC ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 bne @080CD8FC ldr r2, =0x00000cb4 adds r0, r1, r2 ldr r0, [r0] movs r1, 0x1 bl obj_anim_image_start b @080CD8FC .align 2, 0 .pool @080CD8E4: bl sub_80D127C lsls r0, 24 cmp r0, 0 bne @080CD8FC ldr r0, [r5] ldr r1, =0x00000cb4 adds r0, r1 ldr r0, [r0] movs r1, 0x1 bl obj_anim_image_start @080CD8FC: ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x3 bne @080CD95C ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 bne @080CD930 ldr r0, =0x02039d79 ldrb r1, [r0] movs r0, 0 bl sub_80D0E50 b @080CD93E .align 2, 0 .pool @080CD930: cmp r0, 0x1 bne @080CD93E ldr r0, =0x02039d79 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 .pool @080CD950: cmp r4, 0x1 bne @080CD988 movs r0, 0x1 adds r1, r6, 0 bl sub_80D0D8C @080CD95C: cmp r4, 0x1 bne @080CD988 ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0x1 beq @080CD988 ldr r1, =0x02039d08 ldr r0, [r1] ldr r2, =0x00000cd6 adds r0, r2 strb r4, [r0] ldr r0, [r1] ldr r1, =0x00000cb8 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, =0x02039d08 ldr r0, [r5] ldr r2, =0x00000cb4 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, =0x00000cb8 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 .pool @080CD9E4: ldr r3, =0x02039d08 ldr r1, [r3] ldr r2, =0x000021ff adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080CDA28 ldr r2, =0x00000cb4 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, =0x00000cb8 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 .pool @080CDA28: ldr r2, =0x00000cb4 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, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 bne @080CDA56 ldr r0, =0x02039d7a 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 .pool thumb_func_end sub_80CD894 thumb_func_start sub_80CDA68 sub_80CDA68: ; 80CDA68 push {r4,lr} ldr r1, =0x02039d78 ldr r4, =0x02039d08 ldr r2, [r4] ldr r3, =0x00000cd4 adds r0, r2, r3 ldrb r0, [r0] strb r0, [r1] ldr r1, =0x02039d79 adds r3, 0x1 adds r0, r2, r3 ldrb r0, [r0] strb r0, [r1] ldrb r0, [r2, 0x1] cmp r0, 0x3 beq @080CDAC0 ldr r1, =0x000021ff adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0 bne @080CDAD8 ldr r0, =0x02039d7a 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 .pool @080CDAC0: bl sub_80D127C lsls r0, 24 cmp r0, 0 bne @080CDAD8 ldr r0, [r4] ldr r1, =0x00000cb4 adds r0, r1 ldr r0, [r0] movs r1, 0 bl obj_anim_image_start @080CDAD8: bl sub_80CEB40 ldr r0, =0x02039d78 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 .pool @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, =0x02039d08 ldr r0, [r0] ldr r2, =0x00000cb8 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 .pool @080CDB30: ldr r4, =0x02039d08 ldr r1, [r4] ldr r3, =0x000021ff adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @080CDB8A ldr r2, =0x00000cb4 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, =0x00000cb8 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 .pool thumb_func_end sub_80CDA68 thumb_func_start sub_80CDBA0 sub_80CDBA0: ; 80CDBA0 push {lr} ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 bne @080CDBB4 movs r3, 0 b @080CDBC2 .align 2, 0 .pool @080CDBB4: bl calc_player_party_count lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x5 bls @080CDBC2 movs r3, 0x5 @080CDBC2: ldr r0, =0x02039d08 ldr r2, [r0] ldr r1, =0x00000cb4 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, =0x00000cd7 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 .pool 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, =0x02039d7e movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80CDC0C thumb_func_start sub_80CDC18 sub_80CDC18: ; 80CDC18 ldr r0, =0x02039d7e ldr r1, =0x02039d79 ldrb r1, [r1] strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80CDC18 thumb_func_start sub_80CDC2C sub_80CDC2C: ; 80CDC2C ldr r0, =0x02039d7e ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80CDC2C thumb_func_start sub_80CDC38 sub_80CDC38: ; 80CDC38 lsls r0, 24 ldr r1, =0x02039d08 ldr r1, [r1] ldr r2, =0x00000d8c adds r3, r1, r2 ldr r2, =gUnknown_0857B998 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 .pool 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, =0x02039d08 ldr r1, [r0] ldr r2, =0x00000d8c adds r1, r2 ldr r2, =sub_80CDEB4 b @080CDC8E .align 2, 0 .pool @080CDC84: ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x00000d8c adds r1, r2 ldr r2, =sub_80CDEC4 @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 .pool thumb_func_end sub_80CDC64 thumb_func_start sub_80CDCAC sub_80CDCAC: ; 80CDCAC push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000d8c adds r0, r1 ldr r0, [r0] bl _call_via_r0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80CDCAC thumb_func_start sub_80CDCCC sub_80CDCCC: ; 80CDCCC push {r4,r5,lr} ldr r4, =0x02039d08 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 .pool @080CDCEC: cmp r0, 0x2 beq @080CDD40 cmp r0, 0x3 beq @080CDCFE b @080CDD54 @080CDCF6: ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CDD08 @080CDCFE: movs r0, 0 b @080CDD56 .align 2, 0 .pool @080CDD08: ldr r2, =0x00000cb4 adds r0, r1, r2 ldr r0, [r0] movs r1, 0x2 bl obj_anim_image_start b @080CDD4A .align 2, 0 .pool @080CDD1C: bl sub_80CDED4 lsls r0, 24 cmp r0, 0 bne @080CDD54 ldr r0, [r4] ldr r1, =0x00000cb4 adds r0, r1 ldr r0, [r0] movs r1, 0x3 bl obj_anim_image_start bl sub_80CDF38 b @080CDD4A .align 2, 0 .pool @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, =0x02039d08 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 .pool @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, =0x00000cb4 adds r0, r1 ldr r0, [r0] movs r1, 0x2 bl obj_anim_image_start bl sub_80CDFAC b @080CDDBC .align 2, 0 .pool @080CDDA4: bl sub_80CDF08 lsls r0, 24 cmp r0, 0 bne @080CDDD0 ldr r0, [r4] ldr r1, =0x00000cb4 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 .pool @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, =0x02039d08 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 .pool @080CDDF8: cmp r0, 0x2 beq @080CDEA8 b @080CDEAC @080CDDFE: ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 beq @080CDE20 cmp r0, 0x1 bne @080CDEA8 ldr r0, =0x00000d91 adds r1, r0 movs r0, 0xE b @080CDE2A .align 2, 0 .pool @080CDE20: bl get_preferred_box ldr r1, [r4] ldr r2, =0x00000d91 adds r1, r2 @080CDE2A: strb r0, [r1] ldr r4, =0x02039d08 ldr r0, [r4] ldr r1, =0x00000cb4 adds r0, r1 ldr r0, [r0] movs r1, 0x2 bl obj_anim_image_start ldr r0, [r4] ldr r2, =0x00000d91 adds r0, r2 ldrb r0, [r0] ldr r1, =0x02039d79 ldrb r1, [r1] bl sub_80CBD5C ldr r1, [r4] movs r0, 0xD9 lsls r0, 4 adds r1, r0 b @080CDE94 .align 2, 0 .pool @080CDE68: bl sub_80CBDC4 lsls r0, 24 cmp r0, 0 bne @080CDEAC ldr r0, [r4] ldr r1, =0x00000cb4 adds r0, r1 ldr r0, [r0] movs r1, 0x3 bl obj_anim_image_start ldr r0, [r4] ldr r2, =0x00000d91 adds r0, r2 ldrb r0, [r0] ldr r1, =0x02039d79 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 .pool @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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000cb4 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 .pool @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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000cb4 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 .pool @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, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 beq @080CDF68 cmp r0, 0x1 bne @080CDF94 ldr r4, =0x02039d79 ldrb r1, [r4] movs r0, 0xE bl sub_80CE018 ldrb r1, [r4] movs r0, 0 bl sub_80CBC14 b @080CDF8E .align 2, 0 .pool @080CDF68: ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x000021ff adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080CDF8E bl get_preferred_box lsls r0, 24 lsrs r0, 24 ldr r4, =0x02039d79 ldrb r1, [r4] bl sub_80CE018 ldrb r1, [r4] movs r0, 0x1 bl sub_80CBC14 @080CDF8E: ldr r1, =0x02039d7a movs r0, 0x1 strb r0, [r1] @080CDF94: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CDF38 thumb_func_start sub_80CDFAC sub_80CDFAC: ; 80CDFAC push {r4,r5,lr} ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 beq @080CDFDC cmp r0, 0x1 bne @080CDFFE ldr r4, =0x02039d79 ldrb r1, [r4] movs r0, 0xE bl diegohint2 ldrb r1, [r4] movs r0, 0xE bl sub_80CBCAC b @080CDFF8 .align 2, 0 .pool @080CDFDC: bl get_preferred_box adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r5, =0x02039d79 ldrb r1, [r5] adds r0, r4, 0 bl diegohint2 ldrb r1, [r5] adds r0, r4, 0 bl sub_80CBCAC @080CDFF8: ldr r1, =0x02039d7a movs r0, 0 strb r0, [r1] @080CDFFE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r0, [r0] ldr r1, =0x000020a4 adds r0, r1 ldr r3, =0x020244ec ldr r1, =0x02039d79 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 .pool @080CE054: ldr r0, =0x02039d08 ldr r2, [r0] ldr r0, =0x000020a4 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, =0x02039d7b strb r4, [r0] ldr r0, =0x02039d7c strb r5, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec movs r0, 0x64 muls r0, r7 adds r0, r1 ldr r1, =0x02039d08 ldr r1, [r1] ldr r2, =0x000020a4 adds r1, r2 movs r2, 0x64 bl memcpy b @080CE0D8 .align 2, 0 .pool @080CE0C0: ldr r5, =0x02039d08 ldr r0, [r5] ldr r4, =0x000020a4 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 .pool 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, =0x020244ec adds r0, r1 bl zero_pokemon_struct b @080CE10C .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00002108 adds r0, r1 ldr r2, =0x020244ec movs r1, 0x64 muls r1, r7 adds r1, r2 movs r2, 0x64 bl memcpy b @080CE154 .align 2, 0 .pool @080CE144: ldr r0, =0x02039d08 ldr r2, [r0] ldr r0, =0x00002108 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, =0x02039d08 ldr r1, [r5] ldr r4, =0x000020a4 adds r0, r1, r4 ldr r2, =0x00002108 adds r1, r2 movs r2, 0x64 bl memcpy ldr r0, [r5] adds r0, r4 movs r1, 0 bl sub_80CEC00 ldr r0, =0x02039d7b strb r6, [r0] ldr r0, =0x02039d7c strb r7, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d7a 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 .pool @080CE1DC: ldr r5, =0x02039d79 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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000cb4 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 .pool thumb_func_end sub_80CE19C thumb_func_start sub_80CE22C sub_80CE22C: ; 80CE22C push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000cb4 adds r0, r1 ldr r0, [r0] movs r1, 0 bl obj_anim_image_start bl sub_80CEB40 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CE22C thumb_func_start sub_80CE250 sub_80CE250: ; 80CE250 push {lr} ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CE264 movs r2, 0x2 b @080CE274 .align 2, 0 .pool @080CE264: ldr r0, =0x02039d78 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, =0x02039d79 ldrb r1, [r0] adds r0, r2, 0 bl sub_80CBF14 ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x000021e0 adds r0, r1, r2 ldr r2, =0x00000cee adds r1, r2 bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000cb4 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 .pool thumb_func_end sub_80CE2A8 thumb_func_start sub_80CE2D8 sub_80CE2D8: ; 80CE2D8 push {lr} bl sub_80CC020 ldr r1, =0x02039d7a ldrb r0, [r1] cmp r0, 0 beq @080CE2F0 movs r0, 0 strb r0, [r1] b @080CE316 .align 2, 0 .pool @080CE2F0: ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0x1 bne @080CE304 movs r2, 0xE b @080CE30C .align 2, 0 .pool @080CE304: bl get_preferred_box lsls r0, 24 lsrs r2, r0, 24 @080CE30C: ldr r0, =0x02039d79 ldrb r1, [r0] adds r0, r2, 0 bl sub_80CE0E8 @080CE316: bl sub_80CEB40 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CE2D8 thumb_func_start sub_80CE324 sub_80CE324: ; 80CE324 push {lr} ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CE33E ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000cb4 adds r0, r1 ldr r0, [r0] movs r1, 0x3 bl obj_anim_image_start @080CE33E: pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0857B9A4 @080CE358: movs r1, 0 ldrsb r1, [r4, r1] cmp r1, 0x22 beq @080CE378 ldr r0, =0x03005d8c 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, =0x00000163 adds r0, r1, 0 strh r0, [r3] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r0, [r2] ldr r1, =0x0000216d adds r0, r1 movs r1, 0x1 strb r1, [r0] ldr r0, [r2] ldr r2, =0x0000216c adds r0, r2 strb r3, [r0] b @080CE504 .align 2, 0 .pool @080CE3D0: ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CE418 ldr r4, =0x02039d08 ldr r1, [r4] ldr r3, =0x00002108 adds r0, r1, r3 ldr r2, =0x000020a4 adds r1, r2 movs r2, 0x64 bl memcpy ldr r0, [r4] ldr r3, =0x00002170 adds r0, r3 movs r1, 0xFF strb r1, [r0] ldr r0, [r4] ldr r1, =0x00002171 adds r0, r1 movs r1, 0x1 negs r1, r1 b @080CE494 .align 2, 0 .pool @080CE418: ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0x1 bne @080CE464 ldr r4, =0x02039d08 ldr r0, [r4] ldr r2, =0x00002108 adds r0, r2 ldr r3, =0x020244ec ldr r1, =0x02039d79 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, =0x00002170 adds r0, r3 movs r1, 0xE strb r1, [r0] b @080CE488 .align 2, 0 .pool @080CE464: bl get_preferred_box lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039d79 ldrb r1, [r1] ldr r4, =0x02039d08 ldr r2, [r4] ldr r3, =0x00002108 adds r2, r3 bl sub_80D2054 bl get_preferred_box ldr r1, [r4] ldr r2, =0x00002170 adds r1, r2 strb r0, [r1] @080CE488: ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x02039d79 ldrb r1, [r1] ldr r3, =0x00002171 adds r0, r3 @080CE494: strb r1, [r0] ldr r5, =0x02039d08 ldr r0, [r5] ldr r4, =0x00002176 adds r0, r4 bl sub_80CE350 ldr r2, [r5] ldr r1, =0x00002108 adds r0, r2, r1 adds r2, r4 movs r1, 0x51 bl pokemon_getattr ldr r2, [r5] ldr r3, =0x00002174 adds r1, r2, r3 strh r0, [r1] lsls r0, 16 cmp r0, 0 beq @080CE4E8 ldr r0, =0x0000216d adds r1, r2, r0 movs r0, 0 strb r0, [r1] b @080CE4F8 .align 2, 0 .pool @080CE4E8: ldr r1, =0x0000216d adds r0, r2, r1 movs r1, 0x1 strb r1, [r0] ldr r0, [r5] ldr r2, =0x0000216c adds r0, r2 strb r1, [r0] @080CE4F8: ldr r0, =0x02039d08 ldr r0, [r0] ldr r3, =0x00002172 adds r0, r3 movs r1, 0 strh r1, [r0] @080CE504: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CE3A0 thumb_func_start sub_80CE51C sub_80CE51C: ; 80CE51C push {r4-r6,lr} ldr r0, =0x02039d7a 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, =0x020244ec 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 .pool @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, =0x02039d08 ldr r2, [r0] ldr r3, =0x0000216d adds r1, r2, r3 ldrb r1, [r1] adds r5, r0, 0 cmp r1, 0 beq @080CE5B0 ldr r1, =0x0000216c adds r0, r2, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 b @080CE736 .align 2, 0 .pool @080CE5B0: ldr r3, =0x00002172 adds r0, r2, r3 ldrh r0, [r0] cmp r0, 0 beq @080CE5C4 cmp r0, 0x1 beq @080CE690 b @080CE732 .align 2, 0 .pool @080CE5C4: movs r6, 0 @080CE5C6: ldr r2, [r5] ldr r1, =0x00002170 adds r0, r2, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0xE bne @080CE5E4 ldr r3, =0x00002171 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, =0x020244ec adds r0, r1 ldr r1, =0x00002176 adds r2, r1 movs r1, 0x51 bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 ldr r1, [r5] ldr r2, =0x00002174 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, =0x02039d08 ldr r1, [r2] ldr r3, =0x00002174 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, =0x0000216c adds r0, r2 strb r1, [r0] b @080CE732 .align 2, 0 .pool @080CE64C: ldr r3, =0x0000216e 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, =0x00002172 adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @080CE732 .align 2, 0 .pool @080CE674: ldr r1, =0x0000216d adds r0, r5, r1 movs r1, 0x1 strb r1, [r0] mov r2, r8 ldr r0, [r2] ldr r3, =0x0000216c adds r0, r3 strb r1, [r0] b @080CE732 .align 2, 0 .pool @080CE690: movs r6, 0 mov r8, r5 ldr r7, =0x0000ffff @080CE696: mov r0, r8 ldr r3, [r0] ldr r1, =0x0000216e adds r0, r3, r1 ldrb r0, [r0] ldr r2, =0x0000216f 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, =0x00002170 adds r0, r5, r3 ldrh r2, [r0] ldr r1, =0x0000216e 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, =0x00002174 adds r1, r5, r2 ldrh r0, [r1] bics r0, r4 strh r0, [r1] cmp r0, 0 beq @080CE674 @080CE6E0: ldr r2, =0x02039d08 ldr r1, [r2] ldr r3, =0x0000216f 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, =0x0000216f adds r0, r1 strb r3, [r0] ldr r1, [r2] ldr r0, =0x0000216e 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, =0x0000216d adds r0, r1 movs r1, 0x1 strb r1, [r0] ldr r0, [r2] ldr r2, =0x0000216c 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 .pool thumb_func_end sub_80CE580 thumb_func_start sub_80CE760 sub_80CE760: ; 80CE760 push {lr} ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CE77A ldr r0, =0x02039d14 ldr r1, =0x02039d08 ldr r1, [r1] ldr r2, =0x000020a4 adds r1, r2 movs r2, 0x64 bl memcpy @080CE77A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CE760 thumb_func_start sub_80CE790 sub_80CE790: ; 80CE790 push {lr} ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CE7D8 ldr r0, =0x02039d7b ldrb r0, [r0] cmp r0, 0xE bne @080CE7C8 ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x000020a4 adds r0, r1 ldr r1, =0x02039d14 movs r2, 0x64 bl memcpy b @080CE7D8 .align 2, 0 .pool @080CE7C8: ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x000020a4 adds r0, r1 ldr r1, =0x02039d14 movs r2, 0x50 bl memcpy @080CE7D8: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CE790 thumb_func_start sub_80CE7E8 sub_80CE7E8: ; 80CE7E8 push {r4,r5,lr} ldr r0, =0x02039d7a ldrb r5, [r0] cmp r5, 0 beq @080CE838 bl sub_80CE760 ldr r3, =0x02039d08 ldr r1, [r3] ldr r0, =0x0000218c adds r2, r1, r0 ldr r0, =0x02039d14 str r0, [r2] ldr r2, =0x00002187 adds r1, r2 movs r2, 0 strb r2, [r1] ldr r0, [r3] ldr r4, =0x00002186 adds r0, r4 strb r2, [r0] ldr r0, [r3] ldr r1, =0x00002188 adds r0, r1 strb r2, [r0] b @080CE8CA .align 2, 0 .pool @080CE838: ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0x1 bne @080CE894 ldr r4, =0x02039d08 ldr r1, [r4] ldr r0, =0x0000218c adds r2, r1, r0 ldr r0, =0x020244ec str r0, [r2] ldr r0, =0x02039d79 ldrb r0, [r0] ldr r2, =0x00002187 adds r1, r2 strb r0, [r1] bl sub_80C70C4 ldr r1, [r4] subs r0, 0x1 ldr r2, =0x00002186 adds r1, r2 strb r0, [r1] ldr r0, [r4] ldr r4, =0x00002188 adds r0, r4 strb r5, [r0] b @080CE8CA .align 2, 0 .pool @080CE894: bl get_preferred_box lsls r0, 24 lsrs r0, 24 movs r1, 0 bl get_pokemon_by_box_and_pos ldr r3, =0x02039d08 ldr r2, [r3] ldr r4, =0x0000218c adds r1, r2, r4 str r0, [r1] ldr r0, =0x02039d79 ldrb r0, [r0] ldr r1, =0x00002187 adds r2, r1 strb r0, [r2] ldr r0, [r3] ldr r2, =0x00002186 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 .pool thumb_func_end sub_80CE7E8 thumb_func_start sub_80CE8E4 sub_80CE8E4: ; 80CE8E4 push {lr} ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CE8F8 bl sub_80CE790 b @080CE900 .align 2, 0 .pool @080CE8F8: ldr r0, =0x02039d79 ldr r1, =0x0203cf20 ldrb r1, [r1] strb r1, [r0] @080CE900: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff movs r6, 0 movs r5, 0 movs r0, 0x64 mov r9, r0 ldr r1, =0x020244ec 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 .pool @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, =0x020244ec @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 .pool 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, =0x02039d08 ldr r1, [r2] ldr r3, =0x00000ceb adds r1, r3 strb r0, [r1] ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CE9E8 ldr r0, [r2] ldr r1, =0x000020a4 adds r0, r1 movs r1, 0x8 mov r2, sp bl pokemon_setattr b @080CEA1C .align 2, 0 .pool @080CE9E8: ldr r4, =0x02039d78 movs r0, 0 ldrsb r0, [r4, r0] cmp r0, 0x1 bne @080CEA08 ldr r0, =0x02039d79 movs r1, 0 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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, =0x02039d79 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 .pool thumb_func_end sub_80CE9A8 thumb_func_start sub_80CEA30 sub_80CEA30: ; 80CEA30 push {lr} ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0x1 bne @080CEA64 ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 bne @080CEA64 ldr r0, =0x02039d79 ldrb r0, [r0] bl sub_80C7050 lsls r0, 24 cmp r0, 0 bne @080CEA64 movs r0, 0x1 b @080CEA66 .align 2, 0 .pool @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, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CEAC8 ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0x1 bne @080CEAAC ldr r0, =0x02039d79 ldrb r0, [r0] bl sub_80C7050 lsls r0, 24 cmp r0, 0 bne @080CEAAC ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x00000ced adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 bne @080CEAC8 ldr r2, =0x000020a4 adds r0, r1, r2 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @080CEAC8 @080CEAAC: movs r0, 0x1 b @080CEACA .align 2, 0 .pool @080CEAC8: movs r0, 0 @080CEACA: pop {r1} bx r1 thumb_func_end sub_80CEA6C thumb_func_start sub_80CEAD0 sub_80CEAD0: ; 80CEAD0 ldr r0, =0x02039d7a ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80CEAD0 thumb_func_start sub_80CEADC sub_80CEADC: ; 80CEADC push {lr} movs r1, 0 ldr r0, =0x02039d78 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 .pool thumb_func_end sub_80CEADC thumb_func_start sub_80CEAF8 sub_80CEAF8: ; 80CEAF8 push {lr} movs r1, 0 ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0x3 bne @080CEB16 ldr r0, =0x02039d79 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 .pool thumb_func_end sub_80CEAF8 thumb_func_start sub_80CEB24 sub_80CEB24: ; 80CEB24 push {lr} movs r1, 0 ldr r0, =0x02039d78 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 .pool thumb_func_end sub_80CEB24 thumb_func_start sub_80CEB40 sub_80CEB40: ; 80CEB40 push {r4,lr} ldr r0, =0x02039d08 ldr r1, [r0] movs r2, 0 ldr r3, =0x02039d7a ldrb r0, [r3] cmp r0, 0 bne @080CEB52 movs r2, 0x1 @080CEB52: ldr r4, =0x00000cea adds r0, r1, r4 strb r2, [r0] ldrb r0, [r3] cmp r0, 0 bne @080CEBD0 ldr r0, =0x02039d78 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 .pool @080CEB84: cmp r0, 0x3 bgt @080CEBD0 b @080CEBB0 @080CEB8A: ldr r1, =0x02039d79 movs r0, 0 ldrsb r0, [r1, r0] cmp r0, 0x5 bgt @080CEBB0 adds r1, r0, 0 movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0 bl sub_80CEC00 b @080CEBD0 .align 2, 0 .pool @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, =0x02039d79 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 .pool thumb_func_end sub_80CEB40 thumb_func_start sub_80CEBDC sub_80CEBDC: ; 80CEBDC push {lr} ldr r0, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CEBF8 ldr r0, =0x02039d14 movs r1, 0 bl sub_80CEC00 b @080CEBFC .align 2, 0 .pool @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, =0x02039d08 mov r8, r0 ldr r1, [r0] ldr r3, =0x00000ce6 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, =0x00000ce4 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, =0x00000ced adds r0, r2 movs r1, 0x1 strb r1, [r0] b @080CEC86 .align 2, 0 .pool @080CEC74: adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr mov r3, r8 ldr r1, [r3] ldr r2, =0x00000ced adds r1, r2 strb r0, [r1] @080CEC86: ldr r4, =0x02039d08 ldr r2, [r4] ldr r5, =0x00000cee 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, =0x00000cec adds r1, r3 strb r0, [r1] adds r0, r6, 0 movs r1, 0x8 bl pokemon_getattr ldr r1, [r4] ldr r2, =0x00000ceb 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, =0x00000cdc 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, =0x00000ce6 adds r1, r3 strh r0, [r1] b @080CEE26 .align 2, 0 .pool @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, =0x00000ce4 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, =0x00000ced adds r0, r2 strb r5, [r0] b @080CED7E .align 2, 0 .pool @080CED6C: adds r0, r7, 0 movs r1, 0x2D bl pokemon_getattr_encrypted mov r3, r8 ldr r1, [r3] ldr r2, =0x00000ced adds r1, r2 strb r0, [r1] @080CED7E: ldr r5, =0x02039d08 ldr r2, [r5] ldr r4, =0x00000cee 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, =0x00000cec adds r1, r3 strb r0, [r1] adds r0, r7, 0 movs r1, 0x8 bl pokemon_getattr_encrypted ldr r1, [r5] ldr r2, =0x00000ceb 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, =0x00000cdc 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, =0x00000ce6 adds r1, r2 strh r0, [r1] b @080CEE26 .align 2, 0 .pool @080CEE1C: ldr r3, =0x00000ce4 adds r0, r1, r3 mov r1, r9 strh r1, [r0] strh r1, [r2] @080CEE26: ldr r0, =0x02039d08 ldr r1, [r0] ldr r2, =0x00000ce4 adds r0, r1, r2 ldrh r2, [r0] cmp r2, 0 bne @080CEE94 @080CEE34: ldr r4, =0x02039d08 ldr r0, [r4] ldr r3, =0x00000cee adds r0, r3 movs r1, 0 movs r2, 0x5 bl RepeatChar ldr r0, [r4] ldr r1, =0x00000cf9 adds r0, r1 movs r1, 0 movs r2, 0x8 bl RepeatChar ldr r0, [r4] ldr r2, =0x00000d1d adds r0, r2 movs r1, 0 movs r2, 0x8 bl RepeatChar ldr r0, [r4] ldr r3, =0x00000d41 adds r0, r3 movs r1, 0 movs r2, 0x8 bl RepeatChar ldr r0, [r4] ldr r1, =0x00000d65 adds r0, r1 b @080CEEF2 .align 2, 0 .pool @080CEE94: ldr r3, =0x00000ced adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 beq @080CEF14 mov r0, r10 cmp r0, 0 beq @080CEEC0 ldr r2, =0x00000cf9 adds r0, r1, r2 adds r3, 0x1 adds r1, r3 movs r2, 0 movs r3, 0x5 bl sub_8009128 b @080CEECE .align 2, 0 .pool @080CEEC0: ldr r2, =0x00000cf9 adds r0, r1, r2 ldr r1, =gUnknown_085E8264 movs r2, 0 movs r3, 0x8 bl sub_8009128 @080CEECE: ldr r4, =0x02039d08 ldr r0, [r4] ldr r3, =0x00000d1d adds r0, r3 movs r1, 0 movs r2, 0x8 bl RepeatChar ldr r0, [r4] ldr r1, =0x00000d41 adds r0, r1 movs r1, 0 movs r2, 0x8 bl RepeatChar ldr r0, [r4] ldr r2, =0x00000d65 adds r0, r2 @080CEEF2: movs r1, 0 movs r2, 0x8 bl RepeatChar b @080CF0B8 .align 2, 0 .pool @080CEF14: cmp r2, 0x1D beq @080CEF1C cmp r2, 0x20 bne @080CEF20 @080CEF1C: movs r3, 0xFF mov r9, r3 @080CEF20: ldr r4, =0x02039d08 ldr r1, [r4] ldr r2, =0x00000cf9 adds r0, r1, r2 ldr r3, =0x00000cee adds r1, r3 movs r2, 0 movs r3, 0x5 bl sub_8009128 ldr r1, [r4] ldr r0, =0x00000d1d adds r2, r1, r0 movs r0, 0xBA strb r0, [r2] ldr r3, =0x00000d1e adds r2, r1, r3 ldr r0, [r4] ldr r1, =0x00000ce4 adds r0, r1 ldrh r1, [r0] movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r2, 0 movs r2, 0 movs r3, 0x5 bl sub_8009128 ldr r4, [r4] ldr r3, =0x00000d41 adds r2, r4, r3 movs r0, 0xFC strb r0, [r2] ldr r0, =0x00000d42 adds r2, r4, r0 movs r0, 0x4 strb r0, [r2] ldr r1, =0x00000d43 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, =0x00000d44 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, =0x00000d46 adds r2, r4, r3 movs r0, 0x77 strb r0, [r2] ldr r0, =0x00000d47 adds r2, r4, r0 b @080CF020 .align 2, 0 .pool @080CEFD4: strb r0, [r2] ldr r1, =0x00000d44 adds r2, r4, r1 movs r0, 0x1 strb r0, [r2] ldr r3, =0x00000d45 adds r2, r4, r3 movs r0, 0x5 strb r0, [r2] ldr r0, =0x00000d46 adds r2, r4, r0 movs r0, 0xB5 strb r0, [r2] adds r1, 0x3 adds r2, r4, r1 b @080CF020 .align 2, 0 .pool @080CF000: movs r0, 0x6 strb r0, [r2] ldr r3, =0x00000d44 adds r2, r4, r3 movs r0, 0x1 strb r0, [r2] ldr r0, =0x00000d45 adds r2, r4, r0 movs r0, 0x7 strb r0, [r2] ldr r1, =0x00000d46 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, =0x02039d08 ldr r0, [r4] ldr r1, =0x00000cec 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, =0x00000ce6 adds r1, r4, r2 ldrh r0, [r1] cmp r0, 0 beq @080CF0AC ldr r3, =0x00000d65 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 .pool @080CF0AC: ldr r1, =0x00000d65 adds r0, r4, r1 movs r1, 0 movs r2, 0x8 bl RepeatChar @080CF0B8: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CEC00 thumb_func_start sub_80CF0CC sub_80CF0CC: ; 80CF0CC push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x000021ff 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 .pool @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, =0x02039d78 ldrb r0, [r0] mov r8, r0 ldr r2, =0x02039d79 ldrb r4, [r2] ldr r5, =0x02039d08 ldr r0, [r5] ldr r1, =0x00000cd2 mov r10, r1 add r0, r10 movs r1, 0 strb r1, [r0] ldr r0, [r5] ldr r7, =0x00000cd3 adds r0, r7 strb r1, [r0] ldr r0, [r5] ldr r3, =0x00000cd7 mov r9, r3 add r0, r9 strb r1, [r0] ldr r6, =0x030022c0 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 .pool @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, =0x02039d7d ldrb r0, [r0] cmp r0, 0 bne @080CF244 movs r0, 0x8 b @080CF366 .align 2, 0 .pool @080CF244: ldr r1, [r5] ldrb r0, [r1, 0x1] cmp r0, 0x2 bne @080CF254 ldr r0, =0x02039d7a 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, =@080CF278 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x000021ff adds r0, r1, r2 strb r4, [r0] movs r0, 0x14 b @080CF366 .align 2, 0 .pool @080CF2E4: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080CF2F8 movs r0, 0x13 b @080CF366 .align 2, 0 .pool @080CF2F8: ldr r0, =0x03005d90 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 .pool @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, =0x030022c0 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, =0x02039d79 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 .pool @080CF3AC: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @080CF3CC ldr r1, =0x02039d79 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 .pool @080CF3CC: movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @080CF3F0 ldr r4, =0x02039d79 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 .pool @080CF3F0: movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @080CF424 ldr r4, =0x02039d79 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 .pool @080CF420: movs r0, 0x18 b @080CF49C @080CF424: movs r0, 0 b @080CF49C @080CF428: bl sub_80D0BA4 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039d79 ldrb r1, [r1] lsls r1, 24 asrs r1, 24 cmp r0, r1 beq @080CF47C ldr r2, =0x02039d7a ldr r0, =0x02039d08 ldr r1, [r0] ldr r3, =0x00000ce4 adds r0, r1, r3 ldrh r0, [r0] negs r0, r0 lsrs r0, 31 strb r0, [r2] ldr r0, =0x000021ff adds r1, r0 movs r0, 0x2 strb r0, [r1] bl get_preferred_box ldr r1, =0x02039d7b strb r0, [r1] movs r0, 0x17 b @080CF49C .align 2, 0 .pool @080CF47C: ldr r1, =0x02039d08 ldr r0, [r1] ldr r2, =0x000021ff adds r0, r2 strb r4, [r0] ldr r0, [r1] ldr r3, =0x00000cb8 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 .pool thumb_func_end sub_80CF374 thumb_func_start sub_80CF4B0 sub_80CF4B0: ; 80CF4B0 push {r4,lr} ldr r2, =0x030022c0 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, =0x02039d79 ldrb r1, [r0] subs r1, 0x6 b @080CF53A .align 2, 0 .pool @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, =0x02039d79 ldrb r1, [r0] adds r1, 0x6 b @080CF53A .align 2, 0 .pool @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, =0x02039d79 ldrb r1, [r0] subs r1, 0x1 b @080CF53A .align 2, 0 .pool @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, =0x02039d79 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 .pool @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, =0x02039d7a strb r4, [r0] ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x000021ff adds r0, r1 strb r4, [r0] movs r0, 0x1A b @080CF5BC .align 2, 0 .pool @080CF580: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080CF58C @080CF588: movs r0, 0x18 b @080CF5BC @080CF58C: ldr r0, =0x03005d90 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 .pool @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, =0x02039d78 ldrb r0, [r0] mov r9, r0 ldr r6, =0x02039d79 ldrb r4, [r6] ldr r2, =0x02039d08 ldr r0, [r2] ldr r1, =0x00000cd3 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r2] ldr r3, =0x00000cd2 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, =0x030022c0 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 .pool @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, =0x00000cd6 adds r0, r2 strb r1, [r0] movs r4, 0 b @080CF7C6 .align 2, 0 .pool @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, =0x00000cd6 adds r0, r1 ldrb r4, [r0] b @080CF7C6 .align 2, 0 .pool @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, =0x02039d7d ldrb r0, [r0] cmp r0, 0 bne @080CF6E0 movs r0, 0x8 b @080CF7D8 .align 2, 0 .pool @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, =@080CF700 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 mov r12, r2 cmp r0, 0 beq @080CF784 ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 bne @080CF780 movs r0, 0x13 b @080CF7D8 .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r3] ldr r1, =0x00000cd3 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r3] ldr r2, =0x00000cd2 adds r0, r2 strb r1, [r0] ldr r0, [r3] ldr r5, =0x00000cd7 adds r0, r5 strb r1, [r0] ldr r1, =0x030022c0 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 .pool @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, =0x03005d90 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 .pool @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, =0x02039d78 ldrb r0, [r0] mov r8, r0 ldr r0, =0x02039d79 mov r12, r0 ldrb r2, [r0] ldr r3, =0x02039d08 ldr r0, [r3] ldr r1, =0x00000cd3 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r3] ldr r6, =0x00000cd2 adds r0, r6 strb r1, [r0] ldr r0, [r3] ldr r5, =0x00000cd7 adds r0, r5 strb r1, [r0] ldr r7, =0x030022c0 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 .pool @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, =gUnknown_0857B9BC ldr r1, [r0] adds r4, r0, 0 cmp r1, 0 beq @080CFA30 ldr r5, =0x02039d78 @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 .pool @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, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x3 bne @080CFA78 bl sub_80CFB44 b @080CFA7C .align 2, 0 .pool @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, =0x02039d08 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 .pool @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, =0x02039d7a ldrb r0, [r0] cmp r0, 0 beq @080CFAE8 cmp r1, 0 beq @080CFAE0 movs r0, 0x4 bl sub_80CFF34 b @080CFAF8 .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x2 bne @080CFB2A ldr r0, =0x02039d78 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 .pool @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, =0x02039d08 ldr r0, [r4] ldr r5, =0x00000ce4 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, =0x00000ce6 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 .pool @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, =0x00000ce6 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 .pool @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, =0x02039d08 ldr r1, [r1] ldr r2, =0x00000cb4 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 .pool 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, =gUnknown_0857B9E4 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, =gUnknown_0857B9FC 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, =0x0000daca bl gpu_pal_tags_index_of ldr r6, =0x02039d08 ldr r1, [r6] ldr r4, =0x00000cd8 adds r1, r4 strb r0, [r1] ldr r0, =0x0000dac7 bl gpu_pal_tags_index_of ldr r1, [r6] ldr r5, =0x00000cd9 adds r1, r5 strb r0, [r1] ldr r0, =0x02039d78 ldrb r0, [r0] ldr r1, =0x02039d79 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, =gUnknown_0857BA50 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, =0x00000cb4 adds r3, r2, r4 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 adds r1, r0 str r1, [r3] ldr r0, =0x02039d7d ldr r5, =0x00000cd8 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, =0x02039d7a 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 .pool @080CFD18: ldr r0, [r6] ldr r1, =0x00000cb4 adds r0, r1 movs r1, 0 str r1, [r0] @080CFD22: ldr r0, =0x02039d78 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 .pool @080CFD3C: movs r3, 0x15 movs r4, 0x2 @080CFD40: ldr r0, =gUnknown_0857BA68 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, =0x02039d08 ldr r2, [r5] ldr r3, =0x00000cb8 adds r2, r3 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 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, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 beq @080CFDB4 ldr r0, [r5] ldr r4, =0x00000cb8 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 .pool @080CFDA8: ldr r0, =0x02039d08 ldr r0, [r0] ldr r5, =0x00000cb8 adds r0, r5 movs r1, 0 str r1, [r0] @080CFDB4: add sp, 0x2C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CFC14 thumb_func_start sub_80CFDC4 sub_80CFDC4: ; 80CFDC4 push {lr} ldr r2, =0x02039d7d movs r1, 0 ldrb r0, [r2] cmp r0, 0 bne @080CFDD2 movs r1, 0x1 @080CFDD2: strb r1, [r2] ldr r0, =0x02039d08 ldr r0, [r0] ldr r3, =0x00000cb4 adds r1, r0, r3 ldr r3, [r1] ldr r1, =0x00000cd8 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 .pool thumb_func_end sub_80CFDC4 thumb_func_start sub_80CFE08 sub_80CFE08: ; 80CFE08 ldr r0, =0x02039d79 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 bne @080CFE48 ldr r4, =0x02039d79 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 .pool @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, =0x02039d08 ldr r0, [r0] ldr r2, =0x00000cb4 adds r0, r2 ldr r0, [r0] bl obj_anim_image_start pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CFE54 thumb_func_start sub_80CFE78 sub_80CFE78: ; 80CFE78 ldr r0, =0x02039d7b ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80CFE78 thumb_func_start sub_80CFE84 sub_80CFE84: ; 80CFE84 ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000cb4 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 .pool thumb_func_end sub_80CFE84 thumb_func_start sub_80CFEA8 sub_80CFEA8: ; 80CFEA8 push {lr} ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 bne @080CFEC0 ldr r0, =0x02039d79 ldrb r1, [r0] movs r0, 0 bl sub_80D0E50 @080CFEC0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CFEA8 thumb_func_start sub_80CFECC sub_80CFECC: ; 80CFECC push {lr} ldr r0, =0x02039d78 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 cmp r0, 0 bne @080CFEE4 ldr r0, =0x02039d79 ldrb r1, [r0] movs r0, 0 bl sub_80D0D8C @080CFEE4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80CFECC thumb_func_start sub_80CFEF0 sub_80CFEF0: ; 80CFEF0 ldr r2, =0x02039d08 ldr r0, [r2] ldr r1, =0x00000cac adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r2] ldr r3, =0x00000cad adds r0, r3 strb r1, [r0] ldr r0, [r2] subs r3, 0x41 adds r0, r3 strb r1, [r0] ldr r0, [r2] ldr r1, =0x00000c71 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 .pool 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, =0x02039d08 ldr r2, [r4] ldr r5, =0x00000cac adds r1, r2, r5 ldrb r0, [r1] cmp r0, 0x6 bhi @080CFF7E adds r1, r0, 0 lsls r1, 3 ldr r0, =0x00000c74 adds r1, r0 adds r1, r2, r1 ldr r2, =gUnknown_0857BA80 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, =0x00000cad 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 .pool thumb_func_end sub_80CFF34 thumb_func_start sub_80CFF98 sub_80CFF98: ; 80CFF98 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02039d08 ldr r1, [r0] ldr r3, =0x00000cac adds r0, r1, r3 ldrb r0, [r0] cmp r2, r0 bcs @080CFFC8 lsls r0, r2, 3 ldr r2, =0x00000c78 adds r1, r2 adds r1, r0 movs r0, 0 ldrsb r0, [r1, r0] b @080CFFCC .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r5] ldr r2, =0x00000cad adds r0, r1, r2 ldrb r0, [r0] adds r0, 0x2 subs r2, 0x3E adds r1, r2 strb r0, [r1] ldr r1, [r5] ldr r6, =0x00000cac 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, =0x00000c6d adds r1, r2 strb r0, [r1] ldr r1, [r5] adds r3, r1, r3 ldrb r2, [r3] movs r0, 0xF subs r0, r2 ldr r3, =0x00000c6e adds r1, r3 strb r0, [r1] ldr r0, [r5] ldr r1, =0x00000c6c 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, =0x00000c74 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, =0x00000cae adds r0, r1 mov r2, r8 strb r2, [r0] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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 .pool @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, =0x02039d08 ldr r0, [r0] lsls r1, r5, 3 ldr r2, =0x00000c78 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 .pool thumb_func_end sub_80D00AC thumb_func_start sub_80D013C sub_80D013C: ; 80D013C push {r4,r5,lr} ldr r5, =0x02039d08 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 .pool thumb_func_end sub_80D013C thumb_func_start sub_80D0164 sub_80D0164: ; 80D0164 push {r4,lr} ldr r4, =0x02039d80 ldr r0, =0x00000974 bl malloc str r0, [r4] cmp r0, 0 beq @080D01B0 ldr r0, =gUnknown_0857BB1C bl Window_AddFromTemplate8Bpp adds r1, r0, 0 ldr r0, =0x02039d08 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 .pool @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, =0x02039d80 ldr r0, [r0] cmp r0, 0 beq @080D01C6 bl free @080D01C6: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D01B8 thumb_func_start sub_80D01D0 sub_80D01D0: ; 80D01D0 ldr r2, =0x02039d80 ldr r1, [r2] movs r3, 0 strb r0, [r1] ldr r0, [r2] strb r3, [r0, 0x1] bx lr .align 2, 0 .pool thumb_func_end sub_80D01D0 thumb_func_start sub_80D01E4 sub_80D01E4: ; 80D01E4 push {lr} ldr r0, =0x02039d80 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x5 bhi @080D0244 lsls r0, 2 ldr r1, =@080D0204 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039d80 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 .pool @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, =0xfffffc00 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, =0x02039d08 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, =0x00007fff 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 .pool @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, =0x02039d80 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 .pool @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, =0x02039d80 ldr r0, [r4] ldrb r0, [r0, 0x1] cmp r0, 0 beq @080D03C8 cmp r0, 0x1 beq @080D040C b @080D0416 .align 2, 0 .pool @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, =0x02039d08 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 .pool @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, =0x02039d80 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 .pool @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, =0x02039d80 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 .pool @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, =0x02039d80 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 .pool @080D05BC: ldr r0, =0x02039d80 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 .pool @080D05DC: ldr r0, =0x02039d80 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 .pool @080D05FC: ldr r0, =0x02039d80 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 .pool @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, =0x02039d80 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 .pool 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, =0x02039d08 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 .pool 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, =0x02039d08 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 .pool thumb_func_end sub_80D0834 thumb_func_start sub_80D0884 sub_80D0884: ; 80D0884 ldr r3, =0x02039d80 ldr r3, [r3] strh r0, [r3, 0xC] strh r1, [r3, 0xE] strh r2, [r3, 0x10] bx lr .align 2, 0 .pool thumb_func_end sub_80D0884 thumb_func_start sub_80D0894 sub_80D0894: ; 80D0894 push {r4,lr} ldr r4, =0x02039d80 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 .pool 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, =0x02039d80 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, =0x02039d80 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, =0x02039d80 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 .pool 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, =0x02039d80 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, =0x02039d80 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 .pool 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, =0x02039d80 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, =0x02039d80 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 .pool 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, =0x02039d80 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, =0x02039d80 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 .pool 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, =0x02039d80 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 .pool 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, =0x02039d80 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, =0x02039d80 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 .pool @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, =0x02039d08 ldr r0, [r3] ldrb r0, [r0, 0x1] cmp r0, 0x3 bne @080D0D3E ldr r0, =0x03000f78 str r0, [sp, 0x18] ldr r1, =0xffff0000 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, =gUnknown_0857BC70 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, =0x00002208 adds r1, r2 adds r1, r5 lsls r0, 16 lsrs r0, 11 ldr r4, =0x06010000 adds r0, r4 str r0, [r1] ldr r0, =0xffffdacb 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, =0x0000220c 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, =0x00002204 adds r2, r6 adds r2, r5 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 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, =0x00002210 adds r0, r1 mov r2, r10 strb r2, [r0] adds r7, 0x1 cmp r7, 0x2 ble @080D0CA0 @080D0D3E: ldr r0, =0x02039d08 ldr r0, [r0] ldr r4, =0x00002234 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 .pool 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, =0x02039d08 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 .pool @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, =0x020244ec 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 .pool 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, =0x02039d08 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 .pool 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, =0x02039d08 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 .pool @080D0EF8: movs r0, 0x64 muls r0, r7 ldr r1, =0x020244ec 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, =0x02039d08 ldr r0, [r0] ldr r2, =0x00000ce6 adds r1, r0, r2 ldrh r1, [r1] ldr r2, =0x00002234 adds r0, r2 strh r1, [r0] @080D0F20: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00002234 adds r0, r1 strh r5, [r0] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 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, =0x00002234 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 .pool @080D101C: movs r0, 0x64 adds r4, r7, 0 muls r4, r0 ldr r0, =0x020244ec 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, =0x00002234 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 .pool 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, =0x02039d08 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, =0x00002234 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 .pool @080D10E0: movs r0, 0x64 mov r1, r8 muls r1, r0 adds r0, r1, 0 ldr r1, =0x020244ec adds r0, r1 ldr r2, [r6] ldr r1, =0x00002234 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 .pool 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, =0x02039d08 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 .pool @080D1170: movs r0, 0x64 muls r0, r7 ldr r1, =0x020244ec 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 .pool thumb_func_end sub_80D1114 thumb_func_start sub_80D1194 sub_80D1194: ; 80D1194 push {r4,lr} ldr r0, =0x02039d08 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 .pool thumb_func_end sub_80D1194 thumb_func_start sub_80D11CC sub_80D11CC: ; 80D11CC push {r4,lr} ldr r0, =0x02039d08 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x3 bne @080D120A movs r4, 0 @080D11DA: ldr r0, =0x02039d08 ldr r1, [r0] lsls r0, r4, 4 adds r1, r0 ldr r2, =0x00002210 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 .pool thumb_func_end sub_80D11CC thumb_func_start sub_80D1218 sub_80D1218: ; 80D1218 push {r4,r5,lr} movs r5, 0 ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00002204 adds r4, r0, r1 adds r3, r0, 0 @080D1226: ldr r1, =0x00002210 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, =nullsub_12 cmp r1, r0 beq @080D1268 ldr r0, =sub_80D1AD8 cmp r1, r0 beq @080D1268 @080D124E: movs r0, 0x1 b @080D1274 .align 2, 0 .pool @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, =0x02039d08 ldr r1, [r0] ldrb r0, [r1, 0x1] cmp r0, 0x3 bne @080D12B0 movs r2, 0 ldr r0, =0x0000220e 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 .pool @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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00002234 adds r0, r1 ldrh r0, [r0] bl itemid_get_item pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80D12B8 thumb_func_start sub_80D12D4 sub_80D12D4: ; 80D12D4 ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00002234 adds r0, r1 ldrh r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80D12D4 thumb_func_start sub_80D12E8 sub_80D12E8: ; 80D12E8 push {r4,r5,lr} movs r2, 0 ldr r5, =0x02039d08 ldr r3, =0x00002210 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 .pool @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, =0x02039d08 ldr r2, [r0] @080D1334: ldr r5, =0x00002210 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 .pool @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, =0x02039d08 ldr r1, [r0] @080D1380: lsls r0, r3, 4 adds r2, r1, r0 ldr r6, =0x00002210 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 .pool @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, =0x02039d08 ldr r3, [r0] ldr r0, =0x00002204 adds r4, r3, r0 ldr r6, =0x00002210 @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 .pool @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, =0x02039d08 lsls r3, r5, 4 b @080D14F4 .align 2, 0 .pool @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, =0x02039d08 ldr r2, [r6] lsls r5, 4 ldr r1, =0x00002204 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 .pool @080D1494: cmp r7, 0 bne @080D14BC ldr r4, =0x02039d08 ldr r0, [r4] lsls r3, r5, 4 ldr r1, =0x00002204 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 .pool @080D14BC: ldr r4, =0x02039d08 ldr r0, [r4] lsls r3, r5, 4 ldr r1, =0x00002204 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, =0x00002204 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, =0x0000220e adds r0, r1 mov r1, r8 strb r1, [r0] ldr r0, [r4] adds r0, r3 ldr r1, =0x0000220f adds r0, r1 strb r7, [r0] @080D150A: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r1, [r4] ldr r6, =0x000042c4 adds r1, r6 ldr r2, =0x01000080 mov r0, sp bl CpuFastSet ldr r1, [r4] ldr r5, =0x000022c4 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, =0x02039d08 ldr r1, [r5] ldr r4, =0x000042c4 adds r0, r1, r4 ldr r2, =0x00002208 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, =0x0000220c 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 .pool 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, =0x02039d08 ldr r0, [r0] lsls r1, r2, 4 ldr r2, =0x00002204 adds r0, r2 adds r0, r1 ldr r0, [r0] adds r1, r3, 0 bl sub_8008258 @080D15F6: pop {r0} bx r0 .align 2, 0 .pool 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, =@080D1630 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080D1630: .4byte @080D1650 .4byte @080D1674 .4byte @080D1698 .4byte @080D16C4 .4byte @080D16F0 .4byte @080D172E .4byte @080D172E .4byte @080D171C @080D1650: ldr r0, =0x02039d08 ldr r0, [r0] lsls r1, r4, 4 ldr r2, =0x00002204 adds r0, r2 adds r0, r1 ldr r1, [r0] strh r4, [r1, 0x2E] ldr r1, [r0] ldr r0, =sub_80D1A48 b @080D172C .align 2, 0 .pool @080D1674: ldr r0, =0x02039d08 ldr r0, [r0] lsls r1, r4, 4 ldr r2, =0x00002204 adds r0, r2 adds r0, r1 ldr r2, [r0] movs r1, 0 strh r1, [r2, 0x2E] ldr r1, [r0] ldr r0, =sub_80D1A74 b @080D172C .align 2, 0 .pool @080D1698: ldr r0, =0x02039d08 ldr r0, [r0] lsls r1, r4, 4 ldr r2, =0x00002204 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, =sub_80D1B14 b @080D172C .align 2, 0 .pool @080D16C4: ldr r0, =0x02039d08 ldr r0, [r0] lsls r1, r4, 4 ldr r2, =0x00002204 adds r0, r2 adds r0, r1 ldr r2, [r0] movs r1, 0 strh r1, [r2, 0x2E] ldr r2, [r0] ldr r1, =sub_80D1B94 str r1, [r2, 0x1C] strh r5, [r2, 0x3A] ldr r0, [r0] strh r3, [r0, 0x3C] b @080D172E .align 2, 0 .pool @080D16F0: ldr r0, =0x02039d08 ldr r0, [r0] lsls r1, r4, 4 ldr r2, =0x00002204 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, =sub_80D1C30 b @080D172C .align 2, 0 .pool @080D171C: ldr r0, =0x02039d08 ldr r0, [r0] lsls r1, r4, 4 ldr r2, =0x00002204 adds r0, r2 adds r0, r1 ldr r1, [r0] ldr r0, =sub_80D1CCC @080D172C: str r0, [r1, 0x1C] @080D172E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d08 ldr r0, [r1] lsls r2, 4 adds r0, r2 ldr r3, =0x00002210 adds r0, r3 strb r4, [r0] ldr r0, [r1] ldr r1, =0x00002204 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 .pool 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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00002234 b @080D17DA .align 2, 0 .pool @080D17D4: ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00000ce6 @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 .pool thumb_func_end sub_80D17B4 thumb_func_start sub_80D1818 sub_80D1818: ; 80D1818 push {lr} ldr r0, =0x02039d08 ldr r0, [r0] ldr r1, =0x00002236 adds r0, r1 movs r1, 0x15 strh r1, [r0] ldr r1, =gUnknown_0857BB24 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 .pool thumb_func_end sub_80D1818 thumb_func_start sub_80D184C sub_80D184C: ; 80D184C push {r4,r5,lr} sub sp, 0x10 ldr r0, =0x02039d08 ldr r0, [r0] ldr r2, =0x00002236 adds r1, r0, r2 ldrh r0, [r1] cmp r0, 0 bne @080D186C movs r0, 0 b @080D18D2 .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r0] ldr r2, =0x00002236 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, =0x02039d08 ldr r0, [r0] ldr r1, =0x00002236 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 .pool thumb_func_end sub_80D184C thumb_func_start sub_80D18E4 sub_80D18E4: ; 80D18E4 push {r4,r5,lr} sub sp, 0x10 ldr r5, =0x02039d08 ldr r0, [r5] ldr r4, =0x00002236 adds r0, r4 ldrh r0, [r0] cmp r0, 0x16 bne @080D1904 movs r0, 0 b @080D19A4 .align 2, 0 .pool @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, =0x02039d08 ldr r0, [r0] ldr r2, =0x00002236 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 .pool 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, =0x0000093a 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, =0x0000013b 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, =0x0000013d 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 .pool 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, =nullsub_12 str r0, [r4, 0x1C] @080D1A68: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80D1AD8 str r0, [r3, 0x1C] @080D1AD0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D1A74 thumb_func_start sub_80D1AD8 sub_80D1AD8: ; 80D1AD8 ldr r1, =0x02039d08 ldr r3, [r1] ldr r1, =0x00000cb4 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 .pool 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, =nullsub_12 str r0, [r4, 0x1C] @080D1B8A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08329F40 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, =sub_80D1AD8 str r0, [r4, 0x1C] @080D1C20: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08329F40 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, =nullsub_12 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x24] @080D1CBE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =nullsub_12 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 .pool 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 ; char get_preferred_box() get_preferred_box: ; 80D1D0C ldr r0, =0x03005d94 ldr r0, [r0] ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x03005d94 ldr r0, [r0] strb r1, [r0] @080D1D28: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d94 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 .pool @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, =0x03005d94 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 .pool 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, =0x03005d94 ldr r0, [r0] ldrb r0, [r0] adds r1, r3, 0 bl get_pokemon_data_from_any_box pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d94 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 .pool 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, =0x03005d94 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 .pool @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, =0x03005d94 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 .pool 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, =0x03005d94 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 .pool 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, =0x03005d94 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 .pool @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, =0x03005d94 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 .pool 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, =0x03005d94 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 .pool 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, =0x03005d94 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 .pool 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, =0x03005d94 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 .pool 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, =0x03005d94 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 .pool thumb_func_end sub_80D2054 thumb_func_start get_pokemon_by_box_and_pos ; pokemon *get_pokemon_by_box_and_pos(u8 box_id, u8 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, =0x03005d94 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 .pool @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, =0x03005d94 lsls r1, r2, 3 adds r1, r2 ldr r2, =0x00008344 adds r1, r2 ldr r0, [r0] adds r0, r1 @080D20EC: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d94 ldr r0, [r0] ldr r2, =0x000083c2 adds r0, r2 adds r0, r1 ldrb r0, [r0] @080D2112: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d94 ldr r0, [r0] ldr r3, =0x000083c2 adds r0, r3 adds r0, r2 strb r1, [r0] @080D213E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff 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 .pool @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, =0x03005d94 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 .pool @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, =0x03005d94 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 .pool @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, =0x03005d94 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 .pool 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, =0x03005d94 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 .pool 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, =0x00000163 strh r0, [r1, 0x2] movs r0, 0 mov r8, r0 ldr r7, =0x03005d94 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 .pool @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, =0x03005d8c ldr r0, [r2] ldr r1, =0x00003d84 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r2] ldr r3, =0x00003d85 adds r0, r3 strb r1, [r0] ldr r0, [r2] adds r3, 0x1 adds r0, r3 strb r1, [r0] ldr r1, [r2] ldr r0, =0x00003d70 adds r2, r1, r0 ldr r0, =0x00007b35 strh r0, [r2] subs r3, 0x14 adds r2, r1, r3 ldr r0, =0x00006186 strh r0, [r2] ldr r0, =0x00003d74 adds r1, r0 movs r0, 0xFF strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80D242C thumb_func_start sub_80D2480 sub_80D2480: ; 80D2480 ldr r1, =0x03005d8c ldr r1, [r1] ldr r2, =0x00003d86 adds r1, r2 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80D2480 thumb_func_start sub_80D2494 sub_80D2494: ; 80D2494 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d86 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80D2494 thumb_func_start sub_80D24A8 sub_80D24A8: ; 80D24A8 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d85 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003d85 adds r0, r2 strb r1, [r0] @080D24D0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D24BC thumb_func_start sub_80D24DC sub_80D24DC: ; 80D24DC ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d84 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003d84 adds r0, r2 strb r1, [r0] @080D2504: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D24F0 thumb_func_start sub_80D2510 sub_80D2510: ; 80D2510 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d70 adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_80D2510 thumb_func_start sub_80D2524 sub_80D2524: ; 80D2524 push {r4,lr} ldr r2, =0x03005d8c ldr r2, [r2] ldr r4, =0x00003d70 adds r3, r2, r4 strh r0, [r3] ldr r0, =0x00003d72 adds r2, r0 strh r1, [r2] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D2524 thumb_func_start sub_80D2548 sub_80D2548: ; 80D2548 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d74 adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_80D2548 thumb_func_start sub_80D255C sub_80D255C: ; 80D255C push {lr} adds r1, r0, 0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003d74 adds r0, r2 bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D255C thumb_func_start sub_80D2578 sub_80D2578: ; 80D2578 push {lr} movs r1, 0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003d74 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 .pool 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, =0x02039d84 lsls r0, r4, 1 adds r0, r4 lsls r0, 4 bl malloc str r0, [r6] ldr r5, =0x02039d88 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 .pool thumb_func_end sub_80D259C thumb_func_start sub_80D25F0 sub_80D25F0: ; 80D25F0 push {lr} ldr r0, =0x02039d84 ldr r0, [r0] bl free pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D25F0 thumb_func_start sub_80D2604 sub_80D2604: ; 80D2604 push {r4,r5,lr} movs r4, 0 ldr r0, =0x02039d88 ldrh r0, [r0] cmp r4, r0 bge @080D2634 movs r5, 0 @080D2612: ldr r0, =0x02039d84 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, =0x02039d88 ldrh r0, [r0] cmp r4, r0 blt @080D2612 @080D2634: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d88 ldrh r0, [r0] cmp r6, r0 bcs @080D272C ldr r0, =0x02039d84 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, =gUnknown_0857BC88 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 .pool @080D26E8: adds r1, r5, 0 adds r1, 0x2A movs r0, 0x2 @080D26EE: strb r0, [r1] ldr r4, =0x02039d84 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 .pool 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, =0x02039d88 ldrh r0, [r0] cmp r2, r0 bcs @080D2764 ldr r0, =0x02039d84 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 .pool 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, =0x02039d88 ldrh r0, [r0] cmp r3, r0 bcs @080D279C ldr r0, =0x02039d84 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 .pool 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, =0x02039d88 ldrh r0, [r0] cmp r5, r0 bcs @080D27E6 ldr r0, =0x02039d84 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 .pool 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, =0x02039d88 ldrh r0, [r0] cmp r5, r0 bcc @080D280C b @080D290E @080D280C: ldr r4, =0x02039d84 lsls r2, r5, 1 cmp r1, 0x5 bls @080D2816 b @080D2900 @080D2816: lsls r0, r1, 2 ldr r1, =@080D282C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080D282C: .4byte @080D2844 .4byte @080D2864 .4byte @080D2888 .4byte @080D28A8 .4byte @080D28CC .4byte @080D28E8 @080D2844: ldr r4, =0x02039d84 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 .pool @080D2864: ldr r4, =0x02039d84 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 .pool @080D2888: ldr r4, =0x02039d84 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 .pool @080D28A8: ldr r4, =0x02039d84 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 .pool @080D28CC: ldr r3, =0x02039d84 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 .pool @080D28E8: ldr r3, =0x02039d84 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 .pool 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, =0x02039d88 ldrh r0, [r0] cmp r2, r0 bcs @080D2952 ldr r5, =0x02039d84 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 .pool 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, =0x02039d84 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 .pool 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, =0x02039d84 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 .pool thumb_func_end sub_80D29F8 thumb_func_start sub_80D2A90 sub_80D2A90: ; 80D2A90 ldr r3, =0x02039d8c str r0, [r3] str r1, [r0] movs r1, 0 strb r2, [r0, 0x5] strb r1, [r0, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_80D2A90 thumb_func_start sub_80D2AA4 sub_80D2AA4: ; 80D2AA4 push {r4,r5,lr} ldr r2, =0x02039d8c 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, =0x02039d8c ldr r1, [r0] movs r0, 0 strb r0, [r1, 0x4] @080D2AE2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039d8c 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, =sub_80D2B88 str r0, [r1, 0x10] movs r0, 0x1 b @080D2B76 .align 2, 0 .pool @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, =0x02039d8c 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, =sub_80D2C1C str r0, [r1, 0x10] movs r0, 0x1 b @080D2C16 .align 2, 0 .pool @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, =0x040000d4 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 .pool @080D2C6C: movs r4, 0 strh r4, [r5] ldr r1, =0x040000d4 mov r0, sp str r0, [r1] str r2, [r1, 0x4] ldr r0, =0x81000800 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 .pool 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, =gUnknown_0857C570 str r0, [sp, 0x18] adds r0, r4, 0 adds r2, r5, 0 bl sub_80D2EDC str r0, [sp, 0x1C] ldr r0, =gUnknown_0857C5B4 str r0, [sp, 0x20] ldr r0, =gUnknown_0857C5E8 str r0, [sp, 0x24] str r6, [sp, 0x28] ldr r0, =gMonIconPaletteIndices adds r0, r4, r0 ldr r1, =0x0000dac0 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, =0x02020630 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 .pool 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, =gUnknown_0857C570 str r2, [sp] movs r2, 0 str r2, [sp, 0x4] ldr r2, =gUnknown_0857C5B4 str r2, [sp, 0x8] ldr r2, =gUnknown_0857C5E8 str r2, [sp, 0xC] str r1, [sp, 0x10] ldr r2, =gMonIconPaletteIndices adds r2, r0, r2 ldr r7, =0x0000dac0 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, =0x02020630 adds r0, r1 bl sub_80D30DC adds r0, r4, 0 add sp, 0x18 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =gMonIconPaletteTable @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 .pool 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, =gMonIconPaletteIndices adds r0, r1, r0 ldrb r0, [r0] ldr r1, =gMonIconPaletteTable 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 .pool thumb_func_end sub_80D2F28 thumb_func_start sub_80D2F68 sub_80D2F68: ; 80D2F68 push {r4,lr} lsls r0, 16 lsrs r0, 16 ldr r1, =gMonIconPaletteIndices adds r0, r1 ldrb r0, [r0] ldr r1, =gMonIconPaletteTable 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 .pool thumb_func_end sub_80D2F68 thumb_func_start sub_80D2F9C sub_80D2F9C: ; 80D2F9C push {r4,r5,lr} movs r4, 0 ldr r5, =gMonIconPaletteTable @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 .pool 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, =gMonIconPaletteIndices adds r0, r1, r0 ldrb r0, [r0] ldr r1, =gMonIconPaletteTable lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x4] bl gpu_pal_free_tag pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D2FC0 thumb_func_start sub_80D2FF0 sub_80D2FF0: ; 80D2FF0 push {lr} lsls r0, 16 lsrs r0, 16 ldr r1, =gMonIconPaletteIndices adds r0, r1 ldrb r0, [r0] ldr r1, =gMonIconPaletteTable lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x4] bl gpu_pal_free_tag pop {r0} bx r0 .align 2, 0 .pool 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, =gMonIconTable 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 .pool 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, =gMonIconPaletteTable 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 .pool 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, =gMonIconPaletteIndices adds r0, r1, r0 ldrb r0, [r0] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80D3080 thumb_func_start sub_80D30A0 sub_80D30A0: ; 80D30A0 lsls r0, 16 lsrs r0, 16 ldr r1, =gMonIconPaletteIndices adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =gMonIconPaletteTable ldr r0, =gMonIconPaletteIndices adds r0, r2, r0 ldrb r0, [r0] lsls r0, 3 adds r0, r1 ldr r0, [r0] pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0857C5F0 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, =0x06010000 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 .pool @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, =gUnknown_0857C5F0 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, =0xffff0000 add r3, sp, 0x30 ldr r0, [r3, 0x4] ands r0, r1 orrs r0, r2 str r0, [r3, 0x4] add r1, sp, 0x18 ldr r0, =0x0000ffff 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, =0x02020630 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 .pool 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, =gUnknown_0857C5F0 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, =0xffff0000 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 .pool 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, =sub_80D3660 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 .pool 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, =sub_80D3660 bl AddTask lsls r0, 24 lsrs r0, 24 movs r2, 0x1 lsls r1, r0, 2 adds r1, r0 lsls r3, r1, 3 ldr r5, =0x03005e08 ldr r0, =0x0000ffff 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 .pool thumb_func_end sub_80D33AC thumb_func_start sub_80D33F4 sub_80D33F4: ; 80D33F4 push {lr} ldr r0, =sub_80D3660 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e08 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 .pool @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, =0x03005e08 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 .pool 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, =gUnknown_0832A328 lsrs r1, 22 adds r1, r2 ldr r2, [r1] mvns r2, r2 lsls r2, 16 lsrs r2, 16 ldr r3, =0x03005e00 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 .pool thumb_func_end sub_80D352C thumb_func_start sub_80D355C sub_80D355C: ; 80D355C lsls r0, 24 lsrs r0, 24 lsls r1, 24 ldr r3, =0x03005e00 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 adds r2, r3 ldr r0, =gUnknown_0832A328 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 .pool 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, =0x03005e00 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 adds r2, r3 ldr r0, =gUnknown_0832A328 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 .pool @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, =0x02039d90 lsrs r0, 22 adds r0, r2 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end npc_obj_offscreen_culling_and_flag_update thumb_func_start sub_80D35CC sub_80D35CC: ; 80D35CC lsls r0, 24 ldr r1, =0x02039d90 lsrs r0, 22 adds r0, r1 ldr r0, [r0] bx lr .align 2, 0 .pool 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, =0x03005e08 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, =0x02037350 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 .pool 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, =0x02037350 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 .pool @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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =sub_80D3A9C str r0, [r1] movs r0, 0x1 b @080D3A2C .align 2, 0 .pool @080D3754: ldr r0, =0x0203ab40 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, =0x020244ec adds r0, r1 bl sub_806B6D8 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0xC] cmp r0, 0x34 bne @080D3798 ldr r1, =0x03001100 movs r0, 0x5 strb r0, [r1] ldr r0, =0x03001101 movs r1, 0x2 b @080D37A2 .align 2, 0 .pool @080D3798: ldr r1, =0x03001100 movs r0, 0x3 strb r0, [r1] ldr r0, =0x03001101 movs r1, 0x1 @080D37A2: strb r1, [r0] ldr r0, =0x03001102 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, =0x03001108 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, =0x0000ffff adds r0, r6, r4 ldr r1, =0x0203ab40 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, =0x0000ffff adds r0, r5, r3 ldr r4, =0x0203ab40 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, =0x0203ab40 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, =0x03001108 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 .pool @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, =0x03001108 adds r0, r3 strb r1, [r0] b @080D38C8 .align 2, 0 .pool @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, =0x0203ab40 mov r9, r4 ldr r0, =gUnknown_0857C608 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, =gUnknown_0857C60A 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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =hm2_ruin_valley str r0, [r1] ldr r0, =0x03001108 adds r0, r6, r0 strb r7, [r0] movs r4, 0x1 str r4, [sp, 0x10] b @080D3A0C .align 2, 0 .pool @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, =0x03001108 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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =hm2_ruin_valley 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 .pool 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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_80D3AEC 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 .pool thumb_func_end sub_80D3A6C thumb_func_start sub_80D3A9C sub_80D3A9C: ; 80D3A9C push {lr} bl brm_get_pokemon_selection ldr r1, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_08290705 bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_80D4354 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 .pool 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, =0x0203ab40 adds r1, r4, 0x2 adds r0, r4, 0 bl player_get_pos_to adds r7, r4, 0 @080D3B16: ldr r0, =0x03001108 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, =0x0203ab40 ldr r0, =0x03001101 ldrb r1, [r0] ldrh r0, [r2] subs r0, r1 lsls r0, 16 asrs r0, 16 ldr r1, =0x03001102 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, =0x02039dd0 movs r0, 0x8 bl malloc_and_clear str r0, [r4] movs r6, 0 ldr r5, =0x02020630 @080D3BA0: ldr r0, =0x02037590 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, =gUnknown_0857C66C 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 .pool 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, =0x00000207 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 .pool @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, =0x00000212 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 .pool @080D3C78: ldr r0, =0x00000282 cmp r1, r0 beq @080D3CC4 cmp r1, r0 bgt @080D3C90 subs r0, 0x1 cmp r1, r0 beq @080D3CBC b @080D3D00 .align 2, 0 .pool @080D3C90: ldr r0, =0x00000283 cmp r1, r0 beq @080D3CCC b @080D3D00 .align 2, 0 .pool @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, =0x000001cf b @080D3CD6 .align 2, 0 .pool @080D3CBC: ldr r2, =0x00000279 b @080D3CD6 .align 2, 0 .pool @080D3CC4: ldr r2, =0x0000027a b @080D3CD6 .align 2, 0 .pool @080D3CCC: ldr r2, =0x0000027b b @080D3CD6 .align 2, 0 .pool @080D3CD4: ldr r2, =0x00000271 @080D3CD6: adds r0, r4, 0 adds r1, r5, 0 bl setmaptile_0 b @080D3D00 .align 2, 0 .pool @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, =0x00000279 cmp r1, r0 bne @080D3D34 movs r0, 0x2 b @080D3D56 .align 2, 0 .pool @080D3D34: ldr r0, =0x0000027a cmp r1, r0 bne @080D3D44 movs r0, 0x3 b @080D3D56 .align 2, 0 .pool @080D3D44: ldr r0, =0x0000027b cmp r2, r0 beq @080D3D54 movs r0, 0 b @080D3D56 .align 2, 0 .pool @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, =0x03001100 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 .pool @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, =0x00000281 bl setmaptile_0 b @080D3E12 .align 2, 0 .pool @080D3DF8: adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x00000282 bl setmaptile_0 b @080D3E12 .align 2, 0 .pool @080D3E08: adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x00000283 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, =0x00000281 cmp r0, r1 bne @080D3E5C adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x00000279 bl setmaptile_0 @080D3E5C: adds r0, r5, 0 adds r1, r4, 0 bl cur_mapdata_get_blockid_at ldr r1, =0x00000282 cmp r0, r1 bne @080D3E74 adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x0000027a bl setmaptile_0 @080D3E74: adds r0, r5, 0 adds r1, r4, 0 bl cur_mapdata_get_blockid_at ldr r1, =0x00000283 cmp r0, r1 bne @080D3E8C adds r0, r5, 0 adds r1, r4, 0 ldr r2, =0x0000027b bl setmaptile_0 @080D3E8C: movs r1, 0x80 lsls r1, 9 add r1, r8 lsrs r4, r1, 16 asrs r1, 16 ldr r0, =0x03001100 ldrb r0, [r0] cmp r1, r0 bge @080D3EA0 b @080D3D8E @080D3EA0: ldr r1, =0x03001100 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 .pool 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, =0x03001108 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 .pool @080D3F2C: cmp r0, 0x1 beq @080D3F32 b @080D414A @080D3F32: mov r2, sp ldr r1, =0x03001108 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, =0x00000281 cmp r0, r1 bne @080D3F96 ldr r2, =0x00000279 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, =0x00000282 cmp r0, r1 bne @080D3FAE ldr r2, =0x0000027a 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, =0x00000283 cmp r0, r1 bne @080D3FC6 ldr r2, =0x0000027b 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 .pool @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, =0x00000281 b @080D403E .align 2, 0 .pool @080D403C: ldr r2, =0x00000282 @080D403E: adds r0, r6, 0 adds r1, r4, 0 bl setmaptile_0 b @080D4056 .align 2, 0 .pool @080D404C: ldr r2, =0x00000283 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, =0x00000281 cmp r0, r1 bne @080D4090 ldr r2, =0x00000279 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, =0x00000282 cmp r0, r1 bne @080D40A8 ldr r2, =0x0000027a 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, =0x00000283 cmp r0, r1 bne @080D40C0 ldr r2, =0x0000027b 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 .pool @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, =0x00000281 b @080D4132 .align 2, 0 .pool @080D4130: ldr r2, =0x00000282 @080D4132: adds r0, r5, 0 adds r1, r4, 0 bl setmaptile_0 b @080D414A .align 2, 0 .pool @080D4140: ldr r2, =0x00000283 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 .pool 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, =objc_8097BBC str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =sub_80D41D0 str r0, [r4, 0x1C] @080D41C4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end objc_8097BBC thumb_func_start sub_80D41D0 sub_80D41D0: ; 80D41D0 push {r4-r6,lr} movs r4, 0x1 @080D41D4: ldr r6, =0x02039dd0 ldr r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 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, =gUnknown_08267EDB bl script_env_1_execute_new_script @080D422A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000281 b @080D4296 .align 2, 0 .pool @080D4294: ldr r2, =0x00000282 @080D4296: adds r0, r5, 0 adds r1, r4, 0 bl setmaptile_0 b @080D42AE .align 2, 0 .pool @080D42A4: ldr r2, =0x00000283 adds r0, r5, 0 adds r1, r4, 0 bl setmaptile_0 @080D42AE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000281 cmp r1, r0 beq @080D4328 cmp r1, r0 bgt @080D4308 subs r0, 0x79 cmp r1, r0 beq @080D431C b @080D434A .align 2, 0 .pool @080D4308: ldr r0, =0x00000282 cmp r1, r0 beq @080D4330 adds r0, 0x1 cmp r1, r0 beq @080D4340 b @080D434A .align 2, 0 .pool @080D431C: adds r0, r4, 0 adds r1, r5, 0 movs r2, 0x1 bl setmaptile_0 b @080D434A @080D4328: ldr r2, =0x00000279 b @080D4332 .align 2, 0 .pool @080D4330: ldr r2, =0x0000027a @080D4332: adds r0, r4, 0 adds r1, r5, 0 bl setmaptile_0 b @080D434A .align 2, 0 .pool @080D4340: ldr r2, =0x0000027b adds r0, r4, 0 adds r1, r5, 0 bl setmaptile_0 @080D434A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c @080D4372: lsls r1, r4, 3 adds r1, r4 lsls r1, 2 ldr r0, =0x00002be0 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 .pool thumb_func_end sub_80D436C thumb_func_start sub_80D439C sub_80D439C: ; 80D439C push {r4-r6,lr} adds r3, r0, 0 ldr r0, =0x0000ffff 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 .pool 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, =0x03005d8c 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, =0x03005d90 mov r12, r2 ldr r7, =0x03005d8c add r5, sp, 0x4 ldr r3, =0x0000ffff 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, =0x00002be0 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, =0x03005d8c 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, =0x00002bf2 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, =0x00002bf2 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, =0x00002bf2 adds r0, r3 movs r1, 0 bl sub_81DB4DC movs r4, 0 ldr r6, =0x03005d8c add r3, sp, 0x4 ldr r5, =0x03005d90 @080D4500: ldr r2, [r6] ldrb r1, [r3] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r4, r0 ldr r1, =0x00002bfa 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, =0x00002bfe 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 .pool @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, =0x75300000 adds r0, r1 lsrs r0, 16 @080D45E0: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80D45C8 thumb_func_start sub_80D45E8 sub_80D45E8: ; 80D45E8 push {lr} lsls r0, 16 lsrs r3, r0, 16 ldr r0, =0xffff8ad0 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 .pool @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, =0x03005d8c ldr r1, [r0] lsls r0, r2, 3 adds r0, r2 lsls r0, 2 adds r1, r0 ldr r0, =0x00002be0 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 .pool @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, =0x03005d8c 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 .pool thumb_func_end sub_80D4680 thumb_func_start sub_80D46E0 sub_80D46E0: ; 80D46E0 lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005d8c 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 .pool 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, =0x03005d8c mov r8, r0 ldr r3, =0x00002be0 @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 .pool @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, =sub_80D487C 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, =0x02039dd4 strb r0, [r4] movs r0, 0x12 movs r1, 0x28 bl lcd_io_set ldr r2, =0x03005e00 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 .pool @080D4844: ldr r3, =0x03005e00 ldr r2, =0x02039dd4 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 .pool 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, =0x03005e00 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, =@080D48A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039dd4 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 .pool @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, =sub_80D487C 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, =0x02039dd4 ldrb r0, [r0] bl remove_task @080D49A4: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037318 ldrh r1, [r0, 0x12] movs r0, 0xBD lsls r0, 1 cmp r1, r0 bne @080D49DC mov r4, sp adds r4, 0xF ldr r0, =gUnknown_0857F544 ldr r1, [r0, 0x1C] b @080D49F2 .align 2, 0 .pool @080D49DC: mov r4, sp adds r4, 0xF ldr r1, =gUnknown_0857F544 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000cb2 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 .pool @080D4A08: mov r4, sp adds r4, 0xF ldr r0, =0x02037318 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 .pool 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, =0x0000021d 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, =0x00000229 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, =0x0000022a 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, =0x0000022b 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, =0x0000022d 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, =0x0000022e 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, =0x0000022f 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 .pool 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, =0x02037318 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 .pool @080D4C08: movs r1, 0 @080D4C0A: ldr r0, =gUnknown_0857F464 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, =gUnknown_0857DD04 adds r1, r2 movs r2, 0x80 lsls r2, 3 ldr r3, =0x0000021d bl gpu_copy_bg_tile_pattern_data_to_vram ldr r1, =sub_80D4A78 adds r0, r5, 0 bl CallWindowFunction adds r0, r5, 0 bl Window_WriteStandardTileMap ldr r0, =0x02037318 ldrb r0, [r0, 0x16] cmp r0, 0xE bne @080D4C6C ldr r0, =gUnknown_0857F444 movs r1, 0xE0 movs r2, 0x20 bl gpu_pal_apply b @080D4C7A .align 2, 0 .pool @080D4C6C: lsls r0, r4, 5 ldr r1, =gUnknown_0857F384 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, =gUnknown_0857C684 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 .pool 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, =0x0203ce54 ldr r2, =0x00000804 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, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles movs r0, 0xFF strb r0, [r5] @080D4CEE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce54 ldr r4, [r0] ldr r0, =0x00000804 adds r4, r0 ldr r0, =gUnknown_0857FB4C 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 .pool 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, =0x0203ce54 ldr r0, [r0] ldr r2, =0x00000804 adds r0, r2 ldrb r2, [r0] lsls r0, r2, 4 adds r0, r2 lsls r0, 2 ldr r2, =0x02020630 adds r2, r0, r2 cmp r1, 0 beq @080D4D84 ldr r0, =0x0000fffb strh r0, [r2, 0x26] ldr r0, =sub_80D4D94 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 .pool @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, =nullsub_12 str r0, [r4, 0x1C] @080D4DB8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D4D94 thumb_func_start sub_80D4DC4 sub_80D4DC4: ; 80D4DC4 push {r4,lr} ldr r0, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000804 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r4, r0, r1 adds r0, r4, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @080D4DF4 adds r0, r4, 0 movs r1, 0x1 bl sub_8008258 ldr r0, =sub_80D4E0C str r0, [r4, 0x1C] @080D4DF4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =nullsub_12 str r0, [r4, 0x1C] @080D4E28: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce54 ldr r4, [r0] ldr r0, =0x00000805 adds r4, r0 ldr r0, =gUnknown_0857FBA0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_0857FBA8 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_0857FBB0 movs r1, 0x10 movs r2, 0x10 movs r3, 0 bl obj_add_from_template_forward_search strb r0, [r4] ldr r2, =0x02020630 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 .pool 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, =gUnknown_0857FB98 b @080D4EDA .align 2, 0 .pool @080D4ED8: ldr r0, =gUnknown_0857FB9C @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, =sub_80D4F14 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce54 ldr r2, =0x00000806 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, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 movs r1, 0x18 strh r1, [r0, 0x24] movs r1, 0x58 strh r1, [r0, 0x26] @080D4F86: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000808 adds r0, r1 movs r1, 0x8 bl sub_8122344 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000808 adds r0, r1 movs r1, 0x8 bl sub_81223FC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D4FC8 thumb_func_start sub_80D4FEC sub_80D4FEC: ; 80D4FEC push {lr} adds r3, r0, 0 lsls r3, 24 ldr r0, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000808 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 .pool 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, =gUnknown_0857FC94 lsls r4, 3 adds r0, r5, 0x4 adds r0, r4, r0 ldr r0, [r0] str r0, [sp] ldr r1, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r1 ldr r1, =0x00007544 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, =0x0201d000 adds r1, r4, 0 bl call_LZZUnCompWram ldr r0, =0xfffff000 adds r1, r4, r0 adds r0, r4, 0 bl sub_80D5018 add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0857FBEC 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 .pool thumb_func_end sub_80D50D4 thumb_func_start sub_80D510C sub_80D510C: ; 80D510C push {lr} ldr r0, =0x00007544 bl gpu_pal_free_tag pop {r0} bx r0 .align 2, 0 .pool 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, =0x00007544 bl gpu_pal_free_tag adds r0, r4, 0 bl sub_80D5070 ldr r0, =gUnknown_0857FC7C 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, =0x02020630 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 .pool thumb_func_end sub_80D511C thumb_func_start sub_80D518C sub_80D518C: ; 80D518C push {lr} adds r1, r0, 0 ldr r0, =gUnknown_0857FE10 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 .pool 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, =0x0203841e 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 .pool @080D51D0: ldr r1, =0x02020630 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, =0x03005e00 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, =sub_80D5220 str r1, [r0] adds r0, r5, 0 bl _call_via_r1 @080D520C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @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, =0x0203841e 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 .pool @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, =0x020241e4 adds r0, r4, r0 b @080D5350 .align 2, 0 .pool @080D5348: ldr r1, =0x020241e4 ldr r0, =0x02038436 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 .pool @080D5368: ldr r1, =0x02020630 lsls r0, r3, 4 adds r0, r3 lsls r0, 2 adds r0, r1 ldr r2, =0x0203841e ldrh r1, [r2, 0x2] strh r1, [r0, 0x24] ldrh r1, [r2, 0x4] strh r1, [r0, 0x26] ldr r1, =0x03005e00 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, =sub_80D53BC str r1, [r0] adds r0, r5, 0 bl _call_via_r1 @080D53A6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @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, =0x0203841e 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 .pool @080D54A8: ldr r0, =0x02020630 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, =0x03005e00 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, =sub_80D5508 str r2, [r1] adds r0, r5, 0 bl _call_via_r2 @080D54F6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @080D5568: ldr r3, =0x02020630 movs r0, 0x8 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x24] ldrh r2, [r4, 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 .pool @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, =0x0203841e ldrb r0, [r5] bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 ldrh r2, [r5, 0x2] strh r2, [r1, 0x24] ldr r2, =0x03005e00 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, =sub_80D56A4 str r2, [r1] adds r0, r4, 0 bl _call_via_r2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool 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, =0x0203841e 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, =0x03005e00 mov r12, r2 lsls r4, r5, 2 ldr r2, =sub_80D57B8 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 .pool 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, =0x03005e00 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, =0x02020630 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 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080D584C ldr r1, =0x0203841e 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 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080D5890 ldr r1, =0x0203841e ldrh r0, [r1, 0x2] negs r0, r0 b @080D5894 .align 2, 0 .pool @080D5890: ldr r1, =0x0203841e 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, =0x020241e4 ldr r0, =0x02038436 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] strh r0, [r4, 0x34] strh r2, [r4, 0x36] ldr r1, =sub_80D58D4 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A6630 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A6630 str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =sub_80D5944 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A6630 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A6630 str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @080D598C ldr r1, =0x020241e4 ldr r0, =0x02038436 b @080D5990 .align 2, 0 .pool @080D598C: ldr r1, =0x020241e4 ldr r0, =0x02038437 @080D5990: ldrb r0, [r0] adds r0, r1 ldrb r7, [r0] ldr r5, =0x0203841e ldrh r0, [r5, 0x4] movs r3, 0 strh r0, [r6, 0x2E] ldr r0, =0x02020630 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 .pool @080D5A00: cmp r0, 0x2 bne @080D5A06 strh r3, [r6, 0x30] @080D5A06: ldr r0, =0x0203841e ldrh r1, [r0, 0x2] lsls r0, r7, 8 orrs r0, r1 strh r0, [r6, 0x3C] ldr r0, =sub_80D5A24 str r0, [r6, 0x1C] add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool @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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @080D5AB0 ldr r0, =0x02038436 b @080D5AB2 .align 2, 0 .pool @080D5AB0: ldr r0, =0x02038437 @080D5AB2: ldrb r2, [r0] ldr r0, =0x020241e4 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, =0x0203841e 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, =0x0203841e ldrh r0, [r2, 0x8] movs r4, 0 strh r0, [r5, 0x2E] ldr r0, =0x02020630 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, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A6680 str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @080D5B70 ldr r0, =0x02038436 b @080D5B72 .align 2, 0 .pool @080D5B70: ldr r0, =0x02038437 @080D5B72: ldrb r1, [r0] ldr r0, =0x020241e4 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, =0x0203841e 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, =0x0203841e ldrh r0, [r5, 0x8] strh r0, [r6, 0x2E] ldr r0, =0x02020630 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, =move_anim_8072740 adds r0, r6, 0 bl oamt_set_x3A_32 b @080D5C0C .align 2, 0 .pool @080D5C04: ldr r1, =sub_80D5C20 adds r0, r6, 0 bl oamt_set_x3A_32 @080D5C0C: ldr r0, =sub_80A6680 str r0, [r6, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D5B48 thumb_func_start sub_80D5C20 sub_80D5C20: ; 80D5C20 push {r4,lr} ldr r4, =0x02020630 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 .pool 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, =0x0203841e movs r0, 0x6 ldrsh r1, [r5, r0] movs r0, 0x80 lsls r0, 8 bl __divsi3 lsls r0, 16 lsrs r7, r0, 16 ldr r0, =0x02038436 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, =0x03005e00 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, =sub_80D5CE4 str r0, [r4] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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, =sub_80D5D48 str r0, [r5] @080D5D34: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @080D5D70: ldrb r0, [r4, 0x8] ldrh r2, [r4, 0x12] ldrh r1, [r4, 0x20] adds r2, r1 strh r2, [r4, 0x20] ldr r3, =0x02020630 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 .pool 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, =0x0203841e 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 .pool @080D5DD8: cmp r0, 0x3 beq @080D5DE8 b @080D5E10 @080D5DDE: ldr r5, =0x02038436 b @080D5DEA .align 2, 0 .pool @080D5DE8: ldr r5, =0x02038437 @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, =0x020241e4 ldrb r0, [r5] eors r0, r4 adds r0, r1 ldrb r2, [r0] b @080D5E18 .align 2, 0 .pool @080D5E10: adds r0, r6, 0 bl move_anim_task_del b @080D5E58 @080D5E18: ldr r1, =0x03005e00 lsls r4, r6, 2 adds r0, r4, r6 lsls r0, 3 adds r5, r0, r1 strh r2, [r5, 0x8] ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080D5E44 ldr r0, =0x0203841e ldrh r0, [r0, 0x2] b @080D5E4A .align 2, 0 .pool @080D5E44: ldr r0, =0x0203841e ldrh r0, [r0, 0x2] negs r0, r0 @080D5E4A: strh r0, [r5, 0xA] ldr r0, =0x03005e00 adds r1, r4, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_80D5E6C str r0, [r1] @080D5E58: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldrb r2, [r1, 0x8] ldr r3, =0x02020630 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 .pool 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, =0x02038436 ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080D5ED4 ldr r1, =0x0203841e ldrh r0, [r1, 0x2] negs r0, r0 strh r0, [r1, 0x2] @080D5ED4: ldr r4, =0x0203841e ldrb r0, [r4, 0x8] bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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 .pool @080D5F14: ldr r0, =0x02038437 ldrb r0, [r0] @080D5F18: strh r0, [r2, 0x12] ldr r1, =0x03005e00 adds r0, r3, r5 lsls r0, 3 adds r0, r1 movs r1, 0x1 strh r1, [r0, 0x20] ldr r1, =sub_80D5F3C str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @080D5F94: ldrb r0, [r4, 0x12] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080D5FBC ldr r1, =0x02020630 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 .pool @080D5FBC: ldr r1, =0x02020630 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, =0x03005e00 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, =0x03005e00 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 .pool 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, =0x0203841e 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, =0x03005e00 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, =sub_80D60BC str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x0203841e 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, =0x03005e00 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 .pool @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, =0x03005e00 lsls r4, r7, 2 adds r0, r4, r7 lsls r0, 3 adds r5, r0, r1 ldr r6, =0x0203841e 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 .pool @080D61B8: movs r1, 0x4 ldrsh r0, [r6, r1] cmp r0, 0 bne @080D61C8 ldr r0, =0x02038436 b @080D61CA .align 2, 0 .pool @080D61C8: ldr r0, =0x02038437 @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, =0x03005e00 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, =0x03005e00 mov r3, r8 adds r1, r3, r7 lsls r1, 3 adds r1, r0 ldr r0, =sub_80D6308 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =0x03005e00 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, =0x02038436 b @080D6276 .align 2, 0 .pool @080D6274: ldr r0, =0x02038437 @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, =0x0203841e movs r2, 0x6 ldrsh r1, [r0, r2] adds r6, r0, 0 cmp r1, 0x1 beq @080D62B0 ldr r2, =0x03005e00 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 .pool @080D62B0: ldr r3, =0x03005e00 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, =sub_80D6308 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x0203841e movs r2, 0 ldrsh r1, [r0, r2] mov r8, r0 cmp r1, 0 bne @080D63C0 ldr r4, =0x03005e00 lsls r5, r7, 2 adds r0, r5, r7 lsls r0, 3 adds r6, r0, r4 ldr r0, =0x02038408 ldrh r0, [r0] movs r1, 0xC bl __udivsi3 b @080D63D4 .align 2, 0 .pool @080D63C0: ldr r4, =0x03005e00 lsls r5, r7, 2 adds r0, r5, r7 lsls r0, 3 adds r6, r0, r4 ldr r0, =0x02038404 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, =0x02020630 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, =sub_80D646C str r0, [r4] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @080D64C8: ldr r2, =0x02020630 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, =0x02020630 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 .pool @080D6508: ldr r2, =0x02020630 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, =0x02020630 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 .pool thumb_func_end sub_80D646C thumb_func_start decrypt_bag_item_quantity decrypt_bag_item_quantity: ; 80D6554 adds r1, r0, 0 ldr r0, =0x03005d90 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 .pool 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, =0x03005d90 ldr r2, [r2] adds r2, 0xAC ldr r2, [r2] eors r1, r2 strh r1, [r0] bx lr .align 2, 0 .pool 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, =0x02039dd8 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, =0x02039dd8 @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 .pool 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 ; void init_bag_pockets() init_bag_pockets: ; 80D65F0 push {r4,lr} ldr r1, =0x02039dd8 ldr r0, =0x03005d8c 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 .pool thumb_func_end init_bag_pockets thumb_func_start itemid_get_name ; void itemid_get_name(int item_id, char *dest) 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, =gUnknown_085EFCD4 @080D667E: adds r0, r4, 0 bl gf_strcpy b @080D66BE .align 2, 0 .pool @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, =gUnknown_085897E4 adds r1, r0 adds r0, r4, 0 bl sub_80D66C4 b @080D66BE .align 2, 0 .pool @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, =gUnknown_085EFCE5 cmp r2, 0x1 bhi @080D66CE ldr r4, =gUnknown_085EFCDF @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 .pool thumb_func_end sub_80D66C4 thumb_func_start sub_80D66EC sub_80D66EC: ; 80D66EC push {lr} lsls r0, 24 movs r2, 0 ldr r1, =0x02039dd8 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 .pool @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, =0x00004004 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 .pool @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, =0x02039dd8 lsrs r4, r0, 21 b @080D67AE .align 2, 0 .pool @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, =0x02039dd8 @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 .pool 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, =0x020375f0 strh r1, [r0] movs r0, 0x1 b @080D67F6 .align 2, 0 .pool @080D67E4: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0xB2 bls @080D67C8 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] movs r0, 0 @080D67F6: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x00004004 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 .pool @080D684C: mov r0, r8 bl itemid_get_pocket_number subs r0, 0x1 lsls r0, 24 lsrs r2, r0, 24 ldr r7, =0x000003e7 cmp r2, 0x3 beq @080D6860 movs r7, 0x63 @080D6860: movs r6, 0 ldr r1, =0x02039dd8 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, =0x02039dd8 adds r0, r4, r1 ldrb r0, [r0, 0x4] cmp r6, r0 bcc @080D6878 @080D68BC: cmp r5, 0 beq @080D6914 movs r6, 0 ldr r3, =0x02039dd8 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 .pool @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 ; int bag_add_item(int item_id, int quantity) 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, =0x00004004 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 .pool @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, =0x02039dd8 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, =0x000003e7 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 .pool @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, =0x00004004 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 .pool @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, =0x02039dd8 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 .pool @080D6B40: bl sub_80E9214 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080D6B70 ldr r4, =0x000040ee 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, =0x000040ed 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 .pool @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, =0x03005d8c 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 .pool @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, =0x03005d8c 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 .pool 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, =0x03005d8c 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, =0x0000049a 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 .pool @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, =0x03005d8c 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, =0x000003e7 cmp r1, r3 ble @080D6E04 ldr r1, =0x0000fc19 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 .pool @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, =0x03005d8c 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 .pool 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, =0x03005d8c ldr r2, [r2] lsrs r0, 22 adds r3, r2, r0 ldr r0, =0x0000049a 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 .pool 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, =0x03005d8c 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 .pool thumb_func_end sub_80D6E84 thumb_func_start sub_80D6EDC sub_80D6EDC: ; 80D6EDC push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00000496 adds r1, r0, r2 ldrh r2, [r1] ldr r3, =0x00000103 cmp r2, r3 beq @080D6F04 movs r0, 0x88 lsls r0, 1 cmp r2, r0 beq @080D6F0C b @080D6F0E .align 2, 0 .pool @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 ; int bag_pocket_get_itemid(int pocket_id_plus_1, int item_index_in_pocket) bag_pocket_get_itemid: ; 80D6F14 lsls r0, 24 lsls r1, 16 ldr r2, =0x02039dd8 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 .pool thumb_func_end bag_pocket_get_itemid thumb_func_start bag_pocket_get_item_quantity ; int bag_pocket_get_item_quantity(int pocket_id_plus_1, int item_index_in_pocket) bag_pocket_get_item_quantity: ; 80D6F30 push {lr} lsls r0, 24 lsls r1, 16 ldr r2, =0x02039dd8 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 .pool 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, =0x02039dd8 @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 .pool 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, =0x02039dd0 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 .pool 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, =0x03005d90 ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 ldrb r1, [r0] lsls r1, 30 lsrs r2, r1, 30 lsls r0, r2, 2 adds r0, r2 lsls r0, 2 ldr r2, =0x00000e2c adds r0, r2 adds r2, r3, r0 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 1 ldr r1, =0x00000e54 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 .pool @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, =0x03005d90 ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 ldrb r1, [r0] lsls r1, 30 lsrs r2, r1, 30 lsls r0, r2, 2 adds r0, r2 lsls r0, 2 ldr r2, =0x00000e2c adds r0, r2 adds r2, r3, r0 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 1 ldr r1, =0x00000e54 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 .pool @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, =0x03005d90 ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 ldrb r1, [r0] lsls r1, 30 lsrs r2, r1, 30 lsls r0, r2, 2 adds r0, r2 lsls r0, 2 ldr r2, =0x00000e2c adds r0, r2 adds r0, r3 mov r9, r0 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 1 ldr r1, =0x00000e54 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 .pool @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, =0x03005d90 ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 ldrb r1, [r0] lsls r1, 30 lsrs r2, r1, 30 lsls r0, r2, 2 adds r0, r2 lsls r0, 2 ldr r2, =0x00000e2c adds r0, r2 adds r0, r3 mov r8, r0 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 1 ldr r1, =0x00000e54 adds r0, r1 adds r7, r3, r0 ldr r1, =0x0203cf30 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 .pool @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 ; item *itemid_get_item(s16 itemId) 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, =gItems adds r0, r1 pop {r1} bx r1 .align 2, 0 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =gItems 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 .pool 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, =0x02039f2a movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x00003f3f 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, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r0, =0x02022e18 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] ldr r0, =0x02022e1c strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] ldr r0, =0x02022e20 strh r1, [r0] ldr r0, =0x02022e22 strh r1, [r0] ldr r0, =0x02022e24 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r0, =0x02022e28 strh r1, [r0] ldr r0, =0x02022e2a strh r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D7678 thumb_func_start sub_80D7724 sub_80D7724: ; 80D7724 push {r4,r5,lr} ldr r0, =gUnknown_08C17AB0 movs r1, 0xC0 lsls r1, 19 bl call_LZZUnCompVram ldr r0, =gUnknown_08C1850C ldr r1, =0x06002000 bl call_LZZUnCompVram ldr r1, =gUnknown_08C16FA8 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, =gUnknown_08C16E90 movs r2, 0x80 lsls r2, 2 movs r1, 0 bl decompress_palette bl sub_80D782C movs r4, 0 movs r5, 0xA0 @080D775E: ldr r0, =0x0201a004 adds r0, r5, r0 ldr r1, =0x02039f26 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 .pool 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, =gUnknown_08587F34 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, =0x02039f34 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 .pool thumb_func_end sub_80D779C thumb_func_start sub_80D77E4 sub_80D77E4: ; 80D77E4 push {lr} ldr r0, =gUnknown_08587F44 bl Window_InitFromTemplates bl TextBox_ResetSomeField ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080D7818 ldr r2, =0x03003014 ldrb r1, [r2] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2] b @080D7822 .align 2, 0 .pool @080D7818: ldr r0, =0x03003014 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] @080D7822: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D77E4 thumb_func_start sub_80D782C sub_80D782C: ; 80D782C push {r4,r5,lr} ldr r0, =gUnknown_08587C30 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, =0x020378f6 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, =0x00007e3f movs r1, 0xF3 movs r2, 0x2 bl rboxid_80040B8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D782C thumb_func_start sub_80D787C sub_80D787C: ; 80D787C push {r4-r7,lr} ldr r4, =0x02039f34 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, =0x02039f34 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, =0x02039f34 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, =0x02039f34 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, =0x02039f2a 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, =0x02039f26 @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, =0x02039f34 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 .pool thumb_func_end sub_80D787C thumb_func_start sub_80D7988 sub_80D7988: ; 80D7988 push {r4,r5,lr} ldr r4, =0x02039f34 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, =0x0202305c str r0, [r1] ldr r1, =0x02023060 ldr r0, [r2, 0x28] str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D7988 thumb_func_start sub_80D7A5C sub_80D7A5C: ; 80D7A5C push {r4,r5,lr} ldr r5, =0x02039f34 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, =0x0202305c str r4, [r0] ldr r0, =0x02023060 str r4, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D7A5C thumb_func_start sub_80D7B24 sub_80D7B24: ; 80D7B24 push {r4-r6,lr} ldr r0, =0x030022c0 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 .pool @080D7B44: cmp r5, 0x2 beq @080D7BDA cmp r5, 0x3 beq @080D7C04 b @080D7C56 @080D7B4E: ldr r0, =0x02039f38 strb r5, [r0] bl sub_80D7988 bl init_uns_table_pokemon_copy ldr r4, =0x020244d4 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, =0x02037fd4 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, =0x0300301c movs r0, 0x4 strb r0, [r1] ldr r0, =0x02000000 movs r1, 0xD0 lsls r1, 9 adds r0, r1 strb r5, [r0] bl sub_806E414 bl sub_80D787C b @080D7BF6 .align 2, 0 .pool @080D7BD4: movs r0, 0x2 strb r0, [r6] b @080D7C56 @080D7BDA: ldr r4, =0x02039f34 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 .pool @080D7C04: bl sub_80DE224 ldr r0, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] movs r0, 0x2 bl sub_80A2390 ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] ldr r0, =vblank_cb_battle bl SetVBlankCallback ldr r0, =sub_80D7C7C movs r1, 0xA bl AddTask ldr r1, =0x02039f34 ldr r1, [r1] ldr r1, [r1] strb r0, [r1, 0x8] ldr r0, =sub_80D823C bl set_callback2 ldr r0, =0x02039f2a 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 .pool thumb_func_end sub_80D7B24 thumb_func_start sub_80D7C7C sub_80D7C7C: ; 80D7C7C push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 bne @080D7CA2 ldr r0, =0x03005e00 lsls r1, r3, 2 adds r1, r3 lsls r1, 3 adds r1, r0 strh r2, [r1, 0x8] ldr r0, =sub_80D7CB4 str r0, [r1] @080D7CA2: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f2a 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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x02037fd4 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, =0x02039f2a ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @080D7D62 bl sub_80DBF68 @080D7D62: ldr r0, =sub_80D7DAC movs r1, 0 bl AddTask ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r4, [r0, 0x8] ldr r1, =nullsub_41 str r1, [r0] b @080D7D9E .align 2, 0 .pool @080D7D90: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80D80C8 str r0, [r1] @080D7D9E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D7CB4 thumb_func_start sub_80D7DAC sub_80D7DAC: ; 80D7DAC push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =sub_80FC998 ldr r2, =sub_80D7DC8 bl set_task_function_and_args_14_15 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D7DAC thumb_func_start sub_80D7DC8 sub_80D7DC8: ; 80D7DC8 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0x1 strh r0, [r1, 0x8] ldr r0, =sub_80D7DE8 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005e00 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, =0x02039f34 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, =sub_80D80C8 str r1, [r0] ldr r1, =0x03005d80 ldr r0, =0x030060b8 ldr r0, [r0] str r0, [r1] @080D7E2A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =@080D7E68 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080D7E68: .4byte @080D7E84 .4byte @080D7EC8 .4byte @080D7ED8 .4byte @080D7F28 .4byte @080D7F40 .4byte @080D7F7C .4byte @080D8004 @080D7E84: ldr r2, =0x02037fd4 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 RequestDma3Fill ldr r1, =0x06008000 movs r0, 0 adds r2, r4, 0 movs r3, 0x1 bl RequestDma3Fill ldr r1, =0x06010000 movs r0, 0 adds r2, r4, 0 movs r3, 0x1 bl RequestDma3Fill b @080D80AE .align 2, 0 .pool @080D7EC8: ldr r0, =gUnknown_08C17AB0 movs r1, 0xC0 lsls r1, 19 bl call_LZZUnCompVram b @080D80AE .align 2, 0 .pool @080D7ED8: ldr r0, =gUnknown_08C1850C ldr r4, =0x06002000 adds r1, r4, 0 bl call_LZZUnCompVram ldr r3, =0x02018000 movs r5, 0x80 lsls r5, 6 ldr r1, =0x040000d4 ldr r6, =0x84000400 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 .pool @080D7F28: ldr r1, =gUnknown_08C16FA8 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 .pool @080D7F40: ldr r1, =gUnknown_08C17170 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, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0x2C] ldr r2, =0x0201aa04 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x84000200 str r1, [r0, 0x8] ldr r0, [r0, 0x8] b @080D80AE .align 2, 0 .pool @080D7F7C: ldr r0, =gUnknown_08C16E90 movs r2, 0x80 lsls r2, 2 movs r1, 0 bl decompress_palette ldr r5, =0x02037814 ldr r6, =0x04000008 adds r0, r5, 0 mov r1, sp adds r2, r6, 0 bl CpuSet ldr r0, =0x02039f25 mov r9, r0 ldrb r0, [r0] adds r0, 0x5 lsls r0, 5 ldr r1, =0xffffff00 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, =0x0201a004 ldr r0, =0x040000d4 mov r2, r8 str r2, [r0] str r1, [r0, 0x4] ldr r1, =0x84000080 str r1, [r0, 0x8] ldr r0, [r0, 0x8] bl sub_80D782C b @080D80AE .align 2, 0 .pool @080D8004: bl sub_80DD04C bl sub_80DBF90 bl sub_80DB2BC bl sub_80DB120 ldr r1, =0x02039f34 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, =0x02024076 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, =0x02022fec str r4, [r0] ldr r4, =0x0202420b strb r2, [r4] ldr r0, =0x0202420c strb r3, [r0] bl sub_80DB0C4 ldr r2, =0x020241e4 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 .pool @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, =0x02037fd4 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, =0x03005e00 lsls r1, r3, 2 adds r1, r3 lsls r1, 3 adds r1, r0 strh r2, [r1, 0x8] strh r2, [r1, 0xA] ldr r0, =sub_80D8108 str r0, [r1] @080D80F8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r2, 0x8 ldrsh r0, [r0, r2] adds r2, r1, 0 cmp r0, 0x4 bhi @080D8208 lsls r0, 2 ldr r1, =@080D8138 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022e1a 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 .pool @080D8194: bl sub_80DE350 ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @080D822C .align 2, 0 .pool @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, =0x03005e00 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 .pool @080D8208: ldr r0, =0x02039f34 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, =sub_80D833C str r1, [r0] @080D822C: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f38 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 .pool thumb_func_end sub_80D823C thumb_func_start vblank_cb_battle vblank_cb_battle: ; 80D827C push {lr} ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 bl lcd_io_set ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 bl lcd_io_set ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 bl lcd_io_set ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 bl lcd_io_set ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 bl lcd_io_set ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A bl lcd_io_set ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C bl lcd_io_set ldr r0, =0x02022e22 ldrh r1, [r0] movs r0, 0x1E bl lcd_io_set ldr r0, =0x02022e24 ldrh r1, [r0] movs r0, 0x40 bl lcd_io_set ldr r0, =0x02022e26 ldrh r1, [r0] movs r0, 0x44 bl lcd_io_set ldr r0, =0x02022e28 ldrh r1, [r0] movs r0, 0x42 bl lcd_io_set ldr r0, =0x02022e2a 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 .pool 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, =0x03005e00 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, =0x02022e16 strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] bl sub_80DCD48 ldr r1, =0x02037714 ldr r2, =0x0201a204 ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x84000100 str r1, [r0, 0x8] ldr r0, [r0, 0x8] ldr r0, =0x02021cc4 ldr r1, =0x02039f34 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, =0x02039f25 ldrb r0, [r0] bl sub_80DBCA8 lsls r0, 24 cmp r0, 0 bne @080D83CC ldr r0, =0x02022e2c ldr r1, =gUnknown_0827D507 bl gf_strcpy b @080D83D4 .align 2, 0 .pool @080D83CC: ldr r0, =0x02022e2c ldr r1, =gUnknown_0827D531 bl gf_strcpy @080D83D4: bl sub_80DB89C ldr r4, =0x02021fc4 ldr r1, =0x02022e2c adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldrh r1, [r0, 0x8] adds r1, 0x1 strh r1, [r0, 0x8] b @080D841A .align 2, 0 .pool @080D840C: bl sub_80DED4C cmp r0, 0 bne @080D841A strh r0, [r4, 0x8] ldr r0, =sub_80D8424 str r0, [r4] @080D841A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x02039f25 ldrb r0, [r0] bl sub_80DBCA8 lsls r0, 24 cmp r0, 0 bne @080D8474 movs r0, 0x1 bl sub_80DC490 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80D8490 b @080D8480 .align 2, 0 .pool @080D8474: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80D8894 @080D8480: str r0, [r1] @080D8482: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e16 movs r1, 0xA0 strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] movs r6, 0 ldr r0, =0x02039f25 mov r8, r0 ldr r2, =0x02039e1e mov r10, r2 ldr r7, =0x02039f34 @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 AreMovesContestCombo 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, =gUnknown_085ED1A0 b @080D8566 .align 2, 0 .pool @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, =gContestMoves lsls r1, r4, 3 adds r1, r0 ldrb r0, [r1] cmp r0, 0x3 beq @080D856C add r0, sp, 0x4 ldr r1, =gUnknown_085ED1A7 @080D8566: bl gf_strcpy adds r5, r0, 0 @080D856C: movs r0, 0xD adds r1, r4, 0 muls r1, r0 ldr r0, =gMoveNames 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, =0x02039f34 ldr r0, [r4] ldr r0, [r0] ldrb r0, [r0] lsls r0, 24 asrs r0, 24 bl sub_80D880C ldr r2, =0x02039e00 ldr r0, [r4] ldr r0, [r0] ldrb r1, [r0] lsls r1, 1 ldr r0, =0x02039f25 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, =0x03005e00 mov r2, r9 lsls r0, r2, 2 add r0, r9 lsls r0, 3 adds r0, r1 ldr r1, =sub_80D8610 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 .pool 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, =0x030022c0 ldr r1, =0x02039e00 ldr r0, =0x02039f25 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, =0x03005e00 lsls r1, r7, 2 adds r1, r7 lsls r1, 3 adds r1, r0 ldr r0, =sub_80D8894 str r0, [r1] b @080D87FA .align 2, 0 .pool @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, =0x02021cc4 ldr r1, =0x02039f34 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, =0x02039f25 ldrb r0, [r0] bl sub_80DBCA8 lsls r0, 24 cmp r0, 0 bne @080D86DC ldr r0, =0x02022e2c ldr r1, =gUnknown_0827D507 bl gf_strcpy b @080D86E4 .align 2, 0 .pool @080D86DC: ldr r0, =0x02022e2c ldr r1, =gUnknown_0827D531 bl gf_strcpy @080D86E4: bl sub_80DB89C ldr r4, =0x02021fc4 ldr r1, =0x02022e2c adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0 bl sub_80DEC30 ldr r0, =0x02022e16 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_80D8424 str r1, [r0] b @080D87FA .align 2, 0 .pool @080D8730: ldr r4, =0x02039f34 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 .pool @080D8754: subs r0, 0x1 @080D8756: strb r0, [r1] ldr r4, =0x02039f34 ldr r0, [r4] ldr r0, [r0] ldrb r0, [r0] lsls r0, 24 asrs r0, 24 bl sub_80D880C ldr r2, =0x02039e00 ldr r0, [r4] ldr r0, [r0] ldrb r1, [r0] lsls r1, 1 ldr r0, =0x02039f25 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 .pool @080D879C: ldr r4, =0x02039f34 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 .pool @080D87C0: adds r0, r2, 0x1 strb r0, [r1] @080D87C4: ldr r4, =0x02039f34 ldr r0, [r4] ldr r0, [r0] ldrb r0, [r0] lsls r0, 24 asrs r0, 24 bl sub_80D880C ldr r2, =0x02039e00 ldr r0, [r4] ldr r0, [r0] ldrb r1, [r0] lsls r1, 1 ldr r0, =0x02039f25 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 .pool 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, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080D890C ldr r4, =0x02039f25 ldrb r0, [r4] bl sub_80DB8B8 ldr r1, =0x02039f34 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, =sub_80FC9F8 adds r0, r4, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =sub_80D892C adds r1, r4, 0 bl set_task_function_and_args_14_15 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =nullsub_41 str r1, [r0] bl sub_80DBF68 movs r0, 0 bl sub_80DC490 b @080D891E .align 2, 0 .pool @080D890C: bl sub_80DB918 ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80D895C str r0, [r1] @080D891E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 ldr r0, =0x02039f34 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, =sub_80D895C str r1, [r0] pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e16 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1e 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, =0x02037b14 ldr r0, =0x0201a604 movs r2, 0x80 lsls r2, 3 ldr r4, =0x040000d4 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, =0xfffffc00 adds r0, r1 movs r1, 0 bl gpu_pal_apply ldr r1, =0x03005e00 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, =sub_80D8A04 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D895C thumb_func_start sub_80D8A04 sub_80D8A04: ; 80D8A04 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 ldrh r0, [r4, 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, =sub_80D8A50 str r0, [r4] @080D8A42: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80D8A04 thumb_func_start sub_80D8A50 sub_80D8A50: ; 80D8A50 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02039f34 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, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_80D8A88 str r0, [r1] @080D8A76: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02039f34 ldr r0, [r2] ldr r1, [r0] movs r0, 0 strb r0, [r1, 0x10] ldr r0, [r2] ldr r1, [r0] ldr r0, =0x03005d80 ldr r0, [r0] str r0, [r1, 0x18] ldr r0, =0x02039f2a 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, =0x02039f30 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, =0x02039f34 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, =0x03005e00 adds r0, r7, r6 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x8] ldr r1, =sub_80D8B38 str r1, [r0] @080D8B18: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f34 ldr r0, [r2] ldr r0, [r0] ldrb r6, [r0, 0x11] ldr r1, =0x03005e00 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, =@080D8B84 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039f34 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, =0x02039f34 ldr r0, [r4] ldr r0, [r0] strb r7, [r0, 0x11] ldr r0, [r4] ldr r2, [r0] ldrb r6, [r2, 0x11] ldr r0, =0x02039f2a 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, =sub_80FCC88 adds r0, r4, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =sub_80DA110 adds r1, r4, 0 bl set_task_function_and_args_14_15 bl sub_80DBF68 ldr r1, =0x03005e00 mov r0, r10 add r0, r8 lsls r0, 3 adds r0, r1 strh r5, [r0, 0x8] bl @080DA100 .align 2, 0 .pool @080D8D14: adds r0, r6, 0 bl sub_80DD080 ldr r0, =0x03005e00 mov r1, r10 add r1, r8 lsls r1, 3 adds r1, r0 movs r0, 0x2 strh r0, [r1, 0x8] bl @080DA100 .align 2, 0 .pool @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, =0x02039f34 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, =0x03005e00 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 .pool @080D8DA4: bl sub_80DB89C ldr r0, =0x03005e00 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 .pool @080D8DC4: mov r4, r8 lsls r4, 2 mov r10, r4 ldr r1, =0x020244e4 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, =0x02039e00 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, =0x02020630 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, =sub_80DA134 str r1, [r0] ldr r0, =0x03005e00 mov r4, r10 add r4, r8 lsls r4, 3 adds r4, r0 strh r5, [r4, 0xC] ldr r1, =0x020241e4 ldr r0, =0x0202420b 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 .pool @080D8E7C: mov r2, r8 lsls r0, r2, 2 add r0, r8 lsls r0, 3 adds r2, r0, r4 ldrb r5, [r2, 0xC] ldr r1, =0x02020630 lsls r0, r5, 4 adds r0, r5 lsls r0, 2 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 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 .pool @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, =0x02021cc4 lsls r1, r6, 6 ldr r2, =0x02039e02 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, =0x02021dc4 adds r2, r1, 0 movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy b @080D8F48 .align 2, 0 .pool @080D8F38: ldr r0, =0x02021dc4 ldr r2, =gUnknown_08587F1C ldrb r1, [r3, 0xA] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy @080D8F48: ldr r4, =0x02021fc4 ldr r1, =gUnknown_0827D55A adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 ldr r1, =0x03005e00 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 .pool @080D8F84: bl sub_80DED4C adds r1, r0, 0 cmp r1, 0 beq @080D8F92 bl @080DA100 @080D8F92: ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0] adds r0, 0x5A strb r1, [r0] ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @080D9010: ldr r0, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd ldrb r4, [r0] cmp r4, 0 beq @080D9024 bl @080DA100 @080D9024: adds r0, r6, 0 bl sub_80DE9B0 ldr r0, =0x02039f34 ldr r1, [r0] ldr r0, [r1] adds r0, 0x5A ldrb r0, [r0] cmp r0, 0 beq @080D9060 ldr r0, =0x03005e00 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 .pool @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, =0x03005e00 mov r4, r8 lsls r1, r4, 2 b @080D9192 .align 2, 0 .pool @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, =0x03005e00 mov r0, r10 add r0, r8 lsls r0, 3 adds r0, r1 movs r1, 0x18 strh r1, [r0, 0x8] bl @080DA100 .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @080D9320: ldr r0, =0x03005e00 mov r3, r8 lsls r1, r3, 2 add r1, r8 lsls r1, 3 adds r1, r0 b @080D9354 .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =0x02039f26 ldr r2, =0x02039f34 @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 .pool @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, =0x02039f26 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 .pool @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, =0x03005e00 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 .pool @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, =0x02039f26 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, =0x03005e00 mov r0, r10 add r0, r8 lsls r0, 3 adds r0, r1 movs r1, 0x1D strh r1, [r0, 0x8] bl @080DA100 .align 2, 0 .pool @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, =0x02039f26 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 .pool @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, =0x02039f26 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, =0x03005e00 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 .pool @080D95B4: ldr r0, =0x03005e00 mov r1, r10 add r1, r8 lsls r1, 3 adds r1, r0 b @080D95E4 .align 2, 0 .pool @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, =0x02039f26 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 .pool @080D963C: movs r0, 0x64 bl audio_play @080D9642: ldr r5, =0x02039f34 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, =0x03005e00 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 .pool @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, =0x02021cc4 lsls r1, r6, 6 ldr r2, =0x02039e02 adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_0827E793 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 @080D96F6: ldr r0, =0x03005e00 mov r1, r10 add r1, r8 lsls r1, 3 adds r1, r0 movs r0, 0x34 strh r0, [r1, 0x8] bl @080DA100 .align 2, 0 .pool @080D971C: bl sub_80DED4C cmp r0, 0 beq @080D9728 bl @080DA100 @080D9728: ldr r0, =0x02039f34 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, =0x03005e00 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 .pool @080D975C: ldr r0, =0x03005e00 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 .pool @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, =gUnknown_0827E32E b @080D97A6 .align 2, 0 .pool @080D97A0: cmp r0, 0x2 bne @080D97B4 ldr r0, =gUnknown_0827E35B @080D97A6: movs r1, 0x1 bl sub_80DEC30 b @080D97BC .align 2, 0 .pool @080D97B4: ldr r0, =gUnknown_0827E38D movs r1, 0x1 bl sub_80DEC30 @080D97BC: movs r0, 0x3 bl sub_80DD720 ldr r1, =0x03005e00 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 .pool @080D97DC: bl sub_80DB89C ldr r0, =0x02021cc4 lsls r1, r6, 6 ldr r2, =0x02039e02 adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_0827E2FE adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 movs r0, 0x2 bl sub_80DD720 ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @080D9864: bl sub_80DED4C cmp r0, 0 beq @080D9870 bl @080DA100 @080D9870: ldr r1, =0x03005e00 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, =0x02039f34 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 .pool @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, =0x02021cc4 lsls r1, r6, 6 ldr r2, =0x02039e02 adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_0827E6E3 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 ldr r0, =0x03005e00 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 .pool @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, =0x02039f34 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, =0x03005e00 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 .pool @080D99EC: bl sub_80DCD48 ldr r0, =0x02039f34 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, =0x03005e00 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 .pool @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, =0x02021ec4 ldrh r2, [r5, 0x6] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy b @080D9AAE .align 2, 0 .pool @080D9A94: ldr r0, =0x02021ec4 ldr r3, =gUnknown_08587F08 ldr r2, =gContestMoves 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, =0x02039f34 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, =0x02021cc4 lsls r1, r6, 6 ldr r2, =0x02039e02 adds r1, r2 bl gf_strcpy ldr r4, =0x02039f34 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, =0x03005e00 mov r2, r8 lsls r1, r2, 2 b @080D9F58 .align 2, 0 .pool @080D9B30: cmp r3, 0 bge @080D9B48 ldr r0, =0x02021fc4 ldr r1, =gUnknown_0827E73C bl ExpandTextCodes b @080D9B74 .align 2, 0 .pool @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, =0x02021fc4 ldr r1, =gUnknown_0827E717 bl ExpandTextCodes b @080D9B74 .align 2, 0 .pool @080D9B6C: ldr r0, =0x02021fc4 ldr r1, =gUnknown_0827E76A bl ExpandTextCodes @080D9B74: ldr r0, =0x02021fc4 movs r1, 0x1 bl sub_80DEC30 ldr r1, =0x03005e00 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 .pool @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, =0x00000187 bl fanfare_play b @080D9C3E .align 2, 0 .pool @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, =0x02037fd4 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 .pool @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, =@080D9C8C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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 .pool @080D9D84: ldr r0, =0x02037fd4 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 .pool @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, =0x03005e00 mov r2, r8 lsls r1, r2, 2 b @080D9F58 .align 2, 0 .pool @080D9DD4: bl sub_80DB89C ldr r0, =0x02021ec4 ldr r5, =0x02039f34 ldr r1, [r5] ldr r1, [r1, 0x10] ldr r1, [r1] lsls r1, 20 lsrs r1, 29 lsls r1, 6 ldr r4, =0x02039e02 adds r1, r4 bl gf_strcpy ldr r0, =0x02021cc4 lsls r1, r6, 6 adds r1, r4 bl gf_strcpy ldr r0, =0x02021dc4 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, =gMoveNames adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_0827E7EA adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 ldr r1, =0x03005e00 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 .pool @080D9E60: bl sub_80DED4C cmp r0, 0 beq @080D9E6A b @080DA100 @080D9E6A: bl sub_80DB89C ldr r4, =0x02021fc4 ldr r1, =gUnknown_0827E817 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 ldr r1, =0x03005e00 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 .pool @080D9EA0: bl sub_80DED4C cmp r0, 0 beq @080D9EAA b @080DA100 @080D9EAA: bl sub_80DB89C ldr r0, =0x03005e00 mov r5, r8 lsls r1, r5, 2 b @080D9F58 .align 2, 0 .pool @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, =0x02021cc4 lsls r1, r6, 6 ldr r2, =0x02039e02 adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 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, =gMoveNames adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_0827E58A adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 ldr r1, =0x03005e00 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 .pool @080D9F48: bl sub_80DED4C cmp r0, 0 beq @080D9F52 b @080DA100 @080D9F52: ldr r0, =0x03005e00 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 .pool @080D9F68: bl sub_80DDBE8 ldr r0, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @080D9FC0: mov r3, r8 lsls r2, r3, 2 add r2, r8 lsls r2, 3 adds r2, r4 ldrb r5, [r2, 0xC] ldr r1, =0x02020630 lsls r0, r5, 4 adds r0, r5 lsls r0, 2 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80DA164 str r1, [r0] movs r0, 0xB strh r0, [r2, 0x8] b @080DA100 .align 2, 0 .pool @080D9FEC: mov r5, r8 lsls r0, r5, 2 add r0, r8 lsls r0, 3 adds r4, r0, r4 ldrb r5, [r4, 0xC] ldr r1, =0x02020630 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 .pool @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, =0x02021cc4 lsls r1, r6, 6 ldr r2, =0x02039e02 adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_0827D56F adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 ldr r1, =0x03005e00 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 .pool @080DA080: bl sub_80DED4C cmp r0, 0 bne @080DA100 ldr r0, =0x03005e00 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 .pool @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, =sub_80DA198 str r1, [r0] b @080DA100 .align 2, 0 .pool @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, =0x02039f34 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 .pool 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, =nullsub_12 str r0, [r1, 0x1C] @080DA15C: pop {r0} bx r0 .align 2, 0 .pool 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, =nullsub_12 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 .pool 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, =0x03005e00 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 .pool @080DA1C0: cmp r0, 0x2 beq @080DA248 b @080DA250 @080DA1C6: ldr r0, =0x02039f2a ldrb r1, [r0] movs r6, 0x1 adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @080DA224 ldr r0, =0x02039f34 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, =sub_80FCC88 adds r0, r4, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =sub_80DA110 adds r1, r4, 0 bl set_task_function_and_args_14_15 bl sub_80DBF68 strh r6, [r5, 0x8] b @080DA250 .align 2, 0 .pool @080DA224: bl sub_80DB944 bl sub_80DBA18 b @080DA23E @080DA22E: ldr r0, =0x02039f34 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 .pool @080DA248: movs r0, 0 strh r0, [r5, 0x8] ldr r0, =sub_80DA25C str r0, [r5] @080DA250: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =sub_80DA28C str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02039f34 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 .pool @080DA304: bl sub_80DC3AC movs r0, 0 strh r0, [r4, 0x8] strh r0, [r4, 0xA] ldr r0, =sub_80DA31C str r0, [r4] @080DA312: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80DA348 str r0, [r1] @080DA33A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DA31C thumb_func_start sub_80DA348 sub_80DA348: ; 80DA348 lsls r0, 24 lsrs r0, 24 ldr r2, =0x0201a204 ldr r3, =0x02037714 ldr r1, =0x040000d4 str r2, [r1] str r3, [r1, 0x4] ldr r2, =0x84000100 str r2, [r1, 0x8] ldr r1, [r1, 0x8] ldr r2, =0x03005e00 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, =sub_80DA38C str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80DA348 thumb_func_start sub_80DA38C sub_80DA38C: ; 80DA38C push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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, =sub_80DA3CC str r0, [r1] @080DA3BE: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02039f34 ldr r0, [r0] ldr r5, =0x02039f25 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, =0x02021cc4 ldrb r1, [r5] lsls r1, 6 ldr r2, =0x02039e02 adds r1, r2 bl gf_strcpy ldr r5, =0x02021fc4 ldr r0, =gUnknown_08587D90 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 .pool @080DA448: bl sub_80DED4C cmp r0, 0 bne @080DA45A strh r0, [r6, 0x8] ldr r0, =sub_80DA464 str r0, [r6] bl sub_80DCD48 @080DA45A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DA3CC thumb_func_start sub_80DA464 sub_80DA464: ; 80DA464 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 ldrh r0, [r4, 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, =sub_80DA49C str r0, [r4] @080DA48E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x8] ldr r1, =sub_80DA4CC str r1, [r0] @080DA4BE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80DE424 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80DA51C str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f34 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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80DA5E8 b @080DA5A0 .align 2, 0 .pool @080DA590: bl sub_80DDB0C ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_80DA5B4 @080DA5A0: str r0, [r1] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DA51C thumb_func_start sub_80DA5B4 sub_80DA5B4: ; 80DA5B4 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0] ldrb r1, [r0, 0x6] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @080DA5D8 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_80D833C str r0, [r1] @080DA5D8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e16 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] ldr r4, =0x02039f34 movs r3, 0 ldr r2, =0x02039f10 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, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080DA65C ldr r0, =0x02039f34 ldr r2, [r0] ldr r0, =0x02039f25 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 .pool @080DA65C: bl sub_80DF250 bl sub_80DF4F8 bl sub_80DF750 @080DA668: ldr r1, =0x030060b8 ldr r0, =0x03005d80 ldr r0, [r0] str r0, [r1] ldr r4, =0x02021fc4 ldr r1, =gUnknown_0827D597 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_80DEC30 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0xC] ldr r1, =sub_80DA6B4 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e18 strh r4, [r0] ldr r1, =0x02022e1a movs r0, 0xA0 strh r0, [r1] movs r0, 0x62 movs r1, 0 bl audio_play_and_stuff ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r4, [r0, 0x8] ldr r1, =sub_80DA700 str r1, [r0] @080DA6EA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DA6B4 thumb_func_start sub_80DA700 sub_80DA700: ; 80DA700 push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r1, =0x02022e1a 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, =0x03005e00 lsls r1, r3, 2 adds r1, r3 lsls r1, 3 adds r1, r0 ldr r0, =sub_80DA740 str r0, [r1] strh r2, [r1, 0x8] @080DA72E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02039f2a ldrb r0, [r0] movs r1, 0x1 ands r1, r0 cmp r1, 0 beq @080DA780 ldr r0, =sub_80DA7A0 b @080DA792 .align 2, 0 .pool @080DA780: movs r0, 0x1 negs r0, r0 str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =sub_80DA830 @080DA792: str r0, [r4] @080DA794: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80FCACC adds r0, r5, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =sub_80DA7EC adds r1, r5, 0 bl set_task_function_and_args_14_15 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =nullsub_41 str r1, [r0] bl sub_80DBF68 movs r0, 0 bl sub_80DC490 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 ldr r0, =0x02039f34 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, =sub_80DA830 str r1, [r0] add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DA7EC thumb_func_start sub_80DA830 sub_80DA830: ; 80DA830 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080DA860 adds r0, r2, 0 bl remove_task ldr r0, =0x03005dac ldr r1, =sub_80DA874 str r1, [r0] bl Window_FreeMemory bl sub_80D7A5C bl sub_805F094 ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 @080DA860: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080DA898 ldr r1, =0x02039f25 movs r0, 0x3 strb r0, [r1] @080DA898: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DA884 thumb_func_start sub_80DA8A4 sub_80DA8A4: ; 80DA8A4 push {lr} ldr r0, =0x02039f25 ldr r1, =0x02039f2b ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 beq @080DA8C0 movs r0, 0 b @080DA8C2 .align 2, 0 .pool @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, =0x03005d90 ldr r1, [r6] mov r0, sp bl gf_strcpy ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080DA8F2 mov r0, sp bl sub_80DF9D4 @080DA8F2: ldr r5, =0x02039f25 ldrb r0, [r5] lsls r0, 6 ldr r4, =0x02039e0d 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 .pool @080DA928: ldrb r0, [r5] lsls r0, 6 adds r0, r4, r0 movs r1, 0xD9 @080DA930: strb r1, [r0, 0x8] ldr r7, =0x02039e00 ldr r6, =0x02039f25 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, =0x020244ec 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, =0x02039f2a 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 .pool @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, =0x00000101 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 .pool @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, =0x02039e00 ldr r1, =0x02039f25 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 .pool 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, =0x00000864 bl flag_check lsls r0, 24 cmp r0, 0 beq @080DABC0 ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080DABC0 movs r7, 0x1 @080DABC0: movs r5, 0 ldr r2, =gUnknown_085880A4 ldr r3, =gUnknown_085898A4 @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 .pool @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, =gUnknown_085880A4 @080DAC50: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 bl __modsi3 lsls r0, 16 lsrs r0, 16 ldr r1, =0x02039e00 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, =0x02039f24 ldrb r0, [r0] bl sub_80DA8C8 add sp, 0x64 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f30 ldrb r1, [r0] mov r9, r0 cmp r1, 0x4 bne @080DACDE b @080DADF6 @080DACDE: movs r5, 0 ldr r3, =gUnknown_085880A4 ldr r6, =gUnknown_085898A4 @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 .pool @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, =0x02039e00 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, =gUnknown_085880A4 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 .pool 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, =0x02039f2c ldrh r0, [r0] cmp r0, 0x4 bhi @080DAE82 lsls r0, 2 ldr r1, =@080DAE48 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039f2e 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 .pool thumb_func_end sub_80DAE0C thumb_func_start sub_80DAEA4 sub_80DAEA4: ; 80DAEA4 push {r4,r5,lr} movs r5, 0 @080DAEA8: ldr r0, =0x02039f26 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 .pool 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, =0x02022e2c ldr r1, =gUnknown_085ED1AB 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 .pool 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, =gUnknown_085E8D3E add r0, sp, 0x4 bl gf_strcpy lsls r1, r5, 6 ldr r0, =0x02039e0d adds r1, r0 add r0, sp, 0x4 bl gf_strcat add r0, sp, 0x4 adds r1, r4, 0 bl sub_80DAED4 ldr r4, =0x02022e2c 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, =0x02039f26 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 .pool 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, =0x02039e02 adds r0, r2 bl sub_80DAED4 ldr r0, =0x02039f26 adds r4, r0 ldrb r0, [r4] ldr r1, =0x02022e2c 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 .pool 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, =@080DAFFC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080DAFFC: .4byte @080DB010 .4byte @080DB028 .4byte @080DB040 .4byte @080DB050 .4byte @080DB06C @080DB010: ldr r0, =0x02039e00 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 .pool @080DB028: ldr r0, =0x02039e00 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 .pool @080DB040: ldr r1, =0x02039e00 lsls r2, 6 adds r3, r2, r1 adds r0, r3, 0 adds r0, 0x28 b @080DB05A .align 2, 0 .pool @080DB050: ldr r1, =0x02039e00 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 .pool @080DB06C: ldr r0, =0x02039e00 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 .pool 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, =0x02039f00 @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 .pool thumb_func_end sub_80DB09C thumb_func_start sub_80DB0C4 sub_80DB0C4: ; 80DB0C4 push {r4,r5,lr} ldr r0, =gUnknown_08587C00 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08C1C6B8 movs r1, 0x88 lsls r1, 1 movs r2, 0x20 bl decompress_palette ldr r0, =gUnknown_08587BE8 movs r1, 0x70 movs r2, 0x24 movs r3, 0x1E bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r4, =0x02020630 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, =nullsub_12 str r1, [r2] pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80DB0C4 thumb_func_start sub_80DB120 sub_80DB120: ; 80DB120 push {lr} ldr r0, =gUnknown_08587C08 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08587C10 bl gpu_pal_obj_decompress_and_apply ldr r0, =gUnknown_08587C18 movs r1, 0x60 movs r2, 0xA movs r3, 0x1D bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r1, =0x02020630 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 .pool 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, =0x02039f25 ldrb r0, [r0] cmp r4, r0 bne @080DB1B8 lsls r0, r5, 3 ldr r1, =gMonBackPicTable adds r0, r1 ldr r1, =0x020244d4 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 .pool @080DB1B8: lsls r0, r5, 3 ldr r1, =gMonBackPicTable adds r0, r1 ldr r1, =0x020244d4 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, =0x0202499c 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, =0x02020630 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, =nullsub_12 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, =gUnknown_082FF6C0 b @080DB280 .align 2, 0 .pool @080DB278: mov r0, r8 adds r0, 0x10 adds r0, r6, r0 ldr r1, =gUnknown_082FF694 @080DB280: str r1, [r0] lsls r0, r7, 4 adds r0, r7 lsls r0, 2 ldr r1, =0x02020630 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 .pool 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, =0x02039f34 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 .pool 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, =gContestEffects ldr r1, =gContestMoves 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, =@080DB320 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00009082 b @080DB356 .align 2, 0 .pool @080DB34C: ldr r0, =0x00009088 b @080DB356 .align 2, 0 .pool @080DB354: ldr r0, =0x00009086 @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 .pool 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, =gContestMoves lsls r0, 3 adds r0, r1 ldrb r0, [r0, 0x1] lsls r0, 29 lsrs r0, 29 ldr r7, =0x00004040 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, =gContestEffects ldr r0, =gContestMoves 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 .pool @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, =0x00005035 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, =0x00005012 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, =gContestEffects ldr r0, =gContestMoves 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 .pool @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, =0x00005036 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, =0x00005014 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, =gContestEffectDescriptionPointers ldr r0, =gContestMoves adds r0, r7, r0 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, [r0] movs r0, 0xA bl sub_80DEB70 ldr r1, =gUnknown_085E8D3E movs r0, 0x9 bl sub_80DEB70 add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f26 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 .pool @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, =0x02039f34 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 .pool thumb_func_end sub_80DB584 thumb_func_start sub_80DB5B0 sub_80DB5B0: ; 80DB5B0 ldr r0, =0x00002034 bx lr .align 2, 0 .pool 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, =0x02039f34 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 .pool @080DB5F4: ldr r0, =0x02039f26 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 .pool @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, =0x02039f26 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, =0x02039f34 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 .pool 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, =@080DB764 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039f26 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, =0x02039f34 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, =0x00ff0003 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 .pool @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, =0x02039f25 ldrb r0, [r0] cmp r4, r0 beq @080DB8F4 adds r0, r4, 0 bl sub_81562C4 bl sub_8156324 lsls r0, 24 ldr r2, =0x02039e00 lsrs r0, 23 lsls r1, r4, 6 b @080DB902 .align 2, 0 .pool @080DB8F4: ldr r2, =0x02039e00 ldr r0, =0x02039f34 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 .pool 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, =0x02039f34 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 .pool 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, =0x02039f34 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, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool @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, =0x02039f34 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, =0x02039f34 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, =0x02039f34 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 .pool thumb_func_end sub_80DBAA0 thumb_func_start sub_80DBCA8 sub_80DBCA8: ; 80DBCA8 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039f34 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 .pool @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, =0x02039f18 lsls r4, 1 adds r1, r4, r1 strh r0, [r1] ldr r2, =0x02039f08 adds r2, r4, r2 ldr r1, =0x02039f00 adds r4, r1 ldrh r4, [r4] adds r0, r4 strh r0, [r2] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f10 lsrs r0, 23 adds r0, r1 movs r1, 0 ldrsh r0, [r0, r1] lsls r0, 17 asrs r0, 16 bx lr .align 2, 0 .pool 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, =0x02039f08 ldr r2, [sp, 0x64] ldr r5, =0x02039f00 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, =0x02039f20 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 .pool thumb_func_end sub_80DBD4C thumb_func_start sub_80DBED4 sub_80DBED4: ; 80DBED4 push {lr} ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080DBF0E ldr r0, =0x03005d90 ldr r2, [r0] ldr r1, =0x02039f20 ldr r0, =0x02039f25 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r1, 1 ldr r0, =0x02039f2c ldrh r0, [r0] lsls r0, 3 adds r1, r0 ldr r0, =0x00000624 adds r2, r0 adds r2, r1 ldrh r0, [r2] adds r0, 0x1 ldr r1, =0x0000270f cmp r0, r1 ble @080DBF0C adds r0, r1, 0 @080DBF0C: strh r0, [r2] @080DBF0E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e16 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] bl sub_80DB89C ldr r0, =gUnknown_0827E8DA movs r1, 0 bl sub_80DEC30 pop {r0} bx r0 .align 2, 0 .pool 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, =0x00005011 cmp r0, 0 beq @080DBFE2 ldr r1, =0x00006011 cmp r0, 0x1 beq @080DBFE2 ldr r1, =0x00008011 cmp r0, 0x2 bne @080DBFE2 ldr r1, =0x00007011 @080DBFE2: adds r0, r1, 0x1 lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039f34 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, =sub_80DC0F4 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, =0x03005e00 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 .pool @080DC0C8: ldr r2, =0x03005e00 lsls r3, r7, 2 adds r0, r3, r7 lsls r0, 3 adds r0, r2 ldr r1, =0x0000ffff 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 .pool 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, =0x03005e00 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, =0x02039f34 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 .pool @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, =0x03005e00 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 .pool @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, =0x02039f26 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, =0x030075f0 adds r0, r4, 0 bl m4aMPlayImmInit ldr r1, =0x0000ffff ldr r0, [sp, 0xC] lsls r2, r0, 24 asrs r2, 16 adds r0, r4, 0 bl MPlayPitchControl b @080DC28A .align 2, 0 .pool @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, =0x03005e00 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 .pool thumb_func_end sub_80DC0F4 thumb_func_start sub_80DC2BC sub_80DC2BC: ; 80DC2BC push {r4,r5,lr} ldr r0, =gUnknown_08587A74 bl gpu_tile_obj_alloc_tag_and_copy_to_vram movs r4, 0 ldr r5, =gUnknown_08587A6C @080DC2C8: ldr r0, =0x02039f26 adds r0, r4, r0 ldrb r0, [r0] adds r0, r5 ldrb r2, [r0] ldr r0, =gUnknown_08587AD0 movs r1, 0xB4 movs r3, 0x1 bl obj_add_from_template_forward_search ldr r1, =0x02039f34 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 .pool 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, =0x02039f34 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 .pool @080DC350: cmp r0, 0 bge @080DC356 movs r5, 0 @080DC356: ldr r2, =0x02020630 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 .pool @080DC38C: ldr r0, =0x0000ffff @080DC38E: strh r0, [r4, 0x32] adds r0, r3, r7 lsls r0, 2 adds r1, r2, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80DC408 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f34 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 .pool @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, =0x02039f34 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, =nullsub_12 str r0, [r3, 0x1C] b @080DC446 .align 2, 0 .pool @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, =0x02020630 ldr r5, =0x02039f34 ldr r4, =gUnknown_08587A6C ldr r3, =0x02039f26 @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 .pool 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, =0x02039f26 ldr r5, =0x02020630 ldr r4, =0x02039f34 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 .pool @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, =gUnknown_08587B08 bl gpu_pal_obj_alloc_tag_and_apply movs r5, 0 ldr r7, =0x02039f34 ldr r0, =0x02020630 mov r8, r0 movs r6, 0 @080DC506: lsls r0, r5, 3 ldr r1, =gUnknown_08587AE8 adds r0, r1 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08587B18 adds r0, r6, r0 ldr r2, =gUnknown_08587A70 ldr r1, =0x02039f26 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, =gUnknown_08587B80 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 .pool thumb_func_end sub_80DC4F0 thumb_func_start sub_80DC594 sub_80DC594: ; 80DC594 push {lr} ldr r0, =gUnknown_08587BB0 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08587BB8 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_08587BC8 movs r1, 0x1E movs r2, 0x2C movs r3, 0x1 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 adds r1, 0x3E ldrb r2, [r1] movs r3, 0x4 orrs r2, r3 strb r2, [r1] ldr r1, =0x02039f34 ldr r1, [r1] ldr r1, [r1] adds r1, 0x58 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DC594 thumb_func_start sub_80DC5E8 sub_80DC5E8: ; 80DC5E8 push {r4,lr} ldr r0, =sub_80DC728 movs r1, 0x1E bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039f34 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, =0x03005e08 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 .pool 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, =0x03005e00 ldr r1, =0x02039f34 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 .pool 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, =sub_80DC6A4 movs r1, 0x1F bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r2 ldrb r0, [r0, 0x8] adds r5, r0, 0 ldr r0, =0x02039f34 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, =0x00004bff 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 .pool 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, =0x03005e08 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 .pool @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, =0x02039f34 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, =0x00004bff 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 .pool thumb_func_end sub_80DC728 thumb_func_start sub_80DC7EC sub_80DC7EC: ; 80DC7EC push {r4,lr} ldr r0, =sub_80DC8D0 movs r1, 0x1E bl AddTask ldr r1, =0x02039f34 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 .pool 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, =0x03005e00 ldr r1, =0x02039f34 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 .pool 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, =0x02037728 adds r6, r2, r3 ldr r5, =0x02037b28 adds r2, r5 ldr r1, =0x040000d4 str r6, [r1] str r2, [r1, 0x4] ldr r2, =0x80000001 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 .pool 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, =0x03005e08 mov r8, r0 ldr r1, =0x00004bff 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 .pool @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, =0x03005e00 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 .pool thumb_func_end sub_80DC8D0 thumb_func_start sub_80DC9B4 sub_80DC9B4: ; 80DC9B4 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02039f34 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 .pool @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, =0x02039f26 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, =gUnknown_08589904 adds r0, r4, r0 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08589924 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, =gUnknown_0858998C 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, =0x02020630 adds r5, r1 ldrh r2, [r5, 0x4] lsls r1, r2, 22 lsrs r1, 22 adds r1, 0x40 ldr r3, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 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, =0x0600e026 adds r3, r0 ldr r7, =0x02039f34 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, =0x0600e036 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, =0x050000c0 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, =0x02020630 adds r4, r1 ldrh r1, [r4, 0x4] lsls r1, 22 lsrs r1, 17 ldr r6, =0x06010000 adds r1, r6 movs r2, 0x80 lsls r2, 4 mov r10, r2 movs r3, 0x1 bl RequestDma3Copy 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 RequestDma3Copy 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 .pool 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, =0x02020630 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 .pool 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, =0x00000907 movs r0, 0x52 bl lcd_io_set pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f34 ldr r1, [r0] ldr r2, =0x02020630 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, =sub_80DCC84 str r0, [r6] add r4, r8 ldr r0, =nullsub_12 str r0, [r4] mov r3, r9 cmp r3, 0 bne @080DCC70 movs r0, 0x65 bl audio_play b @080DCC76 .align 2, 0 .pool @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, =0x02020630 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, =sub_80DCCD8 mov r1, r12 str r0, [r1, 0x1C] @080DCCCC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DCC84 thumb_func_start sub_80DCCD8 sub_80DCCD8: ; 80DCCD8 push {lr} ldr r1, =0x02039f34 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 .pool thumb_func_end sub_80DCCD8 thumb_func_start sub_80DCD08 sub_80DCD08: ; 80DCD08 push {lr} ldr r0, =0x02000000 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 .pool @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, =0x020322d5 ldrb r0, [r0] cmp r0, 0 beq @080DCE44 ldr r0, =0x02000000 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 .pool @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, =0x02039f34 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, =gUnknown_085E8D40 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, =0x02039f26 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, =0x02039f34 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, =gUnknown_085E8D40 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, =0x02039f26 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 .pool 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, =0x02039f26 mov r8, r3 @080DCECC: mov r6, r8 strb r5, [r6] movs r4, 0 cmp r4, r5 bge @080DCF48 ldr r7, =0x02039f00 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, =0x02039f26 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 .pool @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, =0x02039f26 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 .pool @080DCF80: mov r0, sp movs r1, 0xFF movs r2, 0x4 bl memset movs r5, 0 ldr r3, =0x02039f26 movs r6, 0 @080DCF90: ldr r0, =0x02039f34 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 .pool @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, =0x02039f26 mov r8, r2 add r3, sp, 0x4 mov r12, r3 @080DCFE0: ldr r6, =0x02039f34 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 .pool 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, =0x0201a004 adds r0, r5, r0 ldr r1, =0x02039f26 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 .pool 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, =0x02039f34 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, =gContestMoves 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 .pool @080DD110: ldr r4, =0x02039f34 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, =gContestEffects 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, =0x02039f34 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 AreMovesContestCombo 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, =gContestEffectFunctionTable add r0, r9 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x02039f34 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 .pool @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, =0x02039f34 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 AreMovesContestCombo 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 .pool @080DD29C: ldr r2, =gContestMoves ldr r5, =0x02039f34 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 .pool @080DD2D8: ldrb r1, [r3, 0x15] movs r0, 0x11 negs r0, r0 ands r0, r1 strb r0, [r3, 0x15] @080DD2E2: ldr r5, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool thumb_func_end sub_80DD080 thumb_func_start sub_80DD3D4 sub_80DD3D4: ; 80DD3D4 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02039f34 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 .pool thumb_func_end sub_80DD3D4 thumb_func_start sub_80DD3F0 sub_80DD3F0: ; 80DD3F0 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02039f34 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 .pool 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, =0x02021cc4 lsls r1, r4, 6 ldr r2, =0x02039e02 adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 ldr r5, =0x02039f34 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, =gMoveNames adds r1, r2 bl gf_strcpy ldr r3, =gContestMoves 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, =0x02021ec4 ldr r1, =gUnknown_0827E837 bl gf_strcpy b @080DD52C .align 2, 0 .pool @080DD4DC: lsrs r0, r1, 29 cmp r0, 0x1 bne @080DD4F4 ldr r0, =0x02021ec4 ldr r1, =gUnknown_0827E83F bl gf_strcpy b @080DD52C .align 2, 0 .pool @080DD4F4: lsrs r0, r1, 29 cmp r0, 0x2 bne @080DD50C ldr r0, =0x02021ec4 ldr r1, =gUnknown_0827E847 bl gf_strcpy b @080DD52C .align 2, 0 .pool @080DD50C: lsrs r0, r1, 29 cmp r0, 0x3 bne @080DD524 ldr r0, =0x02021ec4 ldr r1, =gUnknown_0827E850 bl gf_strcpy b @080DD52C .align 2, 0 .pool @080DD524: ldr r0, =0x02021ec4 ldr r1, =gUnknown_0827E85A bl gf_strcpy @080DD52C: ldr r4, =0x02021fc4 ldr r1, =gUnknown_08587E10 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 .pool thumb_func_end sub_80DD45C thumb_func_start sub_80DD560 sub_80DD560: ; 80DD560 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r4, =0x02039f34 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 .pool 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, =0x02039f26 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, =0x02039f34 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 .pool @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, =0x02039f26 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, =0x02039f34 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 .pool 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, =nullsub_12 str r0, [r2, 0x1C] ldr r0, =0x02039f34 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 .pool 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0] ldrb r5, [r0, 0x12] cmp r1, 0x8 bls @080DD734 b @080DD8D4 @080DD734: lsls r0, r1, 2 ldr r1, =@080DD748 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 lsls r4, r5, 4 adds r1, r4, r5 lsls r1, 2 adds r1, r0 ldrh r0, [r1, 0x2E] ldr r2, =0x000003ff ands r2, r0 ldrh r3, [r1, 0x4] ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r2 strh r0, [r1, 0x4] movs r0, 0x20 bl audio_play b @080DD8F8 .align 2, 0 .pool @080DD79C: ldr r0, =0x02020630 lsls r4, r5, 4 adds r1, r4, r5 lsls r1, 2 adds r1, r0 ldrh r2, [r1, 0x2E] adds r2, 0x4 ldr r3, =0x000003ff adds r0, r3, 0 ands r2, r0 ldrh r3, [r1, 0x4] ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r2 strh r0, [r1, 0x4] movs r0, 0x1F bl audio_play b @080DD8F8 .align 2, 0 .pool @080DD7D0: ldr r0, =0x02020630 lsls r4, r5, 4 adds r1, r4, r5 lsls r1, 2 adds r1, r0 ldrh r2, [r1, 0x2E] adds r2, 0x8 ldr r3, =0x000003ff adds r0, r3, 0 ands r2, r0 ldrh r3, [r1, 0x4] ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r2 strh r0, [r1, 0x4] movs r0, 0x1F bl audio_play b @080DD8F8 .align 2, 0 .pool @080DD804: ldr r0, =0x02020630 lsls r4, r5, 4 adds r1, r4, r5 lsls r1, 2 adds r1, r0 ldrh r2, [r1, 0x2E] adds r2, 0xC ldr r3, =0x000003ff adds r0, r3, 0 ands r2, r0 ldrh r3, [r1, 0x4] ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r2 strh r0, [r1, 0x4] movs r0, 0x2D bl audio_play b @080DD8F8 .align 2, 0 .pool @080DD838: ldr r0, =0x02020630 lsls r4, r5, 4 adds r1, r4, r5 lsls r1, 2 adds r1, r0 ldrh r2, [r1, 0x2E] adds r2, 0xC ldr r3, =0x000003ff adds r0, r3, 0 ands r2, r0 ldrh r3, [r1, 0x4] ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r2 strh r0, [r1, 0x4] movs r0, 0x2D bl audio_play b @080DD8F8 .align 2, 0 .pool @080DD86C: ldr r0, =0x02020630 lsls r4, r5, 4 adds r1, r4, r5 lsls r1, 2 adds r1, r0 ldrh r2, [r1, 0x2E] adds r2, 0x10 ldr r3, =0x000003ff adds r0, r3, 0 ands r2, r0 ldrh r3, [r1, 0x4] ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r2 strh r0, [r1, 0x4] movs r0, 0x2D bl audio_play b @080DD8F8 .align 2, 0 .pool @080DD8A0: ldr r0, =0x02020630 lsls r4, r5, 4 adds r1, r4, r5 lsls r1, 2 adds r1, r0 ldrh r2, [r1, 0x2E] adds r2, 0x18 ldr r3, =0x000003ff adds r0, r3, 0 ands r2, r0 ldrh r3, [r1, 0x4] ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r2 strh r0, [r1, 0x4] movs r0, 0xC3 bl audio_play b @080DD8F8 .align 2, 0 .pool @080DD8D4: ldr r0, =0x02020630 lsls r4, r5, 4 adds r1, r4, r5 lsls r1, 2 adds r1, r0 ldrh r2, [r1, 0x2E] adds r2, 0x14 ldr r3, =0x000003ff adds r0, r3, 0 ands r2, r0 ldrh r3, [r1, 0x4] ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r2 strh r0, [r1, 0x4] movs r0, 0x2D bl audio_play @080DD8F8: adds r2, r4, 0 ldr r4, =0x02020630 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, =sub_80DD6DC str r0, [r2] ldr r0, =0x02039f34 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 .pool 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, =0x02039f34 ldr r0, =0x02020630 mov r9, r0 ldr r0, =0x06010000 mov r8, r0 ldr r7, =0x04000008 @080DD956: ldr r0, [r6] ldr r1, [r0] movs r0, 0x13 ldrsb r0, [r1, r0] ldr r4, =gUnknown_08D8EC24 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 .pool thumb_func_end sub_80DD940 thumb_func_start sub_80DD9F0 sub_80DD9F0: ; 80DD9F0 lsls r0, 16 ldr r3, =gUnknown_085899EC ldr r1, =gContestMoves lsrs r0, 13 adds r0, r1 ldrb r1, [r0, 0x1] lsls r1, 29 lsrs r1, 29 ldr r0, =0x02039f2c 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 .pool thumb_func_end sub_80DD9F0 thumb_func_start sub_80DDA20 sub_80DDA20: ; 80DDA20 push {r4,r5,lr} ldr r0, =c3_08130B10 movs r1, 0xA bl AddTask adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r0, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r0 movs r0, 0x1 strh r0, [r4, 0xA] ldr r0, =0x0000abe2 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 .pool 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, =0x03005e00 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 .pool @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, =0x00007fff 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, =0x02039f34 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 .pool thumb_func_end c3_08130B10 thumb_func_start sub_80DDB0C sub_80DDB0C: ; 80DDB0C push {r4,lr} ldr r0, =sub_80DDB6C movs r1, 0xA bl AddTask ldr r3, =0x02020630 ldr r4, =0x02039f34 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, =0x0000ffba 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 .pool 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, =0x02039f34 ldr r0, [r4] ldr r0, [r0] adds r0, 0x58 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r2, r0, r1 ldr r0, =0x03005e00 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 .pool thumb_func_end sub_80DDB6C thumb_func_start sub_80DDBE8 sub_80DDBE8: ; 80DDBE8 push {r4,r5,lr} ldr r5, =0x02020630 ldr r4, =0x02039f34 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 .pool @080DDC1C: ldr r0, =task08_080CD1CC 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 .pool 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, =0x02039f34 ldr r0, [r5] ldr r0, [r0] adds r0, 0x58 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r3, r0, r1 ldr r0, =0x03005e00 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, =0x0000ffba 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 .pool 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, =sub_80DDD20 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 lsls r4, 24 asrs r4, 24 strh r4, [r1, 0x8] ldr r0, =0x02039f34 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 .pool 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, =0x03005e00 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 .pool @080DDD48: cmp r0, 0x2 beq @080DDD70 b @080DDD9C @080DDD4E: bl sub_80DDB0C b @080DDD64 @080DDD54: ldr r0, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool thumb_func_end sub_80DDD20 thumb_func_start sub_80DDDA8 sub_80DDDA8: ; 80DDDA8 ldr r3, =0x02020630 ldr r0, =0x02039f34 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 .pool thumb_func_end sub_80DDDA8 thumb_func_start sub_80DDDE4 sub_80DDDE4: ; 80DDDE4 ldr r2, =0x02020630 ldr r0, =0x02039f34 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 .pool thumb_func_end sub_80DDDE4 thumb_func_start sub_80DDE0C sub_80DDE0C: ; 80DDE0C push {lr} ldr r0, =sub_80DDE30 movs r1, 0xF bl AddTask ldr r0, =0x02039f34 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 .pool 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, =0x03005e00 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, =0x02019000 ldr r1, =0x06002000 movs r2, 0x80 lsls r2, 5 movs r3, 0x1 bl RequestDma3Copy b @080DDE8C .align 2, 0 .pool @080DDE78: ldr r0, =0x02018000 ldr r1, =0x06002000 movs r2, 0x80 lsls r2, 5 movs r3, 0x1 bl RequestDma3Copy ldrh r0, [r4, 0x20] adds r0, 0x1 strh r0, [r4, 0x20] @080DDE8C: ldr r1, =0x03005e00 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, =0x02039f34 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 .pool 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, =sub_80DDF80 movs r1, 0xA bl AddTask lsls r0, 24 lsrs r6, r0, 24 lsls r4, 24 cmp r4, 0 ble @080DDF38 ldr r7, =0x0000237e lsls r0, r5, 24 adds r4, r0, 0 cmp r4, 0 ble @080DDF1C movs r5, 0 ldr r2, =0x02039f34 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 .pool @080DDF1C: ldr r2, =0x02039f34 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 .pool @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, =0x02039f34 @080DDF4E: ldr r1, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool @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, =0x02039f34 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 .pool 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, =0x02039f34 mov r9, r0 mov r8, r9 ldr r6, =0x02020630 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, =0x060100c0 adds r1, r2 ldr r2, =0x04000008 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, =gUnknown_08587A70 ldr r0, =0x02039f26 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 .pool @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, =0x02039f34 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, =gUnknown_08D8E9B4 adds r0, r1 b @080DE122 .align 2, 0 .pool @080DE120: ldr r0, =gUnknown_08D8EA34 @080DE122: pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039f34 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, =0x02039f26 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 .pool thumb_func_end sub_80DE12C thumb_func_start sub_80DE1E8 sub_80DE1E8: ; 80DE1E8 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039f34 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 .pool @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, =0x02022e18 movs r0, 0xF0 strh r0, [r1] ldr r4, =0x02022e1a 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, =0x02039f34 ldr r1, [r4] ldr r1, [r1, 0x28] ldr r2, =0x05000400 bl CpuSet ldr r1, =gUnknown_08C17980 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, =0x02020630 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 .pool thumb_func_end sub_80DE224 thumb_func_start sub_80DE350 sub_80DE350: ; 80DE350 push {r4-r7,lr} sub sp, 0x8 ldr r1, =0x06008000 movs r2, 0x80 lsls r2, 6 movs r0, 0 movs r3, 0x1 bl RequestDma3Fill movs r5, 0 str r5, [sp] ldr r6, =0x02039f34 ldr r0, [r6] ldr r1, [r0, 0x28] ldr r2, =0x05000400 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, =0x02022e18 strh r5, [r0] ldr r0, =0x02022e1a strh r5, [r0] ldr r7, =0x02020630 @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 .pool 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, =0x02022e18 movs r0, 0 strh r0, [r1] ldr r1, =0x02022e1a movs r0, 0xA0 strh r0, [r1] movs r0, 0x62 movs r1, 0 bl audio_play_and_stuff ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80DE464 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DE424 thumb_func_start sub_80DE464 sub_80DE464: ; 80DE464 push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r1, =0x02022e1a 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, =0x03005e00 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, =sub_80DE4A8 str r0, [r1] @080DE496: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @080DE4D0: cmp r1, 0x2 beq @080DE58A cmp r1, 0x3 beq @080DE5A4 b @080DE5B4 @080DE4DA: movs r2, 0 adds r6, r3, 0 ldr r5, =0x02039f34 ldr r3, =0x02039f26 @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, =0x03005e00 adds r1, r6, r4 lsls r1, 3 adds r1, r0 movs r0, 0x1 strh r0, [r1, 0x8] b @080DE5B4 .align 2, 0 .pool @080DE52C: ldr r0, =0x02039f2a ldrb r0, [r0] ands r1, r0 cmp r1, 0 beq @080DE584 ldr r0, =0x02039f34 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, =sub_80FCC88 adds r0, r4, 0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =sub_80DA110 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 .pool @080DE584: bl sub_80DBAA0 b @080DE59A @080DE58A: ldr r0, =0x02039f34 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 .pool @080DE5A4: bl sub_80DB884 bl sub_80DB2BC movs r0, 0 strh r0, [r5, 0x8] ldr r0, =sub_80DE5F4 str r0, [r5] @080DE5B4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DE4A8 thumb_func_start sub_80DE5C0 sub_80DE5C0: ; 80DE5C0 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x02022e1a ldrh r0, [r1] adds r0, 0x7 strh r0, [r1] lsls r0, 16 asrs r0, 16 cmp r0, 0xA0 ble @080DE5E4 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_80DA4F4 str r0, [r1] @080DE5E4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DE5C0 thumb_func_start sub_80DE5F4 sub_80DE5F4: ; 80DE5F4 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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 .pool @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, =sub_80DE65C str r0, [r1] b @080DE654 .align 2, 0 .pool @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, =0x03005e00 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 .pool @080DE680: movs r0, 0 strh r0, [r4, 0xC] movs r0, 0x61 movs r1, 0 bl audio_play_and_stuff ldr r0, =sub_80DE5C0 str r0, [r4] @080DE690: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r5, =0x02039f34 @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, =sub_80DE794 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 mov r0, r8 strh r0, [r1, 0x8] ldr r0, =0x02039f34 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 .pool 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, =0x02020630 ldr r3, =0x02039f34 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, =0x03005e00 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, =0x02039f34 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, =0x02020630 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 .pool 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, =0x0000019b cmp r1, r0 bls @080DE85A movs r1, 0 @080DE85A: adds r0, r1, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039f34 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, =0x02039e00 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, =0x020244e4 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 .pool @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, =gBaseStats 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, =0x02038432 movs r0, 0 b @080DE9A0 .align 2, 0 .pool @080DE920: ldr r6, =0x02039f34 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, =0x02039e00 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 .pool @080DE960: ldr r1, =0x0203841a movs r0, 0xFF b @080DE9A0 .align 2, 0 .pool @080DE96C: ldr r1, =0x0203841a movs r0, 0 b @080DE9A0 .align 2, 0 .pool @080DE978: ldr r0, =0x02039f34 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, =0x02038432 strb r1, [r0] b @080DE9A2 .align 2, 0 .pool @080DE99C: ldr r1, =0x02038432 movs r0, 0x1 @080DE9A0: strb r0, [r1] @080DE9A2: bl sub_80DEA5C pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DE864 thumb_func_start sub_80DE9B0 sub_80DE9B0: ; 80DE9B0 push {r4,lr} ldr r4, =0x02039f34 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 .pool 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, =0x02039f34 ldr r0, [r6] ldr r0, [r0, 0x18] strb r4, [r0, 0x5] ldr r5, =0x02039e00 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 .pool thumb_func_end sub_80DE9DC thumb_func_start sub_80DEA20 sub_80DEA20: ; 80DEA20 push {lr} ldr r0, =nullsub_12 bl object_new_hidden_with_callback ldr r1, =0x020241e4 strb r0, [r1, 0x3] ldr r0, =0x0202420c ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_alloc_rotscale_entry bl sub_80DEA5C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80DEA20 thumb_func_start sub_80DEA5C sub_80DEA5C: ; 80DEA5C push {r4,lr} ldr r0, =0x020241e4 ldrb r0, [r0, 0x3] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool thumb_func_end sub_80DEA5C thumb_func_start sub_80DEAA8 sub_80DEAA8: ; 80DEAA8 push {lr} lsls r0, 16 lsrs r0, 16 ldr r2, =gBattleMoves lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x6] cmp r0, 0x20 bhi @080DEB60 lsls r0, 2 ldr r1, =@080DEAD0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0202420c movs r0, 0x2 b @080DEB64 .align 2, 0 .pool @080DEB60: ldr r1, =0x0202420c movs r0, 0x3 @080DEB64: strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f2a ldrb r1, [r0] adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @080DEC94 movs r1, 0x4 b @080DEC9C .align 2, 0 .pool @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, =0x02039f38 movs r1, 0x1 lsls r1, r0 ldrb r0, [r2] orrs r1, r0 strb r1, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_80DED60 thumb_func_start sub_80DED74 sub_80DED74: ; 80DED74 push {r4-r6,lr} movs r0, 0 ldr r6, =0x03005d90 ldr r5, =0x00000624 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 .pool 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, =0x02039f20 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, =0x02039f25 ldrb r0, [r0] cmp r5, r0 beq @080DEE00 movs r0, 0 b @080DEF90 .align 2, 0 .pool @080DEE00: ldr r0, =0x02039f2c ldrh r0, [r0] cmp r0, 0x4 bhi @080DEE4C lsls r0, 2 ldr r1, =@080DEE1C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c mov r10, r2 ldr r0, [r2] mov r3, r9 lsls r7, r3, 5 ldr r6, =0x00002e90 adds r2, r0, r6 adds r2, r7 ldr r4, =0x02039e00 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, =0x00002e98 adds r1, r3 strh r2, [r1] ldr r1, =0x00002e94 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, =0x02039f2a 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, =0x00002eae adds r0, r1 movs r1, 0x4 b @080DEF02 .align 2, 0 .pool @080DEEF4: mov r2, r10 ldr r0, [r2] adds r0, r7 ldr r1, =0x02039f2e ldrh r1, [r1] ldr r3, =0x00002eae adds r0, r3 @080DEF02: strb r1, [r0] ldr r0, [sp] cmp r0, 0xFF beq @080DEF34 ldr r0, =0x03005d8c ldr r0, [r0] mov r2, r9 lsls r1, r2, 5 adds r0, r1 ldr r1, =0x02039f2c ldrh r1, [r1] ldr r3, =0x00002e9a adds r0, r3 strb r1, [r0] b @080DEF8E .align 2, 0 .pool @080DEF34: ldr r0, =0x03005d8c ldr r0, [r0] mov r2, r9 lsls r1, r2, 5 adds r0, r1 ldr r3, =0x00002e9a adds r0, r3 mov r1, r8 strb r1, [r0] b @080DEF8E .align 2, 0 .pool @080DEF50: ldr r6, =0x02039f3c ldr r4, =0x02039e00 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 .pool 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, =0x03005d8c mov r12, r0 ldr r4, =0x00002e90 ldr r3, =0x00002e70 @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 .pool @080DEFF8: ldr r0, =0x02039f2c ldrh r0, [r0] cmp r0, 0x4 bhi @080DF038 lsls r0, 2 ldr r1, =@080DF014 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c mov r12, r0 ldr r4, =0x00002e90 ldr r3, =gUnknown_08587FA4 @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 .pool 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, =0x02039f34 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 .pool @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, =0x02039f34 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, =0x02039f20 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 .pool @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, =0x02039f08 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, =0x02039f34 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, =0x02039f34 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, =0x02039f00 add r2, r10 movs r6, 0 ldrsh r1, [r2, r6] ldr r7, =0x02039f00 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, =0x02039f20 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 beq @080DF354 ldr r2, =0x02039f34 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, =0x02039f00 add r0, r10 movs r7, 0 ldrsh r6, [r0, r7] str r6, [sp, 0x34] ldr r2, =0x02039f00 ldr r0, =0x02039f18 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, =0x02039f34 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, =0x02039f34 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, =0x0000ffff strh r0, [r1, 0xA] movs r0, 0 ldr r2, [sp, 0x28] strb r0, [r2, 0x5] movs r4, 0 ldr r0, =0x02039f34 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, =0x02039f34 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, =0x0000ffff 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 .pool @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, =0x02039f34 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 .pool 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, =0x02039f20 ldr r0, =0x02039f25 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, =0x02039f34 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, =0x02039f00 adds r0, r2, r1 movs r6, 0 ldrsh r5, [r0, r6] str r5, [sp, 0x8] adds r5, r1, 0 ldr r0, =0x02039f18 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, =0x02039f34 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, =0x02039f34 ldr r0, [r1] ldr r0, [r0, 0x1C] ldrb r4, [r0, 0x1D] movs r3, 0x2 b @080DF638 .align 2, 0 .pool @080DF628: mov r1, sp movs r0, 0 strb r0, [r1] ldr r1, =0x02039f34 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 .pool @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, =0x02039f34 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, =0x02039f34 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 .pool 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, =0x02000000 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 .pool @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, =0x020322d5 ldrb r0, [r0] cmp r0, 0 bne @080DF766 b @080DF924 @080DF766: ldr r0, =0x02000000 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, =0x02000000 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, =gUnknown_085ED1B2 bl gf_strcpy adds r5, r0, 0 ldr r0, =0x02039f26 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, =0x02039f34 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, =0x02039f26 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 .pool @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, =gUnknown_085ED1B5 bl gf_strcpy ldr r0, =0x02039f34 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, =0x02039f26 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 .pool 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 ; s8 CreateShopMainMenu(s8 type) 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, =0x02039f60 strb r4, [r5, 0xF] cmp r4, 0 bne @080DFACC ldr r0, =gUnknown_08589A38 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] ldr r4, =gUnknown_08589A10 adds r0, r4, 0 movs r1, 0x3 bl GetMaxWidthInMenuTable lsls r0, 24 ldr r2, =0x00ffffff 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 .pool @080DFACC: ldr r0, =gUnknown_08589A38 ldr r1, [r0, 0xC] ldr r0, [r0, 0x8] str r0, [sp, 0x8] str r1, [sp, 0xC] ldr r4, =gUnknown_08589A28 adds r0, r4, 0 movs r1, 0x2 bl GetMaxWidthInMenuTable lsls r0, 24 ldr r2, =0x00ffffff 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, =0x02039f60 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, =Task_ShopMenu movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r0, 24 add sp, 0x10 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end CreateShopMainMenu thumb_func_start SetShopMenuCallback ; void SetShopMenuCallback() SetShopMenuCallback: ; 80DFB4C ldr r1, =0x02039f60 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end SetShopMenuCallback thumb_func_start SetShopItemsForSale ; int SetShopItemsForSale(s16 *itemsForSale) SetShopItemsForSale: ; 80DFB58 push {lr} adds r1, r0, 0 movs r2, 0 ldr r3, =0x02039f60 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 .pool 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, =0x02039f60 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 .pool 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, =0x03005e08 adds r4, r1, r2 ldr r3, =sub_80DFD94 lsrs r0, r3, 16 strh r0, [r4, 0x10] strh r3, [r4, 0x12] subs r2, 0x8 adds r1, r2 ldr r0, =sub_80DFCA4 str r0, [r1] movs r0, 0x1 movs r1, 0 bl fade_screen pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r1, r2 ldr r3, =sub_81AAC00 lsrs r0, r3, 16 strh r0, [r4, 0x10] strh r3, [r4, 0x12] subs r2, 0x8 adds r1, r2 ldr r0, =sub_80DFCA4 str r0, [r1] movs r0, 0x1 movs r1, 0 bl fade_screen pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end HandleShopSell thumb_func_start sub_80DFC48 sub_80DFC48: ; 80DFC48 push {lr} ldr r0, =0x03005dac ldr r1, =sub_80DFCE0 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f60 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 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r0, =0x02037fd4 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 .pool thumb_func_end sub_80DFCA4 thumb_func_start sub_80DFCE0 sub_80DFCE0: ; 80DFCE0 push {lr} bl pal_fill_black ldr r0, =sub_80DFCF8 movs r1, 0x8 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f60 ldrb r0, [r0, 0xF] cmp r0, 0x2 bne @080DFD2C ldr r1, =gUnknown_085E95C7 ldr r2, =sub_80DFD44 adds r0, r4, 0 bl sub_81978EC b @080DFD36 .align 2, 0 .pool @080DFD2C: ldr r1, =gUnknown_085E959B ldr r2, =sub_80DFD44 adds r0, r5, 0 bl sub_81978EC @080DFD36: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f60 ldrb r0, [r0, 0xF] bl CreateShopMainMenu adds r0, r4, 0 bl remove_task pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =sub_80E0AC8 movs r1, 0x8 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x03006310 movs r1, 0 movs r2, 0 bl calls_per_item_funcs_in_list_outer ldr r2, =0x03005e00 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, =sub_80DFD80 bl SetVBlankCallback ldr r0, =sub_80DFD64 bl set_callback2 b @080DFEF4 .align 2, 0 .pool @080DFE20: bl vblank_hblank_handler_set_zero str r4, [sp, 0x8] movs r1, 0xE0 lsls r1, 19 ldr r2, =0x01000100 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, =0x02039f70 ldr r0, =0x000020b0 bl malloc_and_clear str r0, [r4] ldr r1, =0x0000200b adds r0, r1 movs r1, 0xFF strb r1, [r0] ldr r0, [r4] ldr r1, =0x0000200d adds r0, r1 movs r1, 0x1 negs r1, r1 strb r1, [r0] ldr r0, [r4] ldr r1, =0x0000200e 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 .pool @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, =0x02039f70 ldr r0, [r0] bl free ldr r0, =0x02039f74 ldr r0, [r0] bl free ldr r0, =0x02039f78 ldr r0, [r0] bl free bl Window_FreeMemory pop {r0} bx r0 .align 2, 0 .pool thumb_func_end FreeShopItemNames thumb_func_start GetShopItemNames GetShopItemNames: ; 80DFF2C push {r4-r7,lr} ldr r7, =0x02039f74 ldr r4, =0x02039f60 ldrh r0, [r4, 0xC] adds r0, 0x1 lsls r0, 3 bl malloc str r0, [r7] ldr r5, =0x02039f78 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, =0x02039f78 lsls r5, r6, 4 ldr r0, [r4] adds r0, r5 ldr r1, =gUnknown_085E8CF7 bl gf_strcpy ldr r2, =0x02039f74 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, =0x03006310 adds r1, r3, 0 ldr r0, =gUnknown_08589A48 ldm r0!, {r4-r6} stm r1!, {r4-r6} ldm r0!, {r4-r6} stm r1!, {r4-r6} ldr r0, [r2] str r0, [r3] ldr r0, =0x02039f60 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 .pool @080DFFDC: strh r1, [r3, 0xE] @080DFFDE: ldr r0, =0x02039f70 ldr r0, [r0] ldr r1, =0x03006310 ldrh r1, [r1, 0xE] ldr r2, =0x00002004 adds r0, r2 strh r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end GetShopItemNames thumb_func_start GetShopItemName ; void GetShopItemName(ShopItem *items1, s16 itemId, char *name) GetShopItemName: ; 80E0000 push {r4-r6,lr} adds r6, r0, 0 adds r5, r2, 0 lsls r1, 16 lsrs r4, r1, 16 ldr r0, =0x02039f60 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 .pool @080E0020: lsls r1, r4, 5 ldr r0, =gUnknown_085A5C09 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 .pool 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, =0x02039f70 ldr r1, [r1] ldr r2, =0x0000200c adds r1, r2 ldrb r1, [r1] bl AddItemIconObjectInShop b @080E008A .align 2, 0 .pool @080E0078: ldr r0, =0x0000ffff ldr r1, =0x02039f70 ldr r1, [r1] ldr r2, =0x0000200c adds r1, r2 ldrb r1, [r1] bl AddItemIconObjectInShop lsls r4, r7, 16 @080E008A: lsrs r4, 16 mov r8, r4 ldr r6, =0x02039f70 ldr r0, [r6] ldr r5, =0x0000200c 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, =0x02039f60 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 .pool @080E00D8: ldr r0, =gUnknown_085A5C08 lsls r1, r7, 5 adds r0, 0x18 adds r1, r0 ldr r4, [r1] b @080E00EA .align 2, 0 .pool @080E00E8: ldr r4, =gUnknown_085E93E0 @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 .pool 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, =0x02039f60 ldrb r0, [r0, 0xF] cmp r0, 0 bne @080E0164 ldr r5, =0x02021cc4 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 .pool @080E0164: ldr r0, =0x02021cc4 ldr r2, =gUnknown_085A5C08 lsls r1, 5 adds r1, r2 ldrh r1, [r1, 0x14] movs r2, 0 movs r3, 0x5 bl decimal_int_to_string @080E0176: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E969C 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, =gUnknown_08589AB3 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 .pool thumb_func_end PrintShopBuyPrice thumb_func_start sub_80E01C8 sub_80E01C8: ; 80E01C8 push {r4,r5,lr} sub sp, 0x10 ldr r5, =0x02039f70 ldr r2, [r5] ldr r4, =0x0000200b adds r0, r2, r4 ldrb r0, [r0] cmp r0, 0xFF bne @080E0206 ldr r0, =0x02039f60 ldrh r1, [r0, 0xC] adds r0, r1, 0x1 cmp r0, 0x8 ble @080E0206 subs r0, r1, 0x7 str r0, [sp] ldr r0, =0x00000834 str r0, [sp, 0x4] str r0, [sp, 0x8] ldr r1, =0x00002008 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 .pool thumb_func_end sub_80E01C8 thumb_func_start sub_80E0224 sub_80E0224: ; 80E0224 push {r4,lr} ldr r4, =0x02039f70 ldr r0, [r4] ldr r2, =0x0000200b adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @080E0242 bl sub_81AF620 ldr r0, [r4] ldr r1, =0x0000200b adds r0, r1 movs r1, 0xFF strb r1, [r0] @080E0242: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E8D60 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 .pool 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, =0x02039f70 ldr r4, =0x0000200d adds r1, r3, r4 ldr r0, [r0] adds r4, r0, r1 ldrb r0, [r4] cmp r0, 0xFF bne @080E0310 ldr r0, =0x02039f60 ldrb r0, [r0, 0xF] cmp r0, 0 beq @080E02AE ldr r0, =0x0000ffff cmp r2, r0 bne @080E02F0 @080E02AE: ldr r0, =0x0000083e 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, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 movs r1, 0x18 strh r1, [r0, 0x24] movs r1, 0x58 strh r1, [r0, 0x26] b @080E0310 .align 2, 0 .pool @080E02F0: lsls r0, r2, 24 lsrs r0, 24 ldr r2, =0x0000083e 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 .pool 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, =0x02039f70 ldr r2, =0x0000200d adds r1, r4, r2 ldr r0, [r0] adds r5, r0, r1 ldrb r0, [r5] cmp r0, 0xFF beq @080E0356 ldr r0, =0x0000083e 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, =0x02020630 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 .pool 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, =gUnknown_08589A60 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r4, =0x02039f70 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 .pool thumb_func_end sub_80E036C thumb_func_start sub_80E0424 sub_80E0424: ; 80E0424 push {lr} sub sp, 0x4 ldr r1, =gUnknown_08D9AFBC movs r2, 0xE8 lsls r2, 2 ldr r3, =0x000003e3 movs r0, 0 str r0, [sp] movs r0, 0x1 bl decompress_and_copy_tile_data_to_vram ldr r0, =gUnknown_08D9B0F0 ldr r1, =0x02039f70 ldr r1, [r1] bl call_LZZUnCompWram ldr r0, =gUnknown_08D9B0C8 movs r1, 0xC0 movs r2, 0x20 bl decompress_palette add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E0424 thumb_func_start sub_80E0468 sub_80E0468: ; 80E0468 push {lr} ldr r0, =gUnknown_08589A70 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 .pool 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, =gUnknown_08589AB0 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 .pool 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, =0x03005d8c 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 .pool 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, =0x02037318 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 .pool @080E0608: movs r5, 0x1 @080E060A: ldr r0, =0x000001ff 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 .pool @080E062C: asrs r0, r4, 16 mov r3, r9 ldr r2, [r3, 0x14] ldr r3, =0xfffffe00 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 .pool 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, =0x02039f70 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 .pool @080E06C0: ldr r6, =0x02039f70 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 .pool @080E06F8: ldr r6, =0x02039f70 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 .pool 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, =0x02039f70 ldr r3, =0x00002010 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, =0x02039f70 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, =0x0000fffc adds r0, r3, r1 ldr r2, [sp, 0x4] ldrh r2, [r2] adds r0, r2 lsls r0, 16 asrs r0, 16 ldr r4, =0x0000fffe 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, =0x00002010 adds r0, r1, r2 adds r0, r5 movs r2, 0 mov r10, r2 strh r6, [r0] ldr r2, =0x00002012 adds r0, r1, r2 adds r0, r5 strh r3, [r0] ldr r0, =0x00002014 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, =0x00002018 adds r1, r2 mov r12, r1 add r12, r5 lsls r0, 24 lsrs r0, 24 mov r1, r12 strh r0, [r1] ldr r1, =0x02037350 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 .pool @080E0870: cmp r0, 0x3 beq @080E0894 b @080E08A4 @080E0876: ldr r4, =0x00002016 adds r0, r2, r4 adds r0, r5 mov r1, r10 b @080E08B6 .align 2, 0 .pool @080E0884: ldr r4, =0x00002016 adds r0, r2, r4 adds r0, r5 movs r1, 0x1 b @080E08B6 .align 2, 0 .pool @080E0894: ldr r1, =0x00002016 adds r0, r2, r1 adds r0, r5 movs r1, 0x2 b @080E08B6 .align 2, 0 .pool @080E08A4: mov r2, r9 ldr r0, [r2] mov r2, r8 adds r1, r4, r2 lsls r1, 1 ldr r4, =0x00002016 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 .pool 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, =0x02039f70 mov r8, r0 ldr r1, =0x02037350 mov r10, r1 ldr r2, =0x02020630 mov r9, r2 @080E090A: mov r3, r8 ldr r0, [r3] lsls r1, r7, 2 adds r1, r7 lsls r5, r1, 1 ldr r4, =0x00002010 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, =0x00002010 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, =0x00002012 adds r1, r3, r2 adds r1, r5 ldrh r2, [r1] lsls r2, 4 adds r2, 0x8 lsls r2, 16 asrs r2, 16 ldr r1, =0x00002014 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, =nullsub_12 bl sub_808DD68 lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 ldr r2, =0x00002010 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, =0x00002016 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 .pool 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, =0x02039f70 ldr r0, [r0] movs r1, 0x80 lsls r1, 4 adds r4, r0, r1 adds r3, r0, 0 movs r1, 0 ldr r0, =0x0000c3e3 adds r6, r0, 0 ldr r5, =0x000003ff @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 .pool thumb_func_end sub_80E0A40 thumb_func_start sub_80E0A88 sub_80E0A88: ; 80E0A88 push {lr} ldr r2, =0x02039f70 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 .pool @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, =0x03005e08 adds r4, r0, r1 ldr r0, =0x02037fd4 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, =0x02039f70 ldr r2, [r7] ldr r3, =0x00002008 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 .pool @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, =0x02039f60 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 .pool @080E0B80: ldr r1, [r7] movs r3, 0x80 lsls r3, 6 adds r1, r3 ldr r2, =gUnknown_085A5C08 lsls r0, r5, 5 adds r0, r2 ldrh r0, [r0, 0x14] str r0, [r1] @080E0B92: ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 ldr r2, =0x02039f70 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, =gUnknown_085E9539 ldr r2, =sub_80E10A0 b @080E0C28 .align 2, 0 .pool @080E0BD0: ldr r4, =0x02039f60 ldrb r0, [r4, 0xF] cmp r0, 0 bne @080E0C38 lsls r0, r5, 16 lsrs r5, r0, 16 ldr r1, =0x02021cc4 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, =0x02021dc4 adds r0, r5, 0 bl sub_81B6CFC lsls r0, 16 lsrs r0, 16 movs r1, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 bl gf_strcpy ldr r1, =gUnknown_085E9417 b @080E0C26 .align 2, 0 .pool @080E0C24: ldr r1, =gUnknown_085E93EF @080E0C26: ldr r2, =sub_80E0CA4 @080E0C28: adds r0, r6, 0 bl sub_80E04E8 b @080E0C8E .align 2, 0 .pool @080E0C38: ldr r0, =0x02021cc4 lsls r1, r5, 5 ldr r2, =gUnknown_085A5C09 adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 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, =0x02021fc4 ldr r1, =gUnknown_085E9468 bl ExpandTextCodes b @080E0C84 .align 2, 0 .pool @080E0C7C: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9493 bl ExpandTextCodes @080E0C84: ldr r1, =0x02021fc4 ldr r2, =sub_80E0EAC adds r0, r6, 0 bl sub_80E04E8 @080E0C8E: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x02021cc4 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E93D5 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, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 bl decrypt_money ldr r1, =0x02039f70 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, =0x0000200a adds r1, r4, r0 movs r0, 0x63 strb r0, [r1] b @080E0D66 .align 2, 0 .pool @080E0D60: ldr r2, =0x0000200a adds r0, r4, r2 strb r1, [r0] @080E0D66: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_80E0D88 str r0, [r1] add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r5, r0, r1 adds r0, r5, 0x2 ldr r7, =0x02039f70 ldr r1, [r7] ldr r2, =0x0000200a 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 .pool @080E0DF0: ldr r0, =0x030022c0 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, =0x02021cc4 bl itemid_get_name ldr r0, =0x02021dc4 movs r2, 0x2 ldrsh r1, [r5, r2] movs r2, 0 movs r3, 0x2 bl decimal_int_to_string ldr r0, =0x02021ec4 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, =gUnknown_085E943F ldr r2, =sub_80E0EAC adds r0, r6, 0 bl sub_80E04E8 b @080E0EA4 .align 2, 0 .pool @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, =gUnknown_08589AA8 movs r2, 0 str r2, [sp] movs r2, 0x1 str r2, [sp, 0x4] movs r2, 0xD str r2, [sp, 0x8] ldr r2, =gUnknown_08589A08 str r2, [sp, 0xC] movs r2, 0x1 movs r3, 0 bl sub_8121F94 add sp, 0x10 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r0, r1 movs r0, 0x1 bl Window_WriteStandardTileMap ldr r6, =0x02039f60 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, =gUnknown_085E94C5 ldr r2, =sub_80E0F88 adds r0, r5, 0 bl sub_80E04E8 adds r0, r5, 0 bl sub_80E1204 b @080E0F7A .align 2, 0 .pool @080E0F30: ldr r1, =gUnknown_085E9558 ldr r2, =sub_80E10A0 b @080E0F60 .align 2, 0 .pool @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, =gUnknown_085E94E7 b @080E0F5E .align 2, 0 .pool @080E0F5C: ldr r1, =gUnknown_085E9510 @080E0F5E: ldr r2, =sub_80E0F88 @080E0F60: adds r0, r5, 0 bl sub_80E04E8 b @080E0F7A .align 2, 0 .pool @080E0F70: ldr r1, =gUnknown_085E957F ldr r2, =sub_80E10A0 adds r0, r7, 0 bl sub_80E04E8 @080E0F7A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r5] movs r4, 0x92 lsls r4, 3 adds r0, r4 ldr r1, =0x02039f70 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, =0x02039f60 ldrb r0, [r0, 0xF] cmp r0, 0 bne @080E0FF0 ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_80E100C b @080E0FFC .align 2, 0 .pool @080E0FF0: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_80E1078 @080E0FFC: str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r5, r0, r1 ldr r0, =0x030022c0 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, =gUnknown_085E95EA ldr r2, =sub_80E10A0 adds r0, r4, 0 bl sub_80E04E8 b @080E1072 .align 2, 0 .pool @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, =0x030022c0 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 .pool 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, =0x03005e08 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, =sub_80E0AC8 str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r0 movs r0, 0x4 movs r1, 0x11 bl Window_FastFillPixels ldr r0, =0x02039f70 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, =0x02021cc4 movs r2, 0x2 ldrsh r1, [r4, r2] movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool 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, =0x03005dac ldr r0, =sub_80DFCE0 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80E11B0 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080E11D6 bl sub_80E53F4 bl FreeShopItemNames ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 adds r0, r4, 0 bl remove_task @080E11D6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E11B0 thumb_func_start sub_80E11E4 sub_80E11E4: ; 80E11E4 push {lr} ldr r0, =0x02039f7c movs r1, 0 strb r1, [r0] ldr r0, =0x02039f80 movs r1, 0 movs r2, 0xC bl memset pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r1, r0 movs r3, 0 ldr r5, =0x02039f80 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 .pool @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, =0x02039f7c 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 .pool 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, =script_env_2_enable_and_set_ctx_running bl SetShopMenuCallback pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =script_env_2_enable_and_set_ctx_running bl SetShopMenuCallback pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =script_env_2_enable_and_set_ctx_running bl SetShopMenuCallback pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x03005e08 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, =@080E1474 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080E1474: .4byte @080E1490 .4byte @080E1498 .4byte @080E14A0 .4byte @080E14A8 .4byte @080E14B0 .4byte @080E14C4 .4byte @080E14D4 @080E1490: ldr r1, =gUnknown_08589ABA b @080E14C6 .align 2, 0 .pool @080E1498: ldr r1, =gUnknown_08589AC0 b @080E14C6 .align 2, 0 .pool @080E14A0: ldr r1, =gUnknown_08589AC6 b @080E14B2 .align 2, 0 .pool @080E14A8: ldr r1, =gUnknown_08589ACC b @080E14C6 .align 2, 0 .pool @080E14B0: ldr r1, =gUnknown_08589AD2 @080E14B2: movs r2, 0xC0 lsls r2, 4 adds r0, r3, 0 bl sub_80E12E8 b @080E14DE .align 2, 0 .pool @080E14C4: ldr r1, =gUnknown_08589AD8 @080E14C6: adds r0, r3, 0 movs r2, 0 bl sub_80E12E8 b @080E14DE .align 2, 0 .pool @080E14D4: ldr r1, =gUnknown_08589ADE 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 .pool 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, =sub_80E1444 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, =0x03005e08 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 .pool 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, =0x02039f8c strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E1558 thumb_func_start sub_80E1570 sub_80E1570: ; 80E1570 push {lr} ldr r0, =0x02039f8c ldrb r0, [r0] bl remove_task pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E1570 thumb_func_start sub_80E1584 sub_80E1584: ; 80E1584 push {lr} ldr r2, =0x03005e00 ldr r0, =0x02039f8c 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 .pool @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, =0x03005d8c ldr r1, [r0] ldr r0, =0x000031f8 adds r1, r0 ldr r2, =0x0100001a mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E15B8 thumb_func_start sub_80E15E4 sub_80E15E4: ; 80E15E4 push {r4,lr} adds r4, r0, 0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000031f8 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 .pool 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, =0x03005d8c ldr r1, [r4] ldr r2, =0x0000320c adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080E1674 ldr r2, =0x00003202 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080E1674 ldr r2, =0x000031f8 adds r0, r1, r2 bl sub_80E1610 ldr r1, [r4] ldr r2, =0x00003228 adds r1, r2 ldr r1, [r1] cmp r0, r1 bne @080E1674 movs r0, 0x1 b @080E1676 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000031f8 b @080E16B4 .align 2, 0 .pool @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, =gBerries - 0x1c ; 1-based array @080E16B4: adds r0, r1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80E167C thumb_func_start sub_80E16C0 sub_80E16C0: ; 80E16C0 lsls r0, 24 ldr r1, =0x03005d8c lsrs r0, 21 ldr r2, =0x0000169c adds r0, r2 ldr r1, [r1] adds r1, r0 adds r0, r1, 0 bx lr .align 2, 0 .pool thumb_func_end sub_80E16C0 thumb_func_start sub_80E16DC sub_80E16DC: ; 80E16DC push {lr} ldr r0, =0x03005df0 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 .pool @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, =gUnknown_082742F9 cmp r0, r1 bne @080E1768 ldr r0, =0x03005df0 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 .pool @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, =gUnknown_082742F9 cmp r0, r1 bne @080E178C bl sub_80E16DC lsls r0, 24 lsrs r0, 24 b @080E178E .align 2, 0 .pool @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, =0x03005d8c ldr r5, =0x0000169c ldr r0, =gUnknown_0858ABD0 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 .pool 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, =@080E17F0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_0858ABD0 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 .pool 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, =0x03005d8c lsls r0, r2, 3 ldr r3, =0x0000169c 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, =gUnknown_0858ABD0 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r4] str r1, [r4, 0x4] b @080E1910 .align 2, 0 .pool @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, =gUnknown_0858ABD0 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 .pool thumb_func_end sub_80E191C thumb_func_start sub_80E1984 sub_80E1984: ; 80E1984 lsls r0, 24 ldr r1, =0x03005d8c ldr r2, [r1] lsrs r0, 21 adds r2, r0 ldr r0, =0x0000169c adds r2, r0 ldr r0, =gUnknown_0858ABD0 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r2] str r1, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_80E1984 thumb_func_start sub_80E19AC sub_80E19AC: ; 80E19AC lsls r0, 24 ldr r1, =0x03005d8c ldr r1, [r1] lsrs r0, 21 adds r1, r0 ldr r0, =0x0000169c adds r1, r0 ldrb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80E19AC thumb_func_start sub_80E19C8 sub_80E19C8: ; 80E19C8 lsls r0, 24 ldr r1, =0x03005d8c ldr r1, [r1] lsrs r0, 21 adds r1, r0 ldr r0, =0x0000169d adds r1, r0 ldrb r0, [r1] lsls r0, 25 lsrs r0, 25 bx lr .align 2, 0 .pool 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, =0xff7b0000 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 .pool @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, =0xffff0000 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 .pool @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, =0x03005d8c 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 .pool 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, =0x03005df0 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, =0x020375f2 ldrb r0, [r0] ldr r1, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl sub_8092E9C lsls r0, 24 cmp r0, 0 beq @080E1BE0 ldr r1, =0x020375e0 movs r0, 0xFF strh r0, [r1] b @080E1BEE .align 2, 0 .pool @080E1BE0: ldr r4, =0x020375e0 adds r0, r5, 0 bl sub_80E19C8 lsls r0, 24 lsrs r0, 24 strh r0, [r4] @080E1BEE: ldr r4, =0x020375e2 adds r0, r5, 0 bl sub_80E1ACC lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r4, =0x020375e4 adds r0, r5, 0 bl sub_80E1B64 lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r1, =0x02021cc4 ldrh r2, [r4] adds r0, r6, 0 bl sub_80E1A58 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E1B94 thumb_func_start sub_80E1C2C sub_80E1C2C: ; 80E1C2C push {lr} ldr r0, =0x03005df0 ldrb r0, [r0] bl sub_808F110 lsls r0, 24 lsrs r0, 24 bl sub_80E19AC lsls r0, 24 lsrs r0, 24 ldr r1, =0x02021cc4 bl sub_80E1A38 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E1C2C thumb_func_start sub_80E1C54 sub_80E1C54: ; 80E1C54 push {r4,r5,lr} ldr r0, =0x03005df0 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, =0x02021cc4 adds r0, r5, 0 bl sub_80E1A58 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E1C54 thumb_func_start sub_80E1C94 sub_80E1C94: ; 80E1C94 push {lr} ldr r0, =c2_810A554 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E1C94 thumb_func_start sub_80E1CA4 sub_80E1CA4: ; 80E1CA4 push {r4,lr} ldr r0, =0x0203ce7c ldrh r0, [r0] bl berryid_from_itemid adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x03005df0 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 .pool thumb_func_end sub_80E1CA4 thumb_func_start sub_80E1CDC sub_80E1CDC: ; 80E1CDC push {r4-r6,lr} ldr r0, =0x03005df0 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, =0x020375e0 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 .pool thumb_func_end sub_80E1CDC thumb_func_start sub_80E1D28 sub_80E1D28: ; 80E1D28 push {lr} ldr r0, =0x03005df0 ldrb r0, [r0] bl sub_808F110 lsls r0, 24 lsrs r0, 24 bl sub_80E1984 ldr r0, =0x020375f2 ldrb r0, [r0] ldr r1, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl sub_8092EF0 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 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 .pool 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, =sub_80E2058 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080E1E4C ldr r0, =0x020375f0 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 .pool @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, =sub_80E2058 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080E1EA8 ldr r1, =0x020375f0 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 .pool @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, =0x03005d90 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 .pool @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, =gUnknown_0858B760 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 .pool 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, =0x02039f90 movs r0, 0x2 strb r0, [r1] movs r2, 0 ldr r6, =sub_80E2058 ldr r5, =gUnknown_0858BB68 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, =0x03005e00 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 .pool @080E202C: movs r0, 0 @080E202E: strh r0, [r1, 0x12] ldr r1, =0x03005e00 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 .pool 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, =0x03005e08 adds r5, r0, r1 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080E20FC ldr r1, =0x02039f90 ldrb r0, [r1] cmp r0, 0 beq @080E2090 subs r0, 0x1 strb r0, [r1] b @080E20FC .align 2, 0 .pool @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, =0x030022c0 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, =0x020375f0 movs r0, 0x7F strh r0, [r1] b @080E20EC .align 2, 0 .pool @080E20E8: ldr r0, =0x020375f0 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 .pool thumb_func_end sub_80E2058 thumb_func_start yes_no_box yes_no_box: ; 80E2108 push {r4,lr} ldr r4, =task_yes_no_maybe adds r0, r4, 0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080E2138 ldr r1, =0x020375f0 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 .pool @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, =0x020375f0 ldrh r0, [r0] cmp r0, 0xFF beq @080E2154 movs r0, 0x1 b @080E2156 .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =0x020375f0 movs r0, 0 b @080E21B8 .align 2, 0 .pool @080E21B4: ldr r1, =0x020375f0 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 .pool 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, =sub_80E2308 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 .pool @080E2210: ldr r0, =0x020375f0 movs r1, 0xFF strh r1, [r0] movs r2, 0 movs r6, 0 ldr r1, =gUnknown_0858B760 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, =gUnknown_0858B760 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, =sub_80E2308 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 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 .pool 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, =0x03005e08 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, =0x020375f0 movs r0, 0x7F strh r0, [r1] b @080E2350 .align 2, 0 .pool @080E234C: ldr r0, =0x020375f0 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 .pool thumb_func_end sub_80E2308 thumb_func_start sp109_CreatePCMenu ; bool sp109_CreatePCMenu() sp109_CreatePCMenu: ; 80E236C push {lr} ldr r0, =sub_80E2058 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080E2394 ldr r1, =0x020375f0 movs r0, 0xFF strh r0, [r1] bl CreatePCMenu movs r0, 0x1 b @080E2396 .align 2, 0 .pool @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, =gUnknown_0858BB70 @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, =0x00000864 adds r0, r6, 0 bl flag_check lsls r0, 24 cmp r0, 0 beq @080E23D4 ldr r0, =gUnknown_085EB18B 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, =gUnknown_085EB18B 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, =gUnknown_085EB198 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 .pool @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, =gUnknown_085EB198 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, =0x000008ab bl flag_check lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 beq @080E24B0 ldr r2, =gUnknown_085EB176 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 .pool @080E24B0: ldr r2, =gUnknown_085EB169 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, =0x02021fc4 ldr r1, =gUnknown_085EB183 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 .pool 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, =gUnknown_0827266F 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 .pool thumb_func_end sub_80E2514 thumb_func_start sub_80E2548 sub_80E2548: ; 80E2548 push {lr} ldr r0, =sub_80E2058 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080E2570 ldr r1, =0x020375f0 movs r0, 0xFF strh r0, [r1] bl sub_80E2578 movs r0, 0x1 b @080E2572 .align 2, 0 .pool @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, =0x03001124 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, =0x020375e0 ldrh r1, [r0] cmp r1, 0 bne @080E25D2 ldr r4, =0x03001124 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, =0x00000113 movs r1, 0x1 bl sub_80D6724 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080E2630 ldr r0, =0x000008b3 bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080E2630 ldr r2, =0x020375e0 ldrh r0, [r2] cmp r0, 0 bne @080E2606 ldr r0, =0x03001124 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, =0x03001124 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, =0x020375e0 ldrh r0, [r2] cmp r0, 0 bne @080E2668 ldr r0, =0x03001124 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, =0x000001db adds r0, r4, 0 bl flag_check lsls r0, 24 cmp r0, 0 bne @080E2690 ldr r0, =0x03001124 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, =0x00000173 movs r1, 0x1 bl sub_80D6724 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080E26EC ldr r0, =0x000008d5 bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080E26EC ldr r2, =0x020375e0 ldrh r0, [r2] cmp r0, 0 bne @080E26C4 ldr r0, =0x03001124 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, =0x000001af adds r0, r4, 0 bl flag_check lsls r0, 24 cmp r0, 0 bne @080E26EC ldr r0, =0x03001124 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, =0x000008d6 bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080E274C ldr r2, =0x020375e0 ldrh r0, [r2] cmp r0, 0 bne @080E2722 ldr r0, =0x03001124 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, =0x03001124 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, =0x03001124 adds r0, r5, r0 movs r1, 0x6 strb r1, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x020375e0 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, =0x020375e0 movs r0, 0xB strh r0, [r1] bl sub_813A128 b @080E2860 .align 2, 0 .pool @080E27A4: movs r1, 0 movs r4, 0 lsls r6, r7, 25 subs r0, r7, 0x1 mov r9, r0 ldr r5, =gUnknown_0858BB80 @080E27B0: ldr r0, =0x03001124 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, =gUnknown_0858BB80 mov r8, r0 @080E2802: ldr r0, =0x03001124 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 .pool thumb_func_end sub_80E2578 thumb_func_start sub_80E2878 sub_80E2878: ; 80E2878 push {lr} ldr r2, =0x020375f0 ldrh r0, [r2] cmp r0, 0x7F beq @080E288C ldr r0, =0x03001124 ldrh r1, [r2] adds r1, r0 ldrb r0, [r1] strh r0, [r2] @080E288C: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 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 .pool @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, =task_picbox 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, =0x03005e00 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, =0x02020630 lsls r1, r5, 4 adds r1, r5 lsls r1, 2 adds r0, r4, 0 adds r0, 0x1C adds r0, r1, r0 ldr r2, =nullsub_12 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 .pool @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, =task_picbox bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @080E29F4 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] ldr r0, =sub_80E29FC b @080E29F6 .align 2, 0 .pool @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, =task_picbox 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 .pool @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, =@080E2AB0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_0858BBAC b @080E2B12 .align 2, 0 .pool @080E2AD8: movs r0, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r4, =gUnknown_0858BB9C b @080E2B12 .align 2, 0 .pool @080E2AE8: movs r0, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r4, =gUnknown_0858BBBC b @080E2B12 .align 2, 0 .pool @080E2AF8: movs r0, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r4, =gUnknown_0858BBCC b @080E2B12 .align 2, 0 .pool @080E2B08: movs r0, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r4, =gUnknown_0858BBEC @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 .pool @080E2B40: movs r0, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r4, =gUnknown_0858BBE0 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 .pool thumb_func_end sub_80E2A94 thumb_func_start sp106_CreateStartMenu sp106_CreateStartMenu: ; 80E2B7C push {lr} ldr r0, =sub_80E2058 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080E2BA4 ldr r1, =0x020375f0 movs r0, 0xFF strh r0, [r1] bl CreateStartMenu movs r0, 0x1 b @080E2BA6 .align 2, 0 .pool @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, =gUnknown_085EB25C 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, =gUnknown_085EB264 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, =gUnknown_085EB26C 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, =gUnknown_085EB270 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, =0x03005d90 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, =gUnknown_085EB279 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, =gUnknown_085EB27E 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, =gUnknown_085EB285 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 .pool 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, =0x02039f90 movs r0, 0x2 strb r0, [r1] ldr r0, =sub_80E2058 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 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 .pool 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 ; int do_choose_name_or_words_screen(u8 type, sav2 *sav2_ptr, s16 player_gender, s16 a4, int a5, void ( *after_finishing_callback)()) 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, =0x02039f94 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 .pool @080E2DA8: ldr r1, =0x00001e2c adds r0, r1 strb r7, [r0] ldr r0, [r4] ldr r2, =0x00001e34 adds r1, r0, r2 strh r5, [r1] adds r2, 0x2 adds r1, r0, r2 strh r6, [r1] ldr r1, =0x00001e38 adds r2, r0, r1 ldr r1, [sp, 0x18] str r1, [r2] ldr r2, =0x00001e30 adds r1, r0, r2 mov r2, r8 str r2, [r1] ldr r1, =0x00001e3c adds r0, r1 ldr r2, [sp, 0x1C] str r2, [r0] cmp r7, 0 bne @080E2DDC bl start_timer1 @080E2DDC: ldr r0, =c2_choose_name_or_words_screen bl set_callback2 @080E2DE2: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x7 bhi @080E2E9C lsls r0, 2 ldr r1, =@080E2E28 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @080E2EA4 .align 2, 0 .pool @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 ; void choose_name_or_words_screen_setup() choose_name_or_words_screen_setup: ; 80E2EA8 push {r4-r7,lr} ldr r5, =0x02039f94 ldr r0, [r5] ldr r1, =0x00001e10 adds r0, r1 movs r2, 0 strb r2, [r0] ldr r1, [r5] ldr r3, =0x00001e18 adds r0, r1, r3 movs r4, 0 strh r2, [r0] ldr r7, =0x00001e1a adds r0, r1, r7 strh r2, [r0] ldr r0, =0x00001e1c 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, =0x00001e21 adds r0, r1 strb r3, [r0] ldr r1, [r5] ldr r6, =0x00001e28 adds r3, r1, r6 ldr r2, =gUnknown_0858BFD8 ldr r4, =0x00001e2c 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, =0x00001e22 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, =0x030022b0 ldrh r1, [r4] ldr r2, =0x00001e25 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, =0x00001e30 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 .pool 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, =0x02020630 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 .pool 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, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 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, =0x040000d4 mov r1, r8 str r1, [r2] str r0, [r2, 0x4] lsrs r0, r3, 2 movs r1, 0x85 lsls r1, 24 orrs r0, r1 str r0, [r2, 0x8] ldr r0, [r2, 0x8] movs r1, 0xA0 lsls r1, 19 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, =gUnknown_0858BE00 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, =gUnknown_0858BE10 adds r0, r1 bl Window_AddFromTemplate ldr r5, =0x02039f94 ldr r1, [r5] ldr r2, =0x00001e11 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, =0x0000080c 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 .pool thumb_func_end choose_name_or_words_screen_init_bgs thumb_func_start sub_80E3194 sub_80E3194: ; 80E3194 push {lr} ldr r0, =sub_80E31B0 movs r1, 0x2 bl AddTask ldr r0, =sub_80E4F58 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E3194 thumb_func_start sub_80E31B0 sub_80E31B0: ; 80E31B0 push {lr} ldr r0, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e10 adds r0, r1 ldrb r0, [r0] cmp r0, 0x9 bhi @080E3240 lsls r0, 2 ldr r1, =@080E31D8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_0858BEBB adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80E3244 thumb_func_start sub_80E3254 sub_80E3254: ; 80E3254 ldr r1, =gUnknown_0858BEBE ldr r0, =0x02039f94 ldr r0, [r0] ldr r2, =0x00001e22 adds r0, r2 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80E3254 thumb_func_start sub_80E3274 sub_80E3274: ; 80E3274 ldr r1, =gUnknown_0858BEC1 ldr r0, =0x02039f94 ldr r0, [r0] ldr r2, =0x00001e22 adds r0, r2 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80E3274 thumb_func_start sub_80E3294 sub_80E3294: ; 80E3294 push {r4-r6,lr} sub sp, 0x4 ldr r1, =gUnknown_08DD4544 movs r0, 0x3 bl sub_80E4CF8 ldr r5, =0x02039f94 ldr r0, [r5] ldr r1, =0x00001e22 adds r0, r1 movs r6, 0 movs r1, 0x1 strb r1, [r0] ldr r1, =gUnknown_08DD46E0 movs r0, 0x2 bl sub_80E4CF8 ldr r1, =gUnknown_08DD4620 movs r0, 0x1 bl sub_80E4CF8 ldr r0, [r5] ldr r1, =0x00001e12 adds r0, r1 ldrb r0, [r0] movs r1, 0 bl sub_80E4DE4 ldr r0, [r5] ldr r1, =0x00001e11 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, =0x00001e10 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 .pool thumb_func_end sub_80E3294 thumb_func_start sub_80E335C sub_80E335C: ; 80E335C push {lr} ldr r0, =0x02037fd4 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, =0x02039f94 ldr r1, [r0] ldr r0, =0x00001e10 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @080E3384: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e10 adds r0, r1 movs r1, 0x2 strb r1, [r0] @080E33CA: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039f94 ldr r0, [r4] ldr r1, =0x00001e2c 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, =0x00001e10 adds r0, r1 movs r1, 0x7 strb r1, [r0] movs r0, 0 b @080E343A .align 2, 0 .pool @080E342C: ldr r0, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e10 adds r0, r1 movs r1, 0x8 strb r1, [r0] movs r0, 0x1 @080E343A: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039f94 ldr r1, [r0] ldr r0, =0x00001e10 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 .pool thumb_func_end sub_80E3448 thumb_func_start sub_80E347C sub_80E347C: ; 80E347C push {r4,r5,lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @080E34C6 ldr r4, =0x02039f94 ldr r0, [r4] ldr r1, =0x00001e2c 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, =0x00001e3c adds r0, r1 ldr r0, [r0] bl set_callback2 ldr r0, =sub_80E31B0 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 .pool 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, =0x02021cc4 ldr r0, =0x00004036 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, =0x02021dc4 ldr r1, =0x02039f94 ldr r1, [r1] ldr r2, =0x00001e30 adds r1, r2 ldr r1, [r1] bl gf_strcpy b @080E3574 .align 2, 0 .pool @080E3534: ldr r4, =0x02021cc4 ldr r0, =0x00004036 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, =0x02021dc4 ldr r1, =0x02039f94 ldr r1, [r1] ldr r2, =0x00001e30 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r4, =0x02021ec4 bl get_unknown_box_id lsls r0, 24 lsrs r0, 24 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy movs r5, 0x2 @080E3574: ldr r0, =0x000008ab 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, =0x02021fc4 ldr r1, =gUnknown_0858BDB8 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, =0x03003014 ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] bl sav2_get_text_speed adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 movs r0, 0 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs 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 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080E362E ldr r0, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e10 adds r0, r1 movs r1, 0x8 strb r1, [r0] @080E362E: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e10 adds r0, r1 movs r1, 0x5 strb r1, [r0] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039f94 ldr r0, [r2] ldr r1, =0x00001e10 adds r0, r1 movs r1, 0x2 strb r1, [r0] ldr r1, [r2] ldr r3, =0x00001e22 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 .pool @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, =sub_80E375C 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 .pool 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, =gUnknown_0858BEC4 ldr r2, =0x03005e00 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 .pool thumb_func_end sub_80E375C thumb_func_start sub_80E3794 sub_80E3794: ; 80E3794 push {lr} ldr r0, =sub_80E375C 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 .pool @080E37AC: movs r0, 0x1 @080E37AE: pop {r1} bx r1 thumb_func_end sub_80E3794 thumb_func_start sub_80E37B4 sub_80E37B4: ; 80E37B4 ldr r1, =0x02039f94 ldr r1, [r1] ldr r3, =0x00001e18 adds r2, r1, r3 movs r3, 0 strh r3, [r2] ldr r2, =0x00001e1a 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 .pool 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, =0x02039f94 ldr r0, [r5] ldr r2, =0x00001e1a adds r1, r0, r2 str r1, [sp] ldr r1, =0x00001e18 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, =0x00001e21 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, =0x00001e1c 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 .pool 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, =0x02039f94 ldr r0, [r5] ldr r2, =0x00001e1a adds r1, r0, r2 str r1, [sp] ldr r3, =0x00001e18 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, =0x00001e21 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 .pool thumb_func_end sub_80E3870 thumb_func_start sub_80E3904 sub_80E3904: ; 80E3904 push {lr} ldr r0, =sub_80E375C 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 .pool thumb_func_end sub_80E3904 thumb_func_start sub_80E3920 sub_80E3920: ; 80E3920 push {lr} ldr r0, =c3_0809E58C movs r1, 0x3 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0x3 strh r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool 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, =c3_0809E58C bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x0000fffc strh r0, [r4, 0x10] b @080E3A6E .align 2, 0 .pool @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, =0x00000101 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 .pool 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, =0x02037b14 lsrs r0, 15 adds r2, r0, r2 ldr r1, =0x02037714 adds r0, r1 ldrh r0, [r0] strh r0, [r2] pop {r0} bx r0 .align 2, 0 .pool 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, =0x01010000 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 .pool 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, =gUnknown_0858BED4 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 .pool 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, =gUnknown_0858BEDC 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 .pool @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, =gUnknown_0858C138 movs r1, 0x26 movs r2, 0x58 movs r3, 0x1 bl obj_add_from_template_forward_search ldr r5, =0x02039f94 ldr r1, [r5] ldr r4, =0x00001e23 adds r1, r4 strb r0, [r1] movs r0, 0x1 bl sub_80E3E3C ldr r6, =0x02020630 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 .pool 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, =0x02039f94 ldr r1, [r1] ldr r2, =0x00001e23 adds r1, r2 ldrb r2, [r1] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 ldr r2, =0x02020630 adds r5, r1, r2 lsrs r1, r0, 16 mov r8, r1 asrs r6, r0, 16 ldr r4, =gUnknown_0858BEA0 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, =gUnknown_0858BEA3 lsls r0, 24 lsrs r0, 21 adds r0, r6, r0 adds r0, r1 ldrb r0, [r0] adds r0, 0x26 b @080E3DDA .align 2, 0 .pool @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, =0x02039f94 ldr r2, [r2] ldr r3, =0x00001e23 adds r2, r3 ldrb r3, [r2] lsls r2, r3, 4 adds r2, r3 lsls r2, 2 ldr r3, =0x02020630 adds r2, r3 ldrh r3, [r2, 0x2E] strh r3, [r0] ldrh r0, [r2, 0x30] strh r0, [r1] bx lr .align 2, 0 .pool 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, =0x02020630 ldr r1, =0x02039f94 ldr r4, [r1] ldr r1, =0x00001e23 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, =0xffffff00 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 .pool thumb_func_end sub_80E3E3C thumb_func_start sub_80E3E94 sub_80E3E94: ; 80E3E94 push {r4,r5,lr} lsls r0, 24 ldr r5, =0x02020630 ldr r1, =0x02039f94 ldr r4, [r1] ldr r1, =0x00001e23 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 .pool thumb_func_end sub_80E3E94 thumb_func_start sub_80E3ED8 sub_80E3ED8: ; 80E3ED8 push {lr} ldr r0, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e23 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x1 bl obj_anim_image_start pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E3ED8 thumb_func_start sub_80E3F04 sub_80E3F04: ; 80E3F04 ldr r2, =0x02020630 ldr r0, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e23 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 .pool 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, =gUnknown_0858BEE4 movs r2, 0 ldrsh r1, [r5, r2] adds r1, r0 ldrb r0, [r1] b @080E3F66 .align 2, 0 .pool @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, =gUnknown_0858BEA0 bl sub_80E3274 lsls r0, 24 lsrs r0, 24 adds r0, r4 ldrb r0, [r0] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80E3F70 thumb_func_start sub_80E3F8C sub_80E3F8C: ; 80E3F8C push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =gUnknown_0858C0C0 movs r1, 0xCC movs r2, 0x58 movs r3, 0 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039f94 ldr r1, [r1] ldr r2, =0x00001e24 adds r1, r2 strb r0, [r1] lsls r5, r0, 4 adds r5, r0 lsls r5, 2 ldr r0, =0x02020630 mov r8, r0 add r5, r8 ldr r1, =gUnknown_0858C050 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, =gUnknown_0858C0F0 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, =gUnknown_0858C058 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, =gUnknown_0858C0D8 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 .pool thumb_func_end sub_80E3F8C thumb_func_start sub_80E4050 sub_80E4050: ; 80E4050 ldr r0, =0x02039f94 ldr r2, [r0] ldr r1, =0x00001e24 adds r0, r2, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x2 strh r1, [r0, 0x2E] ldr r1, =0x00001e22 adds r2, r1 ldrb r1, [r2] strh r1, [r0, 0x30] bx lr .align 2, 0 .pool thumb_func_end sub_80E4050 thumb_func_start sub_80E4084 sub_80E4084: ; 80E4084 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =gUnknown_0858BEE8 @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 .pool 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, =0x02020630 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, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e22 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 .pool 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, =0x02020630 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, =0x0000fffc 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 .pool 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, =0x02020630 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 .pool 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, =gUnknown_0858BEF8 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, =gUnknown_0858BEFE 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 .pool thumb_func_end sub_80E41B8 thumb_func_start sub_80E4218 sub_80E4218: ; 80E4218 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =gUnknown_0858C108 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, =0x02020630 adds r4, r6 ldr r0, =gUnknown_0858C070 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, =gUnknown_0858C120 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 .pool thumb_func_end sub_80E4218 thumb_func_start sub_80E4290 sub_80E4290: ; 80E4290 push {r4-r6,lr} ldr r5, =0x02039f94 ldr r0, [r5] ldr r4, =0x00001e16 adds r0, r4 ldrh r1, [r0] subs r1, 0x5 ldr r0, =gUnknown_0858C150 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, =0x02020630 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, =0x00001e28 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, =gUnknown_0858C168 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, =0x02039f94 ldr r0, [r0] ldr r2, =0x00001e28 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 .pool thumb_func_end sub_80E4290 thumb_func_start sub_80E4354 sub_80E4354: ; 80E4354 push {lr} ldr r1, =gUnknown_0858BF04 ldr r0, =0x02039f94 ldr r0, [r0] ldr r2, =0x00001e28 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 .pool 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, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e34 adds r0, r1 ldrb r1, [r0] movs r0, 0 bl sub_808BD3C lsls r0, 24 lsrs r0, 24 ldr r1, =nullsub_12 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, =0x02020630 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 .pool thumb_func_end sub_80E4384 thumb_func_start sub_80E43E0 sub_80E43E0: ; 80E43E0 push {r4,lr} ldr r0, =gUnknown_0858C180 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, =0x02020630 adds r4, r0 ldr r1, =gUnknown_0858C078 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 .pool thumb_func_end sub_80E43E0 thumb_func_start sub_80E4420 sub_80E4420: ; 80E4420 push {lr} sub sp, 0xC bl sub_80D2F04 ldr r0, =0x02039f94 ldr r3, [r0] ldr r1, =0x00001e34 adds r0, r3, r1 ldrh r0, [r0] ldr r1, =nullsub_12 movs r2, 0 str r2, [sp] ldr r2, =0x00001e38 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, =0x02020630 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 .pool thumb_func_end sub_80E4420 thumb_func_start sub_80E447C sub_80E447C: ; 80E447C push {lr} sub sp, 0x4 ldr r1, =nullsub_12 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, =0x02020630 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 .pool 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, =gUnknown_0858BF18 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 .pool @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, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e10 adds r0, r1 movs r1, 0x3 strb r1, [r0] @080E4546: movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e10 adds r0, r1 movs r1, 0x6 strb r1, [r0] movs r0, 0x1 @080E45D2: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80E45A4 thumb_func_start sub_80E45E0 sub_80E45E0: ; 80E45E0 ldr r0, =0x02039f94 ldr r0, [r0] ldr r1, =0x00001e10 adds r0, r1 movs r1, 0x4 strb r1, [r0] movs r0, 0x1 bx lr .align 2, 0 .pool thumb_func_end sub_80E45E0 thumb_func_start sub_80E45F8 sub_80E45F8: ; 80E45F8 push {lr} ldr r0, =sub_80E465C movs r1, 0x1 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E45F8 thumb_func_start sub_80E460C sub_80E460C: ; 80E460C push {lr} ldr r0, =sub_80E465C bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldrb r0, [r1, 0xA] pop {r1} bx r1 .align 2, 0 .pool 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, =sub_80E465C bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0858BF28 ldr r2, =0x03005e00 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 .pool 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, =0x030022c0 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 .pool @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, =gUnknown_0858BF34 mov r0, sp movs r2, 0xA bl memcpy add r0, sp, 0xC mov r10, r0 ldr r1, =gUnknown_0858BF3E movs r2, 0xA bl memcpy mov r1, sp adds r1, 0x18 str r1, [sp, 0x2C] ldr r1, =gUnknown_0858BF48 ldr r0, [sp, 0x2C] movs r2, 0x8 bl memcpy mov r2, sp adds r2, 0x20 str r2, [sp, 0x30] ldr r1, =gUnknown_0858BF50 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, =0x030022c0 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 .pool @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, =0x02039f94 ldr r0, [r5] ldr r4, =0x00001e14 adds r0, r4 ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r1, [r5] adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x00001e28 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 .pool thumb_func_end sub_80E4894 thumb_func_start sub_80E48E8 sub_80E48E8: ; 80E48E8 push {r4,r5,lr} sub sp, 0x2C ldr r5, =0x02039f94 ldr r0, [r5] ldr r1, =0x00001e34 adds r0, r1 ldrh r1, [r0] movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 add r0, sp, 0xC bl gf_strcpy ldr r0, [r5] ldr r1, =0x00001e28 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, =0x00001e14 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 .pool thumb_func_end sub_80E48E8 thumb_func_start sub_80E4964 sub_80E4964: ; 80E4964 push {lr} ldr r1, =gUnknown_0858BF58 ldr r0, =0x02039f94 ldr r0, [r0] ldr r2, =0x00001e2c 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 .pool thumb_func_end sub_80E4964 thumb_func_start sub_80E498C sub_80E498C: ; 80E498C push {lr} ldr r1, =gUnknown_0858BF6C ldr r0, =0x02039f94 ldr r0, [r0] ldr r2, =0x00001e28 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 .pool 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, =gUnknown_085E8D49 add r0, sp, 0xC bl gf_strcpy ldr r5, =0x02039f94 ldr r0, [r5] ldr r1, =0x00001e36 adds r0, r1 ldrh r0, [r0] cmp r0, 0xFF beq @080E4A0C cmp r0, 0xFE bne @080E49E6 ldr r1, =gUnknown_085E8D4B add r0, sp, 0xC bl gf_strcpy movs r4, 0x1 @080E49E6: ldr r0, [r5] ldr r1, =0x00001e13 adds r0, r1 ldrb r0, [r0] lsls r1, r4, 1 adds r1, r4 ldr r2, =gUnknown_0858BF74 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 .pool 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, =gUnknown_0858BE40 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 .pool thumb_func_end sub_80E4A2C thumb_func_start sub_80E4A60 sub_80E4A60: ; 80E4A60 push {r4,r5,lr} movs r2, 0 ldr r0, =0x02039f94 ldr r4, [r0] ldr r3, =0x00001e28 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 .pool @080E4A90: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, r3 bcc @080E4A7C @080E4A9A: ldr r0, [r5] ldr r1, =0x00001e28 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 .pool thumb_func_end sub_80E4A60 thumb_func_start sub_80E4AB4 sub_80E4AB4: ; 80E4AB4 push {lr} ldr r0, =0x02039f94 ldr r2, [r0] ldr r1, =0x00001e28 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 .pool @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, =0x02039f94 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 .pool 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, =0x02039f94 ldr r1, [r1] ldr r2, =0x00001e28 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 .pool @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, =0x02039f94 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 .pool thumb_func_end sub_80E4BBC thumb_func_start sub_80E4BE4 sub_80E4BE4: ; 80E4BE4 push {r4,r5,lr} movs r2, 0 ldr r1, =0x02039f94 ldr r0, [r1] ldr r4, =0x00001e28 adds r0, r4 ldr r0, [r0] adds r5, r1, 0 b @080E4C44 .align 2, 0 .pool @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, =0x00001e30 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 .pool @080E4C34: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 adds r1, r5, 0 ldr r0, [r1] ldr r4, =0x00001e28 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 .pool 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, =gUnknown_08DD3838 ldr r6, =0x02039f94 ldr r1, [r6] ldr r4, =0x00001810 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, =gUnknown_0858C1C8 bl gpu_tile_obj_alloc_and_load_multiple ldr r0, =gUnknown_0858C230 bl gpu_pal_obj_alloc_and_load_multiple pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08DD3778 movs r1, 0 movs r2, 0xC0 bl gpu_pal_apply ldr r0, =gUnknown_0858BD78 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 .pool 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, =0x02039f94 ldr r1, [r7] ldr r2, =0x00001e28 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, =0x00001e13 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, =gUnknown_085E8218 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, =0x00001e13 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, =0x02039f94 ldr r0, [r5] ldr r4, =0x00001e13 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 .pool 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, =gUnknown_0858BF88 adds r0, r5, r0 ldrb r1, [r0] adds r0, r6, 0 bl Window_FastFillPixels movs r4, 0 ldr r1, =gUnknown_0858BF8C lsls r0, r5, 2 adds r0, r1 ldr r7, [r0] ldr r0, =gUnknown_0858C198 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 .pool 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, =0x02039f94 ldr r0, [r1] ldr r2, =0x00001e11 b @080E4E96 .align 2, 0 .pool @080E4E8C: movs r5, 0x2 movs r6, 0x2 ldr r1, =0x02039f94 ldr r0, [r1] ldr r2, =0x00001e12 @080E4E96: adds r0, r2 ldrb r4, [r0] adds r0, r1, 0 ldr r1, =gUnknown_0858BF98 ldr r0, [r0] ldr r2, =0x00001e22 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 .pool thumb_func_end sub_80E4E5C thumb_func_start sub_80E4EF0 sub_80E4EF0: ; 80E4EF0 push {r4,r5,lr} sub sp, 0x10 ldr r1, =gUnknown_0858BFA4 add r0, sp, 0xC movs r2, 0x3 bl memcpy ldr r5, =0x02039f94 ldr r0, [r5] ldr r4, =0x00001e15 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, =gUnknown_085EEAF6 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 .pool 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, =sub_80E4F94 bl SetVBlankCallback pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f94 ldr r0, [r5] ldr r1, =0x00001e18 adds r0, r1 ldrh r1, [r0] movs r0, 0x16 bl lcd_io_set ldr r0, [r5] ldr r1, =0x00001e1a adds r0, r1 ldrh r1, [r0] movs r0, 0x1A bl lcd_io_set movs r0, 0xA bl lcd_io_get ldr r4, =0x0000fffc adds r1, r4, 0 ands r1, r0 movs r0, 0xA bl lcd_io_set ldr r0, [r5] ldr r1, =0x00001e1c 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, =0x00001e1e adds r0, r1 ldrh r1, [r0] movs r0, 0xC bl lcd_io_set_bits pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0858BDC8 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 .pool thumb_func_end sub_80E503C thumb_func_start sub_80E5074 sub_80E5074: ; 80E5074 push {lr} sub sp, 0x8 ldr r0, =0x03005d90 ldr r1, [r0] ldrb r2, [r1, 0x8] movs r0, 0 str r0, [sp] ldr r0, =sub_8086194 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 .pool thumb_func_end sub_80E5074 thumb_func_start sub_80E509C sub_80E509C: ; 80E509C push {lr} sub sp, 0x8 ldr r0, =0x03005d90 ldr r1, [r0] ldrb r2, [r1, 0x8] movs r0, 0 str r0, [sp] ldr r0, =sub_8086194 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 .pool thumb_func_end sub_80E509C thumb_func_start sub_80E50C4 sub_80E50C4: ; 80E50C4 push {lr} sub sp, 0x8 ldr r0, =0x03005d90 ldr r1, [r0] ldrb r2, [r1, 0x8] movs r0, 0 str r0, [sp] ldr r0, =sub_8086194 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 .pool thumb_func_end sub_80E50C4 thumb_func_start sub_80E50EC sub_80E50EC: ; 80E50EC push {lr} sub sp, 0x8 ldr r0, =0x03005d90 ldr r1, [r0] ldrb r2, [r1, 0x8] movs r0, 0 str r0, [sp] ldr r0, =sub_8086194 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 .pool thumb_func_end sub_80E50EC thumb_func_start decrypt_money ; int decrypt_money(int *money_ptr) decrypt_money: ; 80E5114 ldr r1, =0x03005d90 ldr r1, [r1] adds r1, 0xAC ldr r0, [r0] ldr r1, [r1] eors r0, r1 bx lr .align 2, 0 .pool thumb_func_end decrypt_money thumb_func_start encrypt_money ; void encrypt_money(int *money_ptr, int value) encrypt_money: ; 80E5128 ldr r2, =0x03005d90 ldr r2, [r2] adds r2, 0xAC ldr r2, [r2] eors r2, r1 str r2, [r0] bx lr .align 2, 0 .pool thumb_func_end encrypt_money thumb_func_start is_money_greater_than ; int is_money_greater_than(int *money_ptr, int amount) 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 ; void add_money(int *money_ptr, int amount) 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, =0x000f423f 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 .pool thumb_func_end add_money thumb_func_start subtract_money ; void subtract_money(int *money_ptr, int amount) 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, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 ldr r1, =0x020375e2 ldrh r1, [r1] bl is_money_greater_than lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80E51B0 thumb_func_start sub_80E51D4 sub_80E51D4: ; 80E51D4 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x92 lsls r1, 3 adds r0, r1 ldr r1, =0x020375e2 ldrh r1, [r1] bl subtract_money pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E51D4 thumb_func_start PrintMoneyAmountInMoneyBox ; void PrintMoneyAmountInMoneyBox(u8 windowId, int amount, s8 a3) 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 ; void PrintMoneyAmount(u8 windowId, char x, char y, int amount, u8 a5) 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, =0x02021cc4 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, =0x02021fc4 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, =gUnknown_085E969C adds r0, r2, 0 bl ExpandTextCodes ldr r2, =0x02021fc4 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 .pool thumb_func_end PrintMoneyAmount thumb_func_start set_window_border_style_and_print_money_box ; void set_window_border_style_and_print_money_box(u8 windowId, u16 tileStart, u8 palette, int amount) 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, =0x02039f98 ldrb r0, [r0] movs r2, 0 bl PrintMoneyAmountInMoneyBox pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E52D4 thumb_func_start sub_80E52EC ; void sub_80E52EC(int money, int x, int y) 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, =0x02039f98 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 .pool thumb_func_end sub_80E52EC thumb_func_start sub_80E5384 sub_80E5384: ; 80E5384 push {r4,lr} bl sub_80E53F4 ldr r4, =0x02039f98 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 .pool 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, =gUnknown_0858C2A4 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0858C2AC bl gpu_pal_obj_decompress_and_apply ldr r0, =gUnknown_0858C28C 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, =0x02039f99 strb r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end AddMoneyTextObject thumb_func_start sub_80E53F4 sub_80E53F4: ; 80E53F4 push {lr} ldr r0, =0x02039f99 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_resources pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E53F4 thumb_func_start AreMovesContestCombo ; u8 AreMovesContestCombo(u16 moveId1, u16 moveId2) AreMovesContestCombo: ; 80E5414 push {r4,lr} sub sp, 0x4 lsls r0, 16 lsls r1, 16 ldr r2, =gContestMoves 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, =gComboStarterLookupTable adds r0, r4, r0 ldrb r0, [r0] b @080E5472 .align 2, 0 .pool @080E5470: movs r0, 0 @080E5472: add sp, 0x4 pop {r4} pop {r1} bx r1 thumb_func_end AreMovesContestCombo thumb_func_start ContestEffectFunc_080E547C ContestEffectFunc_080E547C: ; 80E547C bx lr thumb_func_end ContestEffectFunc_080E547C thumb_func_start ContestEffectFunc_080E5480 ContestEffectFunc_080E5480: ; 80E5480 push {lr} ldr r3, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5480 thumb_func_start ContestEffectFunc_080E54B0 ContestEffectFunc_080E54B0: ; 80E54B0 push {lr} ldr r3, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E54B0 thumb_func_start ContestEffectFunc_080E54E0 ContestEffectFunc_080E54E0: ; 80E54E0 ldr r3, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E54E0 thumb_func_start ContestEffectFunc_080E5534 ContestEffectFunc_080E5534: ; 80E5534 push {lr} ldr r3, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5534 thumb_func_start ContestEffectFunc_080E5560 ContestEffectFunc_080E5560: ; 80E5560 push {lr} ldr r3, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5560 thumb_func_start ContestEffectFunc_080E5590 ContestEffectFunc_080E5590: ; 80E5590 push {lr} ldr r3, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5590 thumb_func_start ContestEffectFunc_080E55BC ContestEffectFunc_080E55BC: ; 80E55BC push {lr} ldr r3, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E55BC thumb_func_start ContestEffectFunc_080E55EC ContestEffectFunc_080E55EC: ; 80E55EC push {r4,r5,lr} movs r2, 0 ldr r5, =0x02039f34 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, =0x02039f34 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x36 bl sub_80DD3F0 @080E564C: ldr r0, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E55EC thumb_func_start ContestEffectFunc_080E5664 ContestEffectFunc_080E5664: ; 80E5664 push {r4-r6,lr} movs r1, 0 ldr r2, =0x02039f34 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, =0x02039f34 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x36 bl sub_80DD3F0 @080E56C6: ldr r0, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5664 thumb_func_start ContestEffectFunc_080E56E0 ContestEffectFunc_080E56E0: ; 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] strh r1, [r0, 0x4] bl ContestEffectFunc_080E55EC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ContestEffectFunc_080E56E0 thumb_func_start ContestEffectFunc_080E5718 ContestEffectFunc_080E5718: ; 80E5718 push {r4-r7,lr} mov r7, r8 push {r7} movs r7, 0 ldr r1, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5718 thumb_func_start ContestEffectFunc_080E57CC ContestEffectFunc_080E57CC: ; 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, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E57CC thumb_func_start ContestEffectFunc_080E588C ContestEffectFunc_080E588C: ; 80E588C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} movs r0, 0 mov r9, r0 ldr r1, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E588C thumb_func_start ContestEffectFunc_080E5938 ContestEffectFunc_080E5938: ; 80E5938 push {r4,lr} ldr r4, =0x02039f34 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 ContestEffectFunc_080E5664 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 .pool thumb_func_end ContestEffectFunc_080E5938 thumb_func_start ContestEffectFunc_080E5970 ContestEffectFunc_080E5970: ; 80E5970 push {r4,lr} ldr r4, =0x02039f34 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, =gContestMoves 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 .pool thumb_func_end ContestEffectFunc_080E5970 thumb_func_start ContestEffectFunc_080E59B0 ContestEffectFunc_080E59B0: ; 80E59B0 push {lr} movs r0, 0 bl sub_80E6934 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x30 bl sub_80DD3D4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ContestEffectFunc_080E59B0 thumb_func_start ContestEffectFunc_080E59D0 ContestEffectFunc_080E59D0: ; 80E59D0 push {lr} movs r0, 0x1 bl sub_80E6934 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x30 bl sub_80DD3D4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ContestEffectFunc_080E59D0 thumb_func_start ContestEffectFunc_080E59F0 ContestEffectFunc_080E59F0: ; 80E59F0 push {lr} movs r0, 0x2 bl sub_80E6934 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x30 bl sub_80DD3D4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ContestEffectFunc_080E59F0 thumb_func_start ContestEffectFunc_080E5A10 ContestEffectFunc_080E5A10: ; 80E5A10 push {lr} movs r0, 0x3 bl sub_80E6934 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x30 bl sub_80DD3D4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ContestEffectFunc_080E5A10 thumb_func_start ContestEffectFunc_080E5A30 ContestEffectFunc_080E5A30: ; 80E5A30 push {lr} movs r0, 0x4 bl sub_80E6934 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x30 bl sub_80DD3D4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end ContestEffectFunc_080E5A30 thumb_func_start ContestEffectFunc_080E5A50 ContestEffectFunc_080E5A50: ; 80E5A50 push {r4-r6,lr} movs r4, 0 ldr r2, =0x02039f34 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, =0x02039f34 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 .pool @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 ContestEffectFunc_080E5A50 thumb_func_start ContestEffectFunc_080E5AD4 ContestEffectFunc_080E5AD4: ; 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, =0x02039f34 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 .pool @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, =0x02039f34 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, =gContestMoves adds r0, r1 ldrb r0, [r0, 0x2] ldr r2, =gComboStarterLookupTable adds r0, r2 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 1 b @080E5BD2 .align 2, 0 .pool @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, =0x02039f34 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, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5AD4 thumb_func_start ContestEffectFunc_080E5CD4 ContestEffectFunc_080E5CD4: ; 80E5CD4 push {r4-r7,lr} mov r7, r8 push {r7} movs r0, 0 mov r8, r0 movs r6, 0 ldr r7, =0x02039f34 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, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5CD4 thumb_func_start ContestEffectFunc_080E5D7C ContestEffectFunc_080E5D7C: ; 80E5D7C push {r4-r7,lr} movs r7, 0 movs r4, 0 ldr r5, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5D7C thumb_func_start ContestEffectFunc_080E5E04 ContestEffectFunc_080E5E04: ; 80E5E04 push {r4,lr} ldr r1, =0x02039f26 ldr r0, =0x02039f34 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, =gContestEffects ldr r2, =gContestMoves 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 .pool thumb_func_end ContestEffectFunc_080E5E04 thumb_func_start ContestEffectFunc_080E5E5C ContestEffectFunc_080E5E5C: ; 80E5E5C push {r4,lr} ldr r1, =0x02039f26 ldr r0, =0x02039f34 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, =gContestEffects ldr r2, =gContestMoves 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 .pool thumb_func_end ContestEffectFunc_080E5E5C thumb_func_start ContestEffectFunc_080E5EB4 ContestEffectFunc_080E5EB4: ; 80E5EB4 push {r4-r7,lr} movs r1, 0 movs r5, 0 ldr r0, =0x02039f34 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, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E5EB4 thumb_func_start ContestEffectFunc_080E5F64 ContestEffectFunc_080E5F64: ; 80E5F64 push {r4-r7,lr} movs r6, 0 ldr r0, =0x02039f34 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 .pool @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 ContestEffectFunc_080E5F64 thumb_func_start ContestEffectFunc_080E5FE4 ContestEffectFunc_080E5FE4: ; 80E5FE4 push {r4,r5,lr} ldr r1, =0x02039f34 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 .pool @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 ContestEffectFunc_080E5FE4 thumb_func_start ContestEffectFunc_080E6068 ContestEffectFunc_080E6068: ; 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x1A bl sub_80DD3D4 b @080E60FC .align 2, 0 .pool @080E6098: cmp r0, 0x5 bhi @080E60B4 movs r4, 0x14 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x1B bl sub_80DD3D4 b @080E60FC .align 2, 0 .pool @080E60B4: cmp r0, 0x7 bhi @080E60D0 movs r4, 0x28 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x1C bl sub_80DD3D4 b @080E60FC .align 2, 0 .pool @080E60D0: cmp r1, 0x8 bhi @080E60EC movs r4, 0x3C ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x1D bl sub_80DD3D4 b @080E60FC .align 2, 0 .pool @080E60EC: movs r4, 0x50 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x1E bl sub_80DD3D4 @080E60FC: ldr r0, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E6068 thumb_func_start ContestEffectFunc_080E611C ContestEffectFunc_080E611C: ; 80E611C push {r4-r7,lr} mov r7, r8 push {r7} ldr r2, =0x02039f34 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, =0x02039f34 @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 .pool @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, =gContestMoves 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, =gContestEffects 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 .pool thumb_func_end ContestEffectFunc_080E611C thumb_func_start ContestEffectFunc_080E620C ContestEffectFunc_080E620C: ; 80E620C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x02039f34 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, =gContestMoves 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, =gContestEffects 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 .pool @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 ContestEffectFunc_080E620C thumb_func_start ContestEffectFunc_080E62B8 ContestEffectFunc_080E62B8: ; 80E62B8 push {r4-r7,lr} ldr r0, =0x02039f34 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, =0x02039f34 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 .pool @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 ContestEffectFunc_080E62B8 thumb_func_start ContestEffectFunc_080E6334 ContestEffectFunc_080E6334: ; 80E6334 push {r4,lr} ldr r4, =0x02039f34 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 .pool @080E6388: adds r0, r2, 0 movs r1, 0x3A bl sub_80DD3D4 @080E6390: pop {r4} pop {r0} bx r0 thumb_func_end ContestEffectFunc_080E6334 thumb_func_start ContestEffectFunc_080E6398 ContestEffectFunc_080E6398: ; 80E6398 push {lr} ldr r3, =0x02039f34 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 .pool @080E63DC: adds r0, r2, 0 movs r1, 0x3B bl sub_80DD3D4 @080E63E4: pop {r0} bx r0 thumb_func_end ContestEffectFunc_080E6398 thumb_func_start ContestEffectFunc_080E63E8 ContestEffectFunc_080E63E8: ; 80E63E8 push {r4-r7,lr} sub sp, 0x4 ldr r0, =0x02039f34 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 .pool @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 ContestEffectFunc_080E63E8 thumb_func_start ContestEffectFunc_080E6520 ContestEffectFunc_080E6520: ; 80E6520 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 ldr r0, =0x02039f34 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 .pool @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 ContestEffectFunc_080E6520 thumb_func_start ContestEffectFunc_080E6664 ContestEffectFunc_080E6664: ; 80E6664 bx lr thumb_func_end ContestEffectFunc_080E6664 thumb_func_start ContestEffectFunc_080E6668 ContestEffectFunc_080E6668: ; 80E6668 push {r4-r7,lr} sub sp, 0x8 ldr r0, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E6668 thumb_func_start ContestEffectFunc_080E6778 ContestEffectFunc_080E6778: ; 80E6778 push {lr} ldr r3, =gContestMoves ldr r0, =0x02039f34 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, =0x02039f2c 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 .pool thumb_func_end ContestEffectFunc_080E6778 thumb_func_start ContestEffectFunc_080E67BC ContestEffectFunc_080E67BC: ; 80E67BC push {r4-r7,lr} mov r7, r8 push {r7} movs r0, 0 mov r8, r0 movs r4, 0 ldr r5, =0x02039f34 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x11] movs r1, 0x36 bl sub_80DD3F0 @080E684A: ldr r0, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E67BC thumb_func_start ContestEffectFunc_080E6868 ContestEffectFunc_080E6868: ; 80E6868 push {r4,lr} ldr r0, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E6868 thumb_func_start ContestEffectFunc_080E68EC ContestEffectFunc_080E68EC: ; 80E68EC push {r4,lr} ldr r4, =0x02039f34 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 .pool thumb_func_end ContestEffectFunc_080E68EC 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, =0x02039f34 ldr r0, =gContestMoves 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 .pool @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, =0x02039f34 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 .pool thumb_func_end sub_80E6934 thumb_func_start sub_80E69C8 sub_80E69C8: ; 80E69C8 push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool @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, =0x02039f34 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 .pool 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, =sub_80E715C bl sub_80B37D4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E6BE8 thumb_func_start sub_80E6BF8 sub_80E6BF8: ; 80E6BF8 push {r4,lr} ldr r2, =0x03001134 ldr r0, =0x03005d8c ldr r1, [r0] ldr r3, =0x00001a9c adds r0, r1, r3 str r0, [r2] ldr r2, =0x03001138 ldr r4, =0x000027cc adds r0, r1, r4 str r0, [r2] ldr r2, =0x0300113c ldr r3, =0x00002b50 adds r0, r1, r3 str r0, [r2] ldr r2, =0x03001140 ldr r4, =0x00002e28 adds r0, r1, r4 str r0, [r2] ldr r2, =0x03001144 ldr r3, =0x00002e68 adds r0, r1, r3 str r0, [r2] ldr r2, =0x03001148 ldr r0, =0x02039f9c str r0, [r2] ldr r2, =0x0300114c ldr r0, =0x03005d90 ldr r0, [r0] ldr r4, =0x0000064c adds r3, r0, r4 str r3, [r2] ldr r2, =0x03001150 ldr r4, =0x00003b58 adds r1, r4 str r1, [r2] ldr r1, =0x03001154 adds r0, 0xDC str r0, [r1] ldr r0, =0x03001158 str r3, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E6BF8 thumb_func_start sub_80E6CA0 sub_80E6CA0: ; 80E6CA0 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x03001134 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, =0x03001138 ldr r1, [r0] movs r2, 0xE1 lsls r2, 2 adds r0, r4, 0 bl memcpy adds r0, r4, 0 bl sub_80F14F8 ldr r1, =0x00001004 adds r0, r5, r1 ldr r1, =0x0300113c ldr r1, [r1] movs r2, 0x40 bl memcpy ldr r2, =0x00001044 adds r0, r5, r2 ldr r1, =0x03001140 ldr r1, [r1] movs r2, 0x40 bl memcpy ldr r1, =0x00001084 adds r0, r5, r1 ldr r1, =0x03001144 ldr r1, [r1] movs r2, 0x28 bl memcpy ldr r2, =0x000010ac adds r0, r5, r2 bl sub_80E89F8 ldr r0, =0x0300114c ldr r0, [r0] ldr r2, =0x00001124 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, =0x000011c8 adds r1, r5, r2 strh r0, [r1] @080E6D1C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E6CA0 thumb_func_start sub_80E6D54 sub_80E6D54: ; 80E6D54 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x03001134 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, =0x03001138 ldr r1, [r0] movs r2, 0xE1 lsls r2, 2 adds r0, r4, 0 bl memcpy adds r0, r4, 0 bl sub_80F1208 ldr r1, =0x00001004 adds r0, r5, r1 ldr r1, =0x0300113c ldr r1, [r1] movs r2, 0x40 bl memcpy ldr r2, =0x00001044 adds r4, r5, r2 ldr r0, =0x03001140 ldr r1, [r0] adds r0, r4, 0 movs r2, 0x40 bl memcpy adds r0, r4, 0 bl sub_8120B70 ldr r1, =0x00001084 adds r0, r5, r1 ldr r1, =0x03001144 ldr r1, [r1] movs r2, 0x28 bl memcpy ldr r2, =0x000010ac adds r4, r5, r2 adds r0, r4, 0 bl sub_80E89F8 adds r0, r4, 0 bl sub_80E8A54 ldr r0, =0x0300114c ldr r0, [r0] ldr r1, =0x00001124 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, =0x000011c8 adds r1, r5, r2 strh r0, [r1] @080E6DEE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a018 ldr r0, [r0] bl sub_80E6CA0 b @080E6F12 .align 2, 0 .pool @080E6E50: ldr r0, =0x0203a018 ldr r0, [r0] bl sub_80E6D54 b @080E6F12 .align 2, 0 .pool @080E6E60: ldr r5, =0x0203a018 ldr r0, [r5] ldr r1, =0x03001134 ldr r1, [r1] movs r4, 0xC8 lsls r4, 4 adds r2, r4, 0 bl memcpy ldr r0, [r5] adds r0, r4 ldr r1, =0x03001138 ldr r1, [r1] movs r2, 0xE1 lsls r2, 2 bl memcpy ldr r0, [r5] ldr r1, =0x00001004 adds r0, r1 ldr r1, =0x0300113c ldr r1, [r1] movs r2, 0x40 bl memcpy ldr r0, [r5] ldr r2, =0x00001044 adds r0, r2 ldr r1, =0x03001140 ldr r1, [r1] movs r2, 0x40 bl memcpy ldr r0, [r5] ldr r1, =0x00001214 adds r0, r1 ldr r1, =0x03001150 ldr r1, [r1] movs r2, 0x40 bl memcpy ldr r0, [r5] ldr r2, =0x00001084 adds r0, r2 ldr r1, =0x03001144 ldr r1, [r1] movs r2, 0x28 bl memcpy ldr r0, [r5] ldr r1, =0x000010ac adds r0, r1 bl sub_80E89F8 ldr r0, [r5] ldr r4, =0x00001124 adds r0, r4 ldr r1, =0x0300114c 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, =0x00001210 adds r1, r2 strh r0, [r1] @080E6EFA: ldr r0, [r5] ldr r1, =0x00001254 adds r0, r1 ldr r1, =0x03001154 ldr r1, [r1] bl sub_80E8110 ldr r0, [r5] ldr r2, =0x000012dc adds r0, r2 bl sub_80E8260 @080E6F12: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a014 ldr r0, [r5] movs r1, 0xC8 lsls r1, 4 mov r8, r1 add r0, r8 bl sub_80E7B2C ldr r0, [r5] ldr r6, =0x00001230 lsls r4, 24 lsrs r4, 24 adds r1, r6, 0 adds r2, r4, 0 bl sub_80EAF80 ldr r3, [r5] ldr r1, =0x000010ac adds r0, r3, r1 add r3, r8 adds r1, r6, 0 adds r2, r4, 0 bl sub_80E7B60 ldr r0, [r5] ldr r1, =0x00001124 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, =0x00001004 adds r0, r1 adds r1, r6, 0 adds r2, r4, 0 bl sub_80F0C7C ldr r0, [r5] ldr r1, =0x00001044 adds r0, r1 adds r1, r6, 0 adds r2, r4, 0 bl sub_80E78C4 ldr r0, [r5] ldr r1, =0x00001084 adds r0, r1 adds r1, r6, 0 adds r2, r4, 0 bl sub_812287C ldr r0, [r5] ldr r1, =0x000011c8 adds r0, r1 adds r1, r4, 0 bl sub_80E7F68 b @080E70BE .align 2, 0 .pool @080E7014: ldr r5, =0x0203a014 ldr r0, [r5] movs r1, 0xC8 lsls r1, 4 mov r8, r1 add r0, r8 bl sub_80E7B2C ldr r0, [r5] ldr r6, =0x00001444 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, =0x00001004 adds r0, r1 adds r1, r6, 0 adds r2, r4, 0 bl sub_80F0C7C ldr r0, [r5] ldr r1, =0x00001044 adds r0, r1 adds r1, r6, 0 adds r2, r4, 0 bl sub_80E78C4 ldr r0, [r5] ldr r1, =0x00001084 adds r0, r1 adds r1, r6, 0 adds r2, r4, 0 bl sub_812287C ldr r3, [r5] ldr r1, =0x000010ac adds r0, r3, r1 add r3, r8 adds r1, r6, 0 adds r2, r4, 0 bl sub_80E7B60 ldr r0, [r5] ldr r1, =0x00001124 adds r0, r1 adds r1, r6, 0 adds r2, r4, 0 bl sub_80E7948 ldr r0, [r5] ldr r1, =0x00001210 adds r0, r1 adds r1, r4, 0 bl sub_80E7F68 ldr r0, [r5] ldr r1, =0x00001214 adds r0, r1 adds r1, r6, 0 adds r2, r4, 0 bl sub_80E7A14 ldr r0, [r5] ldr r1, =0x00001254 adds r0, r1 adds r1, r6, 0 adds r2, r4, 0 bl sub_80E8468 ldr r0, [r5] ldr r1, =0x000012dc 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 .pool 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, =0x03005e00 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 .pool 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, =0x03005e08 adds r5, r0, r1 movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0x5 bls @080E7176 b @080E730A @080E7176: lsls r0, 2 ldr r1, =@080E7188 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080E7188: .4byte @080E71A0 .4byte @080E7218 .4byte @080E724C .4byte @080E726C .4byte @080E72AC .4byte @080E72C0 @080E71A0: ldr r4, =0x0203a018 ldr r0, =0x00001444 bl malloc str r0, [r4] ldr r4, =0x0203a014 ldr r0, =0x00005110 bl malloc str r0, [r4] ldr r0, =0x020375e2 ldrb r0, [r0] bl sub_8009628 movs r0, 0x80 lsls r0, 7 movs r1, 0x1 bl var_set ldr r1, =0x03001130 movs r0, 0 strb r0, [r1] bl sub_80E6E24 bl sub_80FB00C movs r0, 0x1 strh r0, [r5] ldr r0, =sub_80E7324 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x14] ldr r0, =sub_80E7128 movs r1, 0x51 bl AddTask lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x1E] b @080E730A .align 2, 0 .pool @080E7218: ldr r2, =0x03005e00 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, =0x00000894 bl flag_set bl sub_80FB074 ldrb r0, [r5, 0x1E] bl remove_task b @080E730A .align 2, 0 .pool @080E724C: ldr r0, =sub_80E7FF8 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 .pool @080E726C: ldr r2, =0x03005e00 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, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @080E7296 bl sub_80B3050 lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x14] @080E7296: ldr r0, =gUnknown_085EEA8E bl sub_80E70F4 strh r4, [r5, 0x10] b @080E730A .align 2, 0 .pool @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, =0x03005e00 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, =0x0203a014 ldr r0, [r0] bl free ldr r0, =0x0203a018 ldr r0, [r0] bl free bl sub_808729C ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @080E72F8 ldr r0, =sub_80AF2B4 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 .pool 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, =0x03005e00 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 .pool @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, =0x0000012d cmp r1, r0 beq @080E7432 adds r0, 0x63 cmp r1, r0 beq @080E744A b @080E7566 .align 2, 0 .pool @080E7384: ldr r0, =gUnknown_085EEA7E 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 .pool @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, =0x0000012d b @080E7564 .align 2, 0 .pool @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, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080E746E b @080E7566 @080E746E: ldr r4, =0x02021cc4 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 .pool @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, =sub_80E756C str r0, [r5] bl sub_800A064 cmp r0, 0 beq @080E7504 ldr r0, =0x0203a018 ldr r0, [r0] adds r1, r5, 0 adds r1, 0xC bl sub_80E7808 ldr r0, =sub_80E7630 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, =0x0203a014 ldr r0, [r0] adds r1, r6, r1 adds r1, 0x12 bl sub_80E7808 ldr r1, =0x0300115c ldr r0, =0x00001230 str r0, [r1] b @080E7566 .align 2, 0 .pool @080E7504: ldr r0, =0x0203a018 ldr r0, [r0] adds r1, r5, 0 adds r1, 0xC bl sub_80E7808 ldr r0, =sub_80E7630 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, =0x0203a014 ldr r0, [r0] adds r1, r6, r1 adds r1, 0x12 bl sub_80E7808 ldr r1, =0x0300115c ldr r0, =0x00001444 str r0, [r1] b @080E7566 .align 2, 0 .pool @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, =0x03005e00 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, =@080E7598 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020228c4 movs r2, 0xC8 bl memcpy b @080E75FC .align 2, 0 .pool @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, =0x0300115c 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 .pool @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, =sub_80E77D4 str r0, [r5] @080E7624: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x0300115c 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, =0x0300115c 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 .pool @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, =0x0300115c 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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 adds r1, r0 ldr r0, =sub_80E776C str r0, [r1] ldr r0, =0x03001130 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 .pool thumb_func_end sub_80E77A0 thumb_func_start sub_80E77D4 sub_80E77D4: ; 80E77D4 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_80E77A0 str r0, [r1] ldr r1, =0x03001130 movs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x020223c4 adds r0, r1 bx lr .align 2, 0 .pool 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, =gUnknown_0858CF8C 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 .pool @080E7868: movs r0, 0 bl sub_800A2A4 adds r2, r0, 0 movs r0, 0x1 ands r2, r0 movs r3, 0 ldr r1, =gUnknown_0858CF8E 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 .pool @080E7894: movs r0, 0 bl sub_800A2A4 movs r1, 0x9 bl __umodsi3 adds r2, r0, 0 movs r3, 0 ldr r1, =gUnknown_0858CF94 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 .pool 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, =0x020229e8 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 .pool @080E7910: adds r0, r6, 0 adds r1, r4, 0 adds r2, r5, 0 bl sub_8120CD0 @080E791A: ldr r0, =0x03001140 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 .pool 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, =0x020229e8 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 .pool @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, =0x03001150 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 .pool @080E7A60: movs r4, 0 @080E7A62: ldr r0, =0x03001150 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 .pool 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, =0x03001160 @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 .pool thumb_func_end sub_80E7B2C thumb_func_start sub_80E7B54 sub_80E7B54: ; 80E7B54 ldr r0, =0x03001160 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x020229e8 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 .pool @080E7BF8: ldr r1, [sp, 0x30] mov r0, r8 muls r0, r1 ldr r2, [sp, 0x2C] adds r7, r2, r0 ldr r1, =0x020229e8 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 .pool @080E7C54: adds r0, r4, 0 bl sub_8009370 mov r4, r9 @080E7C5C: ldrh r1, [r5, 0x2C] ldr r0, =0x000015fc cmp r1, r0 bne @080E7C74 adds r0, r5, 0 adds r0, 0x2C bl sub_8009370 movs r1, 0x1 b @080E7C76 .align 2, 0 .pool @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, =gUnknown_0858CFB8 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 .pool @080E7EE8: add r6, sp, 0x24 ldr r4, =gUnknown_0858CFBE 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, =0x03005d8c 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, =0x0000310c 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 .pool 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, =0x00004001 ldrh r1, [r4] bl var_set ldr r0, =0x02021cc4 ldr r1, =0x020229f0 bl gf_strcpy ldrh r1, [r4] ldr r0, =0x00000113 cmp r1, r0 bne @080E7FEC ldr r0, =0x000008b3 bl flag_set b @080E7FEC .align 2, 0 .pool @080E7FE4: ldr r0, =0x00004001 movs r1, 0 bl var_set @080E7FEC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x9 bls @080E8012 b @080E810A @080E8012: lsls r0, 2 ldr r1, =@080E8024 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080E810A adds r0, r5, 0 bl remove_task b @080E810A .align 2, 0 .pool @080E80A4: movs r0, 0 bl sub_801048C lsls r0, 24 cmp r0, 0 bne @080E810A ldr r0, =sub_8153688 movs r1, 0x5 bl AddTask b @080E80F2 .align 2, 0 .pool @080E80C0: ldr r0, =sub_8153688 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @080E810A ldr r0, =0x030030fc 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 .pool @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, =0x03005d90 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 .pool @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, =0x33330000 cmp r0, r1 bls @080E8224 ldr r0, =0x03005d90 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 .pool @080E8224: ldr r0, =0x03005d90 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 .pool 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, =0x03005d90 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, =0x03005d90 mov r10, r1 ldr r2, =0x00000ee1 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, =0x00000ef1 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, =0x03005d90 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, =0x00000cf4 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, =0x00000d14 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, =0x00000dde adds r0, r3, r1 adds r0, r2 ldrh r0, [r0] mov r1, r8 strh r0, [r1, 0x20] ldr r1, =0x00000dea adds r0, r3, r1 adds r0, r2 ldrh r0, [r0] mov r1, r9 strh r0, [r1] ldr r1, =0x00000e08 adds r0, r3, r1 adds r0, r2 ldrh r0, [r0] mov r1, r9 strh r0, [r1, 0x20] ldr r1, =0x00000e1e adds r0, r3, r1 adds r0, r2 ldrh r1, [r0] movs r0, 0x82 lsls r0, 1 add r0, r10 strh r1, [r0] ldr r1, =0x00000cfc 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 .pool 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, =0x03005d90 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 .pool @080E84CC: ldr r4, =0x03005d90 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 .pool @080E8508: movs r5, 0 adds r6, r3, 0 @080E850C: movs r0, 0x1 eors r0, r5 ldr r7, =0x03005d90 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 .pool 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, =0x03001168 b @080E85A0 .align 2, 0 .pool @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, =0x03005d90 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, =0x03001168 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, =0x03001168 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, =0x03005d90 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, =0x0000057c 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, =0x03001168 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, =0x03001168 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 .pool 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, =0x03005d90 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, =0x03005d90 @080E8972: movs r0, 0x54 adds r1, r5, 0 muls r1, r0 ldr r2, =0x0000057c 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 .pool 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, =0x02039f9c ldr r4, =0x03005d8c 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, =0x0000310c adds r1, r0 adds r0, r5, 0 adds r0, 0x38 movs r2, 0x38 bl memcpy ldr r0, [r4] ldr r1, =0x00003030 adds r0, r1 adds r1, r5, 0 bl sub_806FA9C ldr r0, =0x03001148 ldr r1, [r0] adds r0, r6, 0 movs r2, 0x78 bl memcpy pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x01000028 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 .pool thumb_func_end sub_80E8AF0 thumb_func_start sub_80E8B28 sub_80E8B28: ; 80E8B28 push {r4,r5,lr} movs r4, 0 ldr r5, =0x03005d8c @080E8B2E: lsls r1, r4, 2 adds r1, r4 lsls r1, 5 ldr r0, =0x00001a9c 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 .pool thumb_func_end sub_80E8B28 thumb_func_start sub_80E8B58 sub_80E8B58: ; 80E8B58 ldr r0, =0x0203a01c ldr r1, =0x020375e0 ldrh r1, [r1] strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_80E8B58 thumb_func_start sub_80E8B6C sub_80E8B6C: ; 80E8B6C push {r4,lr} ldr r0, =0x020375f0 movs r1, 0 strh r1, [r0] movs r3, 0 adds r4, r0, 0 b @080E8B86 .align 2, 0 .pool @080E8B80: adds r0, r3, 0x1 lsls r0, 16 lsrs r3, r0, 16 @080E8B86: cmp r3, 0x13 bhi @080E8BB0 ldr r2, =0x0203a01c ldr r0, =0x03005d8c ldr r1, [r0] lsls r0, r3, 2 adds r0, r3 lsls r0, 5 adds r1, r0 ldr r0, =0x00001a9c adds r1, r0 ldrb r0, [r2] ldrb r1, [r1] cmp r0, r1 bne @080E8B80 movs r0, 0x1 strh r0, [r4] ldr r0, =0x00004054 adds r1, r3, 0 bl var_set @080E8BB0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E8B6C thumb_func_start sub_80E8BC8 sub_80E8BC8: ; 80E8BC8 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00001a9c adds r0, r1 ldrb r1, [r0] cmp r1, 0 beq @080E8BEC ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] b @080E8BF0 .align 2, 0 .pool @080E8BEC: ldr r0, =0x020375f0 strh r1, [r0] @080E8BF0: pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000fff 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 .pool @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, =0x020375e6 bl sub_80E8BF8 lsls r0, 24 lsrs r0, 24 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037318 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, =0x000003ff 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 .pool @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, =gUnknown_0858CFCC mov r8, r1 adds r7, r0, 0 mov r4, sp mov r6, r12 @080E8D80: ldr r0, =gUnknown_0858CFCC 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 .pool @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, =0x03005d8c ldr r0, [r2] ldr r1, =0x0203a01c ldrb r1, [r1] ldr r3, =0x00001a9c adds r0, r3 strb r1, [r0] movs r3, 0 ldr r5, =0x00001aa5 ldr r4, =0x03005d90 @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, =0x00004054 movs r1, 0 bl var_set ldr r6, =0x03005d8c ldr r4, [r6] ldr r0, =0x00001a9e adds r4, r0 ldr r1, =0x03005d90 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, =0x00001a9d 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, =0x00001aa9 adds r0, r3 movs r1, 0x2 strb r1, [r0] ldr r0, =0x00004026 ldr r1, =0x02037318 ldrb r1, [r1, 0x14] bl var_set pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c @080E8F0A: ldr r1, [r7] lsls r0, r4, 2 adds r0, r4 lsls r0, 5 adds r1, r0 ldr r0, =0x00001a9c 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, =gUnknown_0858CFCC @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 .pool @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, =0x0203a01c ldrb r0, [r0] movs r1, 0xA bl __udivsi3 ldr r2, =gUnknown_0858CFE8 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 .pool 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, =0x03005e00 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 .pool @080E8FF4: ldr r0, =0x02037fd4 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 .pool @080E900C: ldr r0, =0x00004054 bl var_get lsls r0, 16 lsrs r0, 16 ldr r1, =0x03005d8c ldr r2, [r1] lsls r1, r0, 2 adds r1, r0 lsls r1, 5 adds r2, r1 ldr r0, =0x00001aac 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, =0x03005dac ldr r1, =sub_80AF168 str r1, [r0] ldr r0, =c2_load_new_map bl set_callback2 adds r0, r4, 0 bl remove_task @080E904A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E8FD0 thumb_func_start sub_80E9068 sub_80E9068: ; 80E9068 push {lr} ldr r0, =sub_80E8FD0 movs r1, 0 bl AddTask movs r0, 0x1 movs r1, 0 bl fade_screen ldr r0, =0x03005d8c 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 .pool thumb_func_end sub_80E9068 thumb_func_start sub_80E909C sub_80E909C: ; 80E909C push {lr} ldr r0, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x9 bne @080E90C0 ldr r0, =0x00004097 bl var_get lsls r0, 16 cmp r0, 0 bne @080E90C0 movs r0, 0 b @080E90C2 .align 2, 0 .pool @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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =sub_80E90C8 movs r1, 0 bl AddTask add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080E91D4 ldr r0, =0x0203a01c ldrb r0, [r0] movs r1, 0xA bl __udivsi3 ldr r1, =0x03005d8c 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, =gUnknown_0858CFE8 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, =0x03005dac ldr r0, =sub_80E9108 str r0, [r1] ldr r0, =c2_load_new_map bl set_callback2 adds r0, r6, 0 bl remove_task @080E91D4: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E916C thumb_func_start sub_80E91F8 sub_80E91F8: ; 80E91F8 push {lr} ldr r0, =sub_80E916C movs r1, 0 bl AddTask movs r0, 0x1 movs r1, 0 bl fade_screen pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E91F8 thumb_func_start sub_80E9214 sub_80E9214: ; 80E9214 push {lr} ldr r0, =0x03005d8c 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 .pool @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, =0x00004054 bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r1, =0x03005d8c lsls r0, r5, 2 adds r0, r5 lsls r0, 5 ldr r2, =0x00001a9c 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, =gUnknown_085A5C08 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, =0x00000e21 bl setmaptile_0 b @080E9328 .align 2, 0 .pool @080E92F4: mov r0, r8 cmp r0, 0x1 bne @080E9328 ldr r0, =0x00004089 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, =0x00000e0a bl setmaptile_0 @080E9328: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000271c adds r1, r0, r1 str r1, [sp, 0x4] ldr r2, =0x00002728 adds r2, r0, r2 str r2, [sp, 0x8] movs r3, 0xC str r3, [sp, 0x10] b @080E939C .align 2, 0 .pool @080E9374: ldr r0, =0x00004054 bl var_get lsls r0, 16 lsrs r0, 16 ldr r2, =0x03005d8c lsls r1, r0, 2 adds r1, r0 lsls r1, 5 ldr r4, =0x00001a9c 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 .pool @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, =gUnknown_085A5C08 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, =0x02037318 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, =0x020375e0 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, =0x020375e4 mov r8, r4 ldr r0, [sp, 0x8] adds r1, r0, r6 ldrb r0, [r1] lsrs r0, 4 strh r0, [r4] ldr r7, =0x020375e6 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, =0x020375f0 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, =0x00003f20 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, =gUnknown_085A5C24 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, =0x020375e0 ldrh r0, [r0] adds r0, 0xAE lsls r0, 16 lsrs r0, 16 bl flag_clear ldrb r0, [r6] ldr r5, =0x03005d8c 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, =0x00004054 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 .pool @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, =0x020375e0 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 .pool thumb_func_end sub_80E933C thumb_func_start sub_80E9578 sub_80E9578: ; 80E9578 push {r4-r6,lr} movs r5, 0 ldr r1, =0x02037318 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, =0x03005d8c 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 .pool thumb_func_end sub_80E9578 thumb_func_start sub_80E95D4 sub_80E95D4: ; 80E95D4 push {r4,r5,lr} ldr r5, =0x0000401f ldr r4, =gUnknown_0858D060 ldr r0, =0x00004054 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 .pool 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, =0x0203a01c @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 .pool @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, =gUnknown_08275BB7 bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E9668 thumb_func_start sub_80E9680 sub_80E9680: ; 80E9680 push {lr} bl sub_80E8B58 bl sub_80E8B6C ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0x1 beq @080E969C movs r0, 0x1 b @080E969E .align 2, 0 .pool @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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x1 beq @080E96DC cmp r0, 0x1 bgt @080E96CC cmp r0, 0 beq @080E96D2 b @080E9714 .align 2, 0 .pool @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, =0x02037fd4 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 .pool @080E96F4: movs r0, 0x7E bl copy_saved_warp2_bank_and_enter_x_to_warp1 bl warp_in ldr r0, =0x03005dac ldr r1, =mapldr_default str r1, [r0] ldr r0, =c2_load_new_map 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 .pool thumb_func_end sub_80E96A4 thumb_func_start sub_80E9728 sub_80E9728: ; 80E9728 push {lr} ldr r0, =sub_80E96A4 movs r1, 0 bl AddTask movs r0, 0x1 movs r1, 0 bl fade_screen pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E9728 thumb_func_start sub_80E9744 sub_80E9744: ; 80E9744 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00001a9c adds r0, r1 ldr r1, =0x0203a01c ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 beq @080E9770 ldr r1, =0x020375f0 movs r0, 0x1 b @080E9774 .align 2, 0 .pool @080E9770: ldr r1, =0x020375f0 movs r0, 0 @080E9774: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c mov r8, r0 lsls r5, r1, 2 adds r5, r1 lsls r5, 5 ldr r4, [r0] adds r4, r5, r4 ldr r1, =0x00001a9e 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, =0x00001aa9 adds r0, r1 ldrb r1, [r0] adds r0, r6, 0 bl sub_8009308 ldr r1, =gUnknown_085EA72F adds r0, r6, 0 bl gf_strcat pop {r3} mov r8, r3 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80E9780 thumb_func_start sub_80E97EC sub_80E97EC: ; 80E97EC push {r4,lr} adds r4, r0, 0 ldr r0, =0x00004054 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 .pool thumb_func_end sub_80E97EC thumb_func_start sub_80E980C sub_80E980C: ; 80E980C push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =0x00004054 bl var_get lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005d8c mov r8, r1 lsls r5, r0, 2 adds r5, r0 lsls r5, 5 ldr r4, [r1] adds r4, r5, r4 ldr r0, =0x00001a9e adds r4, r0 ldr r6, =0x02021cc4 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, =0x00001aa9 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 .pool thumb_func_end sub_80E980C thumb_func_start sub_80E9878 sub_80E9878: ; 80E9878 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005d8c ldr r2, [r1] lsls r1, r0, 2 adds r1, r0 lsls r1, 5 adds r2, r1 ldr r0, =0x00001a9d adds r2, r0 ldrb r0, [r2] lsrs r0, 6 cmp r0, 0 bne @080E98A4 movs r0, 0 b @080E98A6 .align 2, 0 .pool @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, =0x03005d8c ldr r1, [r0] ldr r2, =0x00001ad0 adds r2, r1, r2 str r2, [sp] ldr r3, =0x00001a9c adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @080E993A b @080E9A60 @080E993A: movs r6, 0 ldr r7, =0x00001ae8 adds r7, r1, r7 str r7, [sp, 0x14] ldr r0, =0x00001b18 adds r0, r1, r0 str r0, [sp, 0xC] ldr r2, =0x00001b24 adds r2, r1, r2 str r2, [sp, 0x10] adds r3, 0x94 adds r3, r1, r3 str r3, [sp, 0x18] ldr r7, =0x00001b36 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, =0x020244ec 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, =0x020244ec @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, =0x020244ec 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 .pool thumb_func_end sub_80E9914 thumb_func_start sub_80E9A90 sub_80E9A90: ; 80E9A90 push {r4-r6,lr} ldr r5, =0x03005d8c ldr r0, [r5] ldr r4, =0x00001aaa adds r1, r0, r4 ldrh r6, [r1] ldr r1, =0x00001a9c 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 .pool 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, =0x02037318 ldr r4, [r0, 0x4] movs r6, 0 b @080E9B62 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00001a9c 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, =gUnknown_0858CFCC 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 .pool @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, =0x03005d8c ldr r0, [r5] ldr r4, =0x00001aaa adds r1, r0, r4 ldrh r6, [r1] ldr r1, =0x00001a9c 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 .pool 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, =0x00004054 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, =0x020375f0 strh r1, [r0] b @080E9C22 .align 2, 0 .pool @080E9C04: bl sub_80E9BA8 lsls r0, 24 lsrs r0, 24 cmp r0, 0x9 bls @080E9C1C ldr r1, =0x020375f0 movs r0, 0x2 b @080E9C20 .align 2, 0 .pool @080E9C1C: ldr r1, =0x020375f0 movs r0, 0 @080E9C20: strh r0, [r1] @080E9C22: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E9BDC thumb_func_start sub_80E9C2C sub_80E9C2C: ; 80E9C2C push {lr} ldr r0, =0x00004054 bl var_get ldr r1, =0x03005d8c ldr r2, [r1] lsls r0, 16 lsrs r0, 16 lsls r1, r0, 2 adds r1, r0 lsls r1, 5 adds r2, r1 ldr r0, =0x00001a9d 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 .pool thumb_func_end sub_80E9C2C thumb_func_start sub_80E9C74 sub_80E9C74: ; 80E9C74 push {lr} ldr r0, =sub_8126AD8 movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80E9C74 thumb_func_start sub_80E9C88 sub_80E9C88: ; 80E9C88 push {lr} ldr r0, =sub_80E9C9C movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x0203a020 movs r0, 0xDC lsls r0, 1 bl malloc_and_clear str r0, [r4] ldr r0, =gUnknown_0858D06C 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, =sub_80E9E90 str r1, [r0] b @080E9D1A .align 2, 0 .pool @080E9D10: ldr r1, =gUnknown_085EA785 ldr r2, =task_pc_turn_off adds r0, r6, 0 bl sub_81978EC @080E9D1A: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r7, r1, r0 movs r6, 0 movs r5, 0x1 ldr r0, =0x0203a020 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, =0x0203a020 ldr r1, [r4] lsls r3, r6, 3 adds r2, r1, r3 ldr r0, =gUnknown_085E8CF0 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 .pool @080E9DB8: movs r0, 0x8 strh r0, [r7, 0x6] @080E9DBC: ldr r2, =0x03006310 adds r1, r2, 0 ldr r0, =gUnknown_0858D07C 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 .pool 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, =0x03005e08 adds r4, r0 ldrb r0, [r4, 0xC] movs r1, 0 bl SetStandardWindowBorderStyle ldr r0, =0x03006310 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 .pool 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, =0x03005e08 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, =0x000013f8 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 .pool 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, =0x03005e08 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 .pool @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, =0x0203a020 ldr r0, [r0] bl free adds r0, r6, 0 bl task_pc_turn_off b @080E9F1A .align 2, 0 .pool @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, =0x03005e08 adds r5, r4, r6 ldrb r0, [r5, 0x10] bl sub_81AF620 ldr r0, =gUnknown_0858D06C ldr r1, [r0, 0xC] ldr r0, [r0, 0x8] str r0, [sp] str r1, [sp, 0x4] ldr r0, =gUnknown_0858D048 mov r8, r0 movs r1, 0x2 bl GetMaxWidthInMenuTable lsls r0, 24 ldr r2, =0x00ffffff 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, =sub_80E9FB0 str r0, [r4] add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0858D048 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 .pool 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, =0x03005e08 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, =0x02021cc4 ldrb r1, [r4, 0x8] bl sub_80E9780 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA737 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_80EA06C adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0858D058 adds r0, r4, 0 bl sub_8121F68 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x03005d8c 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, =0x00001a9d 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, =sub_80E9E90 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 .pool thumb_func_end sub_80EA08C thumb_func_start sub_80EA120 sub_80EA120: ; 80EA120 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_085EA762 ldr r2, =sub_80EA08C bl sub_81978EC pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =sub_80E9E90 str r0, [r4] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =sub_80E9E90 str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 bne @080EA1F4 ldr r0, =gUnknown_0823B4E8 bl script_env_1_execute_new_script b @080EA1FA .align 2, 0 .pool @080EA1F4: ldr r0, =gUnknown_0823B5E9 bl script_env_1_execute_new_script @080EA1FA: adds r0, r4, 0 bl remove_task pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r4, [r1] lsls r1, r0, 2 adds r1, r0 lsls r1, 5 adds r4, r1 ldr r1, =0x00001aa5 adds r0, r4, r1 ldrb r0, [r0] movs r1, 0x5 bl __umodsi3 ldr r1, =0x00001a9d 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 .pool thumb_func_end sub_80EA20C thumb_func_start sub_80EA250 sub_80EA250: ; 80EA250 push {lr} ldr r0, =0x00004054 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, =gUnknown_08274966 b @080EA2DA .align 2, 0 .pool @080EA278: cmp r0, 0x1 bne @080EA284 ldr r0, =gUnknown_08274D13 b @080EA2DA .align 2, 0 .pool @080EA284: cmp r0, 0x2 bne @080EA290 ldr r0, =gUnknown_08274FFE b @080EA2DA .align 2, 0 .pool @080EA290: cmp r0, 0x3 bne @080EA29C ldr r0, =gUnknown_08275367 b @080EA2DA .align 2, 0 .pool @080EA29C: cmp r0, 0x4 bne @080EA2A8 ldr r0, =gUnknown_082756C7 b @080EA2DA .align 2, 0 .pool @080EA2A8: cmp r0, 0x5 bne @080EA2B4 ldr r0, =gUnknown_08274B24 b @080EA2DA .align 2, 0 .pool @080EA2B4: cmp r0, 0x6 bne @080EA2C0 ldr r0, =gUnknown_08274E75 b @080EA2DA .align 2, 0 .pool @080EA2C0: cmp r0, 0x7 bne @080EA2CC ldr r0, =gUnknown_082751E1 b @080EA2DA .align 2, 0 .pool @080EA2CC: cmp r1, 0x8 beq @080EA2D8 ldr r0, =gUnknown_082758CC b @080EA2DA .align 2, 0 .pool @080EA2D8: ldr r0, =gUnknown_082754F6 @080EA2DA: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80EA250 thumb_func_start sub_80EA2E4 sub_80EA2E4: ; 80EA2E4 push {lr} movs r0, 0x1 bl sub_813BADC ldr r1, =0x02038bca movs r2, 0x80 lsls r2, 3 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x02022fec ldr r0, =0x08000008 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EA2E4 thumb_func_start sub_80EA30C sub_80EA30C: ; 80EA30C push {lr} ldr r0, =0x00004054 bl var_get ldr r1, =0x03005d8c ldr r3, [r1] lsls r0, 16 lsrs r0, 16 lsls r1, r0, 2 adds r1, r0 lsls r1, 5 adds r3, r1 ldr r0, =0x020375f0 ldrb r0, [r0] ldr r1, =0x00001a9d 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 .pool thumb_func_end sub_80EA30C thumb_func_start sub_80EA354 sub_80EA354: ; 80EA354 push {r4-r7,lr} ldr r0, =0x00004054 bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x00000922 bl flag_check lsls r0, 24 cmp r0, 0 bne @080EA39A movs r3, 0 ldr r7, =0x03005d8c ldr r4, =0x00001a9d 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, =0x00000922 bl flag_set @080EA39A: ldr r4, =0x020375e0 lsls r0, r5, 24 lsrs r0, 24 bl sub_80EA20C lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r2, =0x020375f0 ldr r0, =0x03005d8c ldr r1, [r0] lsls r0, r5, 2 adds r0, r5 lsls r0, 5 adds r1, r0 ldr r0, =0x00001a9d 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 .pool 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, =0x03005e08 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 .pool @080EA40C: cmp r0, 0x2 bne @080EA412 b @080EA810 @080EA412: b @080EA820 @080EA414: ldr r0, =0x00004054 bl var_get lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0 beq @080EA434 ldr r1, =0x0203a01d movs r0, 0x1 strb r0, [r1] b @080EA438 .align 2, 0 .pool @080EA434: ldr r0, =0x0203a01d strb r1, [r0] @080EA438: adds r0, r5, 0x4 adds r1, r5, 0x6 bl player_get_pos_to b @080EA81C .align 2, 0 .pool @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, =0x000040ec 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, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 beq @080EA4CC b @080EA820 @080EA4CC: ldr r4, =0x000040ef adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x20 b @080EA7FA .align 2, 0 .pool @080EA4E8: ldr r3, =0xfffffd48 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, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 beq @080EA524 b @080EA820 @080EA524: ldr r4, =0x000040ee adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x1 b @080EA7FA .align 2, 0 .pool @080EA540: ldr r0, =0x00000239 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, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 beq @080EA562 b @080EA820 @080EA562: ldr r4, =0x000040ee adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x4 b @080EA7FA .align 2, 0 .pool @080EA57C: cmp r5, 0x34 bne @080EA586 ldr r0, =0x0000026d 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, =0x0000026a cmp r0, r1 bne @080EA5CC @080EA59E: ldr r0, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 beq @080EA5A8 b @080EA820 @080EA5A8: ldr r4, =0x000040ef 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 .pool @080EA5CC: cmp r5, 0xC1 bne @080EA618 ldr r0, =0x0000023d cmp r4, r0 bne @080EA618 ldr r0, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 beq @080EA5E0 b @080EA820 @080EA5E0: ldr r4, =0x000040ef 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 .pool @080EA618: cmp r5, 0x47 bne @080EA668 ldr r0, =0x0000023e cmp r4, r0 bne @080EA668 ldr r0, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 beq @080EA62C b @080EA820 @080EA62C: ldr r4, =0x000040ef 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 .pool @080EA668: adds r0, r5, 0 bl sub_80893C8 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080EA698 ldr r0, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 beq @080EA680 b @080EA820 @080EA680: ldr r4, =0x000040ef adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x80 b @080EA7FA .align 2, 0 .pool @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, =0x0203a01d 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 .pool @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, =0x000040ee b @080EA7F0 .align 2, 0 .pool @080EA714: ldr r4, =0x000040ee 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 .pool @080EA72C: adds r0, r5, 0 bl sub_80893A0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080EA778 ldr r0, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 bne @080EA75E ldr r4, =0x000040ef 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 .pool @080EA778: adds r0, r5, 0 bl sub_80893B4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080EA7A8 ldr r0, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 bne @080EA820 ldr r4, =0x000040ee 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 .pool @080EA7A8: adds r0, r5, 0 bl sub_8089848 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080EA7D8 ldr r0, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 bne @080EA820 ldr r4, =0x000040ef 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 .pool @080EA7D8: adds r0, r5, 0 bl sub_808985C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080EA820 ldr r0, =0x0203a01d ldrb r0, [r0] cmp r0, 0x1 bne @080EA820 ldr r4, =0x000040ef @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 .pool @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, =0x03005d8c ldr r0, [r6] lsls r2, r5, 2 adds r2, r5 lsls r4, r2, 5 adds r0, r4 ldr r2, =0x00001a9c mov r9, r2 add r0, r9 movs r2, 0xA0 bl memcpy ldr r2, [r6] adds r2, r4 ldr r0, =0x00001a9d 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, =0x00001aa9 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, =0x03005d8c ldr r1, [r0] lsls r0, r5, 2 adds r0, r5 lsls r0, 5 adds r1, r0 ldr r2, =0x00001aa9 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 .pool 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, =0x03005d8c ldr r2, [r0] ldr r4, =0x00001a9c @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 .pool @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, =0x03005d8c ldr r3, [r0] ldr r4, =0x00001a9c @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 .pool @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, =0x03005d8c 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, =0x00001a9d 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 .pool @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, =0x03005d8c ldr r1, [r0] lsls r0, r2, 2 adds r0, r2 lsls r0, 5 adds r1, r0 ldr r0, =0x00001a9d 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 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00001a9c 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 .pool 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, =0x03005d90 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 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00001a9c 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 .pool 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, =0x020229e8 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 .pool @080EB030: lsls r2, r5, 1 adds r0, r6, r2 str r0, [sp] ldr r4, =0x020229e8 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 .pool @080EB074: lsls r0, r5, 1 adds r0, r5 adds r0, r6, r0 str r0, [sp] ldr r1, =0x020229e8 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 .pool @080EB0A8: str r6, [sp] ldr r1, =0x020229e8 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, =0x03005d8c 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, =0x00001a9d 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, =0x03005d8c 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, =0x00001a9c adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 beq @080EB16A ldr r0, =0x00001aaa adds r2, r1, r0 ldrh r1, [r2] ldr r0, =0x0000ffff 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 .pool 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, =0x000040ec movs r1, 0 bl var_set ldr r0, =0x000040ed movs r1, 0 bl var_set ldr r0, =0x000040ee movs r1, 0 bl var_set ldr r0, =0x000040ef movs r1, 0 bl var_set ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB1FC ldr r0, =0x000040f0 movs r1, 0x1 bl var_set b @080EB204 .align 2, 0 .pool @080EB1FC: ldr r0, =0x000040f0 movs r1, 0 bl var_set @080EB204: ldr r1, =0x0203a01d movs r0, 0 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EB1AC thumb_func_start sub_80EB218 sub_80EB218: ; 80EB218 push {r4-r6,lr} ldr r5, =0x000040f0 adds r0, r5, 0 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB272 ldr r6, =0x0203a01d 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, =0x000040ec movs r1, 0 bl var_set ldr r0, =0x000040ed movs r1, 0 bl var_set ldr r0, =0x000040ee movs r1, 0 bl var_set ldr r0, =0x000040ef 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 .pool thumb_func_end sub_80EB218 thumb_func_start sub_80EB290 sub_80EB290: ; 80EB290 push {r4,lr} ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB2BA ldr r4, =0x000040ef 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 .pool thumb_func_end sub_80EB290 thumb_func_start sub_80EB2C8 sub_80EB2C8: ; 80EB2C8 push {r4,lr} ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB2F2 ldr r4, =0x000040ee 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 .pool thumb_func_end sub_80EB2C8 thumb_func_start sub_80EB300 sub_80EB300: ; 80EB300 push {r4,r5,lr} ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB34C ldr r5, =0x000040ee adds r0, r5, 0 bl var_get ldr r1, =0x0000c7ff ands r1, r0 adds r0, r5, 0 bl var_set ldr r4, =0x000040ef adds r0, r4, 0 bl var_get ldr r1, =0x0000fffe 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 .pool thumb_func_end sub_80EB300 thumb_func_start sub_80EB368 sub_80EB368: ; 80EB368 push {r4,r5,lr} ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB3B4 ldr r5, =0x000040ee adds r0, r5, 0 bl var_get ldr r1, =0x0000c7ff ands r1, r0 adds r0, r5, 0 bl var_set ldr r4, =0x000040ef adds r0, r4, 0 bl var_get ldr r1, =0x0000fffe 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 .pool thumb_func_end sub_80EB368 thumb_func_start sub_80EB3D0 sub_80EB3D0: ; 80EB3D0 push {r4,r5,lr} ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB41C ldr r5, =0x000040ee adds r0, r5, 0 bl var_get ldr r1, =0x0000c7ff ands r1, r0 adds r0, r5, 0 bl var_set ldr r4, =0x000040ef adds r0, r4, 0 bl var_get ldr r1, =0x0000fffe 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 .pool thumb_func_end sub_80EB3D0 thumb_func_start sub_80EB438 sub_80EB438: ; 80EB438 push {r4,lr} ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB480 ldr r4, =0x000040ee adds r0, r4, 0 bl var_get ldr r1, =0x0000c7ff ands r1, r0 adds r0, r4, 0 bl var_set adds r4, 0x1 adds r0, r4, 0 bl var_get ldr r1, =0x0000fffe 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 .pool 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, =0xfffffce4 adds r0, r1 cmp r0, 0x18 bhi @080EB55C lsls r0, 2 ldr r1, =@080EB4D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB55C ldr r4, =0x000040ee 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 .pool 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, =0xfffffdd4 adds r0, r1 cmp r0, 0xCF bls @080EB594 b @080EB9D0 @080EB594: lsls r0, 2 ldr r1, =@080EB5A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB9D0 ldr r4, =0x000040ee adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x40 b @080EB994 .align 2, 0 .pool @080EB90C: ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB9D0 ldr r4, =0x000040ee adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x8 b @080EB994 .align 2, 0 .pool @080EB930: ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB9D0 ldr r4, =0x000040ef adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x40 b @080EB994 .align 2, 0 .pool @080EB954: ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB9D0 ldr r4, =0x000040ef 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 .pool @080EB97C: ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB9D0 ldr r4, =0x000040ef 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 .pool @080EB9AC: ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EB9D0 ldr r4, =0x000040ef 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 .pool 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, =0xfffffd6f adds r0, r1 cmp r0, 0x35 bls @080EBA08 b @080EBB18 @080EBA08: lsls r0, 2 ldr r1, =@080EBA1C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EBB18 ldr r4, =0x000040ef 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 .pool 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, =0xfffffddb adds r0, r1 cmp r0, 0xA2 bls @080EBB50 b @080EBE6C @080EBB50: lsls r0, 2 ldr r1, =@080EBB64 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EBE6C ldr r4, =0x000040ef adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x8 b @080EBE30 .align 2, 0 .pool @080EBE14: ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EBE6C ldr r4, =0x000040ef 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 .pool @080EBE48: ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EBE6C ldr r4, =0x000040ef 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 .pool 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, =0x0000028e cmp r1, r0 bgt @080EBECC subs r0, 0x1 cmp r1, r0 blt @080EBECC ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080EBECC ldr r4, =0x000040ef 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 .pool thumb_func_end sub_80EBE7C thumb_func_start sub_80EBEE0 sub_80EBEE0: ; 80EBEE0 push {r4-r7,lr} movs r3, 0 ldr r6, =0x03005d8c movs r5, 0 ldr r7, =0x000027ce @080EBEEA: ldr r0, [r6] lsls r1, r3, 3 adds r1, r3 lsls r1, 2 adds r0, r1 ldr r2, =0x000027cc 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 .pool thumb_func_end sub_80EBEE0 thumb_func_start sub_80EBF3C sub_80EBF3C: ; 80EBF3C push {r4-r7,lr} movs r4, 0x5 ldr r1, =0x03005d8c 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, =0x03005d8c @080EBF86: ldr r1, [r6] lsls r0, r5, 3 adds r0, r5 lsls r4, r0, 2 adds r1, r4 ldr r0, =0x000027cc 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, =0x000027cd adds r0, r1 ldrb r0, [r0] b @080EBFCC .align 2, 0 .pool @080EBFBC: ldr r2, =0x000027cc 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 .pool @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, =0x03005d8c ldr r2, [r0] ldr r3, =0x00002b90 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, =0x000027cc 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 .pool @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, =0x00000891 bl flag_set bl sub_80F0040 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080EC06A cmp r0, 0x2 beq @080EC0BE ldr r0, =0x03005d8c 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 .pool @080EC080: ldr r0, =0x00000892 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, =0x00000891 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 .pool 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, =0x03005dc0 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 .pool thumb_func_end sub_80EC130 thumb_func_start cut cut: ; 80EC14C push {lr} ldr r1, =0x03005dc0 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 .pool thumb_func_end cut thumb_func_start sub_80EC168 sub_80EC168: ; 80EC168 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x020375e0 ldrh r2, [r0] lsls r0, r2, 3 adds r0, r2 lsls r0, 2 adds r1, r0 ldr r0, =0x000027cc adds r1, r0 ldrb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80EC168 thumb_func_start sub_80EC18C sub_80EC18C: ; 80EC18C push {r4,lr} movs r2, 0 ldr r0, =0x03005d8c ldr r3, [r0] @080EC194: lsls r0, r2, 3 adds r0, r2 lsls r0, 2 adds r1, r3, r0 ldr r4, =0x000027cc 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 .pool @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, =0x03005d8c ldr r2, =0x020375e0 ldrh r1, [r2] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r3, [r3] adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0x29 bne @080EC214 ldr r1, =0x00002b90 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 .pool @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, =0x03005d8c ldr r2, [r3] ldr r1, =0x00002ba4 adds r0, r2, r1 movs r4, 0 mov r10, r4 movs r1, 0 strh r1, [r0] ldr r4, =0x00002ba6 adds r0, r2, r4 strh r1, [r0] adds r4, 0x2 adds r0, r2, r4 strh r1, [r0] ldr r0, =0x00002baa adds r1, r2, r0 ldr r0, =0x0000ffff 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, =0x00002baf 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, =0x00002bac 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 .pool thumb_func_end sub_80EC21C thumb_func_start sub_80EC31C sub_80EC31C: ; 80EC31C push {r4,lr} ldr r3, =0x03005d8c ldr r2, [r3] ldr r0, =0x03005d10 mov r12, r0 ldrh r1, [r0, 0x6] ldr r4, =0x00002ba4 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, =0x00002bad 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, =0x00002bae 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, =0x00002bae adds r0, r1 ldrb r1, [r0] movs r2, 0x2 orrs r1, r2 b @080EC3A6 .align 2, 0 .pool @080EC398: ldr r0, [r4] ldr r1, =0x00002bae 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, =0x00002bae adds r0, r1 ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 b @080EC3D2 .align 2, 0 .pool @080EC3C4: ldr r0, [r4] ldr r1, =0x00002bae 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, =0x00002bae adds r0, r4 b @080EC416 .align 2, 0 .pool @080EC410: ldr r0, [r4] ldr r1, =0x00002bae adds r0, r1 @080EC416: ldrb r1, [r0] movs r2, 0x8 orrs r1, r2 strb r1, [r0] @080EC41E: bl sub_80EC4E8 ldr r0, =0x03005d8c ldr r0, [r0] ldr r4, =0x00002ba8 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 .pool thumb_func_end sub_80EC31C thumb_func_start sub_80EC448 sub_80EC448: ; 80EC448 push {r4-r6,lr} ldr r5, =0x03005d8c ldr r2, [r5] ldr r6, =0x00002bae adds r0, r2, r6 ldrb r1, [r0] lsls r1, 31 ldr r4, =0x00002baf 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, =0x02037318 ldrb r1, [r1, 0x14] ldr r2, =0x00002bac adds r0, r2 strb r1, [r0] movs r0, 0x6 bl sav12_xor_increment pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EC448 thumb_func_start sub_80EC4E8 sub_80EC4E8: ; 80EC4E8 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00002bae adds r1, r0 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80EC4E8 thumb_func_start sub_80EC504 sub_80EC504: ; 80EC504 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002bad 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 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002bae adds r0, r1 ldrb r0, [r0] lsls r0, 27 lsrs r0, 31 bx lr .align 2, 0 .pool thumb_func_end is_tile_XX_prevent_per_step_scripts thumb_func_start sub_80EC548 sub_80EC548: ; 80EC548 push {r4,r5,lr} ldr r5, =0x03005d8c ldr r0, [r5] ldr r2, =0x00002baa adds r1, r0, r2 ldrh r0, [r1] ldr r4, =0x0000ffff cmp r0, r4 beq @080EC584 ldr r0, =0x02021cc4 ldrh r1, [r1] bl sub_811EBBC ldr r1, [r5] ldr r0, =0x00002baa adds r1, r0 ldrh r2, [r1] adds r0, r4, 0 orrs r0, r2 strh r0, [r1] movs r0, 0x1 b @080EC586 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002baf 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 .pool @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, =@080EC5F8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080EC5F8: .4byte @080EC618 .4byte @080EC62C .4byte @080EC640 .4byte @080EC654 .4byte @080EC668 .4byte @080EC67C .4byte @080EC690 .4byte @080EC6A4 @080EC618: ldr r1, =0x020375e0 movs r0, 0xE strh r0, [r1] ldr r1, =0x020375e2 movs r0, 0xD b @080EC6AE .align 2, 0 .pool @080EC62C: ldr r1, =0x020375e0 movs r0, 0x5 strh r0, [r1] ldr r1, =0x020375e2 movs r0, 0x6 b @080EC6AE .align 2, 0 .pool @080EC640: ldr r1, =0x020375e0 movs r0, 0x12 strh r0, [r1] ldr r1, =0x020375e2 movs r0, 0x11 b @080EC6AE .align 2, 0 .pool @080EC654: ldr r1, =0x020375e0 movs r0, 0x15 strh r0, [r1] ldr r1, =0x020375e2 movs r0, 0x16 b @080EC6AE .align 2, 0 .pool @080EC668: ldr r1, =0x020375e0 movs r0, 0x8 strh r0, [r1] ldr r1, =0x020375e2 movs r0, 0x9 b @080EC6AE .align 2, 0 .pool @080EC67C: ldr r1, =0x020375e0 movs r0, 0x13 strh r0, [r1] ldr r1, =0x020375e2 movs r0, 0x14 b @080EC6AE .align 2, 0 .pool @080EC690: ldr r1, =0x020375e0 movs r0, 0x17 strh r0, [r1] ldr r1, =0x020375e2 movs r0, 0x18 b @080EC6AE .align 2, 0 .pool @080EC6A4: ldr r1, =0x020375e0 movs r0, 0xA strh r0, [r1] ldr r1, =0x020375e2 movs r0, 0xB @080EC6AE: strh r0, [r1] @080EC6B0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EC5D8 thumb_func_start sub_80EC6BC sub_80EC6BC: ; 80EC6BC push {lr} ldr r0, =0x020375e2 ldrh r0, [r0] subs r0, 0x1 cmp r0, 0x7 bhi @080EC724 lsls r0, 2 ldr r1, =@080EC6DC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d10 ldrh r0, [r5, 0x28] cmp r0, 0 bne @080EC74C bl sub_80EC8FC b @080EC888 .align 2, 0 .pool @080EC74C: bl sub_80EC8A4 ldr r0, =0x0000ffff 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, =gSpeciesNames adds r0, r1 adds r1, r5, 0 adds r1, 0x2A bl sub_8008C44 cmp r0, 0 bne @080EC776 b @080EC888 @080EC776: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFB08 ldr r1, =0x030060bc 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, =0x03005d8c ldr r0, =0x030060bc movs r1, 0 ldrsb r1, [r0, r1] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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, =0x03005d90 mov r8, r1 adds r7, r6, 0x4 b @080EC84E .align 2, 0 .pool @080EC81C: movs r2, 0 ldr r0, =0x02024208 mov r12, r0 adds r3, r6, 0 adds r3, 0x13 ldr r1, =0x03005d90 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, =0x03005d3a 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, =gUnknown_82E9531 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 .pool thumb_func_end sub_80EC728 thumb_func_start sub_80EC8A4 sub_80EC8A4: ; 80EC8A4 push {r4,lr} ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00002b2c adds r4, r1, r0 ldrb r0, [r4] cmp r0, 0x19 beq @080EC8CA ldr r2, =0x000027cc 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, =0x03005d10 ldrh r0, [r1, 0x28] strh r0, [r4, 0x4] ldrh r0, [r1, 0x6] strh r0, [r4, 0x8] ldr r0, =0x02037318 ldrb r0, [r0, 0x14] strb r0, [r4, 0xA] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EC8A4 thumb_func_start sub_80EC8FC sub_80EC8FC: ; 80EC8FC push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x0000ffff bl sub_80EFB38 lsls r0, 24 cmp r0, 0 bne @080EC9B4 movs r1, 0 movs r5, 0 ldr r2, =0x03005d46 @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, =0x0202433a mov r8, r0 ldrb r0, [r0] cmp r0, 0x6 beq @080EC940 cmp r0, 0x1 bne @080EC9B4 @080EC940: ldr r7, =0x03005d8c ldr r0, [r7] ldr r6, =0x000027cc adds r0, r6 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x03005d10 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, =0x02037318 ldrb r0, [r0, 0x14] strb r0, [r4, 0x12] adds r0, r4, 0 adds r0, 0x13 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy adds r0, r4, 0 bl sub_80EC9E8 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x2] @080EC9B4: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c mov r8, r0 ldr r7, [r0] ldr r1, =0x00002b2c adds r6, r7, r1 ldrb r1, [r6] cmp r1, 0x8 bne @080ECACE ldr r0, =0x030060bc ldrb r0, [r0] lsls r0, 24 asrs r0, 24 lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r5, =0x000027cc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy ldr r0, =0x02039f2c ldrh r0, [r0] strb r0, [r4, 0x1C] ldr r0, =0x02039f24 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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, =0x00002b30 adds r1, r7, r2 bl gf_strcpy adds r0, r4, 0 bl sub_80ECA10 ldr r0, =gUnknown_82E9531 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 .pool 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, =0x03005d8c ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 bl sub_80EFADC ldr r4, =0x030060bc 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, =0x020375f0 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy ldr r0, =0x02022fec 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 .pool @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, =0x020229f0 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, =gUnknown_82E9531 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 .pool 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, =0x03005d8c mov r8, r0 ldr r0, [r0] ldr r7, =0x000027cc adds r0, r7 bl sub_80EFADC ldr r4, =0x030060bc 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, =0x020375f0 ldrh r0, [r0] cmp r0, 0x1 bne @080ECC68 @080ECC54: movs r0, 0 b @080ECCEE .align 2, 0 .pool @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, =0x03005d90 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, =gUnknown_82E9531 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 .pool @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, =0x03005d8c ldr r0, =0x020375e4 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r6] adds r4, r1, r0 ldr r0, =0x020375e2 ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 1 strb r0, [r4, 0x16] adds r0, r4, 0x2 ldr r1, =0x03005d90 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, =0x02021cc4 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x17] cmp r0, 0x1 beq @080ECD74 ldr r0, [r6] ldr r1, =0x000031a0 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @080ECD98 @080ECD74: strb r5, [r4, 0x18] b @080ECD9A .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r5] ldr r4, =0x000027cc adds r0, r4 movs r1, 0x18 bl sub_80EF910 ldr r0, [r5] adds r0, r4 bl sub_80EFADC ldr r1, =0x030060bc 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, =0x00002b2c adds r0, r1 strb r6, [r0, 0xD] movs r1, 0x8 strb r1, [r0] @080ECDDC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002b2c adds r4, r0, r1 ldr r1, =0x000027cc adds r0, r1 bl sub_80EFADC ldr r1, =0x030060bc 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 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002b2c adds r4, r0, r1 ldr r1, =0x000027cc adds r0, r1 bl sub_80EFADC ldr r1, =0x030060bc 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 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002b2c adds r4, r0, r1 ldr r1, =0x000027cc adds r0, r1 bl sub_80EFADC ldr r1, =0x030060bc 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 .pool 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, =0x03005d8c ldr r4, [r0] ldr r0, =0x00002b2c adds r5, r4, r0 ldr r1, =0x000027cc adds r0, r4, r1 bl sub_80EFADC ldr r1, =0x030060bc strb r0, [r1] lsls r0, 24 asrs r0, 24 movs r1, 0x1 negs r1, r1 cmp r0, r1 beq @080ECF4C ldr r2, =0x02039e00 lsls r1, r6, 6 adds r0, r1, r2 ldrh r0, [r0] strh r0, [r5, 0x2] ldr r0, =0x00002b30 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, =0x02039f30 ldrb r0, [r0] cmp r1, r0 ble @080ECF30 ldr r0, =0x020229e8 ldrh r0, [r0, 0x1A] b @080ECF4A .align 2, 0 .pool @080ECF30: ldr r0, =gUnknown_82E9531 ldrb r0, [r0] cmp r0, 0x1 beq @080ECF48 ldr r1, =0x020229e8 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 .pool thumb_func_end sub_80ECEB4 thumb_func_start sub_80ECF5C sub_80ECF5C: ; 80ECF5C push {r4-r7,lr} ldr r0, =0x03005d8c ldr r6, [r0] ldr r0, =0x00002b2c adds r5, r6, r0 ldrb r2, [r5] cmp r2, 0x6 bne @080ED02C ldr r0, =0x030060bc movs r1, 0 ldrsb r1, [r0, r1] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy adds r0, r4, 0 adds r0, 0x8 ldr r2, =0x00002b34 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, =gUnknown_82E9531 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 .pool @080ED01C: strb r0, [r4, 0x1F] @080ED01E: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 movs r1, 0x18 bl sub_80EF910 @080ED02C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r4] ldr r1, =0x00002b2c adds r5, r0, r1 bl sub_80EF7B4 ldr r0, [r4] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFADC ldr r1, =0x030060bc 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, =0x000027cc 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 .pool 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, =0x03005d8c ldr r4, [r0] ldr r0, =0x00002b2c adds r7, r4, r0 ldr r1, =0x000027cc adds r0, r4, r1 bl sub_80EFADC ldr r1, =0x030060bc 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, =0x02039f2c 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, =0x02039f2e 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, =0x02039f24 mov r8, r0 ldrb r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec 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, =0x00002b34 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 .pool thumb_func_end sub_80ED090 thumb_func_start sub_80ED164 sub_80ED164: ; 80ED164 push {r4-r6,lr} ldr r2, =0x03005d8c ldr r0, =0x030060bc movs r1, 0 ldrsb r1, [r0, r1] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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, =0x03005d90 ldr r1, [r4] bl gf_strcpy adds r0, r6, 0 adds r0, 0xC ldr r1, [r4] ldr r2, =0x00000bd8 adds r1, r2 bl gf_strcpy ldr r1, [r4] ldr r2, =0x00000bd4 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, =0x00000d07 adds r1, r5 ldrb r0, [r1] movs r1, 0 bl sub_8164FCC strh r0, [r6, 0x16] ldr r0, [r4] ldr r1, =0x00000d06 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 .pool @080ED1F4: movs r0, 0x64 @080ED1F6: strb r0, [r6, 0x1A] ldr r0, =0x020375e0 ldrh r0, [r0] strb r0, [r6, 0x1B] adds r0, r6, 0 bl sub_80ECA10 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r6, 0x1D] cmp r0, 0x1 beq @080ED21C ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000beb 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 .pool thumb_func_end sub_80ED164 thumb_func_start sub_80ED238 sub_80ED238: ; 80ED238 push {r4-r7,lr} ldr r5, =0x03005d8c ldr r0, [r5] ldrh r1, [r0, 0x4] ldr r0, =0x00003c1a cmp r1, r0 beq @080ED2F2 ldr r0, =0x0000371a cmp r1, r0 beq @080ED2F2 ldr r0, =0x00005555 bl sub_80EFB38 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @080ED2F2 ldr r0, [r5] ldr r7, =0x000027cc adds r0, r7 bl sub_80EFB08 ldr r6, =0x030060bc 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, =0x02039f80 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, =0x02037318 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy adds r0, r5, 0 bl sub_80EC9E8 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r5, 0x3] @080ED2F2: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375f0 ldrh r0, [r0] cmp r0, 0x1 beq @080ED400 ldr r0, =0x020375e0 mov r8, r0 ldrh r0, [r0] movs r7, 0x64 muls r0, r7 ldr r6, =0x020244ec adds r0, r6 ldr r4, =0x02021cc4 movs r1, 0x2 adds r2, r4, 0 bl pokemon_getattr ldr r1, =0x03005d90 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, =0x03005d8c ldr r0, =0x030060bc movs r1, 0 ldrsb r1, [r0, r1] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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, =gUnknown_82E9531 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 .pool thumb_func_end sub_80ED320 thumb_func_start sub_80ED430 sub_80ED430: ; 80ED430 push {r4,r5,lr} ldr r4, =0x03005d8c ldr r0, =0x020375e0 ldrh r0, [r0] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 ldr r0, =0x000027cc adds r1, r0 ldr r2, [r4] adds r1, r2, r1 ldrh r3, [r1, 0xC] ldr r5, =0x00002b90 adds r0, r2, r5 strh r3, [r0] ldrb r0, [r1, 0x10] ldr r3, =0x00002b92 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, =0x00002ba0 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, =0x00002ba2 adds r0, r1 movs r1, 0x2 strh r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ED430 thumb_func_start sub_80ED4DC sub_80ED4DC: ; 80ED4DC push {r4,lr} bl sub_80EFA88 ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0x1 beq @080ED532 ldr r2, =0x03005d8c ldr r0, =0x030060bc movs r1, 0 ldrsb r1, [r0, r1] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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 .pool thumb_func_end sub_80ED4DC thumb_func_start sub_80ED548 sub_80ED548: ; 80ED548 push {r4,lr} ldr r2, =0x03005d8c ldr r0, =0x030060bc movs r1, 0 ldrsb r1, [r0, r1] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy bl sub_8139688 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr strh r0, [r4, 0x2] adds r0, r4, 0 bl sub_80ECA10 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x18] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ED548 thumb_func_start sub_80ED5B8 sub_80ED5B8: ; 80ED5B8 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x030060bc movs r1, 0 ldrsb r1, [r0, r1] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy strh r5, [r4, 0x2] adds r0, r4, 0 bl sub_80ECA10 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x18] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ED5B8 thumb_func_start sub_80ED610 sub_80ED610: ; 80ED610 push {r4-r7,lr} mov r7, r8 push {r7} ldr r2, =0x03005d8c ldr r0, =0x030060bc movs r1, 0 ldrsb r1, [r0, r1] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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, =0x020244ec 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, =0x020375e6 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, =0x03005d90 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, =gUnknown_82E9531 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 .pool @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, =0x00000864 bl flag_check lsls r0, 24 cmp r0, 0 beq @080ED7E4 movs r1, 0 ldr r0, =0x03005d8c ldr r2, [r0] ldr r3, =0x000027cc @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, =0x00000147 bl sub_80EFB38 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @080ED7E4 ldr r6, =0x03005d8c ldr r0, [r6] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFADC ldr r4, =0x030060bc 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, =0x000027cc adds r1, r2 ldr r4, [r6] adds r4, r1 movs r1, 0x29 strb r1, [r4] movs r3, 0x1 strb r3, [r4, 0x1] ldr r2, =gUnknown_0858D094 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x18] @080ED7E4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ED718 thumb_func_start sub_80ED808 sub_80ED808: ; 80ED808 push {r4,r5,lr} ldr r3, =0x03005d8c ldr r0, [r3] ldr r2, =0x00002b90 adds r1, r0, r2 movs r4, 0 movs r2, 0 strh r2, [r1] ldr r5, =0x00002b92 adds r0, r5 strb r4, [r0] ldr r0, [r3] ldr r1, =0x00002b93 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, =0x00002ba0 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 .pool 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, =0x03005d8c ldr r0, [r1] ldr r2, =0x00002b90 adds r0, r2 ldrh r0, [r0] mov r12, r1 cmp r0, 0 bne @080ED91C movs r1, 0 ldr r6, =0x000027cc @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, =0x000027cd 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 .pool @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, =0x03005d8c ldr r0, [r0] ldr r3, =0x00002ba2 adds r1, r0, r3 ldrh r0, [r1] cmp r0, r2 bhi @080ED948 bl sub_80ED808 b @080ED94C .align 2, 0 .pool @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, =0x0203a026 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 .pool @080ED978: ldr r4, =0x0203a026 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 .pool thumb_func_end sub_80ED950 thumb_func_start sub_80ED9A8 sub_80ED9A8: ; 80ED9A8 push {r4-r6,lr} ldr r6, =0x03005d8c ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x0203a026 ldrh r0, [r1] strb r0, [r4, 0x2] ldrh r0, [r1] lsrs r0, 8 strb r0, [r4, 0x3] ldr r0, =0x0203a024 ldrh r0, [r0] strh r0, [r4, 0x4] adds r0, r4, 0 adds r0, 0x13 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy adds r0, r4, 0 bl sub_80EC9E8 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x6] @080EDA18: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80ED9A8 thumb_func_start sub_80EDA3C sub_80EDA3C: ; 80EDA3C ldr r1, =0x0203a024 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80EDA3C thumb_func_start sub_80EDA48 sub_80EDA48: ; 80EDA48 push {r4,lr} ldr r4, =0x03005d8c ldr r0, [r4] ldr r2, =0x00002b2c 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, =0x000027cc adds r0, r1 movs r1, 0x18 bl sub_80EF910 @080EDA6E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EDA48 thumb_func_start sub_80EDA80 sub_80EDA80: ; 80EDA80 push {r4-r7,lr} mov r7, r8 push {r7} ldr r7, =0x03005d8c ldr r0, [r7] ldr r1, =0x00002b2c adds r5, r0, r1 ldr r0, =0x0000ffff bl sub_80EFB38 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 bne @080EDB1C ldr r0, [r7] ldr r1, =0x000027cc mov r8, r1 add r0, r8 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy adds r0, r4, 0 bl sub_80EC9E8 ldr r0, =gUnknown_82E9531 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 .pool 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, =0x03005d8c ldr r0, [r4] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFB08 ldr r2, =0x030060bc 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, =0x000027cc 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, =0x00000867 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, =0x0000086e 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 .pool @080EDBCC: movs r0, 0x1 bl sub_80C0844 @080EDBD2: strh r0, [r4, 0x2] ldr r1, =0x02037318 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, =gUnknown_0858D0DE 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, =gUnknown_0858D0D0 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, =0x03005d90 ldr r1, [r0] ldr r2, =0x00000eb8 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0xC] @080EDC40: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EDB44 thumb_func_start sub_80EDC60 sub_80EDC60: ; 80EDC60 push {r4-r7,lr} adds r5, r0, 0 ldr r7, =0x03005d8c ldr r0, [r7] ldr r6, =0x000027cc adds r0, r6 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x03005d90 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x9] @080EDCCE: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EDC60 thumb_func_start sub_80EDCE8 sub_80EDCE8: ; 80EDCE8 push {r4-r6,lr} ldr r6, =0x03005d8c ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x020375e2 ldrh r0, [r0] strh r0, [r4, 0x2] ldr r1, =0x02037318 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy adds r0, r4, 0 bl sub_80EC9E8 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x5] @080EDD56: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFB08 ldr r1, =0x030060bc 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, =0x0203a02a ldrb r1, [r0] adds r6, r0, 0 cmp r1, 0 beq @080EDDCC cmp r1, 0x1 beq @080EDDEE b @080EDE54 .align 2, 0 .pool @080EDDCC: ldr r0, =0x0203a028 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 .pool @080EDDE4: cmp r1, 0x63 bls @080EDE54 adds r0, r1, 0 subs r0, 0x64 b @080EDE0C @080EDDEE: ldr r0, =0x0203a028 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 .pool @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, =0x03005d8c ldr r0, =0x030060bc movs r1, 0 ldrsb r1, [r0, r1] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy adds r0, r4, 0 bl sub_80EC9E8 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x8] @080EDE54: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EDD78 thumb_func_start sub_80EDE70 sub_80EDE70: ; 80EDE70 ldr r2, =0x0203a02a movs r1, 0 strb r1, [r2] ldr r1, =0x0203a028 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80EDE70 thumb_func_start sub_80EDE84 sub_80EDE84: ; 80EDE84 ldr r2, =0x0203a02a movs r1, 0x1 strb r1, [r2] ldr r1, =0x0203a028 strh r0, [r1] bx lr .align 2, 0 .pool 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, =0x030060d0 ldr r7, =0x03005d8c 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, =0x00001aae 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 .pool @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, =0x030060d0 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, =0x030060d0 @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 .pool 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, =0x030060c0 mov r8, r1 @080EDFCA: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @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, =0x030060e0 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, =0x030060e0 @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, =0x030060e0 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 .pool 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, =0x03005d8c ldr r0, [r4] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFB08 ldr r2, =0x030060bc 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, =0x000027cc 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, =0x03005d90 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0xC] @080EE168: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EE104 thumb_func_start sub_80EE184 sub_80EE184: ; 80EE184 push {r4-r7,lr} ldr r6, =0x03005d8c ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x03005d10 ldr r3, =0x02037318 ldr r7, =0x03005d90 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, =0x0202433a ldrb r0, [r0] subs r0, 0x1 cmp r0, 0x9 bhi @080EE282 lsls r0, 2 ldr r1, =@080EE244 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d10 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 .pool @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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0xE] @080EE2C2: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EE184 thumb_func_start sub_80EE2CC sub_80EE2CC: ; 80EE2CC push {r4-r6,lr} ldr r6, =0x03005d8c ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy ldr r0, =0x020375e0 ldrb r1, [r0] movs r0, 0x4 subs r0, r1 strb r0, [r4, 0x4] ldr r0, =0x020375e2 ldrh r0, [r0] strh r0, [r4, 0x2] adds r0, r4, 0 bl sub_80EC9E8 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x5] @080EE33A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c mov r8, r0 ldr r0, [r0] ldr r5, =0x000027cc adds r0, r5 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x03005d90 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, =gUnknown_82E9531 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 .pool 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, =0x03005d8c ldr r0, [r6] ldr r5, =0x000027cc adds r0, r5 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x03005d90 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x4] @080EE4BE: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r7] ldr r5, =0x000027cc adds r0, r5 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x03005d90 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, =gUnknown_82E9531 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 .pool @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, =0x03005d8c ldr r0, [r5] ldr r6, =0x000027cc adds r0, r6 bl sub_80EFB08 ldr r4, =0x030060bc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy ldr r0, [r5] ldr r2, =0x00002bb0 adds r1, r0, r2 ldrh r1, [r1] strh r1, [r4, 0x4] ldr r1, =0x00002bb2 adds r0, r1 ldrh r0, [r0] strh r0, [r4, 0x6] adds r0, r4, 0 bl sub_80EC9E8 ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x8] @080EE79C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EE72C thumb_func_start sub_80EE7C0 sub_80EE7C0: ; 80EE7C0 push {r4,lr} ldr r4, =0x03005d8c ldr r0, [r4] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFADC ldr r1, =0x030060bc 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, =0x020375f0 ldrh r0, [r0] cmp r0, 0x1 beq @080EE810 ldr r0, [r4] ldr r1, =0x00003150 adds r0, r1 ldrb r0, [r0] cmp r0, 0xFF beq @080EE810 movs r0, 0 b @080EE812 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000027cc 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFB08 ldr r1, =0x030060bc 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 .pool @080EE89C: ldr r5, =0x03005d8c ldr r0, [r5] ldr r4, =0x000027cc 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 .pool @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, =0x03005d8c ldr r0, [r5] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFB08 ldr r2, =0x030060bc 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, =0x000027cc 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, =0x03005d90 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, =@080EE944 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020244ec 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 .pool @080EE9A8: ldr r4, =0x020244ec 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 .pool @080EE9E8: ldr r4, =0x020244ec 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 .pool @080EEA00: ldr r2, =0x03005d8c mov r8, r2 ldr r6, =0x03005d90 ldr r0, [r6] ldr r1, =0x00000caa 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, =0x00000cac 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r7, 0xC] @080EEA52: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r7] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFB08 ldr r2, =0x030060bc 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, =0x000027cc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy ldr r0, =0x000040ec bl var_get strh r0, [r5, 0x2] bl sub_80E980C ldr r1, =0x02021cc4 mov r0, sp bl gf_strcpy mov r0, sp bl sub_8009370 adds r0, r5, 0x4 mov r1, sp bl gf_strcpy ldr r0, =0x000040ed bl var_get strh r0, [r5, 0x10] ldr r0, =0x000040ee bl var_get adds r4, r0, 0 ldr r0, =0x000040ef 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r5, 0x1B] cmp r0, 0x1 beq @080EEB3A ldr r4, [r7] ldr r6, =0x00004054 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, =0x00001aa9 adds r4, r0 ldrb r0, [r4] cmp r0, 0x1 bne @080EEB70 @080EEB3A: movs r0, 0x1 b @080EEB8A .align 2, 0 .pool @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, =0x00001aa9 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 .pool thumb_func_end sub_80EEA70 thumb_func_start sub_80EEB98 sub_80EEB98: ; 80EEB98 push {r4-r7,lr} movs r5, 0 ldr r6, =gUnknown_0858D0EC adds r7, r6, 0x2 b @080EEBAE .align 2, 0 .pool @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, =gUnknown_0858D0EC @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 .pool 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, =0x03005d8c ldr r0, [r4] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFB08 ldr r2, =0x030060bc 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, =0x000027cc 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, =0x03005d90 ldr r1, [r1] bl gf_strcpy strb r5, [r4, 0x4] ldr r1, =gUnknown_0858D0EC 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r4, 0x5] @080EEC60: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EEBF4 thumb_func_start sub_80EEC80 sub_80EEC80: ; 80EEC80 push {r4,lr} ldr r4, =0x000040e6 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 .pool thumb_func_end sub_80EEC80 thumb_func_start sub_80EECA4 sub_80EECA4: ; 80EECA4 push {r4,lr} ldr r4, =0x000040eb 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 .pool thumb_func_end sub_80EECA4 thumb_func_start sub_80EECC8 sub_80EECC8: ; 80EECC8 push {r4,lr} ldr r4, =0x000040e7 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 .pool thumb_func_end sub_80EECC8 thumb_func_start sub_80EECEC sub_80EECEC: ; 80EECEC push {r4,lr} ldr r4, =0x000040e8 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 .pool thumb_func_end sub_80EECEC thumb_func_start sub_80EED10 sub_80EED10: ; 80EED10 push {r4,lr} ldr r4, =0x000040e9 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 .pool thumb_func_end sub_80EED10 thumb_func_start sub_80EED34 sub_80EED34: ; 80EED34 push {r4,lr} ldr r4, =0x000040ea adds r0, r4, 0 bl var_get adds r1, r0, 0 ldr r0, =0x020375e4 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 .pool 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, =0x000040f1 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 .pool thumb_func_end sub_80EED60 thumb_func_start sub_80EED88 sub_80EED88: ; 80EED88 push {r4-r7,lr} ldr r0, =0x00000864 bl flag_check lsls r0, 24 cmp r0, 0 beq @080EEE0C ldr r6, =0x03005d8c ldr r0, [r6] ldr r7, =0x00002b50 adds r0, r7 bl sub_80EEE30 ldr r5, =0x030060bc strb r0, [r5] lsls r0, 24 asrs r0, 24 movs r1, 0x1 negs r1, r1 cmp r0, r1 beq @080EEE0C ldr r0, =0x0000028f 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, =0x00002b52 adds r0, r1 movs r1, 0x4 strh r1, [r0] movs r0, 0 ldrsb r0, [r5, r0] lsls r0, 2 adds r2, r0 ldr r0, =0x00002b51 adds r2, r0 movs r0, 0x1 strb r0, [r2] @080EEE0C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r1, [r3] lsrs r0, 22 adds r1, r0 ldr r2, =0x00002b50 adds r1, r2 movs r2, 0 strb r2, [r1] ldr r1, [r3] adds r1, r0 ldr r4, =0x00002b51 adds r1, r4 strb r2, [r1] ldr r1, [r3] adds r1, r0 ldr r0, =0x00002b52 adds r1, r0 strh r2, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EEE78 thumb_func_start sub_80EEEB8 sub_80EEEB8: ; 80EEEB8 push {r4-r7,lr} movs r2, 0 ldr r6, =0x03005d8c @080EEEBE: ldr r0, =0x03005d8c ldr r0, [r0] lsls r1, r2, 2 adds r0, r1 ldr r3, =0x00002b50 adds r0, r3 ldrb r0, [r0] adds r5, r2, 0x1 cmp r0, 0 bne @080EEF12 lsls r0, r5, 24 b @080EEF0C .align 2, 0 .pool @080EEEE0: ldr r3, [r6] lsls r4, r2, 2 adds r0, r3, r4 ldr r7, =0x00002b50 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 .pool @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, =0x03005d8c ldr r3, [r0] @080EEF28: lsls r0, r2, 2 adds r1, r3, r0 ldr r4, =0x00002b50 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 .pool @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, =0x020375f0 movs r0, 0 b @080EF01A .align 2, 0 .pool @080EEF84: ldr r5, =0x03005d8c ldr r0, [r5] lsls r4, r2, 2 adds r1, r0, r4 ldr r0, =0x00002b52 adds r2, r1, r0 ldrh r0, [r2] cmp r0, 0 bne @080EEFE8 ldr r2, =0x00002b51 adds r1, r2 movs r0, 0x2 strb r0, [r1] ldr r0, =0x03005cf8 ldrb r0, [r0, 0x2] lsls r0, 24 asrs r0, 24 cmp r0, 0x13 bgt @080EEFC8 ldr r1, =gUnknown_0858D11C ldr r0, [r5] adds r0, r4 subs r2, 0x1 b @080EEFD0 .align 2, 0 .pool @080EEFC8: ldr r1, =gUnknown_0858D130 ldr r0, [r5] adds r0, r4 ldr r2, =0x00002b50 @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 .pool @080EEFE8: ldrh r1, [r2] ldr r0, =0x02021cc4 movs r2, 0 movs r3, 0x1 bl decimal_int_to_string ldr r0, [r5] adds r0, r4 ldr r1, =0x00002b51 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r1, =gUnknown_0858D108 ldr r0, [r5] adds r0, r4 ldr r2, =0x00002b50 adds r0, r2 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl box_related_two__2 @080EF016: ldr r1, =0x020375f0 movs r0, 0x1 @080EF01A: strh r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c @080EF04C: ldr r1, [r4] lsls r0, r2, 2 adds r1, r0 ldr r5, =0x00002b50 adds r0, r1, r5 ldrb r0, [r0] cmp r0, r3 bne @080EF080 ldr r2, =0x00002b51 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 .pool @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, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0x80 lsls r0, 1 cmp r1, r0 bne @080EF0D4 ldr r0, =0x020375f2 ldrh r0, [r0] cmp r0, 0x19 beq @080EF0A2 b @080EF0D4 .align 2, 0 .pool @080EF0C8: ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000150d cmp r1, r0 beq @080EF0A2 @080EF0D4: movs r0, 0 @080EF0D6: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d8c ldr r3, [r0] ldr r4, =0x00002b50 @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 .pool 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, =0x03005d8c mov r8, r0 @080EF130: mov r1, r8 ldr r0, [r1] lsls r1, r6, 2 adds r2, r0, r1 ldr r3, =0x00002b50 adds r0, r2, r3 ldrb r0, [r0] adds r4, r1, 0 cmp r0, 0 beq @080EF196 ldr r1, =0x00002b52 adds r0, r2, r1 ldrh r0, [r0] cmp r0, r7 bcs @080EF164 adds r0, r6, 0 bl sub_80EEE78 b @080EF196 .align 2, 0 .pool @080EF164: ldr r5, =0x00002b51 adds r0, r2, r5 ldrb r0, [r0] cmp r0, 0 bne @080EF186 ldr r0, =0x00000864 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, =0x00002b52 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 .pool 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, =gUnknown_0858D144 lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x14] bl gf_strcpy b @080EF244 .align 2, 0 .pool @080EF1FC: ldr r1, =gUnknown_0858D144 lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x18] bl gf_strcpy b @080EF244 .align 2, 0 .pool @080EF218: ldr r1, =gUnknown_0858D144 lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x1C] bl gf_strcpy b @080EF244 .align 2, 0 .pool @080EF234: ldr r1, =gUnknown_0858D144 lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x20] bl gf_strcpy @080EF244: pop {r0} bx r0 .align 2, 0 .pool 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, =@080EF26C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080EF26C: .4byte @080EF280 .4byte @080EF29C .4byte @080EF2B8 .4byte @080EF2D4 .4byte @080EF2F0 @080EF280: ldr r1, =gUnknown_0858D144 lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1] bl gf_strcpy b @080EF300 .align 2, 0 .pool @080EF29C: ldr r1, =gUnknown_0858D144 lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x4] bl gf_strcpy b @080EF300 .align 2, 0 .pool @080EF2B8: ldr r1, =gUnknown_0858D144 lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x8] bl gf_strcpy b @080EF300 .align 2, 0 .pool @080EF2D4: ldr r1, =gUnknown_0858D144 lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0xC] bl gf_strcpy b @080EF300 .align 2, 0 .pool @080EF2F0: ldr r1, =gUnknown_0858D144 lsls r0, r2, 2 adds r0, r1 ldr r0, [r0] ldr r1, =gUnknown_0858BAF0 ldr r1, [r1, 0x10] bl gf_strcpy @080EF300: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EF250 thumb_func_start sub_80EF30C sub_80EF30C: ; 80EF30C push {lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc 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 .pool 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, =gUnknown_0858D144 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 .pool 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, =0x00002710 adds r0, r4, 0 bl __divsi3 cmp r0, 0 bne @080EF3B4 movs r0, 0x4 b @080EF406 .align 2, 0 .pool @080EF3B4: ldr r1, =0x000186a0 adds r0, r4, 0 bl __divsi3 cmp r0, 0 bne @080EF3C8 movs r0, 0x5 b @080EF406 .align 2, 0 .pool @080EF3C8: ldr r1, =0x000f4240 adds r0, r4, 0 bl __divsi3 cmp r0, 0 bne @080EF3DC movs r0, 0x6 b @080EF406 .align 2, 0 .pool @080EF3DC: ldr r1, =0x00989680 adds r0, r4, 0 bl __divsi3 cmp r0, 0 bne @080EF3F0 movs r0, 0x7 b @080EF406 .align 2, 0 .pool @080EF3F0: ldr r1, =0x05f5e100 adds r0, r4, 0 bl __divsi3 cmp r0, 0 beq @080EF404 @080EF3FC: movs r0, 0x1 b @080EF406 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r5] ldr r4, =0x000027cc 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 .pool @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, =0x02039f80 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 .pool 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, =0x03005d8c ldr r4, =0x000027cc @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, =0x000027cd adds r0, r2, r6 ldrb r2, [r0] cmp r2, 0x1 bne @080EF590 ldr r0, =0x020375f0 strh r2, [r0] b @080EF5B2 .align 2, 0 .pool @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, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x020375e2 ldrh r0, [r0] subs r0, 0x1 cmp r0, 0xA bhi @080EF646 lsls r0, 2 ldr r1, =@080EF5E0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020375f0 ldrh r0, [r0] cmp r0, 0 bne @080EF6A0 ldr r4, =0x02021cc4 bl sub_8139688 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r4, 0 bl gf_strcpy ldr r2, =0x03005d8c ldr r0, =0x030060bc 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, =0x000027d0 adds r0, r1 movs r1, 0x6 bl sub_811F88C @080EF6A0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EF64C thumb_func_start sub_80EF6C4 sub_80EF6C4: ; 80EF6C4 push {lr} movs r0, 0x2 bl sub_80EF550 ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0 bne @080EF6F0 ldr r2, =0x03005d8c ldr r0, =0x030060bc 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, =0x000027d0 adds r0, r1 movs r1, 0x6 bl sub_811F88C @080EF6F0: pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375f0 ldrh r0, [r0] cmp r0, 0 bne @080EF774 ldr r6, =0x02021cc4 bl sub_8139688 lsls r0, 24 lsrs r0, 24 movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0xB movs r2, 0 bl pokemon_getattr movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames 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, =0x02021dc4 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, =0x03005d8c ldr r0, =0x030060bc 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, =0x000027e8 adds r0, r1 movs r1, 0x2 bl sub_811F88C @080EF774: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EF704 thumb_func_start sub_80EF79C sub_80EF79C: ; 80EF79C ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] bx lr .align 2, 0 .pool 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, =0x020375f0 ldrh r0, [r0] cmp r0, 0 bne @080EF7E0 ldr r2, =0x03005d8c ldr r0, =0x030060bc 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, =0x000027d0 adds r0, r1 movs r1, 0x2 bl sub_811F88C @080EF7E0: pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375f0 ldrh r0, [r0] cmp r0, 0 bne @080EF838 ldr r2, =0x03005d8c ldr r0, =0x030060bc 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, =0x000027e4 adds r0, r1 movs r1, 0x1 bl sub_811F88C @080EF838: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EF80C thumb_func_start sub_80EF84C sub_80EF84C: ; 80EF84C push {lr} movs r0, 0xB bl sub_80EF550 ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0 bne @080EF878 ldr r2, =0x03005d8c ldr r0, =0x030060bc 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, =0x000027e0 adds r0, r1 movs r1, 0x1 bl sub_811F88C @080EF878: pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec adds r5, r1, r0 ldr r6, =0x02021cc4 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, =gSpeciesNames adds r0, r1 adds r1, r6, 0 bl sub_8008C44 cmp r0, 0 bne @080EF8EC movs r0, 0 b @080EF8EE .align 2, 0 .pool @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, =gUnknown_0858D144 lsls r4, 2 adds r4, r0 ldr r0, [r4] movs r1, 0xB muls r1, r5 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy adds r0, r5, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0000019b bl __umodsi3 adds r0, 0x1 lsls r0, 16 lsrs r4, r0, 16 adds r6, r4, 0 b @080EFA62 .align 2, 0 .pool @080EFA48: cmp r4, 0x1 bne @080EFA54 ldr r4, =0x0000019b b @080EFA5A .align 2, 0 .pool @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 SpeciesToNationalPokedexNum 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000027cc adds r0, r1 bl sub_80EFADC ldr r1, =0x030060bc strb r0, [r1] ldr r2, =0x020375e4 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, =0x020375f0 movs r0, 0x1 b @080EFAD0 .align 2, 0 .pool @080EFACC: ldr r1, =0x020375f0 movs r0, 0 @080EFAD0: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff b @080EFB7E .align 2, 0 .pool @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, =0x02021ec4 adds r1, r3, r1 ldrh r1, [r1] bl sub_811EBBC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gSpeciesNames 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 .pool @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, =gUnknown_0858D144 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 .pool thumb_func_end sub_80EFBDC thumb_func_start sub_80EFD54 sub_80EFD54: ; 80EFD54 push {r4,lr} movs r1, 0 ldr r0, =0x03005d8c ldr r3, [r0] ldr r0, =0x020375e0 ldrh r2, [r0] ldr r4, =0x000027cc @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 .pool @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, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r4, =0x02021cc4 movs r1, 0x2 adds r2, r4, 0 bl pokemon_getattr ldr r0, =0x02021ec4 adds r1, r4, 0 bl sub_8008C44 cmp r0, 0 beq @080EFDD4 bl sub_80ED320 movs r0, 0x1 b @080EFDD6 .align 2, 0 .pool @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, =0x020375e0 mov r9, r0 ldrh r0, [r0] movs r1, 0x64 mov r8, r1 mov r1, r8 muls r1, r0 adds r0, r1, 0 ldr r6, =0x020244ec adds r0, r6 ldr r2, =0x02021ec4 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, =0x02021dc4 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, =c2_080CC144 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 .pool thumb_func_end sub_80EFDDC thumb_func_start c2_080CC144 c2_080CC144: ; 80EFE98 push {lr} ldr r0, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r2, =0x02021dc4 movs r1, 0x2 bl pokemon_setattr bl c2_exit_to_overworld_1_continue_scripts_restart_music pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375f6 ldrb r0, [r0] ldr r1, =0x020375f8 ldrb r1, [r1] bl get_pokemon_by_box_and_pos adds r6, r0, 0 ldr r2, =0x02021ec4 movs r1, 0x2 bl pokemon_getattr_encrypted ldr r0, =0x02021dc4 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, =sub_80EFF48 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 .pool thumb_func_end sub_80EFEC4 thumb_func_start sub_80EFF48 sub_80EFF48: ; 80EFF48 push {lr} ldr r0, =0x020375f6 ldrb r0, [r0] ldr r1, =0x020375f8 ldrb r1, [r1] ldr r2, =0x02021dc4 bl sub_80D1E90 bl c2_exit_to_overworld_1_continue_scripts_restart_music pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80EFF48 thumb_func_start sub_80EFF6C sub_80EFF6C: ; 80EFF6C push {r4,lr} ldr r0, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r4, =0x02021cc4 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 .pool 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, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1 movs r2, 0 bl pokemon_getattr cmp r4, r0 bne @080EFFD0 ldr r1, =0x020375f0 movs r0, 0 b @080EFFD4 .align 2, 0 .pool @080EFFD0: ldr r1, =0x020375f0 movs r0, 0x1 @080EFFD4: strh r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 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 .pool thumb_func_end sub_80F0020 thumb_func_start sub_80F0040 sub_80F0040: ; 80F0040 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] cmp r0, 0x1 bne @080F0060 ldr r0, =0x03005d90 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 .pool @080F006C: movs r0, 0x5 ldrsb r0, [r1, r0] cmp r0, 0x2 bne @080F0060 @080F0074: ldr r0, =0x000008bd 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 .pool @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, =0x03005d8c ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] cmp r0, 0x1 bne @080F0104 ldr r0, =0x03005d90 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, =0x02021cc4 ldr r1, =gUnknown_085EAD08 bl gf_strcpy ldr r0, =0x00004003 movs r1, 0x1 bl var_set b @080F0104 .align 2, 0 .pool @080F00EC: movs r0, 0x5 ldrsb r0, [r1, r0] cmp r0, 0x2 bne @080F0104 ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD08 bl gf_strcpy ldr r0, =0x00004003 movs r1, 0x1 bl var_set @080F0104: ldr r4, =0x00004003 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, =0x02021cc4 ldr r1, =gUnknown_085EAD08 bl gf_strcpy b @080F01A8 .align 2, 0 .pool @080F0158: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD04 bl gf_strcpy b @080F01A8 .align 2, 0 .pool @080F016C: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @080F0198 ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD08 bl gf_strcpy adds r0, r4, 0 movs r1, 0x1 bl var_set b @080F01A8 .align 2, 0 .pool @080F0198: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD04 bl gf_strcpy adds r0, r4, 0 movs r1, 0x2 bl var_set @080F01A8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F00A4 thumb_func_start start_menu_append_item start_menu_append_item: ; 80F01B8 push {lr} ldr r0, =0x000040bc movs r1, 0 bl var_set ldr r0, =0x03005d8c ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] movs r0, 0x5 bl npc_hide_by_local_id_and_map ldr r0, =0x00000396 bl flag_set pop {r0} bx r0 .align 2, 0 .pool 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, =0x020229e8 b @080F0276 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000027cc 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, =0x00000a8c adds r3, r5, r4 bl sub_80F0358 b @080F031E .align 2, 0 .pool @080F02C4: ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x000027cc adds r1, r0 movs r3, 0xE1 lsls r3, 3 adds r2, r5, r3 b @080F02EA .align 2, 0 .pool @080F02DC: movs r0, 0xE1 lsls r0, 2 adds r1, r5, r0 ldr r0, =0x03005d8c ldr r2, [r0] ldr r3, =0x000027cc adds r2, r3 @080F02EA: ldr r4, =0x00000a8c adds r3, r5, r4 adds r0, r5, 0 bl sub_80F0358 b @080F031E .align 2, 0 .pool @080F0304: movs r0, 0xE1 lsls r0, 2 adds r1, r5, r0 movs r3, 0xE1 lsls r3, 3 adds r2, r5, r3 ldr r0, =0x03005d8c ldr r3, [r0] ldr r4, =0x000027cc adds r3, r4 adds r0, r5, 0 bl sub_80F0358 @080F031E: ldr r5, =0x03005d8c ldr r0, [r5] ldr r4, =0x000027cc 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 .pool 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, =0x03001174 strb r0, [r1] @080F0384: movs r6, 0 ldr r0, =0x03001174 ldrb r1, [r0] cmp r6, r1 bcs @080F0384 mov r10, r0 @080F0390: cmp r6, 0 bne @080F0398 ldr r2, =0x0203a02c 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, =0x03001176 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, =0x0203a02c 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 .pool @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, =0x03001174 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, =0x030060bc 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, =0x03001176 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 .pool @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, =0x03001176 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 .pool @080F04DC: cmp r1, 0x4 beq @080F0534 b @080F055A @080F04E2: ldr r0, =0x030060bc 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 .pool @080F050C: ldr r0, =0x030060bc 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 .pool @080F0534: ldr r0, =0x030060bc 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 .pool @080F0568: ldr r0, =0x03001176 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 .pool 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, =0x03005d8c ldr r1, [r3] mov r4, r9 lsls r2, r4, 3 adds r0, r2, r4 lsls r0, 2 adds r1, r0 ldr r0, =0x000027cc adds r1, r0 ldrb r0, [r1] adds r7, r2, 0 cmp r0, 0x29 bls @080F0732 b @080F0AD8 @080F0732: lsls r0, 2 ldr r1, =@080F0748 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x000027cc 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 .pool @080F081C: ldr r0, [r3] mov r2, r9 adds r4, r7, r2 lsls r4, 2 adds r0, r4, r0 ldr r6, =0x000027cc 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 .pool @080F0848: ldr r0, [r3] mov r4, r9 adds r1, r7, r4 lsls r1, 2 adds r1, r0 ldr r0, =0x000027cc adds r1, r0 ldrh r0, [r1, 0x2] b @080F09B0 .align 2, 0 .pool @080F0860: ldr r0, [r3] mov r2, r9 adds r1, r7, r2 lsls r1, 2 adds r1, r0 ldr r4, =0x000027cc adds r1, r4 ldrh r0, [r1, 0x2] lsls r1, r2, 24 b @080F09B2 .align 2, 0 .pool @080F0878: ldr r0, [r3] mov r2, r9 adds r1, r7, r2 lsls r1, 2 adds r1, r0 ldr r4, =0x000027cc adds r1, r4 ldrh r0, [r1, 0x6] lsls r1, r2, 24 b @080F09B2 .align 2, 0 .pool @080F0890: ldr r0, [r3] mov r1, r9 adds r4, r7, r1 lsls r4, 2 adds r0, r4, r0 ldr r6, =0x000027cc 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 .pool @080F08BC: ldr r0, [r3] mov r2, r9 adds r1, r7, r2 lsls r1, 2 adds r1, r0 ldr r4, =0x000027cc adds r1, r4 ldrh r0, [r1, 0x2] lsls r1, r2, 24 b @080F09B2 .align 2, 0 .pool @080F08D4: ldr r0, [r3] mov r1, r9 adds r4, r7, r1 lsls r4, 2 adds r0, r4, r0 ldr r6, =0x000027cc 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 .pool @080F0900: ldr r0, [r3] mov r2, r9 adds r1, r7, r2 lsls r1, 2 adds r1, r0 ldr r4, =0x000027cc adds r1, r4 ldrh r0, [r1, 0x10] lsls r1, r2, 24 b @080F09B2 .align 2, 0 .pool @080F0918: ldr r0, [r3] mov r1, r9 adds r4, r7, r1 lsls r4, 2 adds r0, r4, r0 ldr r6, =0x000027cc 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 .pool @080F0944: ldr r0, [r3] mov r2, r9 adds r1, r7, r2 lsls r1, 2 adds r1, r0 ldr r4, =0x000027cc adds r1, r4 ldrh r0, [r1, 0x4] lsls r1, r2, 24 b @080F09B2 .align 2, 0 .pool @080F095C: ldr r0, [r3] mov r1, r9 adds r4, r7, r1 lsls r4, 2 adds r0, r4, r0 ldr r6, =0x000027cc adds r0, r6 ldrh r0, [r0, 0x8] b @080F09D0 .align 2, 0 .pool @080F0974: ldr r0, [r3] mov r2, r9 adds r4, r7, r2 lsls r4, 2 adds r0, r4, r0 ldr r6, =0x000027cc 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 .pool @080F09A0: ldr r0, [r3] mov r4, r9 adds r1, r7, r4 lsls r1, 2 adds r1, r0 ldr r0, =0x000027cc adds r1, r0 ldrh r0, [r1, 0x8] @080F09B0: lsls r1, r4, 24 @080F09B2: lsrs r1, 24 bl sub_80F0B24 b @080F0AE2 .align 2, 0 .pool @080F09C0: ldr r0, [r3] mov r1, r9 adds r4, r7, r1 lsls r4, 2 adds r0, r4, r0 ldr r6, =0x000027cc 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 .pool @080F09F4: ldr r0, [r3] mov r2, r9 adds r4, r7, r2 lsls r4, 2 adds r0, r4, r0 ldr r5, =0x000027cc 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, =@080F0A48 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c ldr r1, [r0] mov r4, r9 adds r0, r7, r4 lsls r0, 2 adds r0, r1 ldr r1, =0x000027cc adds r0, r1 ldrh r0, [r0, 0x8] lsrs r1, r6, 24 bl sub_80F0B24 b @080F0AE2 .align 2, 0 .pool @080F0AA0: ldr r2, =0x03005d8c ldr r0, [r2] mov r1, r9 adds r4, r7, r1 lsls r4, 2 adds r0, r4, r0 ldr r5, =0x000027cc 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 .pool @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, =0x03005d8c ldr r2, [r1] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 adds r2, r1 ldr r0, =0x000027cd adds r2, r0 movs r0, 0 strb r0, [r2] bx lr .align 2, 0 .pool 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 SpeciesToNationalPokedexNum 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, =0x03005d8c ldr r1, [r0] lsls r0, r4, 3 adds r0, r4 lsls r0, 2 adds r1, r0 ldr r0, =0x000027cd adds r1, r0 strb r2, [r1] @080F0B56: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F0B24 thumb_func_start sub_80F0B64 sub_80F0B64: ; 80F0B64 push {r4-r6,lr} ldr r0, =0x00000864 bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080F0BA2 movs r2, 0 ldr r4, =0x000027cd movs r3, 0 ldr r5, =0x03005d8c @080F0B7C: ldr r0, [r5] lsls r1, r2, 3 adds r1, r2 lsls r1, 2 adds r1, r0, r1 ldr r6, =0x000027cc 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 .pool thumb_func_end sub_80F0B64 thumb_func_start sub_80F0BB8 sub_80F0BB8: ; 80F0BB8 push {r4-r6,lr} movs r5, 0 ldr r6, =0x03005d8c @080F0BBE: ldr r1, [r6] lsls r0, r5, 3 adds r0, r5 lsls r4, r0, 2 adds r1, r4 ldr r0, =0x000027cc 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, =0x000027cd 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 .pool 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, =0x03005d8c ldr r4, [r0] ldr r5, =0x000027cc @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000027cc 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 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002b50 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 .pool @080F0CF0: ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00002b50 adds r1, r0 adds r2, r5, 0 adds r2, 0x80 b @080F0D14 .align 2, 0 .pool @080F0D08: adds r1, r5, 0 adds r1, 0x40 ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, =0x00002b50 adds r2, r0 @080F0D14: adds r3, r5, 0 adds r3, 0xC0 adds r0, r5, 0 bl sub_80F0D60 b @080F0D3E .align 2, 0 .pool @080F0D28: adds r1, r5, 0 adds r1, 0x40 adds r2, r5, 0 adds r2, 0x80 ldr r0, =0x03005d8c ldr r3, [r0] ldr r0, =0x00002b50 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 .pool 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, =0x03001175 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 .pool @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, =0x03001176 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, =0x03001175 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, =0x030060bc 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, =0x03001175 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 .pool thumb_func_end sub_80F0D60 thumb_func_start sub_80F0E58 sub_80F0E58: ; 80F0E58 push {lr} ldr r0, [r0] ldr r1, [r1] ldr r2, =0x03001176 ldrb r2, [r2] lsls r2, 24 asrs r2, 24 lsls r2, 2 adds r1, r2 ldr r2, =0x030060bc ldrb r2, [r2] lsls r2, 24 asrs r2, 24 bl sub_80F0E84 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] lsls r1, r4, 2 adds r0, r1 ldr r1, =0x00002b50 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 .pool thumb_func_end sub_80F0EEC thumb_func_start sub_80F0F24 sub_80F0F24: ; 80F0F24 push {r4,r5,lr} ldr r0, =0x00000864 bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @080F0F50 movs r2, 0 ldr r5, =0x03005d8c ldr r4, =0x00002b51 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 .pool 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, =@080F0F98 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =@080F12D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c ldr r2, [r0] ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r2, r0 ldr r1, =0x000027cd 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, =@080F1584 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] cmp r5, 0x8 bls @080F1712 b @080F1952 @080F1712: lsls r0, r5, 2 ldr r1, =@080F1734 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 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, =gSpeciesNames adds r0, r1 adds r1, r4, 0 adds r1, 0x8 bl sub_8008C44 cmp r0, 0 bne @080F17A4 ldr r1, =0x0203a030 movs r0, 0x8 b @080F1950 .align 2, 0 .pool @080F17A4: ldr r1, =0x0203a030 movs r0, 0x1 b @080F1950 .align 2, 0 .pool @080F17B0: ldr r0, =0x02021cc4 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 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 .pool @080F17E8: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0x3 b @080F1950 .align 2, 0 .pool @080F180C: ldr r1, =0x0203a030 movs r0, 0x4 b @080F1950 .align 2, 0 .pool @080F1818: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x16 ldrb r2, [r4, 0x1E] bl sub_81DB5E8 ldr r0, =0x02021dc4 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, =0x0203a030 movs r0, 0x5 b @080F1950 .align 2, 0 .pool @080F184C: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x16 ldrb r2, [r4, 0x1E] bl sub_81DB5E8 ldr r0, =0x02021dc4 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, =0x0203a030 movs r0, 0x5 b @080F1950 .align 2, 0 .pool @080F1880: ldr r0, =0x02021cc4 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, =0x02021ec4 ldrh r1, [r4, 0x6] bl sub_811EBBC ldrh r0, [r4, 0x14] cmp r0, 0 beq @080F18B8 ldr r1, =0x0203a030 movs r0, 0x6 b @080F1950 .align 2, 0 .pool @080F18B8: ldr r1, =0x0203a030 movs r0, 0x7 b @080F1950 .align 2, 0 .pool @080F18C4: ldr r0, =0x02021cc4 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 ldrh r2, [r4, 0x14] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r1, [r4, 0x6] bl sub_811EBBC ldr r1, =0x0203a030 movs r0, 0x7 b @080F1950 .align 2, 0 .pool @080F190C: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x16 ldrb r2, [r4, 0x1E] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy bl sub_80F577C b @080F1952 .align 2, 0 .pool @080F193C: ldr r0, =0x02021cc4 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy @080F194C: ldr r1, =0x0203a030 movs r0, 0x2 @080F1950: strb r0, [r1] @080F1952: ldr r0, =gUnknown_0858D204 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 .pool thumb_func_end sub_80F16EC thumb_func_start sub_80F1974 sub_80F1974: ; 80F1974 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] adds r2, r0, 0 cmp r5, 0xE bls @080F199C b @080F1BEA @080F199C: lsls r0, r5, 2 ldr r1, =@080F19C0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r4, 0x2 ldrb r2, [r4, 0x1D] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0xA] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldrh r0, [r4, 0x16] cmp r0, 0x6 bls @080F1A34 ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1A34: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1A40: ldrb r0, [r4, 0x1A] cmp r0, 0x32 bne @080F1A58 ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAEB1 bl gf_strcpy b @080F1A60 .align 2, 0 .pool @080F1A58: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAEB8 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, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1A84: ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1A90: ldr r0, =0x02021cc4 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 .pool @080F1AB4: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x14] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy b @080F1AA6 .align 2, 0 .pool @080F1AE0: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x14] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldrb r0, [r4, 0x1B] cmp r0, 0 bne @080F1B1C @080F1B02: ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1B1C: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1B28: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] b @080F1B54 .align 2, 0 .pool @080F1B38: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] b @080F1B54 .align 2, 0 .pool @080F1B48: movs r0, 0xB strb r0, [r2] b @080F1BEA @080F1B4E: ldr r0, =0x02021cc4 adds r1, r4, 0x2 ldrb r2, [r4, 0x1D] @080F1B54: bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0xB strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1B68: ldr r0, =0x02021cc4 ldrh r1, [r4, 0x18] bl sub_811EBBC ldrb r0, [r4, 0x1B] cmp r0, 0 bne @080F1B88 ldr r1, =0x0203a030 movs r0, 0xC strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1B88: ldr r1, =0x0203a030 movs r0, 0xD strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1B94: ldr r0, =0x02021cc4 ldrh r1, [r4, 0x18] bl sub_811EBBC ldr r0, =0x02021dc4 adds r1, r4, 0x2 ldrb r2, [r4, 0x1D] bl sub_81DB5E8 ldr r0, =0x02021ec4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1E] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0xE strb r0, [r1] b @080F1BEA .align 2, 0 .pool @080F1BCC: ldr r0, =0x02021cc4 adds r1, r4, 0x2 ldrb r2, [r4, 0x1D] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0xA] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy bl sub_80F577C @080F1BEA: ldr r0, =gUnknown_0858D240 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 .pool thumb_func_end sub_80F1974 thumb_func_start sub_80F1C0C sub_80F1C0C: ; 80F1C0C push {r4-r6,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r5, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r6, [r0] adds r2, r0, 0 cmp r6, 0xC bls @080F1C34 b @080F1E2C @080F1C34: lsls r0, r6, 2 ldr r1, =@080F1C58 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x3] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrb r1, [r5, 0x12] movs r2, 0 bl GetMapName ldrh r0, [r5, 0xC] cmp r0, 0xFE bls @080F1CBC ldr r1, =0x0203a030 movs r0, 0xB strb r0, [r1] b @080F1E2C .align 2, 0 .pool @080F1CBC: ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F1E2C .align 2, 0 .pool @080F1CC8: ldr r0, =0x02021cc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x3] bl sub_81DB5E8 ldr r4, =0x02021dc4 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, =0x0203a030 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 .pool @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, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F1E2C .align 2, 0 .pool @080F1D40: ldr r1, =0x0203a030 movs r0, 0xA strb r0, [r1] b @080F1E2C .align 2, 0 .pool @080F1D4C: ldr r4, =0x02021dc4 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, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F1E2C .align 2, 0 .pool @080F1D7C: ldr r4, =0x02021dc4 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, =0x0203a030 movs r0, 0x9 strb r0, [r1] b @080F1E2C .align 2, 0 .pool @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, =0x02021cc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x3] bl sub_81DB5E8 ldr r4, =0x02021dc4 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, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F1E2C .align 2, 0 .pool @080F1E10: ldr r1, =0x0203a030 movs r0, 0xC strb r0, [r1] b @080F1E2C .align 2, 0 .pool @080F1E1C: ldr r0, =0x02021cc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x3] bl sub_81DB5E8 bl sub_80F577C @080F1E2C: ldr r0, =gUnknown_0858D1D0 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 .pool thumb_func_end sub_80F1C0C thumb_func_start sub_80F1E48 sub_80F1E48: ; 80F1E48 push {r4-r6,lr} sub sp, 0x8 ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r5, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r6, [r0] adds r2, r0, 0 cmp r6, 0x12 bls @080F1E72 b @080F20FE @080F1E72: lsls r0, r6, 2 ldr r1, =@080F1E94 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r5, 0 adds r1, 0xF ldrb r2, [r5, 0x1E] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r5, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 adds r1, r5, 0x4 ldrb r2, [r5, 0x1F] bl sub_81DB5E8 ldr r4, =0x0203a030 adds r0, r5, 0 bl sub_80EFBA4 adds r0, 0x1 strb r0, [r4] b @080F20FE .align 2, 0 .pool @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, =0x02021cc4 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, =0x0203a030 movs r0, 0x9 strb r0, [r1] b @080F20FE .align 2, 0 .pool @080F1F6C: cmp r0, 0x1 bne @080F1F7C ldr r1, =0x0203a030 movs r0, 0xA strb r0, [r1] b @080F20FE .align 2, 0 .pool @080F1F7C: cmp r0, 0x2 beq @080F1F82 b @080F20FE @080F1F82: ldr r1, =0x0203a030 movs r0, 0xB strb r0, [r1] b @080F20FE .align 2, 0 .pool @080F1F90: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0xC strb r0, [r1] b @080F20FE .align 2, 0 .pool @080F1FCC: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0xE strb r0, [r1] b @080F20FE .align 2, 0 .pool @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, =0x02021dc4 ldrh r2, [r5, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames 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, =0x0203a030 movs r0, 0x10 strb r0, [r1] b @080F20FE .align 2, 0 .pool @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, =0x0203a030 movs r0, 0x11 strb r0, [r1] b @080F20FE .align 2, 0 .pool @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, =0x02021dc4 ldrh r2, [r5, 0x1C] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames 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, =0x0203a030 movs r0, 0x12 strb r0, [r1] b @080F20FE .align 2, 0 .pool @080F20EC: movs r6, 0x12 strb r6, [r2] @080F20F0: ldr r0, =0x02021cc4 adds r1, r5, 0x4 ldrb r2, [r5, 0x1F] bl sub_81DB5E8 bl sub_80F577C @080F20FE: ldr r0, =gUnknown_0858D338 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 .pool thumb_func_end sub_80F1E48 thumb_func_start sub_80F211C sub_80F211C: ; 80F211C push {r4-r6,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r5, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r6, [r0] adds r2, r0, 0 cmp r6, 0xB bls @080F2144 b @080F2358 @080F2144: lsls r0, r6, 2 ldr r1, =@080F2168 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x2] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r5, 0x10] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 adds r1, r5, 0x4 ldrb r2, [r5, 0x3] bl sub_81DB5E8 ldrb r0, [r5, 0xF] cmp r0, 0x1 bne @080F21E0 ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F2358 .align 2, 0 .pool @080F21E0: ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F2358 .align 2, 0 .pool @080F21EC: movs r0, 0x2 strb r0, [r2] b @080F2358 @080F21F2: ldr r4, =0x02021dc4 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, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F2358 .align 2, 0 .pool @080F2220: ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F2358 .align 2, 0 .pool @080F222C: ldr r0, =0x02021cc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x2] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r5, 0x10] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 adds r1, r5, 0x4 ldrb r2, [r5, 0x3] bl sub_81DB5E8 b @080F2286 .align 2, 0 .pool @080F2264: movs r0, 0x6 strb r0, [r2] b @080F2358 @080F226A: ldr r0, =0x02021cc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x2] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r5, 0x10] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy @080F2286: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F2358 .align 2, 0 .pool @080F22A0: ldr r0, =0x02021cc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x2] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r5, 0x10] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 adds r1, r5, 0x4 ldrb r2, [r5, 0x3] bl sub_81DB5E8 ldr r4, =0x0203a030 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 .pool @080F22F4: ldr r0, =0x02021cc4 ldrh r1, [r5, 0x10] movs r4, 0xB muls r1, r4 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 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 .pool @080F2324: ldr r0, =0x02021cc4 ldrh r1, [r5, 0x10] movs r4, 0xB muls r1, r4 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 adds r1, r5, 0x4 ldrb r2, [r5, 0x3] bl sub_81DB5E8 @080F233E: ldr r0, =0x0203a030 strb r4, [r0] b @080F2358 .align 2, 0 .pool @080F2354: bl sub_80F577C @080F2358: ldr r0, =gUnknown_0858D1A0 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 .pool thumb_func_end sub_80F211C thumb_func_start sub_80F2370 sub_80F2370: ; 80F2370 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] cmp r5, 0x6 bls @080F2396 b @080F24C0 @080F2396: lsls r0, r5, 2 ldr r1, =@080F23B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F23B8: .4byte @080F23D4 .4byte @080F2408 .4byte @080F245C .4byte @080F245C .4byte @080F24A0 .4byte @080F24A0 .4byte @080F24BC @080F23D4: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x2] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0xC] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F24C0 .align 2, 0 .pool @080F2408: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x2] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrb r1, [r4, 0x12] movs r2, 0 bl GetMapName ldr r0, =0x02021ec4 ldrh r2, [r4, 0xE] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldrb r0, [r4, 0x11] cmp r0, 0x1 bne @080F2450 ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F24C0 .align 2, 0 .pool @080F2450: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F24C0 .align 2, 0 .pool @080F245C: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F24C0 .align 2, 0 .pool @080F2494: ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F24C0 .align 2, 0 .pool @080F24A0: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x2] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F24C0 .align 2, 0 .pool @080F24BC: bl sub_80F577C @080F24C0: ldr r0, =gUnknown_0858D394 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 .pool thumb_func_end sub_80F2370 thumb_func_start sub_80F24D8 sub_80F24D8: ; 80F24D8 push {r4-r7,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r5, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r7, [r0] adds r6, r0, 0 cmp r7, 0x33 bls @080F2500 b @080F26F0 @080F2500: lsls r0, r7, 2 ldr r1, =@080F2524 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r5, 0 adds r1, 0x10 ldrb r2, [r5, 0x18] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r5, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x32 strb r0, [r1] b @080F26F0 .align 2, 0 .pool @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, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F26F0 .align 2, 0 .pool @080F2648: ldr r1, =0x0203a030 adds r0, r2, 0x2 strb r0, [r1] b @080F26F0 .align 2, 0 .pool @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, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F26F0 .align 2, 0 .pool @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, =0x02021fc4 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, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F26FC .align 2, 0 .pool @080F26CC: ldr r4, =0x02021fc4 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, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F26FC .align 2, 0 .pool @080F26F0: ldr r0, =gUnknown_0858D150 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 .pool thumb_func_end sub_80F24D8 thumb_func_start sub_80F2708 sub_80F2708: ; 80F2708 push {r4-r7,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r5, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r6, [r0] adds r7, r0, 0 cmp r6, 0x32 bls @080F2730 b @080F288C @080F2730: lsls r0, r6, 2 ldr r1, =@080F2754 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r5, 0 adds r1, 0x10 ldrb r2, [r5, 0x18] bl sub_81DB5E8 adds r0, r5, 0 bl sub_80EFB58 ldr r1, =0x0203a030 movs r0, 0x32 strb r0, [r1] b @080F288C .align 2, 0 .pool @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, =0x02021fc4 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, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F2898 .align 2, 0 .pool @080F288C: ldr r0, =gUnknown_0858D170 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 .pool thumb_func_end sub_80F2708 thumb_func_start sub_80F28A4 sub_80F28A4: ; 80F28A4 push {r4-r6,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r6, =0x0203a030 ldrb r5, [r6] cmp r5, 0x3 bgt @080F28E8 cmp r5, 0x1 bge @080F2930 cmp r5, 0 beq @080F28EE b @080F297E .align 2, 0 .pool @080F28E8: cmp r5, 0x4 beq @080F2968 b @080F297E @080F28EE: ldr r0, =0x02021cc4 adds r1, r4, 0x5 ldrb r2, [r4, 0xD] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 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 .pool @080F2930: ldr r0, =0x02021cc4 adds r1, r4, 0x5 ldrb r2, [r4, 0xD] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r1, [r4, 0x1C] bl sub_811EBBC movs r0, 0x4 strb r0, [r6] b @080F297E .align 2, 0 .pool @080F2968: ldr r0, =0x02021cc4 adds r1, r4, 0x5 ldrb r2, [r4, 0xD] bl sub_81DB5E8 ldr r0, =0x02021ec4 ldrh r1, [r4, 0x1E] bl sub_811EBBC bl sub_80F577C @080F297E: ldr r0, =gUnknown_0858D188 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 .pool 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, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r4, [r2] adds r4, r0 ldr r0, =0x02021cc4 ldrb r1, [r4, 0x10] movs r2, 0 bl GetMapName ldr r0, =0x02021dc4 ldrh r2, [r4, 0xC] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy bl sub_80F577C bl sub_80ED430 ldr r1, =gUnknown_0858D19C ldr r0, =0x0203a030 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 .pool thumb_func_end sub_80F29A0 thumb_func_start sub_80F2A10 sub_80F2A10: ; 80F2A10 push {r4-r7,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r6, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r7, [r0] adds r2, r0, 0 cmp r7, 0x20 bls @080F2A38 b @080F311C @080F2A38: lsls r0, r7, 2 ldr r1, =@080F2A5C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 ldrb r1, [r6, 0x1C] bl sub_818E868 ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 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, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2B2C: ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2B38: cmp r0, r1 bls @080F2B48 ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2B48: ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2B54: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames 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 .pool @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, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames 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 .pool @080F2BC8: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 adds r1, r6, 0 adds r1, 0x14 ldrb r2, [r6, 0x1D] bl sub_81DB5E8 b @080F2BB2 .align 2, 0 .pool @080F2BF4: ldrb r0, [r6, 0x1C] cmp r0, 0x4 bhi @080F2C74 lsls r0, 2 ldr r1, =@080F2C08 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F2C08: .4byte @080F2C1C .4byte @080F2C30 .4byte @080F2C44 .4byte @080F2C58 .4byte @080F2C6C @080F2C1C: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB0E8 bl gf_strcpy b @080F2C74 .align 2, 0 .pool @080F2C30: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB0ED bl gf_strcpy b @080F2C74 .align 2, 0 .pool @080F2C44: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB0F4 bl gf_strcpy b @080F2C74 .align 2, 0 .pool @080F2C58: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB0F9 bl gf_strcpy b @080F2C74 .align 2, 0 .pool @080F2C6C: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB0FF bl gf_strcpy @080F2C74: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames 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 .pool @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, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2CD8: ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2CE4: ldr r1, =0x0203a030 movs r0, 0xE strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2CF0: ldr r1, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2CFC: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2D08: ldr r1, =0x0203a030 movs r0, 0x14 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2D14: ldr r1, =0x0203a030 movs r0, 0x15 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2D20: ldr r1, =0x0203a030 movs r0, 0x16 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2D2C: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2D40: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2D54: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2D68: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldrb r0, [r6, 0x1C] cmp r0, 0x4 bls @080F2D80 b @080F311C @080F2D80: lsls r0, 2 ldr r1, =@080F2D98 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F2D98: .4byte @080F2DAC .4byte @080F2DB8 .4byte @080F2DC4 .4byte @080F2DD0 .4byte @080F2DDC @080F2DAC: ldr r1, =0x0203a030 movs r0, 0x9 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2DB8: ldr r1, =0x0203a030 movs r0, 0xA strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2DC4: ldr r1, =0x0203a030 movs r0, 0xB strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2DD0: ldr r1, =0x0203a030 movs r0, 0xC strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2DDC: ldr r1, =0x0203a030 movs r0, 0xD strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2DE8: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2DFC: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2E10: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2E24: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2E38: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2E4C: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldrb r0, [r6, 0x1C] cmp r0, 0x4 bls @080F2E64 b @080F311C @080F2E64: lsls r0, 2 ldr r1, =@080F2E7C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F2E7C: .4byte @080F2E90 .4byte @080F2E9C .4byte @080F2EA8 .4byte @080F2EB4 .4byte @080F2EC0 @080F2E90: ldr r1, =0x0203a030 movs r0, 0xF strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2E9C: ldr r1, =0x0203a030 movs r0, 0x10 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2EA8: ldr r1, =0x0203a030 movs r0, 0x11 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2EB4: ldr r1, =0x0203a030 movs r0, 0x12 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2EC0: ldr r1, =0x0203a030 movs r0, 0x13 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2ECC: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2EE0: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2EF4: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2F08: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2F1C: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2F30: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2F44: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames b @080F2F72 .align 2, 0 .pool @080F2F58: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r2, [r6, 0x10] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames @080F2F72: adds r1, r2 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x17 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F2F94: ldr r0, =0x02021cc4 ldrh r1, [r6, 0x12] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021dc4 adds r1, r6, 0x4 ldrb r2, [r6, 0x1E] bl sub_81DB5E8 ldr r0, =0x02021ec4 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 .pool @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, =0x0203a030 movs r0, 0x1F strb r0, [r1] b @080F311C .align 2, 0 .pool @080F3010: ldr r1, =0x0203a030 movs r0, 0x1E strb r0, [r1] b @080F311C .align 2, 0 .pool @080F301C: ldr r1, =0x0203a030 movs r0, 0x1D strb r0, [r1] b @080F311C .align 2, 0 .pool @080F3028: ldr r1, =0x0203a030 movs r0, 0x1C strb r0, [r1] b @080F311C .align 2, 0 .pool @080F3034: ldr r1, =0x0203a030 movs r0, 0x1B strb r0, [r1] b @080F311C .align 2, 0 .pool @080F3040: ldr r1, =0x0203a030 movs r0, 0x1A strb r0, [r1] b @080F311C .align 2, 0 .pool @080F304C: ldr r1, =0x0203a030 movs r0, 0x19 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F3058: ldr r1, =0x0203a030 movs r0, 0x18 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F3064: ldr r0, =0x02021cc4 ldrh r2, [r6, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy b @080F30EA .align 2, 0 .pool @080F3080: ldr r0, =0x02021cc4 adds r1, r6, 0x4 ldrb r2, [r6, 0x1E] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r6, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy b @080F30EA .align 2, 0 .pool @080F30A8: movs r0, 0x20 strb r0, [r2] b @080F311C @080F30AE: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x14 ldrb r2, [r6, 0x1D] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 b @080F30E2 .align 2, 0 .pool @080F30E0: ldr r0, =0x02021cc4 @080F30E2: adds r1, r6, 0x4 ldrb r2, [r6, 0x1E] bl sub_81DB5E8 @080F30EA: ldr r1, =0x0203a030 movs r0, 0x20 strb r0, [r1] b @080F311C .align 2, 0 .pool @080F30FC: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x14 ldrb r2, [r6, 0x1D] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r6, 0x12] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy bl sub_80F577C @080F311C: ldr r0, =gUnknown_0858D27C 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 .pool thumb_func_end sub_80F2A10 thumb_func_start sub_80F3140 sub_80F3140: ; 80F3140 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] adds r2, r0, 0 cmp r5, 0x7 bls @080F3168 b @080F3362 @080F3168: lsls r0, r5, 2 ldr r1, =@080F318C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 ldr r0, =0x02021dc4 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, =0x02021ec4 ldr r1, =gUnknown_085ECB64 bl gf_strcpy b @080F3208 .align 2, 0 .pool @080F3200: ldr r0, =0x02021ec4 ldr r1, =gUnknown_085ECB6B bl gf_strcpy @080F3208: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F3362 .align 2, 0 .pool @080F321C: ldr r0, =0x02021cc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x16] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r2, [r4, 0x14] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F3362 .align 2, 0 .pool @080F3268: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1A] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F3362 .align 2, 0 .pool @080F329C: ldr r0, =0x02021cc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1A] bl sub_81DB5E8 bl sub_80F577C b @080F3362 .align 2, 0 .pool @080F32C0: ldr r0, =0x02021cc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1A] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F3362 .align 2, 0 .pool @080F32EC: ldr r0, =0x02021cc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x16] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r2, [r4, 0x14] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F3362 .align 2, 0 .pool @080F3338: ldr r0, =0x02021cc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x19] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x1A] bl sub_81DB5E8 ldr r0, =0x02021ec4 ldrh r2, [r4, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy bl sub_80F577C @080F3362: ldr r0, =gUnknown_0858D300 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 .pool thumb_func_end sub_80F3140 thumb_func_start sub_80F3388 sub_80F3388: ; 80F3388 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] cmp r5, 0x5 bls @080F33AE b @080F3624 @080F33AE: lsls r0, r5, 2 ldr r1, =@080F33D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F33D0: .4byte @080F33E8 .4byte @080F3418 .4byte @080F3500 .4byte @080F350C .4byte @080F35F4 .4byte @080F3620 @080F33E8: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F3624 .align 2, 0 .pool @080F340C: ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F3624 .align 2, 0 .pool @080F3418: ldrb r0, [r4, 0x3] lsls r0, 29 lsrs r0, 29 cmp r0, 0x4 bhi @080F349C lsls r0, 2 ldr r1, =@080F3430 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F3430: .4byte @080F3444 .4byte @080F3458 .4byte @080F346C .4byte @080F3480 .4byte @080F3494 @080F3444: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB48 bl gf_strcpy b @080F349C .align 2, 0 .pool @080F3458: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB4E bl gf_strcpy b @080F349C .align 2, 0 .pool @080F346C: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB52 bl gf_strcpy b @080F349C .align 2, 0 .pool @080F3480: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB58 bl gf_strcpy b @080F349C .align 2, 0 .pool @080F3494: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB5F bl gf_strcpy @080F349C: ldrb r0, [r4, 0x2] cmp r0, 0x18 bls @080F34BC ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB2A bl gf_strcpy b @080F34DC .align 2, 0 .pool @080F34BC: cmp r0, 0x16 bls @080F34D4 ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB20 bl gf_strcpy b @080F34DC .align 2, 0 .pool @080F34D4: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB1B bl gf_strcpy @080F34DC: ldr r0, =0x02021ec4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x14] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F3624 .align 2, 0 .pool @080F3500: ldr r0, =0x02021cc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x15] b @080F3606 .align 2, 0 .pool @080F350C: ldrb r0, [r4, 0x3] lsls r0, 29 lsrs r0, 29 cmp r0, 0x4 bhi @080F3590 lsls r0, 2 ldr r1, =@080F3524 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F3524: .4byte @080F3538 .4byte @080F354C .4byte @080F3560 .4byte @080F3574 .4byte @080F3588 @080F3538: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB48 bl gf_strcpy b @080F3590 .align 2, 0 .pool @080F354C: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB4E bl gf_strcpy b @080F3590 .align 2, 0 .pool @080F3560: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB52 bl gf_strcpy b @080F3590 .align 2, 0 .pool @080F3574: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB58 bl gf_strcpy b @080F3590 .align 2, 0 .pool @080F3588: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085ECB5F bl gf_strcpy @080F3590: ldrb r0, [r4, 0x2] cmp r0, 0x10 bls @080F35B0 ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB34 bl gf_strcpy b @080F35D0 .align 2, 0 .pool @080F35B0: cmp r0, 0xD bls @080F35C8 ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB3A bl gf_strcpy b @080F35D0 .align 2, 0 .pool @080F35C8: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB3E bl gf_strcpy @080F35D0: ldr r0, =0x02021ec4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x14] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F3624 .align 2, 0 .pool @080F35F4: ldr r0, =0x02021cc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x15] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x14] @080F3606: bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F3624 .align 2, 0 .pool @080F3620: bl sub_80F577C @080F3624: ldr r0, =gUnknown_0858D228 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 .pool thumb_func_end sub_80F3388 thumb_func_start sub_80F363C sub_80F363C: ; 80F363C push {r4-r7,lr} ldr r0, =0x020375f0 movs r1, 0 strh r1, [r0] ldr r0, =0x0203a030 ldrb r7, [r0] adds r2, r0, 0 cmp r7, 0x8 bls @080F3650 b @080F37EA @080F3650: lsls r0, r7, 2 ldr r1, =@080F3668 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 ldr r4, =0x03005d8c ldr r1, [r4] ldr r2, =0x00002bac adds r1, r2 ldrb r1, [r1] movs r2, 0 bl GetMapName ldr r0, [r4] ldr r1, =0x00002bad adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bls @080F36C8 ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F37EA .align 2, 0 .pool @080F36C8: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F37EA .align 2, 0 .pool @080F36D4: movs r0, 0x2 strb r0, [r2] b @080F37EA @080F36DA: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002bae 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 .pool @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, =0x02021cc4 ldr r4, =0x03005d8c ldr r1, [r4] ldr r2, =0x00002ba4 adds r1, r2 ldrh r1, [r1] movs r6, 0xB muls r1, r6 ldr r5, =gSpeciesNames adds r1, r5 bl gf_strcpy ldr r0, =0x02021dc4 ldr r1, [r4] ldr r2, =0x00002ba8 adds r1, r2 ldrh r2, [r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldr r1, [r4] ldr r2, =0x00002ba6 adds r1, r2 ldrh r1, [r1] muls r1, r6 adds r1, r5 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F37EA .align 2, 0 .pool @080F379C: movs r0, 0x8 strb r0, [r2] b @080F37EA @080F37A2: ldr r0, =0x02021cc4 ldr r4, =0x03005d8c ldr r1, [r4] ldr r2, =0x00002baa adds r1, r2 ldrh r1, [r1] bl sub_811EBBC ldr r0, =0x02021dc4 ldr r1, [r4] ldr r2, =0x00002ba4 adds r1, r2 ldrh r1, [r1] movs r6, 0xB muls r1, r6 ldr r5, =gSpeciesNames adds r1, r5 bl gf_strcpy ldr r0, =0x02021ec4 ldr r1, [r4] ldr r2, =0x00002ba6 adds r1, r2 ldrh r1, [r1] muls r1, r6 adds r1, r5 bl gf_strcpy ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] ldr r1, =0x0203a030 movs r0, 0 strb r0, [r1] bl sub_80EC4E8 @080F37EA: ldr r0, =gUnknown_0858D66C 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 .pool thumb_func_end sub_80F363C thumb_func_start sub_80F3828 sub_80F3828: ; 80F3828 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r0, =0x020375f0 movs r1, 0 strh r1, [r0] ldrb r0, [r4, 0x2] ldrb r2, [r4, 0x3] cmp r0, r2 bcs @080F3868 ldr r0, =0x0203a030 strb r1, [r0] b @080F3870 .align 2, 0 .pool @080F3868: ldr r1, =0x0203a030 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 .pool @080F3880: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x6] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x4] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldrb r1, [r4, 0x3] movs r0, 0x2 bl sub_80EF340 bl sub_80F577C b @080F38E0 .align 2, 0 .pool @080F38B8: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x6] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r4, 0x4] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldrb r1, [r4, 0x2] movs r0, 0x2 bl sub_80EF340 bl sub_80F577C @080F38E0: ldr r0, =gUnknown_0858D3B0 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 .pool thumb_func_end sub_80F3828 thumb_func_start sub_80F3904 sub_80F3904: ; 80F3904 push {r4-r6,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r6, =0x0203a030 ldrb r5, [r6] cmp r5, 0x1 beq @080F3974 cmp r5, 0x1 bgt @080F3948 cmp r5, 0 beq @080F394E b @080F39BE .align 2, 0 .pool @080F3948: cmp r5, 0x2 beq @080F3994 b @080F39BE @080F394E: ldr r0, =0x02021cc4 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 .pool @080F3974: ldr r0, =0x02021cc4 ldrh r2, [r4, 0x8] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy movs r0, 0x2 strb r0, [r6] b @080F39BE .align 2, 0 .pool @080F3994: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xB] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrb r1, [r4, 0xA] movs r2, 0 bl GetMapName ldr r0, =0x02021ec4 ldrh r2, [r4, 0x4] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy bl sub_80F577C @080F39BE: ldr r0, =gUnknown_0858D3B8 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 .pool thumb_func_end sub_80F3904 thumb_func_start sub_80F39E4 sub_80F39E4: ; 80F39E4 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] adds r2, r0, 0 cmp r5, 0xA bls @080F3A0C b @080F3BE8 @080F3A0C: lsls r0, r5, 2 ldr r1, =@080F3A30 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00000117 cmp r1, r0 bgt @080F3A8C subs r0, 0x2 cmp r1, r0 blt @080F3A8C movs r0, 0xA strb r0, [r2] b @080F3BE8 .align 2, 0 .pool @080F3A8C: movs r0, 0x9 strb r0, [r2] b @080F3BE8 @080F3A92: ldr r0, =0x02021cc4 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, =0x02021ec4 ldrb r1, [r4, 0x7] movs r2, 0 bl GetMapName @080F3AB0: ldrb r0, [r4, 0x4] cmp r0, 0 bne @080F3B12 b @080F3B24 .align 2, 0 .pool @080F3AC0: ldr r0, =0x02021cc4 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 .pool @080F3ADC: ldr r0, =0x02021cc4 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 .pool @080F3AF8: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F3BE8 .align 2, 0 .pool @080F3B24: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F3BE8 .align 2, 0 .pool @080F3B30: ldrb r1, [r4, 0x4] movs r0, 0 bl sub_80EF340 ldr r0, =0x000008a8 bl flag_check lsls r0, 24 cmp r0, 0 beq @080F3BCC ldr r0, [r4, 0x4] ldr r1, =0x00ffff00 ands r0, r1 cmp r0, 0 bne @080F3B6E b @080F3B84 .align 2, 0 .pool @080F3B58: ldr r0, =0x000008a8 bl flag_check lsls r0, 24 cmp r0, 0 beq @080F3BCC ldr r0, [r4, 0x4] ldr r1, =0x00ffff00 ands r0, r1 cmp r0, 0 beq @080F3B84 @080F3B6E: ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F3BE8 .align 2, 0 .pool @080F3B84: ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F3BE8 .align 2, 0 .pool @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, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F3BE8 .align 2, 0 .pool @080F3BC4: ldrh r1, [r4, 0x8] movs r0, 0 bl sub_80EF340 @080F3BCC: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F3BE8 .align 2, 0 .pool @080F3BD8: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xC] bl sub_81DB5E8 bl sub_80F577C @080F3BE8: ldr r0, =gUnknown_0858D3C4 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 .pool thumb_func_end sub_80F39E4 thumb_func_start sub_80F3C04 sub_80F3C04: ; 80F3C04 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] cmp r5, 0x6 bls @080F3C2A b @080F3D54 @080F3C2A: lsls r0, r5, 2 ldr r1, =@080F3C4C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F3C4C: .4byte @080F3C68 .4byte @080F3CA0 .4byte @080F3CA0 .4byte @080F3CD4 .4byte @080F3D0C .4byte @080F3D0C .4byte @080F3D40 @080F3C68: ldr r0, =0x02021cc4 ldrh r1, [r4, 0x4] bl sub_811EBBC ldr r0, =0x02021dc4 ldrh r1, [r4, 0x6] bl sub_811EBBC ldrb r0, [r4, 0x8] cmp r0, 0 bne @080F3C94 ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F3D54 .align 2, 0 .pool @080F3C94: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F3D54 .align 2, 0 .pool @080F3CA0: ldr r0, =0x02021cc4 ldrh r1, [r4, 0x4] bl sub_811EBBC ldr r0, =0x02021dc4 ldrh r1, [r4, 0x6] bl sub_811EBBC ldr r0, =0x02021ec4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x9] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F3D54 .align 2, 0 .pool @080F3CD4: ldr r0, =0x02021cc4 ldrh r1, [r4, 0x4] bl sub_811EBBC ldr r0, =0x02021dc4 ldrh r1, [r4, 0x6] bl sub_811EBBC ldrb r0, [r4, 0x8] cmp r0, 0 bne @080F3D00 ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F3D54 .align 2, 0 .pool @080F3D00: ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F3D54 .align 2, 0 .pool @080F3D0C: ldr r0, =0x02021cc4 ldrh r1, [r4, 0x4] bl sub_811EBBC ldr r0, =0x02021dc4 ldrh r1, [r4, 0x6] bl sub_811EBBC ldr r0, =0x02021ec4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x9] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F3D54 .align 2, 0 .pool @080F3D40: ldr r0, =0x02021cc4 ldrh r1, [r4, 0x4] bl sub_811EBBC ldr r0, =0x02021dc4 ldrh r1, [r4, 0x6] bl sub_811EBBC bl sub_80F577C @080F3D54: ldr r0, =gUnknown_0858D3F0 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 .pool thumb_func_end sub_80F3C04 thumb_func_start sub_80F3D74 sub_80F3D74: ; 80F3D74 push {r4-r7,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r5, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r7, =0x0203a030 ldrb r6, [r7] cmp r6, 0x1 beq @080F3E02 cmp r6, 0x1 bgt @080F3DB8 cmp r6, 0 beq @080F3DBE b @080F3E5C .align 2, 0 .pool @080F3DB8: cmp r6, 0x2 beq @080F3E3C b @080F3E5C @080F3DBE: ldr r4, =0x02021cc4 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, =0x00000117 cmp r1, r0 bgt @080F3DF0 subs r0, 0x2 cmp r1, r0 blt @080F3DF0 movs r0, 0x2 strb r0, [r7] b @080F3E5C .align 2, 0 .pool @080F3DF0: ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F3E5C .align 2, 0 .pool @080F3DFC: movs r0, 0x1 strb r0, [r7] b @080F3E5C @080F3E02: ldr r4, =0x02021cc4 ldrh r0, [r5, 0x2] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy ldr r0, =0x02021dc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x5] bl sub_81DB5E8 ldr r0, =0x02021ec4 ldrb r1, [r5, 0x4] movs r2, 0 bl GetMapName bl sub_80F577C b @080F3E5C .align 2, 0 .pool @080F3E3C: ldr r4, =0x02021cc4 ldrh r0, [r5, 0x2] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy ldr r0, =0x02021dc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x5] bl sub_81DB5E8 bl sub_80F577C @080F3E5C: ldr r0, =gUnknown_0858D40C 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 .pool thumb_func_end sub_80F3D74 thumb_func_start sub_80F3E7C sub_80F3E7C: ; 80F3E7C push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] cmp r5, 0x1 beq @080F3F28 cmp r5, 0x1 bgt @080F3EC0 cmp r5, 0 beq @080F3ECC b @080F4008 .align 2, 0 .pool @080F3EC0: cmp r5, 0x2 beq @080F3F78 cmp r5, 0x3 bne @080F3ECA b @080F3FCC @080F3ECA: b @080F4008 @080F3ECC: ldr r0, =0x02021cc4 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 .pool @080F3EE8: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB0C bl gf_strcpy b @080F3F04 .align 2, 0 .pool @080F3EFC: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB12 bl gf_strcpy @080F3F04: ldrb r1, [r4, 0x2] cmp r1, 0x1 bne @080F3F1C ldr r0, =0x0203a030 strb r1, [r0] b @080F4008 .align 2, 0 .pool @080F3F1C: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F4008 .align 2, 0 .pool @080F3F28: ldr r0, =0x02021cc4 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 .pool @080F3F44: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB0C bl gf_strcpy b @080F3F60 .align 2, 0 .pool @080F3F58: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB12 bl gf_strcpy @080F3F60: ldrh r1, [r4, 0x4] movs r0, 0x2 bl sub_80EF340 bl sub_80F577C b @080F4008 .align 2, 0 .pool @080F3F78: ldr r0, =0x02021cc4 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 .pool @080F3F94: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB0C bl gf_strcpy b @080F3FB0 .align 2, 0 .pool @080F3FA8: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB12 bl gf_strcpy @080F3FB0: ldrh r1, [r4, 0x4] movs r0, 0x2 bl sub_80EF340 ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F4008 .align 2, 0 .pool @080F3FCC: ldr r0, =0x02021cc4 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 .pool @080F3FE8: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB12 bl gf_strcpy b @080F4004 .align 2, 0 .pool @080F3FFC: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB0C bl gf_strcpy @080F4004: bl sub_80F577C @080F4008: ldr r0, =gUnknown_0858D418 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 .pool thumb_func_end sub_80F3E7C thumb_func_start sub_80F4028 sub_80F4028: ; 80F4028 push {r4-r7,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r6, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r7, [r0] adds r2, r0, 0 cmp r7, 0xC bls @080F4050 b @080F4344 @080F4050: lsls r0, r7, 2 ldr r1, =@080F4074 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r6, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F40FC: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r1, [r6, 0x2] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r1, [r6, 0xA] muls r1, r5 adds r1, r4 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F4140: ldrh r1, [r6, 0x8] movs r0, 0 bl sub_80EF340 ldr r4, =0x02021dc4 ldrh r0, [r6, 0x6] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F4168: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName bl sub_80F577C b @080F4344 .align 2, 0 .pool @080F418C: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r6, 0x2] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F41D0: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r1, [r6, 0x2] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021ec4 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 .pool @080F4218: cmp r0, 0x3 beq @080F4248 b @080F4344 @080F421E: ldrh r0, [r6, 0xC] cmp r0, 0 bne @080F4230 ldr r1, =0x0203a030 movs r0, 0xC strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F4230: ldr r1, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F423C: ldr r1, =0x0203a030 movs r0, 0x9 strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F4248: ldr r1, =0x0203a030 movs r0, 0xA strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F4254: ldr r0, =0x02021cc4 ldrh r2, [r6, 0xC] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 ldrh r2, [r6, 0xA] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 b @080F42A8 .align 2, 0 .pool @080F4284: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r1, [r6, 0x2] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r1, [r6, 0xA] muls r1, r5 adds r1, r4 @080F42A8: bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F42C8: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName ldr r1, =0x0203a030 movs r0, 0xB strb r0, [r1] b @080F4344 .align 2, 0 .pool @080F42F4: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r1, [r6, 0x2] movs r4, 0xB muls r1, r4 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrb r1, [r6, 0x4] movs r2, 0 bl GetMapName ldr r0, =0x0203a030 strb r4, [r0] b @080F4344 .align 2, 0 .pool @080F4334: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xE] bl sub_81DB5E8 bl sub_80F577C @080F4344: ldr r0, =gUnknown_0858D428 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 .pool thumb_func_end sub_80F4028 thumb_func_start sub_80F4360 sub_80F4360: ; 80F4360 push {r4-r6,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r5, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r6, [r0] adds r2, r0, 0 cmp r6, 0xD bls @080F4388 b @080F4588 @080F4388: lsls r0, r6, 2 ldr r1, =@080F43AC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 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, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F4408: ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F4414: ldr r0, =0x02021dc4 ldrb r1, [r5, 0x4] lsls r1, 5 ldr r2, =gUnknown_085A5C09 adds r1, r2 bl gf_strcpy ldrb r0, [r5, 0x3] cmp r0, 0x1 bne @080F443C ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F443C: ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F4448: ldr r0, =0x02021dc4 ldrb r1, [r5, 0x5] lsls r1, 5 ldr r2, =gUnknown_085A5C09 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 .pool @080F4470: cmp r1, 0x4 beq @080F4490 b @080F4588 @080F4476: ldr r1, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F4484: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F4490: ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F449C: ldr r0, =0x02021dc4 ldrb r1, [r5, 0x6] lsls r1, 5 ldr r4, =gUnknown_085A5C09 adds r1, r4 bl gf_strcpy ldr r0, =0x02021ec4 ldrb r1, [r5, 0x7] lsls r1, 5 adds r1, r4 b @080F44CA .align 2, 0 .pool @080F44C0: ldr r0, =0x02021dc4 ldrb r1, [r5, 0x6] lsls r1, 5 ldr r2, =gUnknown_085A5C09 adds r1, r2 @080F44CA: bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F44E4: movs r0, 0x8 strb r0, [r2] b @080F4588 @080F44EA: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0xC strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F450C: cmp r1, 0x31 bhi @080F451C ldr r1, =0x0203a030 movs r0, 0xB strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F451C: cmp r1, 0x45 bhi @080F452C ldr r1, =0x0203a030 movs r0, 0xA strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F452C: ldr r1, =0x0203a030 movs r0, 0x9 strb r0, [r1] b @080F4588 .align 2, 0 .pool @080F4538: ldr r0, =0x02021cc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0xC] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r5, 0x8] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r1, [r5, 0xA] movs r4, 0xD muls r1, r4 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r0, =0x0203a030 strb r4, [r0] b @080F4588 .align 2, 0 .pool @080F4584: bl sub_80F577C @080F4588: ldr r0, =gUnknown_0858D45C 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 .pool thumb_func_end sub_80F4360 thumb_func_start sub_80F45A0 sub_80F45A0: ; 80F45A0 push {r4-r6,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r5, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r6, [r0] ldr r0, =0x02021cc4 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, =0x02021dc4 ldr r1, =gUnknown_085ECB72 bl gf_strcpy b @080F4634 .align 2, 0 .pool @080F45FC: cmp r0, 0x1 bne @080F4614 ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB7A bl gf_strcpy b @080F4634 .align 2, 0 .pool @080F4614: cmp r0, 0x2 bne @080F462C ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB80 bl gf_strcpy b @080F4634 .align 2, 0 .pool @080F462C: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECB87 bl gf_strcpy @080F4634: ldr r4, =0x02021ec4 ldrh r0, [r5, 0x2] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy bl sub_80F577C ldr r1, =gUnknown_0858D494 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 .pool thumb_func_end sub_80F45A0 thumb_func_start sub_80F466C sub_80F466C: ; 80F466C push {r4-r7,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r6, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r7, [r0] cmp r7, 0x6 bls @080F4692 b @080F4858 @080F4692: lsls r0, r7, 2 ldr r1, =@080F46B4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F46B4: .4byte @080F46D0 .4byte @080F4714 .4byte @080F4760 .4byte @080F47B4 .4byte @080F47EC .4byte @080F4814 .4byte @080F4838 @080F46D0: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0x11] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r1, [r6, 0x6] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r1, [r6, 0x4] muls r1, r5 adds r1, r4 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F4858 .align 2, 0 .pool @080F4714: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0x11] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r2, [r6, 0x4] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r2, [r6, 0x2] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F4858 .align 2, 0 .pool @080F4760: ldr r0, =0x02021cc4 ldrh r2, [r6, 0x6] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames 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 .pool @080F4788: cmp r1, 0x3 beq @080F47A8 b @080F4824 @080F478E: ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F4858 .align 2, 0 .pool @080F479C: ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F4858 .align 2, 0 .pool @080F47A8: ldr r0, =0x0203a030 strb r1, [r0] b @080F4858 .align 2, 0 .pool @080F47B4: ldr r0, =0x02021cc4 ldrh r1, [r6, 0x8] movs r5, 0xD muls r1, r5 ldr r4, =gMoveNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021dc4 ldrh r1, [r6, 0xA] muls r1, r5 adds r1, r4 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r1, [r6, 0xC] muls r1, r5 adds r1, r4 b @080F4820 .align 2, 0 .pool @080F47EC: ldr r0, =0x02021cc4 ldrh r1, [r6, 0x8] movs r5, 0xD muls r1, r5 ldr r4, =gMoveNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021dc4 ldrh r1, [r6, 0xA] muls r1, r5 adds r1, r4 b @080F4820 .align 2, 0 .pool @080F4814: ldr r0, =0x02021dc4 ldrh r2, [r6, 0x8] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 @080F4820: bl gf_strcpy @080F4824: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F4858 .align 2, 0 .pool @080F4838: ldr r0, =0x02021cc4 ldrh r1, [r6, 0xE] movs r5, 0xD muls r1, r5 ldr r4, =gMoveNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021dc4 ldrh r1, [r6, 0x2] muls r1, r5 adds r1, r4 bl gf_strcpy bl sub_80F577C @080F4858: ldr r0, =gUnknown_0858D498 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 .pool thumb_func_end sub_80F466C thumb_func_start sub_80F487C sub_80F487C: ; 80F487C push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] cmp r5, 0x5 bls @080F48A2 b @080F499A @080F48A2: lsls r0, r5, 2 ldr r1, =@080F48C4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F48C4: .4byte @080F48DC .4byte @080F4944 .4byte @080F4944 .4byte @080F4944 .4byte @080F4944 .4byte @080F4978 @080F48DC: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x18] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r4, 0x2 ldrb r2, [r4, 0x17] bl sub_81DB5E8 ldr r0, =0x02021ec4 ldrh r1, [r4, 0x14] bl sub_811EBBC ldrb r1, [r4, 0x16] cmp r1, 0x59 bls @080F4918 ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F499A .align 2, 0 .pool @080F4918: cmp r1, 0x45 bls @080F4928 ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F499A .align 2, 0 .pool @080F4928: cmp r1, 0x1D bls @080F4938 ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F499A .align 2, 0 .pool @080F4938: ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F499A .align 2, 0 .pool @080F4944: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x18] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r4, 0x2 ldrb r2, [r4, 0x17] bl sub_81DB5E8 ldrb r1, [r4, 0x16] movs r0, 0x2 bl sub_80EF340 ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F499A .align 2, 0 .pool @080F4978: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0xC ldrb r2, [r4, 0x18] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r4, 0x2 ldrb r2, [r4, 0x17] bl sub_81DB5E8 ldr r0, =0x02021ec4 ldrh r1, [r4, 0x14] bl sub_811EBBC bl sub_80F577C @080F499A: ldr r0, =gUnknown_0858D320 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 .pool thumb_func_end sub_80F487C thumb_func_start sub_80F49BC sub_80F49BC: ; 80F49BC push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] adds r2, r0, 0 cmp r5, 0xB bls @080F49E4 b @080F4B3A @080F49E4: lsls r0, r5, 2 ldr r1, =@080F4A08 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 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, =@080F4A74 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4AA8: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4AB4: ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4AC0: ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4ACC: ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4AD8: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4AE4: ldr r1, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4AF0: ldr r1, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4AFC: ldr r1, =0x0203a030 movs r0, 0x9 strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4B08: ldr r1, =0x0203a030 movs r0, 0xA strb r0, [r1] b @080F4B3A .align 2, 0 .pool @080F4B14: movs r0, 0xB strb r0, [r2] b @080F4B3A @080F4B1A: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x8] bl sub_81DB5E8 ldr r0, =0x02021dc4 ldrh r1, [r4, 0x4] bl sub_811EBBC ldr r0, =0x02021ec4 ldrh r1, [r4, 0x6] bl sub_811EBBC bl sub_80F577C @080F4B3A: ldr r0, =gUnknown_0858D4B4 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 .pool thumb_func_end sub_80F49BC thumb_func_start sub_80F4B5C sub_80F4B5C: ; 80F4B5C push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] cmp r5, 0xF bls @080F4B82 b @080F4D84 @080F4B82: lsls r0, r5, 2 ldr r1, =@080F4BA4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xF] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x10] bl sub_81DB5E8 ldrb r1, [r4, 0x2] cmp r1, 0x9 bhi @080F4C14 ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4C14: cmp r1, 0x13 bhi @080F4C24 ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4C24: ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4C30: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0xF] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x10] bl sub_81DB5E8 ldrb r1, [r4, 0x2] movs r0, 0x2 bl sub_80EF340 ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4C64: ldr r0, =0x02021dc4 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, =@080F4C88 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4CF8: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D04: ldr r1, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D10: ldr r1, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D1C: ldr r1, =0x0203a030 movs r0, 0x9 strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D28: ldr r1, =0x0203a030 movs r0, 0xA strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D34: ldr r1, =0x0203a030 movs r0, 0xB strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D40: ldr r1, =0x0203a030 movs r0, 0xC strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D4C: ldr r1, =0x0203a030 movs r0, 0xD strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D58: ldr r1, =0x0203a030 movs r0, 0xE strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D64: ldr r0, =0x02021dc4 adds r1, r4, 0x4 ldrb r2, [r4, 0x10] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0xF strb r0, [r1] b @080F4D84 .align 2, 0 .pool @080F4D80: bl sub_80F577C @080F4D84: ldr r0, =gUnknown_0858D4E4 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 .pool thumb_func_end sub_80F4B5C thumb_func_start sub_80F4D9C sub_80F4D9C: ; 80F4D9C push {r4-r7,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r6, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r7, [r0] adds r2, r0, 0 cmp r7, 0x12 bls @080F4DC4 b @080F5014 @080F4DC4: lsls r0, r7, 2 ldr r1, =@080F4DE8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =@080F4E4C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 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, =0x0203a030 movs r0, 0x10 strb r0, [r1] b @080F5014 .align 2, 0 .pool @080F4EF4: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0xF strb r0, [r1] b @080F5014 .align 2, 0 .pool @080F4F18: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0xE strb r0, [r1] b @080F5014 .align 2, 0 .pool @080F4F3C: ldr r0, =0x02021cc4 ldrh r1, [r6, 0x4] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021dc4 ldrh r1, [r6, 0x6] muls r1, r5 adds r1, r4 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r1, [r6, 0x8] muls r1, r5 adds r1, r4 b @080F4FEC .align 2, 0 .pool @080F4F74: ldr r0, =0x02021cc4 ldrh r1, [r6, 0x4] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021dc4 ldrh r1, [r6, 0x6] muls r1, r5 adds r1, r4 b @080F4FEC .align 2, 0 .pool @080F4F9C: ldr r0, =0x02021cc4 ldrh r1, [r6, 0x4] movs r5, 0xB muls r1, r5 ldr r4, =gSpeciesNames adds r1, r4 bl gf_strcpy ldr r0, =0x02021dc4 ldrh r1, [r6, 0x6] muls r1, r5 adds r1, r4 bl gf_strcpy ldr r0, =0x02021ec4 ldrh r1, [r6, 0x8] muls r1, r5 adds r1, r4 bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x11 strb r0, [r1] b @080F5014 .align 2, 0 .pool @080F4FE0: ldr r0, =0x02021cc4 ldrh r2, [r6, 0xA] movs r1, 0xB muls r1, r2 ldr r2, =gSpeciesNames adds r1, r2 @080F4FEC: bl gf_strcpy ldr r1, =0x0203a030 movs r0, 0x12 strb r0, [r1] b @080F5014 .align 2, 0 .pool @080F5004: ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x13 ldrb r2, [r6, 0xC] bl sub_81DB5E8 bl sub_80F577C @080F5014: ldr r0, =gUnknown_0858D524 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 .pool thumb_func_end sub_80F4D9C thumb_func_start sub_80F5030 sub_80F5030: ; 80F5030 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] cmp r5, 0x8 bls @080F5056 b @080F5164 @080F5056: lsls r0, r5, 2 ldr r1, =@080F5078 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 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, =@080F50C0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F50C0: .4byte @080F50DC .4byte @080F50E8 .4byte @080F50F4 .4byte @080F5100 .4byte @080F510C .4byte @080F5118 .4byte @080F5124 @080F50DC: ldr r1, =0x0203a030 movs r0, 0x1 strb r0, [r1] b @080F5164 .align 2, 0 .pool @080F50E8: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F5164 .align 2, 0 .pool @080F50F4: ldr r1, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F5164 .align 2, 0 .pool @080F5100: ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F5164 .align 2, 0 .pool @080F510C: ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F5164 .align 2, 0 .pool @080F5118: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F5164 .align 2, 0 .pool @080F5124: ldr r1, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F5164 .align 2, 0 .pool @080F5130: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F5164 .align 2, 0 .pool @080F5154: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x5] bl sub_81DB5E8 bl sub_80F577C @080F5164: ldr r0, =gUnknown_0858D570 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 .pool 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, =gUnknown_0858D690 @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 .pool @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, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r5, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 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, =@080F5240 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 adds r1, r5, 0x4 ldrb r2, [r5, 0x1C] bl sub_81DB5E8 ldr r0, =0x02021dc4 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, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F552A .align 2, 0 .pool @080F5328: movs r0, 0x1 strb r0, [r5, 0x12] bl GenerateRandomNumber ldr r4, =0x0203a031 lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 bl __modsi3 strb r0, [r4] ldrb r1, [r4] b @080F542A .align 2, 0 .pool @080F5348: ldr r0, =0x02021dc4 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 .pool @080F5370: strb r6, [r5, 0x12] ldr r0, =0x0203a031 ldrb r0, [r0] cmp r0, 0 bne @080F5384 adds r0, r5, 0 movs r1, 0x1 b @080F542C .align 2, 0 .pool @080F5384: adds r0, r5, 0 movs r1, 0 b @080F542C @080F538A: bl GenerateRandomNumber ldr r7, =0x0203a031 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, =0x0000fffe cmp r4, r0 bls @080F538A @080F53B2: movs r0, 0x2 strb r0, [r5, 0x12] ldrb r1, [r7, 0x1] b @080F542A .align 2, 0 .pool @080F53C4: ldr r0, =0x02021dc4 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, =0x0203a030 movs r0, 0x9 strb r0, [r1] b @080F552A .align 2, 0 .pool @080F53F0: movs r4, 0 ldr r7, =0x0203a031 ldr r2, =0x0000fffe 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, =0x0203a031 ldrb r1, [r0, 0x2] @080F542A: adds r0, r5, 0 @080F542C: bl sub_80F51AC ldr r1, =0x0203a030 strb r0, [r1] b @080F552A .align 2, 0 .pool @080F5444: ldr r0, =0x02021cc4 adds r1, r5, 0x4 ldrb r2, [r5, 0x1C] bl sub_81DB5E8 ldr r0, =0x02021dc4 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, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F552A .align 2, 0 .pool @080F547C: cmp r0, 0x64 bhi @080F548C ldr r1, =0x0203a030 movs r0, 0x5 strb r0, [r1] b @080F552A .align 2, 0 .pool @080F548C: ldr r1, =0x0203a030 movs r0, 0x6 strb r0, [r1] b @080F552A .align 2, 0 .pool @080F5498: ldr r0, =0x02021cc4 adds r1, r5, 0x4 ldrb r2, [r5, 0x1C] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x1B] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F552A .align 2, 0 .pool @080F54C4: ldr r0, =0x02021cc4 adds r1, r5, 0x4 ldrb r2, [r5, 0x1C] bl sub_81DB5E8 ldr r0, =0x02021dc4 adds r1, r5, 0 adds r1, 0x13 ldrb r2, [r5, 0x1B] bl sub_81DB5E8 bl sub_80F577C b @080F552A .align 2, 0 .pool @080F54E8: movs r0, 0x3 b @080F5528 @080F54EC: movs r0, 0x3 b @080F5528 @080F54F0: ldr r4, =0x02021dc4 ldrh r0, [r5, 0x10] bl itemid_get_item adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy ldr r1, =0x0203a030 ldrb r0, [r5, 0x12] strb r0, [r1] b @080F552A .align 2, 0 .pool @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, =gUnknown_0858D594 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 .pool thumb_func_end sub_80F51EC thumb_func_start sub_80F5548 sub_80F5548: ; 80F5548 push {r4,r5,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x0203a030 ldrb r5, [r0] adds r2, r0, 0 cmp r5, 0xA bls @080F5570 b @080F56BC @080F5570: lsls r0, r5, 2 ldr r1, =@080F5594 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 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, =0x0203a030 movs r0, 0x3 strb r0, [r1] b @080F56BC .align 2, 0 .pool @080F5608: ldr r1, =0x0203a030 movs r0, 0x2 strb r0, [r1] b @080F56BC .align 2, 0 .pool @080F5614: ldrb r1, [r4, 0x3] movs r0, 0x1 bl sub_80EF340 ldr r1, =0x0203a030 movs r0, 0x4 strb r0, [r1] b @080F56BC .align 2, 0 .pool @080F5628: movs r0, 0x4 strb r0, [r2] b @080F56BC @080F562E: ldr r0, =0x02021cc4 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 .pool @080F5650: ldr r0, =0x02021cc4 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, =0x0203a030 movs r0, 0x8 strb r0, [r1] b @080F56BC .align 2, 0 .pool @080F5674: ldr r1, =0x0203a030 movs r0, 0x7 strb r0, [r1] b @080F56BC .align 2, 0 .pool @080F5680: ldrb r1, [r4, 0x3] movs r0, 0x1 bl sub_80EF340 ldr r1, =0x0203a030 movs r0, 0x9 strb r0, [r1] b @080F56BC .align 2, 0 .pool @080F5694: movs r0, 0x9 strb r0, [r2] b @080F56BC @080F569A: ldr r0, =0x02021cc4 adds r1, r4, 0 adds r1, 0x13 ldrb r2, [r4, 0x4] bl sub_81DB5E8 ldr r1, =0x0203a030 movs r0, 0xA strb r0, [r1] b @080F56BC .align 2, 0 .pool @080F56B8: bl sub_80F577C @080F56BC: ldr r0, =gUnknown_0858D640 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 .pool thumb_func_end sub_80F5548 thumb_func_start sub_80F56D4 sub_80F56D4: ; 80F56D4 push {r4-r6,lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x000027cc adds r0, r1 ldr r1, [r2] adds r4, r1, r0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r6, =0x0203a030 ldrb r5, [r6] cmp r5, 0x2 bgt @080F5718 cmp r5, 0x1 bge @080F5744 cmp r5, 0 beq @080F571E b @080F575E .align 2, 0 .pool @080F5718: cmp r5, 0x3 beq @080F574E b @080F575E @080F571E: ldr r0, =0x02021cc4 ldrb r1, [r4, 0xA] bl sub_818E868 ldrb r1, [r4, 0x16] cmp r1, 0x1 bne @080F5734 strb r1, [r6] b @080F575E .align 2, 0 .pool @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, =0x02021ec4 adds r1, r4, 0x2 ldrb r2, [r4, 0x17] bl sub_81DB5E8 @080F574E: ldr r0, =0x02021dc4 adds r1, r4, 0 adds r1, 0xB ldrb r2, [r4, 0x18] bl sub_81DB5E8 bl sub_80F577C @080F575E: ldr r0, =gUnknown_0858D384 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 .pool thumb_func_end sub_80F56D4 thumb_func_start sub_80F577C sub_80F577C: ; 80F577C ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] ldr r1, =0x0203a030 movs r0, 0 strb r0, [r1] ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, =0x020375e0 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r2, r0 ldr r0, =0x000027cd adds r2, r0 movs r0, 0 strb r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_80F577C thumb_func_start sub_80F57B8 sub_80F57B8: ; 80F57B8 ldr r1, =0x0203a030 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_0858D888 movs r0, 0 movs r2, 0x4 bl bg_vram_setup movs r4, 0 @080F57E0: lsls r0, r4, 24 lsrs r0, 24 ldr r1, =0x0203a034 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, =gUnknown_0858D898 bl Window_InitFromTemplates bl TextBox_ResetSomeField movs r0, 0x4C movs r1, 0 bl lcd_io_set ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00003f2e 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, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r0, =0x02022e18 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] ldr r0, =0x02022e1c strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] ldr r0, =0x02022e20 strh r1, [r0] ldr r0, =0x02022e22 strh r1, [r0] ldr r0, =0x02022e24 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r0, =0x02022e28 strh r1, [r0] ldr r0, =0x02022e2a strh r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08C19588 movs r1, 0xC0 lsls r1, 19 bl call_LZZUnCompVram ldr r1, =gUnknown_08C1A12C movs r0, 0x3 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r1, =gUnknown_08C1A000 movs r0, 0x2 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r1, =gUnknown_08C19EEC movs r0, 0 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map bl sub_80F71C8 ldr r0, =gUnknown_08C1A2B4 movs r2, 0x80 lsls r2, 2 movs r1, 0 bl decompress_palette ldr r0, =gUnknown_0858D6B0 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, =0x000060b2 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, =0x000060a4 cmp r0, 0 bge @080F59F6 adds r5, 0x2 b @080F59F6 .align 2, 0 .pool @080F59F4: ldr r5, =0x000060a2 @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 .pool 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, =0x02039e00 adds r7, r1, r0 ldr r6, =0x02022e2c ldr r0, =0x02039f25 ldrb r0, [r0] cmp r5, r0 bne @080F5A96 ldr r1, =gUnknown_085ED21E 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, =0x02022e2c adds r0, r5, 0 adds r1, r4, 0 movs r2, 0 bl sub_80F7ED0 ldr r1, =gUnknown_085E8D3E 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 .pool 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, =0x02037fd4 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, =0x0203a034 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, =sub_80F5CE4 movs r1, 0x5 bl AddTask ldr r1, [r4] ldr r1, [r1] strb r0, [r1, 0x2] ldr r0, =sub_80F5C00 bl set_callback2 ldr r1, =0x02022e28 movs r0, 0xF0 strh r0, [r1] ldr r1, =0x02022e2a ldr r2, =0x000080a0 adds r0, r2, 0 strh r0, [r1] ldr r0, =sub_80F68B4 movs r1, 0x14 bl AddTask bl sub_80F7880 ldr r0, =0x02039f2a 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 .pool @080F5BE4: movs r0, 0xDF lsls r0, 1 bl song_play_for_text @080F5BEC: ldr r0, =sub_80F5C24 bl SetVBlankCallback add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 bl lcd_io_set ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 bl lcd_io_set ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 bl lcd_io_set ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 bl lcd_io_set ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 bl lcd_io_set ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A bl lcd_io_set ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C bl lcd_io_set ldr r0, =0x02022e22 ldrh r1, [r0] movs r0, 0x1E bl lcd_io_set ldr r0, =0x02022e24 ldrh r1, [r0] movs r0, 0x40 bl lcd_io_set ldr r0, =0x02022e26 ldrh r1, [r0] movs r0, 0x44 bl lcd_io_set ldr r0, =0x02022e28 ldrh r1, [r0] movs r0, 0x42 bl lcd_io_set ldr r0, =0x02022e2a 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 .pool 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, =0x02039f2a ldrb r1, [r3] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080F5CF8 b @080F5E2E @080F5CF8: ldr r2, =0x03005e00 lsls r1, r6, 2 adds r0, r1, r6 lsls r0, 3 adds r4, r0, r2 movs r2, 0x8 ldrsh r0, [r4, r2] adds r7, r1, 0 cmp r0, 0x1 beq @080F5DE0 cmp r0, 0x1 bgt @080F5D20 cmp r0, 0 beq @080F5D2A b @080F5E2E .align 2, 0 .pool @080F5D20: cmp r0, 0x2 beq @080F5DF4 cmp r0, 0x3 beq @080F5E0A b @080F5E2E @080F5D2A: bl sub_80DBED4 ldr r1, =0x02039f20 ldr r0, =0x02039f25 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080F5D58 movs r0, 0x23 bl sav12_xor_increment ldr r1, =0x020375e2 movs r0, 0x8 strh r0, [r1] bl sub_80EF5B8 ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0x1 beq @080F5D58 bl sub_80EC6BC @080F5D58: movs r0, 0x2 bl sub_813BADC ldr r0, =0x02039f2e ldrb r0, [r0] bl sub_80DEDA8 movs r0, 0xFE bl sub_80DEDA8 ldr r1, =0x02039f5c movs r0, 0x1 strb r0, [r1] movs r0, 0xFE movs r1, 0 bl sub_80DEFA8 ldr r1, =0x02039f5d strb r0, [r1] ldr r5, =0x00004086 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, =0x03005e00 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 .pool @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, =0x02037fd4 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 bne @080F5EBA ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r4, r0, r1 strh r2, [r4, 0x8] ldr r0, =0x02039f2a ldrb r1, [r0] movs r5, 0x1 adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @080F5E78 ldr r0, =gUnknown_085ED207 bl sub_80F707C ldr r0, =sub_80F5ED8 b @080F5EB8 .align 2, 0 .pool @080F5E78: movs r0, 0x24 bl sav12_xor_increment ldr r1, =0x02039f20 ldr r0, =0x02039f25 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @080F5E92 movs r0, 0x25 bl sav12_xor_increment @080F5E92: ldr r0, =0x02039f2e ldrb r0, [r0] bl sub_80DEDA8 movs r0, 0xFE bl sub_80DEDA8 ldr r0, =0x02039f5c strb r5, [r0] movs r0, 0xFE movs r1, 0 bl sub_80DEFA8 ldr r1, =0x02039f5d strb r0, [r1] movs r0, 0x2 bl sub_813BADC ldr r0, =sub_80F5F74 @080F5EB8: str r0, [r4] @080F5EBA: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080F5EFC ldr r0, =sub_80F5F14 movs r1, 0 bl AddTask ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =nullsub_4 str r1, [r0] @080F5EFC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F5ED8 thumb_func_start sub_80F5F14 sub_80F5F14: ; 80F5F14 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =sub_80FC998 ldr r2, =sub_80F5F30 bl set_task_function_and_args_14_15 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 ldr r0, =0x0203a034 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, =sub_80F5F74 str r1, [r0] bl sub_80F7144 @080F5F60: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F5F30 thumb_func_start sub_80F5F74 sub_80F5F74: ; 80F5F74 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 ldrh r1, [r4, 0x8] movs r2, 0x8 ldrsh r0, [r4, r2] cmp r0, 0 bne @080F5FC4 ldr r0, =sub_80F68F0 movs r1, 0x14 bl AddTask ldr r0, =gUnknown_085ED1B8 ldr r1, =0x0203a034 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 .pool @080F5FC4: cmp r0, 0x1 bne @080F5FDC ldr r0, =0x0203a034 ldr r0, [r0] ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r0, 0 bne @080F6048 b @080F5FF0 .align 2, 0 .pool @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, =gUnknown_085ED1D0 ldr r1, =0x0203a034 ldr r1, [r1] ldr r1, [r1] ldrb r1, [r1] bl sub_80F6B78 lsls r0, 16 asrs r0, 16 ldr r2, =0x0000ffff 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 .pool @080F6030: cmp r0, 0x4 bne @080F6048 ldr r0, =0x0203a034 ldr r0, [r0] ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r0, 0x2 bne @080F6048 movs r0, 0 strh r0, [r4, 0x8] ldr r0, =sub_80F6058 str r0, [r4] @080F6048: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @080F6080: cmp r0, 0x2 beq @080F60D4 b @080F60E6 @080F6086: ldr r5, =0x0203a034 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 .pool @080F60B8: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @080F60E6 @080F60C0: ldr r0, =0x0203a034 ldr r0, [r0] ldr r0, [r0] ldrb r0, [r0, 0x14] cmp r0, 0 bne @080F60E6 strh r0, [r4, 0x8] b @080F60E6 .align 2, 0 .pool @080F60D4: movs r0, 0x88 lsls r0, 3 bl sub_80F6EF4 movs r0, 0 strh r0, [r4, 0x8] strh r0, [r4, 0xC] ldr r0, =sub_80F60F0 str r0, [r4] @080F60E6: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a034 ldr r5, [r0] ldr r0, [r5] ldrb r3, [r0, 0x4] cmp r3, 0 bne @080F614C ldr r1, =0x03005e00 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, =gUnknown_085ED1E9 ldr r1, [r5] ldrb r1, [r1] bl sub_80F6B78 lsls r0, 16 asrs r0, 16 ldr r2, =0x0000ffff movs r3, 0x88 lsls r3, 3 movs r1, 0x90 bl sub_80F6E9C b @080F615E .align 2, 0 .pool @080F614C: cmp r3, 0x2 bne @080F615E ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80F616C str r0, [r1] @080F615E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @080F6194: cmp r0, 0x2 beq @080F61E8 b @080F61F8 @080F619A: ldr r5, =0x0203a034 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 .pool @080F61CC: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @080F61F8 @080F61D4: ldr r0, =0x0203a034 ldr r0, [r0] ldr r0, [r0] ldrb r0, [r0, 0x14] cmp r0, 0 bne @080F61F8 strh r0, [r4, 0x8] b @080F61F8 .align 2, 0 .pool @080F61E8: movs r0, 0x88 lsls r0, 3 bl sub_80F6EF4 movs r0, 0 strh r0, [r4, 0x8] ldr r0, =sub_80F6204 str r0, [r4] @080F61F8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r2, 0x8 ldrsh r0, [r0, r2] adds r2, r1, 0 cmp r0, 0x5 bls @080F6226 b @080F63F4 @080F6226: lsls r0, 2 ldr r1, =@080F6238 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F6238: .4byte @080F6250 .4byte @080F6274 .4byte @080F6292 .4byte @080F62CC .4byte @080F6334 .4byte @080F63E4 @080F6250: ldr r0, =0x0203a034 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 .pool @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, =0x03005e00 @080F6298: ldr r0, =sub_80F73DC 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, =0x02039f20 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 .pool @080F62CC: ldr r0, =0x0203a034 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, =sub_80F74BC movs r1, 0xA bl AddTask ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] movs r4, 0 ldr r1, =0x02039f20 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 .pool @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, =0x02039f20 ldrb r0, [r1] ldr r7, =0x02021cc4 ldr r2, =0x02039e0d 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, =0x02021dc4 mov r1, r8 subs r1, 0xB adds r4, r1 adds r1, r4, 0 bl gf_strcpy ldr r1, =gUnknown_085ED1FA mov r0, sp bl ExpandTextCodes ldr r0, =0x0203a034 ldr r0, [r0] ldr r0, [r0] ldrb r1, [r0] mov r0, sp bl sub_80F6B78 lsls r0, 16 asrs r0, 16 ldr r2, =0x0000ffff movs r3, 0x88 lsls r3, 3 movs r1, 0x90 bl sub_80F6E9C @080F63B4: ldr r0, =0x03005e00 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 .pool @080F63E4: lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r2 movs r1, 0 strh r1, [r0, 0x8] ldr r1, =sub_80F6404 str r1, [r0] @080F63F4: add sp, 0x64 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@080F643C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F643C: .4byte @080F6454 .4byte @080F658C .4byte @080F65DC .4byte @080F65F0 .4byte @080F6638 .4byte @080F667C @080F6454: ldr r1, =0x02022e24 movs r0, 0xF0 strh r0, [r1] ldr r1, =0x02022e26 ldr r3, =0x00005050 adds r0, r3, 0 strh r0, [r1] movs r2, 0 ldr r1, =0x02039f20 ldrb r0, [r1] lsls r4, r7, 2 mov r10, r4 ldr r3, =0x02039e00 ldr r4, =0x02039f25 mov r9, r4 ldr r4, =gMonFrontPicTable mov r12, r4 ldr r4, =0x020244d4 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 .pool @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, =0x0202499c 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, =0x02020630 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, =sub_80F75A8 str r1, [r2] ldr r1, =0x0203a034 ldr r1, [r1] ldr r1, [r1] strb r0, [r1, 0x8] ldr r0, =gUnknown_0858D878 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0858D880 bl gpu_pal_obj_decompress_and_apply ldr r0, =sub_80F7670 movs r1, 0xA bl AddTask ldr r0, =0x03005e00 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 .pool @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, =0x02022e26 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 .pool @080F65DC: ldr r0, =0x0203a034 ldr r0, [r0] ldr r0, [r0] ldrb r0, [r0, 0x6] cmp r0, 0x1 bne @080F669C b @080F6664 .align 2, 0 .pool @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, =0x02020630 ldr r0, =0x0203a034 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, =sub_80F7620 str r1, [r0] ldrh r0, [r3, 0x8] adds r0, 0x1 strh r0, [r3, 0x8] b @080F669C .align 2, 0 .pool @080F6638: ldr r0, =0x0203a034 ldr r0, [r0] ldr r0, [r0] ldrb r0, [r0, 0x6] cmp r0, 0x2 bne @080F669C ldr r3, =0x02022e26 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 .pool @080F667C: ldr r0, =0x0203a034 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, =sub_80F66B4 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 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r2, 0x1 adds r0, r2, 0 ands r0, r1 cmp r0, 0 beq @080F6702 ldr r0, =0x02039f2a ldrb r1, [r0] adds r0, r2, 0 ands r0, r1 lsls r6, r7, 2 cmp r0, 0 bne @080F66F2 ldr r5, =0x02039e00 movs r4, 0x3 @080F66DA: ldrh r0, [r5] bl SpeciesToNationalPokedexNum 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, =0x03005e00 adds r0, r6, r7 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x1C] ldr r1, =sub_80F671C str r1, [r0] @080F6702: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080F6760 ldr r0, =0x03005e00 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, =gUnknown_085ED207 bl sub_80F707C bl sub_800AC34 ldr r0, =sub_80F677C str r0, [r4] b @080F676E .align 2, 0 .pool @080F6760: ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =task_repel str r0, [r1] @080F676E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @080F67AC ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080F679A bl sub_800E084 @080F679A: bl sub_80F7144 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =task_repel str r0, [r1] @080F67AC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @080F67E6 ldr r1, =0x02039f20 ldr r0, =0x02039f25 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80F6820 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080F68A8 ldr r1, =0x03005e00 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, =0x0203a034 ldr r0, [r0] ldr r0, [r0] ldrb r0, [r0, 0x3] bl remove_task ldr r0, =0x0000ffff b @080F686E .align 2, 0 .pool @080F6868: cmp r0, 0x1 bne @080F6884 ldr r0, =0xffff0000 @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 .pool @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, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 bl sub_80F7E64 @080F68A8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F6820 thumb_func_start sub_80F68B4 sub_80F68B4: ; 80F68B4 push {r4,r5,lr} ldr r2, =0x02022e20 ldrh r3, [r2] adds r0, r3, 0x2 strh r0, [r2] ldr r4, =0x02022e22 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 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r0 ldrb r2, [r4, 0xA] ldr r3, =0x00002ede movs r0, 0x6B movs r1, 0x1 bl pal_fade_1 ldrb r2, [r4, 0xA] ldr r3, =0x00007fff movs r0, 0x68 movs r1, 0x1 bl pal_fade_1 ldrb r2, [r4, 0xA] ldr r3, =0x000077be movs r0, 0x6E movs r1, 0x1 bl pal_fade_1 @080F6972: ldr r1, =0x03005e00 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, =0x0203a034 ldr r0, [r0] ldr r0, [r0] strb r4, [r0, 0xA] b @080F69AE .align 2, 0 .pool @080F69A4: ldr r0, =0x0203a034 ldr r0, [r0] ldr r1, [r0] movs r0, 0x1 strb r0, [r1, 0xA] @080F69AE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f25 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, =0x06004000 adds r1, r0 movs r2, 0xC0 lsls r2, 1 adds r0, r3, 0 movs r3, 0x1 bl RequestDma3Copy 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 .pool @080F6A40: mov r0, r8 lsls r1, r0, 9 ldr r2, =0x06004000 adds r1, r2 movs r2, 0xC0 lsls r2, 1 adds r0, r3, 0 movs r3, 0x1 bl RequestDma3Copy @080F6A54: add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039e00 @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 .pool thumb_func_end sub_80F6A64 thumb_func_start sub_80F6A9C sub_80F6A9C: ; 80F6A9C push {r4-r6,lr} movs r4, 0 ldr r6, =gMonIconPaletteIndices movs r5, 0xA0 lsls r5, 16 @080F6AA6: ldr r1, =0x02039e00 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, =gMonIconPalettes 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 .pool thumb_func_end sub_80F6A9C thumb_func_start sub_80F6AE8 sub_80F6AE8: ; 80F6AE8 push {r4,lr} ldr r0, =0x02039f2a 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, =0x02020630 ldr r0, =0x02022b10 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, =gUnknown_0858D8E0 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, =0x06010000 adds r1, r2 movs r2, 0x80 movs r3, 0x1 bl RequestDma3Fill ldr r0, =gUnknown_0858D8C8 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 .pool 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, =gUnknown_0858D8E8 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, =gUnknown_0858D6D0 mov r8, r2 lsls r1, r7, 4 adds r1, r7 lsls r1, 2 ldr r3, =0x02020630 adds r1, r3 ldrh r0, [r1, 0x4] lsls r0, 22 lsrs r0, 17 ldr r2, =0x06010000 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, =0x05000100 bl CpuSet subs r4, 0x1 cmp r4, 0 bge @080F6C7C ldr r5, [sp, 0xC] ldr r6, =0x04000008 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, =0x04000008 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 .pool 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, =gUnknown_0858D7F8 ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2-r4} stm r1!, {r2-r4} add r5, sp, 0x18 ldr r6, =gUnknown_0858D810 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, =gUnknown_0858D850 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, =0x02020630 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, =0x0203a034 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 .pool thumb_func_end sub_80F6DC0 thumb_func_start sub_80F6E9C sub_80F6E9C: ; 80F6E9C push {r4-r6,lr} mov r6, r8 push {r6} ldr r4, =0x0203a034 ldr r4, [r4] mov r8, r4 ldr r4, [r4] ldrb r5, [r4] lsls r4, r5, 4 adds r4, r5 lsls r4, 2 ldr r5, =0x02020630 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, =sub_80F6F68 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 .pool thumb_func_end sub_80F6E9C thumb_func_start sub_80F6EF4 sub_80F6EF4: ; 80F6EF4 push {r4,r5,lr} ldr r1, =0x0203a034 ldr r4, [r1] ldr r1, [r4] ldrb r2, [r1] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 ldr r2, =0x02020630 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, =sub_80F7014 str r0, [r1, 0x1C] ldr r1, [r4] movs r0, 0x3 strb r0, [r1, 0x4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =nullsub_12 str r1, [r0, 0x1C] ldr r0, =0x0203a034 ldr r0, [r0] ldr r0, [r0] strb r3, [r0, 0x4] bx lr .align 2, 0 .pool 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, =0x02020630 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, =sub_80F6FDC str r0, [r3, 0x1C] @080F6FCC: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F6F68 thumb_func_start sub_80F6FDC sub_80F6FDC: ; 80F6FDC push {lr} adds r2, r0, 0 ldr r0, =0x0203a034 ldr r0, [r0] ldr r1, [r0] movs r0, 0x2 strb r0, [r1, 0x4] ldrh r3, [r2, 0x38] ldr r1, =0xffff0000 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 .pool 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, =0x02020630 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 .pool thumb_func_end sub_80F7014 thumb_func_start sub_80F707C sub_80F707C: ; 80F707C push {r4-r7,lr} ldr r4, =0x0203a034 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, =0x02020630 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, =0x02022e24 movs r0, 0xF0 strh r0, [r1] ldr r2, =0x02022e26 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, =0x00003f3e movs r0, 0x48 bl lcd_io_set pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F707C thumb_func_start sub_80F7144 sub_80F7144: ; 80F7144 push {r4-r7,lr} ldr r0, =0x0203a034 ldr r0, [r0] ldr r0, [r0] ldrb r0, [r0, 0x1] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 ldr r3, =0x02020630 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, =0x02022e24 ldr r6, =0x02022e26 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, =0x00003f3f movs r0, 0x48 bl lcd_io_set pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f2a ldrb r1, [r0] adds r0, r4, 0 ands r0, r1 cmp r0, 0 beq @080F71F8 ldr r1, =gUnknown_08DC6498 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 .pool @080F71F8: ldr r0, =0x02039f2e ldrh r2, [r0] cmp r2, 0 bne @080F720C ldr r1, =gUnknown_08DC63F8 b @080F722E .align 2, 0 .pool @080F720C: cmp r2, 0x1 bne @080F7218 ldr r1, =gUnknown_08DC6420 b @080F722E .align 2, 0 .pool @080F7218: cmp r2, 0x2 bne @080F722C ldr r1, =gUnknown_08DC6448 movs r0, 0xA str r0, [sp] str r2, [sp, 0x4] movs r0, 0x2 b @080F7236 .align 2, 0 .pool @080F722C: ldr r1, =gUnknown_08DC6470 @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, =0x02039f2c ldrh r0, [r0] cmp r0, 0 bne @080F725C movs r6, 0 ldr r1, =gUnknown_08DC64AC b @080F7298 .align 2, 0 .pool @080F725C: cmp r0, 0x1 bne @080F726C movs r6, 0x1 ldr r1, =gUnknown_08DC64C0 b @080F7298 .align 2, 0 .pool @080F726C: cmp r0, 0x2 bne @080F7290 movs r6, 0x2 ldr r1, =gUnknown_08DC64D4 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 .pool @080F7290: cmp r0, 0x3 bne @080F72B4 movs r6, 0x3 ldr r1, =gUnknown_08DC64E8 @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 .pool @080F72B4: movs r6, 0x4 ldr r1, =gUnknown_08DC64FC 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, =gUnknown_08DC6510 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, =0x0203a034 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 .pool 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, =0x02039f00 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, =0x0000ffff 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 .pool 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, =0x02039f18 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, =0x0000ffff 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 .pool @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, =0x03005e00 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 .pool @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, =0x50430000 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, =0x0203a034 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 .pool 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, =0x02039f20 ldrb r0, [r1] ldr r6, =0x0203a034 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, =0x03005e00 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, =sub_80F753C 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 .pool 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, =0x03005e00 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, =0x00006f8d 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 .pool @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, =nullsub_12 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x30] ldr r0, =0x0203a034 ldr r0, [r0] ldr r1, [r0] movs r0, 0x1 strb r0, [r1, 0x6] @080F7610: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =nullsub_12 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, =0x0203a034 ldr r0, [r0] ldr r1, [r0] movs r0, 0x2 strb r0, [r1, 0x6] @080F7664: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x0203a034 mov r8, r0 ldr r0, [r0] ldr r0, [r0] ldrb r0, [r0, 0x7] cmp r0, 0x27 bhi @080F7732 ldr r4, =gUnknown_0858D860 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, =0x02020630 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, =0x000003ff adds r0, r1, 0 ands r4, r0 ldr r0, =0xfffffc00 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, =0x0203a034 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 .pool 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, =0x0203a034 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 .pool 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, =sub_80F7824 movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] strh r5, [r1, 0xA] ldr r0, =0x02039e00 lsls r4, 6 adds r4, r0 ldrh r0, [r4] strh r0, [r1, 0xC] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02039e00 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 .pool 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, =0x02039f08 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, =0x02039f00 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, =0x0203a034 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, =0x02039f18 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, =0x02039f20 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 .pool @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, =0x0203a034 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, =0x000060b3 bl bg_fill_tilemap_rect ldr r0, =sub_80F7CA8 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, =0x0000ffff ands r0, r3 ldr r1, =0x00007fff cmp r0, r1 bls @080F7B0A movs r1, 0x80 lsls r1, 9 adds r3, r1 @080F7B0A: ldr r1, =0x03005e00 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 .pool @080F7B5C: movs r1, 0 mov r9, r1 mov r10, r1 movs r3, 0xC0 lsls r3, 19 str r3, [sp, 0x10] @080F7B68: ldr r4, =0x0203a034 ldr r0, [r4] ldr r0, [r0, 0x4] add r0, r10 ldrb r2, [r0, 0x12] ldrb r0, [r0, 0x10] ldr r1, =0x000060a3 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, =sub_80F7CA8 movs r1, 0xA bl AddTask lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x0203a034 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, =0x0000ffff ands r0, r3 ldr r1, =0x00007fff cmp r0, r1 bls @080F7BDA movs r1, 0x80 lsls r1, 9 adds r3, r1 @080F7BDA: ldr r1, =0x03005e00 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 .pool @080F7C1C: ldr r0, [sp, 0x8] adds r0, 0x1 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x8] @080F7C26: ldr r1, =0x0203a034 ldr r0, [r1] ldr r0, [r0, 0x4] mov r4, r10 adds r1, r4, r0 ldrb r0, [r1, 0x10] ldr r4, =0x0203a034 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 .pool @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, =0x03005e00 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, =0x0203a034 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 .pool @080F7CF8: ldr r2, =0x0203a034 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 .pool @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, =0x0203a034 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 .pool @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, =0x0000504c b @080F7DA2 .align 2, 0 .pool @080F7DA0: ldr r3, =0x00005057 @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, =0x0203a034 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 .pool thumb_func_end sub_80F7CA8 thumb_func_start sub_80F7DF4 sub_80F7DF4: ; 80F7DF4 push {r4,r5,lr} ldr r4, =0x0203a034 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 .pool thumb_func_end sub_80F7DF4 thumb_func_start sub_80F7E64 sub_80F7E64: ; 80F7E64 push {r4,r5,lr} ldr r5, =0x0203a034 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 .pool 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, =0x02039f24 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 bl sub_80DAE0C lsls r0, 24 lsrs r0, 24 adds r5, r0, 0 cmp r5, 0 beq @080F7F5E ldr r4, =0x02039f2c ldrb r0, [r4] ldr r1, =0x02039f2e ldrb r1, [r1] bl sub_80DAB8C ldrb r0, [r4] bl sub_80DB09C @080F7F5E: ldr r0, =0x020375f0 strh r5, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F7F30 thumb_func_start sub_80F7F7C sub_80F7F7C: ; 80F7F7C push {r4,lr} movs r4, 0 ldr r0, =0x02039f24 ldrb r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r2, r1, r0 ldr r0, =0x02039f2c ldrh r0, [r0] cmp r0, 0x4 bhi @080F7FEE lsls r0, 2 ldr r1, =@080F7FB0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039f2e 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 .pool thumb_func_end sub_80F7F7C thumb_func_start sub_80F7FFC sub_80F7FFC: ; 80F7FFC push {r4-r7,lr} sub sp, 0x4 ldr r1, =0x02039f20 ldr r0, =0x02039f25 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @080F8010 b @080F8250 @080F8010: ldr r0, =0x02039f2c ldrh r0, [r0] cmp r0, 0x4 bls @080F801A b @080F8250 @080F801A: lsls r0, 2 ldr r1, =@080F8034 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @080F8034: .4byte @080F8048 .4byte @080F80B8 .4byte @080F8124 .4byte @080F8190 .4byte @080F81F8 @080F8048: ldr r6, =0x02039f24 ldrb r0, [r6] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x32 bl pokemon_getattr lsls r0, 24 lsrs r1, r0, 24 mov r0, sp strb r1, [r0] ldr r0, =0x02039f2e 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 .pool @080F80B8: mov r4, sp ldr r7, =0x02039f24 ldrb r0, [r7] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0x33 bl pokemon_getattr strb r0, [r4] mov r0, sp ldrb r2, [r0] ldr r0, =0x02039f2e 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 .pool @080F8124: mov r4, sp ldr r7, =0x02039f24 ldrb r0, [r7] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0x34 bl pokemon_getattr strb r0, [r4] mov r0, sp ldrb r2, [r0] ldr r0, =0x02039f2e 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 .pool @080F8190: mov r4, sp ldr r7, =0x02039f24 ldrb r0, [r7] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0x35 bl pokemon_getattr strb r0, [r4] mov r0, sp ldrb r2, [r0] ldr r0, =0x02039f2e 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 .pool @080F81F8: mov r4, sp ldr r7, =0x02039f24 ldrb r0, [r7] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 movs r1, 0x36 bl pokemon_getattr strb r0, [r4] mov r0, sp ldrb r2, [r0] ldr r0, =0x02039f2e 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 .pool thumb_func_end sub_80F7FFC thumb_func_start sub_80F8264 sub_80F8264: ; 80F8264 push {r4,lr} ldr r4, =0x02021cc4 ldr r0, =0x020375e4 ldrh r1, [r0] lsls r1, 6 ldr r0, =0x02039e0d 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 .pool thumb_func_end sub_80F8264 thumb_func_start sub_80F8290 sub_80F8290: ; 80F8290 push {lr} ldr r0, =0x02021ec4 ldr r1, =0x020375e4 ldrh r1, [r1] lsls r1, 6 ldr r2, =0x02039e02 adds r1, r2 bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375e0 ldr r4, =0x02039f00 ldr r0, =0x020375e4 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 .pool thumb_func_end sub_80F82B4 thumb_func_start sub_80F82FC sub_80F82FC: ; 80F82FC ldr r2, =0x020375e0 ldr r1, =0x02039f00 ldr r0, =0x020375e4 ldrh r0, [r0] lsls r0, 1 adds r0, r1 ldrh r0, [r0] strh r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_80F82FC thumb_func_start sub_80F831C sub_80F831C: ; 80F831C push {lr} movs r1, 0 ldr r2, =0x02039f20 ldrb r0, [r2] ldr r3, =0x020375e2 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 .pool thumb_func_end sub_80F831C thumb_func_start sub_80F834C sub_80F834C: ; 80F834C push {r4,lr} movs r1, 0 ldr r2, =0x02039f20 ldrb r0, [r2] ldr r4, =0x02021ec4 ldr r3, =0x02039e0d 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 .pool thumb_func_end sub_80F834C thumb_func_start sub_80F8390 sub_80F8390: ; 80F8390 push {r4,lr} movs r1, 0 ldr r2, =0x02039f20 ldrb r0, [r2] ldr r4, =0x02021cc4 ldr r3, =0x02039e02 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 .pool thumb_func_end sub_80F8390 thumb_func_start sub_80F83D0 sub_80F83D0: ; 80F83D0 push {lr} ldr r0, =sub_80D7B24 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F83D0 thumb_func_start sub_80F83E0 sub_80F83E0: ; 80F83E0 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080F83FE adds r0, r2, 0 bl remove_task ldr r0, =sub_80F83D0 bl set_callback2 @080F83FE: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80F83E0 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 .pool thumb_func_end sub_80F840C thumb_func_start sub_80F8438 sub_80F8438: ; 80F8438 ldr r2, =0x020375e0 ldr r1, =0x02039e00 ldr r0, =0x020375e4 ldrh r0, [r0] lsls r0, 6 adds r0, r1 ldrh r0, [r0] strh r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_80F8438 thumb_func_start sub_80F8458 sub_80F8458: ; 80F8458 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080F8476 adds r0, r2, 0 bl remove_task ldr r0, =sub_80F5B00 bl set_callback2 @080F8476: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80F8458 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 .pool thumb_func_end sub_80F8484 thumb_func_start sub_80F84B0 sub_80F84B0: ; 80F84B0 ldr r0, =0x020375e0 ldr r1, =0x02039f25 ldrb r1, [r1] strh r1, [r0] bx lr .align 2, 0 .pool 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, =sub_80FC580 adds r0, r6, 0 movs r1, 0 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r2, =sub_80F8508 adds r0, r4, 0 adds r1, r6, 0 bl set_task_function_and_args_14_15 ldr r1, =0x03005e00 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 .pool 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, =0x02039f2a ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @080F8540 ldr r0, =0x02039f24 ldrb r0, [r0] bl sub_80DA8C8 ldr r1, =sub_80FC6BC ldr r2, =sub_80F8568 adds r0, r4, 0 bl set_task_function_and_args_14_15 b @080F8556 .align 2, 0 .pool @080F8540: ldr r0, =0x02039f24 ldrb r0, [r0] bl sub_80DA8C8 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81D9DE4 str r1, [r0] @080F8556: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F8508 thumb_func_start sub_80F8568 sub_80F8568: ; 80F8568 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =sub_80FC804 ldr r2, =sub_80F8584 bl set_task_function_and_args_14_15 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F8568 thumb_func_start sub_80F8584 sub_80F8584: ; 80F8584 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =sub_80FCE48 ldr r2, =sub_80F85A0 bl set_task_function_and_args_14_15 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F8584 thumb_func_start sub_80F85A0 sub_80F85A0: ; 80F85A0 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =sub_80FC894 ldr r2, =sub_80F85BC bl set_task_function_and_args_14_15 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f30 mov r12, r5 ldr r0, =0x020375e0 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, =0x03005e08 @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 .pool @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, =0x03005e08 @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, =0x02039f2b strb r0, [r1] ldr r0, =0x02039f2c ldrb r0, [r0] bl sub_80DB09C ldr r1, =sub_80FCF40 ldr r2, =sub_80F86B8 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 .pool 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, =sub_80FCFD0 ldr r2, =sub_80F8714 adds r0, r4, 0 bl set_task_function_and_args_14_15 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f30 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 .pool 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, =0x020375e0 ldrh r0, [r0] cmp r0, 0x1 bne @080F8748 bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080F877E ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_80F878C str r0, [r1] b @080F877E .align 2, 0 .pool @080F8748: ldr r5, =0x02039e02 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, =0x03005d8c 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_80F87B4 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F878C thumb_func_start sub_80F87B4 sub_80F87B4: ; 80F87B4 push {lr} lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x03003124 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 .pool thumb_func_end sub_80F87B4 thumb_func_start sub_80F87D8 sub_80F87D8: ; 80F87D8 push {r4,lr} ldr r0, =0x03005d8c ldr r2, [r0] ldr r1, =0x02039e00 ldrb r3, [r1, 0x15] ldr r4, =0x000013bc 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 .pool thumb_func_end sub_80F87D8 thumb_func_start sub_80F8814 sub_80F8814: ; 80F8814 push {lr} ldr r0, =0x020375e2 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 .pool @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, =0x020375e0 strh r1, [r0] pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f2c ldrh r0, [r0] cmp r0, 0x4 bhi @080F88A4 lsls r0, 2 ldr r1, =@080F8880 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c ldr r0, [r0] lsls r1, 5 adds r0, r1 ldr r1, =0x00002e98 adds r0, r1 ldrh r1, [r0] cmp r1, 0 bne @080F88CC ldr r0, =0x020375e0 strh r1, [r0] b @080F88D2 .align 2, 0 .pool @080F88CC: ldr r1, =0x020375e0 movs r0, 0x1 strh r0, [r1] @080F88D2: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02039f20 ldr r1, =0x02039f25 ldrb r2, [r1] adds r0, r2, r0 ldrb r0, [r0] cmp r0, 0 bne @080F8930 ldr r0, =0x02039f2e ldrh r0, [r0] cmp r0, 0x3 bne @080F8930 ldr r1, =0x02039f08 lsls r0, r2, 1 adds r0, r1 movs r2, 0 ldrsh r1, [r0, r2] ldr r0, =0x0000031f cmp r1, r0 ble @080F8930 ldr r1, =0x020375e0 movs r0, 0x1 b @080F8934 .align 2, 0 .pool @080F8930: ldr r1, =0x020375e0 movs r0, 0 @080F8934: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F88E8 thumb_func_start sub_80F8940 sub_80F8940: ; 80F8940 push {lr} movs r3, 0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002f98 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 .pool 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, =0x02039f00 mov r12, r0 ldr r1, =0x020375e4 mov r9, r1 ldr r2, =0x02039e02 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 .pool @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, =0x02021cc4 bl gf_strcpy ldr r5, =0x02021dc4 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, =0x020375e4 strh r7, [r0] b @080F8AB6 .align 2, 0 .pool @080F8AB0: ldr r1, =0x020375e4 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 .pool thumb_func_end sub_80F8970 thumb_func_start sub_80F8ACC sub_80F8ACC: ; 80F8ACC push {lr} ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F8ACC thumb_func_start sub_80F8ADC sub_80F8ADC: ; 80F8ADC push {lr} ldr r0, =sub_812FDEC bl set_callback2 ldr r1, =0x030022c0 ldr r0, =sub_80F8ACC str r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F8ADC thumb_func_start sub_80F8AFC sub_80F8AFC: ; 80F8AFC push {r4,r5,lr} ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080F8B7C movs r3, 0 ldr r0, =0x02039f30 adds r4, r0, 0 ldr r5, =0x02039e00 ldrb r0, [r4] cmp r3, r0 bge @080F8B50 adds r2, r5, 0 ldr r1, =0x020229e8 @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 .pool @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, =0x00004010 ldrb r1, [r5, 0x15] bl var_set ldr r0, =0x00004011 adds r1, r5, 0 adds r1, 0x55 ldrb r1, [r1] bl var_set ldr r0, =0x00004012 adds r1, r5, 0 adds r1, 0x95 ldrb r1, [r1] bl var_set ldr r0, =0x00004013 adds r1, r5, 0 adds r1, 0xD5 ldrb r1, [r1] bl var_set @080F8B7C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F8AFC thumb_func_start sub_80F8B94 sub_80F8B94: ; 80F8B94 push {r4-r7,lr} ldr r1, =0x0300301c movs r0, 0xC strb r0, [r1] ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080F8C6E movs r5, 0 ldr r0, =0x02039f30 ldrb r0, [r0] cmp r5, r0 bge @080F8C6E movs r7, 0 movs r6, 0x60 movs r4, 0xB0 lsls r4, 17 @080F8BBA: ldr r0, =gUnknown_0858D8EC adds r0, r5, r0 ldrb r0, [r0] ldr r1, =0x03005d8c 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, =0x02037350 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, =0x02020630 adds r1, r0 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r6 strb r0, [r1, 0x5] ldr r0, =0x020229e8 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, =gUnknown_08499A18 b @080F8C42 .align 2, 0 .pool @080F8C2C: lsrs r1, r4, 16 ldr r0, =gUnknown_084A54B8 b @080F8C42 .align 2, 0 .pool @080F8C38: ldrb r0, [r1, 0x13] cmp r0, 0 bne @080F8C50 lsrs r1, r4, 16 ldr r0, =gUnknown_084987F8 @080F8C42: movs r2, 0x20 bl gpu_pal_apply b @080F8C5A .align 2, 0 .pool @080F8C50: lsrs r1, r4, 16 ldr r0, =gUnknown_084A4278 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, =0x02039f30 ldrb r0, [r0] cmp r5, r0 blt @080F8BBA @080F8C6E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F8B94 thumb_func_start sub_80F8C7C sub_80F8C7C: ; 80F8C7C push {r4-r6,lr} sub sp, 0x4 ldr r6, =0x02039f24 ldrb r0, [r6] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec 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, =0x02039f20 ldr r1, =0x02039f25 ldrb r2, [r1] adds r0, r2, r0 ldrb r0, [r0] cmp r0, 0 bne @080F8D18 ldr r0, =0x02039f2e ldrh r0, [r0] cmp r0, 0x3 bne @080F8D18 ldr r1, =0x02039f08 lsls r0, r2, 1 adds r0, r1 movs r2, 0 ldrsh r1, [r0, r2] ldr r0, =0x0000031f 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 .pool @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, =sub_80F8EE8 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, =0x02039e00 ldr r4, =0x020375e4 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, =0x03005e00 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, =0x02039f25 ldrh r0, [r4] ldrb r1, [r1] cmp r0, r1 bne @080F8DC4 lsls r0, r6, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 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 .pool @080F8DC4: lsls r0, r6, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 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, =0x0202499c 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, =0x02039f2a 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, =0x02020630 adds r0, r1 adds r1, r6, 0 movs r2, 0 movs r3, 0 bl sub_806ED40 b @080F8E6C .align 2, 0 .pool @080F8E58: lsls r4, r5, 4 adds r0, r4, r5 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 adds r1, r6, 0 movs r2, 0 movs r3, 0 bl sub_806ED40 @080F8E6C: ldr r1, =0x03005e00 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, =0x02020630 adds r1, r4, r5 lsls r1, 2 adds r0, r3, 0 adds r0, 0x1C adds r0, r1, r0 ldr r2, =nullsub_12 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 .pool thumb_func_end sub_80F8D28 thumb_func_start sub_80F8EB8 sub_80F8EB8: ; 80F8EB8 push {lr} ldr r0, =sub_80F8EE8 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @080F8EDC ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] bl sub_805F094 @080F8EDC: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@080F8F14 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 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 .pool @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, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080F8FD8 ldr r0, =0x02039f30 ldrb r0, [r0] cmp r0, 0x4 bne @080F8FD8 movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @080F8FD8 ldr r4, =0x020375f0 bl link_get_multiplayer_id lsls r0, 24 lsrs r0, 24 strh r0, [r4] b @080F8FDE .align 2, 0 .pool @080F8FD8: ldr r1, =0x020375f0 movs r0, 0x4 strh r0, [r1] @080F8FDE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F8FA0 thumb_func_start sub_80F8FE8 sub_80F8FE8: ; 80F8FE8 push {r4,lr} ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @080F9020 ldr r2, =0x030060b8 ldr r1, [r2] ldr r0, =0x41c64e6d muls r0, r1 ldr r1, =0x00006073 adds r0, r1 str r0, [r2] lsrs r0, 16 ldr r4, =0x020375f0 b @080F902A .align 2, 0 .pool @080F9020: ldr r4, =0x020375f0 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 .pool thumb_func_end sub_80F8FE8 thumb_func_start sub_80F903C sub_80F903C: ; 80F903C ldr r2, =0x030060b8 ldr r1, [r2] ldr r0, =0x41c64e6d muls r0, r1 ldr r1, =0x00006073 adds r0, r1 str r0, [r2] lsrs r0, 16 bx lr .align 2, 0 .pool thumb_func_end sub_80F903C thumb_func_start sub_80F905C sub_80F905C: ; 80F905C push {lr} ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @080F9074 movs r0, 0 b @080F907E .align 2, 0 .pool @080F9074: ldr r0, =sub_80F9088 movs r1, 0x5 bl AddTask movs r0, 0x1 @080F907E: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 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 .pool @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, =0x02039f2a ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080F90FE ldr r0, =0x03003124 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 .pool thumb_func_end sub_80F90DC thumb_func_start sub_80F910C sub_80F910C: ; 80F910C push {lr} ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @080F9126 ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080F9126 bl sub_800E084 @080F9126: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F910C thumb_func_start sub_80F9134 sub_80F9134: ; 80F9134 push {lr} ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 bne @080F914C movs r0, 0 b @080F914E .align 2, 0 .pool @080F914C: movs r0, 0x1 @080F914E: pop {r1} bx r1 thumb_func_end sub_80F9134 thumb_func_start sub_80F9154 sub_80F9154: ; 80F9154 ldr r1, =0x02039f2a movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_80F9154 thumb_func_start sub_80F9160 sub_80F9160: ; 80F9160 push {lr} ldr r0, =0x02039f2a ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @080F9178 movs r0, 0 b @080F917A .align 2, 0 .pool @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, =0x020244e9 ldrb r0, [r0] cmp r8, r0 bcs @080F922C ldr r1, =0x020244ec 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, =0x020244e9 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 .pool thumb_func_end sp000_heal_pokemon thumb_func_start sub_80F9244 ; void sub_80F9244(s16 species_num, u8 level, int held_item) 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 SpeciesToNationalPokedexNum 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, =0x020375f0 strh r1, [r0] @080F9318: pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec 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 .pool @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, =0x02021cc4 bl sub_80E1A38 @080F9392: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02024744 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 .pool 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, =0x020244e9 ldrb r0, [r0] subs r0, 0x1 lsls r0, 24 lsrs r3, r0, 24 @080F941C: movs r0, 0x64 muls r0, r3 ldr r1, =0x020244ec adds r0, r1 adds r1, r4, 0 bl sub_80691F4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9400 thumb_func_start sub_80F9438 sub_80F9438: ; 80F9438 push {lr} ldr r0, =0x030022c0 ldr r1, =sub_80F9460 str r1, [r0, 0x8] ldr r0, =0x000040cf movs r1, 0x9 bl var_set movs r0, 0 bl sub_81B8518 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9438 thumb_func_start sub_80F9460 sub_80F9460: ; 80F9460 push {lr} ldr r0, =0x0203cef8 ldrb r1, [r0] cmp r1, 0 bne @080F9478 ldr r0, =0x020375f0 strh r1, [r0] b @080F947E .align 2, 0 .pool @080F9478: ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] @080F947E: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9460 thumb_func_start sub_80F9490 sub_80F9490: ; 80F9490 push {lr} ldr r1, =0x030022c0 ldr r0, =sub_80F94B8 str r0, [r1, 0x8] ldr r0, =0x020375e0 ldrb r0, [r0] adds r0, 0x1 lsls r0, 24 lsrs r0, 24 bl sub_81B8518 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9490 thumb_func_start sub_80F94B8 sub_80F94B8: ; 80F94B8 push {lr} ldr r0, =0x0203cef8 ldrb r1, [r0] cmp r1, 0 bne @080F94D0 ldr r0, =0x020375f0 strh r1, [r0] b @080F94D6 .align 2, 0 .pool @080F94D0: ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] @080F94D6: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x05000064 mov r1, sp bl CpuSet movs r5, 0 movs r7, 0x64 ldr r6, =0x020244ec mov r4, sp @080F9502: ldr r0, =0x0203cef8 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, =0x020244ec ldr r2, =0x05000096 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 .pool 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, =0x020244ec 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 .pool @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, =0x020244ec 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, =0x02021cc4 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 .pool 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, =0x020244ec 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 .pool @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, =0x03005e08 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 .pool @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, =0x020375f0 strh r5, [r0] b @080F9718 .align 2, 0 .pool @080F96F0: ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] b @080F9718 .align 2, 0 .pool @080F96FC: ldrb r0, [r4, 0x2] bl sub_80F95C0 ldr r0, =gUnknown_085ECF5D bl box_related_two__2 ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] b @080F9722 .align 2, 0 .pool @080F9714: ldr r0, =0x020375f0 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 .pool thumb_func_end sub_80F9654 thumb_func_start sub_80F972C sub_80F972C: ; 80F972C push {lr} ldr r0, =sub_80F9654 movs r1, 0x50 bl AddTask bl script_env_2_set_ctx_paused pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F972C thumb_func_start overworld_poison overworld_poison: ; 80F9744 push {r4-r7,lr} sub sp, 0x4 ldr r4, =0x020244ec 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 .pool @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, =gUnknown_0858D8F0 @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 .pool @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 SpeciesToNationalPokedexNum 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, =gUnknown_0858D8F0 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 .pool 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 gUnknown_085EED24 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, =0x020375f0 ldrh r0, [r1] cmp r0, 0xFF bne @080F99A0 movs r0, 0 b @080F9A0A .align 2, 0 .pool @080F99A0: ldrh r1, [r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec 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 .pool @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, =0x02021dc4 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 .pool @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, =0x02021ec4 bl sub_80F9910 ldr r0, =0x02021cc4 movs r1, 0xB muls r1, r4 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldrh r1, [r5] movs r0, 0x80 lsls r0, 8 cmp r1, r0 bne @080F9A64 ldr r0, =0x02021dc4 ldr r1, =gUnknown_085ECF6B bl gf_strcpy b @080F9A6E .align 2, 0 .pool @080F9A64: ldr r0, =0x02021dc4 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy @080F9A6E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9A14 thumb_func_start sub_80F9A7C sub_80F9A7C: ; 80F9A7C push {lr} ldr r0, =0x00004047 movs r1, 0x80 lsls r1, 8 bl var_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9A7C thumb_func_start sub_80F9A90 sub_80F9A90: ; 80F9A90 push {lr} ldr r0, =0x00004047 bl var_get_pointer adds r1, r0, 0 movs r0, 0x95 lsls r0, 1 bl sub_80F9A14 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9A90 thumb_func_start sub_80F9AAC sub_80F9AAC: ; 80F9AAC push {r4,lr} ldr r0, =0x00004047 bl var_get_pointer adds r1, r0, 0 ldr r4, =0x020375f0 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 .pool thumb_func_end sub_80F9AAC thumb_func_start sub_80F9AD4 sub_80F9AD4: ; 80F9AD4 push {lr} ldr r0, =0x0000404f movs r1, 0x80 lsls r1, 8 bl var_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9AD4 thumb_func_start sub_80F9AE8 sub_80F9AE8: ; 80F9AE8 push {lr} ldr r0, =0x0000404f bl var_get_pointer adds r1, r0, 0 ldr r0, =0x00000127 bl sub_80F9A14 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9AE8 thumb_func_start sub_80F9B04 sub_80F9B04: ; 80F9B04 push {r4,lr} ldr r0, =0x0000404f bl var_get_pointer adds r1, r0, 0 ldr r4, =0x020375f0 ldr r0, =0x00000127 bl sub_80F9984 lsls r0, 24 lsrs r0, 24 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0858D970 mov r0, sp movs r2, 0x7 bl memcpy mov r8, r4 cmp r6, 0xA bhi @080F9BAC cmp r5, 0x40 bhi @080F9BAC ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000031a8 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, =0x020244ec 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, =0x0000089b bl flag_set @080F9BAC: add sp, 0xC pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80F9C90 adds r1, r4, 0 adds r2, r5, 0 bl sub_80F9C44 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80F9DFC adds r1, r4, 0 adds r2, r5, 0 bl sub_80F9C44 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9BF4 thumb_func_start sub_80F9C1C sub_80F9C1C: ; 80F9C1C push {lr} ldr r0, =sub_80F9C90 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80F9C1C thumb_func_start sub_80F9C30 sub_80F9C30: ; 80F9C30 push {lr} ldr r0, =sub_80F9DFC bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool @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, =0x02037b14 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 .pool @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, =0x03005e00 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 .pool @080F9E24: cmp r1, 0x2 beq @080F9E86 cmp r1, 0x3 beq @080F9ED8 b @080F9F2C @080F9E2E: ldr r0, =0x02037b14 strh r1, [r0] b @080F9F4E .align 2, 0 .pool @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, =0x02037b14 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 .pool @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, =0x0203ab40 ldr r1, =0x02037318 ldr r1, [r1, 0x4] bl sub_80E9608 bl sub_80E8B6C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80F9F5C thumb_func_start sub_80F9F78 sub_80F9F78: ; 80F9F78 push {lr} ldr r0, =0x02037590 ldrb r1, [r0] movs r0, 0x6 ands r0, r1 cmp r0, 0 beq @080F9FC0 ldr r1, =0x02038c08 ldr r0, [r1, 0x4] cmp r0, 0x2 beq @080F9FAE cmp r0, 0x2 bgt @080F9FA0 cmp r0, 0x1 beq @080F9FA6 b @080F9FFE .align 2, 0 .pool @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, =0x02038c08 ldr r0, [r1, 0x4] cmp r0, 0x2 beq @080F9FEA cmp r0, 0x2 bgt @080F9FD8 cmp r0, 0x1 beq @080F9FE2 b @080F9FFE .align 2, 0 .pool @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, =0x020375f0 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, =0x0203ab40 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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =sub_80FA0DC b @080FA0C0 .align 2, 0 .pool @080FA070: adds r0, r4, 0 bl sub_808925C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080FA0A0 bl sub_80F9F5C ldr r1, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =sub_80FA1E8 b @080FA0C0 .align 2, 0 .pool @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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =sub_80FA34C @080FA0C0: str r0, [r1] movs r0, 0x1 @080FA0C4: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_80FA004 thumb_func_start sub_80FA0DC sub_80FA0DC: ; 80FA0DC push {lr} bl brm_get_pokemon_selection ldr r1, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_08275A86 bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_80FA128 lsrs r0, r2, 16 strh r0, [r1, 0x18] strh r2, [r1, 0x1A] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0858E600 ldr r3, =0x02020630 ldr r1, =0x02037590 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, =0x02038c08 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 .pool 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, =sub_80FA1A8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80FA1D8 str r0, [r1, 0x1C] @080FA1D0: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_08275ADF bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_80FA234 lsrs r0, r2, 16 strh r0, [r1, 0x18] strh r2, [r1, 0x1A] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab40 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, =0x00000fff adds r0, r1, 0 ands r2, r0 cmp r2, 0x96 bne @080FA26A ldr r1, =0x02038c08 movs r0, 0 str r0, [r1, 0x1C] @080FA26A: cmp r2, 0x9C bne @080FA274 ldr r1, =0x02038c08 movs r0, 0x2 str r0, [r1, 0x1C] @080FA274: bl sub_80F9F78 ldr r0, =gUnknown_0858E618 ldr r3, =0x02020630 ldr r1, =0x02037590 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, =0x02038c08 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 .pool 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, =0x02038c08 ldr r1, [r0, 0x1C] adds r2, r4, 0 adds r2, 0x2A movs r0, 0 strb r1, [r2] strh r0, [r4, 0x2E] ldr r0, =sub_80FA304 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 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, =sub_80FA33C str r0, [r4, 0x1C] @080FA32E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_08275B38 bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_80FA398 lsrs r0, r2, 16 strh r0, [r1, 0x18] strh r2, [r1, 0x1A] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0858E630 ldr r3, =0x02020630 ldr r1, =0x02037590 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, =0x02038c08 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 .pool 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, =sub_80FA418 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80FA448 str r0, [r1, 0x1C] @080FA440: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80FA4A0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 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 .pool 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, =0x03005e08 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, =@080FA4D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00004054 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 .pool @080FA5B8: mov r0, sp movs r1, 0 ldrsh r0, [r0, r1] movs r2, 0 ldrsh r1, [r4, r2] ldr r2, =0x00000e21 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 .pool 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, =sub_80FA62C movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh 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 .pool 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, =0x03005e08 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 .pool @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, =0x00000276 adds r0, r5, 0 adds r1, r4, 0 bl setmaptile_0 subs r6, r4, 0x1 ldr r2, =0x0000026e 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 .pool 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, =0x03005e00 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 .pool @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, =sub_80FA754 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0x8] strh r7, [r1, 0xA] strh r6, [r1, 0xC] @080FA7DE: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0xfffffd88 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, =@080FA830 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_80FA7EC movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r4, [r1, 0x8] strh r0, [r1, 0xA] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 ldr r2, =0x02037590 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, =gUnknown_085059F8 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, =0x02020630 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, =sub_80FA9A4 str r0, [r2] movs r0, 0 strh r0, [r4, 0x2E] @080FAA5E: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 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 .pool @080FAABC: cmp r0, 0x3 beq @080FAB2C cmp r0, 0x4 beq @080FAB64 b @080FAB8C @080FAAC6: ldr r0, =gUnknown_0858E68C ldr r3, =0x02020630 ldr r1, =0x02037590 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 .pool @080FAAFC: ldr r0, =gUnknown_0858E68C ldr r3, =0x02020630 ldr r1, =0x02037590 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 .pool @080FAB2C: ldr r0, =gUnknown_0858E68C ldr r3, =0x02020630 ldr r1, =0x02037590 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, =0xfff80000 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 .pool @080FAB64: ldr r0, =gUnknown_0858E68C ldr r3, =0x02020630 ldr r1, =0x02037590 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 .pool 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, =0x02038c08 ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] subs r1, 0x1 bl cur_mapdata_get_blockid_at ldr r1, =0x00000286 cmp r0, r1 bne @080FABDC ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] subs r1, 0x1 ldr r2, =0x00000e02 bl setmaptile_0 b @080FABEA .align 2, 0 .pool @080FABDC: ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] subs r1, 0x1 movs r2, 0xA1 lsls r2, 2 bl setmaptile_0 @080FABEA: ldr r4, =0x02038c08 ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] ldr r2, =0x0000020a 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, =sub_80FAC24 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 ldr r0, [r4, 0x14] ldr r1, [r4, 0x18] ldr r2, =0x00000e8c 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, =sub_80FAC68 str r0, [r5, 0x1C] @080FAC54: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x000002f5 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 .pool @080FACB4: ldr r0, =0x000002f6 cmp r1, r0 beq @080FADA4 adds r0, 0x40 cmp r1, r0 beq @080FACC2 b @080FADCE @080FACC2: ldr r0, =0x02021cc4 movs r1, 0x64 movs r2, 0 movs r3, 0x3 bl decimal_int_to_string ldr r0, =0x02021dc4 ldr r1, =gUnknown_085EA88B bl gf_strcpy ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080FADCE ldr r4, =0x000040ee adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x10 b @080FAD8A .align 2, 0 .pool @080FAD14: ldr r0, =0x02021cc4 movs r1, 0x32 movs r2, 0 movs r3, 0x2 bl decimal_int_to_string ldr r0, =0x02021dc4 ldr r1, =gUnknown_085EA890 bl gf_strcpy ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080FADCE ldr r4, =0x000040ee adds r0, r4, 0 bl var_get adds r1, r0, 0 movs r0, 0x20 b @080FAD8A .align 2, 0 .pool @080FAD60: ldr r1, =0x020375f0 movs r0, 0x1 b @080FAD70 .align 2, 0 .pool @080FAD6C: ldr r1, =0x020375f0 movs r0, 0x2 @080FAD70: strh r0, [r1] ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080FADCE ldr r4, =0x000040ee 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 .pool @080FADA4: ldr r1, =0x020375f0 movs r0, 0x3 strh r0, [r1] ldr r0, =0x00004054 bl var_get lsls r0, 16 cmp r0, 0 beq @080FADCE ldr r4, =0x000040ee 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 .pool 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, =0xfffffd7b adds r0, r4, r1 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bls @080FAE10 ldr r0, =0x00000237 cmp r4, r0 bne @080FAE28 @080FAE10: movs r0, 0x1 b @080FAE2A .align 2, 0 .pool @080FAE1C: ldr r0, =0x0000028d cmp r4, r0 beq @080FAE10 ldr r0, =0x0000023f cmp r6, r0 beq @080FAE10 @080FAE28: movs r0, 0 @080FAE2A: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e08 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 .pool @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, =task50_overworld_posion_effect movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end overworld_posion_effect thumb_func_start c3_80A0DD8_is_running c3_80A0DD8_is_running: ; 80FAEC0 push {lr} ldr r0, =task50_overworld_posion_effect bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end c3_80A0DD8_is_running thumb_func_start sub_80FAED4 sub_80FAED4: ; 80FAED4 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_80FAEF0 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_80FAF64 str r1, [r0] @080FAF4E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r5, r0, r1 adds r0, r5, 0 bl sub_8093284 lsls r0, 24 cmp r0, 0 beq @080FAFC8 ldr r1, =0x03005e00 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 .pool @080FAFC4: ldr r0, =sub_80FAFD4 str r0, [r2] @080FAFC8: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80FAED4 movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FAFF8 thumb_func_start sub_80FB00C sub_80FB00C: ; 80FB00C push {r4,r5,lr} ldr r0, =gUnknown_0858E864 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_0858E880 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, =0x02020630 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 .pool @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, =0x02020630 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, =gUnknown_0858E880 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 .pool 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, =0x03005e08 adds r5, r1, r0 movs r1, 0 ldrsh r0, [r5, r1] adds r0, 0x1E bl sub_80FB0DC ldr r4, =0x03005d8c 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, =0xfffd0000 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, =0x75300000 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 .pool 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, =0x03005e08 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 .pool @080FB1F0: ldr r2, =gUnknown_0858E898 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, =sub_80FB2C0 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, =0x03005d8c 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, =0xfffd0000 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 .pool 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, =0x03005e08 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 .pool @080FB304: ldr r1, =gUnknown_0858E898 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, =0x03005d8c 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 .pool 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, =0x03005e08 adds r4, r0, r1 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0x5 bls @080FB386 b @080FB4D8 @080FB386: lsls r0, 2 ldr r1, =@080FB398 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_80FB0F8 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 .pool @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, =0x02037fd4 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, =sub_80FB1AC 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 .pool @080FB450: ldr r2, =0x03005e00 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 .pool @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, =0x0000020d movs r0, 0xB movs r1, 0x8 bl setmaptile_0 ldr r2, =0x00000215 movs r0, 0xB movs r1, 0x9 bl setmaptile_0 ldr r2, =0x0000021d 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, =0x02037b14 ldr r2, =0x01000100 mov r0, sp bl CpuFastSet ldr r0, =sub_80FB36C movs r1, 0xA bl AddTask add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FB4E0 thumb_func_start sub_80FB540 sub_80FB540: ; 80FB540 push {r4-r6,lr} sub sp, 0x4 ldr r0, =sub_80FB36C bl is_function_an_active_task lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 bne @080FB58A ldr r4, =0x03005d8c 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 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r0, =0x000040b4 bl var_get_pointer adds r7, r0, 0 ldr r0, =0x03005d8c 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 .pool @080FB624: cmp r2, 0x2 beq @080FB68A cmp r2, 0x3 beq @080FB6C4 b @080FB6E2 @080FB62E: ldr r0, =0x02037fd4 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 .pool @080FB648: ldr r0, =0x030022c0 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 .pool @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, =gUnknown_0858E8AB b @080FB6B2 .align 2, 0 .pool @080FB6AC: ldrb r1, [r6, 0x1] ldrb r2, [r6] ldr r3, =gUnknown_0858E8AD @080FB6B2: movs r0, 0xFF bl exec_movement movs r0, 0x1 strh r0, [r4] b @080FB6E2 .align 2, 0 .pool @080FB6C4: ldr r0, =0x00004001 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 .pool thumb_func_end sub_80FB5E8 thumb_func_start sub_80FB6EC sub_80FB6EC: ; 80FB6EC push {r4,lr} sub sp, 0x4 ldr r1, =nullsub_12 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, =0x02020630 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, =0x000040b4 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 .pool @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, =0x02037350 ldr r0, =0x02037590 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, =sub_80FB5E8 movs r1, 0x50 bl AddTask bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FB768 thumb_func_start sub_80FB7A4 sub_80FB7A4: ; 80FB7A4 push {lr} ldr r0, =0x0000088d bl flag_set ldr r0, =0x00004001 bl flag_set movs r0, 0x80 lsls r0, 7 bl flag_set ldr r0, =0x03005d8c 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 .pool thumb_func_end sub_80FB7A4 thumb_func_start sub_80FB7E8 sub_80FB7E8: ; 80FB7E8 push {lr} ldr r0, =0x03005d8c 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 .pool @080FB800: ldr r0, =0x0000081d cmp r1, r0 beq @080FB810 movs r0, 0 b @080FB812 .align 2, 0 .pool @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, =0x0203a048 ldrb r0, [r4] cmp r3, r0 bge @080FB844 ldr r6, =0x0203a044 @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 .pool 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, =0x0203a044 ldr r0, =gUnknown_0858E8B0 str r0, [r1] ldr r1, =0x0203a048 movs r0, 0x8 b @080FB902 .align 2, 0 .pool @080FB8F8: ldr r1, =0x0203a044 ldr r0, =gUnknown_0858E8F0 str r0, [r1] ldr r1, =0x0203a048 movs r0, 0xB @080FB902: strb r0, [r1] movs r1, 0 ldr r3, =0x0203a038 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 .pool 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, =0x03005d8c 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, =0x0203a048 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, =0x0203a044 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, =0x0203a038 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, =0x0203a048 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 .pool 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, =0x0203a044 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, =gUnknown_08591FE0 b @080FBA38 .align 2, 0 .pool @080FBA34: mov r1, sp ldr r0, =gUnknown_08591FC8 @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, =0x02020630 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 .pool @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, =0x02021bbc 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, =0x02021bbe 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 .pool thumb_func_end sub_80FBB64 thumb_func_start overworld_free_bgmaps ; void overworld_free_bgmaps() overworld_free_bgmaps: ; 80FBC00 push {lr} ldr r0, =gUnknown_08591D58 bl gpu_tile_obj_alloc_and_load_multiple pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c 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 .pool @080FBC48: ldr r0, =0x0203a044 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, =0x0203a038 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, =0x0203a038 adds r5, r6, r0 ldrb r0, [r5] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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, =0x0203a048 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 .pool 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, =gUnknown_08592058 mov r10, r0 b @080FBD08 .align 2, 0 .pool @080FBCFC: cmp r1, 0x2 beq @080FBD04 @080FBD00: movs r0, 0 b @080FBD98 @080FBD04: ldr r1, =gUnknown_08592038 mov r10, r1 @080FBD08: adds r0, r4, 0 bl sub_80FB854 lsls r0, 24 lsrs r0, 24 str r0, [sp] ldr r0, =0x0203a044 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, =gUnknown_08592078 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 .pool 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, =0x0203a044 ldr r2, [r1] lsls r1, r6, 3 adds r1, r2 ldrb r1, [r1, 0x4] ldr r2, =gUnknown_08592078 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 .pool 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, =0x0203a038 adds r2, r3, r0 ldrb r0, [r2] cmp r0, 0x40 beq @080FBE2C lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool 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, =gUnknown_08591FF8 b @080FBE7A .align 2, 0 .pool @080FBE58: cmp r0, 0x1 bne @080FBE64 ldr r3, =gUnknown_08592008 b @080FBE7A .align 2, 0 .pool @080FBE64: cmp r0, 0x3 bne @080FBE70 ldr r3, =gUnknown_08592018 b @080FBE7A .align 2, 0 .pool @080FBE70: cmp r3, 0x4 beq @080FBE78 movs r0, 0xFF b @080FBE88 @080FBE78: ldr r3, =gUnknown_08592028 @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 .pool 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, =0x0203a048 ldrb r0, [r0] cmp r6, r0 bge @080FBFC2 lsls r0, r4, 16 asrs r7, r0, 16 @080FBF32: ldr r0, =0x0203a044 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 .pool @080FBFB8: adds r6, 0x1 ldr r0, =0x0203a048 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 .pool 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, =0x0203a048 ldrb r0, [r0] cmp r6, r0 bge @080FC08A lsls r0, r4, 16 asrs r7, r0, 16 @080FC008: ldr r0, =0x0203a044 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, =0x0203a048 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 .pool 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, =0x0000088c bl flag_check lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end flag_check_is_in_safari_zone thumb_func_start sub_80FC0B4 sub_80FC0B4: ; 80FC0B4 push {lr} ldr r0, =0x0000088c bl flag_set pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000088c bl flag_clear pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a04c movs r0, 0x1E strb r0, [r1] ldr r1, =0x0203a04e movs r2, 0xFA lsls r2, 1 adds r0, r2, 0 strh r0, [r1] ldr r0, =0x0203a050 movs r1, 0 strb r1, [r0] ldr r0, =0x0203a051 strb r1, [r0] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FC0D4 thumb_func_start sub_80FC114 sub_80FC114: ; 80FC114 push {lr} ldr r0, =0x0203a050 ldrb r0, [r0] ldr r1, =0x0203a051 ldrb r1, [r1] bl sub_80EE44C bl flag_clear_is_in_safari_zone bl sub_80FC244 ldr r1, =0x0203a04c movs r0, 0 strb r0, [r1] ldr r1, =0x0203a04e movs r0, 0 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a04e 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 .pool @080FC170: ldr r0, =gUnknown_082A4B8A bl script_env_1_execute_new_script movs r0, 0x1 @080FC178: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end safari_step thumb_func_start sub_80FC180 sub_80FC180: ; 80FC180 push {lr} ldr r0, =gUnknown_082A4B6F bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FC180 thumb_func_start sub_80FC190 sub_80FC190: ; 80FC190 push {lr} ldr r1, =0x0203a051 ldr r0, =0x03005d10 ldrb r0, [r0, 0x1F] ldrb r2, [r1] adds r0, r2 strb r0, [r1] ldr r2, =0x0202433a ldrb r0, [r2] cmp r0, 0x7 bne @080FC1AE ldr r1, =0x0203a050 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @080FC1AE: ldr r0, =0x0203a04c ldrb r0, [r0] cmp r0, 0 beq @080FC1D8 ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 b @080FC21C .align 2, 0 .pool @080FC1D8: ldrb r0, [r2] cmp r0, 0x8 bne @080FC208 ldr r0, =gUnknown_082A4B4C bl script_env_2_execute_new_script bl warp_in ldr r1, =0x03005dac ldr r0, =sub_80AF6F0 str r0, [r1] ldr r0, =c2_load_new_map bl set_callback2 b @080FC21C .align 2, 0 .pool @080FC208: cmp r0, 0x7 bne @080FC21C ldr r0, =gUnknown_082A4B9B bl script_env_1_execute_new_script bl script_env_2_set_ctx_paused ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 @080FC21C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FC190 thumb_func_start sub_80FC228 sub_80FC228: ; 80FC228 push {lr} lsls r0, 24 lsrs r0, 20 ldr r1, =0x0203a054 adds r0, r1 movs r1, 0 movs r2, 0x10 bl memset pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FC228 thumb_func_start sub_80FC244 sub_80FC244: ; 80FC244 push {lr} ldr r0, =0x0203a054 movs r1, 0 movs r2, 0xA0 bl memset pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r2, [r0] ldr r1, =0x0203a054 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, =0x020375f0 strh r5, [r0] ldr r1, =gUnknown_085B262C ldrb r0, [r3, 0x8] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, =0x02021cc4 bl gf_strcpy b @080FC2D6 .align 2, 0 .pool @080FC2C4: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x9 bls @080FC26A ldr r1, =0x020375f0 ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r1] @080FC2D6: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r7, [r0] mov r4, sp ldr r0, =0x0203a054 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, =0x020375f0 strh r5, [r0] b @080FC376 .align 2, 0 .pool @080FC364: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x9 bls @080FC306 ldr r1, =0x020375f0 ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r1] @080FC376: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FC2E8 thumb_func_start sub_80FC388 sub_80FC388: ; 80FC388 push {lr} bl sub_80FC258 ldr r2, =0x020375f0 ldrh r1, [r2] ldr r0, =0x0000ffff cmp r1, r0 beq @080FC3B0 adds r0, r1, 0 lsls r0, 4 ldr r1, =0x0203a05c adds r0, r1 b @080FC3B2 .align 2, 0 .pool @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, =0x020375f0 ldrh r1, [r2] ldr r0, =0x0000ffff cmp r1, r0 beq @080FC3E0 adds r0, r1, 0 lsls r0, 4 ldr r1, =0x0203a05c adds r0, r1 b @080FC3E2 .align 2, 0 .pool @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, =0x0203a054 mov r6, sp adds r6, 0x2 movs r0, 0x8 adds r0, r2 mov r9, r0 ldr r7, =0x03005d8c @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, =0x00000848 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 .pool @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, =0x0203a054 @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 .pool thumb_func_end sub_80FC480 thumb_func_start sub_80FC4B4 sub_80FC4B4: ; 80FC4B4 push {lr} bl sub_80FC258 ldr r3, =0x020375f0 ldrh r1, [r3] ldr r0, =0x0000ffff cmp r1, r0 beq @080FC4EC ldr r0, =0x02021dc4 ldr r2, =0x0203a054 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 .pool @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, =0x0201c000 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 .pool @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, =0x03005e00 ldr r6, =sub_80FC5C0 ldr r4, =0x020223c4 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 .pool thumb_func_end sub_80FC580 thumb_func_start sub_80FC5C0 sub_80FC5C0: ; 80FC5C0 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_80FC5DC str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @080FC650 bl link_get_multiplayer_id ldr r1, =0x02039f25 strb r0, [r1] bl sub_8009FCC ldr r4, =0x02039f30 strb r0, [r4] ldr r1, =0x02039f2a movs r0, 0x1 strb r0, [r1] ldr r0, =0x030030fc 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, =0x020229e8 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, =0x02039f2a 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 .pool thumb_func_end sub_80FC5DC thumb_func_start sub_80FC670 sub_80FC670: ; 80FC670 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02039f2a 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 .pool @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, =0x03005e08 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 .pool @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, =0x020228c4 ldr r1, =0x02039f25 ldrb r1, [r1] lsls r1, 6 ldr r2, =0x02039e00 adds r1, r2 movs r2, 0x40 bl memcpy movs r0, 0xA strh r0, [r4, 0x8] b @080FC7F4 .align 2, 0 .pool @080FC738: ldr r0, =0x020228c4 ldr r1, =0x02039f25 ldrb r1, [r1] lsls r1, 6 ldr r2, =0x02039e00 adds r1, r2 movs r2, 0x40 bl memcpy b @080FC7D6 .align 2, 0 .pool @080FC758: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FC7F4 movs r5, 0 ldr r0, =0x02039f30 mov r8, r6 ldrb r0, [r0] cmp r5, r0 bge @080FC798 ldr r6, =0x020229e8 @080FC770: lsls r4, r5, 6 ldr r0, =0x02039e00 adds r4, r0 lsls r1, r5, 8 ldr r0, =0x020223c4 adds r1, r0 adds r0, r4, 0 movs r2, 0x40 bl memcpy ldrh r1, [r6, 0x1A] adds r0, r4, 0 bl sub_80DFA08 adds r6, 0x1C adds r5, 0x1 ldr r0, =0x02039f30 ldrb r0, [r0] cmp r5, r0 blt @080FC770 @080FC798: ldr r0, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @080FC7F4 .align 2, 0 .pool @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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool @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, =0x03005d80 movs r1, 0x4 bl sub_80FC4F4 cmp r0, 0x1 bne @080FC880 b @080FC87A .align 2, 0 .pool @080FC858: movs r0, 0 bl sub_80FC530 lsls r0, 24 cmp r0, 0 beq @080FC880 ldr r0, =0x03005d80 ldr r4, =0x020223c4 adds r1, r4, 0 movs r2, 0x4 bl memcpy ldr r0, =0x030060b8 adds r1, r4, 0 movs r2, 0x4 bl memcpy @080FC87A: ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @080FC880: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @080FC8D8: cmp r0, 0xA beq @080FC954 b @080FC96E @080FC8DE: ldr r1, =0x020228c4 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 .pool @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, =0x02039f30 ldrb r0, [r1] cmp r3, r0 bge @080FC93A ldr r4, =0x020223c4 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 .pool @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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool @080FC9C4: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080FC9F0 ldr r0, =0x02039f25 movs r1, 0x1 bl sub_80FC4F4 cmp r0, 0x1 bne @080FC9F0 b @080FC9EA .align 2, 0 .pool @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, =0x03005e00 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 .pool @080FCA30: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080FCAB2 ldr r0, =0x02039f34 ldr r2, [r0] ldr r0, =0x02039f25 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 .pool @080FCA68: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FCAB2 movs r2, 0 ldr r6, =0x02039f30 mov r9, r8 mov r12, r7 ldrb r0, [r6] cmp r2, r0 bge @080FCAA4 ldr r1, =0x02039f34 mov r8, r1 ldr r4, =0x020223c4 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 .pool 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, =0x03005e00 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, =@080FCAFC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039f08 movs r1, 0x8 b @080FCC16 .align 2, 0 .pool @080FCB44: bl sub_80FC55C lsls r0, 24 cmp r0, 0 bne @080FCB50 b @080FCC82 @080FCB50: ldr r0, =0x02039f08 ldr r1, =0x02039f2b ldrb r1, [r1] lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x8 b @080FCC50 .align 2, 0 .pool @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, =0x02039f10 movs r1, 0x8 b @080FCC16 .align 2, 0 .pool @080FCBA4: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FCC82 ldr r0, =0x02039f10 ldr r1, =0x02039f2b ldrb r1, [r1] lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x8 b @080FCC50 .align 2, 0 .pool @080FCBCC: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080FCC82 ldr r0, =0x02039f18 movs r1, 0x8 b @080FCC16 .align 2, 0 .pool @080FCBE0: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FCC82 ldr r0, =0x02039f18 ldr r1, =0x02039f2b ldrb r1, [r1] lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x8 b @080FCC50 .align 2, 0 .pool @080FCC08: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080FCC82 ldr r0, =0x02039f20 movs r1, 0x4 @080FCC16: bl sub_80FC4F4 cmp r0, 0x1 bne @080FCC82 ldr r0, =0x03005e00 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 .pool @080FCC38: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FCC82 ldr r0, =0x02039f20 ldr r1, =0x02039f2b ldrb r1, [r1] lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x4 @080FCC50: bl memcpy ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 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, =@080FCCB8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x4] movs r1, 0x70 b @080FCDD6 .align 2, 0 .pool @080FCD04: bl sub_80FC55C lsls r0, 24 cmp r0, 0 bne @080FCD10 b @080FCE42 @080FCD10: ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x4] ldr r1, =0x02039f2b ldrb r1, [r1] lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x70 b @080FCE10 .align 2, 0 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] movs r1, 0x14 b @080FCDD6 .align 2, 0 .pool @080FCD6C: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FCE42 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x8] ldr r1, =0x02039f2b ldrb r1, [r1] lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x14 b @080FCE10 .align 2, 0 .pool @080FCD98: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080FCE42 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x10] b @080FCDD4 .align 2, 0 .pool @080FCDB0: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FCE42 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x10] b @080FCE04 .align 2, 0 .pool @080FCDC8: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080FCE42 ldr r0, =0x02039f26 @080FCDD4: movs r1, 0x4 @080FCDD6: bl sub_80FC4F4 cmp r0, 0x1 bne @080FCE42 ldr r0, =0x03005e00 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 .pool @080FCDF8: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FCE42 ldr r0, =0x02039f26 @080FCE04: ldr r1, =0x02039f2b ldrb r1, [r1] lsls r1, 8 ldr r2, =0x020223c4 adds r1, r2 movs r2, 0x4 @080FCE10: bl memcpy ldr r1, =0x03005e00 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 .pool @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, =0x03005e08 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 .pool @080FCE8C: cmp r0, 0xA beq @080FCEFC b @080FCF16 @080FCE92: ldr r1, =0x020228c4 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 .pool @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, =0x020223c4 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 .pool @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, =0x03005e00 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 .pool 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, =0x03005e08 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 .pool @080FCF80: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080FCFBE ldr r0, =0x02039f00 movs r1, 0x8 bl sub_80FC4F4 cmp r0, 0x1 bne @080FCFBE b @080FCFB8 .align 2, 0 .pool @080FCF9C: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FCFBE ldr r0, =0x02039f00 ldr r1, =0x02039f2b ldrb r1, [r1] lsls r1, 8 ldr r2, =0x020223c4 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 .pool 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, =0x03005e08 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 .pool @080FD010: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @080FD04E ldr r0, =0x02039f26 movs r1, 0x4 bl sub_80FC4F4 cmp r0, 0x1 bne @080FD04E b @080FD048 .align 2, 0 .pool @080FD02C: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @080FD04E ldr r0, =0x02039f26 ldr r1, =0x02039f2b ldrb r1, [r1] lsls r1, 8 ldr r2, =0x020223c4 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 .pool 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, =0x0203ce7c ldrh r0, [r1] cmp r0, 0xAF bne @080FD084 ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldrb r0, [r1, 0x10] b @080FD08A .align 2, 0 .pool @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, =0x0203ce54 ldr r2, [r0] ldr r1, =gUnknown_085920D8 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 .pool @080FD0B8: ldr r0, =0x0203cf2c ldr r2, [r0] ldr r1, =gUnknown_085920D8 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 .pool 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, =0x03005e00 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, =0x03005dac ldr r0, =sub_80FD124 str r0, [r1] adds r0, r2, 0 bl sub_80FD060 b @080FD11A .align 2, 0 .pool @080FD110: ldr r0, =0x0203a0f4 ldr r1, [r0] adds r0, r2, 0 bl _call_via_r1 @080FD11A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end run_eventually_start thumb_func_start sub_80FD124 sub_80FD124: ; 80FD124 push {lr} bl pal_fill_black ldr r0, =sub_80FD13C movs r1, 0x8 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a0f4 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 @080FD158: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 adds r0, r6, 0 bl ExpandTextCodes cmp r4, 0 bne @080FD1B4 bl sub_81A9E40 lsls r0, 24 cmp r0, 0 bne @080FD1A0 ldr r3, =sub_81ABBBC adds r0, r5, 0 movs r1, 0x1 adds r2, r6, 0 bl sub_81ABB4C b @080FD1BE .align 2, 0 .pool @080FD1A0: ldr r1, =gUnknown_085E8F31 ldr r2, =sub_81C6714 adds r0, r5, 0 bl sub_81C6DD8 b @080FD1BE .align 2, 0 .pool @080FD1B4: ldr r2, =sub_80FD1F8 adds r0, r5, 0 adds r1, r6, 0 bl sub_81978EC @080FD1BE: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E8F31 bl sub_80FD164 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E8F6E bl sub_80FD164 pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80FDF48 cmp r0, r1 bne @080FD238 movs r0, 0x1 b @080FD24E .align 2, 0 .pool @080FD238: adds r0, r4, 0 bl itemid_get_overworld_function ldr r1, =sub_80FE378 cmp r0, r1 beq @080FD24C movs r0, 0 b @080FD24E .align 2, 0 .pool @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, =0x0203ce7c ldrh r0, [r0] strh r0, [r1, 0x20] ldr r1, =sub_81AD40C mov r0, sp movs r2, 0 bl sub_8121478 add sp, 0x24 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FD254 thumb_func_start sub_80FD278 sub_80FD278: ; 80FD278 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203ce54 ldr r2, [r1] ldr r1, =sub_80FD254 str r1, [r2] bl task_close_bag_menu_1 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FD278 thumb_func_start item_field_func_bike ; void item_field_func_bike(int task_id) 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, =0x03005e08 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, =0x0000088b 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 .pool @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, =0x0203a0f4 ldr r0, =sub_80FD358 str r0, [r1] adds r0, r5, 0 bl run_eventually_start b @080FD350 .align 2, 0 .pool @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, =0x0203ce7c 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 .pool @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, =0x0203a0f4 ldr r0, =sub_80FD468 str r0, [r1] adds r0, r4, 0 bl run_eventually_start b @080FD45E .align 2, 0 .pool @080FD44C: ldr r0, =0x03005e00 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 .pool 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, =0x0203ce7c 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 .pool 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, =0x0203a0f4 ldr r0, =sub_80FD4B8 str r0, [r1] adds r0, r4, 0 bl run_eventually_start pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037318 ldr r0, [r0, 0x4] adds r1, r4, 0 bl sub_80FD5F0 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080FD4EC ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80FD504 str r0, [r1] b @080FD4F6 .align 2, 0 .pool @080FD4EC: ldr r1, =gUnknown_085E9002 ldr r2, =sub_80FD5CC adds r0, r4, 0 bl sub_81978EC @080FD4F6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =gUnknown_085920E4 subs r0, 0x1 adds r0, r1 ldrb r0, [r0] bl sub_80FDA24 mov r0, r8 subs r0, 0x8 adds r0, r7, r0 ldr r1, =sub_80FDA94 str r1, [r0] b @080FD5C2 .align 2, 0 .pool @080FD564: bl player_get_direction__sp1AA lsls r0, 24 lsrs r2, r0, 24 movs r1, 0 adds r3, r6, 0 ldr r7, =gUnknown_085920E4 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, =0x03005e00 adds r0, r3, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_80FDADC str r1, [r0] movs r0, 0 strh r0, [r4, 0x6] strh r0, [r4, 0x4] b @080FD5C2 .align 2, 0 .pool @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, =0x03005e00 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, =0x03005e00 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 .pool @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, =0x02037318 ldr r0, [r0] ldr r0, [r0, 0x4] b @080FD79E .align 2, 0 .pool @080FD784: ldr r0, [r3] ldr r0, [r0] subs r0, 0x7 adds r0, r5 b @080FD798 @080FD78E: ldr r0, =0x02037318 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 .pool @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, =0x02037318 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 .pool 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, =0x03005e08 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 .pool @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, =0x02037350 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 .pool 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, =0x02037350 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, =gUnknown_085E8F93 ldr r2, =sub_80FD5CC adds r0, r4, 0 bl sub_81978EC @080FDACA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x02037350 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, =gUnknown_085920E4 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, =gUnknown_085E8FDB ldr r2, =sub_80FD5CC adds r0, r5, 0 bl sub_81978EC @080FDB50: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @080FDB98: ldr r0, =0x03005e00 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, =0x0203ce54 ldr r1, [r0] ldr r0, =sub_80FDBEC str r0, [r1] adds r0, r4, 0 bl task_close_bag_menu_1 b @080FDBDA .align 2, 0 .pool @080FDBC8: ldr r0, =0x03005dac ldr r1, =sub_80AF6D4 str r1, [r0] movs r0, 0x1 movs r1, 0 bl fade_screen ldr r0, =sub_80FDC00 str r0, [r5] @080FDBDA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FDB6C thumb_func_start sub_80FDBEC sub_80FDBEC: ; 80FDBEC push {lr} ldr r1, =sub_81AD40C movs r0, 0 bl sub_81357FC pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @080FDC24 bl overworld_free_bg_tilemaps ldr r1, =c2_exit_to_overworld_2_switch movs r0, 0 bl sub_81357FC adds r0, r4, 0 bl remove_task @080FDC24: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021cc4 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, =0x02021fc4 ldr r1, =gUnknown_085E9026 adds r0, r4, 0 bl ExpandTextCodes ldr r1, =0x03005e00 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, =sub_81ABBBC adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 bl sub_81ABB4C b @080FDC9A .align 2, 0 .pool @080FDC90: ldr r2, =sub_80FD1F8 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC @080FDC9A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021cc4 bl sub_80247BC adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0x5 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9138 adds r0, r4, 0 bl ExpandTextCodes ldr r1, =0x03005e00 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, =sub_81ABBBC adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 bl sub_81ABB4C b @080FDD06 .align 2, 0 .pool @080FDCFC: ldr r2, =sub_80FD1F8 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC @080FDD06: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a0f4 ldr r0, =sub_80FDD74 str r0, [r1] ldr r1, =0x03005dac ldr r0, =sub_80FD124 str r0, [r1] ldr r0, =0x0203ce54 ldr r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch str r0, [r1] adds r0, r4, 0 bl task_close_bag_menu_1 b @080FDD68 .align 2, 0 .pool @080FDD58: ldr r0, =0x0203ce7c 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 .pool 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, =0x0203ce7c ldrh r0, [r0] movs r1, 0x1 bl sub_80D6AA4 bl script_env_2_enable ldr r0, =gUnknown_08274482 bl script_env_1_execute_new_script adds r0, r4, 0 bl remove_task pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a0f4 ldr r0, =sub_80FDE7C b @080FDDD8 .align 2, 0 .pool @080FDDC8: bl sub_80E1770 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @080FDDEC ldr r1, =0x0203a0f4 ldr r0, =sub_80FDE08 @080FDDD8: str r0, [r1] adds r0, r4, 0 bl run_eventually_start b @080FDDFE .align 2, 0 .pool @080FDDEC: ldr r0, =0x03005e00 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 .pool 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, =gUnknown_082744C0 bl script_env_1_execute_new_script adds r0, r4, 0 bl remove_task pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 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 .pool @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, =gUnknown_08242CFC bl script_env_1_execute_new_script adds r0, r4, 0 bl remove_task pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006328 ldr r1, =sub_81B6588 str r1, [r2] bl sub_80FD060 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006328 ldr r1, =sub_81B67C8 str r1, [r2] bl sub_80FD060 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006328 ldr r1, =sub_81B79E8 str r1, [r2] bl sub_80FD060 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006328 ldr r1, =dp05_ether str r1, [r2] bl sub_80FD060 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006328 ldr r1, =dp05_pp_up str r1, [r2] bl sub_80FD060 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FDF10 thumb_func_start sub_80FDF2C sub_80FDF2C: ; 80FDF2C push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 ldr r1, =dp05_rare_candy str r1, [r2] bl sub_80FD060 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce7c ldrh r1, [r0] movs r0, 0xA9 lsls r0, 1 cmp r1, r0 bls @080FDF74 ldr r2, =gUnknown_085E9047 ldr r3, =sub_80FDF90 adds r0, r4, 0 movs r1, 0x1 bl sub_81ABB4C b @080FDF80 .align 2, 0 .pool @080FDF74: ldr r2, =gUnknown_085E9037 ldr r3, =sub_80FDF90 adds r0, r4, 0 movs r1, 0x1 bl sub_81ABB4C @080FDF80: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task08_0809AD8C str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @080FE000 ldr r4, =0x02021cc4 ldr r0, =0x0203ce7c ldrh r0, [r0] bl sub_81B6CFC lsls r0, 16 lsrs r0, 16 movs r1, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9058 adds r0, r4, 0 bl ExpandTextCodes ldr r3, =sub_80FE024 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 .pool thumb_func_end task08_0809AD8C thumb_func_start sub_80FE024 sub_80FE024: ; 80FE024 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_085920E8 movs r1, 0x6 bl sub_81AE238 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FE024 thumb_func_start sub_80FE03C sub_80FE03C: ; 80FE03C push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 ldr r1, =sub_81B6DC4 str r1, [r2] bl sub_80FD060 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FE03C thumb_func_start sub_80FE058 sub_80FE058: ; 80FE058 push {r4,lr} ldr r4, =0x0203ce7c ldrh r0, [r4] movs r1, 0x1 bl sub_80D6AA4 ldrh r0, [r4] ldr r1, =0x02021dc4 bl itemid_get_name ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9080 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 .pool @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, =0x00004021 bl var_get lsls r0, 16 cmp r0, 0 bne @080FE0EC ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80FE124 str r0, [r1] b @080FE116 .align 2, 0 .pool @080FE0EC: bl sub_81A9E40 lsls r0, 24 cmp r0, 0 bne @080FE10C ldr r2, =gUnknown_085E9092 ldr r3, =sub_81ABBBC adds r0, r4, 0 movs r1, 0x1 bl sub_81ABB4C b @080FE116 .align 2, 0 .pool @080FE10C: ldr r1, =gUnknown_085E9092 ldr r2, =sub_81C6714 adds r0, r5, 0 bl sub_81C6DD8 @080FE116: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =sub_80FE164 str r1, [r0] @080FE156: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00004021 ldr r0, =0x0203ce7c 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, =0x02021fc4 ldr r3, =sub_81ABBBC adds r0, r5, 0 movs r1, 0x1 bl sub_81ABB4C b @080FE1C2 .align 2, 0 .pool @080FE1B8: ldr r1, =0x02021fc4 ldr r2, =sub_81C6714 adds r0, r6, 0 bl sub_81C6DD8 @080FE1C2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02021fc4 ldr r3, =sub_81ABBBC adds r0, r4, 0 movs r1, 0x1 bl sub_81ABB4C b @080FE226 .align 2, 0 .pool @080FE21C: ldr r1, =0x02021fc4 ldr r2, =sub_81C6714 adds r0, r5, 0 bl sub_81C6DD8 @080FE226: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce7c ldrh r0, [r4] ldr r1, =0x02021dc4 bl itemid_get_name ldrh r0, [r4] cmp r0, 0x2B bne @080FE278 ldr r0, =0x000008ad bl flag_set ldr r0, =0x000008ae bl flag_clear ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E90C6 bl ExpandTextCodes b @080FE28C .align 2, 0 .pool @080FE278: ldr r0, =0x000008ae bl flag_set ldr r0, =0x000008ad bl flag_clear ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E90F4 bl ExpandTextCodes @080FE28C: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x18] ldr r1, =sub_80FE1D0 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x8] ldr r1, =0x02021fc4 ldr r2, =task08_080A1C44 adds r0, r4, 0 bl sub_81978EC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end re_escape_rope thumb_func_start sub_80FE314 sub_80FE314: ; 80FE314 push {lr} ldr r0, =0x02037318 ldrb r1, [r0, 0x1A] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @080FE32C movs r0, 0 b @080FE32E .align 2, 0 .pool @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, =0x0203a0f4 ldr r0, =re_escape_rope str r0, [r1] adds r0, r4, 0 bl run_eventually_start b @080FE36E .align 2, 0 .pool @080FE35C: ldr r0, =0x03005e00 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 .pool thumb_func_end sub_80FE334 thumb_func_start sub_80FE378 sub_80FE378: ; 80FE378 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03006328 ldr r1, =sub_81B7C74 str r1, [r2] bl sub_80FD060 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce7c 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 .pool @080FE3C8: adds r0, r4, 0 bl sub_81C5B14 b @080FE3FA @080FE3D0: bl sub_81A9E40 lsls r0, 24 cmp r0, 0 bne @080FE3F0 ldr r2, =gUnknown_085E9125 ldr r3, =sub_81ABBBC adds r0, r4, 0 movs r1, 0x1 bl sub_81ABB4C b @080FE3FA .align 2, 0 .pool @080FE3F0: ldr r1, =gUnknown_085E9125 ldr r2, =sub_81C6714 adds r0, r5, 0 bl sub_81C6DD8 @080FE3FA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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 .pool @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, =0x03005e00 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, =0x0203ce7c 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, =sub_80FE408 adds r0, r5, 0 movs r1, 0x1 bl sub_81ABB4C b @080FE4AC .align 2, 0 .pool @080FE49C: ldrh r0, [r4] bl sub_806CF78 adds r1, r0, 0 ldr r2, =sub_80FE408 adds r0, r6, 0 bl sub_81C6DD8 @080FE4AC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202406e ldr r0, =0x020244b8 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x0203ce7c 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, =gUnknown_085E96F6 ldr r3, =sub_81ABBBC adds r0, r4, 0 movs r1, 0x1 bl sub_81ABB4C b @080FE53C .align 2, 0 .pool @080FE518: ldr r1, =gUnknown_085E96F6 ldr r2, =sub_81C6714 adds r0, r4, 0 bl sub_81C6DD8 b @080FE53C .align 2, 0 .pool @080FE52C: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_80FE440 str r0, [r1] strh r2, [r1, 0x18] @080FE53C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce54 ldr r1, [r0] ldr r0, =sub_81B89F0 str r0, [r1] adds r0, r4, 0 bl task_close_bag_menu_1 b @080FE582 .align 2, 0 .pool @080FE574: ldr r0, =0x0203cf2c ldr r1, [r0] ldr r0, =sub_81B89F0 str r0, [r1] adds r0, r4, 0 bl sub_81C5B14 @080FE582: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006328 ldr r1, =sub_81B6588 str r1, [r2] bl sub_80FE54C pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006328 ldr r1, =sub_81B79E8 str r1, [r2] bl sub_80FE54C pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006328 ldr r1, =dp05_ether str r1, [r2] bl sub_80FE54C pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022fec 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, =0x02021fc4 ldr r3, =task_close_bag_menu_1 adds r0, r4, 0 movs r1, 0x1 bl sub_81ABB4C b @080FE646 .align 2, 0 .pool @080FE620: ldr r1, =0x02021fc4 ldr r2, =sub_81C5B14 adds r0, r4, 0 bl sub_81C6DD8 b @080FE646 .align 2, 0 .pool @080FE634: ldr r0, =0x03005e00 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 .pool 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, =0x0203ce7c 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, =@080FE67C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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 .pool @080FE6EC: ldr r0, =0x03005e00 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 .pool @080FE708: ldr r0, =0x03005e00 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 .pool @080FE724: ldr r0, =0x03005e00 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 .pool @080FE740: ldr r0, =0x03005e00 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 .pool @080FE75C: ldr r0, =0x03005e00 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 .pool 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, =0x0203ce7c ldrh r0, [r0] bl sub_81B7CEC lsls r0, 24 lsrs r0, 24 cmp r0, 0x15 bhi @080FE814 lsls r0, 2 ldr r1, =@080FE7A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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 .pool 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, =0x0203841e 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, =0x02038436 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 .pool @080FE87C: ldrh r0, [r5, 0x8] @080FE87E: strh r0, [r4, 0x34] ldr r0, =0x0203841e ldrh r0, [r0, 0xA] strh r0, [r4, 0x36] ldr r0, =sub_80FE898 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r4, 0x2E] ldr r5, =0x02038436 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] ldr r0, =sub_80A6EEC str r0, [r4, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrb r1, [r5, 0x6] adds r0, r4, 0 bl obj_anim_image_start ldrh r0, [r5, 0x4] strh r0, [r4, 0x2E] ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] ldr r0, =sub_80A6EEC str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r6, 0x4] strh r0, [r4, 0x2E] ldrh r0, [r4, 0x20] strh r0, [r4, 0x30] ldr r5, =0x02038437 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, =sub_80FE9E4 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 ldrb r0, [r0] bl sub_80A82E4 adds r0, 0x1 b @080FEA1E .align 2, 0 .pool @080FEA14: ldr r0, =0x02038437 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 .pool 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, =0x03005e00 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, =0x0203841e movs r0, 0xF strh r0, [r1] strh r2, [r1, 0x2] movs r0, 0x50 strh r0, [r1, 0x4] strh r2, [r1, 0x6] ldr r4, =gUnknown_08592210 ldr r0, =0x02038437 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 .pool 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, =0x0203841e ldrh r0, [r6, 0x6] strh r0, [r4, 0x2E] ldr r5, =0x02038436 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] ldrh r0, [r6, 0x4] strh r0, [r4, 0x38] adds r0, r4, 0 bl sub_80A68D4 ldr r0, =sub_80FEB28 str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080FEB90 ldrh r0, [r5, 0x20] subs r0, 0x14 b @080FEB94 .align 2, 0 .pool @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, =0x02038437 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, =sub_80FEBFC str r1, [r5, 0x1C] adds r0, r5, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080FEC68 ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @080FEC68: ldr r4, =0x0203841e ldrh r0, [r4, 0x8] strh r0, [r6, 0x2E] ldr r5, =0x02038437 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, =sub_80FECB8 str r0, [r6, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A64B0 str r0, [r4, 0x1C] ldr r1, =sub_80FECF0 adds r0, r4, 0 bl oamt_set_x3A_32 @080FECE2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A64B0 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =sub_80FED74 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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 .pool @080FEDC8: ldr r0, =0x02038437 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 .pool 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, =0x02038437 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 .pool @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, =0x0203841e 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, =0x02038436 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, =sub_80FEECC str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl sub_80A82E4 subs r0, 0x1 b @080FEF22 .align 2, 0 .pool @080FEF18: ldr r0, =0x02038436 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 .pool @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, =0x0203841e 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, =0x02038436 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, =sub_80FEF98 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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, =0x0203841e 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, =sub_80FF044 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80FF090 str r0, [r1, 0x1C] b @080FF08C .align 2, 0 .pool @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, =0x02038436 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 .pool @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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @080FF114 ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @080FF114: ldr r6, =0x0203841e ldrh r0, [r6, 0x8] strh r0, [r5, 0x2E] movs r1, 0xC ldrsh r0, [r6, r1] cmp r0, 0 bne @080FF154 ldr r4, =0x02038437 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x4] adds r0, r1 strh r0, [r5, 0x32] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r6, [r6, 0x6] adds r0, r6 b @080FF174 .align 2, 0 .pool @080FF154: ldr r0, =0x02038437 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, =0x0203841e ldrh r0, [r0, 0xA] strh r0, [r5, 0x38] adds r0, r5, 0 bl sub_80A68D4 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner adds r4, r0, 0 ldr r0, =0x02038437 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 .pool @080FF1AC: movs r0, 0 @080FF1AE: strh r0, [r5, 0x2E] ldr r0, =sub_80FF1C0 str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =0x0203841e 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, =sub_80FF2BC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 ldrb r0, [r0] bl sub_80A8328 lsls r0, 24 lsrs r0, 24 subs r0, 0x1 b @080FF346 .align 2, 0 .pool @080FF338: ldr r0, =0x02038437 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 .pool 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, =0x0203841e 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, =sub_80FF3B0 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FF374 thumb_func_start sub_80FF3B0 sub_80FF3B0: ; 80FF3B0 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203841e ldrh r1, [r0, 0xE] ldr r0, =0x0000ffff 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, =sub_80FF3EC str r0, [r4, 0x1C] @080FF3DA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool @080FF498: adds r0, r1, 0 movs r1, 0x1 bl sub_80A7270 ldr r0, =0x03005e00 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, =0x02038437 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, =0x0203841e 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, =sub_80FF53C 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 .pool 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, =0x03005e00 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, =0x02020630 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, =0x02038437 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, =sub_80FF5CC str r0, [r4] @080FF5B4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r1, [r0, 0xE] ldr r0, =0x0000ffff cmp r1, r0 bne @080FF660 ldr r0, =0x03005e00 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, =0x02020630 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 .pool @080FF660: ldr r1, =0x03005e00 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 .pool 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, =0x02038437 ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @080FF6C2 ldr r1, =0x0203841e 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, =0x0203841e 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 .pool @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, =0x02038436 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, =sub_80A70C0 str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 @080FF756: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x1 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldr r4, =0x0203841e 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, =sub_80FF8DC str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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, =0x02038437 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, =0x0203841e 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, =sub_80FF8DC str r0, [r1, 0x1C] ldr r1, =0x0203a0f8 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 .pool 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, =0x02038436 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 ldr r4, =0x0203841e 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 .pool 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, =sub_80FFA84 str r0, [r4, 0x1C] @080FFB0E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =0x02038436 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 .pool @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, =sub_80FFAB4 str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =sub_80FFAB4 b @080FFC62 .align 2, 0 .pool @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, =sub_80FFB90 @080FFC62: str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool 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, =0x02038436 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, =0x02038437 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 .pool @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, =sub_80FFD2C str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80FFA84 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 .pool 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, =0x0203841e ldrh r1, [r0, 0x2] strh r1, [r4, 0x30] movs r1, 0x78 strh r1, [r4, 0x20] adds r5, r0, 0 b @080FFE06 .align 2, 0 .pool @080FFDE4: ldr r0, =0x0203841e 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, =sub_80FFE58 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 .pool @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, =sub_80FFEC4 str r0, [r4, 0x1C] @080FFEBA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_80FFE58 thumb_func_start sub_80FFEC4 sub_80FFEC4: ; 80FFEC4 push {r4-r6,lr} adds r4, r0, 0 ldr r5, =gUnknown_08592700 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, =sub_80FFF7C 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 .pool @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, =0x03005e00 adds r5, r0, r1 ldr r4, =0x02038437 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, =gUnknown_08592778 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, =0x02020630 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, =sub_8100128 str r0, [r5] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r6, r0, r1 movs r0, 0xC ldrsh r1, [r6, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool @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, =0x02020630 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, =gUnknown_08592778 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, =0x03005e00 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, =sub_81005D4 str r0, [r5] @081005BA: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool thumb_func_end sub_81005D4 thumb_func_start sub_8100640 sub_8100640: ; 8100640 push {r4-r7,lr} adds r4, r0, 0 ldr r0, =0x0203841e movs r1, 0xC ldrsh r0, [r0, r1] cmp r0, 0 bne @0810065C ldr r0, =0x02038436 b @0810065E .align 2, 0 .pool @0810065C: ldr r0, =0x02038437 @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, =0x0203841e ldrh r0, [r1, 0x6] strh r0, [r4, 0x32] ldr r0, =0x0000fff0 b @08100698 .align 2, 0 .pool @08100688: movs r0, 0x1 strh r0, [r4, 0x36] ldr r1, =0x0203841e 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 .pool @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, =0x02038437 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, =sub_810074C str r0, [r4, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08329F40 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 .pool @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, =0x03005e00 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 .pool @081007E8: ldr r0, =0x0000274f 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, =0x000027b0 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 .pool @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, =gUnknown_08592878 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, =0x0203841e 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 .pool 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, =0x0203841e 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 .pool @081008B4: movs r3, 0 ldrsh r0, [r1, r3] cmp r0, 0 bne @081008C4 ldr r4, =0x02038436 b @081008C6 .align 2, 0 .pool @081008C4: ldr r4, =0x02038437 @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, =0x0203841e 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 .pool @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, =0xffff8000 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, =sub_81009A0 str r0, [r6, 0x1C] @0810098E: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08100A20 ldr r2, =0x0203841e ldrh r0, [r4, 0x20] ldrh r1, [r2] subs r0, r1 strh r0, [r4, 0x20] ldrh r0, [r2, 0x2] b @08100A2C .align 2, 0 .pool @08100A20: ldr r0, =0x0203841e 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, =sub_80A67D8 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81009F8 thumb_func_start sub_8100A50 sub_8100A50: ; 8100A50 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x02038436 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, =sub_81009DC str r0, [r5, 0x1C] ldr r4, =0x0203841e movs r0, 0 ldrsh r1, [r4, r0] adds r0, r5, 0 bl sub_80A6864 ldrh r0, [r4, 0x2] ldrh r1, [r5, 0x22] adds r0, r1 strh r0, [r5, 0x22] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8100A50 thumb_func_start sub_8100A94 sub_8100A94: ; 8100A94 push {r4,lr} adds r4, r0, 0 ldr r1, =0x0203841e 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, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A66DC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8100A94 thumb_func_start sub_8100AE0 sub_8100AE0: ; 8100AE0 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02038437 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, =sub_8100CCC str r0, [r5, 0x1C] ldr r0, =0x0203841e 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 .pool @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, =0xfffffc00 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 .pool 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, =0x0203841e 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 .pool @08100BA8: ldr r5, =0x02038437 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 .pool @08100BC8: ldr r5, =0x02038437 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 .pool @08100C24: ldr r4, =0x02038437 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, =0x02038437 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, =sub_8100CCC str r0, [r6, 0x1C] ldr r0, =0x0203841e 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 .pool @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, =0xfffffc00 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 .pool 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, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 movs r0, 0x3 strh r0, [r4, 0x2E] ldr r0, =sub_80A64B0 str r0, [r4, 0x1C] @08100D28: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool @08100D94: adds r1, r5, 0 adds r1, 0x3E ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] ldr r3, =0x02020630 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 .pool @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, =0x02020630 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 .pool thumb_func_end sub_8100D38 thumb_func_start sub_8100E1C sub_8100E1C: ; 8100E1C push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203841e ldrh r0, [r4, 0x4] strh r0, [r5, 0x2E] ldr r0, =0x02038436 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 .pool @08100E44: ldrh r0, [r4] ldrh r1, [r5, 0x20] adds r0, r1 @08100E4A: strh r0, [r5, 0x20] ldr r4, =0x0203841e 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, =sub_8100E80 str r1, [r5, 0x1C] adds r0, r5, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r1, 0x2] adds r0, 0x8 strh r0, [r1, 0x2] @08100F06: ldr r6, =0x02038436 ldrb r0, [r6] movs r1, 0 bl sub_80A60AC lsls r0, 24 ldr r4, =0x0203841e 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 .pool @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, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r5, 0x2E] ldr r0, =0x00002828 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, =sub_8100FD4 str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037b14 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 .pool @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, =sub_80A67F4 str r0, [r4, 0x1C] @081010C2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8100FD4 thumb_func_start sub_81010CC sub_81010CC: ; 81010CC push {r4-r6,lr} adds r4, r0, 0 ldr r6, =0x02038437 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, =0x0000ffe8 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, =sub_8101138 str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =@08101154 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203841e 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, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A656C str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810130C thumb_func_start sub_810135C sub_810135C: ; 810135C push {r4-r6,lr} adds r5, r0, 0 ldr r0, =0x0203841e movs r1, 0x4 ldrsh r0, [r0, r1] cmp r0, 0 bne @08101378 ldr r0, =0x02038436 b @0810137A .align 2, 0 .pool @08101378: ldr r0, =0x02038437 @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, =0x0203841e 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 .pool @081013C4: ldr r4, =0x0203841e 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 .pool @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, =0x0203841e movs r2, 0 ldrsh r1, [r0, r2] adds r0, r5, 0 bl sub_80A6864 @08101414: ldr r1, =0x0203841e 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, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A656C str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08101474 ldr r0, =0x0203841e 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 .pool @08101474: ldr r2, =0x0203841e 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, =sub_81014A0 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0810152C ldr r1, =0x0203841e 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 .pool @0810152C: ldr r2, =0x0203841e 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, =0x0000ffff strh r0, [r4, 0x34] adds r0, r4, 0 movs r1, 0x1 bl sub_8008258 @0810154A: ldr r0, =sub_8101560 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A64B0 str r1, [r0, 0x1C] ldr r1, =sub_81015D4 bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A64B0 str r0, [r5, 0x1C] ldr r1, =sub_81015D4 adds r0, r5, 0 bl oamt_set_x3A_32 b @0810166A .align 2, 0 .pool @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, =gUnknown_08592CD0 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =sub_8101684 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 .pool 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, =sub_80A64B0 str r0, [r2, 0x1C] ldr r1, =sub_81016B8 adds r0, r2, 0 bl oamt_set_x3A_32 b @081016B0 .align 2, 0 .pool @081016AC: ldr r0, =sub_81015D4 str r0, [r2, 0x1C] @081016B0: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A64B0 str r0, [r5, 0x1C] ldr r1, =sub_8101774 adds r0, r5, 0 bl oamt_set_x3A_32 b @08101760 .align 2, 0 .pool @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, =0x0000fff8 adds r7, r6, 0 b @08101718 .align 2, 0 .pool @08101700: ldr r7, =0x0000fff8 b @08101716 .align 2, 0 .pool @08101708: movs r7, 0x8 ldr r6, =0x0000fff8 b @08101718 .align 2, 0 .pool @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, =0x02038437 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =sub_8101820 adds r0, r5, 0 bl oamt_set_x3A_32 @08101760: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00007fff 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, =0x02037924 adds r0, r2 lsls r1, 4 ldr r3, =0x00000101 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 .pool @0810180C: cmp r0, 0 bne @08101814 ldr r0, =sub_8101820 str r0, [r4, 0x1C] @08101814: add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8101774 thumb_func_start sub_8101820 sub_8101820: ; 8101820 push {lr} adds r2, r0, 0 ldr r0, =0x0203841e ldrh r1, [r0, 0xE] ldr r0, =0x0000ffff cmp r1, r0 bne @08101838 movs r0, 0 strh r0, [r2, 0x30] strh r0, [r2, 0x2E] ldr r0, =sub_8101848 str r0, [r2, 0x1C] @08101838: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool @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, =0x000003ff adds r0, r4, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r3, 0x4] ldr r1, =sub_81015AC str r1, [r3, 0x1C] adds r0, r3, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool @0810196C: cmp r0, 0x2 beq @08101984 b @0810198C @08101972: ldr r0, =sub_8101998 b @0810198E .align 2, 0 .pool @0810197C: ldr r0, =sub_8101A74 b @0810198E .align 2, 0 .pool @08101984: ldr r0, =sub_8101AC4 b @0810198E .align 2, 0 .pool @0810198C: ldr r0, =sub_8101B84 @0810198E: str r0, [r3, 0x1C] pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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, =0x020241e4 ldrb r0, [r5] adds r0, r1 ldrb r0, [r0] strh r0, [r4, 0x34] ldr r1, =sub_81019E8 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A6630 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r4, =0x02038436 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, =0xfffffd00 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, =sub_8101B84 str r0, [r5, 0x1C] @08101A5E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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, =0x020241e4 ldrb r0, [r5] adds r0, r1 ldrb r0, [r0] strh r0, [r4, 0x34] ldr r1, =sub_8101B84 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A6630 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8101AE8 str r0, [r1, 0x1C] @08101ADE: pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r4, =0x02038436 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 .pool @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, =sub_8101B84 str r0, [r5, 0x1C] @08101B78: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8101BA0 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =0x020241e4 ldr r2, =0x02038436 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, =0xfffffe00 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 .pool @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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r5, r0, r1 ldr r1, =0x020241e4 ldr r2, =0x02038436 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, =0x0203841e 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 .pool @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, =sub_8101D2C b @08101D20 .align 2, 0 .pool @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, =sub_8101EEC @08101D20: str r0, [r5] @08101D22: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0xC ldrsh r0, [r4, r1] cmp r0, 0x4 bls @08101D46 b @08101EE6 @08101D46: lsls r0, 2 ldr r1, =@08101D58 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 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 .pool @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, =0x02020630 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 .pool @08101E34: ldr r2, =0x02020630 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 .pool @08101E54: ldr r2, =0x02020630 movs r0, 0x8 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r4, 0x10] strh r1, [r0, 0x24] movs r0, 0xC strh r0, [r4, 0xE] b @08101EA8 .align 2, 0 .pool @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, =0x02020630 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 .pool @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, =0x02020630 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 .pool @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, =0x03005e00 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 .pool @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, =0x0203841e movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 bne @08101F5C ldr r4, =0x02038436 b @08101F5E .align 2, 0 .pool @08101F5C: ldr r4, =0x02038437 @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, =sub_810208C adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8101F40 thumb_func_start sub_8101FA8 sub_8101FA8: ; 8101FA8 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldr r1, =0x0000ffd0 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, =sub_8102044 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67D8 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8101FA8 thumb_func_start sub_8101FF0 sub_8101FF0: ; 8101FF0 push {r4-r6,lr} adds r4, r0, 0 ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203841e ldr r2, =0x0000ffd0 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, =sub_810208C str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810207C adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A653C str r0, [r4, 0x1C] @0810206E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810208C str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 bne @081020F4 ldr r4, =0x02038436 b @081020F6 .align 2, 0 .pool @081020F4: ldr r4, =0x02038437 @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, =0x0203841e ldrh r0, [r0, 0x6] strh r0, [r5, 0x30] ldr r0, =sub_810213C str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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, =sub_81021CC str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r4] movs r1, 0 bl sub_80A5C6C lsls r0, 24 ldr r5, =0x0203841e 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, =0x0203841e ldrh r1, [r0, 0xE] ldr r0, =0x0000ffff cmp r1, r0 bne @081022C2 adds r0, r6, 0 bl move_anim_8072740 @081022C2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x0203841e ldr r0, =0x0000ffff strh r0, [r1, 0xE] b @0810233E .align 2, 0 .pool @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, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r4, 0x2E] ldr r0, =sub_810237C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 @081023CC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] lsls r0, 16 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 .pool 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, =0x0202406c ldrb r0, [r0] cmp r4, r0 bcs @08102490 ldr r6, =0x0203841e ldr r5, =0x03005d70 @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, =0x0202406c 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 .pool 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, =0x03005d70 adds r0, r4, r0 ldrb r0, [r0] bl sub_80729D0 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @081024C2: ldr r0, =0x0202406c 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 .pool 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, =0x0203841e 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, =sub_8102528 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 ldr r2, =0x0203841e 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, =sub_8102584 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff mov r1, r8 ands r1, r0 mov r8, r1 ldr r0, =0x03005e00 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, =0x000027d2 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, =0x000027d3 bl gpu_pal_tags_index_of lsls r0, 24 lsrs r0, 24 lsls r4, r0 mov r1, r10 orrs r4, r1 ldr r0, =0x00007fbb str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =sub_81026A8 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 .pool 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, =0x03005e00 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 .pool @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, =0x00007fbb 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, =0x02037b14 @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 .pool @08102794: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08102832 movs r2, 0 ldr r3, =0x02020630 movs r5, 0x14 adds r5, r3 mov r12, r5 ldr r7, =gUnknown_08592EBC mov r8, r7 ldr r6, =gUnknown_08592EEC 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 .pool @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, =0x00007fbb 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 .pool @08102820: ldr r0, =0x02037fd4 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 .pool thumb_func_end sub_81026A8 thumb_func_start sub_8102844 sub_8102844: ; 8102844 push {r4-r6,lr} adds r5, r0, 0 ldr r6, =0x0203841e 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, =0x02038437 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, =0xffffec00 b @081028FA .align 2, 0 .pool @081028D4: ldr r0, =0x02038436 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, =0xfffff600 bl __divsi3 strh r0, [r5, 0x38] b @08102958 .align 2, 0 .pool @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, =0xffffec00 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, =sub_810296C str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x00002771 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, =0x02020630 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, =0x02037714 @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, =0x02020630 movs r1, 0x1C adds r1, r7 mov r9, r1 b @08102A88 .align 2, 0 .pool @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, =sub_8102B3C 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, =sub_8102AE0 str r0, [r6] ldr r0, =0x02038436 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 .pool @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, =0x03005e00 adds r0, r1 movs r1, 0xE ldrsh r0, [r0, r1] cmp r0, 0 bne @08102B32 ldr r0, =0x02038436 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 .pool @08102B1C: movs r1, 0x80 lsls r1, 3 movs r0, 0 bl lcd_io_set_bits @08102B26: ldr r0, =0x00002771 bl gpu_pal_free_tag adds r0, r4, 0 bl move_anim_task_del @08102B32: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08102B80: ldr r4, =gUnknown_08329F40 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 .pool thumb_func_end sub_8102B3C thumb_func_start sub_8102BCC sub_8102BCC: ; 8102BCC push {r4,lr} adds r4, r0, 0 ldr r1, =move_anim_8072740 bl oamt_set_x3A_32 ldr r0, =sub_80A67D8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08593020 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, =0x02037b14 @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, =gUnknown_08593020 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, =0x02037b14 ldr r6, =gUnknown_08593020 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 .pool 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, =gUnknown_08593020 @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 .pool 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, =0x0203841e ldrb r1, [r4] adds r0, r5, 0 bl obj_anim_image_start ldr r2, =gUnknown_08593020 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 .pool @08102D34: ldr r4, =0x02038437 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, =sub_8102DE4 str r0, [r5, 0x1C] add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08593020 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 .pool thumb_func_end sub_8102DE4 thumb_func_start sub_8102EB0 sub_8102EB0: ; 8102EB0 push {r4-r7,lr} adds r6, r0, 0 ldr r7, =0x02038436 ldrb r0, [r7] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08102ECE ldr r1, =0x0203841e 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, =0x0203841e 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, =sub_8102F40 str r0, [r6, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool @08102FDC: ldr r6, =0x0000fff0 @08102FDE: ldr r4, =0x02038436 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, =sub_80A64B0 str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrb r1, [r5, 0x2] adds r0, r4, 0 bl obj_anim_image_start ldr r2, =gUnknown_08593020 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, =0x0000ffe0 @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, =sub_81030B0 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @08103180 ldr r0, =0x02038436 b @08103182 .align 2, 0 .pool @08103180: ldr r0, =0x02038437 @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, =0x0203841e 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, =sub_81031D0 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =move_anim_8072740 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, =sub_80A67D8 str r0, [r4, 0x1C] @081031F8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81031D0 thumb_func_start sub_8103208 sub_8103208: ; 8103208 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @08103224 ldr r0, =0x02038436 b @08103226 .align 2, 0 .pool @08103224: ldr r0, =0x02038437 @08103226: ldrb r0, [r0] adds r1, r4, 0 bl sub_810310C movs r0, 0 strh r0, [r4, 0x2E] ldr r1, =sub_8103250 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] @08103276: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8103250 thumb_func_start sub_8103284 sub_8103284: ; 8103284 push {r4-r6,lr} adds r4, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @081032A0 ldr r0, =0x02038436 b @081032A2 .align 2, 0 .pool @081032A0: ldr r0, =0x02038437 @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, =sub_8103300 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8103320 str r0, [r1, 0x1C] @08103316: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8103250 str r0, [r2, 0x1C] b @08103388 .align 2, 0 .pool @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, =gUnknown_08329F40 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 .pool thumb_func_end sub_8103320 thumb_func_start sub_8103390 sub_8103390: ; 8103390 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @081033AC ldr r0, =0x02038436 b @081033AE .align 2, 0 .pool @081033AC: ldr r0, =0x02038437 @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 .pool @081033D4: adds r0, r5, 0 movs r1, 0x1 bl obj_anim_image_start movs r0, 0x3 @081033DE: strh r0, [r5, 0x2E] ldr r0, =sub_81033F0 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810342C adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67D8 str r0, [r4, 0x1C] @0810341E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r1, =sub_80A6450 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8103448 thumb_func_start sub_8103498 sub_8103498: ; 8103498 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @081034B4 ldr r0, =0x02038436 b @081034B6 .align 2, 0 .pool @081034B4: ldr r0, =0x02038437 @081034B6: ldrb r0, [r0] adds r1, r4, 0 bl sub_810310C movs r0, 0 strh r0, [r4, 0x2E] strh r0, [r4, 0x30] ldr r0, =sub_81034D8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool thumb_func_end sub_810353C thumb_func_start sub_810358C sub_810358C: ; 810358C push {r4-r6,lr} adds r5, r0, 0 ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldr r1, =0x020241e4 ldr r0, =0x02038437 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, =0x0203841e ldrh r1, [r5, 0x20] ldrh r2, [r0] subs r1, r2 strh r1, [r5, 0x20] adds r1, r0, 0 b @081035EE .align 2, 0 .pool @081035E4: ldr r1, =0x0203841e 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, =sub_810353C 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 .pool 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, =0x0203841e 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, =sub_80A64B0 str r0, [r4, 0x1C] ldr r1, =sub_8103658 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A6EEC str r1, [r0, 0x1C] ldr r1, =sub_8103680 bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r0, =0x02038436 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] movs r1, 0 bl sub_80A7270 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81036DC str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r0, =0x02038436 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, =0x03005e00 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 .pool @08103718: ldr r2, =0x03005e00 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, =0x03005e00 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, =0x02020630 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 .pool @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, =0x02020630 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, =0x03005e00 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 .pool @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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08103804 ldr r0, =0x0203841e ldrh r1, [r4, 0x20] ldrh r2, [r0] subs r1, r2 strh r1, [r4, 0x20] adds r5, r0, 0 b @08103810 .align 2, 0 .pool @08103804: ldr r1, =0x0203841e 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, =0x02038436 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 .pool @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, =sub_80A67D8 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A67BC str r0, [r4, 0x1C] ldr r1, =sub_81038A0 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A6EEC str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] b @0810390E .align 2, 0 .pool @081038EC: ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810390E ldr r1, =0x0203841e 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, =0x02038437 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 ldr r6, =0x0203841e 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, =0xffffa000 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 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 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool @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, =sub_81039CC str r0, [r2, 0x1C] @08103A98: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =sub_8103A00 str r0, [r7, 0x1C] @08103BD4: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8103AA4 thumb_func_start sub_8103BE4 sub_8103BE4: ; 8103BE4 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005e00 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 .pool 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, =0x03005e00 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, =gUnknown_085933B0 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, =0x02020630 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 .pool @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, =0x03005e00 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, =sub_8103BE4 str r0, [r4] @08103CE0: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r2, r7, 2 adds r0, r2, r7 lsls r0, 3 adds r0, r1 movs r1, 0x2 strh r1, [r0, 0x10] ldr r3, =0x0203841e 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 .pool @08103D54: movs r0, 0x1 orrs r0, r1 strh r0, [r3, 0x4] b @08103DB6 @08103D5C: ldr r1, =0x02024076 ldr r0, =0x02038437 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, =0x03005e00 adds r0, r2, r7 lsls r0, 3 adds r0, r1 strh r3, [r0, 0x10] ldr r2, =0x0203841e 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 .pool @08103DB0: movs r0, 0x1 orrs r0, r1 @08103DB4: strh r0, [r2, 0x4] @08103DB6: ldr r5, =0x02038436 ldrb r0, [r5] movs r1, 0 bl sub_80A5C6C ldr r1, =0x03005e00 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, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08103E20 ldr r4, =0x02038437 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 .pool @08103E20: mov r5, sp ldr r4, =0x02038437 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, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 mov r2, sp ldr r3, =0x0203841e 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 .pool @08103E88: subs r0, r1, r2 @08103E8A: lsls r0, 16 lsrs r0, 16 lsls r4, r0, 16 asrs r4, 16 ldr r5, =0x0203841e 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, =0x03005e00 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 .pool @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, =0x03005e00 mov r3, r8 adds r0, r3, r7 lsls r0, 3 adds r5, r0, r1 ldr r4, =0x0203841e 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, =0x02038437 ldrb r0, [r0] bl sub_80A82E4 lsls r0, 24 lsrs r0, 24 ldr r2, =0x0000ffc0 adds r1, r2, 0 ldrh r4, [r4, 0x8] adds r1, r4 adds r0, r1 b @08103FB0 .align 2, 0 .pool @08103F78: lsls r0, r1, 16 asrs r0, 16 cmp r0, 0x3F ble @08103FA0 ldr r0, =0x02038437 ldrb r0, [r0] bl sub_80A82E4 lsls r0, 24 lsrs r0, 24 ldr r3, =0x0000ffc0 adds r1, r3, 0 ldrh r4, [r4, 0x8] adds r1, r4 adds r0, r1 b @08103FB0 .align 2, 0 .pool @08103FA0: ldr r0, =0x02038437 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, =0x03005e00 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, =sub_8103C0C 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 .pool 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, =gUnknown_085934A0 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, =sub_8104018 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037b14 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 .pool 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, =0x02038437 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, =0x0203841e lsrs r0, 24 ldrh r1, [r4, 0x6] adds r0, r1 lsls r0, 16 lsrs r7, r0, 16 ldr r0, =0x02038436 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, =sub_80A7000 str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8104088 thumb_func_start sub_810413C sub_810413C: ; 810413C ldr r1, =0x0000fff0 strh r1, [r0, 0x32] ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] ldr r1, =sub_8104154 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =0x02038436 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 .pool 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, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] ldr r0, =sub_80A6EEC 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, =sub_810421C adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fff4 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, =sub_81042A0 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 .pool 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, =0x02038436 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, =0x0203841e 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, =sub_80A62EC str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 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 .pool 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, =0x0000ffe0 movs r0, 0x10 mov r8, r0 ldr r6, =0x0000fff0 ldr r0, =0x0203841e 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, =0x02038437 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =sub_81043F8 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffe0 movs r2, 0x10 mov r9, r2 ldr r6, =0x0000fff0 ldr r7, =0x0203841e 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, =0x02038437 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, =sub_81044BC str r0, [r5, 0x1C] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fffe 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, =sub_8104530 str r0, [r4, 0x1C] @08104520: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8104594 str r0, [r4, 0x1C] @0810458A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0x50 strh r1, [r0, 0x8] ldr r1, =sub_8104614 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool 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, =0x03005e00 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, =0x02038436 ldrb r0, [r0] bl sub_80A82E4 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x16] ldr r0, =sub_81046CC str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0x5 bls @081046E6 b @081047F6 @081046E6: lsls r0, 2 ldr r1, =@081046F8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strh r1, [r0, 0x26] adds r0, r5, 0 bl move_anim_task_del @081047F6: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 adds r0, r1 bl obj_delete_but_dont_free_vram b @081048DA .align 2, 0 .pool @08104844: ldr r5, =0x02020630 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, =sub_81048F0 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 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 adds r4, r0, r1 ldr r5, =0x0203841e 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 .pool @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, =gUnknown_085935E8 adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_8104998 str r0, [r4] @0810498A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 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 .pool @08104A00: adds r0, r4, 0 bl sub_80A7D34 ldr r2, =0x02020630 movs r0, 0x8 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r4, 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 .pool @08104A34: movs r1, 0x10 ldrsh r0, [r4, r1] cmp r0, 0 beq @08104A5C ldr r2, =0x02020630 movs r0, 0x8 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [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 .pool @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, =0x02020630 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 .pool @08104A9C: ldrb r1, [r4, 0x8] ldr r2, =gUnknown_085935E8 adds r0, r4, 0 bl sub_80A7CFC strh r5, [r4, 0xA] @08104AA8: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_08593608 adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_8104AF0 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool thumb_func_end sub_8104AF0 thumb_func_start sub_8104B1C sub_8104B1C: ; 8104B1C push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x02038436 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 .pool @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, =0x0000ffc0 @08104B6A: strh r0, [r4, 0x30] ldr r0, =0x02038436 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, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A656C str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8104B1C thumb_func_start sub_8104BAC sub_8104BAC: ; 8104BAC push {r4-r6,lr} adds r6, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @08104BC8 ldr r0, =0x02038436 b @08104BCA .align 2, 0 .pool @08104BC8: ldr r0, =0x02038437 @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, =0x0203841e 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, =0x0203841e 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, =move_anim_8074EE0 adds r0, r6, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67BC str r0, [r6, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_085936A4 adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_8104C78 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 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, =0x02020630 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, =0x02038436 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, =sub_8104D28 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @08104D78: ldr r2, =0x02020630 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 .pool @08104DA4: cmp r0, 0x2 beq @08104E0C b @08104E6C @08104DAA: ldr r2, =0x02020630 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 .pool @08104DDC: ldr r2, =0x02020630 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 .pool @08104E0C: ldr r2, =0x02020630 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 .pool @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, =0x03005e00 adds r5, r1, r0 ldr r4, =0x02038437 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, =0x02022e18 ldrh r0, [r0] strh r0, [r5, 0x14] ldr r0, =0x04000014 b @08104EDC .align 2, 0 .pool @08104ED4: ldr r0, =0x02022e1c ldrh r0, [r0] strh r0, [r5, 0x14] ldr r0, =0x04000018 @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, =0x02038c28 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, =0xa2600001 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, =sub_8104F54 str r0, [r5] add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02038c28 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, =0x02039b28 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 .pool thumb_func_end sub_8104F54 thumb_func_start sub_810501C sub_810501C: ; 810501C push {r4-r6,lr} adds r4, r0, 0 ldr r6, =0x02038437 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, =sub_8105078 str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r3, 0x4 ldrsh r2, [r0, r3] adds r7, r1, 0 adds r1, r0, 0 cmp r2, 0 bne @081051F0 ldr r0, =0x02038436 b @081051F2 .align 2, 0 .pool @081051F0: ldr r0, =0x02038437 @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 .pool @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, =0x0203841e 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 .pool @08105260: ldr r1, =0x0203841e mov r0, sp ldrh r0, [r0] subs r0, r4 strh r0, [r1] @0810526A: ldr r1, =sub_80A77C8 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 .pool 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, =0x0203841e movs r2, 0xA ldrsh r0, [r0, r2] cmp r0, 0 bne @081052DC ldr r0, =0x02038436 ldrb r7, [r0] ldr r0, =0x02038437 b @081052E2 .align 2, 0 .pool @081052DC: ldr r0, =0x02038437 ldrb r7, [r0] ldr r0, =0x02038436 @081052E2: ldrb r0, [r0] mov r8, r0 ldr r0, =0x0203841e 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 .pool @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, =0x0203841e 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, =0x02020630 ldr r0, =0x020241e4 adds r0, r4, r0 b @081053EA .align 2, 0 .pool @0810535C: ldr r2, =0x02020630 ldr r0, =0x020241e4 add r0, r8 b @081053EA .align 2, 0 .pool @0810536C: adds r0, r7, 0 mov r1, r10 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203841e 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, =0x02020630 ldr r2, =0x020241e4 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 .pool @081053E0: adds r0, r6, 0 b @081053F4 @081053E4: ldr r2, =0x02020630 ldr r0, =0x020241e4 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, =0x0203841e 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 .pool @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, =0x0203841e ldrh r0, [r1, 0x6] ldrh r2, [r2] adds r0, r2 strh r0, [r3] adds r2, r1, 0 b @0810549E .align 2, 0 .pool @08105490: mov r3, sp mov r0, sp ldr r2, =0x0203841e 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, =sub_8105284 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 .pool thumb_func_end sub_81052A4 thumb_func_start sub_81054E8 sub_81054E8: ; 81054E8 push {r4,lr} adds r4, r0, 0 ldr r0, =0x000027db bl gpu_pal_tags_index_of lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @0810550E lsls r0, 20 ldr r1, =0x01010000 adds r0, r1 lsrs r0, 16 ldr r1, =0x0203841e 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, =sub_80A77C8 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 movs r1, 0xA0 cmp r0, 0 beq @08105554 ldr r1, =0x0000ff60 @08105554: movs r0, 0xE0 lsls r0, 2 strh r0, [r4, 0x2E] strh r1, [r4, 0x30] ldr r0, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r4, 0x3C] ldr r0, =sub_810557C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 movs r1, 0xA0 cmp r0, 0 beq @081055AC ldr r1, =0x0000ff60 @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, =sub_81055F4 str r0, [r4, 0x1C] @081055E0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810561C str r0, [r4, 0x1C] @08105612: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r4, 0x4] ldr r0, =sub_8105694 b @08105680 .align 2, 0 .pool @08105668: ldrh r2, [r4, 0x4] lsls r1, r2, 22 lsrs r1, 22 adds r1, 0x20 ldr r3, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r4, 0x4] ldr r0, =sub_810571C @08105680: str r0, [r4, 0x1C] @08105682: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81056D4 str r0, [r4, 0x1C] @081056CA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810571C str r0, [r4, 0x1C] @08105712: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81056D4 thumb_func_start sub_810571C sub_810571C: ; 810571C push {lr} adds r3, r0, 0 ldr r0, =0x0203841e ldrh r1, [r0, 0xE] ldr r0, =0x0000ffff 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, =sub_810575C b @08105752 .align 2, 0 .pool @08105750: ldr r0, =move_anim_8072740 @08105752: str r0, [r3, 0x1C] @08105754: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_085938B0 adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_81057B8 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool 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, =0x03005e00 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, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08105850 ldr r0, =0x0000ffff strh r0, [r4, 0x22] movs r0, 0x8 b @08105856 .align 2, 0 .pool @08105850: movs r0, 0x1 strh r0, [r4, 0x22] ldr r0, =0x0000fff8 @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, =sub_8105878 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @081058A0: cmp r4, 0x2 beq @08105948 cmp r4, 0x3 beq @08105962 b @08105992 @081058AA: ldr r2, =0x02020630 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 .pool @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, =0x02020630 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 .pool @08105904: ldr r2, =0x02020630 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 .pool @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, =0x02020630 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 .pool 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, =0x03005e00 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, =sub_81059E0 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @08105A3C: ldr r3, =0x02020630 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 .pool @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, =0x03005e00 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, =0x02038436 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, =sub_8105B08 str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_085938DC 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, =0x02020630 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, =gUnknown_085938F4 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 .pool @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, =0x03005e00 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 .pool 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, =0x000027de bl gpu_pal_tags_index_of mov r1, sp strb r0, [r1] movs r4, 0x1 ldr r0, =0x00002710 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, =0x020244d4 ldr r0, [r0] movs r2, 0xBE lsls r2, 1 adds r0, r2 str r1, [r0] ldr r0, =gUnknown_08C22610 bl call_LZZUnCompWram movs r4, 0 @08105D00: ldr r5, =0x020244d4 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 .pool 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, =gUnknown_08593950 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 .pool 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, =0x000003ff adds r0, r1, 0 ands r3, r0 ldr r0, =0xfffffc00 ands r0, r4 orrs r0, r3 strh r0, [r5, 0x4] ldr r0, =gUnknown_08593950 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 .pool 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, =0x02038436 ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08105E08 ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @08105E08: ldr r4, =0x0203841e 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 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 .pool 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, =0x02022e24 strh r6, [r1] ldr r4, =0x02022e26 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, =0x00003f1f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00003f3f 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 strh r5, [r0, 0x8] strh r6, [r0, 0xA] ldr r1, =sub_8105F30 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8105EB0 thumb_func_start sub_8105F30 sub_8105F30: ; 8105F30 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =sub_8105F84 str r0, [r3] b @08105F78 .align 2, 0 .pool @08105F70: ldr r1, =0x02022e24 lsls r0, r4, 8 orrs r2, r0 strh r2, [r1] @08105F78: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x00007fff movs r1, 0x10 bl sub_80A2A20 b @0810600C .align 2, 0 .pool @08105FD8: cmp r0, 0x4 ble @0810600C ldr r0, =0x02022e24 strh r4, [r0] ldr r0, =0x02022e26 strh r4, [r0] ldr r4, =0x00003f3f 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 .pool 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, =0x03005e00 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, =gUnknown_08593988 adds r0, r5, 0 bl sub_80A7CFC ldr r1, =0x02020630 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 .pool @0810607C: ldr r1, =0x02020630 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 .pool 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, =0x03005e00 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, =gUnknown_08593988 adds r0, r5, 0 bl sub_80A7CFC ldr r1, =0x02020630 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 .pool @0810610C: ldr r1, =0x02020630 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 .pool 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, =0x02038437 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, =sub_810618C str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool @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, =0x0203841e 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, =sub_80A64B0 str r1, [r0, 0x1C] ldr r1, =sub_810627C bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool 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, =0x00003f42 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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r4, =0x02022e1a 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, =gUnknown_08C232E0 mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r1, =gUnknown_08C23D78 mov r0, sp movs r2, 0 bl sub_80A6D60 ldr r0, =gUnknown_08C23D50 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81063A8 str r1, [r0] add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@081063D8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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 .pool @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, =0x00003f42 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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r4, =0x02022e1a 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, =gUnknown_08D93960 b @0810658A .align 2, 0 .pool @08106578: ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0810659C ldr r1, =gUnknown_08D93598 @0810658A: mov r0, sp movs r2, 0 bl sub_80A6D60 b @081065A6 .align 2, 0 .pool @0810659C: ldr r1, =gUnknown_08D9377C mov r0, sp movs r2, 0 bl sub_80A6D60 @081065A6: mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08C249F8 mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r0, =gUnknown_08C249D0 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81065EC str r1, [r0] add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@0810661C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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 .pool thumb_func_end sub_81065EC thumb_func_start sub_810673C sub_810673C: ; 810673C push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x02038436 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, =0x0203841e 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, =sub_810679C str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0xfffffc00 adds r0, r1, 0 ldrh r2, [r4, 0x32] adds r0, r2 strh r0, [r4, 0x32] ldr r3, =0xffffff00 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 .pool @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, =0x0203841e ldrh r1, [r0, 0xE] ldr r0, =0x0000ffff cmp r1, r0 bne @08106868 adds r0, r4, 0 bl move_anim_8072740 @08106868: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810679C thumb_func_start sub_8106878 sub_8106878: ; 8106878 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldr r4, =0x0203841e 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, =sub_81068CC str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldr r4, =0x0203841e 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, =sub_8106914 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810699C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool 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, =0x0203841e 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 .pool @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, =sub_8106A64 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 .pool 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, =0x0203841e 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, =0x02038437 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, =0x0000ffff 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 .pool @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, =0x0203841e 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 .pool @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, =0x0203841e 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 .pool @08106CEC: movs r2, 0 ldrsh r0, [r1, r2] cmp r0, 0 bne @08106CFC ldr r4, =0x02038436 b @08106CFE .align 2, 0 .pool @08106CFC: ldr r4, =0x02038437 @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, =0x0203841e 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 .pool @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, =sub_8106D5C str r0, [r5, 0x1C] @08106D50: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =0x03005e00 adds r4, r0 ldr r2, =gUnknown_08593B98 adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_8106DD4 str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool thumb_func_end sub_8106DD4 thumb_func_start sub_8106E00 sub_8106E00: ; 8106E00 push {r4-r7,lr} adds r5, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @08106E1C ldr r0, =0x02038436 b @08106E1E .align 2, 0 .pool @08106E1C: ldr r0, =0x02038437 @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, =0x0203841e 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, =0x0203841e 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r5, 0x4] ldr r0, =sub_8106EC8 str r0, [r5, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool 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, =0x0203841e 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, =sub_8107018 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 .pool 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, =sub_810703C str r0, [r1, 0x1C] @08107032: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @081070F8 ldr r4, =0x02038436 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 .pool @081070F8: ldr r4, =0x02038436 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81070AC thumb_func_start sub_8107144 sub_8107144: ; 8107144 push {lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x0203841e ldr r1, =0x02038400 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 .pool 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, =0x0203841e ldr r1, =0x02038400 ldr r1, [r1] ldrb r1, [r1, 0x10] strh r1, [r2, 0xE] bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x0203841e 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, =gUnknown_08595020 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 .pool thumb_func_end sub_8107188 thumb_func_start sub_810721C sub_810721C: ; 810721C ldr r1, =sub_8107228 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =0x02038436 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, =0x0203841e ldrh r1, [r4] subs r0, r1 b @081072A2 .align 2, 0 .pool @08107290: ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 ldr r4, =0x0203841e 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @081072D8 ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @081072D8: ldr r5, =0x0203841e ldrh r0, [r5, 0xC] strh r0, [r6, 0x2E] ldrh r0, [r6, 0x20] strh r0, [r6, 0x30] ldr r4, =0x02038437 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, =nullsub_12 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, =0x02020630 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, =sub_8107380 str r1, [r6, 0x1C] adds r0, r6, 0 bl _call_via_r1 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool @081073EC: ldr r0, =sub_8107408 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 .pool 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, =sub_80A67D8 str r1, [r0, 0x1C] ldr r1, =sub_8107430 bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8107408 thumb_func_start sub_8107430 sub_8107430: ; 8107430 push {lr} movs r1, 0xA strh r1, [r0, 0x2E] ldr r1, =sub_80A64B0 str r1, [r0, 0x1C] ldr r1, =move_anim_8074EE0 bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810747C ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 lsls r0, 16 lsrs r6, r0, 16 adds r7, r1, 0 b @08107482 .align 2, 0 .pool @0810747C: ldr r0, =0x0203841e 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, =0x02038437 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, =sub_81074E4 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 .pool thumb_func_end sub_810744C thumb_func_start sub_81074E4 sub_81074E4: ; 81074E4 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203841e ldrh r1, [r0, 0xE] ldr r0, =0x0000ffff 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 .pool thumb_func_end sub_81074E4 thumb_func_start sub_8107528 sub_8107528: ; 8107528 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 adds r4, r1 ldr r0, =0x0203841e ldrh r0, [r0] strh r0, [r4, 0x8] ldr r0, =0x0000279c 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, =sub_810756C str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02037b14 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 .pool 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, =0x02038437 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, =0x0203841e 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 .pool @0810765C: lsls r0, r1, 8 strh r0, [r5, 0x3A] @08107660: ldr r1, =sub_8107674 str r1, [r5, 0x1C] adds r0, r5, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r3, =0x0203841e ldrh r0, [r3] movs r2, 0 strh r0, [r1, 0x8] strh r2, [r3, 0xE] ldr r0, =sub_81076F4 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81076C8 thumb_func_start sub_81076F4 sub_81076F4: ; 81076F4 push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x0203841e ldrh r0, [r2, 0xE] adds r0, 0x3 movs r1, 0xFF ands r0, r1 strh r0, [r2, 0xE] ldr r1, =0x03005e00 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 .pool thumb_func_end sub_81076F4 thumb_func_start sub_8107730 sub_8107730: ; 8107730 push {r4-r7,lr} adds r4, r0, 0 ldr r7, =0x02038436 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, =0x0000fff6 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 .pool @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, =sub_81077A4 str r0, [r4, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r5] bl battle_side_get_owner adds r4, r0, 0 ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @0810780A ldr r4, =0x0203841e 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, =0x0203841e 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, =0x02038436 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, =0x02038437 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, =sub_80A6EEC str r0, [r6, 0x1C] ldr r1, =move_anim_8072740 adds r0, r6, 0 bl oamt_set_x3A_32 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =sub_80A6EEC str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8107894 thumb_func_start sub_81078D0 sub_81078D0: ; 81078D0 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203841e 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 .pool @081078EC: adds r0, r4, 0 movs r1, 0x1 bl sub_80A69CC @081078F4: ldr r0, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r4, 0x3C] ldr r0, =sub_810790C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00003f42 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, =0x02038436 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, =gUnknown_08D95E00 bl sub_80A6D48 b @081079EA .align 2, 0 .pool @081079D0: mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08D960D0 bl sub_80A6D48 b @081079EA .align 2, 0 .pool @081079E0: ldr r1, =gUnknown_08D963A4 mov r0, sp movs r2, 0x1 bl sub_80A6D60 @081079EA: mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08D94AB8 mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @08107A24 ldr r0, =gUnknown_08D95DD8 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette b @08107A32 .align 2, 0 .pool @08107A24: ldr r0, =gUnknown_08D8FB9C mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette @08107A32: ldr r0, =sub_8107D58 ldr r4, =0x03005e00 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, =0x0000ffb0 adds r0, r1, 0 ldr r2, =0x02022e18 strh r0, [r2] adds r1, 0x20 adds r0, r1, 0 ldr r2, =0x02022e1a 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 .pool @08107AB4: ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x1 bne @08107AF8 ldr r2, =0x0000ff20 adds r0, r2, 0 ldr r2, =0x02022e18 strh r0, [r2] movs r2, 0x80 lsls r2, 1 adds r0, r2, 0 ldr r2, =0x02022e1a strh r0, [r2] movs r0, 0x2 strh r0, [r6, 0x8] ldr r0, =0x0000ffff strh r0, [r6, 0xA] strh r1, [r7, 0xE] b @08107B0E .align 2, 0 .pool @08107AF8: ldr r0, =0x02022e18 strh r4, [r0] ldr r1, =0x0000ffd0 adds r0, r1, 0 ldr r2, =0x02022e1a strh r0, [r2] ldr r0, =0x0000fffe strh r0, [r6, 0x8] movs r0, 0x1 strh r0, [r6, 0xA] strh r4, [r7, 0xE] @08107B0E: ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 bl lcd_io_set ldr r2, =0x02022e1a ldrh r1, [r2] movs r0, 0x16 bl lcd_io_set ldr r1, =0x03005e00 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 .pool @08107B54: movs r0, 0 strh r0, [r1, 0x10] @08107B58: strh r0, [r1, 0x12] ldr r1, =0x03005e00 mov r2, r10 adds r0, r5, r2 lsls r0, 3 adds r0, r1 movs r1, 0x1 strh r1, [r0, 0x14] ldr r1, =sub_8107B84 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 .pool 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, =0x02022e18 ldr r2, =0x02022e1a ldr r0, =0x03005e00 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, =0x02037b14 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r2, [r0, 0x12] @08107C18: ldr r1, =0x03005e00 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, =sub_8107CC4 str r0, [r2] @08107CA8: add sp, 0x10 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e18 ldr r0, =0x02022e1a mov r8, r0 ldr r6, =0x03005e00 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 .pool @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, =0x0000ffff 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 .pool 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, =0x03005e00 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 .pool @08107D84: cmp r0, 0x2 bne @08107D8A b @08107F78 @08107D8A: b @08108022 @08107D8C: movs r3, 0 movs r2, 0x10 ldrsh r0, [r4, r2] ldr r1, =0x02038c28 mov r12, r1 cmp r3, r0 bge @08107DCA mov r7, r12 movs r5, 0xF0 lsls r5, 3 add r5, r12 ldr r6, =0x0000ffff @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, =0x02038c28 movs r0, 0xF0 lsls r0, 3 adds r6, r5, r0 ldr r7, =0x0000ffff @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, =0x02038c28 movs r0, 0xF0 lsls r0, 3 adds r6, r5, r0 ldr r7, =0x0000ffff @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 .pool @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, =0x04000052 str r0, [sp] ldr r0, =0xa2600001 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 .pool @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, =0x02038c28 ldr r5, =0x02039b28 @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, =0x02038c28 ldr r5, =0x02039b28 @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, =0x02038c28 ldr r5, =0x02039b28 @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 .pool @08107F78: movs r3, 0 movs r1, 0x10 ldrsh r0, [r4, r1] cmp r3, r0 bge @08107FAC ldr r6, =0x02038c28 ldr r5, =0x02039b28 @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, =0x02038c28 ldr r5, =0x02039b28 @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, =0x02038c28 ldr r5, =0x02039b28 @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 .pool 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 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, =0x000001ff 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, =sub_8108098 str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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, =sub_8108140 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x7 bls @0810815C b @0810837A @0810815C: lsls r0, 2 ldr r1, =@08108170 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 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 .pool @08108200: ldr r2, =0x02020630 movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000fffd 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, =0x02020630 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 .pool @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, =0x02020630 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 .pool @081082D8: ldr r2, =0x02020630 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 .pool @08108320: ldr r6, =0x02020630 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 .pool @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, =0x02038436 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @081083B8 ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec b @081083C8 .align 2, 0 .pool @081083B4: adds r0, r2, 0 b @081083FA @081083B8: ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 @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 .pool 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, =0x02038436 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, =gUnknown_08595268 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, =0x02020630 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 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 adds r4, r1, r0 bl sub_8108384 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0xA] ldr r0, =0x02038436 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 .pool @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, =sub_810862C str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x0203841e 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, =sub_81152DC 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, =0x020383fe 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, =0x020383fe 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 .pool @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, =gUnknown_08329F40 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, =gUnknown_08595268 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, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r3, 0 adds r1, 0x1C adds r1, r0, r1 ldr r2, =sub_81087C0 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, =0x41c64e6d muls r0, r1 ldr r1, =0x00003039 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 .pool 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, =0x03005e00 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, =gUnknown_08597388 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, =0x02020630 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, =sub_810886C 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 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 adds r5, r1, r0 ldr r4, =0x02038436 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, =0x0000ffe0 strh r0, [r5, 0x1A] strh r6, [r5, 0xA] strh r6, [r5, 0x8] ldr r0, =sub_8108978 str r0, [r5] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x6 bls @08108992 b @08108AB2 @08108992: lsls r0, 2 ldr r1, =@081089A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08595268 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, =0x02020630 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, =sub_8108B2C 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 .pool 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, =0x0000fff0 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, =sub_8108B94 str r0, [r6, 0x1C] @08108B86: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 @08108BA6: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r2, r0, r6 ldr r1, [r2] ldr r0, =sub_8108978 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 .pool thumb_func_end sub_8108B94 thumb_func_start sub_8108BE0 sub_8108BE0: ; 8108BE0 ldr r2, =0x0203841e 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, =sub_8108C08 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =0x02038437 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, =0x0203841e ldrh r0, [r1, 0x4] strh r0, [r4, 0x34] ldrh r0, [r1, 0x6] strh r0, [r4, 0x36] ldr r0, =sub_8108CDC str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08595310 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, =0x02020630 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, =0x02038436 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 .pool @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, =gUnknown_08595310 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, =0x02020630 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, =0x02038436 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 .pool @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, =0x0203841e 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, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r1, =sub_80A634C str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8108EC8 thumb_func_start sub_8108F08 sub_8108F08: ; 8108F08 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e 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, =sub_80A656C str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08108F88 ldr r2, =0x0203841e 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 .pool @08108F88: ldr r1, =0x0203841e 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, =sub_8109028 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8108F4C thumb_func_start sub_8108FBC sub_8108FBC: ; 8108FBC push {r4,lr} adds r4, r0, 0 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08108FF0 ldr r2, =0x0203841e 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 .pool @08108FF0: ldr r1, =0x0203841e 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, =sub_8109028 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08109090 ldr r0, =0x0203841e ldrh r1, [r4, 0x20] ldrh r2, [r0] subs r1, r2 strh r1, [r4, 0x20] b @081090A2 .align 2, 0 .pool @08109090: ldr r0, =0x0203841e 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, =sub_81090D8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00002710 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, =0xffffff00 b @08109154 .align 2, 0 .pool @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, =sub_80A6EEC str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810916C thumb_func_start sub_8109198 sub_8109198: ; 8109198 push {r4-r6,lr} adds r6, r0, 0 ldr r5, =0x02038436 ldrb r0, [r5] bl battle_side_get_owner adds r4, r0, 0 ldr r0, =0x02038437 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, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @081091DE: ldr r1, =sub_80A7938 str r1, [r6, 0x1C] adds r0, r6, 0 bl _call_via_r1 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8109198 thumb_func_start sub_8109200 sub_8109200: ; 8109200 ldr r2, =0x0203841e ldrh r1, [r2] negs r1, r1 strh r1, [r2] ldrh r1, [r2, 0x4] negs r1, r1 strh r1, [r2, 0x4] ldr r1, =sub_80A7938 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r0, 0x4] movs r1, 0 strh r0, [r4, 0x3C] strh r1, [r4, 0x2E] ldr r0, =sub_8109244 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =sub_810929C str r0, [r5, 0x1C] @0810928E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =sub_8109314 str r1, [r6, 0x1C] adds r0, r6, 0 bl _call_via_r1 b @0810930E .align 2, 0 .pool @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, =0x0203841e 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, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A653C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =sub_80A64B0 str r0, [r4, 0x1C] ldr r1, =sub_81093E4 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810940C str r1, [r0, 0x1C] bl _call_via_r1 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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, =0x02038436 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, =sub_81094D0 str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x6 bls @081094EC b @081097AA @081094EC: lsls r0, 2 ldr r1, =@08109500 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 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 .pool @08109578: ldr r2, =0x02020630 movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000fffd @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, =0x02020630 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, =0x02020630 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 .pool @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, =0x02020630 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 .pool @081096AC: ldr r2, =0x02020630 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 .pool @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, =0x02020630 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 .pool @08109748: movs r1, 0x12 ldrsh r0, [r4, r1] cmp r0, 0 beq @08109764 ldr r2, =0x02020630 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, =0x02020630 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 .pool @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, =0x02020630 lsls r0, r4, 4 adds r0, r4 lsls r0, 2 adds r0, r1 ldrh r4, [r0, 0x20] ldr r0, =0x02038436 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 .pool @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, =gUnknown_085955CC mov r9, r2 lsls r0, 24 asrs r0, 24 str r0, [sp] mov r3, r8 lsls r3, 1 mov r10, r3 @08109834: ldr r0, =gUnknown_085955B4 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, =0x02020630 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r3, =0xfffffc00 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, =gUnknown_085955CE 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, =0x03005e08 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 .pool 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, =0x03005e00 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 .pool thumb_func_end sub_81098EC thumb_func_start sub_8109930 sub_8109930: ; 8109930 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 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, =0x02038436 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 .pool @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, =0x0203841e 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, =0x000003ff adds r1, r3, 0 ands r2, r1 ldr r1, =0xfffffc00 ands r1, r4 orrs r1, r2 strh r1, [r0, 0x4] ldr r1, =sub_8109A64 str r1, [r0, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fffd b @08109ADE .align 2, 0 .pool @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, =0x0203841e ldrb r1, [r4, 0x4] adds r0, r5, 0 bl obj_anim_image_start ldrh r0, [r4, 0x4] strh r0, [r5, 0x3C] ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08109B48 movs r0, 0x4 b @08109B4A .align 2, 0 .pool @08109B48: ldr r0, =0x0000fffc @08109B4A: strh r0, [r5, 0x36] ldr r0, =0x02038437 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 .pool @08109B70: ldrh r0, [r5, 0x30] adds r0, 0xC0 strh r0, [r5, 0x30] ldr r0, =0x02038436 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 .pool @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, =0x02038437 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, =sub_8109C4C str r0, [r5, 0x1C] @08109C3E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038440 movs r1, 0 ldrsb r1, [r0, r1] movs r0, 0x90 bl audio_play_and_stuff b @08109CAA .align 2, 0 .pool @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, =0x0203841e 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, =0x02038437 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 .pool @08109D3C: ldr r0, =0x02038437 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 .pool @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, =0x03005e00 adds r4, r1, r0 ldr r0, =0x02038436 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, =0x02038437 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, =sub_8109E2C str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x0000fffe @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, =0x02020630 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 .pool @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, =0x0000fffe @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, =0x02020630 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 .pool @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, =0x0000fffe 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, =0x02020630 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 .pool @0810A010: movs r1, 0 strh r1, [r2, 0xE] movs r3, 0x22 ldrsh r0, [r2, r3] cmp r1, r0 bge @0810A04E ldr r6, =0x02020630 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 .pool 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, =0x0203841e 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 .pool 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, =0x03005e00 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, =0x0203841e 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, =0x020241e4 ldr r0, =0x02038437 ldrb r0, [r0] adds r0, r1 ldrb r6, [r0] movs r5, 0x10 ldrsh r0, [r2, r5] cmp r0, 0 bne @0810A100 ldr r4, =gUnknown_08595684 movs r1, 0x8 ldrsh r0, [r2, r1] b @0810A106 .align 2, 0 .pool @0810A100: ldr r4, =gUnknown_08595694 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, =0x02020630 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 .pool @0810A154: ldr r3, =0x02020630 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 .pool thumb_func_end sub_810A094 thumb_func_start sub_810A1A8 sub_810A1A8: ; 810A1A8 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810A1D0 ldr r0, =0x0203841e ldrh r1, [r4, 0x20] ldrh r2, [r0] subs r1, r2 strh r1, [r4, 0x20] b @0810A1DC .align 2, 0 .pool @0810A1D0: ldr r1, =0x0203841e 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, =sub_810A1F8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810A23C ldr r0, =0x0203841e ldrh r1, [r4, 0x20] ldrh r0, [r0] subs r1, r0 strh r1, [r4, 0x20] b @0810A246 .align 2, 0 .pool @0810A23C: ldr r0, =0x0203841e ldrh r0, [r0] ldrh r1, [r4, 0x20] adds r0, r1 strh r0, [r4, 0x20] @0810A246: ldr r0, =sub_810A258 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810A2C4 ldr r2, =0x0203841e 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 .pool @0810A2C4: ldr r0, =0x0203841e 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, =move_anim_8074EE0 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A62EC str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810A274 thumb_func_start sub_810A308 sub_810A308: ; 810A308 push {r4-r7,lr} adds r5, r0, 0 ldr r0, =0x0203841e 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 .pool @0810A324: cmp r0, 0x2 beq @0810A338 cmp r0, 0x3 beq @0810A35C b @0810A380 @0810A32E: ldr r0, =0x02038436 b @0810A382 .align 2, 0 .pool @0810A338: ldr r4, =0x02038436 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 .pool @0810A354: ldrb r0, [r4] adds r4, r6, 0 eors r4, r0 b @0810A384 @0810A35C: ldr r0, =0x02038436 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, =0x02038437 ldrb r0, [r0] eors r4, r0 b @0810A384 .align 2, 0 .pool @0810A380: ldr r0, =0x02038437 @0810A382: ldrb r4, [r0] @0810A384: ldr r0, =0x0203841e 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 .pool @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, =gUnknown_08329F40 ldr r6, =0x0203841e 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, =0x02021bc0 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, =sub_810E2C8 str r0, [r5, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r5, 0x6] strh r0, [r4, 0x2E] ldrh r0, [r4, 0x20] strh r0, [r4, 0x30] ldr r6, =0x02038437 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r4, 0x4] ldr r1, =sub_810A4F4 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0810A5E0 @0810A5D8: ldr r1, =0x0203841e ldrh r0, [r1, 0x2] negs r0, r0 strh r0, [r1, 0x2] @0810A5E0: ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 ldr r4, =0x0203841e 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, =sub_810A56C str r0, [r6, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810A5BC thumb_func_start sub_810A628 sub_810A628: ; 810A628 push {r4-r6,lr} adds r5, r0, 0 ldr r1, =0x0203841e 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, =0x02038437 b @0810A64E .align 2, 0 .pool @0810A64C: ldr r0, =0x02038436 @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, =0x0203841e 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, =0x0203841e 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, =0x00007fff 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r5, 0x4] ldr r1, =sub_810A6EC str r1, [r5, 0x1C] adds r0, r5, 0 bl _call_via_r1 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r5, 0x6 ldrsh r0, [r3, r5] lsls r0, 2 adds r1, r0 ldr r5, =0x000003ff adds r0, r5, 0 ands r1, r0 ldr r0, =0xfffffc00 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 .pool @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, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r4, 0x2E] ldr r0, =sub_80A64B0 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 ldrb r0, [r6] movs r1, 0 bl sub_80A5C6C ldr r1, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r1 lsls r0, 24 ldr r5, =0x0203841e 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, =sub_810A834 str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =@0810A8A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08595828 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 .pool @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, =gUnknown_08595828 lsls r1, r4, 16 asrs r1, 16 lsls r2, r6, 16 asrs r2, 16 b @0810A952 .align 2, 0 .pool @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, =gUnknown_08595828 lsls r1, r4, 16 asrs r1, 16 lsls r2, r6, 16 asrs r2, 16 b @0810A952 .align 2, 0 .pool @0810A93C: mov r1, r12 lsls r0, r1, 16 asrs r0, 16 lsls r3, r0, 2 adds r3, r0 @0810A946: ldr r0, =gUnknown_08595828 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 .pool @0810A970: mov r0, r9 bl move_anim_task_del b @0810A9BC @0810A978: cmp r7, 0 beq @0810A9AC ldr r4, =0x02020630 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, =0x000003ff adds r1, r6, 0 ands r2, r1 ldr r1, =0xfffffc00 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, =0x03005e00 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 .pool 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, =0x0203841e 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, =gUnknown_08595840 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, =0x02020630 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, =0x000003ff adds r0, r7, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r5 orrs r0, r1 strh r0, [r6, 0x4] ldr r1, =0x020383fe ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] adds r3, 0x1C adds r2, r3 ldr r0, =sub_810AAB0 str r0, [r2] str r0, [r4, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r5, r1, r0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0810AB28 ldr r4, =0x02038436 b @0810AB2A .align 2, 0 .pool @0810AB28: ldr r4, =0x02038437 @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, =0x0203841e 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, =sub_810AB78 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_085958A8 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, =0x02020630 adds r4, r0 ldr r1, =gUnknown_08595858 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, =sub_810ACC0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67D8 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 .pool @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, =0x03005e00 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 .pool 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, =sub_810AC8C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810ACC0 thumb_func_start sub_810ACD8 sub_810ACD8: ; 810ACD8 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0810ACF4 ldr r4, =0x02038436 b @0810ACF6 .align 2, 0 .pool @0810ACF4: ldr r4, =0x02038437 @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, =move_anim_8074EE0 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67BC str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810ACD8 thumb_func_start sub_810AD30 sub_810AD30: ; 810AD30 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0810AD4C ldr r4, =0x02038436 b @0810AD4E .align 2, 0 .pool @0810AD4C: ldr r4, =0x02038437 @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, =0x0203841e ldrh r0, [r1, 0x2] strh r0, [r5, 0x24] ldrh r0, [r1, 0x4] strh r0, [r5, 0x26] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] 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, =sub_810ADF8 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool 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, =0x03005e00 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 .pool @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, =0x02038436 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, =0x0000ffe0 strh r0, [r5, 0x24] movs r0, 0x2 b @0810AED2 .align 2, 0 .pool @0810AECC: movs r0, 0x20 strh r0, [r5, 0x24] ldr r0, =0x0000fffe @0810AED2: strh r0, [r5, 0x22] ldr r2, =0x02020630 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 .pool @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, =0x02020630 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 .pool @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, =0x02020630 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 .pool @0810AFA0: ldr r2, =0x02020630 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 .pool 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, =0x03005e00 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 .pool @0810AFF4: cmp r0, 0x2 bne @0810AFFA b @0810B140 @0810AFFA: b @0810B14E @0810AFFC: ldr r4, =0x02038436 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, =0x0203841e 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, =0x0000fff0 b @0810B0B0 .align 2, 0 .pool @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, =0x02038437 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 .pool @0810B0A8: ldr r0, =0x0000fff0 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 .pool @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, =0x0000ffff strh r0, [r5, 0xA] movs r0, 0x3 strh r0, [r5, 0x14] b @0810B138 .align 2, 0 .pool @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, =gUnknown_08595A00 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, =0x02020630 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 .pool @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, =0x03005e00 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 .pool 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, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] 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 .pool @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, =0x03005e00 adds r5, r0, r1 movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0x4 bls @0810B2B6 b @0810B428 @0810B2B6: lsls r0, 2 ldr r1, =@0810B2C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0810B2C8: .4byte @0810B2DC .4byte @0810B36C .4byte @0810B3A8 .4byte @0810B404 .4byte @0810B414 @0810B2DC: ldr r4, =0x02038436 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, =0x02038437 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, =0x0000ffff 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 .pool @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, =0x0000ffff 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 .pool @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, =gUnknown_08595A30 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, =0x02020630 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, =0x000003ff adds r0, r6, 0 ands r1, r0 ldr r0, =0xfffffc00 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 .pool @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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool @0810B584: cmp r0, 0x2 beq @0810B600 b @0810B60E @0810B58A: ldr r0, =0x02038437 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, =0x02038437 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 .pool @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, =gUnknown_085956C0 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, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r3, 0 adds r1, 0x1C adds r1, r0, r1 ldr r2, =sub_810B684 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 .pool @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, =0x03005e00 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 .pool 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r5, 0x4] ldr r4, =0x02038437 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, =0x02038436 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, =0x0203841e 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, =0x0203841e 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 .pool @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, =sub_810B848 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 .pool 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, =0x0203841e 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, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r1, =sub_80A634C str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 ldrb r0, [r0] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810B92C ldr r0, =0x0203841e ldrh r1, [r4, 0x32] ldrh r0, [r0, 0x4] subs r1, r0 strh r1, [r4, 0x32] b @0810B936 .align 2, 0 .pool @0810B92C: ldr r0, =0x0203841e ldrh r0, [r0, 0x4] ldrh r1, [r4, 0x32] adds r0, r1 strh r0, [r4, 0x32] @0810B936: ldr r0, =0x02038437 ldrb r0, [r0] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 ldr r1, =0x0203841e lsrs r0, 24 ldrh r2, [r1, 0x6] adds r0, r2 strh r0, [r4, 0x36] ldrh r0, [r1, 0x8] strh r0, [r4, 0x2E] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A6EEC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810B8EC thumb_func_start sub_810B974 sub_810B974: ; 810B974 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e 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 .pool @0810B990: ldr r0, =0x02038437 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, =0x02038436 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, =sub_810B9E8 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =0x02038437 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 .pool @0810BA74: ldr r0, =0x02038437 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810BAAC ldr r0, =0x0203841e ldrh r1, [r5, 0x32] ldrh r0, [r0, 0x4] subs r1, r0 strh r1, [r5, 0x32] b @0810BAB6 .align 2, 0 .pool @0810BAAC: ldr r0, =0x0203841e 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, =sub_80A718C ldr r1, =sub_810BB60 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 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x0000ffec 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, =sub_810BBC8 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810BB60 thumb_func_start sub_810BBC8 sub_810BBC8: ; 810BBC8 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x0000ffec 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 .pool @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, =sub_810BC4C str r0, [r4, 0x1C] @0810BC42: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =0x02038437 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 .pool @0810BCE0: ldr r0, =0x02038437 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810BD1C ldr r0, =0x0203841e ldrh r1, [r5, 0x32] ldrh r2, [r0, 0x4] subs r1, r2 strh r1, [r5, 0x32] adds r1, r0, 0 b @0810BD26 .align 2, 0 .pool @0810BD1C: ldr r1, =0x0203841e 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, =0x0203841e ldr r6, =sub_810BDD8 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 .pool 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, =0x0203841e 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 .pool @0810BE6C: ldr r0, =0x02038437 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, =0x02038436 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 .pool @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, =0x0203841e 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 .pool @0810BEF4: ldr r4, =0x02038436 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 .pool @0810BF20: ldrh r0, [r6] ldrh r1, [r5, 0x20] adds r0, r1 @0810BF26: strh r0, [r5, 0x20] ldr r0, =0x0203841e ldrh r0, [r0, 0x2] ldrh r1, [r5, 0x22] adds r0, r1 strh r0, [r5, 0x22] @0810BF32: ldr r0, =0x02038436 b @0810BF90 .align 2, 0 .pool @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, =0x02038437 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 .pool @0810BF7C: ldrh r0, [r6] ldrh r1, [r5, 0x20] adds r0, r1 @0810BF82: strh r0, [r5, 0x20] ldr r0, =0x0203841e ldrh r0, [r0, 0x2] ldrh r1, [r5, 0x22] adds r0, r1 strh r0, [r5, 0x22] @0810BF8E: ldr r0, =0x02038437 @0810BF90: ldrb r0, [r0] strh r0, [r5, 0x3C] ldr r0, =0x0203841e 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 .pool @0810BFB4: movs r0, 0x40 @0810BFB6: strh r0, [r5, 0x3A] ldr r0, =0x02038437 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, =0x0203841e 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, =sub_810C008 str r1, [r5, 0x1C] adds r0, r5, 0 bl _call_via_r1 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00003f42 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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r4, =0x02022e1a 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, =gUnknown_0854CAD0 movs r2, 0x80 lsls r2, 4 mov r3, sp ldrh r3, [r3, 0xA] bl gpu_copy_bg_tile_pattern_data_to_vram ldr r1, =gUnknown_08D932E0 mov r0, sp movs r2, 0 bl sub_80A6D60 ldr r0, =gUnknown_0854C270 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_810C164 str r1, [r0] add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e18 ldr r2, =0x0000ffff adds r0, r2, 0 ldrh r2, [r1] adds r0, r2 strh r0, [r1] ldr r1, =0x03005e00 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, =@0810C1A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08595C5C 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 .pool @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, =0x03005e00 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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a 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 .pool thumb_func_end sub_810C164 thumb_func_start sub_810C2F0 sub_810C2F0: ; 810C2F0 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x02038436 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, =sub_80A7820 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00003f42 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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r4, =0x02022e1a 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, =gUnknown_0854CAD0 movs r2, 0x80 lsls r2, 4 mov r3, sp ldrh r3, [r3, 0xA] bl gpu_copy_bg_tile_pattern_data_to_vram ldr r1, =gUnknown_08D932E0 mov r0, sp movs r2, 0 bl sub_80A6D60 ldr r0, =gUnknown_0854C270 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =0x0000ffff strh r1, [r0, 0x26] ldr r1, =sub_810C3F0 str r1, [r0] add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e18 ldr r3, =0x03005e00 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, =@0810C42C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08595C88 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 .pool @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, =0x03005e00 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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a 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 .pool 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, =0x0203841e ldrh r0, [r6] strh r0, [r5, 0x2E] ldr r0, =0x02038436 mov r8, r0 ldrb r0, [r0] movs r1, 0x2 bl sub_80A5C6C adds r4, r0, 0 ldr r7, =0x02038437 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, =0x02024076 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, =0x02020630 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, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldr r6, =0x0203841e 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, =0x02038437 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 .pool @0810C65C: ldrh r0, [r6, 0x2] ldrh r1, [r5, 0x20] adds r0, r1 strh r0, [r5, 0x30] ldr r4, =0x02038437 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, =sub_810C6D4 str r0, [r5, 0x1C] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08329F40 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 .pool @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, =0x02038437 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, =0x02024076 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 .pool @0810C78C: strh r5, [r4, 0x38] @0810C78E: movs r0, 0 strh r0, [r4, 0x26] ldr r1, =gUnknown_08329F40 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 .pool @0810C7BC: adds r0, r4, 0 bl sub_80A6F3C ldr r1, =gUnknown_08329F40 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 .pool @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, =0x02024076 ldr r0, =0x02038437 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 .pool @0810C8B4: ldr r0, =0x0000fff0 @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 .pool @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, =0x020383fe ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] @0810C90C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r1, r0 ldr r0, =sub_810C934 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_08595CB4 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 .pool @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, =gUnknown_08595D2C 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, =0x02020630 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 .pool @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, =gUnknown_08595B68 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, =0x02020630 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, =sub_810CC3C 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 .pool @0810CC04: ldr r3, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool thumb_func_end sub_810CC3C thumb_func_start unc_080B06FC unc_080B06FC: ; 810CC88 push {r4-r6,lr} adds r5, r0, 0 ldr r0, =0x02038400 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, =0x0203841e ldrh r0, [r6, 0x8] strh r0, [r5, 0x2E] ldr r0, =0x02038436 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, =0x02038437 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r1, [r6, 0x4] adds r0, r1 strh r0, [r5, 0x32] ldrb r0, [r4] 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, =sub_810CD1C str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A67D8 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 @0810CD3E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 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, =0x000001ff 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, =sub_810CDB0 str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrb r3, [r1] lsls r3, 1 adds r3, r1 ldr r1, =0x02038400 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 .pool thumb_func_end sub_810CDFC thumb_func_start unc_080B08A0 unc_080B08A0: ; 810CE2C push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e 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, =sub_80A64B0 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end unc_080B08A0 thumb_func_start sub_810CE68 sub_810CE68: ; 810CE68 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203841e movs r1, 0xE ldrsh r0, [r4, r1] cmp r0, 0x1 bne @0810CE90 ldr r0, =0x02038436 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, =0x0203841e 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 .pool 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, =0x0203841e 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 .pool thumb_func_end sub_810CEB4 thumb_func_start sub_810CEE0 sub_810CEE0: ; 810CEE0 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203841e 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 .pool @0810CF04: adds r0, r5, 0 movs r1, 0x1 bl sub_80A6980 @0810CF0C: ldr r0, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r5, 0x2E] ldr r0, =sub_80A64B0 str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r2, 0 ldrsh r1, [r0, r2] mov r9, r0 cmp r1, 0 bne @0810CF54 ldr r0, =0x02038436 b @0810CF56 .align 2, 0 .pool @0810CF54: ldr r0, =0x02038437 @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, =0x02024076 add r0, r8 ldrb r1, [r0] adds r0, r7, 0 ands r0, r1 cmp r0, 0 bne @0810D028 lsls r0, r4, 16 ldr r1, =0xfff00000 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, =gUnknown_08597358 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, =0x02020630 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, =nullsub_12 str r1, [r0] @0810D08C: ldr r0, =sub_810D0B8 str r0, [r5, 0x1C] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool @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, =0x0203841e 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 .pool @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, =sub_80A6EEC str r0, [r4, 0x1C] ldr r1, =sub_810D164 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 @0810D1A4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810D164 thumb_func_start sub_810D1B4 sub_810D1B4: ; 810D1B4 push {r4-r6,lr} adds r6, r0, 0 ldr r0, =0x02038436 ldrb r1, [r0] movs r0, 0x2 ldr r2, =0x02038437 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, =0x0203841e 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810D1FE ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @0810D1FE: ldr r4, =0x0203841e 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, =sub_810D240 str r0, [r6, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrb r1, [r5, 0x4] adds r0, r4, 0 bl obj_anim_image_start ldrh r0, [r5, 0x6] strh r0, [r4, 0x2E] ldr r0, =sub_80A64B0 str r0, [r4, 0x1C] ldr r1, =sub_810D2B0 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A64B0 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r4, 0x2E] ldr r0, =sub_810D308 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =sub_810D360 adds r0, r5, 0 bl oamt_set_x3A_32 @0810D34C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810D308 thumb_func_start sub_810D360 sub_810D360: ; 810D360 push {lr} movs r1, 0xF strh r1, [r0, 0x2E] ldr r1, =sub_80A64B0 str r1, [r0, 0x1C] ldr r1, =move_anim_8072740 bl oamt_set_x3A_32 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool @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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0810D428 ldr r4, =0x02038436 b @0810D42A .align 2, 0 .pool @0810D428: ldr r4, =0x02038437 @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, =0x0203841e 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, =sub_810D47C str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fffe @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 .pool thumb_func_end sub_810D47C thumb_func_start sub_810D4F4 sub_810D4F4: ; 810D4F4 push {r4-r6,lr} adds r5, r0, 0 ldr r6, =0x0203841e movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 bne @0810D520 ldr r4, =0x02038436 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 .pool @0810D520: ldr r4, =0x02038437 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, =0x0203841e movs r4, 0x2 ldrsh r0, [r3, r4] lsls r0, 4 adds r1, r0 ldr r4, =0x000003ff adds r0, r4, 0 ands r1, r0 ldr r0, =0xfffffc00 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 .pool @0810D58C: cmp r0, 0x2 beq @0810D5B0 cmp r0, 0x3 beq @0810D5C0 b @0810D5C6 @0810D596: ldr r0, =0x0000fffd b @0810D5C0 .align 2, 0 .pool @0810D5A0: movs r0, 0x3 strh r0, [r5, 0x3A] ldr r0, =0x0000fffd strh r0, [r5, 0x3C] b @0810D5CE .align 2, 0 .pool @0810D5B0: ldr r0, =0x0000fffd strh r0, [r5, 0x3A] movs r0, 0x3 strh r0, [r5, 0x3C] b @0810D5CE .align 2, 0 .pool @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, =sub_810D5DC str r0, [r5, 0x1C] @0810D5D2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0810D664 ldr r4, =0x0202420b 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, =0x02038436 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, =0x02038437 b @0810D680 .align 2, 0 .pool @0810D664: ldr r0, =0x02038437 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, =0x02038436 @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, =sub_810D6A8 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A6F98 str r0, [r4, 0x1C] @0810D704: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810D6A8 thumb_func_start sub_810D714 sub_810D714: ; 810D714 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203841e 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r5, 0x4] ldr r0, =sub_810D770 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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, =0x02038437 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, =sub_810D830 str r0, [r7, 0x1C] @0810D818: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0810D8B8 ldr r4, =0x0202420b 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, =0x02038437 ldrb r4, [r0] ldr r0, =0x02038436 b @0810D8BE .align 2, 0 .pool @0810D8B8: ldr r0, =0x02038436 ldrb r4, [r0] ldr r0, =0x02038437 @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 .pool @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, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A6F98 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =0x0203841e 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, =0x02038432 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, =sub_810D960 str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810D984 thumb_func_start sub_810DA10 sub_810DA10: ; 810DA10 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203841e 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 .pool @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, =0x02038436 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, =sub_80A67D8 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x0203841e ldrh r0, [r0] strh r0, [r4, 0x18] b @0810DB06 .align 2, 0 .pool @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, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0810DB50 ldr r1, =0x02022e20 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 .pool @0810DB50: ldr r2, =0x02022e20 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, =0x02022e22 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, =0x0203841e 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 .pool thumb_func_end sub_810DABC thumb_func_start sub_810DBAC sub_810DBAC: ; 810DBAC push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203841e 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, =0x02038437 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, =0x0000ffe2 strh r0, [r5, 0x38] adds r0, r5, 0 bl sub_80A68D4 ldr r0, =sub_810DC10 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =0x02038437 ldrb r0, [r0] mov r6, sp adds r6, 0x2 movs r1, 0x1 mov r2, sp adds r3, r6, 0 bl sub_80A8924 ldr r0, =0x02038436 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, =0x0000ffe2 strh r0, [r4, 0x38] adds r0, r4, 0 bl sub_80A68D4 ldr r0, =sub_810DCB4 str r0, [r4, 0x1C] add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =sub_810DD24 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810DD7C ldr r1, =0x0203841e ldrh r0, [r1] negs r0, r0 strh r0, [r1] @0810DD7C: ldr r0, =0x0203841e 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, =sub_80A6EEC str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810DD50 thumb_func_start sub_810DDC4 sub_810DDC4: ; 810DDC4 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e 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 .pool @0810DDE0: ldr r0, =0x02038437 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, =0x02038436 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, =sub_810DE2C str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810DE98 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 adds r4, r1 ldr r1, =0x0203841e ldrh r0, [r1, 0x2] strh r0, [r4, 0x8] ldrh r0, [r1] strh r0, [r4, 0xA] ldr r0, =0x00002719 bl gpu_pal_tags_index_of lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0xC] ldr r0, =sub_810DF18 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02037b14 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, =0x00000107 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, =0x00000101 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 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810DFC8 ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @0810DFC8: ldr r4, =0x0203841e ldrh r0, [r4, 0x8] strh r0, [r6, 0x2E] ldrh r0, [r6, 0x20] strh r0, [r6, 0x30] ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] adds r0, r1 strh r0, [r6, 0x32] 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, =sub_80A67BC str r0, [r6, 0x1C] ldr r1, =sub_810E028 adds r0, r6, 0 bl oamt_set_x3A_32 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810E070 ldr r1, =0x0203841e 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, =0x0203841e 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, =0x0203841e 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, =0x02038437 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 .pool @0810E0EC: ldr r0, =0x02038437 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, =0x0203841e 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, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 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 .pool 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, =0x0203841e ldrh r0, [r1, 0x4] strh r0, [r4, 0x2E] ldrh r0, [r1, 0x6] strh r0, [r4, 0x30] ldr r0, =sub_810E184 str r0, [r4, 0x1C] movs r0, 0 bl obj_id_for_side_relative_to_move ldr r2, =0x02020630 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 .pool 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, =0x02038436 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, =0x0000ffe0 strh r0, [r5, 0x22] adds r0, r5, 0 movs r1, 0x1 bl sub_8008258 b @0810E1FE .align 2, 0 .pool @0810E1F8: ldr r0, =0x0000ffe0 strh r0, [r5, 0x20] strh r0, [r5, 0x22] @0810E1FE: ldr r0, =0x0203841e ldrh r0, [r0] strh r0, [r5, 0x2E] ldrh r0, [r5, 0x20] strh r0, [r5, 0x30] ldr r4, =0x02038437 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, =sub_810E24C str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool 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, =0x020383fe ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] @0810E308: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r1, [r0, 0xE] movs r0, 0x80 lsls r0, 1 ands r0, r1 cmp r0, 0 beq @0810E33C ldr r0, =0x02038436 b @0810E33E .align 2, 0 .pool @0810E33C: ldr r0, =0x02038437 @0810E33E: ldrb r6, [r0] adds r0, r6, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0810E354 ldr r1, =0x0203841e 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, =0x0203841e 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 .pool @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, =gUnknown_08329F40 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, =0x02021bc0 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, =sub_810E520 str r0, [r7, 0x1C] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08329F40 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, =0x02021bc0 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 .pool @0810EA0C: ldrh r0, [r4, 0x4] ldr r1, =0x00007fff 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, =sub_810E2C8 str r0, [r5, 0x1C] @0810EA36: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810E520 thumb_func_start sub_810EA4C sub_810EA4C: ; 810EA4C push {r4,r5,lr} adds r4, r0, 0 ldr r0, =0x02038437 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, =0x02038436 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, =sub_80A7820 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810EA4C thumb_func_start sub_810EAA0 sub_810EAA0: ; 810EAA0 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x0203841e 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 .pool @0810EABC: adds r0, r5, 0 movs r1, 0 bl sub_80A6980 @0810EAC4: ldr r4, =0x0203841e movs r2, 0x4 ldrsh r0, [r4, r2] cmp r0, 0 bne @0810EADC ldr r0, =0x02038436 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, =0x02038437 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, =0x0203841e 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, =0x00000ccc 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, =sub_810EB40 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x020383fe 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, =0x0203841e 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, =gUnknown_085973E8 mov r8, r0 ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 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 .pool 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, =0x02020630 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 .pool @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, =0x02038437 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 .pool @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, =0x02020630 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 .pool 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, =0x0203841e ldrh r0, [r1, 0x4] strh r0, [r4, 0x2E] ldrh r0, [r1, 0x6] strh r0, [r4, 0x30] ldr r0, =sub_810ED70 str r0, [r4, 0x1C] movs r0, 0 bl obj_id_for_side_relative_to_move ldr r2, =0x02020630 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 .pool 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, =sub_810EDD0 str r0, [r2, 0x1C] @0810EDC8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r2, 0 ldrsh r0, [r0, r2] cmp r0, 0 bne @0810EE40 ldr r4, =0x02038436 b @0810EE42 .align 2, 0 .pool @0810EE40: ldr r4, =0x02038437 @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 .pool @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, =0x02021bc0 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 .pool 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, =0x000001ff 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 .pool @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, =0x0203841e 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, =0x02038436 b @0810EF76 .align 2, 0 .pool @0810EF74: ldr r4, =0x02038437 @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, =sub_810EFA8 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810F018 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =0x02038436 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, =sub_810F140 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 .pool 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, =0x0203841e 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, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 adds r1, 0x3E ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 b @0810F1DA .align 2, 0 .pool @0810F1BC: movs r0, 0 bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 adds r1, 0x3E ldrb 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 .pool 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, =0x02038436 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, =0x02038436 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 .pool @0810F2B0: movs r0, 0xB0 strh r0, [r5, 0x20] movs r0, 0x28 b @0810F2F2 @0810F2B8: ldr r6, =0x02038436 ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0810F2CE ldr r1, =0x0203841e ldrh r0, [r1] negs r0, r0 strh r0, [r1] @0810F2CE: ldrb r0, [r6] movs r1, 0 bl sub_80A5C6C lsls r0, 24 ldr r4, =0x0203841e 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, =0x0203841e 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, =sub_810F3C8 str r1, [r5, 0x1C] adds r0, r5, 0 bl _call_via_r1 b @0810F330 .align 2, 0 .pool @0810F32C: ldr r0, =sub_810F340 str r0, [r5, 0x1C] @0810F330: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb 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, =0x02020630 ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @0810F3AC: ldr r1, =sub_810F3C8 str r1, [r5, 0x1C] adds r0, r5, 0 bl _call_via_r1 @0810F3B6: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_810F400 str r0, [r4, 0x1C] b @0810F3F8 .align 2, 0 .pool @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, =0x02037b14 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, =sub_810F46C str r0, [r3, 0x1C] @0810F45E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] @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, =0x02020630 ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r2, [r0] movs r1, 0x5 negs r1, r1 ands r1, r2 strb r1, [r0] @0810F502: adds r2, r5, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] ldr r0, =sub_810F524 str r0, [r5, 0x1C] @0810F512: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =move_anim_8072740 str r0, [r6, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =0x02038436 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 .pool @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, =0x0203841e 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 .pool @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, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 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, =0x0000ffff b @0810F692 .align 2, 0 .pool @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, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_810F634 thumb_func_start sub_810F6B0 sub_810F6B0: ; 810F6B0 push {r4-r7,lr} adds r5, r0, 0 ldr r6, =0x02038436 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, =sub_810F740 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67D8 str r0, [r5, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08596740 str r0, [r4, 0x10] movs r0, 0 strh r0, [r4, 0x2E] adds r0, r4, 0 bl obj_alloc_rotscale_entry ldr r0, =sub_810F774 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_0859675C adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_810F810 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 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, =0x02038436 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, =gUnknown_0859677C adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_810F898 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 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 .pool @0810F900: ldr r3, =0x02020630 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 .pool 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, =0x03005e00 adds r5, r1, r0 movs r1, 0 movs r0, 0x10 strh r0, [r5, 0xE] strh r1, [r5, 0x10] ldr r4, =0x02038436 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, =sub_810F9D4 str r0, [r5] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_08596794 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 .pool @0810FA5C: cmp r0, 0x2 beq @0810FA90 cmp r0, 0x3 beq @0810FAA8 b @0810FABE @0810FA66: ldr r0, =0x02020630 lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r1, r0 ldrh r0, [r4, 0x20] b @0810FAB6 .align 2, 0 .pool @0810FA78: ldr r0, =0x02020630 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 .pool @0810FA90: ldr r1, =0x02020630 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 .pool @0810FAA8: ldr r0, =0x02020630 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 .pool @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, =0x02020630 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 .pool @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, =0x0203841e movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 bne @0810FBD4 ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @0810FBD4: ldrh r0, [r6, 0x2] strh r0, [r5, 0x2E] ldr r0, =sub_810FB60 str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r5, r1, r0 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @0810FC94 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x1 bne @0810FC60 ldr r0, =0x0000fff6 strh r0, [r5, 0x1C] ldr r4, =0x02038437 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, =0x02038436 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 .pool @0810FC60: movs r0, 0xA strh r0, [r5, 0x1C] ldr r4, =0x02038436 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, =0x02038437 ldrb r0, [r4] movs r1, 0x4 bl sub_80A861C adds r0, 0x8 b @0810FD12 .align 2, 0 .pool @0810FC94: ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x1 bne @0810FCE8 ldr r0, =0x0000fff6 strh r0, [r5, 0x1C] ldr r4, =0x02038437 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, =0x02038436 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 .pool @0810FCE8: movs r0, 0xA strh r0, [r5, 0x1C] ldr r4, =0x02038436 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, =0x02038437 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, =sub_810FD3C str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_08596864 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, =0x02020630 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 .pool @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, =0x03005e00 adds r4, r1, r0 ldr r0, =0x02038437 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, =0x0203841e 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 .pool @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, =0x02038437 ldrb r0, [r0] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0810FEB8 ldr r0, =0x02022e18 ldrh r0, [r0] strh r0, [r4, 0x1C] ldr r0, =0x04000014 b @0810FEC0 .align 2, 0 .pool @0810FEB8: ldr r0, =0x02022e1c ldrh r0, [r0] strh r0, [r4, 0x1C] ldr r0, =0x04000018 @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, =0x02038c28 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, =0xa2600001 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, =sub_810FF34 str r0, [r4] add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_08329F40 mov r9, r0 movs r7, 0x3 ldr r1, =0x02038c28 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 .pool @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, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] @08110014: ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] b @08110026 .align 2, 0 .pool @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, =0x03005e00 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 .pool @0811006C: ldr r1, =0x0203841e 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 .pool @08110094: ldr r2, =0x02020630 lsls r4, r0, 4 adds r4, r0 lsls r4, 2 adds r0, r2, 0 adds r0, 0x1C adds r0, r4, r0 ldr r1, =nullsub_12 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, =0x0203841e 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, =sub_8110134 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 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_08329F40 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 .pool @081101B8: ldrh r0, [r4, 0xA] subs r0, 0x4 strh r0, [r4, 0xA] ldr r1, =gUnknown_08329F40 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 .pool @08110208: movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool @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, =0x02038436 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 .pool @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, =0x0203841e 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 .pool @08110394: ldr r0, =0x02038437 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, =0x0203841e 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, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A60AC lsls r0, 24 ldr r4, =0x0203841e 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, =sub_80A6EEC str r0, [r6, 0x1C] ldr r1, =move_anim_8072740 adds r0, r6, 0 bl oamt_set_x3A_32 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r1] negs r0, r0 strh r0, [r1] adds r0, r6, 0 movs r1, 0x2 bl sub_8008258 b @08110478 .align 2, 0 .pool @0811045C: ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08110478 ldr r0, =0x0203841e ldrh r1, [r0, 0x2] negs r1, r1 strh r1, [r0, 0x2] ldrh r1, [r0] negs r1, r1 strh r1, [r0] @08110478: ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A60AC lsls r0, 24 ldr r4, =0x0203841e 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, =sub_80A6EEC str r0, [r6, 0x1C] ldr r1, =move_anim_8072740 adds r0, r6, 0 bl oamt_set_x3A_32 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =0x0203841e 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, =0x02038437 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 .pool @08110548: ldr r0, =0x02038437 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, =0x0203841e ldrh r0, [r0, 0x6] strh r0, [r5, 0x38] ldr r0, =sub_811057C str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @081105F0 ldr r0, =0x0203841e ldrh r1, [r4, 0x20] ldrh r2, [r0] subs r1, r2 strh r1, [r4, 0x20] b @081105FC .align 2, 0 .pool @081105F0: ldr r1, =0x0203841e 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, =0x02038437 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, =sub_8110630 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81106A4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8110700 str r0, [r4, 0x1C] @081106F6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] b @08110762 .align 2, 0 .pool @08110740: ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08110762 ldr r1, =0x0203841e 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner adds r4, r0, 0 ldr r5, =0x02038437 ldrb r0, [r5] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @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, =0x0203841e 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, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C adds r4, r0, 0 lsls r4, 24 ldr r6, =0x0203841e 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, =sub_80A6EEC str r0, [r7, 0x1C] ldr r1, =move_anim_8072740 adds r0, r7, 0 bl oamt_set_x3A_32 add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08110870 ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @08110870: ldr r4, =0x0203841e ldrh r0, [r4, 0x8] strh r0, [r6, 0x2E] ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] adds r0, r1 strh r0, [r6, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x6] adds r0, r1 strh r0, [r6, 0x36] ldrh r0, [r4, 0xA] strh r0, [r6, 0x38] adds r0, r6, 0 bl sub_80A68D4 ldr r0, =sub_81108CC 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 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @081109B0 ldr r4, =0x02038436 b @081109B2 .align 2, 0 .pool @081109B0: ldr r4, =0x02038437 @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, =move_anim_8074EE0 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67BC str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8110994 thumb_func_start sub_81109F0 sub_81109F0: ; 81109F0 push {r4-r6,lr} adds r5, r0, 0 ldr r6, =0x0203841e movs r1, 0x6 ldrsh r0, [r6, r1] cmp r0, 0 beq @08110A10 ldr r0, =0x02038437 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, =0x0000ffba strh r0, [r5, 0x36] ldrh r0, [r6, 0x4] strh r0, [r5, 0x38] ldr r1, =sub_8110A70 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r1, =sub_80A6450 str r1, [r5, 0x1C] adds r0, r5, 0 bl _call_via_r1 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffe8 strh r0, [r4, 0x36] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r1, =sub_80A6450 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8110A70 thumb_func_start sub_8110AB4 sub_8110AB4: ; 8110AB4 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203841e ldrb r1, [r4, 0xA] bl obj_anim_image_start adds r0, r5, 0 bl obj_anim_step ldr r0, =0x02038436 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 .pool @08110AE4: ldrh r0, [r4] ldrh r1, [r5, 0x20] adds r0, r1 @08110AEA: strh r0, [r5, 0x20] ldr r3, =0x0203841e 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, =sub_80A656C str r0, [r5, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8110AB4 thumb_func_start sub_8110B38 sub_8110B38: ; 8110B38 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203841e 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 .pool @08110B54: adds r0, r4, 0 movs r1, 0 bl sub_80A6980 @08110B5C: ldr r1, =0x0203841e 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, =sub_8110B80 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00003f42 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, =0x02022e18 strh r5, [r0] ldr r4, =0x02022e1a 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, =gUnknown_08D8D58C mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r1, =gUnknown_08D8D410 mov r0, sp movs r2, 0 bl sub_80A6D60 ldr r0, =gUnknown_08D8DAB8 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 beq @08110C6E ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08110C6E movs r5, 0x1 @08110C6E: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 strh r5, [r1, 0x8] ldr r0, =sub_8110CB0 str r0, [r1] add sp, 0x10 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r2, 0x8 ldrsh r0, [r0, r2] adds r2, r1, 0 cmp r0, 0 bne @08110CE4 ldr r1, =0x02022e18 ldr r3, =0x0000fffa adds r0, r3, 0 ldrh r3, [r1] adds r0, r3 b @08110CEA .align 2, 0 .pool @08110CE4: ldr r1, =0x02022e18 ldrh r0, [r1] adds r0, 0x6 @08110CEA: strh r0, [r1] ldr r1, =0x02022e1a ldr r3, =0x0000ffff 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, =@08110D28 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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 .pool @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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a 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 .pool 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, =0x0203841e movs r2, 0x6 ldrsh r0, [r4, r2] cmp r0, 0 beq @08110E98 ldr r0, =0x02038436 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 .pool @08110E98: ldr r0, =0x0000ffc0 strh r0, [r5, 0x20] @08110E9C: ldr r4, =0x0203841e ldrh r0, [r4] strh r0, [r5, 0x22] ldr r1, =gUnknown_08596BC0 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 .pool @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, =move_anim_8072740 str r0, [r5, 0x1C] @08110F24: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8110E4C thumb_func_start sub_8110F30 sub_8110F30: ; 8110F30 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e 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, =sub_80A6EEC str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r6, r1, r0 ldr r5, =0x02038436 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, =0x02038437 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 .pool @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, =sub_81110A4 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 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x4 bls @081110BE b @0811120C @081110BE: lsls r0, 2 ldr r1, =@081110D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 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 .pool @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, =0x02020630 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 .pool @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, =@08111234 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08111234: .4byte @08111248 .4byte @08111254 .4byte @08111254 .4byte @08111260 .4byte @0811126C @08111248: ldr r3, =gUnknown_08596C28 movs r5, 0 b @08111270 .align 2, 0 .pool @08111254: ldr r3, =gUnknown_08596C40 movs r5, 0x50 b @08111270 .align 2, 0 .pool @08111260: ldr r3, =gUnknown_08596C40 movs r5, 0x40 b @08111270 .align 2, 0 .pool @0811126C: ldr r3, =gUnknown_08596C40 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, =0x02020630 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, =0x000003ff adds r1, r5, 0 ands r2, r1 ldr r1, =0xfffffc00 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 .pool 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, =sub_81110A4 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @08111348 ldr r0, =0x03005e00 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 .pool thumb_func_end sub_811131C thumb_func_start sub_811135C sub_811135C: ; 811135C push {lr} ldr r0, =0x02038400 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 .pool thumb_func_end sub_811135C thumb_func_start sub_8111388 sub_8111388: ; 8111388 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e 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, =sub_81113C8 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 .pool 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, =0x02038436 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 .pool thumb_func_end sub_8111418 thumb_func_start sub_8111444 sub_8111444: ; 8111444 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x02038437 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, =0x0203841e 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, =sub_811149C str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038404 ldr r0, [r2] cmp r0, 0x20 bgt @08111500 ldr r1, =0x0203841e 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, =0x0203841e movs r0, 0x1 strh r0, [r1, 0xE] @08111510: cmp r2, 0x41 ble @0811151A ldr r1, =0x0203841e movs r0, 0x2 strh r0, [r1, 0xE] @0811151A: adds r0, r3, 0 bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02022e22 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 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bne @081115BC movs r0, 0 bl sub_80A6DAC ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] ldr r0, =0x02022e22 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, =0x02022e22 movs r2, 0xA ldrsh r1, [r4, r2] movs r0, 0x4 bl cosine ldrh r4, [r4, 0xC] adds r0, r4 strh r0, [r6] ldr r0, =0x0203841e movs r2, 0xE ldrsh r1, [r0, r2] ldr r0, =0x00000fff 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 .pool 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, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r4, 0x2E] ldrh r0, [r4, 0x20] strh r0, [r4, 0x30] ldr r5, =0x02038437 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, =sub_8111674 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 .pool 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, =sub_81116E8 str r0, [r4, 0x1C] b @081116DE .align 2, 0 .pool @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, =0x02038440 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 .pool 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, =sub_80A67F4 str r0, [r4, 0x1C] b @0811175E .align 2, 0 .pool @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, =0x010d0000 cmp r0, r1 bne @081117EE movs r0, 0 b @081117EC .align 2, 0 .pool @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, =0xffffff00 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 .pool @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, =sub_8111814 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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, =0x03005e00 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, =0x0203841e ldrh r1, [r1] strh r1, [r0, 0xA] strh r2, [r0, 0xC] movs r1, 0x10 strh r1, [r0, 0xE] ldr r1, =sub_8111914 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811188C thumb_func_start sub_8111914 sub_8111914: ; 8111914 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 ldrh r0, [r4, 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, =sub_811196C str r0, [r4] @0811195C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02038436 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, =0x0203841e 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, =sub_8111A88 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 .pool 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, =0x02038437 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 .pool @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, =0x02038437 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 .pool @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, =sub_8111BB4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 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, =0x02038437 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, =0x0000ff70 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 .pool @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, =0x0000ff90 @08111D12: strh r1, [r0, 0x32] ldr r4, =0x02020630 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, =nullsub_12 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, =sub_80A656C str r1, [r0] ldr r0, =sub_8111D78 str r0, [r5] @08111D5C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 adds r0, r1 bl obj_delete_but_dont_free_vram movs r0, 0x1 strh r0, [r4, 0x10] b @08111E48 .align 2, 0 .pool @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, =0x03005e00 adds r1, r2 movs r2, 0 strh r2, [r1, 0x26] ldr r2, =sub_8111E78 str r2, [r1] bl _call_via_r2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r5, r0, r1 ldr r0, =0x02038437 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, =@08111EBC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08111EBC: .4byte @08111ED0 .4byte @08111FD0 .4byte @08112014 .4byte @0811207C .4byte @081120A8 @08111ED0: ldr r7, =0x00002771 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 .pool @08111F0C: ldr r4, =0x02020630 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, =0x020244d0 ldr r1, [r0] ldr r0, =0x02038437 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 .pool @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, =0x02037714 adds r0, r1 movs r2, 0x24 ldrsh r1, [r5, r2] lsls r1, 1 ldr r2, =0x02037b14 adds r1, r2 ldr r2, =0x04000008 bl CpuSet ldrh r0, [r5, 0x10] ldr r3, =0x00003c0d movs r1, 0x10 movs r2, 0xA bl pal_fade_1 b @081120C6 .align 2, 0 .pool @08112014: ldr r2, =0x02020630 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 .pool @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, =0x00003f42 movs r0, 0x50 bl lcd_io_set b @08112098 .align 2, 0 .pool @08112090: ldr r1, =0x00003f44 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 .pool @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, =sub_81120DC 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 .pool 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, =0x03005e00 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, =gUnknown_08329F40 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, =gUnknown_08329F40 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, =sub_8112170 str r1, [r4] adds r0, r5, 0 bl _call_via_r1 @0811215E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 ldr r0, =0x02038437 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 .pool @081121A8: cmp r0, 0x2 beq @081121F0 b @08112258 @081121AE: ldr r1, =0x02039b28 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 .pool @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, =0x00003c0d movs r1, 0x10 movs r2, 0 bl pal_fade_1 b @08112258 .align 2, 0 .pool @081121F0: ldr r3, =0x02020630 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, =0x00002771 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 .pool @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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @081122AC ldr r4, =0x02038436 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, =0x02038437 b @081122D0 .align 2, 0 .pool @081122AC: ldr r4, =0x02038437 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, =0x02038436 @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, =0x0203841e 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, =sub_8112384 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 .pool 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, =0x03005e00 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, =0x0203841e ldrh r0, [r2] strh r0, [r1, 0x1C] ldr r4, =0x02038436 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, =0x02038436 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, =gUnknown_08596DB8 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, =0x02020630 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, =0x0203841e 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, =0x0203841e movs r3, 0x2 ldrsh r1, [r2, r3] bl __divsi3 strh r0, [r4, 0x34] ldr r1, =0x0203841e ldrh r0, [r1, 0x2] strh r0, [r4, 0x36] mov r2, r10 strh r2, [r4, 0x38] mov r3, r9 strh r3, [r4, 0x3A] ldr r0, =0x0202064c adds r5, r0 ldr r0, =sub_8112384 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 .pool @08112530: ldr r0, =gUnknown_08596DB8 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, =0x02020630 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, =0x0203841e 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, =0x0203841e movs r3, 0x2 ldrsh r1, [r2, r3] bl __divsi3 strh r0, [r4, 0x34] ldr r1, =0x0203841e 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, =sub_8112384 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, =sub_81125E0 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 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 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 .pool @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, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00003f1f 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, =0x02038436 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 .pool @081127B8: movs r6, 0xC8 @081127BA: ldr r1, =0x02022e24 lsls r3, r6, 16 asrs r2, r3, 16 lsls r0, r2, 8 orrs r0, r2 strh r0, [r1] ldr r1, =0x02022e26 movs r5, 0x28 ldr r0, =0x00002828 strh r0, [r1] lsrs r3, 16 movs r1, 0xF0 subs r1, r2 movs r4, 0x48 ldr r2, =0x03005e00 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, =sub_811280C str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x3fb00000 ldr r3, =0x00000000 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, =0x3fb00000 ldr r3, =0x00000000 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, =0x3fb00000 ldr r3, =0x00000000 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, =0x3fb00000 ldr r3, =0x00000000 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 .pool @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, =sub_8112994 str r0, [r4] @08112966: ldr r1, =0x02022e24 mov r2, r9 lsls r0, r2, 8 orrs r7, r0 strh r7, [r1] ldr r1, =0x02022e26 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @081129DA ldr r0, =0x02022e24 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r4, =0x00003f3f 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 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @08112A24 movs r2, 0x18 ldr r3, =0x0000fffe 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 .pool @08112A24: ldr r2, =0x0000ffe8 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, =sub_8112A4C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x000003ff adds r0, r4, 0 ands r1, r0 ldr r0, =0xfffffc00 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, =sub_80A64B0 str r0, [r3, 0x1C] ldr r1, =sub_8112ACC adds r0, r3, 0 bl oamt_set_x3A_32 b @08112AC4 .align 2, 0 .pool @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, =sub_8112B44 str r0, [r4, 0x1C] @08112B3A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] adds r0, r4, 0 bl move_anim_8072740 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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, =0x0000050b 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 .pool @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, =sub_8112C4C str r0, [r5, 0x1C] @08112C40: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02038436 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, =sub_8112D10 str r0, [r4] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x5 bls @08112D2A b @08112E96 @08112D2A: lsls r0, 2 ldr r1, =@08112D3C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08596E30 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x40 beq @08112DAA ldr r1, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r5, r0, r1 strh r7, [r5, 0x2E] ldr r0, =0x02038436 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 .pool @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, =0x03005e00 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 .pool @08112EF4: ldr r2, =0x03005e00 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, =0x03005e00 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 .pool 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, =0x020241e4 ldr r1, =0x02038436 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, =0x0203841e ldrh r1, [r2] strh r1, [r0, 0x32] ldrh r1, [r2, 0x2] strh r1, [r0, 0x34] ldr r1, =sub_8112FB8 str r1, [r0, 0x1C] ldr r2, =0x02020630 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 .pool 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, =0x02020630 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, =0xffffff00 adds r0, r1, r2 strh r0, [r5, 0x2E] b @08113054 .align 2, 0 .pool @08113020: ldr r2, =0x02020630 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, =move_anim_8074EE0 str r0, [r5, 0x1C] @08113054: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8112FB8 thumb_func_start sub_8113064 sub_8113064: ; 8113064 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @081130B4 ldr r2, =0x0203841e 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 .pool @081130B4: ldr r1, =0x0203841e 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, =move_anim_8074EE0 adds r0, r5, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A66DC str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08113164 ldr r2, =0x0203841e 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 .pool @08113164: ldr r1, =0x0203841e 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, =0x0203841e ldrh r0, [r0, 0x8] strh r0, [r5, 0x2E] ldr r0, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8113100 thumb_func_start sub_81131B4 sub_81131B4: ; 81131B4 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @081131D0 ldr r4, =0x02038436 b @081131D2 .align 2, 0 .pool @081131D0: ldr r4, =0x02038437 @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, =0x0203841e 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, =sub_80A67D8 str r0, [r5, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81131B4 thumb_func_start sub_8113224 sub_8113224: ; 8113224 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @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 .pool thumb_func_end sub_8113224 thumb_func_start sub_8113250 sub_8113250: ; 8113250 push {r4-r7,lr} adds r6, r0, 0 ldr r4, =0x02038436 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, =0x0203841e ldrh r0, [r0] strh r0, [r6, 0x3A] ldr r4, =0x0202420b 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 .pool @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, =sub_81132E0 str r0, [r6, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r1, r0 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08113424 ldr r0, =0x04000014 str r0, [sp] ldr r0, =0x02022e18 b @0811342A .align 2, 0 .pool @08113424: ldr r0, =0x04000018 str r0, [sp] ldr r0, =0x02022e1c @0811342A: ldrh r0, [r0] strh r0, [r4, 0xC] ldr r0, =0xa2600001 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, =0x02038436 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, =0x02038c28 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, =sub_81134B8 str r0, [r4] add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r2, r0, r1 movs r1, 0x8 ldrsh r0, [r2, r1] cmp r0, 0x4 bhi @0811356E lsls r0, 2 ldr r1, =@081134E4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] ldrh r0, [r2, 0x8] adds r0, 0x1 strh r0, [r2, 0x8] b @0811356E .align 2, 0 .pool @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, =0x02038c28 mov r12, r7 ldr r0, =gUnknown_08329F40 mov r8, r0 ldr r6, =0x02039b28 @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 .pool 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, =0x0203841e 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, =0x02038436 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, =sub_811369C str r0, [r4, 0x1C] adds r4, 0x2E ldr r2, =0x0203a100 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 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =0x0203841e ldrh r1, [r1] strh r1, [r0, 0x8] ldr r1, =0x02038436 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, =0x00003f42 movs r0, 0x50 bl lcd_io_set b @0811373C .align 2, 0 .pool @08113734: ldr r1, =0x00003f44 movs r0, 0x50 bl lcd_io_set @0811373C: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_811375C str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02038436 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 .pool @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, =0x03005e00 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 adds r2, r1 ldr r0, =0x0203841e ldrh r0, [r0] strh r0, [r2, 0x8] movs r1, 0x80 lsls r1, 5 strh r1, [r2, 0xA] ldr r0, =sub_811381C str r0, [r2] movs r0, 0x52 bl lcd_io_set pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02038436 ldrb r0, [r0] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081138BC ldr r1, =0x00003f42 movs r0, 0x50 bl lcd_io_set b @081138C4 .align 2, 0 .pool @081138BC: ldr r1, =0x00003f44 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 .pool thumb_func_end sub_8113888 thumb_func_start sub_81138D4 sub_81138D4: ; 81138D4 push {r4-r6,lr} adds r4, r0, 0 ldr r6, =0x02038437 ldrb r0, [r6] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x30] ldr r5, =0x02038436 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, =0x0000ffd8 strh r0, [r4, 0x3A] ldr r1, =sub_8113950 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =sub_8113A18 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8113A58 str r0, [r2, 0x1C] @08113A4E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r2, 0 ldrsh r1, [r0, r2] adds r3, r0, 0 cmp r1, 0 bne @08113AAC ldr r0, =0x02038436 b @08113AAE .align 2, 0 .pool @08113AAC: ldr r0, =0x02038437 @08113AAE: ldrb r5, [r0] movs r6, 0x14 ldrh r2, [r4, 0x4] lsls r1, r2, 22 lsrs r1, 22 adds r1, 0x4 ldr r7, =0x000003ff adds r0, r7, 0 ands r1, r0 ldr r0, =0xfffffc00 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 .pool @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, =0x0000fff4 strh r0, [r4, 0x38] adds r0, r4, 0 bl sub_80A68D4 ldr r0, =sub_8113B90 str r0, [r4, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r5, r1, r0 ldr r4, =0x02038436 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, =0x0000fff4 b @08113C1E .align 2, 0 .pool @08113C1C: ldr r0, =0x0000ffc0 @08113C1E: strh r0, [r5, 0x18] ldr r0, =0x02038436 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, =0x02022e1a ldrh r0, [r0] strh r0, [r5, 0x1C] ldr r1, =0x00003f42 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, =0x04000016 str r0, [sp] movs r7, 0x2 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @08113CB0 ldr r1, =0x02022e1c b @08113CAA .align 2, 0 .pool @08113C80: ldr r0, =0x02022e1e ldrh r0, [r0] strh r0, [r5, 0x1C] ldr r1, =0x00003f44 movs r0, 0x50 bl lcd_io_set movs r0, 0 movs r1, 0x90 movs r2, 0x20 bl rboxid_80040B8 ldr r0, =0x0400001a str r0, [sp] movs r7, 0x4 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @08113CB0 ldr r1, =0x02022e18 @08113CAA: ldrh r0, [r1] adds r0, 0xF0 strh r0, [r1] @08113CB0: ldr r0, =0xa2600001 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, =0x02038c28 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, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r2, =0x02022e24 ldrh r0, [r5, 0x24] lsls r0, 8 ldrh r1, [r5, 0x26] orrs r0, r1 strh r0, [r2] ldr r1, =0x02022e26 movs r0, 0xA0 strh r0, [r1] ldr r0, =sub_8113D60 str r0, [r5] add sp, 0x1C pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x4 bls @08113D7A b @08113E72 @08113D7A: lsls r0, 2 ldr r1, =@08113D8C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022e24 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 .pool @08113E58: ldr r1, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] @08113E5E: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @08113E72 .align 2, 0 .pool @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, =0x03005e00 adds r5, r0, r1 movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0x4 bls @08113E94 b @081140A6 @08113E94: lsls r0, 2 ldr r1, =@08113EA8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r4, =0x00003f3f 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 .pool @08113EF8: ldr r0, =0x02038437 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, =0x00003f42 movs r0, 0x50 bl lcd_io_set ldr r1, =0x02022e1c b @08113F2E .align 2, 0 .pool @08113F24: ldr r1, =0x00003f44 movs r0, 0x50 bl lcd_io_set ldr r1, =0x02022e18 @08113F2E: ldrh r0, [r1] adds r0, 0xF0 strh r0, [r1] b @08114044 .align 2, 0 .pool @08113F40: movs r1, 0xE ldrsh r0, [r5, r1] cmp r0, 0x1 bne @08113F68 mov r0, sp bl sub_80A6B30 ldr r0, =0x02022e1a 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 .pool @08113F68: ldr r0, =0x02022e1e 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 .pool @08113F84: ldr r4, =0x02038437 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, =0x0000fff4 b @08113FDA .align 2, 0 .pool @08113FD8: ldr r0, =0x0000ffc0 @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 .pool @08113FF0: movs r1, 0xE ldrsh r0, [r5, r1] cmp r0, 0x1 bne @08114000 ldr r0, =0x04000016 b @08114002 .align 2, 0 .pool @08114000: ldr r0, =0x0400001a @08114002: str r0, [sp, 0x10] movs r3, 0 add r4, sp, 0x10 ldr r6, =0x02038c28 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, =0xa2600001 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 .pool @08114058: movs r1, 0xE ldrsh r0, [r5, r1] cmp r0, 0x1 bne @08114070 ldr r1, =0x00003f3d movs r0, 0x4A bl lcd_io_set b @08114078 .align 2, 0 .pool @08114070: ldr r1, =0x00003f3b movs r0, 0x4A bl lcd_io_set @08114078: ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r2, =0x02022e24 ldrh r0, [r5, 0x24] lsls r0, 8 ldrh r1, [r5, 0x26] orrs r0, r1 strh r0, [r2] ldr r1, =0x02022e26 movs r0, 0xA0 strh r0, [r1] movs r0, 0 strh r0, [r5, 0x8] strh r0, [r5, 0xA] strh r0, [r5, 0xC] ldr r1, =0x0000080c movs r0, 0x52 bl lcd_io_set ldr r0, =sub_81140C8 str r0, [r5] @081140A6: add sp, 0x1C pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x4 bls @081140E2 b @08114232 @081140E2: lsls r0, 2 ldr r1, =@081140F4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022e24 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 .pool @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, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] @08114204: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @08114232 .align 2, 0 .pool @08114210: ldr r0, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r4, =0x00003f3f 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 .pool 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, =0x02038c28 mov r12, r0 ldr r7, =0x02039b28 @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, =0x02038c28 mov r12, r0 ldr r7, =0x02039b28 @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, =0x02038c28 ldr r4, =0x02039b28 @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 .pool @08114338: movs r1, 0x1C ldrsh r0, [r6, r1] adds r5, r0, 0 adds r5, 0x9F movs r4, 0 ldr r3, =0x02038c28 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 .pool 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, =0x02020630 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 .pool 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, =0x02038436 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, =0x02020630 mov r9, r0 ldr r0, =0x020241e4 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 .pool 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, =0x02038436 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 .pool thumb_func_end sub_8114470 thumb_func_start sub_81144BC sub_81144BC: ; 81144BC push {r4,lr} adds r4, r0, 0 ldr r1, =0x0203841e 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, =sub_80A67D8 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e24 strh r6, [r0] ldr r0, =0x02022e26 strh r6, [r0] ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00003f3d movs r0, 0x4A bl lcd_io_set movs r1, 0x80 lsls r1, 8 movs r0, 0 bl lcd_io_set_bits ldr r1, =0x00003f42 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000c08 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, =0x02038436 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, =0x02020630 ldr r1, =0x020241e4 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r5, [r0] b @0811465C .align 2, 0 .pool @08114614: ldr r4, =0x02038436 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08114640 ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @08114650 .align 2, 0 .pool @08114640: ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @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, =0x02038436 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, =gUnknown_08C1D210 bl sub_80A6D48 mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08C1D0AC mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r0, =gUnknown_08C1D1E8 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette ldr r2, =0x02022e18 ldr r0, =0x02020630 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, =0x02022e1a 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, =0x0203841e 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 .pool @08114708: lsls r0, r1, 4 ldrh r3, [r2, 0x4] movs r1, 0x10 movs r2, 0xB bl pal_fade_1 @08114714: ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 strh r5, [r0, 0x8] ldr r2, =0x0203841e 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, =sub_8114748 str r1, [r0] add sp, 0x10 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02022e18 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, =0x02020630 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, =0x020241e4 ldr r0, =0x02038436 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 .pool @08114824: cmp r0, 0x3 bne @08114886 ldr r0, =0x02022e24 strh r5, [r0] ldr r0, =0x02022e26 strh r5, [r0] ldr r4, =0x00003f3f 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 .pool 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, =0x0203841e movs r2, 0 ldrsh r1, [r0, r2] adds r2, r0, 0 cmp r1, 0x7 bhi @08114900 lsls r0, r1, 2 ldr r1, =@081148C4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020241e4 adds r0, r4, r0 ldrb r2, [r0] b @0811492E .align 2, 0 .pool @0811492C: movs r2, 0xFF @0811492E: cmp r2, 0xFF beq @0811494A ldr r1, =0x02020630 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, =0x0203841e 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 .pool thumb_func_end sub_811489C thumb_func_start sub_8114960 sub_8114960: ; 8114960 push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x02038432 ldrb r0, [r2] cmp r0, 0x1 bhi @08114974 ldr r1, =0x0203841e movs r0, 0 strh r0, [r1, 0xE] @08114974: ldrb r0, [r2] cmp r0, 0x2 bne @08114980 ldr r1, =0x0203841e movs r0, 0x1 strh r0, [r1, 0xE] @08114980: adds r0, r3, 0 bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8114960 thumb_func_start sub_8114994 sub_8114994: ; 8114994 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x02038436 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, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x36] ldr r0, =0x0000ffd8 strh r0, [r4, 0x38] adds r0, r4, 0 bl sub_80A68D4 ldr r0, =sub_81149FC str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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, =sub_8114A60 str r0, [r5, 0x1C] @08114A50: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08114A9C ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @08114A9C: ldr r4, =0x0203841e ldrh r0, [r4, 0x8] strh r0, [r6, 0x2E] ldr r5, =0x02038437 ldrb r0, [r5] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r1, [r4, 0x4] adds r0, r1 strh r0, [r6, 0x32] ldrb r0, [r5] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldrh r4, [r4, 0x6] adds r0, r4 strh r0, [r6, 0x36] ldr r0, =sub_80A6EEC str r0, [r6, 0x1C] ldr r1, =move_anim_8072740 adds r0, r6, 0 bl oamt_set_x3A_32 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =0x0203841e 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, =sub_80A6EEC str r0, [r6, 0x1C] ldr r1, =move_anim_8074EE0 adds r0, r6, 0 bl oamt_set_x3A_32 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r5, 0x4] ldr r6, =0x0203841e movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 bne @08114BF4 ldr r4, =0x02038436 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, =sub_8114C10 b @08114C02 .align 2, 0 .pool @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, =sub_8114C4C @08114C02: str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r1, r0, r1 ldr r0, =0x0203841e movs r3, 0 ldrsh r0, [r0, r3] cmp r0, 0 bne @08114CE8 ldr r0, =sub_8114CFC b @08114CEA .align 2, 0 .pool @08114CE8: ldr r0, =sub_8114EB4 @08114CEA: str r0, [r1] ldr r1, [r1] adds r0, r2, 0 bl _call_via_r1 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x4 bls @08114D16 b @08114EAA @08114D16: lsls r0, 2 ldr r1, =@08114D28 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02038436 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, =0x02022e18 ldrh r0, [r0] strh r0, [r4, 0x20] ldr r0, =0x02022e1a b @08114D78 .align 2, 0 .pool @08114D70: ldr r0, =0x02022e1c ldrh r0, [r0] strh r0, [r4, 0x20] ldr r0, =0x02022e1e @08114D78: ldrh r0, [r0] strh r0, [r4, 0x22] ldr r0, =0x02038436 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, =0x02020630 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 .pool @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, =gUnknown_08329F40 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, =0x02022e1a b @08114E22 .align 2, 0 .pool @08114E20: ldr r1, =0x02022e1e @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, =0x02022e1a b @08114E4E .align 2, 0 .pool @08114E4C: ldr r1, =0x02022e1e @08114E4E: ldrh r0, [r4, 0x22] subs r0, r2 strh r0, [r1] ldr r2, =0x02020630 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 .pool @08114E78: ldr r1, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] @08114E7E: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @08114EAA .align 2, 0 .pool @08114E8C: adds r0, r2, 0 bl move_anim_task_del ldr r2, =0x02020630 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 .pool 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, =0x02020630 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, =0x02038436 ldrb r0, [r0] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08114F00 ldr r0, =0x02022e1a b @08114F02 .align 2, 0 .pool @08114F00: ldr r0, =0x02022e1e @08114F02: strh r4, [r0] adds r0, r5, 0 bl move_anim_task_del pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r1, r0, r1 ldr r0, =0x0203841e movs r3, 0 ldrsh r0, [r0, r3] cmp r0, 0 bne @08114F40 ldr r0, =sub_8114F54 b @08114F42 .align 2, 0 .pool @08114F40: ldr r0, =sub_8114FD8 @08114F42: str r0, [r1] ldr r1, [r1] adds r0, r2, 0 bl _call_via_r1 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08114F78: movs r0, 0 bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x1C] ldr r3, =0x02020630 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 .pool @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, =0x03005e00 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x4 bhi @081150DA lsls r0, 2 ldr r1, =@08115004 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02038436 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, =0x02022e18 b @08115046 .align 2, 0 .pool @08115044: ldr r0, =0x02022e1c @08115046: ldrh r0, [r0] strh r0, [r4, 0x20] ldr r0, =0x02038436 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 .pool @0811506C: ldrb r0, [r4, 0x1E] movs r1, 0x26 ldrsh r2, [r4, r1] movs r1, 0 bl sub_81150E0 b @081150C2 @0811507A: ldr r2, =0x02020630 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 .pool @08115094: ldr r2, =0x02020630 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, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] @081150C2: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @081150DA .align 2, 0 .pool @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, =0x02022e18 ldrh r3, [r0] ldr r0, =0x04000014 b @0811510A .align 2, 0 .pool @08115104: ldr r0, =0x02022e1c ldrh r3, [r0] ldr r0, =0x04000018 @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, =0x02038c28 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, =0x02038c28 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, =0xa2600001 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 .pool thumb_func_end sub_81150E0 thumb_func_start sub_81151A0 sub_81151A0: ; 81151A0 push {r4-r7,lr} adds r5, r0, 0 ldr r0, =0x0203841e movs r2, 0 ldrsh r1, [r0, r2] adds r7, r0, 0 cmp r1, 0 bne @081151BC ldr r0, =0x02038436 b @081151BE .align 2, 0 .pool @081151BC: ldr r0, =0x02038437 @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, =sub_8115228 str r0, [r5, 0x1C] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @08115260 ldr r0, =0x02038436 b @08115262 .align 2, 0 .pool @08115260: ldr r0, =0x02038437 @08115262: ldrb r5, [r0] adds r0, r5, 0 movs r1, 0 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 ldr r2, =0x0000fff0 adds r0, r2 ldr r4, =0x0203841e 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r6, 0x4] ldr r1, =move_anim_8072740 adds r0, r6, 0 bl oamt_set_x3A_32 ldrh r0, [r4, 0x4] strh r0, [r6, 0x2E] ldr r0, =sub_80A64B0 str r0, [r6, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r0, r1 ldr r0, =0x0203841e 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 .pool @08115308: ldr r0, =0x02038408 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, =0x02022e20 ldrh r0, [r0] strh r0, [r4, 0x22] ldr r0, =sub_81153AC b @0811539E .align 2, 0 .pool @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, =0x020241e4 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 .pool @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, =sub_81154A4 @0811539E: str r0, [r4] @081153A0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02022e20 ldrh r0, [r3, 0x26] ldrh r2, [r3, 0x22] adds r0, r2 strh r0, [r1] b @0811540E .align 2, 0 .pool @08115404: ldr r0, =0x02022e20 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 .pool @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, =0x02022e20 ldrh r0, [r3, 0x24] ldrh r2, [r3, 0x22] adds r0, r2 strh r0, [r1] b @08115466 .align 2, 0 .pool @0811545C: ldr r0, =0x02022e20 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 .pool @08115490: ldr r1, =0x02022e20 ldrh r0, [r3, 0x22] strh r0, [r1] adds r0, r2, 0 bl move_anim_task_del @0811549C: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 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 .pool 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, =0x02020630 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 .pool thumb_func_end sub_8115588 thumb_func_start sub_8115600 sub_8115600: ; 8115600 push {lr} lsls r0, 24 lsrs r1, r0, 24 ldr r3, =0x0203841e movs r2, 0 ldr r0, =0x02038408 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 .pool 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, =0x0203841e ldrh r1, [r2] movs r0, 0x1 ands r0, r1 adds r6, r2, 0 cmp r0, 0 beq @08115648 ldr r0, =0x02038437 b @0811564A .align 2, 0 .pool @08115648: ldr r0, =0x02038436 @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, =sub_81156D0 ldrb r1, [r6, 0x2] bl AddTask lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e00 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, =0x000001ff 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, =0x02022e20 ldrh r0, [r4, 0xA] strh r0, [r2] ldr r0, =0x02022e22 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 .pool 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, =0x03005e00 adds r2, r0, r1 ldr r0, =0x0203841e movs r4, 0xE ldrsh r1, [r0, r4] movs r4, 0xE ldrsh r0, [r2, r4] cmp r1, r0 bne @08115710 ldr r0, =0x02022e20 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e22 strh r1, [r0] adds r0, r3, 0 bl remove_task b @0811571C .align 2, 0 .pool @08115710: ldr r1, =0x02022e20 ldrh r0, [r2, 0xA] strh r0, [r1] ldr r1, =0x02022e22 ldrh r0, [r2, 0xC] strh r0, [r1] @0811571C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81156D0 thumb_func_start sub_811572C sub_811572C: ; 811572C push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e 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, =0x02038436 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 .pool @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, =0x0203841e ldrh r0, [r0, 0x8] strh r0, [r4, 0x34] ldr r1, =sub_8115798 str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =sub_8115884 str r0, [r5, 0x1C] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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 .pool thumb_func_end sub_8115884 thumb_func_start sub_81158A4 sub_81158A4: ; 81158A4 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203841e 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, =sub_81158F8 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =sub_8115984 str r0, [r4, 0x1C] b @0811597C .align 2, 0 .pool @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, =0x02037fd4 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 .pool thumb_func_end sub_8115984 thumb_func_start sub_81159B4 sub_81159B4: ; 81159B4 push {r4,lr} adds r4, r0, 0 ldr r1, =0x0203841e 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, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r1, =sub_80A634C str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 adds r4, r1 ldr r3, =0x0203841e 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, =sub_8115AA4 str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08115B06 ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r3 ldr r2, =0x0203841e 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, =0x0202406c ldrb r1, [r0] mov r9, r3 mov r8, r2 cmp r5, r1 bge @08115B74 ldr r0, =0x02038436 ldrb r3, [r0] ldr r7, =0x02038437 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, =sub_8115C18 str r0, [r4] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08115C7A ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 adds r4, r1 ldr r3, =0x0203841e 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, =sub_8115D2C str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08115D8E ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 adds r4, r1 ldr r5, =0x0203841e 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, =sub_8115E00 str r0, [r4] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08115E28: ldr r0, =0x02037fd4 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, =sub_8115EB8 str r0, [r4] b @08115EAC .align 2, 0 .pool @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, =0x03005e00 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @08115EFE ldr r1, =0x03005e00 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 .pool 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, =0x02038436 ldrb r6, [r0] ldr r0, =0x02038437 ldrb r7, [r0] ldr r4, =0x0203841e 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 .pool 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, =0x03005e00 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, =0x0203841e 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, =0x02038436 ldrb r0, [r0] mov r9, r0 ldr r0, =0x02038437 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, =0x0000ffff @08115FF8: movs r6, 0x1 adds r0, r6, 0 ands r0, r1 cmp r0, 0 beq @08116028 ldr r2, =0x02020630 ldr r0, =0x03005d70 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 .pool 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, =0x0203841e 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 .pool @081160DC: cmp r0, 0x2 beq @081160F4 b @08116104 @081160E2: ldr r1, =0x02022e20 b @081160F6 .align 2, 0 .pool @081160EC: ldr r1, =0x02022e22 b @081160F6 .align 2, 0 .pool @081160F4: ldr r1, =0x02021bbc @081160F6: adds r0, r4, 0 bl oamt_set_x3A_32 b @0811610C .align 2, 0 .pool @08116104: ldr r1, =0x02021bbe 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, =0x0203841e 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, =sub_8116148 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202406c ldrb r0, [r5] cmp r4, r0 bcs @081161DC ldr r2, =0x02020630 mov r12, r2 ldr r6, =0x020241e4 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 .pool thumb_func_end sub_8116148 thumb_func_start sub_81161F4 sub_81161F4: ; 81161F4 push {r4-r6,lr} ldr r6, =0x02020630 ldr r4, =0x020241e4 ldr r5, =0x02038436 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, =0x02038437 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, =0x0203841e 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 .pool @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, =0x03005e00 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 adds r2, r1 ldr r3, =0x0203841e 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, =0x02022e20 ldrh r1, [r3] strh r1, [r4] ldr r4, =0x02022e22 ldrh r1, [r3, 0x2] strh r1, [r4] ldr r1, =sub_81162F8 str r1, [r2] bl _call_via_r1 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02022e20 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 .pool @08116330: ldrh r0, [r3, 0x8] @08116332: strh r0, [r6] ldr r2, =0x02022e22 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 .pool @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, =0x0203841e 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 .pool @081163AC: adds r0, r5, 0 movs r1, 0x1 bl sub_80A6980 @081163B4: ldr r0, =sub_80A67BC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8116388 thumb_func_start sub_81163D0 sub_81163D0: ; 81163D0 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203841e 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 .pool @081163F4: adds r0, r5, 0 movs r1, 0x1 bl sub_80A6980 @081163FC: ldr r0, =0x0203841e ldrh r0, [r0, 0x8] strh r0, [r5, 0x2E] ldr r0, =sub_80A67BC str r0, [r5, 0x1C] ldr r1, =sub_810E2C8 adds r0, r5, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81163D0 thumb_func_start sub_8116420 sub_8116420: ; 8116420 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08116444 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 bne @08116444 ldr r1, =0x0203841e 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 .pool thumb_func_end sub_8116420 thumb_func_start sub_8116458 sub_8116458: ; 8116458 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e 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 .pool @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, =0x0000ffe8 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, =0x0000fff4 adds r0, r1 ldrh r1, [r4, 0x26] adds r0, r1 strh r0, [r4, 0x26] ldr r1, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8116458 thumb_func_start sub_81164F0 sub_81164F0: ; 81164F0 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203841e ldrb r0, [r5] bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x2E] ldr r2, =0x02020630 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 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, =move_anim_8074EE0 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A67BC str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81164F0 thumb_func_start sub_8116560 sub_8116560: ; 8116560 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203841e 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 .pool @0811657C: adds r0, r4, 0 movs r1, 0x1 bl sub_80A6980 @08116584: ldr r0, =0x0203841e ldrh r0, [r0, 0x6] strh r0, [r4, 0x2E] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A64B0 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8116560 thumb_func_start sub_81165A8 sub_81165A8: ; 81165A8 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203841e 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 .pool @081165CC: adds r0, r5, 0 movs r1, 0x1 bl sub_80A6980 @081165D4: ldr r0, =sub_81165E4 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x7 bhi @0811670E lsls r0, 2 ldr r1, =@08116698 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02038436 b @081166CA .align 2, 0 .pool @081166C4: movs r5, 0 @081166C6: mov r0, sp ldr r1, =0x02038437 @081166CA: ldrb r1, [r1] strb r1, [r0] b @0811670E .align 2, 0 .pool @081166D4: mov r1, sp ldr r0, =0x02038436 ldrb r0, [r0] strb r0, [r1] ldr r0, =0x02038437 ldrb r0, [r0] strb r0, [r1, 0x1] b @0811670E .align 2, 0 .pool @081166EC: mov r1, sp movs r0, 0xFF strb r0, [r1] b @0811670E @081166F4: movs r5, 0 mov r2, sp ldr r0, =0x02038436 b @08116706 .align 2, 0 .pool @08116700: movs r5, 0 mov r2, sp ldr r0, =0x02038437 @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 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] bl sub_811583C adds r2, r0, 0 ldr r0, =0x02022ff0 ldrb r0, [r0] cmp r0, 0x9 bhi @08116832 lsls r0, 2 ldr r1, =@0811678C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203841e ldr r0, =0x00000b0c b @08116830 .align 2, 0 .pool @081167C4: ldr r1, =0x0203841e movs r0, 0x9E lsls r0, 4 b @08116830 .align 2, 0 .pool @081167D0: ldr r1, =0x0203841e ldr r0, =0x00002f1e b @08116830 .align 2, 0 .pool @081167E0: ldr r1, =0x0203841e movs r0, 0x90 lsls r0, 7 b @08116830 .align 2, 0 .pool @081167EC: ldr r1, =0x0203841e ldr r0, =0x00007ecb b @08116830 .align 2, 0 .pool @081167FC: ldr r1, =0x0203841e ldr r0, =0x00007ecb b @08116830 .align 2, 0 .pool @0811680C: ldr r1, =0x0203841e ldr r0, =0x00002a16 b @08116830 .align 2, 0 .pool @0811681C: ldr r1, =0x0203841e ldr r0, =0x00000d2e b @08116830 .align 2, 0 .pool @0811682C: ldr r1, =0x0203841e ldr r0, =0x00007fff @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 .pool 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, =0x0203841e 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 .pool thumb_func_end sub_8116848 thumb_func_start sub_8116874 sub_8116874: ; 8116874 push {lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x03005e00 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, =0x0203841e 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, =sub_81168B8 str r1, [r2] bl _call_via_r1 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x0203841e 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81169A0 str r1, [r0] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8116960 thumb_func_start sub_81169A0 sub_81169A0: ; 81169A0 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 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 .pool 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, =0x03005e00 adds r1, r0 ldr r2, =0x0203841e 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, =sub_81169F8 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 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, =sub_8116AD0 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 .pool @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, =0x03005e00 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 .pool 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, =0x02022e24 strh r7, [r0] ldr r0, =0x02022e26 strh r7, [r0] ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00003f3d movs r0, 0x4A bl lcd_io_set movs r1, 0x80 lsls r1, 8 movs r0, 0 bl lcd_io_set_bits ldr r1, =0x00003f42 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000c08 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, =0x02038436 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, =0x02020630 ldr r1, =0x020241e4 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r5, [r0] b @08116CAC .align 2, 0 .pool @08116C64: ldr r4, =0x02038436 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08116C90 ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @08116CA0 .align 2, 0 .pool @08116C90: ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @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, =0x02038436 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, =gUnknown_08C20684 mov r0, sp movs r2, 0 bl sub_80A6D60 mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08C20668 mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r0, =gUnknown_08597418 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 adds r1, 0x1 movs r2, 0x2 bl gpu_pal_apply ldr r2, =0x02022e18 ldr r0, =0x02020630 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, =0x02022e1a ldrh r0, [r1, 0x22] negs r0, r0 adds r0, 0x20 strh r0, [r2] ldr r1, =0x03005e00 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, =sub_8116D64 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 .pool 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, =0x03005e00 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, =0x02022e1a 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, =0x02022e24 mov r1, r8 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r4, =0x00003f3f 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, =0x02020630 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, =0x020241e4 ldr r0, =0x02038436 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 .pool 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, =0x0203a110 movs r0, 0x18 bl malloc_and_clear str r0, [r4] movs r2, 0 ldr r3, =0x0203841e @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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_8116F04 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a110 ldr r1, [r0] movs r2, 0x8 ldrsh r0, [r1, r2] cmp r0, 0 bne @08116F24 ldr r0, =0x02038436 b @08116F26 .align 2, 0 .pool @08116F24: ldr r0, =0x02038437 @08116F26: ldrb r0, [r0] strb r0, [r1] ldr r4, =0x0203a110 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, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00003f3d movs r0, 0x4A bl lcd_io_set movs r1, 0x80 lsls r1, 8 movs r0, 0 bl lcd_io_set_bits ldr r1, =0x00003f42 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, =0x0203a110 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, =0x02020630 ldr r1, =0x020241e4 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, =0x0203a110 ldr r1, [r0] ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r0, [r0] b @081170C4 .align 2, 0 .pool @08117078: ldr r4, =0x0203a110 ldr r0, [r4] ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @081170A8 ldr r1, =0x0202406e ldr r0, [r4] ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @081170BA .align 2, 0 .pool @081170A8: ldr r1, =0x0202406e ldr r0, [r4] ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @081170BA: adds r0, r1 movs r1, 0xB bl pokemon_getattr ldr r1, [r4] @081170C4: strh r0, [r1, 0x14] ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_81170EC str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r4, =0x0203a110 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, =gUnknown_08C2D930 mov r0, sp movs r2, 0 bl sub_80A6D60 b @08117162 .align 2, 0 .pool @08117158: ldr r1, =gUnknown_08C2DA4C mov r0, sp movs r2, 0 bl sub_80A6D60 @08117162: mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08C2D720 mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r0, =0x0203a110 ldr r0, [r0] movs r1, 0x6 ldrsh r0, [r0, r1] cmp r0, 0x6 bhi @081171F8 lsls r0, 2 ldr r1, =@08117198 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08117198: .4byte @081171B4 .4byte @081171BC .4byte @081171C4 .4byte @081171CC .4byte @081171D4 .4byte @081171DC .4byte @081171E4 @081171B4: ldr r0, =gUnknown_08C2DB88 b @081171E6 .align 2, 0 .pool @081171BC: ldr r0, =gUnknown_08C2DB68 b @081171E6 .align 2, 0 .pool @081171C4: ldr r0, =gUnknown_08C2DBA8 b @081171E6 .align 2, 0 .pool @081171CC: ldr r0, =gUnknown_08C2DBC8 b @081171E6 .align 2, 0 .pool @081171D4: ldr r0, =gUnknown_08C2DC08 b @081171E6 .align 2, 0 .pool @081171DC: ldr r0, =gUnknown_08C2DC28 b @081171E6 .align 2, 0 .pool @081171E4: ldr r0, =gUnknown_08C2DC48 @081171E6: mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette b @08117206 .align 2, 0 .pool @081171F8: ldr r0, =gUnknown_08C2DBE8 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette @08117206: ldr r3, =0x02022e18 movs r2, 0 strh r2, [r3] ldr r0, =0x02022e1a strh r2, [r0] ldr r1, =0x0203a110 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, =0x03005e00 lsls r3, r5, 2 adds r0, r3, r5 lsls r0, 3 adds r0, r2 ldr r1, =0x0000fffd b @08117254 .align 2, 0 .pool @08117248: ldr r2, =0x03005e00 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 .pool @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, =0x020241e4 ldrb r0, [r3, 0x1] adds r0, r2 ldrb r0, [r0] strh r0, [r1, 0x16] ldr r0, =sub_81172EC 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 .pool @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, =0x02022e1a ldr r1, =0x03005e00 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 .pool @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, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r4, =0x00003f3f 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, =0x02020630 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, =0x0203a110 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 .pool 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, =0x03005e00 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, =0x0000ffff ands r6, r1 adds r0, r6, 0 bl sub_81175C4 strh r6, [r4, 0x26] strh r5, [r4, 0x8] strh r5, [r4, 0xA] ldr r0, =sub_8117500 str r0, [r4] add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x0000ffff 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 .pool @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, =0x02037b14 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 .pool 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, =0x02038436 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, =0x0203841e 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 .pool 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, =sub_81176D8 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r5, r0, 24 ldr r4, =0x0203841e movs r1, 0x4 ldrsh r0, [r4, r1] cmp r0, 0 beq @0811769C ldr r0, =0x02038436 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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r2, =0x0203841e 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 .pool 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, =0x03005e00 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, =0x02022e20 lsls r0, r3, 16 asrs r0, 24 ldrh r4, [r6] adds r0, r4 strh r0, [r6] ldr r4, =0x02022e22 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, =0x0203841e 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 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner ldr r1, =0x0203841e 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 .pool 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, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner ldr r1, =0x0203841e 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 .pool 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, =0x0203841e movs r4, 0 ldr r0, =0x02038436 ldrb r2, [r0] movs r0, 0x2 ldr r1, =0x02038437 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 .pool 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, =0x02020630 @081177EE: ldr r0, =0x02038436 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, =0x020241e4 adds r0, r4, r0 ldrb r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r6 ldr r1, =0x0203841e 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 .pool 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, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00003f3d movs r0, 0x4A bl lcd_io_set movs r1, 0x80 lsls r1, 8 movs r0, 0 bl lcd_io_set_bits ldr r1, =0x00003f42 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r4, [r0] b @081179A2 .align 2, 0 .pool @08117964: adds r0, r7, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08117988 ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @08117996 .align 2, 0 .pool @08117988: ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @08117996: adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 @081179A2: ldr r5, =0x020241e4 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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] ldr r1, =0x03005e00 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, =sub_8117A60 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 .pool 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, =0x03005e00 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, =0x02022e1a lsls r1, r4, 16 asrs r1, 24 ldrh r0, [r2] subs r0, r1 strh r0, [r2] b @08117AB0 .align 2, 0 .pool @08117AA4: ldr r1, =0x02022e1a 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 .pool @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, =0x02022e24 strh r4, [r0] ldr r0, =0x02022e26 strh r4, [r0] ldr r4, =0x00003f3f 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, =0x02020630 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 .pool thumb_func_end sub_8117A60 thumb_func_start sub_8117C24 sub_8117C24: ; 8117C24 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x0203841e ldr r1, =0x02022ff0 ldrb r1, [r1] strh r1, [r2] bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244d4 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 .pool 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, =0x020244d4 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 .pool 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, =0x0203841e 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 .pool @08117CE4: cmp r0, 0x1 bne @08117CF0 ldr r0, =0x02038436 b @08117CF6 .align 2, 0 .pool @08117CF0: cmp r0, 0x2 bne @08117CFC ldr r0, =0x02038437 @08117CF6: ldrb r0, [r0] adds r4, r0, 0 adds r4, 0x10 @08117CFC: ldr r0, =0x020244d4 ldr r1, [r0] ldr r0, =0x0203841e 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, =0x02037714 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 .pool 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, =0x0203841e 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 .pool @08117D80: cmp r0, 0x1 bne @08117D8C ldr r0, =0x02038436 b @08117D92 .align 2, 0 .pool @08117D8C: cmp r0, 0x2 bne @08117D98 ldr r0, =0x02038437 @08117D92: ldrb r0, [r0] adds r4, r0, 0 adds r4, 0x10 @08117D98: lsls r0, r4, 5 ldr r1, =0x02037714 adds r0, r1 ldr r1, =0x020244d4 ldr r2, [r1] ldr r1, =0x0203841e 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 .pool 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, =0x0203841e 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 .pool @08117E1C: cmp r0, 0x1 bne @08117E28 ldr r0, =0x02038436 b @08117E2E .align 2, 0 .pool @08117E28: cmp r0, 0x2 bne @08117E34 ldr r0, =0x02038437 @08117E2E: ldrb r0, [r0] adds r4, r0, 0 adds r4, 0x10 @08117E34: lsls r1, r4, 5 ldr r0, =0x02037714 adds r0, r1, r0 ldr r2, =0x02037b14 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 .pool 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, =0x0203841e movs r0, 0x1 strh r0, [r1, 0xE] b @08117E84 .align 2, 0 .pool @08117E80: ldr r0, =0x0203841e strh r1, [r0, 0xE] @08117E84: adds r0, r4, 0 bl move_anim_task_del pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8117E60 thumb_func_start sub_8117E94 sub_8117E94: ; 8117E94 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x02038436 ldr r1, =0x0202420c ldrb r1, [r1] strb r1, [r2] ldr r2, =0x02038437 ldr r1, =0x0202420e ldrb r1, [r1] strb r1, [r2] bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner adds r4, r0, 0 ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r4, 24 lsls r0, 24 cmp r4, r0 bne @08117EF8 ldr r1, =0x0203841e movs r0, 0x1 b @08117EFC .align 2, 0 .pool @08117EF8: ldr r1, =0x0203841e 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 .pool thumb_func_end sub_8117EC4 thumb_func_start sub_8117F10 sub_8117F10: ; 8117F10 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x02038437 ldr r1, =0x0202420c ldrb r1, [r1] strb r1, [r2] bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8117F10 thumb_func_start sub_8117F30 sub_8117F30: ; 8117F30 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x02038436 ldr r1, =0x0202420b ldrb r1, [r1] strb r1, [r2] ldr r2, =0x02038437 ldr r1, =0x0202420e ldrb r1, [r1] strb r1, [r2] bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r3, r4, 2 adds r3, r4 lsls r3, 3 adds r3, r0 ldr r0, =0x020244d0 ldr r4, [r0] ldr r2, =0x02038436 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, =sub_8117FD0 str r0, [r3] ldr r1, =0x020383fe ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] @08117FB4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r2, 0xE ldrsh r1, [r0, r2] movs r0, 0x80 lsls r0, 5 cmp r1, r0 bne @08118014 ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02038436 ldrb r3, [r0] ldr r0, [r1] lsls r3, 2 adds r3, r0 ldr r1, =0x03005e00 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 .pool 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, =gUnknown_0859741A adds r0, r6, r0 ldrb r0, [r0] bl lcd_io_get ldr r1, =0x0203a114 strh r0, [r1] cmp r5, 0x6 bhi @08118124 lsls r0, r5, 2 ldr r1, =@08118068 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08118068: .4byte @08118084 .4byte @08118098 .4byte @081180B0 .4byte @081180C8 .4byte @081180E0 .4byte @081180FC .4byte @08118110 @08118084: ldr r2, =0x0203a114 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 .pool @08118098: ldr r3, =0x0203a114 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 .pool @081180B0: ldr r3, =0x0203a114 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 .pool @081180C8: ldr r3, =0x0203a114 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 .pool @081180E0: ldr r3, =0x0203a114 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 .pool @081180FC: ldr r2, =0x0203a114 lsls r3, r4, 7 ldrb r1, [r2] movs r0, 0x7F ands r0, r1 orrs r0, r3 strb r0, [r2] b @08118124 .align 2, 0 .pool @08118110: ldr r3, =0x0203a114 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, =gUnknown_0859741A adds r0, r6, r0 ldrb r0, [r0] ldr r1, =0x0203a114 ldrh r1, [r1] bl lcd_io_set @08118132: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0859741E 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, =@08118174 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022fec ldr r0, [r2] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @08118208 ldr r0, =0x02038bce ldrh r1, [r0] ldr r0, =0x00000c03 cmp r1, r0 beq @08118208 ldr r0, =sub_8118D68 b @08118258 .align 2, 0 .pool @08118208: ldr r2, [r2] movs r0, 0x2 ands r0, r2 cmp r0, 0 beq @0811821C ldr r0, =task00_battle_intro_wireless b @08118258 .align 2, 0 .pool @0811821C: ldr r0, =0x003f0100 ands r0, r2 cmp r0, 0 beq @08118230 ldr r0, =task_battle_intro_anim b @08118258 .align 2, 0 .pool @08118230: movs r0, 0x80 lsls r0, 5 ands r2, r0 cmp r2, 0 beq @08118250 ldr r0, =gUnknown_82E9530 ldrb r0, [r0] cmp r0, 0x2 beq @08118250 movs r4, 0x3 ldr r0, =task00_battle_intro_80BC6C8 b @08118258 .align 2, 0 .pool @08118250: ldr r1, =gUnknown_08597424 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, =0x03005e00 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 .pool 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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] ldr r0, =0x02022e1c strh r1, [r0] ldr r0, =0x02022e1e 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, =0x00003f3f 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 .pool 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, =0x02022e18 ldrh r0, [r1] adds r0, 0x6 strh r0, [r1] ldr r1, =0x03005e00 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, =@08118330 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08118330: .4byte @08118344 .4byte @08118374 .4byte @0811839C .4byte @081183E4 .4byte @08118524 @08118344: ldr r0, =0x02022fec 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 .pool @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, =0x02022e26 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, =0x020243fc ldrh r1, [r2] ldr r0, =0x0000fffe ands r0, r1 strh r0, [r2] b @0811852A .align 2, 0 .pool @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, =0x02022e1a ldrh r1, [r2] ldr r0, =0x0000ffb0 cmp r1, r0 beq @0811842E subs r0, r1, 0x2 b @0811842C .align 2, 0 .pool @08118420: ldr r2, =0x02022e1a ldrh r1, [r2] ldr r0, =0x0000ffc8 cmp r1, r0 beq @0811842E subs r0, r1, 0x1 @0811842C: strh r0, [r2] @0811842E: ldr r2, =0x02022e26 ldrh r1, [r2] movs r0, 0xFF lsls r0, 8 ands r0, r1 cmp r0, 0 beq @08118442 ldr r3, =0xfffffc04 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, =0x02039b28 mov r9, r5 ldr r7, =0x02038c28 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, =0x02038c28 ldr r6, =0x02039b28 ldr r1, =0x03005e00 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, =0x0600e000 ldr r2, =0x05000200 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 .pool @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, =0x03005e00 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 .pool @08118568: cmp r0, 0x4 bne @08118580 @0811856C: ldr r1, =0x02022e18 ldrh r0, [r1] adds r0, 0x8 b @0811857E .align 2, 0 .pool @08118578: ldr r1, =0x02022e18 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, =0x02022e1a ldrh r0, [r4, 0x14] bl cosine2 lsls r0, 16 asrs r0, 16 cmp r0, 0 bge @081185A6 ldr r1, =0x000001ff 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 .pool @081185C8: adds r0, r1, 0x6 @081185CA: strh r0, [r4, 0x14] ldr r2, =0x03005e00 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, =@08118608 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08118608: .4byte @0811861C .4byte @0811864C .4byte @08118678 .4byte @081186C8 .4byte @08118814 @0811861C: ldr r1, =0x03005e00 adds r0, r6, r5 lsls r0, 3 adds r2, r0, r1 movs r3, 0x10 strh r3, [r2, 0x10] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @08118640 strh r3, [r2, 0xC] b @08118644 .align 2, 0 .pool @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, =0x03005e00 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 .pool @08118678: ldr r1, =0x02022e26 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, =0x03005e00 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, =0x020243fc ldrh r1, [r2] ldr r0, =0x0000fffe ands r0, r1 strh r0, [r2] b @0811881A .align 2, 0 .pool @081186C8: ldr r0, =0x03005e00 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, =0x00001842 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 .pool @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, =0x02022e26 ldrh r1, [r2] movs r0, 0xFF lsls r0, 8 ands r0, r1 cmp r0, 0 beq @0811873C ldr r3, =0xfffffc04 adds r0, r1, r3 strh r0, [r2] @0811873C: ldr r0, =0x03005e00 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, =0x02039b28 mov r8, r0 ldr r2, =0x02038c28 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, =0x02038c28 mov r12, r0 ldr r7, =0x02039b28 ldr r1, =0x03005e00 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, =0x03005e00 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, =0x0600e000 ldr r2, =0x05000200 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 .pool @08118814: adds r0, r5, 0 bl sub_811828C @0811881A: ldr r0, =0x03005e00 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 .pool 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, =0x02022e18 ldrh r0, [r1] adds r0, 0x8 strh r0, [r1] ldr r1, =0x03005e00 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, =@08118884 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08118884: .4byte @08118898 .4byte @081188F0 .4byte @0811891C .4byte @0811896C .4byte @08118A90 @08118898: ldr r1, =0x00001842 movs r0, 0x50 bl lcd_io_set ldr r4, =0x00000808 movs r0, 0x52 adds r1, r4, 0 bl lcd_io_set movs r0, 0x54 movs r1, 0 bl lcd_io_set ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r2, r0, r1 strh r4, [r2, 0x10] ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 beq @081188E4 movs r0, 0x10 b @081188E6 .align 2, 0 .pool @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, =0x03005e00 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 .pool @0811891C: ldr r1, =0x02022e26 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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] movs r0, 0xF0 strh r0, [r1, 0xC] movs r0, 0x20 strh r0, [r1, 0xE] movs r0, 0x1 strh r0, [r1, 0x12] ldr r2, =0x020243fc ldrh r1, [r2] ldr r0, =0x0000fffe ands r0, r1 strh r0, [r2] b @08118A96 .align 2, 0 .pool @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, =0x02022e26 ldrh r1, [r2] movs r0, 0xFF lsls r0, 8 ands r0, r1 cmp r0, 0 beq @081189BA ldr r3, =0xfffffc04 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, =0x02039b28 mov r8, r6 ldr r7, =0x02038c28 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, =0x02038c28 ldr r6, =0x02039b28 ldr r1, =0x03005e00 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, =0x03005e00 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, =0x0600e000 ldr r2, =0x05000200 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 .pool @08118A90: adds r0, r5, 0 bl sub_811828C @08118A96: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 movs r2, 0x8 ldrsh r0, [r1, r2] cmp r0, 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 .pool 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, =0x03005e00 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, =0x02022e18 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, =0x02022e1c ldrh r0, [r1] subs r0, 0x3 strh r0, [r1] b @08118B36 .align 2, 0 .pool @08118B18: str r5, [sp] ldr r1, =0x0600e000 ldr r4, =0x05000200 mov r0, sp adds r2, r4, 0 bl CpuSet str r5, [sp, 0x4] add r0, sp, 0x4 ldr r1, =0x0600f000 adds r2, r4, 0 bl CpuSet movs r0, 0x1 strh r0, [r7, 0x10] @08118B36: ldr r0, =0x03005e00 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, =@08118B6C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 ldr r5, =0x0202449c ldr r0, [r5] adds r0, 0x7D ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 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, =sub_8038B74 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, =0x00003f06 movs r0, 0x4A bl lcd_io_set b @08118D5A .align 2, 0 .pool @08118C38: ldr r1, =0x02022e26 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, =0x020243fc ldrh r1, [r2] ldr r0, =0x0000fffe ands r0, r1 strh r0, [r2] b @08118D5A .align 2, 0 .pool @08118C7C: ldr r2, =0x02022e26 ldrh r1, [r2] movs r0, 0xFF lsls r0, 8 ands r0, r1 cmp r0, 0 beq @08118C90 ldr r3, =0xfffffc04 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, =0x02039b28 mov r12, r0 ldr r2, =0x02038c28 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, =0x02038c28 mov r8, r0 ldr r7, =0x02039b28 ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 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, =@08118D98 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00005c0a movs r0, 0xA bl lcd_io_set ldr r1, =0x00005e0a movs r0, 0xC bl lcd_io_set movs r0, 0 bl lcd_io_get adds r1, r0, 0 ldr r2, =0x0000f040 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, =0x00003f3f movs r0, 0x4A bl lcd_io_set ldr r1, =0x02022e16 ldr r2, =0x0000ffd0 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x02022e18 movs r0, 0xF0 strh r0, [r1] ldr r1, =0x02022e1c subs r2, 0xC0 adds r0, r2, 0 strh r0, [r1] b @08118FB2 .align 2, 0 .pool @08118E4C: ldr r2, =0x02022e26 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, =0x020243fc ldrh r1, [r2] ldr r0, =0x0000fffe ands r0, r1 strh r0, [r2] b @08118FB2 .align 2, 0 .pool @08118EA8: ldr r3, =0x02022e26 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, =0x02022e18 ldrh r0, [r3, 0xC] strh r0, [r1] ldr r2, =0x02022e1c 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 .pool @08118F00: ldr r1, =0x02022e16 ldrh r0, [r1] adds r3, r0, 0x2 strh r3, [r1] ldr r1, =0x02022e1e ldrh r0, [r1] adds r0, 0x2 strh r0, [r1] ldr r5, =0x02022e26 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, =0x0600e000 ldr r2, =0x05000800 mov r0, sp bl CpuSet movs r0, 0 bl lcd_io_get ldr r1, =0x0000bfff 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, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] ldr r1, =0x03005e00 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 .pool @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, =0x020244d4 ldr r2, [r1] lsls r4, 2 adds r2, 0x4 adds r2, r4 ldr r1, =0x020244e4 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 .pool 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, =0x040000d4 ldr r0, =0x020244d4 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, =0x80000400 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 .pool thumb_func_end sub_8119094 thumb_func_start dp04_initiate_movement ; void dp04_initiate_movement(int dpad_direction, int buttons_new, int buttons_held) 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, =0x02037590 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 .pool @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, =gUnknown_0859744C 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 .pool 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, =0x02037590 ldrb r0, [r2, 0xB] cmp r0, 0 bne @08119208 strb r1, [r2, 0x2] movs r0, 0 b @0811921C .align 2, 0 .pool @081191F4: ldr r2, =0x02037590 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 .pool @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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 ldrb r1, [r4, 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 .pool @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, =0x02037590 ldrb r1, [r6, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool @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, =gUnknown_0859745C 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 .pool 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, =0x02037590 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 .pool @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, =gUnknown_0859745C 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 .pool thumb_func_end npc_state_reaction_to_tile thumb_func_start sub_81193C8 ; void sub_81193C8(int dpad_direction, int buttons_new, int buttons_held) 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, =gUnknown_08597468 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 .pool 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, =gUnknown_0859749C ldr r3, =0x02037590 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 .pool 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, =0x02037590 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 .pool @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, =0x02037590 cmp r0, r3 beq @081194BC @08119492: ldr r0, =0x02037590 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 .pool @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, =0x02037590 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 .pool @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, =0x02037590 ldrb r1, [r5, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool @08119594: ldrb r0, [r5, 0xA] adds r0, 0x1 strb r0, [r5, 0xA] @0811959A: ldr r1, =0x02037590 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 .pool @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, =0x02037590 ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool @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, =0x02037590 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 .pool 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, =0x02037590 ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool @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, =0x02037590 movs r0, 0x2 strb r0, [r1, 0x2] movs r0, 0xC b @08119750 .align 2, 0 .pool @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, =0x02037590 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 .pool 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, =0x02037590 ldrb r1, [r6, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r0, r1 ldrb r2, [r0, 0x1] movs r1, 0x3 negs r1, r1 ands r1, r2 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 .pool 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, =0x02037590 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 adds r4, r0, r1 ldrb r1, [r4, 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 .pool @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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool @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, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 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 .pool 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, =0x02037590 ldrb r1, [r7, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool @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, =0x02037590 ldrb r1, [r7, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool @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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool @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 ; void sub_8119C3C(int buttons_new, int buttons_held) sub_8119C3C: ; 8119C3C push {lr} lsls r0, 16 lsrs r3, r0, 16 lsls r1, 16 lsrs r2, r1, 16 ldr r0, =0x02037590 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 .pool thumb_func_end sub_8119C3C thumb_func_start sub_8119C64 ; void sub_8119C64(int buttons_new, int buttons_held) 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, =0x02037590 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 .pool @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, =0x02037590 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 .pool @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, =0x020375a4 @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, =0x020375ac @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 .pool @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, =gUnknown_085974C0 adds r4, r5, r0 ldr r0, =0x02037590 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 .pool @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, =0x02037590 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 .pool thumb_func_end sub_8119D80 thumb_func_start sub_8119DBC sub_8119DBC: ; 8119DBC push {r4,lr} lsls r0, 24 ldr r3, =0x02037590 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 .pool 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, =0x02037590 ldrb r0, [r0, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 adds r4, r0 ldrh r1, [r4, 0x10] add r0, sp, 0x4 strh r1, [r0] ldrh r0, [r4, 0x12] mov r5, sp adds r5, 0x6 strh r0, [r5] adds r0, r6, 0 add r1, sp, 0x4 adds r2, r5, 0 bl 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 .pool 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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x8 bne @08119F10 @08119F08: movs r0, 0x1 b @08119F12 .align 2, 0 .pool @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, =0x0203ab54 ldrb r0, [r0] cmp r0, 0 beq @08119F66 ldr r1, =0x0203ab55 ldrb r0, [r1] cmp r0, 0x63 bhi @08119F66 adds r0, 0x1 strb r0, [r1] @08119F66: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037590 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 .pool @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, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x1E] bl sub_8089954 lsls r0, 24 cmp r0, 0 beq @0811A078 movs r0, 0 b @0811A07A .align 2, 0 .pool @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, =0x02037348 movs r0, 0 strb r0, [r1] ldr r0, =0x02037590 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 .pool @0811A0B0: adds r0, r2, 0 bl walkrun_set_bike_bits ldr r4, =0x00000193 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 .pool thumb_func_end sub_811A080 thumb_func_start sub_811A0D0 sub_811A0D0: ; 811A0D0 push {lr} ldr r2, =0x02037590 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, =0x020375ac 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 .pool thumb_func_end sub_811A0D0 thumb_func_start sub_811A114 sub_811A114: ; 811A114 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02037590 strb r0, [r2, 0xA] lsrs r1, r0, 1 adds r0, r1 strb r0, [r2, 0xB] bx lr .align 2, 0 .pool thumb_func_end sub_811A114 thumb_func_start sub_811A128 sub_811A128: ; 811A128 ldr r1, =0x02037590 movs r0, 0 strb r0, [r1, 0xA] strb r0, [r1, 0xB] bx lr .align 2, 0 .pool thumb_func_end sub_811A128 thumb_func_start sub_811A138 sub_811A138: ; 811A138 push {lr} sub sp, 0x8 ldr r1, =gUnknown_085974B8 mov r0, sp movs r2, 0x6 bl memcpy ldr r2, =0x02037590 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 .pool @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, =0x02037590 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 .pool 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, =0x02037318 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 .pool @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, =sub_811A2C0 movs r1, 0 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r1, =0x03005e00 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, =sub_811A278 bl set_callback2 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool 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, =sub_811A2FC adds r0, r4, 0 bl sub_811A2A4 @0811A2F2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r5, r0, r1 movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0x5 bls @0811A318 b @0811A41C @0811A318: lsls r0, 2 ldr r1, =@0811A32C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0811A32C: .4byte @0811A344 .4byte @0811A370 .4byte @0811A3CC .4byte @0811A3D4 .4byte @0811A3EC .4byte @0811A40C @0811A344: ldr r0, =sub_811A290 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 .pool @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, =0x02037fd4 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 .pool @0811A3EC: ldr r0, =0x02037fd4 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 .pool @0811A40C: ldr r0, =0x02037fd4 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 .pool 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, =0x03005e08 adds r6, r0, r1 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0x4 bhi @0811A4BC lsls r0, 2 ldr r1, =@0811A454 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020375e0 ldrh r0, [r0] cmp r0, 0x14 bls @0811A4FE b @0811A7D4 @0811A4FE: lsls r0, 2 ldr r1, =@0811A510 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002bb0 adds r4, r0, r1 b @0811A7C2 .align 2, 0 .pool @0811A578: ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002bbc adds r4, r0, r2 b @0811A7C2 .align 2, 0 .pool @0811A58C: ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00002bc8 adds r4, r0, r3 b @0811A7C2 .align 2, 0 .pool @0811A5A0: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002bd4 adds r4, r0, r1 b @0811A7C2 .align 2, 0 .pool @0811A5B4: ldr r2, =0x03005d8c ldr r0, =0x020375e2 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r3, =0x00002be0 adds r0, r3 ldr r1, [r2] adds r4, r1, r0 b @0811A7C2 .align 2, 0 .pool @0811A5D8: ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002e36 adds r1, r0, r2 ldr r3, =0x00002e2a 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 .pool @0811A604: ldr r2, =0x03005d8c ldr r0, =0x020375e2 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, [r2] adds r0, r1 ldr r1, =0x000027d0 adds r4, r0, r1 ldr r0, =0x020375e4 ldrb r5, [r0] b @0811A7C2 .align 2, 0 .pool @0811A630: ldr r2, =0x03005d8c ldr r0, =0x020375e2 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r3, =0x000027cc adds r0, r3 ldr r1, [r2] adds r1, r0 ldr r0, =0x020375e4 ldrh r0, [r0] lsls r0, 1 adds r0, 0x1C adds r4, r1, r0 movs r5, 0x1 b @0811A7C2 .align 2, 0 .pool @0811A664: ldr r2, =0x03005d8c ldr r0, =0x020375e2 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, [r2] adds r0, r1 ldr r1, =0x000027ce adds r4, r0, r1 movs r5, 0 b @0811A7C2 .align 2, 0 .pool @0811A688: ldr r4, =0x02021ec4 ldr r1, =0x03005d8c ldr r0, [r1] ldr r2, =0x00002e6c adds r0, r2 ldrh r0, [r0] strh r0, [r4] ldr r0, [r1] ldr r3, =0x00002e6e adds r0, r3 ldrh r0, [r0] strh r0, [r4, 0x2] b @0811A7C2 .align 2, 0 .pool @0811A6B4: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002baa adds r4, r0, r1 ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r4] movs r5, 0x1 b @0811A7C2 .align 2, 0 .pool @0811A6D4: ldr r2, =0x03005d8c ldr r0, =0x020375e2 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r3, =0x000027cc adds r0, r3 ldr r1, [r2] adds r1, r0 ldr r0, =0x020375e4 ldrh r0, [r0] lsls r0, 1 adds r0, 0x4 adds r4, r1, r0 movs r5, 0 b @0811A7C2 .align 2, 0 .pool @0811A708: ldr r2, =0x03005d8c ldr r0, =0x020375e2 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, [r2] adds r0, r1 ldr r1, =0x000027e4 adds r4, r0, r1 movs r5, 0x1 b @0811A7C2 .align 2, 0 .pool @0811A72C: ldr r4, =0x02021ec4 adds r0, r4, 0 movs r1, 0x2 bl sub_811F88C b @0811A7C2 .align 2, 0 .pool @0811A73C: ldr r2, =0x03005d8c ldr r0, =0x020375e2 ldrh r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r3, =0x000027cc adds r0, r3 ldr r1, [r2] adds r1, r0 adds r4, r1, 0 adds r4, 0x14 ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r1, 0x14] movs r5, 0x2 b @0811A7C2 .align 2, 0 .pool @0811A770: ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00003b6e adds r4, r0, r3 b @0811A7C2 .align 2, 0 .pool @0811A784: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b5a adds r4, r0, r1 b @0811A7C2 .align 2, 0 .pool @0811A798: ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b6c adds r4, r0, r2 b @0811A7C2 .align 2, 0 .pool @0811A7AC: ldr r0, =0x03005d90 ldr r0, [r0] movs r3, 0x82 lsls r3, 1 adds r4, r0, r3 b @0811A7C2 .align 2, 0 .pool @0811A7BC: bl sub_801B058 adds r4, r0, 0 @0811A7C2: bl overworld_free_bg_tilemaps ldr r0, =0x020375e0 ldrb r0, [r0] ldr r2, =sub_80861B0 adds r1, r4, 0 adds r3, r5, 0 bl sub_811A20C @0811A7D4: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811A4F0 thumb_func_start sub_811A7E4 sub_811A7E4: ; 811A7E4 push {lr} bl fade_and_return_progress_probably ldr r0, =0x030022c0 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 .pool @0811A804: movs r0, 0x1 movs r1, 0 bl fade_screen b @0811A840 @0811A80E: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0811A84E ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 ldr r1, =0x0000ffff strh r1, [r0, 0x16] bl overworld_free_bg_tilemaps bl sub_811A8F0 b @0811A84E .align 2, 0 .pool @0811A840: ldr r1, =0x030022c0 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 .pool thumb_func_end sub_811A7E4 thumb_func_start sub_811A858 sub_811A858: ; 811A858 push {lr} ldr r0, =sub_811A7E4 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08597530 @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 .pool 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, =gUnknown_08597530 lsls r4, 3 adds r0, 0x4 adds r4, r0 ldr r0, [r4] bl sub_811A4D0 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811A8A4 thumb_func_start sub_811A8CC sub_811A8CC: ; 811A8CC push {lr} ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003b6e adds r1, r0 ldr r2, =sub_80861B0 movs r0, 0xF movs r3, 0x3 bl sub_811A20C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811A8CC thumb_func_start sub_811A8F0 sub_811A8F0: ; 811A8F0 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003b5a adds r1, r0 ldr r2, =sub_80861B0 movs r0, 0x10 movs r3, 0x3 bl sub_811A20C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811A8F0 thumb_func_start sub_811A914 sub_811A914: ; 811A914 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003b6c adds r1, r0 ldr r2, =sub_80861B0 movs r0, 0x12 movs r3, 0x3 bl sub_811A20C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811A914 thumb_func_start sub_811A938 sub_811A938: ; 811A938 push {lr} ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003b5a adds r1, r0 ldr r2, =sub_80861B0 movs r0, 0x11 movs r3, 0x3 bl sub_811A20C pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a118 movs r0, 0x50 bl malloc str r0, [r4] cmp r0, 0 bne @0811A984 movs r0, 0 b @0811AA7E .align 2, 0 .pool @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, =gUnknown_08597550 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, =0x0203a118 ldr r2, [r3] ldr r1, =gUnknown_08597550 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 .pool @0811AA34: movs r3, 0 ldr r0, [r4] ldrb r0, [r0, 0x7] cmp r3, r0 bge @0811AA5C adds r6, r4, 0 ldr r1, =0x0000ffff 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, =0x0203a118 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 .pool thumb_func_end sub_811A95C thumb_func_start sub_811AA90 sub_811AA90: ; 811AA90 push {r4,lr} ldr r4, =0x0203a118 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 .pool thumb_func_end sub_811AA90 thumb_func_start sub_811AAAC sub_811AAAC: ; 811AAAC push {lr} ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r0, 0xA bhi @0811AB3E lsls r0, 2 ldr r1, =@0811AACC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0811ABB8 bl sub_811BF78 ldr r1, =0x0203a118 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 .pool @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, =0x0203a118 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, =gUnknown_08597550 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 .pool @0811AC48: ldr r2, =0x0203a118 ldr r1, [r2] ldrb r0, [r1, 0x5] adds r0, 0x1 strb r0, [r1, 0x5] b @0811ABDA .align 2, 0 .pool @0811AC58: ldr r2, =0x0203a118 ldr r1, [r2] ldrb r0, [r1, 0x6] adds r0, 0x1 b @0811ABD8 .align 2, 0 .pool @0811AC68: ldr r2, =0x0203a118 ldr r1, [r2] ldrb r0, [r1, 0x5] subs r0, 0x1 strb r0, [r1, 0x5] b @0811ABDA .align 2, 0 .pool @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, =0x00ffff00 ands r0, r1 ldr r1, =0x00040100 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 .pool thumb_func_end sub_811AB68 thumb_func_start sub_811ACDC sub_811ACDC: ; 811ACDC push {r4-r6,lr} ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0811AD4A ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0x5] lsls r0, 24 asrs r0, 24 cmp r0, 0x1 beq @0811AD3E b @0811AD24 .align 2, 0 .pool @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, =0x0203a118 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, =gUnknown_08597550 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 .pool @0811ADC0: ldr r2, =0x0203a118 ldr r1, [r2] ldrb r0, [r1, 0x5] adds r0, 0x1 strb r0, [r1, 0x5] b @0811AD6E .align 2, 0 .pool @0811ADD0: ldr r1, =0x0203a118 ldr r0, [r1] strb r3, [r0, 0x6] adds r6, r1, 0 b @0811AD70 .align 2, 0 .pool @0811ADE0: ldr r2, =0x0203a118 ldr r1, [r2] ldrb r0, [r1, 0x5] subs r0, 0x1 strb r0, [r1, 0x5] b @0811AD6E .align 2, 0 .pool @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, =0x00ffff00 ands r0, r1 ldr r1, =0x00040100 cmp r0, r1 bne @0811AE28 movs r0, 0 strb r0, [r2, 0x5] @0811AE28: ldr r0, =0x0203a118 ldr r1, [r0] movs r0, 0 strb r0, [r1, 0x4] movs r0, 0x2 @0811AE32: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_811ACDC thumb_func_start sub_811AE44 sub_811AE44: ; 811AE44 push {lr} ldr r1, =0x030022c0 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 .pool @0811AE60: movs r0, 0x1 ands r0, r2 cmp r0, 0 beq @0811AEAE ldr r0, =0x0203a118 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 .pool @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, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0811AF24 ldr r0, =0x0203a118 ldr r1, [r0] movs r0, 0x2 strb r0, [r1, 0x4] movs r0, 0xE b @0811AF86 .align 2, 0 .pool @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, =0x0203a118 ldr r1, [r1] strb r0, [r1, 0x4] movs r0, 0x7 b @0811AFE6 .align 2, 0 .pool @0811AFC0: ldr r0, =0x020375f0 strh r1, [r0] ldr r0, =0x0203a118 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 .pool @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, =0x0203a118 ldr r1, [r1] strb r0, [r1, 0x4] movs r0, 0x7 b @0811B03A .align 2, 0 .pool @0811B020: bl sub_811BE9C ldr r4, =0x020375f0 bl sub_811B4EC strh r0, [r4] bl sub_811B3E4 movs r0, 0x18 b @0811B03A .align 2, 0 .pool @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, =0x0203a118 ldr r1, [r0] movs r0, 0x1 strb r0, [r1, 0x4] movs r0, 0x7 b @0811B086 .align 2, 0 .pool @0811B070: bl sub_811B418 ldr r0, =0x0203a118 ldr r1, [r0] movs r0, 0x1 strb r0, [r1, 0x4] movs r0, 0x8 b @0811B086 .align 2, 0 .pool @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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0811B0A4 movs r0, 0x1A b @0811B0B8 .align 2, 0 .pool @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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @0811B0D4 movs r0, 0 b @0811B0E0 .align 2, 0 .pool @0811B0D4: bl sub_811B2A4 ldr r1, =0x0203a118 ldr r1, [r1] strb r0, [r1, 0x4] movs r0, 0x7 @0811B0E0: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_811B0BC thumb_func_start sub_811B0E8 sub_811B0E8: ; 811B0E8 ldr r0, =0x0203a118 ldr r1, [r0] movs r0, 0xA strb r0, [r1, 0x4] movs r0, 0x6 bx lr .align 2, 0 .pool 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, =0x0203a118 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 .pool @0811B134: ldr r4, =0x020375f0 bl sub_811B4EC strh r0, [r4] bl sub_811B3E4 movs r0, 0x18 b @0811B14A .align 2, 0 .pool @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, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @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, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0x8] bx lr .align 2, 0 .pool thumb_func_end sub_811B2A4 thumb_func_start sub_811B2B0 sub_811B2B0: ; 811B2B0 push {lr} ldr r0, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @0811B324: movs r0, 0 @0811B326: pop {r1} bx r1 thumb_func_end sub_811B2B0 thumb_func_start sub_811B32C sub_811B32C: ; 811B32C ldr r0, =0x0203a118 ldr r1, [r0] movs r0, 0 strb r0, [r1, 0x4] movs r0, 0xA bx lr .align 2, 0 .pool thumb_func_end sub_811B32C thumb_func_start sub_811B33C sub_811B33C: ; 811B33C push {lr} ldr r1, =0x0203a118 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 .pool @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, =0x0203a118 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x6 beq @0811B388 ldr r0, =0x0000ffff bl sub_811B488 movs r0, 0x1 b @0811B390 .align 2, 0 .pool @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, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool thumb_func_end sub_811B3E4 thumb_func_start sub_811B418 sub_811B418: ; 811B418 push {r4,r5,lr} movs r3, 0 ldr r2, =0x0203a118 ldr r0, [r2] ldrb r0, [r0, 0x7] cmp r3, r0 bge @0811B444 adds r5, r2, 0 ldr r0, =0x0000ffff 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 .pool thumb_func_end sub_811B418 thumb_func_start sub_811B454 sub_811B454: ; 811B454 push {r4,r5,lr} movs r4, 0 ldr r3, =0x0203a118 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 .pool 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, =0x0203a118 ldr r1, [r1] lsrs r0, 15 adds r1, 0x3C adds r1, r0 strh r4, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811B488 thumb_func_start sub_811B4AC sub_811B4AC: ; 811B4AC push {r4,r5,lr} movs r2, 0 ldr r0, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @0811B59C: subs r0, r3, 0x1 strb r0, [r1, 0xC] movs r0, 0x11 b @0811B62C @0811B5A4: ldr r0, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @0811B5F8: bl sub_811B744 b @0811B594 @0811B5FE: ldr r0, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @0811B660: movs r0, 0x3 @0811B662: strb r0, [r1, 0xB] bl sub_811B978 b @0811B6BA @0811B66A: ldr r0, =0x0203a118 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 .pool @0811B680: movs r0, 0 b @0811B662 @0811B684: ldr r0, =0x0203a118 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 .pool @0811B6A0: ldr r2, =0x0203a118 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 .pool 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, =0x0203a118 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 .pool @0811B6F4: strb r2, [r1, 0xB] b @0811B738 @0811B6F8: ldr r0, =0x0203a118 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 .pool @0811B710: movs r0, 0 b @0811B736 @0811B714: ldr r0, =0x0203a118 ldr r1, [r0] ldrb r0, [r1, 0xB] adds r0, 0x1 strb r0, [r1, 0xB] bl sub_811B768 b @0811B738 .align 2, 0 .pool @0811B728: ldr r2, =0x0203a118 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 .pool thumb_func_end sub_811B6C4 thumb_func_start sub_811B744 sub_811B744: ; 811B744 push {lr} ldr r2, =0x0203a118 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 .pool thumb_func_end sub_811B744 thumb_func_start sub_811B768 sub_811B768: ; 811B768 push {r4,lr} ldr r4, =0x0203a118 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 .pool @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, =@0811B7AC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0811B7AC: .4byte @0811B848 .4byte @0811B826 .4byte @0811B7C4 .4byte @0811B7F0 .4byte @0811B870 .4byte @0811B890 @0811B7C4: ldr r0, =0x0203a118 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 .pool @0811B7E8: subs r0, r3, 0x1 strb r0, [r1, 0xE] movs r4, 0x13 b @0811B81E @0811B7F0: ldr r0, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool @0811B83C: movs r0, 0x1 @0811B83E: strb r0, [r1, 0x10] bl sub_811B9A0 @0811B844: movs r0, 0x12 b @0811B8C2 @0811B848: ldr r4, =0x0203a118 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 .pool @0811B870: ldr r0, =0x0203a118 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 .pool @0811B888: movs r0, 0 @0811B88A: strb r0, [r2, 0xE] movs r0, 0x15 b @0811B8C2 @0811B890: ldr r3, =0x0203a118 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 .pool @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, =0x0203a118 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 .pool thumb_func_end sub_811B8C8 thumb_func_start sub_811B8E8 sub_811B8E8: ; 811B8E8 ldr r0, =0x0203a118 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 .pool thumb_func_end sub_811B8E8 thumb_func_start sub_811B908 sub_811B908: ; 811B908 push {lr} ldr r0, =0x0203a118 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, =gUnknown_08597748 lsls r1, r2, 3 subs r1, r2 adds r1, r3, r1 adds r1, r0 ldrb r0, [r1] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_811B908 thumb_func_start sub_811B940 sub_811B940: ; 811B940 ldr r0, =0x0203a118 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 .pool 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, =0x0203a118 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 .pool thumb_func_end sub_811B978 thumb_func_start sub_811B9A0 sub_811B9A0: ; 811B9A0 push {lr} b @0811B9B6 @0811B9A4: ldr r0, =0x0203a118 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 .pool thumb_func_end sub_811B9A0 thumb_func_start sub_811B9C8 sub_811B9C8: ; 811B9C8 push {r4,lr} ldr r4, =0x0203a118 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 .pool @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, =gUnknown_08597550 ldr r0, =0x0203a118 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 .pool thumb_func_end sub_811BA3C thumb_func_start sub_811BA5C sub_811BA5C: ; 811BA5C ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_811BA5C thumb_func_start sub_811BA68 sub_811BA68: ; 811BA68 ldr r2, =gUnknown_08597550 ldr r0, =0x0203a118 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 .pool thumb_func_end sub_811BA68 thumb_func_start sub_811BA88 sub_811BA88: ; 811BA88 ldr r0, =0x0203a118 ldr r0, [r0] ldr r0, [r0, 0x34] bx lr .align 2, 0 .pool thumb_func_end sub_811BA88 thumb_func_start sub_811BA94 sub_811BA94: ; 811BA94 ldr r0, =0x0203a118 ldr r0, [r0] adds r0, 0x3C bx lr .align 2, 0 .pool thumb_func_end sub_811BA94 thumb_func_start sub_811BAA0 sub_811BAA0: ; 811BAA0 ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0x3] bx lr .align 2, 0 .pool thumb_func_end sub_811BAA0 thumb_func_start sub_811BAAC sub_811BAAC: ; 811BAAC ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0x2] bx lr .align 2, 0 .pool thumb_func_end sub_811BAAC thumb_func_start sub_811BAB8 sub_811BAB8: ; 811BAB8 ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0x5] bx lr .align 2, 0 .pool thumb_func_end sub_811BAB8 thumb_func_start sub_811BAC4 sub_811BAC4: ; 811BAC4 ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0x6] bx lr .align 2, 0 .pool thumb_func_end sub_811BAC4 thumb_func_start sub_811BAD0 sub_811BAD0: ; 811BAD0 push {r4,r5,lr} ldr r4, =gUnknown_08597550 ldr r2, =0x0203a118 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 .pool thumb_func_end sub_811BAD0 thumb_func_start sub_811BB08 sub_811BB08: ; 811BB08 push {r4,r5,lr} ldr r4, =gUnknown_08597550 ldr r2, =0x0203a118 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 .pool thumb_func_end sub_811BB08 thumb_func_start sub_811BB40 sub_811BB40: ; 811BB40 push {lr} adds r2, r0, 0 ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x4 bne @0811BB5C ldr r0, =gUnknown_085EC3B4 b @0811BB7A .align 2, 0 .pool @0811BB5C: cmp r0, 0x4 blt @0811BB78 cmp r0, 0x10 bgt @0811BB78 cmp r0, 0xF blt @0811BB78 ldr r0, =gUnknown_085EC706 str r0, [r2] ldr r0, =gUnknown_085EC727 b @0811BB7E .align 2, 0 .pool @0811BB78: ldr r0, =gUnknown_085EC3A6 @0811BB7A: str r0, [r2] movs r0, 0 @0811BB7E: str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811BB40 thumb_func_start sub_811BB88 sub_811BB88: ; 811BB88 ldr r2, =gUnknown_085EC410 str r2, [r0] ldr r0, =gUnknown_085EC42F str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_811BB88 thumb_func_start sub_811BB9C sub_811BB9C: ; 811BB9C ldr r2, =0x0203a118 ldr r3, [r2] ldrb r2, [r3, 0xA] strb r2, [r0] ldrb r0, [r3, 0xB] strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_811BB9C thumb_func_start sub_811BBB0 sub_811BBB0: ; 811BBB0 ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0x9] bx lr .align 2, 0 .pool thumb_func_end sub_811BBB0 thumb_func_start sub_811BBBC sub_811BBBC: ; 811BBBC ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0xC] bx lr .align 2, 0 .pool thumb_func_end sub_811BBBC thumb_func_start sub_811BBC8 sub_811BBC8: ; 811BBC8 ldr r2, =0x0203a118 ldr r3, [r2] ldrb r2, [r3, 0x10] strb r2, [r0] ldrb r0, [r3, 0x11] strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_811BBC8 thumb_func_start sub_811BBDC sub_811BBDC: ; 811BBDC ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0xE] bx lr .align 2, 0 .pool thumb_func_end sub_811BBDC thumb_func_start sub_811BBE8 sub_811BBE8: ; 811BBE8 ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0xF] bx lr .align 2, 0 .pool 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, =0x0203a118 ldr r1, [r0] ldrb r0, [r1, 0x4] cmp r0, 0x2 beq @0811BC10 cmp r0, 0x3 beq @0811BC1A b @0811BC24 .align 2, 0 .pool @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, =0x0203a118 ldr r2, [r0] ldrb r0, [r2, 0x4] cmp r0, 0x2 beq @0811BC44 cmp r0, 0x3 beq @0811BC5A b @0811BC68 .align 2, 0 .pool @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, =0x0203a118 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 .pool @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, =0x0203a118 ldr r0, [r0] ldrb r0, [r0, 0x12] bx lr .align 2, 0 .pool 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, =gUnknown_08597550 @0811BCD2: ldrb r0, [r2] cmp r0, r3 bne @0811BCE4 lsls r0, r1, 24 lsrs r0, 24 b @0811BCEE .align 2, 0 .pool @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, =0x0203a118 ldr r0, [r0] ldrb r1, [r0, 0x7] cmp r2, r1 bge @0811BD24 ldr r4, =0x0000ffff 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 .pool @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, =0x0203a118 ldr r0, [r0] ldrb r1, [r0, 0x7] cmp r2, r1 bge @0811BD5C ldr r4, =0x0000ffff 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 .pool @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, =0x0203a118 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x11 bne @0811BD80 bl sub_811BCF4 b @0811BD9C .align 2, 0 .pool @0811BD7C: movs r0, 0 b @0811BD9C @0811BD80: ldr r0, =0x03005d8c ldr r0, [r0] movs r2, 0 ldr r3, =0x0000ffff ldr r4, =0x00003b5a 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 .pool thumb_func_end sub_811BD64 thumb_func_start sub_811BDB0 sub_811BDB0: ; 811BDB0 push {lr} ldr r0, =0x0203a118 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0x12 bne @0811BDC8 bl sub_811BCF4 b @0811BDDE .align 2, 0 .pool @0811BDC8: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 movs r2, 0 ldrh r1, [r0, 0x14] ldr r0, =0x0000ffff cmp r1, r0 bne @0811BDDC movs r2, 0x1 @0811BDDC: adds r0, r2, 0 @0811BDDE: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d8c ldr r4, [r0] bl sub_81AFBF0 ldr r0, =0x00003b70 adds r5, r4, r0 adds r0, r5, 0 bl sub_8008C24 lsls r0, 16 cmp r0, 0 beq @0811BE34 ldr r1, =0x00003b85 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 .pool @0811BE34: ldr r1, =gUnknown_085EC6B2 movs r0, 0 bl sub_81AFC0C @0811BE3C: ldr r1, =gUnknown_085EC6A8 adds r0, r6, 0 bl sub_81AFC28 add sp, 0x20 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811BDF0 thumb_func_start sub_811BE54 sub_811BE54: ; 811BE54 push {r4,r5,lr} ldr r0, =0x0203a118 ldr r0, [r0] adds r4, r0, 0 adds r4, 0x3C ldr r2, =0x02021dc4 movs r5, 0 b @0811BE86 .align 2, 0 .pool @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, =0x0203a118 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 .pool thumb_func_end sub_811BE54 thumb_func_start sub_811BE9C sub_811BE9C: ; 811BE9C push {r4,r5,lr} ldr r5, =0x0203a118 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 .pool @0811BEB8: cmp r0, 0xD beq @0811BF0C cmp r0, 0x14 beq @0811BED0 b @0811BF14 @0811BEC2: ldr r0, =0x00000865 bl flag_set b @0811BF14 .align 2, 0 .pool @0811BED0: bl sub_811BF20 adds r1, r0, 0 cmp r1, 0 beq @0811BEE4 ldr r1, =0x020375e0 movs r0, 0x2 b @0811BF12 .align 2, 0 .pool @0811BEE4: ldr r0, =0x020375e0 strh r1, [r0] b @0811BF14 .align 2, 0 .pool @0811BEF0: bl sub_811BE54 ldr r4, =0x020375e0 ldr r0, [r5] adds r0, 0x3C bl sub_81226D8 lsls r0, 24 lsrs r0, 24 strh r0, [r4] b @0811BF14 .align 2, 0 .pool @0811BF0C: bl sub_811BF40 ldr r1, =0x020375e0 @0811BF12: strh r0, [r1] @0811BF14: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811BE9C thumb_func_start sub_811BF20 sub_811BF20: ; 811BF20 push {lr} ldr r0, =gUnknown_08597764 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 .pool 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, =gUnknown_0859776C 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 .pool @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, =0x0203a118 ldr r1, [r0] movs r0, 0 strb r0, [r1, 0x13] bx lr .align 2, 0 .pool 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, =0x0203a11c ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x5 bls @0811BFB4 b @0811C120 @0811BFB4: lsls r0, 2 ldr r1, =@0811BFC8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08597C54 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r4, =0x0203a11c 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, =gUnknown_08597C64 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, =0x01000100 add r0, sp, 0x4 bl CpuFastSet b @0811C124 .align 2, 0 .pool @0811C044: ldr r1, =gUnknown_08DCBDD0 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, =gUnknown_08DCBF10 movs r0, 0x3 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map bl sub_811D60C ldr r0, =0x0203a11c 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 .pool @0811C090: ldr r1, =gUnknown_08597B54 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 .pool @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, =0x0203a11c 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 .pool thumb_func_end sub_811BFA4 thumb_func_start sub_811C13C sub_811C13C: ; 811C13C push {r4,lr} ldr r4, =0x0203a11c 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 .pool thumb_func_end sub_811C13C thumb_func_start sub_811C158 sub_811C158: ; 811C158 push {lr} ldr r1, =0x0203a11c ldr r1, [r1] movs r2, 0 strh r0, [r1, 0x4] strh r2, [r1] bl sub_811C170 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811C158 thumb_func_start sub_811C170 sub_811C170: ; 811C170 push {lr} ldr r0, =0x0203a11c ldr r0, [r0] ldrh r0, [r0, 0x4] cmp r0, 0x22 bls @0811C17E b @0811C2CE @0811C17E: lsls r0, 2 ldr r1, =@0811C190 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811C2EC cmp r0, 0x1 beq @0811C2FA b @0811C304 .align 2, 0 .pool @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, =gUnknown_08597C30 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, =0x0000ffff mov r8, r2 @0811C36C: ldrh r0, [r4] cmp r0, r8 bne @0811C380 movs r0, 0x48 b @0811C392 .align 2, 0 .pool @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, =gUnknown_08597C30 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 .pool 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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811C41C cmp r0, 0x1 beq @0811C436 b @0811C440 .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811C460 cmp r0, 0x1 beq @0811C47A b @0811C484 .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811C4A4 cmp r0, 0x1 beq @0811C4BE b @0811C4C8 .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811C4E8 cmp r0, 0x1 beq @0811C506 b @0811C510 .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811C530 cmp r0, 0x1 beq @0811C546 movs r0, 0x1 b @0811C54E .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x4 bhi @0811C60E lsls r0, 2 ldr r1, =@0811C574 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0811C618 .align 2, 0 .pool @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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0811C60E: movs r0, 0 b @0811C61A .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x4 bhi @0811C6B8 lsls r0, 2 ldr r1, =@0811C640 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a11c 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 .pool @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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0811C6B8 .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x4 bhi @0811C778 lsls r0, 2 ldr r1, =@0811C6E0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0811C778 .align 2, 0 .pool @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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0811C76E: movs r0, 0 b @0811C77A .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811C7A4 cmp r0, 0x1 beq @0811C7B4 b @0811C7CA .align 2, 0 .pool @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, =0x0203a11c 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 .pool @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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0811C820: movs r0, 0 b @0811C82A .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x5 bhi @0811C8E8 lsls r0, 2 ldr r1, =@0811C850 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0811C8E8 .align 2, 0 .pool @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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0811C8DE: movs r0, 0 b @0811C8EA .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x5 bhi @0811C994 lsls r0, 2 ldr r1, =@0811C910 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0811C994 .align 2, 0 .pool @0811C974: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @0811C994 bl sub_811DFB0 ldr r0, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0811C98C: movs r0, 0 b @0811C996 .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x6 bhi @0811CA54 lsls r0, 2 ldr r1, =@0811C9BC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0811CA54 .align 2, 0 .pool @0811CA34: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @0811CA54 bl sub_811DFB0 ldr r0, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @0811CA4C: movs r0, 0 b @0811CA56 .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x4 bhi @0811CB10 lsls r0, 2 ldr r1, =@0811CA7C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @0811CB10 .align 2, 0 .pool @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, =0x0203a11c ldr r1, [r0] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] movs r0, 0 b @0811CB12 .align 2, 0 .pool @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, =0x0203a11c 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 .pool @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, =0x0203a11c 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 .pool @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, =0x0203a11c 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 .pool @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, =0x0203a11c 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 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811CD2C cmp r0, 0x1 beq @0811CD40 b @0811CD4A .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811CD6C cmp r0, 0x1 beq @0811CD80 b @0811CD8A .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811CDAC cmp r0, 0x1 beq @0811CDC0 b @0811CDCA .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811CDEC cmp r0, 0x1 beq @0811CE00 b @0811CE0A .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811CE2C cmp r0, 0x1 beq @0811CE40 b @0811CE4A .align 2, 0 .pool @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, =0x0203a11c ldr r0, [r4] ldrh r0, [r0] cmp r0, 0 beq @0811CE6C cmp r0, 0x1 beq @0811CE80 b @0811CE8A .align 2, 0 .pool @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, =0x0203a11c 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 .pool @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, =gUnknown_08DCBDB0 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_08597B14 movs r1, 0x10 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_08597B34 movs r1, 0x40 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_08597C1C movs r1, 0xA0 movs r2, 0x8 bl gpu_pal_apply ldr r4, =gUnknown_08597C24 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 .pool 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, =@0811D124 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085EC743 str r0, [sp, 0xC] b @0811D1BC .align 2, 0 .pool @0811D180: ldr r0, =gUnknown_085EC752 str r0, [sp, 0xC] b @0811D1BC .align 2, 0 .pool @0811D18C: ldr r0, =gUnknown_085EC4C9 str r0, [sp, 0xC] ldr r0, =gUnknown_085EC4E9 b @0811D1BA .align 2, 0 .pool @0811D19C: ldr r0, =gUnknown_085EC765 str r0, [sp, 0xC] b @0811D1BC .align 2, 0 .pool @0811D1A8: ldr r0, =gUnknown_085EC520 str r0, [sp, 0xC] b @0811D1BC .align 2, 0 .pool @0811D1B4: ldr r0, =gUnknown_085EC672 str r0, [sp, 0xC] ldr r0, =gUnknown_085EC688 @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 .pool 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, =gUnknown_08597C84 movs r1, 0x1 movs r2, 0xE bl sub_81996C0 pop {r0} bx r0 .align 2, 0 .pool 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, =0xffffff00 ldr r4, [sp] ands r4, r6 movs r1, 0x3 orrs r4, r1 str r4, [sp] ldr r1, =gUnknown_08597C30 lsrs r0, 22 adds r0, r1 ldrb r3, [r0] lsls r1, r3, 27 lsrs r1, 19 ldr r5, =0xffff00ff adds r2, r5, 0 ands r2, r4 orrs r2, r1 lsrs r3, 5 lsls r3, 16 ldr r1, =0xff00ffff ands r2, r1 orrs r2, r3 str r2, [sp] ldrb r3, [r0, 0x1] lsls r3, 24 ldr r1, =0x00ffffff 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, =0x0000ffff ands r0, r1 movs r1, 0xD8 lsls r1, 15 orrs r0, r1 str r0, [sp, 0x4] mov r0, sp bl Window_AddFromTemplate ldr r1, =0x0203a11c 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 .pool 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, =0x0203a11c 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, =gUnknown_08597C8C 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, =0x0203a11c 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 .pool @0811D358: ldrh r0, [r4] ldr r1, =0x0000ffff 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 .pool @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, =0x0203a11c 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, =0x0203a11c 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 .pool 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, =0x01000200 mov r0, sp mov r1, r8 bl CpuFastSet cmp r6, 0x2 beq @0811D450 cmp r6, 0x8 bne @0811D4D4 @0811D450: ldr r0, =gUnknown_08597C30 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, =0x00001005 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, =0x00001007 adds r1, r2, 0 strh r1, [r0] adds r6, r4, 0 cmp r6, r12 blt @0811D474 b @0811D5D6 .align 2, 0 .pool @0811D4D4: ldr r4, =gUnknown_08597C30 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, =0x00001001 adds r1, r2, 0 strh r1, [r0] adds r7, r4, 0 cmp r7, r5 bge @0811D52A ldr r4, =0x00001002 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, =0x00001003 adds r1, r2, 0 strh r1, [r0] adds r6, 0x1 cmp r6, r12 bge @0811D590 ldr r0, =gUnknown_08597C30 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, =0x00001005 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, =0x00001007 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, =0x00001009 adds r1, r4, 0 strh r1, [r0] adds r7, r2, 0 cmp r7, r5 bge @0811D5CA ldr r0, =0x0000100a 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, =0x0000100b 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 .pool 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, =gUnknown_08597C30 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 .pool @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, =gUnknown_08597C90 @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 .pool 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, =0x0000ffff cmp r4, r0 beq @0811D926 ldr r5, =0x0203a11c 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 .pool @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, =0xffffff00 adds r4, r1, r0 movs r0, 0x80 lsls r0, 1 subs r0, r3 b @0811D97E .align 2, 0 .pool @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, =0x0203a11c cmp r0, 0x6 bhi @0811DA86 lsls r0, 2 ldr r1, =@0811D9E8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0811D9E8: .4byte @0811DA04 .4byte @0811DA18 .4byte @0811DA28 .4byte @0811DA3C .4byte @0811DA50 .4byte @0811DA64 .4byte @0811DA78 @0811DA04: ldr r1, =0x0203a11c ldr r2, [r1] movs r0, 0 strb r0, [r2, 0x6] ldr r2, [r1] movs r0, 0xA b @0811DA84 .align 2, 0 .pool @0811DA18: ldr r1, =0x0203a11c ldr r2, [r1] movs r3, 0 movs r0, 0x9 b @0811DA44 .align 2, 0 .pool @0811DA28: ldr r1, =0x0203a11c ldr r2, [r1] movs r0, 0xB strb r0, [r2, 0x6] ldr r2, [r1] movs r0, 0x11 b @0811DA84 .align 2, 0 .pool @0811DA3C: ldr r1, =0x0203a11c 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 .pool @0811DA50: ldr r1, =0x0203a11c ldr r2, [r1] movs r0, 0x11 strb r0, [r2, 0x6] ldr r2, [r1] movs r0, 0xA b @0811DA84 .align 2, 0 .pool @0811DA64: ldr r1, =0x0203a11c ldr r2, [r1] movs r0, 0x12 strb r0, [r2, 0x6] ldr r2, [r1] movs r0, 0x16 b @0811DA84 .align 2, 0 .pool @0811DA78: ldr r1, =0x0203a11c 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 .pool thumb_func_end sub_811D9CC thumb_func_start sub_811DAA4 sub_811DAA4: ; 811DAA4 push {r4,lr} ldr r4, =0x0203a11c 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 .pool @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, =@0811DB0C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a11c 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, =0x00004001 adds r1, r4, 0 strh r1, [r0] adds r2, 0x1 cmp r2, r5 bge @0811DC84 ldr r0, =0x00004002 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, =0x00004003 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, =0x00004005 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, =0x00004007 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, =0x00004009 adds r2, r7, 0 strh r2, [r1] adds r2, r4, 0 mov r12, r0 cmp r4, r5 bge @0811DD26 ldr r0, =0x0000400a 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, =0x0000400b 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 .pool 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, =0x0203a11c ldr r0, [r0] ldr r1, =0x000002ce adds r0, r1 movs r1, 0 strh r1, [r0] pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a11c ldr r3, [r0] ldr r0, =0x000002ce 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 .pool @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, =0x0203a11c 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 .pool @0811DE40: movs r0, 0 @0811DE42: pop {r1} bx r1 thumb_func_end sub_811DE10 thumb_func_start sub_811DE48 sub_811DE48: ; 811DE48 ldr r0, =0x0203a11c ldr r0, [r0] ldr r1, =0x000002ce adds r0, r1 ldrh r0, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_08597CA0 bl gpu_tile_obj_alloc_and_load_multiple ldr r0, =gUnknown_08597CC0 bl gpu_pal_obj_alloc_and_load_multiple movs r5, 0 ldr r4, =gUnknown_08597CE8 @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 .pool thumb_func_end sub_811DE90 thumb_func_start sub_811DEC4 sub_811DEC4: ; 811DEC4 push {lr} bl sub_811BA68 lsls r0, 24 ldr r1, =gUnknown_08597C30 lsrs r0, 22 adds r0, r1 ldrb r2, [r0] lsls r1, r2, 27 lsrs r1, 8 lsrs r2, 5 lsls r2, 19 ldr r0, =gUnknown_08597D18 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, =0x0203a11c ldr r2, [r1] movs r1, 0xB6 lsls r1, 2 adds r2, r1 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 adds r1, r0 str r1, [r2] movs r0, 0x1 strh r0, [r1, 0x30] pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fffa strh r0, [r1, 0x24] @0811DF56: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a11c 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 .pool thumb_func_end sub_811DF60 thumb_func_start sub_811DF90 sub_811DF90: ; 811DF90 ldr r0, =0x0203a11c 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 .pool thumb_func_end sub_811DF90 thumb_func_start sub_811DFB0 sub_811DFB0: ; 811DFB0 ldr r0, =0x0203a11c 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 .pool thumb_func_end sub_811DFB0 thumb_func_start sub_811DFC8 sub_811DFC8: ; 811DFC8 push {r4-r6,lr} mov r6, r8 push {r6} ldr r6, =gUnknown_08597D68 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, =0x0203a11c 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, =0x02020630 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, =0x0000ffe0 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 .pool thumb_func_end sub_811DFC8 thumb_func_start sub_811E050 sub_811E050: ; 811E050 push {r4-r6,lr} ldr r5, =0x0203a11c 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 .pool thumb_func_end sub_811E050 thumb_func_start sub_811E088 sub_811E088: ; 811E088 push {r4,lr} sub sp, 0x4 ldr r0, =0x0203a11c 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 .pool @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, =0x0203a11c 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 .pool @0811E150: ldr r6, =0x0203a11c 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 .pool 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, =gUnknown_08597D08 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, =0x0203a11c 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 .pool @0811E234: ldr r6, =0x0203a11c 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 .pool thumb_func_end sub_811E1A4 thumb_func_start sub_811E288 sub_811E288: ; 811E288 push {lr} ldr r0, =gUnknown_08597D18 movs r1, 0 movs r2, 0 movs r3, 0x4 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203a11c ldr r2, [r1] movs r1, 0xB9 lsls r1, 2 adds r2, r1 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 adds r1, r0 str r1, [r2] ldr r0, =sub_811E2DC 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 .pool 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, =0x0000fffa strh r0, [r1, 0x24] @0811E302: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a11c 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 .pool thumb_func_end sub_811E34C thumb_func_start sub_811E380 sub_811E380: ; 811E380 push {r4,lr} ldr r4, =0x0203a11c 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 .pool thumb_func_end sub_811E380 thumb_func_start sub_811E3AC sub_811E3AC: ; 811E3AC push {r4-r6,lr} ldr r0, =gUnknown_08597DF0 movs r1, 0xD0 movs r2, 0x80 movs r3, 0x6 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r5, =0x0203a11c ldr r2, [r5] movs r1, 0xBA lsls r1, 2 adds r2, r1 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r4, =0x02020630 adds r1, r4 str r1, [r2] movs r6, 0 ldr r0, =0x0000ffc0 strh r0, [r1, 0x24] ldr r0, =gUnknown_08597DD0 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 .pool thumb_func_end sub_811E3AC thumb_func_start sub_811E418 sub_811E418: ; 811E418 push {r4,lr} ldr r4, =0x0203a11c 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 .pool @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, =0x0203a11c ldr r1, [r0] ldrb r0, [r1, 0x9] adds r0, 0x1 strb r0, [r1, 0x9] b @0811E4A4 .align 2, 0 .pool @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, =0x0203a11c 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 .pool thumb_func_end sub_811E4AC thumb_func_start sub_811E4D0 sub_811E4D0: ; 811E4D0 push {r4-r6,lr} ldr r5, =0x0203a11c 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 .pool @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, =0x0203a11c 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 .pool 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, =0x0203a11c 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 .pool @0811E59C: ldr r0, =0x0203a11c 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 .pool thumb_func_end sub_811E578 thumb_func_start sub_811E5B8 sub_811E5B8: ; 811E5B8 ldr r0, =0x0203a11c 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 .pool thumb_func_end sub_811E5B8 thumb_func_start sub_811E5D4 sub_811E5D4: ; 811E5D4 push {r4,lr} ldr r4, =gUnknown_08597E48 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, =0x0203a11c ldr r2, [r0] movs r0, 0xBC lsls r0, 2 adds r2, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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, =0x0203a11c ldr r2, [r0] movs r0, 0xBD lsls r0, 2 adds r2, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 str r0, [r2] adds r0, 0x3F ldrb r1, [r0] movs r2, 0x2 orrs r1, r2 strb r1, [r0] @0811E636: bl sub_811E6B0 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811E5D4 thumb_func_start sub_811E64C sub_811E64C: ; 811E64C push {r4-r6,lr} bl sub_811BBF8 ldr r6, =0x0203a11c 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 .pool thumb_func_end sub_811E64C thumb_func_start sub_811E6B0 sub_811E6B0: ; 811E6B0 ldr r3, =0x0203a11c 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 .pool thumb_func_end sub_811E6B0 thumb_func_start sub_811E6E0 sub_811E6E0: ; 811E6E0 push {lr} cmp r0, 0 bne @0811E6FC ldr r0, =0x0203a11c ldr r2, [r0] movs r1, 0xBC lsls r1, 2 adds r0, r2, r1 ldr r0, [r0] movs r1, 0x60 b @0811E70A .align 2, 0 .pool @0811E6FC: ldr r0, =0x0203a11c 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 .pool thumb_func_end sub_811E6E0 thumb_func_start sub_811E720 sub_811E720: ; 811E720 push {r4,lr} ldr r4, =gUnknown_08597E30 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, =0x0203a11c ldr r2, [r0] movs r0, 0xBE lsls r0, 2 adds r2, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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, =0x0203a11c ldr r2, [r0] movs r0, 0xBF lsls r0, 2 adds r2, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool thumb_func_end sub_811E720 thumb_func_start sub_811E794 sub_811E794: ; 811E794 push {r4-r6,lr} bl sub_811BBF8 ldr r6, =0x0203a11c 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 .pool thumb_func_end sub_811E794 thumb_func_start sub_811E7F8 sub_811E7F8: ; 811E7F8 ldr r3, =0x0203a11c 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 .pool 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, =nullsub_12 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, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x5] movs r1, 0xD negs r1, r1 ands r1, r2 strb r1, [r0, 0x5] movs r1, 0x2 bl obj_anim_image_start @0811E892: ldr r0, =0x03005d90 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, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x5] movs r1, 0xD negs r1, r1 ands r1, r2 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 .pool thumb_func_end sub_811E828 thumb_func_start sub_811E8E4 sub_811E8E4: ; 811E8E4 push {lr} bl sub_811BA68 lsls r0, 24 ldr r1, =gUnknown_08597C30 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 .pool @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, =gUnknown_08597E60 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 .pool 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, =0xffffff00 ldr r0, [sp, 0xC] ands r0, r3 movs r1, 0x3 orrs r0, r1 ldr r2, =0xffff00ff ands r0, r2 adds r1, 0xFD orrs r0, r1 ldr r1, =0xff00ffff ands r0, r1 movs r1, 0xB0 lsls r1, 12 orrs r0, r1 ldr r1, =0x00ffffff 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, =0x0000ffff 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, =gUnknown_08597E6C adds r5, r1, r0 ldr r1, =gUnknown_08597E60 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 .pool 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, =0x00000864 bl flag_check b @0811EA60 .align 2, 0 .pool @0811EA48: cmp r1, 0x15 beq @0811EA5C b @0811EA66 @0811EA4E: ldr r0, =0x00000866 bl flag_check b @0811EA60 .align 2, 0 .pool @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, =gEasyChatGroups lsls r1, r4, 3 adds r1, r0 ldrh r0, [r1, 0x6] @0811EA9A: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0000ffff cmp r1, r0 beq @0811EB04 lsrs r3, r2, 25 ldr r5, =0x000001ff ands r5, r1 cmp r3, 0x15 bhi @0811EB08 ldr r0, =gEasyChatGroups 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 .pool @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, =gUnknown_085F5490 ldrh r0, [r0] b @0811EB50 .align 2, 0 .pool @0811EB3C: ldr r0, =gUnknown_085FA1D4 ldrh r0, [r0] b @0811EB50 .align 2, 0 .pool @0811EB48: ldr r1, =gEasyChatGroups 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 .pool @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, =gSpeciesNames adds r0, r1 b @0811EBB2 .align 2, 0 .pool @0811EB90: movs r0, 0xD muls r0, r2 ldr r1, =gMoveNames adds r0, r1 b @0811EBB2 .align 2, 0 .pool @0811EBA0: ldr r1, =gEasyChatGroups 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 .pool 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, =gUnknown_085EEA42 b @0811EBEA .align 2, 0 .pool @0811EBD8: ldr r0, =0x0000ffff cmp r4, r0 beq @0811EBFC ldr r1, =0x000001ff 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 .pool @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, =0xffff0000 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, =0x0000ffff @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 .pool 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, =0x0000ffff @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 .pool @0811ECFC: movs r6, 0 ldr r1, [sp, 0x4] adds r1, 0x1 mov r9, r1 cmp r6, r8 bcs @0811ED30 ldr r2, =0x0000ffff @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 .pool @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, =0x0000ffff cmp r4, r0 bne @0811ED94 movs r0, 0 b @0811EDBA .align 2, 0 .pool @0811ED94: adds r0, r4, 0 bl sub_811EAA4 lsls r0, 24 cmp r0, 0 bne @0811EDB0 ldr r1, =0x000001ff ands r1, r4 lsrs r0, r5, 25 bl sub_811EB64 b @0811EDB2 .align 2, 0 .pool @0811EDB0: ldr r0, =gUnknown_085EEA42 @0811EDB2: bl sub_8008C24 lsls r0, 16 lsrs r0, 16 @0811EDBA: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =gEasyChatGroups 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, =gEasyChatGroups 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, =0x000001ff ands r2, r1 orrs r0, r2 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0000ffff b @0811EEC4 .align 2, 0 .pool @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, =0x020375e0 ldrh r0, [r0] cmp r0, 0x1 beq @0811EF04 cmp r0, 0x1 bgt @0811EEE4 cmp r0, 0 beq @0811EEEE b @0811EF58 .align 2, 0 .pool @0811EEE4: cmp r0, 0x2 beq @0811EF2C cmp r0, 0x3 beq @0811EF3C b @0811EF58 @0811EEEE: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002bb0 adds r5, r0, r1 movs r2, 0x2 b @0811EF46 .align 2, 0 .pool @0811EF04: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002bbc 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 .pool @0811EF2C: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002bc8 b @0811EF42 .align 2, 0 .pool @0811EF3C: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002bd4 @0811EF42: adds r5, r0, r1 @0811EF44: movs r2, 0x3 @0811EF46: movs r3, 0x2 @0811EF48: ldr r4, =0x02021fc4 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 .pool 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, =0x02021dc4 bl sub_811EBBC pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r3, =0x00002e20 adds r0, r3 adds r0, r2 ldrb r0, [r0] asrs r0, r1 movs r1, 0x1 ands r0, r1 bx lr .align 2, 0 .pool 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, =0x03005d8c ldr r1, [r0] ldr r0, =0x00002e20 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 .pool 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, =0x000001ff 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 .pool @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, =0x0000ffff @0811F084: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x000001ff 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 .pool @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, =0x0000ffff @0811F0EC: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x000001ff ands r0, r1 b @0811F174 .align 2, 0 .pool @0811F128: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 adds r1, r4, 0 bl __umodsi3 lsls r0, 16 lsrs r4, r0, 16 ldr r0, =gEasyChatGroups ldr r5, [r0] ldrh r7, [r0, 0x4] movs r6, 0 cmp r6, r7 bcs @0811F172 @0811F146: ldrh r0, [r5] bl SpeciesToNationalPokedexNum 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, =0x0000ffff @0811F174: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_811F108 thumb_func_start sub_811F184 sub_811F184: ; 811F184 push {r4-r7,lr} movs r2, 0 ldr r5, =0x03005d8c ldr r4, =0x00002bb0 ldr r3, =gUnknown_0859E62C @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, =0x03005d8c ldr r4, =0x00002bbc ldr r3, =gUnknown_0859E634 @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, =0x03005d8c ldr r4, =0x00002bc8 ldr r3, =gUnknown_0859E640 @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, =0x03005d8c ldr r4, =0x00002bd4 ldr r3, =gUnknown_0859E64C @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, =0x03005d8c ldr r6, =0x00002be0 ldr r0, =0x0000ffff 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, =0x03005d8c ldr r3, =0x00002e20 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 .pool thumb_func_end sub_811F184 thumb_func_start sub_811F28C sub_811F28C: ; 811F28C push {r4,lr} ldr r4, =0x0203a120 ldr r0, =0x00003ba4 bl malloc str r0, [r4] cmp r0, 0 beq @0811F2B0 bl sub_811F2D4 bl sub_811F46C movs r0, 0x1 b @0811F2B2 .align 2, 0 .pool @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, =0x0203a120 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 .pool thumb_func_end sub_811F2B8 thumb_func_start sub_811F2D4 sub_811F2D4: ; 811F2D4 push {r4,r5,lr} ldr r4, =0x0203a120 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, =0x00000864 bl flag_check lsls r0, 24 cmp r0, 0 beq @0811F358 ldr r0, =0x0203a120 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, =0x00000866 bl flag_check lsls r0, 24 cmp r0, 0 beq @0811F37A ldr r0, =0x0203a120 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, =0x0203a120 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 .pool thumb_func_end sub_811F2D4 thumb_func_start sub_811F3AC sub_811F3AC: ; 811F3AC ldr r0, =0x0203a120 ldr r0, [r0] ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_811F3AC thumb_func_start sub_811F3B8 sub_811F3B8: ; 811F3B8 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x0203a120 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 .pool @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, =gEasyChatGroupNamePointers 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 .pool thumb_func_end sub_811F3E0 thumb_func_start sub_811F424 sub_811F424: ; 811F424 lsls r0, 24 ldr r1, =gEasyChatGroupNamePointers lsrs r0, 22 adds r0, r1 ldr r0, [r0] bx lr .align 2, 0 .pool 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, =gEasyChatWordsByLetterPointers 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, =0x0203a120 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, =0x0000ffff 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 .pool @0811F4C8: ldr r0, =0x0203a120 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 .pool @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, =0x0203a120 ldr r1, [r1] ldr r2, =0x00003ba0 adds r1, r2 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811F548 thumb_func_start sub_811F578 sub_811F578: ; 811F578 push {lr} lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x0203a120 ldr r1, [r0] ldr r3, =0x00003ba0 adds r0, r1, r3 ldrh r0, [r0] cmp r2, r0 bcs @0811F5A4 lsls r0, r2, 1 ldr r2, =0x00003984 adds r1, r2 adds r1, r0 ldrh r0, [r1] b @0811F5A6 .align 2, 0 .pool @0811F5A4: ldr r0, =0x0000ffff @0811F5A6: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_811F578 thumb_func_start sub_811F5B0 sub_811F5B0: ; 811F5B0 ldr r0, =0x0203a120 ldr r0, [r0] ldr r1, =0x00003ba0 adds r0, r1 ldrh r0, [r0] bx lr .align 2, 0 .pool 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, =gEasyChatGroups 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, =0x0203a120 ldr r2, [r0] lsls r0, r5, 1 ldr r1, =0x00003984 adds r2, r1 adds r2, r0 ldrh r0, [r4] ldr r3, =0x000001ff 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 .pool @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, =0x0203a120 ldr r1, [r0] lsls r0, r5, 1 ldr r3, =0x00003984 adds r1, r3 adds r1, r0 ldr r2, =0x000001ff 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 .pool 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, =0x0203a120 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, =0x00003984 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 .pool 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, =0x0203a120 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 .pool @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, =@0811F780 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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 SpeciesToNationalPokedexNum 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 SpeciesToNationalPokedexNum 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, =gEasyChatGroups 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 .pool 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, =gUnknown_0859E658 @0811F842: ldrh r0, [r1] cmp r0, r3 bne @0811F850 movs r0, 0x1 b @0811F85A .align 2, 0 .pool @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, =0xffff0000 adds r1, r0 lsrs r0, r1, 16 ldr r1, =0x0000ffff 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 .pool thumb_func_end sub_811F88C thumb_func_start sub_811F8BC sub_811F8BC: ; 811F8BC push {lr} bl sub_801B058 ldr r1, =0x0000ffff 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 .pool 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, =0x000001ff 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 .pool @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, =0x0203a124 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_811F90C thumb_func_start sub_811F918 sub_811F918: ; 811F918 push {lr} sub sp, 0x4 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x14] lsrs r0, 3 bl sub_8098758 ldr r3, =0x0203a124 ldr r2, [r3] ldr r1, [r0] str r1, [r2, 0x2C] ldr r0, [r0, 0x4] str r0, [r2, 0x30] ldr r0, =0x000010b4 adds r2, r0 movs r1, 0 strb r1, [r2] mov r0, sp strh r1, [r0] ldr r1, [r3] adds r1, 0x34 ldr r2, =0x01000800 bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_811F918 thumb_func_start sub_811F960 sub_811F960: ; 811F960 push {r4-r7,lr} ldr r0, =0x0203a124 ldr r1, [r0] ldr r2, =0x000010b4 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 .pool @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, =0x0203a124 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, =0x000010b4 adds r1, r0 b @0811FA1E .align 2, 0 .pool @0811F9D8: ldr r0, =0x0203a124 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, =0x0203a124 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, =0x000010b4 adds r1, r2 @0811FA1E: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0811FA88 .align 2, 0 .pool @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, =0x0203a124 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, =0x000010b4 adds r1, r2 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0811FA7C: movs r0, 0 b @0811FA8A .align 2, 0 .pool @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, =0x0203a124 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 .pool thumb_func_end sub_811FAA4 thumb_func_start sub_811FAF8 sub_811FAF8: ; 811FAF8 push {r4-r7,lr} movs r5, 0 ldr r4, =0x0203a124 @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, =0x0203a124 @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, =0x0203a124 @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, =0x0203a124 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 .pool thumb_func_end sub_811FAF8 thumb_func_start sub_811FBA4 sub_811FBA4: ; 811FBA4 push {r4,r5,lr} ldr r0, =0x030022c0 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, =0x0203a124 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 .pool @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, =0x0203a124 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 .pool @0811FC0C: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0811FC68 movs r0, 0x5 bl audio_play ldr r2, =0x0203a124 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 .pool @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, =0x0203a124 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, =gUnknown_08DC9628 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, =gUnknown_08DC9608 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, =gUnknown_0859EE7C str r0, [r4, 0x4] ldr r0, =gUnknown_0859EF14 str r0, [r4, 0x8] str r7, [r4, 0xC] ldr r0, =gUnknown_082EC6A8 str r0, [r4, 0x10] ldr r0, =nullsub_47 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, =0x0203a124 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, =0x02020630 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, =gUnknown_0859EEDC str r0, [r4, 0x8] ldr r0, =sub_811FF40 str r0, [r4, 0x14] ldr r0, =gUnknown_0859EE84 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, =0x0203a124 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, =0x02020630 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, =nullsub_12 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 .pool @0811FEA8: ldr r1, [r6] movs r0, 0 str r0, [r1, 0x28] @0811FEAE: ldr r0, =sub_811FF7C 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, =0x0203a124 ldr r2, [r0] lsls r1, r3, 4 adds r1, r3 lsls r1, 2 ldr r0, =0x02020630 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 .pool @0811FEFC: ldr r0, =0x0203a124 ldr r0, [r0] lsls r1, r5, 2 adds r0, 0xC b @0811FF14 .align 2, 0 .pool @0811FF0C: ldr r0, =0x0203a124 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 .pool @0811FF20: ldr r0, =0x0203a124 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 .pool 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, =0x0203a124 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 .pool @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, =0x0203a124 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 .pool 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, =gUnknown_0859E65C @0811FFA4: movs r3, 0x10 bl sub_811FFD4 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0859E65C @0811FFC4: movs r3, 0x1 bl sub_811FFD4 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0859E67C 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, =0xffff0000 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, =gUnknown_0859EF1C str r0, [sp, 0x4] ldr r0, =gUnknown_0859EFA4 str r0, [sp, 0x8] str r2, [sp, 0xC] ldr r0, =gUnknown_082EC6A8 str r0, [sp, 0x10] ldr r0, =nullsub_47 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 .pool @08120068: lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 @08120072: add sp, 0x28 pop {r3} mov r8, r3 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_811FFD4 thumb_func_start sub_8120084 sub_8120084: ; 8120084 push {lr} lsls r0, 24 lsrs r0, 17 ldr r2, =gUnknown_0859E67C adds r0, r2 movs r2, 0x80 movs r3, 0x10 bl RequestDma3Copy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8120084 thumb_func_start sub_81200A0 sub_81200A0: ; 81200A0 push {r4,lr} ldr r0, =0x03005d8c ldr r2, [r0] ldr r1, =0x00002e28 adds r0, r2, r1 movs r1, 0 strb r1, [r0] ldr r3, =0x00002e51 adds r0, r2, r3 strb r1, [r0] ldr r0, =gUnknown_82E9531 ldrb r1, [r0] adds r3, 0x1 adds r0, r2, r3 strb r1, [r0] movs r3, 0 ldr r0, =0x00002e2a adds r2, r0 ldr r4, =gUnknown_0859EFE4 @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 .pool thumb_func_end sub_81200A0 thumb_func_start sub_81200F8 sub_81200F8: ; 81200F8 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00002e28 adds r1, r0 movs r2, 0 movs r0, 0x1 strb r0, [r1] strb r2, [r1, 0x1] ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r1, 0x2] bx lr .align 2, 0 .pool 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, =0x03005d8c ldr r1, [r0] ldr r0, =0x00002e28 adds r2, r1, r0 movs r3, 0 movs r0, 0x4 strb r0, [r2] strb r3, [r2, 0x1] ldr r0, =gUnknown_82E9531 ldrb r0, [r0] ldr r2, =0x00002e48 adds r1, r2 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005d90 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, =@08120190 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e28 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81201C8 thumb_func_start sub_81201DC sub_81201DC: ; 81201DC push {r4,lr} ldr r4, =0x020375f0 bl sub_81201C8 lsls r0, 24 lsrs r0, 24 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81201DC thumb_func_start sub_81201F4 sub_81201F4: ; 81201F4 ldr r1, =0x020375f0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002e51 adds r0, r2 ldrb r0, [r0] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81201F4 thumb_func_start sub_8120210 sub_8120210: ; 8120210 push {r4-r6,lr} ldr r0, =0x03005d8c ldr r4, [r0] ldr r0, =0x00002e28 adds r6, r4, r0 ldr r1, =0x00002e42 adds r0, r4, r1 ldr r5, =0x03005d90 ldr r1, [r5] bl gf_strcpy movs r2, 0 ldr r0, =0x00002e4d 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 .pool thumb_func_end sub_8120210 thumb_func_start sub_8120280 sub_8120280: ; 8120280 push {r4-r7,lr} ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x020375e0 ldrh r0, [r0] ldr r2, =0x00002e36 adds r5, r1, r2 cmp r0, 0 bne @08120296 ldr r0, =0x00002e2a adds r5, r1, r0 @08120296: ldr r2, =0x02021fc4 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 .pool thumb_func_end sub_8120280 thumb_func_start sub_8120340 sub_8120340: ; 8120340 push {lr} ldr r0, =0x020375e0 ldrb r0, [r0] bl sub_81206C0 bl script_env_2_set_ctx_paused pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8120340 thumb_func_start sub_8120358 sub_8120358: ; 8120358 ldr r1, =0x020375f0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002e28 adds r0, r2 ldrb r0, [r0, 0x1] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8120358 thumb_func_start sub_8120374 sub_8120374: ; 8120374 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e28 adds r0, r1 movs r1, 0x1 strb r1, [r0, 0x1] bx lr .align 2, 0 .pool 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, =0x0000ffff cmp r1, r0 bne @081203AC ldr r1, =0x020375f0 movs r0, 0 b @081203B6 .align 2, 0 .pool @081203AC: ldr r0, =0x02021cc4 bl sub_811EBBC ldr r1, =0x020375f0 movs r0, 0x1 @081203B6: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812038C thumb_func_start sub_81203C4 sub_81203C4: ; 81203C4 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e28 adds r2, r0, r1 ldrb r0, [r2, 0x1] cmp r0, 0xA bne @081203EC ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] strb r0, [r2, 0x1] b @081203F2 .align 2, 0 .pool @081203EC: ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] @081203F2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81203C4 thumb_func_start sub_81203FC sub_81203FC: ; 81203FC push {r4-r6,lr} ldr r0, =0x03005d8c ldr r4, [r0] ldr r0, =0x00002e28 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, =0x00002e2c adds r6, r4, r1 adds r0, r6, r0 ldrh r1, [r0] ldr r0, =0x0000ffff 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, =0x02021fc4 ldrb r1, [r5, 0x1] lsls r1, 1 adds r1, r6, r1 ldrh r1, [r1] bl sub_811EBBC adds r2, r0, 0 ldr r1, =gUnknown_082942FD bl gf_strcpy adds r2, r0, 0 ldr r0, =gUnknown_0859EFF0 lsls r4, 2 adds r4, r0 ldr r1, [r4] adds r0, r2, 0 bl gf_strcpy adds r2, r0, 0 ldr r1, =gUnknown_08294301 bl gf_strcpy b @081204A2 .align 2, 0 .pool @08120480: ldr r0, =0x02021fc4 ldr r3, =gUnknown_0859F010 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 .pool @081204C4: ldrb r0, [r5, 0x1] adds r0, 0x1 @081204C8: strb r0, [r5, 0x1] ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r4, [r0] ldr r0, =0x00002e28 adds r0, r4, r0 str r0, [sp, 0x18] ldr r1, =gUnknown_0859F030 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, =0x0000ffff strh r1, [r0] adds r0, r7, 0x1 lsls r0, 16 lsrs r7, r0, 16 adds r4, r5, 0x1 b @0812060E .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e51 adds r0, r1 movs r1, 0 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8120628 thumb_func_start sub_8120640 sub_8120640: ; 8120640 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e28 adds r0, r1 movs r1, 0 strb r1, [r0, 0x1] bx lr .align 2, 0 .pool 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, =@0812068C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_8120944 movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x12] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81206C0 thumb_func_start sub_81206F0 sub_81206F0: ; 81206F0 ldr r1, =0x03002f84 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81206F0 thumb_func_start sub_81206FC sub_81206FC: ; 81206FC ldr r1, =0x03002f84 movs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool 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, =sub_81206FC str r0, [sp, 0x8] movs r0, 0 movs r1, 0x1 adds r2, r5, 0 movs r3, 0 bl Print ldr r0, =0x03002f84 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 .pool 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, =@08120764 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08120764: .4byte @0812077C .4byte @08120938 .4byte @081207BC .4byte @081207F8 .4byte @081207F8 .4byte @08120938 @0812077C: ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, =0x020375e0 ldrh r0, [r0] ldr r3, =0x00002e36 adds r1, r2, r3 cmp r0, 0 bne @08120790 ldr r0, =0x00002e2a 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 .pool @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, =0x03007630 ldr r5, =0x0000ffff 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 .pool @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, =0x03007630 ldr r5, =0x0000ffff 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 .pool @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, =0x03007630 bl MPlayStop_rev01 movs r0, 0x4 @08120936: strb r0, [r6, 0x3] @08120938: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r5, r0, r1 ldr r1, =0x03006130 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, =@0812097C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0812097C: .4byte @08120994 .4byte @081209B8 .4byte @081209C8 .4byte @08120A7E .4byte @08120B40 .4byte @08120A6E @08120994: bl sub_8120280 ldr r0, =0x02021fc4 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 .pool @081209B8: bl sub_80A3200 lsls r0, 24 cmp r0, 0 bne @081209C4 b @08120B50 @081209C4: movs r0, 0x2 b @08120B4E @081209C8: ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002e28 adds r4, r0, r2 movs r0, 0xE ldrsh r1, [r5, r0] ldr r0, =0x02021fc4 adds r1, r0 movs r3, 0 ldrb r0, [r1] ldr r7, =0x03006130 ldrh r2, [r5, 0x12] ldr r6, =0x0203a128 b @08120A02 .align 2, 0 .pool @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, =0x02021fc4 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, =0x03007630 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 .pool @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, =0x03006130 ldrh r0, [r0, 0x4] strh r0, [r5, 0xC] movs r0, 0x4 b @08120B4E .align 2, 0 .pool @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, =0x00004010 movs r1, 0x45 bl var_set pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085EDFB0 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 .pool 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, =@08120C2C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =@08120D58 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a12c ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e28 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 .pool thumb_func_end sub_8120E08 thumb_func_start sub_8120E50 sub_8120E50: ; 8120E50 ldr r3, =0x0203a12c ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e28 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 .pool 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, =gUnknown_0859F048 @08120E90: ldrb r0, [r1] cmp r0, r3 bne @08120EA0 adds r0, r1, 0 b @08120EAA .align 2, 0 .pool @08120EA0: adds r1, 0x10 adds r2, 0x1 cmp r2, 0x23 ble @08120E90 ldr r0, =gUnknown_0859F278 @08120EAA: pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203a12c 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 .pool thumb_func_end sub_8120ED8 thumb_func_start sub_8120F08 sub_8120F08: ; 8120F08 ldr r1, =0x0203a12c 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 .pool thumb_func_end sub_8120F08 thumb_func_start sub_8120F2C sub_8120F2C: ; 8120F2C ldr r2, =0x0203a12c 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 .pool thumb_func_end sub_8120F2C thumb_func_start sub_8120F4C sub_8120F4C: ; 8120F4C push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x0203a12c 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 .pool @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, =0x0203a12c 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 .pool thumb_func_end sub_8120F7C thumb_func_start sub_8120FAC sub_8120FAC: ; 8120FAC push {r4,r5,lr} adds r5, r1, 0 ldr r2, =0x0203a12c 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 .pool 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, =0x0203a12c mov r9, r0 ldr r0, [r0] adds r0, 0x4 add r0, r8 strb r6, [r0] ldr r0, =0x03005d90 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, =0x02021cc4 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, =0x02021dc4 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, =gUnknown_82E9531 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 .pool 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, =gUnknown_0859F288 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, =gUnknown_0859F048 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, =0x0203a12c 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, =0x0203a12c 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, =0x03001178 ldrb r0, [r0] adds r1, r4, 0 bl sub_8120FDC b @0812115E .align 2, 0 .pool @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, =0x0203a12c ldr r0, [r6] adds r0, 0x4 adds r0, r5 ldrb r0, [r0] mov r8, r0 ldr r4, =0x02021cc4 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, =0x02021dc4 mov r0, r8 bl sub_8120ECC adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy ldr r4, =0x02021ec4 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 .pool thumb_func_end sub_8121178 thumb_func_start sub_81211EC sub_81211EC: ; 81211EC push {r4,r5,lr} sub sp, 0xC ldr r1, =gUnknown_085EB7EA movs r0, 0x1 movs r2, 0 bl font_get_width_of_string adds r5, r0, 0 movs r4, 0 ldr r0, =0x0203a12c 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, =0x0203a12c 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, =0x0203a130 strb r0, [r1] ldrb r0, [r1] movs r1, 0 bl SetStandardWindowBorderStyle movs r4, 0 ldr r0, =0x0203a12c 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, =0x0203a130 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, =0x0203a12c ldr r0, [r0] adds r0, 0x4 adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @08121272 @081212AA: ldr r5, =0x0203a130 ldrb r0, [r5] ldr r2, =gUnknown_085EB7EA 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 .pool 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, =0x03005e00 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 .pool @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, =0x020375f0 movs r0, 0 strh r0, [r1] b @08121364 .align 2, 0 .pool @0812135C: ldr r0, =0x020375f0 strh r5, [r0] ldr r0, =0x03001178 strb r4, [r0] @08121364: ldr r0, =0x0203a130 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 .pool thumb_func_end sub_81212FC thumb_func_start sub_8121388 sub_8121388: ; 8121388 push {lr} ldr r0, =sub_81212FC movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8121388 thumb_func_start sub_812139C sub_812139C: ; 812139C push {lr} ldr r0, =0x03001178 ldrb r0, [r0] bl sub_8121178 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812139C thumb_func_start sub_81213B0 sub_81213B0: ; 81213B0 push {lr} ldr r1, =0x0203a12c ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002e28 adds r0, r2 str r0, [r1] bl sub_8120ED8 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81213B0 thumb_func_start sub_81213D8 sub_81213D8: ; 81213D8 push {r4,r5,lr} ldr r2, =0x0203a12c ldr r0, =0x03005d8c ldr r1, [r0] ldr r3, =0x00002e28 adds r0, r1, r3 str r0, [r2] ldr r5, =0x03001178 ldrb r0, [r5] ldr r2, =0x00002e2c 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 .pool @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, =0x0203a12c ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002e28 adds r0, r2 str r0, [r1] ldrb r0, [r0, 0x1] cmp r0, 0 beq @08121448 movs r0, 0x1 b @0812144A .align 2, 0 .pool @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, =0x0203a12c ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00002e28 adds r0, r2 str r0, [r1] bl sub_81210B8 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203a134 ldr r0, =0x0000222c bl malloc_and_clear str r0, [r4] ldr r1, =0x0000021d adds r0, r1 movs r1, 0x2 strb r1, [r0] ldr r0, [r4] ldr r2, =0x0000021e adds r0, r2 movs r1, 0x1 strb r1, [r0] ldr r4, [r4] movs r3, 0x88 lsls r3, 2 adds r1, r4, r3 ldr r0, =sub_811EBBC str r0, [r1] movs r0, 0x89 lsls r0, 2 adds r1, r4, r0 ldr r0, =sub_811EC08 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 .pool @081214E8: ldr r3, =0x0000021a adds r1, r4, r3 movs r0, 0 strb r0, [r1] movs r6, 0 @081214F2: ldr r0, =0x0203a134 ldr r1, [r0] ldr r2, =0x0000021e 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, =gUnknown_0859F3B4 b @08121540 .align 2, 0 .pool @0812152C: movs r0, 0x8A lsls r0, 2 adds r2, r1, r0 ldr r3, =0x0000021a adds r0, r1, r3 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 ldr r1, =gUnknown_0859F458 @08121540: adds r0, r1 str r0, [r2] ldrh r0, [r5, 0x1E] mov r1, sp bl sub_80D45E8 lsls r0, 16 ldr r1, =0xffff0000 adds r0, r1 movs r1, 0xCD lsls r1, 17 cmp r0, r1 bhi @081215AC ldr r1, =0x0203a134 ldr r2, [r1] ldr r3, =0x0000021a adds r0, r2, r3 ldrb r0, [r0] adds r3, r1, 0 cmp r0, 0x6 beq @0812158C cmp r0, 0x9 beq @0812159C ldr r0, =0x0000021b adds r1, r2, r0 movs r0, 0 strb r0, [r1] b @081215BA .align 2, 0 .pool @0812158C: ldr r0, =0x0000021b adds r1, r2, r0 movs r0, 0x1 strb r0, [r1] b @081215BA .align 2, 0 .pool @0812159C: ldr r0, =0x0000021b adds r1, r2, r0 movs r0, 0x2 strb r0, [r1] b @081215BA .align 2, 0 .pool @081215AC: ldr r0, =0x0203a134 ldr r1, [r0] ldr r2, =0x0000021b 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, =sub_81219F0 bl set_callback2 add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8121478 thumb_func_start sub_81215EC sub_81215EC: ; 81215EC push {r4-r6,lr} sub sp, 0xC ldr r0, =0x030022c0 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, =@08121614 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x01000200 add r0, sp, 0x8 bl CpuSet b @081219D4 .align 2, 0 .pool @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, =gUnknown_0859F290 movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r4, =0x0203a134 ldr r1, [r4] movs r2, 0x8B lsls r2, 2 adds r1, r2 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x0000122c adds r1, r0 movs r0, 0x2 bl bg_set_tilemap b @081219D4 .align 2, 0 .pool @08121730: ldr r0, =gUnknown_0859F29C bl Window_InitFromTemplates bl TextBox_ResetSomeField b @081219D4 .align 2, 0 .pool @08121740: ldr r2, =gUnknown_0859F2B8 ldr r0, =0x0203a134 ldr r0, [r0] ldr r1, =0x0000021a 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 .pool @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, =gUnknown_0859F2B8 ldr r0, =0x0203a134 ldr r0, [r0] ldr r1, =0x0000021a 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 .pool @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, =0x02037714 ldr r4, =gUnknown_0859F2B8 ldr r0, =0x0203a134 ldr r3, [r0] ldr r2, =0x0000021a 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, =0x02037b14 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, =gUnknown_0859F2B0 ldr r0, =0x03005d90 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 .pool @081218B0: ldr r0, =0x0203a134 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 .pool @081218CC: ldr r0, =0x0203a134 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 .pool @081218EC: bl sub_8087598 cmp r0, 0x1 bne @081219D4 b @081219E2 @081218F6: ldr r0, =sub_8121C50 bl SetVBlankCallback ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] b @081219D4 .align 2, 0 .pool @08121910: ldr r5, =0x0203a134 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, =0x0000021b adds r0, r2 ldrb r0, [r0] cmp r0, 0x1 beq @08121940 cmp r0, 0x2 beq @08121958 b @081219D4 .align 2, 0 .pool @08121940: adds r0, r4, 0 bl sub_80D2F68 ldr r1, =nullsub_12 movs r0, 0 str r0, [sp] str r0, [sp, 0x4] adds r0, r4, 0 movs r2, 0x60 b @0812196A .align 2, 0 .pool @08121958: adds r0, r4, 0 bl sub_80D2F68 ldr r1, =nullsub_12 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 .pool @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, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] ldr r0, =0x0203a134 ldr r0, [r0] movs r1, 0x84 lsls r1, 2 adds r0, r1 ldr r1, =sub_8121C98 str r1, [r0] movs r0, 0x1 b @081219E4 .align 2, 0 .pool @081219D4: ldr r1, =0x030022c0 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 .pool 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, =sub_8121C64 bl set_callback2 b @08121A18 .align 2, 0 .pool @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, =0x0203a134 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, =0x0203a134 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, =0x0000021e adds r0, r1, r3 ldrb r0, [r0] cmp r0, 0 bne @08121AF0 ldr r1, =gUnknown_085EEA78 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, =0x00000219 adds r2, r0 strb r1, [r2] b @08121B0C .align 2, 0 .pool @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, =0x00000219 adds r0, r2 strb r1, [r0] @08121B0C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a134 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, =gUnknown_0859F2AC 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, =0x0203a134 ldr r0, [r2] add r0, r10 ldr r0, [r0] ldrb r0, [r0] cmp r6, r0 bcc @08121B60 @08121BCC: ldr r1, =gUnknown_085EEA78 add r0, sp, 0xC bl gf_strcpy ldr r4, =0x0203a134 ldr r1, [r4] movs r2, 0x80 lsls r2, 2 adds r1, r2 bl gf_strcpy ldr r0, [r4] ldr r1, =0x00000219 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, =gUnknown_0859F2AC 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 .pool 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, =0x0203a134 ldr r0, [r4] ldr r1, =0x0000021b 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 .pool 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, =0x0203a134 ldr r0, [r0] movs r1, 0x84 lsls r1, 2 adds r0, r1 ldr r1, =sub_8121CC0 str r1, [r0] @08121CB2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8121C98 thumb_func_start sub_8121CC0 sub_8121CC0: ; 8121CC0 push {lr} sub sp, 0x4 ldr r0, =0x030022c0 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, =0x0203a134 ldr r0, [r0] movs r1, 0x84 lsls r1, 2 adds r0, r1 ldr r1, =sub_8121D00 str r1, [r0] @08121CEE: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a134 ldr r0, [r4] movs r1, 0x83 lsls r1, 2 adds r0, r1 ldr r0, [r0] bl set_callback2 ldr r1, [r4] ldr r2, =0x0000021b 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, =0x02020630 adds r0, r1 bl sub_80D2EF8 @08121D58: ldr r4, =0x0203a134 ldr r0, [r4] ldr r2, =0x0000222c 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 .pool 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, =0x0100c000 mov r0, sp bl CpuSet movs r4, 0 str r4, [sp, 0x4] add r0, sp, 0x4 movs r1, 0xE0 lsls r1, 19 ldr r2, =0x05000100 bl CpuSet add r0, sp, 0x8 strh r4, [r0] movs r1, 0xA0 lsls r1, 19 ldr r2, =0x01000200 bl CpuSet add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a140 strb r6, [r0] adds r0, r6, 0 movs r1, 0x1 bl sub_8197B1C ldr r4, =0x02021fc4 ldr r0, [sp, 0x30] cmp r0, r4 beq @08121EC0 adds r0, r4, 0 ldr r1, [sp, 0x30] bl ExpandTextCodes @08121EC0: ldr r2, =0x03003014 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, =0x0300117c ldr r0, [sp, 0x34] str r0, [r1] ldr r1, =0x03005e00 mov r2, r8 lsls r0, r2, 2 add r0, r8 lsls r0, 3 adds r0, r1 ldr r1, =task_show_message str r1, [r0] add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a140 ldrb r0, [r0] bl sub_8121F20 lsls r0, 16 cmp r0, 0 bne @08121F5A ldr r0, =0x0300117c ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 @08121F5A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_show_message thumb_func_start sub_8121F68 sub_8121F68: ; 8121F68 lsls r0, 24 lsrs r0, 24 ldr r3, =0x0203a138 ldr r2, [r1, 0x4] ldr r1, [r1] str r1, [r3] str r2, [r3, 0x4] ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_8121FDC str r0, [r1] bx lr .align 2, 0 .pool 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, =0x0203a138 ldr r0, [r5] ldr r1, [r5, 0x4] str r0, [r2] str r1, [r2, 0x4] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8121FDC str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a138 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 b @08122028 .align 2, 0 .pool @08122018: movs r0, 0x5 bl audio_play ldr r0, =0x0203a138 ldr r1, [r0, 0x4] adds r0, r4, 0 bl _call_via_r1 @08122028: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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 .pool @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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 bne @08122106 ldr r0, =0x030022c0 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 .pool @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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x13] cmp r0, 0x1 bne @08122142 ldr r0, =0x030022c0 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 .pool @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, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00001919 cmp r1, r0 beq @08122166 bl in_trade_center cmp r0, 0x1 bne @08122174 @08122166: movs r0, 0 b @08122176 .align 2, 0 .pool @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, =0x03003124 ldrb r0, [r0] cmp r0, 0x1 bne @081221C8 @081221BE: movs r0, 0x1 b @081221CA .align 2, 0 .pool @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, =gUnknown_0859F514 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0859F51C bl gpu_pal_obj_decompress_and_apply pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 @08122358: lsls r1, r5, 4 ldr r0, =gUnknown_0859F524 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 .pool 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, =0x02020630 @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 .pool @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, =0x02020630 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 .pool 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, =0x02020630 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 .pool @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, =0x03005d8c @081224DA: movs r0, 0xA bl sub_811EE38 ldr r1, [r5] lsls r4, r6, 3 adds r1, r4 ldr r2, =0x00002e6c 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, =0x00002e6e adds r1, r7 b @08122522 .align 2, 0 .pool @08122514: movs r0, 0xD bl sub_811EE38 ldr r1, [r5] adds r1, r4 ldr r2, =0x00002e6e adds r1, r2 @08122522: strh r0, [r1] bl GenerateRandomNumber ldr r3, [r5] adds r3, r4 movs r2, 0x1 ands r2, r0 ldr r7, =0x00002e69 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, =0x00002e68 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e68 adds r0, r1 movs r1, 0x5 movs r2, 0 bl sub_8122804 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00002e68 adds r0, r4 ldr r3, =0x03005d8c 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 .pool @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, =0x03005d8c ldr r0, [r4] ldr r1, =0x00002e68 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 .pool 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, =0x00000893 adds r0, r4, 0 bl flag_check lsls r0, 24 cmp r0, 0 bne @08122744 adds r0, r4, 0 bl flag_set ldr r0, =0x00000894 bl flag_check lsls r0, 24 cmp r0, 0 bne @08122744 ldr r0, =0x03005d8c ldr r1, [r0] mov r0, r8 ldrh r2, [r0] ldr r3, =0x00002e6c 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 .pool @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, =0x03005d8c lsls r4, r5, 3 ldr r1, =0x00002e68 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, =0x00002e68 @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, =0x00002e68 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 .pool @081227D4: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x4 bls @08122762 ldr r2, [r6] ldr r1, =0x00002e88 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 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e68 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 .pool thumb_func_end sub_812287C thumb_func_start sub_8122998 sub_8122998: ; 8122998 push {lr} ldr r2, =0x03005d8c ldr r0, =0x020375e0 ldrh r1, [r0] lsls r1, 3 ldr r0, [r2] adds r1, r0 ldr r0, =0x02021cc4 ldr r2, =0x00002e6c adds r1, r2 movs r2, 0x2 movs r3, 0x1 bl sub_811EC08 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8122998 thumb_func_start sub_81229C8 sub_81229C8: ; 81229C8 push {r4,lr} movs r4, 0 ldr r0, =0x03005d8c ldr r3, [r0] ldr r1, =0x00002e68 adds r0, r3, r1 ldrb r1, [r0] lsls r1, 25 lsrs r1, 25 ldr r2, =0x00002e70 adds r0, r3, r2 ldrb r0, [r0] lsls r0, 25 lsrs r0, 25 subs r1, r0 cmp r1, 0x1 bgt @08122A0C ldr r1, =0x00002e69 adds r0, r3, r1 ldrb r1, [r0] movs r2, 0x40 adds r0, r2, 0 ands r0, r1 cmp r0, 0 bne @08122A0C ldr r1, =0x00002e71 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, =0x020375f0 strh r4, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81229C8 thumb_func_start sub_8122A30 sub_8122A30: ; 8122A30 ldr r2, =0x020375f0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00002e6c 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 .pool 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, =0xffffc07f 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 .pool 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, =0x03005d8c @08122BB8: lsls r1, r4, 3 ldr r0, [r6] adds r1, r0 ldr r0, =0x00002e6c 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 .pool @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, =gUnknown_0859F53C @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 .pool @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, =gUnknown_0859F534 adds r0, r1 b @08122CB6 .align 2, 0 .pool @08122CB4: movs r0, 0 @08122CB6: pop {r1} bx r1 thumb_func_end sub_8122C94 thumb_func_start sub_8122CBC ; warpdata *sub_8122CBC(int a1) sub_8122CBC: ; 8122CBC push {lr} cmp r0, 0 beq @08122CD4 cmp r0, 0x16 bhi @08122CD4 lsls r0, 3 ldr r1, =gUnknown_0859F534 adds r0, r1 b @08122CD6 .align 2, 0 .pool @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, =0x0203a144 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, =sub_8123254 b @08122D2A .align 2, 0 .pool @08122D28: ldr r0, =sub_81230C4 @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 .pool @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, =0x0203a144 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 .pool thumb_func_end sub_8122D88 thumb_func_start sub_8122DB0 sub_8122DB0: ; 8122DB0 push {r4,r5,lr} sub sp, 0xC ldr r0, =0x0203a144 ldr r0, [r0] adds r0, 0x79 ldrb r0, [r0] cmp r0, 0x7 bls @08122DC2 b @0812300C @08122DC2: lsls r0, 2 ldr r1, =@08122DD4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08122DD4: .4byte @08122DF4 .4byte @08122E2C .4byte @08122E78 .4byte @08122E94 .4byte @08122EB0 .4byte @08122ECC .4byte @08122F10 .4byte @08122F8C @08122DF4: ldr r0, =0x0203a144 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, =gUnknown_0859F77C movs r2, 0 str r2, [sp] b @08122E52 .align 2, 0 .pool @08122E18: ldr r0, =gUnknown_0859F77C ldr r1, =0x06008000 bl LZ77UnCompVram b @08123014 .align 2, 0 .pool @08122E2C: ldr r4, =0x0203a144 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, =gUnknown_085A04E0 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 .pool @08122E64: ldr r0, =gUnknown_085A04E0 ldr r1, =0x0600e000 bl LZ77UnCompVram b @08123014 .align 2, 0 .pool @08122E78: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 beq @08122E84 b @08123014 @08122E84: ldr r0, =gUnknown_0859F73C movs r1, 0x70 movs r2, 0x60 bl gpu_pal_apply b @08123014 .align 2, 0 .pool @08122E94: ldr r0, =gUnknown_0859F60C ldr r1, =0x0203a144 ldr r1, [r1] movs r2, 0xC2 lsls r2, 1 adds r1, r2 bl LZ77UnCompWram b @08123014 .align 2, 0 .pool @08122EB0: ldr r0, =gUnknown_0859F650 ldr r1, =0x0203a144 ldr r1, [r1] movs r5, 0xA1 lsls r5, 2 adds r1, r5 bl LZ77UnCompWram b @08123014 .align 2, 0 .pool @08122ECC: bl sub_81238AC ldr r4, =0x0203a144 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 .pool @08122F10: ldr r0, =0x0203a144 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 .pool @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, =0x0203a144 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 .pool @08123014: ldr r0, =0x0203a144 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 .pool 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, =0x02037bf4 ldr r1, =0x020377f4 movs r2, 0x30 bl CpuSet pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8123030 thumb_func_start sub_812305C sub_812305C: ; 812305C push {r4,lr} ldr r4, =0x0203a144 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 .pool thumb_func_end sub_812305C thumb_func_start sub_81230AC sub_81230AC: ; 81230AC push {lr} ldr r0, =0x0203a144 ldr r0, [r0] ldr r0, [r0, 0x18] bl _call_via_r0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81230AC thumb_func_start sub_81230C4 sub_81230C4: ; 81230C4 push {r4,lr} movs r4, 0 ldr r2, =0x0203a144 ldr r0, [r2] adds r0, 0x7B strb r4, [r0] ldr r0, [r2] adds r0, 0x7C strb r4, [r0] ldr r3, =0x030022c0 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 .pool @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, =_swiopen str r0, [r1, 0x18] @08123184: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81230C4 thumb_func_start _swiopen _swiopen: ; 8123190 push {r4,r5,lr} ldr r5, =0x0203a144 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 .pool @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, =sub_81230C4 str r0, [r1, 0x18] movs r0, 0x3 @08123248: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end _swiopen thumb_func_start sub_8123254 sub_8123254: ; 8123254 push {r4-r6,lr} movs r4, 0 ldr r3, =0x0203a144 ldr r0, [r3] mov r12, r0 adds r0, 0x6A strh r4, [r0] mov r5, r12 adds r5, 0x68 strh r4, [r5] ldr r2, =0x030022c0 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, =0x0000ffff 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, =0x0000ffff 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, =sub_8123334 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 .pool thumb_func_end sub_8123254 thumb_func_start sub_8123334 sub_8123334: ; 8123334 push {r4,r5,lr} ldr r5, =0x0203a144 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, =0x0203a144 ldr r2, [r0] adds r1, r2, 0 adds r1, 0x6C movs r0, 0 strh r0, [r1] ldr r0, =sub_8123254 str r0, [r2, 0x18] movs r0, 0x3 b @08123412 .align 2, 0 .pool @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, =0x0203a144 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, =0xfffff800 b @081234FA .align 2, 0 .pool @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, =0x0203a144 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 .pool @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, =sub_8123254 cmp r0, 0 bne @08123584 ldr r2, =sub_81230C4 @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 .pool @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, =0x0203a144 ldr r2, [r0] adds r0, r2, 0 adds r0, 0x78 ldrb r3, [r0] cmp r3, 0 bne @08123674 ldr r1, [r2, 0x4C] ldr r0, =0x00007fff cmp r1, r0 bgt @08123684 adds r0, 0x1 str r0, [r2, 0x4C] str r3, [r2, 0x50] b @08123684 .align 2, 0 .pool @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, =0x0203a144 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 .pool 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, =0x0203a144 ldr r6, [r4] ldr r7, =gUnknown_08329F40 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 .pool thumb_func_end sub_81236C4 thumb_func_start sub_812378C sub_812378C: ; 812378C ldr r2, =0x0203a144 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 .pool thumb_func_end sub_812378C thumb_func_start sub_81237B4 sub_81237B4: ; 81237B4 push {r4,lr} ldr r4, =0x0203a144 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 .pool 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, =0x0203a144 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 .pool 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, =0xfffe0000 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 .pool @08123890: subs r0, r3, 0x1 lsls r0, 16 lsrs r3, r0, 16 ldr r1, =gUnknown_085A096C 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 .pool 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, =0x03005d8c 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 .pool @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, =@08123904 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a144 ldr r0, [r4] ldr r3, =0x02037318 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, =0x03005d8c 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 .pool @0812396C: ldr r2, =0x02037318 ldrb r1, [r2, 0x1A] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081239C8 ldr r4, =0x03005d8c 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, =0x0203a144 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 .pool @081239C8: ldr r0, =0x0203a144 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 .pool @081239E4: ldr r4, =0x03005d8c 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, =0x0203a144 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 .pool @08123A28: ldr r4, =0x0203a144 ldr r0, [r4] ldr r1, =0x02037318 ldrb r1, [r1, 0x14] strh r1, [r0] cmp r1, 0x57 beq @08123A64 ldr r0, =0x03005d8c 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 .pool @08123A64: ldr r0, =0x03005d8c 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, =0x0203a144 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 .pool @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, =gRegionMapEntries ldr r4, =0x0203a144 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 .pool @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, =0x03005d8c 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 .pool @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, =0x0203a144 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 .pool 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, =@08123C40 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08123C40: .4byte @08123C94 .4byte @08123C54 .4byte @08123C64 .4byte @08123C74 .4byte @08123C84 @08123C54: ldr r2, =0x0203a144 ldr r1, [r2] movs r0, 0x8 strh r0, [r1] b @08123D10 .align 2, 0 .pool @08123C64: ldr r2, =0x0203a144 ldr r1, [r2] movs r0, 0xC strh r0, [r1] b @08123D10 .align 2, 0 .pool @08123C74: ldr r2, =0x0203a144 ldr r1, [r2] movs r0, 0x27 strh r0, [r1] b @08123D10 .align 2, 0 .pool @08123C84: ldr r2, =0x0203a144 ldr r1, [r2] movs r0, 0x2E strh r0, [r1] b @08123D10 .align 2, 0 .pool @08123C94: mov r0, sp ldrb r0, [r0] ldrb r1, [r4] bl get_mapheader_by_bank_and_number ldr r1, =0x0203a144 mov r9, r1 ldr r2, [r1] ldrb r1, [r0, 0x14] strh r1, [r2] ldr r6, [r0] ldr r1, =gRegionMapEntries 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, =gRegionMapEntries 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 .pool 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, =0x0000086f b @08123E4A .align 2, 0 .pool @08123DD8: movs r0, 0x87 lsls r0, 4 b @08123E4A @08123DDE: ldr r0, =0x00000871 b @08123E4A .align 2, 0 .pool @08123DE8: ldr r0, =0x00000872 b @08123E4A .align 2, 0 .pool @08123DF0: ldr r0, =0x00000873 b @08123E4A .align 2, 0 .pool @08123DF8: ldr r0, =0x00000874 b @08123E4A .align 2, 0 .pool @08123E00: ldr r0, =0x00000875 b @08123E4A .align 2, 0 .pool @08123E08: ldr r0, =0x00000876 b @08123E4A .align 2, 0 .pool @08123E10: ldr r0, =0x00000877 b @08123E4A .align 2, 0 .pool @08123E18: ldr r0, =0x00000878 b @08123E4A .align 2, 0 .pool @08123E20: ldr r0, =0x00000879 b @08123E4A .align 2, 0 .pool @08123E28: ldr r0, =0x0000087a b @08123E4A .align 2, 0 .pool @08123E30: ldr r0, =0x0000087b b @08123E4A .align 2, 0 .pool @08123E38: ldr r0, =0x0000087c b @08123E4A .align 2, 0 .pool @08123E40: ldr r0, =0x0000087d b @08123E4A .align 2, 0 .pool @08123E48: ldr r0, =0x0000087e @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 .pool @08123E60: ldr r0, =0x000008a8 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 .pool @08123E7C: ldr r0, =0x000008a9 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 .pool @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, =gUnknown_085A1B84 @08123EBE: ldrh r0, [r1] cmp r0, r3 bne @08123ED4 bl sub_8123F04 lsls r0, 16 lsrs r0, 16 b @08123F00 .align 2, 0 .pool @08123ED4: adds r1, 0x2 adds r2, 0x1 cmp r2, 0x2 bls @08123EBE ldr r1, =gUnknown_085A1B24 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 .pool @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, =0x00004037 bl var_get subs r0, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0xF bls @08123F18 movs r1, 0 @08123F18: ldr r0, =gUnknown_085A1B8A lsls r1, 16 asrs r1, 15 adds r1, r0 ldrh r0, [r1] pop {r1} bx r1 .align 2, 0 .pool 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, =0x00004037 bl var_get lsls r0, 16 lsrs r1, r0, 16 ldr r2, =0xfff70000 adds r0, r2 lsrs r0, 16 cmp r0, 0x7 bls @08123F4C movs r1, 0x9 @08123F4C: subs r1, 0x9 lsls r1, 16 ldr r0, =gUnknown_085A1BAC 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 .pool 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, =gUnknown_085A1BCC @08123F7E: adds r0, r1, r3 ldrb r0, [r0] cmp r0, r2 bne @08123F90 movs r0, 0x1 b @08123F98 .align 2, 0 .pool @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, =0x0203a144 ldr r1, [r0] ldrh r0, [r1] cmp r0, 0xD5 bne @08123FC8 movs r0, 0 strb r0, [r1, 0x3] b @0812402E .align 2, 0 .pool @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, =0x0203a144 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 .pool @08124028: ldr r0, =0x0203a144 ldr r0, [r0] strb r6, [r0, 0x3] @0812402E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8123FB0 thumb_func_start sub_8124038 sub_8124038: ; 8124038 push {r4,r5,lr} lsls r0, 16 ldr r1, =0xffff0000 adds r0, r1 lsrs r5, r0, 16 ldr r0, =0x0000ffff cmp r5, r0 bne @08124058 b @0812407A .align 2, 0 .pool @08124054: movs r0, 0x1 b @0812407C @08124058: movs r4, 0x1 @0812405A: adds r0, r4, 0 adds r1, r5, 0 bl sub_812386C ldr r1, =0x0203a144 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 .pool thumb_func_end sub_8124038 thumb_func_start sub_8124088 sub_8124088: ; 8124088 push {r4,lr} adds r2, r0, 0 ldr r0, =0x0203a144 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 .pool 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, =gUnknown_085A1C00 ldr r2, [r1, 0x4] ldr r1, [r1] str r1, [sp, 0x20] str r2, [sp, 0x24] mov r2, sp ldr r1, =gUnknown_085A1C08 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, =0x0203a144 ldr r4, [r0] adds r0, r4, 0 adds r0, 0x58 strh r3, [r0] ldr r5, =0xffff0000 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, =sub_8124088 b @0812416E .align 2, 0 .pool @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, =nullsub_48 @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, =0x0203a144 ldr r2, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool @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, =0x0203a144 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, =0x00000101 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 .pool thumb_func_end sub_81240D4 thumb_func_start sub_8124238 sub_8124238: ; 8124238 push {r4,lr} ldr r4, =0x0203a144 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 .pool thumb_func_end sub_8124238 thumb_func_start sub_8124268 sub_8124268: ; 8124268 ldr r0, =0x0203a144 ldr r0, [r0] ldr r1, [r0, 0x1C] movs r0, 0x1 strh r0, [r1, 0x34] bx lr .align 2, 0 .pool thumb_func_end sub_8124268 thumb_func_start sub_8124278 sub_8124278: ; 8124278 ldr r0, =0x0203a144 ldr r0, [r0] ldr r1, [r0, 0x1C] movs r0, 0 strh r0, [r1, 0x34] bx lr .align 2, 0 .pool 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, =gUnknown_085A084C str r2, [sp, 0x18] movs r2, 0x80 add r6, sp, 0x18 lsrs r3, r0, 16 orrs r0, r2 str r0, [r6, 0x4] ldr r0, =gUnknown_085A082C str r0, [sp, 0x20] ldr r2, =0xffff0000 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, =gUnknown_085A1C20 str r0, [sp, 0x4] ldr r0, =gUnknown_085A1C30 str r0, [sp, 0x8] str r5, [sp, 0xC] ldr r0, =gUnknown_082EC6A8 str r0, [sp, 0x10] ldr r0, =nullsub_12 str r0, [sp, 0x14] ldr r0, =0x02037318 ldrb r0, [r0, 0x14] bl sub_8124668 cmp r0, 0 beq @08124304 ldr r0, =0x0203a144 ldr r0, [r0] str r5, [r0, 0x20] b @081243A4 .align 2, 0 .pool @08124304: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0x1 bne @08124316 ldr r0, =gUnknown_085A08EC str r0, [sp, 0x18] ldr r0, =gUnknown_085A08CC 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, =0x0203a144 ldr r2, [r1] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 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, =sub_81244EC b @081243A2 .align 2, 0 .pool @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, =sub_812445C @081243A2: str r0, [r1, 0x1C] @081243A4: add sp, 0x28 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8124288 thumb_func_start sub_81243B0 sub_81243B0: ; 81243B0 push {lr} ldr r3, =0x0203a144 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, =nullsub_12 str r0, [r1, 0x1C] @081243CE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81243B0 thumb_func_start sub_81243DC sub_81243DC: ; 81243DC push {lr} ldr r0, =0x0203a144 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, =sub_812445C b @08124444 .align 2, 0 .pool @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, =sub_81244EC @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 .pool thumb_func_end sub_81243DC thumb_func_start sub_812445C sub_812445C: ; 812445C push {r4,lr} adds r3, r0, 0 ldr r0, =0x0203a144 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 .pool @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, =0x0203a144 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 .pool @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, =0x0203a144 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 .pool 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, =gRegionMapEntries 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 .pool @081245A0: cmp r4, 0 bne @081245A6 movs r4, 0x12 @081245A6: adds r0, r5, 0 movs r1, 0 adds r2, r4, 0 bl RepeatChar 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, =gUnknown_085EC9D2 bl gf_strcpy b @0812460A .align 2, 0 .pool @081245F8: ldr r1, =gUnknown_085EC9D8 bl gf_strcpy b @0812460A .align 2, 0 .pool @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, =gUnknown_085EC9E4 bl gf_strcpy @08124626: pop {r1} bx r1 .align 2, 0 .pool 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, =gRegionMapEntries 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 .pool thumb_func_end sub_8124630 thumb_func_start sub_8124658 sub_8124658: ; 8124658 ldr r0, =0x0203a144 ldr r0, [r0] adds r0, 0x78 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_085A1C34 @08124672: adds r0, r1, r3 ldrb r0, [r0] cmp r2, r0 bne @08124684 movs r0, 0x1 b @0812468C .align 2, 0 .pool @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, =0x030022c0 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, =@081246B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a148 ldr r0, =0x00000a74 bl malloc str r0, [r4] cmp r0, 0 bne @08124754 ldr r0, =sub_8086194 bl set_callback2 b @081248AA .align 2, 0 .pool @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, =gUnknown_085A1EE4 movs r0, 0x1 movs r2, 0x3 bl bg_vram_setup b @0812489C .align 2, 0 .pool @0812477C: ldr r0, =gUnknown_085A1EF0 bl Window_InitFromTemplates bl TextBox_ResetSomeField b @0812489C .align 2, 0 .pool @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, =0x0203a148 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, =0x00000a4c adds r0, r1 movs r1, 0 movs r2, 0x10 bl RepeatChar ldr r1, =0x03001180 movs r0, 0x1 str r0, [r1] bl sub_8124904 b @0812489C .align 2, 0 .pool @081247E4: ldr r0, =gUnknown_085A1C58 ldr r1, =0x0600c000 bl LZ77UnCompVram b @0812489C .align 2, 0 .pool @081247F8: ldr r0, =gUnknown_085A1C90 ldr r1, =0x0600f000 bl LZ77UnCompVram b @0812489C .align 2, 0 .pool @0812480C: ldr r0, =gUnknown_085A1C38 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, =gUnknown_085E8CB4 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 .pool @0812484C: bl sub_8124A70 b @0812489C @08124852: movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r0, =sub_81248C0 bl SetVBlankCallback b @0812489C .align 2, 0 .pool @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, =sub_8124D14 bl sub_81248F4 ldr r0, =sub_81248D4 bl set_callback2 @0812489C: ldr r1, =0x030022c0 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 .pool 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, =0x0203a148 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 .pool thumb_func_end sub_81248D4 thumb_func_start sub_81248F4 sub_81248F4: ; 81248F4 ldr r1, =0x0203a148 ldr r1, [r1] str r0, [r1] movs r0, 0 strh r0, [r1, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_81248F4 thumb_func_start sub_8124904 sub_8124904: ; 8124904 push {r4-r7,lr} sub sp, 0xC ldr r2, =0x0203a148 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, =gUnknown_085A1EDC 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, =0x03001180 str r7, [r0] b @081249CE .align 2, 0 .pool @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, =0x03001180 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 .pool @081249F4: movs r0, 0 movs r1, 0x11 bl Window_FastFillPixels @081249FC: ldr r0, =0x0203a148 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, =0x03001180 str r4, [r0] b @08124A62 .align 2, 0 .pool @08124A2C: ldr r4, =0x03001180 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 .pool thumb_func_end sub_8124904 thumb_func_start sub_8124A70 sub_8124A70: ; 8124A70 push {r4,r5,lr} sub sp, 0x8 ldr r0, =gUnknown_085A1D68 ldr r5, =0x0203a148 ldr r1, [r5] ldr r4, =0x0000088c adds r1, r4 bl LZ77UnCompWram ldr r0, [r5] adds r0, r4 str r0, [sp] ldr r1, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r1 movs r1, 0xE0 lsls r1, 1 orrs r0, r1 ldr r1, =0x0000ffff 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, =gUnknown_085A1F10 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 .pool 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, =0x0000086f 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 .pool @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, =gUnknown_085A1F7C movs r3, 0xA bl obj_add_from_template_forward_search lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x40 beq @08124BB8 ldr r1, =0x02020630 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, =sub_8124CBC str r1, [r0] b @08124BA2 .align 2, 0 .pool @08124B9C: adds r0, r7, 0x3 lsls r0, 16 lsrs r7, r0, 16 @08124BA2: adds r4, r5 lsls r4, 2 ldr r0, =0x02020630 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 .pool 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, =gUnknown_085A1F18 ldrh r0, [r6, 0x2] cmp r0, 0xD5 beq @08124C9C mov r5, sp adds r5, 0x6 add r7, sp, 0x4 ldr r1, =0x02020630 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, =gUnknown_085A1F7C 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, =sub_8124CBC 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, =gUnknown_085A1F18 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 .pool thumb_func_end sub_8124BE4 thumb_func_start sub_8124CBC sub_8124CBC: ; 8124CBC push {lr} adds r2, r0, 0 ldr r0, =0x0203a148 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 .pool @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, =0x0203a148 ldr r0, [r4] ldrh r1, [r0, 0x4] cmp r1, 0 beq @08124D2C cmp r1, 0x1 beq @08124D46 b @08124D56 .align 2, 0 .pool @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, =sub_8124D64 bl sub_81248F4 @08124D56: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8124D14 thumb_func_start sub_8124D64 sub_8124D64: ; 8124D64 push {r4,lr} ldr r0, =0x0203a148 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, =@08124D90 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203a148 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, =0x00000a72 adds r0, r1 movs r1, 0x1 strb r1, [r0] ldr r0, =sub_8124E0C bl sub_81248F4 b @08124DF8 .align 2, 0 .pool @08124DE0: movs r0, 0x5 bl m4aSongNumStart ldr r0, =0x0203a148 ldr r0, [r0] ldr r1, =0x00000a72 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, =sub_8124E0C bl sub_81248F4 @08124DF8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8124D64 thumb_func_start sub_8124E0C sub_8124E0C: ; 8124E0C push {r4,lr} sub sp, 0x4 ldr r4, =0x0203a148 ldr r0, [r4] ldrh r1, [r0, 0x4] cmp r1, 0 beq @08124E24 cmp r1, 0x1 beq @08124E3E b @08124F1A .align 2, 0 .pool @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, =0x00000a72 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 .pool @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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] movs r1, 0xD cmp r0, 0 bne @08124EB0 movs r1, 0xC b @08124EB0 .align 2, 0 .pool @08124E98: ldr r0, =0x000008b4 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 .pool @08124EBC: ldr r3, =gUnknown_085A1E3C ldr r0, =0x0203a148 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 .pool @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, =sub_81B58A8 bl set_callback2 @08124F06: ldr r4, =0x0203a148 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 .pool thumb_func_end sub_8124E0C thumb_func_start sub_8124F2C sub_8124F2C: ; 8124F2C push {lr} ldr r2, =0x03006168 ldr r1, [r0, 0x4] str r1, [r2] ldr r2, =0x0300617c ldrb r1, [r0, 0x1F] strb r1, [r2] ldr r2, =0x03006164 ldrb r1, [r0, 0x19] strb r1, [r2] ldr r2, =0x03006178 ldrb r1, [r0, 0x1A] strb r1, [r2] ldr r2, =0x03006174 ldrb r1, [r0, 0x1B] strb r1, [r2] ldr r2, =0x0300616c ldrb r1, [r0, 0x1C] strb r1, [r2] ldr r2, =0x03006180 ldrb r1, [r0, 0x1D] strb r1, [r2] ldr r2, =0x03006170 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, =@08124F98 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0300617c ldrb r0, [r0] bl sub_81253A4 b @081250B4 .align 2, 0 .pool @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, =0x0300616c mov r8, r0 ldrb r0, [r0] cmp r2, r0 bcs @0812514A ldr r1, =0x03006174 mov r12, r1 ldr r3, =0x03006180 mov r10, r3 ldr r0, =0x03006164 mov r9, r0 @081250DE: ldr r1, =0x03006178 ldrb r0, [r1] adds r0, r2 mov r3, r10 ldrb r1, [r3] muls r0, r1 lsls r0, 1 ldr r3, =0x03006168 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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @08125208 ldr r1, =0x03006174 mov r10, r1 @0812518E: ldr r3, =0x03006178 ldrb r0, [r3] adds r0, r2 ldr r3, =0x03006180 ldrb r1, [r3] muls r0, r1 lsls r0, 1 ldr r3, =0x03006168 ldr r1, [r3] adds r1, r0 ldr r3, =0x03006164 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, =0x0300616c 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 .pool thumb_func_end sub_8125170 thumb_func_start sub_8125230 sub_8125230: ; 8125230 push {r4,r5,lr} movs r4, 0 ldr r5, =0x00000c7f @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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @081252C2 ldr r0, =0x03006168 mov r8, r0 ldr r3, =0x03006174 @08125268: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r2 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r4, r8 ldr r1, [r4] adds r1, r0 ldr r0, =0x03006164 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, =0x0300616c 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 .pool 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, =0x03006174 ldrb r0, [r0] cmp r2, r0 bcs @0812537E ldr r0, =0x03006168 mov r8, r0 ldr r3, =0x03006180 @08125300: ldr r0, =0x03006178 ldrb r1, [r0] ldrb r0, [r3] muls r0, r1 lsls r0, 1 mov r4, r8 ldr r1, [r4] adds r1, r0 ldr r0, =0x03006164 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, =0x0300616c ldrb r0, [r0] subs r0, 0x1 adds r7, r2, 0x1 cmp r5, r0 bge @08125372 ldr r6, =0x03006180 @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, =0x0300616c ldrb r0, [r0] subs r0, 0x1 cmp r5, r0 blt @08125336 @08125372: lsls r0, r7, 24 lsrs r2, r0, 24 ldr r0, =0x03006174 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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @08125420 ldr r0, =0x03006168 mov r9, r0 ldr r3, =0x03006174 @081253C4: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r2 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r4, r9 ldr r1, [r4] adds r1, r0 ldr r0, =0x03006164 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, =0x0300616c 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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @081254BA ldr r0, =0x03006168 mov r8, r0 ldr r3, =0x03006174 @08125460: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r2 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r4, r8 ldr r1, [r4] adds r1, r0 ldr r0, =0x03006164 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, =0x0300616c 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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r7, r0 bcs @0812556C ldr r0, =0x03006168 mov r8, r0 @081254F6: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r7 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r2, r8 ldr r1, [r2] adds r1, r0 ldr r0, =0x03006164 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, =0x03006174 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, =0x03006174 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, =0x0300616c ldrb r0, [r0] cmp r7, r0 bcc @081254F6 @0812556C: movs r6, 0 ldr r0, =0x03006174 ldrb r0, [r0] cmp r6, r0 bcs @0812560C ldr r3, =0x03006168 mov r9, r3 ldr r0, =0x03006180 mov r8, r0 @0812557E: ldr r0, =0x03006178 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, =0x03006164 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, =0x0300616c ldrb r0, [r0] subs r0, 0x1 adds r6, 0x1 cmp r7, r0 bge @081255F0 ldr r4, =0x03006180 @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, =0x0300616c 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, =0x03006174 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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @081256A2 ldr r0, =0x03006168 mov r8, r0 ldr r3, =0x03006174 @08125648: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r2 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r4, r8 ldr r1, [r4] adds r1, r0 ldr r0, =0x03006164 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, =0x0300616c 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 .pool 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, =0x03006168 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, =0x03006168 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, =0x03006168 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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @0812587A ldr r0, =0x03006168 mov r8, r0 @0812580E: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r2 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r3, r8 ldr r1, [r3] adds r1, r0 ldr r0, =0x03006164 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, =0x03006174 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, =0x03006174 ldrb r0, [r0] subs r0, 0x1 cmp r5, r0 blt @08125846 @0812586E: lsls r0, r6, 24 lsrs r2, r0, 24 ldr r0, =0x0300616c 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 .pool 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, =0x03006174 ldrb r0, [r0] cmp r2, r0 bcs @0812592E ldr r0, =0x03006168 mov r8, r0 ldr r7, =0x03006180 @081258B8: ldr r0, =0x03006178 ldrb r1, [r0] ldrb r0, [r7] muls r0, r1 lsls r0, 1 mov r3, r8 ldr r1, [r3] adds r1, r0 ldr r0, =0x03006164 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, =0x0300616c 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, =0x0300616c ldrb r0, [r0] subs r0, 0x1 cmp r5, r0 blt @081258F2 @08125922: lsls r0, r6, 24 lsrs r2, r0, 24 ldr r0, =0x03006174 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 .pool 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, =gUnknown_085A1F94 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 .pool @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, =0x03006168 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 .pool @08125A78: mov r1, r10 lsls r0, r1, 1 add r0, r10 ldr r1, =gUnknown_085A1F94 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 .pool @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, =0x00007fff @08125B8E: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =@08125BE0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00007fff @08125C8E: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03006188 ldrb r1, [r0, 0x18] lsls r1, 4 strh r1, [r2] ldr r3, =0x03006184 ldrh r2, [r2] lsls r2, 1 ldr r1, [r0, 0x8] adds r1, r2 str r1, [r3] ldr r2, =0x03006168 ldr r1, [r0, 0x4] str r1, [r2] ldr r2, =0x03006164 ldrb r1, [r0, 0x19] strb r1, [r2] ldr r2, =0x03006178 ldrb r1, [r0, 0x1A] strb r1, [r2] ldr r2, =0x03006174 ldrb r1, [r0, 0x1B] strb r1, [r2] ldr r2, =0x0300616c ldrb r1, [r0, 0x1C] strb r1, [r2] ldr r2, =0x03006180 ldrb r1, [r0, 0x1D] strb r1, [r2] ldr r2, =0x03006170 ldrb r1, [r0, 0x1E] strb r1, [r2] ldrh r0, [r0, 0x14] cmp r0, 0x5 bhi @0812626A lsls r0, 2 ldr r1, =@0812621C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03006184 ldr r1, [r2] movs r0, 0 strh r0, [r1] ldr r0, [r2] ldr r2, =0x000018c6 adds r1, r2, 0 strh r1, [r0, 0x2] ldr r2, =0x000077bd adds r1, r2, 0 strh r1, [r0, 0x4] ldr r2, =0x00002d6b adds r1, r2, 0 strh r1, [r0, 0x6] ldr r2, =0x000018dd adds r1, r2, 0 strh r1, [r0, 0x8] ldr r2, =0x00001ba6 adds r1, r2, 0 strh r1, [r0, 0xA] ldr r2, =0x000074c6 adds r1, r2, 0 strh r1, [r0, 0xC] ldr r2, =0x00001bbd adds r1, r2, 0 strh r1, [r0, 0xE] ldr r2, =0x000074dd adds r1, r2, 0 strh r1, [r0, 0x10] ldr r2, =0x000077a6 adds r1, r2, 0 strh r1, [r0, 0x12] ldr r2, =0x0000197d adds r1, r2, 0 strh r1, [r0, 0x14] ldr r2, =0x00001bab adds r1, r2, 0 strh r1, [r0, 0x16] ldr r2, =0x00007566 adds r1, r2, 0 strh r1, [r0, 0x18] ldr r2, =0x00002cdd adds r1, r2, 0 strh r1, [r0, 0x1A] ldr r2, =0x00002fa6 adds r1, r2, 0 strh r1, [r0, 0x1C] ldr r2, =0x000074cb adds r1, r2, 0 strh r1, [r0, 0x1E] bx lr .align 2, 0 .pool thumb_func_end sub_8126270 thumb_func_start sub_8126318 sub_8126318: ; 8126318 ldr r2, =0x03006184 ldr r0, [r2] movs r1, 0 strh r1, [r0] ldr r2, [r2] strh r1, [r2, 0x2] ldr r1, =0x00007fff adds r0, r1, 0 strh r0, [r2, 0x4] bx lr .align 2, 0 .pool thumb_func_end sub_8126318 thumb_func_start sub_8126334 sub_8126334: ; 8126334 push {r4,r5,lr} ldr r1, =0x03006184 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 .pool thumb_func_end sub_8126334 thumb_func_start sub_8126370 sub_8126370: ; 8126370 push {r4,lr} ldr r2, =0x03006184 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 .pool 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, =0x03006184 mov r12, r3 mov r0, r9 lsls r4, r0, 1 ldr r5, =0x0300616c 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, =0x00003def adds r1, r2, 0 strh r1, [r0] movs r3, 0 ldrb r5, [r5] cmp r3, r5 bcs @081264E4 @081263F4: ldr r2, =0x03006168 ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r3 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 ldr r1, [r2] adds r1, r0 ldr r0, =0x03006164 ldrb r0, [r0] lsls r0, 1 adds r4, r1, r0 movs r6, 0 ldr r0, =0x03006174 adds r2, r0, 0 adds r3, 0x1 mov r10, r3 ldrb r3, [r2] cmp r6, r3 bcs @081264D6 ldr r0, =0x03006188 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 .pool @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, =0x03006184 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 .pool @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, =0x03006174 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, =0x0300616c 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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @081265A0 ldr r0, =0x03006168 mov r8, r0 @08126510: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r2 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r3, r8 ldr r1, [r3] adds r1, r0 ldr r0, =0x03006164 ldrb r0, [r0] lsls r0, 1 adds r4, r1, r0 movs r6, 0 ldr r0, =0x03006174 adds r3, r0, 0 adds r7, r2, 0x1 ldrb r0, [r3] cmp r6, r0 bcs @08126594 ldr r5, =0x03006188 @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 .pool @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, =0x03006174 @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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcc @08126510 @081265A0: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @08126650 ldr r0, =0x03006168 mov r8, r0 @081265CA: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r2 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r3, r8 ldr r1, [r3] adds r1, r0 ldr r0, =0x03006164 ldrb r0, [r0] lsls r0, 1 adds r4, r1, r0 movs r5, 0 ldr r0, =0x03006174 adds r7, r2, 0x1 ldrb r0, [r0] cmp r5, r0 bcs @08126644 ldr r6, =0x03006188 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 .pool @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, =0x03006174 ldrb r0, [r0] cmp r5, r0 bcc @081265FA @08126644: lsls r0, r7, 24 lsrs r2, r0, 24 ldr r0, =0x0300616c 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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @08126700 ldr r0, =0x03006168 mov r8, r0 @0812667A: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r2 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r3, r8 ldr r1, [r3] adds r1, r0 ldr r0, =0x03006164 ldrb r0, [r0] lsls r0, 1 adds r4, r1, r0 movs r5, 0 ldr r0, =0x03006174 adds r7, r2, 0x1 ldrb r0, [r0] cmp r5, r0 bcs @081266F4 ldr r6, =0x03006188 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 .pool @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, =0x03006174 ldrb r0, [r0] cmp r5, r0 bcc @081266AA @081266F4: lsls r0, r7, 24 lsrs r2, r0, 24 ldr r0, =0x0300616c 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 .pool 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, =0x0300616c ldrb r0, [r0] cmp r2, r0 bcs @081267B0 ldr r0, =0x03006168 mov r8, r0 @0812672A: ldr r0, =0x03006178 ldrb r1, [r0] adds r1, r2 ldr r0, =0x03006180 ldrb r0, [r0] muls r0, r1 lsls r0, 1 mov r3, r8 ldr r1, [r3] adds r1, r0 ldr r0, =0x03006164 ldrb r0, [r0] lsls r0, 1 adds r4, r1, r0 movs r5, 0 ldr r0, =0x03006174 adds r7, r2, 0x1 ldrb r0, [r0] cmp r5, r0 bcs @081267A4 ldr r6, =0x03006188 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 .pool @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, =0x03006174 ldrb r0, [r0] cmp r5, r0 bcc @0812675A @081267A4: lsls r0, r7, 24 lsrs r2, r0, 24 ldr r0, =0x0300616c 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 .pool 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, =0x0203a173 ldrb r0, [r3] cmp r0, 0x7 bhi @0812697E ldr r2, =0x0203a14c ldr r1, =0x0203bc40 lsls r0, 3 adds r0, r1 ldr r0, [r0] str r0, [r2] @0812697E: ldr r2, =0x0203a17c ldrb r0, [r2, 0x9] cmp r0, 0 bne @08126996 ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00001aae adds r1, r0, r3 str r1, [r2] ldr r1, =0x00001abe adds r0, r1 str r0, [r2, 0x4] @08126996: ldrb r0, [r2, 0x9] cmp r0, 0x1 bne @081269AC ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x0000271c adds r1, r0, r3 str r1, [r2] ldr r1, =0x00002728 adds r0, r1 str r0, [r2, 0x4] @081269AC: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a188 adds r4, r1, r0 cmp r1, 0 bne @08126A28 ldr r0, =gUnknown_085A6B90 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] ldr r0, =gUnknown_085A6B48 movs r1, 0x4 bl GetMaxWidthInMenuTable lsls r0, 24 ldr r2, =0x00ffffff 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 .pool @08126A28: lsls r0, r1, 3 ldr r1, =gUnknown_085A6B90 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 .pool 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, =0x0203a188 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 .pool 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, =gUnknown_085A6B48 adds r0, r4, 0 movs r1, 0x4 bl PrintMenuTable ldr r0, =0x0203a150 ldrb r2, [r0] adds r0, r4, 0 movs r1, 0x4 bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8126A88 thumb_func_start sub_8126ABC sub_8126ABC: ; 8126ABC push {lr} ldr r1, =0x0203a150 movs r0, 0 strb r0, [r1] bl script_env_2_enable bl sub_8126A88 bl sub_8126C08 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a17c ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00001aae adds r1, r0, r3 str r1, [r2] ldr r1, =0x00001abe adds r0, r1 str r0, [r2, 0x4] movs r1, 0 movs r0, 0x10 strb r0, [r2, 0x8] strb r1, [r2, 0x9] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8126B80 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a17c ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x0000271c adds r1, r0, r3 str r1, [r2] ldr r1, =0x00002728 adds r0, r1 str r0, [r2, 0x4] movs r0, 0xC strb r0, [r2, 0x8] movs r0, 0x1 strb r0, [r2, 0x9] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8126B80 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =gUnknown_085A6B48 ldr r0, =0x0203a150 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 .pool @08126BD8: bl GetMenuCursorPos ldr r1, =0x0203a150 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 .pool @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, =gUnknown_085A6B68 ldr r0, =0x0203a150 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 .pool 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, =0x02021fc4 ldr r1, =gUnknown_085EA83D adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8126DA4 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC b @08126C96 .align 2, 0 .pool @08126C7C: ldr r1, =0x03005e00 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, =0x0203a173 strb r2, [r0] adds r0, r5, 0 bl sub_8126DCC @08126C96: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_085EAAEC adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8126DA4 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC b @08126D00 .align 2, 0 .pool @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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0xC] ldr r1, =sub_8129ABC str r1, [r0] @08126D00: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_085EA83D adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8126DA4 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC b @08126D5E .align 2, 0 .pool @08126D44: ldr r1, =0x03005e00 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, =0x0203a173 strb r2, [r0] adds r0, r5, 0 bl sub_8126DCC @08126D5E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a17c ldrb r0, [r0, 0x9] cmp r0, 0 bne @08126D98 ldr r0, =gUnknown_0823B4E8 bl script_env_1_execute_new_script adds r0, r4, 0 bl remove_task b @08126D9E .align 2, 0 .pool @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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8126B80 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A6BB0 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 .pool 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, =0x0203a173 ldrb r2, [r0] adds r0, r4, 0 movs r1, 0x9 bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_8127088 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a188 ldrb r0, [r5, 0x1] movs r1, 0x11 bl Window_FastFillPixels adds r0, r4, 0 bl sub_8126E8C ldrb r0, [r5, 0x1] ldr r1, =0x0203a173 ldrb r2, [r1] movs r1, 0x9 bl InitMenuInUpperLeftCornerPlaySoundWhenAPressed ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8127088 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r1, r0, r1 ldr r0, =0x0203a188 ldrb r5, [r0, 0x1] ldr r0, =0x0203a17c 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 .pool @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, =0x03005e00 mov r2, r9 adds r1, r2, r6 lsls r1, 3 adds r1, r0 movs r2, 0x1E ldrsh r0, [r1, r2] ldr r2, =gUnknown_085E8CF0 cmp r0, 0x2 bne @08126F2C ldr r2, =gUnknown_085EB7EA @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 .pool 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, =0x02021fc4 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, =gUnknown_085A6B28 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, =0x0203bc40 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 .pool 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, =gUnknown_085EA7C8 bl gf_strcpy cmp r4, 0x1 bne @08127078 movs r0, 0x4 strb r0, [r5, 0x2] movs r0, 0x5 b @0812707E .align 2, 0 .pool @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, =0x02037fd4 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 .pool @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, =0x0203a173 strb r4, [r0] adds r0, r5, 0 bl sub_81270E8 @081270DE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a173 ldrb r0, [r4] bl sub_8161AD0 ldr r1, =0x0203a151 strb r0, [r1] lsls r0, 24 cmp r0, 0 beq @08127154 ldrb r0, [r4] bl sub_8161A38 ldr r2, =0x0203a14c ldr r1, =0x0203bc40 ldrb r0, [r4] lsls r0, 3 adds r0, r1 ldr r0, [r0] str r0, [r2] adds r0, r5, 0 bl sub_81279B4 ldr r0, =0x0203a170 movs r1, 0 strh r1, [r0] ldr r0, =0x0203a16e strh r1, [r0] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_8127620 str r1, [r0] b @0812716E .align 2, 0 .pool @08127154: movs r0, 0x1 bl sub_8126A58 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA83D adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8127180 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC @0812716E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8126B80 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A6BB0 movs r1, 0xD0 movs r2, 0x20 bl gpu_pal_apply movs r0, 0 movs r1, 0 bl sub_8197434 ldr r1, =0x03005e00 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, =0x0203a173 strb r2, [r0] adds r0, r4, 0 bl sub_8126DFC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8127208 thumb_func_start sub_8127250 sub_8127250: ; 8127250 push {lr} lsls r1, 24 ldr r2, =gUnknown_085A6B28 lsrs r1, 22 adds r1, r2 ldr r1, [r1] bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a18c ldr r2, [r3] ldr r0, =0x0203a151 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, =0x00000521 adds r1, r0, r2 movs r0, 0x8 strb r0, [r1] b @081272BE .align 2, 0 .pool @081272B8: ldr r2, =0x00000521 adds r0, r2 strb r1, [r0] @081272BE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8127284 thumb_func_start sub_81272C8 sub_81272C8: ; 81272C8 push {r4,lr} ldr r0, =0x0203a170 ldr r1, =0x0203a16e ldr r2, =0x0203a18c ldr r3, [r2] ldr r4, =0x00000521 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 .pool thumb_func_end sub_81272C8 thumb_func_start sub_81272F8 sub_81272F8: ; 81272F8 push {r4,lr} sub sp, 0x4 ldr r0, =0x0203a170 ldr r1, =0x0203a16e ldr r2, =0x0203a18c ldr r3, [r2] ldr r4, =0x00000521 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 .pool 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, =0x03005e08 adds r1, r0 ldr r0, =0x0203a173 ldrb r0, [r0] subs r0, 0x6 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @08127378 ldr r0, =0x0203a17c ldrb r0, [r0, 0x9] cmp r0, 0x1 bne @08127378 movs r2, 0x16 ldrsh r0, [r1, r2] cmp r0, 0 bne @08127378 ldr r0, =0x02021cc4 movs r1, 0x1 bl sub_8127058 b @08127380 .align 2, 0 .pool @08127378: ldr r0, =0x02021cc4 movs r1, 0 bl sub_8127058 @08127380: movs r6, 0 ldr r1, =0x0203a18c 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, =0x0203a14c 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, =0x0203a18c 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, =gUnknown_085E8CF0 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, =0x03006310 adds r1, r2, 0 ldr r0, =gUnknown_085A6BD0 ldm r0!, {r3,r4,r6} stm r1!, {r3,r4,r6} ldm r0!, {r3,r4,r6} stm r1!, {r3,r4,r6} ldr r0, =0x0203a188 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, =0x00000521 adds r0, r6 ldrb r0, [r0] strh r0, [r2, 0xE] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021cc4 bl gf_strcpy lsls r4, 5 ldr r0, =gUnknown_085A5C09 adds r4, r0 adds r0, r5, 0 adds r1, r4, 0 bl gf_strcat pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a18c ldr r1, [r4] ldr r2, =0x00000522 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, =0x0203a170 str r0, [sp, 0xC] movs r0, 0x2 movs r1, 0x3C movs r2, 0xC movs r3, 0x94 bl sub_81AF4A0 ldr r1, [r4] ldr r2, =0x00000522 adds r1, r2 strb r0, [r1] @08127540: add sp, 0x10 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8127500 thumb_func_start sub_8127554 sub_8127554: ; 8127554 push {r4,lr} ldr r4, =0x0203a18c ldr r0, [r4] ldr r2, =0x00000522 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @08127572 bl sub_81AF620 ldr r0, [r4] ldr r1, =0x00000522 adds r0, r1 movs r1, 0xFF strb r1, [r0] @08127572: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r5, r0 movs r0, 0x3 bl sub_81269D4 ldr r0, =0x0203a173 ldrb r0, [r0] bl sub_8127718 ldr r6, =0x0203a18c ldr r0, =0x00000524 bl malloc_and_clear str r0, [r6] ldr r1, =0x00000522 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, =0x03006310 ldr r1, =0x0203a170 ldrh r1, [r1] ldr r2, =0x0203a16e 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_812764C str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r5, r0, r1 ldr r0, =0x02037fd4 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, =0x0203a170 ldr r1, =0x0203a16e 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 .pool @081276A4: movs r0, 0x5 bl audio_play ldr r0, =gUnknown_085A6B78 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 .pool @081276C4: movs r0, 0x5 bl audio_play ldr r0, =0x0203a172 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, =0x0203a18c ldr r0, [r0] bl free ldr r1, =gUnknown_085A6B78 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 .pool 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, =0x0203a188 ldrb r5, [r0, 0x3] adds r0, r5, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r0, =0x0203a151 ldrb r0, [r0] cmp r4, r0 bcc @08127770 ldr r2, =gUnknown_085E8D62 b @08127782 .align 2, 0 .pool @08127770: ldr r1, =gUnknown_085A5C08 ldr r0, =0x0203a14c 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 .pool 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, =0x0203a152 @081277C6: adds r0, r1, r3 ldrb r0, [r0] cmp r0, r2 bne @081277D8 movs r0, 0x1 b @081277E4 .align 2, 0 .pool @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, =0x0203a162 @081277F2: adds r0, r1, r3 ldrb r0, [r0] cmp r0, r2 bne @08127804 movs r0, 0x1 b @08127810 .align 2, 0 .pool @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, =0x0203a152 movs r1, 0 movs r2, 0x10 bl memset ldr r0, =0x0203a162 movs r1, 0 movs r2, 0xC bl memset movs r6, 0 ldr r0, =0x03005d8c mov r10, r0 ldr r1, =0x00001aae mov r9, r1 ldr r3, =0x0203a173 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, =0x0203bc40 adds r0, r1 ldrb r0, [r0, 0x4] cmp r2, r0 bcs @081278E2 ldr r7, =0x0203a152 adds r3, r1, 0 mov r12, r3 @08127868: ldr r0, =0x0203a14c 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, =0x0203a152 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 .pool @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, =0x0203bc40 mov r8, r3 @081278F4: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000271c 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 .pool @08127918: ldr r0, =0x0203a14c ldr r1, [r0] adds r1, r2 ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x0000271c 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, =0x0203a162 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, =0x0203a162 adds r0, r5, r0 strb r4, [r0] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 b @0812799A .align 2, 0 .pool @08127988: lsls r0, r4, 16 lsrs r2, r0, 16 @0812798C: ldr r0, =0x0203a173 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 .pool 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, =0x0203a170 ldrh r0, [r0] ldr r1, =0x0203a16e ldrh r1, [r1] adds r0, r1 adds r1, r0, 0x1 ldr r4, =0x0203a152 ldr r3, =0x0203a162 @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 .pool @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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8127A14 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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 .pool 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, =0x03005e08 adds r4, r0 bl sub_8127554 bl sub_81277A8 ldrb r0, [r4, 0x1A] movs r1, 0 movs r2, 0 bl sub_81AE6C8 ldr r0, =0x0203a18c ldr r0, [r0] bl free adds r0, r5, 0 bl sub_8126E44 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8127A8C thumb_func_start sub_8127ACC sub_8127ACC: ; 8127ACC push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x03005e00 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 adds r4, r2, r3 ldr r0, =0x03005d8c 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 .pool 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, =0x03005d8c ldr r1, [r0] movs r0, 0x4 ldrsb r0, [r1, r0] ldrb r1, [r1, 0x5] lsls r1, 24 asrs r1, 24 movs r2, 0x1 negs r2, r2 ldr r3, =0x03005e00 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 .pool 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, =0x0000ffff cmp r2, 0x22 beq @08127B7C cmp r2, 0x26 bne @08127B86 ldr r0, =gUnknown_085A72E4 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 28 lsrs r0, 16 b @08127B86 .align 2, 0 .pool @08127B7C: ldr r0, =gUnknown_085A72EC adds r0, r1, r0 ldrb r0, [r0] lsls r0, 28 lsrs r0, 16 @08127B86: pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085A5C24 adds r0, r4, r0 str r0, [sp, 0x1C] ldr r0, =gUnknown_085A5C08 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 .pool @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, =gUnknown_085A5C08 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, =0x0000ffff 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 .pool @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, =gUnknown_085A5C08 lsls r0, r2, 5 adds r0, r1 ldrb r0, [r0, 0x12] cmp r0, 0x9 bhi @08127E10 lsls r0, 2 ldr r1, =@08127D68 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037318 ldr r0, =0x020375e2 mov r8, r0 ldr r1, =0x020375e4 mov r10, r1 ldr r2, =0x03005d8c 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, =0x02037318 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, =0x00003f20 adds r0, r5, 0 ldrb r1, [r1, 0x1] adds r0, r1 ldr r1, =0x0203a190 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, =0x0203aa34 ldrh r1, [r1] mov r2, r10 strh r1, [r2] ldr r1, =0x0203aa36 ldrh r1, [r1] ldr r4, =0x020375e6 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, =0x020375e6 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 .pool @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, =0x0203a17c 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 .pool @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, =0x0203a17c ldrb r0, [r0, 0x9] cmp r0, 0x1 bne @08127FAC ldr r0, =0x0203a173 ldrb r0, [r0] cmp r0, 0x6 beq @08127FAC cmp r0, 0x7 beq @08127FAC ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA9AE adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8127A5C adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC b @0812804C .align 2, 0 .pool @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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0xC] ldr r1, =sub_8128060 str r1, [r0] b @0812804C .align 2, 0 .pool @08127FE8: ldr r0, =0x02021cc4 ldr r4, =0x0203a17c 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, =0x02021fc4 ldr r1, =gUnknown_085EA8EA bl ExpandTextCodes b @08128020 .align 2, 0 .pool @08128018: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EA931 bl ExpandTextCodes @08128020: ldr r1, =0x02021fc4 ldr r2, =sub_8127A5C adds r0, r5, 0 bl sub_81978EC b @0812804C .align 2, 0 .pool @08128038: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA8D2 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8127A5C adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC @0812804C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08128088: cmp r0, 0x2 beq @081280FC b @08128112 @0812808E: ldr r0, =0x02037fd4 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 .pool @081280AC: ldr r4, =0x02037fd4 ldrb r0, [r4, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r4, 0x8] ldr r5, =0x0203a190 ldr r0, =0x0203a172 ldrb r1, [r0] ldr r0, =0x0203a14c 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 .pool @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, =0x0203aa38 ldr r4, =0x02020630 ldr r5, =0x03005dd0 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, =sub_81292D0 str r1, [r0] adds r2, r4 ldr r3, =gUnknown_085A7250 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 .pool 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, =0x03005e00 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 adds r2, r3 ldrb r2, [r2, 0x12] ldr r3, =gUnknown_085A7250 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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @0812820C ldr r1, =nullsub_12 str r0, [sp] movs r0, 0xC1 b @08128214 .align 2, 0 .pool @0812820C: ldr r1, =nullsub_12 movs r0, 0 str r0, [sp] movs r0, 0xC2 @08128214: movs r3, 0x48 bl sub_808DD68 ldr r1, =0x0203aa39 strb r0, [r1] ldr r3, =0x02020630 ldr r0, =0x0203aa39 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, =0x0203aa38 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 bl obj_delete_and_free_tiles ldr r0, =0x03005dd0 ldr r0, [r0, 0x4] strb r0, [r4] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81281A8 thumb_func_start sub_812826C sub_812826C: ; 812826C push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r2, =gUnknown_085A5C08 ldr r0, =0x0203a172 ldrb r1, [r0] ldr r0, =0x0203a14c 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, =@081282A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 lsls r1, r3, 2 adds r1, r3 lsls r1, 3 adds r1, r0 movs r0, 0x1 b @08128394 .align 2, 0 .pool @081282E4: ldr r1, =0x03005e00 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 .pool @081282FC: ldr r1, =0x03005e00 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 .pool @08128314: ldr r1, =0x03005e00 lsls r0, r3, 2 adds r0, r3 lsls r0, 3 adds r0, r1 movs r1, 0x4 b @081283AC .align 2, 0 .pool @08128328: ldr r0, =0x03005e00 lsls r1, r3, 2 adds r1, r3 lsls r1, 3 adds r1, r0 movs r0, 0x2 b @08128394 .align 2, 0 .pool @0812833C: ldr r1, =0x03005e00 lsls r0, r3, 2 adds r0, r3 lsls r0, 3 adds r0, r1 movs r1, 0x1 b @081283AC .align 2, 0 .pool @08128350: ldr r0, =0x03005e00 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 .pool @08128370: ldr r1, =0x03005e00 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 .pool @08128388: ldr r0, =0x03005e00 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 .pool @081283A0: ldr r1, =0x03005e00 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x1C] ldr r3, =0x02020630 ldr r0, =0x0203aa38 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, =0x0203aa39 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x1C] ldr r3, =0x02020630 ldr r0, =0x0203aa38 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, =0x0203aa39 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, =0x02021fc4 ldr r1, =gUnknown_085EA8BF adds r0, r5, 0 bl ExpandTextCodes ldr r2, =sub_8128B80 adds r0, r4, 0 adds r1, r5, 0 bl sub_81978EC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 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, =@08128580 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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, =0x03005e00 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 .pool @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, =0x03005e00 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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x0203a172 ldrb r1, [r0] ldr r0, =0x0203a14c ldr r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r1, 5 ldr r0, =gUnknown_085A5C08 adds r1, r0 adds r0, r5, 0 bl sub_812853C lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081289A4 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA897 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_81289D0 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC b @081289BE .align 2, 0 .pool @081289A4: movs r0, 0x20 bl audio_play ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA8A6 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8129020 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC @081289BE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A72C4 adds r0, r4, 0 bl sub_8121F68 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A5C08 ldr r0, =0x0203a172 ldrb r1, [r0] ldr r0, =0x0203a14c 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, =0x03005e00 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 .pool @08128A44: ldr r2, =0x0203aa34 ldr r0, =0x03005e00 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, =0x0203aa36 ldrh r0, [r1, 0xA] subs r0, 0x7 strh r0, [r2] ldr r0, =gUnknown_08275D1F bl script_env_1_execute_new_script @08128A64: ldr r2, =0x02020630 ldr r0, =0x0203aa38 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, =0x02037318 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 .pool 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, =0x0203a17c 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, =0x0203a152 ldrb r1, [r0] adds r2, r0, 0 cmp r1, 0 bne @08128B28 b @08128B48 .align 2, 0 .pool @08128AF0: ldr r0, =0x0203a172 ldrb r1, [r0] ldr r0, =0x0203a14c ldr r0, [r0] adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r2, [r5, 0x4] adds r2, r3 ldr r0, =0x03005e00 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 .pool @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, =0x0203a162 ldrb r1, [r0] adds r2, r0, 0 cmp r1, 0 bne @08128B5C @08128B48: ldr r0, =0x0203a172 ldrb r0, [r0] adds r0, 0x1 strb r0, [r2] b @08128B76 .align 2, 0 .pool @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, =0x0203a172 ldrb r0, [r0] adds r0, 0x1 strb r0, [r1] @08128B76: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A72CC adds r0, r4, 0 bl sub_8121F68 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0xC] ldr r1, =c1_overworld_prev_quest str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08128C10: bl script_env_2_enable ldr r0, =0x02037fd4 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 .pool @08128C30: bl sub_812A3C8 ldr r0, =0x00000be5 bl gpu_pal_free_tag ldr r1, =0x03005dac ldr r0, =sub_8128CD4 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 adds r0, r4, 0 bl remove_task @08128C4C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @08128C8C: cmp r0, 0x2 beq @08128CA8 cmp r0, 0x3 beq @08128CB4 b @08128CCA @08128C96: bl sub_80E9578 b @08128CAC @08128C9C: ldr r0, =gUnknown_08275D0C bl script_env_1_execute_new_script b @08128CAC .align 2, 0 .pool @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, =sub_812764C str r1, [r0] @08128CCA: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8128C64 movs r1, 0x8 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 bl sub_8127580 ldr r1, =0x03005e00 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 .pool 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, =0x03005e08 adds r2, r1, r0 ldr r0, =0x0203aa3a 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 .pool @08128D48: ldrb r0, [r3] cmp r0, 0x2 bne @08128D6C movs r0, 0x2 ldrsh r1, [r2, r0] subs r1, 0x7 ldr r0, =0x02037318 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 .pool @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, =0x02037318 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 .pool @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, =0x030022c0 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 .pool @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, =0x0203aa3a movs r0, 0 strb r0, [r1] ldr r4, =0x02020630 ldr r3, =0x0203aa38 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 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r5, =0x02020630 ldr r3, =0x0203aa38 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, =gUnknown_085A72D4 movs r3, 0x18 ldrsh r1, [r4, r3] lsls r1, 3 b @08128E76 .align 2, 0 .pool @08128E68: cmp r0, 0x2 bne @08128E88 ldr r0, =gUnknown_085A72D4 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 .pool @08128E88: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2C] movs r7, 0xF0 adds r0, r7, 0 ands r0, r1 cmp r0, 0x40 bne @08128EBC ldr r1, =0x0203aa3a 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, =0x0000fffe 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, =0x0203aa3a 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, =0x0203aa3a movs r0, 0x3 strb r0, [r1] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000fffe 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, =0x0203aa3a 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, =0x0203aa3a ldrb r0, [r0] cmp r0, 0 beq @08128F94 ldr r3, =0x02020630 ldr r2, =0x0203aa38 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, =0x030022c0 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 .pool 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, =0x02020630 ldr r0, =0x0203aa38 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 strh r2, [r0, 0x1C] ldr r1, =sub_8128E18 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8128FD8 thumb_func_start sub_8129020 sub_8129020: ; 8129020 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x030022c0 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 .pool 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, =0x01000452 mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8129048 thumb_func_start sub_8129068 sub_8129068: ; 8129068 push {lr} adds r2, r0, 0 lsls r1, 16 ldr r0, =gUnknown_083DFC74 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 .pool 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, =0x000003ff ands r2, r0 @0812909E: ldr r0, =gUnknown_083DFC74 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 .pool @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, =gUnknown_083DFC78 ldr r1, [r1] ldr r1, [r1, 0xC] lsrs r0, 15 adds r0, r1 ldrh r1, [r0] ldr r0, =0x00000fff ands r0, r1 bx lr .align 2, 0 .pool 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, =gUnknown_085A71B0 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 .pool thumb_func_end sub_81291E8 thumb_func_start sub_812925C sub_812925C: ; 812925C push {r4,r5,lr} lsls r0, 24 ldr r3, =0x0203aa3c 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, =gUnknown_085A7250 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, =0xfffffe00 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, =0xfffffc00 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 .pool 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, =sub_81292E8 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =gUnknown_085A5C08 adds r4, r0 str r4, [r5] ldrb r0, [r4, 0x11] cmp r0, 0x4 beq @081293B4 ldr r0, =0x00000be5 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, =0x00000884 adds r0, r5, r1 ldr r1, =gUnknown_083DFC78 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, =gUnknown_085A72BC bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =gUnknown_085A728C movs r1, 0 movs r2, 0 movs r3, 0 bl obj_add_from_template_forward_search b @081293C6 .align 2, 0 .pool @081293B4: ldr r0, [r4, 0x1C] ldrh r0, [r0] ldr r1, =nullsub_12 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 .pool 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, =0x0203cebc ldr r1, [r4] bl call_LZZUnCompWram ldr r0, [r4] ldr r4, =0x0203cec0 ldr r1, [r4] bl sub_81AFE44 ldr r0, [r4] str r0, [sp] ldr r4, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r4 movs r1, 0x80 lsls r1, 2 orrs r0, r1 lsls r2, r7, 16 ldr r1, =0x0000ffff 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, =gUnknown_08614FF4 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 .pool @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, =gUnknown_085A6BE8 lsls r0, 2 lsls r1, r3, 3 adds r0, r1 adds r0, r2 ldr r0, [r0] pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203a190 adds r0, r6, 0 bl sub_8129048 lsls r4, 5 ldr r0, =gUnknown_085A5C08 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, =0x00000884 adds r5, r6, r0 ldr r0, =gUnknown_083DFC78 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, =gUnknown_085A72F4 ldr r0, [r6] ldrb r0, [r0, 0x12] lsls r0, 1 adds r0, r1 ldrh r0, [r0] lsls r0, 21 ldr r4, =0xffff0000 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, =gUnknown_085A72A4 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 .pool @081295A4: ldr r0, [r4, 0x1C] ldrh r0, [r0] ldr r1, =nullsub_12 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 .pool 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, =0x02020630 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 .pool @08129634: ldr r0, =gUnknown_085A6BE8 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, =0x02020630 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 .pool @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, =0x02020630 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 .pool thumb_func_end sub_81295CC thumb_func_start sub_81296EC sub_81296EC: ; 81296EC lsls r0, 24 lsrs r0, 24 ldr r3, =0x0203a17c 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 .pool thumb_func_end sub_81296EC thumb_func_start sub_8129708 sub_8129708: ; 8129708 push {r4-r6,lr} ldr r6, =0x020375e2 movs r0, 0 strh r0, [r6] ldr r2, =0x020375f0 strh r0, [r2] ldr r4, =0x020375e0 ldr r1, =0x0203aac4 ldrh r0, [r4] ldrb r1, [r1] cmp r0, r1 bne @08129744 movs r0, 0x1 strh r0, [r2] b @08129796 .align 2, 0 .pool @08129738: ldr r1, =0x020375e4 ldrb r0, [r2] strh r0, [r1] b @08129796 .align 2, 0 .pool @08129744: ldr r3, =gUnknown_085A5C08 ldr r2, =0x0203a17c ldr r1, =0x0203aa44 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, =0x02037318 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 .pool thumb_func_end sub_8129708 thumb_func_start sub_81297AC sub_81297AC: ; 81297AC push {r4-r6,lr} movs r2, 0 ldr r0, =0x02037318 ldr r0, [r0, 0x4] ldrb r1, [r0] cmp r2, r1 bcs @081297F0 adds r3, r0, 0 ldr r5, [r3, 0x4] ldr r0, =0x020375e0 ldrh r4, [r0] ldr r6, =0x020375e2 @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 .pool @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, =0x0203aa44 lsls r5, r6, 3 adds r4, r5, r3 ldrb r1, [r4] ldr r2, =0x0203a17c ldr r0, [r2] adds r0, r1 ldrb r0, [r0] lsls r0, 5 ldr r7, =gUnknown_085A5C08 adds r0, r7 ldrb r2, [r0, 0x11] ldr r7, =0x0203a17c 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, =0x0203aa44 adds r3, r7 mov r9, r3 subs r5, r6, 0x7 str r5, [sp, 0x8] @0812985E: adds r0, r4, 0x7 add r0, r8 ldr r1, =0x02037318 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, =0x0203aa44 adds r5, r7, 0 adds r0, r7, r3 ldrb r0, [r0, 0x2] cmp r6, r0 bcc @08129846 @081298AE: ldr r2, =0x0203aa44 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, =0x0203aac4 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 .pool 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, =0x03005e00 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 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08129994 bl cur_mapdata_full_redraw ldr r0, =gUnknown_08275D2E 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 .pool @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, =0x02021fc4 ldr r1, =gUnknown_085EAAC5 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8129D64 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC ldr r0, =0x02037318 ldrb r0, [r0, 0x14] cmp r0, 0x56 bne @08129994 bl sub_80EE104 @08129994: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81298EC thumb_func_start sub_81299AC sub_81299AC: ; 81299AC push {lr} movs r1, 0 ldr r0, =0x0203a17c 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 .pool @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, =0x0203aa38 ldr r2, =0x02020630 ldr r4, =0x03005dd0 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, =gUnknown_085A7404 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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @08129A3C ldr r1, =nullsub_12 str r0, [sp] movs r0, 0xC1 b @08129A44 .align 2, 0 .pool @08129A3C: ldr r1, =nullsub_12 movs r0, 0 str r0, [sp] movs r0, 0xC2 @08129A44: movs r2, 0x88 movs r3, 0x48 bl sub_808DD68 ldr r1, =0x0203aa39 strb r0, [r1] ldr r6, =0x02020630 ldr r0, =0x0203aa39 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, =0x0203aa38 ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 bl obj_delete_and_free_tiles ldr r0, =0x03005dd0 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 .pool 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, =0x03005e08 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 .pool @08129AE4: cmp r0, 0x2 beq @08129B1A b @08129B2E @08129AEA: ldr r0, =0x02037fd4 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 .pool @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, =0x02020630 ldr r3, =0x0203aa38 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, =sub_812A36C str r1, [r0] ldr r2, =0x0203aa39 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r6, [r0, 0x1C] ldr r1, =sub_8128E18 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 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, =0x02020630 ldr r5, =0x0203aa38 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, =nullsub_12 str r1, [r0] ldr r5, =0x02021fc4 ldr r1, =gUnknown_085EAA62 adds r0, r5, 0 bl ExpandTextCodes ldr r2, =sub_812A1F0 adds r0, r4, 0 adds r1, r5, 0 bl sub_81978EC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203aac4 ldrb r0, [r0] cmp r0, 0 beq @08129CA8 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EAAA3 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_812A1A0 b @08129D14 .align 2, 0 .pool @08129CA8: lsls r1, r5, 2 adds r1, r5 lsls r1, 3 ldr r0, =0x03005e08 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, =0x02020630 ldr r4, =0x0203aa38 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, =nullsub_12 str r1, [r0] ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EAA62 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_812A1F0 @08129D14: adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC b @08129D50 .align 2, 0 .pool @08129D3C: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EAA81 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8129D64 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC @08129D50: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8129C74 thumb_func_start sub_8129D64 sub_8129D64: ; 8129D64 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x030022c0 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 .pool thumb_func_end sub_8129D64 thumb_func_start sub_8129D8C sub_8129D8C: ; 8129D8C push {lr} adds r2, r1, 0 lsls r0, 24 ldr r1, =gUnknown_085A5C08 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 .pool @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, =0x02020630 ldr r6, =0x0203aa38 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, =nullsub_12 str r3, [r2] ldr r4, =0x0203aa39 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 .pool 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, =0x03005e00 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, =0x0203a17c 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 .pool @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, =0x0203a17c ldr r3, =0x0203aa44 ldr r0, =0x0203aac4 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, =0x03005d8c mov r9, r3 @08129F4A: ldr r1, [r7] lsls r0, r4, 1 adds r0, r4 lsls r5, r0, 3 adds r1, r5 ldr r2, =0x00000c74 adds r0, r1, r2 movs r2, 0 ldrsh r0, [r0, r2] cmp r0, r8 bne @08129FB0 ldr r2, =0x00000c76 adds r0, r1, r2 movs r2, 0 ldrsh r0, [r0, r2] cmp r0, r6 bne @08129FB0 ldr r2, =0x00000c84 adds r0, r1, r2 ldrh r0, [r0] bl flag_check lsls r0, 24 cmp r0, 0 bne @08129FB0 ldr r0, =0x0203aac4 ldrb r1, [r0] lsls r1, 3 add r1, r9 ldr r0, [r7] adds r0, r5 ldr r2, =0x00000c84 adds r0, r2 ldrh r0, [r0] strh r0, [r1, 0x4] b @08129FBA .align 2, 0 .pool @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, =gUnknown_085A5C08 ldrb r2, [r1] lsls r1, r2, 5 adds r1, r0 ldrb r0, [r1, 0x11] cmp r0, 0x4 bne @0812A024 ldr r5, =0x0203aa44 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, =0x0203aac4 strb r4, [r0] movs r0, 0x1 b @0812A034 .align 2, 0 .pool @0812A024: adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 @0812A02A: ldr r0, =0x0203a17c ldrb r1, [r0, 0x8] cmp r6, r1 bcc @08129FD2 movs r0, 0 @0812A034: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203a17c ldrb r0, [r7, 0x8] cmp r4, r0 bcs @0812A0C6 adds r6, r7, 0 ldr r5, =0x0203aac4 @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, =gUnknown_085A5C08 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, =0x0203aa44 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 .pool 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, =0x0203aac4 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, =0x0203a17c 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, =0x0203aa44 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 .pool @0812A14C: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x0203a17c ldrb r1, [r0, 0x8] cmp r5, r1 bcc @0812A10E @0812A15A: ldr r0, =0x0203aac4 ldrb r0, [r0] cmp r0, 0 beq @0812A18C ldr r0, =0x0203a17c ldr r2, =0x0203aa44 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 .pool 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, =gUnknown_085A7348 adds r0, r4, 0 bl sub_8121F68 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0xC] ldr r1, =sub_81298EC str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A7350 adds r0, r4, 0 bl sub_8121F68 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0xC] ldr r1, =sub_812A25C str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @0812A280: ldr r0, =0x02037fd4 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 .pool @0812A29C: bl sub_812A3C8 ldr r0, =0x03005dac ldr r1, =sub_812A334 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 adds r0, r4, 0 bl remove_task @0812A2B2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @0812A2EC: cmp r0, 0x2 beq @0812A308 cmp r0, 0x3 beq @0812A314 b @0812A32A @0812A2F6: bl sub_80E9578 b @0812A30C @0812A2FC: ldr r0, =gUnknown_08275D0C bl script_env_1_execute_new_script b @0812A30C .align 2, 0 .pool @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, =sub_8126B80 str r1, [r0] @0812A32A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_812A2C4 movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0xC] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @0812A3B8 ldr r0, =gUnknown_085A73D8 bl gpu_pal_obj_alloc_tag_and_apply b @0812A3BE .align 2, 0 .pool @0812A3B8: ldr r0, =gUnknown_085A73E0 bl gpu_pal_obj_alloc_tag_and_apply @0812A3BE: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021cc4 ldr r1, =0x0203a172 ldrb r2, [r1] ldr r1, =0x0203a14c ldr r1, [r1] adds r1, r2 ldrb r1, [r1] lsls r1, 5 ldr r2, =gUnknown_085A5C09 adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EAA14 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_812A458 adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC b @0812A444 .align 2, 0 .pool @0812A430: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA9E0 adds r0, r4, 0 bl ExpandTextCodes ldr r2, =sub_8127A5C adds r0, r5, 0 adds r1, r4, 0 bl sub_81978EC @0812A444: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A741C adds r0, r4, 0 bl sub_8121F68 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203a172 ldrb r1, [r0] ldr r0, =0x0203a14c ldr r0, [r0] adds r0, r1 movs r1, 0 strb r1, [r0] ldr r5, =0x0203a173 ldrb r0, [r5] bl sub_8161AD0 ldr r1, =0x0203a151 strb r0, [r1] ldrb r0, [r5] bl sub_8161A38 adds r0, r4, 0 bl sub_8127814 ldr r5, =0x02021fc4 ldr r1, =gUnknown_085EAA3D adds r0, r5, 0 bl ExpandTextCodes ldr r2, =sub_8127A5C adds r0, r4, 0 adds r1, r5, 0 bl sub_81978EC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0812A530 ldr r0, =sub_812A588 bl set_callback2 adds r0, r5, 0 bl remove_task @0812A530: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab34 movs r0, 0x68 bl malloc_and_clear str r0, [r5] adds r0, r4, 0 adds r1, r6, 0 bl sub_812A6D4 ldr r0, =sub_812A4DC movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0x8] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812A540 thumb_func_start sub_812A588 sub_812A588: ; 812A588 push {lr} sub sp, 0x4 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r0, [r0] cmp r0, 0xB bhi @0812A666 lsls r0, 2 ldr r1, =@0812A5AC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0812A666 .align 2, 0 .pool @0812A660: ldr r0, =sub_812A670 bl set_callback2 @0812A666: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab34 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 .pool 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, =nullsub_49 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, =0x03005e00 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 .pool thumb_func_end sub_812A6D4 thumb_func_start sub_812A710 sub_812A710: ; 812A710 push {lr} ldr r0, =nullsub_49 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 ldr r0, =0x03005e00 adds r2, r0 ldr r3, =0x0203ab34 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 .pool 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, =0x05006000 mov r0, sp bl CpuSet movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_085A7424 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r0, =gUnknown_085A7434 bl Window_InitFromTemplates bl TextBox_ResetSomeField add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812A750 thumb_func_start sub_812A79C sub_812A79C: ; 812A79C push {lr} ldr r0, =sub_812A688 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 .pool 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, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 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 .pool 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, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x81000200 str r1, [r0, 0x8] ldr r0, [r0, 0x8] add sp, 0x4 bx lr .align 2, 0 .pool 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, =0x00001048 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000809 movs r0, 0x52 bl lcd_io_set pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab34 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, =gUnknown_085A76B4 mov r8, r0 @0812A934: ldr r0, =0x0203ab34 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 .pool 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, =0x02021b38 movs r0, 0x80 strb r0, [r1] bl gpu_pal_allocator_reset bl clear_tasks pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812A9AC thumb_func_start sub_812A9CC sub_812A9CC: ; 812A9CC push {r4,r5,lr} ldr r4, =0x0203aacc movs r0, 0x8 bl malloc str r0, [r4] ldr r4, =0x0203aad0 movs r0, 0xE bl malloc_and_clear str r0, [r4] ldr r5, =0x0203aadc movs r0, 0x8 bl malloc_and_clear str r0, [r5] ldr r1, [r4] ldr r2, =0x00002051 adds r0, r2, 0 strh r0, [r1] ldr r1, [r4] ldr r2, =0x00002851 adds r0, r2, 0 strh r0, [r1, 0x2] ldr r2, =0x00002061 adds r0, r2, 0 strh r0, [r1, 0x4] ldr r2, =0x00002861 adds r0, r2, 0 strh r0, [r1, 0x6] ldr r2, =0x000020be adds r0, r2, 0 strh r0, [r1, 0x8] ldr r2, =0x000028be adds r0, r2, 0 strh r0, [r1, 0xA] ldr r2, =0x000020bf adds r0, r2, 0 strh r0, [r1, 0xC] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_812AAC8 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 .pool 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, =gUnknown_085A7450 lsls r1, r0, 2 adds r1, r0 lsls r4, r1, 3 ldr r5, =0x03005e00 @0812AAD8: ldr r0, =0x0203ab34 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 .pool 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, =0x0203ab34 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 .pool thumb_func_end sub_812AB04 thumb_func_start sub_812AB38 sub_812AB38: ; 812AB38 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0812AB50 ldr r0, =0x0203ab34 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @0812AB50: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_812AB38 thumb_func_start sub_812AB60 sub_812AB60: ; 812AB60 push {lr} ldr r3, =0x0203ab34 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 .pool @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, =0x0203ab34 ldr r1, [r0] movs r0, 0x4 strb r0, [r1] @0812ABBC: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_812ABA8 thumb_func_start sub_812ABC8 sub_812ABC8: ; 812ABC8 push {lr} movs r0, 0 bl sub_812DEE4 ldr r2, =0x0203ab34 ldr r1, [r2] movs r0, 0x5 strb r0, [r1] ldr r2, [r2] movs r0, 0xC ldrsh r1, [r2, r0] ldr r0, =0x0000270e cmp r1, r0 ble @0812ABE8 movs r0, 0x17 strb r0, [r2] @0812ABE8: movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_812ABC8 thumb_func_start sub_812ABF8 sub_812ABF8: ; 812ABF8 push {r4,r5,lr} ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0812AC1C movs r0, 0 bl sub_812DC80 ldr r0, =0x0203ab34 ldr r1, [r0] movs r0, 0x8 b @0812ACE2 .align 2, 0 .pool @0812AC1C: movs r0, 0x80 lsls r0, 1 ands r0, r1 cmp r0, 0 beq @0812AC82 ldr r0, =0x0203ab34 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, =0x0203ab34 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 .pool @0812AC7C: movs r0, 0x6 strb r0, [r2] b @0812ACE4 @0812AC82: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0812ACB2 ldr r4, =0x0203ab34 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, =0x0203ab34 ldr r3, [r0] movs r1, 0x12 ldrsh r2, [r3, r1] ldr r4, =0x030022c0 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 .pool 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, =gUnknown_085EF734 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x7 strb r0, [r1] movs r0, 0 add sp, 0xC pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_812ACF4 thumb_func_start sub_812AD34 sub_812AD34: ; 812AD34 push {lr} ldr r0, =0x030022c0 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x5 strb r0, [r1] @0812AD52: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x5 strb r0, [r1] @0812AD74: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab34 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 .pool @0812ADC4: movs r0, 0x1 bl sub_812DEE4 ldr r1, [r4] movs r0, 0xB @0812ADCE: strb r0, [r1] ldr r4, =0x0203ab34 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 .pool 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, =0x0203ab34 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 .pool 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, =0x0203ab34 ldr r1, [r0] movs r0, 0xC strb r0, [r1] @0812AE40: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_812AE24 thumb_func_start sub_812AE4C sub_812AE4C: ; 812AE4C push {r4,lr} ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0812AE78 movs r0, 0x18 bl audio_play ldr r4, =0x0203ab34 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 .pool thumb_func_end sub_812AE4C thumb_func_start sub_812AE88 sub_812AE88: ; 812AE88 push {r4,lr} ldr r4, =0x0203ab34 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 .pool @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, =0x0203ab34 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, =0x00000185 bl fanfare_play movs r0, 0x6 bl sub_812DEE4 b @0812AF62 .align 2, 0 .pool @0812AF38: movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0812AF54 ldr r0, =0x00000185 bl fanfare_play movs r0, 0x5 bl sub_812DEE4 b @0812AF62 .align 2, 0 .pool @0812AF54: movs r0, 0xC3 lsls r0, 1 bl fanfare_play movs r0, 0x2 bl sub_812DEE4 @0812AF62: ldr r2, =0x0203ab34 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 .pool @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, =0x0000270f cmp r0, r2 ble @0812AFEE strh r2, [r1, 0x10] @0812AFEE: movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x10 strb r0, [r1] @0812B010: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab34 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 .pool 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, =0x0203ab34 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 .pool 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, =0x0203ab34 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 .pool 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x2 strb r0, [r1] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x13 strb r0, [r1] @0812B14E: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EF6E9 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x16 strb r0, [r1] movs r0, 0 add sp, 0xC pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab34 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 .pool @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, =0x0203ab34 ldr r1, [r0] movs r0, 0x5 @0812B206: strb r0, [r1] @0812B208: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EF6F8 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x18 strb r0, [r1] movs r0, 0 add sp, 0xC pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_812B214 thumb_func_start sub_812B254 sub_812B254: ; 812B254 push {lr} ldr r0, =0x030022c0 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x5 strb r0, [r1] @0812B272: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EF710 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x1A strb r0, [r1] movs r0, 0 add sp, 0xC pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_812B280 thumb_func_start sub_812B2C0 sub_812B2C0: ; 812B2C0 push {lr} ldr r0, =0x030022c0 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x1B strb r0, [r1] @0812B2DE: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_812B2C0 thumb_func_start sub_812B2EC sub_812B2EC: ; 812B2EC push {r4,lr} sub sp, 0x4 ldr r4, =0x0203ab34 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 .pool thumb_func_end sub_812B2EC thumb_func_start sub_812B32C sub_812B32C: ; 812B32C push {r4-r6,lr} ldr r0, =0x02037fd4 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, =0x0203ab34 ldr r0, [r6] ldr r0, [r0, 0x64] bl set_callback2 ldr r4, =0x0203aaf4 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203aaf8 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203aafc ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab00 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab04 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab08 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab0c ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab10 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab14 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab18 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab1c ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab20 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab24 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab28 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203aae4 ldr r0, [r4] cmp r0, 0 beq @0812B3E4 bl free str r5, [r4] @0812B3E4: ldr r4, =0x0203aae8 ldr r0, [r4] cmp r0, 0 beq @0812B3F2 bl free str r5, [r4] @0812B3F2: ldr r4, =0x0203aaec ldr r0, [r4] cmp r0, 0 beq @0812B400 bl free str r5, [r4] @0812B400: ldr r4, =0x0203aaf0 ldr r0, [r4] cmp r0, 0 beq @0812B40E bl free str r5, [r4] @0812B40E: ldr r4, =0x0203aac8 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203aacc ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203aad0 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203aad4 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203aad8 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203aadc ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203aae0 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab2c ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ab30 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 .pool thumb_func_end sub_812B32C thumb_func_start sub_812B4EC sub_812B4EC: ; 812B4EC push {r4,lr} ldr r4, =0x0203ab34 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, =gUnknown_085A77FE 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, =0x0203ab34 ldr r2, [r0] ldr r1, =gUnknown_085A7804 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 .pool thumb_func_end sub_812B4EC thumb_func_start sub_812B55C sub_812B55C: ; 812B55C push {lr} ldr r2, =0x0203ab34 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 .pool 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, =gUnknown_085A77F6 @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 .pool @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, =gUnknown_085A76C0 ldr r1, =0x0203ab34 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 .pool @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, =gUnknown_085A76D2 @0812B5F2: bl GenerateRandomNumber movs r2, 0xFF ldr r1, =0x0203ab34 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 .pool 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, =gUnknown_085A76E4 mov r8, r0 movs r7, 0x80 lsls r7, 17 @0812B644: bl GenerateRandomNumber movs r5, 0xFF ands r5, r0 ldr r0, =0x0203ab34 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 .pool @0812B680: asrs r0, r2, 16 cmp r0, 0x4 bne @0812B69E ldr r0, =0x0203ab34 ldr r0, [r0] ldrb r0, [r0, 0x3] cmp r0, 0x1 bne @0812B69E lsls r0, r3, 16 ldr r1, =0xfff60000 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 .pool thumb_func_end sub_812B634 thumb_func_start sub_812B6CC sub_812B6CC: ; 812B6CC push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r0, =0x0203ab34 ldr r2, [r0] ldrb r0, [r2, 0x3] cmp r0, 0 beq @0812B6E8 ldr r0, =gUnknown_085A7768 b @0812B6EA .align 2, 0 .pool @0812B6E8: ldr r0, =gUnknown_085A7702 @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 .pool thumb_func_end sub_812B6CC thumb_func_start sub_812B700 sub_812B700: ; 812B700 push {r4-r6,lr} ldr r0, =0x0203ab34 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 .pool @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, =0x0203ab34 ldr r0, [r0] strb r6, [r0, 0x5] @0812B754: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A77CE lsls r4, 1 adds r4, r0 ldrh r4, [r4] cmp r1, r4 bcc @0812B784 movs r0, 0 b @0812B786 .align 2, 0 .pool @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, =0x0203ab34 ldr r0, [r0] movs r2, 0x10 ldrsh r1, [r0, r2] ldr r0, =0x0000012b cmp r1, r0 ble @0812B7AC movs r4, 0x4 b @0812B7C2 .align 2, 0 .pool @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, =gUnknown_085A77D8 lsls r4, 2 adds r0, r4, r5 ldrb r0, [r0] cmp r1, r0 bcs @0812B7E8 movs r0, 0x4 b @0812B822 .align 2, 0 .pool @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, =gUnknown_085A77EC ldr r1, =0x0203ab34 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 .pool @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, =0x0203ab34 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 .pool 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, =0x0203ab34 ldr r2, [r0] ldr r0, =gUnknown_085A7828 lsls r1, 1 adds r0, r1, r0 ldrh r0, [r0] ldrh r3, [r2, 0xE] adds r0, r3 strh r0, [r2, 0xE] ldr r0, =gUnknown_085A7816 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 .pool 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, =0x0203ab34 ldr r2, [r0] ldr r0, =gUnknown_085A7828 lsls r1, 1 adds r0, r1, r0 ldrh r0, [r0] ldrh r3, [r2, 0xE] adds r0, r3 strh r0, [r2, 0xE] ldr r0, =gUnknown_085A7816 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, =0x0203ab34 ldr r2, [r0] ldr r0, =gUnknown_085A7828 lsls r1, 1 adds r0, r1, r0 ldrh r0, [r0] ldrh r3, [r2, 0xE] adds r0, r3 strh r0, [r2, 0xE] ldr r0, =gUnknown_085A7816 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 .pool 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, =0x0203ab34 ldr r2, [r0] ldr r0, =gUnknown_085A7828 lsls r1, 1 adds r0, r1, r0 ldrh r0, [r0] ldrh r3, [r2, 0xE] adds r0, r3 strh r0, [r2, 0xE] ldr r0, =gUnknown_085A7816 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, =0x0203ab34 ldr r2, [r0] ldr r0, =gUnknown_085A7828 lsls r1, 1 adds r0, r1, r0 ldrh r0, [r0] ldrh r3, [r2, 0xE] adds r0, r3 strh r0, [r2, 0xE] ldr r0, =gUnknown_085A7816 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 .pool 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, =gUnknown_085A780E adds r0, r3, r0 ldrb r0, [r0] b @0812BAB6 .align 2, 0 .pool @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, =sub_812BAFC 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 .pool thumb_func_end sub_812BABC thumb_func_start sub_812BADC sub_812BADC: ; 812BADC push {lr} ldr r0, =sub_812BAFC 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 .pool @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, =gUnknown_085A74C4 ldr r2, =0x03005e00 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 .pool 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, =0x0203ab34 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 .pool @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, =0x0203ab34 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, =0x0000270e cmp r1, r0 bgt @0812BBA8 adds r0, r3, 0x1 strh r0, [r2, 0xC] @0812BBA8: movs r0, 0x8 strh r0, [r4, 0xA] ldr r0, =0x030022c0 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @0812BBF6 movs r0, 0x15 bl audio_play ldr r1, =0x0203ab34 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, =0x0000270f cmp r0, r3 ble @0812BBF0 strh r3, [r2, 0xC] @0812BBF0: ldr r1, [r1] movs r0, 0 strh r0, [r1, 0xE] @0812BBF6: ldr r0, =0x0203ab34 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 .pool 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, =sub_812BAFC 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 .pool 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, =0x0203ab34 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, =gUnknown_085A766E 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 .pool 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, =0x0203ab34 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, =0x0000ffff @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 .pool thumb_func_end sub_812BC98 thumb_func_start sub_812BCE8 sub_812BCE8: ; 812BCE8 push {lr} ldr r1, =0x0203ab34 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, =gUnknown_085A76AD lsls r1, 16 asrs r1, 16 adds r1, r0 ldrb r0, [r1] pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab34 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 .pool 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, =0x0203ab34 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 .pool thumb_func_end sub_812BD70 thumb_func_start sub_812BDD4 sub_812BDD4: ; 812BDD4 push {r4,lr} ldr r1, =0x0203ab34 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 .pool 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, =0x0203ab34 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 .pool thumb_func_end sub_812BE0C thumb_func_start sub_812BE5C sub_812BE5C: ; 812BE5C push {r4-r6,lr} movs r4, 0 ldr r5, =sub_812BF2C ldr r6, =0x03005e00 @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, =0x0203ab34 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 .pool thumb_func_end sub_812BE5C thumb_func_start sub_812BEA4 sub_812BEA4: ; 812BEA4 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r4, =0x03005e00 ldr r1, =0x0203ab34 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 .pool thumb_func_end sub_812BEA4 thumb_func_start sub_812BEDC sub_812BEDC: ; 812BEDC lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 ldr r1, =0x0203ab34 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 .pool thumb_func_end sub_812BEDC thumb_func_start sub_812BF04 sub_812BF04: ; 812BF04 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 ldr r1, =0x0203ab34 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 .pool 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, =gUnknown_085A74D0 ldr r2, =0x03005e00 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 .pool 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, =0x0203ab34 ldr r1, [r1] movs r2, 0x1A ldrsh r1, [r1, r2] bl sub_812BD28 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab34 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, =gUnknown_085A74E4 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, =0x0203ab34 ldr r1, [r0] movs r0, 0 strb r0, [r1, 0x6] ldr r1, =gUnknown_085A74F0 movs r2, 0x26 ldrsh r0, [r4, r2] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 @0812BFF4: ldr r0, =0x0203ab34 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 .pool 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, =gUnknown_085A74FC mov r0, sp movs r2, 0xA bl memcpy ldr r7, =0x0203ab34 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 .pool @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, =0x0203ab34 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 .pool thumb_func_end sub_812C01C thumb_func_start sub_812C0E0 sub_812C0E0: ; 812C0E0 push {r4,lr} adds r2, r0, 0 ldr r4, =0x0203ab34 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 .pool thumb_func_end sub_812C0E0 thumb_func_start sub_812C138 sub_812C138: ; 812C138 push {r4,r5,lr} ldr r4, =0x0203ab34 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, =gUnknown_085A7508 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 .pool 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, =0x0203ab34 ldr r0, [r0] strb r1, [r0, 0x7] movs r0, 0x1 b @0812C1BE .align 2, 0 .pool @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, =0x0203ab34 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 .pool @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, =0x0203ab34 ldr r1, [r0] movs r0, 0x2 strh r0, [r1, 0x34] strh r5, [r1, 0x2E] movs r0, 0x1 b @0812C286 .align 2, 0 .pool @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, =0x0203ab34 ldr r0, [r0] strh r7, [r0, 0x34] strh r6, [r0, 0x2E] movs r0, 0x1 b @0812C390 .align 2, 0 .pool @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, =0x0203ab34 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 .pool @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, =gUnknown_085A7514 ldr r0, =0x0203ab34 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 .pool thumb_func_end sub_812C3A0 thumb_func_start sub_812C3C8 sub_812C3C8: ; 812C3C8 push {r4-r7,lr} ldr r0, =0x0203ab34 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, =0x0203ab34 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 .pool @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, =0x0203ab34 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, =0x0203ab34 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 .pool @0812C46C: movs r0, 0x2 strh r0, [r1, 0x36] strh r5, [r1, 0x30] @0812C472: movs r0, 0x1 b @0812C4B2 @0812C476: ldr r0, =0x0203ab34 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, =0x0203ab34 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 .pool thumb_func_end sub_812C414 thumb_func_start sub_812C4BC sub_812C4BC: ; 812C4BC push {r4,lr} ldr r2, =0x0203ab34 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, =gUnknown_085A7520 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 .pool 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, =0x0203ab34 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, =0x0203ab34 ldr r0, [r0] mov r1, r8 strh r1, [r0, 0x38] strh r5, [r0, 0x32] movs r0, 0x1 b @0812C552 .align 2, 0 .pool @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, =0x0203ab34 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 .pool @0812C588: ldr r0, =0x0203ab34 ldr r0, [r0] strh r5, [r0, 0x32] mov r1, r8 strh r1, [r0, 0x38] movs r0, 0x1 b @0812C5D2 .align 2, 0 .pool @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, =0x0203ab34 ldr r0, [r0] strh r5, [r0, 0x2E] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A752C ldr r0, =0x0203ab34 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 .pool thumb_func_end sub_812C628 thumb_func_start sub_812C64C sub_812C64C: ; 812C64C push {r4-r7,lr} sub sp, 0x4 ldr r0, =0x0203ab34 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, =0x0203ab34 ldr r1, [r0] movs r0, 0x2 strh r0, [r1, 0x36] strh r5, [r1, 0x30] b @0812C6C4 .align 2, 0 .pool @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, =0x0203ab34 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 .pool @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, =0x0203ab34 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 .pool @0812C778: ldr r0, =0x0203ab34 ldr r0, [r0] movs r1, 0 strh r5, [r0, 0x36] strh r1, [r0, 0x30] b @0812C84A .align 2, 0 .pool @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, =0x0203ab34 @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 .pool @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, =gUnknown_085A7538 ldr r0, =0x0203ab34 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 .pool thumb_func_end sub_812C8FC thumb_func_start sub_812C920 sub_812C920: ; 812C920 push {r4-r7,lr} movs r6, 0 ldr r7, =0x0203ab34 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 .pool @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, =0x0203ab34 ldr r0, [r0] strh r6, [r0, 0x32] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab34 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 .pool @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, =0x0203ab34 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, =0x0203ab34 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 .pool @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, =0x0203ab34 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 .pool 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, =0x0203ab34 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 .pool @0812CC28: adds r0, r5, 0x1 lsls r0, 16 lsrs r3, r0, 16 asrs r0, 16 cmp r0, 0x4 ble @0812CBF6 @0812CC34: ldr r7, =0x0203ab34 @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 .pool @0812CCB4: ldr r7, =0x0203ab34 @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 .pool @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, =sub_812CD74 adds r0, r5, 0 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x26] bl _call_via_r5 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A7544 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085A7550 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 .pool 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, =gUnknown_085A7550 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 .pool thumb_func_end sub_812CDF4 thumb_func_start sub_812CE2C sub_812CE2C: ; 812CE2C push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_085A8408 lsls r1, r0, 2 adds r1, r2 ldr r2, [r1] ldr r1, =gUnknown_085A8430 adds r0, r1 ldrb r1, [r0] adds r0, r2, 0 movs r2, 0x2 bl gpu_pal_apply pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812CE2C thumb_func_start sub_812CE54 sub_812CE54: ; 812CE54 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_085A841C lsls r1, r0, 2 adds r1, r2 ldr r2, [r1] ldr r1, =gUnknown_085A8430 adds r0, r1 ldrb r1, [r0] adds r0, r2, 0 movs r2, 0x2 bl gpu_pal_apply pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A843B adds r0, r1, r0 ldrb r0, [r0] cmp r4, r0 bcs @0812CEA8 ldr r7, =gUnknown_085A8435 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 .pool 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, =gUnknown_085A843B adds r0, r1, r0 ldrb r0, [r0] cmp r4, r0 bcs @0812CEE4 ldr r7, =gUnknown_085A8435 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 .pool thumb_func_end sub_812CEB8 thumb_func_start sub_812CEF4 sub_812CEF4: ; 812CEF4 push {r4,r5,lr} movs r4, 0 ldr r5, =0x02020630 @0812CEFA: ldr r0, =sub_812D024 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, =0x0203ab34 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 .pool thumb_func_end sub_812CEF4 thumb_func_start sub_812CF34 sub_812CF34: ; 812CF34 lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203ab34 ldr r1, [r1] adds r1, 0x44 adds r1, r0 ldrb r1, [r1] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r2, 0 movs r1, 0x1 strh r1, [r0, 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 .pool thumb_func_end sub_812CF34 thumb_func_start sub_812CF6C sub_812CF6C: ; 812CF6C push {r4,r5,lr} movs r2, 0 ldr r0, =0x0203ab34 ldr r0, [r0] adds r3, r0, 0 adds r3, 0x44 ldr r4, =0x02020630 @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 .pool @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, =0x0203ab34 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 .pool @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, =0x02020630 adds r1, r0 movs r2, 0x30 ldrsh r0, [r1, r2] cmp r0, 0 bne @0812D00C movs r0, 0x1 b @0812D01E .align 2, 0 .pool @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, =gUnknown_085A8430 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 .pool thumb_func_end sub_812D024 thumb_func_start sub_812D0B0 sub_812D0B0: ; 812D0B0 push {r4,lr} ldr r4, =sub_812D128 adds r0, r4, 0 movs r1, 0x6 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0x1 strh r2, [r1, 0xE] bl _call_via_r4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812D0B0 thumb_func_start sub_812D0E0 sub_812D0E0: ; 812D0E0 push {lr} ldr r0, =sub_812D128 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005e00 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 .pool @0812D10C: adds r0, r2, 0 bl remove_task ldr r0, =gUnknown_085A84AC ldr r0, [r0] movs r1, 0x10 movs r2, 0x20 bl gpu_pal_apply movs r0, 0x1 @0812D120: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_085A84A0 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 .pool thumb_func_end sub_812D128 thumb_func_start sub_812D188 sub_812D188: ; 812D188 push {lr} ldr r0, =sub_812D230 movs r1, 0x8 bl AddTask ldr r1, =0x0203ab34 ldr r1, [r1] adds r1, 0x3E strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812D188 thumb_func_start sub_812D1A8 sub_812D1A8: ; 812D1A8 push {r4,lr} ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x3E ldrb r0, [r0] lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e00 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 .pool thumb_func_end sub_812D1A8 thumb_func_start sub_812D1DC sub_812D1DC: ; 812D1DC push {r4,lr} ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x3E ldrb r0, [r0] lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e00 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 .pool thumb_func_end sub_812D1DC thumb_func_start sub_812D20C sub_812D20C: ; 812D20C ldr r2, =0x03005e00 ldr r0, =0x0203ab34 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 .pool 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, =gUnknown_085A7558 ldr r2, =0x03005e00 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 .pool 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, =0x02020630 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 .pool @0812D2C4: cmp r1, 0x10 bne @0812D2CC movs r3, 0x2 movs r2, 0x2 @0812D2CC: ldr r0, =0x0203aacc ldr r0, [r0] lsls r1, r2, 1 adds r1, r0 ldr r2, =gUnknown_085A7568 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 .pool 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, =0x0203aacc ldr r0, [r0] lsls r1, r2, 1 adds r1, r0 ldr r0, =gUnknown_085A7568 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 .pool 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, =gUnknown_085A7568 @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 .pool @0812D3DC: cmp r0, 0xF bne @0812D3E4 movs r3, 0x2 movs r1, 0x2 @0812D3E4: ldr r0, =0x0203aacc 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, =gUnknown_085A756A @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 .pool @0812D440: cmp r0, 0xF bne @0812D448 movs r3, 0x2 movs r1, 0x2 @0812D448: ldr r0, =0x0203aacc 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, =0x03005e00 ldr r0, =0x0203ab34 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 .pool thumb_func_end sub_812D3B4 thumb_func_start sub_812D4AC sub_812D4AC: ; 812D4AC push {r4,lr} ldr r4, =sub_812D4EC 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 .pool thumb_func_end sub_812D4AC thumb_func_start sub_812D4CC sub_812D4CC: ; 812D4CC push {lr} ldr r0, =sub_812D4EC 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 .pool @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, =gUnknown_085A7574 ldr r2, =0x03005e00 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 .pool thumb_func_end sub_812D4EC thumb_func_start sub_812D51C sub_812D51C: ; 812D51C push {lr} ldr r3, =0x0203ab34 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, =0x02021bbc strh r2, [r0] ldr r0, =0x02021bbe 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 .pool thumb_func_end sub_812D51C thumb_func_start sub_812D594 sub_812D594: ; 812D594 push {r4,r5,lr} adds r4, r0, 0 ldr r1, =0x02021bbc 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, =0x000001ff 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 .pool 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, =gUnknown_085A75C0 mov r0, sp movs r2, 0x4 bl memcpy add r0, sp, 0x4 mov r8, r0 ldr r1, =gUnknown_085A75C4 movs r2, 0x8 bl memcpy add r6, sp, 0xC ldr r1, =gUnknown_085A75CC 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, =0x0203ab34 ldr r0, [r0] adds r0, 0x3F ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool 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, =0x0203ab34 ldr r0, [r0] adds r0, 0x3F ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x3 bl obj_anim_image_start_if_different @0812D730: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab34 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 .pool @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, =0x0203ab34 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 .pool @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, =0x0203ab34 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 .pool 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, =0x0203ab34 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, =0x02020630 adds r0, r1 movs r1, 0x5 bl obj_anim_image_start_if_different ldr r0, =0x00000187 bl fanfare_play b @0812D914 .align 2, 0 .pool @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, =0x02020630 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 .pool 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, =0x02021bbc 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, =0x000001ff 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 .pool @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, =0x0203ab34 ldr r0, [r4] movs r6, 0 strb r6, [r0, 0xB] ldr r1, [r4] ldrb r0, [r1, 0x5] strb r0, [r1, 0xA] ldr r0, =0x02021bbc 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, =sub_812D4EC bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task b @0812DA1A .align 2, 0 .pool @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, =0x0203ab34 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 .pool @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, =sub_812D4EC bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @0812DA86: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r3, =0x0203ab34 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, =0x00000187 bl fanfare_play movs r0, 0xB2 bl audio_play pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812DA90 thumb_func_start sub_812DB04 sub_812DB04: ; 812DB04 push {r4,r5,lr} adds r4, r0, 0 ldr r1, =0x02021bbe 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, =0x02020630 ldr r0, =0x0203ab34 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 .pool thumb_func_end sub_812DB04 thumb_func_start sub_812DB8C sub_812DB8C: ; 812DB8C push {r4,lr} adds r4, r0, 0 ldr r1, =0x02021bbe 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 .pool thumb_func_end sub_812DB8C thumb_func_start sub_812DBBC sub_812DBBC: ; 812DBBC push {lr} ldr r1, =0x02021bbc movs r0, 0 strh r0, [r1] movs r0, 0x14 movs r1, 0 bl lcd_io_set ldr r0, =0x0203ab34 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, =sub_812D4EC bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A96E0 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 .pool 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, =gUnknown_085A9898 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 .pool 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, =sub_812DCD4 adds r0, r5, 0 movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xA] bl _call_via_r5 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812DC80 thumb_func_start sub_812DCB4 sub_812DCB4: ; 812DCB4 push {lr} ldr r0, =sub_812DCD4 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 .pool @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, =gUnknown_085A75D4 ldr r2, =0x03005e00 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 .pool 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, =0x02037fd4 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 .pool 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, =gUnknown_085A7444 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 .pool 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, =gUnknown_085A744C str r0, [sp] movs r4, 0 str r4, [sp, 0x4] ldr r0, =gUnknown_085EF750 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 .pool 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, =0x030022c0 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 .pool 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, =0x0203ab34 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 .pool thumb_func_end sub_812DE48 thumb_func_start sub_812DE7C sub_812DE7C: ; 812DE7C push {lr} ldr r0, =sub_812DCD4 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812DE7C thumb_func_start sub_812DE94 sub_812DE94: ; 812DE94 push {lr} ldr r0, =sub_812E0B0 movs r1, 0x3 bl AddTask lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x3D strb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =0x03005e00 adds r0, r1 ldr r1, =0x0000ffff 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 .pool 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, =0x0203ab34 ldr r0, [r0] adds r0, 0x3D ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =0x03005e00 adds r7, r0, r1 strh r4, [r7, 0xA] movs r6, 0 ldr r1, =gUnknown_085A7A04 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 .pool 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, =0x0203ab34 ldr r0, [r0] adds r0, 0x3D ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =0x03005e00 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 .pool @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, =0x0203ab34 ldr r0, [r0] adds r0, 0x3D ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =0x03005e00 adds r4, r0, r1 ldrh r1, [r4, 0xA] ldr r0, =0x0000ffff cmp r1, r0 beq @0812E008 ldr r0, =gUnknown_085A7A20 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, =0x02020630 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 .pool thumb_func_end sub_812DFDC thumb_func_start sub_812E054 sub_812E054: ; 812E054 push {r4,r5,lr} ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x3D ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =0x03005e00 adds r0, r1 movs r2, 0x4 adds r3, r0, 0 adds r3, 0x8 ldr r4, =0x02020630 @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 .pool @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, =gUnknown_085A7610 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085A7CE0 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, =0x02020630 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, =0x0000ffff 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 .pool thumb_func_end sub_812E0E4 thumb_func_start sub_812E154 sub_812E154: ; 812E154 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x0203ab34 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 .pool 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, =0x0000270f @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, =0x0000270f @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 .pool 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, =gUnknown_085A7CF8 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, =0x02020630 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, =0x0000ffff strh r0, [r2, 0x34] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812E230 thumb_func_start sub_812E2A8 sub_812E2A8: ; 812E2A8 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203ab34 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 .pool thumb_func_end sub_812E2A8 thumb_func_start sub_812E300 sub_812E300: ; 812E300 push {lr} ldr r0, =gUnknown_085A7D10 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, =0x02020630 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, =gUnknown_085A7FC0 bl obj_set_f18_to_r0_f42_to_40 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812E300 thumb_func_start sub_812E33C sub_812E33C: ; 812E33C push {r4,r5,lr} sub sp, 0x18 ldr r4, =0x0203aae4 ldr r0, [r4] cmp r0, 0 bne @0812E350 movs r0, 0x28 bl malloc_and_clear str r0, [r4] @0812E350: ldr r2, [r4] ldr r0, =0x0203aad8 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, =gUnknown_085A7D28 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, =0x02020630 lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r1 ldrb r3, [r2, 0x5] movs r1, 0xD negs r1, r1 ands r1, r3 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, =0x0203ab34 ldr r1, [r1] adds r1, 0x3F strb r0, [r1] add sp, 0x18 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812E33C thumb_func_start sub_812E3E8 sub_812E3E8: ; 812E3E8 push {r4,lr} ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x3F ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldr r4, =0x0203aae4 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 .pool 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, =0x0000fff8 strh r0, [r2, 0x26] @0812E46A: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203aae8 ldr r0, [r4] cmp r0, 0 bne @0812E490 movs r0, 0x8 bl malloc_and_clear str r0, [r4] @0812E490: ldr r2, [r4] ldr r0, =0x0203aad8 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, =gUnknown_085A7D40 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, =0x02020630 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, =gUnknown_085A7FE0 adds r0, r2, 0 bl obj_set_f18_to_r0_f42_to_40 ldr r5, =0x0203ab34 ldr r0, [r5] adds r0, 0x49 strb r4, [r0] ldr r4, =0x0203aaec 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, =gUnknown_085A7D58 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, =gUnknown_085A7FF4 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 .pool thumb_func_end sub_812E474 thumb_func_start sub_812E5A8 sub_812E5A8: ; 812E5A8 push {r4,r5,lr} sub sp, 0x18 ldr r4, =0x0203aaf0 ldr r0, [r4] cmp r0, 0 bne @0812E5BC movs r0, 0x8 bl malloc_and_clear str r0, [r4] @0812E5BC: ldr r2, [r4] ldr r0, =0x0203aad8 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, =gUnknown_085A7D70 ldm r0!, {r3-r5} stm r1!, {r3-r5} ldm r0!, {r3-r5} stm r1!, {r3-r5} str r2, [sp, 0xC] ldr r0, =0x02021bbc 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, =0x02020630 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, =gUnknown_085A8010 bl obj_set_f18_to_r0_f42_to_40 ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x42 strb r4, [r0] add sp, 0x18 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A7D88 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, =0x02020630 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, =0x0203ab34 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 .pool thumb_func_end sub_812E650 thumb_func_start sub_812E6C4 sub_812E6C4: ; 812E6C4 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203ab34 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 .pool 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, =gUnknown_085A7DA0 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, =0x02020630 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, =gUnknown_085A8028 mov r9, r0 adds r0, r2, 0 mov r1, r9 bl obj_set_f18_to_r0_f42_to_40 ldr r6, =0x0203ab34 ldr r0, [r6] adds r0, 0x4E strb r4, [r0] movs r1, 0x90 lsls r1, 1 ldr r0, =gUnknown_085A7DA0 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 .pool thumb_func_end sub_812E70C thumb_func_start sub_812E7CC sub_812E7CC: ; 812E7CC push {r4,lr} ldr r0, =gUnknown_085A7DB8 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, =0x02020630 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, =gUnknown_085A803C bl obj_set_f18_to_r0_f42_to_40 ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x40 strb r4, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812E7CC thumb_func_start sub_812E82C sub_812E82C: ; 812E82C push {r4,lr} ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x40 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles movs r4, 0 @0812E846: ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x49 adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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, =0x0203aae8 ldr r0, [r4] cmp r0, 0 beq @0812E878 bl free movs r0, 0 str r0, [r4] @0812E878: ldr r4, =0x0203aaec ldr r0, [r4] cmp r0, 0 beq @0812E888 bl free movs r0, 0 str r0, [r4] @0812E888: movs r4, 0 @0812E88A: ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x4B adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool thumb_func_end sub_812E82C thumb_func_start sub_812E8C4 sub_812E8C4: ; 812E8C4 push {r4,lr} movs r4, 0 @0812E8C8: ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x4E adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool thumb_func_end sub_812E8C4 thumb_func_start sub_812E8F8 sub_812E8F8: ; 812E8F8 push {r4,lr} ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x42 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldr r4, =0x0203aaf0 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 .pool 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, =gUnknown_085A7DD0 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, =0x02020630 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, =0x0203ab34 ldr r1, [r6] adds r1, 0x50 strb r0, [r1] movs r0, 0x8 strh r0, [r3, 0x2E] ldr r0, =0x0000ffff 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 .pool 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, =0x02020630 ldr r1, =0x0203ab34 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 .pool thumb_func_end sub_812EA44 thumb_func_start sub_812EA7C sub_812EA7C: ; 812EA7C push {r4,lr} movs r4, 0 @0812EA80: ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x50 adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 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 .pool 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, =gUnknown_085A7DE8 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, =0x02020630 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, =0x0203ab34 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 .pool 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, =gUnknown_085A7614 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, =0x01030000 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 .pool thumb_func_end sub_812EB48 thumb_func_start sub_812EBAC sub_812EBAC: ; 812EBAC ldr r3, =0x02020630 ldr r1, =0x0203ab34 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 .pool 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, =0x01030000 adds r0, r1 lsrs r0, 16 movs r1, 0 movs r2, 0 movs r3, 0 bl sub_80B609C movs r4, 0 @0812EBEA: ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x52 adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool thumb_func_end sub_812EBCC thumb_func_start sub_812EC20 sub_812EC20: ; 812EC20 push {lr} ldr r0, =gUnknown_085A7E00 movs r1, 0xA8 movs r2, 0x50 movs r3, 0x6 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 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, =0x0203ab34 ldr r1, [r1] adds r1, 0x41 strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812EC20 thumb_func_start sub_812EC64 sub_812EC64: ; 812EC64 ldr r1, =0x02021bbe ldrh r1, [r1] strh r1, [r0, 0x26] bx lr .align 2, 0 .pool thumb_func_end sub_812EC64 thumb_func_start sub_812EC70 sub_812EC70: ; 812EC70 push {lr} ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x41 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812EC70 thumb_func_start sub_812EC94 sub_812EC94: ; 812EC94 push {r4,r5,lr} sub sp, 0x8 ldr r1, =gUnknown_085A7616 mov r0, sp movs r2, 0x8 bl memcpy movs r4, 0 @0812ECA4: ldr r0, =0x02021bbc ldrh r0, [r0] movs r1, 0x50 subs r1, r0 lsls r1, 16 asrs r1, 16 ldr r0, =gUnknown_085A7E18 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, =0x02020630 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, =0x0203ab34 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 .pool 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, =0x0203ab34 ldr r0, [r0] adds r0, 0x54 adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 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 .pool thumb_func_end sub_812ED8C thumb_func_start sub_812EDC0 sub_812EDC0: ; 812EDC0 push {r4,lr} ldr r0, =gUnknown_085A7E30 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, =0x02020630 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, =0x0203ab34 ldr r0, [r0] adds r0, 0x43 strb r4, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r0, =0x0203ab34 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 .pool thumb_func_end sub_812EEA8 thumb_func_start sub_812EECC sub_812EECC: ; 812EECC push {r4,lr} ldr r0, =0x0203ab34 ldr r0, [r0] adds r0, 0x43 ldrb r0, [r0] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 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 .pool 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, =gUnknown_085A7F98 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, =0x02020630 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 .pool 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, =0x02020630 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 .pool 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, =gUnknown_085A78C8 lsrs r1, 22 adds r3, r1, r3 ldr r5, [r3] ldr r3, =gUnknown_085A783A 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 .pool 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, =gUnknown_085A8264 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, =0x03001188 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, =0x02020630 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, =gUnknown_085A82CC 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 .pool 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, =gUnknown_085A761E mov r0, sp movs r2, 0x8 bl memcpy add r5, sp, 0x8 ldr r1, =gUnknown_085A7626 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 .pool 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, =0x010f0000 cmp r0, r1 ble @0812F1B4 @0812F1A2: ldrh r0, [r2, 0x2E] adds r0, 0x1 strh r0, [r2, 0x2E] b @0812F1B4 .align 2, 0 .pool @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, =@0812F238 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0812F238: .4byte @0812F250 .4byte @0812F268 .4byte @0812F288 .4byte @0812F29C .4byte @0812F2AC .4byte @0812F2C2 @0812F250: ldr r0, =0x0203ab34 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 .pool @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, =gUnknown_085A8510 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 .pool @0812F4C0: ldr r1, =gUnknown_085A8510 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 .pool 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, =gUnknown_085A762E mov r0, sp movs r2, 0x10 bl memcpy add r6, sp, 0x10 ldr r1, =gUnknown_085A763E adds r0, r6, 0 movs r2, 0x10 bl memcpy add r5, sp, 0x20 ldr r1, =gUnknown_085A764E 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 .pool @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, =gUnknown_085A765E 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 .pool 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, =0x0203ab34 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, =0x00002088 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, =0x0203ab34 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 .pool @0812F6E0: ldr r6, =0x0203ab34 ldr r0, [r6] movs r1, 0x12 ldrsh r0, [r0, r1] cmp r0, 0 beq @0812F76C ldr r1, =nullsub_12 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, =0x0000c0e0 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, =0x0203ab34 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 .pool 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, =gUnknown_085A8520 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 .pool thumb_func_end sub_812F794 thumb_func_start sub_812F7C0 sub_812F7C0: ; 812F7C0 ldr r0, =0x0203ab34 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 .pool thumb_func_end sub_812F7C0 thumb_func_start sub_812F7E4 sub_812F7E4: ; 812F7E4 push {r4-r6,lr} bl sub_812F8A0 ldr r4, =0x0203aad4 movs r0, 0xC8 lsls r0, 6 bl malloc adds r1, r0, 0 str r1, [r4] ldr r0, =gUnknown_08DD0050 bl call_LZZUnCompWram ldr r4, =0x0203aad8 movs r0, 0xD8 lsls r0, 6 bl malloc adds r1, r0, 0 str r1, [r4] ldr r0, =gUnknown_085A858C bl call_LZZUnCompWram ldr r4, =0x0203ab30 movs r0, 0xB0 bl malloc_and_clear str r0, [r4] movs r3, 0 ldr r5, =gUnknown_085A8334 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, =0x0203aad4 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, =gUnknown_085A8544 bl gpu_pal_obj_alloc_and_load_multiple pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812F7E4 thumb_func_start sub_812F8A0 sub_812F8A0: ; 812F8A0 push {r4-r6,lr} ldr r5, =0x0203ab2c movs r0, 0x8 bl malloc_and_clear str r0, [r5] ldr r4, =0x0203aae0 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, =gUnknown_085A83E4 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 .pool thumb_func_end sub_812F8A0 thumb_func_start sub_812F908 sub_812F908: ; 812F908 push {r4,r5,lr} ldr r4, =0x0203aac8 movs r5, 0x88 lsls r5, 6 adds r0, r5, 0 bl malloc adds r1, r0, 0 str r1, [r4] ldr r0, =gUnknown_08DCDB30 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, =gUnknown_08DCDA90 movs r1, 0 movs r2, 0xA0 bl gpu_pal_apply ldr r0, =gUnknown_085A8524 movs r1, 0xD0 movs r2, 0x20 bl gpu_pal_apply pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08DCE770 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 .pool 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, =0x0203aad0 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 .pool 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, =0x0203aadc 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, =0x000001e1 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, =0x00000201 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 .pool thumb_func_end sub_812FA78 thumb_func_start sub_812FAF4 sub_812FAF4: ; 812FAF4 push {lr} ldr r1, =gUnknown_08DCEC70 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 .pool thumb_func_end sub_812FAF4 thumb_func_start sub_812FB14 sub_812FB14: ; 812FB14 ldr r1, =0x03001188 ldr r0, =0x0203aaf4 ldr r0, [r0] str r0, [r1] ldr r0, =0x0203aaf8 ldr r0, [r0] str r0, [r1, 0x4] ldr r0, =0x0203aafc ldr r0, [r0] str r0, [r1, 0x8] ldr r0, =0x0203ab04 ldr r0, [r0] str r0, [r1, 0xC] ldr r0, =0x0203ab08 ldr r0, [r0] str r0, [r1, 0x10] ldr r0, =0x0203ab18 ldr r0, [r0] str r0, [r1, 0x14] ldr r0, =0x0203ab1c ldr r0, [r0] str r0, [r1, 0x18] ldr r0, =0x0203ab20 ldr r0, [r0] str r0, [r1, 0x1C] ldr r0, =0x0203ab24 ldr r0, [r0] str r0, [r1, 0x20] ldr r0, =0x0203ab28 ldr r0, [r0] str r0, [r1, 0x24] ldr r0, =0x0203ab00 ldr r0, [r0] str r0, [r1, 0x28] str r0, [r1, 0x2C] str r0, [r1, 0x30] str r0, [r1, 0x34] ldr r0, =0x0203ab0c 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, =0x0203ab10 ldr r0, [r0] str r0, [r1, 0x4C] str r0, [r1, 0x50] str r0, [r1, 0x54] ldr r0, =0x0203ab14 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 .pool thumb_func_end sub_812FB14 thumb_func_start sub_812FBC4 sub_812FBC4: ; 812FBC4 push {r4-r6,lr} mov r6, r8 push {r6} ldr r4, =0x0203aaf4 movs r0, 0x8 bl malloc_and_clear str r0, [r4] ldr r6, =0x0203aad4 ldr r1, [r6] str r1, [r0] movs r5, 0xC0 lsls r5, 3 strh r5, [r0, 0x4] ldr r4, =0x0203aaf8 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, =0x0203aafc 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, =0x0203ab00 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, =0x0203ab04 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, =0x0203ab08 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, =0x0203ab0c 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, =0x0203ab10 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, =0x0203ab14 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, =0x0203ab18 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, =0x0203ab1c 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, =0x0203ab20 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, =0x0203ab24 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, =0x0203ab28 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 .pool thumb_func_end sub_812FBC4 thumb_func_start sub_812FDA8 sub_812FDA8: ; 812FDA8 push {r4-r7,lr} ldr r3, =0x02039f5d ldr r4, =0x02039f5c ldr r1, =0x03005d8c ldr r2, [r1] subs r0, 0x1 lsls r1, r0, 5 adds r2, r1 ldr r1, =0x02039f3c ldr r5, =0x00002e90 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 .pool 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, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 ldr r4, =0x030061c4 ldr r0, [r4] bl free movs r5, 0 str r5, [r4] ldr r4, =0x03006190 ldr r0, [r4] bl free str r5, [r4] ldr r0, =0x030011f7 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 .pool thumb_func_end sub_812FE0C thumb_func_start sub_812FE58 sub_812FE58: ; 812FE58 push {r4-r7,lr} sub sp, 0x4 ldr r1, =0x030022c0 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, =@0812FE80 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030061c0 ldr r0, =0x02039f3c str r0, [r1] movs r0, 0x1 bl sub_8130238 bl sub_81301EC ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0812FF3E .align 2, 0 .pool @0812FEC8: bl sub_80A1A74 movs r2, 0xC0 lsls r2, 19 movs r3, 0xC0 lsls r3, 9 movs r5, 0 ldr r1, =0x040000d4 movs r4, 0x80 lsls r4, 5 ldr r6, =0x85000400 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 .pool @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, =0x02039f5d ldrb r0, [r0] ldr r1, =0x02039f5c ldrb r1, [r1] bl sub_8130884 @0812FF36: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @0812FF3E: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0812FFA0 .align 2, 0 .pool @0812FF54: ldr r0, =0x02039f5d ldrb r0, [r0] ldr r1, =0x02039f5c ldrb r1, [r1] bl sub_813010C ldr r0, =gUnknown_085B0838 movs r1, 0 movs r2, 0x2 bl gpu_pal_apply movs r1, 0xA0 lsls r1, 19 movs r4, 0 str r4, [sp] ldr r0, =0x040000d4 mov r2, sp str r2, [r0] str r1, [r0, 0x4] ldr r1, =0x85000100 str r1, [r0, 0x8] ldr r0, [r0, 0x8] movs r0, 0x2 bl sub_80A2390 ldr r0, =sub_81302D0 bl SetVBlankCallback ldr r0, =0x030011f0 strb r4, [r0] movs r1, 0x9A lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =sub_812FDF8 bl set_callback2 @0812FFA0: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_812FE58 thumb_func_start sub_812FFC8 sub_812FFC8: ; 812FFC8 push {lr} sub sp, 0x4 ldr r3, =0x030011f0 ldrb r1, [r3] cmp r1, 0x1 beq @0813001C cmp r1, 0x1 bgt @0812FFE4 cmp r1, 0 beq @0812FFEA b @08130082 .align 2, 0 .pool @0812FFE4: cmp r1, 0x2 beq @0813005C b @08130082 @0812FFEA: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0812FFFA movs r0, 0x1 strb r0, [r3] @0812FFFA: ldr r0, =0x030011f6 ldrb r0, [r0] cmp r0, 0 beq @08130082 ldr r1, =0x030011f4 ldrh r0, [r1] cmp r0, 0 beq @08130082 subs r0, 0x1 b @08130080 .align 2, 0 .pool @0813001C: ldr r0, =0x030022c0 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, =0x030011f6 ldrb r0, [r0] cmp r0, 0 beq @08130082 ldr r1, =0x030011f4 movs r0, 0 b @08130080 .align 2, 0 .pool @0813005C: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0813006E ldr r0, =sub_812FE0C bl set_callback2 @0813006E: ldr r0, =0x030011f6 ldrb r0, [r0] cmp r0, 0 beq @08130082 ldr r1, =0x030011f4 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 .pool 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, =gUnknown_085B07E8 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, =0x030011f7 ldr r0, =gUnknown_085B07EC 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 .pool 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, =0x030061c0 ldr r1, [r6] ldrb r5, [r1, 0xA] cmp r0, 0x7 bhi @08130190 ldr r4, =0x02021cc4 adds r0, r4, 0 adds r1, r5, 0 bl sub_818E868 ldr r1, =gUnknown_085E8D5E adds r0, r4, 0 bl gf_strcat ldr r1, =gUnknown_085B07D4 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, =0x02021dc4 ldr r1, [r6] adds r1, 0x16 adds r0, r4, 0 bl gf_strcpy adds r0, r4, 0 bl sub_81DB5AC ldr r0, =0x02021ec4 ldr r1, [r6] adds r1, 0xB bl gf_strcpy ldr r0, =0x02021fc4 ldr r1, =gUnknown_0827EA0C bl ExpandTextCodes b @081301A6 .align 2, 0 .pool @08130190: ldr r0, =0x02021cc4 adds r1, 0xB bl gf_strcpy ldr r0, =0x02021fc4 ldr r2, =gUnknown_085B07F4 lsls r1, r5, 2 adds r1, r2 ldr r1, [r1] bl ExpandTextCodes @081301A6: ldr r4, =0x02021fc4 movs r0, 0x1 adds r1, r4, 0 movs r2, 0xD0 bl sub_81DB35C adds r3, r0, 0 ldr r0, =0x030011f7 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 .pool 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, =0x04000200 ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] ldr r1, =0x00000c42 movs r0, 0x8 bl lcd_io_set ldr r1, =0x00000a45 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 .pool 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, =0x030011f6 strb r1, [r0] ldr r0, =0x030011f2 strh r1, [r0] ldr r0, =0x030011f4 strh r1, [r0] b @0813026E .align 2, 0 .pool @0813025C: ldr r1, =0x030011f6 movs r0, 0x1 strb r0, [r1] ldr r1, =0x030011f2 movs r0, 0xF strh r0, [r1] ldr r1, =0x030011f4 movs r0, 0x1E strh r0, [r1] @0813026E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8130238 thumb_func_start sub_8130280 sub_8130280: ; 8130280 push {lr} ldr r0, =0x030011f6 ldrb r0, [r0] cmp r0, 0 bne @08130298 movs r0, 0x4C movs r1, 0 bl lcd_io_set b @081302C0 .align 2, 0 .pool @08130298: ldr r1, =0x00000a45 movs r0, 0xA bl lcd_io_set ldr r1, =0x030011f2 ldr r0, =0x030011f4 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 .pool 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, =0x030061c0 ldr r0, [r6] ldr r1, [r0, 0x4] ldr r2, [r0] adds r0, r5, 0 bl species_and_otid_get_pal ldr r7, =0x030061c4 ldr r1, [r7] bl call_LZZUnCompVram cmp r4, 0 bne @08130348 lsls r0, r5, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r4, =0x020244d4 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, =0x03006190 ldr r2, [r2] bl sub_8130380 b @0813036C .align 2, 0 .pool @08130348: lsls r0, r5, 3 ldr r1, =gMonBackPicTable adds r0, r1 ldr r4, =0x020244d4 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, =0x03006190 ldr r2, [r2] bl sub_8130380 @0813036C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085A989C movs r2, 0x80 lsls r2, 1 movs r1, 0 bl gpu_pal_apply cmp r4, 0x1 beq @0813044E b @081305A4 @0813044E: ldr r0, =0x030061c0 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, =@08130478 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08130478: .4byte @0813048C .4byte @081304A4 .4byte @081304BC .4byte @081304D4 .4byte @081304F8 @0813048C: ldr r0, =gUnknown_085A9A9C movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AE974 b @081304E0 .align 2, 0 .pool @081304A4: ldr r0, =gUnknown_085AAB20 movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AEE80 b @081304E0 .align 2, 0 .pool @081304BC: ldr r0, =gUnknown_085AB750 movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AF38C b @081304E0 .align 2, 0 .pool @081304D4: ldr r0, =gUnknown_085AC288 movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AF898 @081304E0: ldr r1, =0x03006190 ldr r1, [r1] bl RLUnCompWram b @0813050C .align 2, 0 .pool @081304F8: ldr r0, =gUnknown_085AD240 movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AFDA4 ldr r1, =0x03006190 ldr r1, [r1] bl RLUnCompWram @0813050C: movs r1, 0 ldr r5, =0x06006000 ldr r0, =0x00001015 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, =0x0600608c mov r12, r0 ldr r7, =0x03006190 @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, =0x0600608e ldr r2, =0x03006190 @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 .pool @081305A4: cmp r5, 0x7 bhi @081305C0 ldr r0, =gUnknown_085AE370 movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085B02B0 b @08130650 .align 2, 0 .pool @081305C0: ldr r0, =0x030061c0 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, =@081305E8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081305E8: .4byte @081305FC .4byte @08130614 .4byte @0813062C .4byte @08130644 .4byte @08130664 @081305FC: ldr r0, =gUnknown_085A9A9C movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AE974 b @08130650 .align 2, 0 .pool @08130614: ldr r0, =gUnknown_085AAB20 movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AEE80 b @08130650 .align 2, 0 .pool @0813062C: ldr r0, =gUnknown_085AB750 movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AF38C b @08130650 .align 2, 0 .pool @08130644: ldr r0, =gUnknown_085AC288 movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AF898 @08130650: ldr r1, =0x06006000 bl RLUnCompVram b @08130676 .align 2, 0 .pool @08130664: ldr r0, =gUnknown_085AD240 movs r1, 0xC0 lsls r1, 19 bl RLUnCompVram ldr r0, =gUnknown_085AFDA4 ldr r1, =0x06006000 bl RLUnCompVram @08130676: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8130430 thumb_func_start sub_8130688 sub_8130688: ; 8130688 push {lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x030022c0 ldr r1, =gUnknown_085B0830 ldr r2, [r1, 0x4] ldr r1, [r1] str r1, [r3, 0x38] str r2, [r3, 0x3C] ldrh r2, [r3, 0x3C] ldr r1, =0xfffffc00 ands r1, r2 strh r1, [r3, 0x3C] ldrh r1, [r3, 0x3A] ldr r0, =0xfffffe00 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 .pool 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, =0x030061c0 ldr r0, [r0] ldrb r0, [r0, 0xA] b @081306F4 .align 2, 0 .pool @081306E4: ldr r0, =0x030061c0 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, =@0813070C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030061c4 movs r0, 0x80 lsls r0, 2 bl malloc_and_clear str r0, [r4] ldr r4, =0x03006190 movs r0, 0x80 lsls r0, 6 bl malloc_and_clear str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030061a0 ldr r0, =0x03006190 ldr r0, [r0] str r0, [r1, 0x4] ldr r0, =0x030061c4 ldr r0, [r0] str r0, [r1, 0x8] movs r2, 0 strb r2, [r1, 0x18] ldr r0, =0x030061c0 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, =@081307B4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x06010000 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, =0x030061c4 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 .pool 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, =0x030061c0 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 .pool 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, =0x020244a8 ldr r0, [r1] ldr r3, [r0, 0x18] movs r4, 0 mov r12, r1 ldr r2, =0x02022fec movs r1, 0 @081308DC: adds r0, r3, r4 strb r1, [r0] adds r4, 0x1 cmp r4, 0x53 bls @081308DC ldr r0, [r2] ldr r1, =0x0a7f098a ands r0, r1 cmp r0, 0x8 bne @0813092E movs r4, 0 ldr r6, =0x02038bca ldr r5, =gTrainers + 0x10 ; items offset @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 .pool 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, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] movs r4, 0 ldr r6, =0x02024064 movs r3, 0 @08130962: adds r0, r1, r4 strb r3, [r0] adds r4, 0x1 cmp r4, 0x1B bls @08130962 movs r4, 0 ldr r3, =0x020244a8 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 .pool @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, =0x020244a8 @081309B4: ldr r7, =gUnknown_0832A328 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, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x1C] adds r0, 0x20 movs r1, 0 strb r1, [r0] ldr r0, =0x0203ab3c ldr r6, =0x02024064 ldrb r2, [r6] strb r2, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08130A60 ldr r5, =0x0202420c 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, =0x02024210 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 .pool @08130A60: ldr r0, =0x0202420c movs r1, 0x1 eors r1, r2 strb r1, [r0] @08130A68: ldr r0, =0x02022fec 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 .pool @08130A84: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08130AA0 ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] movs r0, 0x80 lsls r0, 23 str r0, [r1, 0xC] b @08130B72 .align 2, 0 .pool @08130AA0: movs r0, 0x80 lsls r0, 3 ands r0, r1 cmp r0, 0 beq @08130ABC ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] movs r0, 0x80 lsls r0, 22 str r0, [r1, 0xC] b @08130B72 .align 2, 0 .pool @08130ABC: movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08130AD8 ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] movs r0, 0x80 lsls r0, 24 str r0, [r1, 0xC] b @08130B72 .align 2, 0 .pool @08130AD8: movs r0, 0x80 lsls r0, 12 ands r0, r1 cmp r0, 0 beq @08130AF4 bl sub_81A6FB4 @08130AE6: ldr r1, =0x020244a8 ldr r1, [r1] ldr r1, [r1, 0x14] str r0, [r1, 0xC] b @08130B72 .align 2, 0 .pool @08130AF4: ldr r0, =0x0c3f0900 ands r0, r1 cmp r0, 0 beq @08130B10 ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] movs r0, 0x7 str r0, [r1, 0xC] b @08130B72 .align 2, 0 .pool @08130B10: movs r0, 0x80 lsls r0, 8 ands r1, r0 cmp r1, 0 beq @08130B58 ldr r0, =0x020244a8 ldr r0, [r0] ldr r4, [r0, 0x14] ldr r3, =gTrainers ldr r0, =0x02038bca ldrh r0, [r0] lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r3, 0x1C adds r1, r3 ldr r0, =0x02038bcc 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 .pool @08130B58: ldr r0, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =gTrainers ldr r0, =0x02038bca 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, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08130B8C ldr r0, =0x020244a8 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 .pool thumb_func_end sub_8130950 thumb_func_start sub_8130BA4 sub_8130BA4: ; 8130BA4 push {r4,lr} ldr r0, =0x020241ea ldrh r4, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 bne @08130BC4 bl sub_8130BDC b @08130BC8 .align 2, 0 .pool @08130BC4: bl sub_8130CF4 @08130BC8: lsls r0, 24 lsrs r1, r0, 24 ldr r0, =0x020241ea strh r4, [r0] adds r0, r1, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x020244a8 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, =0x020244a8 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 .pool @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, =0x02024084 ldr r0, =0x0203ab3c 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 .pool 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, =0x0203ab3c ldrb r0, [r0] cmp r8, r0 beq @08130D2E movs r0, 0x58 mov r7, r8 muls r7, r0 adds r0, r7, 0 ldr r1, =0x02024084 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, =0x0000ffff mov r7, r10 strh r0, [r7] b @08130EAE .align 2, 0 .pool @08130D48: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @08130D70 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x92 ldrb r0, [r0] lsrs r0, 4 bl sub_8130950 b @08130D76 .align 2, 0 .pool @08130D70: movs r0, 0xF bl sub_8130950 @08130D76: ldr r0, =0x0202420c mov r1, r8 strb r1, [r0] movs r1, 0x1 mov r2, r8 ands r2, r1 ldr r0, =0x0203ab3c ldrb r0, [r0] ands r1, r0 cmp r2, r1 beq @08130D90 bl sub_8131074 @08130D90: ldr r2, =0x020244a8 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 .pool @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, =0x0203ab3c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 ldr r2, =0x02024090 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, =0x0203ab3c ldrb r1, [r0] movs r0, 0x2 eors r0, r1 cmp r8, r0 bne @08130EAE cmp r2, 0x63 bgt @08130EAE ldr r0, =0x0000ffff 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, =0x0202420c 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 .pool 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, =0x020244a8 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, =0x0203ab38 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, =gUnknown_082DBEF8 ldrb r0, [r2, 0x11] lsls r0, 2 adds r0, r1 ldr r0, [r0] mov r1, r8 str r0, [r1] ldr r5, =0x02024084 ldrb r4, [r2, 0x1] ldr r0, =0x0203ab3c 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 .pool @08130FD4: ldrh r1, [r2, 0x2] cmp r1, 0 beq @08130FF4 ldr r1, =gUnknown_085B083C 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 .pool @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, =0x020244a8 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 .pool @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, =0x020244a8 ldr r0, [r4] ldr r2, [r0, 0x18] ldr r3, =0x0202420c ldrb r1, [r3] lsls r0, r1, 4 adds r2, r0 ldr r5, =0x02024248 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 .pool @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, =0x020244a8 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 .pool 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, =0x020244a8 ldr r2, [r2] ldr r2, [r2, 0x18] adds r2, 0x40 adds r2, r0 strb r1, [r2] bx lr .align 2, 0 .pool 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, =0x020244a8 ldr r1, [r1] ldr r1, [r1, 0x18] adds r1, 0x40 adds r1, r0 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x020244a8 ldr r2, [r2] ldr r2, [r2, 0x18] adds r2, 0x44 adds r2, r0 strb r1, [r2] bx lr .align 2, 0 .pool 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, =0x020244a8 ldr r1, [r1] ldr r1, [r1, 0x18] adds r1, 0x44 adds r1, r0 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x0203ab38 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 .pool @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, =0x0203ab38 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 .pool @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, =0x0203ab38 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 .pool @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, =0x0203ab38 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 .pool @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, =0x020244a8 ldr r0, [r2] ldr r0, [r0, 0x14] adds r1, r0, 0x4 ldrb r0, [r0, 0x1] adds r1, r0 ldr r3, =0x0203ab38 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 .pool thumb_func_end tai04_unk thumb_func_start tai05_unk tai05_unk: ; 81312BC push {r4,lr} ldr r0, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @081312D8 ldr r0, =0x0203ab3c b @081312DA .align 2, 0 .pool @081312D8: ldr r0, =0x0202420c @081312DA: ldrb r1, [r0] ldr r2, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @08131340 ldr r0, =0x0203ab3c b @08131342 .align 2, 0 .pool @08131340: ldr r0, =0x0202420c @08131342: ldrb r1, [r0] ldr r2, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @081313A8 ldr r0, =0x0203ab3c b @081313AA .align 2, 0 .pool @081313A8: ldr r0, =0x0202420c @081313AA: ldrb r1, [r0] ldr r2, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @08131410 ldr r0, =0x0203ab3c b @08131412 .align 2, 0 .pool @08131410: ldr r0, =0x0202420c @08131412: ldrb r1, [r0] ldr r2, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 cmp r1, 0x1 bne @08131478 ldr r0, =0x0203ab3c b @0813147A .align 2, 0 .pool @08131478: ldr r0, =0x0202420c @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, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 cmp r1, 0x1 bne @081314EC ldr r0, =0x0203ab3c b @081314EE .align 2, 0 .pool @081314EC: ldr r0, =0x0202420c @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, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 cmp r1, 0x1 bne @08131560 ldr r0, =0x0203ab3c b @08131562 .align 2, 0 .pool @08131560: ldr r0, =0x0202420c @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, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 cmp r1, 0x1 bne @081315D4 ldr r0, =0x0203ab3c b @081315D6 .align 2, 0 .pool @081315D4: ldr r0, =0x0202420c @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, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 cmp r1, 0x1 bne @08131648 ldr r0, =0x0203ab3c b @0813164A .align 2, 0 .pool @08131648: ldr r0, =0x0202420c @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, =0x020242ac 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 cmp r1, 0x1 bne @081316B8 ldr r0, =0x0203ab3c b @081316BA .align 2, 0 .pool @081316B8: ldr r0, =0x0202420c @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, =0x020242ac 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 .pool @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, =0x0203ab38 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 bne @08131724 ldr r0, =0x0203ab3c b @08131726 .align 2, 0 .pool @08131724: ldr r0, =0x0202420c @08131726: ldrb r0, [r0] bl battle_get_per_side_status movs r2, 0x1 ands r2, r0 ldr r4, =0x0203ab38 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, =0x0202428e 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 .pool @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, =0x0203ab38 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 bne @081317A0 ldr r0, =0x0203ab3c b @081317A2 .align 2, 0 .pool @081317A0: ldr r0, =0x0202420c @081317A2: ldrb r0, [r0] bl battle_get_per_side_status movs r2, 0x1 ands r2, r0 ldr r4, =0x0203ab38 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, =0x0202428e 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 .pool @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, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x14] ldr r3, =0x0203ab38 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 .pool @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, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x14] ldr r3, =0x0203ab38 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 .pool @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, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x14] ldr r3, =0x0203ab38 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 .pool @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, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x14] ldr r3, =0x0203ab38 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 .pool @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, =0x0203ab38 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, =0x020244a8 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 .pool @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, =0x0203ab38 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, =0x020244a8 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 .pool @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, =0x0203ab38 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, =0x020244a8 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 .pool @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, =0x0203ab38 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, =0x020244a8 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 .pool @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, =0x0203ab38 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldr r0, =0x020244a8 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 .pool @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, =0x0203ab38 ldr r2, [r3] ldrb r1, [r2, 0x1] ldrb r0, [r2, 0x2] lsls r0, 8 orrs r1, r0 ldr r0, =0x020244a8 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 .pool @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, =0x0203ab38 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, =0x020244a8 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 .pool @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, =0x0203ab38 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, =0x020244a8 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 .pool @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, =0x0203ab38 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, =0x0000ffff cmp r0, r5 beq @08131C00 ldr r0, =0x020244a8 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 .pool @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, =0x0203ab38 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, =0x0000ffff adds r5, r2, 0 cmp r0, r4 beq @08131C5C ldr r0, =0x020244a8 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 .pool @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, =0x0203ab38 ldr r1, =0x02024084 ldr r0, =0x0203ab3c ldrb r2, [r0] ldr r5, =gBattleMoves 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 .pool @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, =0x0203ab38 ldr r1, =0x02024084 ldr r0, =0x0203ab3c ldrb r2, [r0] ldr r5, =gBattleMoves 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 .pool @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, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] ldr r0, =0x03005d10 ldrb r0, [r0, 0x13] str r0, [r1, 0x8] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end tai21_unk thumb_func_start dp15_get_some_type dp15_get_some_type: ; 8131D80 push {r4,lr} ldr r1, =0x0203ab38 ldr r0, [r1] ldrb r0, [r0, 0x1] adds r4, r1, 0 cmp r0, 0x4 bhi @08131E5A lsls r0, 2 ldr r1, =@08131DA0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08131DA0: .4byte @08131DD8 .4byte @08131DB4 .4byte @08131E20 .4byte @08131DFC .4byte @08131E44 @08131DB4: ldr r0, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =0x02024084 ldr r0, =0x0203ab3c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x21 ldrb r0, [r0] b @08131E58 .align 2, 0 .pool @08131DD8: ldr r0, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x21 ldrb r0, [r0] b @08131E58 .align 2, 0 .pool @08131DFC: ldr r0, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =0x02024084 ldr r0, =0x0203ab3c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x22 ldrb r0, [r0] b @08131E58 .align 2, 0 .pool @08131E20: ldr r0, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =0x02024084 ldr r0, =0x0202420c ldrb r1, [r0] movs r0, 0x58 muls r0, r1 adds r0, r2 adds r0, 0x22 ldrb r0, [r0] b @08131E58 .align 2, 0 .pool @08131E44: ldr r0, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =gBattleMoves 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 .pool 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, =0x0203ab3c ldrb r0, [r0] b @08131EAC .align 2, 0 .pool @08131E84: cmp r0, 0x1 ble @08131E90 cmp r0, 0x2 beq @08131EA4 cmp r0, 0x3 beq @08131E9C @08131E90: ldr r0, =0x0202420c ldrb r0, [r0] b @08131EAC .align 2, 0 .pool @08131E9C: ldr r0, =0x0203ab3c b @08131EA6 .align 2, 0 .pool @08131EA4: ldr r0, =0x0202420c @08131EA6: ldrb r1, [r0] movs r0, 0x2 eors r0, r1 @08131EAC: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8131E70 thumb_func_start tai5F_unk tai5F_unk: ; 8131EB4 push {r4,lr} ldr r4, =0x0203ab38 ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_8131E70 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02024084 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, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] movs r0, 0x1 b @08131F04 .align 2, 0 .pool @08131EFC: ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] movs r0, 0 @08131F04: str r0, [r1, 0x8] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x3 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end tai5F_unk thumb_func_start dp15_move_get_power__2_8 dp15_move_get_power__2_8: ; 8131F1C ldr r0, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =gBattleMoves 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_085B09C8 ldrh r1, [r0] ldr r5, =0x0000ffff ldr r6, =gBattleMoves ldr r2, =0x020244a8 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, =gUnknown_085B09C8 @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, =gUnknown_085B09C8 adds r0, r1 ldrh r3, [r0] ldr r0, =0x0000ffff cmp r3, r0 beq @08131FAC b @08132126 @08131FAC: ldr r0, =0x02024400 movs r1, 0 strh r1, [r0] ldr r0, =0x0202449c ldr r0, [r0] strb r1, [r0, 0x13] ldr r0, =0x02024474 movs r2, 0x1 strb r2, [r0, 0xE] ldr r0, =0x0202427c strb r1, [r0] ldr r0, =0x02024211 strb r2, [r0] movs r6, 0 mov r9, r3 ldr r2, =gUnknown_085B09C8 ldrh r2, [r2] str r2, [sp, 0x10] @08131FD0: movs r3, 0 ldr r5, =0x02024084 lsls r4, r6, 1 ldr r7, =0x0203ab3c 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, =gBattleMoves 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, =gUnknown_085B09C8 @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, =gUnknown_085B09C8 adds r0, r2 ldrh r0, [r0] cmp r0, r9 bne @081320C0 ldr r0, =gBattleMoves 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, =0x020241ea strh r2, [r5] ldrb r0, [r7] ldr r4, =0x0202420c 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, =0x020241f0 ldr r0, =0x020244a8 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 .pool @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, =0x020244a8 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, =0x0203ab38 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 .pool @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, =0x0203ab38 @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 .pool 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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r3, r0, 0 cmp r1, 0x1 bne @08132178 ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0x14] ldr r1, =0x02024248 ldr r0, =0x0203ab3c b @08132182 .align 2, 0 .pool @08132178: ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0x14] ldr r1, =0x02024248 ldr r0, =0x0202420c @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 .pool thumb_func_end dp15_get_move_to_execute_B thumb_func_start tai26_unk tai26_unk: ; 81321A4 push {lr} ldr r3, =0x0203ab38 ldr r2, [r3] ldrb r1, [r2, 0x1] ldr r0, =0x020244a8 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 .pool @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, =0x0203ab38 ldr r2, [r3] ldrb r1, [r2, 0x1] ldr r0, =0x020244a8 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 .pool @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, =0x0203ab3c ldrb r0, [r0] ldr r1, =0x0202420c ldrb r1, [r1] movs r2, 0x1 bl b_first_side ldr r3, =0x0203ab38 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 .pool @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, =0x0203ab3c ldrb r0, [r0] ldr r1, =0x0202420c ldrb r1, [r1] movs r2, 0x1 bl b_first_side ldr r3, =0x0203ab38 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 .pool @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, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] movs r0, 0 str r0, [r1, 0x8] ldr r0, =0x0203ab38 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 bne @081322E8 ldr r0, =0x0203ab3c b @081322EA .align 2, 0 .pool @081322E8: ldr r0, =0x0202420c @081322EA: ldrb r5, [r0] adds r0, r5, 0 bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r8, r1 cmp r0, 0 bne @08132300 ldr r0, =0x020244ec mov r8, r0 @08132300: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @08132344 ldr r4, =0x0202406e 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 .pool @08132344: ldr r1, =0x0202406e 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, =0x020244a8 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x2 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end tai2C_unk thumb_func_start dp15_get_move_id__8 dp15_get_move_id__8: ; 81323B8 ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] ldrh r0, [r1, 0x2] str r0, [r1, 0x8] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =gBattleMoves 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end dp15_move_get_move_script_id thumb_func_start tai2F_unk tai2F_unk: ; 8132400 push {r4-r7,lr} ldr r0, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] mov r12, r0 cmp r1, 0x1 bne @0813241C ldr r0, =0x0203ab3c b @0813241E .align 2, 0 .pool @0813241C: ldr r0, =0x0202420c @0813241E: ldrb r3, [r0] ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, r3 beq @081324F0 ldr r7, =0x020244a8 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 .pool @0813244C: ldr r1, =0x02024084 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 .pool @08132480: ldr r6, =gBaseStats 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, =0x0203ab38 mov r12, r0 b @08132504 .align 2, 0 .pool @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, =0x0203ab38 mov r12, r1 b @08132504 .align 2, 0 .pool @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, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0x14] ldr r1, =0x02024084 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 .pool thumb_func_end tai2F_unk thumb_func_start tai60_unk tai60_unk: ; 813251C push {r4-r6,lr} ldr r4, =0x0203ab38 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, =0x020244a8 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 .pool @0813255C: ldr r1, =0x02024084 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 .pool @08132588: ldr r2, =gBaseStats 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 .pool @081325B4: ldrb r3, [r1, 0x16] b @081325CA @081325B8: ldrb r3, [r1, 0x17] b @081325CA @081325BC: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r5 adds r0, r1 adds r0, 0x20 ldrb r3, [r0] ldr r6, =0x020244a8 @081325CA: cmp r3, 0 bne @081325E8 @081325CE: ldr r0, [r6] ldr r1, [r0, 0x14] movs r0, 0x2 str r0, [r1, 0x8] ldr r2, =0x0203ab38 b @08132608 .align 2, 0 .pool @081325E8: ldr r0, =0x0203ab38 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 .pool @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, =0x02024400 movs r1, 0 strh r1, [r0] ldr r0, =0x0202449c ldr r0, [r0] strb r1, [r0, 0x13] ldr r0, =0x02024474 movs r3, 0 movs r2, 0x1 strb r2, [r0, 0xE] ldr r0, =0x0202427c strb r1, [r0] ldr r0, =0x02024211 strb r2, [r0] ldr r0, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x14] str r3, [r0, 0x8] movs r5, 0 ldr r4, =0x020241f0 ldr r7, =0x020241ea ldr r0, =0x02024090 mov r8, r0 ldr r6, =0x0203ab3c @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, =0x0202420c 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, =0x0202427c ldrb r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @081326A8 movs r0, 0 str r0, [r4] @081326A8: ldr r0, =0x020244a8 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024400 movs r1, 0 strh r1, [r0] ldr r0, =0x0202449c ldr r0, [r0] strb r1, [r0, 0x13] ldr r0, =0x02024474 movs r2, 0x1 strb r2, [r0, 0xE] ldr r5, =0x0202427c strb r1, [r5] ldr r0, =0x02024211 strb r2, [r0] ldr r4, =0x020241f0 movs r0, 0x28 str r0, [r4] ldr r1, =0x020241ea ldr r0, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x14] ldrh r0, [r0, 0x2] strh r0, [r1] ldrh r0, [r1] ldr r1, =0x0203ab3c ldrb r1, [r1] ldr r2, =0x0202420c 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, =0x0203ab38 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 .pool @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, =0x0203ab38 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 bne @08132818 ldr r0, =0x0203ab3c b @0813281A .align 2, 0 .pool @081327F8: ldr r3, =0x0203ab38 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 .pool @08132818: ldr r0, =0x0202420c @0813281A: ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r9, r1 cmp r0, 0 bne @0813282E ldr r0, =0x020244ec mov r9, r0 @0813282E: ldr r0, =0x0203ab38 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, =0x0203ab38 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 .pool 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, =0x0203ab38 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 bne @081328D8 ldr r0, =0x0203ab3c b @081328DA .align 2, 0 .pool @081328D8: ldr r0, =0x0202420c @081328DA: ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 ldr r1, =0x02024744 mov r10, r1 cmp r0, 0 bne @081328EE ldr r0, =0x020244ec mov r10, r0 @081328EE: ldr r2, =0x0203ab38 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, =0x0203ab38 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 .pool thumb_func_end tai35_unk thumb_func_start dp15_get_weather__8 dp15_get_weather__8: ; 8132994 push {lr} ldr r2, =0x020243cc ldrh r1, [r2] movs r0, 0x7 ands r0, r1 cmp r0, 0 beq @081329AC ldr r0, =0x020244a8 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, =0x020244a8 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, =0x020244a8 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, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x14] movs r0, 0x3 str r0, [r1, 0x8] @081329E8: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp15_get_weather__8 thumb_func_start tai37_unk tai37_unk: ; 8132A00 push {lr} ldr r2, =gBattleMoves ldr r0, =0x020244a8 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, =0x0203ab38 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 .pool @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, =gBattleMoves ldr r0, =0x020244a8 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, =0x0203ab38 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @08132AB4 ldr r0, =0x0203ab3c b @08132AB6 .align 2, 0 .pool @08132AB4: ldr r0, =0x0202420c @08132AB6: ldrb r3, [r0] ldr r1, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @08132B1C ldr r0, =0x0203ab3c b @08132B1E .align 2, 0 .pool @08132B1C: ldr r0, =0x0202420c @08132B1E: ldrb r3, [r0] ldr r1, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @08132B84 ldr r0, =0x0203ab3c b @08132B86 .align 2, 0 .pool @08132B84: ldr r0, =0x0202420c @08132B86: ldrb r3, [r0] ldr r1, =0x02024084 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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @08132BEC ldr r0, =0x0203ab3c b @08132BEE .align 2, 0 .pool @08132BEC: ldr r0, =0x0202420c @08132BEE: ldrb r3, [r0] ldr r1, =0x02024084 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 .pool @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, =gBattleMoves ldr r0, =0x020244a8 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, =0x02024400 movs r1, 0 strh r1, [r0] ldr r0, =0x0202449c ldr r0, [r0] strb r1, [r0, 0x13] ldr r0, =0x02024474 movs r7, 0x1 strb r7, [r0, 0xE] ldr r0, =0x0202427c strb r1, [r0] ldr r0, =0x02024211 strb r7, [r0] ldr r5, =0x020241ea mov r1, r8 ldr r0, [r1] ldr r0, [r0, 0x14] ldrh r0, [r0, 0x2] strh r0, [r5] ldr r4, =0x0203ab3c ldrb r0, [r4] ldr r6, =0x0202420c ldrb r1, [r6] bl sub_8046E7C ldrh r0, [r5] ldrb r1, [r4] ldrb r2, [r6] bl move_effectiveness_something ldr r4, =0x020241f0 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, =0x02024084 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, =0x0203ab38 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 .pool @08132D1C: ldr r1, =0x0203ab38 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 .pool 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, =gBattleMoves ldr r7, =0x020244a8 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, =0x02024400 movs r1, 0 strh r1, [r0] ldr r0, =0x0202449c ldr r0, [r0] strb r1, [r0, 0x13] ldr r0, =0x02024474 movs r2, 0x1 strb r2, [r0, 0xE] ldr r0, =0x0202427c strb r1, [r0] ldr r0, =0x02024211 strb r2, [r0] ldr r6, =0x020241ea ldr r0, [r7] ldr r0, [r0, 0x14] ldrh r0, [r0, 0x2] strh r0, [r6] ldr r4, =0x0203ab3c ldrb r0, [r4] ldr r5, =0x0202420c ldrb r1, [r5] bl sub_8046E7C ldrh r0, [r6] ldrb r1, [r4] ldrb r2, [r5] bl move_effectiveness_something ldr r4, =0x020241f0 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, =0x02024084 ldrb r2, [r5] movs r1, 0x58 muls r1, r2 adds r1, r3 ldrh r1, [r1, 0x28] cmp r1, r0 ble @08132E04 ldr r3, =0x0203ab38 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 .pool @08132E04: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08132E0C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab38 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 .pool @08132E38: cmp r1, 0x2 beq @08132EDC cmp r1, 0x3 beq @08132E84 b @08132F40 @08132E42: movs r4, 0 ldr r3, =0x02024084 ldr r2, =0x0203ab3c 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 .pool @08132E84: ldr r3, =0x02024084 ldr r2, =0x0203ab3c 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 .pool @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, =0x020244a8 ldr r0, [r3] ldr r1, [r0, 0x18] ldr r2, =0x0202420c 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 .pool @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, =0x0203ab38 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 .pool @08132F68: cmp r0, 0x2 beq @08132FB4 cmp r0, 0x3 bne @08133018 @08132F70: movs r3, 0 ldr r2, =0x02024084 ldr r4, =0x0203ab3c 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 .pool @08132FB4: movs r3, 0 ldr r4, =0x020244a8 ldr r0, [r4] ldr r1, [r0, 0x18] ldr r2, =0x0202420c 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 .pool @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, =0x0203ab38 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 .pool @0813303C: cmp r0, 0x2 beq @08133090 cmp r0, 0x3 bne @08133110 @08133044: movs r3, 0 ldr r1, =0x02024084 ldr r0, =0x0203ab3c ldrb r2, [r0] ldr r6, =gBattleMoves movs r0, 0x58 muls r0, r2 adds r1, 0xC adds r2, r0, r1 ldr r4, =0x0203ab38 @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 .pool @08133090: movs r3, 0 ldr r1, =0x02024084 ldr r0, =0x0203ab3c ldrb r2, [r0] ldr r0, =gBattleMoves mov r12, r0 ldr r7, =0x020244a8 ldr r6, =0x0202420c 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 .pool @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, =0x0203ab38 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 .pool @08133134: cmp r0, 0x2 beq @08133188 cmp r0, 0x3 bne @081331F4 @0813313C: movs r3, 0 ldr r1, =0x02024084 ldr r0, =0x0203ab3c ldrb r2, [r0] ldr r6, =gBattleMoves movs r0, 0x58 muls r0, r2 adds r1, 0xC adds r2, r0, r1 ldr r5, =0x0203ab38 @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 .pool @08133188: movs r3, 0 ldr r0, =0x020244a8 ldr r0, [r0] ldr r1, [r0, 0x18] ldr r0, =0x0202420c ldrb r0, [r0] ldr r6, =gBattleMoves lsls r0, 4 adds r2, r0, r1 ldr r5, =0x0203ab38 @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 .pool @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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r5, r0, 0 cmp r1, 0x1 bne @08133218 ldr r0, =0x0203ab3c b @0813321A .align 2, 0 .pool @08133218: ldr r0, =0x0202420c @0813321A: ldrb r3, [r0] adds r4, r5, 0 ldr r2, [r4] ldrb r0, [r2, 0x2] cmp r0, 0 bne @08133240 ldr r0, =0x020242bc 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 .pool @08133240: cmp r0, 0x1 beq @0813324A @08133244: adds r0, r2, 0x7 str r0, [r4] b @0813327C @0813324A: ldr r0, =0x020242bc 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 .pool @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, =0x0203ab38 ldr r3, [r4] ldrb r0, [r3, 0x1] cmp r0, 0 beq @0813329C cmp r0, 0x1 beq @081332C8 b @08133308 .align 2, 0 .pool @0813329C: ldr r2, =0x020242bc ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x020244a8 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 .pool @081332C8: ldr r2, =0x020242bc ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x020244a8 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 .pool @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, =0x020244a8 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 .pool thumb_func_end tai45_unk thumb_func_start tai46_unk tai46_unk: ; 8133328 push {r4,lr} ldr r0, =0x0202449c 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, =0x0203ab38 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 .pool @08133374: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @0813337C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end tai46_unk thumb_func_start dp15_end_with_move_5 dp15_end_with_move_5: ; 8133388 ldr r0, =0x020244a8 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 .pool 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, =0x0203ab38 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 bne @081333B4 ldr r0, =0x0203ab3c b @081333B6 .align 2, 0 .pool @081333B4: ldr r0, =0x0202420c @081333B6: ldrb r2, [r0] ldr r0, =0x02024064 ldrb r0, [r0] cmp r0, r2 beq @081333E0 ldr r4, =0x020244a8 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 .pool @081333E0: ldr r1, =0x02024084 movs r0, 0x58 muls r0, r2 adds r0, r1 ldrh r0, [r0, 0x2E] bl itemid_get_x12 ldr r1, =0x020244a8 ldr r1, [r1] @081333F2: ldr r1, [r1, 0x14] lsls r0, 24 lsrs r0, 24 str r0, [r1, 0x8] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x2 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp15_get_held_item_x12__8 thumb_func_start tai62_unk tai62_unk: ; 8133414 push {r4,lr} ldr r0, =0x0203ab38 ldr r0, [r0] ldrb r0, [r0, 0x1] bl sub_8131E70 lsls r0, 24 lsrs r3, r0, 24 movs r0, 0x1 ldr r1, =0x0203ab3c ldrb r2, [r1] adds r1, r3, 0 ands r1, r0 ands r0, r2 cmp r1, r0 bne @0813344C ldr r1, =0x02024084 movs r0, 0x58 muls r0, r3 adds r0, r1 ldrh r3, [r0, 0x2E] b @08133458 .align 2, 0 .pool @0813344C: ldr r0, =0x020244a8 ldr r0, [r0] ldr r0, [r0, 0x18] adds r0, 0x44 adds r0, r3 ldrb r3, [r0] @08133458: ldr r4, =0x0203ab38 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 .pool @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, =0x0203ab38 ldr r0, [r0] ldrb r0, [r0, 0x1] cmp r0, 0x1 bne @081334AC ldr r0, =0x0203ab3c b @081334AE .align 2, 0 .pool @081334AC: ldr r0, =0x0202420c @081334AE: ldrb r1, [r0] ldr r2, =0x02024084 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, =0x020244a8 ldr r1, [r1] ldr r1, [r1, 0x14] lsls r0, 24 lsrs r0, 24 str r0, [r1, 0x8] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x2 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @08133508 ldr r0, =0x0203ab3c b @0813350A .align 2, 0 .pool @08133508: ldr r0, =0x0202420c @0813350A: ldrb r3, [r0] ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0x14] ldr r1, =0x020242bc 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 .pool 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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @08133554 ldr r0, =0x0203ab3c b @08133556 .align 2, 0 .pool @08133554: ldr r0, =0x0202420c @08133556: ldrb r3, [r0] ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0x14] ldr r1, =0x020242bc 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 .pool thumb_func_end dp15_stockpile_get_num_uses thumb_func_start dp15_is_double_battle dp15_is_double_battle: ; 8133584 ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0x14] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 str r0, [r2, 0x8] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @081335C8 ldr r0, =0x0203ab3c b @081335CA .align 2, 0 .pool @081335C8: ldr r0, =0x0202420c @081335CA: ldrb r3, [r0] ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0x14] ldr r0, =0x0202449c 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 .pool thumb_func_end dp15_get_dp08_item__8 thumb_func_start dp15_move_get_type__8 dp15_move_get_type__8: ; 81335F8 ldr r0, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =gBattleMoves 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =gBattleMoves 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x020244a8 ldr r0, [r0] ldr r3, [r0, 0x14] ldr r2, =gBattleMoves 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x0203ab38 ldr r1, [r0] ldrb r1, [r1, 0x1] adds r4, r0, 0 cmp r1, 0x1 bne @08133698 ldr r0, =0x0203ab3c b @0813369A .align 2, 0 .pool @08133698: ldr r0, =0x0202420c @0813369A: ldrb r3, [r0] ldr r0, =0x020244a8 ldr r0, [r0] ldr r2, [r0, 0x14] ldr r1, =0x020242bc 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 .pool 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, =0x0203ab38 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 .pool thumb_func_end tai58_unk thumb_func_start dp15_jump dp15_jump: ; 8133710 ldr r3, =0x0203ab38 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 .pool 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, =0x020244a8 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 .pool 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, =0x0203ab38 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 .pool @08133770: cmp r0, 0x2 beq @081337D8 b @08133824 @08133776: ldr r3, =0x02024084 ldr r0, =0x0203ab3c ldrb r0, [r0] movs r2, 0x58 adds r1, r0, 0 muls r1, r2 adds r1, r3 adds r1, 0x2A ldr r0, =0x0202420c ldrb r0, [r0] muls r0, r2 adds r0, r3 adds r0, 0x2A ldrb r1, [r1] ldrb r0, [r0] cmp r1, r0 bhi @081337FA b @08133820 .align 2, 0 .pool @081337A8: ldr r3, =0x02024084 ldr r0, =0x0203ab3c ldrb r0, [r0] movs r2, 0x58 adds r1, r0, 0 muls r1, r2 adds r1, r3 adds r1, 0x2A ldr r0, =0x0202420c ldrb r0, [r0] muls r0, r2 adds r0, r3 adds r0, 0x2A ldrb r1, [r1] ldrb r0, [r0] cmp r1, r0 bcc @081337FA b @08133820 .align 2, 0 .pool @081337D8: ldr r3, =0x02024084 ldr r0, =0x0203ab3c ldrb r0, [r0] movs r2, 0x58 adds r1, r0, 0 muls r1, r2 adds r1, r3 adds r1, 0x2A ldr r0, =0x0202420c ldrb r0, [r0] muls r0, r2 adds r0, r3 adds r0, 0x2A ldrb r1, [r1] ldrb r0, [r0] cmp r1, r0 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 .pool @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, =0x020242bc ldr r0, =0x0202420c 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, =0x0203ab38 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 .pool @0813386C: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08133874: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end tai5C_unk thumb_func_start tai5D_unk tai5D_unk: ; 813387C push {lr} ldr r2, =0x020242bc ldr r0, =0x0202420c 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, =0x0203ab38 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 .pool @081338BC: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @081338C4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end tai5D_unk thumb_func_start tai5E_unk tai5E_unk: ; 81338CC push {lr} ldr r0, =0x0203ab3c ldrb r3, [r0] movs r0, 0x1 ldr r1, =0x0202420c ldrb r2, [r1] adds r1, r0, 0 ands r1, r3 ands r0, r2 cmp r1, r0 bne @0813390C ldr r3, =0x0203ab38 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 .pool @0813390C: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08133914: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end tai5E_unk thumb_func_start tai61_unk tai61_unk: ; 813391C push {r4,lr} ldr r4, =0x0203ab38 ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_8131E70 lsls r0, 24 ldr r1, =0x020244a8 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 .pool @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, =0x020244a8 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 .pool thumb_func_end b_mc_stack_push thumb_func_start b_mc_stack_push_cursor b_mc_stack_push_cursor: ; 8133990 ldr r0, =0x020244a8 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, =0x0203ab38 ldr r0, [r0] str r0, [r2] bx lr .align 2, 0 .pool 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, =0x020244a8 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 .pool @081339D4: subs r0, 0x1 strb r0, [r1] ldr r2, =0x0203ab38 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 .pool thumb_func_end b_mc_stack_pop_cursor thumb_func_start sub_81339F8 sub_81339F8: ; 81339F8 push {r4-r6,lr} ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00002e28 adds r5, r1, r0 movs r2, 0 movs r0, 0x2 strb r0, [r5] ldr r0, =0x00002e59 adds r1, r0 strb r2, [r1] movs r4, 0 ldr r6, =gUnknown_085B09E4 @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, =gUnknown_085B09F4 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 .pool thumb_func_end sub_81339F8 thumb_func_start sub_8133A60 sub_8133A60: ; 8133A60 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e59 adds r0, r1 movs r1, 0 strb r1, [r0] bx lr .align 2, 0 .pool 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, =0x03005e08 adds r7, r1, r0 ldr r0, =0x03005d8c ldr r4, [r0] ldr r0, =0x00002e28 adds r0, r4 mov r9, r0 ldr r0, =gUnknown_085B09F8 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0xC] str r1, [sp, 0x10] ldr r1, =gUnknown_085EB7EA movs r0, 0x1 movs r2, 0 bl font_get_width_of_string adds r6, r0, 0 ldr r1, =gUnknown_085E8D38 movs r0, 0x1 movs r2, 0 bl font_get_width_of_string mov r8, r0 movs r5, 0 ldr r0, =0x00002e29 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 .pool @08133AF0: ldrb r1, [r1] lsls r1, 5 ldr r0, =gUnknown_085A5C09 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, =0x00ffffff 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, =gUnknown_085E8D38 movs r3, 0x8 bl Print b @08133B94 .align 2, 0 .pool @08133B70: ldrb r0, [r7, 0x6] ldrb r2, [r1] lsls r2, 5 ldr r1, =gUnknown_085A5C09 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, =gUnknown_085EB7EA 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 .pool 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, =0x03005e08 adds r4, r0, r1 cmp r2, 0x78 bls @08133C14 ldr r1, =0x020375e0 ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r1] b @08133C18 .align 2, 0 .pool @08133C14: ldr r0, =0x020375e0 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 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e28 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 .pool @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, =0x020375e2 lsls r4, 24 asrs r4, 24 strh r4, [r0] ldr r5, =0x02021cc4 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 .pool thumb_func_end sub_8133C48 thumb_func_start sub_8133CD8 sub_8133CD8: ; 8133CD8 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x020375f0 ldr r2, =0x00002e59 adds r0, r2 ldrb r0, [r0] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8133CD8 thumb_func_start sub_8133CF4 sub_8133CF4: ; 8133CF4 push {r4,r5,lr} movs r4, 0 ldr r5, =0x020375f0 @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 .pool @08133D10: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x7 bls @08133CFA ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] @08133D20: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8133CF4 thumb_func_start sub_8133D2C sub_8133D2C: ; 8133D2C push {r4-r6,lr} ldr r6, =0x020375f0 movs r0, 0 strh r0, [r6] ldr r4, =gUnknown_085A5C08 ldr r5, =0x020375e0 ldrh r0, [r5] lsls r0, 5 adds r2, r0, r4 ldr r0, =0x020375e4 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, =0x02021dc4 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 .pool thumb_func_end sub_8133D2C thumb_func_start sub_8133D8C sub_8133D8C: ; 8133D8C push {lr} ldr r0, =sub_8127208 movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375e4 ldr r0, =0x0203a172 ldrb r1, [r0] ldr r0, =0x0203a14c ldr r0, [r0] adds r0, r1 ldrb r0, [r0] strh r0, [r5] ldr r0, =0x02021ec4 ldr r1, =0x020375e0 ldrh r1, [r1] lsls r1, 5 ldr r4, =gUnknown_085A5C09 adds r1, r4 bl gf_strcpy ldr r0, =0x02021dc4 ldrh r1, [r5] lsls r1, 5 adds r1, r4 bl gf_strcpy b @08133E04 .align 2, 0 .pool @08133DFC: ldr r1, =0x020375e4 ldr r2, =0x0000ffff 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 .pool thumb_func_end sub_8133DA0 thumb_func_start sub_8133E1C sub_8133E1C: ; 8133E1C push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x020375e4 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 .pool thumb_func_end sub_8133E1C thumb_func_start sub_8133E38 sub_8133E38: ; 8133E38 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =0x03005d8c ldr r6, [r0] ldr r0, =0x00002e28 adds r5, r6, r0 ldr r1, =0x020375e4 mov r8, r1 ldrb r0, [r1] bl sub_81619DC ldr r0, =0x020375e0 ldrb r0, [r0] bl sub_8161960 ldr r4, =0x020375e2 ldrh r1, [r4] movs r0, 0xB muls r0, r1 adds r0, 0x5 adds r5, r0 ldr r0, =0x03005d90 ldr r1, [r0] adds r0, r5, 0 bl gf_strcpy ldr r2, =0x00002e29 adds r0, r6, r2 ldrh r1, [r4] adds r0, r1 mov r2, r8 ldrh r1, [r2] strb r1, [r0] ldr r1, =0x00002e5a adds r0, r6, r1 ldrh r4, [r4] adds r0, r4 movs r1, 0x2 strb r1, [r0] ldr r2, =0x00002e59 adds r6, r2 movs r0, 0x1 strb r0, [r6] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8133E38 thumb_func_start sub_8133EC0 sub_8133EC0: ; 8133EC0 push {lr} ldr r0, =sub_8133C48 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 bl sub_8133A78 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B1DF8 lsls r1, 1 adds r1, r0 ldrh r0, [r1] pop {r1} bx r1 .align 2, 0 .pool 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, =0x040000d4 str r1, [r2] movs r1, 0xC0 lsls r1, 19 str r1, [r2, 0x4] ldr r0, =0x8100c000 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, =0x85000100 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, =0x81000200 str r0, [r2, 0x8] ldr r0, [r2, 0x8] ldr r0, =gUnknown_085B0E04 bl LZ77UnCompVram ldr r0, =gUnknown_085B0A80 ldr r1, =0x06003000 bl LZ77UnCompVram ldr r0, =gUnknown_085B0C0C ldr r1, =0x06003800 bl LZ77UnCompVram movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_085B1E00 movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r0, =gUnknown_085B1DCC 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, =gUnknown_085B0A00 movs r1, 0 movs r2, 0x40 bl gpu_pal_apply ldr r0, =gUnknown_085B1ED8 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085B1EE8 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085B1EF8 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, =sub_8133EF8 bl SetVBlankCallback ldr r0, =sub_81341E0 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, =sub_81341FC movs r1, 0 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r1, =0x03005e00 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, =gUnknown_085B1F10 movs r1, 0x78 movs r2, 0x38 movs r3, 0x2 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r3, =0x02020630 mov r8, r3 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 add r1, r8 strh r4, [r1, 0x2E] ldr r6, =gUnknown_085B1F28 ldr r5, =gUnknown_085B1DEC 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, =0x030011f8 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 .pool 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, =0x03005e00 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, =gUnknown_085E8C53 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, =sub_813425C str r0, [r4] add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r6, r0, r2 ldrh r7, [r6, 0x8] ldrb r4, [r6, 0x8] ldr r1, =0x030022c0 ldrh r3, [r1, 0x2E] movs r0, 0x1 ands r0, r3 cmp r0, 0 beq @081342F8 bl sub_8134604 ldr r0, =gUnknown_085B1F40 ldr r1, =gUnknown_085B1DEC 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, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r2, r4, 0 adds r2, 0x10 adds r2, r1, r2 ldr r3, =gUnknown_085B1ED0 str r3, [r2] adds r4, 0x1C adds r1, r4 ldr r2, =sub_8134774 str r2, [r1] strh r0, [r6, 0xA] ldr r0, =sub_8134340 str r0, [r6] b @08134334 .align 2, 0 .pool @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, =sub_8134640 str r0, [r6] b @08134334 .align 2, 0 .pool @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, =sub_8134640 str r1, [r0] @08134334: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813425C thumb_func_start sub_8134340 sub_8134340: ; 8134340 push {lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x02020630 ldr r2, =0x03005e00 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, =sub_8134390 str r0, [r2] @0813437E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_085E8C90 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, =gUnknown_085B1DDC movs r1, 0xAA lsls r1, 2 movs r2, 0xD movs r3, 0 bl sub_81996C0 ldr r0, =sub_8134400 str r0, [r4] add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375f0 ldr r1, =0x03005e00 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, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 b @0813449A .align 2, 0 .pool @08134450: movs r0, 0x5 bl audio_play ldr r0, =0x03005e00 lsls r5, r4, 2 adds r5, r4 lsls r5, 3 adds r5, r0 ldrb r4, [r5, 0xA] ldr r6, =0x02020630 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, =sub_81344AC str r0, [r5] @0813449A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8134400 thumb_func_start sub_81344AC sub_81344AC: ; 81344AC lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_81341FC str r0, [r1] bx lr .align 2, 0 .pool 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 SpeciesToNationalPokedexNum 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, =gSpeciesNames add r9, r0 ldr r0, =gUnknown_085B1DE4 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x2C] str r1, [sp, 0x30] ldr r3, =gUnknown_085B1DF2 lsls r5, 1 adds r2, r5, r3 mov r10, r2 ldrb r0, [r2] lsls r0, 8 ldr r1, =0xffff00ff 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, =0xff00ffff ands r0, r2 orrs r0, r1 str r0, [sp, 0x2C] add r0, sp, 0x2C bl Window_AddFromTemplate ldr r4, =0x030011f8 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, =gUnknown_085B1E0C 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 .pool thumb_func_end sub_81344C8 thumb_func_start sub_8134604 sub_8134604: ; 8134604 push {r4,lr} ldr r4, =0x030011f8 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8134668 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8134640 thumb_func_start sub_8134668 sub_8134668: ; 8134668 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 adds r4, r1 ldrb r0, [r4, 0x8] bl sub_81344C8 ldr r0, =sub_813425C str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff str r1, [sp, 0xC] movs r1, 0x8 movs r2, 0 movs r3, 0x1 bl sub_818D3E4 lsls r0, 24 lsrs r0, 24 ldr r1, =0x02020630 lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r1 ldrb r3, [r2, 0x5] movs r1, 0xD negs r1, r1 ands r1, r3 strb r1, [r2, 0x5] add sp, 0x10 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8134690 thumb_func_start sub_81346DC sub_81346DC: ; 81346DC push {r4,lr} adds r4, r0, 0 ldr r2, =gUnknown_085B1E28 ldr r3, =0x03005e00 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 .pool thumb_func_end sub_81346DC thumb_func_start sub_813473C sub_813473C: ; 813473C push {lr} adds r3, r0, 0 ldr r2, =0x03005e00 movs r0, 0x2E ldrsh r1, [r3, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 movs r2, 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 .pool @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, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 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, =0x040000d4 mov r1, r8 str r1, [r2] str r0, [r2, 0x4] lsrs r0, r3, 2 movs r1, 0x85 lsls r1, 24 orrs r0, r1 str r0, [r2, 0x8] ldr r0, [r2, 0x8] movs r1, 0xA0 lsls r1, 19 mov r0, sp strh r4, [r0] str r0, [r2] str r1, [r2, 0x4] lsrs r3, 1 movs r0, 0x81 lsls r0, 24 orrs r3, r0 str r3, [r2, 0x8] ldr r0, [r2, 0x8] ldr r0, =gUnknown_08DCC05C movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0 bne @081348FC ldr r0, =gUnknown_08DCC01C movs r1, 0 movs r2, 0x20 bl gpu_pal_apply b @08134906 .align 2, 0 .pool @081348FC: ldr r0, =gUnknown_08DCC03C 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, =gUnknown_085B21D4 movs r1, 0xC0 movs r2, 0x8 bl gpu_pal_apply movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_085B21FC movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r0, =gUnknown_085B21DC 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, =gUnknown_085B2208 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085B2218 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 .pool 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, =sub_81347B4 bl SetVBlankCallback ldr r0, =sub_8134C9C 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 .pool 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, =gUnknown_08DCC648 ldr r1, =0x06003800 bl LZ77UnCompVram ldr r0, =sub_8134CB8 movs r1, 0 bl AddTask adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 ldr r1, =0x03005e00 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, =gUnknown_085B2250 movs r1, 0x78 movs r2, 0x50 movs r3, 0x1 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r1, =0x02020630 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, =gUnknown_085B2268 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, =gUnknown_085B22A0 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, =gUnknown_085B22B8 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, =gUnknown_085EFAE0 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 .pool 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, =gUnknown_08DCC908 ldr r1, =0x06003800 bl LZ77UnCompVram ldr r0, =sub_8134F10 movs r1, 0 bl AddTask lsls r0, 24 lsrs r7, r0, 24 adds r0, r7, 0 bl sub_8135130 ldr r1, =0x03005e00 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 .pool @08134B9C: movs r1, 0x5A mov r10, r1 movs r2, 0x87 str r2, [sp, 0xC] @08134BA4: ldr r0, =gUnknown_085B2250 movs r1, 0x78 movs r2, 0x50 movs r3, 0x1 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r6, =0x02020630 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, =gUnknown_085B2268 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, =gUnknown_085B22A0 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, =gUnknown_085B22B8 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, =gUnknown_085EFAE8 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08134CD8 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_8134CE8 str r0, [r1] @08134CD8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x030022c0 ldrh r0, [r2, 0x2E] movs r3, 0x1 adds r1, r3, 0 ands r1, r0 cmp r1, 0 beq @08134D70 ldr r0, =sub_8134DC4 str r0, [r5] b @08134DBE .align 2, 0 .pool @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, =gUnknown_085EFAC6 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, =gUnknown_085B21F4 adds r1, r5, 0 movs r2, 0xD movs r3, 0x1 bl sub_81996C0 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =c3_80BF560 str r1, [r0] add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_8134EA4 b @08134E94 .align 2, 0 .pool @08134E74: movs r0, 0x5 bl audio_play movs r0, 0 movs r1, 0 bl sub_8198070 movs r0, 0 bl Window_FillTileMap ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_8134CE8 @08134E94: str r0, [r1] @08134E96: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =c2_080111BC str r0, [r4] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8134EA4 thumb_func_start c2_080111BC c2_080111BC: ; 8134EE8 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08134F02 bl Window_FreeMemory ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 @08134F02: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_080111BC thumb_func_start sub_8134F10 sub_8134F10: ; 8134F10 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08134F30 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_8134F40 str r0, [r1] @08134F30: pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @08134F66 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_8134F78 str r0, [r1] @08134F66: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8134FB0 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8134F78 thumb_func_start sub_8134FB0 sub_8134FB0: ; 8134FB0 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08134FC6 ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 @08134FC6: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r6, r0, r1 ldr r5, =0x03005cf8 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 .pool @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, =0x03005e00 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, =gUnknown_085B22D0 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 .pool 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, =0x03005e00 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, =gUnknown_085B22D0 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 .pool thumb_func_end sub_8135244 thumb_func_start sub_81352DC sub_81352DC: ; 81352DC push {r4,lr} adds r4, r0, 0 ldr r2, =0x03005e00 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 .pool @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, =0x00000fff 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, =0x00000fff adds r0, r2 @08135370: asrs r0, 12 strh r0, [r4, 0x26] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81352DC thumb_func_start sub_8135380 sub_8135380: ; 8135380 push {r4,lr} adds r4, r0, 0 ldr r2, =0x03005e00 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 .pool @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, =0x00000fff 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, =0x00000fff adds r0, r2 @08135414: asrs r0, 12 strh r0, [r4, 0x26] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab40 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, =0x02037350 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, =0x020375f2 ldrb r0, [r2, 0x8] strh r0, [r1] movs r0, 0x1 b @08135472 .align 2, 0 .pool @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, =0x0203ab40 adds r1, r0, 0x2 bl player_get_pos_to_plus_one_step_in_direction_player_is_facing ldr r0, =task08_080C9820 movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037590 movs r0, 0x1 strb r0, [r1, 0x6] ldrb r1, [r1, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x5 bne @08135504 movs r0, 0x3B bl oe_exec ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_8135578 b @0813551C .align 2, 0 .pool @08135504: bl sub_808C114 adds r0, r4, 0 movs r1, 0x39 bl npc_set_state_2 ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_813552C @0813551C: str r0, [r1] @0813551E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_8135578 str r0, [r1] @08135560: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038c08 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, =0x02037590 ldrb r0, [r5, 0x5] lsls r4, r0, 3 adds r4, r0 lsls r4, 2 ldr r0, =0x02037350 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, =0x02020630 adds r0, r1 ldrb r1, [r6, 0x8] bl obj_anim_image_start movs r0, 0x6 bl oe_active_list_remove ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_813561C str r1, [r0] @081355FC: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02037590 movs r0, 0 strb r0, [r1, 0x6] adds r0, r4, 0 bl remove_task pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375f0 bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r1, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =sub_8179834 b @081356A8 .align 2, 0 .pool @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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =sub_81356C4 @081356A8: str r0, [r1] movs r0, 0x1 @081356AC: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8135654 thumb_func_start sub_81356C4 sub_81356C4: ; 81356C4 push {lr} bl brm_get_pokemon_selection ldr r1, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_082907F0 bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_8135714 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 .pool 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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =hm2_dig str r0, [r1] movs r0, 0x1 @0813574C: pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_81357BC 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 .pool 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, =task08_080A1C44 movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] @081357EE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab50 ldr r0, =0x00000e88 bl malloc str r0, [r5] ldr r2, =0x00000809 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, =0x00000e7c adds r0, r1 movs r1, 0xFF strb r1, [r0] ldr r0, [r5] ldr r4, =0x00000e7d adds r0, r4 strb r3, [r0] ldr r0, =0x0203ab48 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 .pool @08135864: cmp r2, 0x3 beq @081358A4 b @081358C0 @0813586A: ldr r0, =0x00000804 adds r1, r5, r0 ldr r0, =gUnknown_085B269B str r0, [r1] ldr r4, =0x00000808 adds r1, r5, r4 movs r0, 0x2 b @081358D2 .align 2, 0 .pool @08135888: ldr r1, =0x00000804 adds r0, r5, r1 ldr r1, =gUnknown_085B269D str r1, [r0] ldr r4, =0x00000808 adds r0, r5, r4 strb r2, [r0] b @081358D4 .align 2, 0 .pool @081358A4: ldr r0, =0x00000804 adds r1, r5, r0 ldr r0, =gUnknown_085B269F str r0, [r1] ldr r4, =0x00000808 adds r1, r5, r4 movs r0, 0x2 b @081358D2 .align 2, 0 .pool @081358C0: ldr r0, =0x0203ab50 ldr r1, [r0] ldr r0, =0x00000804 adds r2, r1, r0 ldr r0, =gUnknown_085B2698 str r0, [r2] ldr r4, =0x00000808 adds r1, r4 movs r0, 0x3 @081358D2: strb r0, [r1] @081358D4: ldr r0, =sub_813594C bl set_callback2 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81357FC thumb_func_start sub_81358F4 sub_81358F4: ; 81358F4 push {lr} ldr r1, =sub_8059D50 movs r0, 0x1 bl sub_81357FC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81358F4 thumb_func_start sub_8135908 sub_8135908: ; 8135908 push {lr} ldr r1, =c2_exit_to_overworld_2_switch movs r0, 0x2 bl sub_81357FC pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =@081359A0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @08135BA6 .align 2, 0 .pool @08135A08: bl gpu_pal_allocator_reset b @08135B9E @08135A0E: bl sub_80A1A74 ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @08135BA6 .align 2, 0 .pool @08135A30: bl reset_all_obj_data b @08135B9E @08135A36: ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000809 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @08135A46 b @08135B9E @08135A46: bl clear_tasks b @08135B9E .align 2, 0 .pool @08135A54: bl sub_8135BDC ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000e7e adds r0, r1 movs r1, 0 strh r1, [r0] b @08135B9E .align 2, 0 .pool @08135A70: bl sub_8135C38 lsls r0, 24 cmp r0, 0 bne @08135A7C b @08135BD0 @08135A7C: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @08135BA6 .align 2, 0 .pool @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, =0x0203ab50 ldr r1, [r1] ldr r2, =0x00000e74 adds r1, r2 strb r0, [r1] ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @08135BA6 .align 2, 0 .pool @08135AC4: ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000e75 adds r0, r1 movs r1, 0x7 bl sub_8122344 b @08135B9E .align 2, 0 .pool @08135ADC: ldr r0, =0x0203ab48 ldrh r0, [r0, 0x4] ldr r1, =0x00001005 bl sub_8136110 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @08135BA6 .align 2, 0 .pool @08135AFC: bl sub_8135D24 b @08135B9E @08135B02: bl sub_8135E2C ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @08135BA6 .align 2, 0 .pool @08135B14: bl sub_81363BC b @08135B9E @08135B1A: ldr r0, =sub_81365C8 movs r1, 0 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x03006310 ldr r2, =0x0203ab48 ldrh r1, [r2, 0x6] ldrh r2, [r2, 0x4] bl calls_per_item_funcs_in_list_outer ldr r2, =0x03005e00 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @08135BA6 .align 2, 0 .pool @08135B64: bl sub_8135DAC b @08135B9E @08135B6A: movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @08135BA6 .align 2, 0 .pool @08135B84: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] @08135B9E: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @08135BA6: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08135BD0 .align 2, 0 .pool @08135BB8: ldr r0, =sub_8135938 bl SetVBlankCallback ldr r0, =sub_813591C bl set_callback2 movs r0, 0x1 b @08135BD2 .align 2, 0 .pool @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, =gUnknown_085B2620 movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r0, =0x0203ab50 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 .pool thumb_func_end sub_8135BDC thumb_func_start sub_8135C38 sub_8135C38: ; 8135C38 push {r4,lr} sub sp, 0x4 ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000e7e adds r0, r1 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x5 bhi @08135D18 lsls r0, 2 ldr r1, =@08135C64 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08D9B2B4 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 .pool @08135C98: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08135D18 ldr r0, =gUnknown_08D9B7C8 ldr r4, =0x0203ab50 ldr r1, [r4] bl call_LZZUnCompWram ldr r1, [r4] b @08135CE2 .align 2, 0 .pool @08135CBC: ldr r0, =gUnknown_08D9B470 movs r1, 0 movs r2, 0xC0 bl decompress_palette b @08135CDE .align 2, 0 .pool @08135CCC: ldr r0, =gUnknown_085B26F4 bl gpu_tile_obj_decompress_and_load b @08135CDE .align 2, 0 .pool @08135CD8: ldr r0, =gUnknown_085B26FC bl gpu_pal_obj_decompress_and_apply @08135CDE: ldr r0, =0x0203ab50 ldr r1, [r0] @08135CE2: ldr r0, =0x00000e7e adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @08135D18 .align 2, 0 .pool @08135CFC: bl sub_8122328 ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000e7e adds r0, r1 movs r1, 0 strh r1, [r0] movs r0, 0x1 b @08135D1A .align 2, 0 .pool @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, =gUnknown_085B2748 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, =gUnknown_0860F074 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 .pool 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, =gUnknown_085B271C 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 .pool thumb_func_end sub_8135D7C thumb_func_start sub_8135DAC sub_8135DAC: ; 8135DAC push {r4,lr} ldr r0, =0x00000111 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, =gUnknown_085E931D movs r0, 0x2 movs r2, 0 bl sub_8135D7C ldr r1, =gUnknown_085E9323 movs r0, 0x3 movs r2, 0 bl sub_8135D7C ldr r1, =gUnknown_085E9327 movs r0, 0x4 movs r2, 0 bl sub_8135D7C ldr r1, =gUnknown_085E932D movs r0, 0x5 movs r2, 0 bl sub_8135D7C ldr r1, =gUnknown_085E9334 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 .pool thumb_func_end sub_8135DAC thumb_func_start sub_8135E2C sub_8135E2C: ; 8135E2C push {r4-r7,lr} movs r6, 0 ldr r1, =0x0203ab50 ldr r0, [r1] ldr r2, =0x0000080a 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, =0x00000954 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, =0x0000080c 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, =0x0000080a adds r1, r4 ldrb r0, [r1] subs r0, 0x1 cmp r6, r0 blt @08135E42 @08135E7C: ldr r5, =0x0203ab50 lsls r4, r6, 5 ldr r7, =0x00000954 adds r4, r7 ldr r0, [r5] adds r0, r4 ldr r1, =gUnknown_085E9344 bl gf_strcpy ldr r1, [r5] lsls r2, r6, 3 ldr r3, =0x0000080c 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, =0x03006310 adds r1, r2, 0 ldr r0, =gUnknown_085B27B0 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, =0x0000080a adds r0, r1, r4 ldrb r0, [r0] strh r0, [r2, 0xC] adds r3, r1, r3 str r3, [r2] ldr r6, =0x0000080b adds r1, r6 ldrb r0, [r1] strh r0, [r2, 0xE] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8135E2C thumb_func_start sub_8135F04 sub_8135F04: ; 8135F04 push {r4-r6,lr} lsls r1, 16 ldr r2, =0x03005d8c lsrs r1, 13 ldr r3, =0x00000848 adds r1, r3 ldr r5, [r2] adds r5, r1 ldr r2, =gUnknown_085B262C 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, =0x02021cc4 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, =gUnknown_085E934F adds r0, r4, 0 bl ExpandTextCodes pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000e74 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8136470 str r1, [r0] @08135F9C: ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000e7d 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 .pool 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, =0x03005d8c lsls r0, r4, 3 ldr r2, =0x00000848 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 .pool @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, =0x02021cc4 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 .pool @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, =0x03005d8c mov r9, r0 lsls r7, r2, 3 ldr r1, =0x00000848 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, =0x00000848 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 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00000848 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 .pool @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, =0x0203ab48 movs r0, 0 strh r0, [r1, 0x4] strh r0, [r1, 0x6] bx lr .align 2, 0 .pool thumb_func_end sub_813624C thumb_func_start sub_813625C sub_813625C: ; 813625C push {r4,r5,lr} bl sub_8136140 ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x0000080a adds r0, r1 movs r1, 0 strb r1, [r0] movs r2, 0 ldr r5, =0x03005d8c ldr r4, =0x00000848 @08136274: ldr r0, [r5] lsls r1, r2, 3 adds r0, r1 adds r0, r4 ldrb r0, [r0] ldr r3, =0x0203ab50 cmp r0, 0 beq @08136290 ldr r1, [r3] ldr r0, =0x0000080a 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, =0x0000080a 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, =0x0000080b adds r1, r0, r2 movs r0, 0x9 strb r0, [r1] b @081362D6 .align 2, 0 .pool @081362D0: ldr r1, =0x0000080b adds r0, r1 strb r2, [r0] @081362D6: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813625C thumb_func_start sub_81362E0 sub_81362E0: ; 81362E0 push {r4,r5,lr} ldr r0, =0x0203ab48 ldrh r1, [r0, 0x6] adds r3, r0, 0 ldr r4, =0x0203ab50 cmp r1, 0 beq @08136308 ldrh r0, [r3, 0x6] ldr r1, [r4] ldr r5, =0x0000080b 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, =0x0000080a 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 .pool @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, =0x0203ab48 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, =0x0203ab50 ldr r0, [r6] ldr r3, =0x0000080b adds r1, r0, r3 ldrb r1, [r1] adds r2, r1 ldr r7, =0x0000080a 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, =0x0000080b adds r0, r1, r7 ldrb r0, [r0] adds r2, r0 ldr r0, =0x0000080a adds r1, r0 ldrb r1, [r1] cmp r2, r1 bne @08136374 @081363A4: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8136344 thumb_func_start sub_81363BC sub_81363BC: ; 81363BC push {r4,lr} sub sp, 0x10 ldr r4, =0x0203ab50 ldr r1, [r4] ldr r2, =0x00000e7c adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0xFF bne @081363FC ldr r2, =0x0000080a adds r0, r1, r2 ldrb r0, [r0] adds r2, 0x1 adds r1, r2 ldrb r1, [r1] subs r0, r1 str r0, [sp] ldr r0, =0x00000456 str r0, [sp, 0x4] str r0, [sp, 0x8] ldr r0, =0x0203ab4e str r0, [sp, 0xC] movs r0, 0x2 movs r1, 0xB0 movs r2, 0x8 movs r3, 0x98 bl sub_81AF4A0 ldr r1, [r4] ldr r2, =0x00000e7c adds r1, r2 strb r0, [r1] @081363FC: add sp, 0x10 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81363BC thumb_func_start sub_8136418 sub_8136418: ; 8136418 push {r4,lr} ldr r4, =0x0203ab50 ldr r0, [r4] ldr r2, =0x00000e7c adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @08136436 bl sub_81AF620 ldr r0, [r4] ldr r1, =0x00000e7c adds r0, r1 movs r1, 0xFF strb r1, [r0] @08136436: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B2704 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 .pool 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, =gUnknown_085B26F0 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 .pool @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, =nullsub_12 str r0, [r4, 0x1C] @081364E0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8136524 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r2, r0, r1 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081365BE ldr r6, =0x0203ab50 ldr r0, [r6] ldr r1, =0x00000809 adds r0, r1 ldrb r0, [r0] subs r0, 0x2 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @0813655A ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] @0813655A: ldrb r0, [r2] ldr r4, =0x0203ab4e 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 .pool @081365A4: subs r0, r4, 0x6 ldr r0, [r0] bl set_callback2 @081365AC: bl Window_FreeMemory ldr r0, =0x0203ab50 ldr r0, [r0] bl free adds r0, r5, 0 bl remove_task @081365BE: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 mov r10, r0 mov r6, r8 add r6, r10 ldr r0, =0x02037fd4 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, =0x030022c0 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, =0x0203ab4e 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, =0x0203ab50 ldr r0, [r5] ldr r2, =0x0000080a 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, =0x00002005 bl sub_8136110 ldrh r0, [r4, 0x4] ldrh r4, [r4, 0x6] adds r0, r4 strh r0, [r6, 0x4] ldr r0, [r5] ldr r1, =0x00000e7d adds r0, r1 movs r1, 0x1 strb r1, [r0] mov r0, r10 subs r0, 0x8 add r0, r8 ldr r1, =sub_813671C str r1, [r0] b @08136708 .align 2, 0 .pool @08136688: ldr r5, =0x0203ab48 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, =0x00001005 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 .pool @081366D0: movs r0, 0x5 bl audio_play ldr r0, =0x020375f0 ldr r2, =0x0000ffff adds r1, r2, 0 strh r1, [r0] ldr r0, =0x0203ce7c mov r1, r9 strh r1, [r0] adds r0, r7, 0 bl sub_81364EC b @08136708 .align 2, 0 .pool @081366F8: movs r0, 0x5 bl audio_play ldr r0, =0x0203ce7c 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 .pool 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, =0x03005e08 adds r7, r0, r1 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08136742 b @08136848 @08136742: ldr r0, =0x030022c0 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, =0x0203ab4e subs r2, r1, 0x2 bl get_coro_args_x18_x1A b @08136822 .align 2, 0 .pool @0813676C: ldr r6, =0x0203ab48 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, =0x0203ab48 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, =0x00002005 bl sub_8136110 b @081367C0 .align 2, 0 .pool @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, =0x0203ab50 ldr r0, [r5] ldr r4, =0x00000e75 adds r0, r4 movs r1, 0x7 movs r2, 0 bl sub_81223FC ldr r0, [r5] adds r0, r4 ldr r1, =0x0203ab48 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 .pool @08136810: movs r0, 0x5 bl audio_play ldr r0, =0x030022c0 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 .pool @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, =0x03005e08 adds r6, r0, r1 ldr r2, =0x0203ab48 ldrh r0, [r2, 0x4] ldrh r1, [r2, 0x6] adds r0, r1 lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000e7d 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, =0x0203ab48 ldrh r0, [r1, 0x4] subs r0, 0x1 strh r0, [r1, 0x4] @081368BA: ldr r0, =0x03006310 ldr r2, =0x0203ab48 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, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000e75 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, =0x0203ab48 ldrh r0, [r0, 0x4] ldr r1, =0x00001005 bl sub_8136110 ldr r1, =0x03005e00 adds r0, r5, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81365C8 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r6, r0, r1 ldr r0, =0x0203ab50 ldr r0, [r0] ldr r1, =0x00000808 adds r0, r1 ldrb r0, [r0] cmp r0, 0x3 bne @08136968 movs r0, 0x8 b @0813696A .align 2, 0 .pool @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, =0x0203ab50 ldr r3, [r5] ldr r4, =0x00000808 adds r1, r3, r4 ldrb r1, [r1] ldr r2, =gUnknown_085B2668 mov r12, r2 ldr r2, =0x00000804 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81369E0 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B2668 ldr r0, =0x0203ab50 ldr r0, [r0] ldr r2, =0x00000804 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 .pool thumb_func_end sub_81369E0 thumb_func_start sub_8136A50 sub_8136A50: ; 8136A50 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203ab50 ldr r1, [r1] movs r2, 0x80 lsls r2, 4 adds r1, r2 ldr r2, =sub_8136A74 str r2, [r1] bl sub_81364EC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8136A50 thumb_func_start sub_8136A74 sub_8136A74: ; 8136A74 push {lr} ldr r2, =0x03005d8c ldr r0, =0x0203ce7c ldrh r1, [r0] lsls r1, 3 ldr r0, =0x00000848 adds r1, r0 ldr r0, [r2] adds r0, r1 ldr r1, =sub_8136AA0 bl sub_8166204 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8136A74 thumb_func_start sub_8136AA0 sub_8136AA0: ; 8136AA0 push {lr} ldr r0, =0x0203ab48 ldr r1, [r0] movs r0, 0 bl sub_81357FC pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r0, r1 ldrb r0, [r0, 0x2] movs r1, 0 bl sub_8198070 ldr r0, =0x02021cc4 ldr r3, =gUnknown_085B262C ldr r1, =0x03005d8c ldr r2, [r1] ldr r1, =0x0203ce7c ldrh r1, [r1] lsls r1, 3 adds r2, r1 ldr r1, =0x00000848 adds r2, r1 ldrb r1, [r2] lsls r1, 2 adds r1, r3 ldr r1, [r1] bl gf_strcpy ldr r5, =0x02021fc4 ldr r1, =gUnknown_085E9353 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, =sub_8136B48 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 .pool 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, =gUnknown_085B27A8 movs r2, 0x2 str r2, [sp] movs r2, 0x1 str r2, [sp, 0x4] movs r2, 0xE str r2, [sp, 0x8] ldr r2, =gUnknown_085B26A4 str r2, [sp, 0xC] movs r2, 0x1 movs r3, 0 bl sub_8121F94 add sp, 0x10 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_085E9367 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, =sub_8136BC0 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 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @08136C36 ldr r0, =0x0203ce7c ldrb r0, [r0] bl sub_8136F68 movs r0, 0x5 bl audio_play ldr r5, =0x0203ab4e subs r6, r5, 0x2 lsls r4, r7, 2 adds r4, r7 lsls r4, 3 ldr r0, =0x03005e08 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, =0x03006310 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, =0x00001005 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81365C8 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024744 bl GetNature lsls r0, 24 lsrs r0, 24 ldr r5, =0x03005d8c ldr r7, =0x0203ce7c ldrh r2, [r7] lsls r2, 3 ldr r6, =0x00000848 adds r2, r6 ldr r1, [r5] adds r1, r2 bl sub_8136FE4 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldr r0, =0x02022f58 ldr r3, =gUnknown_085B262C 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 .pool @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, =0x0203ce7c ldrb r0, [r5] bl sub_80FC3E8 ldr r0, =0x02021cc4 ldr r3, =gUnknown_085B262C ldr r1, =0x03005d8c ldr r2, [r1] ldrh r1, [r5] lsls r1, 3 adds r2, r1 ldr r1, =0x00000848 adds r2, r1 ldrb r1, [r2] lsls r1, 2 adds r1, r3 ldr r1, [r1] bl gf_strcpy ldr r1, =0x020375f0 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 .pool 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, =0x020375e0 ldr r0, =0x03005d8c ldr r5, =0x0203ce7c ldrh r1, [r5] lsls r1, 3 ldr r2, =0x00000848 adds r1, r2 ldr r0, [r0] adds r0, r1 bl sub_818E704 lsls r0, 24 lsrs r0, 24 strh r0, [r6] ldr r1, =0x020375f0 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 .pool 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, =0x03005e08 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, =sub_81365C8 str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8136DE8 thumb_func_start sub_8136E20 sub_8136E20: ; 8136E20 push {r4,lr} lsls r0, 24 ldr r3, =0x03005d8c ldr r1, [r3] lsrs r0, 21 adds r1, r0 ldr r2, =0x00000848 adds r1, r2 movs r2, 0 strb r2, [r1] ldr r1, [r3] adds r1, r0 ldr r4, =0x00000849 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, =0x0000084e adds r1, r0 strb r2, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r2, [r0] ldr r3, =0x00000848 @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 .pool @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, =0x03005d8c ldr r2, [r0] lsls r0, r1, 3 ldr r1, =0x00000848 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 .pool @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, =0x03005d8c ldr r0, [r0] lsls r1, r2, 3 adds r0, r1 ldr r1, =0x00000848 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 .pool @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, =gUnknown_085B25A0 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 .pool 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, =gUnknown_085B262C 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 .pool 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, =gUnknown_085B262C @08137074: lsls r1, r4, 3 ldr r0, =gUnknown_085B2720 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 .pool @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, =0x020375f0 bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r1, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =sub_8179918 b @08137152 .align 2, 0 .pool @08137134: ldr r0, =0x02037318 ldrb r0, [r0, 0x15] cmp r0, 0x1 bne @08137170 ldr r0, =0x00000888 bl flag_check lsls r0, 24 cmp r0, 0 bne @08137170 ldr r1, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =hm2_flash @08137152: str r0, [r1] movs r0, 0x1 b @08137172 .align 2, 0 .pool @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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r2, =sub_81371B4 lsrs r1, r2, 16 strh r1, [r0, 0x18] strh r2, [r0, 0x1A] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end hm2_flash thumb_func_start sub_81371B4 sub_81371B4: ; 81371B4 push {lr} movs r0, 0xCF bl audio_play ldr r0, =0x00000888 bl flag_set ldr r0, =gUnknown_082926F8 bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool 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, =0x040000d4 mov r0, sp str r0, [r1] movs r0, 0xC0 lsls r0, 19 str r0, [r1, 0x4] ldr r0, =0x8100c000 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, =0x85000100 str r0, [r1, 0x8] ldr r0, [r1, 0x8] mov r0, sp strh r4, [r0] str r0, [r1] ldr r0, =0x05000002 str r0, [r1, 0x4] ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] bl sub_80A1A74 bl clear_tasks bl reset_all_obj_data ldr r3, =0x04000208 ldrh r2, [r3] strh r4, [r3] ldr r4, =0x04000200 ldrh r0, [r4] movs r1, 0x1 orrs r0, r1 strh r0, [r4] strh r2, [r3] ldr r0, =sub_81371EC bl SetVBlankCallback ldr r0, =sub_81371D4 bl set_callback2 bl sub_8137304 lsls r0, 24 cmp r0, 0 bne @081372D2 ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 @081372D2: add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B27C8 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 .pool @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, =gUnknown_085B27C8 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 .pool @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, =gUnknown_085B27C8 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 .pool @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, =sub_8137404 movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81373F0 thumb_func_start sub_8137404 sub_8137404: ; 8137404 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_8137420 str r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_085B2A90 ldr r1, =0x0600c000 bl LZ77UnCompVram ldr r0, =gUnknown_085B28B0 ldr r1, =0x0600f800 bl LZ77UnCompVram ldr r0, =gUnknown_085B2850 movs r1, 0xE0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085B28A0 movs r1, 0xE0 movs r2, 0x10 bl gpu_pal_apply ldr r1, =0x00003e41 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, =0x00001f0c movs r0, 0x8 bl lcd_io_set movs r1, 0x8A lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81374C4 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 .pool 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, =0x03005e00 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 .pool @081374F8: movs r0, 0 strh r0, [r5, 0xC] ldr r0, =sub_813750C str r0, [r5] @08137500: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00001010 movs r0, 0x52 bl lcd_io_set ldr r1, =0x03005e00 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, =gUnknown_085B28A0 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 .pool @08137554: ldr r0, =gUnknown_085B2850 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =sub_8137574 str r0, [r4] movs r0, 0x8 strh r0, [r4, 0xC] @08137566: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813750C thumb_func_start sub_8137574 sub_8137574: ; 8137574 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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 .pool @08137598: ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 @081375A0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8137574 thumb_func_start sub_81375A8 sub_81375A8: ; 81375A8 push {lr} ldr r0, =sub_81375BC movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81375A8 thumb_func_start sub_81375BC sub_81375BC: ; 81375BC lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_81375D8 str r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_085B2A90 ldr r1, =0x0600c000 bl LZ77UnCompVram ldr r0, =gUnknown_085B28B0 ldr r1, =0x0600f800 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, =0x00001f0c movs r0, 0x8 bl lcd_io_set movs r1, 0x8A lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =gUnknown_085B2850 movs r1, 0xE0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085B2870 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8137678 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 .pool thumb_func_end sub_81375D8 thumb_func_start sub_8137678 sub_8137678: ; 8137678 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 ldrh 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, =gUnknown_085B2890 adds r0, r1 lsls r2, 17 lsrs r2, 16 movs r1, 0xE0 bl gpu_pal_apply b @081376C8 .align 2, 0 .pool @081376B4: ldr r1, =0x00001010 movs r0, 0x52 bl lcd_io_set ldr r1, =0x00003e41 movs r0, 0x50 bl lcd_io_set ldr r0, =sub_81376DC str r0, [r4] @081376C8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08137714: ldr r0, =gUnknown_085B2870 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 @08137726: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000864 adds r0, r4, 0 bl flag_check lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x1 bne @08137760 ldr r0, =0x0203bce4 strb r1, [r0] b @0813776C .align 2, 0 .pool @08137760: ldr r1, =0x0203bce4 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, =0x03005d90 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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @081377AC movs r0, 0x1 bl sub_8084F6C b @081377B2 .align 2, 0 .pool @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, =0x020244ec 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, =0x0000089b 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, =0x020244ec adds r0, r1 movs r1, 0x43 bl sub_80EE4DC @0813785A: ldr r0, =sub_8173694 bl set_callback2 movs r0, 0 add sp, 0x1C pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8137734 thumb_func_start sp0C8_whiteout_maybe sp0C8_whiteout_maybe: ; 813787C push {lr} ldr r0, =c2_whiteout bl set_callback2 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sp0C8_whiteout_maybe thumb_func_start sub_8137890 sub_8137890: ; 8137890 push {r4,lr} ldr r0, =0x00004024 bl var_get adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldr r0, =0x00004025 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 .pool thumb_func_end sub_8137890 thumb_func_start sub_81378BC sub_81378BC: ; 81378BC push {r4,lr} adds r4, r0, 0 ldr r0, =0x00004024 lsrs r1, r4, 16 bl var_set ldr r0, =0x00004025 lsls r4, 16 lsrs r4, 16 adds r1, r4, 0 bl var_set pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x41c64e6d ldr r2, =0x00003039 @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 .pool 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, =0x020244ec 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, =0x0000ffff ands r1, r0 cmp r1, r6 bne @08137978 movs r0, 0x1 b @08137980 .align 2, 0 .pool @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, =gUnknown_085B2B44 ldr r0, =0x03005cf8 ldrb r0, [r0, 0x2] lsls r0, 24 asrs r0, 24 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @081379C8 ldr r0, =0x0000089a bl flag_set b @081379CE .align 2, 0 .pool @081379C8: ldr r0, =0x0000089a bl flag_clear @081379CE: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81379D8 movs r1, 0x50 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81379F8 thumb_func_start sub_8137A0C sub_8137A0C: ; 8137A0C push {lr} ldr r0, =0x00004049 bl var_get_pointer movs r1, 0 strh r1, [r0] pop {r0} bx r0 .align 2, 0 .pool 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, =0x00004049 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 .pool thumb_func_end sub_8137A20 thumb_func_start sub_8137A4C sub_8137A4C: ; 8137A4C push {lr} ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0 bne @08137A70 movs r0, 0 bl sub_80C0844 ldr r1, =0x020375e2 strh r0, [r1] movs r0, 0x1 bl sub_80C0844 b @08137A80 .align 2, 0 .pool @08137A70: movs r0, 0 bl pokedex_count ldr r1, =0x020375e2 strh r0, [r1] movs r0, 0x1 bl pokedex_count @08137A80: ldr r1, =0x020375e4 strh r0, [r1] bl sub_809D42C lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_082A5DAB b @08137C06 .align 2, 0 .pool @08137AB0: cmp r0, 0x1D bhi @08137ABC ldr r0, =gUnknown_082A5DF1 b @08137C06 .align 2, 0 .pool @08137ABC: cmp r0, 0x27 bhi @08137AC8 ldr r0, =gUnknown_082A5E34 b @08137C06 .align 2, 0 .pool @08137AC8: cmp r0, 0x31 bhi @08137AD4 ldr r0, =gUnknown_082A5E83 b @08137C06 .align 2, 0 .pool @08137AD4: cmp r0, 0x3B bhi @08137AE0 ldr r0, =gUnknown_082A5EB9 b @08137C06 .align 2, 0 .pool @08137AE0: cmp r0, 0x45 bhi @08137AEC ldr r0, =gUnknown_082A5EF4 b @08137C06 .align 2, 0 .pool @08137AEC: cmp r0, 0x4F bhi @08137AF8 ldr r0, =gUnknown_082A5F39 b @08137C06 .align 2, 0 .pool @08137AF8: cmp r0, 0x59 bhi @08137B04 ldr r0, =gUnknown_082A5F82 b @08137C06 .align 2, 0 .pool @08137B04: cmp r0, 0x63 bhi @08137B10 ldr r0, =gUnknown_082A5FB9 b @08137C06 .align 2, 0 .pool @08137B10: cmp r0, 0x6D bhi @08137B1C ldr r0, =gUnknown_082A6018 b @08137C06 .align 2, 0 .pool @08137B1C: cmp r0, 0x77 bhi @08137B28 ldr r0, =gUnknown_082A6061 b @08137C06 .align 2, 0 .pool @08137B28: cmp r0, 0x81 bhi @08137B34 ldr r0, =gUnknown_082A609C b @08137C06 .align 2, 0 .pool @08137B34: cmp r0, 0x8B bhi @08137B40 ldr r0, =gUnknown_082A60D5 b @08137C06 .align 2, 0 .pool @08137B40: cmp r0, 0x95 bhi @08137B4C ldr r0, =gUnknown_082A6124 b @08137C06 .align 2, 0 .pool @08137B4C: cmp r0, 0x9F bhi @08137B58 ldr r0, =gUnknown_082A616F b @08137C06 .align 2, 0 .pool @08137B58: cmp r0, 0xA9 bhi @08137B64 ldr r0, =gUnknown_082A61D6 b @08137C06 .align 2, 0 .pool @08137B64: cmp r0, 0xB3 bhi @08137B70 ldr r0, =gUnknown_082A623A b @08137C06 .align 2, 0 .pool @08137B70: cmp r0, 0xBD bhi @08137B7C ldr r0, =gUnknown_082A6287 b @08137C06 .align 2, 0 .pool @08137B7C: cmp r0, 0xC7 bls @08137BEA cmp r0, 0xC8 bne @08137BB8 ldr r0, =0x00000199 bl SpeciesToNationalPokedexNum 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 SpeciesToNationalPokedexNum 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 .pool @08137BB8: cmp r0, 0xC9 bne @08137BF8 ldr r0, =0x00000199 bl SpeciesToNationalPokedexNum 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 SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x1 bl pokedex_flag_operation lsls r0, 24 cmp r0, 0 beq @08137C04 @08137BEA: ldr r0, =gUnknown_082A62C9 b @08137C06 .align 2, 0 .pool @08137BF8: cmp r0, 0xCA beq @08137C04 @08137BFC: ldr r0, =gUnknown_082A5D6C b @08137C06 .align 2, 0 .pool @08137C04: ldr r0, =gUnknown_082A6312 @08137C06: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8137A98 thumb_func_start sub_8137C10 sub_8137C10: ; 8137C10 push {lr} ldr r0, =0x020375e0 ldrh r0, [r0] bl sub_8137A98 bl box_related_two__2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8137C10 thumb_func_start sub_8137C28 sub_8137C28: ; 8137C28 push {lr} ldr r0, =sub_8174194 bl set_callback2 bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8137C28 thumb_func_start sub_8137C3C sub_8137C3C: ; 8137C3C push {lr} ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 ldr r1, =0x03005dac ldr r0, =mapldr_080CA5C0 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8137C94 movs r1, 0xA bl AddTask add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end mapldr_080CA5C0 thumb_func_start sub_8137C94 sub_8137C94: ; 8137C94 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 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 .pool thumb_func_end sub_8137C94 thumb_func_start sub_8137CB4 sub_8137CB4: ; 8137CB4 push {lr} ldr r0, =sub_8177888 bl set_callback2 bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8137CB4 thumb_func_start sub_8137CC8 sub_8137CC8: ; 8137CC8 push {lr} ldr r0, =0x030022c0 ldr r1, =c2_exit_to_overworld_2_switch str r1, [r0, 0x8] ldr r0, =sub_8134B44 bl set_callback2 bl script_env_2_enable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8137CC8 thumb_func_start wild_pokemon_reroll wild_pokemon_reroll: ; 8137CEC ldr r0, =0x0203ab54 movs r1, 0 strb r1, [r0] ldr r0, =0x0203ab55 strb r1, [r0] ldr r1, =0x0203ab58 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end wild_pokemon_reroll thumb_func_start sub_8137D0C sub_8137D0C: ; 8137D0C ldr r1, =0x0203ab54 movs r0, 0x1 strb r0, [r1] ldr r1, =0x0203ab55 movs r0, 0 strb r0, [r1] ldr r1, =0x0203ab58 ldr r0, =0x030022c0 ldr r0, [r0, 0x20] str r0, [r1] bx lr .align 2, 0 .pool 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, =0x02021cc4 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0 movs r3, 0x2 bl decimal_int_to_string ldr r1, =gUnknown_085EB5EE adds r0, r4, 0 bl gf_strcat b @08137D90 .align 2, 0 .pool @08137D88: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB5CF bl gf_strcpy @08137D90: ldr r0, =0x00000e0f cmp r7, r0 bhi @08137DF0 ldr r4, =0x02021dc4 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, =gUnknown_085EB5E5 adds r0, r4, 0 bl gf_strcat b @08137DF8 .align 2, 0 .pool @08137DF0: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085EB5DA bl gf_strcpy @08137DF8: movs r4, 0 cmp r6, 0 bne @08137E0C movs r4, 0x5 b @08137E2A .align 2, 0 .pool @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, =0x020375f0 strh r4, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8137D5C thumb_func_start sub_8137E6C sub_8137E6C: ; 8137E6C push {r4,r5,lr} ldr r0, =0x030022c0 ldr r1, =0x0203ab58 ldr r4, [r0, 0x20] ldr r0, [r1] subs r4, r0 ldr r5, =0x0203ab55 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 .pool 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, =0x00004028 adds r0, r6, 0 bl var_get adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldr r7, =0x00004029 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, =0x00004027 mov r1, r8 bl var_set @08137EE6: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8137E9C thumb_func_start sub_8137EFC sub_8137EFC: ; 8137EFC push {r4,lr} ldr r0, =0x00004028 bl var_get adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldr r0, =0x00004029 bl var_get lsls r0, 16 adds r4, r0 cmp r4, 0 beq @08137F3C ldr r0, =0x00004027 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 .pool @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, =0x020322dc ldrh r1, [r0] ldr r0, =0x00000c1d cmp r1, r0 beq @08137F7C ldr r4, =0x000040a9 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 .pool thumb_func_end sub_8137F44 thumb_func_start sub_8137F90 sub_8137F90: ; 8137F90 push {lr} ldr r0, =0x0000088d bl flag_set ldr r0, =0x0000404a bl var_get_pointer movs r1, 0 strh r1, [r0] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8137F90 thumb_func_start sub_8137FB0 sub_8137FB0: ; 8137FB0 push {lr} ldr r0, =0x0000088d bl flag_clear pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000088d bl flag_check lsls r0, 24 cmp r0, 0 beq @08137FE6 ldr r0, =0x0000404a 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 .pool @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, =0x0000404a bl var_get_pointer adds r4, r0, 0 ldr r0, =0x000040b4 bl var_get_pointer ldrh r0, [r0] subs r0, 0x1 cmp r0, 0x9 bhi @081380C2 lsls r0, 2 ldr r1, =@08138038 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x1 blt @0813810A cmp r0, 0x3 ble @081380F6 cmp r0, 0x6 bne @0813810A @081380F6: ldr r0, =0x000040f2 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 .pool @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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x1 blt @08138152 cmp r0, 0x3 ble @0813813E cmp r0, 0x6 bne @08138152 @0813813E: ldr r0, =0x000040f3 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 .pool @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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x1 blt @0813819A cmp r0, 0x3 ble @08138186 cmp r0, 0x6 bne @0813819A @08138186: ldr r0, =0x000040f5 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 .pool @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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x1 blt @081381E2 cmp r0, 0x3 ble @081381CE cmp r0, 0x6 bne @081381E2 @081381CE: ldr r0, =0x000040f4 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 .pool @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, =0x02037318 ldrb r0, [r0, 0x17] cmp r0, 0x1 blt @0813822A cmp r0, 0x3 ble @08138216 cmp r0, 0x6 bne @0813822A @08138216: ldr r0, =0x000040f6 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 .pool @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, =gUnknown_0858D144 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, =0x020229f0 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 .pool 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, =gUnknown_085B2B5C add r0, sp, 0x8 movs r2, 0x4 bl memcpy add r4, sp, 0xC ldr r1, =gUnknown_085B2B60 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 .pool @081382F4: cmp r1, 0x3 beq @081382FE cmp r1, 0x4 beq @08138324 b @08138350 @081382FE: movs r7, 0x2 ldr r0, =0x03005d8c ldr r1, [r0] ldrh r0, [r1] subs r0, 0x1 b @0813832C .align 2, 0 .pool @08138310: movs r7, 0x1 ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0] mov r9, r1 ldrh r0, [r0, 0x2] subs r0, 0x1 b @0813834A .align 2, 0 .pool @08138324: ldr r0, =0x03005d8c 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 .pool @0813833C: movs r7, 0x3 ldr r0, =0x03005d8c 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 .pool @08138358: cmp r10, r6 beq @0813840A ldr r0, =0x020229e8 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 .pool @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, =0x020375e0 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 .pool 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, =0x03005d8c 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, =0x02037350 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, =0x02020630 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 .pool @081384A8: cmp r4, 0xEB beq @081384B2 cmp r4, 0xEC beq @081384BC b @081384E6 @081384B2: ldr r0, =gUnknown_08499A18 b @081384C6 .align 2, 0 .pool @081384BC: ldr r0, =gUnknown_084A54B8 b @081384C6 .align 2, 0 .pool @081384C4: ldr r0, =gUnknown_084987F8 @081384C6: movs r2, 0x80 lsls r2, 1 adds r1, r3, r2 movs r2, 0x20 bl gpu_pal_apply b @081384E6 .align 2, 0 .pool @081384D8: ldr r0, =gUnknown_084A4278 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 .pool thumb_func_end sub_813842C thumb_func_start sub_81384F0 sub_81384F0: ; 81384F0 push {r4,r5,lr} movs r4, 0 ldr r5, =gUnknown_085B2B68 @081384F6: ldr r0, =0x020375e0 ldrh r0, [r0] cmp r4, r0 bne @0813851C lsls r1, r4, 2 adds r1, r5 ldrb r0, [r1] ldrb r1, [r1, 0x1] ldr r2, =0x00000206 bl setmaptile_0 b @0813852A .align 2, 0 .pool @0813851C: lsls r1, r4, 2 adds r1, r5 ldrb r0, [r1] ldrb r1, [r1, 0x1] ldr r2, =0x00000205 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 .pool 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, =0xfffffde6 adds r0, r1 cmp r0, 0x37 bls @0813855A b @08138734 @0813855A: lsls r0, 2 ldr r1, =@0813856C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00000231 b @08138720 .align 2, 0 .pool @0813865C: movs r2, 0x8E lsls r2, 2 b @08138720 @08138662: ldr r2, =0x00000239 b @08138720 .align 2, 0 .pool @0813866C: movs r2, 0x88 lsls r2, 2 b @08138720 @08138672: ldr r2, =0x00000221 b @08138720 .align 2, 0 .pool @0813867C: ldr r2, =0x00000e28 b @08138720 .align 2, 0 .pool @08138684: ldr r2, =0x00000e29 b @08138720 .align 2, 0 .pool @0813868C: ldr r2, =0x00000232 b @08138720 .align 2, 0 .pool @08138694: ldr r2, =0x00000233 b @08138720 .align 2, 0 .pool @0813869C: ldr r2, =0x0000023a b @08138720 .align 2, 0 .pool @081386A4: ldr r2, =0x0000023b b @08138720 .align 2, 0 .pool @081386AC: ldr r2, =0x00000222 b @08138720 .align 2, 0 .pool @081386B4: ldr r2, =0x00000223 b @08138720 .align 2, 0 .pool @081386BC: ldr r2, =0x00000e2a b @08138720 .align 2, 0 .pool @081386C4: ldr r2, =0x00000e2b b @08138720 .align 2, 0 .pool @081386CC: ldr r2, =0x00000e42 b @08138720 .align 2, 0 .pool @081386D4: ldr r2, =0x0000021a b @08138720 .align 2, 0 .pool @081386DC: ldr r2, =0x00000e43 b @08138720 .align 2, 0 .pool @081386E4: ldr r2, =0x0000021a b @08138720 .align 2, 0 .pool @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, =0x00000e48 b @08138720 .align 2, 0 .pool @0813870C: ldr r2, =0x00000e49 b @08138720 .align 2, 0 .pool @08138714: ldr r2, =0x00000e41 b @08138720 .align 2, 0 .pool @0813871C: movs r2, 0xE5 lsls r2, 4 @08138720: adds r0, r4, 0 adds r1, r5, 0 bl setmaptile_0 b @08138734 @0813872A: ldr r2, =0x00000251 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 .pool thumb_func_end sub_8138540 thumb_func_start sub_8138750 sub_8138750: ; 8138750 push {r4-r6,lr} ldr r4, =gUnknown_085B2B68 movs r5, 0x3 @08138756: ldrb r0, [r4] ldrb r1, [r4, 0x1] ldr r2, =0x00000206 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, =0xfffffde0 adds r0, r1 cmp r0, 0x30 bls @08138780 b @081388CA @08138780: lsls r0, 2 ldr r1, =@0813879C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00000231 b @081388B2 .align 2, 0 .pool @08138870: movs r2, 0x8E lsls r2, 2 b @081388B2 @08138876: ldr r2, =0x00000239 b @081388B2 .align 2, 0 .pool @08138880: ldr r2, =0x00000232 b @081388B2 .align 2, 0 .pool @08138888: ldr r2, =0x00000233 b @081388B2 .align 2, 0 .pool @08138890: ldr r2, =0x0000023a b @081388B2 .align 2, 0 .pool @08138898: ldr r2, =0x0000023b b @081388B2 .align 2, 0 .pool @081388A0: ldr r2, =0x00000e42 b @081388B2 .align 2, 0 .pool @081388A8: ldr r2, =0x00000e43 b @081388B2 .align 2, 0 .pool @081388B0: ldr r2, =0x0000021a @081388B2: adds r0, r4, 0 adds r1, r5, 0 bl setmaptile_0 b @081388CA .align 2, 0 .pool @081388C0: ldr r2, =0x00000251 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 .pool thumb_func_end sub_8138750 thumb_func_start sub_81388E4 sub_81388E4: ; 81388E4 push {lr} ldr r0, =0x0203ab5c movs r1, 0 strb r1, [r0] ldr r0, =0x0203ab5d strb r1, [r0] movs r0, 0x2C bl audio_play ldr r0, =sub_8138910 movs r1, 0x8 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B2B78 ldr r5, =0x0203ab5d ldrb r1, [r5] adds r0, r1, r0 ldr r4, =0x0203ab5c ldrb r2, [r4] ldrb r0, [r0] cmp r0, r2 bne @0813896C ldr r0, =0x020375e0 ldrb r0, [r0] ldr r2, =gUnknown_085B2B7E 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 .pool @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, =@081389A0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020375e0 ldrb r0, [r0] ldr r1, =gUnknown_085B2B7E ldrh r1, [r1, 0x8] bl sub_8138978 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8138AA4 thumb_func_start sub_8138AC0 sub_8138AC0: ; 8138AC0 push {lr} ldr r0, =0x02021fc4 bl box_related_two__2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8138AC0 thumb_func_start sub_8138AD0 sub_8138AD0: ; 8138AD0 ldr r1, =0x020375e0 ldr r0, =0x03005d8c ldr r2, [r0] ldrh r0, [r2] strh r0, [r1] ldr r1, =0x020375e2 ldrh r0, [r2, 0x2] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8138AD0 thumb_func_start sub_8138AF0 sub_8138AF0: ; 8138AF0 push {lr} ldr r0, =0x03005d90 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 .pool thumb_func_end sub_8138AF0 thumb_func_start sub_8138B10 sub_8138B10: ; 8138B10 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @08138B34 ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB5F9 bl gf_strcpy b @08138B3C .align 2, 0 .pool @08138B34: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB601 bl gf_strcpy @08138B3C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8138B10 thumb_func_start sub_8138B48 sub_8138B48: ; 8138B48 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @08138B6C ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB60E bl gf_strcpy b @08138B74 .align 2, 0 .pool @08138B6C: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EB60A bl gf_strcpy @08138B74: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8138B48 thumb_func_start sub_8138B80 sub_8138B80: ; 8138B80 ldr r0, =0x0202433a ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8138B80 thumb_func_start sub_8138B8C sub_8138B8C: ; 8138B8C push {lr} sub sp, 0x4 ldr r0, =0x020375e0 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 .pool @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, =0x020375e0 ldrh r0, [r0] bl flag_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8138BC8 thumb_func_start sub_8138BDC sub_8138BDC: ; 8138BDC push {lr} ldr r0, =0x03005cf8 movs r1, 0 ldrsh r0, [r0, r1] movs r1, 0x7 bl __divsi3 lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000270f cmp r0, r1 bls @08138BF6 adds r0, r1, 0 @08138BF6: pop {r1} bx r1 .align 2, 0 .pool 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, =0x020244ec 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 .pool @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, =c2_exit_to_overworld_1_continue_scripts_restart_music bl sub_817018C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8138C84 thumb_func_start sub_8138C94 sub_8138C94: ; 8138C94 push {lr} ldr r0, =sub_8138C84 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8138C94 thumb_func_start sp0D9_ComputerRelated sp0D9_ComputerRelated: ; 8138CA4 push {r4,lr} ldr r4, =sub_8138CE8 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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool 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, =0x020375e0 ldrh r0, [r0] cmp r0, 0 bne @08138DAC movs r3, 0x4 b @08138DE6 .align 2, 0 .pool @08138DAC: cmp r0, 0x1 bne @08138DB8 ldr r3, =0x0000025a b @08138DE6 .align 2, 0 .pool @08138DB8: cmp r0, 0x2 bne @08138DE6 ldr r3, =0x00000259 b @08138DE6 .align 2, 0 .pool @08138DC4: ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0 bne @08138DD4 movs r3, 0x5 b @08138DE6 .align 2, 0 .pool @08138DD4: cmp r0, 0x1 bne @08138DE0 ldr r3, =0x0000027f b @08138DE6 .align 2, 0 .pool @08138DE0: cmp r0, 0x2 bne @08138DE6 ldr r3, =0x0000027e @08138DE6: ldr r0, =0x03005d8c 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 .pool 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, =0x020375e0 ldrh r0, [r0] cmp r0, 0 bne @08138E70 movs r4, 0x4 b @08138E82 .align 2, 0 .pool @08138E70: cmp r0, 0x1 bne @08138E7C ldr r4, =0x0000025a b @08138E82 .align 2, 0 .pool @08138E7C: cmp r0, 0x2 bne @08138E82 ldr r4, =0x00000259 @08138E82: ldr r0, =0x03005d8c 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 .pool thumb_func_end sub_8138E2C thumb_func_start sub_8138EC0 sub_8138EC0: ; 8138EC0 push {r4,lr} ldr r4, =sub_8138F04 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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool 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, =0x00000e9d movs r0, 0x12 movs r1, 0x8 bl setmaptile_0 ldr r2, =0x00000ea5 movs r0, 0x12 movs r1, 0x9 bl setmaptile_0 b @08138F7A .align 2, 0 .pool @08138F64: ldr r2, =0x00000e58 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 .pool thumb_func_end sub_8138F2C thumb_func_start sub_8138FAC sub_8138FAC: ; 8138FAC push {lr} ldr r2, =0x00000e9d movs r0, 0x12 movs r1, 0x8 bl setmaptile_0 ldr r2, =0x00000ea5 movs r0, 0x12 movs r1, 0x9 bl setmaptile_0 bl cur_mapdata_full_redraw pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8138FAC thumb_func_start sub_8138FD4 sub_8138FD4: ; 8138FD4 push {lr} ldr r1, =0x020375e0 ldr r0, =0x000001f5 strh r0, [r1] bl flag_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8138FD4 thumb_func_start sub_8138FEC sub_8138FEC: ; 8138FEC push {lr} ldr r1, =0x020375e0 ldr r0, =0x000001f5 strh r0, [r1] bl flag_clear pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec adds r0, r1 movs r1, 0x16 bl pokemon_getattr cmp r0, 0xC7 bls @08139028 movs r0, 0x1 b @0813902A .align 2, 0 .pool @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, =0x020244ec adds r0, r1 movs r1, 0x17 bl pokemon_getattr cmp r0, 0xC7 bls @08139054 movs r0, 0x1 b @08139056 .align 2, 0 .pool @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, =0x020244ec adds r0, r1 movs r1, 0x18 bl pokemon_getattr cmp r0, 0xC7 bls @08139080 movs r0, 0x1 b @08139082 .align 2, 0 .pool @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, =0x020244ec adds r0, r1 movs r1, 0x21 bl pokemon_getattr cmp r0, 0xC7 bls @081390AC movs r0, 0x1 b @081390AE .align 2, 0 .pool @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, =0x020244ec adds r0, r1 movs r1, 0x2F bl pokemon_getattr cmp r0, 0xC7 bls @081390D8 movs r0, 0x1 b @081390DA .align 2, 0 .pool @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, =gBaseStats @081390E6: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 bl pokemon_getattr cmp r0, 0 beq @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, =0x020375f0 movs r0, 0x1 b @0813914A .align 2, 0 .pool @0813913C: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x5 bls @081390E6 ldr r1, =0x020375f0 movs r0, 0 @0813914A: strh r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81390E0 thumb_func_start sub_8139158 sub_8139158: ; 8139158 push {lr} sub sp, 0x8 ldr r0, =0x03005d8c 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, =0x02037350 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 .pool 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, =0x03005d8c 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 .pool 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, =0x020244ec adds r0, r1 bl GetNature lsls r0, 24 lsrs r0, 24 ldr r1, =0x02021cc4 bl sub_8137068 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81391D0 thumb_func_start sub_8139200 sub_8139200: ; 8139200 push {r4,lr} ldr r4, =0x02021cc4 ldr r0, =0x00004026 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 .pool 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, =0x02021cc4 bl sub_8165284 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8139238 thumb_func_start sub_8139248 sub_8139248: ; 8139248 push {r4,r5,lr} ldr r0, =0x03005d8c ldr r2, [r0] ldr r1, =0x00002e68 adds r0, r2, r1 ldrb r1, [r0] lsls r1, 25 ldr r0, =0x00002e6a adds r2, r0 lsrs r1, 25 ldrh r2, [r2] adds r1, r2 ldr r2, =gUnknown_085B2B88 ldr r0, =0x020375e0 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, =gUnknown_085B2B94 b @08139296 .align 2, 0 .pool @08139294: ldr r4, =gUnknown_085B2BA0 @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 .pool thumb_func_end sub_8139248 thumb_func_start sub_81392AC sub_81392AC: ; 81392AC push {lr} ldr r1, =0x020375e0 ldr r0, =0x00000213 strh r0, [r1] bl flag_check lsls r0, 24 cmp r0, 0 beq @081392CC movs r0, 0x1 b @081392CE .align 2, 0 .pool @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, =0x020375e0 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 .pool @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, =0x020375e0 ldr r0, =0x00000215 strh r0, [r1] bl flag_check lsls r0, 24 cmp r0, 0 beq @08139318 movs r0, 0x1 b @0813931A .align 2, 0 .pool @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, =0x020375e0 ldr r0, =0x00000216 strh r0, [r1] bl flag_check lsls r0, 24 cmp r0, 0 beq @08139340 movs r0, 0x1 b @08139342 .align 2, 0 .pool @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, =0x020244ec 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 .pool 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, =0x0000089b 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, =0x020244ec 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 .pool 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, =0x020244ec adds r0, r1 bl sub_806DC8C lsls r0, 16 ldr r1, =0x01fd0000 cmp r0, r1 bhi @081393F4 movs r0, 0 b @081393F6 .align 2, 0 .pool @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, =0x03005d8c 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, =0x0000409a movs r1, 0x4 b @08139446 .align 2, 0 .pool @08139434: movs r0, 0xE9 lsls r0, 2 bl flag_check lsls r0, 24 cmp r0, 0 beq @08139454 ldr r0, =0x0000409a movs r1, 0x5 @08139446: bl var_set movs r0, 0x1 b @08139456 .align 2, 0 .pool @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, =0x000008bf bl flag_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813945C thumb_func_start sub_813946C sub_813946C: ; 813946C push {r4,r5,lr} sub sp, 0x14 ldr r5, =0x020244ec 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 .pool thumb_func_end sub_813946C thumb_func_start sub_81394D8 sub_81394D8: ; 81394D8 push {r4-r6,lr} ldr r0, =0x00004023 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, =0x020244ec 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 .pool @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, =0x020244ec movs r1, 0x3F bl sub_806DD7C lsls r0, 24 cmp r0, 0 beq @08139558 movs r0, 0x1 b @0813955A .align 2, 0 .pool @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, =sub_81395BC movs r1, 0x9 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =0x020375e2 ldrh r0, [r0] movs r2, 0 strh r0, [r1, 0x8] strh r2, [r1, 0xA] ldr r0, =0x020375e4 ldrh r0, [r0] strh r0, [r1, 0xC] ldr r0, =0x020375e6 ldrh r0, [r0] strh r0, [r1, 0xE] ldr r0, =0x020375e0 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 .pool 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, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] movs r1, 0x2 ldrsh r0, [r4, r1] movs r2, 0x6 ldrsh r1, [r4, r2] bl __modsi3 cmp r0, 0 bne @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 .pool 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, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x41 movs r2, 0 bl pokemon_getattr movs r1, 0xCE lsls r1, 1 cmp r0, r1 beq @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 .pool @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, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool 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, =0x000040c2 bl var_get lsls r0, 16 lsrs r0, 16 adds r3, r0, 0 ldr r2, =0x03005cf8 movs r1, 0 ldrsh r0, [r2, r1] subs r0, r3 cmp r0, 0x6 ble @08139734 movs r0, 0 b @0813974C .align 2, 0 .pool @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, =0x000040c2 ldr r4, =0x03005cf8 ldrh r1, [r4] bl var_set ldrh r0, [r4] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8139754 thumb_func_start sub_8139770 sub_8139770: ; 8139770 push {r4-r6,lr} ldr r6, =0x020375e0 ldrh r0, [r6] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec 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, =0x02021cc4 movs r1, 0x7 adds r2, r4, 0 bl pokemon_getattr ldr r0, =0x03005d90 ldr r0, [r0] adds r1, r4, 0 bl sub_8008C44 cmp r0, 0 beq @081397BC @081397A6: movs r0, 0x1 b @081397BE .align 2, 0 .pool @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, =0x020375f0 ldrh r1, [r2] ldr r0, =0x0000270f cmp r1, r0 bls @081397E0 movs r0, 0 bl sub_80EF340 b @08139862 .align 2, 0 .pool @081397E0: ldr r0, =0x000003e7 cmp r1, r0 bls @081397F8 ldr r4, =0x02021cc4 movs r0, 0xA1 strb r0, [r4] adds r4, 0x1 b @0813981C .align 2, 0 .pool @081397F8: cmp r1, 0x63 bls @0813980C ldr r4, =0x02021cc4 movs r0, 0xA1 strb r0, [r4] strb r0, [r4, 0x1] adds r4, 0x2 b @0813981C .align 2, 0 .pool @0813980C: cmp r1, 0x9 bls @0813983C ldr r4, =0x02021cc4 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 .pool @0813983C: ldr r4, =0x02021cc4 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 .pool thumb_func_end sub_81397C4 thumb_func_start sub_813986C sub_813986C: ; 813986C push {lr} ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0x4 bhi @081398B8 lsls r0, 2 ldr r1, =@08139888 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020375e0 ldr r2, =0xfffffedf 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 .pool @081398E0: ldr r4, =0x02021dc4 ldrh r0, [r1] bl sub_81B6CFC lsls r0, 16 lsrs r0, 16 movs r1, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 bl gf_strcpy movs r0, 0x1 @081398FC: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x020244ec adds r0, r1 movs r1, 0x4 bl pokemon_getattr cmp r0, 0x1 bne @08139938 movs r0, 0x1 b @08139944 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00000f1a cmp r1, r0 bne @08139978 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x2 bne @08139978 movs r0, 0x1 b @0813997A .align 2, 0 .pool @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, =0x03005d8c 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, =@081399B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00004043 bl var_set pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8139994 thumb_func_start sub_81399F4 sub_81399F4: ; 81399F4 push {r4,lr} ldr r2, =0x0203ab60 movs r0, 0 strh r0, [r2] ldr r1, =0x0203ab62 strh r0, [r1] ldr r0, =0x03005d8c 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, =@08139A34 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_8139AF4 movs r1, 0x9 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r4, r1, r0 movs r3, 0 strh r3, [r4, 0x2] strh r3, [r4, 0x4] movs r6, 0x1 strh r6, [r4, 0x8] ldr r0, =0x020375e2 ldr r1, =0x020375e4 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 .pool @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, =gUnknown_085B2C18 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 .pool 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, =0x03005e08 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 .pool 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, =0x0203ab5e ldr r0, =gUnknown_085B2BAC bl Window_AddFromTemplate strb r0, [r5] ldrb r0, [r5] movs r1, 0 bl SetStandardWindowBorderStyle ldr r4, =gUnknown_085EB6A5 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, =gUnknown_085B2BB4 ldr r4, =0x020375e2 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 .pool thumb_func_end sub_8139B60 thumb_func_start sub_8139C10 sub_8139C10: ; 8139C10 push {r4,lr} ldr r4, =0x0203ab5e ldrb r0, [r4] movs r1, 0x1 bl sub_8198070 ldrb r0, [r4] bl Window_Remove pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8139C80 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, =0x03005e00 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, =gUnknown_085B2C21 adds r0, r6, r0 ldrb r0, [r0] strh r0, [r1, 0xE] @08139C6C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =gUnknown_085B2BF4 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 .pool @08139D10: movs r1, 0 ldr r0, =gUnknown_085B2C06 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 .pool thumb_func_end sub_8139C80 thumb_func_start sub_8139D98 sub_8139D98: ; 8139D98 push {r4-r7,lr} sub sp, 0x18 ldr r6, =0x020375e0 ldrh r0, [r6] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec 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, =0x020375e2 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, =0x020375e4 movs r0, 0 strh r0, [r2] ldr r1, =0x020375e6 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 .pool @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, =0x020322dc 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, =gUnknown_085B2C2A ldrh r0, [r2] ldr r1, =0x0000ffff 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 .pool @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, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00003c1a cmp r1, r0 beq @08139EEC movs r0, 0x1 b @08139EEE .align 2, 0 .pool @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, =0x0000402f 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 .pool thumb_func_end sub_8139EF4 thumb_func_start sub_8139F20 sub_8139F20: ; 8139F20 push {r4-r7,lr} movs r4, 0 ldr r0, =0x0000402f bl var_get lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0x9 bls @08139F34 b @0813A03A @08139F34: lsls r0, r6, 2 ldr r1, =@08139F48 adds r1, r0, r1 ldr r1, [r1] adds r2, r0, 0 mov pc, r1 .align 2, 0 .pool .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, =0x03005d90 ldr r0, [r0] movs r3, 0xCE lsls r3, 4 adds r1, r0, r3 adds r3, r1, r2 ldr r1, =0x00000ce2 adds r0, r1 adds r1, r0, r2 ldrh r0, [r3] ldrh r2, [r1] cmp r0, r2 bcs @0813A028 b @0813A038 .align 2, 0 .pool @08139F94: ldr r0, =0x03005d90 ldr r0, [r0] ldr r3, =0x00000d0c 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 .pool @08139FB4: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000de2 adds r2, r0, r1 ldr r3, =0x00000de4 b @08139F9E .align 2, 0 .pool @08139FCC: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000dc8 adds r2, r0, r1 ldr r3, =0x00000dca b @08139F9E .align 2, 0 .pool @08139FE4: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000dda adds r2, r0, r1 ldr r3, =0x00000ddc b @08139F9E .align 2, 0 .pool @08139FFC: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e04 adds r2, r0, r1 ldr r3, =0x00000e06 b @08139F9E .align 2, 0 .pool @0813A014: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e1a adds r2, r0, r1 ldr r3, =0x00000e1c 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 .pool @0813A038: ldrh r4, [r1] @0813A03A: movs r2, 0 ldr r5, =gUnknown_085B2CC8 lsls r0, r6, 1 adds r1, r0, r5 ldrb r1, [r1] adds r3, r0, 0 ldr r7, =gUnknown_085B2C50 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 .pool thumb_func_end sub_8139F20 thumb_func_start sub_813A080 sub_813A080: ; 813A080 push {r4-r7,lr} ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 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, =0x020375e2 movs r0, 0x5 strh r0, [r1] ldr r1, =0x020375e4 movs r0, 0x4 strh r0, [r1] b @0813A110 .align 2, 0 .pool @0813A0D0: movs r0, 0x4 strh r0, [r6] adds r0, r3, 0x5 b @0813A10E @0813A0D8: movs r3, 0 ldr r6, =0x020375e2 ldr r7, =0x020375e4 lsls r1, r4, 1 lsls r2, r5, 2 ldr r4, =gUnknown_085B2CDC ldr r0, =0x03005d90 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 .pool thumb_func_end sub_813A080 thumb_func_start sub_813A128 sub_813A128: ; 813A128 push {r4,lr} ldr r0, =sub_813A2DC movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e00 adds r3, r0, r1 ldr r1, =0x020375e0 ldrh r0, [r1] strh r0, [r3, 0x1E] ldrh r0, [r1] cmp r0, 0xC bls @0813A14E b @0813A2C6 @0813A14E: lsls r0, 2 ldr r1, =@0813A168 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020375f0 movs r0, 0x7F strh r0, [r1] adds r0, r4, 0 bl remove_task @0813A2D2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r6, r0, r1 bl script_env_2_enable ldr r0, =0x0203ab68 movs r5, 0 strh r5, [r0] ldr r1, =0x0203ab6c 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, =0x0203ab64 movs r1, 0xA ldrsh r0, [r6, r1] lsls r0, 3 bl malloc_and_clear str r0, [r4] ldr r0, =0x0203ab6a 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, =gUnknown_085B2CF0 @0813A33A: lsls r1, r4, 2 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 6 adds r1, r0 adds r1, r5 ldr r0, [r1] ldr r1, =0x0203ab64 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, =0x030061d0 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_813A4EC str r1, [r0] add sp, 0x20 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813A2DC thumb_func_start sub_813A42C sub_813A42C: ; 813A42C ldr r1, =0x030061d0 ldr r0, =0x0203ab64 ldr r0, [r0] str r0, [r1] ldr r0, =sub_813A46C 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 .pool 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, =sub_813A4EC 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, =0x03005e00 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, =0x0203ab68 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, =0x0203ab6a 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 .pool 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, =0x03005e00 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 .pool @0813A51C: ldr r1, =0x020375f0 movs r0, 0x7F strh r0, [r1] movs r0, 0x5 bl audio_play b @0813A54C .align 2, 0 .pool @0813A530: ldr r0, =0x020375f0 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 .pool @0813A558: adds r0, r5, 0 bl sub_813A738 ldr r0, =sub_813A600 str r0, [r6] bl script_env_2_enable_and_set_ctx_running @0813A566: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x0203ab64 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 .pool thumb_func_end sub_813A570 thumb_func_start sub_813A600 sub_813A600: ; 813A600 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0x14 ldrsh r0, [r1, r2] cmp r0, 0x1 beq @0813A624 cmp r0, 0x2 bne @0813A624 movs r0, 0x1 strh r0, [r1, 0x14] ldr r0, =sub_813A664 str r0, [r1] @0813A624: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813A600 thumb_func_start sub_813A630 sub_813A630: ; 813A630 push {lr} ldr r0, =sub_813A600 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 .pool @0813A64C: ldr r0, =0x03005e00 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_813A4EC str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r1, r0 mov r1, sp ldr r0, =gUnknown_085B3030 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, =0x0203ab68 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 .pool 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, =0x03005e00 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 .pool 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, =0x020229e8 ldr r0, =0x0000401f 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 .pool @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, =0x020375e0 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, =0x020244ec adds r0, r1 bl GetNature lsls r0, 24 ldr r1, =gUnknown_085B3040 lsrs r0, 22 adds r0, r1 ldr r0, [r0] bl box_related_two__2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x00004030 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 .pool thumb_func_end sub_813A7F4 thumb_func_start sub_813A820 sub_813A820: ; 813A820 push {r4,lr} ldr r0, =0x00004030 bl var_get adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldr r1, =gUnknown_085B30A4 lsls r0, r4, 2 adds r0, r1 ldr r0, [r0] bl box_related_two__2 ldr r0, =0x00004031 adds r1, r4, 0 bl var_set pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813A820 thumb_func_start sub_813A854 sub_813A854: ; 813A854 push {r4,lr} ldr r4, =gUnknown_085B30D4 ldr r0, =0x00004031 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 .pool 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, =0x000040ce bl var_get lsls r0, 16 lsrs r7, r0, 16 ldr r0, =0x00004031 bl var_get lsls r0, 16 lsrs r6, r0, 16 ldr r0, =0x000040cf bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r4, =0x00004033 adds r0, r4, 0 bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bne @0813A8F0 ldr r1, =gUnknown_085B3104 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 .pool @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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000eb8 adds r0, r1 ldrh r1, [r0] add r0, sp, 0xC movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r1, =gUnknown_085EB6AD bl gf_strcpy movs r0, 0x1 add r1, sp, 0xC movs r2, 0x30 bl sub_81DB368 adds r3, r0, 0 ldr r0, =0x0203ab6d 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 .pool thumb_func_end sub_813A8FC thumb_func_start sub_813A958 sub_813A958: ; 813A958 push {r4,lr} ldr r4, =0x0203ab6d ldr r0, =gUnknown_085B311C 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 .pool thumb_func_end sub_813A958 thumb_func_start sub_813A988 sub_813A988: ; 813A988 push {r4,lr} ldr r4, =0x0203ab6d ldrb r0, [r4] movs r1, 0x1 bl sub_8198070 ldrb r0, [r4] bl Window_Remove pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813A988 thumb_func_start sub_813A9A4 sub_813A9A4: ; 813A9A4 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000eb8 adds r1, r0, r2 ldr r0, =0x020375e0 ldrh r2, [r1] ldrh r0, [r0] cmp r2, r0 bcs @0813A9C8 movs r0, 0 b @0813A9CA .align 2, 0 .pool @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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000eb8 adds r2, r0, r1 ldrh r1, [r2] ldr r0, =0x020375e0 ldrh r0, [r0] adds r1, r0 ldr r0, =0x0000270f cmp r1, r0 ble @0813A9FC strh r0, [r2] b @0813A9FE .align 2, 0 .pool @0813A9FC: strh r1, [r2] @0813A9FE: pop {r0} bx r0 thumb_func_end sub_813A9D0 thumb_func_start sub_813AA04 sub_813AA04: ; 813AA04 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000eb8 adds r0, r1 ldrh r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_813AA04 thumb_func_start sub_813AA18 sub_813AA18: ; 813AA18 push {r4,lr} ldr r4, =0x0203ab6e ldr r0, =gUnknown_085B3124 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 .pool thumb_func_end sub_813AA18 thumb_func_start sub_813AA44 sub_813AA44: ; 813AA44 push {r4,lr} ldr r4, =0x0203ab6e ldrb r0, [r4] movs r1, 0x1 bl sub_8198070 ldrb r0, [r4] bl Window_Remove pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0xfffd0000 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 .pool @0813AAA0: cmp r4, 0x5 beq @0813AB5C cmp r4, 0x6 beq @0813AB94 b @0813ABC2 @0813AAAA: ldr r1, =gUnknown_085B3170 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, =gUnknown_085B312C lsls r0, r5, 1 adds r1, r0, r1 ldrh r5, [r1] ldr r0, =0x0000ffff cmp r5, r0 beq @0813AB18 b @0813AB2C .align 2, 0 .pool @0813AAE8: ldr r1, =gUnknown_085B319C 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, =gUnknown_085B3142 lsls r0, r5, 1 adds r1, r0, r1 ldrh r5, [r1] ldr r0, =0x0000ffff cmp r5, r0 bne @0813AB2C @0813AB18: ldrh r0, [r1] bl sub_813ABD4 b @0813ABC2 .align 2, 0 .pool @0813AB2C: ldr r4, =0x0000157c 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, =0x0203ab6c strb r0, [r1] b @0813ABC2 .align 2, 0 .pool @0813AB5C: ldr r1, =gUnknown_085B31B4 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, =gUnknown_085B314E lsls r0, r5, 1 adds r0, r1 ldrh r0, [r0] bl sub_813ABD4 b @0813ABC2 .align 2, 0 .pool @0813AB94: ldr r1, =gUnknown_085B31D0 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, =gUnknown_085B315C 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 .pool 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, =0x0000157c 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, =0x0203ab6c strb r0, [r4] lsls r0, 24 lsrs r0, 24 cmp r0, 0x40 beq @0813AC32 ldr r3, =0x02020630 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 .pool thumb_func_end sub_813ABD4 thumb_func_start sub_813AC44 sub_813AC44: ; 813AC44 push {lr} lsls r0, 16 lsrs r1, r0, 16 ldr r2, =0x0203ab6c 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, =0x02020630 adds r0, r1 bl obj_delete_and_free_resources @0813AC6A: ldr r1, =0x0203ab6c movs r0, 0x40 strb r0, [r1] @0813AC70: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813AC44 thumb_func_start sub_813AC7C sub_813AC7C: ; 813AC7C push {lr} ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0 beq @0813ACB8 ldr r0, =0x02021cc4 ldr r2, =gUnknown_085B320C ldr r1, =0x020375e0 ldrh r1, [r1] lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy b @0813ACD2 .align 2, 0 .pool @0813ACB8: ldr r0, =0x02021cc4 ldr r2, =gUnknown_085B31F8 ldr r1, =0x020375e0 ldrh r1, [r1] lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy @0813ACD2: pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375e4 ldrh r0, [r0] cmp r0, 0 bne @0813AD18 ldr r4, =0x0203ab5e ldr r0, =gUnknown_085B3220 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 .pool 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, =0x0203ab5e 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, =gUnknown_085B3254 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 .pool @0813AD90: ldrb r0, [r4] ldr r2, =gUnknown_085B3228 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 .pool thumb_func_end sub_813AD34 thumb_func_start sub_813ADB8 sub_813ADB8: ; 813ADB8 push {r4,lr} ldr r4, =0x0203ab5e ldrb r0, [r4] movs r1, 0x1 bl sub_8198070 ldrb r0, [r4] bl Window_Remove pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_813A600 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, =0x03005e00 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, =gUnknown_085B2CF0 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, =0x020375e0 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, =gUnknown_085E8B3A 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 .pool thumb_func_end sub_813ADD4 thumb_func_start sub_813AEB4 sub_813AEB4: ; 813AEB4 push {r4,lr} movs r1, 0 ldr r0, =0x020375e2 strh r1, [r0] ldr r0, =0x0000400e bl var_get adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldr r0, =0x0000400d bl var_get lsls r0, 16 lsrs r1, r0, 16 cmp r4, 0 beq @0813AF18 movs r2, 0 lsls r1, 1 ldr r3, =gUnknown_0861500C ldr r0, =gUnknown_085B320C 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 .pool @0813AF0C: ldr r0, =0x020375e2 strh r2, [r0] b @0813AF38 .align 2, 0 .pool @0813AF18: movs r2, 0 lsls r1, 1 ldr r3, =gUnknown_0861500C ldr r0, =gUnknown_085B31F8 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 .pool thumb_func_end sub_813AEB4 thumb_func_start sub_813AF48 sub_813AF48: ; 813AF48 push {r4,r5,lr} ldr r0, =sub_813A600 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, =0x03005e00 adds r4, r0 ldrh r0, [r4, 0x24] lsls r0, 24 lsrs r0, 24 movs r1, 0 movs r2, 0 bl sub_81AE6C8 ldr r0, =0x0203ab64 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 .pool thumb_func_end sub_813AF48 thumb_func_start sub_813AFC8 sub_813AFC8: ; 813AFC8 push {lr} ldr r0, =task_deoxys_sound movs r1, 0x8 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x000008d4 bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0813B004 ldr r1, =0x020375f0 movs r0, 0x3 b @0813B06A .align 2, 0 .pool @0813B004: ldr r0, =0x00004035 mov r8, r0 bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r4, =0x00004034 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, =gUnknown_085B33F6 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, =0x020375f0 movs r0, 0 strh r0, [r1] b @0813B070 .align 2, 0 .pool @0813B05C: cmp r5, 0xA bne @0813B080 ldr r0, =0x000008d4 bl flag_set ldr r1, =0x020375f0 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 .pool @0813B080: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 lsls r0, r5, 24 lsrs r0, 24 bl sub_813B0B4 ldr r0, =0x00004035 adds r1, r5, 0 bl var_set ldr r1, =0x020375f0 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 .pool 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, =gUnknown_085B3280 adds r0, r1 movs r1, 0xD0 lsls r1, 1 movs r2, 0x8 bl gpu_pal_apply ldr r0, =0x03005d8c 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 .pool @0813B0F0: movs r0, 0x82 lsls r0, 1 bl audio_play @0813B0F8: ldr r0, =sub_813B160 movs r1, 0x8 bl AddTask ldr r3, =0x02038c08 movs r0, 0x1 str r0, [r3] movs r0, 0x3A str r0, [r3, 0x4] movs r0, 0x1A str r0, [r3, 0x8] ldr r0, =gUnknown_085B33E0 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 .pool @0813B138: movs r0, 0x5 @0813B13A: str r0, [r3, 0x14] movs r0, 0x42 bl oe_exec ldr r0, =gUnknown_085B33E0 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 .pool 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, =0x00004034 adds r0, r4, 0 bl var_get lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x00003a1a 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 .pool @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, =0x00004035 bl var_get lsls r0, 24 lsrs r0, 19 ldr r1, =gUnknown_085B3280 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 .pool thumb_func_end sub_813B1D0 thumb_func_start set_unknown_box_id ; void set_unknown_box_id(char id) set_unknown_box_id: ; 813B204 ldr r1, =0x0203ab6f strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end set_unknown_box_id thumb_func_start get_unknown_box_id get_unknown_box_id: ; 813B210 ldr r0, =0x0203ab6f ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end get_unknown_box_id thumb_func_start sub_813B21C sub_813B21C: ; 813B21C push {r4,r5,lr} ldr r5, =0x000008d7 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, =0x00004036 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 .pool @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, =0x00004036 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, =0x000008d7 bl flag_clear @0813B2A6: ldr r0, =0x00004036 lsrs r1, r7, 16 bl var_set bl sub_813B21C lsls r0, 24 lsrs r0, 24 b @0813B2DC .align 2, 0 .pool @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, =0x00004038 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, =0x000001bf bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0813B330 ldr r0, =0x00004037 movs r1, 0x7 ands r4, r1 adds r1, r4, 0 adds r1, 0x9 bl var_set b @0813B36A .align 2, 0 .pool @0813B330: movs r0, 0x1 ands r4, r0 cmp r4, 0 bne @0813B354 bl GenerateRandomNumber lsls r0, 16 lsrs r4, r0, 16 @0813B340: ldr r0, =0x00004037 movs r1, 0x7 ands r4, r1 adds r1, r4, 0x1 bl var_set b @0813B36A .align 2, 0 .pool @0813B354: bl GenerateRandomNumber lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x00004037 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 .pool thumb_func_end sub_813B2E4 thumb_func_start sub_813B374 sub_813B374: ; 813B374 push {r4,lr} ldr r0, =0x00004037 bl var_get adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldr r0, =0x02021cc4 ldr r2, =gUnknown_085B3400 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 .pool @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, =0x00004038 adds r0, r5, 0 bl var_get lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x00004037 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, =0x000003e7 cmp r4, r0 bls @0813B474 adds r0, r5, 0 movs r1, 0 bl var_set ldr r0, =0x03005d8c 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, =0x00004039 movs r1, 0x1 b @0813B478 .align 2, 0 .pool @0813B414: ldr r0, =0x03005d8c 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, =0x00004039 movs r1, 0x1 b @0813B478 .align 2, 0 .pool @0813B444: ldr r3, [r3] movs r2, 0x5 ldrsb r2, [r3, r2] ldr r1, =gUnknown_085B3410 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 .pool @0813B468: ldr r0, =0x00004037 movs r1, 0 b @0813B478 .align 2, 0 .pool @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, =0x03005d8c ldr r4, [r0] movs r6, 0x4 ldrsb r6, [r4, r6] ldr r5, =gUnknown_085B3420 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 .pool @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, =0x020375e0 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 .pool @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, =0x0000403f bl var_get lsls r0, 16 cmp r0, 0 beq @0813B52C movs r0, 0x1 b @0813B52E .align 2, 0 .pool @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, =0x0203ab70 ldr r1, =0x02022fec ldr r0, [r1] str r0, [r2] movs r0, 0 str r0, [r1] ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @0813B552 ldr r0, =sub_80B3AF8 movs r1, 0x5 bl AddTask @0813B552: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813B534 thumb_func_start sub_813B568 sub_813B568: ; 813B568 push {lr} ldr r0, =sub_813B57C movs r1, 0x5 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@0813B5A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_80B3AF8 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @0813B5DE b @0813B7C6 @0813B5DE: b @0813B790 .align 2, 0 .pool @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, =0x020375e0 movs r2, 0x2 bl link_0800A448 b @0813B708 .align 2, 0 .pool @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, =0x020375e2 ldr r0, =0x020223c4 movs r1, 0x80 lsls r1, 1 adds r0, r1 ldrh r0, [r0] strh r0, [r5] movs r0, 0x1 bl sub_800A5EC ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0x1 bne @0813B668 ldrh r1, [r5] cmp r1, 0x1 bne @0813B668 ldr r0, =0x020375f0 strh r1, [r0] b @0813B790 .align 2, 0 .pool @0813B668: ldr r0, =0x020375e0 ldrh r1, [r0] adds r2, r0, 0 cmp r1, 0 bne @0813B68C ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x1 bne @0813B68C ldr r1, =0x020375f0 movs r0, 0x2 b @0813B6AC .align 2, 0 .pool @0813B68C: ldrh r0, [r2] cmp r0, 0x1 bne @0813B6A8 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0 bne @0813B6A8 ldr r1, =0x020375f0 movs r0, 0x3 b @0813B6AC .align 2, 0 .pool @0813B6A8: ldr r1, =0x020375f0 movs r0, 0 @0813B6AC: strh r0, [r1] b @0813B790 .align 2, 0 .pool @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, =0x020375f0 movs r2, 0x2 bl link_0800A448 b @0813B708 .align 2, 0 .pool @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, =0x020375f0 ldr r0, =0x020223c4 ldrh r0, [r0] strh r0, [r1] movs r0, 0 bl sub_800A5EC @0813B708: ldr r1, =0x03005e00 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 .pool @0813B728: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @0813B74C ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0x2 bne @0813B790 ldr r0, =gUnknown_0824979B bl box_related_two__3 b @0813B790 .align 2, 0 .pool @0813B74C: ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0x3 bne @0813B790 ldr r0, =gUnknown_0824979B bl box_related_two__3 b @0813B790 .align 2, 0 .pool @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, =0x03005e00 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 .pool @0813B7A8: ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @0813B7B4 bl sub_800AC34 @0813B7B4: ldr r0, =0x02022fec ldr r1, =0x0203ab70 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 .pool thumb_func_end sub_813B57C thumb_func_start sub_813B7D8 sub_813B7D8: ; 813B7D8 push {lr} ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0 bne @0813B7F8 ldr r2, =c2_exit_to_overworld_1_continue_scripts_restart_music movs r0, 0 movs r1, 0x1 bl sub_81D6720 b @0813B802 .align 2, 0 .pool @0813B7F8: ldr r2, =c2_exit_to_overworld_1_continue_scripts_restart_music movs r0, 0x1 movs r1, 0 bl sub_81D6720 @0813B802: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813B7D8 thumb_func_start sub_813B80C sub_813B80C: ; 813B80C push {lr} ldr r0, =sub_813B824 movs r1, 0x8 bl AddTask movs r0, 0x9D bl audio_play pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] movs r0, 0x2 ldrsh r1, [r4, r0] ldr r0, =0x020375e2 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, =0x020375e0 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 .pool thumb_func_end sub_813B824 thumb_func_start sub_813B880 sub_813B880: ; 813B880 push {lr} ldr r0, =_fwalk movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 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 .pool 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, =0x03005e08 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, =0x03005d8c 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, =0x00000201 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 .pool thumb_func_end _fwalk thumb_func_start sub_813B968 sub_813B968: ; 813B968 push {r4,r5,lr} ldr r5, =0x020375f0 ldr r0, =0x020375e0 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 .pool thumb_func_end sub_813B968 thumb_func_start sub_813B9A0 sub_813B9A0: ; 813B9A0 push {lr} ldr r0, =0x03005d8c 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 .pool thumb_func_end sub_813B9A0 thumb_func_start sub_813B9C0 sub_813B9C0: ; 813B9C0 push {r4,lr} ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x4 ldrsb r1, [r0, r1] lsls r1, 8 ldrb r0, [r0, 0x5] lsls r0, 24 asrs r0, 24 adds r0, r1 lsls r0, 16 lsrs r3, r0, 16 ldr r2, =gUnknown_085B3444 ldrh r0, [r2] ldr r1, =0x0000ffff 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 .pool @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, =0x03005d8c ldr r0, [r0] ldr r2, =0x0000141e 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 .pool 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, =0x03005d8c ldr r1, [r0] ldr r0, =0x03005d90 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 .pool thumb_func_end sub_813BA30 thumb_func_start sub_813BA60 sub_813BA60: ; 813BA60 push {r4,lr} ldr r4, =0x03005d8c ldr r0, [r4] ldr r1, =0x0000141e 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, =0x03005d90 ldr r0, [r0] ldrh r0, [r0, 0xE] movs r2, 0xA1 lsls r2, 5 adds r1, r2 strh r0, [r1] ldr r0, =0x00000315 bl flag_clear ldr r0, =0x00000316 bl flag_clear ldr r0, =0x00000317 bl flag_clear movs r0, 0xC6 lsls r0, 2 bl flag_clear ldr r0, =0x000002da bl flag_clear ldr r0, =0x00004095 movs r1, 0x1 bl var_set @0813BAB6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00004095 bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x2 bne @0813BB58 ldr r4, =0x03005d8c ldr r0, [r4] ldr r5, =0x0000141e adds r3, r0, r5 ldrh r2, [r3] movs r1, 0x7F ands r1, r2 ldr r0, =gUnknown_085B3470 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, =0x0000ff80 ands r1, r2 strh r1, [r0] b @0813BB58 .align 2, 0 .pool @0813BB3C: ldr r2, [r4] adds r2, r5 ldrh r1, [r2] ldr r0, =0x0000ff80 ands r0, r1 movs r1, 0x14 orrs r0, r1 strh r0, [r2] b @0813BB58 .align 2, 0 .pool @0813BB54: adds r0, r2, r0 strh r0, [r3] @0813BB58: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000141e adds r0, r1 ldrb r1, [r0] movs r0, 0x7F ands r0, r1 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d8c ldr r2, =0x0000141e movs r6, 0x1 @0813BB82: ldr r0, [r7] adds r0, r2 ldrh r1, [r0] ldr r0, =gUnknown_085B3474 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 .pool @0813BBC8: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x7 bls @0813BB82 ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, =0x0000141e adds r2, r0 ldr r1, =gUnknown_085B3474 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 .pool 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, =0x03005d8c mov r8, r2 ldr r0, =0x0000141e mov r9, r0 movs r4, 0x1 @0813BC3A: mov r1, r8 ldr r0, [r1] add r0, r9 ldrh r1, [r0] ldr r7, =gUnknown_085B347C 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, =0x03005d8c ldr r0, [r0] ldr r2, =0x0000141e 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 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000141e 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 .pool thumb_func_end sub_813BCA8 thumb_func_start sub_813BCE8 sub_813BCE8: ; 813BCE8 push {r4-r6,lr} movs r5, 0 ldr r2, =0x03005d90 ldr r0, [r2] ldrh r1, [r0, 0xE] ldr r0, =0x000003e6 cmp r1, r0 bhi @0813BD58 adds r6, r2, 0 b @0813BD32 .align 2, 0 .pool @0813BD04: ldr r0, [r6] ldrh r1, [r0, 0xE] ldr r4, =0x03005d8c 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, =0x03005d8c 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 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000141e adds r0, r1 ldrh r0, [r0] ldr r1, =0x020375e0 ldrh r1, [r1] asrs r0, r1 movs r1, 0x1 ands r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_813BD60 thumb_func_start sub_813BD84 sub_813BD84: ; 813BD84 ldr r0, =0x03005d8c ldr r2, [r0] ldr r0, =0x0000141e 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 .pool thumb_func_end sub_813BD84 thumb_func_start sub_813BDB4 sub_813BDB4: ; 813BDB4 push {lr} movs r3, 0 movs r2, 0 ldr r0, =0x020375e0 ldrh r0, [r0] subs r0, 0x8 cmp r0, 0x7 bhi @0813BE14 lsls r0, 2 ldr r1, =@0813BDD8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003150 adds r0, r1 adds r1, r3, 0 bl sub_813BE30 pop {r0} bx r0 .align 2, 0 .pool 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, =@0813BE58 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0813BE58: .4byte @0813BED4 .4byte @0813BE70 .4byte @0813BE84 .4byte @0813BE98 .4byte @0813BEAC .4byte @0813BEC0 @0813BE70: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD14 bl gf_strcpy b @0813BF04 .align 2, 0 .pool @0813BE84: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD1B bl gf_strcpy b @0813BF04 .align 2, 0 .pool @0813BE98: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD22 bl gf_strcpy b @0813BF04 .align 2, 0 .pool @0813BEAC: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD29 bl gf_strcpy b @0813BF04 .align 2, 0 .pool @0813BEC0: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD30 bl gf_strcpy b @0813BF04 .align 2, 0 .pool @0813BED4: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EAD0C bl gf_strcpy b @0813BF04 .align 2, 0 .pool @0813BEE8: ldr r4, =0x02021cc4 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 .pool thumb_func_end sub_813BE30 thumb_func_start sub_813BF10 sub_813BF10: ; 813BF10 push {lr} ldr r0, =0x00004095 bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x2 bne @0813BF40 bl sub_813BA30 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0x1 bne @0813BF3C bl sub_813BB74 b @0813BF40 .align 2, 0 .pool @0813BF3C: bl sub_813BC00 @0813BF40: pop {r0} bx r0 thumb_func_end sub_813BF10 thumb_func_start sub_813BF44 sub_813BF44: ; 813BF44 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x0000141e adds r0, r1 ldrh r0, [r0] lsrs r0, 7 movs r1, 0x1 ands r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_813BF44 thumb_func_start sub_813BF60 sub_813BF60: ; 813BF60 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x0000141e adds r1, r0 ldrh r2, [r1] movs r0, 0x80 orrs r0, r2 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_813BF60 thumb_func_start sub_813BF7C sub_813BF7C: ; 813BF7C push {lr} ldr r0, =0x020375e0 ldrb r0, [r0] bl sub_813BADC lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x01000008 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 .pool 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, =0x0000270f cmp r0, r1 bls @0813C12A strh r1, [r2, 0xA] b @0813C12A .align 2, 0 .pool @0813C100: ldrh r0, [r2, 0xC] adds r0, 0x1 strh r0, [r2, 0xC] lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000270f cmp r0, r1 bls @0813C12A strh r1, [r2, 0xC] b @0813C12A .align 2, 0 .pool @0813C118: ldrh r0, [r2, 0xE] adds r0, 0x1 strh r0, [r2, 0xE] lsls r0, 16 lsrs r0, 16 ldr r1, =0x0000270f cmp r0, r1 bls @0813C12A strh r1, [r2, 0xE] @0813C12A: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000270e cmp r0, r1 bhi @0813C166 adds r0, r4, 0 bl sav12_xor_increment @0813C166: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020229e8 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 .pool thumb_func_end sub_813C170 thumb_func_start sub_813C1F8 sub_813C1F8: ; 813C1F8 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003150 adds r0, r1 bl sub_813BFC4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813C1F8 thumb_func_start sub_813C214 sub_813C214: ; 813C214 push {lr} movs r1, 0x64 muls r1, r0 ldr r0, =0x02039b6c adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] lsls r0, 16 lsrs r0, 16 ldr r2, =0x0000270f cmp r0, r2 bls @0813C230 strh r2, [r1] @0813C230: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813C214 thumb_func_start sub_813C23C sub_813C23C: ; 813C23C push {lr} movs r1, 0x64 muls r1, r0 ldr r0, =0x02039b6e adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] lsls r0, 16 lsrs r0, 16 ldr r2, =0x0000270f cmp r0, r2 bls @0813C258 strh r2, [r1] @0813C258: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813C23C thumb_func_start sub_813C264 sub_813C264: ; 813C264 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0x1 beq @0813C27C cmp r0, 0x2 beq @0813C28A b @0813C298 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003150 adds r0, r1 movs r1, 0x64 adds r3, r4, 0 muls r3, r1 ldr r2, =0x02039b88 adds r1, r3, r2 subs r2, 0x30 adds r3, r2 ldrh r2, [r3, 0xE] ldr r3, =0x0202433a 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 .pool thumb_func_end sub_813C2A0 thumb_func_start sub_813C2F4 sub_813C2F4: ; 813C2F4 push {r4,lr} sub sp, 0xC ldr r4, =0x02021cc4 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, =0x02021dc4 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, =0x02021ec4 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, =0x02021fc4 ldr r1, =gUnknown_085EF6A1 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, =0x0203ab74 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 .pool 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, =0x0203ab74 mov r8, r0 ldrb r0, [r0] ldr r2, =gUnknown_085B3D84 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, =gUnknown_085B3D8C 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 .pool @0813C40C: ldr r0, =0x02021cc4 movs r1, 0x8 bl sub_800917C ldr r0, =0x02021cc4 adds r1, r6, 0 movs r2, 0x7 bl gf_strncpy lsls r1, r5, 24 lsrs r1, 24 ldr r0, =0x02021cc4 bl sub_8009308 ldr r0, =0x0203ab74 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, =0x02021cc4 movs r3, 0x8 bl Print ldrh r1, [r6, 0xA] ldr r0, =0x02021cc4 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, =0x02021cc4 movs r3, 0x50 bl Print ldrh r1, [r6, 0xC] ldr r0, =0x02021cc4 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, =0x02021cc4 movs r3, 0x80 bl Print ldrh r1, [r6, 0xE] ldr r0, =0x02021cc4 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, =0x02021cc4 movs r3, 0xB0 bl Print @0813C4A8: add sp, 0xC pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab74 ldr r0, =gUnknown_085B3D7C 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, =0x02021fc4 ldr r1, =gUnknown_085EF68D 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, =0x03005d8c mov r8, r0 ldr r0, [r0] ldr r1, =0x00003150 mov r9, r1 add r0, r9 bl sub_813C2F4 ldr r1, =gUnknown_085EF6BD 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, =0x000031a0 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, =0x0203ab74 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 .pool thumb_func_end sub_813C4BC thumb_func_start sub_813C5A0 sub_813C5A0: ; 813C5A0 push {r4,lr} ldr r4, =0x0203ab74 ldrb r0, [r4] movs r1, 0 bl sub_819746C ldrb r0, [r4] bl Window_Remove pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813C5A0 thumb_func_start sub_813C5BC sub_813C5BC: ; 813C5BC push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0813C5DC ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_813C5EC str r0, [r1] @0813C5DC: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r1, r0 ldr r0, =0x030022c0 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, =sub_813C62C str r0, [r4] @0813C61A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_813C664 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0813C694 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 ldr r0, =0x0203ab78 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 .pool 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, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 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, =0x040000d4 mov r1, r8 str r1, [r2] str r0, [r2, 0x4] lsrs r0, r3, 2 movs r1, 0x85 lsls r1, 24 orrs r0, r1 str r0, [r2, 0x8] ldr r0, [r2, 0x8] movs r1, 0xA0 lsls r1, 19 mov r0, sp strh r4, [r0] str r0, [r2] str r1, [r2, 0x4] lsrs r3, 1 movs r0, 0x81 lsls r0, 24 orrs r3, r0 str r3, [r2, 0x8] ldr r0, [r2, 0x8] movs r0, 0 movs r1, 0 bl 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 .pool 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, =gUnknown_085B3484 adds r0, r4, 0 movs r2, 0xC0 movs r3, 0 bl gpu_copy_bg_tile_pattern_data_to_vram ldr r1, =gUnknown_085B3564 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, =gUnknown_085B3544 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_813C91C bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813C904 thumb_func_start sub_813C91C sub_813C91C: ; 813C91C push {r4,lr} sub sp, 0x4 ldr r0, =0x030022c0 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, =@0813C944 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203ab78 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, =gUnknown_085B3D64 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 .pool @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, =gUnknown_085B3D6C bl Window_InitFromTemplates bl TextBox_ResetSomeField b @0813CA00 .align 2, 0 .pool @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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0813CA3C .align 2, 0 .pool @0813CA14: bl sub_813C880 ldr r0, =sub_813C8D8 bl SetVBlankCallback bl sub_81D5C8C ldr r0, =sub_813C5BC movs r1, 0x8 bl AddTask ldr r0, =sub_813C8EC bl set_callback2 ldr r0, =0x030022c0 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 .pool thumb_func_end sub_813C91C thumb_func_start sub_813CA54 sub_813CA54: ; 813CA54 ldr r0, =0x0203ab7c ldr r0, [r0] movs r1, 0x8A lsls r1, 1 adds r0, r1 movs r1, 0 strh r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_813CA54 thumb_func_start sub_813CA68 sub_813CA68: ; 813CA68 push {lr} sub sp, 0x4 ldr r0, =0x0203ab7c 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, =@0813CA90 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0813CA90: .4byte @0813CAA4 .4byte @0813CAB4 .4byte @0813CABA .4byte @0813CAEC .4byte @0813CB10 @0813CAA4: ldr r0, =0x0203ab7c ldr r0, [r0] ldrh r0, [r0, 0xE] bl sub_813CB40 b @0813CB24 .align 2, 0 .pool @0813CAB4: bl sub_813CF0C b @0813CB24 @0813CABA: ldr r1, =gUnknown_085B3DB4 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, =0x0203ab7c 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 .pool @0813CAEC: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @0813CB34 ldr r0, =gUnknown_085B3D94 ldr r1, =0x02037854 ldr r2, =0x04000008 bl CpuSet b @0813CB24 .align 2, 0 .pool @0813CB10: ldr r1, =0xfffff800 movs r0, 0x2 movs r2, 0 bl bg_change_y_offset b @0813CB24 .align 2, 0 .pool @0813CB20: movs r0, 0 b @0813CB36 @0813CB24: ldr r0, =0x0203ab7c 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 .pool 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, =0x0203ab7c ldr r0, [r5] ldr r1, =0x000006e2 adds r0, r1 movs r4, 0 strh r4, [r0] ldr r0, =0x0000403e bl var_get ldr r1, [r5] ldr r2, =0x000006e4 adds r1, r2 strh r0, [r1] lsls r0, 16 lsrs r0, 16 cmp r0, 0x8 bls @0813CB70 strh r4, [r1] @0813CB70: ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x000031dc 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, =gUnknown_085B3EE8 @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, =gUnknown_085B3EF0 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 .pool @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, =gUnknown_085B3EF0 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, =gWildMonHeaders 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 .pool @0813CC7C: cmp r0, 0x1A beq @0813CC8C b @0813CC9C @0813CC82: ldrb r1, [r5, 0x1] movs r0, 0 bl sub_813CD04 b @0813CC9C @0813CC8C: ldr r0, =gWildMonHeaders 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, =gWildMonHeaders 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 .pool @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, =0x0203ab7c 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 .pool 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, =0x0203ab7c 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, =gUnknown_085B3EEA @0813CD96: ldrh r4, [r0] cmp r5, r4 beq @0813CE22 adds r0, 0x2 adds r3, 0x1 cmp r3, 0x2 bls @0813CD96 ldr r1, =gUnknown_085B3EFC 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, =0x0203ab7c 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 .pool 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, =0x0203ab7c ldr r2, [r0] ldr r0, =0x000006e2 adds r1, r2, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] ldrh r1, [r1] ldr r0, =0x000006e4 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 .pool @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, =0x0203ab7c adds r7, r2, 0 movs r6, 0x8B lsls r6, 1 movs r5, 0 ldr r3, =0x0000027f @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, =0x0000ffff 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, =0x0203ab7c mov r12, r7 movs r7, 0x8B lsls r7, 1 ldr r3, =0x0000ffff @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, =0x0203ab7c movs r5, 0x8B lsls r5, 1 ldr r7, =0x0000ffff mov r12, r7 movs r0, 0xA0 lsls r0, 8 mov r9, r0 ldr r7, =0x0000a010 ldr r1, =0x0000ffcf 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 .pool @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, =0x0000ff3f 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, =0x0000ffaf 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, =0x0000ff5f ands r0, r1 strh r0, [r2] @0813D184: ldr r1, [r6] adds r1, r5 adds r1, r3 ldr r2, =gUnknown_085B3F18 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, =0x0000027f 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 .pool thumb_func_end sub_813CF0C thumb_func_start sub_813D1C8 sub_813D1C8: ; 813D1C8 push {lr} ldr r1, =0x0203ab7c 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, =0x0000061e adds r1, r2, r0 movs r0, 0x1 strb r0, [r1] b @0813D206 .align 2, 0 .pool @0813D1FC: ldr r0, [r3] ldr r1, =0x0000061e adds r0, r1 movs r1, 0 strb r1, [r0] @0813D206: ldr r1, [r3] ldr r2, =0x00000616 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, =0x0000061c adds r2, r1, r0 movs r0, 0x40 strh r0, [r2] ldr r2, =0x0000061f adds r1, r2 movs r0, 0x1 strb r0, [r1] ldr r1, =0x00003f44 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 .pool thumb_func_end sub_813D1C8 thumb_func_start sub_813D25C sub_813D25C: ; 813D25C push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x0203ab7c ldr r2, [r0] ldr r3, =0x0000061e adds r1, r2, r3 ldrb r1, [r1] adds r7, r0, 0 cmp r1, 0 bne @0813D32A ldr r0, =0x00000616 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 .pool @0813D2A4: ldr r1, =0x0000061c adds r0, r2, r1 @0813D2A8: ldrh r1, [r0] adds r1, 0x4 movs r2, 0x7F ands r1, r2 strh r1, [r0] ldr r3, =gUnknown_08329F40 ldr r1, [r7] ldr r2, =0x0000061a 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, =0x0000061c 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, =0x00000616 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, =0x0000061e adds r1, r3 movs r0, 0x1 b @0813D3C4 .align 2, 0 .pool @0813D324: subs r0, 0x1 strh r0, [r1] b @0813D3C6 @0813D32A: ldr r0, =0x00000616 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, =0x0000061f 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, =0x0000061f 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, =0x0000061f 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 .pool 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, =0x0203ab7c ldr r0, =0x000015bc 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, =sub_813D42C movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r5, [r1, 0x8] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@0813D45C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085B4018 bl sub_81C4D70 ldr r0, =0x0203ab7c ldr r0, [r0] movs r1, 0xF7 lsls r1, 4 adds r0, r1 movs r1, 0 movs r2, 0x10 bl RepeatChar b @0813D584 .align 2, 0 .pool @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, =0x0203ab7c ldr r0, [r0] ldr r2, =0x000006ec 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 .pool @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, =0x00003f41 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 .pool @0813D56C: lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r2 ldr r1, =sub_813D5A0 str r1, [r0] movs r1, 0 strh r1, [r0, 0x8] b @0813D594 .align 2, 0 .pool @0813D584: ldr r0, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool @0813D5CC: cmp r1, 0x2 beq @0813D640 cmp r1, 0x3 beq @0813D652 @0813D5D4: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 movs r0, 0 strh r0, [r1, 0x8] @0813D5E2: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0813D6A8 b @0813D698 .align 2, 0 .pool @0813D5F8: ldr r0, =0x030022c0 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 .pool @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, =0x03005d90 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 .pool @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, =0x02037fd4 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, =0x0203ab7c 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 .pool @0813D698: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @0813D6A8: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B401C bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_085B4024 bl gpu_pal_obj_alloc_tag_and_apply ldr r0, =0x03001204 movs r1, 0 strh r1, [r0] ldr r2, =0x03001200 strh r1, [r2] ldr r1, =0x0203ab7c ldr r0, [r1] movs r3, 0x89 lsls r3, 1 adds r0, r3 ldrh r0, [r0] cmp r0, 0 beq @0813D7D8 ldr r5, =0x03001202 mov r10, r1 adds r7, r2, 0 ldr r0, =0x030011fc mov r9, r0 ldr r6, =gRegionMapEntries ldr r1, =0x030011fe 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, =gUnknown_085B4034 movs r3, 0 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x40 beq @0813D7BE ldr r0, =0x02020630 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, =0x03001204 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, =0x0203ab7c ldr r0, [r0] ldr r1, =0x03001204 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 .pool 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, =0x0203ab7c 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, =0x0203ab7c 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 .pool thumb_func_end sub_813D824 thumb_func_start sub_813D8A8 sub_813D8A8: ; 813D8A8 push {lr} sub sp, 0x8 ldr r0, =0x0203ab7c ldr r1, [r0] ldr r0, =0x00000fbc adds r1, r0 str r1, [sp] ldr r0, =0x00030600 str r0, [sp, 0x4] ldr r0, =gUnknown_08DC4140 bl LZ77UnCompWram mov r0, sp bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_085B40EC bl gpu_pal_obj_alloc_tag_and_apply add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_813D8A8 thumb_func_start sub_813D8E8 sub_813D8E8: ; 813D8E8 push {r4-r6,lr} ldr r1, =0x0203ab7c 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 .pool @0813D920: movs r4, 0 ldr r5, =0x02020630 @0813D924: lsls r1, r4, 21 movs r6, 0xA0 lsls r6, 16 adds r1, r6 asrs r1, 16 ldr r0, =gUnknown_085B40FC 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, =0x000003ff adds r1, r6, 0 ands r0, r1 ldr r6, =0xfffffc00 adds r1, r6, 0 ands r2, r1 orrs r2, r0 strh r2, [r3, 0x4] ldr r0, =0x0203ab7c 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 .pool @0813D988: ldr r0, =0x0203ab7c 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 .pool 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, =0x03005e00 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 .pool @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, =0x02037fd4 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, =0x020244ec 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 .pool 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, =sub_813D9C0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0x8] strh r4, [r1, 0xC] strh r5, [r1, 0xE] strh r6, [r1, 0x1C] ldr r0, =sub_813D9B0 bl set_callback2 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x05006000 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, =0x02022e14 movs r2, 0 strh r2, [r0] ldr r0, =0x02022e16 strh r2, [r0] ldr r0, =0x02022e18 strh r2, [r0] ldr r0, =0x02022e1a strh r2, [r0] ldr r0, =0x02022e1c strh r2, [r0] ldr r0, =0x02022e1e strh r2, [r0] ldr r1, =0x02022e20 movs r2, 0x80 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] ldr r0, =0x02022e22 movs r1, 0 strh r1, [r0] ldr r1, =0x02022ff0 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, =0x0300301c movs r2, 0x4 strb r2, [r0] movs r0, 0x64 bl malloc_and_clear ldr r1, =0x0203ab80 str r0, [r1] bl init_uns_table_pokemon_copy adds r0, r4, 0 movs r1, 0x2 mov r2, sp bl pokemon_getattr ldr r0, =0x02021cc4 mov r1, sp bl strcpy_limit_10_chars ldr r0, =0x02021dc4 movs r1, 0xB mov r2, r10 muls r2, r1 adds r1, r2, 0 ldr r2, =gSpeciesNames 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, =gMonFrontPicTable adds r0, r1 ldr r2, =0x020244d4 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, =0x0202499c mov r8, r0 ldr r1, =gUnknown_082EC6A8 str r1, [r0, 0x10] movs r1, 0x78 movs r2, 0x40 movs r3, 0x1E bl obj_add_from_template_forward_search ldr r1, =0x0203ab80 ldr r2, [r1] lsls r1, r0, 24 lsrs r3, r1, 24 strb r0, [r2] ldr r7, =0x02020630 lsls r1, r3, 4 adds r1, r3 lsls r1, 2 adds r6, r7, 0 adds r6, 0x1C adds r0, r1, r6 ldr r2, =nullsub_18 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, =gMonFrontPicTable adds r0, r2 ldr r2, =0x020244d4 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, =gUnknown_082EC6A8 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, =0x0203ab80 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, =nullsub_18 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, =sub_813E570 movs r1, 0 bl AddTask ldr r1, =0x0203ab80 ldr r2, [r1] lsls r1, r0, 24 lsrs r3, r1, 24 strb r0, [r2, 0x2] ldr r1, =0x03005e00 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, =0x0203ab80 ldr r0, [r1] ldr r1, =0x02037754 adds r0, 0x4 movs r2, 0x60 bl memcpy movs r1, 0xFA lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r0, =nullsub_83 bl SetHBlankCallback ldr r0, =sub_813FCDC bl SetVBlankCallback bl m4aMPlayAllStop ldr r0, =sub_813E3A4 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 .pool 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, =0x03005e00 ldr r0, =0x0203ab80 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, =0x020244ec 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, =0x05006000 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, =0x02022e14 strh r4, [r0] ldr r0, =0x02022e16 strh r4, [r0] ldr r0, =0x02022e18 strh r4, [r0] ldr r0, =0x02022e1a strh r4, [r0] ldr r0, =0x02022e1c strh r4, [r0] ldr r0, =0x02022e1e strh r4, [r0] ldr r1, =0x02022e20 movs r2, 0x80 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] ldr r0, =0x02022e22 strh r4, [r0] ldr r1, =0x02022ff0 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, =0x0300301c movs r0, 0x4 strb r0, [r1] lsls r0, r5, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 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, =0x0202499c ldr r1, =gUnknown_082EC6A8 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, =0x02020630 lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r0, r3, 0 adds r0, 0x1C adds r0, r1, r0 ldr r2, =nullsub_18 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, =nullsub_83 bl SetHBlankCallback ldr r0, =sub_813FCDC bl SetVBlankCallback ldr r0, =sub_813E3A4 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 .pool thumb_func_end sub_813DD7C thumb_func_start sub_813DF70 sub_813DF70: ; 813DF70 push {r4-r6,lr} sub sp, 0xC ldr r2, =0x03005e00 ldr r0, =0x0203ab80 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, =0x020244ec adds r4, r2, r1 ldrh r6, [r0, 0xC] ldr r0, =0x030022c0 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, =@0813DFC0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0300301c movs r0, 0x4 strb r0, [r1] ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r0, =0x02022e18 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] ldr r0, =0x02022e1c strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] ldr r2, =0x02022e20 movs r3, 0x80 lsls r3, 1 adds r0, r3, 0 strh r0, [r2] ldr r0, =0x02022e22 strh r1, [r0] b @0813E180 .align 2, 0 .pool @0813E050: bl sub_80A1A74 ldr r0, =nullsub_83 bl SetHBlankCallback ldr r0, =sub_813FD64 bl SetVBlankCallback ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @0813E188 .align 2, 0 .pool @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, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @0813E188 .align 2, 0 .pool @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, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 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 .pool @0813E0F0: adds r0, r6, 0 movs r1, 0x1 bl sub_806A068 ldr r0, =0x0202499c ldr r1, =gUnknown_082EC6A8 str r1, [r0, 0x10] movs r1, 0x78 movs r2, 0x40 movs r3, 0x1E bl obj_add_from_template_forward_search ldr r1, =0x0203ab80 ldr r1, [r1] lsls r2, r0, 24 lsrs r2, 24 strb r0, [r1, 0x1] ldr r3, =0x02020630 lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r0, r3, 0 adds r0, 0x1C adds r0, r1, r0 ldr r2, =nullsub_18 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, =0x030022c0 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 .pool @0813E160: ldr r0, =0x030030fc 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @0813E188: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0813E1C8 .align 2, 0 .pool @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, =sub_813E3C0 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 .pool 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, =0x02021cc4 mov r1, sp bl strcpy_limit_10_chars ldr r0, =0x02021dc4 movs r1, 0xB muls r1, r5 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcpy ldr r1, =0x02021cc0 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, =0x0203ab80 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, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 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, =0x0202499c ldr r1, =gUnknown_082EC6A8 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, =0x02020630 lsls r1, r6, 4 adds r1, r6 lsls r1, 2 adds r0, r3, 0 adds r0, 0x1C adds r0, r1, r0 ldr r2, =nullsub_18 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, =sub_813F1B8 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, =0x03005e00 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, =0x02022e14 strh r4, [r0] ldr r0, =0x02022e16 strh r4, [r0] ldr r0, =0x02022e18 strh r4, [r0] ldr r0, =0x02022e1a strh r4, [r0] ldr r0, =0x02022e1c strh r4, [r0] ldr r0, =0x02022e1e strh r4, [r0] ldr r1, =0x02022e20 movs r2, 0x80 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] ldr r0, =0x02022e22 strh r4, [r0] ldr r2, =0x03003014 ldrb r0, [r2] movs r1, 0x2 orrs r0, r1 strb r0, [r2] ldr r0, =sub_813FD64 bl SetVBlankCallback ldr r0, =sub_813E3C0 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 .pool 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, =gEvolutionTable adds r1, r7 mov r8, r1 ldrh r0, [r1] cmp r0, 0xD beq @0813E40C b @0813E546 @0813E40C: ldr r6, =0x020244e9 ldrb r0, [r6] cmp r0, 0x5 bls @0813E416 b @0813E546 @0813E416: movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec 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, =gEvolutionTable 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, =gSpeciesNames 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, =0x020244ec 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, =0x020244e9 @0813E4A0: ldrb r0, [r7] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 adds r1, r4, 0 mov r2, sp bl pokemon_setattr adds r4, 0x1 cmp r4, 0x4F ble @0813E4A0 ldr r4, =0x020244e9 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, =gEvolutionTable mov r4, r8 add r4, r10 lsls r4, 3 adds r4, r0 ldrh r0, [r4, 0xC] bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x2 bl pokedex_flag_operation ldrh r0, [r4, 0xC] bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl pokedex_flag_operation mov r0, r9 movs r1, 0xB bl pokemon_getattr ldr r1, =0x0000012f 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, =gUnknown_085B58C4 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 .pool 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, =0x03005e00 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, =0x020244ec adds r1, r0 mov r9, r1 ldr r0, =0x030022c0 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, =0x02024332 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 .pool @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, =@0813E614 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 ldr r0, =0x0203ab80 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, =0x03005e00 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 .pool @0813E6D4: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0813E6E4 bl @0813F1A4 @0813E6E4: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085CC990 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0 bl battle_show_message_maybe ldr r0, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 b @0813EC52 .align 2, 0 .pool @0813E714: movs r0, 0 bl a_pressed_maybe lsls r0, 16 cmp r0, 0 beq @0813E724 bl @0813F1A4 @0813E724: ldr r0, =0x0203ab80 ldr r0, [r0] ldrb r0, [r0] ldr r1, =0x03005e00 mov r3, r8 adds r4, r3, r7 lsls r4, 3 adds r4, r1 b @0813EB90 .align 2, 0 .pool @0813E740: ldr r0, =0x0203ab80 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, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 b @0813EC52 .align 2, 0 .pool @0813E770: bl mplay_has_finished_maybe lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @0813E780 bl @0813F1A4 @0813E780: ldr r0, =0x00000179 bl current_map_music_set ldr r0, =0x03005e00 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 .pool @0813E7B0: ldr r0, =0x02037fd4 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, =0x02024332 strb r0, [r1, 0x2] ldr r0, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 b @0813EC52 .align 2, 0 .pool @0813E7E8: ldr r4, =0x02024332 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, =0x0203ab80 ldr r1, [r0] movs r0, 0x1 strb r0, [r1, 0x3] bl sub_817BFB4 strb r0, [r4, 0x2] bl @0813F1A4 .align 2, 0 .pool @0813E828: ldr r4, =0x02024332 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, =0x0203ab80 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 .pool @0813E860: ldr r2, =0x0203ab80 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, =0x02024332 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 .pool @0813E8A4: bl sub_817C068 ldr r1, =0x02024332 strb r0, [r1, 0x2] ldr r0, =0x03005e00 mov r3, r8 adds r1, r3, r7 lsls r1, 3 adds r1, r0 b @0813EC52 .align 2, 0 .pool @0813E8C0: ldr r6, =0x02024332 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 .pool @0813E8EC: ldr r0, =0x02024332 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 .pool @0813E918: bl mplay_has_finished_maybe lsls r0, 24 cmp r0, 0 bne @0813E926 bl @0813F1A4 @0813E926: bl m4aMPlayAllStop ldr r0, =0x02037754 ldr r1, =0x0203ab80 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, =0x03005e00 mov r3, r8 adds r1, r3, r7 lsls r1, 3 adds r1, r0 b @0813EC52 .align 2, 0 .pool @0813E964: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0813E974 bl @0813F1A4 @0813E974: ldr r0, =0x0203ab80 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 .pool @0813E990: bl sub_80A3678 lsls r0, 24 cmp r0, 0 bne @0813E99E bl @0813F1A4 @0813E99E: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085CC9A6 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0 bl battle_show_message_maybe ldr r0, =0x00000173 bl song_play_for_text ldr r2, =0x03005e00 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 SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x2 bl pokedex_flag_operation ldrh r0, [r4, 0xC] bl SpeciesToNationalPokedexNum 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 .pool @0813EA1C: movs r0, 0 bl a_pressed_maybe lsls r0, 16 cmp r0, 0 beq @0813EA2A b @0813F1A4 @0813EA2A: ldr r1, =0x03005e00 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, =0x02022f58 add r1, sp, 0x4 bl strcpy_limit_10_chars ldr r0, =0x0000ffff cmp r6, r0 bne @0813EA94 movs r0, 0x16 strh r0, [r4, 0x8] b @0813F1A4 .align 2, 0 .pool @0813EA94: ldr r0, =0x0000fffe cmp r6, r0 bne @0813EA9C b @0813F1A4 @0813EA9C: movs r0, 0x14 strh r0, [r4, 0x8] b @0813F1A4 .align 2, 0 .pool @0813EAA8: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 b @0813EC52 .align 2, 0 .pool @0813EAC8: ldr r0, =0x02037fd4 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, =0x0203ab80 ldr r0, [r4] bl free str r6, [r4] bl Window_FreeMemory ldr r0, =0x030061e8 ldr r0, [r0] bl set_callback2 b @0813F1A4 .align 2, 0 .pool @0813EB34: ldr r0, =0x02024332 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, =0x0006001c ldr r1, =0x00007fff 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 .pool @0813EB74: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0813EB82 b @0813F1A4 @0813EB82: ldr r0, =0x0203ab80 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 .pool @0813EBA8: ldr r0, =0x0203ab80 ldr r0, [r0] ldrb r0, [r0] bl sub_8140208 cmp r0, 0 bne @0813EBB8 b @0813F1A4 @0813EBB8: ldr r0, =0x03005e00 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, =0x02021fc4 ldr r1, =gUnknown_085CC9EE bl ExpandTextCodes b @0813EBEC .align 2, 0 .pool @0813EBE4: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085CC9D3 bl ExpandTextCodes @0813EBEC: ldr r0, =0x02021fc4 movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005e00 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 .pool @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, =0x0000016f bl fanfare_play ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0xC] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r0, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =@0813ECC8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085CC270 ldr r0, [r0, 0x10] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r0, =0x03005e00 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 .pool @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, =gUnknown_085CC270 ldr r0, [r0, 0x14] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r0, =0x03005e00 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 .pool @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, =gUnknown_085CC270 ldr r0, [r0, 0x18] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r0, =0x03005e00 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, =gUnknown_085CCABB movs r1, 0xC bl battle_show_message_maybe ldr r0, =0x03005e00 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, =0x02024332 strb r2, [r0, 0x1] movs r0, 0 bl sub_8056B74 b @0813F1A4 .align 2, 0 .pool @0813EE34: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0813EE5C ldr r4, =0x02024332 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0813EE84 ldr r4, =0x02024332 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, =0x030022c0 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, =0x02024332 ldrb r2, [r0, 0x1] cmp r2, 0 beq @0813EECC ldr r0, =0x03005e00 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 .pool @0813EECC: ldr r0, =0x03005e00 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, =0x030022c0 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, =0x03005e00 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 .pool @0813EF30: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0813EF3E b @0813F1A4 @0813EF3E: bl Window_FreeMemory ldr r0, =0x020244ec ldr r1, =0x03005e00 mov r3, r8 adds r5, r3, r7 lsls r5, 3 adds r5, r1 ldrb r1, [r5, 0x1C] ldr r2, =0x020244e9 ldrb r2, [r2] subs r2, 0x1 lsls r2, 24 lsrs r2, 24 ldr r3, =sub_813DD7C ldr r4, =0x020244e2 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 .pool @0813EF88: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0813EF96 b @0813F1A4 @0813EF96: ldr r1, [r6, 0x4] ldr r0, =sub_813E3A4 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, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 movs r0, 0xA b @0813F1A2 .align 2, 0 .pool @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, =gUnknown_085CC270 ldr r3, =0x000004cc adds r0, r3 ldr r0, [r0] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005e00 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 .pool @0813F014: ldr r1, =0x02022f68 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] strb r4, [r1, 0x2] lsrs r0, r4, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] lsls r4, r6, 24 lsrs r4, 24 mov r0, r9 adds r1, r4, 0 bl sub_806B9A8 ldr r0, =0x020244e2 ldrh r1, [r0] mov r0, r9 adds r2, r4, 0 bl sub_80691F4 ldr r0, =0x03005e00 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 .pool @0813F05C: ldr r0, =gUnknown_085CC270 movs r1, 0xCF lsls r1, 2 adds r0, r1 ldr r0, [r0] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r0, =0x03005e00 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 .pool @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, =gUnknown_085CC270 ldr r0, [r0, 0x1C] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r0, =0x03005e00 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 .pool @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, =gUnknown_085CC270 movs r1, 0xD0 lsls r1, 2 adds r0, r1 ldr r0, [r0] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005e00 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 .pool @0813F120: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x20] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005e00 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 .pool @0813F154: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x24] bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool 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, =0x03005e00 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, =0x020244ec 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, =@0813F204 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021fc4 ldr r1, =gUnknown_085CC990 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0x1 bl sub_807F1A8 ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 b @0813F6B4 .align 2, 0 .pool @0813F284: movs r0, 0 bl a_pressed_maybe lsls r0, 16 cmp r0, 0 beq @0813F294 bl @0813FCC4 @0813F294: ldr r0, =0x03005e00 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 .pool @0813F2AC: bl sub_80A3678 lsls r0, 24 cmp r0, 0 bne @0813F2BA bl @0813FCC4 @0813F2BA: ldr r0, =0x00000179 bl m4aSongNumStop movs r0, 0xBC lsls r0, 1 bl audio_play ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 b @0813F6B4 .align 2, 0 .pool @0813F2DC: bl mplay_has_finished_maybe lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 beq @0813F2EC bl @0813FCC4 @0813F2EC: ldr r0, =0x00000179 bl song_play_for_text ldr r1, =0x03005e00 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 .pool @0813F314: ldr r0, =0x02037fd4 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, =0x02020630 ldr r0, =0x0203ab80 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, =0x02024332 strb r0, [r1, 0x2] ldr r1, =0x03005e00 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, =0x00000603 movs r0, 0xE bl lcd_io_set bl @0813FCC4 .align 2, 0 .pool @0813F380: ldr r4, =0x02024332 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, =0x0203ab80 ldr r1, [r0] movs r0, 0x1 strb r0, [r1, 0x3] bl sub_817BFB4 strb r0, [r4, 0x2] bl @0813FCC4 .align 2, 0 .pool @0813F3C0: ldr r4, =0x02024332 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, =0x0203ab80 ldr r1, [r0] ldrb r0, [r1] ldrb r1, [r1, 0x1] bl sub_817C3A0 strb r0, [r4, 0x2] b @0813F6AC .align 2, 0 .pool @0813F3F0: ldr r2, =0x0203ab80 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, =0x02024332 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 .pool @0813F42C: bl sub_817C068 ldr r1, =0x02024332 strb r0, [r1, 0x2] ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 b @0813F6B4 .align 2, 0 .pool @0813F448: ldr r6, =0x02024332 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 .pool @0813F474: ldr r0, =0x02024332 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 .pool @0813F498: bl mplay_has_finished_maybe lsls r0, 24 cmp r0, 0 bne @0813F4A6 bl @0813FCC4 @0813F4A6: ldr r0, =0x0203ab84 ldr r0, [r0] bl free ldr r5, =0x0203ab80 ldr r0, [r5] ldrb r0, [r0, 0x1] ldr r1, =0x03005e00 lsls r4, r7, 2 adds r4, r7 lsls r4, 3 adds r4, r1 ldrh r1, [r4, 0xC] bl sub_81401E0 ldr r0, =0x02037754 ldr r1, [r5] adds r1, 0x4 movs r2, 0x60 bl memcpy b @0813F6F2 .align 2, 0 .pool @0813F4E4: bl sub_80A3678 lsls r0, 24 cmp r0, 0 bne @0813F4F2 bl @0813FCC4 @0813F4F2: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085CC9A6 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0x1 bl sub_807F1A8 ldr r0, =0x00000173 bl fanfare_play ldr r2, =0x03005e00 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 SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 movs r1, 0x2 bl pokedex_flag_operation ldrh r0, [r4, 0xC] bl SpeciesToNationalPokedexNum 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 .pool @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, =0x03005e00 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, =0x02022f58 add r1, sp, 0x4 bl strcpy_limit_10_chars ldr r0, =0x0000ffff cmp r6, r0 bne @0813F5E8 movs r0, 0x14 strh r0, [r5, 0x8] b @0813FCC4 .align 2, 0 .pool @0813F5E8: ldr r0, =0x0000fffe cmp r6, r0 bne @0813F5F0 b @0813FCC4 @0813F5F0: movs r0, 0x12 strh r0, [r5, 0x8] b @0813FCC4 .align 2, 0 .pool @0813F5FC: ldr r0, =0x00000179 bl song_play_for_text ldr r1, =gUnknown_085EF6D2 movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r0, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 b @0813F78C .align 2, 0 .pool @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, =0x0203ab80 ldr r0, [r4] bl free str r5, [r4] ldr r2, =0x03003014 ldrb r1, [r2] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r2] ldr r0, =0x030061e8 ldr r0, [r0] bl set_callback2 b @0813FCC4 .align 2, 0 .pool @0813F668: ldr r0, =0x02024332 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, =0x02020630 ldr r0, =0x0203ab80 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, =0x0004001c orrs r0, r1 ldr r1, =0x00007fff 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 .pool @0813F6D0: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0813F6DE b @0813FCC4 @0813F6DE: ldr r0, =0x0203ab80 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 .pool @0813F704: ldr r0, =0x0203ab80 ldr r0, [r0] ldrb r0, [r0] bl sub_8140208 cmp r0, 0 bne @0813F714 b @0813FCC4 @0813F714: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085CC9EE adds r0, r4, 0 bl ExpandTextCodes movs r0, 0 adds r1, r4, 0 movs r2, 0x1 bl sub_807F1A8 ldr r1, =0x03005e00 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 .pool @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, =0x0000016f bl fanfare_play ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0xC] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r0, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =@0813F808 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085CC270 ldr r0, [r0, 0x10] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r0, =0x03005e00 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 .pool @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, =gUnknown_085CC270 ldr r0, [r0, 0x14] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r0, =0x03005e00 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 .pool @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, =gUnknown_085CC270 ldr r0, [r0, 0x18] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r0, =0x03005e00 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, =gUnknown_0833900C movs r1, 0xA8 movs r2, 0xE movs r3, 0 bl sub_81996C0 ldr r3, =0x02024332 strb r4, [r3, 0x1] ldr r0, =0x03005e00 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 .pool @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, =0x02024332 strb r6, [r0, 0x1] ldr r0, =gUnknown_085CC270 movs r1, 0x92 lsls r1, 3 adds r0, r1 ldr r0, [r0] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r1, =0x03005e00 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 .pool @0813F9E4: ldr r1, =0x02024332 movs r0, 0x1 strb r0, [r1, 0x1] ldr r0, =gUnknown_085CC270 movs r1, 0x92 lsls r1, 3 adds r0, r1 ldr r0, [r0] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r1, =0x03005e00 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 .pool @0813FA24: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0813FA32 b @0813FCC4 @0813FA32: ldr r0, =0x030030fc 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, =0x020244ec ldr r1, =0x03005e00 mov r2, r8 adds r5, r2, r7 lsls r5, 3 adds r5, r1 ldrb r1, [r5, 0x1C] ldr r2, =0x020244e9 ldrb r2, [r2] subs r2, 0x1 lsls r2, 24 lsrs r2, 24 ldr r3, =sub_813DF70 ldr r4, =0x020244e2 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 .pool @0813FAA8: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0813FAB6 b @0813FCC4 @0813FAB6: ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_813E3C0 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, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 movs r0, 0x9 b @0813FCC2 .align 2, 0 .pool @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, =gUnknown_085CC270 ldr r1, =0x000004cc adds r0, r1 ldr r0, [r0] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r1, =0x03005e00 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 .pool @0813FB3C: ldr r1, =0x02022f68 movs r0, 0xFD strb r0, [r1] movs r0, 0x2 strb r0, [r1, 0x1] strb r4, [r1, 0x2] lsrs r0, r4, 8 strb r0, [r1, 0x3] movs r0, 0xFF strb r0, [r1, 0x4] lsls r4, r6, 24 lsrs r4, 24 mov r0, r9 adds r1, r4, 0 bl sub_806B9A8 ldr r0, =0x020244e2 ldrh r1, [r0] mov r0, r9 adds r2, r4, 0 bl sub_80691F4 ldr r0, =gUnknown_085CC270 movs r1, 0xCF lsls r1, 2 adds r0, r1 ldr r0, [r0] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r0, =0x03005e00 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 .pool @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, =gUnknown_085CC270 ldr r0, [r0, 0x1C] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r0, =0x03005e00 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 .pool @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, =gUnknown_085CC270 movs r1, 0xD0 lsls r1, 2 adds r0, r1 ldr r0, [r0] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r1, =0x03005e00 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 .pool @0813FC38: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x20] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r1, =0x03005e00 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 .pool @0813FC70: ldr r0, =gUnknown_085CC270 ldr r0, [r0, 0x24] bl sub_814E6F0 ldr r1, =0x02022e2c movs r0, 0 movs r2, 0x1 bl sub_807F1A8 ldr r1, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool 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, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 bl lcd_io_set ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 bl lcd_io_set ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 bl lcd_io_set ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 bl lcd_io_set ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 bl lcd_io_set ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A bl lcd_io_set ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C bl lcd_io_set ldr r0, =0x02022e22 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 .pool thumb_func_end sub_813FCDC thumb_func_start sub_813FD64 sub_813FD64: ; 813FD64 push {lr} ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 bl lcd_io_set ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 bl lcd_io_set ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 bl lcd_io_set ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 bl lcd_io_set ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 bl lcd_io_set ldr r0, =0x02022e1e ldrh r1, [r0] movs r0, 0x1A bl lcd_io_set ldr r0, =0x02022e20 ldrh r1, [r0] movs r0, 0x1C bl lcd_io_set ldr r0, =0x02022e22 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 .pool 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, =0x03005e08 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, =gUnknown_085B58C9 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 .pool @0813FE74: ldr r0, =0x0203ab84 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 .pool 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, =sub_813FEE8 movs r1, 0x7 bl AddTask lsls r0, 24 lsrs r2, r0, 24 cmp r4, 0 bne @0813FED0 ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 strh r4, [r0, 0xC] b @0813FEDE .align 2, 0 .pool @0813FED0: ldr r0, =0x03005e00 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 .pool 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, =0x02022e18 mov r8, r0 ldr r1, =0x02022e1a mov r9, r1 ldr r1, =0x03005e00 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, =0x02022e1c ldr r6, =0x02022e1e b @0813FF2C .align 2, 0 .pool @0813FF28: ldr r7, =0x02022e20 ldr r6, =0x02022e22 @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, =sub_813FDEC 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 .pool 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, =gUnknown_085B5884 ldr r7, =gUnknown_085B58D9 @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 .pool 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, =0x0203ab84 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 .pool @08140028: movs r6, 0x1 movs r4, 0x3 @0814002C: ldr r0, =gUnknown_085B51E4 movs r1, 0xA0 movs r2, 0x20 bl gpu_pal_apply ldr r1, =gUnknown_085B4134 movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree ldr r1, =gUnknown_085B482C movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r1, =gUnknown_085B4D10 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, =0x00000442 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000808 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 .pool @081400C4: ldr r1, =0x00000842 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000808 movs r0, 0x52 bl lcd_io_set movs r1, 0xDA lsls r1, 5 movs r0, 0 bl lcd_io_set @081400DE: ldr r0, =sub_813FDEC 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 .pool thumb_func_end sub_8140000 thumb_func_start sub_8140100 sub_8140100: ; 8140100 push {lr} ldr r0, =sub_813FDEC bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @0814011E ldr r0, =0x03005e00 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 .pool thumb_func_end sub_8140100 thumb_func_start sub_8140134 sub_8140134: ; 8140134 push {lr} ldr r0, =sub_813FDEC bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @08140148 bl remove_task @08140148: ldr r0, =sub_813FEE8 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 .pool 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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a strh r1, [r0] ldr r0, =0x02022e1c 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, =0x0203ab84 ldr r0, [r0] bl free pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 adds r0, r2 movs r2, 0 movs r3, 0 bl sub_806ED40 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81401E0 thumb_func_start sub_8140208 sub_8140208: ; 8140208 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r2, 0x1C adds r1, r2 ldr r1, [r1] ldr r0, =nullsub_12 cmp r1, r0 beq @08140230 movs r0, 0 b @08140232 .align 2, 0 .pool @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, =0x0203ab88 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 .pool 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, =0x0203ab88 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, =0x040000d4 ldr r3, =0x0000133c adds r0, r2, r3 str r0, [r1] ldr r0, =0x060021c0 str r0, [r1, 0x4] ldr r0, =0x800001a0 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 .pool @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, =0x040000d4 ldr r2, [r4] movs r3, 0xCF lsls r3, 2 adds r0, r2, r3 str r0, [r1] ldr r0, =0x0600f9c0 str r0, [r1, 0x4] ldr r0, =0x800001a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] movs r0, 0x2 strh r0, [r2, 0x28] b @08140374 .align 2, 0 .pool @08140324: ldr r1, =0x040000d4 movs r2, 0xCF lsls r2, 2 adds r0, r2 str r0, [r1] ldr r0, =0x0600f9c0 str r0, [r1, 0x4] ldr r0, =0x800001a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] b @08140374 .align 2, 0 .pool @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, =0x040000d4 mov r3, sp str r3, [r1] ldr r0, =0x0600f9c0 str r0, [r1, 0x4] ldr r0, =0x810001a0 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 .pool 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, =0x0203ab88 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, =gUnknown_085B6140 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, =0x0000117c adds r1, r2 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x0000317c adds r1, r0 movs r0, 0x2 bl bg_set_tilemap ldr r0, =gUnknown_085B614C bl Window_InitFromTemplates bl sub_8197200 ldr r0, =0x0203ab8c strb r5, [r0] ldr r0, =gUnknown_085B5DFC mov r1, sp bl malloc_and_decompress ldr r1, [r4] ldr r2, =0x0000397c adds r1, r2 str r0, [r1] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8140388 thumb_func_start sub_8140418 sub_8140418: ; 8140418 push {r4,r5,lr} ldr r5, =0x0203ab88 ldr r0, [r5] ldr r4, =0x0000397c 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 .pool thumb_func_end sub_8140418 thumb_func_start sub_8140470 sub_8140470: ; 8140470 push {r4-r6,lr} sub sp, 0x8 ldr r1, =gUnknown_085B6418 mov r0, sp movs r2, 0x6 bl memcpy ldr r5, =0x0203ab88 ldr r3, [r5] ldr r4, =0x020375e0 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, =gUnknown_085B6348 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, =gUnknown_085B6344 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, =0x02037714 ldr r3, =0x02037b14 mov r0, sp ldrh r2, [r0] b @08140528 .align 2, 0 .pool @08140520: ldr r4, =0x02037714 ldr r3, =0x02037b14 mov r0, sp ldrh r2, [r0, 0x2] @08140528: adds r0, r3, 0 adds r0, 0xA2 strh r2, [r0] ldr r1, =0x0000ffff 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, =0x0203ab88 ldr r0, [r0] adds r0, 0xB8 bl sub_8151678 movs r4, 0 @0814054E: ldr r5, =0x0203ab88 ldr r0, [r5] adds r0, 0xB8 lsls r2, r4, 3 ldr r1, =gUnknown_085B6388 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, =0x020244ec 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 .pool @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, =0x030022c0 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, =@081405F4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0000060a movs r0, 0x52 bl lcd_io_set b @081407F8 .align 2, 0 .pool @08140650: bl sub_80A1A74 bl reset_all_obj_data bl clear_tasks bl reset_temp_tile_data_buffers b @081407F8 @08140662: ldr r0, =gUnknown_085B5BFC movs r2, 0xE0 lsls r2, 1 movs r1, 0 bl gpu_pal_apply ldr r1, =gUnknown_08DBC2E8 movs r4, 0 str r4, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_08DBCA14 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 .pool @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, =gUnknown_085B5FA0 movs r0, 0x2 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map b @081407F8 .align 2, 0 .pool @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, =0x0203ab8c ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldrb r0, [r4] ldr r2, =gUnknown_082A5B89 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, =0x02021bbc movs r2, 0x3C negs r2, r2 adds r0, r2, 0 strh r0, [r1] ldr r0, =0x02021bbe strh r5, [r0] b @081407F8 .align 2, 0 .pool @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, =sub_8140264 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, =sub_81408A8 movs r1, 0 bl AddTask ldr r5, =0x0203ab88 ldr r1, [r5] adds r1, 0xA4 strb r0, [r1] lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 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, =sub_8140814 movs r1, 0x1 bl AddTask ldr r1, [r5] adds r1, 0xA5 strb r0, [r1] ldr r0, =sub_8140238 bl set_callback2 b @08140806 .align 2, 0 .pool @081407F8: ldr r1, =0x030022c0 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 .pool thumb_func_end sub_81405CC thumb_func_start sub_8140814 sub_8140814: ; 8140814 push {r4-r6,lr} ldr r3, =0x0203ab88 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 .pool 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, =0x00000808 movs r0, 0x52 bl lcd_io_set ldr r1, =0x03005e00 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, =sub_8140968 ldr r2, =0x0000ffff adds r0, r4, 0 movs r3, 0x3 bl sub_8141F7C @081408FE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab8c ldrb r0, [r5] movs r1, 0 bl sub_81973FC ldrb r0, [r5] ldr r2, =gUnknown_082A5C13 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, =gUnknown_085B6410 adds r0, r4, 0 bl sub_8121F68 add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8140BD0 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 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 .pool 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, =@081409D8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203ab88 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 .pool @08140A3C: lsls r0, r4, 1 adds r0, r4 adds r0, 0xE lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r5, =0x0203ab88 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, =0x0000397c adds r0, r1 ldr r1, [r0] ldr r0, =0x00000232 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 .pool @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, =0x0203ab88 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, =0x0000397c 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 .pool @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, =0x0203ab88 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, =0x0000397c 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 .pool thumb_func_end sub_81409B8 thumb_func_start sub_8140B64 sub_8140B64: ; 8140B64 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 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 .pool 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, =0x0203ab88 ldr r2, [r5] movs r6, 0 movs r1, 0x1 strh r1, [r2, 0x28] ldr r1, =0x03005e00 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, =sub_8141040 str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 ldr r0, [r1] ldr r2, [r0, 0x8] movs r0, 0x20 ands r0, r2 cmp r0, 0 beq @08140C30 movs r3, 0xB ldr r5, =gUnknown_085B6154 adds r0, r5, 0 adds r0, 0xE4 ldr r0, [r0] ands r2, r0 ldr r0, =0x03005e00 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 .pool @08140C30: movs r3, 0x6 ldr r5, =gUnknown_085B6154 adds r0, r5, 0 adds r0, 0x80 ldr r0, [r0] ands r2, r0 ldr r0, =0x03005e00 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, =sub_8140B8C str r0, [r4] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B641E 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 .pool @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, =0x030022c0 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, =0x03005e08 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, =0x03005e08 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, =0x03005e08 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, =0x03005e08 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, =0x03005e00 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, =0x0203ab88 ldr r0, [r5] adds r0, 0xB8 ldr r1, =0x0000ffff 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, =0x02020630 mov r12, r1 movs r2, 0x8 add r2, r12 mov r10, r2 @08140E8C: ldr r0, =0x0203ab88 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, =0x000003ff mov r8, r2 mov r0, r8 ands r1, r0 ldrh r2, [r3, 0x4] ldr r0, =0xfffffc00 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, =0x03005e00 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, =gUnknown_085B6154 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, =0x02020630 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, =0xfffffc00 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 .pool 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, =0x0203ab88 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 .pool @08140F90: adds r1, 0x23 movs r0, 0 strb r0, [r1] @08140F96: ldr r0, =0x0203ab88 ldr r0, [r0] adds r0, 0x21 movs r1, 0 strb r1, [r0] ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0x20 strh r1, [r0, 0xA] ldr r1, =sub_81410FC str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 ldr r2, [r4] ldrb r1, [r2, 0x1A] lsls r1, 28 lsrs r1, 28 adds r2, 0x1B adds r2, r1 ldr r3, =0x03005e00 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, =sub_8140F6C str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081410F2 ldr r0, =0x0203ab88 ldr r3, [r0] ldr r2, =gUnknown_085B6154 ldr r1, =0x03005e00 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 .pool @081410E8: movs r0, 0x5F bl m4aSongNumStart ldr r0, =sub_8140FC4 str r0, [r4] @081410F2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8141040 thumb_func_start sub_81410FC sub_81410FC: ; 81410FC push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 ldrh r0, [r4, 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, =0x02021bbc ldrh r0, [r1] adds r0, 0x2 strh r0, [r1] @08141128: ldr r0, =0x0203ab88 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, =0x02020630 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, =nullsub_12 str r1, [r0] b @08141180 .align 2, 0 .pool @08141168: movs r0, 0x1 movs r1, 0xFF bl sub_8142E70 movs r0, 0x1 movs r1, 0xFF bl sub_8143038 ldr r0, =sub_8141344 str r0, [r4] movs r0, 0 strh r0, [r4, 0xA] @08141180: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 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 .pool @081411AC: cmp r2, 0x3 beq @08141214 b @08141280 @081411B2: ldr r0, =0x03005cf8 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, =gUnknown_085B6348 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 .pool @081411E4: movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @08141200 ldr r0, =gUnknown_085B6348 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 .pool @08141200: ldr r0, =gUnknown_085B6348 ldrb r1, [r3, 0x4] lsls r1, 30 lsrs r1, 25 adds r1, r0 ldrb r0, [r1, 0x2] b @0814133A .align 2, 0 .pool @08141214: ldr r0, =0x03005cf8 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, =gUnknown_085B6348 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 .pool @08141248: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08141268 cmp r4, 0x6 bls @08141268 ldr r0, =gUnknown_085B6348 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 .pool @08141268: ldr r1, =gUnknown_085B6348 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 .pool @08141280: ldr r0, =0x03005cf8 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 .pool @081412A0: ldr r1, =gUnknown_085B6348 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 .pool @081412B8: movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @081412F0 cmp r4, 0xC bls @081412DC ldr r1, =gUnknown_085B6348 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 .pool @081412DC: ldr r1, =gUnknown_085B6348 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 .pool @081412F0: movs r0, 0x80 lsls r0, 8 ands r0, r1 cmp r0, 0 beq @08141328 cmp r4, 0xC bls @08141314 ldr r1, =gUnknown_085B6348 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 .pool @08141314: ldr r1, =gUnknown_085B6348 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 .pool @08141328: ldr r1, =gUnknown_085B6348 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 .pool 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, =gUnknown_085B6422 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, =0x0203ab88 ldr r0, [r3] ldr r2, =0x03005e00 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, =0x03005cf8 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 .pool @081413E0: lsls r1, r5, 24 asrs r1, 24 movs r0, 0x1 subs r0, r1 lsls r0, 25 @081413EA: lsrs r5, r0, 24 ldr r0, =0x0203ab88 ldr r6, [r0] ldrb r0, [r6, 0x4] lsls r0, 30 lsrs r0, 25 ldr r1, =gUnknown_085B6348 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, =0x47800000 bl __addsf3 @0814141C: ldr r1, =0x40a00000 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, =0x47800000 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, =gUnknown_085B6348 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, =0x47800000 bl __addsf3 adds r5, r0, 0 @08141492: str r5, [r7] adds r7, r6, 0 adds r7, 0x90 ldr r1, =0x3f000000 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, =0x47800000 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, =0x42880000 str r0, [r1] adds r1, 0x8 ldr r0, =0x00000000 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, =0x47800000 bl __addsf3 adds r2, r0, 0 @081414F8: ldr r0, =0x41000000 adds r1, r2, 0 bl __divsf3 bl __negsf2 str r0, [r5] adds r1, r6, 0 adds r1, 0xA0 ldr r0, =0x42100000 str r0, [r1] ldr r1, =0x03005e00 mov r5, r10 lsls r0, r5, 2 add r0, r10 lsls r0, 3 adds r0, r1 ldr r1, =sub_814155C 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 .pool thumb_func_end sub_8141344 thumb_func_start sub_814155C sub_814155C: ; 814155C push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r4, =0x0203ab88 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, =0x02020630 adds r1, r2 str r1, [r3, 0x38] ldr r2, =sub_81446AC str r2, [r1, 0x1C] ldr r1, =0x03005e00 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, =sub_81415D4 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 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 .pool @08141614: ldr r2, =0x03005e00 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, =0x03005e00 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, =0x030022c0 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 .pool @08141690: ldr r0, =0x0203ab88 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, =sub_81416D4 str r0, [r4] @081416C6: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02021bbc ldrh r0, [r1] subs r0, 0x2 strh r0, [r1] @08141700: ldr r0, =0x0203ab88 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, =0x02020630 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, =sub_814390C str r1, [r0] b @08141768 .align 2, 0 .pool @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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_8141778 str r0, [r1] @08141768: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =sub_814189C adds r0, r2, 0 movs r2, 0x1E movs r3, 0 bl sub_8141F7C @081417F4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =sub_8141A18 ldr r2, =0x0000ffff adds r0, r5, 0 movs r3, 0x3 bl sub_8141F7C b @08141888 .align 2, 0 .pool @08141864: bl mplay_has_finished_maybe lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 bne @08141888 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r2, [r0, 0x1E] ldr r1, =sub_8141AC0 ldr r2, =0x0000ffff adds r0, r5, 0 movs r3, 0x3 bl sub_8141F7C @08141888: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x00000185 bl fanfare_play ldr r4, =0x0203ab8c ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldrb r0, [r4] ldr r2, =gUnknown_082A5BD7 b @08141902 .align 2, 0 .pool @081418EC: movs r0, 0xC3 lsls r0, 1 bl fanfare_play ldr r4, =0x0203ab8c ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldrb r0, [r4] ldr r2, =gUnknown_082A5BCB @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 .pool @08141928: movs r0, 0x20 bl m4aSongNumStart ldr r4, =0x0203ab8c ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldrb r0, [r4] ldr r2, =gUnknown_082A5BE0 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0xA] ldr r1, =sub_8141800 str r1, [r0] add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x0000270e cmp r1, r0 ble @081419D0 strh r5, [r4, 0xA] b @081419E6 .align 2, 0 .pool @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, =0x03005e00 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, =sub_8141AC0 ldr r2, =0x0000ffff adds r0, r6, 0 movs r3, 0x3 bl sub_8141F7C @08141A04: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021cc4 ldr r1, =0x0203ab88 mov r9, r1 ldr r1, [r1] ldrb r2, [r1, 0x19] ldr r1, =0x03005e00 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, =0x02021fc4 mov r8, r2 ldr r1, =gUnknown_082A5BEF mov r0, r8 bl ExpandTextCodes ldr r5, =0x0203ab8c 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, =sub_8141984 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 .pool 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, =0x0203ab88 ldr r0, [r5] adds r0, 0xB8 ldr r1, =0x0000ffff 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, =0x02020630 ldr r2, [r5] ldr r5, =gUnknown_085B6154 ldr r0, =0x03005e00 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, =sub_8141B58 str r0, [r3] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 movs r2, 0 strh r5, [r0, 0x10] ldr r4, =0x0203ab88 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, =0x02020630 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, =0xfffffc00 mov r8, r1 @08141BB0: ldr r0, =0x0203ab88 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, =0x000003ff 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, =0x03005e00 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, =0x0203ab8c ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldrb r0, [r4] ldr r2, =gUnknown_082A5C21 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, =dp01t_12_3_battle_menu b @08141C8E .align 2, 0 .pool @08141C58: movs r0, 0x22 ldrsh r1, [r2, r0] ldr r0, =0x0000270f cmp r1, r0 bne @08141CB0 ldr r4, =0x0203ab8c ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldrb r0, [r4] ldr r2, =gUnknown_082A5C61 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, =sub_8140914 @08141C8E: ldr r2, =0x0000ffff adds r0, r6, 0 movs r3, 0x3 bl sub_8141F7C b @08141CF2 .align 2, 0 .pool @08141CB0: ldr r0, =sub_8140914 str r0, [r2] b @08141CF2 .align 2, 0 .pool @08141CBC: ldr r4, =0x0203ab8c ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldrb r0, [r4] ldr r2, =gUnknown_082A5C04 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, =sub_8140994 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 .pool 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, =0x03005e00 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, =0x02020630 ldr r3, =0x0203ab88 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r2, r0, r1 movs r0, 0x22 ldrsh r1, [r2, r0] ldr r0, =0x0000270f cmp r1, r0 bne @08141DD4 ldr r4, =0x0203ab8c ldrb r0, [r4] movs r1, 0 bl sub_81973FC ldrb r0, [r4] ldr r2, =gUnknown_082A5C61 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, =sub_8140914 ldr r2, =0x0000ffff adds r0, r5, 0 movs r3, 0x3 bl sub_8141F7C b @08141DD8 .align 2, 0 .pool @08141DD4: ldr r0, =sub_8140914 str r0, [r2] @08141DD8: add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 ldr r0, [r4] adds r0, 0xB8 ldr r1, =0x0000ffff bl sub_8151A9C ldr r0, [r4] adds r0, 0xB8 bl sub_8151678 ldr r1, =0x03005e00 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, =0x020375e0 movs r0, 0x1 b @08141E3C .align 2, 0 .pool @08141E38: ldr r1, =0x020375e0 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_8141E7C str r1, [r0] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021bbc ldr r0, =0x02021bbe 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, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 adds r0, r5, 0 bl remove_task @08141EDE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 ldr r3, [r1] adds r0, r3, 0 adds r0, 0xA8 ldrh r0, [r0] adds r5, r1, 0 cmp r0, 0 beq @08141F1E ldr r0, =0x030022c0 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, =0x03005e00 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, =0x0000ffff cmp r2, r0 beq @08141F64 subs r0, r2, 0x1 strh r0, [r1] @08141F64: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 ldr r0, [r2] mov r12, r0 mov r3, r12 adds r3, 0xB4 ldr r1, =0x03005e00 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, =0x0000ffff 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 .pool @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, =sub_8141EF8 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 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, =0x03005e00 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 .pool thumb_func_end sub_8141FF4 thumb_func_start sub_8142070 sub_8142070: ; 8142070 push {lr} ldr r2, =0x0203ab88 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, =0x0203ab88 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, =0x0203ab88 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 .pool 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, =gUnknown_085B642C 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, =gUnknown_085B643C 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 .pool @0814210C: ldr r6, =0x0203ab88 ldr r3, [r6] ldr r1, =0x03005e00 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, =gUnknown_085B62E4 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, =gUnknown_085B62E8 add r0, r12 ldr r7, [r0] ldr r4, =0x0203ab88 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 .pool 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, =@08142210 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203ab88 mov r12, r1 cmp r4, r2 bge @081422E8 ldr r0, [r1] ldr r3, =gUnknown_085B6154 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, =0x0000dfff ldr r3, [sp, 0x18] ands r3, r1 str r3, [sp, 0x18] adds r1, r3, 0 bl sub_8151A48 b @081424E2 .align 2, 0 .pool @0814230C: mov r0, sp ldr r1, =gUnknown_085B63F0 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, =0xffff0000 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, =0x0203ab88 mov r12, r4 b @081423D4 .align 2, 0 .pool @08142368: cmp r0, 0x3 beq @081423A4 cmp r0, 0x4 beq @081423B8 ldr r5, =0x0203ab88 mov r12, r5 b @081423D4 .align 2, 0 .pool @0814237C: ldr r3, =0x02020630 ldr r2, =0x0203ab88 ldr r0, [r2] adds r0, 0x43 b @081423C0 .align 2, 0 .pool @08142390: ldr r3, =0x02020630 ldr r2, =0x0203ab88 ldr r0, [r2] adds r0, 0x44 b @081423C0 .align 2, 0 .pool @081423A4: ldr r3, =0x02020630 ldr r2, =0x0203ab88 ldr r0, [r2] adds r0, 0x45 b @081423C0 .align 2, 0 .pool @081423B8: ldr r3, =0x02020630 ldr r2, =0x0203ab88 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, =gUnknown_085B6154 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 .pool @08142430: movs r4, 0 lsls r5, r7, 2 str r5, [sp, 0x1C] ldr r0, =gUnknown_085B6154 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, =0x0203ab88 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, =0x0203ab88 ldr r0, [r0] adds r0, 0xB8 ldr r2, =gUnknown_085B6154 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 .pool 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, =0x0203ab88 ldr r1, [r4] movs r0, 0x1 strh r0, [r1, 0x2A] movs r0, 0 movs r1, 0 bl sub_8142E70 ldr r1, [r4] ldr r2, =0x0000117c adds r0, r1, r2 ldr r2, =0x0000397c 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, =@08142558 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085B6154 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, =gUnknown_085B6154 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, =0x0203ab88 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, =gUnknown_085B6154 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, =0x0000117c adds r5, r4, r0 adds r2, r5, r2 mov r1, r12 ldrb r0, [r1] ldrb r1, [r7] adds r1, r0 ldr r0, =0x0000397c 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 .pool 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, =gUnknown_085B6448 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x13 bls @08142770 movs r4, 0 @08142770: ldr r3, =gUnknown_085B6154 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 .pool @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, =0x0203ab88 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 .pool @081427C4: subs r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0203ab88 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 .pool @081427E8: ldr r0, =0x0203ab88 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 .pool @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, =0x0203ab88 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, =0x02021bbe 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, =0x02021bbc 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, =0x0fff0000 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 .pool 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, =gUnknown_085B6408 adds r0, r4, 0 bl sub_8121F68 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08142908 movs r0, 0 bl SetVBlankCallback ldr r0, =sub_81405CC bl set_callback2 adds r0, r4, 0 bl remove_task @08142908: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81428E4 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @081429DE ldr r1, =0x020375e0 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 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @08142A60 ldr r2, =gUnknown_085B6344 ldr r0, =0x020375e0 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, =0x02021cc4 movs r2, 0x2 movs r3, 0x1 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_082A5B12 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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81428C4 str r1, [r0] @08142A60: add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_085B6344 ldr r0, =0x020375e0 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, =0x02021cc4 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, =gUnknown_082A5B6B 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, =sub_81429F0 str r0, [r6] b @08142BB0 .align 2, 0 .pool @08142B28: ldr r4, =0x02021fc4 ldr r1, =gUnknown_082A5B12 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81428C4 str r1, [r0] b @08142BB0 .align 2, 0 .pool @08142B78: ldr r5, =0x02021fc4 ldr r1, =gUnknown_082A5B4E 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, =sub_81429A0 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 .pool 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, =sub_8142A88 movs r1, 0 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 bl sub_8145C30 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085B7384 bl gpu_pal_obj_alloc_and_load_multiple ldr r0, =gUnknown_085B7864 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085B7978 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085B7A40 bl gpu_tile_obj_decompress_and_load b @08142C5A .align 2, 0 .pool @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, =0x02020630 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, =0x01670000 cmp r0, r1 bls @08142CBC ldr r1, =0xfffffeb6 adds r0, r2, r1 strh r0, [r6] @08142CBC: adds r0, r5, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085B7488 ldr r0, [r4] ldr r5, =0x0201c000 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, =gUnknown_085B7490 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, =0x02020630 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, =gUnknown_085B75B0 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, =0x0203ab88 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, =0x02020630 @08142D86: lsls r1, r6, 1 adds r1, r6 lsls r1, 3 ldr r0, =gUnknown_085B7508 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, =0x0203ab88 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, =0x02020630 @08142DCC: lsls r2, r6, 1 adds r2, r6 lsls r2, 3 ldr r0, =gUnknown_085B7568 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, =0x0203ab88 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 .pool thumb_func_end sub_8142CD0 thumb_func_start sub_8142E3C sub_8142E3C: ; 8142E3C push {r4,lr} movs r4, 0 @08142E40: ldr r0, =0x0203ab88 ldr r0, [r0] adds r0, r4 adds r0, 0x59 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool 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, =0x02020630 ldr r3, =0x0203ab88 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 .pool @08142EC0: movs r4, 0 ldr r0, =0x0203ab88 mov r9, r0 ldr r7, =gUnknown_085B62E4 adds r1, r7, 0x4 mov r8, r1 ldr r5, =0x02020630 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 .pool @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, =0x02020630 ldr r3, =0x0203ab88 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 .pool 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, =0x0203ab88 ldr r4, =0x02020630 movs r0, 0x4 mov r8, r0 @08142F8C: ldr r0, =gUnknown_085B7928 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, =sub_814390C 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 .pool 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, =0x02020630 ldr r3, =0x0203ab88 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 .pool @08143084: ldr r0, =0x0203ab88 mov r8, r0 ldr r7, =0x02020630 ldr r0, =gUnknown_085B6154 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 .pool @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, =0x02020630 ldr r0, =0x0203ab88 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 .pool @08143180: ldr r4, =0x02020630 ldr r3, =0x0203ab88 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, =gUnknown_085B6154 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 .pool thumb_func_end sub_8143150 thumb_func_start sub_81431E4 sub_81431E4: ; 81431E4 push {r4-r7,lr} sub sp, 0xC ldr r4, =gUnknown_085B741C ldr r0, [r4] ldr r5, =0x0201c000 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, =0x02020630 @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, =gUnknown_085B7610 adds r0, r1 movs r1, 0x28 mov r2, sp bl sub_8142C60 ldr r1, =0x0203ab88 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 .pool thumb_func_end sub_81431E4 thumb_func_start sub_8143280 sub_8143280: ; 8143280 push {r4-r6,lr} adds r6, r0, 0 ldr r0, =0x0203ab88 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, =0x00000167 cmp r1, r0 ble @081432A2 ldr r2, =0xfffffe98 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, =0x02021bc0 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 .pool 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, =0x0201c000 mov r6, sp @08143322: ldr r0, =gUnknown_085B7750 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, =0xffff0000 ldr r1, [r6, 0x4] ands r1, r0 orrs r1, r2 str r1, [r6, 0x4] ldrh r2, [r4, 0x6] lsls r2, 16 ldr r0, =0x0000ffff 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, =gUnknown_085B77E4 movs r1, 0xD0 movs r2, 0x10 movs r3, 0x4 bl obj_add_from_template_forward_search ldr r3, =0x0203ab88 ldr r1, [r3] adds r1, 0x50 strb r0, [r1] ldr r4, =0x02020630 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, =gUnknown_085B77FC 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, =gUnknown_085B7814 movs r1, 0x78 movs r2, 0x44 movs r3, 0x4 bl obj_add_from_template_forward_search ldr r2, =0x0203ab88 ldr r1, [r2] adds r1, 0x55 strb r0, [r1] ldr r3, =0x02020630 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, =gUnknown_085B782C 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, =gUnknown_085B7844 movs r1, 0x98 movs r2, 0x60 movs r3, 0x9 bl obj_add_from_template_forward_search ldr r3, =0x0203ab88 ldr r1, [r3] adds r1, 0x6C strb r0, [r1] ldr r4, =0x02020630 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 .pool 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, =0x02020630 mov r9, r1 ldr r0, =0x0203ab88 mov r10, r0 @08143534: adds r0, r7, 0 mov r1, r8 bl __udivsi3 lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x0203ab88 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, =0x02020630 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, =0x02020638 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, =0x000003ff adds r0, r4, 0 ands r2, r0 ldrh r0, [r3, 0x4] ldr r4, =0xfffffc00 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 .pool 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, =gUnknown_085B7B04 mov r0, sp movs r2, 0x5 bl memcpy cmp r4, 0x13 bls @0814362C movs r4, 0 @0814362C: ldr r3, =gUnknown_085B6154 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 .pool @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, =0x0203ab88 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 .pool @08143680: subs r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0203ab88 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 .pool @081436A4: ldr r0, =0x0203ab88 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 .pool @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, =0x0203ab88 ldr r1, [r1] adds r1, 0x55 ldrb r2, [r1] lsls r1, r2, 4 adds r1, r2 lsls r1, 2 ldr r2, =0x02020630 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, =0x000003ff adds r0, r2, 0 ands r1, r0 ldrh r2, [r4, 0x4] ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r4, 0x4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 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, =@08143760 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08143760: .4byte @081438A8 .4byte @08143864 .4byte @0814383C .4byte @08143830 .4byte @08143808 .4byte @081437FC .4byte @0814377C @0814377C: movs r4, 0 ldr r5, =0x02020630 ldr r6, =0x0203ab88 movs r0, 0x5 negs r0, r0 mov r12, r0 adds r7, r5, 0 adds r7, 0x8 ldr r2, =0xfffffc00 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, =0x000003ff 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 .pool @081437FC: ldr r2, =0x02020630 ldr r0, [r5] adds r0, 0x58 b @0814386A .align 2, 0 .pool @08143808: ldr r2, =0x02020630 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 .pool @08143830: ldr r2, =0x02020630 ldr r0, [r5] adds r0, 0x57 b @0814386A .align 2, 0 .pool @0814383C: ldr r2, =0x02020630 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 .pool @08143864: ldr r2, =0x02020630 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, =0x000003ff adds r0, r2, 0 ands r1, r0 ldrh r2, [r3, 0x4] ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r3, 0x4] b @081438F4 .align 2, 0 .pool @081438A8: movs r4, 0 lsls r7, r6, 2 ldr r6, =0x02020630 movs r0, 0x8 adds r0, r6 mov r12, r0 ldr r2, =0xfffffc00 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, =0x000003ff 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 .pool thumb_func_end sub_814372C thumb_func_start sub_814390C sub_814390C: ; 814390C ldr r1, =0x0203ab88 ldr r1, [r1] ldrh r1, [r1, 0x26] strh r1, [r0, 0x24] bx lr .align 2, 0 .pool thumb_func_end sub_814390C thumb_func_start sub_814391C sub_814391C: ; 814391C push {r4,r5,lr} sub sp, 0x8 ldr r4, =gUnknown_085B7948 ldr r0, [r4] ldr r5, =0x0201c000 adds r1, r5, 0 bl LZ77UnCompWram str r5, [sp] ldrh r1, [r4, 0x6] lsls r1, 16 ldrh r0, [r4, 0x4] orrs r0, r1 str r0, [sp, 0x4] mov r0, sp bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_085B7950 movs r1, 0x74 movs r2, 0x50 movs r3, 0x51 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 ldr r0, =0x0203ab88 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 .pool 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, =0x02021bc0 lsls r0, 3 adds r0, r1 ldr r1, =0x0203ab88 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 .pool thumb_func_end sub_814399C thumb_func_start sub_81439C8 sub_81439C8: ; 81439C8 push {r4-r6,lr} movs r4, 0 ldr r5, =0x0203ab88 ldr r6, =0x02020630 @081439D0: movs r3, 0x39 subs r3, r4 lsls r3, 24 lsrs r3, 24 ldr r0, =gUnknown_085B7928 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 .pool 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, =0x0203ab88 ldr r0, [r0] adds r0, 0x3C ldrb r5, [r0] movs r6, 0 ldr r7, =0x02020630 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, =nullsub_12 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 .pool thumb_func_end sub_8143A40 thumb_func_start sub_8143AC8 sub_8143AC8: ; 8143AC8 push {r4,r5,lr} adds r3, r0, 0 ldr r0, =0x0203ab88 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, =0x01670000 cmp r1, r0 ble @08143B08 ldr r5, =0xfffffe98 adds r0, r2, r5 b @08143B06 .align 2, 0 .pool @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, =0x0203ab88 ldr r4, [r5] lsls r0, 16 asrs r0, 16 bl __floatsisf ldr r1, =0x41f00000 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 .pool 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, =0x0203ab88 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, =0x43b40000 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 .pool @08143BD4: ldr r1, =0x00000000 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, =0x030075f0 ldr r4, =0x0000ffff ldrh r2, [r7, 0x24] lsls r2, 24 asrs r2, 24 adds r1, r4, 0 bl MPlayPanpotControl ldr r0, =0x03007630 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 .pool thumb_func_end sub_8143B84 thumb_func_start sub_8143C90 sub_8143C90: ; 8143C90 push {r4,r5,lr} adds r5, r0, 0 ldr r0, =0x0203ab88 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, =0x01670000 cmp r1, r0 ble @08143CAE ldr r1, =0xfffffe98 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, =0x02021bbe asrs r0, 12 ldrh r1, [r1] adds r0, r1 strh r0, [r5, 0x26] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 ldr r6, [r7] adds r4, r6, 0 adds r4, 0x94 adds r0, r6, 0 adds r0, 0xA0 ldr r0, [r0] ldr r1, =0x40000000 bl __subsf3 adds r1, r0, 0 ldr r0, [r4] bl __lesf2 cmp r0, 0 bgt @08143DF8 b @08143D8C .align 2, 0 .pool @08143D6C: ldr r7, =0x0203ab88 ldr r6, [r7] adds r4, r6, 0 adds r4, 0x94 adds r0, r6, 0 adds r0, 0xA0 ldr r0, [r0] ldr r1, =0x40000000 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, =sub_8143C90 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, =0x00000000 str r0, [r1] str r0, [r2] subs r1, 0xC ldr r0, =0xbf800000 str r0, [r1] @08143DF8: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B6348 mov r10, r0 ldr r1, =0x0203ab88 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 .pool @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, =gUnknown_085B6348 mov r10, r0 ldr r1, =0x0203ab88 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, =0x40000000 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, =0x00000000 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, =sub_8143CFC 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 .pool 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, =0x3d4ccccd 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, =0x0203ab88 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, =sub_8143C90 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 .pool 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, =0x02020630 ldr r0, =0x0203ab88 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 .pool @08144098: lsls r0, r1, 16 asrs r0, 16 movs r2, 0x3C ldrsh r1, [r3, r2] cmp r0, r1 bge @081440E4 ldr r2, =0x02020630 ldr r0, =0x0203ab88 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 .pool @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, =sub_8143FA4 str r0, [r3, 0x1C] movs r0, 0x3D bl m4aSongNumStart @0814411E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8144050 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x32] @0814415C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 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, =sub_8143E14 b @0814419C .align 2, 0 .pool @08144194: adds r0, r4, 0 bl sub_81448B8 ldr r0, =sub_8144128 @0814419C: str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 ldr r4, [r0] adds r4, 0x98 ldr r0, [r4] ldr r1, =0xbf800000 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, =0x0203ab88 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, =sub_8143C90 str r0, [r5, 0x1C] movs r0, 0x47 bl m4aSongNumStartOrChange b @0814425C .align 2, 0 .pool @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, =gUnknown_085B62E4 ldr r4, =0x0203ab88 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, =sub_8143C90 str r0, [r6, 0x1C] movs r0, 0x47 bl m4aSongNumStartOrChange b @081443F8 .align 2, 0 .pool @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, =0x00000000 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, =gUnknown_085B6348 b @08144378 .align 2, 0 .pool @08144340: ldr r7, [r4] adds r4, r7, 0 adds r4, 0x8C ldr r5, =gUnknown_085B6348 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, =gUnknown_085B62E4 lsls r1, r2, 3 adds r0, 0x4 adds r1, r0 ldr r2, =0x0203ab88 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 .pool @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, =0x3f000000 b @081443E6 .align 2, 0 .pool @081443E0: adds r1, r3, 0 adds r1, 0x8C ldr r0, =0xbfc00000 @081443E6: str r0, [r1] @081443E8: ldr r0, [r2] adds r0, 0x98 ldr r1, =0x3dae147b str r1, [r0] ldr r0, =prev_quest_read_x24_hm_usage 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 .pool 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, =0x0203ab88 ldr r0, [r4] adds r0, 0x8C ldr r0, [r0] ldr r1, =0x3f000000 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, =0x00000000 str r0, [r1] movs r0, 0x8C adds r0, r2 mov r8, r0 ldr r1, =gUnknown_085B6348 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, =0x43800000 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, =sub_8144264 str r0, [r6, 0x1C] b @081444FA .align 2, 0 .pool @081444BC: ldr r4, [r4] adds r7, r4, 0 adds r7, 0x90 ldr r0, [r7] ldr r6, =0x00000000 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, =0x3ff33333 ldr r3, =0x33333333 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 .pool 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, =0x0203ab88 ldr r5, [r0] adds r0, r5, 0 adds r0, 0x94 ldr r0, [r0] ldr r1, =0x42200000 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, =0x47800000 bl __addsf3 adds r2, r0, 0 @08144556: ldr r0, =0x40800000 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, =0x47800000 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, =sub_8144410 str r0, [r6, 0x1C] @081445B8: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 ldr r0, [r4] adds r0, 0x94 ldr r0, [r0] ldr r1, =0x42700000 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, =0x47800000 bl __addsf3 adds r2, r0, 0 @08144620: ldr r0, =0x41a00000 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, =0x3f800000 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, =0x47800000 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, =sub_8144514 str r0, [r6, 0x1C] @0814468A: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81445D8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B7B0A 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, =0x0203ab88 ldr r0, =gUnknown_085B79F8 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, =gUnknown_085B7ABC 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, =0x02020630 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, =gUnknown_085B6348 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, =0x0000ffff adds r0, r1 adds r3, r0 strh r3, [r2, 0x34] adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 ldr r2, =0x02020630 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 .pool 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, =gUnknown_085B7B12 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, =gUnknown_085B7A10 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, =0x0203ab88 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, =0x02020630 adds r0, r6 ldrh r1, [r7, 0x2E] lsls r1, 24 lsrs r1, 24 bl obj_anim_image_start ldr r0, =gUnknown_085B7AEC 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, =gUnknown_085B6348 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, =0x0203ab88 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 .pool 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, =0x0203ab88 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, =0x00000000 str r0, [r1] adds r2, r6, 0 adds r2, 0x8C ldr r1, =gUnknown_085B6348 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, =0x0203ab88 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 .pool @08144B1C: movs r0, 0x1 strh r0, [r7, 0x2E] ldr r0, =0x0203ab88 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 .pool @08144B38: lsrs r0, r5, 1 strh r0, [r7, 0x2E] ldr r0, =0x0203ab88 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 .pool @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, =0x0203ab88 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 .pool @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, =gUnknown_085B6160 mov r10, r1 @08144BBC: ldr r3, [r4] lsls r0, r6, 3 ldr r1, =gUnknown_085B62E8 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 .pool @08144C48: ldr r0, [sp, 0x10] mov r1, r9 bl __modsi3 add r0, sp ldrb r0, [r0] @08144C54: strh r0, [r7, 0x3C] ldr r1, =sub_8144168 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 .pool 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, =0x0203ab88 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, =gUnknown_085B7B1A ldrh r0, [r0] strh r0, [r1, 0x34] @08144CC0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B7B2E 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, =0x02021bbe 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 .pool @08144D54: ldr r1, =0x02021bbe movs r0, 0 strh r0, [r1] ldr r2, =0x02020630 ldr r0, =0x0203ab88 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 .pool 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, =0x3d1fbe77 bl __mulsf3 adds r1, r4, 0 bl __mulsf3 bl __fixsfsi strh r0, [r5, 0x26] ldr r0, =0x0203ab88 ldr r3, [r0] ldr r2, =gUnknown_085B7B1A 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, =sub_8144C70 str r3, [r5, 0x1C] ldr r2, =0x02020630 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, =0x0000fffe 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, =sub_8144CD0 str r1, [r0] movs r0, 0xD6 bl m4aSongNumStart @08144E3E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab88 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, =gUnknown_085B6348 ldrb r0, [r3, 0x4] lsls r0, 30 lsrs r0, 25 adds r0, r1 ldrh r0, [r0, 0x8] b @08144EA6 .align 2, 0 .pool @08144E94: movs r0, 0x34 ldrsh r2, [r1, r0] ldr r1, =gUnknown_085B6348 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, =0x0203ab88 ldr r1, [r2] movs r0, 0x1 strb r0, [r1, 0x1] ldr r1, [r2] ldr r0, =gUnknown_085B7B1A ldrh r0, [r0] strh r0, [r1, 0x34] b @08144F7C .align 2, 0 .pool @08144EE4: ldr r5, =0x0203ab88 ldr r3, [r5] ldr r2, =gUnknown_085B7B1A 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, =gUnknown_085B6348 ldrb r0, [r3, 0x4] lsls r0, 30 lsrs r0, 25 adds r0, r1 ldrh r0, [r0, 0xA] b @08144F42 .align 2, 0 .pool @08144F30: movs r0, 0x34 ldrsh r2, [r1, r0] ldr r1, =gUnknown_085B6348 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, =0x02020630 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, =sub_8144D94 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, =nullsub_12 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x3C] @08144F7C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =nullsub_12 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, =0x02020630 ldr r4, =0x0203ab88 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 .pool 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, =0x0203ab88 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, =sub_8144FB0 str r0, [r4, 0x1C] ldr r2, =0x02020630 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 .pool 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, =gUnknown_085B7B46 mov r0, sp movs r2, 0x2 bl memcpy add r5, sp, 0x4 ldr r1, =gUnknown_085B7B48 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, =0x0203ab88 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, =0x030075f0 ldr r5, =0x0000ffff lsls r4, 24 asrs r4, 24 adds r1, r5, 0 adds r2, r4, 0 bl MPlayPanpotControl ldr r0, =0x03007630 adds r1, r5, 0 adds r2, r4, 0 bl MPlayPanpotControl b @08145208 .align 2, 0 .pool @0814516C: lsls r0, r1, 16 cmp r0, 0 blt @081451BC ldr r0, =0x0203ab88 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 .pool @081451BC: movs r0, 0x5E bl m4aSongNumStartOrChange ldr r0, =0x0203ab88 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 .pool @081451E0: movs r0, 0x98 lsls r0, 1 movs r1, 0x3F negs r1, r1 bl cry_related @081451EC: ldr r0, =0x0203ab88 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, =sub_8145030 str r0, [r4, 0x1C] @08145208: add sp, 0x14 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085B7B46 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, =0x0203ab88 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, =0x02020630 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 .pool @08145284: ldr r0, =sub_8144F94 str r0, [r4, 0x1C] @08145288: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8145218 thumb_func_start sub_8145294 sub_8145294: ; 8145294 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203ab88 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, =gUnknown_085B6348 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, =0x02020630 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 .pool @081452DC: movs r0, 0x34 ldrsh r2, [r1, r0] ldr r1, =gUnknown_085B6348 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, =0x02020630 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, =sub_8145218 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, =sub_81450D8 str r1, [r0] movs r0, 0x2B bl m4aSongNumStart @0814533E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030061ec ldrb r0, [r0] cmp r0, 0x1 beq @081453F8 cmp r0, 0x1 bgt @0814537C cmp r0, 0 beq @08145382 b @0814544A .align 2, 0 .pool @0814537C: cmp r0, 0x2 beq @08145434 b @0814544A @08145382: ldr r5, =0x0203ab90 ldr r0, [r5] cmp r0, 0 bne @0814539E movs r0, 0x1C bl malloc_and_clear str r0, [r5] ldr r4, =0x0203ab94 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, =gUnknown_085B8C10 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 .pool @081453F8: movs r4, 0 ldr r1, =0x0203ab90 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, =0x030061ec ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0814544A .align 2, 0 .pool @08145434: adds r0, r7, 0 bl sub_8145814 ldr r0, =gUnknown_085B8BF0 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 .pool 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, =0x0203ab90 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 .pool @081454A4: ldr r5, =0x0203ab90 ldr r0, [r5] ldrb r0, [r0, 0x10] cmp r0, 0 bne @081454B8 bl sub_814560C b @0814552A .align 2, 0 .pool @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, =0x0203ab90 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 .pool 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, =0x03007420 ldr r0, [r0, 0x4] cmp r0, 0 bge @08145582 ldr r6, =0x0203ab90 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 .pool @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, =0x0203ab90 ldr r1, [r0] movs r0, 0x1 strb r0, [r1, 0x10] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8145588 thumb_func_start sub_81455A8 sub_81455A8: ; 81455A8 push {r4,lr} ldr r3, =0x03002f50 movs r0, 0 ldrsb r0, [r3, r0] cmp r0, 0x1 bgt @081455C0 ldr r0, =0x030066d0 b @081455D8 .align 2, 0 .pool @081455C0: ldr r2, =0x03006380 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, =0x0203ab90 @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 .pool thumb_func_end sub_81455A8 thumb_func_start sub_814560C sub_814560C: ; 814560C push {r4,lr} ldr r4, =0x0203ab90 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 .pool 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, =0x0203ab90 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, =gUnknown_085B8C10 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 .pool 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 gUnknown_085B8C30 @08145774: .4byte 0x0203ab94 @08145778: .4byte gUnknown_085B8770 @0814577C: .4byte gUnknown_085B8C32 @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 gUnknown_085B8770 @0814580C: .4byte gUnknown_085B8C32 @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, =0x030061ec ldrb r0, [r6] cmp r0, 0 beq @08145874 cmp r0, 0x1 beq @081458B0 b @081458F8 .align 2, 0 .pool @08145874: ldr r5, =0x0203ab98 ldr r0, [r5] cmp r0, 0 bne @08145884 movs r0, 0x8 bl malloc_and_clear str r0, [r5] @08145884: ldr r1, =gUnknown_085B8438 adds r0, r7, 0 movs r2, 0 movs r3, 0 bl Window_CopyToPixels ldr r0, =gUnknown_085B8418 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 .pool @081458B0: ldr r0, =gUnknown_085B8C80 bl gpu_tile_obj_alloc_and_load_multiple ldr r0, =gUnknown_085B8C90 bl gpu_pal_obj_alloc_and_load_multiple ldr r0, =gUnknown_085B8C68 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, =0x0203ab98 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 .pool thumb_func_end sub_8145850 thumb_func_start sub_8145914 sub_8145914: ; 8145914 push {r4-r6,lr} ldr r4, =0x02020630 ldr r6, =0x0203ab98 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, =0x0203ab90 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 .pool 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, =0x02020630 ldr r4, =0x0203ab98 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, =0x0203ab90 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 .pool @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, =0x0203ab98 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 .pool @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, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r2 movs r1, 0x80 lsls r1, 1 orrs r0, r1 ldr r1, =0x0000ffff 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 ObjAffineSet 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, =gUnknown_08329F40 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 .pool 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, =0x0203ab98 ldr r0, [r1] strb r2, [r0, 0x1] ldr r1, [r1] movs r0, 0x5 strb r0, [r1, 0x2] pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021cc4 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DAB 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, =0x0203ab9c 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 .pool 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, =0x00000141 str r0, [sp, 0xC] add r0, sp, 0x10 movs r1, 0 adds r2, r4, 0 bl rbox_template_set ldr r4, =0x0203ab9c 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 .pool thumb_func_end sub_8145BAC thumb_func_start sub_8145C14 sub_8145C14: ; 8145C14 push {r4,lr} ldr r4, =0x0203ab9c ldrb r0, [r4] movs r1, 0x1 bl sub_819746C ldrb r0, [r4] bl Window_Remove pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8145C14 thumb_func_start sub_8145C30 sub_8145C30: ; 8145C30 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00000494 adds r1, r0 ldr r0, =0x03005d90 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 .pool thumb_func_end sub_8145C30 thumb_func_start sub_8145C58 sub_8145C58: ; 8145C58 lsls r0, 16 lsrs r0, 16 ldr r1, =0x03005d8c ldr r2, [r1] ldr r1, =0x03005d90 ldr r1, [r1] adds r1, 0xAC ldr r1, [r1] eors r0, r1 ldr r1, =0x00000494 adds r2, r1 strh r0, [r2] bx lr .align 2, 0 .pool 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, =0x0000270e cmp r1, r0 bls @08145C9C movs r0, 0 b @08145CC0 .align 2, 0 .pool @08145C9C: adds r0, r1, r4 cmp r1, r0 ble @08145CAC ldr r0, =0x0000270f b @08145CBA .align 2, 0 .pool @08145CAC: lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x0000270f 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 .pool 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, =0x0000ffff b @08145D26 .align 2, 0 .pool @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, =gUnknown_085B91B8 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 .pool @08145D90: adds r0, r4, 0x4 adds r0, r1, r0 ldr r0, [r0] b @08145DBA @08145D98: cmp r0, r3 bne @08145DB8 ldr r5, =gUnknown_085B91B8 @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 .pool 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, =0x020375f0 bl brm_get_pokemon_selection lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r1, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =sub_8145E0C str r0, [r1] movs r0, 0x1 @08145DF2: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end hm_prepare_rocksmash thumb_func_start sub_8145E0C sub_8145E0C: ; 8145E0C push {lr} bl brm_get_pokemon_selection ldr r1, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] ldr r0, =gUnknown_082908FD bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_8145E74 lsrs r0, r2, 16 strh r0, [r1, 0x18] strh r2, [r1, 0x1A] ldr r0, =0x02038c08 ldr r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl sub_81B1B44 movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0300120b ldrb r0, [r4] cmp r0, 0 beq @08145E98 cmp r0, 0x1 beq @08145EAC b @08145EC0 .align 2, 0 .pool @08145E98: ldr r0, =0x0300120a ldrb r0, [r0] bl sub_8145F6C ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] b @08145EC0 .align 2, 0 .pool @08145EAC: bl sub_8145F20 lsls r0, 24 cmp r0, 0 beq @08145EC0 movs r0, 0 strb r0, [r4] ldr r0, =c2_exit_to_overworld_2_switch 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 .pool thumb_func_end sub_8145E84 thumb_func_start sub_8145EDC sub_8145EDC: ; 8145EDC push {lr} ldr r1, =0x0300120a strb r0, [r1] ldr r0, =sub_8145E84 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8145EDC thumb_func_start sub_8145EF4 sub_8145EF4: ; 8145EF4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x030022c0 ldr r1, =sub_8085E50 str r1, [r2, 0x4] bl sub_8145F6C pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8145FA8 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005e00 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 .pool @08145F4C: adds r0, r2, 0 bl remove_task ldr r4, =0x0203aba0 ldr r0, [r4] bl free movs r0, 0 str r0, [r4] movs r0, 0x1 @08145F60: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =sub_8145FA8 movs r1, 0x2 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xA] ldr r4, =0x0203aba0 movs r0, 0x3C bl malloc_and_clear str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085C8A98 ldr r2, =0x03005e00 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 .pool 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, =0x02037b14 ldr r1, =0x02037714 ldr r2, =0x04000100 bl CpuSet ldr r1, =gUnknown_085C8948 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 .pool @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, =gUnknown_085C8948 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 .pool @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, =gUnknown_085C89F0 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 .pool 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, =gUnknown_085C89F0 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 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_085C8AA8 ldr r2, =0x03005e00 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081461F4 ldr r0, =sub_814610C 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 .pool 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, =gUnknown_085C8AB4 ldr r2, =0x03005e00 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 .pool 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, =0x020393a8 ldr r1, =0x0203aba0 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, =sub_8146320 bl SetVBlankCallback ldr r0, =sub_8146358 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 .pool thumb_func_end sub_814623C thumb_func_start sub_81462A8 sub_81462A8: ; 81462A8 push {r4,r5,lr} sub sp, 0x8 ldr r4, =0x0203aba0 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, =0x02038c28 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081462FA ldr r0, =sub_8146204 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 .pool thumb_func_end sub_81462A8 thumb_func_start sub_8146320 sub_8146320: ; 8146320 push {lr} bl sub_8149F2C ldr r0, =0x0203aba0 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0 beq @08146344 ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @08146344: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8146320 thumb_func_start sub_8146358 sub_8146358: ; 8146358 ldr r1, =0x02038c28 ldr r0, =0x04000006 ldrh r0, [r0] lsls r0, 1 movs r2, 0xF0 lsls r2, 3 adds r1, r2 adds r0, r1 ldrh r1, [r0] ldr r0, =0x04000014 strh r1, [r0] adds r0, 0x4 strh r1, [r0] adds r0, 0x4 strh r1, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_085C8ABC ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 ldr r1, [r0] ldr r0, =0x020393a8 movs r2, 0x16 ldrsh r1, [r1, r2] movs r2, 0xA0 lsls r2, 1 bl memset ldr r0, =sub_81464B0 bl SetVBlankCallback ldr r0, =sub_81464E8 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 .pool thumb_func_end sub_81463BC thumb_func_start sub_8146420 sub_8146420: ; 8146420 push {r4-r7,lr} ldr r1, =0x0203aba0 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, =0x02038c28 lsls r2, r5, 1 adds r2, r1 ldr r6, =0x0203aba0 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0814648E ldr r0, =sub_8146384 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 .pool thumb_func_end sub_8146420 thumb_func_start sub_81464B0 sub_81464B0: ; 81464B0 push {lr} bl sub_8149F2C ldr r0, =0x0203aba0 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0 beq @081464D4 ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @081464D4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81464B0 thumb_func_start sub_81464E8 sub_81464E8: ; 81464E8 ldr r1, =0x02038c28 ldr r0, =0x04000006 ldrh r0, [r0] lsls r0, 1 movs r2, 0xF0 lsls r2, 3 adds r1, r2 adds r0, r1 ldrh r1, [r0] ldr r0, =0x04000016 strh r1, [r0] adds r0, 0x4 strh r1, [r0] adds r0, 0x4 strh r1, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_085C8AFC ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C8AC4 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C8AE0 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C8B14 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C8B2C ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C8B44 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C8B5C ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 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, =0x00003f41 strh r0, [r2, 0xE] ldrh r0, [r4, 0xA] lsls r0, 8 ldrh r1, [r4, 0xC] orrs r0, r1 strh r0, [r2, 0x10] ldr r0, =0x02038c28 movs r2, 0xF0 movs r1, 0x9F ldr r3, =0x000008be adds r0, r3 @081466E2: strh r2, [r0] subs r0, 0x2 subs r1, 0x1 cmp r1, 0 bge @081466E2 ldr r0, =sub_8146F3C bl SetVBlankCallback pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x01000400 bl CpuSet ldr r0, =gUnknown_085BAED0 ldr r1, [sp, 0x8] bl LZ77UnCompVram ldr r0, =gUnknown_085BAEB0 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 .pool 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, =0x01000400 bl CpuSet ldr r0, =gUnknown_085BB4A4 ldr r1, [sp, 0x8] bl LZ77UnCompVram ldr r0, =gUnknown_085BAEB0 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 .pool 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, =0x01000400 bl CpuSet ldr r0, =gUnknown_085BBC14 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 .pool 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, =0x01000400 mov r0, sp bl CpuSet ldr r0, =gUnknown_085B9330 ldr r1, [sp, 0x8] movs r2, 0xB0 lsls r2, 2 bl CpuSet ldr r0, =gUnknown_085C8ED4 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 .pool 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, =gUnknown_085C9020 movs r1, 0 ldr r0, [sp, 0x8] mov r9, r0 ldr r6, =0x02038c28 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 .pool 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, =gUnknown_085BB248 ldr r1, [sp, 0x8] bl LZ77UnCompVram ldr r0, =0x02038c28 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 .pool 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, =gUnknown_085BB930 ldr r1, [sp, 0x8] bl LZ77UnCompVram ldr r0, =0x02038c28 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 .pool 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, =gUnknown_085BC2B4 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085BC314 ldr r1, [sp, 0x8] movs r2, 0xA0 lsls r2, 2 bl CpuSet ldr r0, =0x02038c28 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 .pool 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, =gUnknown_085BC2D4 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085BCB14 ldr r1, [sp, 0x8] movs r2, 0xA0 lsls r2, 2 bl CpuSet ldr r0, =0x02038c28 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 .pool 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, =gUnknown_085BC2F4 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085BD314 ldr r1, [sp, 0x8] movs r2, 0xA0 lsls r2, 2 bl CpuSet ldr r0, =0x02038c28 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 .pool 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, =0x01000400 mov r0, sp bl CpuSet ldr r0, =gUnknown_085BDB34 ldr r1, [sp, 0x8] bl LZ77UnCompVram ldr r0, =gUnknown_085BE1E8 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 .pool 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, =gUnknown_085BEDA0 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 .pool 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, =gUnknown_085BEEE0 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 .pool 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, =0xffff8000 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 .pool thumb_func_end sub_8146B7C thumb_func_start sub_8146BA8 sub_8146BA8: ; 8146BA8 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08146BDE ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff 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 .pool 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, =0x0203aba0 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, =0xffffff00 adds r1, r0, 0 ldrh r5, [r3, 0x12] adds r1, r5 strh r1, [r3, 0x12] ldr r0, =0x02038c28 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 .pool 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, =0x0203aba0 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, =0xffffff00 adds r1, r0, 0 ldrh r5, [r3, 0x12] adds r1, r5 strh r1, [r3, 0x12] ldr r0, =0x02038c28 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 .pool 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, =0x0203aba0 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, =0xffffff00 adds r1, r0, 0 ldrh r3, [r4, 0x12] adds r1, r3 strh r1, [r4, 0x12] ldr r0, =0x02038c28 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 .pool 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, =0x0000ffff 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 .pool thumb_func_end sub_8146DAC thumb_func_start sub_8146DD8 sub_8146DD8: ; 8146DD8 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 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 .pool thumb_func_end sub_8146DD8 thumb_func_start sub_8146DF8 sub_8146DF8: ; 8146DF8 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203aba0 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, =0x000003ff 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, =0x02038c28 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, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff 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 .pool @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, =sub_8146F68 bl SetVBlankCallback @08146EA4: ldr r0, =0x0203aba0 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 .pool thumb_func_end sub_8146DF8 thumb_func_start sub_8146EC0 sub_8146EC0: ; 8146EC0 push {lr} ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff ands r0, r2 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] bl sub_8149F2C ldr r2, =0x0203aba0 ldr r0, [r2] ldrb r0, [r0] cmp r0, 0 beq @08146EF8 ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r3, 0xF0 lsls r3, 3 adds r0, r3 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @08146EF8: ldr r1, =0x04000048 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 .pool thumb_func_end sub_8146EC0 thumb_func_start sub_8146F3C sub_8146F3C: ; 8146F3C push {lr} bl sub_8146EC0 ldr r1, =0x040000b0 ldr r0, =0x020393a8 str r0, [r1] ldr r0, =0x04000010 str r0, [r1, 0x4] ldr r0, =0xa2400001 str r0, [r1, 0x8] ldr r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8146F3C thumb_func_start sub_8146F68 sub_8146F68: ; 8146F68 push {lr} bl sub_8146EC0 ldr r1, =0x040000b0 ldr r0, =0x020393a8 str r0, [r1] ldr r0, =0x04000040 str r0, [r1, 0x4] ldr r0, =0xa2400001 str r0, [r1, 0x8] ldr r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085C8B7C ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085B98B0 ldr r1, [sp, 0x8] movs r2, 0x20 bl CpuSet movs r0, 0 str r0, [sp] ldr r1, [sp, 0x4] ldr r2, =0x05000200 mov r0, sp bl CpuSet ldr r0, =gUnknown_085C8ED4 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 .pool 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, =gUnknown_085C8B88 mov r0, sp movs r2, 0x4 bl memcpy add r4, sp, 0x4 ldr r1, =gUnknown_085C8B8C 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, =0x02038c08 @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 .pool 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, =sub_8146F94 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 .pool thumb_func_end sub_81470A4 thumb_func_start sub_81470D0 sub_81470D0: ; 81470D0 push {r4,r5,lr} ldr r0, =gUnknown_085C8E68 ldr r5, =0x02038c08 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, =0x02020630 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, =0x0000ffff 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 .pool 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, =gUnknown_085C8B96 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 .pool @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, =0x04000008 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, =0x0000f001 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 .pool 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, =gUnknown_085C8B9C ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x2] movs r0, 0x3F strh r0, [r1, 0x4] ldr r0, =0x0000f0f1 strh r0, [r1, 0x6] movs r0, 0xA0 strh r0, [r1, 0x8] movs r1, 0 ldr r3, =0x020393a8 ldr r2, =0x0000f3f4 @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, =sub_8147688 bl SetVBlankCallback ldr r0, =0x0203aba0 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 .pool 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, =0x0203aba0 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, =0x02038c28 @081472D4: ldr r4, =0x0203aba0 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 .pool 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, =0x0203aba0 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, =0x02038c28 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 .pool @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, =0x0203aba0 @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 .pool 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, =0x0203aba0 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, =0x02038c28 @08147456: ldr r4, =0x0203aba0 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 .pool 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, =0x0203aba0 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, =0x02038c28 mov r10, r7 ldr r0, =0x0203aba0 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 .pool @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, =0x02038c28 adds r3, r1, 0 ldr r5, =0x0203aba0 @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, =0x0203aba0 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 .pool 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, =0x0203aba0 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, =0x02038c28 @081475DC: movs r2, 0x78 ldr r5, =0x0203aba0 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 .pool thumb_func_end sub_81475B0 thumb_func_start sub_8147648 sub_8147648: ; 8147648 push {lr} ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff ands r0, r2 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] bl sub_8149F84 ldr r0, =sub_8147204 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 .pool thumb_func_end sub_8147648 thumb_func_start sub_8147688 sub_8147688: ; 8147688 push {r4,lr} ldr r4, =0x040000b0 ldrh r1, [r4, 0xA] ldr r0, =0x0000c5ff ands r0, r1 strh r0, [r4, 0xA] ldrh r1, [r4, 0xA] ldr r0, =0x00007fff ands r0, r1 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C ldr r3, =0x0203aba0 ldr r0, [r3] ldrb r0, [r0] cmp r0, 0 beq @081476C0 ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @081476C0: ldr r2, =0x04000048 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, =0x02038c28 movs r1, 0xF0 lsls r1, 3 adds r0, r1 ldrh r1, [r0] strh r1, [r2] str r0, [r4] str r2, [r4, 0x4] ldr r0, =0xa2400001 str r0, [r4, 0x8] ldr r0, [r4, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085C8BB8 ldr r2, =0x03005e00 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 .pool 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, =0x020393a8 ldr r3, =0x0203aba0 @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, =sub_8147888 bl SetVBlankCallback ldr r0, =sub_81478C0 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 .pool 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, =0x0203aba0 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, =0x1fff0000 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, =0x02038c28 lsls r2, r5, 1 adds r2, r1 ldr r1, =0x0203aba0 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0814785A ldr r0, =sub_8147718 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @0814785A: ldr r0, =0x0203aba0 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 .pool thumb_func_end sub_81477A8 thumb_func_start sub_8147888 sub_8147888: ; 8147888 push {lr} bl sub_8149F2C ldr r0, =0x0203aba0 ldr r0, [r0] ldrb r0, [r0] cmp r0, 0 beq @081478AC ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @081478AC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8147888 thumb_func_start sub_81478C0 sub_81478C0: ; 81478C0 ldr r1, =0x02038c28 ldr r0, =0x04000006 ldrh r0, [r0] lsls r0, 1 movs r2, 0xF0 lsls r2, 3 adds r1, r2 adds r0, r1 ldrh r1, [r0] ldr r0, =0x04000016 strh r1, [r0] adds r0, 0x4 strh r1, [r0] adds r0, 0x4 strh r1, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_085C8BC0 ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 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, =0x020393a8 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, =sub_8147A58 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 .pool 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, =0x0203aba0 ldr r1, [r0] ldrb r0, [r1] movs r0, 0 strb r0, [r1] ldr r7, =0x02038c28 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, =0x0203aba0 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 .pool thumb_func_end sub_814797C thumb_func_start sub_8147A18 sub_8147A18: ; 8147A18 push {lr} ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff ands r0, r2 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] bl sub_8149F84 ldr r0, =sub_81478EC 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 .pool thumb_func_end sub_8147A18 thumb_func_start sub_8147A58 sub_8147A58: ; 8147A58 push {r4,lr} ldr r4, =0x040000b0 ldrh r1, [r4, 0xA] ldr r0, =0x0000c5ff ands r0, r1 strh r0, [r4, 0xA] ldrh r1, [r4, 0xA] ldr r0, =0x00007fff ands r0, r1 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C ldr r3, =0x0203aba0 ldr r0, [r3] ldrb r0, [r0] cmp r0, 0 beq @08147A90 ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @08147A90: ldr r2, =0x04000048 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, =0x020393a8 str r0, [r4] ldr r0, =0x04000040 str r0, [r4, 0x4] ldr r0, =0xa2400001 str r0, [r4, 0x8] ldr r0, [r4, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8147A58 thumb_func_start sub_8147AE4 sub_8147AE4: ; 8147AE4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0 strh r2, [r1, 0x26] bl sub_8147B84 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8147AE4 thumb_func_start sub_8147B04 sub_8147B04: ; 8147B04 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0x1 strh r2, [r1, 0x26] bl sub_8147B84 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8147B04 thumb_func_start sub_8147B24 sub_8147B24: ; 8147B24 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0x2 strh r2, [r1, 0x26] bl sub_8147B84 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8147B24 thumb_func_start sub_8147B44 sub_8147B44: ; 8147B44 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0x3 strh r2, [r1, 0x26] bl sub_8147B84 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8147B44 thumb_func_start sub_8147B64 sub_8147B64: ; 8147B64 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0x4 strh r2, [r1, 0x26] bl sub_8147B84 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085C8BCC ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 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, =0x020393a8 ldr r2, =0x0000f0f1 @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, =sub_81480CC 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 .pool 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, =gUnknown_085C94D0 add r1, sp, 0x4 mov r0, sp bl sub_8149F58 ldr r0, =gUnknown_085B9AF0 ldr r1, [sp, 0x4] movs r2, 0xF0 bl CpuSet ldr r1, =gUnknown_085C8FDC 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, =gUnknown_085C8FF0 ldr r0, =0x03005d90 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, =sub_81481E0 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 .pool thumb_func_end sub_8147C24 thumb_func_start sub_8147CE4 sub_8147CE4: ; 8147CE4 push {r4-r7,lr} adds r4, r0, 0 ldr r0, =0x0203aba0 ldr r1, [r0] ldrb r0, [r1] movs r0, 0 strb r0, [r1] ldr r7, =0x02038c28 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, =0x0203aba0 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 .pool thumb_func_end sub_8147CE4 thumb_func_start sub_8147DD0 sub_8147DD0: ; 8147DD0 push {r4,r5,lr} adds r4, r0, 0 ldr r2, =0x0203aba0 ldr r1, [r2] ldrb r0, [r1] movs r0, 0 strb r0, [r1] ldr r1, =0x02038c28 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 .pool thumb_func_end sub_8147DD0 thumb_func_start sub_8147E4C sub_8147E4C: ; 8147E4C push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203aba0 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 .pool 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, =0x0203aba0 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, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff ands r0, r2 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] ldr r4, =0x02038c28 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, =sub_8148160 bl SetVBlankCallback @08147F1C: movs r0, 0 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8147E88 thumb_func_start sub_8147F40 sub_8147F40: ; 8147F40 push {r4-r7,lr} adds r4, r0, 0 ldr r2, =0x0203aba0 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, =0x02038c28 @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 .pool thumb_func_end sub_8147F40 thumb_func_start sub_8148008 sub_8148008: ; 8148008 push {r4-r6,lr} adds r4, r0, 0 ldr r5, =0x0203aba0 ldr r0, [r5] ldrb r1, [r0] movs r6, 0 strb r6, [r0] movs r0, 0x1 negs r0, r0 ldr r2, =0x00007fff 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 .pool thumb_func_end sub_8148008 thumb_func_start sub_8148040 sub_8148040: ; 8148040 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x0203aba0 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, =0x02038c28 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 .pool thumb_func_end sub_8148040 thumb_func_start sub_814808C sub_814808C: ; 814808C push {r4,lr} adds r4, r0, 0 ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff 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 .pool thumb_func_end sub_814808C thumb_func_start sub_81480CC sub_81480CC: ; 81480CC push {r4,lr} ldr r4, =0x040000b0 ldrh r1, [r4, 0xA] ldr r0, =0x0000c5ff ands r0, r1 strh r0, [r4, 0xA] ldrh r1, [r4, 0xA] ldr r0, =0x00007fff ands r0, r1 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C ldr r3, =0x0203aba0 ldr r0, [r3] ldrb r0, [r0] cmp r0, 0 beq @08148104 ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @08148104: ldr r2, =0x04000012 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, =0x020393a8 str r0, [r4] ldr r0, =0x04000040 str r0, [r4, 0x4] ldr r0, =0xa2400001 str r0, [r4, 0x8] ldr r0, [r4, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81480CC thumb_func_start sub_8148160 sub_8148160: ; 8148160 push {r4,lr} ldr r4, =0x040000b0 ldrh r1, [r4, 0xA] ldr r0, =0x0000c5ff ands r0, r1 strh r0, [r4, 0xA] ldrh r1, [r4, 0xA] ldr r0, =0x00007fff ands r0, r1 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C ldr r2, =0x0203aba0 ldr r0, [r2] ldrb r0, [r0] cmp r0, 0 beq @08148198 ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r3, 0xF0 lsls r3, 3 adds r0, r3 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @08148198: ldr r1, =0x04000050 ldr r0, [r2] ldrh r0, [r0, 0xE] strh r0, [r1] ldr r0, =0x020393a8 str r0, [r4] ldr r0, =0x04000054 str r0, [r4, 0x4] ldr r0, =0xa2400001 str r0, [r4, 0x8] ldr r0, [r4, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8148160 thumb_func_start sub_81481E0 sub_81481E0: ; 81481E0 push {lr} ldr r0, =0x04000006 ldrh r0, [r0] cmp r0, 0x4F bhi @08148200 ldr r1, =0x04000010 ldr r0, =0x0203aba0 ldr r0, [r0] ldrh r0, [r0, 0x18] b @08148208 .align 2, 0 .pool @08148200: ldr r1, =0x04000010 ldr r0, =0x0203aba0 ldr r0, [r0] ldrh r0, [r0, 0x1A] @08148208: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085C8BF4 movs r2, 0x26 ldrsh r1, [r4, r2] mov r8, r1 add r0, r8 ldrb r0, [r0] ldr r2, =gUnknown_085C8C0E 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, =0x0201c000 str r5, [sp] movs r3, 0 bl sub_80B5E6C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x22] ldr r0, =0x03005d90 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, =0x02020630 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, =sub_8148380 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, =gUnknown_085C8BFA 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, =0xfffffe00 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 .pool thumb_func_end sub_8148218 thumb_func_start sub_8148380 sub_8148380: ; 8148380 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =gUnknown_085C8C24 @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 .pool 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, =gUnknown_085C8C40 mov r0, sp movs r2, 0x4 bl memcpy add r4, sp, 0x4 ldr r1, =gUnknown_085C8C44 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 .pool 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, =0x02020630 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 .pool thumb_func_end sub_8148484 thumb_func_start sub_814849C sub_814849C: ; 814849C ldr r2, =0x02020630 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 .pool thumb_func_end sub_814849C thumb_func_start sub_81484B8 sub_81484B8: ; 81484B8 ldr r2, =0x02020630 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 .pool 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, =gUnknown_085C8C48 ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 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, =0x020393a8 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, =sub_814869C bl SetVBlankCallback ldr r0, =sub_8148728 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 .pool 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, =0x0203aba0 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, =0x00000fff 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, =0x02038c28 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 .pool @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, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff ands r0, r2 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] bl sub_8149F84 ldr r0, =sub_81484D0 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 .pool thumb_func_end sub_814865C thumb_func_start sub_814869C sub_814869C: ; 814869C push {r4,lr} ldr r4, =0x040000b0 ldrh r1, [r4, 0xA] ldr r0, =0x0000c5ff ands r0, r1 strh r0, [r4, 0xA] ldrh r1, [r4, 0xA] ldr r0, =0x00007fff ands r0, r1 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C ldr r2, =0x04000048 ldr r0, =0x0203aba0 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, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x80000140 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @081486E6: ldr r0, =0x020394e8 str r0, [r4] ldr r0, =0x04000040 str r0, [r4, 0x4] ldr r0, =0xa2400001 str r0, [r4, 0x8] ldr r0, [r4, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814869C thumb_func_start sub_8148728 sub_8148728: ; 8148728 push {lr} ldr r2, =0x04000006 ldrh r0, [r2] cmp r0, 0x9F bhi @0814874E ldr r1, =0x02038c28 ldrh r0, [r2] lsls r0, 1 movs r2, 0xF0 lsls r2, 3 adds r1, r2 adds r0, r1 ldrh r1, [r0] ldr r0, =0x04000014 strh r1, [r0] adds r0, 0x4 strh r1, [r0] adds r0, 0x4 strh r1, [r0] @0814874E: pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085C8C54 ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 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, =0x02038c28 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, =0x0203aba0 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, =sub_814869C bl SetVBlankCallback ldr r0, =sub_8148728 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 .pool 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, =gUnknown_085C8C64 mov r0, sp movs r2, 0x2 bl memcpy add r4, sp, 0x4 ldr r1, =gUnknown_085C8C66 adds r0, r4, 0 movs r2, 0x4 bl memcpy ldr r2, =0x0203aba0 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, =0x02038ea8 adds r4, r1, r0 movs r2, 0xA0 lsls r2, 1 adds r0, r2 adds r3, r1, r0 ldr r0, =0x02039128 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 .pool @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, =0x00000fff 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, =0x02038c28 adds r2, r0, r1 ldr r1, =0x02038d68 adds r3, r0, r1 ldr r0, =0x0203aba0 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, =0x02038ea8 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, =0x02039128 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 .pool @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, =0x00000fff 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, =0x02038c28 adds r2, r0, r1 ldr r1, =0x02038d68 adds r3, r0, r1 ldr r1, =0x0203aba0 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, =0x0203aba0 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 .pool 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, =0x0000ff10 movs r1, 0 ldr r4, =0x020393a8 @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 .pool thumb_func_end sub_8148AD4 thumb_func_start sub_8148B14 sub_8148B14: ; 8148B14 push {lr} ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff ands r0, r2 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] bl sub_8149F84 ldr r0, =sub_8148760 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 .pool 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, =gUnknown_085C8C6C ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C8C78 ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 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, =0x02038c28 movs r2, 0 movs r1, 0x9F ldr r3, =0x000008be adds r0, r3 @08148BEE: strh r2, [r0] subs r0, 0x2 subs r1, 0x1 cmp r1, 0 bge @08148BEE movs r4, 0 ldr r0, =sub_8146F68 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 .pool 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, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff 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 .pool @08148C6C: ldr r5, =0x0203aba0 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, =0x000003ff 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, =0x02038c28 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 .pool @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, =0x0203aba0 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, =gUnknown_085C8C80 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, =0x02038c28 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 .pool thumb_func_end sub_8148CE8 thumb_func_start sub_8148D6C sub_8148D6C: ; 8148D6C push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203aba0 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, =0x02038c28 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, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff 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 .pool @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, =0x0203aba0 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 .pool 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, =gUnknown_085C8C84 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085BACD0 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, =0x01000400 mov r0, sp bl CpuSet ldr r0, =gUnknown_085C8ED4 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, =0x03001210 strb r1, [r5] ldr r0, =0x0000ffff 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, =0x0000fffd strh r2, [r5, 0x1A] strb r4, [r5, 0x1C] ldr r3, =0x00000133 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 .pool 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, =gUnknown_085C8D38 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, =0x03001210 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, =0x0000027d 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, =0x0000f002 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 .pool thumb_func_end sub_8148F4C thumb_func_start sub_8149008 sub_8149008: ; 8149008 push {r4,lr} adds r4, r0, 0 ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff 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 .pool 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, =0x03001208 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 .pool @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, =0x0000027f 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 .pool @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, =gUnknown_085C8D40 ldr r2, =0x03005e00 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 .pool 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, =0x01000400 mov r0, sp bl CpuSet ldr r0, =gUnknown_085BE51C ldr r1, [sp, 0x8] bl LZ77UnCompVram ldr r0, =gUnknown_085BEA88 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 .pool 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, =gUnknown_085BF0A0 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 .pool 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, =gUnknown_085BF2A0 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 .pool 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, =gUnknown_085C8D60 ldr r2, =0x03005e00 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 .pool 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, =0x00009a08 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, =0x01000400 mov r0, sp bl CpuSet ldr r0, =gUnknown_085BF6A0 ldr r1, [sp, 0x8] movs r2, 0x80 lsls r2, 5 bl CpuSet ldr r0, =0x0203aba0 ldr r1, [r0] movs r0, 0 strh r0, [r1, 0x20] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] ldr r0, =gUnknown_085BF540 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply movs r2, 0 ldr r3, =0x02038c28 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, =sub_8149508 bl SetVBlankCallback movs r0, 0 add sp, 0xC pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085C6BE0 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 .pool 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, =gUnknown_085BF4A0 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 .pool 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, =0xffff8000 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 .pool thumb_func_end sub_81493D8 thumb_func_start sub_8149410 sub_8149410: ; 8149410 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0814942E ldr r0, =0x0203aba0 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 .pool thumb_func_end sub_8149410 thumb_func_start sub_814943C sub_814943C: ; 814943C push {r4,lr} adds r4, r0, 0 ldr r0, =0x00007fff movs r1, 0x8 movs r2, 0 bl sub_80A2A20 ldr r0, =0xffff8000 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 .pool 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, =gUnknown_085BF4A0 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, =0x0203aba0 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, =sub_8146F68 ldr r3, =0x020393a8 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 .pool thumb_func_end sub_814946C thumb_func_start sub_8149508 sub_8149508: ; 8149508 push {lr} ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff ands r0, r2 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] bl sub_8149F2C ldr r0, =0x0203aba0 ldr r0, [r0] movs r1, 0x20 ldrsh r0, [r0, r1] cmp r0, 0 bne @08149548 ldr r2, =0x02038c28 b @08149554 .align 2, 0 .pool @08149548: ldr r2, =0x02038c28 cmp r0, 0x1 bne @08149554 movs r0, 0xF0 lsls r0, 3 adds r2, r0 @08149554: ldr r1, =0x040000b0 str r2, [r1] ldr r0, =0x04000012 str r0, [r1, 0x4] ldr r0, =0xa2400001 str r0, [r1, 0x8] ldr r0, [r1, 0x8] pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085C8D8C ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 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, =0x020393a8 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, =sub_8149840 bl SetHBlankCallback ldr r0, =sub_8149774 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 .pool 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, =gUnknown_085C8DA0 mov r0, sp movs r2, 0x10 bl memcpy movs r5, 0 movs r4, 0 @0814963C: ldr r0, =sub_8149864 bl obj_add_empty_with_callback lsls r0, 24 lsrs r0, 24 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 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 .pool thumb_func_end sub_8149628 thumb_func_start sub_814969C sub_814969C: ; 814969C push {r4,lr} adds r4, r0, 0 ldr r2, =0x0203aba0 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, =0x00007fff 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 .pool thumb_func_end sub_814969C thumb_func_start sub_81496D8 sub_81496D8: ; 81496D8 push {r4-r6,lr} adds r6, r0, 0 ldr r4, =0x0203aba0 ldr r0, [r4] ldrb r1, [r0] movs r5, 0 strb r5, [r0] ldr r1, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff 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, =sub_8149804 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 .pool thumb_func_end sub_81496D8 thumb_func_start sub_8149740 sub_8149740: ; 8149740 push {lr} ldr r0, =0x0203aba0 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, =sub_8149578 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 .pool thumb_func_end sub_8149740 thumb_func_start sub_8149774 sub_8149774: ; 8149774 push {r4,lr} ldr r4, =0x040000b0 ldrh r1, [r4, 0xA] ldr r0, =0x0000c5ff ands r0, r1 strh r0, [r4, 0xA] ldrh r1, [r4, 0xA] ldr r0, =0x00007fff ands r0, r1 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C ldr r2, =0x04000050 ldr r0, =0x0203aba0 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, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x80000140 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @081497C4: ldr r0, =0x020394e8 str r0, [r4] ldr r0, =0x04000040 str r0, [r4, 0x4] ldr r0, =0xa2400001 str r0, [r4, 0x8] ldr r0, [r4, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8149774 thumb_func_start sub_8149804 sub_8149804: ; 8149804 push {lr} bl sub_8149F2C ldr r1, =0x04000054 ldr r0, =0x0203aba0 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 .pool thumb_func_end sub_8149804 thumb_func_start sub_8149840 sub_8149840: ; 8149840 ldr r2, =0x04000054 ldr r1, =0x02038c28 ldr r0, =0x04000006 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 .pool 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, =0x0203aba0 ldr r1, [r0] ldrb r0, [r1] movs r0, 0x1 strb r0, [r1] b @0814994C .align 2, 0 .pool @08149890: movs r2, 0x22 ldrsh r1, [r3, r2] lsls r1, 1 ldr r0, =0x02038c28 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, =0x0203aba0 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, =0x0203aba0 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 .pool 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, =gUnknown_085C8DB0 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085BACD0 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, =0x01000400 mov r0, sp bl CpuSet ldr r0, =gUnknown_085C8ED4 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 .pool 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, =gUnknown_085BACD0 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 .pool 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, =sub_814995C 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 .pool 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, =gUnknown_085C8DBC ldr r2, =0x03005e00 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 .pool 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, =0x0203aba0 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, =0x02038c28 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, =sub_8149CE8 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 .pool 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, =0x0203aba0 ldr r0, [r0] adds r0, 0x24 ldr r6, =gUnknown_085C8DD0 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 .pool 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, =0x0203aba0 ldr r1, [r0] ldrb r0, [r1] movs r0, 0 strb r0, [r1] mov r8, r0 movs r7, 0 ldr r0, =0x02038c28 mov r9, r0 @08149BA0: ldr r1, =0x02038c28 ldr r0, =0x0203aba0 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 .pool @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, =0x0203aba0 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 .pool @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, =0x0203aba0 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 .pool 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, =0x040000b0 ldrh r2, [r1, 0xA] ldr r0, =0x0000c5ff ands r0, r2 strh r0, [r1, 0xA] ldrh r2, [r1, 0xA] ldr r0, =0x00007fff ands r0, r2 strh r0, [r1, 0xA] ldrh r0, [r1, 0xA] bl sub_8149F84 ldr r0, =sub_8149A6C bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task movs r0, 0 b @08149CC4 .align 2, 0 .pool @08149CAC: ldrh r0, [r2, 0x8] adds r0, 0x1 strh r0, [r2, 0x8] ldr r1, =gUnknown_085C8E16 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 .pool 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, =0x040000b0 ldrh r1, [r4, 0xA] ldr r0, =0x0000c5ff ands r0, r1 strh r0, [r4, 0xA] ldrh r1, [r4, 0xA] ldr r0, =0x00007fff ands r0, r1 strh r0, [r4, 0xA] ldrh r0, [r4, 0xA] bl sub_8149F2C ldr r3, =0x0203aba0 ldr r0, [r3] ldrb r0, [r0] cmp r0, 0 beq @08149D20 ldr r1, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @08149D20: ldr r2, =0x04000048 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, =0x02038c28 movs r1, 0xF0 lsls r1, 3 adds r0, r1 ldrh r1, [r0] strh r1, [r2] str r0, [r4] str r2, [r4, 0x4] ldr r0, =0xa2400001 str r0, [r4, 0x8] ldr r0, [r4, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8149DFC movs r1, 0x3 str r3, [sp] bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 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 .pool thumb_func_end sub_8149D78 thumb_func_start sub_8149DDC sub_8149DDC: ; 8149DDC push {lr} ldr r0, =sub_8149DFC 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 .pool @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, =gUnknown_085C8E24 ldr r2, =0x03005e00 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 .pool 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, =0x00002d6b 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 .pool 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, =0x00002d6b 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, =sub_8149DFC bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task b @08149EFE .align 2, 0 .pool @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, =0x0203aba0 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 .pool 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, =0x04000008 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 .pool thumb_func_end sub_8149F40 thumb_func_start sub_8149F58 sub_8149F58: ; 8149F58 push {r4,lr} ldr r3, =0x04000008 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 .pool 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, =0xffff0000 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 .pool 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, =0xffff0000 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, =0xffff0000 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 .pool 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, =0x01000400 mov r0, sp bl CpuSet ldr r0, =gUnknown_085C7C00 ldr r1, [sp, 0x8] bl LZ77UnCompVram ldr r0, =gUnknown_085C7BE0 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 .pool 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, =gUnknown_085C828C ldr r1, [sp, 0x8] bl LZ77UnCompVram ldr r0, =0x02038c28 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 .pool 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, =gUnknown_085C99D0 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C99E8 ldr r2, =0x03005e00 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 .pool 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, =0x00007fff 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, =0x0203aba0 ldr r2, [r6] ldr r3, =0x00003f41 strh r3, [r2, 0xE] ldrh r0, [r4, 0x14] lsls r0, 8 ldrh r1, [r4, 0x12] orrs r0, r1 strh r0, [r2, 0x10] ldr r0, =0x04000050 strh r3, [r0] ldr r1, =0x04000052 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, =0x01000400 bl CpuSet ldr r0, =gUnknown_085C7C00 ldr r1, [sp, 0x8] bl LZ77UnCompVram ldr r0, =gUnknown_085C7BE0 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 .pool 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, =gUnknown_085C828C 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 .pool 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, =sub_814A684 ldr r4, =0x020393a8 ldr r3, =0x0203aba0 @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, =sub_814A6CC 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 .pool 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, =0x0203aba0 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, =0xfffffe80 adds r0, r1 cmp r0, 0 blt @0814A5A0 adds r0, r2, r1 strh r0, [r4, 0xC] b @0814A5A2 .align 2, 0 .pool @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, =0x02038c28 lsls r2, r5, 1 adds r2, r1 ldr r1, =0x0203aba0 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0814A654 ldr r0, =sub_814A3F4 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, =0x0203aba0 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 .pool thumb_func_end sub_814A550 thumb_func_start sub_814A684 sub_814A684: ; 814A684 push {lr} bl sub_8149F2C ldr r2, =0x04000050 ldr r0, =0x0203aba0 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, =0x040000d4 ldr r0, =0x02038c28 str r0, [r1] movs r2, 0xF0 lsls r2, 3 adds r0, r2 str r0, [r1, 0x4] ldr r0, =0x800000a0 str r0, [r1, 0x8] ldr r0, [r1, 0x8] @0814A6B4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814A684 thumb_func_start sub_814A6CC sub_814A6CC: ; 814A6CC ldr r1, =0x02038c28 ldr r0, =0x04000006 ldrh r0, [r0] lsls r0, 1 movs r2, 0xF0 lsls r2, 3 adds r1, r2 adds r0, r1 ldrh r1, [r0] ldr r0, =0x04000012 strh r1, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_085C99F8 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C9A08 ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C9A1C ldr r2, =0x03005e00 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 .pool 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, =gUnknown_085C8598 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, =gUnknown_085C8578 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 .pool 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, =gUnknown_085C8928 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 .pool 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, =0x02037714 movs r3, 0 ldr r5, =0x02037b14 @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 .pool @0814A8FC: ldr r0, =0xffff7fff movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r0, =gUnknown_085C86F4 b @0814A91E .align 2, 0 .pool @0814A914: ldr r0, =gUnknown_085C87F4 b @0814A91E .align 2, 0 .pool @0814A91C: ldr r0, =gUnknown_085C88A4 @0814A91E: ldr r1, [sp, 0xC] bl LZ77UnCompVram b @0814A94C .align 2, 0 .pool @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, =gUnknown_085C8598 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, =gUnknown_085C8578 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 .pool 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, =gUnknown_085C9A30 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, =gUnknown_085C8928 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 .pool 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, =0xffff3fff 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 .pool 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, =gUnknown_085C8928 mov r8, r0 movs r4, 0x4 str r4, [sp] str r4, [sp, 0x4] ldr r5, =gUnknown_085C9A30 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 .pool @0814AB2C: movs r1, 0xC ldrsh r0, [r7, r1] cmp r0, 0 ble @0814AB72 ldr r1, =gUnknown_085C9A30 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 .pool 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, =0x03005e00 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, =0x02022e14 ldrh r1, [r5] movs r0, 0x12 bl lcd_io_set ldr r4, =0x02022e16 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 .pool 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, =gUnknown_085C8598 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, =gUnknown_085C8578 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =0x02022e14 strh r5, [r0] ldr r4, =0x02022e16 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, =sub_814ABE4 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 .pool @0814ACC8: cmp r1, 0x2 beq @0814AD00 b @0814AD1C @0814ACCE: ldr r0, =0x03005e00 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 .pool @0814ACE4: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =0x0000ffff strh r1, [r0, 0x8] movs r1, 0x1 negs r1, r1 b @0814AD2C .align 2, 0 .pool @0814AD00: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0x1 strh r1, [r0, 0x8] ldr r1, =0x0000ffff b @0814AD2C .align 2, 0 .pool @0814AD1C: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =0x0000ffff 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 .pool 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, =gUnknown_085C9A53 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, =gUnknown_085C8928 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 .pool thumb_func_end sub_814AD48 thumb_func_start sub_814ADB4 sub_814ADB4: ; 814ADB4 push {r4,lr} adds r4, r0, 0 ldr r0, =0xffff7fff 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 .pool 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, =gUnknown_085C9A53 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, =sub_814ABE4 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 .pool 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, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r4, =0x02022e16 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 .pool 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, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl4 str r1, [r0] bx lr .align 2, 0 .pool 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, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @0814AF18 ldr r0, =0x02023064 lsls r1, r3, 9 adds r1, r0 ldrb r0, [r1] cmp r0, 0x38 bhi @0814AF14 ldr r0, =gUnknown_085C9A94 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 b @0814AF18 .align 2, 0 .pool @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, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0814AF40 bl dp01_tbl4_exec_completed @0814AF40: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814AF1C thumb_func_start sub_814AF54 sub_814AF54: ; 814AF54 push {r4-r6,lr} ldr r6, =0x02020630 ldr r5, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r6, 0 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 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 .pool thumb_func_end sub_814AF54 thumb_func_start sub_814AFBC sub_814AFBC: ; 814AFBC push {r4,lr} ldr r4, =0x020244d0 ldr r1, [r4] ldr r3, =0x02024064 ldrb r0, [r3] ldr r2, [r1, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x9] subs r0, 0x1 strb r0, [r1, 0x9] lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @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 .pool 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, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0814B05C @0814B028: ldr r2, =0x02020630 ldr r1, =0x03005d70 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0814B094 b @0814B092 .align 2, 0 .pool @0814B05C: ldr r2, =0x02020630 ldr r5, =0x03005d70 ldr r0, =0x02024064 ldrb r3, [r0] adds r0, r3, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r2, 0 adds r4, 0x1C adds r0, r4 ldr r2, [r0] ldr r0, =nullsub_12 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, =0x020244d0 ldr r0, [r0] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x9] ldr r1, =0x03005d60 ldrb r0, [r3] lsls r0, 2 adds r0, r1 ldr r1, =sub_814AFBC str r1, [r0] @0814B0C6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244d0 mov r12, r0 ldr r0, [r0] ldr r7, =0x02024064 ldrb r2, [r7] ldr r3, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r4, r0, r3 ldrb r1, [r4] movs r5, 0x8 adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @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, =0x02020630 mov r10, r1 ldr r0, =0x03005d7c mov r9, r0 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 mov r5, r10 adds r5, 0x1C adds r0, r5 ldr r3, [r0] ldr r0, =nullsub_12 cmp r3, r0 bne @0814B252 ldr r0, =0x020241e4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r0, [r0] cmp r0, r3 bne @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, =0x02022fec 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, =0x03005d70 ldrb r0, [r7] mov r1, r8 eors r1, r0 adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r7] mov r1, r8 eors r0, r1 bl sub_8076918 ldrb r0, [r7] mov r1, r8 eors r0, r1 adds r0, r4 ldrb r0, [r0] bl sub_80729D0 @0814B1F0: ldr r1, =0x03005d7c ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldr r5, =0x03005d70 ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r4] bl sub_8076918 ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 ldr r0, =0x020244d0 ldr r0, [r0] ldr r2, [r0, 0x8] ldrb r1, [r2, 0x9] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B004 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 .pool thumb_func_end sub_814B0E8 thumb_func_start sub_814B290 sub_814B290: ; 814B290 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 27 cmp r0, 0 bge @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 .pool thumb_func_end sub_814B290 thumb_func_start bx_t4_healthbar_update bx_t4_healthbar_update: ; 814B2D0 push {r4-r6,lr} ldr r5, =0x02024064 ldrb r0, [r5] ldr r6, =0x03005d70 adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] bl sub_80729D0 lsls r4, 16 asrs r1, r4, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0814B318 ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] movs r2, 0 bl heathbar_draw_hp b @0814B332 .align 2, 0 .pool @0814B318: ldr r2, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 bl dp01_tbl4_exec_completed @0814B332: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_t4_healthbar_update thumb_func_start sub_814B340 sub_814B340: ; 814B340 push {r4-r6,lr} ldr r6, =0x02020630 ldr r5, =0x020241e4 ldr r4, =0x02024064 ldrb r2, [r4] adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 movs r3, 0x22 ldrsh r1, [r0, r3] movs r3, 0x26 ldrsh r0, [r0, r3] adds r1, r0 cmp r1, 0xA0 ble @0814B3BC ldr r1, =0x0202406e lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 bl nullsub_24 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 bl rotscale_free_entry ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 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 .pool thumb_func_end sub_814B340 thumb_func_start sub_814B3DC sub_814B3DC: ; 814B3DC push {r4-r6,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r6, =0x02024064 ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0814B430 ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 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 .pool 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, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r2 movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x20 bne @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, =0x020244b9 strb r3, [r0] bl dp01_tbl4_exec_completed b @0814B4DA .align 2, 0 .pool @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, =0x02020630 ldr r0, =0x03005d70 ldr r4, =0x02024064 ldrb r3, [r4] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0814B532 adds r0, r3, 0 bl sub_805E408 ldr r0, =0x020244d0 ldr r0, [r0] ldrb r2, [r4] ldr r1, [r0] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0814B526 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x6 bl move_anim_start_t4 @0814B526: ldr r0, =0x03005d60 ldrb r1, [r4] lsls r1, 2 adds r1, r0 ldr r0, =sub_814B554 str r0, [r1] @0814B532: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814B4E0 thumb_func_start sub_814B554 sub_814B554: ; 814B554 push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0814B590 ldr r2, =0x02020630 ldr r0, =0x020241e4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0814B590 bl dp01_tbl4_exec_completed @0814B590: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814B554 thumb_func_start sub_814B5A8 sub_814B5A8: ; 814B5A8 push {r4-r7,lr} mov r7, r8 push {r7} ldr r3, =0x020244d0 ldr r0, [r3] ldr r7, =0x02024064 ldrb r1, [r7] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r2, r0, r2 ldrb r1, [r2, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @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, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag ldr r0, =c3_0802FDF4 movs r1, 0xA bl AddTask ldr r0, =0x0202406e mov r8, r0 ldrb r1, [r7] lsls r0, r1, 1 add r0, r8 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 bl sub_805E990 ldr r1, =0x020241e4 ldrb r0, [r7] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 bl obj_anim_image_start ldr r4, =0x03005d70 ldrb r1, [r7] adds r0, r1, r4 ldrb r0, [r0] lsls r1, 1 add r1, r8 ldrh r1, [r1] muls r1, r6 adds r1, r5 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r7] bl sub_8076918 ldrb r0, [r7] adds r0, r4 ldrb r0, [r0] bl sub_80729D0 ldr r1, =0x03005d60 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B4E0 str r1, [r0] @0814B664: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814B5A8 thumb_func_start sub_814B69C sub_814B69C: ; 814B69C push {r4-r6,lr} ldr r6, =0x020244d0 ldr r0, [r6] ldr r4, =0x02024064 ldrb r2, [r4] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x88 ands r0, r1 cmp r0, 0 bne @0814B6CE ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @0814B6CE: ldr r5, =0x02020630 ldr r0, =0x03005d7c ldrb r2, [r4] adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r3, r0, 2 adds r0, r5, 0 adds r0, 0x1C adds r0, r3, r0 ldr r1, [r0] ldr r0, =nullsub_12 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, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B5A8 str r1, [r0] @0814B714: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl4 str r1, [r0] ldr r0, =0x02022fec 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, =0x02023064 ldrb r0, [r4] lsls r0, 9 adds r0, r1 movs r1, 0x38 strb r1, [r0] b @0814B7A6 .align 2, 0 .pool @0814B794: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] @0814B7A6: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_tbl4_exec_completed thumb_func_start sub_814B7B8 sub_814B7B8: ; 814B7B8 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @0814B7DA bl dp01_tbl4_exec_completed @0814B7DA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814B7B8 thumb_func_start sub_814B7E8 sub_814B7E8: ; 814B7E8 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0814B80A bl dp01_tbl4_exec_completed @0814B80A: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @0814B850 ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] mov r1, sp bl dp01_getattr_by_ch1_for_player_pokemon__ adds r6, r0, 0 b @0814B872 .align 2, 0 .pool @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, =0x02023064 ldr r3, =0x02024064 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, =@0814B8CC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 add r0, sp, 0x24 mov r9, r0 movs r1, 0x3B add r1, sp mov r10, r1 mov r2, sp adds r2, 0x2B str r2, [sp, 0x80] mov r0, sp adds r0, 0x2A str r0, [sp, 0x7C] mov r1, sp adds r1, 0x68 str r1, [sp, 0x8C] adds r2, 0x5 str r2, [sp, 0x84] adds r0, 0x12 str r0, [sp, 0x88] mov r8, r4 add r4, sp, 0xC @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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_getattr mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 bl pokemon_getattr ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr mov r3, sp movs r5, 0x1F ands r0, r5 ldrb r2, [r3, 0x14] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr mov r3, sp movs r6, 0x1F ands r0, r6 lsls r0, 5 ldrh r2, [r3, 0x14] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 2 ldrb r2, [r3, 0x15] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [sp, 0x14] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr mov r3, sp ands r0, r6 lsls r0, 4 ldrh r2, [r3, 0x16] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 1 ldrb r2, [r3, 0x17] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C bl pokemon_getattr mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D bl pokemon_getattr mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E bl pokemon_getattr mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F bl pokemon_getattr mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr mov r3, sp movs r1, 0x1 ands r0, r1 lsls r0, 6 ldrb r2, [r3, 0x17] movs r1, 0x41 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] bl pokemon_getattr ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] bl 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 .pool @0814BBE0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB b @0814BF5A .align 2, 0 .pool @0814BBF0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xC b @0814BF5A .align 2, 0 .pool @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, =0x020244ec 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, =0x020244ec 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 .pool @0814BC68: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x9 b @0814BF5A .align 2, 0 .pool @0814BC84: movs r6, 0 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r2, =0x020244ec 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, =0x020244ec adds r0, r1 movs r1, 0x15 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 b @0814C022 .align 2, 0 .pool @0814BCC0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x8 b @0814C01A .align 2, 0 .pool @0814BCDC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1 b @0814BCF6 .align 2, 0 .pool @0814BCEC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool @0814BD1C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1A b @0814C01A .align 2, 0 .pool @0814BD2C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1B b @0814C01A .align 2, 0 .pool @0814BD3C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1C b @0814C01A .align 2, 0 .pool @0814BD4C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1D b @0814C01A .align 2, 0 .pool @0814BD5C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1E b @0814C01A .align 2, 0 .pool @0814BD6C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1F b @0814C01A .align 2, 0 .pool @0814BD7C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x20 b @0814C01A .align 2, 0 .pool @0814BD8C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x22 b @0814C01A .align 2, 0 .pool @0814BD9C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x23 b @0814C01A .align 2, 0 .pool @0814BDAC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x24 b @0814C01A .align 2, 0 .pool @0814BDBC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x25 b @0814C01A .align 2, 0 .pool @0814BDCC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x26 b @0814C01A .align 2, 0 .pool @0814BDDC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr strb r0, [r7, 0x5] movs r6, 0x6 b @0814C022 .align 2, 0 .pool @0814BE2C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x27 b @0814C01A .align 2, 0 .pool @0814BE3C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x28 b @0814C01A .align 2, 0 .pool @0814BE4C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x29 b @0814C01A .align 2, 0 .pool @0814BE5C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2A b @0814C01A .align 2, 0 .pool @0814BE6C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2B b @0814C01A .align 2, 0 .pool @0814BE7C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2C b @0814C01A .align 2, 0 .pool @0814BE8C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0 b @0814BEB6 .align 2, 0 .pool @0814BE9C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x9 b @0814BF5A .align 2, 0 .pool @0814BEAC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool @0814BEE0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 b @0814C01A .align 2, 0 .pool @0814BEF0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x39 b @0814BF5A .align 2, 0 .pool @0814BF00: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A b @0814BF5A .align 2, 0 .pool @0814BF10: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3B b @0814BF5A .align 2, 0 .pool @0814BF20: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3C b @0814BF5A .align 2, 0 .pool @0814BF30: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3D b @0814BF5A .align 2, 0 .pool @0814BF40: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3E b @0814BF5A .align 2, 0 .pool @0814BF50: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool @0814BF70: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x16 b @0814C01A .align 2, 0 .pool @0814BF80: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x17 b @0814C01A .align 2, 0 .pool @0814BF90: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x18 b @0814C01A .align 2, 0 .pool @0814BFA0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x21 b @0814C01A .align 2, 0 .pool @0814BFB0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2F b @0814C01A .align 2, 0 .pool @0814BFC0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x30 b @0814C01A .align 2, 0 .pool @0814BFD0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x32 b @0814C01A .align 2, 0 .pool @0814BFE0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x33 b @0814C01A .align 2, 0 .pool @0814BFF0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x34 b @0814C01A .align 2, 0 .pool @0814C000: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x35 b @0814C01A .align 2, 0 .pool @0814C010: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @0814C074 ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] bl sub_814C09C b @0814C092 .align 2, 0 .pool @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, =0x02024064 ldrb r0, [r0] lsls r0, 9 ldr r2, =0x02023067 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 adds r0, r1 ldrb r0, [r0] adds r7, r2, 0 cmp r0, 0x3B bls @0814C0C8 bl @0814CA62 @0814C0C8: lsls r0, 2 ldr r1, =@0814C0E0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB adds r2, r6, 0 bl pokemon_setattr adds r2, r6, 0 adds r2, 0x2E adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr movs r0, 0 mov r8, r0 movs r0, 0x3B adds r0, r6 mov r10, r0 adds r0, r6, 0 adds r0, 0x2B str r0, [sp, 0x20] adds r0, 0x19 str r0, [sp, 0x28] adds r0, 0x4 str r0, [sp, 0x2C] adds r0, 0x4 str r0, [sp, 0x30] subs r0, 0x22 str r0, [sp, 0x1C] subs r0, 0x2 str r0, [sp, 0x18] adds r0, 0x4 str r0, [sp, 0x24] adds r0, r6, 0x2 str r0, [sp, 0x4] adds r0, r6, 0x4 str r0, [sp, 0x8] adds r0, r6, 0x6 str r0, [sp, 0xC] adds r0, 0x2 str r0, [sp, 0x10] adds r0, 0x2 str r0, [sp, 0x14] mov r9, r4 adds r7, r6, 0 adds r7, 0x24 adds r4, r6, 0 adds r4, 0xC @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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 mov r2, r10 bl pokemon_setattr adds r0, r4, 0 movs r1, 0x20 ldr r2, [sp, 0x20] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x19 ldr r2, [sp, 0x28] bl pokemon_setattr ldrb r0, [r6, 0x14] lsls r0, 27 lsrs r0, 27 mov r1, sp strb r0, [r1] adds r0, r4, 0 movs r1, 0x27 mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x14] lsls r0, 22 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x28 mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x15] lsls r0, 25 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x29 mov r2, sp bl pokemon_setattr mov r1, sp ldr r0, [r6, 0x14] lsls r0, 12 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2A mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x16] lsls r0, 23 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2B mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x17] lsls r0, 26 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0 ldr r2, [sp, 0x2C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x37 ldr r2, [sp, 0x30] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 ldr r2, [sp, 0x1C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 ldr r2, [sp, 0x18] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A ldr r2, [sp, 0x24] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3B ldr r2, [sp, 0x4] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C ldr r2, [sp, 0x8] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D ldr r2, [sp, 0xC] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E ldr r2, [sp, 0x10] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F ldr r2, [sp, 0x14] bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C368: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xB bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C388: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xC bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @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, =0x020244ec 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, =0x020244ec adds r0, r1 movs r1, 0x15 mov r2, r9 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C400: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x9 b @0814C4A4 .align 2, 0 .pool @0814C428: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x11 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x12 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x13 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x14 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C48C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x8 @0814C4A4: adds r3, 0x3 adds r2, r3 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C4BC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C4DC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x19 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C4FC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1A bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C51C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1B bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C53C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1C bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C55C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1D bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C57C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1E bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C59C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1F bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C5BC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x20 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C5DC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x22 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C5FC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x23 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C61C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x24 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C63C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x25 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C65C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x26 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C67C: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x27 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x28 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x29 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x2A bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x2B bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x5 adds r2, r0 adds r0, r4, 0 b @0814C79C .align 2, 0 .pool @0814C6EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x27 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C70C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x28 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C72C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x29 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C74C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2A bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C76C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2B bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C78C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 @0814C79C: movs r1, 0x2C bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C7AC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C7CC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x9 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C7EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x37 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C80C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x38 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C82C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x39 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C84C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3A bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C86C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3B bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C88C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3C bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C8AC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3D bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C8CC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3E bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C8EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3F bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C90C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x16 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C92C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x17 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C94C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x18 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C96C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x21 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C98C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2F bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C9AC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x30 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C9CC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x32 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814C9EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x33 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814CA0C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x34 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814CA2C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x35 bl pokemon_setattr b @0814CA62 .align 2, 0 .pool @0814CA4C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x36 bl pokemon_setattr @0814CA62: ldr r2, =0x0202406e ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 add sp, 0x34 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814C09C thumb_func_start sub_814CA98 sub_814CA98: ; 814CA98 push {r4-r7,lr} ldr r1, =0x0202406e ldr r7, =0x02024064 ldrb r2, [r7] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 adds r3, r1, 0 muls r3, r0 ldr r4, =0x02023064 lsls r2, 9 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] ldr r1, =0x020244ec adds r0, r1 adds r5, r3, r0 movs r3, 0 adds r0, r4, 0x2 adds r2, r0 ldrb r2, [r2] cmp r3, r2 bcs @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 .pool thumb_func_end sub_814CA98 thumb_func_start sub_814CB0C sub_814CB0C: ; 814CB0C push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =0x0202406e mov r8, r0 ldr r6, =0x02024064 ldrb r1, [r6] lsls r0, r1, 1 add r0, r8 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 bl sub_805DD7C ldrb r0, [r6] lsls r0, 1 add r0, r8 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0xB bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_806A068 ldr r0, =0x0202499c mov r8, r0 ldrb r0, [r6] movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldrb r0, [r6] bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r6] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r8 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 ldrb r1, [r6] adds r1, r4 strb r0, [r1] ldr r5, =0x02020630 ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ff10 strh r1, [r0, 0x24] ldrb r2, [r6] adds r0, r2, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x2E] ldrb r3, [r6] adds r0, r3, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r2, [r6] adds r4, r2, r4 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r2, r1 ldrb r1, [r2] bl obj_anim_image_start ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B290 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814CB0C thumb_func_start sub_814CC28 sub_814CC28: ; 814CC28 push {r4-r6,lr} ldr r5, =0x02024064 ldrb r0, [r5] ldr r4, =0x02023064 lsls r1, r0, 9 adds r6, r4, 0x2 adds r1, r6 ldrb r1, [r1] bl sub_805EF84 ldr r2, =0x0202406e ldrb r0, [r5] lsls r1, r0, 1 adds r1, r2 lsls r0, 9 adds r4, 0x1 adds r0, r4 ldrb r0, [r0] strh r0, [r1] ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805DD7C ldrb r0, [r5] lsls r1, r0, 9 adds r1, r6 ldrb r1, [r1] bl sub_814CC98 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B69C str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202406e lsls r2, r6, 1 adds r2, r0 ldr r0, =0x02023064 lsls r1, r6, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] strh r0, [r2] ldrh r1, [r2] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 bl object_new_hidden_with_callback ldr r1, =0x03005d7c mov r9, r1 add r9, r6 mov r1, r9 strb r0, [r1] adds r0, r6, 0 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_806A068 ldr r0, =0x0202499c mov r10, r0 adds r0, r6, 0 movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r10 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 adds r4, r6, r4 strb r0, [r4] ldr r5, =0x02020630 mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r4] strh r1, [r0, 0x30] mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x32] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x2E] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 mov r1, r8 strh r1, [r0, 0x32] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, r6, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r6, r1 ldrb r1, [r6] bl 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, =nullsub_12 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 .pool thumb_func_end sub_814CC98 thumb_func_start sub_814CE14 sub_814CE14: ; 814CE14 push {r4-r6,lr} ldr r1, =0x02023064 ldr r6, =0x02024064 ldrb r2, [r6] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r3, [r0] cmp r3, 0 bne @0814CE5C ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_814CEA4 str r1, [r0] b @0814CE92 .align 2, 0 .pool @0814CE5C: ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 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 .pool thumb_func_end sub_814CE14 thumb_func_start sub_814CEA4 sub_814CEA4: ; 814CEA4 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r4, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r0, [r3, 0x4] cmp r0, 0 beq @0814CECC cmp r0, 0x1 beq @0814CEFA b @0814CF22 .align 2, 0 .pool @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, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B3DC str r1, [r0] @0814CF22: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814CEA4 thumb_func_start sub_814CF30 sub_814CF30: ; 814CF30 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0814CF60 ldr r0, =0x02024064 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 .pool @0814CF60: movs r7, 0x50 @0814CF62: ldr r5, =0x02024064 ldrb r0, [r5] bl sub_806D864 ldr r6, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r6 movs r4, 0xFF ldrb r0, [r1] cmp r0, 0x4 beq @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 .pool @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, =0x02024064 ldrb r1, [r5] adds r0, r4, 0 bl sub_805DF84 ldrb r0, [r5] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl template_build_for_pokemon_or_trainer ldr r6, =0x0202499c mov r8, r7 ldr r0, =gUnknown_08305D2C 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, =0x020241e4 ldrb r1, [r5] adds r1, r6 strb r0, [r1] ldr r4, =0x02020630 ldrb r3, [r5] adds r0, r3, r6 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0xF0 strh r1, [r0, 0x24] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, 0x1C adds r0, r4 ldr r1, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_814AF1C str r1, [r0] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 bl oamt_add_pos2_onto_pos1 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x23 strh r1, [r0, 0x2E] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ffd8 strh r1, [r0, 0x32] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =nullsub_12 bl oamt_set_x3A_32 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_814AF54 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814D0F0 thumb_func_start sub_814D19C sub_814D19C: ; 814D19C push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r0, [r4, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r3, r1, r0 ldrb r0, [r3, 0x4] cmp r0, 0 bne @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 .pool @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, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 movs r1, 0x40 negs r1, r1 movs r0, 0x10 bl audio_play_and_stuff ldr r2, =0x02020630 ldr r3, =0x020241e4 ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r4, [r0, 0x30] ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x5 strh r1, [r0, 0x32] ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039C00 str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B340 str r1, [r0] @0814D266: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 beq @0814D2CE b @0814D3F4 @0814D2CE: ldr r0, =0x02023064 mov r12, r0 ldrb r1, [r5] lsls r1, 9 adds r0, 0x1 adds r0, r1, r0 ldrb r6, [r0] mov r0, r12 adds r0, 0x2 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 8 orrs r6, r0 ldr r0, =0x02038432 mov r8, r0 mov r0, r12 adds r0, 0x3 adds r1, r0 ldrb r0, [r1] mov r1, r8 strb r0, [r1] ldr r3, =0x02038408 ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0x4 adds r0, r1, r0 ldrb r2, [r0] mov r0, r12 adds r0, 0x5 adds r1, r0 ldrb r0, [r1] lsls r0, 8 orrs r2, r0 strh r2, [r3] ldr r3, =0x02038404 ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0x6 adds r0, r1, r0 ldrb r2, [r0] mov r0, r12 adds r0, 0x7 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 8 orrs r2, r0 mov r0, r12 adds r0, 0x8 adds r0, r1, r0 ldrb r0, [r0] lsls r0, 16 orrs r2, r0 mov r0, r12 adds r0, 0x9 adds r1, r0 ldrb r0, [r1] lsls r0, 24 orrs r2, r0 str r2, [r3] ldr r2, =0x0203841a ldrb r0, [r5] lsls r0, 9 mov r1, r12 adds r1, 0xA adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r4, =0x0203841c ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0xC adds r0, r1, r0 ldrb r2, [r0] mov r0, r12 adds r0, 0xD adds r1, r0 ldrb r0, [r1] lsls r0, 8 orrs r2, r0 strh r2, [r4] ldr r7, =0x02038400 ldrb r1, [r5] lsls r1, 9 mov r0, r12 adds r0, 0x10 adds r1, r0 str r1, [r7] ldr r2, =0x020244bc ldrb r0, [r5] lsls r0, 2 adds r0, r2 ldr r1, [r1] str r1, [r0] mov r0, r8 ldrb r1, [r0] adds r0, r6, 0 bl sub_805DB8C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @0814D3CC bl dp01_tbl4_exec_completed b @0814D3F4 .align 2, 0 .pool @0814D3CC: ldr r0, =0x020244d0 ldr r0, [r0] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_move_anim_4 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 .pool 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, =0x02023064 ldr r6, =0x02024064 ldrb r3, [r6] lsls r1, r3, 9 adds r0, r2, 0x1 mov r10, r0 adds r0, r1, r0 ldrb r4, [r0] adds r5, r2, 0x2 mov r9, r5 adds r0, r1, r5 ldrb r0, [r0] lsls r0, 8 orrs r4, r0 adds r2, 0xB adds r1, r2 ldrb r1, [r1] mov r8, r1 ldr r7, =0x020244d0 ldr r5, [r7] ldr r1, [r5, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x4] cmp r2, 0x1 beq @0814D4A4 cmp r2, 0x1 bgt @0814D464 cmp r2, 0 beq @0814D46E b @0814D580 .align 2, 0 .pool @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, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd 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, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x4] b @0814D580 .align 2, 0 .pool @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, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r5, =0x02024064 ldrb r4, [r5] lsls r4, 9 ldr r0, =0x02023066 adds r4, r0 ldrh r0, [r4] bl battle_pick_message ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_t4_button_a str r1, [r0] ldrh r0, [r4] bl sub_817C95C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r0, =0x02024064 mov r9, r0 ldrb r4, [r0] lsls r2, r4, 9 adds r0, r3, 0x2 adds r0, r2, r0 ldrb r1, [r0] adds r3, 0x3 adds r2, r3 ldrb r0, [r2] lsls r0, 8 orrs r1, r0 lsls r1, 16 asrs r7, r1, 16 ldr r0, =0x00007fff cmp r7, r0 beq @0814D6CC ldr r6, =0x0202406e lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x3A bl pokemon_getattr mov r8, r0 mov r1, r9 ldrb r0, [r1] lsls r0, 1 adds r0, r6 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] mov r2, r8 bl sub_807294C b @0814D6F6 .align 2, 0 .pool @0814D6CC: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A bl pokemon_getattr adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] movs r3, 0 bl sub_807294C @0814D6F6: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_t4_healthbar_update 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 .pool 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, =0x02024064 ldrb r0, [r4] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @0814D78C ldr r0, =0x03005d70 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe ldrb r2, [r4] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B7B8 str r1, [r0] @0814D78C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814D738 thumb_func_start sub_814D7B0 sub_814D7B0: ; 814D7B0 push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @0814D800 ldr r4, =0x02023064 ldrb r3, [r5] lsls r3, 9 adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] adds r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 adds r2, r4, 0x4 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 16 orrs r1, r2 adds r4, 0x5 adds r3, r4 ldrb r2, [r3] lsls r2, 24 orrs r1, r2 bl move_anim_start_t2_for_situation ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B7B8 str r1, [r0] @0814D800: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022d0c 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 .pool thumb_func_end sub_814D884 thumb_func_start sub_814D8A0 sub_814D8A0: ; 814D8A0 push {lr} ldr r3, =0x02022d0c ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] movs r1, 0x7F ands r1, r0 ldrb r2, [r3] movs r0, 0x80 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] bl dp01_tbl4_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814D8A0 thumb_func_start sub_814D8D8 sub_814D8D8: ; 814D8D8 push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] bl dp01_tbl4_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814D8D8 thumb_func_start sub_814D8F0 sub_814D8F0: ; 814D8F0 push {lr} ldr r3, =0x02022d0c ldr r1, [r3] lsls r1, 24 lsrs r1, 31 movs r0, 0x1 eors r1, r0 lsls r1, 7 ldrb r2, [r3] movs r0, 0x7F ands r0, r2 orrs r0, r1 strb r0, [r3] bl dp01_tbl4_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814D8F0 thumb_func_start dp01t_29_4_blink dp01t_29_4_blink: ; 814D918 push {r4,lr} ldr r3, =0x02020630 ldr r2, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @0814D94C bl dp01_tbl4_exec_completed b @0814D976 .align 2, 0 .pool @0814D94C: ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0 strh r1, [r0, 0x30] ldrb r0, [r4] bl sub_80769F4 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =dp01t_0F_4_move_anim str r1, [r0] @0814D976: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 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, =0x02023064 ldrb r1, [r4] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 lsls r1, r3, 24 asrs r1, 24 bl audio_play_and_stuff bl dp01_tbl4_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814D994 thumb_func_start sub_814D9D8 sub_814D9D8: ; 814D9D8 push {r4,r5,lr} ldr r4, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r3, r0, 9 adds r0, r4, 0x3 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @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 .pool @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, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 movs r1, 0x19 negs r1, r1 movs r2, 0x5 bl sub_80A32E4 bl dp01_tbl4_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814DA34 thumb_func_start dp01t_2E_4_battle_intro dp01t_2E_4_battle_intro: ; 814DA74 push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] bl battle_intro_launch ldr r2, =0x020243fc ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] bl dp01_tbl4_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_2E_4_battle_intro thumb_func_start sub_814DAA8 sub_814DAA8: ; 814DAA8 push {r4-r7,lr} ldr r5, =0x020241e4 ldr r6, =0x02024064 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl oamt_add_pos2_onto_pos1 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x32 strh r1, [r0, 0x2E] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000ffd8 strh r1, [r0, 0x32] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb 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, =sub_805CC00 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, =0x0000d6f9 bl gpu_pal_alloc_new lsls r0, 24 lsrs r7, r0, 24 ldrb r0, [r6] bl sub_806D864 ldr r4, =0x020229e8 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 .pool @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, =gTrainerBackPicPaletteTable 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, =0x02020630 ldr r1, =0x020241e4 ldr r5, =0x02024064 ldrb r0, [r5] adds r0, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r4 strb r0, [r1, 0x5] ldr r0, =sub_814DCCC movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r4, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r4 ldrb r0, [r5] strh r0, [r1, 0x8] ldr r3, =0x020244d0 ldr r0, [r3] ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0814DC80 ldr r0, =0x020244b4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r4 ldr r1, =sub_8073C30 str r1, [r0] @0814DC80: ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r0, [r2, 0x9] movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_112 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, 2 add r0, r8 lsls r0, 3 adds r1, r0, r1 ldrh r2, [r1, 0xA] movs r3, 0xA ldrsh r0, [r1, r3] cmp r0, 0x17 bgt @0814DCF8 adds r0, r2, 0x1 strh r0, [r1, 0xA] b @0814DDB4 .align 2, 0 .pool @0814DCF8: ldr r7, =0x02024064 ldrb r0, [r7] mov r9, r0 ldrh r0, [r1, 0x8] strb r0, [r7] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0814DD18 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0814DD48 @0814DD18: ldr r0, =0x02023064 ldrb r1, [r7] lsls r2, r1, 9 adds r0, 0x1 adds r2, r0 ldr r0, =0x0202406e lsls r1, 1 adds r1, r0 ldrh r0, [r1] strb r0, [r2] ldrb r0, [r7] movs r1, 0 bl sub_814CC98 b @0814DD9C .align 2, 0 .pool @0814DD48: ldr r4, =0x02023064 ldrb r0, [r7] lsls r1, r0, 9 adds r4, 0x1 adds r1, r4 ldr r5, =0x0202406e lsls r0, 1 adds r0, r5 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r7] movs r1, 0 bl sub_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, =0x020244ec 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, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_814B0E8 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 .pool thumb_func_end sub_814DCCC thumb_func_start sub_814DDD8 sub_814DDD8: ; 814DDD8 push {r4-r6,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @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 .pool @0814DE08: ldr r6, =0x020244d0 ldr r0, [r6] ldr r5, =0x02024064 ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] ldrb r0, [r5] lsls r3, r0, 9 ldr r4, =0x02023068 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] subs r4, 0x2 adds r3, r4 ldrb r3, [r3] bl sub_80735DC ldr r2, =0x020244b4 ldrb r1, [r5] adds r1, r2 movs r3, 0 strb r0, [r1] ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x5] ldrb r2, [r5] lsls r0, r2, 9 adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @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, =0x03005d60 ldrb r1, [r5] lsls r1, 2 adds r1, r0 ldr r0, =sub_814DE9C str r0, [r1] @0814DE7C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814DDD8 thumb_func_start sub_814DE9C sub_814DE9C: ; 814DE9C push {r4,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x5] adds r2, r1, 0x1 strb r2, [r0, 0x5] lsls r1, 24 lsrs r1, 24 cmp r1, 0x5C bls @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 .pool thumb_func_end sub_814DE9C thumb_func_start sub_814DEE4 sub_814DEE4: ; 814DEE4 push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0814DF16 ldr r2, =0x03005e00 ldr r0, =0x020244b4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, =sub_8073C30 str r1, [r0] @0814DF16: bl dp01_tbl4_exec_completed pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r4] bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @0814DF86 ldr r3, =0x02020630 ldr r0, =0x020241e4 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 ldr r0, =0x02023064 lsls r1, 9 adds r0, 0x1 adds r1, r0 adds r2, 0x3E movs r0, 0x1 ldrb r1, [r1] ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] ldrb r0, [r4] bl sub_805E408 @0814DF86: bl dp01_tbl4_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_814DF40 thumb_func_start sub_814DFA0 sub_814DFA0: ; 814DFA0 push {r4-r6,lr} sub sp, 0x4 ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @0814E002 ldr r4, =0x02023064 ldrb r2, [r5] lsls r1, r2, 9 adds r0, r4, 0x1 adds r0, r1, r0 ldrb r6, [r0] adds r0, r4, 0x2 adds r0, r1, r0 ldrb r3, [r0] adds r4, 0x3 adds r1, r4 ldrb r0, [r1] lsls r0, 8 orrs r3, r0 str r3, [sp] adds r0, r2, 0 adds r1, r2, 0 adds r3, r6, 0 bl move_anim_start_t3 lsls r0, 24 cmp r0, 0 beq @0814DFF0 bl dp01_tbl4_exec_completed b @0814DFFC .align 2, 0 .pool @0814DFF0: ldr r0, =0x03005d60 ldrb r1, [r5] lsls r1, 2 adds r1, r0 ldr r0, =sub_814B7E8 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 .pool thumb_func_end sub_814DFA0 thumb_func_start sub_814E014 sub_814E014: ; 814E014 push {lr} ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 ldr r1, =0x02023066 adds r0, r1 bl sub_81851A8 bl dp01_tbl4_exec_completed pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r5] lsls r0, 9 ldr r4, =0x02023068 adds r0, r4 bl sub_81851A8 ldr r2, =0x0202433a ldrb r0, [r5] lsls r0, 9 subs r1, r4, 0x3 adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r0, =0x03005d90 ldr r3, [r0] ldrb r0, [r5] lsls r0, 9 subs r4, 0x2 adds r0, r4 ldrb r0, [r0] ldr r1, =0x00000ca9 adds r3, r1 movs r1, 0x1 ands r1, r0 lsls r1, 3 ldrb r2, [r3] movs r0, 0x9 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 bl sub_80A2390 bl dp01_tbl4_exec_completed ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_80587B0 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203aba8 ldr r0, =0x02024064 mov r8, r0 ldrb r1, [r0] lsls r1, 9 ldr r0, =0x02023068 adds r1, r0 str r1, [r4] ldr r2, =0x02024208 ldrh r0, [r1, 0x4] strh r0, [r2] ldr r2, =0x0202420a ldrb r0, [r1, 0x6] strb r0, [r2] ldr r5, =0x02024474 ldrb r0, [r1, 0x7] strb r0, [r5, 0x17] ldr r3, =0x0202449c 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, =0x0202420f 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, =0x02022f58 mov r10, r1 ldr r3, =0x0203aba4 @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, =0x02022f58 mov r8, r0 ldr r3, =0x0203aba8 ldr r5, =0x02022f68 ldr r4, =0x02022f78 @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, =@0814E1B4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0814E1B4: .4byte @0814E1CC .4byte @0814E2AC .4byte @0814E394 .4byte @0814E430 .4byte @0814E4F8 .4byte @0814E55C @0814E1CC: ldr r0, =0x02022fec ldr r2, [r0] movs r0, 0x8 ands r0, r2 cmp r0, 0 beq @0814E26C ldr r0, =0x02000002 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, =gUnknown_085CBBCD cmp r2, 0 bne @0814E200 b @0814E6D8 @0814E200: ldr r7, =gUnknown_085CD318 b @0814E6D8 .align 2, 0 .pool @0814E214: ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 cmp r1, r0 bne @0814E22C ldr r7, =gUnknown_085CBB9C b @0814E6D8 .align 2, 0 .pool @0814E22C: movs r0, 0x80 lsls r0, 17 ands r2, r0 ldr r7, =gUnknown_085CBBB9 cmp r2, 0 bne @0814E23A b @0814E6D8 @0814E23A: ldr r7, =gUnknown_085CD301 b @0814E6D8 .align 2, 0 .pool @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, =gUnknown_085CBB9C cmp r2, 0 bne @0814E260 b @0814E6D8 @0814E260: ldr r7, =gUnknown_085CCE17 b @0814E6D8 .align 2, 0 .pool @0814E26C: movs r0, 0x80 lsls r0, 6 ands r0, r2 cmp r0, 0 beq @0814E280 ldr r7, =gUnknown_085CBB5A b @0814E6D8 .align 2, 0 .pool @0814E280: movs r0, 0x1 ands r0, r2 cmp r0, 0 beq @0814E290 ldr r7, =gUnknown_085CBB82 b @0814E6D8 .align 2, 0 .pool @0814E290: movs r0, 0x80 lsls r0, 2 ands r2, r0 ldr r7, =gUnknown_085CBB47 cmp r2, 0 bne @0814E29E b @0814E6D8 @0814E29E: ldr r7, =gUnknown_085CBB6D b @0814E6D8 .align 2, 0 .pool @0814E2AC: mov r1, r12 ldrb r0, [r1] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0814E310 ldr r0, =0x02022fec 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, =gUnknown_085CCE38 b @0814E6D8 .align 2, 0 .pool @0814E2DC: movs r0, 0x80 lsls r0, 8 ands r0, r1 cmp r0, 0 beq @0814E2F0 ldr r7, =gUnknown_085CBC96 b @0814E6D8 .align 2, 0 .pool @0814E2F0: movs r0, 0x40 ands r1, r0 ldr r7, =gUnknown_085CBC96 cmp r1, 0 bne @0814E2FC b @0814E6D8 @0814E2FC: ldr r7, =gUnknown_085CBCE5 b @0814E6D8 .align 2, 0 .pool @0814E308: ldr r7, =gUnknown_085CBC8E b @0814E6D8 .align 2, 0 .pool @0814E310: ldr r0, =0x02022fec 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, =gUnknown_085CCDDE b @0814E6D8 .align 2, 0 .pool @0814E33C: movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0814E34C ldr r7, =gUnknown_085CBC4E b @0814E6D8 .align 2, 0 .pool @0814E34C: ldr r0, =0x02000002 ands r1, r0 ldr r7, =gUnknown_085CBBFA cmp r1, 0 bne @0814E358 b @0814E6D8 @0814E358: ldr r7, =gUnknown_085CBC37 b @0814E6D8 .align 2, 0 .pool @0814E368: ldr r0, =0x02000002 ands r1, r0 cmp r1, 0 beq @0814E380 ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 ldr r7, =gUnknown_085CBC27 cmp r1, r0 beq @0814E380 b @0814E6D8 @0814E380: ldr r7, =gUnknown_085CBBE7 b @0814E6D8 .align 2, 0 .pool @0814E394: mov r1, r12 ldrb r0, [r1] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0814E3EC ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0xB1 ldrb r2, [r0] cmp r2, 0 bne @0814E3BC ldr r7, =gUnknown_085CBCFD b @0814E6D8 .align 2, 0 .pool @0814E3BC: cmp r2, 0x1 beq @0814E3CC ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0814E3D8 @0814E3CC: ldr r7, =gUnknown_085CBD1B b @0814E6D8 .align 2, 0 .pool @0814E3D8: ldr r7, =gUnknown_085CBD3D cmp r2, 0x2 beq @0814E3E0 b @0814E6D8 @0814E3E0: ldr r7, =gUnknown_085CBD2A b @0814E6D8 .align 2, 0 .pool @0814E3EC: ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0x80 lsls r0, 4 ldr r2, =0x02022fec 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, =gUnknown_085CBD65 cmp r0, 0 bne @0814E414 b @0814E6D8 @0814E414: ldr r7, =gUnknown_085CBD75 b @0814E6D8 .align 2, 0 .pool @0814E428: ldr r7, =gUnknown_085CBD52 b @0814E6D8 .align 2, 0 .pool @0814E430: mov r4, r9 ldrb r0, [r4, 0x17] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0814E488 ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0xB1 ldrb r2, [r0] cmp r2, 0 beq @0814E456 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x1 ands r0, r1 cmp r0, 0 beq @0814E468 @0814E456: ldr r7, =gUnknown_085CBCA5 b @0814E6D8 .align 2, 0 .pool @0814E468: cmp r2, 0x1 bne @0814E474 ldr r7, =gUnknown_085CBCAD b @0814E6D8 .align 2, 0 .pool @0814E474: ldr r7, =gUnknown_085CBCC7 cmp r2, 0x2 beq @0814E47C b @0814E6D8 @0814E47C: ldr r7, =gUnknown_085CBCB8 b @0814E6D8 .align 2, 0 .pool @0814E488: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x02000002 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 .pool @0814E4AC: movs r0, 0x40 ands r1, r0 cmp r1, 0 beq @0814E4BC ldr r7, =gUnknown_085CBC7E b @0814E6D8 .align 2, 0 .pool @0814E4BC: ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 ldr r7, =gUnknown_085CBC6E cmp r1, r0 beq @0814E4CC b @0814E6D8 @0814E4CC: ldr r7, =gUnknown_085CBC14 b @0814E6D8 .align 2, 0 .pool @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, =gUnknown_085CCE04 cmp r0, 0x1 beq @0814E4F2 b @0814E6D8 @0814E4F2: b @0814E4CC .align 2, 0 .pool @0814E4F8: mov r0, r10 bl sub_814F8F8 ldr r0, =0x0203aba8 ldr r2, [r0] ldrh r1, [r2] movs r0, 0xB1 lsls r0, 1 cmp r1, r0 bls @0814E534 ldr r0, =0x02022f68 ldr r1, =0x0202449c ldr r1, [r1] adds r1, 0x8E ldrb r2, [r1] lsls r1, r2, 4 adds r1, r2 ldr r2, =gUnknown_085CCBBC adds r1, r2 bl gf_strcpy b @0814E544 .align 2, 0 .pool @0814E534: ldr r0, =0x02022f68 ldrh r2, [r2] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy @0814E544: ldr r0, =0x02022f68 bl sub_814F950 ldr r7, =gUnknown_085CBDAC b @0814E6D8 .align 2, 0 .pool @0814E55C: ldr r4, =0x02022f58 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, =0x02022f58 ldrb r0, [r0] subs r0, 0x2 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @0814E5A4 ldr r7, =gUnknown_085CB4CA b @0814E6D8 .align 2, 0 .pool @0814E5A4: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 ldr r7, =gUnknown_085CB5D2 cmp r0, 0 bne @0814E5B4 b @0814E6D8 @0814E5B4: ldr r7, =gUnknown_085CB5DF b @0814E6D8 .align 2, 0 .pool @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, =0x02022fec ldr r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0814E638 ldr r0, =0x02022f58 ldrb r0, [r0] cmp r0, 0x2 beq @0814E628 cmp r0, 0x2 bgt @0814E608 cmp r0, 0x1 beq @0814E60E b @0814E6D8 .align 2, 0 .pool @0814E608: cmp r0, 0x3 beq @0814E630 b @0814E6D8 @0814E60E: movs r0, 0x80 lsls r0, 16 ands r1, r0 ldr r7, =gUnknown_085CB538 cmp r1, 0 beq @0814E6D8 ldr r7, =gUnknown_085CCE53 b @0814E6D8 .align 2, 0 .pool @0814E628: ldr r7, =gUnknown_085CB567 b @0814E6D8 .align 2, 0 .pool @0814E630: ldr r7, =gUnknown_085CB5A6 b @0814E6D8 .align 2, 0 .pool @0814E638: ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 cmp r1, r0 bne @0814E680 ldr r0, =0x02022f58 ldrb r0, [r0] cmp r0, 0x2 beq @0814E670 cmp r0, 0x2 bgt @0814E660 cmp r0, 0x1 beq @0814E666 b @0814E6D8 .align 2, 0 .pool @0814E660: cmp r0, 0x3 beq @0814E678 b @0814E6D8 @0814E666: ldr r7, =gUnknown_085CBA2E b @0814E6D8 .align 2, 0 .pool @0814E670: ldr r7, =gUnknown_085CD24C b @0814E6D8 .align 2, 0 .pool @0814E678: ldr r7, =gUnknown_085CD267 b @0814E6D8 .align 2, 0 .pool @0814E680: ldr r0, =0x02022f58 ldrb r0, [r0] cmp r0, 0x2 beq @0814E6A8 cmp r0, 0x2 bgt @0814E698 cmp r0, 0x1 beq @0814E69E b @0814E6D8 .align 2, 0 .pool @0814E698: cmp r0, 0x3 beq @0814E6B0 b @0814E6D8 @0814E69E: ldr r7, =gUnknown_085CB524 b @0814E6D8 .align 2, 0 .pool @0814E6A8: ldr r7, =gUnknown_085CB54F b @0814E6D8 .align 2, 0 .pool @0814E6B0: ldr r7, =gUnknown_085CB581 b @0814E6D8 .align 2, 0 .pool @0814E6B8: movs r0, 0xBE lsls r0, 1 cmp r6, r0 bls @0814E6CC ldr r1, =0x02022e2c movs r0, 0xFF strb r0, [r1] b @0814E6DE .align 2, 0 .pool @0814E6CC: ldr r1, =gUnknown_085CC270 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 .pool thumb_func_end battle_pick_message thumb_func_start sub_814E6F0 sub_814E6F0: ; 814E6F0 push {lr} ldr r1, =0x02022e2c bl sub_814E764 pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085CD422 mov r0, sp movs r2, 0x8 bl memcpy mov r2, sp movs r3, 0 b @0814E728 .align 2, 0 .pool @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, =gUnknown_0831BCA8 @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 .pool @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, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @0814E794 ldr r0, =0x0203c7b4 ldrb r7, [r0] b @0814E79C .align 2, 0 .pool @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, =@0814E7CC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022f58 ldrb r0, [r5] cmp r0, 0xFD bne @0814E8B8 ldr r4, =0x02021cc4 adds r0, r5, 0 b @0814E8F0 .align 2, 0 .pool @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, =0x02022f68 ldrb r0, [r1] cmp r0, 0xFD bne @0814E904 ldr r4, =0x02021dc4 b @0814E8EE .align 2, 0 .pool @0814E8E4: ldr r1, =0x02022f78 ldrb r0, [r1] cmp r0, 0xFD bne @0814E904 ldr r4, =0x02021ec4 @0814E8EE: adds r0, r1, 0 @0814E8F0: adds r1, r4, 0 bl sub_814F648 bl @0814F5C0 .align 2, 0 .pool @0814E904: adds r4, r1, 0 bl @0814F5C0 @0814E90A: ldr r4, =0x02021cc4 bl @0814F5C0 .align 2, 0 .pool @0814E914: ldr r4, =0x02021dc4 bl @0814F5C0 .align 2, 0 .pool @0814E920: ldr r4, =0x02021ec4 bl @0814F5C0 .align 2, 0 .pool @0814E92C: movs r0, 0 bl battle_get_side_with_given_state ldr r1, =0x0202406e lsls r0, 24 lsrs r0, 23 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool @0814E960: movs r0, 0x1 bl battle_get_side_with_given_state ldr r1, =0x0202406e lsls r0, 24 lsrs r0, 23 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 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 .pool @0814E994: movs r0, 0x2 bl battle_get_side_with_given_state ldr r1, =0x0202406e lsls r0, 24 lsrs r0, 23 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool @0814E9C8: movs r0, 0x3 bl battle_get_side_with_given_state ldr r1, =0x0202406e lsls r0, 24 lsrs r0, 23 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 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 .pool @0814E9FC: ldr r2, =0x0202406e ldr r1, =0x020229e8 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, =0x020244ec 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 .pool @0814EA38: ldr r2, =0x0202406e ldr r1, =0x020229e8 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, =0x02024744 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 .pool @0814EA78: ldr r2, =0x0202406e ldr r1, =0x020229e8 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, =0x020244ec 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 .pool @0814EAB8: ldr r2, =0x0202406e ldr r1, =0x020229e8 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, =0x02024744 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 .pool @0814EAF8: ldr r4, =0x0202420b ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 adds r2, r4, 0 cmp r0, 0 beq @0814EB74 ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x8 ands r1, r0 ldr r4, =gUnknown_085CBD85 cmp r1, 0 beq @0814EB36 ldr r4, =gUnknown_085CBD8B b @0814EB36 .align 2, 0 .pool @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, =0x0202406e lsls r0, 24 lsrs r0, 23 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr b @0814EB9E .align 2, 0 .pool @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, =0x0202406e lsls r0, 24 lsrs r0, 23 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool @0814EBB0: ldr r4, =0x0202420b 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, =0x0202406e lsls r0, 24 lsrs r0, 23 adds r0, 0x4 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr b @0814EC24 .align 2, 0 .pool @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, =0x0202406e lsls r0, 24 lsrs r0, 23 adds r0, 0x4 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 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 .pool @0814EC38: ldr r5, =0x0202420b ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0814ECA8 ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x8 ands r1, r0 ldr r4, =gUnknown_085CBD85 cmp r1, 0 beq @0814EC56 ldr r4, =gUnknown_085CBD8B @0814EC56: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =0x0202406e ldr r2, =0x02024744 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 .pool @0814ECA8: ldr r1, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool @0814ECD4: ldr r5, =0x0202420c ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0814ED44 ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x8 ands r1, r0 ldr r4, =gUnknown_085CBD85 cmp r1, 0 beq @0814ECF2 ldr r4, =gUnknown_085CBD8B @0814ECF2: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =0x0202406e ldr r2, =0x02024744 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 .pool @0814ED44: ldr r1, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool @0814ED70: ldr r5, =0x0202420e ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0814EDE0 ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x8 ands r1, r0 ldr r4, =gUnknown_085CBD85 cmp r1, 0 beq @0814ED8E ldr r4, =gUnknown_085CBD8B @0814ED8E: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =0x0202406e ldr r2, =0x02024744 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 .pool @0814EDE0: ldr r1, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool @0814EE0C: ldr r5, =0x02024064 ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0814EE7C ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x8 ands r1, r0 ldr r4, =gUnknown_085CBD85 cmp r1, 0 beq @0814EE2A ldr r4, =gUnknown_085CBD8B @0814EE2A: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =0x0202406e ldr r2, =0x02024744 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 .pool @0814EE7C: ldr r1, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool @0814EEA8: ldr r5, =0x02024474 ldrb r0, [r5, 0x17] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0814EF18 ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x8 ands r1, r0 ldr r4, =gUnknown_085CBD85 cmp r1, 0 beq @0814EEC6 ldr r4, =gUnknown_085CBD8B @0814EEC6: ldrb r1, [r4] adds r0, r1, 0 ldr r3, =0x0202406e ldr r2, =0x02024744 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 .pool @0814EF18: ldr r1, =0x0202406e ldrb r0, [r5, 0x17] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool @0814EF44: ldr r0, =0x0203aba8 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 .pool @0814EF5C: ldr r0, =0x0203aba8 ldr r2, [r0] ldrh r1, [r2, 0x2] movs r0, 0xB1 lsls r0, 1 cmp r1, r0 bls @0814EF88 @0814EF6A: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x8E ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 ldr r1, =gUnknown_085CCBBC adds r4, r0, r1 b @0814F5C0 .align 2, 0 .pool @0814EF88: ldrh r1, [r2, 0x2] @0814EF8A: movs r0, 0xD muls r1, r0 ldr r0, =gMoveNames adds r4, r1, r0 b @0814F5C0 .align 2, 0 .pool @0814EF98: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x02000002 ands r0, r1 cmp r0, 0 beq @0814F06E ldr r2, =0x02024208 ldrh r0, [r2] cmp r0, 0xAF bne @0814F064 movs r0, 0x40 ands r1, r0 cmp r1, 0 bne @0814F014 ldr r0, =0x02024474 adds r0, 0x25 ldrb r0, [r0] cmp r0, 0 beq @0814EFE0 ldr r2, =0x0202420f ldrb r1, [r2] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0814EFEC b @0814F05C .align 2, 0 .pool @0814EFE0: ldr r2, =0x0202420f 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, =0x02024404 adds r1, r0 mov r0, sp bl gf_strcpy ldr r1, =gUnknown_085CC0AD mov r0, sp bl gf_strcat b @0814F5BE .align 2, 0 .pool @0814F014: ldr r2, =0x020229e8 ldr r0, =0x02024474 adds r0, 0x25 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0202420f ldrb r2, [r1] ldrh r0, [r0, 0x18] cmp r0, r2 bne @0814F05C lsls r1, r2, 3 subs r1, r2 lsls r1, 2 ldr r0, =0x02024404 adds r1, r0 mov r0, sp bl gf_strcpy ldr r1, =gUnknown_085CC0AD mov r0, sp bl gf_strcat b @0814F5BE .align 2, 0 .pool @0814F05C: ldr r4, =gUnknown_085CC0A0 b @0814F5C0 .align 2, 0 .pool @0814F064: ldrh r0, [r2] mov r1, sp bl itemid_get_name b @0814F5BE @0814F06E: ldr r0, =0x02024208 ldrh r0, [r0] mov r1, sp bl itemid_get_name b @0814F5BE .align 2, 0 .pool @0814F080: ldr r0, =0x0202420a b @0814F0C0 .align 2, 0 .pool @0814F088: ldr r1, =0x0203aba4 ldr r0, =0x0202420b b @0814F0BC .align 2, 0 .pool @0814F098: ldr r1, =0x0203aba4 ldr r0, =0x0202420c b @0814F0BC .align 2, 0 .pool @0814F0A8: ldr r1, =0x0203aba4 ldr r0, =0x02024474 ldrb r0, [r0, 0x17] b @0814F0BE .align 2, 0 .pool @0814F0B8: ldr r1, =0x0203aba4 ldr r0, =0x0202420e @0814F0BC: ldrb r0, [r0] @0814F0BE: adds r0, r1 @0814F0C0: ldrb r1, [r0] movs r0, 0xD muls r1, r0 ldr r0, =gAbilityNames adds r4, r1, r0 b @0814F5C0 .align 2, 0 .pool @0814F0D8: ldr r0, =0x02022fec 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 .pool @0814F0F0: ldr r3, =0x02038bca 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 .pool @0814F10C: ldr r0, =0x000003fe cmp r2, r0 bne @0814F11C bl sub_81A4D00 b @0814F59C .align 2, 0 .pool @0814F11C: ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0814F12C ldrh r0, [r3] b @0814F598 .align 2, 0 .pool @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, =gTrainers 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 .pool @0814F164: ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x80 lsls r0, 20 ands r0, r1 cmp r0, 0 beq @0814F1AC movs r2, 0 ldr r4, =0x020244a8 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 .pool @0814F1AC: ldr r3, =0x02038bca 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 .pool @0814F1C4: ldr r0, =0x000003fe cmp r2, r0 bne @0814F1D8 mov r0, sp bl sub_81A4D50 b @0814F5BE .align 2, 0 .pool @0814F1D8: ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0814F1E8 ldrh r1, [r3] b @0814F5B8 .align 2, 0 .pool @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, =gTrainers + 0x4 ; name offset adds r4, r1, r0 b @0814F5C0 .align 2, 0 .pool @0814F220: lsls r0, r7, 3 subs r0, r7 lsls r0, 2 ldr r1, =0x020229f0 adds r4, r0, r1 b @0814F5C0 .align 2, 0 .pool @0814F230: ldr r4, =0x020229e8 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 .pool @0814F244: ldr r4, =0x020229e8 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 .pool @0814F258: ldr r4, =0x020229e8 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 .pool @0814F27C: ldr r0, =0x02024474 ldrb r0, [r0, 0x17] bl sub_806D864 @0814F284: lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r0, =0x020229f0 adds r4, r1, r0 b @0814F5C0 .align 2, 0 .pool @0814F298: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @0814F2B4 ldr r4, =0x020229f0 b @0814F5C0 .align 2, 0 .pool @0814F2B4: ldr r0, =0x03005d90 ldr r4, [r0] b @0814F5C0 .align 2, 0 .pool @0814F2C0: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0814F2E0 ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0x2 b @0814F55A .align 2, 0 .pool @0814F2E0: movs r0, 0x80 lsls r0, 19 ands r1, r0 cmp r1, 0 beq @0814F2F8 ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0x4 b @0814F584 .align 2, 0 .pool @0814F2F8: bl sub_80B1CA4 adds r4, r0, 0 b @0814F5C0 @0814F300: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0814F31C ldr r0, =0x02038bca b @0814F556 .align 2, 0 .pool @0814F31C: movs r0, 0x80 lsls r0, 19 ands r1, r0 cmp r1, 0 bne @0814F328 b @0814F5C0 @0814F328: ldr r0, =0x02038bca b @0814F580 .align 2, 0 .pool @0814F330: ldr r0, =0x02024474 ldrb r0, [r0, 0x17] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0814F39C ldr r0, =0x02022fec ldr r1, [r0] movs r0, 0x8 ands r1, r0 ldr r4, =gUnknown_085CBD85 cmp r1, 0 beq @0814F34E ldr r4, =gUnknown_085CBD8B @0814F34E: ldrb r1, [r4] adds r0, r1, 0 ldr r5, =0x02024744 mov r12, r5 ldr r2, =0x0202449c 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 .pool @0814F39C: ldr r0, =0x0202449c ldr r0, [r0] adds r0, 0x52 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool @0814F3C4: ldr r0, =0x000008ab bl flag_check lsls r0, 24 ldr r4, =gUnknown_085CC015 cmp r0, 0 bne @0814F3D4 b @0814F5C0 @0814F3D4: ldr r4, =gUnknown_085CC01F b @0814F5C0 .align 2, 0 .pool @0814F3E4: ldr r0, =0x0202420b b @0814F3EE .align 2, 0 .pool @0814F3EC: ldr r0, =0x0202420c @0814F3EE: ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 ldr r4, =gUnknown_085CBD9A cmp r0, 0 beq @0814F3FE b @0814F5C0 @0814F3FE: ldr r4, =gUnknown_085CBD9E b @0814F5C0 .align 2, 0 .pool @0814F410: ldr r0, =0x0202420b b @0814F41A .align 2, 0 .pool @0814F418: ldr r0, =0x0202420c @0814F41A: ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 ldr r4, =gUnknown_085CBD91 cmp r0, 0 beq @0814F42A b @0814F5C0 @0814F42A: ldr r4, =gUnknown_085CBD95 b @0814F5C0 .align 2, 0 .pool @0814F43C: ldr r0, =0x0202420b b @0814F446 .align 2, 0 .pool @0814F444: ldr r0, =0x0202420c @0814F446: ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 ldr r4, =gUnknown_085CBDA3 cmp r0, 0 beq @0814F456 b @0814F5C0 @0814F456: ldr r4, =gUnknown_085CBDA7 b @0814F5C0 .align 2, 0 .pool @0814F468: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0814F484 ldr r0, =0x02038bcc b @0814F596 .align 2, 0 .pool @0814F484: movs r0, 0x80 lsls r0, 19 ands r1, r0 cmp r1, 0 beq @0814F49C ldr r0, =0x02038bcc ldrh r0, [r0] bl sub_81D5530 b @0814F59C .align 2, 0 .pool @0814F49C: ldr r2, =gTrainers ldr r0, =0x02038bcc 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 .pool @0814F4B8: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0814F4D4 ldr r0, =0x02038bcc b @0814F5B6 .align 2, 0 .pool @0814F4D4: movs r0, 0x80 lsls r0, 19 ands r1, r0 cmp r1, 0 beq @0814F4F0 ldr r0, =0x02038bcc ldrh r1, [r0] mov r0, sp bl sub_81D5554 b @0814F5BE .align 2, 0 .pool @0814F4F0: ldr r0, =0x02038bcc ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 ldr r1, =gTrainers + 0x4 ; name offset adds r4, r0, r1 b @0814F5C0 .align 2, 0 .pool @0814F508: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0814F528 ldr r0, =0x02038bcc ldrh r1, [r0] movs r0, 0x2 b @0814F55A .align 2, 0 .pool @0814F528: movs r0, 0x80 lsls r0, 19 ands r1, r0 cmp r1, 0 beq @0814F540 ldr r0, =0x02038bcc ldrh r1, [r0] movs r0, 0x4 b @0814F584 .align 2, 0 .pool @0814F540: bl sub_80B1CE0 adds r4, r0, 0 b @0814F5C0 @0814F548: ldr r0, =0x02022fec ldr r1, [r0] ldr r0, =0x003f0100 ands r0, r1 cmp r0, 0 beq @0814F574 ldr r0, =0x02038bcc @0814F556: ldrh r1, [r0] movs r0, 0x1 @0814F55A: bl sub_81A36D0 ldr r4, =0x02021fc4 b @0814F5C0 .align 2, 0 .pool @0814F574: movs r0, 0x80 lsls r0, 19 ands r1, r0 cmp r1, 0 beq @0814F5C0 ldr r0, =0x02038bcc @0814F580: ldrh r1, [r0] movs r0, 0x3 @0814F584: bl sub_81D572C ldr r4, =0x02021fc4 b @0814F5C0 .align 2, 0 .pool @0814F594: ldr r0, =0x02038bce @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, =gTrainerClassNames adds r4, r1, r0 b @0814F5C0 .align 2, 0 .pool @0814F5B4: ldr r0, =0x02038bce @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 .pool @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, =@0814F680 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085CC270 subs r1, 0xC lsls r1, 2 adds r1, r0 ldr r1, [r1] b @0814F8BE .align 2, 0 .pool @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, =gMoveNames adds r1, r0 b @0814F8BE .align 2, 0 .pool @0814F734: adds r0, r5, r7 ldrb r0, [r0, 0x1] lsls r1, r0, 3 subs r1, r0 ldr r0, =gTypeNames b @0814F846 .align 2, 0 .pool @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, =0x020244ec adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr b @0814F7A4 .align 2, 0 .pool @0814F768: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x8 ands r0, r1 cmp r0, 0 beq @0814F788 ldr r1, =gUnknown_085CBD8B adds r0, r6, 0 bl gf_strcat b @0814F790 .align 2, 0 .pool @0814F788: ldr r1, =gUnknown_085CBD85 adds r0, r6, 0 bl gf_strcat @0814F790: adds r0, r5, r7 ldrb r1, [r0, 0x2] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 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 .pool @0814F7BC: ldr r1, =gUnknown_085CBE00 adds r0, r5, r7 ldrb r0, [r0, 0x1] lsls r0, 2 adds r0, r1 ldr r1, [r0] b @0814F848 .align 2, 0 .pool @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, =0x020244ec adds r0, r1 movs r1, 0x2 adds r2, r6, 0 bl pokemon_getattr b @0814F81A .align 2, 0 .pool @0814F808: ldrb r1, [r4, 0x2] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 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 .pool @0814F828: ldr r1, =gUnknown_085CBE6C adds r0, r5, r7 ldrb r0, [r0, 0x1] lsls r0, 2 adds r0, r1 ldr r1, [r0] b @0814F848 .align 2, 0 .pool @0814F83C: adds r0, r5, r7 ldrb r1, [r0, 0x1] movs r0, 0xD muls r1, r0 ldr r0, =gAbilityNames @0814F846: adds r1, r0 @0814F848: adds r0, r6, 0 bl gf_strcat adds r5, 0x2 b @0814F8E0 .align 2, 0 .pool @0814F858: adds r0, r5, r7 ldrb r2, [r0, 0x1] ldrb r0, [r0, 0x2] lsls r0, 8 orrs r2, r0 ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 beq @0814F8D6 cmp r2, 0xAF bne @0814F8CC ldr r2, =0x020229e8 ldr r0, =0x02024474 adds r0, 0x25 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0202420f ldrb r2, [r1] ldrh r0, [r0, 0x18] cmp r0, r2 bne @0814F8BC lsls r1, r2, 3 subs r1, r2 lsls r1, 2 ldr r0, =0x02024404 adds r1, r0 adds r0, r6, 0 bl gf_strcpy ldr r1, =gUnknown_085CC0AD b @0814F8BE .align 2, 0 .pool @0814F8BC: ldr r1, =gUnknown_085CC0A0 @0814F8BE: adds r0, r6, 0 bl gf_strcat b @0814F8DE .align 2, 0 .pool @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, =0x0203aba8 ldr r3, =gUnknown_085CD336 @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, =gUnknown_085CCBB5 adds r0, r4, 0 bl gf_strcpy b @0814F944 .align 2, 0 .pool @0814F938: cmp r2, 0x4 bgt @0814F944 ldr r1, =gUnknown_085CCBB9 adds r0, r4, 0 bl gf_strcpy @0814F944: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085CD336 ldr r5, =0x0203aba8 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, =@0814F99C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0814F99C: .4byte @0814F9B0 .4byte @0814F9B8 .4byte @0814F9C0 .4byte @0814F9C8 .4byte @0814F9D8 @0814F9B0: ldr r1, =gUnknown_085CBDB7 b @0814F9CA .align 2, 0 .pool @0814F9B8: ldr r1, =gUnknown_085CBDB9 b @0814F9CA .align 2, 0 .pool @0814F9C0: ldr r1, =gUnknown_085CBDBB b @0814F9CA .align 2, 0 .pool @0814F9C8: ldr r1, =gUnknown_085CBDBD @0814F9CA: adds r0, r3, 0 bl gf_strcpy b @0814F9E0 .align 2, 0 .pool @0814F9D8: ldr r1, =gUnknown_085CBDBF adds r0, r3, 0 bl gf_strcpy @0814F9E0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085CD660 ldr r0, =0x02024474 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 .pool @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, =0x02024474 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, =0x03003014 ldrb r2, [r0] movs r1, 0x3 negs r1, r1 ands r1, r2 b @0814FAE8 .align 2, 0 .pool @0814FAE0: ldr r0, =0x03003014 ldrb r1, [r0] movs r2, 0x2 orrs r1, r2 @0814FAE8: strb r1, [r0] adds r3, r0, 0 ldr r0, =0x02022fec ldr r1, [r0] ldr r2, =0x01000002 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 .pool @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, =0x02000002 ands r0, r1 cmp r0, 0 beq @0814FB34 movs r6, 0x1 b @0814FB5C .align 2, 0 .pool @0814FB34: movs r0, 0x80 lsls r0, 17 ands r1, r0 cmp r1, 0 beq @0814FB54 ldr r4, =gUnknown_085CD668 bl sub_8185FC4 lsls r0, 24 lsrs r0, 24 adds r0, r4 ldrb r6, [r0] b @0814FB5C .align 2, 0 .pool @0814FB54: bl sav2_get_text_speed lsls r0, 24 lsrs r6, r0, 24 @0814FB5C: ldr r0, =0x03003014 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @0814FB7E .align 2, 0 .pool @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, =0x02024064 ldrb r2, [r0] lsls r1, r2, 9 ldr r0, =0x02023068 adds r1, r0 ldr r4, =gUnknown_08D85620 ldr r0, =0x020244b0 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, =0x02037714 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, =0x02037bcc 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0814FC8E ldr r0, =sub_814FCC8 bl set_callback2 adds r0, r4, 0 bl remove_task @0814FC8E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_814FC70 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 .pool 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, =0x030022c0 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, =@0814FCF8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 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, =0x040000d4 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, =0x0203abac ldr r0, =0x00004110 bl malloc_and_clear str r0, [r4] ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 ldrb r0, [r1] adds r0, 0x1 b @08150224 .align 2, 0 .pool @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, =gUnknown_0854C14C 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, =gUnknown_085CD66C movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r4, =0x0203abac ldr r1, [r4] adds r1, 0xFC movs r0, 0 bl bg_set_tilemap ldr r1, [r4] ldr r3, =0x000010fc adds r1, r3 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x000020fc adds r1, r0 movs r0, 0x2 bl bg_set_tilemap ldr r1, [r4] ldr r2, =0x000030fc adds r1, r2 movs r0, 0x3 bl bg_set_tilemap ldr r2, =0x02021bbc ldr r1, =0x02021bbe movs r0, 0 strh r0, [r1] strh r0, [r2] ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 ldrb r0, [r1] adds r0, 0x1 b @08150224 .align 2, 0 .pool @0814FE90: movs r4, 0 add r5, sp, 0x14 ldr r6, =gUnknown_085CDB54 @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, =gUnknown_085CDB74 bl gpu_pal_obj_alloc_and_load_multiple ldr r0, =gUnknown_085CD67C adds r1, r5, 0 bl malloc_and_decompress ldr r4, =0x0203abac ldr r1, [r4] ldr r2, =0x000040fc adds r1, r2 str r0, [r1] ldr r0, =gUnknown_085CD7D4 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, =gUnknown_085CD958 adds r1, r5, 0 bl malloc_and_decompress ldr r1, [r4] ldr r2, =0x00004104 adds r1, r2 str r0, [r1] ldr r0, =gUnknown_085CDB30 adds r1, r5, 0 bl malloc_and_decompress ldr r1, [r4] ldr r3, =0x0000410c adds r2, r1, r3 str r0, [r2] ldr r0, =0x00004108 adds r1, r0 ldr r0, =gUnknown_085CDB1C str r0, [r1] ldr r1, =gUnknown_08DBA5B8 movs r0, 0 str r0, [sp] movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 ldrb r0, [r1] adds r0, 0x1 b @08150224 .align 2, 0 .pool @0814FF50: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 beq @0814FF5C b @08150226 @0814FF5C: ldr r0, =gUnknown_08DBA518 movs r1, 0 movs r2, 0x80 bl gpu_pal_apply ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 ldrb r0, [r1] adds r0, 0x1 b @08150224 .align 2, 0 .pool @0814FF7C: bl sub_8150D28 bl run_active_tasks ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 b @08150224 .align 2, 0 .pool @0814FF98: ldr r0, =0x0203abac 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 .pool @0814FFB4: ldr r0, =gUnknown_0854C14C 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 .pool @0814FFF8: ldr r6, =0x0203abac 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, =0x00004104 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, =0x00004108 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, =0x0000410c 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 b @08150224 .align 2, 0 .pool @08150090: ldr r0, =0x020375e0 ldrb r0, [r0] bl sub_81514C8 ldr r1, =0x0203abac mov r9, r1 ldr r0, [r1] ldr r2, =0x000040fc 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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 ldrb r0, [r1] adds r0, 0x1 b @08150224 .align 2, 0 .pool @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, =0x000001a9 movs r1, 0x1 bl sub_80A3194 movs r0, 0x1 bl sub_8150B6C ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 ldrb r0, [r1] adds r0, 0x1 b @08150224 .align 2, 0 .pool @081501C8: ldr r3, =0x04000208 ldrh r2, [r3] movs r0, 0 strh r0, [r3] ldr r4, =0x04000200 ldrh r0, [r4] movs r1, 0x1 orrs r0, r1 strh r0, [r4] strh r2, [r3] ldr r0, =sub_8150800 bl SetVBlankCallback ldr r0, =mainloop bl set_callback2 ldr r0, =sub_81503E4 movs r1, 0 bl AddTask ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0 bne @08150218 ldr r0, =sub_8150550 b @0815021A .align 2, 0 .pool @08150218: ldr r0, =sub_8150664 @0815021A: movs r1, 0x1 bl AddTask ldr r1, =0x0203abac 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 .pool 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, =0x02021bbc strh r4, [r0] movs r0, 0 bl sub_80AB130 add r0, sp, 0x4 mov r8, r0 ldr r0, =gUnknown_0854C14C 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, =0x0203abac ldr r0, [r6] ldr r2, =0x00004108 adds r1, r0, r2 movs r5, 0 str r5, [r1] ldr r4, =0x0000410c adds r0, r4 ldr r0, [r0] bl free ldr r0, [r6] adds r4, r0, r4 str r5, [r4] ldr r4, =0x00004104 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, =0x000040fc 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, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 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, =0x040000d4 mov r1, r8 str r1, [r2] str r0, [r2, 0x4] lsrs r0, r3, 2 movs r1, 0x85 lsls r1, 24 orrs r0, r1 str r0, [r2, 0x8] ldr r0, [r2, 0x8] movs r1, 0xA0 lsls r1, 19 mov r0, sp strh r4, [r0] str r0, [r2] str r1, [r2, 0x4] lsrs r3, 1 movs r0, 0x81 lsls r0, 24 orrs r3, r0 str r3, [r2, 0x8] ldr r0, [r2, 0x8] bl warp_in ldr r0, =0x03005dac str r4, [r0] ldr r0, =c2_load_new_map bl set_callback2 add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203abac 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 .pool @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, =gUnknown_0854C14C 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 .pool @08150490: ldr r0, =gUnknown_0854C14C 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 .pool @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, =0x023a0000 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 .pool @08150510: ldr r0, =0x02037fd4 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 .pool @08150528: movs r0, 0 bl SetVBlankCallback adds r0, r6, 0 bl remove_task ldr r0, [r5] ldrb r0, [r0] bl remove_task ldr r0, =c2_8011A1C bl set_callback2 @08150542: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81503E4 thumb_func_start sub_8150550 sub_8150550: ; 8150550 push {r4-r6,lr} sub sp, 0xC ldr r6, =0x0203abac 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 .pool @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, =0x00004108 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, =0x0000410c 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, =0x02021bbc 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 .pool thumb_func_end sub_8150550 thumb_func_start sub_8150664 sub_8150664: ; 8150664 push {r4-r7,lr} sub sp, 0xC ldr r7, =0x0203abac 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 .pool @081506BC: cmp r1, 0x28 beq @08150784 cmp r1, 0xB0 bne @081507B6 ldr r1, =0x0000410c 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 .pool @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, =0x00004108 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 .pool @08150784: ldr r5, =0x00004108 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, =0x0203abac ldr r1, [r0] ldrh r0, [r1, 0x6] ldrh r1, [r1, 0x4] cmp r0, r1 bcs @081507DC ldr r4, =0x02021bbc movs r1, 0 ldrsh r0, [r4, r1] b @081507E6 .align 2, 0 .pool @081507DC: ldr r0, =gUnknown_0854C14C ldr r4, [r0] ldr r0, =0x000006fc 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 .pool 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, =0x0203abac 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 .pool 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, =0x0203abac ldr r6, [r0] ldrb r0, [r6, 0x1] cmp r0, 0xFF beq @08150934 ldr r0, =0x020375e0 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, =0x47800000 bl __addsf3 @08150892: ldr r1, =0x3e0f5c29 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, =0x47800000 bl __addsf3 @081508BA: ldr r1, =0x3d89374c 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 .pool @081508E4: movs r0, 0x6 ldrsh r4, [r6, r0] adds r0, r4, 0 bl __floatsisf cmp r4, 0 bge @081508F8 ldr r1, =0x47800000 bl __addsf3 @081508F8: ldr r1, =0x3e0f5c29 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, =0x47800000 bl __addsf3 @08150920: ldr r1, =0x3d89374c 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 .pool thumb_func_end sub_8150868 thumb_func_start sub_8150948 sub_8150948: ; 8150948 push {r4-r6,lr} adds r5, r0, 0 ldr r0, =0x0203abac ldr r6, [r0] ldrb r0, [r6, 0x1] cmp r0, 0xFF bne @08150958 b @08150A60 @08150958: ldr r0, =0x020375e0 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, =0x47800000 bl __addsf3 @08150974: ldr r1, =0x3e0f5c29 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, =0x47800000 bl __addsf3 @0815099C: ldr r1, =0x3d89374c 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 .pool @081509C8: movs r0, 0x6 ldrsh r4, [r6, r0] adds r0, r4, 0 bl __floatsisf cmp r4, 0 bge @081509DC ldr r1, =0x47800000 bl __addsf3 @081509DC: ldr r1, =0x3e0f5c29 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, =0x47800000 bl __addsf3 @08150A04: ldr r1, =0x3d89374c 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 .pool @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, =0x020375e0 ldrh r3, [r0] cmp r3, 0 bne @08150C74 ldr r1, =0x0203abac 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 .pool @08150C74: ldr r1, =0x0203abac 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 .pool 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, =gUnknown_085CDBE4 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, =gUnknown_085CDBE6 adds r0, r6, 0 movs r2, 0x4 bl memcpy add r5, sp, 0x14 ldr r1, =gUnknown_085CDBEA adds r0, r5, 0 movs r2, 0x8 bl memcpy add r4, sp, 0x1C ldr r1, =gUnknown_085CDBF2 adds r0, r4, 0 movs r2, 0x4 bl memcpy ldr r0, =gUnknown_085CDBF8 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x20] str r1, [sp, 0x24] ldr r0, =0x020375e0 ldrh r0, [r0] mov r8, r6 mov r10, r5 cmp r0, 0 beq @08150D86 cmp r0, 0x1 beq @08150E68 @08150D86: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] add r0, sp adds r0, 0xC ldrb r0, [r0] ldr r1, =sub_8150948 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, =0x02020630 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, =gUnknown_085CDB9C 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, =0x02020630 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, =0x0203abac 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 .pool @08150E68: ldr r7, =0x0203abac ldr r0, [r7] ldr r1, =0x000040fc 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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] add r0, sp adds r0, 0xC ldrb r0, [r0] ldr r1, =sub_8150948 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, =0x02020630 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, =gUnknown_085CDB9C 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, =0x02020630 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, =0x00000109 strh r0, [r1, 0x4] movs r0, 0x7 bl sub_80AB130 @08150F3A: movs r4, 0 ldr r5, =0x02020630 @08150F3E: lsls r1, r4, 20 movs r2, 0xC0 lsls r2, 15 adds r1, r2 asrs r1, 16 lsls r2, r4, 19 ldr r3, =0xfff80000 adds r2, r3 asrs r2, 16 ldr r0, =gUnknown_085CDBCC 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, =0x020375e0 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, =0x02020630 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 .pool @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, =0x02020630 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 .pool 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, =0x0203abac 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, =0x0203abac 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, =0x000040fc 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 .pool thumb_func_end sub_8151088 thumb_func_start sub_815115C sub_815115C: ; 815115C push {r4,r5,lr} ldr r5, =0x0203abac 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 .pool thumb_func_end sub_815115C thumb_func_start sub_81511B8 sub_81511B8: ; 81511B8 push {r4,r5,lr} ldr r5, =0x0203abac 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 .pool 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, =0x0203abac 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, =0x0203abb2 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, =0x0203abb0 mov r9, r3 ldr r0, =0x0203abb1 mov r8, r0 @0815126E: mov r1, r9 ldr r2, [r1] ldrb r0, [r2, 0x19] strb r0, [r6] ldr r0, =0x0203abb2 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, =0x0203abb0 ldr r4, =0x0203abac 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 .pool 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, =0x0203abac 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, =0x0203abb5 ldr r0, [r2] ldrb r0, [r0, 0x1A] strb r0, [r1] ldr r6, =0x0203abb3 mov r10, r2 ldr r0, =0x0203abb4 mov r9, r0 @081513D4: mov r1, r10 ldr r2, [r1] ldrb r0, [r2, 0x19] strb r0, [r6] ldr r0, =0x0203abb5 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, =0x0203abb4 ldr r5, =0x0203abac 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 .pool 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, =0x0203abac 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 .pool @08151500: ldr r1, =0x0203abac 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, =0x0203abac ldr r1, [r0] movs r0, 0 strb r0, [r1, 0x1C] pop {r0} bx r0 .align 2, 0 .pool 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, =0xfffffc1f 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, =0x02037b14 adds r3, r0, r1 ldr r1, =0x02037714 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 .pool @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, =0x02037b14 @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 .pool @08151990: ldrb r0, [r3, 0x8] cmp r2, r0 bcs @081519B4 ldr r5, =0x02037b14 ldr r4, =0x02037714 @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 .pool 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, =0x02037b14 adds r0, r1, r0 ldr r2, =0x02037714 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 .pool @08151B10: strb r3, [r4, 0x7] @08151B12: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0xF bls @08151AAA ldr r0, =0x0000ffff cmp r7, r0 bne @08151B2C movs r0, 0 strb r0, [r6] b @08151B30 .align 2, 0 .pool @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, =0x02037b14 ldr r3, =0x02037714 @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 .pool 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, =0x02037b14 ldr r4, =0x02037714 @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 .pool @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, =0x02037b14 ldr r4, =0x02037714 @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 .pool 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, =0x02037fd4 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 .pool @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, =0x0203abb8 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 .pool @08152208: strb r4, [r1] cmp r5, r4 bcs @08152242 adds r3, r6, 0 ldr r0, =gUnknown_082EC690 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 .pool thumb_func_end sub_81521C0 thumb_func_start sub_8152254 sub_8152254: ; 8152254 push {r4-r7,lr} movs r3, 0 ldr r0, =0x0203abb8 ldr r2, [r0] adds r5, r0, 0 cmp r2, 0 bne @0815226C movs r0, 0 b @081522C4 .align 2, 0 .pool @0815226C: ldrb r2, [r2] cmp r3, r2 bcs @08152292 ldr r0, =0x030024f8 mov r12, r0 ldr r4, =gUnknown_082EC690 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 .pool 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, =0x0203abb8 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 .pool @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, =0x030024f8 adds r0, r1 ldr r1, =gUnknown_082EC690 ldm r1!, {r2,r3} stm r0!, {r2,r3} b @081523C0 .align 2, 0 .pool @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, =0x000001ff adds r0, r1, 0 ands r2, r0 ldrh r0, [r3, 0x2] ldr r1, =0xfffffe00 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, =0x000003ff adds r0, r1, 0 adds r1, r3, 0 ands r1, r0 mov r12, r1 ldrh r0, [r2, 0x4] ldr r3, =0xfffffc00 adds r1, r3, 0 ands r0, r1 mov r1, r12 orrs r0, r1 strh r0, [r2, 0x4] lsls r1, r6, 3 ldr r2, =0x030024f8 ldr r0, [r4, 0x4] adds r1, r2 adds r0, r5, r0 ldm r0!, {r2,r3} stm r1!, {r2,r3} @081523C0: ldr r3, =0x0203abb8 @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 .pool 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, =0x0000ffff 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 .pool @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, =0x0203abb8 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 .pool @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, =0x0203abb8 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 .pool @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, =0x0203abb8 ldr r0, [r0] cmp r0, 0 beq @0815255E mov r1, r9 cmp r1, 0 bne @08152530 b @0815255E .align 2, 0 .pool @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, =0x0203abb8 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 .pool @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, =0xfffffe00 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, =0x030024f8 adds r1, r0 ldr r0, =gUnknown_082EC690 ldm r0!, {r2,r3} stm r1!, {r2,r3} adds r0, r5, 0 @0815263C: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03007860 @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 .pool thumb_func_end calls_flash_erase_block thumb_func_start sub_8152680 sub_8152680: ; 8152680 ldr r0, =0x03006200 movs r1, 0 str r1, [r0] ldr r0, =0x030061f0 strh r1, [r0] ldr r0, =0x030061fc str r1, [r0] bx lr .align 2, 0 .pool 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, =0x030061fc movs r1, 0x1 lsls r1, r3 ldr r0, [r2] orrs r0, r1 str r0, [r2] b @081526F4 .align 2, 0 .pool @081526D0: ldr r2, =0x030061fc adds r1, r0, 0 lsls r1, r3 ldr r0, [r2] bics r0, r1 str r0, [r2] b @081526F4 .align 2, 0 .pool @081526E4: ldr r0, =0x030061fc 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 .pool 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, =0x03006204 ldr r0, =0x0203abbc str r0, [r1] ldr r0, =0x0000ffff 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 .pool @08152730: ldr r1, =0x030061f8 ldr r5, =0x030061f0 ldrh r0, [r5] strh r0, [r1] ldr r1, =0x030061f4 ldr r6, =0x03006200 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, =0x030061fc ldr r0, [r0] cmp r0, 0 beq @08152782 movs r5, 0xFF ldr r1, =0x030061f0 ldr r0, =0x030061f8 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03006200 ldr r0, =0x030061f4 ldr r0, [r0] str r0, [r1] @08152782: adds r0, r5, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x030061f0 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, =0x03006200 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, =0x03006204 mov r12, r2 mov r8, r12 movs r2, 0 ldr r1, =0x00000fff @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, =0x00000ff4 adds r0, r1, r2 strh r6, [r0] ldr r3, =0x00000ff8 adds r2, r1, r3 ldr r0, =0x08012025 str r0, [r2] ldr r6, =0x00000ffc 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, =0x03006204 ldr r1, [r1] ldr r7, =0x00000ff6 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 .pool 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, =0x0203abbc movs r3, 0 movs r6, 0 ldr r1, =0x00000fff @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, =0x00000ff8 adds r1, r4, r0 ldr r0, =0x08012025 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, =0x00000ff4 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 .pool 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, =0x03006204 ldr r0, =0x0203abbc str r0, [r1] ldr r1, =0x030061f8 ldr r5, =0x030061f0 ldrh r0, [r5] strh r0, [r1] ldr r1, =0x030061f4 ldr r6, =0x03006200 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, =0x03006208 movs r0, 0 strh r0, [r1] ldr r1, =0x030061fc movs r0, 0 str r0, [r1] pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8152934 thumb_func_start sub_8152990 sub_8152990: ; 8152990 ldr r1, =0x03006204 ldr r0, =0x0203abbc str r0, [r1] ldr r1, =0x030061f8 ldr r0, =0x030061f0 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x030061f4 ldr r0, =0x03006200 ldr r0, [r0] str r0, [r1] ldr r1, =0x03006208 movs r0, 0 strh r0, [r1] ldr r1, =0x030061fc movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03006208 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, =0x030061fc ldr r0, [r0] cmp r0, 0 beq @08152A2A movs r5, 0xFF ldr r1, =0x030061f0 ldr r0, =0x030061f8 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03006200 ldr r0, =0x030061f4 ldr r0, [r0] str r0, [r1] b @08152A2A .align 2, 0 .pool @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, =0xffff0000 adds r0, r2 lsrs r0, 16 bl calls_flash_erase_block_2 ldr r0, =0x030061fc ldr r0, [r0] cmp r0, 0 beq @08152A5E movs r4, 0xFF ldr r1, =0x030061f0 ldr r0, =0x030061f8 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x03006200 ldr r0, =0x030061f4 ldr r0, [r0] str r0, [r1] @08152A5E: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x030061f0 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, =0x03006200 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, =0x03006204 mov r12, r2 mov r8, r12 movs r2, 0 ldr r1, =0x00000fff @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, =0x00000ff4 adds r0, r1, r2 strh r6, [r0] ldr r6, =0x00000ff8 adds r2, r1, r6 ldr r0, =0x08012025 str r0, [r2] ldr r7, =0x00000ffc 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, =0x03006204 ldr r1, [r1] ldr r2, =0x00000ff6 adds r1, r2 strh r0, [r1] ldr r0, =0x03007860 ldr r1, [r0] adds r0, r5, 0 bl _call_via_r1 movs r6, 0x1 movs r4, 0 ldr r7, =0x00000ff7 mov r9, r7 ldr r7, =0x03007854 b @08152B82 .align 2, 0 .pool @08152B7C: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 @08152B82: cmp r4, r9 bhi @08152BA0 ldr r0, =0x03006204 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 .pool @08152BB0: movs r6, 0x1 movs r4, 0 ldr r1, =0x03007854 mov r9, r1 ldr r7, =0x00000ff9 b @08152BCA .align 2, 0 .pool @08152BC4: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 @08152BCA: cmp r4, 0x6 bhi @08152BEC adds r1, r4, r7 ldr r0, =0x03006204 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 .pool @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, =0x030061f0 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, =0x03006200 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, =0x03007854 ldr r1, =0x00000ff8 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 .pool @08152C84: lsls r1, r4, 24 lsrs r1, 24 movs r0, 0 bl sub_815269C ldr r0, =0x030061f8 ldrh r0, [r0] strh r0, [r6] ldr r0, =0x030061f4 ldr r0, [r0] str r0, [r5] movs r0, 0xFF @08152C9C: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sav12_xor_get thumb_func_start sub_8152CAC sub_8152CAC: ; 8152CAC push {r4-r6,lr} lsls r0, 16 ldr r6, =0x030061f0 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, =0x03006200 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, =0x03007854 ldr r1, =0x00000ff8 ldr r0, =0x03006204 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 .pool @08152D1C: lsls r1, r4, 24 lsrs r1, 24 movs r0, 0 bl sub_815269C ldr r0, =0x030061f8 ldrh r0, [r0] strh r0, [r6] ldr r0, =0x030061f4 ldr r0, [r0] str r0, [r5] movs r0, 0xFF @08152D34: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8152CAC thumb_func_start sub_8152D44 sub_8152D44: ; 8152D44 push {r4-r6,lr} lsls r0, 16 ldr r6, =0x030061f0 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, =0x03006200 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, =0x03007854 ldr r1, =0x00000ff8 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 .pool @08152DA8: lsls r1, r4, 24 lsrs r1, 24 movs r0, 0 bl sub_815269C ldr r0, =0x030061f8 ldrh r0, [r0] strh r0, [r6] ldr r0, =0x030061f4 ldr r0, [r0] str r0, [r5] movs r0, 0xFF @08152DC0: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03006204 ldr r0, =0x0203abbc str r0, [r1] ldr r0, =0x0000ffff cmp r4, r0 beq @08152DF4 movs r5, 0xFF b @08152E06 .align 2, 0 .pool @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, =0x03006200 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, =0x03006204 @08152E2C: adds r0, r5, r7 lsls r0, 24 lsrs r0, 24 ldr r1, [r6] bl sub_815314C ldr r0, [r6] ldr r1, =0x00000ff4 adds r0, r1 ldrh r1, [r0] cmp r1, 0 bne @08152E48 ldr r0, =0x030061f0 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, =0x00000ff8 adds r0, r2, r1 ldr r1, [r0] ldr r0, =0x08012025 adds r5, 0x1 cmp r1, r0 bne @08152E98 ldr r1, =0x00000ff6 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, =0x03006204 @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 .pool 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, =0x03006204 @08152EE4: lsls r0, r4, 24 lsrs r0, 24 ldr r1, [r7] bl sub_815314C ldr r2, [r7] ldr r1, =0x00000ff8 adds r0, r2, r1 ldr r1, [r0] ldr r0, =0x08012025 cmp r1, r0 bne @08152F34 movs r5, 0x1 ldr r3, =0x00000ff4 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, =0x00000ff6 adds r0, r1, r3 ldrh r0, [r0] cmp r0, r2 bne @08152F34 ldr r2, =0x00000ffc 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, =0x00003fff movs r1, 0xFF str r1, [sp] cmp r6, r0 bne @08152F74 movs r2, 0x1 str r2, [sp] b @08152F74 .align 2, 0 .pool @08152F70: movs r3, 0 str r3, [sp] @08152F74: movs r6, 0 movs r5, 0 movs r4, 0 ldr r7, =0x03006204 @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, =0x00000ff8 adds r0, r2, r1 ldr r1, [r0] ldr r0, =0x08012025 cmp r1, r0 bne @08152FD0 movs r5, 0x1 ldr r3, =0x00000ff4 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, =0x00000ff6 adds r0, r1, r3 ldrh r0, [r0] cmp r0, r2 bne @08152FD0 ldr r2, =0x00000ffc 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, =0x00003fff movs r1, 0xFF cmp r6, r0 bne @0815300A movs r1, 0x1 b @0815300A .align 2, 0 .pool @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, =0x03006200 mov r3, r9 b @08153064 .align 2, 0 .pool @08153044: ldr r0, =0x03006200 mov r1, r8 str r1, [r0] b @08153094 .align 2, 0 .pool @08153050: cmp r8, r9 bcs @08153060 ldr r0, =0x03006200 mov r2, r9 str r2, [r0] b @08153094 .align 2, 0 .pool @08153060: ldr r0, =0x03006200 mov r3, r8 @08153064: str r3, [r0] b @08153094 .align 2, 0 .pool @0815306C: ldr r0, =0x03006200 mov r2, r8 str r2, [r0] cmp r1, 0xFF beq @0815308C b @08153094 .align 2, 0 .pool @0815307C: cmp r1, 0x1 bne @08153098 ldr r0, =0x03006200 mov r3, r9 str r3, [r0] ldr r0, [sp] cmp r0, 0xFF bne @08153094 @0815308C: movs r0, 0xFF b @081530C4 .align 2, 0 .pool @08153094: movs r0, 0x1 b @081530C4 @08153098: ldr r2, [sp] cmp r2, 0 bne @081530B8 cmp r1, 0 bne @081530B8 ldr r0, =0x03006200 str r1, [r0] ldr r0, =0x030061f0 strh r1, [r0] movs r0, 0 b @081530C4 .align 2, 0 .pool @081530B8: ldr r0, =0x03006200 movs r1, 0 str r1, [r0] ldr r0, =0x030061f0 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 .pool 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, =0x0203abbc adds r1, r5, 0 bl sub_815314C ldr r1, =0x00000ff8 adds r0, r5, r1 ldr r1, [r0] ldr r0, =0x08012025 cmp r1, r0 bne @08153144 adds r0, r5, 0 adds r1, r4, 0 bl sub_8153164 lsls r0, 16 lsrs r0, 16 ldr r2, =0x00000ff4 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 .pool @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, =0x03006220 ldr r0, =0x03005d90 ldr r2, =gUnknown_085CDC00 ldrh r1, [r2] ldr r0, [r0] adds r0, r1 str r0, [r3] ldrh r0, [r2, 0x2] strh r0, [r3, 0x4] ldr r5, =0x03005d8c 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, =0x03006220 ldr r5, =0x03005d94 ldr r0, =gUnknown_085CDC00 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 .pool 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, =0x0203cf5c ldr r6, [r1] movs r0, 0 str r0, [r1] bl sub_8153190 cmp r4, 0x5 bhi @081532AC lsls r0, r4, 2 ldr r1, =@0815322C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0815322C: .4byte @081532AC .4byte @081532C4 .4byte @081532C4 .4byte @0815325A .4byte @081532F8 .4byte @08153244 @08153244: movs r4, 0x1C ldr r5, =0x03007860 @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, =0x000003e6 cmp r0, r1 bhi @0815326C movs r0, 0xA bl sav12_xor_increment @0815326C: bl save_serialize_game ldr r0, =0x0000ffff ldr r1, =0x03006220 bl save_write_to_flash ldr r4, =0x0201c000 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 .pool @081532AC: bl save_serialize_game ldr r0, =0x0000ffff ldr r1, =0x03006220 bl save_write_to_flash b @0815331A .align 2, 0 .pool @081532C4: bl save_serialize_game movs r4, 0 @081532CA: adds r0, r4, 0 ldr r1, =0x03006220 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, =0x03006220 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 .pool @081532F8: movs r4, 0x1C ldr r5, =0x03007860 @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, =0x0000ffff ldr r1, =0x03006220 bl save_write_to_flash @0815331A: ldr r0, =0x0203cf5c str r6, [r0] movs r0, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d88 ldr r4, [r0] cmp r4, 0x1 bne @0815335A adds r0, r5, 0 bl calls_flash_erase_block_3 ldr r0, =0x030061fc ldr r0, [r0] cmp r0, 0 beq @08153370 adds r0, r5, 0 bl fullscreen_save_activate @0815335A: ldr r1, =0x03006294 movs r0, 0xFF strh r0, [r1] movs r0, 0xFF b @08153376 .align 2, 0 .pool @08153370: ldr r0, =0x03006294 strh r4, [r0] movs r0, 0x1 @08153376: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end save_game_when_memory_present thumb_func_start sub_8153380 sub_8153380: ; 8153380 push {lr} ldr r0, =0x03005d88 ldr r0, [r0] cmp r0, 0x1 bne @081533A4 bl sub_8153190 bl save_serialize_game ldr r0, =0x03006220 bl sub_8152934 movs r0, 0 b @081533A6 .align 2, 0 .pool @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, =0x03006220 movs r0, 0xE bl sub_81529D4 lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x030061fc 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 .pool @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, =0x03006220 movs r0, 0xE bl sub_8152A34 ldr r0, =0x030061fc 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 .pool thumb_func_end sub_81533E0 thumb_func_start sub_8153408 sub_8153408: ; 8153408 push {lr} ldr r1, =0x03006220 movs r0, 0xE bl sub_8152CAC ldr r0, =0x030061fc 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 .pool thumb_func_end sub_8153408 thumb_func_start sub_8153430 sub_8153430: ; 8153430 push {r4,lr} ldr r0, =0x03005d88 ldr r0, [r0] cmp r0, 0x1 bne @0815346C bl sub_8153190 bl save_serialize_game ldr r4, =0x03006220 adds r0, r4, 0 bl sub_8152990 ldr r0, =0x03006208 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 .pool @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, =0x03006208 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, =0x03006220 adds r1, r4, 0 bl sub_8152A34 adds r0, r5, 0 adds r1, r4, 0 bl sub_8152D44 b @081534B2 .align 2, 0 .pool @081534A8: ldr r1, =0x03006220 adds r0, r5, 0 bl sub_8152D44 movs r6, 0x1 @081534B2: ldr r0, =0x030061fc 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 .pool 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, =0x03005d88 ldr r0, [r0] cmp r0, 0x1 beq @081534F0 ldr r1, =0x03006210 movs r0, 0x4 strh r0, [r1] movs r0, 0xFF b @08153550 .align 2, 0 .pool @081534F0: bl sub_8153190 cmp r4, 0 beq @081534FC cmp r4, 0x3 beq @08153528 @081534FC: ldr r0, =0x0000ffff ldr r1, =0x03006220 bl sub_8152DD0 lsls r0, 24 lsrs r4, r0, 24 bl save_deserialize_game ldr r0, =0x03006210 strh r4, [r0] ldr r1, =0x03006214 movs r0, 0 str r0, [r1] b @0815354E .align 2, 0 .pool @08153528: ldr r5, =0x0201c000 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 .pool thumb_func_end sub_81534D0 thumb_func_start sub_815355C sub_815355C: ; 815355C push {r4-r7,lr} ldr r5, =0x03006204 ldr r0, =0x0203abbc str r0, [r5] adds r7, r0, 0 ldr r0, =0x03005d88 ldr r4, [r0] cmp r4, 0x1 beq @0815358C b @081535C8 .align 2, 0 .pool @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, =0x03006220 bl sub_8152EC8 ldr r0, =0x03006200 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, =0x00000ff4 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 .pool 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, =0x0203abbc movs r3, 0x80 lsls r3, 5 adds r0, r1, 0 movs r1, 0 adds r2, r4, 0 bl ReadFlash ldr r1, [r4] ldr r0, =0x0000b39d cmp r1, r0 beq @08153614 @08153608: movs r0, 0xFF b @0815362A .align 2, 0 .pool @08153614: movs r3, 0 ldr r5, =0x00000ffb 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 .pool 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, =0x0203abbc ldr r0, =0x0000b39d adds r3, r7, 0 stm r3!, {r0} movs r2, 0 ldr r4, =0x00000ffb @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 .pool @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, =0x03005e08 adds r4, r0, r1 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0xB bls @081536A2 b @081537C2 @081536A2: lsls r0, 2 ldr r1, =@081536B4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03002700 movs r1, 0x1 strb r1, [r0] movs r0, 0x1 strh r0, [r4] b @081537C2 .align 2, 0 .pool @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, =0x03002700 movs r0, 0 strb r0, [r1] adds r0, r2, 0 bl remove_task @081537C2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_08674C86 bl ExpandTextCodes movs r0, 0x3 bl sub_81538C4 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_082DED2C ldr r2, =gUnknown_082DED2C + 0x44 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 .pool 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, =0x0203bbc0 bl sub_8153820 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8153870 thumb_func_start sub_8153884 sub_8153884: ; 8153884 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x0203bbc0 adds r0, r4, 0 bl sub_8153850 ldr r1, [r4, 0x6C] str r1, [r5] pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8153884 thumb_func_start sub_81538A0 sub_81538A0: ; 81538A0 push {r4,lr} adds r1, r0, 0 ldr r4, =0x0203bbc0 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 .pool thumb_func_end sub_81538A0 thumb_func_start sub_81538C4 sub_81538C4: ; 81538C4 ldr r1, =0x0203bbc0 str r0, [r1, 0x6C] bx lr .align 2, 0 .pool thumb_func_end sub_81538C4 thumb_func_start sub_81538D0 sub_81538D0: ; 81538D0 push {lr} movs r2, 0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b18 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 .pool thumb_func_end sub_81538D0 thumb_func_start sub_81538F8 sub_81538F8: ; 81538F8 push {r4,r5,lr} ldr r5, =0x03005d8c ldr r0, [r5] ldr r1, =0x00003b18 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, =0x00003b14 adds r0, r2 ldr r0, [r0] cmp r1, r0 beq @0815393C @0815392A: movs r0, 0 b @0815393E .align 2, 0 .pool @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, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003b14 adds r1, r0 ldr r2, =0x01000008 mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r4] ldr r1, =0x00003b18 adds r0, r1 strb r3, [r0] ldr r0, [r4] ldr r2, =0x00003b19 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, =0x00003b14 adds r1, r2 str r0, [r1] @081539BC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8153970 thumb_func_start sub_81539D4 sub_81539D4: ; 81539D4 push {r4-r6,lr} ldr r6, =0x03005d8c ldr r0, [r6] ldr r1, =0x00003b18 adds r4, r0, r1 bl sub_81538F8 cmp r0, 0 bne @081539F8 bl sub_8153944 movs r0, 0 b @08153A1A .align 2, 0 .pool @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, =0x00003b14 adds r1, r2 str r0, [r1] @08153A18: adds r0, r5, 0 @08153A1A: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02021fc4 bl ExpandTextCodes @08153ABE: movs r0, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02021cc4 mov r9, r0 ldr r6, =0x03005d8c ldr r1, [r6] ldr r5, =0x000031f8 adds r1, r5 movs r2, 0x7 bl gf_strncpy adds r0, r4, 0 bl sub_80E15E4 ldr r4, =0x02021dc4 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, =0x02021fc4 ldr r1, =gUnknown_08674AE4 b @08153B74 .align 2, 0 .pool @08153B54: mov r0, r9 adds r1, r4, 0 bl sub_8008C44 cmp r0, 0 beq @08153B70 ldr r0, =0x02021fc4 ldr r1, =gUnknown_08674B16 b @08153B74 .align 2, 0 .pool @08153B70: ldr r0, =0x02021fc4 ldr r1, =gUnknown_08674B42 @08153B74: bl ExpandTextCodes movs r0, 0x2 str r0, [r7, 0x6C] bl sub_80E162C cmp r0, 0x1 bne @08153B9C ldr r0, =0x0000402d movs r1, 0x1 bl var_set b @08153BA0 .align 2, 0 .pool @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, =0x02021fc4 ldr r1, =gUnknown_08674B6A bl ExpandTextCodes movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_08674B9E bl ExpandTextCodes movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_08674BD4 bl ExpandTextCodes movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02021cc4 ldr r1, =gUnknown_085E8264 movs r2, 0xB bl gf_strncpy b @08153D22 .align 2, 0 .pool @08153D18: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085E8268 movs r2, 0xB bl gf_strncpy @08153D22: ldr r0, =0x020244e9 ldrb r0, [r0] cmp r0, 0x6 bne @08153D4C ldr r0, =0x02021fc4 ldr r1, =gUnknown_08674C02 bl ExpandTextCodes movs r0, 0x3 b @08153DB6 .align 2, 0 .pool @08153D4C: ldr r7, =0x020246e0 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 SpeciesToNationalPokedexNum adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r4, 0 movs r1, 0x2 bl pokedex_flag_operation adds r0, r4, 0 movs r1, 0x3 bl pokedex_flag_operation @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, =0x02021fc4 ldr r1, =gUnknown_08674BF0 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000bec adds r0, r2 movs r2, 0xBC bl memcpy bl sub_81652B4 ldr r0, =0x02021fc4 ldr r1, =gUnknown_08674C31 bl ExpandTextCodes movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02021fc4 ldr r1, =gUnknown_085ECAD8 bl ExpandTextCodes movs r0, 0x2 str r0, [r4, 0x6C] movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02020630 adds r7, r1, r0 ldr r0, =objc_80DAF50 str r0, [r7, 0x1C] ldrb r1, [r7, 0x5] movs r0, 0xC orrs r1, r0 strb r1, [r7, 0x5] ldr r2, =gUnknown_084975C4 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, =gUnknown_082EC69C str r0, [r7, 0x8] adds r0, r7, 0 movs r1, 0 bl obj_anim_image_start ldr r0, =gUnknown_082EC6A8 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 .pool 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, =gUnknown_085CDC38 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 .pool @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, =0x000011ff 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 .pool @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, =0x000011ff 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 .pool 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, =0x02037350 adds r7, r0, r1 ldrb r1, [r7, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r5, r0, r1 ldr r0, [r7] ldr r1, =0x00020001 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 .pool @081540FC: ldr r1, =gUnknown_084975C4 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, =0xfffffc00 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 .pool thumb_func_end objc_80DAF50 thumb_func_start sub_8154228 sub_8154228: ; 8154228 push {r4,lr} ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_8154228 thumb_func_start objid_set_invisible objid_set_invisible: ; 8154278 lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 adds r1, 0x3E ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x02020630 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, =0x02020630 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 .pool thumb_func_end sub_8154298 thumb_func_start oei_shadow oei_shadow: ; 8154340 push {r4,r5,lr} ldr r5, =0x02038c08 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, =0x02037350 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, =gUnknown_085059F8 ldr r1, =gUnknown_085CDC3E 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, =0x02020630 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, =gUnknown_085CDC42 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 .pool 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, =0x02037350 adds r4, r0, r1 ldrb r0, [r4, 0x4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 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, =0x00400001 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 .pool thumb_func_end oamc_shadow thumb_func_start oei_grass_normal oei_grass_normal: ; 81544AC push {r4,r5,lr} sub sp, 0x4 ldr r5, =0x02038c08 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, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x02037334 ldrb r1, [r3] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0815459C ldr r0, =0x03005d8c 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 .pool @08154604: mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool thumb_func_end unc_grass_normal thumb_func_start sub_8154658 sub_8154658: ; 8154658 push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0xC bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x02020630 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, =unc_grass_normal 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 .pool @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, =0x02038c08 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, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x02037334 ldrb r1, [r3] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0815484C ldr r0, =0x03005d8c 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 .pool @081548B4: mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 ldr r1, =0x02037350 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 .pool thumb_func_end unc_grass_tall thumb_func_start sub_81548FC sub_81548FC: ; 81548FC push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_81548FC thumb_func_start sub_815496C sub_815496C: ; 815496C push {r4-r6,lr} ldr r6, =0x02038c08 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, =0x02037350 adds r5, r1, r0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x02037350 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 .pool @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, =0x02020630 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 .pool thumb_func_end sub_8154A10 thumb_func_start sub_8154B04 sub_8154B04: ; 8154B04 push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_8154B04 thumb_func_start sub_8154B78 sub_8154B78: ; 8154B78 push {r4,r5,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_8154B78 thumb_func_start sub_8154BEC sub_8154BEC: ; 8154BEC push {r4,r5,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_8154BEC thumb_func_start sub_8154C60 sub_8154C60: ; 8154C60 push {lr} ldr r2, =gUnknown_085CDC4C 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 .pool 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, =0x02038c08 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, =0x02037350 adds r5, r1, r0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x02020630 ldr r2, =0x02037350 mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh 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 .pool thumb_func_end sub_8154D90 thumb_func_start sub_8154E1C sub_8154E1C: ; 8154E1C push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0xC bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_8154E1C thumb_func_start oei_water_drop_tall oei_water_drop_tall: ; 8154E8C push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end oei_water_drop_tall thumb_func_start sub_8154EFC sub_8154EFC: ; 8154EFC push {r4-r7,lr} ldr r7, =0x02038c08 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, =0x02037350 adds r6, r1, r0 ldr r0, =gUnknown_085059F8 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, =0x02020630 adds r0, r3 ldr r1, =sub_8154FB4 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, =0x0000ffff 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 .pool 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, =0x02037350 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 .pool @08154FFC: ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool thumb_func_end sub_8154FB4 thumb_func_start oei_ripples oei_ripples: ; 8155054 push {r4,lr} ldr r0, =gUnknown_085059F8 ldr r0, [r0, 0x14] ldr r4, =0x02038c08 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, =0x02020630 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 .pool thumb_func_end oei_ripples thumb_func_start sub_81550B4 sub_81550B4: ; 81550B4 push {r4-r6,lr} ldr r6, =0x02038c08 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, =0x02037350 adds r5, r1, r0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x02037350 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 .pool @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, =0x02020630 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 .pool thumb_func_end sub_8155158 thumb_func_start sub_81551F0 sub_81551F0: ; 81551F0 push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_81551F0 thumb_func_start sub_815525C sub_815525C: ; 815525C push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_815525C thumb_func_start sub_81552C8 sub_81552C8: ; 81552C8 push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_81552C8 thumb_func_start sub_8155334 sub_8155334: ; 8155334 push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_8155334 thumb_func_start ash ash: ; 81553A0 push {r4,lr} lsls r2, 16 lsrs r2, 16 ldr r4, =0x02038c08 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 .pool thumb_func_end ash thumb_func_start oei_ash oei_ash: ; 81553D4 push {r4,r5,lr} sub sp, 0x4 ldr r5, =0x02038c08 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, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end oei_ash thumb_func_start sub_8155460 sub_8155460: ; 8155460 push {lr} ldr r2, =gUnknown_085CDC54 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 .pool 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, =0x02037350 ldr r0, =0x02037590 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 .pool 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, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x8 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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, =0x0000ffff 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 .pool thumb_func_end sub_8155534 thumb_func_start sub_81555AC sub_81555AC: ; 81555AC lsls r0, 24 lsrs r0, 24 lsls r1, 24 ldr r3, =0x02020630 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 .pool thumb_func_end sub_81555AC thumb_func_start sub_81555D8 sub_81555D8: ; 81555D8 lsls r0, 24 lsrs r0, 24 lsls r1, 24 ldr r3, =0x02020630 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 .pool 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, =0x02020630 lsls r3, r0, 4 adds r3, r0 lsls r3, 2 adds r3, r4 ldrh r0, [r3, 0x2E] ldr r4, =0xfffff0ff 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 .pool 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, =0x02037350 adds r4, r0 ldrb r0, [r4, 0x4] lsls r5, r0, 4 adds r5, r0 lsls r5, 2 ldr r0, =0x02020630 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 .pool 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, =gUnknown_085CDC60 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 .pool 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, =gUnknown_085CDC6A 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 .pool @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, =gUnknown_082EC6AC 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, =0x02020630 adds r2, r1 ldr r1, =sub_8155850 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 .pool 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, =0x02020630 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 .pool thumb_func_end sub_8155850 thumb_func_start sub_8155890 sub_8155890: ; 8155890 push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0xC bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool thumb_func_end sub_8155890 thumb_func_start sub_8155900 sub_8155900: ; 8155900 push {r4-r7,lr} ldr r7, =0x02038c08 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, =0x02037350 adds r6, r1, r0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x02037350 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 .pool @08155A04: ldr r2, =0x02020630 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, =0x02020630 ldr r2, =0x02037350 mov r0, sp ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 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 .pool thumb_func_end sub_81559BC thumb_func_start sub_8155A88 sub_8155A88: ; 8155A88 push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x00001004 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 .pool thumb_func_end sub_8155AEC thumb_func_start sub_8155B2C sub_8155B2C: ; 8155B2C push {r4,lr} ldr r4, =0x02038c08 adds r1, r4, 0x4 adds r0, r4, 0 movs r2, 0x8 movs r3, 0x4 bl sub_80930E0 ldr r0, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x02038c08 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 .pool @08155C08: ldr r1, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =0x02037350 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, =0x02020630 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 .pool 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, =0x02020630 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 .pool 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, =0x02020630 adds r1, r0, r1 movs r3, 0x3C ldrsh r0, [r1, r3] cmp r0, 0 bne @08155DCC movs r0, 0 b @08155DD8 .align 2, 0 .pool @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, =0x02038c08 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, =gUnknown_085059F8 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, =0x02020630 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 .pool 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, =@08155F9C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0600f800 mov r12, r4 ldr r0, =0x0000bff4 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, =0x00000137 cmp r1, r0 bgt @08156022 b @08156156 @08156022: movs r1, 0 movs r0, 0x1 b @0815611A .align 2, 0 .pool @08156034: ldr r4, =gUnknown_08329F40 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 .pool @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, =0x0600f800 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 .pool 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, =0x02037350 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, =0x02020630 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 .pool @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, =0x02039f34 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, =0x02039e00 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 .pool thumb_func_end sub_81562C4 thumb_func_start sub_8156324 sub_8156324: ; 8156324 push {r4-r6,lr} ldr r1, =0x02039f34 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, =0x02039f34 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 .pool thumb_func_end sub_8156324 thumb_func_start sub_81563B0 sub_81563B0: ; 81563B0 push {r4-r7,lr} mov r7, r8 push {r7} ldr r5, =0x02039f34 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, =0x0203ab38 ldr r0, =0x02039e1e 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, =gUnknown_082DE350 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 .pool @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, =gUnknown_085CDD00 ldr r0, [r6] ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 b @08156458 .align 2, 0 .pool @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, =0x02039f34 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 .pool @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, =0x02039f34 ldr r0, [r3] ldr r0, [r0, 0x8] b @081564CC .align 2, 0 .pool @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, =0x02039f34 ldr r0, [r3] ldr r0, [r0, 0xC] adds r1, r0, 0x5 ldrb r0, [r0, 0x4] adds r1, r0 ldr r2, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] ldr r0, [r0] ldrb r0, [r0, 0x1] strh r0, [r1, 0x18] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8156530 thumb_func_start sub_8156550 sub_8156550: ; 8156550 push {lr} bl sub_8156530 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8156660 thumb_func_start sub_8156684 sub_8156684: ; 8156684 push {lr} bl sub_8156660 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8156794 thumb_func_start sub_81567BC sub_81567BC: ; 81567BC push {lr} bl sub_8156794 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81568CC thumb_func_start sub_815690C sub_815690C: ; 815690C push {lr} bl sub_81568CC ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8156A1C thumb_func_start sub_8156A48 sub_8156A48: ; 8156A48 push {r4,r5,lr} bl sub_8156A1C ldr r0, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r1, =0x02039f00 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8156B88 thumb_func_start sub_8156BB4 sub_8156BB4: ; 8156BB4 push {r4,r5,lr} bl sub_8156B88 ldr r0, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] ldr r0, =0x02039f2c ldrh r0, [r0] strh r0, [r1, 0x18] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8156CF4 thumb_func_start sub_8156D18 sub_8156D18: ; 8156D18 push {lr} bl sub_8156CF4 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039e00 ldr r4, =0x02039f34 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8156DA0 thumb_func_start sub_8156DE4 sub_8156DE4: ; 8156DE4 push {r4,lr} bl sub_8156DA0 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] ldr r3, =0x0203ab38 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 .pool @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, =0x02039e00 ldr r0, =0x02039f34 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, =gContestMoves lsls r0, 3 adds r0, r1 ldrb r0, [r0] strh r0, [r3, 0x18] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8156F04 thumb_func_start sub_8156F44 sub_8156F44: ; 8156F44 push {lr} bl sub_8156F04 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039e00 ldr r0, =0x02039f34 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, =gContestEffects ldr r1, =gContestMoves lsls r0, 3 adds r0, r1 ldrb r0, [r0] lsls r0, 2 adds r0, r2 ldrb r0, [r0] strh r0, [r3, 0x18] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8156FCC thumb_func_start sub_8157018 sub_8157018: ; 8157018 push {lr} bl sub_8156FCC ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039e00 ldr r5, =0x02039f34 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, =gContestEffects ldr r4, =gContestMoves lsls r0, 3 adds r0, r4 ldrb r0, [r0] lsls r0, 2 adds r0, r3 ldrb r7, [r0, 0x1] movs r6, 0 ldr r0, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @08157164 ldr r3, =0x0203ab38 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 .pool @08157164: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @0815716C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_815712C thumb_func_start sub_8157174 sub_8157174: ; 8157174 push {r4-r7,lr} ldr r2, =0x02039e00 ldr r5, =0x02039f34 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, =gContestEffects ldr r4, =gContestMoves lsls r0, 3 adds r0, r4 ldrb r0, [r0] lsls r0, 2 adds r0, r3 ldrb r7, [r0, 0x2] movs r6, 0 ldr r0, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @08157238 ldr r3, =0x0203ab38 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 .pool @08157238: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x5 str r0, [r1] @08157240: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157200 thumb_func_start sub_8157248 sub_8157248: ; 8157248 push {r4,lr} ldr r2, =0x02039e00 ldr r0, =0x02039f34 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, =gContestEffects ldr r1, =gContestMoves 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157248 thumb_func_start sub_81572A4 sub_81572A4: ; 81572A4 push {lr} bl sub_8157248 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039e00 ldr r0, =0x02039f34 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, =gContestEffects ldr r1, =gContestMoves 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81573B4 thumb_func_start sub_8157410 sub_8157410: ; 8157410 push {lr} bl sub_81573B4 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039e00 ldr r5, =0x02039f34 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 .pool @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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157520 thumb_func_start sub_8157578 sub_8157578: ; 8157578 push {lr} bl sub_8157520 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039e00 ldr r0, =0x02039f34 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, =0x02039f34 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 AreMovesContestCombo 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] strh r3, [r0, 0x18] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157688 thumb_func_start sub_8157700 sub_8157700: ; 8157700 push {lr} bl sub_8157688 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @08157738 ldr r3, =0x0203ab38 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 .pool @08157738: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157740: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157700 thumb_func_start sub_8157748 sub_8157748: ; 8157748 push {lr} bl sub_8157688 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bne @08157780 ldr r3, =0x0203ab38 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 .pool @08157780: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157788: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157748 thumb_func_start sub_8157790 sub_8157790: ; 8157790 push {r4-r6,lr} movs r3, 0 ldr r2, =0x02039e00 ldr r0, =0x02039f34 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, =0x02039f34 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 AreMovesContestCombo 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] strh r3, [r0, 0x18] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157790 thumb_func_start sub_8157808 sub_8157808: ; 8157808 push {lr} bl sub_8157790 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @08157840 ldr r3, =0x0203ab38 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 .pool @08157840: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157848: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157808 thumb_func_start sub_8157850 sub_8157850: ; 8157850 push {lr} bl sub_8157790 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bne @08157888 ldr r3, =0x0203ab38 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 .pool @08157888: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157890: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157850 thumb_func_start sub_8157898 sub_8157898: ; 8157898 push {r4-r6,lr} movs r5, 0 ldr r3, =0x02039e00 ldr r6, =0x02039f34 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 AreMovesContestCombo 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, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157898 thumb_func_start sub_81578F8 sub_81578F8: ; 81578F8 push {lr} bl sub_8157898 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @08157930 ldr r3, =0x0203ab38 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 .pool @08157930: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157938: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81578F8 thumb_func_start sub_8157940 sub_8157940: ; 8157940 push {lr} bl sub_8157898 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bne @08157978 ldr r3, =0x0203ab38 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 .pool @08157978: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157980: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157940 thumb_func_start sub_8157988 sub_8157988: ; 8157988 push {r4,r5,lr} ldr r4, =0x0203ab38 ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039f34 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 .pool thumb_func_end sub_8157988 thumb_func_start sub_81579CC sub_81579CC: ; 81579CC push {lr} bl sub_8157988 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x0203ab38 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, =gContestMoves ldr r0, =0x02039f34 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, =0x02039f34 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 .pool thumb_func_end sub_8157ADC thumb_func_start sub_8157B38 sub_8157B38: ; 8157B38 push {lr} bl sub_8157ADC ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x0203ab38 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, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] movs r0, 0 b @08157C7C .align 2, 0 .pool @08157C74: ldr r0, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] movs r0, 0x1 @08157C7C: strh r0, [r1, 0x18] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x2 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157C48 thumb_func_start sub_8157C94 sub_8157C94: ; 8157C94 push {lr} bl sub_8157C48 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @08157CCC ldr r3, =0x0203ab38 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 .pool @08157CCC: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157CD4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157C94 thumb_func_start sub_8157CDC sub_8157CDC: ; 8157CDC push {lr} bl sub_8157C48 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bne @08157D14 ldr r3, =0x0203ab38 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 .pool @08157D14: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157D1C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157CDC thumb_func_start sub_8157D24 sub_8157D24: ; 8157D24 push {r4,lr} ldr r4, =0x0203ab38 ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039f34 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 .pool thumb_func_end sub_8157D24 thumb_func_start sub_8157D60 sub_8157D60: ; 8157D60 push {lr} bl sub_8157D24 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @08157D98 ldr r3, =0x0203ab38 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 .pool @08157D98: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157DA0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157D60 thumb_func_start sub_8157DA8 sub_8157DA8: ; 8157DA8 push {lr} bl sub_8157D24 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bne @08157DE0 ldr r3, =0x0203ab38 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 .pool @08157DE0: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157DE8: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157DA8 thumb_func_start sub_8157DF0 sub_8157DF0: ; 8157DF0 push {r4,r5,lr} ldr r4, =0x0203ab38 ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC lsls r0, 24 lsrs r0, 24 ldr r1, =0x02039f34 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 .pool thumb_func_end sub_8157DF0 thumb_func_start sub_8157E3C sub_8157E3C: ; 8157E3C push {lr} bl sub_8157DF0 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bge @08157E74 ldr r3, =0x0203ab38 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 .pool @08157E74: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157E7C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157E3C thumb_func_start sub_8157E84 sub_8157E84: ; 8157E84 push {lr} bl sub_8157DF0 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 ble @08157EBC ldr r3, =0x0203ab38 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 .pool @08157EBC: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157EC4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157E84 thumb_func_start sub_8157ECC sub_8157ECC: ; 8157ECC push {lr} bl sub_8157DF0 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bne @08157F04 ldr r3, =0x0203ab38 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 .pool @08157F04: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157F0C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157ECC thumb_func_start sub_8157F14 sub_8157F14: ; 8157F14 push {lr} bl sub_8157DF0 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @08157F4C ldr r3, =0x0203ab38 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 .pool @08157F4C: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157F54: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157F14 thumb_func_start sub_8157F5C sub_8157F5C: ; 8157F5C push {r4,lr} ldr r4, =0x0203ab38 ldr r0, [r4] ldrb r0, [r0, 0x1] bl sub_81564AC lsls r0, 24 ldr r1, =0x02039f34 ldr r1, [r1] ldr r3, [r1, 0xC] ldr r2, =0x02039f00 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 .pool thumb_func_end sub_8157F5C thumb_func_start sub_8157FA0 sub_8157FA0: ; 8157FA0 push {lr} bl sub_8157F5C ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bge @08157FD8 ldr r3, =0x0203ab38 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 .pool @08157FD8: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08157FE0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157FA0 thumb_func_start sub_8157FE8 sub_8157FE8: ; 8157FE8 push {lr} bl sub_8157F5C ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 ble @08158020 ldr r3, =0x0203ab38 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 .pool @08158020: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08158028: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8157FE8 thumb_func_start sub_8158030 sub_8158030: ; 8158030 push {lr} bl sub_8157F5C ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bne @08158068 ldr r3, =0x0203ab38 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 .pool @08158068: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08158070: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8158030 thumb_func_start sub_8158078 sub_8158078: ; 8158078 push {lr} bl sub_8157F5C ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @081580B0 ldr r3, =0x0203ab38 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 .pool @081580B0: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @081580B8: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8158078 thumb_func_start sub_81580C0 sub_81580C0: ; 81580C0 push {r4,r5,lr} ldr r5, =0x0203ab38 ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC lsls r0, 24 ldr r3, [r5] ldrb r2, [r3, 0x2] ldr r1, =0x02039f34 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, =gContestMoves 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 .pool thumb_func_end sub_81580C0 thumb_func_start sub_8158108 sub_8158108: ; 8158108 push {lr} bl sub_81580C0 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x0203ab38 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, =0x02039f34 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 .pool thumb_func_end sub_8158218 thumb_func_start sub_8158254 sub_8158254: ; 8158254 push {lr} bl sub_8158218 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x0203ab38 ldr r0, [r5] ldrb r0, [r0, 0x1] bl sub_81564AC lsls r0, 24 ldr r3, [r5] ldrb r2, [r3, 0x2] ldr r1, =0x02039f34 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, =gContestEffects ldr r1, =gContestMoves 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 .pool thumb_func_end sub_8158364 thumb_func_start sub_81583B8 sub_81583B8: ; 81583B8 push {lr} bl sub_8158364 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] ldr r3, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r3, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool thumb_func_end sub_8158440 thumb_func_start sub_815846C sub_815846C: ; 815846C push {r4,lr} ldr r0, =0x02039f34 ldr r0, [r0] ldr r3, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool thumb_func_end sub_815846C thumb_func_start sub_815849C sub_815849C: ; 815849C push {r4,lr} ldr r0, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool thumb_func_end sub_815849C thumb_func_start sub_81584D4 sub_81584D4: ; 81584D4 push {r4,lr} ldr r0, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool thumb_func_end sub_81584D4 thumb_func_start sub_8158508 sub_8158508: ; 8158508 push {r4,lr} ldr r0, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool thumb_func_end sub_8158508 thumb_func_start sub_815853C sub_815853C: ; 815853C push {r4,lr} ldr r0, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r1, [r0, 0xC] ldr r4, =0x0203ab38 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 .pool @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, =0x0203ab38 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 .pool thumb_func_end sub_815886C thumb_func_start dp15_call dp15_call: ; 815888C push {r4,lr} ldr r4, =0x0203ab38 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 .pool 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, =0x02039f34 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 .pool thumb_func_end sub_81588BC thumb_func_start sub_81588E0 sub_81588E0: ; 81588E0 push {r4,lr} ldr r1, =0x02039f34 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 .pool thumb_func_end sub_81588E0 thumb_func_start sub_8158908 sub_8158908: ; 8158908 push {lr} ldr r3, =0x02039f34 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 .pool @08158924: subs r0, 0x1 strb r0, [r1] ldr r2, =0x0203ab38 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 .pool 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, =0x02039e1e @08158950: lsls r1, r4, 1 ldr r0, =0x02039f34 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 .pool @08158980: adds r4, 0x1 cmp r4, 0x3 ble @08158950 @08158986: ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] strh r5, [r0, 0x18] ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x1 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8158948 thumb_func_start sub_81589A4 sub_81589A4: ; 81589A4 push {lr} bl sub_8158948 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @081589DC ldr r3, =0x0203ab38 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 .pool @081589DC: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @081589E4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81589A4 thumb_func_start sub_81589EC sub_81589EC: ; 81589EC push {lr} bl sub_8158948 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bne @08158A24 ldr r3, =0x0203ab38 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 .pool @08158A24: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08158A2C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81589EC thumb_func_start sub_8158A34 sub_8158A34: ; 8158A34 push {r4-r6,lr} movs r6, 0 ldr r3, =0x0203ab38 ldr r0, [r3] ldrb r5, [r0, 0x1] ldrb r0, [r0, 0x2] lsls r0, 8 orrs r5, r0 movs r4, 0 ldr r0, =0x02039e00 mov r12, r0 ldr r2, =0x02039f34 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 .pool @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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 beq @08158AD8 ldr r3, =0x0203ab38 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 .pool @08158AD8: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08158AE0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8158AA0 thumb_func_start sub_8158AE8 sub_8158AE8: ; 8158AE8 push {lr} bl sub_8158A34 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0xC] movs r1, 0x18 ldrsh r0, [r0, r1] cmp r0, 0 bne @08158B20 ldr r3, =0x0203ab38 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 .pool @08158B20: ldr r1, =0x0203ab38 ldr r0, [r1] adds r0, 0x4 str r0, [r1] @08158B28: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r6, r0, 2 adds r6, r0 lsls r6, 3 adds r6, r1 ldr r1, =0x0203841e 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, =sub_8158B98 str r0, [r6] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =sub_8158C04 str r0, [r4] b @08158BFE .align 2, 0 .pool @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, =0x03005e00 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 .pool 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, =0x0203841e 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, =0x03005e00 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, =sub_8158D08 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 .pool 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, =0x03005e00 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 .pool @08158D50: ldr r1, =0x03005e00 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 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @08158DC8 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r4, [r0] b @08158E76 .align 2, 0 .pool @08158DC8: adds r0, r5, 0 bl move_anim_task_del b @08158E76 @08158DD0: ldr r0, =0x0203841e movs r2, 0 ldrsh r1, [r0, r2] adds r2, r0, 0 cmp r1, 0 bne @08158DEC ldr r0, =0x02038436 ldrb r4, [r0] b @08158E12 .align 2, 0 .pool @08158DEC: cmp r1, 0x1 bne @08158DFC ldr r0, =0x02038437 ldrb r4, [r0] b @08158E12 .align 2, 0 .pool @08158DFC: cmp r1, 0x2 bne @08158E08 ldr r0, =0x02038436 b @08158E0A .align 2, 0 .pool @08158E08: ldr r0, =0x02038437 @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 .pool @08158E38: adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08158E5C ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @08158E6A .align 2, 0 .pool @08158E5C: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @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 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @08158ED8 ldr r0, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r4, [r0] b @08158F86 .align 2, 0 .pool @08158ED8: adds r0, r6, 0 bl move_anim_task_del b @08158F86 @08158EE0: ldr r0, =0x0203841e movs r2, 0 ldrsh r1, [r0, r2] adds r2, r0, 0 cmp r1, 0 bne @08158EFC ldr r0, =0x02038436 ldrb r4, [r0] b @08158F22 .align 2, 0 .pool @08158EFC: cmp r1, 0x1 bne @08158F0C ldr r0, =0x02038437 ldrb r4, [r0] b @08158F22 .align 2, 0 .pool @08158F0C: cmp r1, 0x2 bne @08158F18 ldr r0, =0x02038436 b @08158F1A .align 2, 0 .pool @08158F18: ldr r0, =0x02038437 @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 .pool @08158F48: adds r0, r4, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @08158F6C ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 b @08158F7A .align 2, 0 .pool @08158F6C: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec @08158F7A: adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 @08158F86: ldr r1, =0x03005e00 lsls r2, r6, 2 adds r0, r2, r6 lsls r0, 3 adds r0, r1 ldr r3, =0x0203841e 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 .pool @08158FC8: adds r0, r4, 0 movs r2, 0x7 bl sub_80A32E4 @08158FD0: ldr r0, =0x03005e00 adds r1, r5, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_8158FF4 str r0, [r1] b @08158FEE .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =0x0203841e 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] b @08159102 .align 2, 0 .pool @081590F8: ldr r1, =0x02038438 ldr r0, =0x02038436 ldrb r0, [r0] lsls r0, 1 adds r0, r1 @08159102: ldrh r2, [r0] ldr r0, =0x03005e00 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, =sub_815913C str r0, [r1] b @08159136 .align 2, 0 .pool @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, =0x03005e00 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, =@08159174 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 b @081591B0 .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =0x0203841e 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 .pool 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, =0x0203841e 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 .pool 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, =0x0203841e 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, =0x03005e00 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, =sub_8159308 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 .pool 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, =0x03005e00 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, =0x02038440 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 .pool 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, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl6 str r1, [r0] bx lr .align 2, 0 .pool 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, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @081593D4 ldr r0, =0x02023064 lsls r1, r3, 9 adds r1, r0 ldrb r0, [r1] cmp r0, 0x38 bhi @081593D0 ldr r0, =gUnknown_085CDF20 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 b @081593D4 .align 2, 0 .pool @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, =0x030022c0 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, =0x020244ac ldr r0, =0x02024064 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 .pool @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, =0x020244ac ldr r4, =0x02024064 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 .pool @08159484: movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @081594C0 ldr r5, =0x020244ac ldr r4, =0x02024064 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 .pool @081594C0: movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @0815950C ldr r5, =0x020244ac ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @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 .pool @0815950C: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0815954E ldr r5, =0x020244ac ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @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 .pool thumb_func_end bx_battle_menu_t6_2 thumb_func_start sub_815955C sub_815955C: ; 815955C push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08159580 bl dp01_tbl6_exec_completed @08159580: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r1, =0x03005d70 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @081595D0 bl dp01_tbl6_exec_completed @081595D0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81595AC thumb_func_start sub_81595E4 sub_81595E4: ; 81595E4 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0815960E ldr r2, =0x030022c0 ldr r0, =0x00000439 adds r3, r2, r0 ldrb r1, [r3] movs r0, 0x3 negs r0, r0 ands r0, r1 strb r0, [r3] ldr r0, =0x03005d00 ldr r0, [r0] str r0, [r2] ldr r0, [r2, 0x8] bl set_callback2 @0815960E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81595E4 thumb_func_start bx_wait_t6 bx_wait_t6: ; 8159624 push {lr} ldr r0, =0x020244b9 ldrb r0, [r0] cmp r0, 0 beq @0815964A ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0815964E @0815964A: bl dp01_tbl6_exec_completed @0815964E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_wait_t6 thumb_func_start sub_8159660 sub_8159660: ; 8159660 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08159684 ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8159698 str r1, [r0] bl Window_FreeMemory bl sub_81358F4 @08159684: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8159660 thumb_func_start sub_8159698 sub_8159698: ; 8159698 push {lr} ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 bne @081596BE ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081596BE ldr r0, =0x0203ce7c 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 .pool thumb_func_end sub_8159698 thumb_func_start sub_81596D4 sub_81596D4: ; 81596D4 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @081596F6 bl dp01_tbl6_exec_completed @081596F6: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl6 str r1, [r0] ldr r0, =0x02022fec 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, =0x02023064 ldrb r0, [r4] lsls r0, 9 adds r0, r1 movs r1, 0x38 strb r1, [r0] b @0815976A .align 2, 0 .pool @08159758: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] @0815976A: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_tbl6_exec_completed thumb_func_start bx_80364D0 bx_80364D0: ; 815977C push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @0815979E bl dp01_tbl6_exec_completed @0815979E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r4] ldrb r0, [r0, 0x8] ldr r5, =0x02024064 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, =0x0202499c ldr r2, =gUnknown_08305D2C 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, =0x020241e4 ldrb r1, [r5] adds r1, r6 strb r0, [r1] ldr r4, =0x02020630 ldrb r3, [r5] adds r0, r3, r6 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0xF0 strh r1, [r0, 0x24] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, 0x1C adds r0, r4 ldr r1, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_815955C str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x8] movs r0, 0x4 strb r0, [r1, 0x8] ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldr r5, =0x02024064 ldrb r4, [r5] movs r0, 0x1 bl battle_get_side_with_given_state adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r4, 0 movs r3, 0x4 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_wait_t6 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8159910 thumb_func_start sub_8159964 sub_8159964: ; 8159964 push {r4,r5,lr} ldr r1, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r1, [r0] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] strb r1, [r0, 0x8] ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r4, [r5] movs r0, 0x1 bl battle_get_side_with_given_state adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r4, 0 movs r3, 0x4 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_wait_t6 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 ldr r1, =0x02023066 adds r0, r1 ldrh r0, [r0] bl battle_pick_message ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_t6_button_a str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 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 .pool @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, =0x02022e14 strh r1, [r0] ldr r1, =0x02022e16 movs r0, 0xA0 strh r0, [r1] ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_battle_menu_t6_2 str r1, [r0] @08159A7A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8159A54 thumb_func_start sub_8159A94 sub_8159A94: ; 8159A94 push {r4,lr} ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8159A54 str r1, [r0] ldr r0, =gUnknown_085CCA54 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, =0x020244ac ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] movs r1, 0 bl sub_8059CB4 ldr r0, =gUnknown_085CCA04 bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0x1 bl battle_show_message_maybe pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_8159660 str r1, [r0] ldr r1, =0x020244b8 ldrb r0, [r2] strb r0, [r1] add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d70 ldr r1, =0x02024064 ldrb r1, [r1] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0xB bl healthbar_draw_field_maybe bl dp01_tbl6_exec_completed pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 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, =0x02023064 ldrb r1, [r4] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 lsls r1, r3, 24 asrs r1, 24 bl audio_play_and_stuff bl dp01_tbl6_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r3, r0, 9 adds r0, r4, 0x3 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @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 .pool @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, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 movs r1, 0x19 bl cry_related bl dp01_tbl6_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8159D20 thumb_func_start dp01t_2E_6_battle_intro dp01t_2E_6_battle_intro: ; 8159D5C push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] bl battle_intro_launch ldr r2, =0x020243fc ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] bl dp01_tbl6_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_2E_6_battle_intro thumb_func_start sub_8159D90 sub_8159D90: ; 8159D90 push {r4,r5,lr} ldr r5, =0x03005d70 ldr r4, =0x02024064 ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 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, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_81595AC str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r6, =0x02024064 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 .pool @08159E5C: ldr r0, =0x03005d60 ldrb r1, [r6] lsls r1, 2 adds r1, r0 ldr r0, =sub_81596D4 str r0, [r1] @08159E68: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202433a ldr r1, =0x02023064 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] strb r0, [r2] movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 bl sub_80A2390 bl dp01_tbl6_exec_completed ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x6 ands r0, r1 cmp r0, 0x2 bne @08159ECC ldr r0, =0x03005d60 ldrb r1, [r4] lsls r1, 2 adds r1, r0 ldr r0, =sub_81595E4 str r0, [r1] @08159ECC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =hm2_sweet_scent str r0, [r1] movs r0, 0x1 bx lr .align 2, 0 .pool 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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_8159F5C lsrs r0, r2, 16 strh r0, [r1, 0x18] strh r2, [r1, 0x1A] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02037714 ldr r1, =0x02037fe8 movs r4, 0x80 lsls r4, 1 adds r0, r5, 0 adds r2, r4, 0 bl CpuFastSet ldr r0, =0x02037b14 adds r1, r5, 0 adds r2, r4, 0 bl CpuFastSet bl sub_808BCDC ldr r2, =0x02020630 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, =sub_8159FEC movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0x8] movs r0, 0x33 bl oe_active_list_remove add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e00 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 .pool @0815A044: ldr r0, =sub_815A090 str r0, [r4] bl sub_808BCDC ldr r2, =0x02020630 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 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0815A0BE ldr r0, =0x02037fe8 ldr r1, =0x02037714 movs r2, 0x80 lsls r2, 1 bl CpuFastSet bl sub_80AC3E4 ldr r0, =gUnknown_08290CAE bl script_env_1_execute_new_script adds r0, r4, 0 bl remove_task @0815A0BE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_815A090 thumb_func_start sub_815A0D4 sub_815A0D4: ; 815A0D4 push {lr} adds r2, r0, 0 ldr r1, =0x0203841e 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 .pool @0815A0FC: ldrh r0, [r1, 0x4] negs r0, r0 @0815A100: strh r0, [r2, 0x2E] ldrh r0, [r1, 0x8] strh r0, [r2, 0x30] ldr r0, =sub_815A114 str r0, [r2, 0x1C] pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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 .pool 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, =sub_80A64B0 str r0, [r4, 0x1C] movs r0, 0x7 strh r0, [r4, 0x30] ldr r1, =sub_815A1F4 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 .pool 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, =sub_815A234 str r0, [r4, 0x1C] @0815A228: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038437 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, =0x0203841e ldrh r0, [r0, 0x4] strh r0, [r5, 0x2E] strh r7, [r5, 0x32] strh r6, [r5, 0x36] ldr r0, =sub_80A6EEC str r0, [r5, 0x1C] ldr r1, =move_anim_8072740 adds r0, r5, 0 bl oamt_set_x3A_32 add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_815A31C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_815A3AC str r0, [r4, 0x1C] @0815A3A0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_815A3F0 str r0, [r3, 0x1C] @0815A3E8: pop {r0} bx r0 .align 2, 0 .pool 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, =@0815A40C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0000ffff strh r0, [r4, 0x24] movs r0, 0 b @0815A44E .align 2, 0 .pool @0815A440: movs r0, 0 strh r0, [r4, 0x24] movs r0, 0x1 b @0815A44E @0815A448: movs r0, 0 strh r0, [r4, 0x24] ldr r0, =0x0000ffff @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, =sub_815A49C str r0, [r4, 0x1C] @0815A48C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_815A52C str r0, [r1] ldr r1, =0x020383fe ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005e00 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, =0x02037b14 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, =0x0203841e ldrh r1, [r0, 0xE] ldr r0, =0x0000ffff 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 .pool thumb_func_end sub_815A52C thumb_func_start c3_80DE6F0 c3_80DE6F0: ; 815A5C8 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_815A5F0 str r0, [r1] ldr r1, =0x020383fe ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005e00 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, =0x02037b14 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, =0x02037714 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, =0x03005e00 adds r0, r2 strh r1, [r0, 0x12] @0815A692: ldr r0, =0x0203841e ldrh r1, [r0, 0xE] ldr r0, =0x0000ffff 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 .pool 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, =0x02038437 ldrb r0, [r0] mov r5, sp adds r5, 0x2 movs r1, 0 mov r2, sp adds r3, r5, 0 bl sub_80A8924 ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0815A6F8 ldr r1, =0x0203841e ldrh r0, [r1, 0x4] negs r0, r0 strh r0, [r1, 0x4] @0815A6F8: ldr r1, =0x0203841e 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, =0x0000ffce strh r0, [r4, 0x38] adds r0, r4, 0 bl sub_80A68D4 ldr r0, =sub_815A73C str r0, [r4, 0x1C] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80A64B0 str r0, [r4, 0x1C] ldr r1, =sub_815A76C adds r0, r4, 0 bl oamt_set_x3A_32 @0815A75E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =sub_80A67D8 str r0, [r4, 0x1C] ldr r1, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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, =0x02038436 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 .pool @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, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0815A8EC ldr r1, =0x0203841e movs r0, 0 b @0815A8F0 .align 2, 0 .pool @0815A8EC: ldr r1, =0x0203841e 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 .pool thumb_func_end sub_815A8C8 thumb_func_start sub_815A904 sub_815A904: ; 815A904 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02038404 ldr r0, [r0] cmp r0, 0 ble @0815A920 ldr r1, =0x0203841e movs r0, 0 b @0815A924 .align 2, 0 .pool @0815A920: ldr r1, =0x0203841e movs r0, 0x1 @0815A924: strh r0, [r1, 0xE] adds r0, r2, 0 bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_815A904 thumb_func_start sub_815A934 sub_815A934: ; 815A934 push {r4,r5,lr} adds r5, r0, 0 ldr r1, =0x00001f3f movs r0, 0x4A bl lcd_io_set movs r1, 0x80 lsls r1, 8 movs r0, 0 bl lcd_io_set_bits ldr r0, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r4, =0x02022e26 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, =sub_815A9A0 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =@0815A9BC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_815AA6C str r0, [r4, 0x1C] @0815AA60: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_815A9A0 thumb_func_start sub_815AA6C sub_815AA6C: ; 815AA6C push {r4,lr} adds r4, r0, 0 ldr r1, =0x00003f3f 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 .pool thumb_func_end sub_815AA6C thumb_func_start sub_815AAA4 sub_815AAA4: ; 815AAA4 push {r4-r6,lr} adds r5, r0, 0 ldr r6, =0x0203841e movs r1, 0x6 ldrsh r0, [r6, r1] cmp r0, 0 bne @0815AAD0 ldr r4, =0x02038436 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, =0x000003ff adds r0, r4, 0 ands r1, r0 ldr r0, =0xfffffc00 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, =0x0000fff4 strh r0, [r5, 0x24] movs r0, 0x2 b @0815AB32 .align 2, 0 .pool @0815AB2C: movs r0, 0xC strh r0, [r5, 0x24] ldr r0, =0x0000fffe @0815AB32: strh r0, [r5, 0x30] ldr r1, =0x0203841e 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, =sub_815AB5C str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00001f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x02022e28 ldr r2, =0x000098f0 adds r0, r2, 0 strh r0, [r1] ldr r1, =0x02022e2a movs r0, 0xA0 strh r0, [r1] ldr r0, =0x02022e24 ldrh r1, [r0] movs r0, 0x42 bl lcd_io_set ldr r0, =0x02022e26 ldrh r1, [r0] movs r0, 0x46 bl lcd_io_set b @0815AC70 .align 2, 0 .pool @0815AC40: ldr r1, =0x00001f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x02022e28 movs r0, 0xF0 strh r0, [r1] ldr r4, =0x02022e2a ldr r1, =0x000078a0 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 .pool 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, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r0, =0x02022e28 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e2a 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 .pool thumb_func_end sub_815AC8C thumb_func_start sub_815ACD0 sub_815ACD0: ; 815ACD0 push {r4-r6,lr} adds r5, r0, 0 ldr r6, =0x0203841e movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 bne @0815ACEC ldr r4, =0x02038436 b @0815ACEE .align 2, 0 .pool @0815ACEC: ldr r4, =0x02038437 @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, =0x0203841e 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, =sub_815AD4C str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08329F40 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 .pool @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, =0x03005e00 adds r5, r1, r0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0815ADDC ldr r4, =0x02038436 b @0815ADDE .align 2, 0 .pool @0815ADDC: ldr r4, =0x02038437 @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, =0x0203841e ldrh r0, [r1, 0x2] strh r0, [r5, 0x12] strh r2, [r5, 0x14] strh r2, [r5, 0x16] cmp r7, 0x1 bne @0815AE30 ldr r0, =0x02022e18 b @0815AE32 .align 2, 0 .pool @0815AE30: ldr r0, =0x02022e1c @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 .pool @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, =0x02038c28 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, =0x04000014 b @0815AEA2 .align 2, 0 .pool @0815AEA0: ldr r0, =0x04000018 @0815AEA2: str r0, [sp] ldr r0, =0xa2600001 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, =sub_815AED8 str r0, [r5] add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02038c28 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, =0x02038c28 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, =0x02039b28 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 .pool 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, =0x03005e00 adds r4, r0 movs r5, 0 strh r5, [r4, 0x8] strh r5, [r4, 0xA] ldr r6, =0x02038436 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, =0x0000ffec 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, =sub_815B054 str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r6, r0, r1 movs r1, 0x8 ldrsh r0, [r6, r1] cmp r0, 0x5 bls @0815B074 b @0815B22E @0815B074: lsls r0, 2 ldr r1, =@0815B088 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08593114 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, =0x02020630 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, =nullsub_12 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, =gUnknown_085CE2A0 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 .pool @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, =0x02020630 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, =gUnknown_08593114 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, =sub_815B23C 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 .pool @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, =0x03005e00 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 .pool 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, =move_anim_8072740 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, =0x02038437 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, =sub_80A6EEC str r0, [r5, 0x1C] @0815B324: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @0815B35C cmp r0, 0x1 beq @0815B37C b @0815B38E .align 2, 0 .pool @0815B35C: movs r0, 0 bl obj_id_for_side_relative_to_move adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_085CE350 adds r0, r4, 0 bl sub_80A7CFC ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @0815B38E .align 2, 0 .pool @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, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] 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 .pool @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, =0x02020630 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 .pool @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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0815B4BC ldr r0, =0x0000fff0 b @0815B4C0 .align 2, 0 .pool @0815B4BC: movs r0, 0x80 lsls r0, 1 @0815B4C0: strh r0, [r4, 0x20] movs r0, 0 strh r0, [r4, 0x22] ldr r0, =sub_815B4D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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 .pool @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, =gUnknown_085CE3A0 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 .pool 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 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, =sub_815B5D0 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff 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 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bne @0815B69C movs r0, 0 bl obj_id_for_side_relative_to_move adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_085CE3B8 adds r0, r4, 0 bl sub_80A7CFC ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @0815B6AE .align 2, 0 .pool @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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bne @0815B6F4 movs r0, 0 bl obj_id_for_side_relative_to_move adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_085CE3E0 adds r0, r4, 0 bl sub_80A7CFC ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @0815B706 .align 2, 0 .pool @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, =0x02038436 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 .pool @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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bne @0815B7B8 movs r0, 0 bl obj_id_for_side_relative_to_move adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_085CE430 adds r0, r4, 0 bl sub_80A7CFC ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @0815B7CA .align 2, 0 .pool @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, =0x03005e00 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, =@0815B808 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02038436 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 .pool @0815B844: movs r0, 0x2 movs r1, 0x2 movs r2, 0x1 bl lcd_bg_operations @0815B84E: ldr r0, =0x03005e00 mov r6, r8 lsls r1, r6, 2 add r1, r8 lsls r1, 3 adds r1, r0 ldr r0, =0x0203841e ldrh r0, [r0] strh r0, [r1, 0x1C] b @0815BA26 .align 2, 0 .pool @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, =0x02038436 ldrb r0, [r5] ldr r1, =0x02038437 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 .pool @0815B8E0: ldrb r0, [r5] bl battle_get_per_side_status lsls r0, 24 lsrs r1, r0, 24 @0815B8EA: ldr r0, =0x020244d4 ldr r2, [r0] lsls r0, r1, 2 adds r2, 0x4 adds r2, r0 ldr r1, =0x020244e4 ldr r0, =0x02038436 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r1, 11 ldr r0, [r2] adds r0, r1 ldr r1, [sp] ldr r2, =0x04000200 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, =0x02039f34 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, =0x02039f34 ldr r0, [r0] ldr r0, [r0, 0x18] ldrh r0, [r0, 0x2] bl sub_80DB2A8 lsls r0, 24 cmp r0, 0 beq @0815B9EC ldr r3, =0x02020630 ldr r4, =0x020241e4 ldr r2, =0x02038436 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, =gUnknown_082FF6C0 b @0815BA06 .align 2, 0 .pool @0815B9EC: ldr r3, =0x02020630 ldr r4, =0x020241e4 ldr r2, =0x02038436 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, =gUnknown_082FF694 @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, =0x03005e00 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 .pool @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, =0x02038436 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 .pool @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, =0x02038436 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0815BAF6 ldr r0, =0x03005e00 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, =0x020244d0 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 .pool thumb_func_end sub_815B7D0 thumb_func_start c3_80DFBE4 c3_80DFBE4: ; 815BB18 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r4, =0x0203841e ldr r3, =0x02020630 ldr r2, =0x020241e4 ldr r1, =0x02038436 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 .pool 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, =0x02038436 ldrb r0, [r0] ldr r1, =0x02038437 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 .pool 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, =0x03005e00 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, =@0815BBB4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0815BBB4: .4byte @0815BBC8 .4byte @0815BCB8 .4byte @0815BD08 .4byte @0815BD72 .4byte @0815BDA6 @0815BBC8: ldr r1, =0x00003f42 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, =gUnknown_08C2A6EC mov r0, sp movs r2, 0 bl sub_80A6D60 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @0815BC34 ldr r1, =0x02022e18 ldr r3, =0x0000ffc8 b @0815BC5C .align 2, 0 .pool @0815BC34: ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 beq @0815BC58 ldr r1, =0x02022e18 ldr r2, =0x0000ff79 adds r0, r2, 0 b @0815BC5E .align 2, 0 .pool @0815BC58: ldr r1, =0x02022e18 ldr r3, =0x0000fff6 @0815BC5C: adds r0, r3, 0 @0815BC5E: strh r0, [r1] ldr r1, =0x02022e1a movs r0, 0 strh r0, [r1] mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08C2A634 mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r0, =gUnknown_08C2A6D4 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =0x02022e18 ldrh r0, [r0] strh r0, [r1, 0x1C] ldr r0, =0x02022e1a ldrh r0, [r0] strh r0, [r1, 0x1E] ldrh r0, [r1, 0x8] adds r0, 0x1 b @0815BD8E .align 2, 0 .pool @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, =0x02022e18 ldr r1, =gUnknown_085CE460 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 .pool @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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a 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 .pool 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, =0x02038436 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, =0x0203841e ldrh r0, [r1] strh r0, [r7, 0x30] ldrh r0, [r1, 0x2] strh r0, [r7, 0x32] ldr r4, =gUnknown_085CE48C 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, =0x02020630 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, =0x0203841e 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, =0x0000ffff 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, =sub_815C050 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, =sub_815BF44 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 .pool 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, =0x02020630 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, =0x02020630 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, =sub_815BFF4 str r0, [r3, 0x1C] @0815BFE8: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_815BF44 thumb_func_start sub_815BFF4 sub_815BFF4: ; 815BFF4 push {r4-r6,lr} adds r4, r0, 0 ldr r5, =0x02020630 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, =nullsub_12 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 .pool 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, =nullsub_12 str r0, [r3, 0x1C] @0815C09C: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@0815C0D4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0815C0D4: .4byte @0815C0EC .4byte @0815C224 .4byte @0815C2AC .4byte @0815C2E2 .4byte @0815C310 .4byte @0815C34A @0815C0EC: ldr r1, =0x00003f42 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000d03 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, =gUnknown_08C2A6EC mov r0, sp movs r2, 0 bl sub_80A6D60 bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @0815C15C ldr r1, =0x02022e18 ldr r3, =0x0000ffc8 adds r0, r3, 0 b @0815C1CA .align 2, 0 .pool @0815C15C: ldr r0, =0x02038437 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, =0x02022e18 ldr r2, =0x0000ff65 adds r0, r2, 0 strh r0, [r1] @0815C180: cmp r4, 0x3 bne @0815C18C ldr r1, =0x02022e18 ldr r3, =0x0000ff8d adds r0, r3, 0 strh r0, [r1] @0815C18C: cmp r4, 0 bne @0815C196 ldr r1, =0x02022e18 movs r0, 0xE strh r0, [r1] @0815C196: cmp r4, 0x2 bne @0815C1CC ldr r1, =0x02022e18 ldr r2, =0x0000ffec b @0815C1C8 .align 2, 0 .pool @0815C1B4: cmp r4, 0x1 bne @0815C1C0 ldr r1, =0x02022e18 ldr r3, =0x0000ff79 adds r0, r3, 0 strh r0, [r1] @0815C1C0: cmp r4, 0 bne @0815C1CC ldr r1, =0x02022e18 ldr r2, =0x0000fff6 @0815C1C8: adds r0, r2, 0 @0815C1CA: strh r0, [r1] @0815C1CC: ldr r1, =0x02022e1a movs r0, 0 strh r0, [r1] mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08C2A634 mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r0, =gUnknown_08C2A6D4 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =0x02022e18 ldrh r0, [r0] strh r0, [r1, 0x1C] ldr r0, =0x02022e1a ldrh r0, [r0] strh r0, [r1, 0x1E] b @0815C2A4 .align 2, 0 .pool @0815C224: ldr r1, =0x03005e00 lsls r4, r6, 2 adds r0, r4, r6 lsls r0, 3 adds r5, r0, r1 movs r0, 0 strh r0, [r5, 0xE] ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0815C268 ldr r2, =0x02022e18 ldr r1, =gUnknown_085CE4A4 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 .pool @0815C268: ldr r2, =0x02022e18 ldr r1, =gUnknown_085CE4A4 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, =0x03005e00 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 .pool @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, =gUnknown_085CE4A8 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 .pool @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, =0x02022e18 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1a 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 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bne @0815C3E8 movs r0, 0 bl obj_id_for_side_relative_to_move adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_085CE4B0 adds r0, r4, 0 bl sub_80A7CFC ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @0815C3FA .align 2, 0 .pool @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, =0x02038436 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 .pool @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, =0x03005e00 adds r4, r0, r1 ldr r5, =0x0203841e 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 .pool @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, =0x02038436 b @0815C50A .align 2, 0 .pool @0815C508: ldr r0, =0x02038437 @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, =sub_815C548 str r0, [r4] @0815C538: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @0815C570: cmp r6, 0x2 beq @0815C628 cmp r6, 0x3 bne @0815C57A b @0815C698 @0815C57A: b @0815C6A8 @0815C57C: ldr r2, =0x02020630 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 .pool @0815C5D0: ldr r2, =0x02020630 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 .pool @0815C628: ldr r2, =0x02020630 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 .pool @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, =0x02038436 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, =0x0203841e ldrh r0, [r1] b @0815C6DE .align 2, 0 .pool @0815C6D4: movs r0, 0xF0 strh r0, [r4, 0x20] ldr r1, =0x0203841e 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, =sub_815C700 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 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 .pool @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, =0x03005e00 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, =0x0203841e 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, =sub_815C7C4 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0xfffffe00 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 .pool @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, =0x02020630 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 .pool @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, =0x0203841e movs r2, 0x4 ldrsh r0, [r6, r2] cmp r0, 0 bne @0815C990 ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 0x3 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x22] @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 .pool @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, =0x03005e00 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, =0x0203841e movs r3, 0 ldrsh r1, [r0, r3] mov r8, r0 cmp r1, 0 bne @0815CA5C ldr r0, =0x02038436 b @0815CA5E .align 2, 0 .pool @0815CA5C: ldr r0, =0x02038437 @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, =0x03005e00 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 .pool @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, =0x02020630 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, =0x02020630 adds r0, r2, r5 lsls r0, 2 adds r0, r1 movs r1, 0x2 strh r1, [r0, 0x24] ldr r0, =0x03005e00 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 .pool @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, =0x02020630 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, =0x02020630 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 .pool 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r4, 0x4] bl GenerateRandomNumber2 ldr r5, =0x000001ff 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 .pool @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, =0x0203841e ldrh r0, [r0] strh r0, [r4, 0x32] lsls r0, 16 cmp r0, 0 bne @0815CC1C ldr r0, =0x0000fff8 b @0815CC1E .align 2, 0 .pool @0815CC1C: movs r0, 0xF8 @0815CC1E: strh r0, [r4, 0x20] movs r0, 0x68 strh r0, [r4, 0x22] ldr r0, =sub_815CC34 str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00001f3f movs r0, 0x4A bl lcd_io_set movs r1, 0x80 lsls r1, 8 movs r0, 0 bl lcd_io_set_bits ldr r0, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r4, =0x02022e26 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, =0x0203841e 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, =sub_815CD0C str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00003f3f 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 .pool thumb_func_end sub_815CD0C thumb_func_start sub_815CDB4 sub_815CDB4: ; 815CDB4 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x02038436 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, =0x0203841e ldrh r0, [r1] strh r0, [r4, 0x2E] ldrh r0, [r1, 0x2] strh r0, [r4, 0x30] ldr r1, =sub_815CDFC str r1, [r4, 0x1C] adds r0, r4, 0 bl _call_via_r1 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038436 ldrb r0, [r0] bl sub_80A82E4 subs r0, 0x1 b @0815CE52 .align 2, 0 .pool @0815CE48: ldr r0, =0x02038436 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 .pool @0815CE98: cmp r2, 0x1 bne @0815CEC8 ldr r1, =0xfffffc00 adds r0, r1, 0 ldrh r2, [r4, 0x32] adds r0, r2 strh r0, [r4, 0x32] ldr r3, =0xffffff00 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 .pool 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, =0x02039f34 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 .pool @0815CF18: ldr r0, =0x02038436 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, =0x0202406e ldr r4, =0x02038437 ldrb r0, [r4] lsls r0, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r7, =0x020244ec 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, =0x020244d0 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 .pool @0815CF9C: ldrb r0, [r4] lsls r0, 1 adds r0, r6 ldrh r0, [r0] muls r0, r5 ldr r1, =0x02024744 adds r0, r1 @0815CFAA: movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r6, r0, 16 b @0815CFBE .align 2, 0 .pool @0815CFBC: ldrh r6, [r1, 0x2] @0815CFBE: movs r1, 0x14 mov r10, r1 b @0815D05A @0815CFC4: movs r2, 0x1 str r2, [sp, 0x1C] ldr r6, =0x0202406e ldr r4, =0x02038437 ldrb r0, [r4] lsls r0, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r7, =0x02024744 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, =0x020244d0 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, =0x020244ec adds r0, r1 b @0815D048 .align 2, 0 .pool @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, =0x0000ffec @0815D058: mov r10, r3 @0815D05A: ldr r0, =0x02038436 ldrb r0, [r0] bl sub_80A8328 lsls r0, 24 lsrs r7, r0, 24 ldr r5, =0x02038436 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, =0x02038437 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, =0x02020630 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, =0x00007fff 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, =0x03005e00 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, =sub_815D160 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 .pool thumb_func_end sub_815CED8 thumb_func_start sub_815D160 sub_815D160: ; 815D160 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 ldrh r0, [r4, 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, =sub_815D1BC str r0, [r4] @0815D1AE: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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, =sub_80A6814 str r0, [r5] @0815D22A: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r4, r1, r0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0815D26C ldr r0, =0x02038436 b @0815D26E .align 2, 0 .pool @0815D26C: ldr r0, =0x02038437 @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, =0x0203841e 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, =0x04000014 str r0, [sp] ldr r1, =0x00003f42 movs r0, 0x50 bl lcd_io_set ldr r0, =0x02022e18 ldrh r5, [r0] ldr r0, =0x02022e1a b @0815D316 .align 2, 0 .pool @0815D304: ldr r0, =0x04000018 str r0, [sp] ldr r1, =0x00003f44 movs r0, 0x50 bl lcd_io_set ldr r0, =0x02022e1c ldrh r5, [r0] ldr r0, =0x02022e1e @0815D316: ldrh r3, [r0] movs r7, 0 movs r2, 0 ldr r6, =0x02038c28 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, =0xa6600001 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, =sub_815D398 str r0, [r4] add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02022e18 ldrh r0, [r0] str r0, [sp, 0x4] ldr r0, =0x02022e1a b @0815D3E0 .align 2, 0 .pool @0815D3D8: ldr r0, =0x02022e1c ldrh r0, [r0] str r0, [sp, 0x4] ldr r0, =0x02022e1e @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 .pool @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, =0x02039b28 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, =0x02038c28 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, =0x02038c28 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, =gUnknown_08329F40 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, =0xffff0000 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, =0x02038c28 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 .pool @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, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] movs r0, 0 strh r0, [r6, 0xC] b @0815D62E .align 2, 0 .pool @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, =0x03005e00 adds r4, r0 movs r0, 0 strh r0, [r4, 0x8] ldr r0, =0x0203841e 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, =gUnknown_085CE5F0 adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_815D694 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 movs r0, 0x26 ldrsh r1, [r3, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000ffff strh r1, [r0, 0x24] b @0815D708 .align 2, 0 .pool @0815D6F8: ldr r2, =0x02020630 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 .pool 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, =0x0203841e 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, =sub_815D804 str r0, [r4, 0x1C] add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e ldrh r0, [r6, 0x6] strh r0, [r5, 0x2E] ldrb r1, [r6] adds r0, r5, 0 bl sub_8008258 ldr r0, =0x02038437 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, =0x02038436 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, =sub_810E2C8 str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 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 .pool @0815D998: ldr r2, =0x02020630 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 .pool @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, =0x020383fe 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 .pool 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, =0x03005e00 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 .pool @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, =0x00007fff 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, =0x02020630 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 .pool @0815DB00: ldr r2, =0x02020630 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 .pool @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, =sub_815D8D8 str r0, [r2] @0815DB80: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 mov r8, r0 lsls r7, r6, 2 adds r0, r7, r6 lsls r0, 3 mov r1, r8 adds r4, r0, r1 ldr r1, =0x020241e4 ldr r2, =0x02038436 ldrb r0, [r2] adds r0, r1 ldrb r0, [r0] strh r0, [r4, 0x26] ldr r5, =0x0203841e 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, =0xffff8000 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 .pool @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, =0x00007fff ands r0, r1 b @0815DC28 .align 2, 0 .pool @0815DC20: ldrh r0, [r5, 0x2] ldr r2, =0xffff8000 adds r1, r2, 0 orrs r0, r1 @0815DC28: strh r0, [r4, 0xC] ldr r0, =0x0203841e 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, =0x03005e00 lsls r4, r6, 2 adds r1, r4, r6 lsls r1, 3 adds r1, r3 ldrh r2, [r5, 0x4] ldr r0, =0x00007fff ands r0, r2 b @0815DC72 .align 2, 0 .pool @0815DC60: ldr r3, =0x03005e00 lsls r4, r6, 2 adds r1, r4, r6 lsls r1, 3 adds r1, r3 ldrh r2, [r5, 0x4] ldr r7, =0xffff8000 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, =sub_815DA20 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r5, r0, r1 ldr r4, =0x0203841e 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, =0x02038436 b @0815DCEA .align 2, 0 .pool @0815DCE8: ldr r0, =0x02038437 @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, =0x0203841e 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, =gUnknown_085CE74C adds r0, r5, 0 bl sub_80A7CFC ldr r0, =sub_815DD48 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_085CE74C adds r0, r4, 0 bl sub_80A7CFC b @0815DDDA .align 2, 0 .pool @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, =0x03005e00 adds r4, r0, r2 cmp r1, 0 bne @0815DE08 movs r1, 0x12 movs r3, 0xEC b @0815DE0C .align 2, 0 .pool @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, =0x02020630 @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, =gUnknown_085CE76C 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, =0x0000ffff 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 .pool 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, =0x03005e00 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 .pool thumb_func_end sub_815DEBC thumb_func_start sub_815DF0C sub_815DF0C: ; 815DF0C push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 adds r4, r1 movs r0, 0 strh r0, [r4, 0x8] ldr r1, =0x0203841e 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, =0x02020630 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, =sub_815DF64 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_085CE784 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 .pool @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, =0x02038436 ldrb r3, [r1] ldr r1, =0x0203841e 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, =gUnknown_08C2DC68 str r1, [sp, 0x10] ldr r1, =gUnknown_08C2DDC4 str r1, [sp, 0x14] ldr r1, =gUnknown_08C2DDA4 str r1, [sp, 0x18] movs r1, 0 bl sub_8117854 add sp, 0x1C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_815DFCC thumb_func_start sub_815E01C sub_815E01C: ; 815E01C push {r4-r6,lr} adds r5, r0, 0 ldr r6, =0x02038436 ldrb r0, [r6] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0815E038 ldr r1, =0x0203841e ldrh r0, [r1] negs r0, r0 strh r0, [r1] @0815E038: ldrb r0, [r6] movs r1, 0 bl sub_80A5C6C lsls r0, 24 ldr r4, =0x0203841e 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, =0x0000fd80 strh r0, [r5, 0x30] b @0815E0A8 .align 2, 0 .pool @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, =0x02038436 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, =sub_815E0DC str r0, [r5, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @0815E144: movs r0, 0xC strh r0, [r6, 0x12] movs r0, 0x3 strh r0, [r6, 0x14] strh r1, [r6, 0x16] @0815E14E: ldr r5, =0x02038436 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 .pool @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, =0x02038436 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, =0x02038437 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, =sub_815E20C str r0, [r6] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 @0815E272: add r0, sp, 0x10 movs r2, 0 ldrsh r1, [r0, r2] mov r3, r8 movs r0, 0 ldrsh r2, [r3, r0] ldr r0, =gUnknown_085CE7EC 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 .pool @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, =0x02020630 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 .pool @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, =0x03005e00 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 .pool thumb_func_end sub_815E404 thumb_func_start sub_815E444 sub_815E444: ; 815E444 push {r4,lr} adds r4, r0, 0 ldr r1, =0x0203841e 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, =move_anim_8072740 adds r0, r4, 0 bl oamt_set_x3A_32 ldr r0, =sub_80A70C0 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r7, r0, r1 ldr r0, =0x02038436 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, =0x02038437 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, =gUnknown_085CE84C 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, =0x02020630 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, =0x0000ffe0 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, =sub_815E5CC str r0, [r7] b @0815E5BE .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =0x02020630 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 .pool @0815E634: movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool @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, =0x02020630 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 .pool @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, =0x0203841e movs r2, 0 ldrsh r1, [r0, r2] adds r6, r0, 0 cmp r1, 0 bne @0815E6F4 ldr r0, =0x02038436 b @0815E6F6 .align 2, 0 .pool @0815E6F4: ldr r0, =0x02038437 @0815E6F6: ldrb r5, [r0] ldrh r2, [r4, 0x4] lsls r1, r2, 22 lsrs r1, 22 adds r1, 0x10 ldr r3, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 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 .pool @0815E768: adds r0, r5, 0 movs r1, 0x5 bl sub_80A861C adds r0, 0x8 @0815E772: strh r0, [r4, 0x20] ldr r0, =sub_815E784 str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool @0815E85C: ldr r0, =0x03005e00 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, =gUnknown_085CE87C adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_815E898 str r0, [r4] @0815E884: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 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 .pool @0815E8E0: ldr r2, =0x02020630 movs r0, 0x26 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000fffe @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, =0x02020630 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, =0x03005e00 adds r0, r1 ldrh r1, [r0, 0x26] lsls r1, 24 lsrs r1, 24 ldr r2, =gUnknown_085CE87C bl sub_80A7CFC strh r5, [r4, 0xA] strh r5, [r4, 0xC] b @0815E94E .align 2, 0 .pool @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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0815E970 ldr r4, =0x02038436 b @0815E972 .align 2, 0 .pool @0815E970: ldr r4, =0x02038437 @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, =0x0203841e ldrh r0, [r1, 0x2] strh r0, [r5, 0x30] strh r2, [r5, 0x32] ldrh r0, [r1, 0x4] strh r0, [r5, 0x34] ldr r0, =sub_815E9BC str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e 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 .pool @0815EA44: movs r0, 0x8C strh r0, [r3, 0x20] ldr r0, =0x0000ffff @0815EA4A: strh r0, [r3, 0x3C] movs r0, 0x38 strh r0, [r3, 0x22] ldr r0, =sub_815EA60 str r0, [r3, 0x1C] pop {r0} bx r0 .align 2, 0 .pool 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, =@0815EA7C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08329F40 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 .pool @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, =gUnknown_08329F40 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 .pool @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, =gUnknown_08329F40 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, =0x000003ff adds r0, r3, 0 ands r1, r0 ldr r0, =0xfffffc00 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 .pool @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, =0x03005e00 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, =0x02038436 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 .pool @0815ECAC: ldr r0, =0x0000ffff b @0815ECD2 .align 2, 0 .pool @0815ECB4: ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0815ECD0 ldr r0, =0x0000ffff b @0815ECD2 .align 2, 0 .pool @0815ECD0: movs r0, 0x1 @0815ECD2: strh r0, [r6, 0x24] @0815ECD4: ldr r0, =sub_815ECE4 str r0, [r6] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 adds r3, r0, r1 movs r1, 0x8 ldrsh r0, [r3, r1] cmp r0, 0x8 bls @0815ECFE b @0815EE78 @0815ECFE: lsls r0, 2 ldr r1, =@0815ED10 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 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 .pool @0815ED78: ldr r2, =0x02020630 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 .pool @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, =0x02020630 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 .pool @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, =0x02020630 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 .pool @0815EE28: ldr r2, =0x02020630 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 .pool @0815EE60: ldr r2, =0x02020630 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 .pool thumb_func_end sub_815ECE4 thumb_func_start sub_815EE84 sub_815EE84: ; 815EE84 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bne @0815EEA8 adds r0, r4, 0 movs r1, 0x1 bl sub_80A69CC ldr r0, =0x02038436 b @0815EEAA .align 2, 0 .pool @0815EEA8: ldr r0, =0x02038437 @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, =sub_815EF08 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =@0815EF24 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =@0815EF50 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085CE3A0 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 .pool thumb_func_end sub_815F10C thumb_func_start sub_815F18C sub_815F18C: ; 815F18C push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02038437 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, =0x0203841e 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 .pool @0815F1D0: ldr r2, =0x0203841e 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, =sub_815F10C str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 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 .pool @0815F2AC: ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0 bl refresh_graphics_maybe bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @0815F2EE ldr r3, =0x02020630 ldr r2, =0x020241e4 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, =gUnknown_082FF6C0 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, =sub_815F330 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 .pool 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, =0x03005e00 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 .pool @0815F360: cmp r5, 0x2 beq @0815F400 cmp r5, 0x3 beq @0815F43C b @0815F482 @0815F36A: ldr r0, =0x02020630 lsls r1, r3, 4 adds r1, r3 lsls r1, 2 adds r1, r0 ldr r0, =0x0000ff38 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 .pool @0815F394: ldrh r1, [r4, 0x1C] adds r1, 0x70 movs r5, 0 strh r1, [r4, 0x1C] ldr r2, =0x02020630 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, =0xfffff800 adds r0, r1, 0 ldrh r2, [r4, 0x1C] adds r0, r2 strh r0, [r4, 0x1C] b @0815F42E .align 2, 0 .pool @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, =0x02020630 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 .pool @0815F43C: ldrh r0, [r4, 0x1C] adds r0, 0x70 strh r0, [r4, 0x1C] ldr r2, =0x02020630 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 .pool thumb_func_end sub_815F330 thumb_func_start sub_815F48C sub_815F48C: ; 815F48C push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02038437 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, =0x0000ff70 b @0815F4C8 .align 2, 0 .pool @0815F4B8: ldrb r0, [r4] bl sub_80A82E4 adds r0, 0x2 adds r1, r5, 0 adds r1, 0x43 strb r0, [r1] ldr r4, =0x0000ffa0 @0815F4C8: ldr r0, =0x02038437 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, =sub_815F4F0 str r0, [r5, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =@0815F50C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08329F40 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 .pool @0815F584: ldrh r1, [r4, 0x30] adds r1, 0x6 movs r3, 0 strh r1, [r4, 0x30] ldr r2, =gUnknown_08329F40 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 .pool @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, =0x02020630 adds r0, r1 bl obj_delete_but_dont_free_vram @0815F66E: mov r0, r8 bl move_anim_task_del b @0815F780 .align 2, 0 .pool @0815F67C: ldr r4, =0x02020630 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, =0x0000fff0 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, =0x03005e00 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, =0x020244d0 ldr r1, [r0] ldr r0, =0x02038437 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 .pool @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, =sub_815F7C4 str r0, [r2] adds r1, r3 str r0, [r1] mov r0, r12 add r0, r8 lsls r0, 3 ldr r1, =0x03005e00 adds r0, r1 ldr r1, =sub_815F79C 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 .pool thumb_func_end sub_815F620 thumb_func_start sub_815F79C sub_815F79C: ; 815F79C push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005e00 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 .pool 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, =0x020244d0 ldr r1, [r0] ldr r0, =0x02038437 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 .pool @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, =0x03005e00 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 .pool 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, =0x0203841e movs r2, 0 strh r2, [r3, 0xE] ldr r1, =0x0203841a 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 .pool 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, =0x03005e00 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, =@0815F92C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 mov r9, r4 cmp r0, 0 bne @0815F998 ldr r2, =0x02020630 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 .pool @0815F998: ldr r3, =0x02020630 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, =0x03005e00 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 .pool @0815F9F4: bl sub_80A4DF0 lsls r0, 24 cmp r0, 0 beq @0815FA28 ldr r0, =0x02039f34 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, =0x02038436 ldrb r0, [r0] bl sub_80A82E4 lsls r0, 24 lsrs r4, r0, 24 movs r7, 0 b @0815FB4E .align 2, 0 .pool @0815FA28: ldr r4, =0x02038436 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0815FAC8 ldr r7, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r7 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec 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, =0x020244d0 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 .pool @0815FA9C: ldrh r6, [r1, 0x2] @0815FA9E: movs r0, 0x1 bl obj_id_for_side_relative_to_move ldr r2, =0x02020630 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 .pool @0815FAC8: ldr r7, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r7 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x02024744 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, =0x020244d0 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 .pool @0815FB2C: ldrh r6, [r1, 0x2] @0815FB2E: movs r0, 0x1 bl obj_id_for_side_relative_to_move ldr r2, =0x02020630 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, =0x0000ffe0 @0815FB50: ldr r0, =0x02038437 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, =0x02038436 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, =0x020244d0 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, =0x02020630 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, =0x00007fff movs r1, 0x10 movs r2, 0x6 bl pal_fade_1 @0815FBBA: ldr r0, =0x03005e00 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 .pool @0815FBE8: ldr r1, =0x03005e00 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, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 mov r9, r4 cmp r0, 0 bne @0815FC40 ldr r3, =0x02020630 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 .pool @0815FC40: ldr r2, =0x02020630 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, =0x03005e00 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, =0x02038436 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, =0x02038437 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 .pool @0815FCB4: lsls r4, r5, 16 asrs r4, 16 ldr r0, =0x02038437 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, =0x0203841e ldr r0, =0x0000ffff 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, =0x03005e00 mov r1, r9 add r1, r8 lsls r1, 3 adds r1, r0 movs r0, 0 strh r0, [r1, 0xA] b @0815FD7E .align 2, 0 .pool @0815FD08: movs r0, 0 bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r7, r0, 24 ldr r1, =0x03005e00 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, =0x02020630 adds r0, r5 bl sub_80A8610 ldr r0, =0x02038436 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 .pool @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, =0x03005e00 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 .pool @0815FD8C: movs r0, 0 bl obj_id_for_side_relative_to_move lsls r0, 24 lsrs r7, r0, 24 ldr r1, =0x03005e00 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, =0x02038436 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, =0x02020630 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 .pool @0815FE0C: ldr r1, =0x02020630 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, =0x03005e00 mov r0, r9 add r0, r8 lsls r0, 3 adds r0, r1 ldrb r1, [r0, 0xA] strh r1, [r0, 0xA] ldr r1, =0x02020630 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 .pool 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, =0x0203841e 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, =0x02038437 ldrb r0, [r0] movs r1, 0x1 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 adds r0, 0x10 strh r0, [r4, 0x22] ldr r0, =0x0000ffe0 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, =0x02038436 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, =0x02020630 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 .pool @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, =0x02038436 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 .pool @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, =0x03005e00 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, =@0815FFF4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0815FFF4: .4byte @08160008 .4byte @08160058 .4byte @081600B4 .4byte @081600CC .4byte @08160132 @08160008: ldr r0, =0x02038436 ldrb r0, [r0] movs r1, 0 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 adds r5, r0, 0 ldr r0, =0x02038437 ldrb r0, [r0] movs r1, 0 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 adds r2, r0, 0 ldr r1, =0x03005e00 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 .pool @08160058: ldr r1, =0x020241e4 ldr r0, =0x02038436 ldrb r0, [r0] adds r0, r1 ldrb r2, [r0] ldr r1, =0x02020630 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 .pool @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, =0x020241e4 ldr r0, =0x02038436 ldrb r0, [r0] adds r0, r1 ldrb r2, [r0] ldr r1, =0x02020630 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 .pool @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, =0x020241e4 ldr r0, =0x02038436 ldrb r0, [r0] adds r0, r1 ldrb r2, [r0] ldr r1, =0x02020630 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 .pool 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, =0x03005e00 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, =0x02038436 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, =0x02020630 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, =sub_81601DC str r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 movs r6, 0xE ldrsh r0, [r4, r6] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 ldr r3, =gUnknown_08329F40 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 .pool @08160284: ldrh r0, [r4, 0x1E] adds r0, 0x8 movs r1, 0xFF ands r0, r1 strh r0, [r4, 0x1E] ldr r3, =0x02020630 movs r1, 0xE ldrsh r0, [r4, r1] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r3 ldr r2, =gUnknown_08329F40 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 .pool @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, =0x02038437 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 .pool thumb_func_end sub_81602E0 thumb_func_start sub_8160338 sub_8160338: ; 8160338 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02038437 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0816037C ldr r2, =0x0203841e 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, =0x0000fff5 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 .pool @0816037C: movs r0, 0xB strh r0, [r4, 0x2E] movs r0, 0xC0 strh r0, [r4, 0x30] ldr r1, =0x0203841e 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, =sub_81602E0 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8160338 thumb_func_start sub_81603A8 sub_81603A8: ; 81603A8 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02038436 ldrb r0, [r4] movs r1, 0x2 bl sub_80A5C6C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x20] ldrb r0, [r4] movs r1, 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, =sub_81603F4 str r0, [r5, 0x1C] lsls r1, 8 movs r0, 0x52 bl lcd_io_set pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203841e movs r0, 0 strh r0, [r2, 0xE] ldr r0, =0x0203841c ldrh r1, [r0] movs r0, 0x60 ands r0, r1 cmp r0, 0 beq @08160514 movs r0, 0x1 b @08160536 .align 2, 0 .pool @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, =0x03005e00 adds r4, r0 movs r0, 0 strh r0, [r4, 0x8] ldr r0, =0x0203841e 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, =gUnknown_085CE9C8 adds r0, r4, 0 bl sub_80A7CFC ldr r0, =sub_816058C str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x02020630 movs r0, 0x26 ldrsh r1, [r3, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000ffff strh r1, [r0, 0x24] b @08160600 .align 2, 0 .pool @081605F0: ldr r2, =0x02020630 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 .pool 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, =sub_8160664 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08160688 ldr r0, =sub_81606A0 bl set_callback2 ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] adds r0, r4, 0 bl remove_task @08160688: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc34 movs r0, 0x8C lsls r0, 1 bl malloc_and_clear str r0, [r6] ldr r1, =0x020375e0 ldrh r1, [r1] adds r0, 0x44 movs r5, 0 strb r1, [r0] ldr r0, =sub_8160624 bl SetVBlankCallback bl sub_81607EC movs r0, 0 bl sub_81D2824 ldr r4, =0x0203bc38 movs r0, 0 strh r5, [r4] strh r5, [r4, 0x2] strb r0, [r4, 0x4] bl sub_8161280 ldr r0, =gUnknown_085CEBB0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_085CEBB8 bl gpu_pal_obj_alloc_tag_and_apply bl sub_81610B8 ldr r0, =0x03006310 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, =sub_816082C bl set_callback2 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc34 movs r0, 0x8C lsls r0, 1 bl malloc_and_clear str r0, [r5] movs r1, 0x1C strb r1, [r0] ldr r0, [r5] ldr r1, =0x020375e0 ldrh r1, [r1] adds r0, 0x44 strb r1, [r0] ldr r0, [r5] ldr r1, =0x020375e2 ldrh r1, [r1] adds r0, 0x45 strb r1, [r0] ldr r0, =sub_8160624 bl SetVBlankCallback bl sub_81607EC ldr r4, =0x0203bc38 ldrb r0, [r4, 0x4] bl sub_81D2824 bl sub_8161280 ldr r0, =gUnknown_085CEBB0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_085CEBB8 bl gpu_pal_obj_alloc_tag_and_apply bl sub_81610B8 ldr r0, =0x03006310 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, =sub_816082C bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085CEC28 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 .pool 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, =0x02021fc4 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 bl sub_81D2BF4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc34 ldr r0, [r1] ldrb r0, [r0] adds r7, r1, 0 cmp r0, 0x21 bls @0816087E b @08160E8A @0816087E: lsls r0, 2 ldr r1, =@08160890 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037fd4 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 .pool @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, =0x0203bc34 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] bl sub_81611AC b @08160E8A .align 2, 0 .pool @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, =0x0203bc34 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 b @08160E88 .align 2, 0 .pool @081609A8: bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 bne @08160A0A ldr r5, =0x0203bc34 ldr r0, [r5] adds r0, 0x44 ldrb r1, [r0] movs r0, 0x64 adds r4, r1, 0 muls r4, r0 ldr r0, =0x020244ec 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, =0xffff0000 cmp r0, r1 beq @08160A04 ldr r0, =gUnknown_085EF8E4 bl sub_816084C ldr r1, =0x020375e0 movs r0, 0x1 strh r0, [r1] ldr r1, [r5] movs r0, 0x1F b @08160E88 .align 2, 0 .pool @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, =0x0203bc38 ldrb r0, [r0, 0x4] cmp r0, 0 bne @08160A30 ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x3 b @08160E88 .align 2, 0 .pool @08160A30: cmp r0, 0x1 beq @08160A36 b @08160E8A @08160A36: ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x5 b @08160E88 .align 2, 0 .pool @08160A44: bl sub_81D2C3C lsls r0, 16 cmp r0, 0 beq @08160A50 b @08160E8A @08160A50: bl sub_81D2C50 ldr r0, =0x0203bc34 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 b @08160E88 .align 2, 0 .pool @08160A64: bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 bne @08160A7C ldr r0, =0x020375e0 strh r1, [r0] b @08160E82 .align 2, 0 .pool @08160A7C: movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08160A8A cmp r1, 0x1 beq @08160A8A b @08160E8A @08160A8A: ldr r0, =0x0203bc38 ldrb r0, [r0, 0x4] cmp r0, 0 bne @08160AA4 ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x3 b @08160E88 .align 2, 0 .pool @08160AA4: cmp r0, 0x1 beq @08160AAA b @08160E8A @08160AAA: ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x5 b @08160E88 .align 2, 0 .pool @08160AB8: ldr r0, =gUnknown_085EF8F3 bl sub_816084C ldr r0, =0x0203bc34 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 b @08160E88 .align 2, 0 .pool @08160AD0: bl sub_81D2C3C lsls r0, 16 cmp r0, 0 beq @08160ADC b @08160E8A @08160ADC: bl sub_81D2C50 ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x12 b @08160E88 .align 2, 0 .pool @08160AEC: bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 bne @08160B10 ldr r0, =gUnknown_085EFA10 bl sub_816084C ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x13 b @08160E88 .align 2, 0 .pool @08160B10: movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08160B1E cmp r1, 0x1 beq @08160B1E b @08160E8A @08160B1E: ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x18 b @08160E88 .align 2, 0 .pool @08160B2C: ldr r4, =0x02021dc4 bl sub_8161054 movs r1, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 bl gf_strcpy ldr r0, =gUnknown_085EF960 bl sub_816084C ldr r0, =0x0203bc34 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 b @08160E88 .align 2, 0 .pool @08160B60: bl sub_81D2C3C lsls r0, 16 cmp r0, 0 beq @08160B6C b @08160E8A @08160B6C: bl sub_81D2C50 ldr r0, =0x0203bc34 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 b @08160E88 .align 2, 0 .pool @08160B80: bl sub_8198C58 lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 bne @08160B98 ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x1B b @08160E88 .align 2, 0 .pool @08160B98: movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08160BA6 cmp r1, 0x1 beq @08160BA6 b @08160E8A @08160BA6: ldr r0, =0x0203bc38 ldrb r0, [r0, 0x4] cmp r0, 0 bne @08160BC4 ldr r2, =0x0203bc34 ldr r1, [r2] movs r0, 0x3 strb r0, [r1] adds r7, r2, 0 b @08160BD0 .align 2, 0 .pool @08160BC4: ldr r7, =0x0203bc34 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 .pool @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, =0x0203bc38 ldrb r0, [r0, 0x4] cmp r0, 0 bne @08160C08 ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x3 b @08160E88 .align 2, 0 .pool @08160C08: cmp r0, 0x1 beq @08160C0E b @08160E8A @08160C0E: ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x5 b @08160E88 .align 2, 0 .pool @08160C1C: bl sub_81D2C3C lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0 beq @08160C2A b @08160E8A @08160C2A: ldr r0, =0x0203bc34 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 .pool @08160C48: ldr r0, =0x02037fd4 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, =0x020244ec ldr r1, =0x0203bc34 ldr r1, [r1] adds r1, 0x44 ldrb r1, [r1] ldr r2, =0x020244e9 ldrb r2, [r2] subs r2, 0x1 lsls r2, 24 lsrs r2, 24 ldr r3, =sub_8160740 str r0, [sp] adds r0, r4, 0 bl sub_81BFA38 bl sub_8160EA0 b @08160E8A .align 2, 0 .pool @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, =0x0203bc34 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 b @08160E88 .align 2, 0 .pool @08160CD8: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08160CE6 b @08160E8A @08160CE6: bl sub_8160EA0 ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 b @08160E8A .align 2, 0 .pool @08160CFC: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =0x0203bc34 ldr r1, [r0] ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r0, =0x0203bc38 ldrb r0, [r0, 0x4] cmp r0, 0 bne @08160D30 movs r0, 0x1 bl render_previous_quest_text b @08160D3A .align 2, 0 .pool @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, =0x02037fd4 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 .pool @08160D6C: adds r0, r1, 0 adds r0, 0x44 ldrb r0, [r0] movs r4, 0x64 muls r0, r4 ldr r5, =0x020244ec adds r0, r5 ldrb r1, [r2] adds r1, 0xD bl pokemon_getattr lsls r0, 16 lsrs r0, 16 ldr r2, =0x02021ec4 movs r1, 0xD mov r8, r1 mov r1, r8 muls r1, r0 ldr r6, =gMoveNames 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, =0x02021dc4 bl sub_8161054 mov r1, r8 muls r1, r0 adds r1, r6 adds r0, r4, 0 bl gf_strcpy ldr r0, =gUnknown_085EF979 bl sub_816084C ldr r1, [r7] movs r0, 0x1E strb r0, [r1] ldr r1, =0x020375e0 movs r0, 0x1 strh r0, [r1] b @08160E8A .align 2, 0 .pool @08160E0C: bl sub_81D2C3C lsls r0, 16 cmp r0, 0 bne @08160E8A ldr r0, =gUnknown_085EF9A6 bl sub_816084C ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x1F strb r0, [r1] ldr r0, =0x0000016f bl fanfare_play b @08160E8A .align 2, 0 .pool @08160E38: bl sub_81D2C3C lsls r0, 16 cmp r0, 0 bne @08160E8A ldr r0, =0x0000016f bl fanfare_play ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x20 b @08160E88 .align 2, 0 .pool @08160E58: bl task_is_not_running_overworld_fanfare lsls r0, 24 cmp r0, 0 beq @08160E8A ldr r0, =0x0203bc34 ldr r1, [r0] movs r0, 0x21 b @08160E88 .align 2, 0 .pool @08160E70: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08160E8A movs r0, 0x5 bl audio_play @08160E82: ldr r0, =0x0203bc34 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 .pool thumb_func_end sub_8160868 thumb_func_start sub_8160EA0 sub_8160EA0: ; 8160EA0 push {r4,lr} bl sub_8161234 ldr r4, =0x0203bc34 ldr r0, [r4] movs r1, 0x89 lsls r1, 1 adds r0, r1 ldrb r0, [r0] ldr r1, =0x0203bc38 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 .pool 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, =0x02020630 ldr r4, =0x0203bc34 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, =0x02021fc4 ldr r1, =gUnknown_085EF8C2 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 .pool 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, =0x0203bc34 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, =0x0203bc38 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, =0x030022c0 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 .pool @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, =0x02021fc4 ldr r1, =gUnknown_085EF9E6 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 bl sub_81D2BF4 b @0816103E .align 2, 0 .pool @08161010: movs r0, 0x5 bl audio_play bl sub_8161234 ldr r1, [r6] movs r0, 0x8 strb r0, [r1] ldr r0, =0x02021dc4 movs r1, 0xD muls r1, r5 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EF8DA adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 bl sub_81D2BF4 @0816103E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8160F50 thumb_func_start sub_8161054 sub_8161054: ; 8161054 ldr r0, =0x0203bc34 ldr r2, [r0] ldr r1, =0x0203bc38 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 .pool 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, =0x02021fc4 ldr r1, =gUnknown_085EF8C2 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 .pool thumb_func_end sub_8161074 thumb_func_start sub_81610B8 sub_81610B8: ; 81610B8 push {r4-r7,lr} ldr r2, =0x0203bc34 ldr r0, [r2] movs r1, 0x8A lsls r1, 1 adds r0, r1 movs r1, 0xFF strb r1, [r0] ldr r0, [r2] ldr r2, =0x00000113 adds r1, r0, r2 movs r0, 0x1 negs r0, r0 strb r0, [r1] bl sub_81611AC movs r4, 0 ldr r5, =gUnknown_085CEC10 @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, =0x0203bc34 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, =gUnknown_085CEC10 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, =0x02020630 adds r0, r5 movs r1, 0x2 bl obj_anim_image_start adds r4, 0x1 cmp r4, 0x7 ble @0816111C movs r4, 0 ldr r3, =0x0203bc34 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 .pool thumb_func_end sub_81610B8 thumb_func_start sub_81611AC sub_81611AC: ; 81611AC push {r4-r6,lr} ldr r4, =0x0203bc34 ldr r1, [r4] movs r2, 0x8A lsls r2, 1 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0xFF bne @081611D4 ldr r0, =gUnknown_085CEBC0 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, =0x00000113 adds r0, r6 ldrb r0, [r0] cmp r0, 0xFF bne @08161210 ldr r0, =0x0203ce8c adds r2, r0, 0 ldr r1, =gUnknown_085CEBD0 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, =0x00000111 adds r2, r5 ldrb r2, [r2] subs r1, r2 strh r1, [r0, 0x8] ldr r1, =0x0203bc38 bl sub_81AF380 ldr r1, [r4] ldr r6, =0x00000113 adds r1, r6 strb r0, [r1] @08161210: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81611AC thumb_func_start sub_8161234 sub_8161234: ; 8161234 push {r4,lr} ldr r4, =0x0203bc34 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, =0x00000113 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @08161270 bl sub_81AF620 ldr r0, [r4] ldr r2, =0x00000113 adds r1, r0, r2 movs r0, 0xFF strb r0, [r1] @08161270: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc34 ldr r1, [r4] adds r0, r1, 0 adds r0, 0x44 ldrb r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec 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, =gMoveNames 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, =0x0203bc34 ldr r0, [r4] adds r0, 0x44 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2 mov r2, sp bl pokemon_getattr ldr r0, =0x02021cc4 mov r1, sp bl 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, =gUnknown_085E8CF0 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, =0x00000111 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 .pool 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, =0x0203bc38 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, =0x02020630 ldr r3, =0x0203bc34 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 .pool @081613CC: ldr r1, =gContestEffects ldr r0, =gContestMoves 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, =0x0203bc34 ldr r4, =0x02020630 @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 .pool @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, =gContestEffects ldr r0, =gContestMoves 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, =0x0203bc34 mov r8, r0 ldr r7, =0x02020630 @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 .pool @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, =0x020244ec 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 .pool @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, =0x0203cec8 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1370 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1370 str r1, [r0] b @08161658 .align 2, 0 .pool @081615EC: movs r0, 0x64 mov r10, r0 mov r0, r10 muls r0, r5 ldr r1, =0x020244ec 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 .pool @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, =sub_816166C 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 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r5, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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, =sub_81616C0 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 .pool 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, =0x0203cec8 movs r1, 0xA ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl sub_81B1B44 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9C17 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_8161724 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1370 str r1, [r0] @08161772: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1370 str r0, [r1] @081617AA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E9712 movs r1, 0 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8161784 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81617B8 thumb_func_start sub_81617F4 sub_81617F4: ; 81617F4 push {r4,lr} ldr r0, =0x0203bc40 mov r12, r0 ldr r0, =0x03005d8c ldr r1, [r0] ldr r2, =0x00002734 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, =0x00002748 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, =0x0000278e adds r0, r1, r2 str r0, [r4, 0x28] mov r0, r12 adds r0, 0x2C strb r3, [r0] ldr r4, =0x00002798 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 .pool 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, =0x0203bc40 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 .pool 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, =0x0203bc40 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 .pool @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, =gUnknown_085A5C08 lsls r0, r3, 5 adds r0, r1 ldrb r0, [r0, 0x13] movs r2, 0 ldr r1, =0x0203bc40 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 .pool @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, =gUnknown_085A5C08 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, =0x0203bc40 lsls r1, r5, 3 adds r1, r0 ldr r0, [r1] adds r0, r2 strb r4, [r0] movs r0, 0x1 b @081619A2 .align 2, 0 .pool @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, =gUnknown_085A5C08 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 .pool @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, =0x0203bc40 ldr r1, =gUnknown_085A5C08 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 .pool 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, =0x0203bc40 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, =0x0203bc40 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 .pool 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, =0x0203bc40 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 .pool 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, =0x03005d8c ldr r0, [r5] ldr r4, =0x000031dc adds r0, r4 movs r1, 0 movs r2, 0x1C bl memset ldr r0, [r5] adds r0, r4 ldr r1, =0x00000197 strh r1, [r0, 0x8] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8161B34 thumb_func_start sub_8161B60 sub_8161B60: ; 8161B60 push {r4-r6,lr} movs r2, 0 ldr r6, =0x0203bc86 ldr r4, =0x0203bc80 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 .pool 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, =0x03005d8c ldr r1, [r0] ldr r2, =0x000031dc adds r1, r2 ldr r2, =0x00000197 b @08161BC8 .align 2, 0 .pool @08161BBC: ldr r0, =0x03005d8c ldr r1, [r0] ldr r2, =0x000031dc adds r1, r2 movs r2, 0xCC lsls r2, 1 @08161BC8: strh r2, [r1, 0x8] adds r7, r0, 0 ldr r6, =0x02024744 ldr r0, [r7] ldr r5, =0x000031dc 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, =0x0203bc86 mov r0, r8 strb r0, [r4] bl GenerateRandomNumber ldr r5, =gUnknown_085CEC30 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 .pool thumb_func_end sub_8161B94 thumb_func_start sub_8161CBC sub_8161CBC: ; 8161CBC push {lr} bl sub_8161B34 bl sub_8161B60 ldr r0, =0x020375e0 ldrh r0, [r0] bl sub_8161B94 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc80 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, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x4] strb r1, [r0] ldrb r1, [r2, 0x5] strb r1, [r0, 0x1] bx lr .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r2, =0x000031dc adds r0, r2 ldrb r0, [r0, 0x13] cmp r0, 0 beq @08161D3E ldr r0, =0x0203bc86 strb r1, [r0] ldr r5, =gUnknown_085CEC30 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 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000031dc adds r0, r1 ldrb r0, [r0, 0x13] cmp r0, 0 beq @08161DE2 ldr r7, =0x0203bc86 ldr r3, =gUnknown_085CEC30 @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, =gUnknown_085CEC30 adds r5, r2, 0x1 ldr r4, =0x0203bc80 @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 .pool @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, =0x03005d8c ldr r0, [r0] ldr r3, =0x000031dc adds r0, r3 ldrb r0, [r0, 0x13] cmp r0, 0 beq @08161E20 ldr r0, =0x0203bc86 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 .pool @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, =0x02024744 bl zero_enemy_party_data ldr r4, =0x03005d8c ldr r0, [r4] ldr r1, =0x000031dc 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, =0x000031e9 adds r2, r0 adds r0, r5, 0 movs r1, 0x37 bl pokemon_setattr ldr r2, [r4] ldr r1, =0x000031e6 adds r2, r1 adds r0, r5, 0 movs r1, 0x39 bl pokemon_setattr ldr r2, [r4] ldr r0, =0x000031ea adds r2, r0 adds r0, r5, 0 movs r1, 0x16 bl pokemon_setattr ldr r2, [r4] ldr r1, =0x000031eb adds r2, r1 adds r0, r5, 0 movs r1, 0x17 bl pokemon_setattr ldr r2, [r4] ldr r0, =0x000031ec adds r2, r0 adds r0, r5, 0 movs r1, 0x18 bl pokemon_setattr ldr r2, [r4] ldr r1, =0x000031ed adds r2, r1 adds r0, r5, 0 movs r1, 0x21 bl pokemon_setattr ldr r2, [r4] ldr r0, =0x000031ee 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 .pool thumb_func_end sub_8161E28 thumb_func_start sub_8161EDC sub_8161EDC: ; 8161EDC push {lr} ldr r0, =0x03005d8c 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 .pool @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, =0x03005d8c ldr r1, [r5] ldr r4, =0x000031dc 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 .pool thumb_func_end sub_8161F18 thumb_func_start sub_8161F4C sub_8161F4C: ; 8161F4C ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000031dc adds r0, r1 movs r1, 0 strb r1, [r0, 0x13] bx lr .align 2, 0 .pool thumb_func_end sub_8161F4C thumb_func_start sub_8161F64 sub_8161F64: ; 8161F64 ldr r3, =0x0203bc86 ldrb r2, [r3] strb r2, [r0] ldrb r0, [r3, 0x1] strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8161F64 thumb_func_start sub_8161F74 sub_8161F74: ; 8161F74 push {lr} ldr r1, =gUnknown_085DF96C ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8161F74 thumb_func_start sub_8161F94 sub_8161F94: ; 8161F94 push {r4-r7,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r6, r0, 16 ldr r0, [r4] ldr r2, =0x00000ca8 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, =0x00000ca9 adds r1, r0 ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, [r4] ldr r2, =0x00000ca9 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, =0x00000cdc adds r3, r4, r0 ldr r2, =gUnknown_085DF9AC 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, =0x03005d8c 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, =0x02038bca strh r7, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8161F94 thumb_func_start sub_8162054 sub_8162054: ; 8162054 push {r4-r6,lr} ldr r5, =0x03005d90 ldr r0, [r5] ldr r4, =0x00000ca9 adds r0, r4 ldrb r0, [r0] lsls r0, 30 lsrs r6, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x020375e2 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 .pool @08162094: adds r0, r6, 0 lsls r1, 24 lsrs r1, 24 bl sub_8164FCC ldr r1, =0x020375f0 strh r0, [r1] b @081620E8 .align 2, 0 .pool @081620A8: ldr r4, =0x020375f0 ldr r2, [r5] ldr r0, =0x00000cdc adds r2, r0 ldr r3, =gUnknown_085DF9AC 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 .pool @081620D8: ldr r1, [r5] adds r0, r1, r4 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 ldr r2, =0x00000d07 adds r1, r2 strb r0, [r1] @081620E8: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8162054 thumb_func_start sub_81620F4 sub_81620F4: ; 81620F4 push {r4-r7,lr} ldr r6, =0x03005d90 ldr r0, [r6] ldr r7, =0x00000ca9 adds r0, r7 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x020375e2 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 .pool @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, =0x020375e4 ldrh r0, [r0] strh r0, [r2] b @081621B4 .align 2, 0 .pool @08162150: ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @08162180 ldr r2, [r6] ldr r0, =0x00000cdc adds r2, r0 ldr r3, =gUnknown_085DF9AC 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 .pool @08162180: ldr r2, [r6] ldr r1, =0x00000cdc adds r2, r1 ldr r3, =gUnknown_085DF9CC 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 .pool @081621A4: ldr r1, [r6] adds r0, r1, r7 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 ldr r2, =0x00000d07 adds r1, r2 strb r0, [r1] @081621B4: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81620F4 thumb_func_start sub_81621C0 sub_81621C0: ; 81621C0 push {r4,r5,lr} ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0xFA lsls r0, 1 cmp r1, r0 bne @081621DA ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bec adds r0, r1 bl sub_816534C @081621DA: ldr r5, =0x03005d90 ldr r0, [r5] ldr r1, =0x00000d04 adds r2, r0, r1 ldrh r1, [r2] ldr r0, =0x0000270e cmp r1, r0 bhi @081621EE adds r0, r1, 0x1 strh r0, [r2] @081621EE: ldr r1, [r5] ldr r4, =0x00000cb2 adds r1, r4 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] bl sub_8163E90 ldr r1, =0x020375f0 ldr r0, [r5] adds r0, r4 ldrh r0, [r0] strh r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 mov r10, r0 ldr r0, =0x000040ce bl var_get lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x2C] ldr r0, =0x000040cf 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, =0x03005d90 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, =0x03005d90 ldr r1, [r3] movs r0, 0x2C muls r0, r5 adds r0, r2 adds r1, r0 ldr r4, =0x0000076c 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, =gUnknown_085DF9F6 ldr r1, [sp, 0x2C] adds r0, r1, r0 ldrb r0, [r0] cmp r6, r0 blt @0816233E ldr r3, =0x03005d90 ldr r2, [r3] movs r4, 0xEC adds r3, r7, 0 muls r3, r4 adds r1, r2, r3 ldr r5, =0x0000073a 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, =0x03005d90 ldr r0, [r0] ldr r4, =gUnknown_085DF9EC 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 .pool @081623C0: ldr r4, =0x02038bca 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 .pool thumb_func_end sub_816222C thumb_func_start sub_81623F0 sub_81623F0: ; 81623F0 push {r4-r7,lr} ldr r6, =0x03005d90 ldr r0, [r6] ldr r1, =0x00000ca9 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 .pool @08162414: ldr r0, =0x000040ce 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, =0x00000cb2 adds r0, r1, r2 ldrh r3, [r0] ldr r2, =0x02038bca lsls r0, r3, 2 ldr r4, =0x00000cb4 adds r1, r4 adds r0, r1, r0 ldrh r0, [r0] strh r0, [r2] ldr r4, =0x02038bcc 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 .pool @08162488: bl sub_816222C lsls r0, 24 cmp r0, 0 beq @081624B4 ldr r4, =0x02038bca ldrh r0, [r4] movs r1, 0 bl sub_8162614 ldr r1, [r6] ldr r2, =0x00000cb2 adds r0, r1, r2 ldrh r0, [r0] lsls r0, 1 adds r2, 0x2 b @08162528 .align 2, 0 .pool @081624B4: lsls r7, r5, 24 adds r5, r6, 0 ldr r6, =0x00000cb2 @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, =0x00000cb4 adds r0, r1, r2 ldrh r0, [r0] cmp r0, r3 beq @081624FC ldr r0, =0x03005d90 ldr r1, [r0] subs r2, 0x2 adds r0, r1, r2 ldrh r2, [r0] ldr r0, =0x00000cb4 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, =0x00000cb2 adds r0, r1 ldrh r0, [r0] cmp r4, r0 bne @081624BA ldr r4, =0x02038bca strh r3, [r4] ldrh r0, [r4] movs r1, 0 bl sub_8162614 ldr r0, =0x03005d90 ldr r1, [r0] ldr r2, =0x00000cb2 adds r0, r1, r2 ldrh r2, [r0] adds r0, r2, 0x1 cmp r0, 0x6 bgt @08162530 lsls r0, r2, 1 ldr r2, =0x00000cb4 @08162528: adds r1, r2 adds r1, r0 ldrh r0, [r4] strh r0, [r1] @08162530: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085DFA1A 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 .pool @08162570: ldr r2, =gUnknown_085DF9FA 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 .pool @08162584: ldr r1, =gUnknown_085DF9FA 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 .pool 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, =gUnknown_085DFA1A lsls r2, r0, 2 b @081625D8 .align 2, 0 .pool @081625D4: ldr r1, =gUnknown_085DF9FA 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 .pool @081625F4: ldr r0, =gUnknown_085DF9FA 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bed adds r0, r1 b @081626BA .align 2, 0 .pool @08162640: ldr r0, =0x000003fe cmp r4, r0 bne @08162650 bl sub_81A4DD8 b @08162788 .align 2, 0 .pool @08162650: ldr r0, =0x0000012b cmp r4, r0 bhi @0816266C ldr r0, =0x0203bc88 ldr r1, [r0] movs r0, 0x34 muls r0, r4 adds r0, r1 b @081626BA .align 2, 0 .pool @0816266C: ldr r0, =0x0000018f cmp r4, r0 bhi @08162698 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 movs r1, 0xEC muls r1, r2 adds r0, r1 ldr r1, =0x00000739 adds r0, r1 b @081626BA .align 2, 0 .pool @08162698: ldr r3, =gUnknown_08610970 ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0xfffffe70 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, =gUnknown_085DCEDC 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, =gUnknown_085DCF0E 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 .pool @08162700: movs r1, 0 ldr r3, =gUnknown_085DCEFA 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, =gUnknown_085DCF2C 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, =0x00004010 bl var_set b @08162788 .align 2, 0 .pool @08162744: ldr r0, =0x00004011 bl var_set b @08162788 .align 2, 0 .pool @08162750: ldr r0, =0x0000401e bl var_set b @08162788 .align 2, 0 .pool @0816275C: cmp r5, 0x1 beq @08162770 cmp r5, 0x1 ble @08162768 cmp r5, 0xF beq @08162780 @08162768: ldr r0, =0x00004010 b @08162772 .align 2, 0 .pool @08162770: ldr r0, =0x00004011 @08162772: movs r1, 0x7 bl var_set b @08162788 .align 2, 0 .pool @08162780: ldr r0, =0x0000401e movs r1, 0x7 bl var_set @08162788: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bed adds r0, r1 b @08162836 .align 2, 0 .pool @081627CC: ldr r0, =0x0000012b cmp r4, r0 bhi @081627E8 ldr r0, =0x0203bc88 ldr r1, [r0] movs r0, 0x34 muls r0, r4 adds r0, r1 b @08162836 .align 2, 0 .pool @081627E8: ldr r0, =0x0000018f cmp r4, r0 bhi @08162814 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 movs r1, 0xEC muls r1, r2 adds r0, r1 ldr r1, =0x00000739 adds r0, r1 b @08162836 .align 2, 0 .pool @08162814: ldr r3, =gUnknown_08610970 ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0xfffffe70 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, =gUnknown_085DCEDC 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, =gUnknown_085DCF0E b @08162892 .align 2, 0 .pool @0816286C: movs r1, 0 ldr r3, =gUnknown_085DCEFA 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 .pool @08162890: ldr r0, =gUnknown_085DCF2C @08162892: adds r0, r1, r0 ldrb r0, [r0] @08162896: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d90 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, =0x00000744 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, =0x03005d90 ldr r0, [r7] adds r1, r3, r4 ldr r7, =0x00000744 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, =0x03005d90 ldr r0, [r1] ldr r3, =0x0000073c 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 .pool @08162930: adds r6, 0x1 cmp r6, 0x6 bgt @08162944 ldr r7, =0x03005d90 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, =0x03005d90 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 .pool @08162974: movs r5, 0 ldr r7, =0x03005d90 ldr r0, [r7] ldr r1, =0x0000073a 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, =0x03005d90 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 .pool @081629C4: mov r2, sp ldr r4, =0x03005d90 ldr r0, [r4] ldr r3, =0x0000073a 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, =0x03005d90 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 .pool @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, =0x03005d90 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, =0x03005d90 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 .pool 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, =gUnknown_0831F578 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000bed adds r0, r2 ldrb r0, [r0] adds r0, r1 b @08162BC8 .align 2, 0 .pool @08162AD0: ldr r0, =0x000003fe cmp r4, r0 bne @08162AE4 bl sub_81A4CB0 lsls r0, 24 lsrs r0, 24 b @08162BCA .align 2, 0 .pool @08162AE4: ldr r0, =0x0000012b cmp r4, r0 bhi @08162B08 ldr r2, =gUnknown_0831F578 ldr r0, =0x0203bc88 ldr r1, [r0] movs r0, 0x34 muls r0, r4 adds r0, r1 ldrb r0, [r0] adds r0, r2 b @08162BC8 .align 2, 0 .pool @08162B08: ldr r0, =0x0000018f cmp r4, r0 bhi @08162B64 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @08162B38 ldr r4, =gUnknown_0831F578 bl sub_818649C lsls r0, 24 lsrs r0, 24 adds r0, r4 b @08162BC8 .align 2, 0 .pool @08162B38: ldr r3, =gUnknown_0831F578 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 movs r1, 0xEC muls r1, r2 adds r0, r1 ldr r2, =0x00000739 adds r0, r2 ldrb r0, [r0] adds r0, r3 b @08162BC8 .align 2, 0 .pool @08162B64: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne @08162BB0 ldr r4, =gUnknown_0831F578 ldr r3, =gUnknown_08610970 ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0xfffffe70 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 .pool @08162BB0: ldr r5, =gUnknown_0831F578 ldr r4, =gUnknown_08610970 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 .pool 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, =gTrainerClassNameIndices ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000bed adds r0, r2 ldrb r0, [r0] b @08162C26 .align 2, 0 .pool @08162C08: ldr r0, =0x000003fe cmp r4, r0 bne @08162C1C bl sub_81A4D00 lsls r0, 24 lsrs r0, 24 b @08162D1E .align 2, 0 .pool @08162C1C: ldr r0, =0x00000c03 cmp r4, r0 bne @08162C38 ldr r0, =gTrainers ldr r1, =0x00007da1 @08162C26: adds r0, r1 ldrb r0, [r0] b @08162D1E .align 2, 0 .pool @08162C38: ldr r0, =0x0000012b cmp r4, r0 bhi @08162C60 ldr r2, =gTrainerClassNameIndices ldr r0, =0x0203bc88 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 .pool @08162C60: ldr r0, =0x0000018f cmp r4, r0 bhi @08162CBC ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @08162C90 ldr r4, =gTrainerClassNameIndices bl sub_818649C lsls r0, 24 lsrs r0, 24 adds r0, r4 ldrb r0, [r0] b @08162D1E .align 2, 0 .pool @08162C90: ldr r3, =gTrainerClassNameIndices ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 movs r1, 0xEC muls r1, r2 adds r0, r1 ldr r2, =0x00000739 adds r0, r2 ldrb r0, [r0] adds r0, r3 ldrb r0, [r0] b @08162D1E .align 2, 0 .pool @08162CBC: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @08162CF4 ldr r5, =gTrainerClassNameIndices ldr r4, =gUnknown_08610970 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 .pool @08162CF4: ldr r4, =gTrainerClassNameIndices ldr r3, =gUnknown_08610970 ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0xfffffe70 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bed adds r0, r1 b @08162E0A .align 2, 0 .pool @08162D5C: ldr r0, =0x0000012b cmp r4, r0 bhi @08162D78 ldr r0, =0x0203bc88 ldr r1, [r0] movs r0, 0x34 muls r0, r4 adds r0, r1 b @08162E0A .align 2, 0 .pool @08162D78: ldr r0, =0x0000018f cmp r4, r0 bhi @08162DC0 ldr r0, =0x02022fec 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 .pool @08162DA0: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 movs r1, 0xEC muls r1, r2 adds r0, r1 ldr r1, =0x00000739 adds r0, r1 b @08162E0A .align 2, 0 .pool @08162DC0: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 beq @08162DE8 ldr r4, =gUnknown_08610970 bl sub_81864A8 lsls r0, 24 lsrs r0, 24 movs r1, 0x58 muls r0, r1 adds r0, r4 b @08162E08 .align 2, 0 .pool @08162DE8: ldr r3, =gUnknown_08610970 ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0xfffffe70 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 .pool 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, =0x03005d90 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 .pool @08162E54: ldr r0, =0x000003fe cmp r5, r0 bne @08162E68 adds r0, r6, 0 bl sub_81A4D50 b @08162F62 .align 2, 0 .pool @08162E68: ldr r0, =0x00000c03 cmp r5, r0 bne @08162E88 ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 ; Steven's name @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 .pool @08162E88: ldr r0, =0x0000012b cmp r5, r0 bhi @08162EB4 ldr r0, =0x0203bc88 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 .pool @08162EB4: ldr r0, =0x0000018f cmp r5, r0 bhi @08162F00 ldr r0, =0x02022fec 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 .pool @08162ED8: ldr r2, =0x03005d90 movs r0, 0xEC adds r1, r5, 0 muls r1, r0 ldr r0, =0xfffef2a8 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 .pool @08162F00: ldr r0, =0x02022fec 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 .pool @08162F24: ldr r1, =0x03005d90 lsls r0, r5, 4 adds r0, r5 lsls r0, 2 ldr r2, =0xffff969c 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 .pool @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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bed adds r0, r1 b @0816300E .align 2, 0 .pool @08162F90: ldr r0, =0x000003fe cmp r4, r0 bne @08162FA4 bl sub_81A4DB8 lsls r0, 24 lsrs r0, 24 b @08163042 .align 2, 0 .pool @08162FA4: ldr r0, =0x0000012b cmp r4, r0 bhi @08162FC0 ldr r0, =0x0203bc88 ldr r1, [r0] movs r0, 0x34 muls r0, r4 adds r0, r1 b @0816300E .align 2, 0 .pool @08162FC0: ldr r0, =0x0000018f cmp r4, r0 bhi @08162FEC ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r4, r1 movs r1, 0xEC muls r1, r2 adds r0, r1 ldr r1, =0x00000739 adds r0, r1 b @0816300E .align 2, 0 .pool @08162FEC: ldr r3, =gUnknown_08610970 ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0xfffffe70 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, =gUnknown_085DCEFA 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 .pool @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, =0x02038bca ldrh r0, [r0] movs r1, 0 adds r2, r4, 0 bl sub_81630C4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038bca ldrh r0, [r0] movs r1, 0 adds r2, r4, 0 bl sub_81630C4 ldr r0, =0x02038bcc ldrh r0, [r0] movs r1, 0x3 adds r2, r4, 0 bl sub_81630C4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038bca ldrh r0, [r0] movs r1, 0 adds r2, r4, 0 bl sub_8165EA4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000012b cmp r5, r0 bhi @08163138 adds r0, r5, 0 bl sub_8165D08 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x24] ldr r0, =0x02038bca ldrh r2, [r0] ldr r0, =0x0203bc88 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, =0x0000ffff cmp r1, r0 bne @08163124 b @08163278 @08163124: b @08163260 .align 2, 0 .pool @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, =0x03005d90 @0816314C: movs r0, 0x64 muls r0, r7 ldr r1, =0x02024744 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 .pool @08163180: ldr r0, =0x000003fe cmp r5, r0 bne @08163190 bl sub_81A4E04 b @08163426 .align 2, 0 .pool @08163190: ldr r0, =0x0000018f 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, =0xfffffed4 adds r1, r5, r2 movs r0, 0xEC adds r2, r1, 0 muls r2, r0 mov r8, r2 muls r0, r5 ldr r5, =0xfffef2a8 adds r4, r0, r5 @081631B6: ldr r0, =0x03005d90 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, =0x0000076c 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, =0x02024744 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 .pool @08163218: ldr r7, [sp, 0x18] adds r0, r7, 0x3 cmp r7, r0 blt @08163222 b @08163426 @08163222: ldr r6, =0x03005d90 lsls r0, r5, 4 adds r0, r5 lsls r0, 2 ldr r1, =0xffff969c adds r5, r0, r1 movs r4, 0 @08163230: movs r0, 0x64 muls r0, r7 ldr r1, =0x02024744 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 .pool @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, =0x0000ffff 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, =0x00000351 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 .pool @081632D0: adds r6, 0x1 @081632D2: cmp r6, r8 bge @081632F6 movs r1, 0x64 adds r0, r6, 0 muls r0, r1 ldr r2, =0x02024744 adds r0, r2 movs r1, 0xB movs r2, 0 bl pokemon_getattr ldr r1, =0x0203bc8c 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, =gBattleFrontierHeldItems mov r9, r5 movs r3, 0 @08163308: ldr r0, =0x02024744 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, =0x0203bc8c 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, =0x02024744 adds r0, r2 ldr r5, =0x0203bc8c 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, =0x02024744 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, =0x02024744 adds r4, r6 adds r0, r4, 0 movs r1, 0x20 add r2, sp, 0x14 bl pokemon_setattr ldr r0, =0x0203bc8c ldr r0, [r0] add r0, r9 ldrb r2, [r0, 0xA] lsls r2, 1 ldr r0, =gBattleFrontierHeldItems 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 .pool 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, =0x03005d90 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, =0x00000ca9 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, =0x02024744 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, =0x02024744 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 .pool 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, =0x0203bc88 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 .pool @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, =0x0000ffff 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, =0x00000351 cmp r1, r0 bhi @0816355E @08163580: adds r0, r1, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8163524 thumb_func_start sub_8163590 sub_8163590: ; 8163590 push {lr} bl zero_enemy_party_data ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r1, [r0] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 beq @081635C0 ldr r0, =0x02038bca ldrh r0, [r0] movs r1, 0 bl sub_81635D4 b @081635CA .align 2, 0 .pool @081635C0: ldr r0, =0x02038bca ldrh r0, [r0] movs r1, 0 bl sub_816379C @081635CA: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000012b cmp r2, r0 bhi @0816364A ldr r4, =0x03005d90 ldr r0, =0x000040ce 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, =0x00000cb2 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 .pool @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, =0x03005d90 @0816365E: movs r0, 0x64 muls r0, r7 ldr r1, =0x02024744 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 .pool @08163694: ldr r0, =0x000003fe cmp r3, r0 bne @081636A4 bl sub_81A6CD0 b @08163776 .align 2, 0 .pool @081636A4: movs r0, 0x1F @081636A6: str r0, [sp, 0x18] bl sub_8165C40 lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x14] ldr r0, =0x03005d90 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, =0x03006298 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, =0x02024744 adds r0, r6, r1 ldr r3, =0x0203bc8c 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, =0x0203bc8c 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, =0x02024744 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, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x20 add r2, sp, 0xC bl pokemon_setattr ldr r1, =0x0203bc8c ldr r0, [r1] adds r0, r7, r0 ldrb r2, [r0, 0xA] lsls r2, 1 ldr r0, =gBattleFrontierHeldItems 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 .pool 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, =0x03005d90 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, =0x03006298 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, =0x02024744 adds r0, r6, r1 ldr r7, =0x0203bc8c 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, =0x0203bc8c ldr r0, [r1] adds r0, r5, r0 lsls r4, r7, 1 adds r0, 0x2 adds r0, r4 ldrh r1, [r0] ldr r2, =0x02024744 adds r0, r6, r2 adds r2, r7, 0 bl sub_81A7024 ldr r1, =0x0203bc8c 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, =0x02024744 adds r4, r7 adds r0, r4, 0 movs r1, 0x20 add r2, sp, 0xC bl pokemon_setattr ldr r1, =0x0203bc8c ldr r0, [r1] add r0, r8 ldrb r2, [r0, 0xA] lsls r2, 1 ldr r0, =gBattleFrontierHeldItems 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 .pool thumb_func_end sub_816379C thumb_func_start sub_81638AC sub_81638AC: ; 81638AC push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x02021fc4 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, =0x02021fc4 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 .pool thumb_func_end sub_81638AC thumb_func_start sub_8163914 sub_8163914: ; 8163914 push {lr} bl sub_8165C40 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0 beq @08163930 ldr r0, =0x02038bcc b @08163932 .align 2, 0 .pool @08163930: ldr r0, =0x02038bca @08163932: ldrh r3, [r0] movs r0, 0xFA lsls r0, 1 cmp r3, r0 bne @08163950 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bfc b @08163986 .align 2, 0 .pool @08163950: ldr r0, =0x0000012b cmp r3, r0 bhi @08163974 ldr r2, =0x0203bc88 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 .pool @08163974: ldr r0, =0x0000018f cmp r3, r0 bhi @0816399C ldr r1, =0x03005d90 movs r0, 0xEC muls r0, r3 ldr r1, [r1] adds r0, r1 ldr r1, =0xfffef2b8 @08163986: adds r0, r1 bl sub_81638AC b @081639A8 .align 2, 0 .pool @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, =0x02024474 adds r0, 0x26 ldrb r0, [r0] cmp r0, 0xA bhi @08163A78 lsls r0, 2 ldr r1, =@081639D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000ebc adds r1, r0, r2 ldr r2, [r1] ldr r0, =0x00fffffe 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 .pool @08163A2C: ldr r0, =0x00ffffff str r0, [r1] b @08163A78 .align 2, 0 .pool @08163A38: movs r5, 0 ldr r6, =0x03005d8c @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, =0x020244ec 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 .pool @08163A74: bl sub_816537C @08163A78: ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldr r1, =sub_81639AC str r1, [r0, 0x8] ldr r0, =sub_8036760 bl set_callback2 adds r0, r4, 0 bl remove_task @08163AB0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8163A8C thumb_func_start sub_8163AC4 sub_8163AC4: ; 8163AC4 push {r4-r6,lr} sub sp, 0x4 ldr r0, =0x02024474 ldr r2, =0x020375e0 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, =@08163AF0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022fec movs r0, 0x84 lsls r0, 1 str r0, [r5] ldr r0, =0x000040ce 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 .pool @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, =0x02038bce ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000cd6 adds r0, r2 ldrh r0, [r0] strh r0, [r1] ldrh r0, [r1] bl sub_8165404 ldr r0, [r5] ldr r1, =0x00408041 orrs r0, r1 str r0, [r5] b @08163BA6 .align 2, 0 .pool @08163B98: ldr r0, [r5] ldr r1, =0x00800043 orrs r0, r1 str r0, [r5] movs r0, 0x2 bl sub_816306C @08163BA6: ldr r0, =sub_8163A8C movs r1, 0x1 bl AddTask movs r0, 0 bl current_map_music_set__default_for_battle movs r0, 0 b @08163E10 .align 2, 0 .pool @08163BC0: movs r5, 0 ldr r6, =0x03005d8c @08163BC4: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec 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, =sub_8163A8C movs r1, 0x1 bl AddTask movs r0, 0 bl current_map_music_set__default_for_battle movs r0, 0xC b @08163E10 .align 2, 0 .pool @08163C10: bl zero_enemy_party_data movs r5, 0 ldr r4, =0x03005d90 @08163C18: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 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, =0x02022fec ldr r0, =0x00000808 str r0, [r1] ldr r1, =0x02038bca movs r0, 0 strh r0, [r1] ldr r0, =sub_8163A8C movs r1, 0x1 bl AddTask movs r0, 0 bl current_map_music_set__default_for_battle movs r0, 0xD b @08163E10 .align 2, 0 .pool @08163C70: ldr r4, =0x02022fec ldr r0, =0x00010008 str r0, [r4] ldr r0, =0x000040ce 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, =0x02038bca ldrh r1, [r0] ldr r0, =0x000003fe cmp r1, r0 bne @08163C9A movs r0, 0x2 bl sub_8163048 @08163C9A: ldr r0, =sub_8163A8C movs r1, 0x1 bl AddTask movs r0, 0 bl sub_806E694 movs r0, 0x3 b @08163E10 .align 2, 0 .pool @08163CC4: ldr r4, =0x02022fec ldr r0, =0x00020008 str r0, [r4] ldr r0, =0x000040ce 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, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000ca9 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 .pool @08163D0C: movs r0, 0x3 bl sub_81630A0 @08163D12: ldr r0, =sub_8163A8C movs r1, 0x1 bl AddTask movs r0, 0 bl current_map_music_set__default_for_battle movs r0, 0x4 b @08163E10 .align 2, 0 .pool @08163D28: ldr r1, =0x02022fec ldr r0, =0x00040008 str r0, [r1] ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 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 .pool @08163D58: movs r0, 0x3 bl sub_81630A0 @08163D5E: ldr r0, =sub_8163A8C movs r1, 0x1 bl AddTask movs r0, 0 bl current_map_music_set__default_for_battle movs r0, 0x5 b @08163E10 .align 2, 0 .pool @08163D74: ldr r4, =0x02022fec ldr r0, =0x00080008 str r0, [r4] ldr r0, =0x000040ce 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, =sub_8163A8C movs r1, 0x1 bl AddTask movs r0, 0 bl current_map_music_set__default_for_battle movs r0, 0x6 b @08163E10 .align 2, 0 .pool @08163DB4: ldr r1, =0x02022fec movs r0, 0x84 lsls r0, 1 str r0, [r1] movs r0, 0x3 bl sub_8163048 b @08163E00 .align 2, 0 .pool @08163DC8: ldr r1, =0x02022fec ldr r0, =0x00200008 str r0, [r1] movs r0, 0x3 bl sub_8163048 ldr r0, =sub_8163A8C movs r1, 0x1 bl AddTask movs r0, 0 bl current_map_music_set__default_for_battle movs r0, 0xA b @08163E10 .align 2, 0 .pool @08163DF4: ldr r1, =0x02022fec ldr r0, =0x00008109 str r0, [r1] movs r0, 0x1 bl sub_816306C @08163E00: ldr r0, =sub_8163A8C 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 .pool @08163E2C: ldr r1, =0x02022fec ldr r0, =0x00408049 str r0, [r1] ldr r5, =0x00000c03 adds r0, r5, 0 bl sub_8165404 ldr r4, =0x02038bfc movs r0, 0 strb r0, [r4] ldr r0, =gUnknown_08224158 bl battle_configure_by_script movs r0, 0x1 strb r0, [r4] ldr r0, =gUnknown_08224167 bl battle_configure_by_script ldr r0, =0x02038bce strh r5, [r0] ldr r0, =sub_8163A8C 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 .pool thumb_func_end sub_8163AC4 thumb_func_start sub_8163E90 sub_8163E90: ; 8163E90 push {r4-r6,lr} ldr r6, =0x03005d90 ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 ldrb r5, [r0] lsls r5, 30 lsrs r5, 30 ldr r0, =0x000040ce 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 .pool 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, =0x03005d90 ldr r0, [r4] ldr r1, =0x0000064c adds r5, r0, r1 adds r0, r5, 0 bl sub_8164FB8 ldr r0, [r4] ldr r2, =0x00000ca9 adds r0, r2 ldrb r0, [r0] lsls r0, 30 lsrs r6, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 24 lsrs r7, r0, 24 ldr r2, [r4] ldrb r0, [r2, 0x8] cmp r0, 0 beq @08163F40 ldr r4, =gUnknown_085DCEFA 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 .pool @08163F40: ldr r4, =gUnknown_085DCEDC 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, =0x03005d90 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, =0x03005d8c ldr r1, [r0] ldr r7, =0x00002bbc 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, =0x00002bd4 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, =0x03005d90 ldr r0, [r6] lsls r1, r4, 1 ldr r2, =0x00000caa 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, =0x02024488 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, =gUnknown_82E9531 ldrb r0, [r0] mov r7, r8 strb r0, [r7] ldr r0, [r6] ldr r1, =0x0000064c 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 .pool thumb_func_end sub_8163EE4 thumb_func_start sub_8164040 sub_8164040: ; 8164040 push {r4,r5,lr} ldr r5, =0x03005d90 ldr r0, [r5] ldr r1, =0x00000ca9 adds r0, r1 ldrb r4, [r0] lsls r4, 30 lsrs r4, 30 ldr r0, =0x000040ce 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, =0x020375e2 ldrh r0, [r0] cmp r0, 0 bne @0816408E cmp r1, 0x1 bgt @0816408A ldr r1, =0x00000cb2 adds r0, r5, r1 ldrh r0, [r0] cmp r0, 0 beq @0816408E @0816408A: bl sub_8163EE4 @0816408E: ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool 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, =0x020244ec 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, =0x03005d90 ldr r1, [r0] ldr r0, =0xfffffe70 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, =0x03006298 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 .pool 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, =0x03005d90 ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 str r0, [sp, 0xC] ldr r4, =0x020244ec 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, =0xfffffed4 adds r5, r0 ldr r6, =0x0000076c 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, =0x03006298 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 .pool 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, =0x03005d8c ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 adds r1, r0, r1 str r1, [sp, 0x24] ldr r5, =0x03005d90 ldr r0, [r5] ldr r2, =0x00000ca9 adds r0, r2 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 str r0, [sp, 0x14] ldr r0, =0x000040ce 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, =0x020244ec 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, =0x00000cb4 adds r1, r0, r3 ldrh r0, [r1] cmp r0, r8 beq @08164368 ldr r0, =0x0203bc88 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, =0x00000cb4 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, =0x03005d90 ldr r0, [r1] mov r2, r9 lsls r1, r2, 1 ldr r3, =0x00000cb4 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, =0x03005d90 ldr r0, [r3] ldr r4, =0x00000cb4 adds r0, r4 ldr r1, [sp, 0x28] adds r0, r1 ldrh r2, [r0] ldr r0, =0x0203bc8c 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, =0x03005d90 ldr r0, [r2] ldr r1, =0x0203bc8c ldr r3, [r1] lsls r1, r6, 4 adds r1, r3 ldr r4, =0x00000cc4 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, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000cb4 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, =0x03005d90 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, =gUnknown_085DF9EC 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, =0x03005d90 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, =0x03005d90 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, =0x03005d90 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, =0x03005d90 ldr r5, [r0] movs r1, 0xEC mov r6, r9 muls r6, r1 adds r4, r5, r6 ldr r1, =0x0000073a 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, =0x03005d90 mov r8, r2 ldr r3, =0x0000076c @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 .pool @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, =0x03005d90 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, =0x00000cc2 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, =0x00000361 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 .pool 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, =0x0203bc8c 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 .pool @081646FC: ldr r0, =0x0000018f cmp r5, r0 bhi @08164750 ldr r0, =0x03005d90 ldr r3, [r0] ldr r1, =0x03006298 ldr r0, =0x020375e2 ldrh r0, [r0] adds r0, 0x1 lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x2C muls r1, r0 ldr r0, =0xfffffed4 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, =0x0000076c adds r3, r2 ldrh r3, [r3] mov r10, r3 b @081647CE .align 2, 0 .pool @08164750: ldr r4, =0x03005d90 ldr r3, [r4] ldr r1, =0x03006298 ldr r0, =0x020375e2 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, =0xfffffe70 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, =0x02021ec4 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, =0x03005d90 ldr r2, [r0] ldr r0, =0xfffffe70 adds r1, r5, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, r0 ldr r1, =0x0000011b adds r0, r2, r1 ldrb r1, [r0] adds r0, r7, 0 bl sub_8009308 @081647CE: ldr r0, =0x02021cc4 movs r1, 0xD mov r2, r9 muls r2, r1 adds r1, r2, 0 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r0, =0x02021dc4 movs r1, 0xB mov r2, r10 muls r2, r1 adds r1, r2, 0 ldr r2, =gSpeciesNames 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 .pool 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, =0x020375f2 ldrh r0, [r0] subs r5, r0, 0x2 ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r5, 1 ldr r2, =0x00000cb4 adds r0, r2 adds r0, r1 ldrh r7, [r0] movs r3, 0 str r3, [sp] ldr r4, =gUnknown_085DD500 lsls r6, r7, 16 b @08164884 .align 2, 0 .pool @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, =0x020375e2 ldrh r0, [r0] cmp r0, 0x4 bls @081648A4 b @08164AC2 @081648A4: lsls r0, 2 ldr r1, =@081648B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0000018f cmp r7, r0 bgt @081648F4 @081648E2: ldr r0, =0x02021cc4 adds r1, r7, 0 bl sub_8162E20 b @08164AC2 .align 2, 0 .pool @081648F4: movs r3, 0 lsls r2, r7, 16 mov r10, r2 ldr r6, =0x02021cc4 mov r9, r6 ldr r4, =0x03005d90 mov r8, r4 ldr r5, =0xfffffe70 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, =0x03005d90 ldr r1, [r2] ldr r3, =0xfffffe70 adds r0, r7, r3 lsls r4, r0, 4 adds r4, r0 lsls r4, 2 adds r1, r4 ldr r5, =0x0000011b adds r0, r1, r5 ldrb r1, [r0] adds r0, r6, 0 bl sub_8009308 ldr r0, =0x02021dc4 ldr r2, =0x03005d90 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, =0x02021ec4 mov r3, r10 lsrs r1, r3, 16 bl sub_8162E20 b @08164AC2 .align 2, 0 .pool @08164984: ldr r0, =0x03005d90 ldr r1, [r0] lsls r0, r5, 2 adds r1, r0 ldr r4, =0x00000cc4 adds r1, r4 b @081649A8 .align 2, 0 .pool @0816499C: ldr r0, =0x03005d90 ldr r1, [r0] lsls r0, r5, 2 adds r1, r0 ldr r5, =0x00000cc6 adds r1, r5 @081649A8: adds r0, r7, 0 ldrh r1, [r1] bl sub_81646BC b @08164AC2 .align 2, 0 .pool @081649BC: ldr r0, =0x02038bce strh r7, [r0] ldr r0, =0x0000012b cmp r7, r0 bgt @08164A08 ldr r0, =0x03005d90 ldr r4, [r0] lsls r1, r5, 1 adds r0, r1, 0 adds r0, 0x8 lsls r0, 1 ldr r3, =0x00000cb4 adds r2, r4, r3 adds r0, r2, r0 ldrh r3, [r0] ldr r5, =0x00000cd8 adds r0, r4, r5 strh r3, [r0] adds r1, 0x9 lsls r1, 1 adds r2, r1 ldrh r0, [r2] ldr r1, =0x00000cda adds r4, r1 strh r0, [r4] b @08164A46 .align 2, 0 .pool @08164A08: ldr r0, =0x0000018f cmp r7, r0 bgt @08164A30 ldr r0, =0x03005d90 ldr r1, [r0] ldr r3, =0x03006298 ldrh r2, [r3, 0x4] ldr r4, =0x00000cd8 adds r0, r1, r4 strh r2, [r0] ldrh r0, [r3, 0x6] b @08164A40 .align 2, 0 .pool @08164A30: ldr r0, =0x03005d90 ldr r1, [r0] ldr r3, =0x03006298 ldrh r2, [r3] ldr r4, =0x00000cd8 adds r0, r1, r4 strh r2, [r0] ldrh r0, [r3, 0x2] @08164A40: ldr r5, =0x00000cda 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, =0x02038bce ldrh r0, [r0] cmp r0, r3 beq @08164A60 movs r2, 0 cmp r2, r5 bge @08164AA2 ldr r1, =0x03005d90 ldr r0, [r1] ldr r4, =0x00000cb4 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, =0x03005d90 ldr r0, [r5] ldr r1, =0x00000cb4 adds r0, r1 add r0, r10 strh r3, [r0] mov r5, r9 cmp r5, 0xD ble @08164A4E ldr r2, =0x03005d90 ldr r0, [r2] ldr r3, =0x00000cd6 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, =gUnknown_085DD500 ldr r4, [sp] lsls r1, r4, 3 b @08164B04 .align 2, 0 .pool @08164AF8: ldr r0, =0x0000018f cmp r7, r0 bgt @08164B28 ldr r0, =gUnknown_085DD500 ldr r5, [sp] lsls r1, r5, 3 @08164B04: adds r0, 0x4 adds r1, r0 ldr r0, =0x020375e2 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 .pool @08164B28: ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0xfffffe70 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, =gUnknown_085DD690 lsrs r0, 25 adds r0, r1 ldr r1, =0x020375e2 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 .pool 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, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r7, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r0, [r4] ldr r2, =0x00000cb2 adds r0, r2 ldrh r6, [r0] bl link_get_multiplayer_id ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0x6 bls @08164BAC b @08164DB6 @08164BAC: lsls r0, 2 ldr r1, =@08164BD0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d90 ldr r0, [r0] lsls r1, r7, 1 adds r0, r1 ldr r3, =0x00000cec 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, =0x020375f0 movs r0, 0x1 b @08164DB4 .align 2, 0 .pool @08164C3C: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 beq @08164C4A b @08164DB6 @08164C4A: bl sub_800A5B4 ldr r1, =0x020223c4 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, =0x03005d90 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, =0x00000cb4 adds r0, r1 ldrh r0, [r0] cmp r0, r3 beq @08164CB0 ldr r6, =0x03005d90 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, =0x00000cb4 adds r0, r2 adds r0, r1 strh r3, [r0] mov r4, r8 cmp r4, 0xD ble @08164C68 ldr r1, =0x020375f0 movs r0, 0x2 b @08164DB4 .align 2, 0 .pool @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, =0x03005d90 ldr r1, [r1] ldr r3, =0x00000cb4 adds r1, r3 movs r2, 0x28 bl link_0800A448 ldr r1, =0x020375f0 movs r0, 0x3 b @08164DB4 .align 2, 0 .pool @08164D14: bl sub_800A550 movs r1, 0x3 ands r1, r0 cmp r1, 0x3 bne @08164DB6 bl sub_800A5B4 ldr r4, =0x03005d90 ldr r0, [r4] ldr r5, =0x00000cb4 adds r0, r5 ldr r1, =0x020223c4 movs r2, 0x28 bl memcpy ldr r2, =0x02038bca ldr r1, [r4] lsls r0, r6, 2 adds r1, r5 adds r0, r1, r0 ldrh r0, [r0] strh r0, [r2] ldr r4, =0x02038bcc 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, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @08164DB0 ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 bne @08164DB0 ldr r1, =0x020375f0 movs r0, 0x4 b @08164DB4 .align 2, 0 .pool @08164D98: bl sub_800AC34 ldr r1, =0x020375f0 movs r0, 0x5 b @08164DB4 .align 2, 0 .pool @08164DA8: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @08164DB6 @08164DB0: ldr r1, =0x020375f0 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 .pool thumb_func_end sub_8164B74 thumb_func_start sub_8164DCC sub_8164DCC: ; 8164DCC push {lr} ldr r0, =0x030030fc ldrb r0, [r0] cmp r0, 0 beq @08164DDA bl sub_800AC34 @08164DDA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8164DCC thumb_func_start sub_8164DE4 sub_8164DE4: ; 8164DE4 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cd6 adds r0, r1 ldrh r0, [r0] movs r1, 0xF bl sub_8162614 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8164DE4 thumb_func_start sub_8164E04 sub_8164E04: ; 8164E04 push {r4-r6,lr} sub sp, 0x20 ldr r0, =0x000040ce bl var_get lsls r0, 16 cmp r0, 0 bne @08164E9A ldr r5, =0x02038bca ldrh r1, [r5] mov r0, sp bl sub_8162E20 mov r0, sp bl sub_8009370 ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000bd8 adds r0, r1 mov r1, sp bl gf_strcpy ldr r0, [r4] ldr r2, =0x00000beb adds r0, r2 ldrh r1, [r5] bl sub_8165B88 ldr r6, =0x0202406e ldrh r0, [r6, 0x2] movs r5, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr ldr r1, [r4] ldr r2, =0x00000bd6 adds r1, r2 strh r0, [r1] ldrh r0, [r6] muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr ldr r1, [r4] ldr r2, =0x00000bd4 adds r1, r2 strh r0, [r1] movs r2, 0 movs r5, 0xBE lsls r5, 4 ldr r3, =0x020240b4 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, =0x0202433a ldrb r1, [r1] ldr r2, =0x00000d06 adds r0, r2 strb r1, [r0] @08164E9A: add sp, 0x20 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8164E04 thumb_func_start sub_8164ED8 sub_8164ED8: ; 8164ED8 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x03005d90 ldr r0, [r0] movs r3, 0 movs r2, 0 ldr r4, =0x0000064c adds r1, r0, r4 @08164EEA: ldm r1!, {r0} adds r3, r0 adds r2, 0x1 cmp r2, 0x39 bls @08164EEA ldr r5, =0x03005d90 ldr r1, [r5] ldr r2, =0x00000734 adds r0, r1, r2 ldr r0, [r0] cmp r0, r3 beq @08164F0A ldr r3, =0x0000064c 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 .pool 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, =0x03005d90 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, =0x0000270f cmp r0, r1 bls @08164FEE adds r0, r1, 0 @08164FEE: pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085DFA42 mov r0, sp movs r2, 0x4 bl memcpy cmp r4, 0x3 bls @0816501C movs r0, 0x3 b @08165022 .align 2, 0 .pool @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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 adds r5, r0, 0 ldr r0, =0x000040ce 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, =0x020375f0 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, =0x03005d8c mov r5, sp @0816508C: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r6, 1 ldr r2, =0x00000caa 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, =0x020375f0 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, =0x03005d8c 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 .pool 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, =0x03005d90 ldr r2, [r1] ldr r0, =0x00000bec adds r7, r2, r0 ldrb r0, [r2, 0x8] adds r5, r1, 0 cmp r0, 0 beq @08165194 ldr r4, =gUnknown_085DCEFA 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 .pool @08165194: ldr r4, =gUnknown_085DCEDC 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, =0x03005d8c mov r8, r0 adds r5, r7, 0 adds r5, 0x10 ldr r1, =0x00002bbc 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, =0x020244ec 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 .pool thumb_func_end sub_816515C thumb_func_start sub_8165244 sub_8165244: ; 8165244 ldr r1, =gUnknown_0831F578 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000bed adds r0, r2 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8165244 thumb_func_start sub_8165264 sub_8165264: ; 8165264 ldr r1, =gTrainerClassNameIndices ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000bed adds r0, r2 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x03005d90 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 .pool thumb_func_end sub_8165284 thumb_func_start sub_81652B4 sub_81652B4: ; 81652B4 push {r4-r6,lr} ldr r2, =0x020375f0 movs r0, 0 strh r0, [r2] ldr r1, =0x03005d90 ldr r0, [r1] ldr r3, =0x00000bec 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 .pool @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, =0x00000ca4 adds r0, r1, r2 ldr r0, [r0] cmp r0, r4 beq @08165316 ldr r3, =0x00000bec adds r0, r1, r3 bl sub_816534C ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] @08165316: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bfc adds r0, r1 bl sub_81638AC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8165360 thumb_func_start sub_816537C sub_816537C: ; 816537C push {lr} ldr r0, =0x0202433a ldrb r0, [r0] cmp r0, 0x3 bne @08165398 ldr r1, =0x02021fc4 movs r0, 0xFF strb r0, [r1] b @081653C0 .align 2, 0 .pool @08165398: cmp r0, 0x1 bne @081653B4 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000c14 adds r0, r1 bl sub_81638AC b @081653C0 .align 2, 0 .pool @081653B4: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000c08 adds r0, r1 bl sub_81638AC @081653C0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816537C thumb_func_start start_menu_compose_normal start_menu_compose_normal: ; 81653CC push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca8 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 .pool 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, =0x00000c03 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, =gUnknown_085DD6D0 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, =0x0000ef2a adds r1, r4, 0 bl sub_806EBD0 lsls r0, 24 lsrs r7, r0, 24 cmp r7, 0 bne @08165440 ldr r0, [sp, 0x44] bl GetNatureFromPersonality 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, =0x02024618 mov r8, r1 adds r0, r6, r1 mov r5, r9 add r5, r10 lsls r5, 2 ldr r2, =gUnknown_085DD6D0 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, =0x0000ef2a str r4, [sp, 0xC] mov r3, r12 bl create_pokemon_set_level str r7, [sp, 0x44] movs r3, 0 mov r4, r8 ldr r0, =gUnknown_085DD6D5 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, =gUnknown_085DD6DC ldr r6, =0x02024618 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, =0x02024618 adds r4, r0 adds r0, r4, 0 movs r1, 0x7 ldr r2, =gTrainers + TRAINER_STEVEN * 0x28 + 0x4 ; Steven's name 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 .pool @0816554C: movs r0, 0xFA lsls r0, 1 cmp r7, r0 bne @08165564 add r0, sp, 0x10 ldr r1, =gUnknown_82E9531 ldrb r1, [r1] strb r1, [r0] b @0816585A .align 2, 0 .pool @08165564: ldr r0, =0x0000012b 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, =0x03005d90 ldr r1, [r0] mov r0, r10 adds r0, 0x12 lsls r0, 1 ldr r2, =0x00000cb4 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, =0x02024618 mov r9, r0 mov r0, r8 add r0, r9 ldr r6, =0x0203bc8c 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, =0x02024618 adds r4, r0 adds r0, r4, 0 movs r1, 0x20 ldr r2, [sp, 0x5C] bl pokemon_setattr ldr r0, =0x0203bc8c ldr r1, [r0] ldr r2, [sp, 0x54] lsls r0, r2, 4 adds r0, r1 ldrb r2, [r0, 0xA] lsls r2, 1 ldr r0, =gBattleFrontierHeldItems 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, =0x0203bc88 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, =0x02024618 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 .pool @081656E8: ldr r0, =0x0000018f cmp r7, r0 bls @081656F0 b @081657F0 @081656F0: ldr r1, =0xfffffed4 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, =0x000015fc mov r9, r6 ldr r0, =0x0000ffff mov r8, r0 movs r1, 0x24 str r1, [sp, 0x6C] @08165710: ldr r1, =0x03005d90 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, =0x00000cb4 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 .pool @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, =0x02024618 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 .pool @081657F0: ldr r1, =0xfffffe70 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, =0x03005d90 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, =0x02024618 adds r4, r0 mov r1, r8 ldr r0, [r1] adds r1, r0, r6 ldr r2, =0x00000cb4 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 .pool 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, =gUnknown_085DCF40 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 .pool @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, =gUnknown_085DFA46 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, =gUnknown_085DFA52 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, =0x0500000b 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 .pool 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, =gUnknown_085DCF40 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 .pool @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, =0x03005d90 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 .pool 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, =gUnknown_82E9531 b @08165C28 .align 2, 0 .pool @08165BA4: ldr r0, =0x0000012b cmp r2, r0 bhi @08165BB8 ldr r0, =gUnknown_82E9531 b @08165C28 .align 2, 0 .pool @08165BB8: ldr r0, =0x0000018f cmp r2, r0 bhi @08165BFC ldr r0, =0x02022fec 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 .pool @08165BDC: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0xfffffed4 adds r2, r1 movs r1, 0xEC muls r1, r2 adds r0, r1 ldr r1, =0x0000081c adds r0, r1 b @08165C28 .align 2, 0 .pool @08165BFC: ldr r0, =0x02022fec 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 .pool @08165C14: ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0xfffffe70 adds r1, r3, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, r0 ldr r1, =0x0000011b adds r0, r2, r1 @08165C28: ldrb r0, [r0] @08165C2A: strb r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8165B88 thumb_func_start sub_8165C40 sub_8165C40: ; 8165C40 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r2, r0, r1 ldrb r1, [r2] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 beq @08165C84 ldr r1, =0x0203bc88 ldr r0, =gBattleFrontierTrainers str r0, [r1] ldr r1, =0x0203bc8c ldr r0, =gBattleFrontierMons str r0, [r1] ldrb r0, [r2] lsls r0, 30 lsrs r0, 30 bl sub_8165C90 b @08165C88 .align 2, 0 .pool @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, =0x020244ec 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 .pool 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, =0x000040cf 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 .pool @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, =0x000040cf bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x4 bne @08165DA8 ldr r1, =0x0203bc88 ldr r0, =gSlateportBattleTentTrainers str r0, [r1] ldr r1, =0x0203bc8c ldr r0, =gSlateportBattleTentMons b @08165DF2 .align 2, 0 .pool @08165DA8: cmp r0, 0x2 bne @08165DC8 ldr r1, =0x0203bc88 ldr r0, =gVerdanturfBattleTentTrainers str r0, [r1] ldr r1, =0x0203bc8c ldr r0, =gVerdanturfBattleTentMons b @08165DF2 .align 2, 0 .pool @08165DC8: cmp r0, 0x3 bne @08165DE8 ldr r1, =0x0203bc88 ldr r0, =gFallarborBattleTentTrainers str r0, [r1] ldr r1, =0x0203bc8c ldr r0, =gFallarborBattleTentMons b @08165DF2 .align 2, 0 .pool @08165DE8: ldr r1, =0x0203bc88 ldr r0, =gBattleFrontierTrainers str r0, [r1] ldr r1, =0x0203bc8c ldr r0, =gBattleFrontierMons @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 .pool thumb_func_end sub_8165D78 thumb_func_start sub_8165E18 sub_8165E18: ; 8165E18 push {r4,r5,lr} ldr r5, =0x03005d90 @08165E1C: bl sub_8165D40 lsls r0, 16 lsrs r4, r0, 16 movs r3, 0 ldr r1, [r5] ldr r2, =0x00000cb2 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, =0x03005d90 ldr r1, [r0] subs r2, 0x2 adds r0, r1, r2 ldrh r2, [r0] ldr r0, =0x00000cb4 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, =0x00000cb2 adds r0, r1 ldrh r0, [r0] cmp r3, r0 bne @08165E1C ldr r5, =0x02038bca strh r4, [r5] ldrh r0, [r5] movs r1, 0 bl sub_8162614 ldr r0, =0x03005d90 ldr r1, [r0] ldr r2, =0x00000cb2 adds r0, r1, r2 ldrh r2, [r0] adds r0, r2, 0x1 cmp r0, 0x2 bgt @08165E8C lsls r0, r2, 1 ldr r2, =0x00000cb4 adds r1, r2 adds r1, r0 ldrh r0, [r5] strh r0, [r1] @08165E8C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02038bca ldrh r2, [r0] ldr r0, =0x0203bc88 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 .pool @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, =0x0000ffff 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 .pool @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, =0x02024744 adds r0, r2 movs r1, 0xB movs r2, 0 bl pokemon_getattr ldr r1, =0x0203bc8c 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, =gBattleFrontierHeldItems mov r9, r0 movs r3, 0 @08165F7A: ldr r1, =0x02024744 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, =0x0203bc8c 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, =0x02024744 adds r0, r1 ldr r5, =0x0203bc8c 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, =0x02024744 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, =0x02024744 adds r4, r6 adds r0, r4, 0 movs r1, 0x20 add r2, sp, 0x14 bl pokemon_setattr ldr r0, =0x0203bc8c ldr r0, [r0] add r0, r9 ldrb r2, [r0, 0xA] lsls r2, 1 ldr r0, =gBattleFrontierHeldItems 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 .pool 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, =gUnknown_085DCEDC 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, =gUnknown_085DCF0E b @08166116 .align 2, 0 .pool @081660EC: movs r1, 0 ldr r3, =gUnknown_085DCEFA 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 .pool @08166114: ldr r0, =gUnknown_085DCF2C @08166116: adds r0, r1, r0 ldrb r0, [r0] @0816611A: pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d90 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 .pool @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, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 beq @081661E8 bl sub_8165C40 lsls r0, 24 movs r5, 0 ldr r7, =gBaseStats lsrs r0, 22 ldr r1, =gExperienceTables adds r6, r0, r1 @081661A6: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x02024744 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 .pool 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, =0x0203bcac ldr r0, =0x0000806c bl malloc_and_clear str r0, [r4] ldr r1, =0x0203bc90 ldr r2, =0x00007fd0 adds r0, r2 str r0, [r1] str r5, [r0, 0x8] str r6, [r0, 0x4] ldr r0, =sub_8166380 bl launch_c3_walk_stairs_and_run_once ldr r0, =sub_816631C bl set_callback2 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8166204 thumb_func_start sub_816624C sub_816624C: ; 816624C push {r4,r5,lr} ldr r4, =0x0203bcac ldr r0, =0x0000806c bl malloc_and_clear str r0, [r4] ldr r5, =0x0203bc90 ldr r1, =0x00007fd0 adds r0, r1 str r0, [r5] ldr r1, =0x0203bc98 ldr r1, [r1] str r1, [r0, 0x8] ldr r1, =0x0203bc94 ldr r1, [r1] str r1, [r0, 0x4] ldr r4, =0x0203bc9c 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, =sub_8166380 bl launch_c3_walk_stairs_and_run_once ldr r0, =sub_81662C0 bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816624C thumb_func_start sub_81662C0 sub_81662C0: ; 81662C0 push {r4,lr} ldr r4, =0x0203bc90 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, =map_warp_consider_1_to_outside_or_stair_or_dive cmp r1, r0 bne @081662F0 adds r0, r4, 0 adds r0, 0x50 movs r1, 0 strb r1, [r0] ldr r0, =sub_8166304 bl set_callback2 @081662F0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc90 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 .pool 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, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007c58 adds r0, r1 bl sub_81D2108 bl sub_80BA0A8 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc90 ldr r1, [r1] str r0, [r1] adds r1, 0x50 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x0203bc90 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, =@081663A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203bcac ldr r0, [r2] ldr r1, =0x00007b10 adds r0, r1 movs r1, 0xFF strb r1, [r0] ldr r0, [r2] ldr r2, =0x00007c58 adds r0, r2 bl sub_81D1ED4 b @0816653C .align 2, 0 .pool @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, =0x05006000 mov r0, sp bl CpuSet b @0816653C .align 2, 0 .pool @08166434: movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_085DFCCC movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r0, =gUnknown_085DFCDC bl Window_InitFromTemplates bl TextBox_ResetSomeField movs r0, 0 movs r1, 0x97 movs r2, 0xE0 bl sub_809882C b @0816653C .align 2, 0 .pool @08166464: ldr r1, [r2] b @08166540 @08166468: bl sub_8168328 lsls r0, 24 cmp r0, 0 bne @08166556 b @0816653C @08166474: ldr r1, =0x030022b0 movs r0, 0x14 strh r0, [r1] bl sub_8167420 b @0816653C .align 2, 0 .pool @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, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007b0e adds r0, r1 bl sub_81D312C lsls r0, 24 cmp r0, 0 bne @08166556 b @0816653C .align 2, 0 .pool @081664B8: ldr r1, [r2] b @08166540 @081664BC: ldr r5, =0x0203bcac ldr r1, [r5] ldr r4, =0x00007c58 adds r0, r1, r4 ldr r2, =0x00007c6c adds r1, r2 bl sub_81D2754 ldr r0, [r5] adds r0, r4 bl sub_81D20AC b @0816653C .align 2, 0 .pool @081664E4: ldr r4, =0x0203bcac ldr r0, [r4] ldr r1, =0x00007c58 adds r0, r1 bl sub_81D20BC lsls r0, 24 cmp r0, 0 bne @08166556 ldr r2, [r4] ldr r1, =0x00007c58 adds r0, r2, r1 adds r1, 0x14 adds r2, r1 adds r1, r2, 0 bl sub_81D1F84 b @0816653C .align 2, 0 .pool @08166510: ldr r0, =0x0203bcac ldr r0, [r0] ldr r2, =0x00007c58 adds r0, r2 bl sub_81D2230 b @0816653C .align 2, 0 .pool @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, =0x0203bc90 ldr r1, [r0] @08166540: adds r1, 0x50 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08166556 .align 2, 0 .pool @08166550: ldr r0, =map_warp_consider_1_to_outside_or_stair_or_dive bl launch_c3_walk_stairs_and_run_once @08166556: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc90 ldr r0, [r4] adds r0, 0x50 ldrb r1, [r0] cmp r1, 0 beq @08166580 cmp r1, 0x1 beq @081665C0 b @08166610 .align 2, 0 .pool @08166580: movs r0, 0x1 negs r0, r0 str r1, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =sub_8166340 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 .pool @081665C0: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08166610 ldr r4, =0x0203bcac ldr r0, [r4] ldr r1, =0x00007b1c adds r0, r1 bl sub_81D3464 ldr r4, [r4] ldr r2, =0x00008041 adds r0, r4, r2 ldrb r1, [r0] ldr r3, =0x00008040 adds r0, r4, r3 ldrb r0, [r0] subs r0, 0x1 cmp r1, r0 beq @0816660A ldr r1, =0x00007fb3 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, =0x00007b1c adds r0, r4, r3 subs r3, 0xC adds r1, r4, r3 ldrb r1, [r1] bl sub_81D3480 @0816660A: ldr r0, =sub_8166634 bl launch_c3_walk_stairs_and_run_once @08166610: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 ldrb r0, [r0] cmp r0, 0x7 bls @08166644 b @0816680E @08166644: lsls r0, 2 ldr r1, =@08166658 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08166658: .4byte @08166678 .4byte @0816675C .4byte @0816680E .4byte @08166788 .4byte @0816680E .4byte @08166794 .4byte @081667AC .4byte @081667F4 @08166678: ldr r2, =0x030022c0 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, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007b1c adds r0, r1 bl sub_81D3520 ldr r0, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 movs r1, 0x1 b @0816680C .align 2, 0 .pool @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, =0x0203bcac ldr r0, [r0] ldr r2, =0x00007b1c adds r0, r2 bl sub_81D3520 ldr r0, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 movs r1, 0x1 b @0816680C .align 2, 0 .pool @081666F0: ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08166710 movs r0, 0x5 bl audio_play ldr r0, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 movs r1, 0x3 b @0816680C .align 2, 0 .pool @08166710: movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @0816671A b @0816680E @0816671A: movs r0, 0x5 bl audio_play ldr r0, =0x0203bcac ldr r0, [r0] ldr r2, =0x00008041 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, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 movs r1, 0x3 b @0816680C .align 2, 0 .pool @0816674C: ldr r0, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 movs r1, 0x5 b @0816680C .align 2, 0 .pool @0816675C: ldr r0, =0x0203bcac ldr r0, [r0] ldr r1, =0x00008044 adds r0, r1 ldr r0, [r0] bl _call_via_r0 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @0816680E ldr r0, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 b @0816680C .align 2, 0 .pool @08166788: ldr r0, =sub_8166BEC bl launch_c3_walk_stairs_and_run_once b @0816680E .align 2, 0 .pool @08166794: bl sub_8166D44 ldr r0, =0x0203bc90 ldr r1, [r0] adds r1, 0x50 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0816680E .align 2, 0 .pool @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, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 movs r1, 0x7 b @0816680C .align 2, 0 .pool @081667E8: ldr r0, =sub_816681C bl launch_c3_walk_stairs_and_run_once b @0816680E .align 2, 0 .pool @081667F4: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @0816680E bl sub_8166F94 @08166804: ldr r0, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 movs r1, 0 @0816680C: strb r1, [r0] @0816680E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8166634 thumb_func_start sub_816681C sub_816681C: ; 816681C push {r4,r5,lr} sub sp, 0x4 ldr r5, =0x0203bc90 ldr r0, [r5] adds r0, 0x50 ldrb r4, [r0] cmp r4, 0 beq @08166838 cmp r4, 0x1 beq @08166888 b @081668D4 .align 2, 0 .pool @08166838: ldr r0, =0x0203bcac ldr r0, [r0] ldr r1, =0x00008041 adds r0, r1 ldrb r0, [r0] bl sub_81672A4 ldr r1, =0x0203bc9c strb r0, [r1] ldr r1, =0x0203bc94 ldr r2, [r5] ldr r0, [r2, 0x4] str r0, [r1] ldr r1, =0x0203bc98 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 .pool @08166888: ldr r0, =0x02037fd4 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, =0x0203bca0 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203bca4 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203bca8 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203bcac ldr r0, [r4] bl free str r5, [r4] bl Window_FreeMemory ldr r1, =0x030022c0 ldr r0, =sub_816624C str r0, [r1, 0x8] bl sub_8179D70 @081668D4: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816681C thumb_func_start sub_81668F8 sub_81668F8: ; 81668F8 push {r4,lr} sub sp, 0x4 ldr r1, =0x0203bc90 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, =@08166920 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08166920: .4byte @0816693C .4byte @08166972 .4byte @08166A18 .4byte @081669A0 .4byte @081669AE .4byte @081669C8 .4byte @081669F4 @0816693C: ldr r0, =0x0203bcac ldr r0, [r0] ldr r1, =0x00008041 adds r0, r1 ldr r1, =0x0203bc9c 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 .pool @08166968: ldr r0, [r4] adds r0, 0x50 movs r1, 0x3 strb r1, [r0] b @08166A18 @08166972: ldr r0, =0x0203bcac ldr r0, [r0] ldr r1, =0x00008044 adds r0, r1 ldr r0, [r0] bl _call_via_r0 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @08166A18 ldr r0, =0x0203bc90 ldr r0, [r0] adds r0, 0x50 strb r1, [r0] b @08166A18 .align 2, 0 .pool @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, =sub_8166340 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, =0x0203bc90 ldr r1, [r0] @081669E2: adds r1, 0x50 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08166A18 .align 2, 0 .pool @081669F4: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08166A18 ldr r0, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007b1c adds r0, r1 bl sub_81D3464 ldr r0, =sub_8166A34 bl launch_c3_walk_stairs_and_run_once ldr r0, =sub_816631C bl set_callback2 @08166A18: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81668F8 thumb_func_start sub_8166A34 sub_8166A34: ; 8166A34 push {r4-r6,lr} ldr r1, =0x0203bc90 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, =@08166A58 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08166A58: .4byte @08166A70 .4byte @08166AAC .4byte @08166AC0 .4byte @08166B14 .4byte @08166B94 .4byte @08166BB6 @08166A70: ldr r4, [r5] ldr r3, =0x020244ec str r3, [r4, 0xC] ldr r0, =0x0203bcac ldr r0, [r0] ldr r2, =0x00008041 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, =0x00007b1c adds r0, r3 bl sub_81D3520 b @08166BAA .align 2, 0 .pool @08166AAC: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @08166ABA b @08166BDA @08166ABA: b @08166BAA .align 2, 0 .pool @08166AC0: bl sub_8167104 ldr r6, =0x0203bc90 ldr r0, [r6] adds r0, 0x5C ldr r4, =0x0203bcac ldr r1, [r4] ldr r5, =0x00007ca8 adds r1, r5 bl sub_81D2754 ldr r2, [r4] ldr r4, =0x00007c58 adds r0, r2, r4 ldr r3, =0x00007fb3 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 .pool @08166B14: ldr r5, =0x0203bcac ldr r0, [r5] ldr r1, =0x00007c58 adds r0, r1 bl sub_81D2074 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 bne @08166BDA ldr r0, [r5] ldr r4, =0x00008041 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, =0x00008040 adds r0, r3, r2 ldrb r0, [r0] subs r0, 0x1 cmp r1, r0 beq @08166B6C ldr r4, =0x00007fb3 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, =0x00007b1c adds r0, r3, r4 subs r4, 0xC adds r1, r3, r4 ldrb r1, [r1] bl sub_81D3480 @08166B6C: ldr r1, =0x0203bc90 ldr r0, [r1] adds r0, 0x52 strb r6, [r0] ldr r1, [r1] b @08166BAC .align 2, 0 .pool @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, =0x030022c0 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, =0x0203ce7c ldrb r0, [r0] bl sub_8136F68 ldr r0, =sub_8166BEC bl launch_c3_walk_stairs_and_run_once @08166BDA: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8166A34 thumb_func_start sub_8166BEC sub_8166BEC: ; 8166BEC push {r4-r6,lr} sub sp, 0x4 ldr r4, =0x0203bc90 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 .pool @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, =0x02037fd4 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 .pool @08166C40: ldr r1, =0x02039b28 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 .pool @08166C5C: ldr r0, [r0, 0x4] bl set_callback2 ldr r0, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007b1c adds r0, r1 bl sub_81D354C movs r4, 0 @08166C70: ldr r5, =0x0203bcac ldr r0, [r5] ldr r2, =0x00007b06 adds r0, r2 adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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, =0x00007b44 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, =0x0203bcac ldr r0, [r6] ldr r2, =0x00007b10 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, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles @08166CE6: movs r0, 0 bl SetVBlankCallback ldr r4, =0x0203bca0 ldr r0, [r4] bl free movs r5, 0 str r5, [r4] ldr r4, =0x0203bca4 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203bca8 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 .pool thumb_func_end sub_8166BEC thumb_func_start sub_8166D44 sub_8166D44: ; 8166D44 push {r4,lr} sub sp, 0x4C ldr r0, =0x0203bcac ldr r0, [r0] ldr r1, =0x00008041 adds r0, r1 ldrb r0, [r0] bl sub_81672A4 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r0, r1 ldr r1, =0x020244ec 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, =gUnknown_085EC7A0 add r0, sp, 0xC bl gf_strcat ldr r4, =0x02021fc4 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, =gUnknown_085DFCFC movs r1, 0x97 movs r2, 0xE movs r3, 0 bl sub_81996C0 add sp, 0x4C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc90 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, =0x02021fc4 ldrb r1, [r1] adds r2, 0x61 adds r2, r1 ldrb r2, [r2] bl sub_8166FD4 b @08166EB8 .align 2, 0 .pool @08166EA8: ldr r0, =0x02021fc4 ldr r1, =0x0203bc90 ldr r1, [r1] adds r1, 0x53 ldrb r1, [r1] movs r2, 0 bl sub_8166FD4 @08166EB8: ldr r0, =0x02021fc4 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 .pool 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, =0x0203bc90 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 .pool @08166F18: strb r4, [r1] movs r0, 0 b @08166F44 @08166F1E: ldr r4, =0x02021fc4 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 .pool 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, =gUnknown_085EC800 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 .pool 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, =0x02021fc4 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 .pool 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, =gUnknown_085DFD04 lsls r0, r3, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 bl gf_strcpy ldr r1, =gUnknown_085EC7E1 adds r0, r4, 0 bl gf_strcat b @08167018 .align 2, 0 .pool @08167010: ldr r1, =gUnknown_085EC7EF adds r0, r4, 0 bl gf_strcpy @08167018: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085DFCB0 @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 .pool 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, =gUnknown_085DFCB0 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, =0x0203bc90 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 .pool thumb_func_end sub_8167054 thumb_func_start sub_8167104 sub_8167104: ; 8167104 push {r4,r5,lr} ldr r5, =0x020244ec ldr r0, =0x0203bcac ldr r1, [r0] ldr r2, =0x00008041 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 2 adds r1, r0 ldr r0, =0x00007fb9 adds r1, r0 ldrb r1, [r1] movs r0, 0x64 muls r0, r1 adds r5, r0, r5 ldr r4, =0x0203bc90 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 .pool 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, =0x0203bc90 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, =0x0203bc9e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 ble @081671D4 movs r0, 0x1 b @081671DA .align 2, 0 .pool @081671D4: cmp r0, 0 bge @08167250 movs r0, 0xFF @081671DA: movs r2, 0 lsls r0, 24 mov r9, r0 ldr r0, =0x0203bc90 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, =gUnknown_085DFCC4 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 .pool thumb_func_end sub_8167184 thumb_func_start sub_8167268 sub_8167268: ; 8167268 push {lr} ldr r0, =0x0203bcac ldr r1, [r0] ldr r2, =0x00008041 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 .pool @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, =0x020244ec 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 .pool @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, =0x020244ec 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 .pool 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, =gUnknown_085DFD18 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_085DFD20 bl gpu_pal_obj_alloc_tag_and_apply ldr r2, =0x0203bc90 ldr r0, [r2] adds r0, 0x54 movs r1, 0 strb r1, [r0] movs r4, 0 adds r5, r2, 0 ldr r6, =gUnknown_085DFD28 adds r0, r6, 0x2 mov r8, r0 ldr r7, =0x0202064c @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, =gUnknown_085DFD5C 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, =sub_81673DC 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 .pool 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, =0x0203bc90 ldr r1, [r0] adds r1, 0x54 ldrb r0, [r1] subs r0, 0x1 strb r0, [r1] @08167418: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcac b @08167472 .align 2, 0 .pool @08167430: movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec 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, =0x00007fb8 adds r1, r0 movs r0, 0xE strb r0, [r1] ldr r0, [r6] adds r0, r2 ldr r1, =0x00007fb9 adds r0, r1 strb r4, [r0] ldr r0, [r6] adds r0, r2 ldr r2, =0x00007fba 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, =0x0203bcac ldr r0, [r2] ldr r1, =0x00008041 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r2] adds r1, r5, 0x1 ldr r2, =0x00008040 adds r0, r2 strb r1, [r0] bl sub_81674BC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8167420 thumb_func_start sub_81674BC sub_81674BC: ; 81674BC push {r4,r5,lr} ldr r4, =0x0203bcac ldr r0, [r4] ldr r5, =0x00008041 adds r0, r5 ldrb r0, [r0] movs r1, 0 bl sub_816753C ldr r0, [r4] ldr r1, =0x00007fb3 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r4] ldr r2, =0x00007fb4 adds r0, r2 movs r1, 0x1 strb r1, [r0] ldr r0, [r4] ldr r1, =0x00007fb5 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 .pool 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, =0x0203bcac mov r9, r0 ldr r1, [r0] lsls r5, 16 asrs r0, r5, 14 adds r0, r1, r0 ldr r3, =0x00007fb8 adds r2, r0, r3 ldrb r7, [r2] ldr r2, =0x00007fb9 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, =0x00007b4d adds r0, r2 adds r0, r1, r0 lsls r2, r4, 6 ldr r3, =0x00007b95 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, =0x00007c58 adds r0, r1, r2 ldr r3, =0x00007fb0 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 .pool 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, =0x0203bcac ldr r3, [r1] ldr r0, =0x00007b10 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, =0x00007b12 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, =0x00007b14 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, =0x00007b10 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 .pool @081676AC: ldr r0, [r7] add r0, r8 strb r1, [r0] ldr r4, =0x02020630 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, =sub_8168168 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, =0x00007b18 adds r1, r2, r3 subs r3, 0x4 adds r0, r2, r3 ldrh r0, [r0] lsls r0, 5 ldr r3, =0x06010000 adds r0, r3 str r0, [r1] ldr r0, =0x00007b12 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 .pool @08167714: lsls r1, r6, 13 movs r0, 0xC1 lsls r0, 2 adds r1, r0 adds r1, r3, r1 ldr r2, =0x00007b18 adds r0, r3, r2 ldr r2, [r0] ldr r0, =0x040000d4 str r1, [r0] str r2, [r0, 0x4] ldr r1, =0x80000400 str r1, [r0, 0x8] ldr r0, [r0, 0x8] lsls r0, r6, 7 adds r0, 0x4 adds r0, r3, r0 ldr r2, =0x00007b12 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 .pool 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, =0x0203bcac ldr r0, [r1] ldr r2, =0x00008040 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, =0x02020630 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, =0x00007b06 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, =sub_8168180 str r1, [r0] b @08167808 .align 2, 0 .pool @081677FC: ldr r0, [r5] ldr r1, =0x00007b06 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, =0x00008040 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, =0x0203bcac ldr r7, =0x02020630 @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, =0x00007b06 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 .pool @08167874: ldr r0, [r5] ldr r2, =0x00007b06 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, =sub_81681B4 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, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007b06 adds r0, r1 adds r0, r4 strb r3, [r0] ldr r0, =0x02020630 lsls r2, r3, 4 adds r2, r3 lsls r2, 2 adds r2, r0 ldrb r3, [r2, 0x1] movs r1, 0x3F adds r0, r1, 0 ands r0, r3 movs r3, 0x40 orrs r0, r3 strb r0, [r2, 0x1] ldrb r0, [r2, 0x3] ands r1, r0 movs r0, 0x80 orrs r1, r0 strb r1, [r2, 0x3] b @08167902 .align 2, 0 .pool @081678F4: ldr r0, =0x0203bcac ldr r0, [r0] ldr r2, =0x00007b06 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 .pool thumb_func_end sub_8167760 thumb_func_start sub_8167930 sub_8167930: ; 8167930 push {r4,r5,lr} sub sp, 0x8 ldr r0, =0x0203bcac ldr r0, [r0] ldr r2, =0x00008048 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xB bls @08167944 b @08167B78 @08167944: lsls r0, 2 ldr r1, =@0816795C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00007040 movs r0, 0 bl lcd_io_set movs r1, 0x91 lsls r1, 2 movs r0, 0x50 bl lcd_io_set ldr r1, =0x0000040b movs r0, 0x52 bl lcd_io_set b @08167B7E .align 2, 0 .pool @08167A04: ldr r4, =0x0203bca4 movs r0, 0xD0 lsls r0, 5 bl malloc str r0, [r4] ldr r5, =0x0203bca0 movs r4, 0xA0 lsls r4, 3 adds r0, r4, 0 bl malloc str r0, [r5] ldr r5, =0x0203bca8 adds r0, r4, 0 bl malloc str r0, [r5] b @08167B7E .align 2, 0 .pool @08167A38: ldr r0, =gUnknown_085DFB60 ldr r1, =0x0203bca8 b @08167AA0 .align 2, 0 .pool @08167A48: ldr r1, =gUnknown_085DFA80 movs r0, 0x3 movs r2, 0xE0 movs r3, 0 bl gpu_copy_bg_tile_pattern_data_to_vram b @08167B7E .align 2, 0 .pool @08167A5C: ldr r0, =0x0203bca8 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 .pool @08167A74: ldr r0, =gUnknown_085DFA60 movs r1, 0xD0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007b0e adds r0, r1 ldr r1, =0x0000ffb0 strh r1, [r0] b @08167B7E .align 2, 0 .pool @08167A9C: ldr r0, =gUnknown_08DCCF7C ldr r1, =0x0203bca4 @08167AA0: ldr r1, [r1] bl LZ77UnCompVram b @08167B7E .align 2, 0 .pool @08167AB0: ldr r0, =gUnknown_08DCD81C ldr r1, =0x0203bca0 ldr r1, [r1] bl LZ77UnCompVram ldr r0, =gUnknown_08DCCF5C movs r1, 0x20 movs r2, 0x20 bl gpu_pal_apply b @08167B7E .align 2, 0 .pool @08167AD4: ldr r0, =0x0203bca4 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 .pool @08167AEC: ldr r0, =0x0203bca0 ldr r1, [r0] movs r0, 0x1 bl bg_set_tilemap ldr r1, =gUnknown_08DCDA30 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 .pool @08167B1C: ldr r0, =gUnknown_085DFC0C ldr r1, =0x0203bcac ldr r1, [r1] ldr r2, =0x00007304 adds r1, r2 bl LZ77UnCompVram b @08167B7E .align 2, 0 .pool @08167B38: ldr r0, =0x0203bcac ldr r1, [r0] ldr r0, =0x00007304 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, =gUnknown_086231E8 movs r1, 0x30 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_08623208 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply movs r0, 0x2 bl sub_81D21DC b @08167B7E .align 2, 0 .pool @08167B78: movs r0, 0 strb r0, [r1] b @08167B8E @08167B7E: ldr r0, =0x0203bcac ldr r1, [r0] ldr r2, =0x00008048 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 .pool 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, =0x0203bcac ldr r3, [r7] ldr r1, =0x00008041 adds r0, r3, r1 ldrb r1, [r0] ldr r2, =0x00008040 adds r0, r3, r2 ldrb r0, [r0] subs r0, 0x1 cmp r1, r0 beq @08167C46 lsls r2, r4, 6 ldr r0, =0x00007b95 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, =0x00008041 adds r0, r1 ldrb r0, [r0] bl sub_81672A4 lsls r0, 24 lsrs r0, 24 movs r1, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 bl GetNature adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, [r7] ldr r6, =0x0000804a adds r0, r6 ldr r1, =gUnknown_085EBF8D bl gf_strcpy ldr r1, =gNatureNamePointers lsls r4, 2 adds r4, r1 ldr r1, [r4] bl gf_strcpy ldr r0, =gUnknown_085DFCC9 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 .pool @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, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007fb5 adds r0, r1 b @08167CC8 .align 2, 0 .pool @08167CC0: ldr r0, =0x0203bcac ldr r0, [r0] ldr r2, =0x00007fb4 adds r0, r2 @08167CC8: ldrb r0, [r0] lsls r0, 24 asrs r0, 24 lsls r0, 16 lsrs r6, r0, 16 ldr r5, =0x0203bcac ldr r2, [r5] ldr r3, =0x00007c58 adds r0, r2, r3 ldr r4, =0x00007fb3 adds r1, r2, r4 movs r3, 0 ldrsb r3, [r1, r3] lsls r1, r3, 2 adds r1, r3 lsls r1, 2 ldr r4, =0x00007c6c 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, =0x00008041 adds r0, r4, r1 ldrb r1, [r0] ldr r2, =0x00008040 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, =0x00007fb4 adds r0, r4, r3 ldrb r1, [r0] subs r2, 0x8B adds r0, r4, r2 strb r1, [r0] ldr r0, [r5] ldr r4, =0x00007fb3 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, =0x00007fb6 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, =0x00008041 adds r1, r0 strb r2, [r1] ldr r1, =0x0203bcac ldr r3, [r1] adds r0, r3, r0 ldrb r0, [r0] adds r6, r1, 0 cmp r0, 0 bne @08167D74 ldr r1, =0x00008040 adds r0, r3, r1 ldrb r0, [r0] @08167D74: subs r1, r0, 0x1 b @08167E1E .align 2, 0 .pool @08167D98: ldr r3, =0x00007fb5 adds r0, r4, r3 ldrb r1, [r0] ldr r2, =0x00007fb4 adds r0, r4, r2 strb r1, [r0] ldr r0, [r5] ldr r4, =0x00007fb3 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, =0x00007fb6 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 .pool @08167DEC: movs r3, 0 @08167DEE: ldr r1, =0x00008041 adds r0, r2, r1 strb r3, [r0] ldr r2, =0x0203bcac ldr r3, [r2] adds r1, r3, r1 ldrb r1, [r1] ldr r4, =0x00008040 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 .pool @08167E1C: movs r1, 0 @08167E1E: ldr r2, =0x00007b4c adds r0, r3, r2 strb r1, [r0] adds r5, r6, 0 ldr r0, [r5] ldr r3, =0x00008041 adds r1, r0, r3 ldrb r2, [r1] ldr r4, =0x00008040 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, =0x00007b1c adds r0, r1 bl sub_81D3520 mov r2, r8 cmp r2, 0 bne @08167E70 ldr r0, [r5] ldr r3, =0x00008044 adds r0, r3 ldr r1, =sub_8167EA4 b @08167E90 .align 2, 0 .pool @08167E70: cmp r4, 0 bne @08167E88 ldr r0, [r5] ldr r4, =0x00008044 adds r0, r4 ldr r1, =sub_8167FA4 b @08167E90 .align 2, 0 .pool @08167E88: ldr r0, [r6] ldr r1, =0x00008044 adds r0, r1 ldr r1, =sub_8168048 @08167E90: str r1, [r0] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8167CA0 thumb_func_start sub_8167EA4 sub_8167EA4: ; 8167EA4 push {r4-r6,lr} ldr r4, =0x0203bcac ldr r1, [r4] ldr r5, =0x00008048 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 .pool @08167EC8: cmp r0, 0x2 beq @08167F08 cmp r0, 0x3 beq @08167F48 b @08167F9C @08167ED2: ldr r2, =0x00007fb3 adds r0, r1, r2 ldrb r0, [r0] bl sub_8167608 b @08167F2C .align 2, 0 .pool @08167EE4: ldr r6, =0x00007fb3 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, =0x00008048 adds r1, r0 b @08167F30 .align 2, 0 .pool @08167F08: ldr r2, =0x00007c58 adds r0, r1, r2 ldr r6, =0x00007b0e adds r1, r6 bl sub_81D3178 lsls r0, 24 cmp r0, 0 bne @08167F9C ldr r1, [r4] ldr r2, =0x00007b4c adds r0, r1, r2 ldrb r0, [r0] ldr r6, =0x00007fb6 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 .pool @08167F48: ldr r2, =0x00007b1c adds r0, r1, r2 bl sub_81D3464 ldr r3, [r4] ldr r6, =0x00008041 adds r0, r3, r6 ldrb r1, [r0] ldr r2, =0x00008040 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, =0x00007b1c 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 .pool @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, =0x0203bcac ldr r1, [r4] ldr r5, =0x00008048 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 .pool @08167FC8: cmp r0, 0x2 beq @08168014 cmp r0, 0x3 beq @08168038 b @0816803E @08167FD2: ldr r2, =0x00007c58 adds r0, r1, r2 ldr r2, =0x00007b0e adds r1, r2 bl sub_81D31A4 lsls r0, 24 cmp r0, 0 bne @0816803E b @08168024 .align 2, 0 .pool @08167FF0: ldr r2, =0x00007fb3 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, =0x00008048 adds r1, r0 b @08168028 .align 2, 0 .pool @08168014: ldr r2, =0x00007b4c adds r0, r1, r2 ldrb r0, [r0] ldr r2, =0x00007fb6 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 .pool @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, =0x0203bcac ldr r1, [r4] ldr r5, =0x00008048 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 .pool @0816806C: cmp r0, 0x2 beq @081680CC cmp r0, 0x3 beq @0816810C b @08168160 @08168076: ldr r2, =0x00007c58 adds r0, r1, r2 bl sub_81D2074 ldr r0, [r4] ldr r6, =0x00007b0e adds r0, r6 bl sub_81D3150 lsls r0, 24 cmp r0, 0 bne @08168160 ldr r0, [r4] ldr r1, =0x00007fb3 adds r0, r1 ldrb r0, [r0] bl sub_8167608 b @081680F0 .align 2, 0 .pool @081680A8: ldr r2, =0x00007fb3 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, =0x00008048 adds r1, r6 b @081680F4 .align 2, 0 .pool @081680CC: ldr r2, =0x00007c58 adds r0, r1, r2 ldr r6, =0x00007b0e adds r1, r6 bl sub_81D3178 lsls r0, 24 cmp r0, 0 bne @08168160 ldr r1, [r4] ldr r2, =0x00007b4c adds r0, r1, r2 ldrb r0, [r0] ldr r6, =0x00007fb6 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 .pool @0816810C: ldr r2, =0x00007b1c adds r0, r1, r2 bl sub_81D3464 ldr r3, [r4] ldr r6, =0x00008041 adds r0, r3, r6 ldrb r1, [r0] ldr r2, =0x00008040 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, =0x00007b1c 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 .pool @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, =0x0203bcac ldr r1, [r1] ldr r2, =0x00007b0e adds r1, r2 ldrh r1, [r1] adds r1, 0x26 strh r1, [r0, 0x20] bx lr .align 2, 0 .pool 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, =0x0203bcac ldr r0, [r0] ldr r3, =0x00008041 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 .pool @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, =0x0203bcac ldr r0, [r0] ldr r2, =0x00008041 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 .pool @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, =0x020244ec adds r0, r1 movs r1, 0x30 bl pokemon_getattr lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x0203bcac ldr r0, [r0] ldr r3, =0x00007fb3 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 .pool @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, =gUnknown_085DFDB8 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x8] str r1, [sp, 0xC] ldr r0, =gUnknown_08DCCBB8 str r0, [sp] ldr r1, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r1 movs r1, 0x80 lsls r1, 4 orrs r0, r1 ldr r1, =0x0000ffff ands r0, r1 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 .pool 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, =0x0203bcac ldr r0, [r0] ldr r1, =0x00007b44 adds r7, r0, r1 ldr r0, =gUnknown_085DFDA0 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, =0x02020630 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 .pool thumb_func_end sub_8168294 thumb_func_start sub_8168328 sub_8168328: ; 8168328 push {r4,r5,lr} ldr r4, =0x0203bcac ldr r0, [r4] ldr r5, =0x00008048 adds r0, r5 ldrb r0, [r0] cmp r0, 0 beq @08168348 cmp r0, 0x1 beq @08168360 b @0816836C .align 2, 0 .pool @08168348: bl sub_8168248 ldr r1, [r4] ldr r0, =0x00008048 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r0, 0x1 b @0816836E .align 2, 0 .pool @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, =nullsub_12 str r0, [r2, 0x1C] @081683A8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl2 str r1, [r0] ldr r2, =0x0202449c 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 .pool 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, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08168440 ldr r0, =0x02023064 lsls r1, r3, 9 adds r1, r0 ldrb r0, [r1] cmp r0, 0x38 bhi @0816843C ldr r0, =gUnknown_085DFDC0 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 b @08168440 .align 2, 0 .pool @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, =0x0202449c 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, =@08168468 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08168590 bl dp01_tbl5_exec_completed @08168590: pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244b9 ldrb r0, [r0] cmp r0, 0 bne @081685CA bl dp01_tbl5_exec_completed @081685CA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_wait_t5 thumb_func_start sub_81685D4 sub_81685D4: ; 81685D4 push {lr} ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081685FC ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8168610 str r1, [r0] bl nullsub_35 bl Window_FreeMemory bl sub_81ADD70 @081685FC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81685D4 thumb_func_start sub_8168610 sub_8168610: ; 8168610 push {lr} ldr r0, =0x030022c0 ldr r1, [r0, 0x4] ldr r0, =sub_8038420 cmp r1, r0 bne @08168636 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08168636 ldr r0, =0x0203ce7c 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 .pool thumb_func_end sub_8168610 thumb_func_start sub_816864C sub_816864C: ; 816864C push {r4-r7,lr} mov r7, r8 push {r7} ldr r4, =0x020244d0 ldr r0, [r4] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r7, 0x88 adds r0, r7, 0 ands r0, r1 cmp r0, 0 bne @08168684 ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @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, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @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, =0x02020630 mov r8, r0 ldr r7, =0x03005d7c 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, =nullsub_12 cmp r3, r0 bne @081687DC ldr r0, =0x020241e4 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, =0x02022fec 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, =0x03005d70 ldrb r0, [r5] adds r1, r6, 0 eors r1, r0 adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [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, =0x03005d7c ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldr r5, =0x03005d70 ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r4] bl sub_8076918 ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 ldr r0, =0x020244d0 ldr r0, [r0] ldr r2, [r0, 0x8] ldrb r1, [r2, 0x9] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8168818 str r1, [r0] @081687DC: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r0, =0x03005d70 ldr r1, =0x02024064 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, =nullsub_12 cmp r1, r0 bne @08168842 movs r4, 0x1 @08168842: cmp r4, 0 beq @08168904 ldr r7, =0x020244d0 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, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag ldr r0, =c3_0802FDF4 movs r1, 0xA bl AddTask ldr r2, =0x0202406e mov r0, r8 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 bl dp01_tbl5_exec_completed @08168904: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8168818 thumb_func_start sub_8168934 sub_8168934: ; 8168934 push {r4-r6,lr} ldr r5, =0x02024064 ldrb r0, [r5] ldr r6, =0x03005d70 adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] bl sub_80729D0 lsls r4, 16 asrs r1, r4, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0816897C ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] movs r2, 0 bl heathbar_draw_hp b @08168996 .align 2, 0 .pool @0816897C: ldr r2, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 bl dp01_tbl5_exec_completed @08168996: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8168934 thumb_func_start bx_blink_t5 bx_blink_t5: ; 81689A4 push {r4,lr} ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r2 movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x20 bne @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, =0x020244b9 strb r3, [r0] bl dp01_tbl5_exec_completed b @08168A1A .align 2, 0 .pool @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, =0x020244d0 ldr r0, [r0] ldr r6, =0x02024064 ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08168A74 ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 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 .pool thumb_func_end sub_8168A20 thumb_func_start sub_8168A90 sub_8168A90: ; 8168A90 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08168AB4 bl dp01_tbl5_exec_completed @08168AB4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8168A90 thumb_func_start sub_8168AC8 sub_8168AC8: ; 8168AC8 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @08168AEA bl dp01_tbl5_exec_completed @08168AEA: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl2 str r1, [r0] ldr r0, =0x02022fec 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, =0x02023064 ldrb r0, [r4] lsls r0, 9 adds r0, r1 movs r1, 0x38 strb r1, [r0] b @08168B5E .align 2, 0 .pool @08168B4C: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] @08168B5E: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_tbl5_exec_completed thumb_func_start sub_8168B70 sub_8168B70: ; 8168B70 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @08168B92 bl dp01_tbl5_exec_completed @08168B92: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @08168BD8 ldr r0, =0x0202406e 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 .pool @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, =0x02023064 ldr r3, =0x02024064 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, =@08168C54 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 add r0, sp, 0x24 mov r9, r0 movs r1, 0x3B add r1, sp mov r10, r1 mov r2, sp adds r2, 0x2B str r2, [sp, 0x80] mov r0, sp adds r0, 0x2A str r0, [sp, 0x7C] mov r1, sp adds r1, 0x68 str r1, [sp, 0x8C] adds r2, 0x5 str r2, [sp, 0x84] adds r0, 0x12 str r0, [sp, 0x88] mov r8, r4 add r4, sp, 0xC @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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_getattr mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 bl pokemon_getattr ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr mov r3, sp movs r5, 0x1F ands r0, r5 ldrb r2, [r3, 0x14] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr mov r3, sp movs r6, 0x1F ands r0, r6 lsls r0, 5 ldrh r2, [r3, 0x14] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 2 ldrb r2, [r3, 0x15] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [sp, 0x14] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr mov r3, sp ands r0, r6 lsls r0, 4 ldrh r2, [r3, 0x16] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 1 ldrb r2, [r3, 0x17] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C bl pokemon_getattr mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D bl pokemon_getattr mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E bl pokemon_getattr mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F bl pokemon_getattr mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr mov r3, sp movs r1, 0x1 ands r0, r1 lsls r0, 6 ldrb r2, [r3, 0x17] movs r1, 0x41 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] bl pokemon_getattr ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] bl 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 .pool @08168F68: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB b @081692E2 .align 2, 0 .pool @08168F78: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xC b @081692E2 .align 2, 0 .pool @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, =0x020244ec 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, =0x020244ec 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 .pool @08168FF0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x9 b @081692E2 .align 2, 0 .pool @0816900C: movs r6, 0 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r2, =0x020244ec 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, =0x020244ec adds r0, r1 movs r1, 0x15 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 b @081693AA .align 2, 0 .pool @08169048: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x8 b @081693A2 .align 2, 0 .pool @08169064: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1 b @0816907E .align 2, 0 .pool @08169074: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool @081690A4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1A b @081693A2 .align 2, 0 .pool @081690B4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1B b @081693A2 .align 2, 0 .pool @081690C4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1C b @081693A2 .align 2, 0 .pool @081690D4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1D b @081693A2 .align 2, 0 .pool @081690E4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1E b @081693A2 .align 2, 0 .pool @081690F4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1F b @081693A2 .align 2, 0 .pool @08169104: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x20 b @081693A2 .align 2, 0 .pool @08169114: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x22 b @081693A2 .align 2, 0 .pool @08169124: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x23 b @081693A2 .align 2, 0 .pool @08169134: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x24 b @081693A2 .align 2, 0 .pool @08169144: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x25 b @081693A2 .align 2, 0 .pool @08169154: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x26 b @081693A2 .align 2, 0 .pool @08169164: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr strb r0, [r7, 0x5] movs r6, 0x6 b @081693AA .align 2, 0 .pool @081691B4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x27 b @081693A2 .align 2, 0 .pool @081691C4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x28 b @081693A2 .align 2, 0 .pool @081691D4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x29 b @081693A2 .align 2, 0 .pool @081691E4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2A b @081693A2 .align 2, 0 .pool @081691F4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2B b @081693A2 .align 2, 0 .pool @08169204: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2C b @081693A2 .align 2, 0 .pool @08169214: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0 b @0816923E .align 2, 0 .pool @08169224: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x9 b @081692E2 .align 2, 0 .pool @08169234: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool @08169268: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 b @081693A2 .align 2, 0 .pool @08169278: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x39 b @081692E2 .align 2, 0 .pool @08169288: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A b @081692E2 .align 2, 0 .pool @08169298: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3B b @081692E2 .align 2, 0 .pool @081692A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3C b @081692E2 .align 2, 0 .pool @081692B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3D b @081692E2 .align 2, 0 .pool @081692C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3E b @081692E2 .align 2, 0 .pool @081692D8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool @081692F8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x16 b @081693A2 .align 2, 0 .pool @08169308: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x17 b @081693A2 .align 2, 0 .pool @08169318: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x18 b @081693A2 .align 2, 0 .pool @08169328: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x21 b @081693A2 .align 2, 0 .pool @08169338: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2F b @081693A2 .align 2, 0 .pool @08169348: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x30 b @081693A2 .align 2, 0 .pool @08169358: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x32 b @081693A2 .align 2, 0 .pool @08169368: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x33 b @081693A2 .align 2, 0 .pool @08169378: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x34 b @081693A2 .align 2, 0 .pool @08169388: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x35 b @081693A2 .align 2, 0 .pool @08169398: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @081693FC ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] bl sub_8169424 b @0816941A .align 2, 0 .pool @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, =0x02024064 ldrb r0, [r0] lsls r0, 9 ldr r2, =0x02023067 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 adds r0, r1 ldrb r0, [r0] adds r7, r2, 0 cmp r0, 0x3B bls @08169450 bl @08169DEA @08169450: lsls r0, 2 ldr r1, =@08169468 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB adds r2, r6, 0 bl pokemon_setattr adds r2, r6, 0 adds r2, 0x2E adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr movs r0, 0 mov r8, r0 movs r0, 0x3B adds r0, r6 mov r10, r0 adds r0, r6, 0 adds r0, 0x2B str r0, [sp, 0x20] adds r0, 0x19 str r0, [sp, 0x28] adds r0, 0x4 str r0, [sp, 0x2C] adds r0, 0x4 str r0, [sp, 0x30] subs r0, 0x22 str r0, [sp, 0x1C] subs r0, 0x2 str r0, [sp, 0x18] adds r0, 0x4 str r0, [sp, 0x24] adds r0, r6, 0x2 str r0, [sp, 0x4] adds r0, r6, 0x4 str r0, [sp, 0x8] adds r0, r6, 0x6 str r0, [sp, 0xC] adds r0, 0x2 str r0, [sp, 0x10] adds r0, 0x2 str r0, [sp, 0x14] mov r9, r4 adds r7, r6, 0 adds r7, 0x24 adds r4, r6, 0 adds r4, 0xC @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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 mov r2, r10 bl pokemon_setattr adds r0, r4, 0 movs r1, 0x20 ldr r2, [sp, 0x20] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x19 ldr r2, [sp, 0x28] bl pokemon_setattr ldrb r0, [r6, 0x14] lsls r0, 27 lsrs r0, 27 mov r1, sp strb r0, [r1] adds r0, r4, 0 movs r1, 0x27 mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x14] lsls r0, 22 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x28 mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x15] lsls r0, 25 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x29 mov r2, sp bl pokemon_setattr mov r1, sp ldr r0, [r6, 0x14] lsls r0, 12 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2A mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x16] lsls r0, 23 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2B mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x17] lsls r0, 26 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0 ldr r2, [sp, 0x2C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x37 ldr r2, [sp, 0x30] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 ldr r2, [sp, 0x1C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 ldr r2, [sp, 0x18] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A ldr r2, [sp, 0x24] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3B ldr r2, [sp, 0x4] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C ldr r2, [sp, 0x8] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D ldr r2, [sp, 0xC] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E ldr r2, [sp, 0x10] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F ldr r2, [sp, 0x14] bl pokemon_setattr b @08169DEA .align 2, 0 .pool @081696F0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xB bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169710: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xC bl pokemon_setattr b @08169DEA .align 2, 0 .pool @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, =0x020244ec 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, =0x020244ec adds r0, r1 movs r1, 0x15 mov r2, r9 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169788: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x9 b @0816982C .align 2, 0 .pool @081697B0: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x11 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x12 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x13 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x14 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169814: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x8 @0816982C: adds r3, 0x3 adds r2, r3 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169844: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169864: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x19 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169884: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1A bl pokemon_setattr b @08169DEA .align 2, 0 .pool @081698A4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1B bl pokemon_setattr b @08169DEA .align 2, 0 .pool @081698C4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1C bl pokemon_setattr b @08169DEA .align 2, 0 .pool @081698E4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1D bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169904: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1E bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169924: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1F bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169944: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x20 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169964: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x22 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169984: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x23 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @081699A4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x24 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @081699C4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x25 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @081699E4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x26 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169A04: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x27 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x28 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x29 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x2A bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x2B bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x5 adds r2, r0 adds r0, r4, 0 b @08169B24 .align 2, 0 .pool @08169A74: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x27 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169A94: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x28 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169AB4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x29 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169AD4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2A bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169AF4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2B bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169B14: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 @08169B24: movs r1, 0x2C bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169B34: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169B54: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x9 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169B74: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x37 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169B94: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x38 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169BB4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x39 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169BD4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3A bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169BF4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3B bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169C14: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3C bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169C34: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3D bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169C54: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3E bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169C74: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3F bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169C94: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x16 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169CB4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x17 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169CD4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x18 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169CF4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x21 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169D14: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2F bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169D34: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x30 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169D54: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x32 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169D74: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x33 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169D94: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x34 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169DB4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x35 bl pokemon_setattr b @08169DEA .align 2, 0 .pool @08169DD4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x36 bl pokemon_setattr @08169DEA: ldr r2, =0x0202406e ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 add sp, 0x34 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r6, =0x02024064 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, =0x03005d60 ldrb r1, [r6] lsls r1, 2 adds r1, r0 ldr r0, =sub_8168A20 str r0, [r1] b @08169EB6 .align 2, 0 .pool @08169E80: ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 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 .pool thumb_func_end sub_8169E44 thumb_func_start sub_8169EC8 sub_8169EC8: ; 8169EC8 push {r4-r6,lr} ldr r4, =0x02024064 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, =0x0202499c ldr r1, =gUnknown_08305D2C 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, =0x020241e4 ldrb r1, [r4] adds r1, r6 strb r0, [r1] ldr r5, =0x02020630 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, =0x0000fffe 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, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_816856C str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8169EC8 thumb_func_start dp01t_07_6_ dp01t_07_6_: ; 8169F94 push {r4-r6,lr} ldr r4, =0x02024064 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, =0x0202499c ldr r1, =gUnknown_08305D2C 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, =0x020241e4 ldrb r1, [r4] adds r1, r6 strb r0, [r1] ldr r5, =0x02020630 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, =0x0000ffa0 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, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8168A90 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x8] movs r0, 0x4 strb r0, [r1, 0x8] ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldr r5, =0x02024064 ldrb r4, [r5] movs r0, 0x1 bl battle_get_side_with_given_state adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r4, 0 movs r3, 0x4 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_wait_t5 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816A084 thumb_func_start sub_816A0D8 sub_816A0D8: ; 816A0D8 push {r4,r5,lr} ldr r1, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r1, [r0] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] strb r1, [r0, 0x8] ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r4, [r5] movs r0, 0x1 bl battle_get_side_with_given_state adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r4, 0 movs r3, 0x4 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =bx_wait_t5 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 mov r12, r0 ldr r6, =0x02024064 ldrb r2, [r6] lsls r2, 9 adds r0, 0x1 adds r0, r2, r0 ldrb r0, [r0] mov r1, r12 adds r1, 0x2 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 ldr r5, =0x02038432 mov r1, r12 adds r1, 0x3 adds r2, r1 ldrb r1, [r2] strb r1, [r5] ldr r4, =0x02038408 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x4 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x5 adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r4, =0x02038404 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x6 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x7 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r3, r1 mov r1, r12 adds r1, 0x8 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 16 orrs r3, r1 mov r1, r12 adds r1, 0x9 adds r2, r1 ldrb r1, [r2] lsls r1, 24 orrs r3, r1 str r3, [r4] ldr r3, =0x0203841a ldrb r1, [r6] lsls r1, 9 mov r2, r12 adds r2, 0xA adds r1, r2 ldrb r1, [r1] strb r1, [r3] ldr r4, =0x0203841c ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0xC adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0xD adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r3, =0x02038400 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x10 adds r2, r1 str r2, [r3] ldr r3, =0x020244bc ldrb r1, [r6] lsls r1, 2 adds r1, r3 ldr r2, [r2] str r2, [r1] ldrb r1, [r5] bl sub_805DB8C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @0816A23C bl dp01_tbl5_exec_completed b @0816A25A .align 2, 0 .pool @0816A23C: ldr r0, =0x020244d0 ldr r0, [r0] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =bx_move_anim_5 str r1, [r0] @0816A25A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r6, =0x02024064 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, =0x020244d0 ldr r5, [r7] ldr r1, [r5, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x4] cmp r2, 0x1 beq @0816A2F6 cmp r2, 0x1 bgt @0816A2BC cmp r2, 0 beq @0816A2C6 b @0816A3AC .align 2, 0 .pool @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, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd 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 .pool @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, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 ldr r1, =0x02023066 adds r0, r1 ldrh r0, [r0] bl battle_pick_message ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_81685A4 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @0816A428 bl sub_816A3B8 b @0816A42C .align 2, 0 .pool @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, =0x02022e14 strh r1, [r0] ldr r1, =0x02022e16 movs r0, 0xA0 strh r0, [r1] ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8168444 str r1, [r0] @0816A456: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816A430 thumb_func_start dp01t_12_1_battle_menu dp01t_12_1_battle_menu: ; 816A470 push {r4,lr} ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_816A430 str r1, [r0] ldr r0, =gUnknown_085CCA3A 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, =0x020244ac ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r0, [r0] movs r1, 0 bl sub_8059CB4 ldr r0, =gUnknown_085CCA15 bl sub_814E6F0 ldr r0, =0x02022e2c movs r1, 0x1 bl battle_show_message_maybe pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202449c 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 .pool @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, =0x02022e14 strh r1, [r0] ldr r1, =0x02022e16 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 .pool @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, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_81685D4 str r1, [r0] ldr r1, =0x020244b8 ldrb r0, [r2] strb r0, [r1] add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r0, =0x02024064 mov r9, r0 ldrb r4, [r0] lsls r2, r4, 9 adds r0, r3, 0x2 adds r0, r2, r0 ldrb r1, [r0] adds r3, 0x3 adds r2, r3 ldrb r0, [r2] lsls r0, 8 orrs r1, r0 lsls r1, 16 asrs r7, r1, 16 ldr r0, =0x00007fff cmp r7, r0 beq @0816A664 ldr r6, =0x0202406e lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x3A bl pokemon_getattr mov r8, r0 mov r1, r9 ldrb r0, [r1] lsls r0, 1 adds r0, r6 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] mov r2, r8 bl sub_807294C b @0816A69E .align 2, 0 .pool @0816A664: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A bl pokemon_getattr adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r4, =0x03005d70 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, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8168934 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 .pool 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, =0x02020630 ldr r2, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @0816A7C8 bl dp01_tbl5_exec_completed b @0816A7F2 .align 2, 0 .pool @0816A7C8: ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0 strh r1, [r0, 0x30] ldrb r0, [r4] bl sub_80769F4 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_blink_t5 str r1, [r0] @0816A7F2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r1, [r0] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl audio_play bl dp01_tbl5_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816A810 thumb_func_start sub_816A840 sub_816A840: ; 816A840 push {r4,r5,lr} ldr r4, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r3, r0, 9 adds r0, r4, 0x3 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @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 .pool @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, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 movs r1, 0x19 bl cry_related bl dp01_tbl5_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816A89C thumb_func_start dp01t_2E_5_battle_intro dp01t_2E_5_battle_intro: ; 816A8D8 push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] bl battle_intro_launch ldr r2, =0x020243fc ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] bl dp01_tbl5_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_2E_5_battle_intro thumb_func_start sub_816A90C sub_816A90C: ; 816A90C push {r4-r7,lr} ldr r6, =0x020241e4 ldr r7, =0x02024064 ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 bl oamt_add_pos2_onto_pos1 ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x32 strh r1, [r0, 0x2E] ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ffd8 strh r1, [r0, 0x32] ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r2, [r7] adds r0, r2, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x38] ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =sub_805CC00 bl oamt_set_x3A_32 ldrb r0, [r7] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x1 bl obj_anim_image_start ldr r0, =0x0000d6f8 bl gpu_pal_alloc_new adds r4, r0, 0 lsls r4, 24 ldr r0, =gTrainerBackPicPaletteTable 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, =sub_816AC04 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r4, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r4 ldrb r0, [r7] strh r0, [r1, 0x8] ldr r3, =0x020244d0 ldr r0, [r3] ldrb r2, [r7] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0816AA24 ldr r0, =0x020244b4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r4 ldr r1, =sub_8073C30 str r1, [r0] @0816AA24: ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r0, [r2, 0x9] movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_21 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r6, 2 adds r0, r1 movs r1, 0 strh r1, [r0, 0x2] ldr r0, =0x0202406e lsls r2, r6, 1 adds r2, r0 ldr r0, =0x02023064 lsls r1, r6, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] strh r0, [r2] ldrh r1, [r2] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 bl object_new_hidden_with_callback ldr r1, =0x03005d7c mov r9, r1 add r9, r6 mov r1, r9 strb r0, [r1] adds r0, r6, 0 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_806A068 ldr r0, =0x0202499c mov r10, r0 adds r0, r6, 0 movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r10 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 adds r4, r6, r4 strb r0, [r4] ldr r5, =0x02020630 mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r4] strh r1, [r0, 0x30] mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x32] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x2E] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 mov r1, r8 strh r1, [r0, 0x32] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, r6, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r6, r1 ldrb r1, [r6] bl 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, =nullsub_12 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 .pool 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, =0x03005e00 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 .pool @0816AC28: ldr r4, =0x02024064 ldrb r5, [r4] ldrh r0, [r1, 0x8] strb r0, [r4] ldr r0, =0x02023064 ldrb r1, [r4] lsls r2, r1, 9 adds r0, 0x1 adds r2, r0 ldr r0, =0x0202406e lsls r1, 1 adds r1, r0 ldrh r0, [r1] strb r0, [r2] ldrb r0, [r4] bl sub_816AA80 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_816864C str r1, [r0] strb r5, [r4] adds r0, r6, 0 bl remove_task @0816AC5E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816AC04 thumb_func_start sub_816AC78 sub_816AC78: ; 816AC78 push {r4,r5,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @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 .pool @0816ACA8: ldr r0, =0x020244d0 ldr r0, [r0] ldr r5, =0x02024064 ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] ldrb r0, [r5] lsls r4, r0, 9 ldr r3, =0x02023068 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, =0x020244b4 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 .pool 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, =0x02023064 ldr r6, =0x02024064 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 .pool @0816AD60: ldr r0, =0x03005d60 ldrb r1, [r6] lsls r1, 2 adds r1, r0 ldr r0, =sub_8168AC8 str r0, [r1] @0816AD6C: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202433a ldr r1, =0x02023064 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] strb r0, [r2] movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 bl sub_80A2390 bl dp01_tbl5_exec_completed ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x6 ands r0, r1 cmp r0, 0x2 bne @0816ADD0 ldr r0, =0x03005d60 ldrb r1, [r4] lsls r1, 2 adds r1, r0 ldr r0, =sub_80587B0 str r0, [r1] @0816ADD0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] movs r1, 0x93 lsls r1, 3 adds r0, r1 movs r1, 0x32 bl sub_80D6C7C ldr r1, =gUnknown_085DFEFC 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 .pool thumb_func_end sub_816ADF4 thumb_func_start sub_816AE58 sub_816AE58: ; 816AE58 push {lr} ldr r1, =0x0203bcb0 ldr r0, =gUnknown_085DFED4 str r0, [r1] ldr r1, =0x0203bcb4 movs r0, 0x4 strb r0, [r1] ldr r0, =nullsub_4 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_085E8D80 ldr r2, =sub_816AED8 bl sub_81978EC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816AE58 thumb_func_start sub_816AE98 sub_816AE98: ; 816AE98 push {lr} ldr r1, =0x0203bcb0 ldr r0, =gUnknown_085DFED8 str r0, [r1] ldr r1, =0x0203bcb4 movs r0, 0x3 strb r0, [r1] ldr r0, =nullsub_4 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_085E8D80 ldr r2, =sub_816AED8 bl sub_81978EC pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r6, r0, r1 ldr r0, =0x0203bcb4 ldrb r1, [r0] mov r8, r0 cmp r1, 0x3 bne @0816AF0C ldr r0, =gUnknown_085DFF24 ldr r1, [r0, 0x4] ldr r0, [r0] b @0816AF12 .align 2, 0 .pool @0816AF0C: ldr r0, =gUnknown_085DFF24 ldr r1, [r0, 0xC] ldr r0, [r0, 0x8] @0816AF12: str r0, [sp] str r1, [sp, 0x4] ldr r5, =gUnknown_085DFEB4 ldr r4, =0x0203bcb0 ldr r1, [r4] mov r0, r8 ldrb r2, [r0] adds r0, r5, 0 bl sub_81DB3D8 lsls r0, 24 ldr r2, =0x00ffffff 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_816AF98 str r1, [r0] add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r0, =0x0203bcb4 ldrb r0, [r0] cmp r0, 0x3 bls @0816AFC0 bl ProcessMenuInput b @0816AFC4 .align 2, 0 .pool @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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_816B148 str r1, [r0] b @0816B04C .align 2, 0 .pool @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, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r2, =gUnknown_085DFEB4 ldr r0, =0x0203bcb0 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 .pool thumb_func_end sub_816AF98 thumb_func_start sub_816B060 sub_816B060: ; 816B060 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_085E8D80 ldr r2, =sub_816AED8 bl sub_81978EC pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_816B248 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcb8 movs r1, 0 strb r0, [r5, 0x5] lsls r0, 24 cmp r0, 0 bne @0816B0D8 ldr r1, =gUnknown_085EAC4B ldr r2, =sub_816B060 adds r0, r4, 0 bl sub_81978EC b @0816B12A .align 2, 0 .pool @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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_816B674 str r0, [r1] b @0816B12A .align 2, 0 .pool @0816B120: ldr r1, =gUnknown_085EAC4B ldr r2, =sub_816B060 adds r0, r6, 0 bl sub_81978EC @0816B12A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcb4 ldrb r0, [r0] cmp r0, 0x4 bne @0816B180 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @0816B174 ldr r0, =gUnknown_081F863F bl script_env_1_execute_new_script b @0816B184 .align 2, 0 .pool @0816B174: ldr r0, =gUnknown_081F958F bl script_env_1_execute_new_script b @0816B184 .align 2, 0 .pool @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, =0x03005e08 adds r4, r0 ldr r0, =gUnknown_085DFF24 ldr r1, [r0, 0x14] ldr r0, [r0, 0x10] str r0, [sp] str r1, [sp, 0x4] ldr r6, =gUnknown_085DFEDC adds r0, r6, 0 movs r1, 0x4 bl GetMaxWidthInMenuTable lsls r0, 24 ldr r2, =0x00ffffff ldr r1, [sp] ands r1, r2 orrs r1, r0 str r1, [sp] mov r0, sp bl 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, =gUnknown_085DFEA4 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 .pool 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, =gUnknown_085DFEDC 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 .pool @0816B298: lsls r1, r5, 24 lsls r0, r2, 24 asrs r2, r0, 24 cmp r1, r0 beq @0816B2C0 ldr r0, =gUnknown_085DFEA4 lsls r1, r2, 2 adds r1, r0 ldr r0, [r1] bl sub_816B21C b @0816B2C0 .align 2, 0 .pool @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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_816B2F0 str r0, [r1] movs r0, 0x1 movs r1, 0 bl fade_screen pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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 .pool thumb_func_end sub_816B2F0 thumb_func_start sub_816B31C sub_816B31C: ; 816B31C push {lr} ldr r0, =0x03005dac ldr r1, =mapldr_080EBC0C str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =sub_816B368 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 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_816B248 str r0, [r1] @0816B388: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @0816B3C4: adds r0, r5, 0 bl sub_816B4DC ldr r1, =gUnknown_085EABD1 ldr r2, =task_pc_itemstorage adds r0, r5, 0 bl sub_81978EC @0816B3D4: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @0816B410: adds r0, r5, 0 bl sub_816B4DC ldr r1, =gUnknown_085EABD1 ldr r2, =task_pc_itemstorage adds r0, r5, 0 bl sub_81978EC @0816B420: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r0, r5, r6 strh r1, [r0, 0x6] adds r0, r4, 0 bl sub_816B4DC ldr r1, =0x0203bcb8 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, =0x0203bcc4 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, =sub_816C158 str r0, [r5] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcb8 ldrb r0, [r1, 0x5] cmp r0, 0x7 bls @0816B4D4 movs r0, 0x8 b @0816B4D6 .align 2, 0 .pool @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, =0x03005e08 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 .pool thumb_func_end sub_816B4DC thumb_func_start sub_816B510 sub_816B510: ; 816B510 push {r4,lr} movs r2, 0 movs r1, 0x6 ldr r0, =0x03005d8c 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 .pool 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, =0x03005d8c mov r10, r0 lsls r0, r2, 3 adds r0, r2 lsls r0, 2 mov r12, r0 ldr r6, =0x00002be0 @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 .pool 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, =gUnknown_085EAB4E 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, =0x0203bcb8 adds r0, r4, 0 bl sub_81D1DC0 ldr r2, =0x03005e00 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 .pool 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, =0x03005e08 mov r10, r0 mov r4, r9 add r4, r10 ldr r0, =0x02037fd4 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, =0x0203bcba 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 .pool @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, =sub_816B730 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 .pool 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, =0x02021cc4 ldr r2, =0x03005d8c ldr r1, =0x0203bcb8 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, =0x00002bf2 adds r1, r0 adds r0, r5, 0 bl gf_strcpy adds r0, r5, 0 movs r1, 0 bl sub_81DB554 ldr r5, =0x02021fc4 ldr r1, =gUnknown_085EAC63 adds r0, r5, 0 bl ExpandTextCodes ldr r2, =sub_816B7DC adds r0, r4, 0 adds r1, r5, 0 bl sub_81978EC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool 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, =gUnknown_085DFF04 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_816B82C str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085DFF04 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_816B8A4 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005d8c ldr r1, =0x0203bcb8 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, =0x00002be0 adds r1, r0 ldr r0, [r2] adds r0, r1 ldr r1, =sub_816B900 movs r2, 0x1 bl sub_8121478 adds r0, r4, 0 bl remove_task @0816B8E6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816B8A4 thumb_func_start sub_816B900 sub_816B900: ; 816B900 push {lr} ldr r0, =0x03005dac ldr r1, =pal_fill_for_maplights_or_black str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =task00_080EBBDC movs r1, 0 bl AddTask lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0203bcb8 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 .pool @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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_816B674 str r0, [r1] @0816B984: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task00_080EBBDC thumb_func_start sub_816B994 sub_816B994: ; 816B994 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_085EAC8D ldr r2, =sub_816B9B0 bl sub_81978EC pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_816B9D8 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r4, =0x0203bcb8 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, =0x00002be0 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, =gUnknown_085EACB5 ldr r2, =sub_816BBD4 adds r0, r6, 0 bl sub_81978EC b @0816BA9C .align 2, 0 .pool @0816BA68: ldr r1, =gUnknown_085EACC8 ldr r2, =sub_816BBD4 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 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_816BAF8 str r0, [r1] @0816BAEA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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 .pool thumb_func_end sub_816BAF8 thumb_func_start sub_816BB28 sub_816BB28: ; 816BB28 push {lr} ldr r0, =0x03005dac ldr r1, =sub_816BB48 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816BB28 thumb_func_start sub_816BB48 sub_816BB48: ; 816BB48 push {r4-r6,lr} ldr r0, =task00_080EBBDC movs r1, 0 bl AddTask lsls r0, 24 lsrs r6, r0, 24 ldr r5, =0x0203bcb8 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, =0x0203bcb8 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 .pool @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, =gUnknown_085E8DE9 ldr r2, =sub_816BBD4 bl sub_81978EC pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_816B674 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816BBD4 thumb_func_start sub_816BC14 sub_816BC14: ; 816BC14 push {r4,lr} ldr r4, =0x0203bcc4 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, =0x00000666 adds r0, r1 movs r1, 0xFF strb r1, [r0] ldr r0, [r4] ldr r1, =0x00000667 adds r0, r1 movs r1, 0x1 negs r1, r1 strb r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcc4 ldr r0, [r0] bl free pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcc4 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, =gUnknown_085DFF5C 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 .pool thumb_func_end sub_816BC7C thumb_func_start sub_816BCC4 sub_816BCC4: ; 816BCC4 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203bcc4 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 .pool thumb_func_end sub_816BCC4 thumb_func_start sub_816BD04 sub_816BD04: ; 816BD04 push {r4-r6,lr} movs r6, 0 ldr r0, =0x0203bcb8 ldrb r0, [r0, 0x5] subs r0, 0x1 cmp r6, r0 bge @0816BD58 ldr r5, =0x0203bcc4 @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, =0x03005d8c 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, =0x0203bcb8 ldrb r0, [r0, 0x5] subs r0, 0x1 cmp r6, r0 blt @0816BD14 @0816BD58: ldr r5, =0x0203bcc4 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, =gUnknown_085E8CF7 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, =0x03006310 adds r1, r4, 0 ldr r0, =gUnknown_085DFF44 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, =0x0203bcb8 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 .pool 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, =0x0203bcc4 ldr r0, [r0] ldr r1, =0x00000666 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, =0x03005d8c 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 .pool @0816BE2C: ldr r0, =0x0000ffff bl sub_816C060 @0816BE32: adds r0, r4, 0 bl sub_816BEF0 @0816BE38: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcc4 ldr r0, [r0] ldr r1, =0x00000666 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 .pool @0816BE84: adds r0, r5, 0 movs r1, 0xFF movs r2, 0xFF bl sub_816BFE0 @0816BE8E: ldr r0, =0x02021cc4 ldr r1, =0x03005d8c ldr r1, [r1] lsls r2, r4, 2 adds r1, r2 ldr r2, =0x0000049a adds r1, r2 ldrh r1, [r1] movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool 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, =0x0203bcc4 ldr r0, [r0] ldr r2, =0x00000661 adds r0, r2 ldrb r5, [r0] movs r0, 0x2 negs r0, r0 cmp r1, r0 beq @0816BF2C ldr r0, =0x03005d8c 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 .pool @0816BF2C: ldr r0, =0x0000ffff 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 .pool thumb_func_end sub_816BEF0 thumb_func_start sub_816BF60 sub_816BF60: ; 816BF60 push {r4,lr} sub sp, 0x10 ldr r4, =0x0203bcb8 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, =0x000013f8 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 .pool thumb_func_end sub_816BF60 thumb_func_start sub_816BF9C sub_816BF9C: ; 816BF9C push {r4,lr} ldr r4, =0x0203bcb8 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 .pool 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, =0x0203bcc4 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 GetMenuCursorDimensionByFont adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 movs r1, 0x1 bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 str r4, [sp] str r0, [sp, 0x4] adds r0, r5, 0 movs r1, 0x11 movs r2, 0 adds r3, r6, 0 bl Window_FillPixelRect b @0816C050 .align 2, 0 .pool @0816C030: movs r0, 0 str r0, [sp] str r0, [sp, 0x4] ldr r0, =gUnknown_085DFF8C str r0, [sp, 0x8] lsls r0, r2, 24 asrs r0, 24 str r0, [sp, 0xC] ldr r0, =gUnknown_085E8D60 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 .pool 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, =0x0203bcc4 ldr r0, [r0] ldr r1, =0x00000667 adds r5, r0, r1 ldrb r0, [r5] cmp r0, 0xFF bne @0816C0B2 ldr r4, =0x000013f6 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, =0x02020630 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 .pool thumb_func_end sub_816C060 thumb_func_start sub_816C0C8 sub_816C0C8: ; 816C0C8 push {r4,r5,lr} ldr r0, =0x0203bcc4 ldr r0, [r0] ldr r1, =0x00000667 adds r5, r0, r1 ldrb r0, [r5] cmp r0, 0xFF beq @0816C0FA ldr r4, =0x000013f6 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, =0x02020630 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 .pool thumb_func_end sub_816C0C8 thumb_func_start sub_816C110 sub_816C110: ; 816C110 push {lr} sub sp, 0x4 bl sub_80D6E84 ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0x93 lsls r1, 3 adds r0, r1 ldr r2, =0x0203bcbc 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 .pool thumb_func_end sub_816C110 thumb_func_start sub_816C140 sub_816C140: ; 816C140 push {lr} ldr r0, =0x0203bcba subs r1, r0, 0x2 ldrb r2, [r1, 0x4] ldrb r3, [r1, 0x5] bl sub_812225C pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =gUnknown_085EAB71 cmp r0, 0 bne @0816C186 ldr r5, =gUnknown_085EAB63 @0816C186: movs r0, 0x1 adds r1, r5, 0 movs r2, 0x68 bl sub_81DB35C adds r3, r0, 0 ldr r4, =0x0203bcc4 ldr r0, [r4] ldr r1, =0x00000663 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, =0x00000662 adds r0, r1 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram bl sub_816C110 bl sub_816C140 bl sub_816BD04 ldr r0, =0x03006310 ldr r2, =0x0203bcb8 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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_816C30C str r1, [r0] add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816C158 thumb_func_start sub_816C228 sub_816C228: ; 816C228 push {lr} lsls r0, 16 lsrs r1, r0, 16 ldr r2, =0xffff0009 adds r0, r1, r2 cmp r0, 0x8 bhi @0816C2B4 lsls r0, 2 ldr r1, =@0816C248 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085E8D62 b @0816C2BA .align 2, 0 .pool @0816C274: ldr r0, =gUnknown_085EAC09 b @0816C2BA .align 2, 0 .pool @0816C27C: ldr r0, =gUnknown_085EAC22 b @0816C2BA .align 2, 0 .pool @0816C284: ldr r0, =gUnknown_085E8EE0 b @0816C2BA .align 2, 0 .pool @0816C28C: ldr r0, =gUnknown_085E8EF9 b @0816C2BA .align 2, 0 .pool @0816C294: ldr r0, =gUnknown_085EABE7 b @0816C2BA .align 2, 0 .pool @0816C29C: ldr r0, =gUnknown_085E8EB9 b @0816C2BA .align 2, 0 .pool @0816C2A4: ldr r0, =gUnknown_085E8F0E b @0816C2BA .align 2, 0 .pool @0816C2AC: ldr r0, =gUnknown_085E8DFE b @0816C2BA .align 2, 0 .pool @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, =0x0203bcc4 ldr r0, [r0] ldr r1, =0x00000661 adds r0, r1 ldrb r5, [r0] adds r0, r5, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r4, =0x02021fc4 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 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0816C35C ldrb r0, [r4, 0xA] ldr r1, =0x0203bcba 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 .pool @0816C35C: ldrb r0, [r4, 0xA] bl sub_81AE604 adds r6, r0, 0 ldrb r0, [r4, 0xA] ldr r1, =0x0203bcba 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 .pool @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, =0x03005e08 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 .pool @0816C3DC: adds r0, r4, 0 movs r1, 0x2 bl sub_816B190 @0816C3E4: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_816B248 str r0, [r1] @0816C3F2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x0203bcc4 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, =bx_battle_menu_t3 str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x0203bcc4 ldr r2, [r6] ldr r1, =0x0203bcb8 ldrb r0, [r1] ldrb r1, [r1, 0x2] adds r0, r1 ldr r5, =0x00000666 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, =0x03005d8c 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, =0x02021cc4 bl itemid_get_name ldr r0, =0x0000fff7 bl sub_816C228 bl sub_816C2C0 movs r1, 0x8 negs r1, r1 add r8, r1 add r4, r8 ldr r0, =sub_816C4FC str r0, [r4] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r7, =0x030022c0 ldrh r1, [r7, 0x2E] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0816C530 ldrb r0, [r4, 0xA] ldr r1, =0x0203bcba subs r2, r1, 0x2 bl get_coro_args_x18_x1A b @0816C57E .align 2, 0 .pool @0816C530: ldrb r0, [r4, 0xA] bl sub_81AE604 adds r6, r0, 0 ldrb r0, [r4, 0xA] ldr r1, =0x0203bcba subs r4, r1, 0x2 adds r2, r4, 0 bl get_coro_args_x18_x1A ldr r0, =0x0203bcc4 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 .pool @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, =0x03005e08 adds r0, r1 mov r8, r0 ldr r4, =0x0203bcb8 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, =0x0203bcc4 ldr r0, [r1] ldr r2, =0x00000666 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, =0x03005d8c 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, =0x0203bcc4 ldr r1, [r0] ldr r2, =0x00000666 adds r1, r2 ldrb r1, [r1] adds r4, r0, 0 cmp r1, r6 bcs @0816C622 ldr r1, =0x0203bcb8 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, =0x00000666 adds r0, r2 movs r1, 0xFF strb r1, [r0] ldr r0, =0x03006310 ldr r2, =0x0203bcb8 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_816C30C str r1, [r0] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816C5A0 thumb_func_start sub_816C690 sub_816C690: ; 816C690 push {lr} adds r3, r0, 0 lsls r3, 24 ldr r0, =0x0203bcc4 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 .pool 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, =0x02021cc4 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool 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, =0x03005e08 adds r6, r0, r1 ldr r1, =0x0203bcb8 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, =0x03005d8c ldr r1, [r0] lsls r0, r4, 2 adds r1, r0 ldr r2, =0x0000049a adds r0, r1, r2 ldrh r0, [r0] cmp r0, 0x1 bne @0816C774 adds r0, r5, 0 bl sub_816C8FC b @0816C7FE .align 2, 0 .pool @0816C774: movs r2, 0x93 lsls r2, 3 adds r0, r1, r2 ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, =0x0000fffe bl sub_816C228 bl sub_816C2C0 b @0816C7D4 .align 2, 0 .pool @0816C798: ldr r0, =0x03005d8c ldr r1, [r0] lsls r0, r4, 2 adds r1, r0 ldr r2, =0x0000049a adds r0, r1, r2 ldrh r0, [r0] cmp r0, 0x1 bne @0816C7BC adds r0, r5, 0 bl sub_816C9B8 b @0816C7FE .align 2, 0 .pool @0816C7BC: movs r2, 0x93 lsls r2, 3 adds r0, r1, r2 ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, =0x0000fffc 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_816C818 str r1, [r0] @0816C7FE: add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r6, r0, r1 ldr r0, =0x0203bcb8 ldrh r2, [r0, 0x2] ldrh r0, [r0] adds r2, r0 lsls r2, 16 adds r0, r6, 0x4 ldr r1, =0x03005d8c mov r8, r1 ldr r1, [r1] lsrs r7, r2, 14 adds r1, r7 ldr r2, =0x0000049a 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 .pool @0816C888: ldr r0, =0x030022c0 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 .pool @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, =0x03005e08 mov r8, r0 adds r4, r6, r0 ldr r0, =0x0203bcb8 ldrh r1, [r0, 0x2] ldrh r0, [r0] adds r1, r0 lsls r1, 16 ldr r7, =0x03005d8c 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, =0x02021cc4 bl itemid_get_name ldr r0, =0x02021dc4 movs r2, 0x4 ldrsh r1, [r4, r2] movs r2, 0 movs r3, 0x3 bl decimal_int_to_string ldr r0, =0x0000fffd bl sub_816C228 bl sub_816C2C0 mov r0, r8 subs r0, 0x8 adds r0, r6, r0 ldr r1, =sub_816CB04 b @0816C9A2 .align 2, 0 .pool @0816C98C: movs r0, 0 strh r0, [r4, 0x4] ldr r0, =0x0000fffa bl sub_816C228 bl sub_816C2C0 mov r0, r8 subs r0, 0x8 adds r0, r6, r0 ldr r1, =sub_816CB74 @0816C9A2: str r1, [r0] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 mov r9, r0 mov r7, r8 add r7, r9 ldr r0, =0x0203bcb8 ldrh r1, [r0, 0x2] ldrh r0, [r0] adds r1, r0 lsls r1, 16 ldr r6, =0x03005d8c 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, =0x02021cc4 bl itemid_get_name ldr r0, =0x02021dc4 movs r2, 0x4 ldrsh r1, [r7, r2] movs r2, 0 movs r3, 0x3 bl decimal_int_to_string ldr r0, =0x0000fff8 bl sub_816C228 bl sub_816C2C0 ldr r1, =gUnknown_085DFF84 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, =gUnknown_085DFF3C str r0, [sp, 0xC] adds r0, r5, 0 movs r2, 0x1 movs r3, 0 bl sub_8121F94 b @0816CA7C .align 2, 0 .pool @0816CA64: movs r0, 0 strh r0, [r7, 0x4] ldr r0, =0x0000fff9 bl sub_816C228 bl sub_816C2C0 mov r0, r9 subs r0, 0x8 add r0, r8 ldr r1, =sub_816CB74 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 .pool 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, =0x0000fffb bl sub_816C228 bl sub_816C2C0 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_816CB04 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r2, [r0] ldr r1, =0x0203bcb8 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 .pool 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, =0x03005e08 adds r5, r0, r1 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @0816CB5E ldr r4, =0x0203bcb8 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, =0x03006310 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 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @0816CBAC ldr r0, =0x03005d8c ldr r2, [r0] ldr r1, =0x0203bcb8 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_816C30C str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r0, [r0, 0x2E] cmp r0, 0 beq @0816CC3C ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0816CC3C ldr r0, =sub_816CC54 bl set_callback2 b @0816CC4C .align 2, 0 .pool @0816CC3C: ldr r2, =0x030062a0 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 .pool 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, =c2_title_screen_1 bl set_callback2 @0816CC66: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816CC54 thumb_func_start load_copyright_graphics ; void load_copyright_graphics(u16 tile_patterns_dest, u16 tilemap_dest, u16 unknown_dest) 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, =gUnknown_08DC3D74 movs r6, 0xC0 lsls r6, 19 adds r3, r6 adds r1, r3, 0 bl LZ77UnCompVram ldr r0, =gUnknown_08DC3FD4 adds r4, r6 adds r1, r4, 0 bl LZ77UnCompVram ldr r0, =gUnknown_08DC3D54 adds r1, r5, 0 movs r2, 0x20 bl gpu_pal_apply pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end load_copyright_graphics thumb_func_start sub_816CCB8 sub_816CCB8: ; 816CCB8 push {lr} ldr r0, =0x030062b0 bl sub_82DEEE2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_816CCB8 thumb_func_start do_copyright_screen do_copyright_screen: ; 816CCC8 push {r4-r6,lr} sub sp, 0x10 ldr r0, =0x030022c0 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 .pool @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, =0x00007fff 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, =0x05006000 add r0, sp, 0x4 bl CpuSet str r4, [sp, 0x8] add r0, sp, 0x8 movs r1, 0xE0 lsls r1, 19 ldr r2, =0x05000100 bl CpuSet add r0, sp, 0xC strh r4, [r0] ldr r1, =0x05000002 ldr r2, =0x010001ff 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, =0x0000ffff 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, =sub_816CBE8 bl SetVBlankCallback movs r1, 0x80 lsls r1, 19 movs r2, 0xA0 lsls r2, 1 adds r0, r2, 0 strh r0, [r1] ldr r0, =sub_816CCB8 bl set_serial_callback ldr r0, =0x030062b0 bl sub_82DEE98 @0816CDBC: bl fade_and_return_progress_probably ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] ldr r0, =0x030062b0 bl sub_82DED84 b @0816CEA0 .align 2, 0 .pool @0816CE00: ldr r4, =0x030062b0 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 .pool @0816CE2C: bl fade_and_return_progress_probably lsls r0, 24 cmp r0, 0 bne @0816CEA0 ldr r0, =task_intro_1 movs r1, 0 bl AddTask ldr r0, =sub_816CC00 bl set_callback2 ldr r5, =0x030062b0 ldrb r0, [r5, 0x2] cmp r0, 0 beq @0816CE8C ldrb r0, [r5, 0x2] cmp r0, 0x2 bne @0816CE96 ldr r6, =0x020000ac ldr r4, [r6] ldr r0, =0x65366347 cmp r4, r0 bne @0816CE6C ldr r0, =gUnknown_089AA144 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 .pool @0816CE8C: bl sub_82DF012 ldr r0, =sub_800BA38 bl set_serial_callback @0816CE96: movs r0, 0 b @0816CEA2 .align 2, 0 .pool @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, =0x03006210 ldrh r0, [r0] cmp r0, 0 beq @0816CEDE cmp r0, 0x2 bne @0816CEE2 @0816CEDE: bl init_sav2 @0816CEE2: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x15] lsls r0, 31 lsrs r0, 31 bl sub_82E1810 ldr r0, =0x02000000 movs r1, 0xE0 lsls r1, 9 bl init_malloc @0816CEFA: pop {r0} bx r0 .align 2, 0 .pool 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 ; void task_intro_1(int task_id) 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, =0x0203bcc8 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, =gUnknown_085E13B4 movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_085E07C4 ldr r1, =0x06008000 bl LZ77UnCompVram ldr r1, =0x06008800 add r0, sp, 0x8 movs r6, 0 strh r6, [r0] ldr r4, =0x040000d4 str r0, [r4] str r1, [r4, 0x4] ldr r5, =0x81000400 str r5, [r4, 0x8] ldr r0, [r4, 0x8] ldr r0, =gUnknown_085E0B78 ldr r1, =0x06009000 bl LZ77UnCompVram ldr r1, =0x06009800 add r0, sp, 0x8 strh r6, [r0] str r0, [r4] str r1, [r4, 0x4] str r5, [r4, 0x8] ldr r0, [r4, 0x8] ldr r0, =gUnknown_085E0EAC ldr r1, =0x0600a000 bl LZ77UnCompVram ldr r1, =0x0600a800 add r0, sp, 0x8 strh r6, [r0] str r0, [r4] str r1, [r4, 0x4] str r5, [r4, 0x8] ldr r0, [r4, 0x8] ldr r0, =gUnknown_085E119C ldr r1, =0x0600b000 bl LZ77UnCompVram ldr r1, =0x0600b800 add r0, sp, 0x8 strh r6, [r0] str r0, [r4] str r1, [r4, 0x4] str r5, [r4, 0x8] ldr r0, [r4, 0x8] ldr r0, =gUnknown_085E05C4 movs r5, 0x80 lsls r5, 2 movs r1, 0 adds r2, r5, 0 bl gpu_pal_apply ldr r1, =0x00009603 movs r0, 0xE bl lcd_io_set ldr r1, =0x00009402 movs r0, 0xC bl lcd_io_set ldr r1, =0x00009201 movs r0, 0xA bl lcd_io_set movs r1, 0x90 lsls r1, 8 movs r0, 0x8 bl lcd_io_set ldr r0, =gUnknown_085E4FDC bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085E4FEC bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085E4FFC bl gpu_pal_obj_alloc_and_load_multiple ldr r0, =gUnknown_085E4A74 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085E4A84 bl gpu_pal_obj_alloc_and_load_multiple ldr r4, =0x02037914 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, =0x03005e00 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, =task_intro_2 str r0, [r1] add sp, 0xC pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_816CBE8 bl SetVBlankCallback movs r1, 0xFA lsls r1, 5 movs r0, 0 bl lcd_io_set ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_3 str r1, [r0] ldr r0, =0x030062a0 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 .pool 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, =0x030062a0 ldr r0, [r5] cmp r0, 0x4C bne @0816D1BE ldr r2, =0x02020630 ldr r1, =0x03005e00 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, =task_intro_3_1 movs r1, 0 bl AddTask @0816D1CC: ldr r0, [r5] cmp r0, 0xFB bne @0816D1EE ldr r2, =0x02020630 ldr r1, =0x03005e00 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, =task_intro_3_2 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, =task_intro_3_3 movs r1, 0 bl AddTask @0816D252: ldr r0, [r5] cmp r0, r4 bls @0816D27A ldr r1, =0x03005e00 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, =task_intro_4 str r1, [r0] @0816D27A: add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @0816D2D8: ldr r0, =gUnknown_085E4AB8 ldr r2, =gUnknown_085E4AD0 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 .pool @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, =0x030062a0 ldr r2, [r5] ldr r0, =0x00000387 cmp r2, r0 bhi @0816D418 ldr r0, =0x03005e00 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, =0xffffa000 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, =0xffff8000 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, =0xffff4000 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, =gUnknown_085E4FC4 movs r1, 0x78 movs r2, 0xA0 movs r3, 0xA bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 adds r1, 0x3E ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] b @0816D43E .align 2, 0 .pool @0816D418: ldr r0, =0x000003ef cmp r2, r0 bls @0816D43E movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_5 str r1, [r0] @0816D43E: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030062a0 ldr r1, [r0] ldr r0, =0x00000402 cmp r1, r0 bls @0816D476 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =task_intro_6 str r0, [r1] @0816D476: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bd24 movs r1, 0 strh r1, [r0] ldr r0, =0x0203bd26 strh r1, [r0] ldr r0, =0x0203bccc strh r1, [r0] movs r0, 0x1 bl load_intro_part2_graphics ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_7 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcc8 ldrh r0, [r0] cmp r0, 0 bne @0816D504 ldr r0, =gUnknown_085F52BC bl gpu_tile_obj_decompress_and_load b @0816D50A .align 2, 0 .pool @0816D504: ldr r0, =gUnknown_085F52CC bl gpu_tile_obj_decompress_and_load @0816D50A: ldr r0, =gUnknown_085F52DC bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F52FC bl gpu_tile_obj_decompress_and_load movs r6, 0 lsls r7, r4, 2 ldr r5, =gUnknown_085E4AE8 @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, =gUnknown_085F530C bl gpu_pal_obj_alloc_and_load_multiple ldr r0, =gUnknown_085E4B08 bl gpu_pal_obj_alloc_and_load_multiple ldr r0, =gUnknown_085E4BDC 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, =gUnknown_085E4BA4 movs r1, 0x90 lsls r1, 1 movs r2, 0x6E movs r3, 0x1 bl obj_add_from_template_forward_search ldr r0, =0x0203bcc8 ldrh r0, [r0] cmp r0, 0 bne @0816D590 adds r0, r5, 0 movs r1, 0x64 bl sub_817B834 b @0816D598 .align 2, 0 .pool @0816D590: adds r0, r5, 0 movs r1, 0x64 bl sub_817B88C @0816D598: lsls r0, 24 lsrs r6, r0, 24 ldr r2, =0x02020630 lsls r0, r6, 4 adds r0, r6 lsls r0, 2 adds r5, r2, 0 adds r5, 0x1C adds r3, r0, r5 ldr r1, =sub_816F9D4 str r1, [r3] adds r2, 0x8 adds r0, r2 ldr r1, =gUnknown_085E4DC4 str r1, [r0] ldr r0, =0x03005e00 adds r4, r7, r4 lsls r4, 3 adds r4, r0 strh r6, [r4, 0xA] ldr r0, =gUnknown_085E4B40 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, =sub_816FAB0 str r1, [r0] strh r6, [r4, 0xC] movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =sub_816CBE8 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, =task_intro_8 str r0, [r4] add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_intro_7 thumb_func_start task_intro_8 ; void task_intro_8(int task_id) task_intro_8: ; 816D650 push {r4-r7,lr} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 ldr r5, =0x030062a0 ldr r1, [r5] movs r0, 0xE8 lsls r0, 3 cmp r1, r0 bne @0816D67C ldr r1, =0x0203bd28 movs r0, 0x2 strh r0, [r1] ldr r1, =0x03005e00 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, =0x0000079a cmp r1, r0 bls @0816D6A4 movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0x8 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_9 str r1, [r0] @0816D6A4: ldr r1, [r5] ldr r0, =0x00000455 ldr r3, =0x03005e00 cmp r1, r0 bne @0816D6C8 ldr r2, =0x02020630 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, =0x000004be cmp r1, r0 bne @0816D6EA ldr r2, =0x02020630 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, =0x00000572 cmp r1, r0 bne @0816D70C ldr r2, =0x02020630 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, =0x00000576 cmp r1, r0 bne @0816D72E ldr r2, =0x02020630 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, =0x02020630 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, =0x000006bf cmp r1, r0 bne @0816D774 ldr r2, =0x02020630 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, =0x0203bccc strh r0, [r1] ldrh r2, [r4, 0xE] movs r7, 0xE ldrsh r1, [r4, r7] ldr r0, =0x000001ff 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 .pool 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, =0x030062a0 ldr r1, [r0] ldr r0, =0x00000814 cmp r1, r0 bls @0816D806 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =task_intro_10 str r0, [r1] @0816D806: pop {r0} bx r0 .align 2, 0 .pool 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, =@0816D840 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =@0816D9DC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0816D9DC: .4byte @0816D9F4 .4byte @0816DA08 .4byte @0816DA20 .4byte @0816DA64 .4byte @0816DA9A .4byte @0816DACA @0816D9F4: ldr r0, =0x030062a0 ldr r1, [r0] movs r0, 0x99 lsls r0, 3 cmp r1, r0 bne @0816DADA b @0816DABA .align 2, 0 .pool @0816DA08: ldr r0, =0x030062a0 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 .pool @0816DA20: ldr r0, =0x030062a0 ldr r1, [r0] ldr r0, =0x000006c7 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 .pool @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, =0x030062a0 ldr r1, [r0] ldr r0, =0x0000073f 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 .pool 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, =0x030062a0 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 .pool @0816DB1C: ldrh r0, [r4, 0x20] subs r0, 0x2 strh r0, [r4, 0x20] ldr r0, =0x030062a0 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 .pool @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, =gUnknown_085E3854 movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_085E3724 ldr r1, =0x06004000 bl LZ77UnCompVram ldr r0, =gUnknown_085E3524 movs r2, 0x80 lsls r2, 2 movs r1, 0 bl gpu_pal_apply ldr r0, =0x03005e00 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, =0x0000ffff str r1, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r1, =0x00004883 movs r0, 0xC bl lcd_io_set ldr r1, =0x00001441 movs r0, 0 bl lcd_io_set ldr r0, =task_intro_11 str r0, [r4] ldr r0, =0x030062a0 str r5, [r0] movs r0, 0xDD lsls r0, 1 bl m4aSongNumStart add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x000006bf 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 .pool @0816DCA4: ldr r0, =task_intro_12 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, =0x030062a0 ldr r0, [r0] cmp r0, 0x1C bne @0816DCE6 movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff 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 .pool 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, =0x030062a0 ldr r0, [r0] cmp r0, 0x2B bls @0816DD18 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =task_intro_13 str r0, [r1] @0816DD18: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x0300301c movs r0, 0x8 strb r0, [r1] ldr r0, =gUnknown_08D88494 movs r1, 0xC0 lsls r1, 19 bl call_LZZUnCompVram ldr r0, =gUnknown_08D88D40 ldr r1, =0x0600c000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D89F7C ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D8A818 ldr r1, =0x0600e000 bl call_LZZUnCompVram ldr r0, =gUnknown_08524D14 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_0852561C bl gpu_pal_obj_decompress_and_apply3 ldr r0, =gUnknown_08D85CD0 ldr r1, =0x02037714 movs r2, 0x80 lsls r2, 1 bl CpuSet ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_14 str r1, [r0] @0816DD94: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000b880 movs r0, 0xC bl lcd_io_set ldr r1, =0x00001c05 movs r0, 0xA bl lcd_io_set ldr r1, =0x00003641 movs r0, 0 bl lcd_io_set movs r0, 0x1 negs r0, r0 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r0 movs r0, 0 strh r0, [r4, 0x8] ldr r0, =0x0000ffa0 strh r0, [r4, 0xA] ldr r1, =0x0000ff51 strh r1, [r4, 0xC] movs r2, 0x80 lsls r2, 1 strh r2, [r4, 0xE] movs r3, 0 bl sub_816F2A8 ldr r0, =task_intro_15 str r0, [r4] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @0816DEB8: movs r1, 0x82 lsls r1, 6 movs r0, 0x44 bl lcd_io_set ldr r0, =task_intro_16 str r0, [r4] @0816DEC6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_intro_15 thumb_func_start task_intro_16 task_intro_16: ; 816DED0 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =task_intro_17 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0 strh r2, [r1, 0x8] ldr r0, =task_intro_18 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 .pool 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, =0x03005e08 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, =@0816DF94 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08D85CD0 adds r0, r1 ldr r1, =0x02037b52 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 .pool @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, =gUnknown_08D85CD0 adds r0, r1 ldr r1, =0x02037b52 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 .pool @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, =0x00000195 str r1, [sp] movs r1, 0 movs r2, 0x64 movs r3, 0xA bl sub_80A344C b @0816E14E .align 2, 0 .pool @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, =0x00000666 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, =0x00007fff 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 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0816E176 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_19 str r1, [r0] ldr r1, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] @0816E176: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r5, =gUnknown_085E4C64 @0816E19C: movs r0, 0 ldrsh r1, [r5, r0] lsls r3, r4, 24 lsrs r3, 24 ldr r0, =gUnknown_08596C10 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, =sub_816E1F8 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 .pool 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, =gUnknown_085E4C64 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, =0x03005e00 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 .pool @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, =gUnknown_08D89224 movs r1, 0xC0 lsls r1, 19 bl call_LZZUnCompVram ldr r0, =gUnknown_08D89ABC ldr r1, =0x0600c000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D8A934 ldr r1, =0x0600e000 bl call_LZZUnCompVram ldr r0, =gUnknown_085E4C88 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085E4C98 bl gpu_pal_obj_alloc_tag_and_apply movs r0, 0x2 negs r0, r0 ldr r1, =0x0000ffff str r1, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =task_intro_20 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 .pool 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, =0x03005e08 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, =@0816E394 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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 .pool @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, =0x03005e00 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, =0xfffffefe 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 .pool @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, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r2, =0xffffff00 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 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @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, =gUnknown_08D85CD0 adds r0, r1 ldr r1, =0x02037b72 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 .pool @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, =gUnknown_08D85CD0 adds r0, r1 ldr r1, =0x02037b72 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 .pool @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, =0x03005e00 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, =0x00007fff str r1, [sp] movs r1, 0x3 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @0816E690 .align 2, 0 .pool @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, =0x03005e00 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 .pool @0816E69C: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0816E6BC ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_21 str r1, [r0] ldr r1, =0x02039b28 movs r0, 0x3 strb r0, [r1, 0x15] @0816E6BC: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E4CA8 ldr r0, =0x02020630 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, =gUnknown_085E4D14 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 .pool 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, =gUnknown_085E4CA8 adds r4, r7, 0x4 movs r6, 0x24 ldr r0, =0x02020630 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, =gUnknown_085E4D14 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 .pool 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, =0x03005e00 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 .pool @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, =0x00001f1f 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, =0x00005a04 movs r0, 0xA bl lcd_io_set ldr r1, =0x00001c06 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, =0x0000ffb0 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, =gUnknown_08D8AA54 movs r1, 0xC0 lsls r1, 19 adds r0, r4, 0 bl call_LZZUnCompVram ldr r1, =0x06004000 adds r0, r4, 0 bl call_LZZUnCompVram ldr r0, =gUnknown_08D8B6E8 ldr r1, =0x0600e000 bl call_LZZUnCompVram ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_22 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08D8B180 ldr r1, =0x0600c000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D8B440 ldr r1, =0x0600d000 bl call_LZZUnCompVram ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_23 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_24 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 .pool 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, =0x03005e08 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 .pool @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, =0x0000ffff 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 .pool @0816EA58: movs r0, 0xC ldrsh r1, [r4, r0] movs r0, 0xA0 lsls r0, 6 cmp r1, r0 bne @0816EA74 ldr r0, =0x0000fffe ldr r1, =0x00002949 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 .pool @0816EA90: ldr r0, =0x02037fd4 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, =task_intro_25 str r1, [r0] @0816EAA6: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08D8C16C ldr r1, =0x0600e000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D8CCC8 ldr r1, =0x0600c000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D8BA74 ldr r1, =0x06004000 bl call_LZZUnCompVram ldr r0, =gUnknown_08D8C838 movs r1, 0xC0 lsls r1, 19 bl call_LZZUnCompVram movs r1, 0xD5 lsls r1, 6 movs r0, 0 bl lcd_io_set ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_26 str r1, [r0] movs r2, 0 strh r2, [r0, 0x8] movs r1, 0x1 strh r1, [r0, 0x14] strh r2, [r0, 0x16] ldr r0, =gUnknown_085E4BF4 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_085E4C04 bl gpu_pal_obj_alloc_and_load_multiple pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool @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, =gUnknown_085E4C4C 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, =0x02020630 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 .pool @0816EBE0: ldrh r0, [r6, 0xC] subs r0, 0x1 strh r0, [r6, 0xC] lsls r0, 16 cmp r0, 0 bne @0816EC62 ldr r4, =gUnknown_085E4C4C 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, =0x02020630 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 .pool @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, =task_intro_27 str r1, [r0] @0816EC62: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08D85CD0 adds r0, r1 ldr r1, =0x02037bce 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, =gUnknown_08D85CD0 adds r0, r1 ldr r1, =0x02037bce 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 .pool 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, =gUnknown_085E5048 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085E5058 bl gpu_pal_obj_alloc_and_load_multiple movs r1, 0xD5 lsls r1, 6 movs r0, 0 bl lcd_io_set ldr r6, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r6 ldr r0, =task_intro_28 str r0, [r4] ldr r0, =0x0000ffde ldr r1, =0x00002949 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, =0x0000fff0 strh r1, [r4, 0xC] ldr r0, =0x0000ff78 strh r0, [r4, 0xE] strh r1, [r4, 0x10] ldr r0, =sub_816EEA8 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 .pool 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, =0x03005e08 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 .pool @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, =0x02037fd4 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 .pool @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, =task_intro_29 str r1, [r0] @0816EE86: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_816CC54 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =@0816EEDC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08D85E72 adds r0, r1 ldr r1, =0x02037bd0 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 .pool @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, =gUnknown_08D85E72 adds r0, r1 ldr r1, =0x02037bc4 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 .pool @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, =gUnknown_08D85E52 adds r0, r1 ldr r1, =0x02037bcc 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, =gUnknown_085E5030 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, =0x02020630 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 .pool @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, =0x00002949 movs r0, 0x50 movs r1, 0x10 bl pal_fade_1 ldr r4, =gUnknown_08D85E7C ldr r5, =0x02037bd0 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 .pool @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, =0x00007fff 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 .pool @0816F0A0: ldr r0, =0x02037fd4 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 .pool thumb_func_end sub_816EEA8 thumb_func_start intro_reset_and_hide_bgs ; void 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x1 beq @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, =gUnknown_0853FF70 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 .pool @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, =gUnknown_0853FF70 ands r0, r1 adds r0, r2 ldrh r1, [r0] movs r0, 0x52 bl lcd_io_set b @0816F1DA .align 2, 0 .pool @0816F1A0: ldr r0, =gUnknown_0853FF70 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 .pool @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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x1 beq @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, =gUnknown_0853FF70 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 .pool @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, =gUnknown_0853FF70 ands r0, r1 adds r0, r2 ldrh r1, [r0] movs r0, 0x52 bl lcd_io_set b @0816F2A2 .align 2, 0 .pool @0816F258: ldr r0, =gUnknown_0853FF70 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 .pool @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, =0x02020630 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, =sub_816F318 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 .pool @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, =sub_816F46C str r0, [r1, 0x1C] @0816F464: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fffc strh r0, [r7, 0x24] movs r0, 0x80 strh r0, [r7, 0x36] ldr r0, =sub_816F5B4 str r0, [r7, 0x1C] b @0816F59E .align 2, 0 .pool @0816F4AC: ldrh r1, [r7, 0x36] ldr r5, =gUnknown_08329F40 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 .pool 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, =gUnknown_08329F40 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 .pool @0816F64C: movs r0, 0 strh r0, [r4, 0x36] ldr r0, =sub_816F660 str r0, [r4, 0x1C] @0816F654: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08329F40 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 .pool @0816F6C0: ldr r0, =sub_816F6D0 str r0, [r1, 0x1C] @0816F6C4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_816F318 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 .pool 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, =sub_816F318 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 .pool 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, =gUnknown_085E4D64 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, =0x02020630 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, =sub_816F454 b @0816F8A0 .align 2, 0 .pool @0816F898: mov r0, r9 adds r0, 0x1C adds r0, r5, r0 ldr r1, =sub_816F750 @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, =gUnknown_085E4D64 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, =0x02020630 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, =0x0202064c adds r4, r2 ldr r0, =sub_816F3A4 str r0, [r4] ldr r0, =gUnknown_085E4D64 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, =0x0202064c adds r4, r0 ldr r1, =sub_816F3A4 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 .pool 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, =@0816F9F0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030062a0 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 .pool @0816FA30: ldrh r2, [r4, 0x20] movs r1, 0x20 ldrsh r0, [r4, r1] cmp r0, 0x78 ble @0816FA46 ldr r0, =0x030062a0 ldr r0, [r0] movs r1, 0x7 ands r0, r1 cmp r0, 0 beq @0816FA6E @0816FA46: adds r0, r2, 0x1 b @0816FA60 .align 2, 0 .pool @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, =0x030062a0 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 .pool @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, =0x0000ffff strh r0, [r4, 0x26] b @0816FAAA .align 2, 0 .pool @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, =0x0000012f cmp r0, r1 bgt @0816FAE4 ldrh r0, [r4, 0x24] adds r0, 0x8 b @0816FB10 .align 2, 0 .pool @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, =0x0203bccc 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 .pool 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, =@0816FB54 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030062a0 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 .pool @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, =gUnknown_08D85C50 adds r0, r4 ldr r5, =0x02037d52 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 .pool @0816FC14: movs r1, 0x30 ldrsh r0, [r6, r1] lsls r0, 1 ldr r4, =gUnknown_08D85C50 adds r0, r4 ldr r5, =0x02037d52 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 .pool @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, =gUnknown_08D85C50 adds r0, r4 ldr r5, =0x02037d52 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 .pool @0816FCC4: ldr r0, =0x030062a0 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 .pool @0816FCF4: ldr r1, =gUnknown_085E4F48 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 .pool 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, =0x030062a0 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 .pool @0816FD7C: ldr r0, =0x030062a0 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 .pool @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, =gUnknown_085E4E94 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, =0xfffc0000 adds r2, r3 ldr r0, =gUnknown_085E4F5C 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, =0x02020630 adds r4, r0 movs r1, 0 strh r1, [r4, 0x2E] ldr r0, =gUnknown_085E4FA4 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, =gUnknown_085E4E94 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, =gUnknown_085E4F8C 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, =0x02020630 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 .pool 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, =gUnknown_08329F40 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 .pool @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, =gUnknown_08329F40 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 .pool thumb_func_end sub_8170040 thumb_func_start sub_81700F8 sub_81700F8: ; 81700F8 push {r4,r5,lr} ldr r5, =0x04000208 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, =0x030022c0 ldr r0, =0x00000439 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, =0x03006210 ldrh r0, [r0] cmp r0, 0 beq @08170148 cmp r0, 0x2 bne @0817014C @08170148: bl init_sav2 @0817014C: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x15] lsls r0, 31 lsrs r0, 31 bl sub_82E1810 ldr r0, =0x02000000 movs r1, 0xE0 lsls r1, 9 bl init_malloc ldr r0, =sub_8086230 bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcd0 movs r0, 0x89 lsls r0, 4 bl malloc str r0, [r4] ldr r1, =0x0000088c adds r2, r0, r1 movs r1, 0 strh r1, [r2] str r5, [r0] ldr r0, =sub_81701C4 bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E5068 movs r0, 0x1 movs r2, 0x2 bl bg_vram_setup ldr r0, =gUnknown_085E5070 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, =sub_8170274 bl set_callback2 ldr r0, =sub_8170260 bl SetVBlankCallback pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcd0 ldr r0, [r1] ldr r2, =0x0000088c adds r0, r2 ldrh r0, [r0] adds r4, r1, 0 cmp r0, 0x6 bls @081702A6 b @08170416 @081702A6: lsls r0, 2 ldr r1, =@081702BC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0000088c adds r1, r0 b @081703D8 .align 2, 0 .pool @08170300: movs r0, 0x1 movs r1, 0 movs r2, 0x27 movs r3, 0xD bl SetWindowBorderStyle ldr r5, =gUnknown_085EE8F1 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 .pool @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, =0x0203bcd0 ldr r1, [r0] ldr r0, =0x0000088c adds r1, r0 b @081703D8 .align 2, 0 .pool @08170380: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08170416 ldr r1, [r4] b @081703D4 .align 2, 0 .pool @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, =0x0203bcd0 ldr r1, [r0] ldr r0, =0x0000088c adds r1, r0 b @081703D8 .align 2, 0 .pool @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, =0x0203bcd0 ldr r1, [r0] @081703D4: ldr r2, =0x0000088c adds r1, r2 @081703D8: ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @08170416 .align 2, 0 .pool @081703E8: ldr r0, =0x02037fd4 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, =0x0203bcd0 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 .pool thumb_func_end sub_8170290 thumb_func_start sub_8170428 sub_8170428: ; 8170428 push {r4,lr} sub sp, 0xC ldr r4, =0x0203bcd0 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 .pool @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, =0x02038436 ldrb r4, [r0] ldr r0, =0x02022e24 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e26 strh r1, [r0] ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set ldr r1, =0x00003f3d movs r0, 0x4A bl lcd_io_set movs r1, 0x80 lsls r1, 8 movs r0, 0 bl lcd_io_set_bits ldr r1, =0x00003f42 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, =0x03005d70 adds r4, r0 ldrb r0, [r4] ldr r1, =0x02020630 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, =nullsub_12 bl object_new_hidden_with_callback lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x14] ldr r0, =nullsub_12 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, =nullsub_12 str r1, [r6] add r4, r9 str r1, [r4] mov r0, sp bl sub_80A6B30 mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08C2EA9C bl sub_80A6D48 mov r0, sp ldrb r0, [r0, 0x9] ldr r1, =gUnknown_08C2EA50 mov r2, sp ldrh r2, [r2, 0xA] bl sub_80A6CC0 ldr r0, =gUnknown_08C2DDA4 mov r1, sp ldrb r1, [r1, 0x8] lsls r1, 4 movs r2, 0x20 bl decompress_palette ldr r1, =0x02022e18 ldrh r0, [r7, 0x20] negs r0, r0 adds r0, 0x20 strh r0, [r1] ldr r1, =0x02022e1a ldrh r0, [r7, 0x22] negs r0, r0 subs r0, 0x20 strh r0, [r1] ldr r1, =0x03005e00 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, =sub_8170660 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 .pool 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, =0x02038436 ldrb r0, [r0] mov r8, r0 ldr r1, =0x03005e00 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, =0x02022e1a 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 .pool @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, =0x02022e24 strh r4, [r0] ldr r0, =0x02022e26 strh r4, [r0] ldr r4, =0x00003f3f 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, =0x02020630 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, =0x03005d70 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 .pool 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, =0x03005d70 adds r2, r0 ldrb r0, [r2] lsls r5, r0, 4 adds r5, r0 lsls r5, 2 ldr r0, =0x02020630 adds r5, r0 ldrb r1, [r5, 0x6] mov r10, r1 ldrh r4, [r5, 0x38] lsls r4, 24 lsrs r4, 24 ldr r0, =0x0000d709 bl gpu_pal_alloc_new mov r2, r9 strb r0, [r2] ldr r0, =0x0000d70a 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, =0x02020630 adds r6, r2 ldrb r4, [r6, 0x5] lsrs r4, 4 lsls r4, 4 orrs r4, r3 lsls r0, 1 ldr r1, =0x02037714 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, =0x02020630 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 .pool 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, =0x02038436 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 .pool 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, =0x03005d70 adds r0, r1 ldrb r0, [r0] ldr r1, =0x02020630 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, =0x0000d709 bl gpu_pal_free_tag ldr r0, =0x0000d70a bl gpu_pal_free_tag ldr r0, =0x0000d6ff bl gpu_pal_tags_index_of adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x0000d704 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 .pool 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, =0x02038436 ldrb r0, [r0] bl sub_817094C adds r0, r4, 0 bl move_anim_task_del pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81709EC thumb_func_start sub_8170A0C sub_8170A0C: ; 8170A0C lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =0x0203841e ldrh r0, [r2] strh r0, [r1, 0x1C] ldrh r0, [r2, 0x2] strh r0, [r1, 0x1E] ldr r0, =sub_8170A38 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005e00 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, =0x0000d709 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 .pool @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, =0x00007f74 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 .pool @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, =0x00007f74 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 .pool 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, =0x020241e4 ldr r0, =0x02038436 ldrb r0, [r0] adds r0, r1 ldrb r5, [r0] ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0x1 beq @08170B52 cmp r0, 0x1 bgt @08170B3C cmp r0, 0 beq @08170B42 b @08170BA4 .align 2, 0 .pool @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, =0x000002cf cmp r1, r0 ble @08170BA4 @08170B76: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @08170BA4 .align 2, 0 .pool @08170B84: adds r0, r5, 0 bl sub_80A7344 ldr r1, =0x02020630 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 .pool 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, =0x020241e4 ldr r4, =0x02038436 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, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec b @08170C08 .align 2, 0 .pool @08170BF8: ldr r1, =0x0202406e ldrb r0, [r4] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 @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, =0x03005e00 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 .pool @08170C44: ldr r5, =0x02038436 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, =0x02020630 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 .pool @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, =0x02024208 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 .pool 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, =0x02024208 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 .pool thumb_func_end sub_8170D24 thumb_func_start sub_8170D4C sub_8170D4C: ; 8170D4C push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x8] cmp r0, 0x5 bne @08170D70 ldr r1, =0x0203841e ldr r0, =0x0000ffff b @08170D74 .align 2, 0 .pool @08170D70: ldr r1, =0x0203841e movs r0, 0 @08170D74: strh r0, [r1, 0xE] adds r0, r2, 0 bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool 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, =@08170DA0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02024208 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, =gUnknown_0832C588 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, =0x02020630 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, =0x02038437 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, =sub_8171104 str r0, [r4] ldr r0, =0x020244d0 ldr r0, [r0] ldr r3, [r0, 0x8] ldr r1, =0x020241e4 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, =0x03005e00 mov r2, r10 lsls r0, r2, 2 add r0, r10 lsls r0, 3 adds r0, r1 strh r5, [r0, 0x8] ldr r1, =sub_8170EF0 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 .pool thumb_func_end sub_8170E04 thumb_func_start sub_8170EF0 sub_8170EF0: ; 8170EF0 push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r1, =0x03005e00 lsls r0, r3, 2 adds r0, r3 lsls r0, 3 adds r0, r1 ldrb r1, [r0, 0x8] ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x2E] ldr r0, =0x0000ffff cmp r1, r0 bne @08170F1A adds r0, r3, 0 bl move_anim_task_del @08170F1A: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022fec 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 .pool @08170F50: movs r6, 0x17 movs r5, 0x5 @08170F54: ldr r0, =0x02024208 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, =gUnknown_0832C588 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, =0x02020630 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, =0x02038437 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, =nullsub_12 str r0, [r4] movs r0, 0 bl battle_get_side_with_given_state ldr r1, =0x020241e4 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, =sub_8039E84 str r1, [r0] ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 strh r5, [r0, 0x8] ldr r1, =sub_8171030 str r1, [r0] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 movs r0, 0 bl battle_get_side_with_given_state ldr r1, =0x020241e4 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, =0x03005e00 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, =sub_8171104 str r1, [r0] ldr r0, =sub_81710A8 movs r1, 0xA bl AddTask ldr r0, =sub_8170EF0 str r0, [r4] @0817108A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 movs r0, 0 bl battle_get_side_with_given_state ldr r4, =0x020241e4 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 .pool 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, =0x0000ffd8 strh r0, [r4, 0x38] adds r0, r4, 0 bl sub_80A68D4 ldr r0, =sub_8171134 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x8] cmp r0, 0x5 bne @08171160 ldr r0, =sub_8171CAC str r0, [r4, 0x1C] b @081711D2 .align 2, 0 .pool @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, =sub_81711E8 str r0, [r4, 0x1C] ldr r0, =0x02024208 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, =0x02038437 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 .pool 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, =nullsub_4 movs r1, 0x32 bl AddTask lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x38] ldr r0, =sub_8171240 str r0, [r4, 0x1C] ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02038437 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 .pool thumb_func_end sub_81711E8 thumb_func_start sub_8171240 sub_8171240: ; 8171240 push {r4-r7,lr} adds r7, r0, 0 ldr r1, =0x020241e4 ldr r0, =0x02038437 ldrb r0, [r0] adds r0, r1 ldrb r4, [r0] ldrh r0, [r7, 0x38] lsls r0, 24 lsrs r6, r0, 24 ldr r1, =0x03005e00 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 .pool @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, =0x030062dc movs r0, 0x1C str r0, [r1] ldr r2, =0x030062e4 ldr r1, =0x02020630 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, =0x030062e0 ldrh r0, [r2] lsls r0, 8 movs r1, 0x1C bl __udivsi3 strh r0, [r4] strh r0, [r5, 0xC] b @08171346 .align 2, 0 .pool @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, =0x02020630 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, =0x0000047f cmp r1, r0 ble @0817137C b @08171346 .align 2, 0 .pool @0817132C: adds r0, r4, 0 bl sub_80A7344 ldr r1, =0x02020630 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 .pool @08171354: ldr r0, =0x03005e00 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, =sub_817138C str r0, [r7, 0x1C] @0817137C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81713D0 str r0, [r4, 0x1C] @081713C6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000101 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 .pool @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, =0xffffff00 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, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] ldrb r0, [r0, 0x8] cmp r0, 0 bne @081714C0 strh r5, [r4, 0x38] ldr r0, =sub_81717B4 str r0, [r4, 0x1C] b @081714CA .align 2, 0 .pool @081714C0: ldr r0, =sub_81714D4 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 .pool 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, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] strh r5, [r0, 0xC] ldr r0, =sub_8171520 str r0, [r4, 0x1C] movs r0, 0x17 bl audio_play @08171510: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =@08171540 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08171540: .4byte @0817155C .4byte @081715AE .4byte @081715F4 .4byte @08171654 .4byte @081716A4 .4byte @08171708 .4byte @08171768 @0817155C: ldr r1, =0x020244d0 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 .pool @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, =0x020244d0 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 .pool @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, =0x020244d0 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 .pool @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, =0x020244d0 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, =sub_81717B4 str r0, [r4, 0x1C] b @081717AE .align 2, 0 .pool @08171740: cmp r0, 0x4 bne @08171754 cmp r1, 0x3 bne @08171754 ldr r0, =sub_81717D8 str r0, [r4, 0x1C] b @0817175A .align 2, 0 .pool @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, =0xffffff00 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 .pool @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, =sub_8171AE4 str r0, [r1, 0x1C] @081717CE: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81717F8 str r1, [r0, 0x1C] movs r1, 0 strh r1, [r0, 0x34] strh r1, [r0, 0x36] strh r1, [r0, 0x38] bx lr .align 2, 0 .pool 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, =0x02038437 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 .pool @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, =0x020244b9 movs r1, 0 strb r1, [r0] movs r0, 0x1 bl sub_8072A88 bl m4aMPlayAllStop ldr r0, =0x00000213 bl audio_play b @081718BC .align 2, 0 .pool @08171880: ldr r0, =0x0000013b cmp r1, r0 bne @081718BC ldr r5, =0x02020630 ldr r4, =0x020241e4 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, =sub_81718D8 str r0, [r6, 0x1C] @081718BC: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00007fff str r0, [sp] adds r0, r1, 0 movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @08171982 .align 2, 0 .pool @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, =0x02037fd4 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, =sub_81719C0 str r0, [r4, 0x1C] @081719B0: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff strh r0, [r4, 0x2E] b @081719E4 .align 2, 0 .pool @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, =0x02020630 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, =gUnknown_085E5250 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, =gUnknown_085E5088 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, =sub_8171AAC str r0, [r4] ldr r0, =gUnknown_085E51B4 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 .pool 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, =sub_8171BAC str r0, [r4, 0x1C] ldr r0, =0x02024208 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, =0x02038437 ldrb r1, [r0] movs r0, 0x1 movs r2, 0xE adds r3, r5, 0 bl sub_81729E8 @08171B36: ldr r6, =0x02020630 ldr r5, =0x020241e4 ldr r4, =0x02038437 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 .pool 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, =0x02020630 ldr r3, =0x020241e4 ldr r2, =0x02038437 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 .pool @08171C04: ldr r6, =0xfffffee0 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, =0x02020630 ldr r3, =0x020241e4 ldr r2, =0x02038437 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, =0x020244d0 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, =sub_81719C0 str r0, [r7, 0x1C] ldr r0, =0x020244b9 strb r6, [r0] movs r0, 0x1 bl sub_8072A88 @08171C8A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8171CE8 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 .pool 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, =sub_81719C0 str r0, [r4, 0x1C] ldr r1, =0x020244b9 movs r0, 0 strb r0, [r1] movs r0, 0x1 bl sub_8072A88 @08171D52: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8171CE8 thumb_func_start sub_8171D60 sub_8171D60: ; 8171D60 push {r4,r5,lr} lsls r0, 24 ldr r1, =gUnknown_085E5094 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, =0xffff0000 cmp r0, r1 bne @08171D86 adds r0, r4, 0 bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_085E50F4 adds r0, r5, r0 bl gpu_pal_obj_decompress_and_apply3 @08171D86: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E51C0 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, =0x03005e00 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 .pool thumb_func_end sub_8171D98 thumb_func_start sub_8171E20 sub_8171E20: ; 8171E20 push {lr} ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08171E3E ldr r0, =0x020244d0 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 .pool 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, =0x03005e00 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, =gUnknown_085E51F0 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, =0x02020630 adds r7, r4, r5 ldr r0, =gUnknown_085E51B4 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, =sub_8171F68 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, =0x03005e00 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, =0x030022c0 ldr r4, =0x00000439 adds r0, r4 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08171F22 ldr r0, =0x02020630 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 .pool @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, =sub_8171F88 str r0, [r1, 0x1C] b @08171F84 .align 2, 0 .pool @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, =0x03005e00 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, =0x02020630 mov r10, r3 mov r1, r8 lsls r0, r1, 1 add r0, r8 lsls r0, 3 str r0, [sp, 0x10] @0817200A: ldr r0, =gUnknown_085E51F0 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, =gUnknown_085E51B4 add r0, r8 ldrb r1, [r0] adds r0, r5, 0 bl obj_anim_image_start ldr r0, =0x0202064c adds r4, r0 ldr r0, =sub_8172508 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08172092 ldr r0, =0x02020630 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 .pool 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, =0x03005e00 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, =0x02020630 mov r10, r3 mov r1, r8 lsls r0, r1, 1 add r0, r8 lsls r0, 3 str r0, [sp, 0x10] @0817210E: ldr r0, =gUnknown_085E51F0 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, =gUnknown_085E51B4 add r0, r8 ldrb r1, [r0] adds r0, r5, 0 bl obj_anim_image_start ldr r0, =0x0202064c adds r4, r0 ldr r0, =sub_8172508 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08172196 ldr r0, =0x02020630 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 .pool 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, =0x03005e00 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, =0x02020630 mov r8, r3 ldr r0, =gUnknown_085E51B4 adds r1, r0 mov r10, r1 @08172212: ldr r0, =gUnknown_085E51F0 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, =0x0202064c adds r4, r0 ldr r0, =sub_8172508 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08172296 ldr r0, =0x02020630 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 .pool 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, =0x03005e00 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, =0x02020630 mov r10, r3 mov r1, r8 lsls r0, r1, 1 add r0, r8 lsls r0, 3 str r0, [sp, 0x10] @08172312: ldr r0, =gUnknown_085E51F0 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, =gUnknown_085E51B4 add r0, r8 ldrb r1, [r0] adds r0, r5, 0 bl obj_anim_image_start ldr r0, =0x0202064c adds r4, r0 ldr r0, =sub_8172508 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @0817239E ldr r0, =0x02020630 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 .pool 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, =0x03005e00 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 .pool @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, =0x02020630 mov r9, r3 ldr r1, =gUnknown_085E51B4 adds r0, r1 mov r10, r0 @08172430: ldr r0, =gUnknown_085E51F0 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, =0x0202064c adds r4, r0 ldr r0, =sub_8172508 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, =0x03005e00 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, =0x030022c0 ldr r4, =0x00000439 adds r0, r4 ldrb r1, [r0] adds r0, r2, 0 ands r0, r1 cmp r0, 0 bne @081724D0 ldr r0, =0x02020630 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 .pool 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, =0x03005e00 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, =0x02020630 mov r8, r3 ldr r0, =gUnknown_085E51B4 adds r1, r0 mov r10, r1 @081725A6: ldr r0, =gUnknown_085E51F0 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, =0x0202064c adds r4, r0 ldr r0, =sub_817265C 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @08172626 ldr r0, =0x02020630 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 .pool 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, =0x03005e00 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, =gUnknown_085E51F0 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, =0x02020630 adds r5, r4, r0 ldr r0, =gUnknown_085E51B4 add r0, r9 ldrb r1, [r0] adds r0, r5, 0 bl obj_anim_image_start ldr r1, =0x0202064c adds r4, r1 ldr r0, =sub_8172508 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 .pool @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, =0x030022c0 ldr r2, =0x00000439 adds r0, r2 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081727C4 ldr r0, =0x02020630 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 .pool 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, =0x03005e00 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, =0x02020630 mov r8, r3 ldr r0, =gUnknown_085E51B4 adds r1, r0 mov r10, r1 @0817282E: ldr r0, =gUnknown_085E51F0 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, =0x0202064c adds r4, r0 ldr r0, =sub_81728E0 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081728A8 ldr r0, =0x02020630 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 .pool 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, =0x030022c0 ldr r1, =0x00000439 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 .pool @08172970: ldr r2, =0x020244d0 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, =gUnknown_085E51C0 b @08172998 .align 2, 0 .pool @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, =gUnknown_085E5094 ldr r4, =gUnknown_085E50F4 @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 .pool @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, =sub_8172AB0 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r1, =0x03005e00 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, =gUnknown_085E5310 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 .pool @08172A58: lsls r0, r6, 20 movs r1, 0x80 lsls r1, 17 adds r0, r1 lsrs r0, 16 ldr r2, =gUnknown_085E5310 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, =0x0000ffff strh r0, [r5, 0xA] ldr r0, =sub_8172B40 str r0, [r5] @08172A7E: ldr r0, =0x00007fff 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 .pool 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, =0x03005e00 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, =gUnknown_085E5310 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 .pool @08172B08: ldr r0, =0x02037fd4 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, =0x00007fff 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08172B78 ldr r0, =0x03005e00 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, =0x00007fff str r1, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =sub_8172B90 str r0, [r4] @08172B78: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_085E5310 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 .pool @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, =0x020241e4 ldr r3, =0x02038436 ldrb r2, [r3] adds r0, r2, r0 ldrb r6, [r0] ldr r1, =0x03005e00 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 .pool @08172C30: cmp r0, 0x2 beq @08172CDA b @08172D8A @08172C36: ldr r0, =0x0203841e 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, =0x02020630 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 .pool @08172C78: ldr r3, =0x02020630 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, =0x03005e00 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 .pool @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, =0x02020630 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 .pool @08172D10: ldr r0, =0x02020630 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldrb r1, [r0, 0x8] strh r1, [r0, 0x8] ldr r0, =0x02038436 ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 beq @08172D68 ldr r0, =0x02020630 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 .pool @08172D68: ldr r0, =0x02020630 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 .pool 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, =0x03005e00 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 .pool @08172DC0: cmp r0, 0x2 beq @08172E4E b @08172E84 @08172DC6: ldr r0, =0x02038436 ldrb r0, [r0] bl battle_get_per_side_status_permutated lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @08172DE8 ldr r1, =0x00003f42 movs r0, 0x50 bl lcd_io_set b @08172DF0 .align 2, 0 .pool @08172DE8: ldr r1, =0x00003f44 movs r0, 0x50 bl lcd_io_set @08172DF0: movs r0, 0x52 movs r1, 0x10 bl lcd_io_set ldr r0, =0x03005e00 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 .pool @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, =0x020241e4 ldr r4, =0x02038436 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] ldr r2, =0x02020630 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, =0x06010000 adds r1, r0 movs r2, 0x80 lsls r2, 4 movs r0, 0 movs r3, 0x1 bl RequestDma3Fill 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 .pool thumb_func_end sub_8172D98 thumb_func_start sub_8172E9C sub_8172E9C: ; 8172E9C push {lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x0203841e ldr r1, =0x020244d0 ldr r2, [r1] ldr r1, =0x02038436 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 .pool thumb_func_end sub_8172E9C thumb_func_start sub_8172ED0 sub_8172ED0: ; 8172ED0 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x02038437 ldr r1, =0x0202420e ldrb r1, [r1] strb r1, [r2] bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244d0 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, =0x0000ffff 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, =0x000027f9 bl gpu_tile_obj_tag_get_range_start lsls r0, 16 lsrs r0, 16 cmp r0, r7 bne @08172F6E ldr r0, =gUnknown_0852528C bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_08525B94 bl gpu_pal_obj_decompress_and_apply3 @08172F6E: ldr r5, =sub_8172FEC 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, =0x03005e00 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 .pool @08172FC8: ldr r0, =0x020244d0 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 .pool 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, =0x03005e00 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 .pool @08173018: ldr r0, =0x020244d0 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, =gUnknown_085CE388 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 .pool @08173074: cmp r0, 0 blt @081730A8 cmp r0, 0x3 bgt @081730A8 ldr r0, =gUnknown_085CE3A0 adds r1, r5, 0 movs r3, 0x5 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02020630 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 .pool @081730A8: ldr r0, =gUnknown_085CE3A0 adds r1, r5, 0 movs r3, 0x5 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02020630 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, =0x000003ff adds r0, r4, 0 ands r1, r0 ldr r0, =0xfffffc00 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] @081730D6: ldr r2, =0x03005e00 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, =0x02020630 lsls r2, r5, 4 adds r0, r2, r5 lsls r0, 2 adds r1, 0x1C adds r0, r1 ldr r1, =sub_81731FC str r1, [r0] adds r4, r2, 0 b @08173160 .align 2, 0 .pool @08173118: ldr r3, =0x02020630 lsls r4, r5, 4 adds r1, r4, r5 lsls r1, 2 adds r0, r3, 0 adds r0, 0x1C adds r0, r1, r0 ldr r2, =sub_8173250 str r2, [r0] adds r1, r3 ldr r0, =0x0000ffe0 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, =0x02020630 adds r0, r4, r5 lsls r0, 2 adds r0, r1 strh r7, [r0, 0x2E] ldr r1, =0x03005e00 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, =sub_81731B0 str r0, [r1] @08173190: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x020244d0 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 .pool 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, =0x03005e00 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 .pool 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, =0x03005e00 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 .pool 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, =gUnknown_085253AC bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_08525CB4 bl gpu_pal_obj_decompress_and_apply3 ldr r0, =0x0000281d bl gpu_pal_tags_index_of adds r0, r4, 0 bl move_anim_task_del pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000281d 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 .pool 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, =0x0203841e 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, =0x0000ffe0 strh r0, [r4, 0x38] adds r0, r4, 0 bl sub_80A68D4 ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02038436 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039E84 str r1, [r0] ldr r0, =sub_817339C str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817330C thumb_func_start sub_817339C sub_817339C: ; 817339C push {lr} adds r3, r0, 0 ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02038436 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, =sub_81733D4 str r0, [r3, 0x1C] @081733C0: pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8173400 str r0, [r4, 0x1C] @081733F6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81733D4 thumb_func_start sub_8173400 sub_8173400: ; 8173400 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x02020630 ldr r3, =0x020241e4 ldr r2, =0x02038436 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 .pool 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, =0x0203841e movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 beq @08173478 cmp r0, 0x1 beq @0817348C b @081734A0 .align 2, 0 .pool @08173478: movs r0, 0 bl battle_get_side_with_given_state ldr r1, =0x02038436 strb r0, [r1] movs r0, 0x1 b @08173498 .align 2, 0 .pool @0817348C: movs r0, 0x1 bl battle_get_side_with_given_state ldr r1, =0x02038436 strb r0, [r1] movs r0, 0 @08173498: bl battle_get_side_with_given_state ldr r1, =0x02038437 strb r0, [r1] @081734A0: adds r0, r4, 0 bl move_anim_task_del pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817345C thumb_func_start sub_81734B4 sub_81734B4: ; 81734B4 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x8] ldrh r1, [r0] cmp r1, 0x53 bne @081734D4 ldr r1, =0x0203841e movs r0, 0x1 b @0817350C .align 2, 0 .pool @081734D4: cmp r1, 0xFA bne @081734E4 ldr r1, =0x0203841e movs r0, 0x2 b @0817350C .align 2, 0 .pool @081734E4: cmp r1, 0x80 bne @081734F4 ldr r1, =0x0203841e movs r0, 0x3 b @0817350C .align 2, 0 .pool @081734F4: movs r0, 0xA4 lsls r0, 1 cmp r1, r0 bne @08173508 ldr r1, =0x0203841e movs r0, 0x4 b @0817350C .align 2, 0 .pool @08173508: ldr r1, =0x0203841e movs r0, 0 @0817350C: strh r0, [r1] adds r0, r2, 0 bl move_anim_task_del pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81734B4 thumb_func_start sub_817351C sub_817351C: ; 817351C push {lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x02038436 ldr r1, =0x020244d0 ldr r2, [r1] ldr r1, [r2, 0x8] ldrh r1, [r1] strb r1, [r3] ldr r3, =0x02038437 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 .pool 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, =0x030022c0 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, =@081735A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203bcdc ldr r0, =0x00002014 bl malloc_and_clear str r0, [r4] ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x1 strb r1, [r0] b @08173688 .align 2, 0 .pool @081735E8: bl sub_8174F70 b @08173642 @081735EE: ldr r1, =0x00003f42 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, =0x0203bcdc ldr r1, [r0] movs r0, 0 strh r0, [r1] b @08173642 .align 2, 0 .pool @08173620: bl sub_8175024 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @08173688 ldr r0, =sub_817354C 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08173688 .align 2, 0 .pool @0817365C: bl fade_and_return_progress_probably ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08173688 ldr r0, =sub_8173560 bl set_callback2 movs r0, 0xDA lsls r0, 1 bl song_play_for_text movs r0, 0 b @0817368A .align 2, 0 .pool @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, =sub_817371C movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] ldr r4, =0x0203bcd8 movs r0, 0x78 bl malloc_and_clear str r0, [r4] @081736C4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817371C movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0x1 strh r0, [r1, 0x8] ldr r4, =0x0203bcd8 movs r0, 0x78 bl malloc_and_clear str r0, [r4] @08173708: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, 2 add r0, r8 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0xC] movs r7, 0 ldr r0, =0x0203bcd8 mov r9, r0 @08173740: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec 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, =0x000001ff adds r1, r2, 0 ands r0, r1 ldrh r1, [r3, 0x8] ldr r5, =0xfffffe00 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, =0x0203bcd8 @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, =0x03005e00 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 .pool @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, =0xfffffe00 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, =0x0203bcd4 movs r3, 0 str r3, [r0] ldr r4, =0x03005e00 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, =sub_8173A8C b @081738A6 .align 2, 0 .pool @081738A4: ldr r0, =sub_81738BC @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 .pool 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, =0x0201c000 ldr r0, =0x0203bce4 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 .pool @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, =0x000001ff 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, =0x0201c000 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, =0x0203bcd8 ldr r1, [r0] adds r0, r7, 0 movs r2, 0x78 bl memcpy movs r0, 0 movs r1, 0 bl sub_81973C4 ldr r2, =gUnknown_082C8959 movs r0, 0 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r0, 0 movs r1, 0x1 movs r3, 0 bl text_box_related_one movs r0, 0 movs r1, 0x3 bl Window_CopyToVram ldr r1, =0x03005e00 mov r0, r8 add r0, r9 lsls r0, 3 adds r0, r1 ldr r1, =sub_81739C4 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 .pool 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, =0x03006214 ldr r0, =sub_81736D8 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, =0x030061fc 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, =0x0203bcdc ldr r0, [r5] cmp r0, 0 beq @08173A06 bl free movs r0, 0 str r0, [r5] @08173A06: ldr r5, =0x0203bcd8 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 .pool @08173A34: movs r0, 0x37 bl audio_play ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8173A5C str r1, [r0] movs r1, 0x20 strh r1, [r0, 0xE] @08173A4C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81739C4 thumb_func_start sub_8173A5C sub_8173A5C: ; 8173A5C push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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 .pool @08173A80: ldr r0, =sub_8173A8C str r0, [r1] @08173A84: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8173A5C thumb_func_start sub_8173A8C sub_8173A8C: ; 8173A8C lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_8173AA8 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005e00 mov r2, r8 lsls r1, r2, 2 add r1, r8 lsls r1, 3 adds r1, r0 ldrh r6, [r1, 0xA] ldr r2, =0x0203bcd8 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, =gUnknown_085E53B4 b @08173AEE .align 2, 0 .pool @08173AEC: ldr r1, =gUnknown_085E53E4 @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, =0x000001ff 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, =0x0000ffff str r3, [sp, 0xC] movs r3, 0x1 bl sub_818D3E4 lsls r0, 24 lsrs r0, 24 ldr r4, =0x02020630 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, =sub_8175120 str r1, [r2] ldr r5, =0x03005e00 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, =sub_8173BC0 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 .pool 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, =0x03005e00 lsls r3, r0, 2 adds r3, r0 lsls r3, 3 adds r5, r3, r4 ldrh r0, [r5, 0xA] ldr r2, =0x0203bcd8 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, =0x02020630 adds r3, r0, r1 ldr r1, [r3, 0x1C] ldr r0, =nullsub_12 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, =sub_8173C34 str r0, [r5] @08173C1A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r6, r0, 3 adds r4, r6, r2 ldrh r3, [r4, 0xA] ldr r1, =0x0203bcd8 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 .pool @08173C78: ldr r2, =0x0203bcd4 ldr r0, =0x02020630 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, =0x000001ff ands r0, r1 cmp r0, 0 beq @08173D04 adds r0, r2, 0x1 strh r0, [r4, 0xA] ldr r0, =0x000063b0 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, =sub_8173AA8 str r0, [r4] b @08173D10 .align 2, 0 .pool @08173D04: lsls r0, r5, 2 adds r0, r5 lsls r0, 3 add r0, r12 ldr r1, =sub_8173D24 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 .pool 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, =0xffff0000 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, =0x03005e08 mov r12, r0 mov r8, r1 ldr r6, =0x02020630 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, =0x03005e00 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, =sub_8173DC0 str r1, [r0] add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08173E04: movs r3, 0 mov r9, r4 ldr r0, =0x0203bcd4 mov r10, r0 adds r4, r5, 0 adds r7, 0x8 mov r8, r7 ldr r7, =0x02020630 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, =0x000063b0 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, =0x03005e00 mov r2, r9 adds r0, r2, r6 lsls r0, 3 adds r0, r1 movs r1, 0x7 strh r1, [r0, 0xE] ldr r1, =sub_8173EA4 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 .pool thumb_func_end sub_8173DC0 thumb_func_start sub_8173EA4 sub_8173EA4: ; 8173EA4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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, =sub_8173EE4 str r0, [r1] b @08173EDE .align 2, 0 .pool @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, =0x03005d90 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, =0x0000ffff str r1, [sp, 0x4] movs r1, 0x1 movs r2, 0x78 movs r3, 0x48 bl sub_818D8AC ldr r1, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r1 strh r0, [r4, 0x10] ldr r0, =gUnknown_085E5380 bl Window_AddFromTemplate ldr r0, [r6] ldrb r1, [r0, 0x14] lsrs r1, 3 ldr r2, =0x0000021d 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, =sub_8173F84 str r0, [r4] add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08173FAC: ldr r2, =0x02020630 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 .pool @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, =gUnknown_085E8C14 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, =sub_8174028 str r0, [r4] @08174018: add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0817404E movs r0, 0x4 bl play_sound_effect ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_8174060 str r0, [r1] @0817404E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037b14 ldr r1, =0x02037714 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81740B0 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08174164 lsls r0, r7, 2 mov r8, r0 ldr r1, =0x03005e00 adds r0, r7 lsls r0, 3 adds r1, 0x12 adds r5, r0, r1 ldr r2, =0x02020630 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, =0x03005e00 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, =0x0203bcdc ldr r0, [r4] cmp r0, 0 beq @08174150 bl free movs r0, 0 str r0, [r4] @08174150: ldr r4, =0x0203bcd8 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 .pool thumb_func_end sub_81740B0 thumb_func_start sub_8174184 sub_8174184: ; 8174184 push {lr} ldr r0, =sub_8175620 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8174184 thumb_func_start sub_8174194 sub_8174194: ; 8174194 push {r4,lr} ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x5 bhi @081741D0 lsls r0, 2 ldr r1, =@081741B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203bcdc ldr r0, =0x00002014 bl malloc_and_clear str r0, [r4] ldr r0, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 movs r1, 0x1 strb r1, [r0] b @08174308 .align 2, 0 .pool @08174200: bl sub_8174F70 ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @081742A2 .align 2, 0 .pool @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, =0x030022c0 movs r4, 0x87 lsls r4, 3 adds r1, r4 b @081742A2 .align 2, 0 .pool @08174240: bl sub_8175024 lsls r0, 24 cmp r0, 0 bne @08174308 ldr r1, =0x0201c000 ldr r0, =gUnknown_085E56D4 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, =sub_817354C bl SetVBlankCallback ldr r1, =0x030022c0 movs r4, 0x87 lsls r4, 3 adds r1, r4 b @081742A2 .align 2, 0 .pool @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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @081742A2: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08174308 .align 2, 0 .pool @081742B0: ldr r1, =0x00003f42 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, =sub_8174324 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, =0x03005e08 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, =0x0203bcd8 movs r0, 0x80 lsls r0, 6 bl malloc_and_clear str r0, [r4] ldr r0, =sub_8173560 bl set_callback2 @08174308: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000226 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, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_81749A0 b @081743DA .align 2, 0 .pool @08174364: ldr r0, =0x0201c000 ldr r4, =0x0203bcd8 ldr r1, [r4] movs r2, 0x80 lsls r2, 5 bl CpuSet ldr r4, [r4] movs r2, 0 ldrh r1, [r4, 0x8] ldr r3, =0x000001ff 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, =0x03005e00 adds r1, r5, r6 lsls r1, 3 adds r1, r0 subs r0, r2, 0x1 b @081743C6 .align 2, 0 .pool @081743BC: ldr r0, =0x03005e00 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, =0x03005e00 adds r1, r5, r6 lsls r1, 3 adds r1, r2 strh r0, [r1, 0xA] ldr r0, =sub_81743EC @081743DA: str r0, [r1] add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bcd8 ldr r3, [r0] movs r5, 0 ldr r1, =0x03005e00 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, =0x0203bcd4 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, =0x000001ff 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, =0x03005e00 ldr r0, [sp, 0x14] add r0, r8 lsls r0, 3 mov r9, r0 adds r0, r1 str r0, [sp, 0x10] ldr r1, =0x000001ff 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, =gUnknown_085E53B4 adds r0, 0x4 adds r0, r1, r0 ldrh r3, [r0] ldr r0, =gUnknown_085E53BA adds r1, r0 ldrh r4, [r1] b @081744C8 .align 2, 0 .pool @081744B8: ldr r0, =gUnknown_085E53E4 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, =0x0000ffff str r3, [sp, 0xC] movs r3, 0x1 bl sub_818D7D8 lsls r0, 16 lsrs r0, 16 ldr r2, =0x02020630 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, =0x03005e08 adds r1, r2 strh r0, [r1] b @0817454E .align 2, 0 .pool @08174540: adds r0, r5, 0x5 lsls r0, 1 add r0, r9 ldr r4, =0x03005e08 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, =0xffff0000 ldr r2, =0x000063b0 movs r1, 0xC bl sub_80A2A20 ldr r0, =0x02021cc4 ldr r1, =0x03005e00 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, =0x02021fc4 ldr r1, =gUnknown_085E8C00 adds r0, r5, 0 bl ExpandTextCodes movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 bgt @081745C0 ldr r1, =gUnknown_085E8574 movs r0, 0x1 str r0, [sp] adds r0, r5, 0 movs r2, 0 movs r3, 0 bl sub_8198204 b @081745D0 .align 2, 0 .pool @081745C0: ldr r1, =gUnknown_085E855C movs r0, 0x1 str r0, [sp] adds r0, r5, 0 movs r2, 0 movs r3, 0 bl sub_8198204 @081745D0: ldr r0, =0x03005e00 ldr r1, [sp, 0x14] add r1, r8 lsls r1, 3 adds r1, r0 ldr r0, =sub_81745FC 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 .pool 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, =0x0203bcd8 ldr r5, [r0] movs r3, 0 ldr r1, =0x03005e00 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, =0x03005e08 mov r10, r0 ldr r1, =0x02020630 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, =0x03005e00 adds r6, r1, r0 movs r2, 0xC ldrsh r0, [r6, r2] adds r0, 0x5 lsls r0, 1 adds r0, r1 ldr r1, =0x03005e00 adds r1, 0x8 adds r0, r1 ldrh r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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, =0xffff0000 eors r0, r1 ldr r2, =0x0203bcd4 str r0, [r2] ldr r2, =0x000063b0 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, =0x000001ff 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, =sub_8174728 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 .pool 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, =0x030022c0 ldrh r2, [r1, 0x2E] movs r0, 0x1 ands r0, r2 adds r3, r1, 0 cmp r0, 0 beq @081747E4 ldr r0, =0x03005e00 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, =0x03005e00 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, =sub_81743EC str r0, [r1] b @08174884 .align 2, 0 .pool @081747B8: bl sub_80A36C8 lsls r0, 24 cmp r0, 0 beq @081747D2 bl sub_80A369C ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl @081747D2: ldr r0, =sub_8174898 str r0, [r4] b @08174884 .align 2, 0 .pool @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, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl @08174806: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_8174898 str r0, [r1] b @08174884 .align 2, 0 .pool @08174828: movs r0, 0x40 ands r0, r2 cmp r0, 0 beq @08174858 ldr r0, =0x03005e00 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, =sub_81745FC str r0, [r1] b @08174884 .align 2, 0 .pool @08174858: ldrh r1, [r3, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08174884 ldr r1, =0x03005e00 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, =sub_81745FC str r0, [r2] @08174884: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037b14 ldr r1, =0x02037714 movs r2, 0x80 lsls r2, 2 bl CpuSet ldr r1, =0x0201c000 ldr r0, =gUnknown_085E56D4 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81748F0 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x0203bcdc ldr r0, [r4] cmp r0, 0 beq @08174974 bl free movs r0, 0 str r0, [r4] @08174974: ldr r4, =0x0203bcd8 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 .pool 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, =gUnknown_085E8588 movs r1, 0x8 movs r2, 0x1 bl sub_8198180 movs r0, 0 movs r1, 0 bl sub_81973C4 ldr r2, =gUnknown_085E8BDC 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8174A08 str r1, [r0] add sp, 0x10 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81749A0 thumb_func_start sub_8174A08 sub_8174A08: ; 8174A08 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08174A28 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_8174898 str r0, [r1] @08174A28: pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E8B3E 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, =gUnknown_085E5388 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 .pool 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, =0x000001ff ands r1, r0 movs r0, 0xCE lsls r0, 1 cmp r1, r0 beq @08174B30 ldr r1, =gUnknown_085E8C36 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, =0x0000ffff 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 .pool @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, =gUnknown_085E5388 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, =0x000001ff 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, =gUnknown_085E5388 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 .pool @08174B8C: movs r0, 0x1 add r1, sp, 0xC movs r2, 0x80 bl sub_81DB368 lsls r2, r0, 24 lsrs r2, 24 ldr r0, =gUnknown_085E5388 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, =gSpeciesNames 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 .pool @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, =gUnknown_085E5388 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, =gUnknown_085E8C3B 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, =gUnknown_085E8C4D 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 .pool 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, =0x0000021d movs r0, 0x1 movs r1, 0 movs r3, 0xD bl SetWindowBorderStyle ldr r0, =gUnknown_085E538C mov r8, r0 str r0, [sp] movs r1, 0x1 negs r1, r1 mov r9, r1 str r1, [sp, 0x4] ldr r0, =gUnknown_085E8C48 str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 movs r2, 0 movs r3, 0x1 bl box_print ldr r0, =0x03005d90 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, =gUnknown_085E8C4D 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, =0x000186a0 adds r0, r4, 0 bl __modsi3 ldr r5, =0x00002710 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, =gUnknown_085E84CE 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, =0x03005d90 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, =gUnknown_085E538C 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 .pool 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, =0x040000d4 movs r5, 0x80 lsls r5, 5 ldr r7, =0x81000800 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, =0x040000d4 mov r1, r8 str r1, [r2] str r0, [r2, 0x4] lsrs r0, r3, 2 movs r1, 0x85 lsls r1, 24 orrs r0, r1 str r0, [r2, 0x8] ldr r0, [r2, 0x8] movs r1, 0xA0 lsls r1, 19 mov r0, sp strh r4, [r0] str r0, [r2] str r1, [r2, 0x4] lsrs r3, 1 movs r0, 0x81 lsls r0, 24 orrs r3, r0 str r3, [r2, 0x8] ldr r0, [r2, 0x8] bl sub_80A1A74 ldr r0, =gUnknown_085E54E8 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 .pool 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, =0x0300301c movs r0, 0x8 strb r0, [r1] ldr r0, =gUnknown_085E5394 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085E53A4 bl gpu_pal_obj_decompress_and_apply pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E5374 movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r4, =0x0203bcdc ldr r1, [r4] adds r1, 0x12 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001012 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 .pool thumb_func_end sub_8174FAC thumb_func_start sub_8175024 sub_8175024: ; 8175024 push {r4,lr} sub sp, 0x8 ldr r0, =0x0203bcdc ldr r0, [r0] ldrh r0, [r0] cmp r0, 0x4 bhi @08175108 lsls r0, 2 ldr r1, =@08175044 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08175044: .4byte @08175058 .4byte @08175070 .4byte @0817507C .4byte @081750D2 .4byte @081750DC @08175058: ldr r1, =gUnknown_085E5508 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 .pool @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, =0x0203bcdc ldr r1, [r0] movs r0, 0 strh r0, [r1] b @08175114 .align 2, 0 .pool @08175108: ldr r0, =0x0203bcdc 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 .pool 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, =gUnknown_08329F40 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 .pool 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, =gUnknown_085E54D0 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, =0x02020630 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 .pool @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, =0x020375e0 movs r0, 0xB4 strh r0, [r4] ldr r0, =sub_8175364 movs r1, 0 bl AddTask lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @081752AA ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 ldrh r1, [r4] strh r1, [r0, 0xA] ldr r0, =0x020375e2 strh r2, [r0] @081752AA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8175280 thumb_func_start sub_81752C0 sub_81752C0: ; 81752C0 push {r4,lr} ldr r0, =sub_8175364 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, =0x000003e9 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 .pool 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, =0x03005e00 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 .pool @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, =gUnknown_08329F40 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 .pool 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, =0x03005e08 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 .pool @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, =0x020375e0 strh r7, [r0] ldr r1, =0x020375e2 ldr r2, =0x0000ffff adds r0, r2, 0 strh r0, [r1] @081753B8: ldr r0, =gUnknown_085E5394 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085E53A4 bl gpu_pal_obj_decompress_and_apply ldrh r0, [r6] adds r0, 0x1 strh r0, [r6] b @081754B0 .align 2, 0 .pool @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, =gUnknown_085E53FC ldr r2, =0x000003e9 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, =sub_81752F4 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 .pool @08175494: ldrh r0, [r6, 0x1E] cmp r0, 0 bne @081754B0 movs r0, 0xFF strh r0, [r6] b @081754B0 @081754A0: bl sub_81752C0 ldr r0, =0x020375e0 strh r7, [r0] ldr r1, =0x020375e2 ldr r2, =0x0000ffff 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 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2C] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @08175522 ldr r0, =0x0203bce4 ldrb r0, [r0] cmp r0, 0 beq @08175522 ldr r2, =0x03005e00 ldr r0, =0x0203bce2 ldrh r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, [r0] ldr r0, =sub_8175774 cmp r1, r0 bne @08175522 bl sub_81754C8 bl run_active_tasks bl call_obj_callbacks ldr r1, =0x0203bce5 movs r0, 0x1 strb r0, [r1] @08175522: bl obj_sync_something bl fade_and_return_progress_probably pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E6F68 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, =gUnknown_085E56F0 movs r1, 0x80 movs r2, 0x40 bl gpu_pal_apply ldr r0, =gUnknown_085E6F6C 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 .pool 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, =0x02000000 movs r1, 0xE0 lsls r1, 9 bl init_malloc bl sub_80A1A74 bl clear_tasks bl sub_8175548 ldr r0, =sub_8175744 movs r1, 0 bl AddTask lsls r0, 24 lsrs r7, r0, 24 ldr r1, =0x03005e00 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, =0x03005e00 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, =0x0000fffc movs r0, 0x12 bl lcd_io_set ldr r0, =sub_8175DA0 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, =sub_81754C8 bl SetVBlankCallback ldr r0, =0x000001c7 bl m4aSongNumStart ldr r0, =sub_81754DC bl set_callback2 ldr r0, =0x0203bce5 mov r1, r8 strb r1, [r0] ldr r4, =0x0203bce8 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, =0x0203bce2 strh r7, [r0] add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8175620 thumb_func_start sub_8175744 sub_8175744: ; 8175744 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08175764 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_8175774 str r0, [r1] @08175764: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =sub_8175A9C b @081757FA .align 2, 0 .pool @081757B0: ldr r0, =0x0203bce0 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, =sub_8175808 b @081757FA .align 2, 0 .pool @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, =sub_81758A4 @081757FA: str r0, [r4] @081757FC: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =c2_080C9BFC str r0, [r1] @08175836: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =sub_81754C8 bl SetVBlankCallback ldr r0, =sub_8175744 str r0, [r5] @08175890: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81758E4 str r0, [r1] @081758D2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x0300301c movs r0, 0x8 strb r0, [r1] ldr r0, =gUnknown_085B0E04 movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_085B0C0C ldr r1, =0x06003800 bl LZ77UnCompVram ldr r0, =gUnknown_085B0A02 movs r1, 0x1 movs r2, 0x3E bl gpu_pal_apply movs r1, 0 ldr r4, =0x0201c000 movs r3, 0x11 ldr r2, =0x000007ff @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, =0x0201d800 ldr r6, =gUnknown_085E701C ldr r0, =0xfffff000 adds r5, r2, r0 movs r4, 0x22 ldr r3, =0x000007ff @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, =0x0201d000 movs r4, 0x33 ldr r3, =0x000007ff @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, =0x000053ff adds r0, r1, 0 strh r0, [r2, 0x2] ldr r1, =0x0000529f adds r0, r1, 0 strh r0, [r2, 0x4] ldr r1, =0x00007e94 adds r0, r1, 0 strh r0, [r2, 0x6] adds r0, r6, 0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_085E702C bl gpu_pal_obj_alloc_tag_and_apply ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08175A7A .align 2, 0 .pool @081759F0: ldr r0, =sub_81760FC movs r1, 0 bl AddTask ldr r2, =0x03005e00 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, =0x00000703 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, =0x0203bd28 strh r5, [r0] ldr r0, =sub_8175744 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 .pool 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, =0x03005e00 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 .pool @08175AC4: movs r0, 0x1 negs r0, r0 str r1, [sp] movs r1, 0xC movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =sub_8175AE4 str r0, [r4] @08175AD8: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08175B0A adds r0, r4, 0 bl sub_8176CA0 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_8175B1C str r0, [r1] @08175B0A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0xEB strh r1, [r0, 0x8] ldr r1, =sub_8175B90 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @08175BB8: movs r0, 0x1 negs r0, r0 str r1, [sp] movs r1, 0x6 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =sub_8175BD8 str r0, [r4] @08175BCC: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e00 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, =sub_8175C34 str r1, [r0] @08175C1E: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08175CB8 ldr r1, =0x03005e00 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, =0x030022c0 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, =0x0000ffff str r1, [sp] movs r1, 0x8 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =sub_8175CC8 str r0, [r4] b @08175CB8 .align 2, 0 .pool @08175C94: ldr r0, =0x00001be8 cmp r1, r0 bne @08175CA0 movs r0, 0x8 bl play_sound_effect @08175CA0: movs r0, 0x8 ldrsh r1, [r4, r0] ldr r0, =0x00001ab8 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 .pool thumb_func_end sub_8175C34 thumb_func_start sub_8175CC8 sub_8175CC8: ; 8175CC8 push {lr} ldr r0, =0x02037fd4 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 .pool 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, =0x040000d4 mov r0, sp str r0, [r1] movs r0, 0xC0 lsls r0, 19 str r0, [r1, 0x4] ldr r0, =0x8100c000 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, =0x85000100 str r0, [r1, 0x8] ldr r0, [r1, 0x8] mov r0, sp strh r2, [r0] str r0, [r1] ldr r0, =0x05000002 str r0, [r1, 0x4] ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@08175DD4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037fd4 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, =0x0203bce0 strh r2, [r0] b @0817602A .align 2, 0 .pool @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, =sub_8175774 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, =gUnknown_085E6AF4 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, =0x03005e00 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, =0x0000328d b @08175F1A .align 2, 0 .pool @08175F14: movs r0, 0xC0 lsls r0, 2 ldr r1, =0x00001967 @08175F1A: str r1, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 b @0817602A .align 2, 0 .pool @08175F2C: movs r0, 0xA strh r0, [r3, 0x8] b @0817602A @08175F32: movs r0, 0 strh r0, [r5, 0x24] b @0817602A @08175F38: ldr r0, =0x02037fd4 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 .pool @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, =0x0000328d b @08175FB6 .align 2, 0 .pool @08175FB0: movs r0, 0xC0 lsls r0, 2 ldr r1, =0x00001967 @08175FB6: str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @0817602A .align 2, 0 .pool @08175FC8: ldr r0, =0x02037fd4 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, =0x03005e00 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 .pool @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, =0x0203bce8 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 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 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 .pool @0817612C: ldr r0, =0x0203bce8 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 .pool @08176158: ldr r6, =0x0203bce8 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, =sub_8175774 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, =gUnknown_085E6F7C 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, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 movs r1, 0x32 b @081761EA .align 2, 0 .pool @081761D8: movs r0, 0 strh r0, [r1] ldr r1, =0x02020630 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, =0x0203bce8 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 .pool @08176210: adds r0, 0x1 @08176212: strh r0, [r1] ldr r0, =0x03005e00 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 .pool @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, =0x03005e00 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, =@0817627C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203bd26 strh r0, [r1] b @08176390 .align 2, 0 .pool @0817636C: ldr r7, =0x0203bd26 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 .pool @0817639C: ldr r3, =0x02020630 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 .pool @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, =0x02020630 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 .pool @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, =0x0203bd26 strh r0, [r1] b @08176514 .align 2, 0 .pool @08176464: ldr r2, =0x02020630 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 .pool @08176484: lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r6 movs r1, 0x32 b @08176512 @08176490: ldr r3, =0x02020630 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 .pool @081764B0: ldr r3, =0x02020630 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 .pool @081764D4: ldr r3, =0x02020630 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 .pool @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, =0x03005e00 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, =@08176548 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00007fff 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 .pool @081765AC: lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r2, r0, r4 movs r3, 0xA ldrsh r0, [r2, r3] ldr r5, =0x00007fff 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 .pool @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, =0x00007fff 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 .pool @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, =@08176670 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08176670: .4byte @08176684 .4byte @0817672C .4byte @081767D8 .4byte @08176884 .4byte @08176934 @08176684: ldr r5, =0x02020630 ldr r0, =0x03005e00 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 .pool @0817672C: ldr r5, =0x02020630 ldr r0, =0x03005e00 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 .pool @081767D8: ldr r5, =0x02020630 ldr r0, =0x03005e00 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 .pool @08176884: ldr r5, =0x02020630 ldr r0, =0x03005e00 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, =0x0000ffe0 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 .pool @08176934: ldr r5, =0x02020630 ldr r0, =0x03005e00 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, =sub_817651C movs r1, 0 bl AddTask ldr r6, =0x03005e00 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, =sub_817624C 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 .pool 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, =0x030022c0 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 .pool @08176B30: ldr r1, =0x0203bd24 movs r0, 0x22 strh r0, [r1] ldr r1, =0x0203bd26 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 .pool @08176B54: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @08176BD8 ldr r0, =gUnknown_085F5334 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F53BC bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F5354 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F5384 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, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r0 strh r2, [r4, 0x12] ldr r6, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r5, r6, 0 adds r5, 0x1C adds r2, r0, r5 ldr r1, =sub_8176EE8 str r1, [r2] adds r6, 0x8 adds r0, r6 ldr r1, =gUnknown_085E6FD0 str r1, [r0] movs r0, 0x88 lsls r0, 1 movs r1, 0x2E bl sub_817B88C b @08176C2C .align 2, 0 .pool @08176BD8: ldr r0, =gUnknown_085F5344 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F53AC bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F5354 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F5384 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, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r0 strh r2, [r4, 0x12] ldr r6, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r5, r6, 0 adds r5, 0x1C adds r2, r0, r5 ldr r1, =sub_8176EE8 str r1, [r2] adds r6, 0x8 adds r0, r6 ldr r1, =gUnknown_085E6FD0 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, =sub_8176F90 str r1, [r5] adds r0, r6 ldr r1, =gUnknown_085E7010 str r1, [r0] ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08176C96 .align 2, 0 .pool @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, =0x03005e00 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, =0x0203bd28 movs r0, 0x1 strh r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E5770 movs r6, 0xC0 lsls r6, 19 adds r3, r6 adds r1, r3, 0 bl LZ77UnCompVram ldr r0, =gUnknown_08DC3D54 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, =0x000003ff @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 .pool 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, =gUnknown_085E5BAC movs r4, 0xC0 lsls r4, 19 adds r1, 0x1 ldr r3, =0x000003ff @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, =gUnknown_085E5BBB str r6, [sp] movs r1, 0x7 movs r2, 0x7 adds r3, r5, 0 bl sub_8176DBC ldr r4, =gUnknown_085E5BCA 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, =gUnknown_085E5BD9 str r6, [sp] movs r1, 0x14 movs r2, 0x7 adds r3, r5, 0 bl sub_8176DBC ldr r0, =gUnknown_085E5BE8 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 .pool thumb_func_end sub_8176E40 thumb_func_start sub_8176EE8 sub_8176EE8: ; 8176EE8 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203bd28 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 .pool @08176F04: movs r2, 0x2E ldrsh r0, [r4, r2] cmp r0, 0x5 bhi @08176F88 lsls r0, 2 ldr r1, =@08176F1C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203bd28 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 .pool @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, =0x0203bd26 ldrh r0, [r0] negs r0, r0 strh r0, [r4, 0x26] b @08177048 .align 2, 0 .pool @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, =0x0203bd28 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 beq @0817706C ldrh r0, [r5, 0x3A] bl sub_818D820 b @0817721C .align 2, 0 .pool @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, =@08177088 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02020630 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, =sub_8177050 str r0, [r1] strh r4, [r2, 0x3A] ldr r0, =gUnknown_085E7068 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 .pool thumb_func_end sub_8177224 thumb_func_start sub_81772B8 sub_81772B8: ; 81772B8 push {r4,lr} adds r3, r0, 0 ldr r4, =0x02020630 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, =0x0203bd28 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 .pool @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, =0x00004023 bl var_get lsls r0, 16 lsrs r0, 16 bl sub_8133EDC lsls r0, 16 lsrs r0, 16 bl SpeciesToNationalPokedexNum lsls r0, 16 lsrs r0, 16 mov r10, r0 movs r4, 0x1 movs r6, 0 ldr r5, =0x00000181 @081773B4: adds r0, r4, 0 movs r1, 0x1 bl pokedex_flag_operation lsls r0, 24 cmp r0, 0 beq @081773D4 ldr r0, =0x0203bce8 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, =0x00000181 ldr r1, =0x0203bce8 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, =0x0000039a 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 .pool @08177430: adds r1, 0x94 movs r0, 0x47 strh r0, [r1] @08177436: movs r6, 0 ldr r0, =0x0203bce8 mov r9, r0 ldr r1, =0x0000039a mov r8, r1 movs r7, 0 b @08177450 .align 2, 0 .pool @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, =0x0203bce8 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 .pool @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, =0x00004045 movs r1, 0 bl var_set pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff cmp r4, r0 beq @081775B4 ldr r5, =0x41c64e6d ldr r3, =0x00003039 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 .pool thumb_func_end sub_8177584 thumb_func_start sub_81775CC sub_81775CC: ; 81775CC push {lr} bl sub_817783C ldr r1, =0x020375f0 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375e0 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, =0x020244ec 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, =0x020375f0 ldrh r0, [r0] lsls r1, 16 lsrs r1, 16 bl sub_817778C lsls r0, 24 lsrs r0, 24 ldr r1, =0x020375e0 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, =0x03005d94 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, =0x020375f0 ldrh r0, [r0] lsls r1, 16 lsrs r1, 16 bl sub_817778C lsls r0, 24 lsrs r0, 24 ldr r1, =0x020375e0 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, =0x020375e0 ldrh r0, [r3] cmp r0, 0 beq @0817776E ldr r2, =0x020375e2 ldr r1, =gUnknown_085E7080 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, =0x020375e4 movs r0, 0 strh r0, [r1] movs r0, 0x64 ldr r1, [sp, 0x4] muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r2, =0x02021cc4 movs r1, 0x2 bl pokemon_getattr b @08177768 .align 2, 0 .pool @0817773C: ldr r1, =0x020375e4 movs r0, 0x1 strh r0, [r1] ldr r2, =0x03005d94 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, =0x02021cc4 movs r1, 0x2 bl pokemon_getattr_encrypted @08177768: ldr r0, =0x02021cc4 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 .pool 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, =0x0203bcec mov r10, r1 ldr r0, =0x0203bcee 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 .pool 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, =0x0000404b bl var_set ldr r0, =0x0000404c adds r1, r4, 0 bl var_set pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8177814 thumb_func_start sub_817783C sub_817783C: ; 817783C push {r4,lr} ldr r0, =0x0000404b bl var_get adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldr r0, =0x0000404c bl var_get lsls r0, 16 orrs r0, r4 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x040000d4 add r0, sp, 0x4 str r0, [r1] movs r0, 0xC0 lsls r0, 19 str r0, [r1, 0x4] ldr r0, =0x8100c000 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, =0x85000100 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, =0x81000200 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, =gUnknown_085E7088 movs r1, 0 movs r2, 0x40 bl gpu_pal_apply ldr r4, =0x0203bcf0 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, =gUnknown_085E7804 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, =gUnknown_085E70C8 ldr r1, =0x0203bcf0 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, =sub_8177874 bl SetVBlankCallback ldr r0, =sub_8177A08 bl set_callback2 ldr r0, =sub_8177A20 movs r1, 0 bl AddTask add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08177A40 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_8177A50 str r0, [r1] @08177A40: pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8177A98 str r1, [r0] @08177A82: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08177AC2 ldr r0, =0x0203bcf0 ldr r0, [r0] bl free bl Window_FreeMemory adds r0, r4, 0 bl remove_task ldr r0, =sub_80861E8 bl set_callback2 @08177AC2: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021cc4 ldr r1, =gUnknown_085EE855 bl gf_strcpy b @08177B0C .align 2, 0 .pool @08177AFC: movs r0, 0x14 movs r1, 0 bl lcd_io_set ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EE84F bl gf_strcpy @08177B0C: ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE85E 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 .pool 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, =gUnknown_085E81FC movs r0, 0 movs r2, 0x2 bl bg_vram_setup ldr r0, =0x0203bcf0 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 .pool thumb_func_end sub_8177B44 thumb_func_start sub_8177B9C sub_8177B9C: ; 8177B9C push {lr} ldr r0, =gUnknown_085E8204 bl Window_InitFromTemplates bl TextBox_ResetSomeField ldr r0, =gUnknown_0860F074 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 .pool 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, =gUnknown_085E8214 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 .pool thumb_func_end sub_8177BCC thumb_func_start sub_8177C14 sub_8177C14: ; 8177C14 push {r4,lr} ldr r4, =0x0203bcf4 ldr r0, =0x0000180c bl malloc_and_clear str r0, [r4] ldr r0, =0x0203ce7c 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, =sub_8177C84 bl set_callback2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =@08177CD8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 b @08177DDA .align 2, 0 .pool @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, =0x0203bcf4 ldr r0, [r0] ldr r1, =0x00001808 adds r0, r1 movs r1, 0 strh r1, [r0] b @08177DDC .align 2, 0 .pool @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, =sub_8178654 movs r1, 0 bl AddTask b @08177DDC .align 2, 0 .pool @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, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @08177DDA: strb r0, [r2, 0x8] @08177DDC: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08177E0C .align 2, 0 .pool @08177DF4: ldr r0, =sub_8177C70 bl SetVBlankCallback ldr r0, =sub_8177C54 bl set_callback2 movs r0, 0x1 b @08177E0E .align 2, 0 .pool @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, =gUnknown_085EFCF0 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r4, =0x0203bcf4 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 .pool thumb_func_end sub_8177E14 thumb_func_start sub_8177E88 sub_8177E88: ; 8177E88 push {r4-r7,lr} sub sp, 0x4 ldr r1, =0x0203bcf4 ldr r0, [r1] ldr r2, =0x00001808 adds r0, r2 ldrh r0, [r0] adds r7, r1, 0 cmp r0, 0x5 bls @08177E9E b @08177FEC @08177E9E: lsls r0, 2 ldr r1, =@08177EB4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08D9BB44 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, =0x0203bcf4 ldr r1, [r0] ldr r0, =0x00001808 adds r1, r0 b @08177FD6 .align 2, 0 .pool @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, =gUnknown_08D9BF98 ldr r4, =0x0203bcf4 ldr r1, [r4] bl call_LZZUnCompWram ldr r1, [r4] b @08177FD2 .align 2, 0 .pool @08177F1C: ldr r0, =gUnknown_08D9C13C ldr r1, [r7] movs r2, 0x80 lsls r2, 5 adds r1, r2 bl call_LZZUnCompWram ldr r1, [r7] ldr r0, =0x00001808 adds r1, r0 b @08177FD6 .align 2, 0 .pool @08177F3C: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @08177F78 movs r2, 0 ldr r6, =0x0203bcf4 movs r5, 0x80 lsls r5, 4 ldr r4, =0x00004042 ldr r3, =0x000003ff @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 .pool @08177F78: movs r2, 0 ldr r6, =0x0203bcf4 movs r5, 0x80 lsls r5, 4 ldr r4, =0x00005042 ldr r3, =0x000003ff @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 .pool @08177FA8: ldr r0, =gUnknown_08D9BEF0 movs r1, 0 movs r2, 0xC0 bl decompress_palette ldr r0, =0x0203bcf4 ldr r1, [r0] ldr r0, =0x00001808 adds r1, r0 b @08177FD6 .align 2, 0 .pool @08177FC8: ldr r0, =gUnknown_0857FDEC bl gpu_tile_obj_decompress_and_load ldr r0, =0x0203bcf4 ldr r1, [r0] @08177FD2: ldr r2, =0x00001808 adds r1, r2 @08177FD6: ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @08177FFC .align 2, 0 .pool @08177FEC: ldr r0, =gUnknown_0857FDF4 bl gpu_pal_obj_decompress_and_apply movs r0, 0x1 b @08177FFE .align 2, 0 .pool @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, =gUnknown_085EFD28 bl Window_InitFromTemplates bl TextBox_ResetSomeField ldr r0, =gUnknown_085EFD00 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 .pool 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, =gUnknown_085EFD20 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 .pool 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, =0x0203bcf4 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, =gUnknown_085E926B 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 .pool 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, =0x0203bcf4 ldr r0, [r5] movs r4, 0xC0 lsls r4, 5 adds r0, r4 ldrb r0, [r0] bl sub_80E167C adds r6, r0, 0 ldr r0, =0x02021cc4 ldr r1, [r5] adds r1, r4 ldrh r1, [r1] movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r0, =0x02021dc4 adds r1, r6, 0 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9263 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 .pool thumb_func_end sub_8178110 thumb_func_start sub_8178174 sub_8178174: ; 8178174 push {r4-r7,lr} sub sp, 0xC ldr r0, =0x0203bcf4 ldr r0, [r0] movs r1, 0xC0 lsls r1, 5 adds r0, r1 ldrb r0, [r0] bl sub_80E167C adds r4, r0, 0 ldr r2, =gUnknown_085E9225 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, =0x02021cc4 adds r1, r5, 0 movs r2, 0 movs r3, 0x2 bl decimal_int_to_string ldr r0, =0x02021dc4 adds r1, r4, 0 movs r2, 0 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9233 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 .pool @08178230: ldr r2, =gUnknown_085E8D34 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 .pool thumb_func_end sub_8178174 thumb_func_start itemid_copy_name itemid_copy_name: ; 8178250 push {r4-r6,lr} sub sp, 0xC ldr r0, =0x0203bcf4 ldr r0, [r0] movs r1, 0xC0 lsls r1, 5 adds r0, r1 ldrb r0, [r0] bl sub_80E167C adds r6, r0, 0 ldr r2, =gUnknown_085E922C 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, =gBerryFirmnessStringPointers 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 .pool @081782B0: ldr r2, =gUnknown_085E8D34 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 .pool thumb_func_end itemid_copy_name thumb_func_start sub_81782D0 sub_81782D0: ; 81782D0 push {lr} sub sp, 0xC ldr r0, =0x0203bcf4 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 .pool thumb_func_end sub_81782D0 thumb_func_start sub_8178304 sub_8178304: ; 8178304 push {lr} sub sp, 0xC ldr r0, =0x0203bcf4 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 .pool thumb_func_end sub_8178304 thumb_func_start sub_8178338 sub_8178338: ; 8178338 push {r4,lr} ldr r4, =0x0203bcf4 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, =0x00001802 adds r1, r2 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8178338 thumb_func_start sub_817836C sub_817836C: ; 817836C push {lr} ldr r0, =0x0203bcf4 ldr r0, [r0] ldr r1, =0x00001802 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles bl sub_80D510C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817836C thumb_func_start sub_817839C sub_817839C: ; 817839C push {r4,lr} movs r0, 0x40 bl sub_80D518C ldr r4, =0x0203bcf4 ldr r1, [r4] ldr r2, =0x00001803 adds r1, r2 strb r0, [r1] movs r0, 0x68 bl sub_80D518C ldr r1, [r4] ldr r2, =0x00001804 adds r1, r2 strb r0, [r1] movs r0, 0x90 bl sub_80D518C ldr r1, [r4] ldr r2, =0x00001805 adds r1, r2 strb r0, [r1] movs r0, 0xB8 bl sub_80D518C ldr r1, [r4] ldr r2, =0x00001806 adds r1, r2 strb r0, [r1] movs r0, 0xE0 bl sub_80D518C ldr r1, [r4] ldr r2, =0x00001807 adds r1, r2 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817839C thumb_func_start sub_8178404 sub_8178404: ; 8178404 push {r4,r5,lr} ldr r4, =0x0203bcf4 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, =0x02020630 ldr r0, [r4] ldr r1, =0x00001803 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 .pool @08178448: ldr r3, =0x02020630 ldr r0, [r4] ldr r1, =0x00001803 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, =0x0203bcf4 ldr r0, [r3] ldr r1, =0x00001804 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 .pool @0817849C: ldr r3, =0x0203bcf4 ldr r0, [r3] ldr r1, =0x00001804 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, =0x00001805 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 .pool @081784E8: ldr r0, [r3] ldr r1, =0x00001805 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, =0x00001806 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 .pool @0817852C: ldr r0, [r3] ldr r1, =0x00001806 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, =0x00001807 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 .pool @08178570: ldr r0, [r3] ldr r1, =0x00001807 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 .pool thumb_func_end sub_8178404 thumb_func_start sub_8178594 sub_8178594: ; 8178594 push {r4,lr} movs r4, 0 @08178598: ldr r0, =0x0203bcf4 ldr r0, [r0] ldr r1, =0x00001803 adds r0, r1 adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_8178610 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08178642 bl sub_817836C bl sub_8178594 ldr r0, =0x0203bcf4 ldr r0, [r0] bl free bl Window_FreeMemory ldr r0, =sub_81AD40C bl set_callback2 adds r0, r4, 0 bl remove_task @08178642: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081786A6 ldr r3, =0x030022c0 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 .pool @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, =0x03005e08 adds r4, r0, r2 ldr r2, =0x0203ce58 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 .pool @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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81787AC str r1, [r0] @08178718: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81786AC thumb_func_start sub_8178728 sub_8178728: ; 8178728 push {r4-r6,lr} ldr r5, =0x0203ce70 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 .pool @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, =0x0203bcf4 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 .pool 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, =0x03005e08 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 .pool @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, =0x02020630 ldr r3, =0x0203bcf4 ldr r0, [r3] ldr r1, =0x00001802 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, =0x00001803 @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, =0x03005e00 mov r2, r8 lsls r1, r2, 2 add r1, r8 lsls r1, 3 adds r1, r0 ldr r0, =sub_8178654 str r0, [r1] @08178922: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020229e8 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 .pool 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, =sub_8178944 bl SetVBlankCallback movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_085EFD64 movs r0, 0 movs r2, 0x1 bl bg_vram_setup ldr r0, =gUnknown_085EFD68 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, =sub_8009404 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, =sub_8178A78 bl set_callback2 @08178A22: add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085EE80A bl gf_strcpy movs r5, 0 @08178A54: cmp r4, 0x2 bne @08178A5A movs r5, 0 @08178A5A: cmp r4, 0x1 bne @08178A66 ldr r1, =gUnknown_085EE827 adds r0, r6, 0 bl gf_strcpy @08178A66: adds r0, r5, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8178A40 thumb_func_start sub_8178A78 sub_8178A78: ; 8178A78 push {r4-r6,lr} sub sp, 0x8 ldr r1, =0x030022c0 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, =@08178AA0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @08178B20 b @08178E58 @08178B20: ldr r1, =gUnknown_085EE765 movs r0, 0x1 str r0, [sp] movs r0, 0 movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08178E3C .align 2, 0 .pool @08178B48: movs r0, 0 bl a_pressed_maybe lsls r0, 16 cmp r0, 0 beq @08178B56 b @08178E58 @08178B56: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r1, =0x020229c6 ldr r2, =0x00005501 adds r0, r2, 0 strh r0, [r1] bl sub_8009734 b @08178E58 .align 2, 0 .pool @08178B80: ldr r0, =0x030030e0 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, =gUnknown_085EE788 movs r0, 0x1 str r0, [sp] movs r0, 0 movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08178D00 .align 2, 0 .pool @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, =0x030022c0 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, =gUnknown_085EE7BF 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 .pool @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, =0x03003124 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, =0x02021fc4 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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r2 b @08178CF2 .align 2, 0 .pool @08178CAC: bl sub_8178958 lsls r0, 24 cmp r0, 0 beq @08178CCC ldr r1, =gUnknown_085EE7CE movs r0, 0x1 str r0, [sp] movs r0, 0 movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 b @08178E34 .align 2, 0 .pool @08178CCC: bl sub_80097E8 @08178CD0: ldr r4, =0x02021fc4 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, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 @08178CF2: movs r1, 0xD strb r1, [r0] b @08178E58 .align 2, 0 .pool @08178D00: ldr r4, =0x030022c0 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 .pool @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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08178E3C .align 2, 0 .pool @08178D58: movs r0, 0x87 lsls r0, 3 adds r1, r4, r0 b @08178E3C @08178D60: bl sub_800AC34 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08178E3C .align 2, 0 .pool @08178D74: ldr r0, =0x03003124 ldrb r6, [r0] cmp r6, 0 bne @08178E58 ldr r5, =0x0201c000 adds r0, r5, 0 bl sub_81538A0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 str r6, [sp, 0x4] ldr r2, =0x050001f5 add r0, sp, 0x4 adds r1, r5, 0 bl CpuSet ldr r0, =0x02021fc4 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 .pool @08178DBC: ldr r1, =0x02021fc4 movs r0, 0x1 str r0, [sp] movs r0, 0 movs r2, 0x1 movs r3, 0x2 bl sub_8178EC4 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08178E3C .align 2, 0 .pool @08178DE0: movs r0, 0 bl a_pressed_maybe lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0 bne @08178E58 ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] ldr r0, =0x0203bcf8 strb r2, [r0] b @08178E58 .align 2, 0 .pool @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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @08178E3C: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08178E58 .align 2, 0 .pool @08178E48: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08178E58 bl do_reset @08178E58: ldr r0, =0x030030e0 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, =0x02021fc4 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, =0x030022c0 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 .pool 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, =0x0203bd0e 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 .pool 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, =sub_8178FDC bl set_callback2 ldr r0, =0x0203bcfc strh r4, [r0] ldr r1, =0x0203bcfe movs r2, 0 movs r0, 0 strh r0, [r1] strh r0, [r1, 0x2] ldr r0, =0x0203bd0e strb r2, [r0] strb r2, [r0, 0x1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x040000d4 str r1, [r2] movs r1, 0xC0 lsls r1, 19 str r1, [r2, 0x4] ldr r0, =0x8100c000 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, =0x85000100 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, =0x81000200 str r0, [r2, 0x8] ldr r0, [r2, 0x8] ldr r0, =gUnknown_085B0E04 bl LZ77UnCompVram ldr r0, =gUnknown_085B0A80 ldr r1, =0x06007000 bl LZ77UnCompVram ldr r0, =gUnknown_085B0C0C ldr r1, =0x06007800 bl LZ77UnCompVram ldr r0, =gUnknown_085EFDE4 ldr r1, =0x06010020 bl LZ77UnCompVram movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_085EFD88 movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r5, =0x0201e000 movs r0, 0 adds r1, r5, 0 bl bg_set_tilemap mov r0, r8 str r0, [sp, 0x8] ldr r2, =0x05000200 adds r0, r4, 0 adds r1, r5, 0 bl CpuSet ldr r1, =gUnknown_0850E87C 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, =gUnknown_085EFD94 bl Window_InitFromTemplates ldr r0, =gUnknown_085EFD9C bl Window_AddFromTemplateWithoutAllocatingMemory ldr r4, =0x0203bd0e strb r0, [r4] ldrb r0, [r4] movs r1, 0x80 lsls r1, 4 adds r2, r5, r1 movs r1, 0x7 bl Window_SetField ldr r0, =gUnknown_085EFDA4 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, =gUnknown_085B0A00 movs r1, 0 movs r2, 0x40 bl gpu_pal_apply ldr r0, =gUnknown_085EFDC4 movs r1, 0x80 lsls r1, 1 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_0850FEFC movs r1, 0xE0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_0860F074 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, =gUnknown_085EC816 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, =sub_8178FC8 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 .pool @0817925C: bl fade_and_return_progress_probably lsls r0, 24 cmp r0, 0 bne @08179272 ldr r0, =sub_8179288 bl set_callback2 ldr r0, =sub_8179454 bl SetVBlankCallback @08179272: add sp, 0xC pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8178FDC thumb_func_start sub_8179288 sub_8179288: ; 8179288 push {r4-r6,lr} movs r5, 0 ldr r0, =0x0203bcfe movs r1, 0x1 strh r1, [r0] ldr r1, =0x030061fc 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, =0x0203bd0e ldrb r0, [r4] movs r1, 0x11 bl Window_FastFillPixels ldr r0, =gUnknown_085EC917 movs r1, 0x1 movs r2, 0 bl sub_8178F44 ldr r0, =0x0203bcfc 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, =gUnknown_085EC816 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, =0x0203bd0e ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, =gUnknown_085EC86F b @08179330 .align 2, 0 .pool @0817931C: ldr r0, =0x0203bd0e ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, =0x03006214 ldr r0, [r0] cmp r0, 0 bne @08179370 ldr r0, =gUnknown_085EC94F @08179330: movs r1, 0x1 movs r2, 0 bl sub_8178F44 b @0817937A .align 2, 0 .pool @08179348: ldr r0, =0x0203bd0e ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, =gUnknown_085EC86F movs r1, 0x1 movs r2, 0 bl sub_8178F44 ldr r0, =sub_8179390 bl set_callback2 b @08179380 .align 2, 0 .pool @08179370: ldr r0, =gUnknown_085EC9A2 movs r1, 0x1 movs r2, 0 bl sub_8178F44 @0817937A: ldr r0, =sub_81793E0 bl set_callback2 @08179380: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8179288 thumb_func_start sub_8179390 sub_8179390: ; 8179390 push {lr} ldr r1, =0x0203bcfe movs r0, 0 strh r0, [r1] ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081793C4 ldr r0, =0x0203bd0e ldrb r0, [r0] movs r1, 0x11 bl Window_FastFillPixels ldr r0, =gUnknown_085EC8D4 movs r1, 0x1 movs r2, 0 bl sub_8178F44 ldr r0, =sub_8178FC8 bl SetVBlankCallback ldr r0, =sub_81793E0 bl set_callback2 @081793C4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8179390 thumb_func_start sub_81793E0 sub_81793E0: ; 81793E0 push {lr} sub sp, 0x4 ldr r0, =0x0203bcfe movs r2, 0 strh r2, [r0] ldr r0, =0x030022c0 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, =sub_8178FC8 bl SetVBlankCallback ldr r0, =sub_8179428 bl set_callback2 @08179410: add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03006214 ldr r0, [r5] cmp r0, 0 bne @08179448 bl do_reset b @0817944E .align 2, 0 .pool @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, =0x030022c0 ldr r0, [r5, 0x24] lsrs r4, r0, 3 movs r0, 0x7 ands r4, r0 ldr r0, =gUnknown_085EFD80 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r5, 0x38] str r1, [r5, 0x3C] ldrh r1, [r5, 0x3A] ldr r0, =0xfffffe00 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, =0x0203bcfe ldrh r0, [r0] cmp r0, 0 beq @081794DC ldr r3, =gUnknown_085EFDAC lsls r2, r4, 1 adds r2, r4 adds r0, r2, r3 ldrb r4, [r0] ldrh r1, [r5, 0x3C] ldr r0, =0xfffffc00 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 .pool @081794DC: ldrh r0, [r5, 0x3C] ldr r1, =0xfffffc00 ands r1, r0 movs r0, 0x1 orrs r1, r0 strh r1, [r5, 0x3C] @081794E8: ldr r0, =0x030022f8 movs r1, 0xE0 lsls r1, 19 movs r2, 0x1 bl CpuFastSet ldr r1, =0x0203bcfe 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 .pool thumb_func_end sub_8179454 thumb_func_start sub_8179514 sub_8179514: ; 8179514 push {r4,lr} lsls r0, 16 lsrs r0, 16 ldr r4, =0x0203abbc movs r3, 0x80 lsls r3, 5 movs r1, 0 adds r2, r4, 0 bl ReadFlash movs r1, 0 ldr r2, =0x000003ff @0817952C: ldr r0, [r4] cmp r0, 0 beq @08179540 movs r0, 0x1 b @0817954E .align 2, 0 .pool @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, =0x00000fff mov r8, r1 ldr r7, =0x03007854 @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 .pool 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, =0x000008af bl flag_check lsls r0, 24 cmp r0, 0 bne @08179634 ldr r0, =0x03005d8c ldr r2, [r0] ldrh r1, [r2, 0x4] ldr r0, =0x00004718 cmp r1, r0 bne @08179634 ldr r1, [r2] ldr r0, =0x0003000a cmp r1, r0 beq @08179616 ldr r0, =0x00030009 cmp r1, r0 beq @08179616 ldr r0, =0x0003000b cmp r1, r0 bne @08179634 @08179616: movs r0, 0x1 b @08179636 .align 2, 0 .pool @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, =0x0000022a movs r0, 0x10 movs r1, 0x8 bl setmaptile_0 ldr r2, =0x0000022b 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, =0x00000e32 movs r0, 0x10 movs r1, 0x9 bl setmaptile_0 ldr r2, =0x00000233 movs r0, 0x11 movs r1, 0x9 bl setmaptile_0 ldr r2, =0x00000e34 movs r0, 0x12 movs r1, 0x9 bl setmaptile_0 bl cur_mapdata_full_redraw movs r0, 0x14 bl audio_play ldr r0, =0x000008af bl flag_set bl script_env_2_disable pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817963C thumb_func_start sub_81796AC sub_81796AC: ; 81796AC push {r4,lr} ldr r4, =0x020244ec 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, =0x020244e9 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, =0x0000017d cmp r0, r1 bne @081796F4 movs r0, 0x1 b @081796F6 .align 2, 0 .pool @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, =sub_8179778 movs r1, 0x9 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh 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 .pool thumb_func_end sub_8179700 thumb_func_start sub_817973C sub_817973C: ; 817973C push {lr} ldr r0, =sub_8179778 movs r1, 0x9 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh 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 .pool 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, =0x03005e00 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 .pool 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, =0x03005d8c ldr r3, [r0] ldrh r1, [r3, 0x4] movs r0, 0xC3 lsls r0, 3 cmp r1, r0 bne @0817982C ldr r1, [r3] ldr r0, =0x00170006 cmp r1, r0 beq @08179810 ldr r0, =0x00170005 cmp r1, r0 beq @08179810 ldr r0, =0x00170007 cmp r1, r0 bne @0817982C @08179810: ldr r0, =0x0203bd14 strb r2, [r0] movs r0, 0x1 b @0817982E .align 2, 0 .pool @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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] movs r0, 0x3C bl oe_exec pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000022a movs r0, 0xE movs r1, 0x1A bl setmaptile_0 ldr r2, =0x0000022b 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, =0x00000e32 movs r0, 0xE movs r1, 0x1B bl setmaptile_0 ldr r2, =0x00000233 movs r0, 0xF movs r1, 0x1B bl setmaptile_0 ldr r2, =0x00000e34 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 .pool thumb_func_end sub_8179860 thumb_func_start sub_81798D0 sub_81798D0: ; 81798D0 push {lr} ldr r0, =0x000008b2 bl flag_check lsls r0, 24 cmp r0, 0 bne @08179910 ldr r0, =0x03005d8c ldr r2, [r0] ldrh r1, [r2, 0x4] ldr r0, =0x00004418 cmp r1, r0 bne @08179910 ldr r1, [r2] ldr r0, =0x00190008 cmp r1, r0 bne @08179910 ldr r1, =0x0203bd14 movs r0, 0x1 strb r0, [r1] movs r0, 0x1 b @08179912 .align 2, 0 .pool @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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] movs r0, 0x3C bl oe_exec pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000022a movs r0, 0xE movs r1, 0x1A bl setmaptile_0 ldr r2, =0x0000022b 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, =0x00000e32 movs r0, 0xE movs r1, 0x1B bl setmaptile_0 ldr r2, =0x00000233 movs r0, 0xF movs r1, 0x1B bl setmaptile_0 ldr r2, =0x00000e34 movs r0, 0x10 movs r1, 0x1B bl setmaptile_0 bl cur_mapdata_full_redraw movs r0, 0x14 bl audio_play ldr r0, =0x000008b2 bl flag_set bl script_env_2_disable pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bd14 ldrb r0, [r0] cmp r0, 0x1 bne @081799E4 ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 ldr r2, =sub_8179934 b @081799F0 .align 2, 0 .pool @081799E4: ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 ldr r2, =sub_8179850 @081799F0: lsrs r1, r2, 16 strh r1, [r0, 0x18] strh r2, [r0, 0x1A] movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r4] ldrh r1, [r0, 0x4] ldr r0, =0x00004318 cmp r1, r0 beq @08179A1A b @08179B5A @08179A1A: ldr r0, =0x000008b1 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 .pool @08179A54: movs r0, 0x1 b @08179B5C @08179A58: movs r5, 0 mov r8, r4 ldr r4, =gUnknown_085EFE74 adds r0, r4, 0x1 mov r12, r0 ldr r6, =0x0000403b ldr r1, =0x0000403c 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 .pool @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, =0x0000403d 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, =0x0000403b bl var_get lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x0000ffff cmp r4, r0 bne @08179B5A ldr r0, =0x0000403c bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, r4 bne @08179B5A ldr r0, =0x0000403d bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0xF bne @08179B5A ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, [r0] ldr r0, =0x00150008 cmp r1, r0 beq @08179A54 b @08179B5A .align 2, 0 .pool @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, =0x030022c0 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, =@08179BC0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203bd18 ldr r0, =0x00001084 bl malloc_and_clear str r0, [r4] bl vblank_hblank_handler_set_zero bl clear_scheduled_bg_copies_to_vram ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08179D3A .align 2, 0 .pool @08179C20: bl sub_80A1A74 ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 b @08179D30 .align 2, 0 .pool @08179C34: bl reset_all_obj_data ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08179D3A .align 2, 0 .pool @08179C48: bl gpu_pal_allocator_reset b @08179D32 @08179C4E: bl init_uns_table_pokemon_copy ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08179D3A .align 2, 0 .pool @08179C60: bl sub_8179D9C b @08179D32 @08179C66: bl sub_8179FAC ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08179D3A .align 2, 0 .pool @08179C78: ldr r0, =0x0203bc9c ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 bl sub_8179DF4 lsls r0, 24 cmp r0, 0 beq @08179D64 b @08179D32 .align 2, 0 .pool @08179C98: bl sub_817A4A4 ldr r1, =0x0203bd18 ldr r1, [r1] ldr r2, =0x0000105e adds r1, r2 strb r0, [r1] b @08179D32 .align 2, 0 .pool @08179CB0: ldr r0, =0x0203bc9c ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 bl sub_817A358 ldr r1, =0x0203bd18 ldr r1, [r1] ldr r2, =0x0000105d adds r1, r2 strb r0, [r1] b @08179D32 .align 2, 0 .pool @08179CDC: movs r0, 0 movs r1, 0x1 movs r2, 0x1 movs r3, 0xE bl SetWindowBorderStyle ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08179D3A .align 2, 0 .pool @08179CF8: bl sub_817A168 b @08179D32 @08179CFE: movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @08179D3A .align 2, 0 .pool @08179D18: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @08179D30: strb r0, [r2, 0x8] @08179D32: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @08179D3A: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @08179D64 .align 2, 0 .pool @08179D4C: ldr r0, =sub_8179B84 bl SetVBlankCallback ldr r0, =sub_8179B68 bl set_callback2 movs r0, 0x1 b @08179D66 .align 2, 0 .pool @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, =gUnknown_085F0550 movs r0, 0 movs r2, 0x2 bl bg_vram_setup ldr r0, =0x0203bd18 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 .pool 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, =0x0203bd18 ldr r0, [r0] ldr r1, =0x0000107e adds r0, r1 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x8 bls @08179E0C b @08179FA0 @08179E0C: lsls r0, 2 ldr r1, =@08179E24 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] ldr r1, [r1, 0x8] adds r2, r5, 0 adds r3, r4, 0 bl help_system_enable_unless_flashback__sp199 ldr r0, =0x0203bd18 ldr r1, [r0] b @08179F5E .align 2, 0 .pool @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, =0x0203bd18 ldr r1, [r0] b @08179F5E .align 2, 0 .pool @08179EC4: ldr r0, =gUnknown_085B26F4 bl gpu_tile_obj_decompress_and_load ldr r0, =0x0203bd18 ldr r1, [r0] b @08179F5E .align 2, 0 .pool @08179ED8: ldr r0, =gUnknown_085B26FC bl gpu_pal_obj_decompress_and_apply ldr r0, =0x0203bd18 ldr r1, [r0] b @08179F5E .align 2, 0 .pool @08179EEC: ldr r0, =gUnknown_085F06A0 bl gpu_tile_obj_decompress_and_load ldr r0, =0x0203bd18 ldr r1, [r0] b @08179F5E .align 2, 0 .pool @08179F00: ldr r0, =0x0203ce7c ldrb r0, [r0] bl sub_8179FEC ldr r0, =0x0203bd1c bl gpu_pal_obj_decompress_and_apply ldr r0, =0x0203bd18 ldr r1, [r0] b @08179F5E .align 2, 0 .pool @08179F20: bl reset_temp_tile_data_buffers ldr r1, =gUnknown_08D7C440 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, =0x0203bd18 ldr r1, [r0] b @08179F5E .align 2, 0 .pool @08179F44: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @08179FA0 ldr r0, =gUnknown_08D9BA44 ldr r4, =0x0203bd18 ldr r1, [r4] adds r1, 0x48 bl call_LZZUnCompWram ldr r1, [r4] @08179F5E: ldr r0, =0x0000107e adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @08179FA0 .align 2, 0 .pool @08179F78: ldr r0, =gUnknown_08D7C9EC movs r1, 0x20 movs r2, 0x60 bl decompress_palette ldr r0, =0x0203bd18 ldr r0, [r0] ldr r1, =0x0000107e adds r0, r1 movs r1, 0 strh r1, [r0] movs r0, 0x1 b @08179FA2 .align 2, 0 .pool @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, =gUnknown_085F0558 bl Window_InitFromTemplates bl TextBox_ResetSomeField movs r0, 0 movs r1, 0x1 movs r2, 0xE0 bl sub_809882C ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply movs 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 .pool thumb_func_end sub_8179FAC thumb_func_start sub_8179FEC sub_8179FEC: ; 8179FEC push {lr} lsls r0, 24 ldr r1, =0x03005d8c lsrs r0, 21 ldr r2, =0x00000848 adds r0, r2 ldr r1, [r1] adds r1, r0 adds r0, r1, 0 movs r1, 0 bl sub_8136F9C lsls r0, 24 ldr r2, =0x0203bd1c ldr r1, =gUnknown_085F0568 lsrs r0, 22 subs r0, 0x4 adds r0, r1 ldr r0, [r0] str r0, [r2] ldr r0, =0x000039e2 strh r0, [r2, 0x4] pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @0817A044 b @0817A154 @0817A044: ldr r0, =0x03005e00 lsls r2, r4, 2 adds r1, r2, r4 lsls r1, 3 adds r1, r0 movs r0, 0x8 ldrsh r3, [r1, r0] ldr r0, =0x0000010d 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 .pool @0817A074: ldr r0, =0x00000119 cmp r3, r0 beq @0817A0E0 adds r0, 0x10 cmp r3, r0 beq @0817A0F8 b @0817A104 .align 2, 0 .pool @0817A088: ldr r0, =0x0203bd18 ldr r1, [r0] ldr r2, =0x00001050 adds r1, r2 strb r3, [r1] ldr r0, [r0] ldr r1, =0x00001058 adds r0, r1 strh r3, [r0] bl sub_817A5CC b @0817A104 .align 2, 0 .pool @0817A0AC: ldr r0, =0x0203bd18 ldr r0, [r0] ldr r2, =0x0000105e adds r0, r2 ldrb r0, [r0] ldrb r1, [r1, 0xA] bl sub_817A4F8 b @0817A104 .align 2, 0 .pool @0817A0C8: bl sub_817A56C ldr r1, =0x0203bd18 ldr r1, [r1] ldr r2, =0x0000105f adds r1, r2 strb r0, [r1] b @0817A104 .align 2, 0 .pool @0817A0E0: ldr r0, =0x0203bd18 ldr r0, [r0] ldr r1, =0x0000105d adds r0, r1 ldrb r0, [r0] bl sub_817A434 b @0817A104 .align 2, 0 .pool @0817A0F8: ldr r0, =sub_817A1C4 str r0, [r1] b @0817A154 .align 2, 0 .pool @0817A104: ldr r0, =0x0203bd18 ldr r0, [r0] ldr r2, =0x00001058 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 .pool @0817A128: cmp r1, r0 bne @0817A138 ldr r0, =0x03005e00 adds r1, r5, r4 lsls r1, 3 adds r1, r0 movs r0, 0xFE strh r0, [r1, 0x8] @0817A138: ldr r0, =0x0203bd18 ldr r1, [r0] ldr r0, =0x00001058 adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] ldr r0, =0x03005e00 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 .pool thumb_func_end sub_817A030 thumb_func_start sub_817A168 sub_817A168: ; 817A168 push {lr} ldr r0, =sub_817A030 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0x8] movs r0, 0x1 strh r0, [r1, 0xA] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_817A320 str r0, [r1] @0817A1B6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc9c ldrb r1, [r0] movs r0, 0x64 adds r5, r1, 0 muls r5, r0 ldr r0, =0x020244ec adds r5, r0 ldr r1, =0x03005d8c ldr r0, =0x0203ce7c ldrh r0, [r0] lsls r0, 3 ldr r2, =0x00000848 adds r0, r2 ldr r4, [r1] adds r4, r0 adds r0, r5, 0 bl GetNature lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 bl sub_8136FE4 ldr r6, =0x0203bc9e strh r0, [r6] ldr r1, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 ldr r1, =0x02021dc4 adds r0, r4, 0 bl sub_8137044 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 bne @0817A248 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E937F bl ExpandTextCodes b @0817A268 .align 2, 0 .pool @0817A248: cmp r0, 0 ble @0817A260 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9390 bl ExpandTextCodes b @0817A268 .align 2, 0 .pool @0817A260: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E93A9 bl ExpandTextCodes @0817A268: ldr r2, =0x03003014 ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] bl sav2_get_text_speed adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 ldr r2, =0x02021fc4 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_817A194 str r1, [r0] add sp, 0x10 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl ldr r0, =0x030022c0 ldr r0, [r0, 0x8] bl set_callback2 adds r0, r4, 0 bl remove_task bl Window_FreeMemory ldr r0, =0x0203bd18 ldr r0, [r0] bl free bl sub_805F094 @0817A304: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_817A2C0 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202499c 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, =0x0203bd18 mov r9, r0 ldr r0, [r0] ldr r2, =0x00001054 adds r1, r0, r2 strh r4, [r1] ldr r1, =0x0000105b adds r0, r1 mov r2, r8 strb r2, [r0] adds r0, r5, 0 bl GetNature mov r2, r9 ldr r1, [r2] ldr r2, =0x0000105a adds r1, r2 strb r0, [r1] ldr r7, =0x02020630 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, =nullsub_12 str r1, [r0] mov r2, r9 ldr r0, [r2] ldr r1, =0x00001053 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, =gUnknown_085F05B0 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, =0x00001053 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 .pool thumb_func_end sub_817A358 thumb_func_start sub_817A434 sub_817A434: ; 817A434 lsls r0, 24 lsrs r0, 24 ldr r3, =0x02020630 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, =0x0000fff8 strh r0, [r2, 0x2E] movs r0, 0x1 strh r0, [r2, 0x30] adds r3, 0x1C adds r1, r3 ldr r0, =sub_817A468 str r0, [r1] bx lr .align 2, 0 .pool 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, =nullsub_12 str r0, [r4, 0x1C] @0817A49A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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, =gUnknown_085F0664 str r2, [r1] adds r5, 0x1C adds r3, r5 ldr r1, =nullsub_12 str r1, [r3] bl obj_alloc_rotscale_entry adds r0, r4, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02020630 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, =gUnknown_085F0668 b @0817A548 .align 2, 0 .pool @0817A540: mov r0, r8 adds r0, 0x10 adds r0, r6, r0 ldr r1, =gUnknown_085F066C @0817A548: str r1, [r0] lsls r0, r7, 4 adds r0, r7 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_alloc_rotscale_entry pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817A4F8 thumb_func_start sub_817A56C sub_817A56C: ; 817A56C push {lr} ldr r0, =gUnknown_085F06A8 movs r1, 0xAE movs r2, 0x54 movs r3, 0x1 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 ldr r2, =0x0000fff4 strh r2, [r1, 0x2E] movs r2, 0x1 strh r2, [r1, 0x30] pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203bd18 ldr r1, [r0] ldr r0, =0x00001056 adds r3, r1, r0 movs r0, 0x1 strh r0, [r3] ldr r2, =gUnknown_085EFEBC ldr r7, =0x0000105a adds r1, r7 ldrb r0, [r1] lsls r0, 1 adds r0, r2 ldrb r2, [r0] movs r4, 0 ldr r5, =gUnknown_085EFF00 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 .pool thumb_func_end sub_817A5CC thumb_func_start sub_817A634 sub_817A634: ; 817A634 push {r4,lr} ldr r0, =0x0203bd18 ldr r4, [r0] ldr r1, =0x00001050 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0x5A bls @0817A646 b @0817A90E @0817A646: lsls r0, 2 ldr r1, =@0817A65C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085EFEBC ldr r2, =0x0000105a adds r0, r4, r2 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrb r1, [r0] ldr r3, =0x00001051 adds r0, r4, r3 strb r1, [r0] ldr r1, =0x0000105b adds r0, r4, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 adds r1, r0 adds r0, r4, 0 stm r0!, {r1} movs r2, 0x44 bl memcpy ldr r2, =0x00001050 adds r1, r4, r2 movs r0, 0xA strb r0, [r1] b @0817A90E .align 2, 0 .pool @0817A818: bl sub_817A91C ldr r1, =gUnknown_085EFEBC ldr r3, =0x0000105a 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, =gUnknown_085F04FC str r1, [r0, 0x10] bl obj_alloc_rotscale_entry @0817A850: ldr r0, =0x00001050 adds r1, r4, r0 movs r0, 0x32 strb r0, [r1] @0817A858: ldr r1, =gUnknown_085EFEBC ldr r2, =0x0000105a 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, =0x00001053 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 .pool @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, =0x00001072 adds r0, r4, r1 movs r2, 0 ldrsh r0, [r0, r2] cmp r0, 0 bne @0817A8E0 ldr r3, =0x00001051 adds r1, r4, r3 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] bl sub_817A91C @0817A8C8: ldr r0, =0x00001050 adds r1, r4, r0 movs r0, 0x3C strb r0, [r1] b @0817A90E .align 2, 0 .pool @0817A8E0: ldr r0, [r4] ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 bl rotscale_free_entry ldr r2, =0x00001050 adds r1, r4, r2 movs r0, 0x46 strb r0, [r1] b @0817A90E .align 2, 0 .pool @0817A8FC: bl sub_817AA3C ldr r3, =0x00001051 adds r0, r4, r3 movs r1, 0 strb r1, [r0] ldr r2, =0x00001050 adds r0, r4, r2 strb r1, [r0] @0817A90E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817A634 thumb_func_start sub_817A91C sub_817A91C: ; 817A91C push {r4-r7,lr} ldr r0, =0x0203bd18 ldr r5, [r0] movs r4, 0 movs r0, 0x83 lsls r0, 5 adds r7, r5, r0 ldr r1, =gUnknown_085EFEEE mov r12, r1 ldr r2, =0x00001051 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, =0x00001068 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, =0x00001074 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, =0x00001076 adds r1, r5, r2 strh r0, [r1] ldrh r0, [r6] ldr r1, =0x00001078 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 .pool @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, =0x0203bd18 ldr r2, [r0] ldr r1, =0x00001078 adds r0, r2, r1 ldr r5, =0x00001068 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 .pool @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, =0x0203bd18 ldr r0, [r0] ldr r0, [r0] bl obj_free_rotscale_entry movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203bd18 ldr r7, [r0] ldr r1, =0x00001070 adds r0, r7, r1 ldrh r0, [r0] mov r9, r0 ldr r2, =0x00001078 adds r0, r7, r2 ldrh r0, [r0] mov r3, r9 subs r0, r3 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r4, =0x0000107a 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, =0x0000107c 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 .pool 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, =0x0203bd18 ldr r6, [r0] movs r0, 0 str r0, [sp] ldr r1, =0x0000107a adds r0, r6, r1 ldr r2, =0x00001074 adds r1, r6, r2 ldrh r2, [r0] ldrh r0, [r1] subs r2, r0 ldr r3, =0x0000107c adds r0, r6, r3 ldr r1, =0x00001076 adds r3, r6, r1 ldrh r1, [r0] ldrh r0, [r3] subs r1, r0 ldr r3, =0x00001068 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, =0x0000106a 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, =0x00001066 adds r7, r6, r3 lsrs r0, 16 ldrh r1, [r7] adds r0, r1 lsls r4, r0, 16 strh r0, [r7] ldr r2, =0x00001064 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, =0x00001078 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 .pool @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, =0x00001062 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 .pool @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, =sub_817ACE4 movs r1, 0 bl AddTask @0817ACDC: pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085EFA8F 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, =gUnknown_085F06D8 movs r1, 0x2 movs r2, 0xE movs r3, 0x1 bl sub_81996C0 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_817AD40 str r1, [r0] add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085EFAAA 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_817ADC0 str r1, [r0] b @0817ADB2 .align 2, 0 .pool @0817ADA0: movs r0, 0x5 bl audio_play adds r0, r5, 0 bl remove_task ldr r0, =sub_817AFD4 bl set_callback2 @0817ADB2: add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817AFD4 bl set_callback2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x040000d4 str r0, [r1] movs r0, 0xC0 lsls r0, 19 str r0, [r1, 0x4] ldr r0, =0x8100c000 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, =0x85000100 str r0, [r1, 0x8] ldr r0, [r1, 0x8] add r0, sp, 0x4 strh r2, [r0] str r0, [r1] ldr r0, =0x05000002 str r0, [r1, 0x4] ldr r0, =0x810001ff str r0, [r1, 0x8] ldr r0, [r1, 0x8] bl sub_80A1A74 ldr r2, =0x02037714 ldr r0, =0x00007fff strh r0, [r2] ldr r1, =0x02037b14 strh r0, [r1] ldr r0, =0x00003945 strh r0, [r2, 0x2] strh r0, [r1, 0x2] movs r1, 0 ldr r3, =0x06000020 ldr r0, =0x00001111 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, =0x0600f000 movs r3, 0x1 ldr r2, =0x000003ff @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, =gUnknown_085F06C0 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, =0x0000ffff str r0, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 movs r0, 0x1 bl enable_irqs ldr r0, =sub_817ADF4 bl SetVBlankCallback ldr r0, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 movs r1, 0x1 strb r1, [r0] b @0817AFC8 .align 2, 0 .pool @0817AFA4: bl fade_and_return_progress_probably ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0817AFC8 ldr r0, =sub_817ADE4 bl set_callback2 movs r0, 0x1 b @0817AFCA .align 2, 0 .pool @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, =0x030022c0 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, =0x0000ffff 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 .pool @0817B008: bl fade_and_return_progress_probably ldr r0, =0x02037fd4 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 .pool thumb_func_end sub_817AFD4 thumb_func_start sub_817B02C sub_817B02C: ; 817B02C push {lr} ldr r0, =gUnknown_085F06C8 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, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085F0740 ldr r1, =0x06004000 bl LZ77UnCompVram ldr r0, =gUnknown_085F0BC0 ldr r1, =0x06007800 bl LZ77UnCompVram ldr r0, =gUnknown_085F06E0 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply cmp r4, 0 beq @0817B08C cmp r4, 0x1 beq @0817B0EC @0817B08C: ldr r0, =gUnknown_085F0DBC movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_085F1398 ldr r1, =0x06003000 bl LZ77UnCompVram ldr r0, =gUnknown_085F0CFC movs r1, 0 movs r2, 0x60 bl gpu_pal_apply ldr r0, =gUnknown_085F5064 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F1668 movs r1, 0x80 lsls r1, 1 movs r2, 0x20 bl gpu_pal_apply bl sub_817B76C b @0817B11E .align 2, 0 .pool @0817B0EC: ldr r0, =gUnknown_085F1824 movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_085F1EAC ldr r1, =0x06003000 bl LZ77UnCompVram ldr r0, =gUnknown_085F17E4 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085F50EC bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F21B0 movs r1, 0x80 lsls r1, 1 movs r2, 0x20 bl gpu_pal_apply bl sub_817B788 @0817B11E: ldr r1, =0x0203bd28 movs r0, 0 strh r0, [r1] ldr r1, =0x0300301c movs r0, 0x8 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000603 movs r0, 0xE bl lcd_io_set ldr r1, =0x00000702 movs r0, 0xC bl lcd_io_set ldr r1, =0x00000f05 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 .pool @0817B194: ldr r1, =0x00000603 movs r0, 0xE bl lcd_io_set ldr r1, =0x00000702 movs r0, 0xC bl lcd_io_set ldr r1, =0x00000f05 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 .pool 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, =gUnknown_085F0740 ldr r1, =0x06004000 bl LZ77UnCompVram ldr r0, =gUnknown_085F0BC0 ldr r1, =0x06007800 bl LZ77UnCompVram cmp r4, 0x4 bhi @0817B214 lsls r0, r4, 2 ldr r1, =@0817B200 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0817B200: .4byte @0817B214 .4byte @0817B270 .4byte @0817B2DC .4byte @0817B2DC .4byte @0817B334 @0817B214: ldr r0, =gUnknown_085F06E0 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085F0DBC movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_085F1398 ldr r1, =0x06003000 bl LZ77UnCompVram ldr r0, =gUnknown_085F0CFC movs r1, 0 movs r2, 0x60 bl gpu_pal_apply ldr r0, =gUnknown_085F5064 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F16A8 ldr r1, =0x06010000 bl LZ77UnCompVram ldr r0, =gUnknown_085F1668 b @0817B2A6 .align 2, 0 .pool @0817B270: ldr r0, =gUnknown_085F0700 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085F0DBC movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_085F1398 ldr r1, =0x06003000 bl LZ77UnCompVram ldr r0, =gUnknown_085F0D5C movs r1, 0 movs r2, 0x60 bl gpu_pal_apply ldr r0, =gUnknown_085F5064 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F16A8 ldr r1, =0x06010000 bl LZ77UnCompVram ldr r0, =gUnknown_085F1688 @0817B2A6: movs r1, 0x80 lsls r1, 1 movs r2, 0x20 bl gpu_pal_apply bl sub_817B76C b @0817B370 .align 2, 0 .pool @0817B2DC: ldr r0, =gUnknown_085F0700 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085F1824 movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_085F1EAC ldr r1, =0x06003000 bl LZ77UnCompVram ldr r4, =gUnknown_085F1804 adds r0, r4, 0 movs r1, 0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085F50EC 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 .pool @0817B334: ldr r0, =gUnknown_085F0720 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_085F235C movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram ldr r0, =gUnknown_085F2568 ldr r1, =0x06003000 bl LZ77UnCompVram ldr r0, =gUnknown_085F231C movs r1, 0 movs r2, 0x40 bl gpu_pal_apply ldr r0, =gUnknown_085F5180 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_085F2548 movs r1, 0x80 lsls r1, 1 movs r2, 0x20 bl gpu_pal_apply bl sub_817B7A4 @0817B370: ldr r1, =0x0300301c movs r0, 0x8 strb r0, [r1] ldr r1, =0x0203bd28 movs r0, 0 strh r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817B1C8 thumb_func_start sub_817B3A8 sub_817B3A8: ; 817B3A8 push {lr} ldr r1, =0x00000603 movs r0, 0xE bl lcd_io_set ldr r1, =0x00000702 movs r0, 0xC bl lcd_io_set ldr r1, =0x00000f05 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 .pool 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, =sub_817B458 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, =0x03005e00 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 .pool 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, =0x03005e00 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, =0x0203bd24 ldr r0, =0x0203bd26 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, =0x0203bd24 ldr r0, =0x0203bd26 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 .pool @0817B4F0: ldr r0, =0x0203bd24 ldrh r1, [r0] movs r0, 0x1A bl lcd_io_set @0817B4FA: ldr r0, =0x03005e00 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, =0x0203bd24 ldrh r1, [r0] movs r0, 0x1E bl lcd_io_set @0817B532: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldr r2, [r0, 0x20] movs r0, 0x3 ands r0, r2 cmp r0, 0 bne @0817B620 ldr r0, =0x02037fd4 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, =0x02037714 ldrh r1, [r2, 0x12] mov r0, sp strh r1, [r0] ldrh r1, [r2, 0x14] b @0817B596 .align 2, 0 .pool @0817B58C: ldr r2, =0x02037714 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 .pool @0817B5B8: ldr r0, =0x030022c0 ldr r2, [r0, 0x20] movs r0, 0x3 ands r0, r2 cmp r0, 0 bne @0817B620 ldr r0, =0x02037fd4 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, =0x00003d27 adds r0, r2, 0 strh r0, [r1] adds r1, 0x2 ldr r2, =0x00000295 b @0817B606 .align 2, 0 .pool @0817B5F8: mov r1, sp movs r2, 0xC7 lsls r2, 2 adds r0, r2, 0 strh r0, [r1] adds r1, 0x2 ldr r2, =0x00003d27 @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 .pool thumb_func_end sub_817B540 thumb_func_start sub_817B62C sub_817B62C: ; 817B62C push {lr} adds r2, r0, 0 ldr r0, =0x0203bd28 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 .pool @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, =0x0000ffe0 strh r0, [r2, 0x20] @0817B668: movs r1, 0x2E ldrsh r0, [r2, r1] cmp r0, 0 beq @0817B688 ldr r1, =0x0203bd24 ldr r0, =0x0203bd26 ldrh r0, [r0] ldrh r1, [r1] adds r0, r1 b @0817B68C .align 2, 0 .pool @0817B688: ldr r0, =0x0203bd24 ldrh r0, [r0] @0817B68C: negs r0, r0 strh r0, [r2, 0x26] @0817B690: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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, =gUnknown_085F504C 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, =0x02020638 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 .pool thumb_func_end sub_817B698 thumb_func_start sub_817B76C sub_817B76C: ; 817B76C push {lr} ldr r1, =gUnknown_085F50A4 ldr r2, =gUnknown_085F5094 movs r0, 0 movs r3, 0x9 bl sub_817B698 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817B76C thumb_func_start sub_817B788 sub_817B788: ; 817B788 push {lr} ldr r1, =gUnknown_085F5120 ldr r2, =gUnknown_085F5114 movs r0, 0x1 movs r3, 0xC bl sub_817B698 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817B788 thumb_func_start sub_817B7A4 sub_817B7A4: ; 817B7A4 push {lr} ldr r1, =gUnknown_085F519C ldr r2, =gUnknown_085F5198 movs r0, 0x1 movs r3, 0x6 bl sub_817B698 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool 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, =gUnknown_085F51EC 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, =gUnknown_085F523C 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, =0x02020630 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 .pool 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, =gUnknown_085F5204 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, =gUnknown_085F5254 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, =0x02020630 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 .pool 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, =0x02020630 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 .pool 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, =gUnknown_085F528C mov r8, r0 lsls r2, 16 asrs r4, r2, 16 ldr r0, =0xffe00000 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, =0x02020630 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, =sub_817B8E8 str r0, [r4] adds r0, r6, 0 pop {r3} mov r8, r3 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085F52A4 mov r8, r0 lsls r2, 16 asrs r4, r2, 16 ldr r0, =0xffe00000 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, =0x02020630 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, =sub_817B8E8 str r0, [r4] adds r0, r6, 0 pop {r3} mov r8, r3 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085F5458 @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 .pool 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, =gUnknown_085F5440 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, =0x02020630 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, =sub_817BA7C str r0, [r3] @0817BB82: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085F5440 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, =0x02020630 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, =sub_817BB94 str r0, [r3] @0817BC5E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085F5440 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, =0x02020630 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, =sub_817BC70 str r0, [r3] @0817BD0E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085F5440 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, =0x02020630 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, =sub_817BD20 str r0, [r5] @0817BE60: pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817BDF0 thumb_func_start sub_817BE78 sub_817BE78: ; 817BE78 push {lr} ldr r0, =gUnknown_085F540C bl gpu_tile_obj_decompress_and_load3 ldr r0, =gUnknown_085F541C bl gpu_pal_obj_alloc_and_load_multiple pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817BEC4 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xA] pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 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, =0x00007fff str r1, [sp] movs r1, 0xA movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =sub_817BF14 str r0, [r5] movs r0, 0x8C bl audio_play add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x03005e00 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 .pool @0817BF70: movs r0, 0x60 strh r0, [r1, 0x26] ldr r0, =sub_817BF84 str r0, [r1] @0817BF78: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =sub_817BFCC movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x26] ldr r1, =sub_817C000 str r1, [r0] movs r0, 0xB7 bl audio_play pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x03005e00 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 .pool @0817C048: ldr r0, =sub_817C058 str r0, [r1] @0817C04C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817C080 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x26] ldr r1, =sub_817C0B4 str r1, [r0] movs r0, 0x66 bl audio_play pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x03005e00 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, =0x03005e00 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 .pool @0817C124: ldr r0, =sub_817C134 str r0, [r1] @0817C128: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817C174 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xC] pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 lsls r5, r4, 2 adds r5, r4 lsls r5, 3 adds r5, r0 movs r0, 0 strh r0, [r5, 0x26] ldr r0, =0x02037b54 ldr r1, =0x02037754 movs r2, 0x30 bl CpuSet ldr r0, =0xfff9041c ldr r1, =0x00007fff str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =sub_817C1D4 str r0, [r5] movs r0, 0xCA bl audio_play add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0xffff041c ldr r1, =0x00007fff str r1, [sp] movs r1, 0x10 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 @0817C234: ldr r0, =0x03005e00 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 .pool @0817C250: ldr r0, =sub_817C260 str r0, [r1] @0817C254: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817C1D4 thumb_func_start sub_817C260 sub_817C260: ; 817C260 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x02037fd4 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 .pool 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, =sub_817C2B0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0xC] pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 lsls r5, r4, 2 adds r5, r4 lsls r5, 3 adds r5, r0 movs r0, 0 strh r0, [r5, 0x26] ldr r0, =0x02037b54 ldr r1, =0x02037754 movs r2, 0x30 bl CpuSet ldr r0, =0xfff90400 ldr r1, =0x00007fff str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =sub_817C310 str r0, [r5] movs r0, 0xCA bl audio_play add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0xffff0400 ldr r1, =0x00007fff str r1, [sp] movs r1, 0x10 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 @0817C370: ldr r0, =0x03005e00 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 .pool @0817C38C: ldr r0, =sub_817C260 str r0, [r1] @0817C390: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817C4EC ldr r2, =0x00007fff @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, =0x03005e00 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, =0x02020630 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, =nullsub_68 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, =0x02037d14 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, =nullsub_68 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 .pool thumb_func_end sub_817C3A0 thumb_func_start sub_817C4EC sub_817C4EC: ; 817C4EC lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r0, [r1, 0x12] movs r0, 0x8 strh r0, [r1, 0x14] ldr r0, =sub_817C510 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =sub_817C560 str r0, [r2] @0817C556: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =sub_817C72C str r0, [r2] b @0817C670 .align 2, 0 .pool @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, =sub_817C510 str r0, [r5] @0817C670: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 mov r8, r1 ldr r1, =0x03005e00 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 .pool 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, =0x02020630 mov r8, r1 ldr r1, =0x03005e00 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 .pool thumb_func_end sub_817C72C thumb_func_start sub_817C7DC sub_817C7DC: ; 817C7DC ldr r2, =gUnknown_0860A320 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 .pool 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, =gUnknown_0860A3AC b @0817C84E .align 2, 0 .pool @0817C810: lsrs r0, r4, 25 ldr r2, =0x000001ff ands r2, r5 cmp r0, 0x13 bhi @0817C828 cmp r0, 0x12 bcs @0817C834 cmp r0, 0 beq @0817C82C b @0817C83C .align 2, 0 .pool @0817C828: cmp r0, 0x15 bne @0817C83C @0817C82C: ldr r1, =gUnknown_085F5494 b @0817C844 .align 2, 0 .pool @0817C834: ldr r1, =gUnknown_085FA1D8 b @0817C844 .align 2, 0 .pool @0817C83C: ldr r1, =gUnknown_0860A168 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 .pool 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, =gUnknown_0860A3DC 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 .pool thumb_func_end sub_817C858 thumb_func_start sub_817C8BC sub_817C8BC: ; 817C8BC push {lr} ldr r0, =0x02037318 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 .pool @0817C8D8: ldr r1, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =hm_teleport_run_dp02scr str r0, [r1] movs r0, 0x1 @0817C8E6: pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_817C94C 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 .pool 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, =0x02022fec 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, =0x0202449c ldr r0, [r0] movs r1, 0x81 lsls r1, 2 adds r7, r0, r1 ldr r5, =0x0202420b ldrb r0, [r5] bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0202420c ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x0202420e ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 mov r9, r0 ldr r0, =0x0203aba8 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, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r2 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec b @0817CA10 .align 2, 0 .pool @0817CA00: ldr r2, =0x0202406e ldrb r0, [r5] lsls r0, 1 adds r0, r2 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 @0817CA10: adds r1, r0 str r1, [sp, 0x8] cmp r6, 0 bne @0817CA3C ldr r0, =0x0202420c ldrb r0, [r0] lsls r0, 1 adds r0, r2 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec b @0817CA4C .align 2, 0 .pool @0817CA3C: ldr r0, =0x0202420c ldrb r0, [r0] lsls r0, 1 adds r0, r2 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 @0817CA4C: adds r1, r0 str r1, [sp, 0xC] ldr r0, =0x0202420b ldrb r0, [r0] ldr r1, =0x0203aba8 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 .pool @0817CA9C: ldr r0, =0x0202420b ldrb r0, [r0] bl battle_get_per_side_status lsls r0, 24 lsrs r0, 25 mov r8, r0 ldr r0, =0x0202420c ldrb r0, [r0] bl battle_get_per_side_status lsls r0, 24 lsrs r5, r0, 25 ldr r0, =0x0202420e 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, =@0817CAEC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02022fec 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 .pool @0817D098: movs r0, 0x1 mov r1, r10 movs r2, 0x1 movs r3, 0 bl sub_817E684 ldr r0, =0x02022fec 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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, =0xfffc7fff 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 .pool @0817D124: lsls r2, r4, 1 adds r2, r4 lsls r2, 2 adds r2, r7, r2 ldr r1, =0x0202406e ldr r0, =0x0202420b 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 .pool @0817D16C: lsls r0, r4, 1 adds r0, r4 lsls r0, 2 adds r5, r7, r0 ldr r1, =0x0202406e ldr r0, =0x0202420b 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 .pool @0817D1B8: ldr r1, =0x02022f5c 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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, =0xfffffe7f ands r0, r3 orrs r0, r1 strh r0, [r2] bl @0817E0A6 .align 2, 0 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202449c ldr r0, [r0] adds r0, 0xB3 movs r1, 0x1 bl @0817E0A4 .align 2, 0 .pool @0817D3B8: movs r0, 0x12 mov r1, r10 movs r2, 0 b @0817D48E @0817D3C0: ldr r0, =0x02022f58 ldrb r2, [r0, 0x2] cmp r2, 0 bne @0817D3CC bl @0817E0A6 @0817D3CC: ldr r1, =0x02022f6a 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 .pool @0817D3E8: subs r2, 0x1 lsls r2, 24 lsrs r2, 24 movs r0, 0x16 b @0817D48C @0817D3F2: ldr r0, =0x02022f58 ldrb r2, [r0, 0x2] cmp r2, 0 bne @0817D3FE bl @0817E0A6 @0817D3FE: ldr r0, =0x0202420b ldr r1, =0x0202420c ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 bne @0817D436 ldr r1, =0x02022f6a 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 .pool @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, =0x02022f58 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 .pool @0817D45C: ldr r0, =0x02022f58 ldrb r2, [r0, 0x2] cmp r2, 0 bne @0817D468 bl @0817E0A6 @0817D468: ldr r1, =0x02022f6a 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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, =0xfffffe3f ands r0, r3 orrs r0, r1 strh r0, [r2, 0x30] adds r2, 0x32 bl @0817DF0A .align 2, 0 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e ldr r6, =0x0202420e 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, =0x0202420b 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, =0xfffffe3f 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 .pool @0817D76C: ldr r0, [sp, 0x8] movs r1, 0x39 movs r2, 0 bl pokemon_getattr cmp r0, 0 bne @0817D77E bl @0817E0A6 @0817D77E: ldr r6, =0x0202406e ldr r5, =0x0202420b 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 .pool @0817D7D8: ldr r5, =0x0202406e ldr r6, =0x0202420e 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, =0x0202420b 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 .pool @0817D838: ldr r5, =0x0202406e ldr r6, =0x0202420e 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, =0x0202420b 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 .pool @0817D8A4: ldr r0, [sp, 0x8] movs r1, 0x39 movs r2, 0 bl pokemon_getattr cmp r0, 0 bne @0817D8B6 bl @0817E0A6 @0817D8B6: ldr r2, =0x0202406e mov r8, r2 ldr r6, =0x0202420b 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 .pool @0817D94C: lsls r2, r5, 3 lsls r0, r6, 4 adds r2, r0 adds r2, r7, r2 ldr r1, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e ldr r6, =0x0202420e 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, =0x0202420b 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 .pool @0817DA24: ldr r1, =0x0202406e ldr r0, =0x0202420b 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 .pool @0817DA68: ldr r5, =0x0202406e ldr r6, =0x0202420e 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, =0x0202420b 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 .pool @0817DACC: ldr r1, =0x0202406e ldr r0, =0x0202420b 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, =0x0203aba8 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 .pool @0817DB24: ldr r5, =0x0202406e ldr r6, =0x0202420e 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, =0x0202420b 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, =0xfffc7fff 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 .pool @0817DB90: ldr r1, =0x0202406e ldr r0, =0x0202420b 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 .pool @0817DBD4: lsls r3, 3 mov r1, r9 lsls r0, r1, 4 adds r3, r0 adds r3, r7, r3 ldr r1, =0x0202406e ldr r0, =0x0202420b 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, =0xfffc7fff 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @0817DD38: mov r0, r8 lsls r2, r0, 3 lsls r0, r4, 4 adds r2, r0 adds r2, r7, r2 ldr r1, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @0817DE10: lsls r2, r4, 1 adds r2, r4 lsls r2, 2 adds r2, r7, r2 ldr r1, =0x0202406e ldr r0, =0x0202420b 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, =0xfffffe3f 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 .pool @0817DE58: ldr r1, =0x02022f5a 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, =0x02022f5a 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, =0xfffffe3f 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, =0x02022f5a 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 .pool @0817DEDC: lsls r2, r4, 1 adds r2, r4 lsls r2, 2 adds r2, r7, r2 ldr r1, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0xfffffe3f ands r0, r2 strh r0, [r3] ldrb r2, [r1] movs r0, 0x31 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =gUnknown_0860A8A4 ldr r6, =0x0000ffff 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, =0x0000ffff cmp r1, r0 beq @0817E0F4 movs r0, 0 b @0817E0F6 .align 2, 0 .pool @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, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 bne @0817E122 b @0817E310 @0817E122: ldr r0, =0x0202449c ldr r0, [r0] movs r1, 0x81 lsls r1, 2 adds r1, r0, r1 str r1, [sp, 0x8] ldr r2, =0x0202420b mov r10, r2 ldrb r0, [r2] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 mov r9, r0 ldr r0, =0x0202420c 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 .pool @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, =0x0202406e 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, =gBattleMoves 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, =0x00000111 cmp r7, r0 bne @0817E272 mov r1, r10 ldrb r0, [r1] lsls r0, 1 ldr r2, =0x0202406e 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, =0x0202406e 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, =gBattleMoves 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 .pool 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, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @0817E3EE ldr r0, =0x0202449c ldr r0, [r0] movs r1, 0x81 lsls r1, 2 adds r4, r0, r1 ldr r0, =0x0202420b 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 .pool @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, =0x00007fff str r3, [sp, 0xC] movs r4, 0 str r4, [sp, 0x10] movs r7, 0 str r7, [sp, 0x14] mov r8, r0 ldr r0, =0x0202449c 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, =0x020244ec 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, =0x02024744 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, =0x02022fec 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, =0x020244ec 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, =0x02024744 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, =0x02024744 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, =0x02024744 adds r0, r3 movs r1, 0x19 movs r2, 0 bl pokemon_getattr cmp r4, r0 bls @0817E5A0 b @0817E594 .align 2, 0 .pool @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, =0x020244ec 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, =0x02022fec 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, =0x02024474 adds r0, 0x25 ldrb r0, [r0] bl sub_806D82C lsls r0, 16 cmp r0, 0 beq @0817E630 b @0817E670 .align 2, 0 .pool @0817E620: ldr r0, =0x02024474 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, =0x02024474 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 .pool @0817E65C: ldr r0, =0x02024474 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 .pool 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, =0x0202449c 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, =0x0202420b ldrb r0, [r0] bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0202420c 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, =@0817E6F0 adds r1, r0, r1 ldr r1, [r1] mov r12, r0 mov pc, r1 .align 2, 0 .pool .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, =0x0202406e ldr r0, =0x0202420b 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, =gUnknown_0860A834 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 .pool @0817E79C: ldr r1, =gUnknown_0860A834 add r1, r12 ldr r7, =0x0202406e lsls r0, r4, 1 adds r0, r4 lsls r2, r0, 4 ldr r4, =0x0000ffff ldr r1, [r1] ldr r3, =0x0202420b 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 .pool @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, =gUnknown_0860A834 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 .pool @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, =gUnknown_0860A834 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 .pool @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, =gUnknown_0860A834 add r0, r12 ldr r2, [r0] lsls r0, r6, 1 adds r0, r2 b @0817EA64 .align 2, 0 .pool @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, =gUnknown_0860A834 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 .pool @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, =gUnknown_0860A834 add r0, r12 ldr r0, [r0] ldrh r0, [r0] ldrh r2, [r1] adds r0, r2 b @0817EA6A .align 2, 0 .pool @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, =gUnknown_0860A834 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, =gUnknown_0860A834 add r0, r12 ldr r0, [r0] ldrh r0, [r0] ldrh r2, [r1] adds r0, r2 b @0817EA6A .align 2, 0 .pool @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, =gUnknown_0860A834 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 .pool @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, =gUnknown_0860A834 add r0, r12 ldr r0, [r0] ldrh r0, [r0] ldrh r2, [r1] adds r0, r2 b @0817EA6A .align 2, 0 .pool @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, =gUnknown_0860A834 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 .pool 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, =0x0202449c ldr r0, [r0] movs r1, 0x81 lsls r1, 2 adds r5, r0, r1 ldr r3, =0x0202420b mov r8, r3 ldrb r0, [r3] bl battle_side_get_owner lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x0202420c 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, =@0817EAEC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e ldr r0, =0x0202420b 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 .pool @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, =0x0202406e 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 .pool 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, =0x02022fec ldr r0, [r7] ldr r1, =0x02000003 ands r0, r1 cmp r0, 0 beq @0817EEE6 b @0817F1FA @0817EEE6: ldr r4, =0x0202420b ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @0817EEF8 b @0817F1FA @0817EEF8: ldr r5, =0x02024084 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, =0x0202420c 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, =0x020241ea ldrh r1, [r0] cmp r1, 0xED bne @0817EF2E b @0817F1FA @0817EF2E: ldr r0, =0x00000137 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, =gBattleMoves ldr r2, =0x020244b0 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, =gUnknown_0860A4AC ldr r4, =0x0000ffff 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, =0x0000ffff cmp r1, r0 beq @0817EF98 b @0817F1FA @0817EF98: ldr r2, =0x0202420b ldrb r0, [r2] adds r0, r6 ldrb r0, [r0] lsls r0, 2 mov r1, sp adds r1, r0 adds r1, 0x10 ldr r0, =0x020241f0 ldr r0, [r0] str r0, [r1] ldr r0, =0x020241ea 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, =0x0202420c mov r9, r4 @0817EFC2: lsls r1, r5, 1 ldr r6, =0x0202420b ldrb r0, [r6] movs r2, 0x58 muls r0, r2 adds r1, r0 ldr r0, =0x02024084 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, =0x0202428e 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, =0x0202420b ldrb r0, [r2] movs r4, 0x58 muls r0, r4 ldr r6, =0x02024084 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, =0x0202420b 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, =0x020241f0 str r3, [r4] ldr r1, =0x020242ac ldr r2, =0x0202420b 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, =gBattleMoves 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, =0x0202433c ldr r6, =0x0202420b ldrb r1, [r6] lsls r1, 4 adds r1, r0 ldrb r0, [r1] lsls r0, 28 cmp r0, 0 bge @0817F08C ldr r4, =0x020241f0 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, =0x020241f0 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, =0x0202420b ldr r6, =0x020244b0 ldr r4, =0x0202406e 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, =0x0202420c ldr r6, =0x02024744 ldr r0, =0x0202420b 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, =0x0202420b ldrb r0, [r2] lsls r0, 1 add r0, r8 ldrh r0, [r0] mov r3, r9 muls r3, r0 adds r0, r3, 0 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 ldr r4, =0x0202420b 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, =0x02024090 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 .pool @0817F1D4: adds r5, 0x1 cmp r5, 0x3 bgt @0817F1DC b @0817F0CC @0817F1DC: ldr r2, =0x020241f0 ldr r1, =0x020244b0 ldr r0, =0x0202420b 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, =0x020241ea 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 .pool 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, =gBattleMoves 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, =gUnknown_0860A4AC ldr r7, =0x0000ffff 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, =0x0000ffff cmp r1, r0 beq @0817F270 movs r0, 0 str r0, [r6] b @0817F2A0 .align 2, 0 .pool @0817F270: cmp r2, 0x95 bne @0817F294 ldr r2, =0x02024084 ldr r0, =0x0202420b 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 .pool @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, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @0817F324 ldr r0, =0x0202449c ldr r3, [r0] ldr r0, =0x0000025b adds r4, r3, r0 ldrb r2, [r4] subs r1, 0x21 adds r0, r1, 0 ands r0, r2 strb r0, [r4] ldr r0, =0x00000267 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 .pool 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, =0x02024744 cmp r0, 0 bne @0817F356 ldr r6, =0x020244ec @0817F356: movs r4, 0 ldr r1, =0x0202406e lsls r0, r5, 1 adds r5, r0, r1 b @0817F36E .align 2, 0 .pool @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, =gUnknown_0860A8C8 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @0817F48C movs r0, 0 b @0817F492 .align 2, 0 .pool @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, =0x03005e00 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, =nullsub_12 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, =gUnknown_0860AA88 ldr r7, =0x03001274 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 .pool 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, =sub_817F498 movs r1, 0x80 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 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 .pool thumb_func_end sub_817F544 thumb_func_start sub_817F578 sub_817F578: ; 817F578 lsls r1, 24 ldr r3, =0x03001274 movs r2, 0x1 str r2, [r3] ldr r2, =gUnknown_0860AA88 lsrs r1, 22 adds r1, r2 ldr r1, [r1] str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =sub_817F498 movs r1, 0x80 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 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, =0x0202406e lsrs r0, 23 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 bl GetNature lsls r0, 24 lsrs r0, 24 lsls r1, r6, 1 ldr r2, =gUnknown_0860AD2F adds r0, r2 adds r1, r6 ldrb r0, [r0] adds r1, r0 lsls r1, 24 lsrs r1, 24 ldr r0, =gUnknown_0860ACE4 adds r1, r0 ldrb r0, [r1] strh r0, [r4, 0xE] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_817F594 thumb_func_start sub_817F60C sub_817F60C: ; 817F60C ldr r1, =nullsub_69 str r1, [r0, 0x1C] bx lr .align 2, 0 .pool 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, =0xffff0000 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 ObjAffineSet ldr r0, =0x02021bc0 lsls r4, 3 adds r4, r0 ldrh r0, [r5] strh r0, [r4] ldrh r0, [r5, 0x2] strh r0, [r4, 0x2] ldrh r0, [r5, 0x4] strh r0, [r4, 0x4] ldrh r0, [r5, 0x6] strh r0, [r4, 0x6] add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0860AD68 str r0, [r4, 0x10] ldr r0, =0x03001274 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 .pool @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, =0x03001240 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 .pool @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, =0x03001270 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 .pool 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, =0x03001274 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 .pool @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, =sub_8184D88 str r0, [r6, 0x1C] b @0817F88C .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 b @0817F8EE .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 b @0817F946 .align 2, 0 .pool @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, =sub_817F8FC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 b @0817F9C4 .align 2, 0 .pool @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, =sub_817F978 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x24] b @0817FA5E .align 2, 0 .pool @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, =0xffffff00 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 .pool @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, =sub_817F9F4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x24] b @0817FB56 .align 2, 0 .pool @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, =@0817FAC8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_8184D88 str r0, [r6, 0x1C] b @0817FC12 .align 2, 0 .pool @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, =gUnknown_0860AD70 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, =sub_8184D88 str r0, [r4, 0x1C] b @0817FC6A .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] b @0817FCBE .align 2, 0 .pool @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, =sub_817FC20 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 b @0817FD12 .align 2, 0 .pool @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, =sub_817FCDC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 b @0817FD78 .align 2, 0 .pool @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, =sub_817FD44 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r7, 0x1C] movs r0, 0 strh r0, [r7, 0x24] strh r0, [r7, 0x26] b @0817FE24 .align 2, 0 .pool @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, =0x03001240 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 .pool @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, =0x03001240 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 .pool @0817FEB4: adds r0, r4, 0 bl sub_817F77C ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b @0817FEF2 .align 2, 0 .pool @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, =0x03001240 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, =sub_817FE30 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_8184D88 str r0, [r4, 0x1C] b @0817FFAA .align 2, 0 .pool @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, =0x03001240 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, =sub_817FF3C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_8184D88 str r0, [r5, 0x1C] b @0818006A .align 2, 0 .pool @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, =0x000001bf 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, =0x03001240 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 .pool 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, =0x03001240 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, =sub_817FFF0 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] b @08180128 .align 2, 0 .pool @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, =sub_8184D88 str r0, [r6, 0x1C] b @08180204 .align 2, 0 .pool @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, =0xffffff00 adds r0, r1 adds r4, r0 strh r4, [r6, 0x36] adds r4, r5, 0 b @081801E4 .align 2, 0 .pool @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, =sub_8184D88 str r0, [r5, 0x1C] mov r0, r8 strh r0, [r5, 0x26] b @0818030A .align 2, 0 .pool @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, =0xffffff00 adds r1, r2, 0 subs r1, r0 strh r1, [r5, 0x36] b @081802B2 .align 2, 0 .pool @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, =gUnknown_0860AA80 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x26] b @08180394 .align 2, 0 .pool @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, =sub_818031C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x24] b @0818045E .align 2, 0 .pool @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, =sub_8184D88 str r0, [r6, 0x1C] b @081804E8 .align 2, 0 .pool @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, =0x00000ccc 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 .pool 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, =sub_8184D88 str r0, [r6, 0x1C] b @08180582 .align 2, 0 .pool @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, =0x00000ccc 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 .pool 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, =sub_81804F8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r6, 0x1C] b @08180644 .align 2, 0 .pool @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, =0x00000ccc 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 .pool 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, =sub_81805B0 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r6, 0x1C] b @081806FC .align 2, 0 .pool @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, =0x00000ccc 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 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] b @081807FE .align 2, 0 .pool @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, =sub_8180714 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r5, 0x1C] b @081808D0 .align 2, 0 .pool @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, =0x03001240 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x6] str r1, [sp] ldr r5, =gUnknown_0860AD8E 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, =sub_8184D88 str r0, [r4, 0x1C] b @08180A3A .align 2, 0 .pool @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, =0x03001240 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, =sub_8180900 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x000002df movs r1, 0x10 movs r2, 0 bl pal_fade_1 ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b @08180AE8 .align 2, 0 .pool @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, =0x000002df 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 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] b @08180B50 .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] b @08180BB6 .align 2, 0 .pool @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, =0x000003ff movs r1, 0x10 movs r2, 0 bl pal_fade_1 ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b @08180C20 .align 2, 0 .pool @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, =0x000003ff 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 .pool 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, =0x00006018 movs r1, 0x10 movs r2, 0 bl pal_fade_1 ldr r0, =sub_8184D88 str r0, [r4, 0x1C] b @08180C8C .align 2, 0 .pool @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, =0x00006018 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 .pool 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, =sub_8180CB4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8180CE8 str r0, [r4, 0x1C] @08180CD6: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8180D44 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 .pool 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, =sub_8180DC0 str r0, [r4, 0x1C] @08180DAE: adds r0, r4, 0 bl sub_817F70C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8180E28 str r0, [r4, 0x1C] b @08180E1C .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] @08180E4A: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8180E78 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fff8 strh r0, [r4, 0x26] strh r1, [r4, 0x36] ldr r0, =sub_8180ED0 str r0, [r4, 0x1C] @08180EBA: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8180F2C 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 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] @08180F96: adds r0, r4, 0 bl sub_817F70C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r3, 0x1C] @08180FFC: movs r0, 0x2 @08180FFE: strh r0, [r3, 0x34] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8181024 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fff0 strh r0, [r4, 0x24] movs r0, 0x10 strh r0, [r4, 0x26] ldr r0, =sub_8181068 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 .pool 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, =sub_81810C4 str r0, [r4, 0x1C] @081810B2: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] @081810E8: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8181110 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8181144 str r0, [r4, 0x1C] @08181134: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fff0 strh r0, [r4, 0x24] movs r0, 0x10 strh r0, [r4, 0x26] movs r0, 0 strh r0, [r4, 0x32] ldr r0, =sub_81811A4 str r0, [r4, 0x1C] b @08181186 .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] @081811CE: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_8181214 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end pokemonanimfunc_2A thumb_func_start sub_8181214 sub_8181214: ; 8181214 push {r4-r6,lr} adds r4, r0, 0 ldr r6, =0x03001240 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 .pool @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, =0x0000ffff 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 .pool @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, =0x03001240 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 .pool @08181328: adds r0, r4, 0 bl sub_817F77C ldr r0, =sub_8184D88 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 .pool 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, =sub_8181370 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0xffffff00 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, =sub_8184D88 str r0, [r4, 0x1C] @08181404: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0860AA64 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, =sub_8184D88 str r0, [r4, 0x1C] b @081814CE .align 2, 0 .pool @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, =0x000003ff movs r1, 0x10 movs r2, 0x10 bl pal_fade_1 b @08181494 .align 2, 0 .pool @08181488: ldrh r0, [r4, 0x3C] ldr r3, =0x000003ff movs r1, 0x10 movs r2, 0 bl pal_fade_1 @08181494: movs r0, 0 strh r0, [r4, 0x36] ldr r1, =gUnknown_0860AA64 @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 .pool @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, =0x03001240 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 .pool @0818153C: adds r0, r6, 0 bl sub_817F77C ldr r0, =sub_8184D88 str r0, [r6, 0x1C] b @08181588 .align 2, 0 .pool @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, =0x00000ccc 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 .pool 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, =0x03001240 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, =sub_81814D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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 .pool @0818163C: adds r0, r6, 0 bl sub_817F77C ldr r0, =sub_8184D88 str r0, [r6, 0x1C] b @0818168A .align 2, 0 .pool @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, =0x00000ccc 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 .pool 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, =0x03001240 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, =sub_81815D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8181708 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8181770 str r0, [r4, 0x1C] @08181760: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8181794 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 .pool 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, =pokemonanimfunc_10 str r0, [r4, 0x1C] @08181800: adds r0, r4, 0 bl sub_817F70C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8181794 thumb_func_start sub_8181810 sub_8181810: ; 8181810 push {r4-r6,lr} adds r5, r0, 0 ldr r4, =0x03001240 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 .pool @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, =sub_8184D88 str r0, [r5, 0x1C] @0818193A: ldr r2, =0x03001240 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 .pool 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, =0x03001240 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, =sub_8181810 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r5, 0x1C] movs r0, 0 strh r0, [r5, 0x24] b @08181A62 .align 2, 0 .pool @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, =0x03001240 lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldr r0, =0x0000ffff strh r0, [r1, 0x8] adds r0, r4, 0 bl sub_817F670 strh r5, [r4, 0x34] adds r0, r4, 0 bl sub_8181ABC ldr r0, =sub_8181ABC str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end pokemonanimfunc_32 thumb_func_start sub_8181ABC sub_8181ABC: ; 8181ABC push {r4-r6,lr} adds r4, r0, 0 ldr r6, =0x03001240 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 .pool @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, =sub_8181B4C str r0, [r4, 0x1C] b @08181B3E .align 2, 0 .pool @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, =sub_8181C2C str r0, [r4, 0x1C] b @08181C1A .align 2, 0 .pool @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, =0x03001240 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 .pool 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, =0x03001240 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, =sub_8181ABC b @08181C84 .align 2, 0 .pool @08181C7C: adds r0, r4, 0 bl sub_817F77C ldr r0, =sub_8184D88 @08181C84: str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x24] b @08181CD0 .align 2, 0 .pool @08181C90: ldr r2, =0x03001240 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 .pool 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, =0x03001240 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 .pool @08181D48: adds r0, r4, 0 bl sub_817F77C ldr r0, =sub_8184D88 str r0, [r4, 0x1C] @08181D52: adds r0, r4, 0 bl sub_817F70C b @08181DA6 .align 2, 0 .pool @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, =0x03001240 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 .pool 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, =0x03001240 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, =sub_8181CE8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] adds r0, r4, 0 bl sub_817F70C b @08181E8A .align 2, 0 .pool @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, =sub_8184D88 str r0, [r3, 0x1C] @08181EEE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8181F14 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8181F50 str r0, [r4, 0x1C] b @08181F38 .align 2, 0 .pool @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, =sub_8181FC0 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x3A] b @08181FAE .align 2, 0 .pool @08181F74: movs r1, 0x32 ldrsh r0, [r4, r1] lsls r0, 4 negs r0, r0 cmp r0, 0 bge @08181F84 ldr r1, =0x000001ff 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 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] b @08181FFE .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] b @081820A6 .align 2, 0 .pool @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, =sub_81820FC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_818216C str r0, [r4, 0x1C] b @0818214A .align 2, 0 .pool @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, =sub_81821CC str r0, [r4, 0x1C] b @081821AA .align 2, 0 .pool @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, =sub_8182248 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 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] b @0818228E .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x24] b @0818235C .align 2, 0 .pool @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, =sub_8184D88 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 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] b @08182540 .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] b @081825D4 .align 2, 0 .pool @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, =sub_81825F8 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x3C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8182648 str r0, [r4, 0x1C] movs r0, 0x40 b @08182620 .align 2, 0 .pool @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, =0x0000ffff adds r0, r1, 0 subs r0, 0x40 lsls r0, 16 lsrs r0, 16 b @081826A8 .align 2, 0 .pool @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, =sub_81826F8 str r0, [r4, 0x1C] @081826EE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 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 .pool 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, =sub_8184D88 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 .pool @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, =sub_8184D88 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 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] b @0818299E .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] b @08182A5E .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] b @08182B16 .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x3A] b @08182C08 .align 2, 0 .pool @08182B48: movs r1, 0x32 ldrsh r2, [r4, r1] adds r0, r2, 0 cmp r2, 0 bge @08182B56 ldr r1, =0x000001ff 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 .pool @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, =0x000001ff adds r0, r1 @08182B9C: asrs r0, 9 b @08182BE0 .align 2, 0 .pool @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, =0x000001ff 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 .pool 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, =@08182C78 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_8184D88 str r0, [r4, 0x1C] @08182D12: adds r0, r4, 0 bl sub_817F70C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8180714 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817F8FC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817F978 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_8180900 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817FCDC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817FD44 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_817FE30 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_817FFF0 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_818031C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81804F8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817F9F4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_817FF3C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_8181214 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_8181810 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_8181ABC str r0, [r4, 0x1C] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_8181CE8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_8181CE8 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_81814D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_81814D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_81815D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_81815D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 b @08183180 .align 2, 0 .pool @0818315C: adds r1, r2, 0 adds r1, 0xC0 adds r0, r1, 0 cmp r1, 0 bge @0818316A ldr r3, =0x000001bf 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 .pool 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, =sub_8183140 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8183140 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x3A] b @081832BC .align 2, 0 .pool @081831F8: movs r1, 0x32 ldrsh r2, [r4, r1] adds r0, r2, 0 cmp r2, 0 bge @08183206 ldr r1, =0x000001ff 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 .pool @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, =0x000001ff adds r0, r1 @0818325E: asrs r0, 9 b @08183296 .align 2, 0 .pool @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, =0x000001ff adds r0, r1 @0818327A: asrs r0, 9 adds r0, 0x10 b @08183296 .align 2, 0 .pool @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, =sub_8184D88 str r0, [r6, 0x1C] b @081833DC .align 2, 0 .pool @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, =0xffffff00 adds r1, r2, 0 subs r1, r0 lsls r1, 16 lsrs r1, 16 mov r9, r1 b @08183392 .align 2, 0 .pool @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, =sub_8184D88 str r0, [r6, 0x1C] b @08183538 .align 2, 0 .pool @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, =0xffffff00 adds r0, r1 adds r4, r0 lsls r4, 16 lsrs r1, r4, 16 b @08183522 .align 2, 0 .pool @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, =gUnknown_0860AA80 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x26] b @0818360A .align 2, 0 .pool @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, =sub_8183574 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817FCDC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_817F8FC str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 b @081836CA .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 b @0818372E .align 2, 0 .pool @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, =sub_8183140 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8183574 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8183574 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001240 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, =sub_817FFF0 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 str r0, [r7, 0x1C] b @0818392C .align 2, 0 .pool @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, =0xffffff00 adds r4, r2 adds r0, r4 lsls r0, 16 lsrs r0, 16 mov r10, r0 mov r0, r8 b @081838EA .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x3A] b @08183A54 .align 2, 0 .pool @08183990: movs r1, 0x32 ldrsh r2, [r4, r1] adds r0, r2, 0 cmp r2, 0 bge @0818399E ldr r1, =0x000001ff 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 .pool @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, =0x000001ff adds r0, r1 @081839F6: asrs r0, 9 b @08183A2E .align 2, 0 .pool @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, =0x000001ff adds r0, r1 @08183A12: asrs r0, 9 adds r0, 0x10 b @08183A2E .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x3A] b @08183B40 .align 2, 0 .pool @08183A84: movs r1, 0x32 ldrsh r2, [r4, r1] adds r0, r2, 0 cmp r2, 0 bge @08183A92 ldr r1, =0x000001ff 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 .pool @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, =0x000001ff adds r0, r1 @08183AEA: asrs r0, 9 b @08183B22 .align 2, 0 .pool @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, =0x000001ff adds r0, r1 @08183B06: asrs r0, 9 adds r0, 0x10 b @08183B22 .align 2, 0 .pool @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, =gUnknown_0860ADBE 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, =sub_8184D88 str r0, [r4, 0x1C] b @08183C06 .align 2, 0 .pool @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, =sub_8183B4C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8183B4C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8183B4C str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184D88 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 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] movs r0, 0 strh r0, [r4, 0x24] strh r0, [r4, 0x26] b @0818403E .align 2, 0 .pool @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, =0x000001bf 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 .pool 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, =sub_8184D88 str r0, [r5, 0x1C] b @081840F4 .align 2, 0 .pool @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, =0x0000ffe0 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, =sub_8184D88 str r0, [r4, 0x1C] b @08184358 .align 2, 0 .pool @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, =0x0000ffe0 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, =sub_8184D88 str r0, [r4, 0x1C] b @081843DC .align 2, 0 .pool @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, =0x0000ffe0 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, =sub_8184D88 str r0, [r4, 0x1C] b @08184460 .align 2, 0 .pool @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, =sub_8184D88 str r0, [r6, 0x1C] b @08184544 .align 2, 0 .pool @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, =sub_8184610 str r0, [r4, 0x1C] @081845FE: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184640 str r0, [r4, 0x1C] @0818462E: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8184678 str r0, [r4, 0x1C] @08184668: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81846B8 str r0, [r4, 0x1C] b @081846AC .align 2, 0 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] @081846DA: adds r0, r4, 0 bl sub_817F70C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81845D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81845D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81845D4 str r0, [r4, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0860AE7C 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, =sub_8184D88 str r0, [r4, 0x1C] b @0818482E .align 2, 0 .pool @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, =0x000003ff movs r1, 0x10 movs r2, 0x10 bl pal_fade_1 b @081847FC .align 2, 0 .pool @081847F0: ldrh r0, [r4, 0x3C] ldr r3, =0x000003ff 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 .pool @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, =sub_8184D88 str r0, [r4, 0x1C] b @0818492A .align 2, 0 .pool @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, =gUnknown_0860AE88 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 .pool 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, =nullsub_12 str r0, [r2, 0x1C] @08184D9C: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203c7ac mov r1, r12 strb r1, [r0] ldr r1, =0x0203ccd0 movs r0, 0 strb r0, [r1] movs r2, 0 movs r7, 0 ldr r3, =0x0203c7bc mov r10, r3 ldr r6, =0x0203c794 mov r9, r6 ldr r0, =0x0203bd34 mov r8, r0 @08184DD0: lsls r0, r2, 1 mov r3, r9 adds r1, r0, r3 strh r7, [r1] ldr r6, =0x0203c79c adds r1, r0, r6 strh r7, [r1] ldr r1, =0x0203c7a4 adds r0, r1 strh r7, [r0] adds r4, r2, 0x1 mov r3, r12 cmp r3, 0x1 bne @08184E1C ldr r5, =0x02022fec 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, =0x0203c7b8 str r0, [r1] ldr r3, =0x020244a8 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 .pool 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, =0x0203c7ac ldrb r0, [r0] cmp r0, 0x1 bne @08184EA0 ldr r1, =0x0203bd2c ldr r0, =0x03005d80 ldr r0, [r0] str r0, [r1] ldr r4, =0x0203c7ae ldr r0, =0x000040cf bl var_get strb r0, [r4] ldr r4, =0x0203c7af bl sub_81A513C strb r0, [r4] b @08184EAC .align 2, 0 .pool @08184EA0: cmp r0, 0x2 bne @08184EAC ldr r0, =0x03005d80 ldr r1, =0x0203bd2c ldr r1, [r1] str r1, [r0] @08184EAC: ldr r0, =0x02022fec ldr r5, [r0] movs r0, 0x2 ands r5, r0 cmp r5, 0 beq @08184F64 bl link_get_multiplayer_id ldr r1, =0x0203c7b4 strb r0, [r1] bl sub_8009FCC lsls r0, 24 lsrs r0, 24 mov r10, r0 movs r5, 0 ldr r0, =0x0203cc80 mov r9, r0 ldr r6, =0x020229e8 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 .pool @08184F3C: adds r5, 0x1 ldr r0, =0x020229f0 adds r1, r3, r0 ldr r0, =0x0203cc84 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 .pool @08184F64: ldr r3, =0x0203cc80 ldr r4, =0x03005d90 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, =gUnknown_82E9531 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 .pool 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, =0x0203c794 lsls r0, r5, 1 adds r4, r0, r1 ldrh r2, [r4] adds r3, r2, 0 ldr r0, =0x00000297 cmp r3, r0 bhi @08184FF0 ldr r0, =0x0203c7ac ldrb r0, [r0] cmp r0, 0x2 beq @08184FF0 ldr r1, =0x0203bd34 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 .pool 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, =0x0203c794 lsls r1, r5, 1 adds r2, r1, r0 ldr r7, =0x0203bd34 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 .pool 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, =0x0203c794 lsls r0, r3, 1 adds r2, r0, r1 ldrh r1, [r2] ldr r0, =0x00000297 cmp r1, r0 bhi @0818507A ldr r4, =0x0203bd34 adds r0, 0x1 muls r3, r0 adds r0, r1, r3 adds r0, r4 ldrb r0, [r0] cmp r0, 0xFF bne @081850BC @0818507A: ldr r2, =0x020375f0 ldr r1, =0x0202433a movs r0, 0x5 strb r0, [r1] movs r0, 0x5 strh r0, [r2] bl pal_fade_control_reset_maybe movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r0, =sub_80384E4 bl set_callback2 movs r0, 0xFF b @081850C6 .align 2, 0 .pool @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, =0x0203c7ac ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x0203c794 adds r5, r3, r0 ldr r1, =0x0203c79c 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, =0x0203bd34 mov r10, r1 ldr r6, =0x0203c79c 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, =0x0203c794 adds r0, r3, r1 ldrh r1, [r0] ldrh r0, [r2] subs r1, r0 cmp r4, r1 blt @08185146 @08185172: ldr r0, =0x0203c79c add r0, r9 ldr r1, =0x0203c794 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 .pool 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, =0x02022fec ldr r0, [r0] ands r0, r1 cmp r0, 0 beq @0818525E movs r5, 0 ldr r4, =0x020229e8 b @081851DA .align 2, 0 .pool @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, =0x02022fec 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, =0x0203bd34 ldr r0, =0x0203c7a4 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 .pool 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, =0x000004ec adds r0, r5, r1 ldr r1, [r0] cmp r1, 0 beq @081852E8 ldr r0, =0x7d007e92 ands r1, r0 cmp r1, 0 bne @081852E8 ldr r4, =0x00000f7c 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 .pool @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, =0x00000f7c 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 .pool @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, =0x0203c7c0 adds r1, r4, r1 adds r0, r5, 0 movs r2, 0x64 bl memcpy movs r1, 0x96 lsls r1, 2 adds r5, r1 ldr r0, =0x0203ca18 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, =0x03005d90 mov r9, r2 movs r3, 0x9A lsls r3, 3 adds r3, r7, r3 str r3, [sp, 0x8] ldr r5, =0x0203cc80 mov r8, r6 mov r12, r6 movs r4, 0x96 lsls r4, 3 adds r4, r7 mov r10, r4 ldr r0, =0x000004e4 adds r4, r7, r0 @081853AC: lsls r1, r6, 3 ldr r0, =0x0203cc80 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, =0x000004d4 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, =0x0203bd2c ldr r0, [r5] str r0, [r1] ldr r0, =0x0203c7b8 ldr r2, [r0] movs r0, 0x2 ands r0, r2 cmp r0, 0 beq @081854DC ldr r1, =0x000004ec 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 .pool @08185454: movs r0, 0x40 ands r2, r0 cmp r2, 0 beq @081854E2 ldr r2, =0x0203cc80 ldrh r0, [r2, 0xE] cmp r0, 0x1 beq @081854A8 cmp r0, 0x1 bgt @08185474 cmp r0, 0 beq @0818547E b @081854E2 .align 2, 0 .pool @08185474: cmp r0, 0x2 beq @0818547E cmp r0, 0x3 beq @081854A8 b @081854E2 @0818547E: ldr r3, =0x0203c7b4 ldrb r1, [r3] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 ldr r4, =0x0203cc80 adds r0, r4 ldrh r1, [r0, 0xE] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @081854E2 ldr r5, =0x000004ec adds r0, r7, r5 b @081854C4 .align 2, 0 .pool @081854A8: ldr r0, =0x0203c7b4 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 ldr r1, =0x0203cc80 adds r0, r1 ldrh r1, [r0, 0xE] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081854E2 ldr r2, =0x000004ec 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 .pool @081854DC: ldr r3, =0x000004ec adds r0, r7, r3 str r2, [r0] @081854E2: ldr r4, =0x02038bca ldrh r1, [r4] ldr r5, =0x000004f4 adds r0, r7, r5 strh r1, [r0] ldr r0, =0x02038bcc ldrh r1, [r0] ldr r2, =0x000004f6 adds r0, r7, r2 strh r1, [r0] ldr r3, =0x02038bce ldrh r1, [r3] movs r4, 0x9F lsls r4, 3 adds r0, r7, r4 strh r1, [r0] ldr r5, =0x0203c7b4 ldrb r1, [r5] adds r2, 0x4 adds r0, r7, r2 strh r1, [r0] mov r3, r9 ldr r0, [r3] ldr r4, =0x00000ca9 adds r0, r4 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 ldr r5, =0x000004fc adds r1, r7, r5 strb r0, [r1] ldr r0, =0x0203c7ae ldrb r1, [r0] adds r2, 0x3 adds r0, r7, r2 strb r1, [r0] ldr r3, =0x0203c7af ldrb r1, [r3] ldr r4, =0x000004fe adds r0, r7, r4 strb r1, [r0] mov r5, r9 ldr r0, [r5] ldrb r1, [r0, 0x15] lsls r1, 29 ldr r0, =0x000004ff 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, =0x0203c7bc ldr r0, [r3] str r0, [r1] ldr r4, =0xfffffed4 adds r1, r4, 0 ldr r5, =0x02038bca 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, =0x00000504 adds r3, r7, r0 mov r10, r9 ldr r1, =0x02038bca mov r12, r1 adds r2, r4, 0 mov r8, r2 ldr r4, =0x0000073c @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, =0x02038bca ldrh r0, [r1] ldr r3, =0xfffffed4 adds r0, r3 movs r1, 0xEC muls r0, r1 adds r2, r0 ldr r4, =0x00000739 adds r2, r4 ldrb r1, [r2] ldr r5, =0x0000050c adds r0, r7, r5 strb r1, [r0] ldr r1, =0x0203cce8 ldrb r0, [r1] cmp r0, 0x1 bne @08185664 movs r6, 0 ldr r2, =0x0000050e adds r4, r7, r2 mov r10, r9 ldr r5, =0x02038bca 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 .pool @08185664: movs r6, 0 ldr r1, =0x0000050e adds r4, r7, r1 mov r10, r9 ldr r2, =0x02038bca 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, =0x00000754 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, =0x02038bca ldrh r0, [r3] ldr r4, =0xfffffed4 adds r0, r4 movs r1, 0xEC muls r0, r1 adds r2, r0 ldr r5, =0x0000081c adds r2, r5 ldrb r1, [r2] b @08185856 .align 2, 0 .pool @081856C4: ldr r3, =0x02038bcc 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, =0x00000504 adds r3, r7, r4 mov r10, r9 ldr r5, =0x02038bcc mov r12, r5 ldr r0, =0xfffffed4 mov r8, r0 ldr r4, =0x0000073c @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, =0x02038bcc ldrh r0, [r1] ldr r3, =0xfffffed4 adds r0, r3 movs r1, 0xEC muls r0, r1 adds r2, r0 ldr r4, =0x00000739 adds r2, r4 ldrb r1, [r2] ldr r5, =0x0000050c adds r0, r7, r5 strb r1, [r0] ldr r1, =0x0203cce8 ldrb r0, [r1] cmp r0, 0x1 bne @08185784 movs r6, 0 ldr r2, =0x0000050e adds r4, r7, r2 mov r10, r9 ldr r5, =0x02038bcc 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 .pool @08185784: movs r6, 0 ldr r1, =0x0000050e adds r4, r7, r1 mov r10, r9 ldr r2, =0x02038bcc 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, =0x00000754 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, =0x02038bcc ldrh r0, [r3] ldr r4, =0xfffffed4 adds r0, r4 movs r1, 0xEC muls r0, r1 adds r2, r0 ldr r5, =0x0000081c adds r2, r5 ldrb r1, [r2] b @08185856 .align 2, 0 .pool @081857E4: ldr r3, =0x02038bce ldrh r3, [r3] adds r0, r1, r3 lsls r0, 16 lsrs r0, 16 cmp r0, 0x63 bhi @0818585C movs r6, 0 ldr r4, =0x00000504 adds r3, r7, r4 mov r10, r9 ldr r5, =0x02038bce mov r12, r5 ldr r0, =0xfffffed4 mov r8, r0 ldr r4, =0x0000073c @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, =0x02038bce ldrh r0, [r2] ldr r3, =0xfffffed4 adds r0, r3 movs r2, 0xEC muls r0, r2 adds r1, r0 ldr r4, =0x00000739 adds r1, r4 ldrb r1, [r1] ldr r5, =0x0000050c adds r0, r7, r5 strb r1, [r0] mov r0, r9 ldr r1, [r0] ldr r4, =0x02038bce ldrh r0, [r4] adds r0, r3 muls r0, r2 adds r1, r0 ldr r5, =0x0000081c adds r1, r5 ldrb r1, [r1] @08185856: ldr r2, =0x0000051a adds r0, r7, r2 strb r1, [r0] @0818585C: ldr r3, =0x02038bca ldrh r0, [r3] ldr r1, =0x0000018f cmp r0, r1 bls @08185900 mov r4, r9 ldr r2, [r4] adds r1, r0, 0 ldr r3, =0xfffffe70 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, =0x0000050d adds r1, r7, r5 strb r0, [r1] movs r6, 0 ldr r0, =0x0000050e adds r4, r7, r0 mov r10, r9 ldr r1, =0x02038bca 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, =0x02038bca ldrh r1, [r4] ldr r5, =0xfffffe70 adds r1, r5 b @081859AC .align 2, 0 .pool @08185900: ldr r3, =0x02038bcc ldrh r0, [r3] cmp r0, r1 bls @0818597C mov r4, r9 ldr r2, [r4] adds r1, r0, 0 ldr r3, =0xfffffe70 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, =0x0000050d adds r1, r7, r5 strb r0, [r1] movs r6, 0 ldr r0, =0x0000050e adds r4, r7, r0 mov r10, r9 ldr r1, =0x02038bcc 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, =0x02038bcc ldrh r1, [r4] ldr r5, =0xfffffe70 adds r1, r5 b @081859AC .align 2, 0 .pool @0818597C: ldr r3, =0x02038bce ldrh r0, [r3] cmp r0, r1 bls @081859C0 mov r4, r9 ldr r2, [r4] adds r1, r0, 0 ldr r3, =0xfffffe70 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, =0x0000050d adds r1, r7, r5 strb r0, [r1] ldr r2, [r4] ldr r0, =0x02038bce ldrh r1, [r0] adds r1, r3 @081859AC: lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, r0 ldr r1, =0x0000011b adds r0, r2, r1 ldrb r1, [r0] ldr r2, =0x0000051b adds r0, r7, r2 strb r1, [r0] @081859C0: movs r6, 0 ldr r3, =0x00000297 mov r10, r3 ldr r4, =0x0203bd34 mov r9, r4 movs r5, 0xA6 lsls r5, 2 mov r8, r5 ldr r0, =0x0000051c 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 .pool 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, =0x03005d90 ldr r2, [r0] ldr r0, =0x0203c7ad ldrb r0, [r0] ldr r1, =0x00000ca9 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, =0x0202433a movs r0, 0 strb r0, [r1] ldr r0, =0x02022fec movs r1, 0 str r1, [r0] ldr r0, =0x02038bca strh r1, [r0] ldr r0, =0x02038bcc strh r1, [r0] ldr r0, =0x02038bce strh r1, [r0] bl sub_8185EFC ldr r0, =0x0203c7b0 ldr r0, [r0] bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x030022c0 ldr r1, =sub_8185AB0 str r1, [r0, 0x8] ldr r0, =sub_8036760 bl set_callback2 adds r0, r4, 0 bl remove_task @08185B4A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec 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, =0x02024744 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, =0x020229e8 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, =0x000004e4 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, =0x0203bd2c movs r3, 0x9D lsls r3, 3 adds r0, r7, r3 ldr r0, [r0] str r0, [r1] ldr r2, =0x02022fec ldr r1, =0x000004ec adds r0, r7, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 17 orrs r0, r1 str r0, [r2] ldr r1, =0x02038bca ldr r2, =0x000004f4 adds r0, r7, r2 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x02038bcc adds r3, 0xE adds r0, r7, r3 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x02038bce adds r2, 0x4 adds r0, r7, r2 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x0203c7b4 adds r3, 0x4 adds r0, r7, r3 ldrh r0, [r0] strb r0, [r1] ldr r1, =0x0203c7ad ldr r3, =0x03005d90 ldr r0, [r3] ldr r2, =0x00000ca9 adds r0, r2 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 strb r0, [r1] ldr r1, =0x0203c7ae ldr r2, =0x000004fd adds r0, r7, r2 ldrb r0, [r0] strb r0, [r1] ldr r1, =0x0203c7af adds r2, 0x1 adds r0, r7, r2 ldrb r0, [r0] strb r0, [r1] ldr r2, =0x0203c7b6 ldr r1, =0x000004ff adds r0, r7, r1 ldrb r1, [r0] lsls r0, r1, 31 lsrs r0, 31 strb r0, [r2] ldr r0, =0x0203c7b7 lsls r1, 28 lsrs r1, 29 strb r1, [r0] ldr r1, =0x0203c7bc movs r2, 0xA0 lsls r2, 3 adds r0, r7, r2 ldr r0, [r0] str r0, [r1] movs r6, 0 mov r10, r3 ldr r2, =0x0203ccd9 ldr r3, =0x0203ccda ldr r0, =0x03001278 mov r8, r0 ldr r1, =0x03001279 mov r9, r1 ldr r5, =0x0203ccd1 ldr r0, =0x00000504 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, =0x0000050c adds r0, r7, r1 ldrb r0, [r0] strb r0, [r2] ldr r2, =0x0000050d adds r0, r7, r2 ldrb r0, [r0] strb r0, [r3] ldr r3, =0x0000051a 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, =0x0000050e adds r1, r7, r0 ldr r4, =0x0203ccdc 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, =0x000004fc adds r0, r7, r3 ldrb r0, [r0] ldr r1, =0x00000ca9 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, =0x00000297 mov r10, r2 ldr r3, =0x0203bd34 mov r9, r3 movs r0, 0xA6 lsls r0, 2 mov r8, r0 ldr r1, =0x0000051c 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 .pool 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, =sub_8185B1C movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0x80 strh r0, [r1, 0x8] ldr r0, =0x0203c7b0 str r5, [r0] movs r0, 0 bl current_map_music_set__default_for_battle ldr r0, =sub_8185E8C bl set_callback2 @08185E6E: adds r0, r4, 0 bl free pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203c7ae ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8185EA0 thumb_func_start sub_8185EAC sub_8185EAC: ; 8185EAC ldr r0, =0x0203c7af ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8185EAC thumb_func_start sub_8185EB8 sub_8185EB8: ; 8185EB8 push {r4-r6,lr} movs r5, 0 ldr r6, =0x0203c7c0 @08185EBE: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 adds r0, r4, r6 ldr r1, =0x020244ec adds r1, r4, r1 movs r2, 0x64 bl memcpy ldr r0, =0x0203ca18 adds r0, r4, r0 ldr r1, =0x02024744 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 .pool thumb_func_end sub_8185EB8 thumb_func_start sub_8185EFC sub_8185EFC: ; 8185EFC push {r4-r6,lr} movs r5, 0 ldr r6, =0x020244ec @08185F02: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 adds r0, r4, r6 ldr r1, =0x0203c7c0 adds r1, r4, r1 movs r2, 0x64 bl memcpy ldr r0, =0x02024744 adds r0, r4, r0 ldr r1, =0x0203ca18 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 .pool thumb_func_end sub_8185EFC thumb_func_start sub_8185F40 sub_8185F40: ; 8185F40 push {r4,r5,lr} movs r2, 0 ldr r0, =0x020229e8 ldr r3, =0x02024064 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 .pool @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, =0x0203c7b5 movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8185F84 thumb_func_start sub_8185F90 sub_8185F90: ; 8185F90 lsls r0, 16 lsrs r0, 16 ldr r2, =0x0203c7b5 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 .pool thumb_func_end sub_8185F90 thumb_func_start sub_8185FAC sub_8185FAC: ; 8185FAC ldr r0, =0x0203c7b5 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8185FAC thumb_func_start sub_8185FB8 sub_8185FB8: ; 8185FB8 ldr r0, =0x0203c7b6 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8185FB8 thumb_func_start sub_8185FC4 sub_8185FC4: ; 8185FC4 ldr r0, =0x0203c7b7 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8185FC4 thumb_func_start sub_8185FD0 sub_8185FD0: ; 8185FD0 push {r4-r7,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @0818601C ldr r0, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 bne @0818601C ldr r0, =0x0203c7ac ldrb r0, [r0] cmp r0, 0x2 beq @0818601C movs r3, 0 ldr r7, =0x0203cc70 adds r6, r4, 0 ldr r5, =0x02024090 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 .pool 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, =0x02022fec ldr r0, [r0] ldr r1, =0x02000002 ands r0, r1 cmp r0, 0 beq @0818605C b @081863FC @0818605C: movs r0, 0 mov r10, r0 b @081863F2 .align 2, 0 .pool @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, =0x0203cc70 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, =0x02024090 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, =0x0203cc70 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, =0x02024090 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 .pool @08186110: adds r1, 0x2 adds r2, 0x1 cmp r2, 0x3 ble @081860F0 @08186118: cmp r5, 0x3 ble @081860DE b @081863EE @0818611E: ldr r3, =0x0203bd34 ldr r1, =0x0203c794 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, =0x02024084 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, =0x02024084 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, =0x020240a8 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, =0x020242bc adds r0, r2 ldrb r1, [r0, 0x18] lsrs r1, 4 ldr r2, =gUnknown_0832A328 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, =0x020242bc 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, =0x02024084 adds r4, r1 adds r4, 0x3B ldr r0, =0x020242bc 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, =0x0202406e ldr r4, [sp, 0x44] adds r6, r4, r0 @081862CA: ldrh r1, [r6] movs r0, 0x64 muls r0, r1 ldr r4, =0x020244ec 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, =0x0202406e 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, =0x0202406e ldr r1, [sp, 0x44] adds r7, r1, r0 movs r2, 0x64 mov r9, r2 ldr r3, =0x020244ec 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, =0x0202406e ldr r6, =0x020244ec 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, =0x02024274 ldr r3, [sp, 0x44] adds r2, r3, r2 ldr r0, =0x0202449c 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, =0x02024084 adds r1, 0xC adds r0, r1 ldrh r0, [r0] strh r0, [r2] @081863EE: ldr r6, [sp, 0x38] mov r10, r6 @081863F2: ldr r0, =0x0202406c 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 .pool thumb_func_end sub_818603C thumb_func_start sub_8186438 sub_8186438: ; 8186438 ldr r0, =0x0203c7bc ldr r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8186438 thumb_func_start sub_8186444 sub_8186444: ; 8186444 ldr r1, =0x0203ccd0 movs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_8186444 thumb_func_start rfu_lacks_rfufunc rfu_lacks_rfufunc: ; 8186450 push {lr} movs r1, 0 ldr r0, =0x0203ccd0 ldrb r0, [r0] cmp r0, 0 bne @0818645E movs r1, 0x1 @0818645E: adds r0, r1, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x03001278 ldr r4, =0x0203ccd1 @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 .pool thumb_func_end sub_8186468 thumb_func_start sub_818649C sub_818649C: ; 818649C ldr r0, =0x0203ccd9 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_818649C thumb_func_start sub_81864A8 sub_81864A8: ; 81864A8 ldr r0, =0x0203ccda ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81864A8 thumb_func_start sub_81864B4 sub_81864B4: ; 81864B4 ldr r0, =0x03001278 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81864B4 thumb_func_start sub_81864C0 sub_81864C0: ; 81864C0 ldr r0, =0x03001279 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81864C0 thumb_func_start sub_81864CC sub_81864CC: ; 81864CC ldr r0, =0x0203cce8 ldr r1, =0x0202433a ldrb r1, [r1] strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81864CC thumb_func_start sub_81864E0 sub_81864E0: ; 81864E0 ldr r0, =0x0203ccdc bx lr .align 2, 0 .pool 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, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186508 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81864EC thumb_func_start sub_8186508 sub_8186508: ; 8186508 push {lr} ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @08186554 ldr r0, =0x02023064 lsls r1, r3, 9 adds r1, r0 ldrb r0, [r1] cmp r0, 0x38 bhi @08186550 ldr r0, =gUnknown_0860AE90 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 b @08186554 .align 2, 0 .pool @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, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0818657C bl sub_81871AC @0818657C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8186558 thumb_func_start sub_8186590 sub_8186590: ; 8186590 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @081865B4 bl sub_81871AC @081865B4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8186590 thumb_func_start sub_81865C8 sub_81865C8: ; 81865C8 push {r4-r6,lr} ldr r5, =0x02020630 ldr r6, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r2, r0, 2 adds r0, r5, 0 adds r0, 0x1C adds r0, r2, r0 ldr r1, [r0] ldr r0, =nullsub_12 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 .pool thumb_func_end sub_81865C8 thumb_func_start sub_8186630 sub_8186630: ; 8186630 push {r4,lr} ldr r4, =0x020244d0 ldr r1, [r4] ldr r3, =0x02024064 ldrb r0, [r3] ldr r2, [r1, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x9] subs r0, 0x1 strb r0, [r1, 0x9] lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @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 .pool 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, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @081866F8 @081866A4: ldr r4, =0x02020630 ldr r0, =0x03005d70 ldr r2, =0x02024064 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, =nullsub_12 mov r8, r2 cmp r1, r0 bne @08186764 ldr r0, =0x020241e4 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 .pool @081866F8: ldr r6, =0x02020630 ldr r7, =0x03005d70 ldr r2, =0x02024064 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, =nullsub_12 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, =0x020241e4 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, =0x020244d0 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, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag @08186816: ldr r0, =0x020244d0 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, =0x03005d60 mov r2, r8 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186630 str r1, [r0] @0818683A: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244d0 ldr r0, [r4] ldr r7, =0x02024064 ldrb r2, [r7] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r5, 0x88 adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @081868AC ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @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, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @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, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @08186964 ldr r4, =0x03005d70 ldrb r0, [r7] adds r1, r6, 0 eors r1, r0 adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 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, =0x03005d70 ldr r4, =0x02024064 ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r4] bl sub_8076918 ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 @08186994: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x80 orrs r1, r2 strb r1, [r0, 0x1] @081869AE: ldr r5, =0x020244d0 ldr r0, [r5] ldr r4, =0x02024064 ldrb r2, [r4] ldr r3, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x1] movs r0, 0xC0 ands r0, r1 cmp r0, 0x80 bne @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, =0x02022fec 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, =0x03007420 bl m4aMPlayContinue b @08186A4C .align 2, 0 .pool @08186A40: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl @08186A4C: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x1] movs r0, 0x1 mov r9, r0 @08186A6A: bl battle_type_is_double lsls r0, 24 cmp r0, 0 bne @08186AC8 ldr r2, =0x02020630 ldr r0, =0x03005d7c ldr r1, =0x02024064 ldrb r4, [r1] adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r3, [r0] ldr r0, =nullsub_12 cmp r3, r0 bne @08186B26 ldr r0, =0x020241e4 adds r0, r4, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r0, [r0] cmp r0, r3 bne @08186B26 b @08186B22 .align 2, 0 .pool @08186AC8: ldr r2, =0x02020630 ldr r7, =0x03005d7c ldr r0, =0x02024064 ldrb r3, [r0] adds r0, r3, r7 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r4, [r0] ldr r0, =nullsub_12 cmp r4, r0 bne @08186B26 ldr r6, =0x020241e4 adds r0, r3, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r5, [r0] cmp r5, r4 bne @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, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @08186B8A ldr r1, =0x03005d7c ldr r5, =0x02024064 ldrb r0, [r5] movs r4, 0x2 eors r0, r4 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldrb r0, [r5] eors r4, r0 ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_805EE54 @08186B8A: ldr r1, =0x03005d7c ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldrb r5, [r4] ldr r1, =0x0202406e lsls r0, r5, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r5, 0 bl sub_805EE54 ldr r3, =0x020244d0 ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r1, [r2, 0x9] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2, 0x9] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x21 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x7F ands r0, r2 strb r0, [r1, 0x1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186678 str r1, [r0] @08186C10: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818686C thumb_func_start sub_8186C48 sub_8186C48: ; 8186C48 push {r4-r7,lr} ldr r4, =0x02020630 ldr r0, =0x020241e4 ldr r7, =0x02024064 ldrb r3, [r7] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r2, r0, 2 adds r0, r4, 0 adds r0, 0x1C adds r0, r2, r0 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08186CFA adds r0, r2, r4 movs r1, 0x24 ldrsh r0, [r0, r1] cmp r0, 0 bne @08186CFA ldr r6, =0x020244d0 ldr r0, [r6] ldr r1, [r0, 0x4] lsls r4, r3, 1 adds r0, r4, r3 lsls r0, 2 adds r2, r0, r1 ldrb r5, [r2] movs r0, 0x80 ands r0, r5 cmp r0, 0 bne @08186CC0 ldr r0, =0x0202406e adds r0, r4, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 b @08186CFA .align 2, 0 .pool @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, =0x000027f9 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 .pool thumb_func_end sub_8186C48 thumb_func_start sub_8186D04 sub_8186D04: ; 8186D04 push {r4-r6,lr} ldr r6, =0x02024064 ldrb r0, [r6] ldr r5, =0x03005d70 adds r1, r0, r5 ldrb r1, [r1] movs r2, 0 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r6] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 lsls r4, 16 asrs r1, r4, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @08186D4C ldrb r0, [r6] adds r0, r5 ldrb r0, [r0] movs r2, 0 bl heathbar_draw_hp b @08186D50 .align 2, 0 .pool @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, =0x02020630 ldr r0, =0x020241e4 ldr r1, =0x02024064 ldrb r3, [r1] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 31 cmp r0, 0 bne @08186D86 ldr r0, =0x03005d70 adds r0, r3, r0 ldrb r0, [r0] bl sub_8072984 bl sub_81871AC @08186D86: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8186D58 thumb_func_start sub_8186D9C sub_8186D9C: ; 8186D9C push {r4-r6,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r6, =0x02024064 ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08186DF6 ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldrb r0, [r6] bl sub_805EEE0 ldr r1, =0x03005d70 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 .pool 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, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r2 movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x20 bne @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, =0x020244b9 strb r3, [r0] bl sub_81871AC b @08186E9E .align 2, 0 .pool @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, =0x02020630 ldr r0, =0x03005d70 ldr r4, =0x02024064 ldrb r3, [r4] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @08186EF0 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0] lsls r0, r3, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @08186EE4 adds r0, r3, 0 adds r1, r3, 0 adds r2, r3, 0 movs r3, 0x6 bl move_anim_start_t4 @08186EE4: ldr r0, =0x03005d60 ldrb r1, [r4] lsls r1, 2 adds r1, r0 ldr r0, =sub_8186F14 str r0, [r1] @08186EF0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8186EA4 thumb_func_start sub_8186F14 sub_8186F14: ; 8186F14 push {r4,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r4, =0x02024064 ldrb r1, [r4] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @08186F6E bl sub_80A36C8 lsls r0, 24 cmp r0, 0 bne @08186F6E ldr r2, =0x02020630 ldr r1, =0x020241e4 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @08186F5E ldr r0, =nullsub_18 cmp r1, r0 bne @08186F6E @08186F5E: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl bl sub_81871AC @08186F6E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8186F14 thumb_func_start sub_8186F94 sub_8186F94: ; 8186F94 push {r4-r7,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r1, [r3, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08187050 ldr r7, =0x02020630 ldr r6, =0x020241e4 adds r0, r2, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r7, 0 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 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, =0x000027f9 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, =0x03005d70 ldrb r1, [r5] adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r5] bl sub_8076918 ldrb r0, [r5] adds r0, r4 ldrb r0, [r0] bl sub_80729D0 ldrb r0, [r5] bl sub_805E408 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186EA4 str r1, [r0] @08187050: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8186F94 thumb_func_start sub_8187084 sub_8187084: ; 8187084 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r0, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x88 ands r0, r1 cmp r0, 0 bne @081870B6 ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @081870B6: ldr r4, =0x02020630 ldr r0, =0x03005d7c ldrb r2, [r5] adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r3, r0, 2 adds r0, r4, 0 adds r0, 0x1C adds r0, r3, r0 ldr r1, [r0] ldr r0, =nullsub_12 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, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r4, 0 bl sub_805EE54 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186F94 str r1, [r0] @08187120: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8187084 thumb_func_start sub_818714C sub_818714C: ; 818714C push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @0818716E bl sub_81871AC @0818716E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818714C thumb_func_start sub_818717C sub_818717C: ; 818717C push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0818719E bl sub_81871AC @0818719E: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818717C thumb_func_start sub_81871AC sub_81871AC: ; 81871AC push {r4,lr} sub sp, 0x4 ldr r1, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186508 str r1, [r0] ldr r0, =0x02022fec 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, =0x02023064 ldrb r0, [r4] lsls r0, 9 adds r0, r1 movs r1, 0x38 strb r1, [r0] b @08187212 .align 2, 0 .pool @08187200: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] @08187212: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @0818725C ldr r0, =0x0202406e 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 .pool @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, =0x02023064 ldr r3, =0x02024064 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, =@081872D8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 add r0, sp, 0x24 mov r9, r0 movs r1, 0x3B add r1, sp mov r10, r1 mov r2, sp adds r2, 0x2B str r2, [sp, 0x80] mov r0, sp adds r0, 0x2A str r0, [sp, 0x7C] mov r1, sp adds r1, 0x68 str r1, [sp, 0x8C] adds r2, 0x5 str r2, [sp, 0x84] adds r0, 0x12 str r0, [sp, 0x88] mov r8, r4 add r4, sp, 0xC @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, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_getattr mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 bl pokemon_getattr ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr mov r3, sp movs r5, 0x1F ands r0, r5 ldrb r2, [r3, 0x14] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr mov r3, sp movs r6, 0x1F ands r0, r6 lsls r0, 5 ldrh r2, [r3, 0x14] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 2 ldrb r2, [r3, 0x15] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [sp, 0x14] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr mov r3, sp ands r0, r6 lsls r0, 4 ldrh r2, [r3, 0x16] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 1 ldrb r2, [r3, 0x17] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C bl pokemon_getattr mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D bl pokemon_getattr mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E bl pokemon_getattr mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F bl pokemon_getattr mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr mov r3, sp movs r1, 0x1 ands r0, r1 lsls r0, 6 ldrb r2, [r3, 0x17] movs r1, 0x41 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] bl pokemon_getattr ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] bl 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 .pool @081875EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB b @08187966 .align 2, 0 .pool @081875FC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xC b @08187966 .align 2, 0 .pool @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, =0x02024744 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, =0x02024744 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 .pool @08187674: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x9 b @08187966 .align 2, 0 .pool @08187690: movs r6, 0 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r2, =0x02024744 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, =0x02024744 adds r0, r1 movs r1, 0x15 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 b @08187A2E .align 2, 0 .pool @081876CC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x8 b @08187A26 .align 2, 0 .pool @081876E8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1 b @08187702 .align 2, 0 .pool @081876F8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 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 .pool @08187728: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1A b @08187A26 .align 2, 0 .pool @08187738: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1B b @08187A26 .align 2, 0 .pool @08187748: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1C b @08187A26 .align 2, 0 .pool @08187758: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1D b @08187A26 .align 2, 0 .pool @08187768: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1E b @08187A26 .align 2, 0 .pool @08187778: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x1F b @08187A26 .align 2, 0 .pool @08187788: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x20 b @08187A26 .align 2, 0 .pool @08187798: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x22 b @08187A26 .align 2, 0 .pool @081877A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x23 b @08187A26 .align 2, 0 .pool @081877B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x24 b @08187A26 .align 2, 0 .pool @081877C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x25 b @08187A26 .align 2, 0 .pool @081877D8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x26 b @08187A26 .align 2, 0 .pool @081877E8: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr strb r0, [r7, 0x5] movs r6, 0x6 b @08187A2E .align 2, 0 .pool @08187838: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x27 b @08187A26 .align 2, 0 .pool @08187848: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x28 b @08187A26 .align 2, 0 .pool @08187858: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x29 b @08187A26 .align 2, 0 .pool @08187868: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2A b @08187A26 .align 2, 0 .pool @08187878: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2B b @08187A26 .align 2, 0 .pool @08187888: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2C b @08187A26 .align 2, 0 .pool @08187898: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0 b @081878C2 .align 2, 0 .pool @081878A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x9 b @08187966 .align 2, 0 .pool @081878B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 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 .pool @081878EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x38 b @08187A26 .align 2, 0 .pool @081878FC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x39 b @08187966 .align 2, 0 .pool @0818790C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3A b @08187966 .align 2, 0 .pool @0818791C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3B b @08187966 .align 2, 0 .pool @0818792C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3C b @08187966 .align 2, 0 .pool @0818793C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3D b @08187966 .align 2, 0 .pool @0818794C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3E b @08187966 .align 2, 0 .pool @0818795C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 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 .pool @0818797C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x16 b @08187A26 .align 2, 0 .pool @0818798C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x17 b @08187A26 .align 2, 0 .pool @0818799C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x18 b @08187A26 .align 2, 0 .pool @081879AC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x21 b @08187A26 .align 2, 0 .pool @081879BC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x2F b @08187A26 .align 2, 0 .pool @081879CC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x30 b @08187A26 .align 2, 0 .pool @081879DC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x32 b @08187A26 .align 2, 0 .pool @081879EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x33 b @08187A26 .align 2, 0 .pool @081879FC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x34 b @08187A26 .align 2, 0 .pool @08187A0C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x35 b @08187A26 .align 2, 0 .pool @08187A1C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 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 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @08187A80 ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] bl dp01_setattr_for_opponent_pokemon b @08187A9E .align 2, 0 .pool @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, =0x02024064 ldrb r0, [r3] lsls r0, 9 ldr r2, =0x02023067 adds r4, r0, r2 adds r7, r4, 0 subs r1, r2, 0x2 adds r0, r1 ldrb r0, [r0] adds r6, r3, 0 adds r3, r2, 0 cmp r0, 0x3B bls @08187AD6 bl @081883B4 @08187AD6: lsls r0, 2 ldr r1, =@08187AEC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0xB adds r2, r7, 0 bl pokemon_setattr adds r2, r7, 0 adds r2, 0x2E adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr movs r0, 0 mov r8, r0 movs r0, 0x3B adds r0, r7 mov r10, r0 adds r0, r7, 0 adds r0, 0x2B str r0, [sp, 0x20] adds r0, 0x19 str r0, [sp, 0x28] adds r0, 0x4 str r0, [sp, 0x2C] adds r0, 0x4 str r0, [sp, 0x30] subs r0, 0x22 str r0, [sp, 0x1C] subs r0, 0x2 str r0, [sp, 0x18] adds r0, 0x4 str r0, [sp, 0x24] adds r0, r7, 0x2 str r0, [sp, 0x4] adds r0, r7, 0x4 str r0, [sp, 0x8] adds r0, r7, 0x6 str r0, [sp, 0xC] adds r0, 0x2 str r0, [sp, 0x10] adds r0, 0x2 str r0, [sp, 0x14] mov r9, r4 adds r6, r7, 0 adds r6, 0x24 adds r4, r7, 0 adds r4, 0xC @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, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x15 mov r2, r10 bl pokemon_setattr adds r0, r4, 0 movs r1, 0x20 ldr r2, [sp, 0x20] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x19 ldr r2, [sp, 0x28] bl pokemon_setattr ldrb r0, [r7, 0x14] lsls r0, 27 lsrs r0, 27 mov r1, sp strb r0, [r1] adds r0, r4, 0 movs r1, 0x27 mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r7, 0x14] lsls r0, 22 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x28 mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r7, 0x15] lsls r0, 25 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x29 mov r2, sp bl pokemon_setattr mov r1, sp ldr r0, [r7, 0x14] lsls r0, 12 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2A mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r7, 0x16] lsls r0, 23 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2B mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r7, 0x17] lsls r0, 26 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0 ldr r2, [sp, 0x2C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x37 ldr r2, [sp, 0x30] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 ldr r2, [sp, 0x1C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 ldr r2, [sp, 0x18] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A ldr r2, [sp, 0x24] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3B ldr r2, [sp, 0x4] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C ldr r2, [sp, 0x8] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D ldr r2, [sp, 0xC] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E ldr r2, [sp, 0x10] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F ldr r2, [sp, 0x14] bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187D74: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0xB bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187D90: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0xC bl pokemon_setattr b @081883B4 .align 2, 0 .pool @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, =0x02024744 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, =0x02024744 adds r0, r1 movs r1, 0x15 mov r2, r9 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187E00: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldr r3, =0x02023064 ldrb r2, [r6] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x9 b @08187E9E .align 2, 0 .pool @08187E20: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 ldrb r2, [r6] lsls r2, 9 adds r2, r3 adds r0, r4, 0 movs r1, 0x11 str r3, [sp, 0x34] bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x12 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x13 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x14 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187E88: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldr r3, =0x02023064 ldrb r2, [r6] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x8 @08187E9E: adds r3, 0x3 adds r2, r3 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187EB0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187ECC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x19 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187EE8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1A bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187F04: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1B bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187F20: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1C bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187F3C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1D bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187F58: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1E bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187F74: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x1F bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187F90: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x20 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187FAC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x22 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187FC8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x23 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08187FE4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x24 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188000: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x25 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @0818801C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x26 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188038: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 ldrb r2, [r6] lsls r2, 9 adds r2, r3 adds r0, r4, 0 movs r1, 0x27 str r3, [sp, 0x34] bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x28 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x29 bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x2A bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x2B bl pokemon_setattr ldrb r2, [r6] lsls r2, 9 ldr r3, [sp, 0x34] adds r0, r3, 0x5 adds r2, r0 adds r0, r4, 0 b @08188146 .align 2, 0 .pool @081880AC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x27 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081880C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x28 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081880E4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x29 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188100: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x2A bl pokemon_setattr b @081883B4 .align 2, 0 .pool @0818811C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x2B bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188138: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 @08188146: movs r1, 0x2C bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188154: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188170: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x9 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @0818818C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x37 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081881A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x38 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081881C4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x39 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081881E0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3A bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081881FC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3B bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188218: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3C bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188234: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3D bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188250: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3E bl pokemon_setattr b @081883B4 .align 2, 0 .pool @0818826C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x3F bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188288: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x16 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081882A4: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x17 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081882C0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x18 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081882DC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x21 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081882F8: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x2F bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188314: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x30 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188330: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x32 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @0818834C: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x33 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188368: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x34 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @08188384: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x35 bl pokemon_setattr b @081883B4 .align 2, 0 .pool @081883A0: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 adds r0, r1 ldrb r2, [r6] lsls r2, 9 adds r2, r3 movs r1, 0x36 bl pokemon_setattr @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 .pool thumb_func_end dp01_setattr_for_opponent_pokemon thumb_func_start sub_81883C8 sub_81883C8: ; 81883C8 push {r4-r7,lr} ldr r1, =0x0202406e ldr r7, =0x02024064 ldrb r2, [r7] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 adds r3, r1, 0 muls r3, r0 ldr r4, =0x02023064 lsls r2, 9 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] ldr r1, =0x02024744 adds r0, r1 adds r5, r3, r0 movs r3, 0 adds r0, r4, 0x2 adds r2, r0 ldrb r2, [r2] cmp r3, r2 bcs @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 .pool 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, =0x0202406e ldr r6, =0x02024064 ldrb r0, [r6] lsls r0, 1 adds r0, r7 ldrh r0, [r0] movs r1, 0x64 mov r10, r1 mov r2, r10 muls r2, r0 adds r0, r2, 0 ldr r1, =0x02024744 mov r9, r1 add r0, r9 movs r1, 0xB bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r1, [r6] lsls r0, r1, 1 adds r0, r7 ldrh r0, [r0] mov r2, r10 muls r2, r0 adds r0, r2, 0 add r0, r9 bl sub_805DC0C ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_806A068 ldr r0, =0x0202499c mov r8, r0 ldrb r0, [r6] movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldrb r0, [r6] bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r6] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r8 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 ldrb r1, [r6] adds r1, r4 strb r0, [r1] ldr r5, =0x02020630 ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ff10 strh r1, [r0, 0x24] ldrb r2, [r6] adds r0, r2, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x2E] ldrb r3, [r6] adds r0, r3, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r2, [r6] adds r4, r2, r4 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r2, r1 ldrb r1, [r2] bl 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, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186C48 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 .pool thumb_func_end sub_818843C thumb_func_start sub_818858C sub_818858C: ; 818858C push {r4,lr} ldr r1, =0x0202406e ldr r4, =0x02024064 ldrb r0, [r4] lsls r2, r0, 1 adds r2, r1 ldr r3, =0x02023064 lsls r0, 9 adds r1, r3, 0x1 adds r0, r1 ldrb r0, [r0] strh r0, [r2] ldrb r0, [r4] lsls r1, r0, 9 adds r3, 0x2 adds r1, r3 ldrb r1, [r1] bl sub_81885D8 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8187084 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202406e lsls r4, r6, 1 adds r4, r0 ldr r0, =0x02023064 lsls r1, r6, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] strh r0, [r4] ldrh r0, [r4] movs r1, 0x64 mov r9, r1 mov r1, r9 muls r1, r0 adds r0, r1, 0 ldr r5, =0x02024744 adds r0, r5 movs r1, 0xB bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 bl object_new_hidden_with_callback ldr r1, =0x03005d7c mov r10, r1 add r10, r6 mov r1, r10 strb r0, [r1] ldrh r0, [r4] mov r1, r9 muls r1, r0 adds r0, r1, 0 adds r0, r5 adds r1, r6, 0 bl sub_805DC0C adds r0, r6, 0 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_806A068 ldr r0, =0x0202499c mov r9, r0 adds r0, r6, 0 movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r9 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 adds r4, r6, r4 strb r0, [r4] ldr r5, =0x02020630 mov r0, r10 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r4] strh r1, [r0, 0x30] mov r0, r10 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x32] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x2E] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 mov r1, r8 strh r1, [r0, 0x32] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, r6, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r6, r1 ldrb r1, [r6] bl 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, =nullsub_12 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 .pool thumb_func_end sub_81885D8 thumb_func_start sub_8188768 sub_8188768: ; 8188768 push {r4-r6,lr} ldr r1, =0x02023064 ldr r6, =0x02024064 ldrb r2, [r6] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r3, [r0] cmp r3, 0 bne @081887B0 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_8188800 str r1, [r0] b @081887EC .align 2, 0 .pool @081887B0: ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldrb r0, [r6] bl sub_805EEE0 ldr r1, =0x03005d70 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 .pool thumb_func_end sub_8188768 thumb_func_start sub_8188800 sub_8188800: ; 8188800 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r4, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r0, [r3, 0x4] cmp r0, 0 beq @08188828 cmp r0, 0x1 beq @08188856 b @0818887E .align 2, 0 .pool @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, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186D9C str r1, [r0] @0818887E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022fec ldr r0, [r5] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @081888F6 ldr r4, =0x02024064 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, =0x02038bca b @081888DA .align 2, 0 .pool @081888D8: ldr r0, =0x02038bcc @081888DA: ldrh r0, [r0] bl sub_8162AA0 lsls r0, 24 lsrs r0, 24 b @0818892C .align 2, 0 .pool @081888EC: bl sub_8185F40 lsls r0, 24 lsrs r0, 24 b @08188924 @081888F6: movs r7, 0xB0 ldr r0, =0x02038bca ldrh r1, [r0] movs r0, 0xC0 lsls r0, 4 cmp r1, r0 bne @08188910 bl sub_8068B48 b @08188928 .align 2, 0 .pool @08188910: ldr r2, =0x020229e8 ldr r0, =0x0203c7b4 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, =0x02024064 ldrb r1, [r5] bl sub_805DF38 ldrb r0, [r5] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl template_build_for_pokemon_or_trainer ldr r6, =0x0202499c mov r9, r7 ldr r1, =gUnknown_083054E0 mov r2, r8 lsls r0, r2, 2 adds r0, r1 ldrb r0, [r0] movs r4, 0x8 subs r4, r0 lsls r4, 18 movs r0, 0xA0 lsls r0, 14 adds r4, r0 asrs r4, 16 ldrb r0, [r5] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 adds r0, r6, 0 mov r1, r9 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r6, =0x020241e4 ldrb r1, [r5] adds r1, r6 strb r0, [r1] ldr r4, =0x02020630 ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000ff10 strh r1, [r0, 0x24] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x2 strh r1, [r0, 0x2E] ldr r1, =gTrainerPaletteTable 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, =sub_805D7AC str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186558 str r1, [r0] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 bl oamt_add_pos2_onto_pos1 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x23 strh r1, [r0, 0x2E] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x8C lsls r1, 1 strh r1, [r0, 0x32] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =nullsub_12 bl oamt_set_x3A_32 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_81865C8 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8188A4C thumb_func_start sub_8188AF8 sub_8188AF8: ; 8188AF8 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r0, [r4, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r3, r1, r0 ldrb r0, [r3, 0x4] cmp r0, 0 bne @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 .pool @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, =0x02020630 ldr r1, =0x020241e4 ldrb r0, [r5] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039934 str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186D58 str r1, [r0] @08188B88: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r6] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 beq @08188BE6 b @08188CFA @08188BE6: ldr r0, =0x02023064 mov r12, r0 ldrb r2, [r6] lsls r2, 9 adds r0, 0x1 adds r0, r2, r0 ldrb r0, [r0] mov r1, r12 adds r1, 0x2 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 ldr r5, =0x02038432 mov r1, r12 adds r1, 0x3 adds r2, r1 ldrb r1, [r2] strb r1, [r5] ldr r4, =0x02038408 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x4 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x5 adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r4, =0x02038404 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x6 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x7 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r3, r1 mov r1, r12 adds r1, 0x8 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 16 orrs r3, r1 mov r1, r12 adds r1, 0x9 adds r2, r1 ldrb r1, [r2] lsls r1, 24 orrs r3, r1 str r3, [r4] ldr r3, =0x0203841a ldrb r1, [r6] lsls r1, 9 mov r2, r12 adds r2, 0xA adds r1, r2 ldrb r1, [r1] strb r1, [r3] ldr r4, =0x0203841c ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0xC adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0xD adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r3, =0x02038400 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x10 adds r2, r1 str r2, [r3] ldr r3, =0x020244bc ldrb r1, [r6] lsls r1, 2 adds r1, r3 ldr r2, [r2] str r2, [r1] ldrb r1, [r5] bl sub_805DB8C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @08188CDC bl sub_81871AC b @08188CFA .align 2, 0 .pool @08188CDC: ldr r0, =0x020244d0 ldr r0, [r0] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_8188D0C str r1, [r0] @08188CFA: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r6, =0x02024064 ldrb r3, [r6] lsls r1, r3, 9 adds r0, r2, 0x1 mov r10, r0 adds r0, r1, r0 ldrb r4, [r0] adds r5, r2, 0x2 mov r9, r5 adds r0, r1, r5 ldrb r0, [r0] lsls r0, 8 orrs r4, r0 adds r2, 0xB adds r1, r2 ldrb r1, [r1] mov r8, r1 ldr r7, =0x020244d0 ldr r5, [r7] ldr r1, [r5, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x4] cmp r2, 0x1 beq @08188DA4 cmp r2, 0x1 bgt @08188D64 cmp r2, 0 beq @08188D6E b @08188E80 .align 2, 0 .pool @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, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd 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, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x4] b @08188E80 .align 2, 0 .pool @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, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 ldr r1, =0x02023066 adds r0, r1 ldrh r0, [r0] bl battle_pick_message ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186E10 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 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 .pool 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, =0x02022fec 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 .pool @08188F48: ldr r5, =0x02024064 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 .pool 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, =0x02024064 ldrb r0, [r4] bl sub_8185054 ldrb r1, [r4] ldr r3, =0x0202449c 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 .pool 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, =0x02023064 ldr r0, =0x02024064 mov r9, r0 ldrb r4, [r0] lsls r2, r4, 9 adds r0, r3, 0x2 adds r0, r2, r0 ldrb r1, [r0] adds r3, 0x3 adds r2, r3 ldrb r0, [r2] lsls r0, 8 orrs r1, r0 lsls r1, 16 asrs r7, r1, 16 ldr r0, =0x00007fff cmp r7, r0 beq @08189060 ldr r6, =0x0202406e lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x02024744 adds r0, r4 movs r1, 0x3A bl pokemon_getattr mov r8, r0 mov r1, r9 ldrb r0, [r1] lsls r0, 1 adds r0, r6 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] mov r2, r8 bl sub_807294C b @0818908A .align 2, 0 .pool @08189060: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0x3A bl pokemon_getattr adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] movs r3, 0 bl sub_807294C @0818908A: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8186D04 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 .pool 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, =0x02024064 ldrb r0, [r4] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @08189120 ldr r0, =0x03005d70 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x02024744 adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe ldrb r2, [r4] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_818714C str r1, [r0] @08189120: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81890CC thumb_func_start sub_8189144 sub_8189144: ; 8189144 push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @08189194 ldr r4, =0x02023064 ldrb r3, [r5] lsls r3, 9 adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] adds r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 adds r2, r4, 0x4 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 16 orrs r1, r2 adds r4, 0x5 adds r3, r4 ldrb r2, [r3] lsls r2, 24 orrs r1, r2 bl move_anim_start_t2_for_situation ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_818714C str r1, [r0] @08189194: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022d0c 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 .pool thumb_func_end sub_8189218 thumb_func_start sub_8189234 sub_8189234: ; 8189234 push {lr} ldr r3, =0x02022d0c ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] movs r1, 0x7F ands r1, r0 ldrb r2, [r3] movs r0, 0x80 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] bl sub_81871AC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8189234 thumb_func_start sub_818926C sub_818926C: ; 818926C push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] bl sub_81871AC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818926C thumb_func_start sub_8189284 sub_8189284: ; 8189284 push {lr} ldr r3, =0x02022d0c ldr r1, [r3] lsls r1, 24 lsrs r1, 31 movs r0, 0x1 eors r1, r0 lsls r1, 7 ldrb r2, [r3] movs r0, 0x7F ands r0, r2 orrs r0, r1 strb r0, [r3] bl sub_81871AC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8189284 thumb_func_start sub_81892AC sub_81892AC: ; 81892AC push {r4,lr} ldr r3, =0x02020630 ldr r2, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @081892E0 bl sub_81871AC b @0818930A .align 2, 0 .pool @081892E0: ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0 strh r1, [r0, 0x30] ldrb r0, [r4] bl sub_80769F4 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_blink_t2 str r1, [r0] @0818930A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 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, =0x02023064 ldrb r1, [r4] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 lsls r1, r3, 24 asrs r1, 24 bl audio_play_and_stuff bl sub_81871AC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8189328 thumb_func_start sub_818936C sub_818936C: ; 818936C push {r4,r5,lr} ldr r4, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r3, r0, 9 adds r0, r4, 0x3 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @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 .pool @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, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024744 adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 movs r1, 0x19 movs r2, 0x5 bl sub_80A32E4 bl sub_81871AC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81893C8 thumb_func_start sub_8189404 sub_8189404: ; 8189404 push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] bl battle_intro_launch ldr r2, =0x020243fc ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] bl sub_81871AC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8189404 thumb_func_start sub_8189438 sub_8189438: ; 8189438 push {r4-r6,lr} ldr r5, =0x020241e4 ldr r6, =0x02024064 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl oamt_add_pos2_onto_pos1 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x23 strh r1, [r0, 0x2E] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x8C lsls r1, 1 strh r1, [r0, 0x32] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =sub_818962C bl oamt_set_x3A_32 ldr r0, =c3_0803D564 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r4, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r4 ldrb r0, [r6] strh r0, [r1, 0x8] ldr r3, =0x020244d0 ldr r0, [r3] ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081894FA ldr r0, =0x020244b4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r4 ldr r1, =sub_8073C30 str r1, [r0] @081894FA: ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r0, [r2, 0x9] movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_70 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r7] mov r9, r0 ldr r1, =0x03005e00 mov r2, r8 lsls r0, r2, 2 add r0, r8 lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x8] strb r0, [r7] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @08189582 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @081895B4 @08189582: ldr r0, =0x02023064 ldrb r1, [r7] lsls r2, r1, 9 adds r0, 0x1 adds r2, r0 ldr r0, =0x0202406e lsls r1, 1 adds r1, r0 ldrh r0, [r1] strb r0, [r2] ldrb r0, [r7] movs r1, 0 bl sub_81885D8 b @081895F4 .align 2, 0 .pool @081895B4: ldr r4, =0x02023064 ldrb r0, [r7] lsls r1, r0, 9 adds r4, 0x1 adds r1, r4 ldr r6, =0x0202406e lsls r0, 1 adds r0, r6 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r7] movs r1, 0 bl sub_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, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_818686C 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 .pool 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, =0x02023064 ldr r0, =0x02024064 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 .pool @08189678: ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] ldr r1, =0x02023064 ldrb r2, [r3] lsls r0, r2, 9 adds r1, 0x2 adds r0, r1 ldrb r0, [r0] adds r7, r3, 0 cmp r0, 0 beq @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 .pool @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, =0x02023068 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] subs r4, 0x2 adds r3, r4 ldrb r3, [r3] bl sub_80735DC ldr r2, =0x020244b4 ldrb r1, [r5] adds r1, r2 movs r3, 0 strb r0, [r1] ldr r6, =0x020244d0 ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x5] ldrb r2, [r5] lsls r0, r2, 9 adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @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, =0x03005d60 ldrb r1, [r7] lsls r1, 2 adds r1, r0 ldr r0, =sub_818975C str r0, [r1] @08189742: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8189648 thumb_func_start sub_818975C sub_818975C: ; 818975C push {r4,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x5] adds r2, r1, 0x1 strb r2, [r0, 0x5] lsls r1, 24 lsrs r1, 24 cmp r1, 0x5C bls @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 .pool thumb_func_end sub_818975C thumb_func_start sub_81897A4 sub_81897A4: ; 81897A4 push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081897D6 ldr r2, =0x03005e00 ldr r0, =0x020244b4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, =sub_8073C30 str r1, [r0] @081897D6: bl sub_81871AC pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r4] bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @08189846 ldr r3, =0x02020630 ldr r0, =0x020241e4 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 ldr r0, =0x02023064 lsls r1, 9 adds r0, 0x1 adds r1, r0 adds r2, 0x3E movs r0, 0x1 ldrb r1, [r1] ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] ldrb r0, [r4] bl sub_805E408 @08189846: bl sub_81871AC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8189800 thumb_func_start sub_8189860 sub_8189860: ; 8189860 push {r4-r6,lr} sub sp, 0x4 ldr r6, =0x02024064 ldrb r0, [r6] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @081898B8 ldr r5, =0x02023064 ldrb r2, [r6] lsls r1, r2, 9 adds r0, r5, 0x1 adds r0, r1, r0 ldrb r3, [r0] adds r0, r5, 0x2 adds r0, r1, r0 ldrb r4, [r0] adds r5, 0x3 adds r1, r5 ldrb r0, [r1] lsls r0, 8 orrs r4, r0 str r4, [sp] adds r0, r2, 0 adds r1, r2, 0 bl move_anim_start_t3 lsls r0, 24 cmp r0, 0 beq @081898AC bl sub_81871AC b @081898B8 .align 2, 0 .pool @081898AC: ldr r0, =0x03005d60 ldrb r1, [r6] lsls r1, 2 adds r1, r0 ldr r0, =sub_818717C str r0, [r1] @081898B8: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r2, [r0] cmp r2, 0x3 bne @08189908 ldr r0, =0x0202433a strb r2, [r0] b @08189910 .align 2, 0 .pool @08189908: ldr r0, =0x0202433a 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, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_80587B0 str r1, [r0] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_8189968 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_818994C thumb_func_start sub_8189968 sub_8189968: ; 8189968 push {lr} ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @081899B4 ldr r0, =0x02023064 lsls r1, r3, 9 adds r1, r0 ldrb r0, [r1] cmp r0, 0x38 bhi @081899B0 ldr r0, =gUnknown_0860AF74 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 b @081899B4 .align 2, 0 .pool @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, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @081899DC bl sub_818A514 @081899DC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81899B8 thumb_func_start sub_81899F0 sub_81899F0: ; 81899F0 push {r4-r6,lr} ldr r6, =0x02020630 ldr r5, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r6, 0 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 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 .pool thumb_func_end sub_81899F0 thumb_func_start sub_8189A58 sub_8189A58: ; 8189A58 push {r4,lr} ldr r4, =0x020244d0 ldr r1, [r4] ldr r3, =0x02024064 ldrb r0, [r3] ldr r2, [r1, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x9] subs r0, 0x1 strb r0, [r1, 0x9] lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @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 .pool 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, =0x02024064 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, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08189B0C @08189ADA: ldr r2, =0x02020630 ldr r1, =0x03005d70 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, =nullsub_12 cmp r1, r0 bne @08189B42 b @08189B48 .align 2, 0 .pool @08189B0C: ldr r2, =0x02020630 ldr r5, =0x03005d70 ldr r0, =0x02024064 ldrb r3, [r0] adds r0, r3, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r4, [r0] ldr r0, =nullsub_12 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, =0x020244d0 mov r9, r0 ldr r0, [r0] ldr r5, =0x02024064 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, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag ldr r7, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r7 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 ldr r4, =0x020244ec 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, =0x03005d60 ldrb r0, [r5] b @08189D10 .align 2, 0 .pool @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, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @08189CB0 @08189C80: ldr r2, =0x02020630 ldr r1, =0x03005d70 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, =nullsub_12 cmp r1, r0 bne @08189CE6 b @08189CE4 .align 2, 0 .pool @08189CB0: ldr r2, =0x02020630 ldr r5, =0x03005d70 ldr r0, =0x02024064 ldrb r3, [r0] adds r0, r3, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r4, [r0] ldr r0, =nullsub_12 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, =0x020244d0 ldr r0, [r0] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x9] ldr r1, =0x03005d60 ldrb r0, [r3] @08189D10: lsls r0, 2 adds r0, r1 ldr r1, =sub_8189A58 str r1, [r0] @08189D18: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r4] bl battle_get_per_side_status lsls r0, 24 cmp r0, 0 bne @08189DBE ldr r5, =0x020244d0 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, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @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, =0x0202406e adds r0, r2, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r3, 0 bl sub_8172EF0 @08189DBE: ldr r3, =0x020244d0 ldr r0, [r3] ldr r2, =0x02024064 ldrb r5, [r2] ldr r4, [r0, 0x4] lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r6, r0, r4 ldrb r1, [r6] movs r0, 0x8 mov r12, r0 ands r0, r1 mov 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, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @08189E54 ldr r4, =0x03005d70 mov r1, r9 ldrb r0, [r1] adds r1, r7, 0 eors r1, r0 adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec 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, =0x03005d70 ldr r4, =0x02024064 ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r4] bl sub_8076918 ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 @08189E84: ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x80 orrs r1, r2 strb r1, [r0, 0x1] mov 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, =0x02022fec 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, =0x03007420 bl m4aMPlayContinue b @08189F44 .align 2, 0 .pool @08189F38: ldr r0, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl @08189F44: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x1] movs r2, 0x20 orrs r1, r2 strb r1, [r0, 0x1] movs r0, 0x1 mov r10, r0 @08189F62: mov r1, r10 cmp r1, 0 beq @0818A02A ldr r7, =0x02020630 ldr r6, =0x03005d7c ldr r5, =0x02024064 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, =nullsub_12 cmp r2, r0 bne @0818A02A ldr r0, =0x020241e4 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, =0x02022fec 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, =0x03005d7c ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldr r3, =0x020244d0 ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r1, [r2, 0x9] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2, 0x9] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x21 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r0, [r3] ldrb r2, [r4] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x7F ands r0, r2 strb r0, [r1, 0x1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8189AA0 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 .pool thumb_func_end sub_8189D40 thumb_func_start sub_818A064 sub_818A064: ; 818A064 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 27 cmp r0, 0 bge @0818A092 movs r2, 0x24 ldrsh r0, [r1, r2] cmp r0, 0 bne @0818A092 bl sub_818A514 @0818A092: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818A064 thumb_func_start sub_818A0A4 sub_818A0A4: ; 818A0A4 push {r4-r6,lr} ldr r5, =0x02024064 ldrb r0, [r5] ldr r6, =0x03005d70 adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] bl sub_80729D0 lsls r4, 16 asrs r1, r4, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @0818A0EC ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] movs r2, 0 bl heathbar_draw_hp b @0818A106 .align 2, 0 .pool @0818A0EC: ldr r2, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 bl sub_818A514 @0818A106: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818A0A4 thumb_func_start sub_818A114 sub_818A114: ; 818A114 push {r4-r6,lr} ldr r6, =0x02020630 ldr r5, =0x020241e4 ldr r4, =0x02024064 ldrb r2, [r4] adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 movs r3, 0x22 ldrsh r1, [r0, r3] movs r3, 0x26 ldrsh r0, [r0, r3] adds r1, r0 cmp r1, 0xA0 ble @0818A190 ldr r1, =0x0202406e lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 bl nullsub_24 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 bl rotscale_free_entry ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 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 .pool thumb_func_end sub_818A114 thumb_func_start sub_818A1B0 sub_818A1B0: ; 818A1B0 push {r4-r6,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r6, =0x02024064 ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0818A204 ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 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 .pool 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, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r2 movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x20 bne @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, =0x020244b9 strb r3, [r0] bl sub_818A514 b @0818A2AE .align 2, 0 .pool @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, =0x02020630 ldr r0, =0x03005d70 ldr r4, =0x02024064 ldrb r3, [r4] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0818A306 adds r0, r3, 0 bl sub_805E408 ldr r0, =0x020244d0 ldr r0, [r0] ldrb r2, [r4] ldr r1, [r0] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @0818A2FA adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x6 bl move_anim_start_t4 @0818A2FA: ldr r0, =0x03005d60 ldrb r1, [r4] lsls r1, 2 adds r1, r0 ldr r0, =sub_818A328 str r0, [r1] @0818A306: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818A2B4 thumb_func_start sub_818A328 sub_818A328: ; 818A328 push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @0818A364 ldr r2, =0x02020630 ldr r0, =0x020241e4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @0818A364 bl sub_818A514 @0818A364: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818A328 thumb_func_start sub_818A37C sub_818A37C: ; 818A37C push {r4-r7,lr} mov r7, r8 push {r7} ldr r3, =0x020244d0 ldr r0, [r3] ldr r7, =0x02024064 ldrb r1, [r7] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r2, r0, r2 ldrb r1, [r2, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @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, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag ldr r0, =c3_0802FDF4 movs r1, 0xA bl AddTask ldr r0, =0x0202406e mov r8, r0 ldrb r1, [r7] lsls r0, r1, 1 add r0, r8 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 bl sub_805E990 ldr r1, =0x020241e4 ldrb r0, [r7] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 bl obj_anim_image_start ldr r4, =0x03005d70 ldrb r1, [r7] adds r0, r1, r4 ldrb r0, [r0] lsls r1, 1 add r1, r8 ldrh r1, [r1] muls r1, r6 adds r1, r5 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r7] bl sub_8076918 ldrb r0, [r7] adds r0, r4 ldrb r0, [r0] bl sub_80729D0 ldr r1, =0x03005d60 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A2B4 str r1, [r0] @0818A438: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818A37C thumb_func_start sub_818A470 sub_818A470: ; 818A470 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r0, [r6] ldr r4, =0x02024064 ldrb r2, [r4] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x88 ands r0, r1 cmp r0, 0 bne @0818A4A2 ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @0818A4A2: ldr r5, =0x02020630 ldr r0, =0x03005d7c ldrb r2, [r4] adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r3, r0, 2 adds r0, r5, 0 adds r0, 0x1C adds r0, r3, r0 ldr r1, [r0] ldr r0, =nullsub_12 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, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A37C str r1, [r0] @0818A4E8: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818A470 thumb_func_start sub_818A514 sub_818A514: ; 818A514 push {r4,lr} sub sp, 0x4 ldr r1, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_8189968 str r1, [r0] ldr r0, =0x02022fec 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, =0x02023064 ldrb r0, [r4] lsls r0, 9 adds r0, r1 movs r1, 0x38 strb r1, [r0] b @0818A57A .align 2, 0 .pool @0818A568: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] @0818A57A: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818A514 thumb_func_start sub_818A58C sub_818A58C: ; 818A58C push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @0818A5AE bl sub_818A514 @0818A5AE: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818A58C thumb_func_start sub_818A5BC sub_818A5BC: ; 818A5BC push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @0818A5DE bl sub_818A514 @0818A5DE: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @0818A624 ldr r0, =0x0202406e 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 .pool @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, =0x02023064 ldr r3, =0x02024064 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, =@0818A6A0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 add r0, sp, 0x24 mov r9, r0 movs r1, 0x3B add r1, sp mov r10, r1 mov r2, sp adds r2, 0x2B str r2, [sp, 0x80] mov r0, sp adds r0, 0x2A str r0, [sp, 0x7C] mov r1, sp adds r1, 0x68 str r1, [sp, 0x8C] adds r2, 0x5 str r2, [sp, 0x84] adds r0, 0x12 str r0, [sp, 0x88] mov r8, r4 add r4, sp, 0xC @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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_getattr mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 bl pokemon_getattr ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr mov r3, sp movs r5, 0x1F ands r0, r5 ldrb r2, [r3, 0x14] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr mov r3, sp movs r6, 0x1F ands r0, r6 lsls r0, 5 ldrh r2, [r3, 0x14] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 2 ldrb r2, [r3, 0x15] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [sp, 0x14] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr mov r3, sp ands r0, r6 lsls r0, 4 ldrh r2, [r3, 0x16] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 1 ldrb r2, [r3, 0x17] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C bl pokemon_getattr mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D bl pokemon_getattr mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E bl pokemon_getattr mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F bl pokemon_getattr mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr mov r3, sp movs r1, 0x1 ands r0, r1 lsls r0, 6 ldrb r2, [r3, 0x17] movs r1, 0x41 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] bl pokemon_getattr ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] bl 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 .pool @0818A9B4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB b @0818AD2E .align 2, 0 .pool @0818A9C4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xC b @0818AD2E .align 2, 0 .pool @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, =0x020244ec 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, =0x020244ec 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 .pool @0818AA3C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x9 b @0818AD2E .align 2, 0 .pool @0818AA58: movs r6, 0 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r2, =0x020244ec 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, =0x020244ec adds r0, r1 movs r1, 0x15 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 b @0818ADF6 .align 2, 0 .pool @0818AA94: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x8 b @0818ADEE .align 2, 0 .pool @0818AAB0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1 b @0818AACA .align 2, 0 .pool @0818AAC0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool @0818AAF0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1A b @0818ADEE .align 2, 0 .pool @0818AB00: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1B b @0818ADEE .align 2, 0 .pool @0818AB10: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1C b @0818ADEE .align 2, 0 .pool @0818AB20: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1D b @0818ADEE .align 2, 0 .pool @0818AB30: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1E b @0818ADEE .align 2, 0 .pool @0818AB40: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1F b @0818ADEE .align 2, 0 .pool @0818AB50: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x20 b @0818ADEE .align 2, 0 .pool @0818AB60: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x22 b @0818ADEE .align 2, 0 .pool @0818AB70: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x23 b @0818ADEE .align 2, 0 .pool @0818AB80: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x24 b @0818ADEE .align 2, 0 .pool @0818AB90: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x25 b @0818ADEE .align 2, 0 .pool @0818ABA0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x26 b @0818ADEE .align 2, 0 .pool @0818ABB0: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr strb r0, [r7, 0x5] movs r6, 0x6 b @0818ADF6 .align 2, 0 .pool @0818AC00: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x27 b @0818ADEE .align 2, 0 .pool @0818AC10: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x28 b @0818ADEE .align 2, 0 .pool @0818AC20: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x29 b @0818ADEE .align 2, 0 .pool @0818AC30: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2A b @0818ADEE .align 2, 0 .pool @0818AC40: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2B b @0818ADEE .align 2, 0 .pool @0818AC50: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2C b @0818ADEE .align 2, 0 .pool @0818AC60: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0 b @0818AC8A .align 2, 0 .pool @0818AC70: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x9 b @0818AD2E .align 2, 0 .pool @0818AC80: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool @0818ACB4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 b @0818ADEE .align 2, 0 .pool @0818ACC4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x39 b @0818AD2E .align 2, 0 .pool @0818ACD4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A b @0818AD2E .align 2, 0 .pool @0818ACE4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3B b @0818AD2E .align 2, 0 .pool @0818ACF4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3C b @0818AD2E .align 2, 0 .pool @0818AD04: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3D b @0818AD2E .align 2, 0 .pool @0818AD14: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3E b @0818AD2E .align 2, 0 .pool @0818AD24: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool @0818AD44: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x16 b @0818ADEE .align 2, 0 .pool @0818AD54: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x17 b @0818ADEE .align 2, 0 .pool @0818AD64: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x18 b @0818ADEE .align 2, 0 .pool @0818AD74: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x21 b @0818ADEE .align 2, 0 .pool @0818AD84: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2F b @0818ADEE .align 2, 0 .pool @0818AD94: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x30 b @0818ADEE .align 2, 0 .pool @0818ADA4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x32 b @0818ADEE .align 2, 0 .pool @0818ADB4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x33 b @0818ADEE .align 2, 0 .pool @0818ADC4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x34 b @0818ADEE .align 2, 0 .pool @0818ADD4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x35 b @0818ADEE .align 2, 0 .pool @0818ADE4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec 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 .pool 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, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @0818AE48 ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] bl sub_818AE70 b @0818AE66 .align 2, 0 .pool @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, =0x02024064 ldrb r0, [r0] lsls r0, 9 ldr r2, =0x02023067 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 adds r0, r1 ldrb r0, [r0] adds r7, r2, 0 cmp r0, 0x3B bls @0818AE9C bl @0818B836 @0818AE9C: lsls r0, 2 ldr r1, =@0818AEB4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB adds r2, r6, 0 bl pokemon_setattr adds r2, r6, 0 adds r2, 0x2E adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr movs r0, 0 mov r8, r0 movs r0, 0x3B adds r0, r6 mov r10, r0 adds r0, r6, 0 adds r0, 0x2B str r0, [sp, 0x20] adds r0, 0x19 str r0, [sp, 0x28] adds r0, 0x4 str r0, [sp, 0x2C] adds r0, 0x4 str r0, [sp, 0x30] subs r0, 0x22 str r0, [sp, 0x1C] subs r0, 0x2 str r0, [sp, 0x18] adds r0, 0x4 str r0, [sp, 0x24] adds r0, r6, 0x2 str r0, [sp, 0x4] adds r0, r6, 0x4 str r0, [sp, 0x8] adds r0, r6, 0x6 str r0, [sp, 0xC] adds r0, 0x2 str r0, [sp, 0x10] adds r0, 0x2 str r0, [sp, 0x14] mov r9, r4 adds r7, r6, 0 adds r7, 0x24 adds r4, r6, 0 adds r4, 0xC @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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 mov r2, r10 bl pokemon_setattr adds r0, r4, 0 movs r1, 0x20 ldr r2, [sp, 0x20] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x19 ldr r2, [sp, 0x28] bl pokemon_setattr ldrb r0, [r6, 0x14] lsls r0, 27 lsrs r0, 27 mov r1, sp strb r0, [r1] adds r0, r4, 0 movs r1, 0x27 mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x14] lsls r0, 22 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x28 mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x15] lsls r0, 25 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x29 mov r2, sp bl pokemon_setattr mov r1, sp ldr r0, [r6, 0x14] lsls r0, 12 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2A mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x16] lsls r0, 23 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2B mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x17] lsls r0, 26 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0 ldr r2, [sp, 0x2C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x37 ldr r2, [sp, 0x30] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 ldr r2, [sp, 0x1C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 ldr r2, [sp, 0x18] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A ldr r2, [sp, 0x24] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3B ldr r2, [sp, 0x4] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C ldr r2, [sp, 0x8] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D ldr r2, [sp, 0xC] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E ldr r2, [sp, 0x10] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F ldr r2, [sp, 0x14] bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B13C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xB bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B15C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xC bl pokemon_setattr b @0818B836 .align 2, 0 .pool @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, =0x020244ec 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, =0x020244ec adds r0, r1 movs r1, 0x15 mov r2, r9 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B1D4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x9 b @0818B278 .align 2, 0 .pool @0818B1FC: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x11 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x12 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x13 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x14 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B260: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x8 @0818B278: adds r3, 0x3 adds r2, r3 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B290: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B2B0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x19 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B2D0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1A bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B2F0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1B bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B310: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1C bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B330: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1D bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B350: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1E bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B370: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1F bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B390: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x20 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B3B0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x22 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B3D0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x23 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B3F0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x24 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B410: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x25 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B430: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x26 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B450: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x27 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x28 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x29 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x2A bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x2B bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x5 adds r2, r0 adds r0, r4, 0 b @0818B570 .align 2, 0 .pool @0818B4C0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x27 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B4E0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x28 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B500: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x29 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B520: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2A bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B540: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2B bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B560: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 @0818B570: movs r1, 0x2C bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B580: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B5A0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x9 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B5C0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x37 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B5E0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x38 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B600: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x39 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B620: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3A bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B640: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3B bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B660: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3C bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B680: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3D bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B6A0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3E bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B6C0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3F bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B6E0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x16 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B700: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x17 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B720: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x18 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B740: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x21 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B760: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2F bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B780: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x30 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B7A0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x32 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B7C0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x33 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B7E0: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x34 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B800: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x35 bl pokemon_setattr b @0818B836 .align 2, 0 .pool @0818B820: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x36 bl pokemon_setattr @0818B836: ldr r2, =0x0202406e ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 add sp, 0x34 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818AE70 thumb_func_start sub_818B86C sub_818B86C: ; 818B86C push {r4-r7,lr} ldr r1, =0x0202406e ldr r7, =0x02024064 ldrb r2, [r7] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 adds r3, r1, 0 muls r3, r0 ldr r4, =0x02023064 lsls r2, 9 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] ldr r1, =0x020244ec adds r0, r1 adds r5, r3, r0 movs r3, 0 adds r0, r4, 0x2 adds r2, r0 ldrb r2, [r2] cmp r3, r2 bcs @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 .pool thumb_func_end sub_818B86C thumb_func_start sub_818B8E0 sub_818B8E0: ; 818B8E0 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =0x0202406e mov r8, r0 ldr r6, =0x02024064 ldrb r1, [r6] lsls r0, r1, 1 add r0, r8 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 bl sub_805DD7C ldrb r0, [r6] lsls r0, 1 add r0, r8 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0xB bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_806A068 ldr r0, =0x0202499c mov r8, r0 ldrb r0, [r6] movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldrb r0, [r6] bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r6] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r8 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 ldrb r1, [r6] adds r1, r4 strb r0, [r1] ldr r5, =0x02020630 ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ff10 strh r1, [r0, 0x24] ldrb r2, [r6] adds r0, r2, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x2E] ldrb r3, [r6] adds r0, r3, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r2, [r6] adds r4, r2, r4 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r2, r1 ldrb r1, [r2] bl obj_anim_image_start ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A064 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818B8E0 thumb_func_start sub_818B9FC sub_818B9FC: ; 818B9FC push {r4-r6,lr} ldr r5, =0x02024064 ldrb r0, [r5] ldr r4, =0x02023064 lsls r1, r0, 9 adds r6, r4, 0x2 adds r1, r6 ldrb r1, [r1] bl sub_805EF84 ldr r2, =0x0202406e ldrb r0, [r5] lsls r1, r0, 1 adds r1, r2 lsls r0, 9 adds r4, 0x1 adds r0, r4 ldrb r0, [r0] strh r0, [r1] ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805DD7C ldrb r0, [r5] lsls r1, r0, 9 adds r1, r6 ldrb r1, [r1] bl sub_818BA6C ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A470 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202406e lsls r2, r6, 1 adds r2, r0 ldr r0, =0x02023064 lsls r1, r6, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] strh r0, [r2] ldrh r1, [r2] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 bl object_new_hidden_with_callback ldr r1, =0x03005d7c mov r9, r1 add r9, r6 mov r1, r9 strb r0, [r1] adds r0, r6, 0 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_806A068 ldr r0, =0x0202499c mov r10, r0 adds r0, r6, 0 movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r10 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 adds r4, r6, r4 strb r0, [r4] ldr r5, =0x02020630 mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r4] strh r1, [r0, 0x30] mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x32] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x2E] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 mov r1, r8 strh r1, [r0, 0x32] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, r6, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r6, r1 ldrb r1, [r6] bl 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, =nullsub_12 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 .pool thumb_func_end sub_818BA6C thumb_func_start sub_818BBE8 sub_818BBE8: ; 818BBE8 push {r4-r6,lr} ldr r1, =0x02023064 ldr r6, =0x02024064 ldrb r2, [r6] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r3, [r0] cmp r3, 0 bne @0818BC30 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_818BC78 str r1, [r0] b @0818BC66 .align 2, 0 .pool @0818BC30: ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 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 .pool thumb_func_end sub_818BBE8 thumb_func_start sub_818BC78 sub_818BC78: ; 818BC78 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r4, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r0, [r3, 0x4] cmp r0, 0 beq @0818BCA0 cmp r0, 0x1 beq @0818BCCE b @0818BCF6 .align 2, 0 .pool @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, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A1B0 str r1, [r0] @0818BCF6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022fec 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 .pool @0818BD30: ldr r2, =0x020229e8 ldr r0, =0x0203c7b4 ldrb r1, [r0] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r2 b @0818BD4A .align 2, 0 .pool @0818BD48: ldr r0, =0x020229e8 @0818BD4A: ldrb r4, [r0, 0x13] @0818BD4C: ldr r0, =0x02022fec ldr r1, [r0] movs r2, 0x40 ands r1, r2 adds r5, r0, 0 cmp r1, 0 beq @0818BD98 ldr r0, =0x02024064 ldrb r0, [r0] bl battle_get_per_side_status movs r1, 0x2 ands r1, r0 movs r0, 0x20 mov r9, r0 cmp r1, 0 beq @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, =gUnknown_083054E0 b @0818BD9E .align 2, 0 .pool @0818BD98: movs r0, 0x50 mov r9, r0 @0818BD9C: ldr r1, =gUnknown_08305D2C @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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] bl sub_806F000 lsls r0, 16 lsrs r4, r0, 16 adds r5, r4, 0 ldr r6, =0x02024064 ldrb r1, [r6] adds r0, r5, 0 bl sub_805DF38 ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 bl sub_806A1C0 ldr r0, =0x0202499c mov r8, r0 lsls r4, r7, 16 asrs r4, 16 ldrb r0, [r6] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r8 mov r1, r9 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 ldrb r1, [r6] adds r1, r4 strb r0, [r1] ldr r0, =gTrainerPaletteTable lsls r5, 3 adds r5, r0 ldrh r0, [r5, 0x4] bl gpu_pal_tags_index_of ldr r5, =0x02020630 ldrb r1, [r6] adds r1, r4 ldrb r1, [r1] lsls r2, r1, 4 adds r2, r1 lsls r2, 2 adds r2, r5 lsls r0, 4 ldrb r3, [r2, 0x5] movs r1, 0xF ands r1, r3 orrs r1, r0 strb r1, [r2, 0x5] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0xF0 strh r1, [r0, 0x24] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x30 strh r1, [r0, 0x26] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_805D7AC str r1, [r0] ldrb r0, [r6] adds r0, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 ldrb r2, [r1, 0x1] movs r0, 0x4 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 adds r0, 0x3F ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @0818BF72 .align 2, 0 .pool @0818BEDC: ldr r5, =0x02024064 ldrb r1, [r5] adds r0, r4, 0 bl sub_805DF84 ldrb r0, [r5] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl template_build_for_pokemon_or_trainer ldr r6, =0x0202499c mov r8, r9 lsls r4, r7, 16 asrs r4, 16 ldrb r0, [r5] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 adds r0, r6, 0 mov r1, r8 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r6, =0x020241e4 ldrb r1, [r5] adds r1, r6 strb r0, [r1] ldr r4, =0x02020630 ldrb r3, [r5] adds r0, r3, r6 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0xF0 strh r1, [r0, 0x24] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, 0x1C adds r0, r4 ldr r1, =sub_805D7AC str r1, [r0] @0818BF72: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_81899B8 str r1, [r0] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 bl oamt_add_pos2_onto_pos1 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x23 strh r1, [r0, 0x2E] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ffd8 strh r1, [r0, 0x32] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =nullsub_12 bl oamt_set_x3A_32 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_81899F0 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818BFB8 thumb_func_start sub_818C064 sub_818C064: ; 818C064 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r0, [r4, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r3, r1, r0 ldrb r0, [r3, 0x4] cmp r0, 0 bne @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 .pool @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, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 movs r1, 0x40 negs r1, r1 movs r0, 0x10 bl audio_play_and_stuff ldr r2, =0x02020630 ldr r3, =0x020241e4 ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r4, [r0, 0x30] ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x5 strh r1, [r0, 0x32] ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039C00 str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A114 str r1, [r0] @0818C12E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r6] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 beq @0818C192 b @0818C2A6 @0818C192: ldr r0, =0x02023064 mov r12, r0 ldrb r2, [r6] lsls r2, 9 adds r0, 0x1 adds r0, r2, r0 ldrb r0, [r0] mov r1, r12 adds r1, 0x2 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 ldr r5, =0x02038432 mov r1, r12 adds r1, 0x3 adds r2, r1 ldrb r1, [r2] strb r1, [r5] ldr r4, =0x02038408 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x4 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x5 adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r4, =0x02038404 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x6 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x7 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r3, r1 mov r1, r12 adds r1, 0x8 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 16 orrs r3, r1 mov r1, r12 adds r1, 0x9 adds r2, r1 ldrb r1, [r2] lsls r1, 24 orrs r3, r1 str r3, [r4] ldr r3, =0x0203841a ldrb r1, [r6] lsls r1, 9 mov r2, r12 adds r2, 0xA adds r1, r2 ldrb r1, [r1] strb r1, [r3] ldr r4, =0x0203841c ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0xC adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0xD adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r3, =0x02038400 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x10 adds r2, r1 str r2, [r3] ldr r3, =0x020244bc ldrb r1, [r6] lsls r1, 2 adds r1, r3 ldr r2, [r2] str r2, [r1] ldrb r1, [r5] bl sub_805DB8C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @0818C288 bl sub_818A514 b @0818C2A6 .align 2, 0 .pool @0818C288: ldr r0, =0x020244d0 ldr r0, [r0] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =bx_move_anim_2 str r1, [r0] @0818C2A6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02023064 ldr r6, =0x02024064 ldrb r3, [r6] lsls r1, r3, 9 adds r0, r2, 0x1 mov r10, r0 adds r0, r1, r0 ldrb r4, [r0] adds r5, r2, 0x2 mov r9, r5 adds r0, r1, r5 ldrb r0, [r0] lsls r0, 8 orrs r4, r0 adds r2, 0xB adds r1, r2 ldrb r1, [r1] mov r8, r1 ldr r7, =0x020244d0 ldr r5, [r7] ldr r1, [r5, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x4] cmp r2, 0x1 beq @0818C350 cmp r2, 0x1 bgt @0818C310 cmp r2, 0 beq @0818C31A b @0818C42C .align 2, 0 .pool @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, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd 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, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x4] b @0818C42C .align 2, 0 .pool @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, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 ldr r1, =0x02023066 adds r0, r1 ldrh r0, [r0] bl battle_pick_message ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A220 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024332 ldr r0, =0x0202406c ldrb r0, [r0] ldrb r1, [r1, 0x4] lsrs r0, 1 cmp r1, r0 bcc @0818C4C6 ldr r0, =0x02024064 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 .pool thumb_func_end sub_818C49C thumb_func_start sub_818C4D8 sub_818C4D8: ; 818C4D8 push {lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 10 ands r0, r1 cmp r0, 0 beq @0818C508 ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_818C49C str r1, [r0] b @0818C522 .align 2, 0 .pool @0818C508: ldr r0, =0x02024064 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 .pool 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, =0x02022fec 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 .pool @0818C560: ldr r5, =0x02024064 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 .pool 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, =0x02024064 ldrb r0, [r4] bl sub_8185054 ldrb r1, [r4] ldr r3, =0x0202449c 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 .pool 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, =0x02023064 ldr r0, =0x02024064 mov r9, r0 ldrb r4, [r0] lsls r2, r4, 9 adds r0, r3, 0x2 adds r0, r2, r0 ldrb r1, [r0] adds r3, 0x3 adds r2, r3 ldrb r0, [r2] lsls r0, 8 orrs r1, r0 lsls r1, 16 asrs r7, r1, 16 ldr r0, =0x00007fff cmp r7, r0 beq @0818C678 ldr r6, =0x0202406e lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x3A bl pokemon_getattr mov r8, r0 mov r1, r9 ldrb r0, [r1] lsls r0, 1 adds r0, r6 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] mov r2, r8 bl sub_807294C b @0818C6B2 .align 2, 0 .pool @0818C678: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A bl pokemon_getattr adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r4, =0x03005d70 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, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A0A4 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 .pool 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, =0x02024064 ldrb r0, [r4] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @0818C748 ldr r0, =0x03005d70 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe ldrb r2, [r4] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A58C str r1, [r0] @0818C748: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818C6F4 thumb_func_start sub_818C76C sub_818C76C: ; 818C76C push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @0818C7BC ldr r4, =0x02023064 ldrb r3, [r5] lsls r3, 9 adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] adds r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 adds r2, r4, 0x4 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 16 orrs r1, r2 adds r4, 0x5 adds r3, r4 ldrb r2, [r3] lsls r2, 24 orrs r1, r2 bl move_anim_start_t2_for_situation ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A58C str r1, [r0] @0818C7BC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02022d0c 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 .pool thumb_func_end sub_818C840 thumb_func_start sub_818C85C sub_818C85C: ; 818C85C push {lr} ldr r3, =0x02022d0c ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] movs r1, 0x7F ands r1, r0 ldrb r2, [r3] movs r0, 0x80 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] bl sub_818A514 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818C85C thumb_func_start sub_818C894 sub_818C894: ; 818C894 push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] bl sub_818A514 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818C894 thumb_func_start sub_818C8AC sub_818C8AC: ; 818C8AC push {lr} ldr r3, =0x02022d0c ldr r1, [r3] lsls r1, 24 lsrs r1, 31 movs r0, 0x1 eors r1, r0 lsls r1, 7 ldrb r2, [r3] movs r0, 0x7F ands r0, r2 orrs r0, r1 strb r0, [r3] bl sub_818A514 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818C8AC thumb_func_start sub_818C8D4 sub_818C8D4: ; 818C8D4 push {r4,lr} ldr r3, =0x02020630 ldr r2, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @0818C908 bl sub_818A514 b @0818C932 .align 2, 0 .pool @0818C908: ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0 strh r1, [r0, 0x30] ldrb r0, [r4] bl sub_80769F4 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_818A238 str r1, [r0] @0818C932: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 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, =0x02023064 ldrb r1, [r4] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 lsls r1, r3, 24 asrs r1, 24 bl audio_play_and_stuff bl sub_818A514 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818C950 thumb_func_start sub_818C994 sub_818C994: ; 818C994 push {r4,r5,lr} ldr r4, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r3, r0, 9 adds r0, r4, 0x3 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @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 .pool @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, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 movs r1, 0x19 negs r1, r1 movs r2, 0x5 bl sub_80A32E4 bl sub_818A514 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818C9F0 thumb_func_start dp01t_2E_2_battle_intro dp01t_2E_2_battle_intro: ; 818CA30 push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] bl battle_intro_launch ldr r2, =0x020243fc ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] bl sub_818A514 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_2E_2_battle_intro thumb_func_start sub_818CA64 sub_818CA64: ; 818CA64 push {r4-r6,lr} ldr r5, =0x020241e4 ldr r6, =0x02024064 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl oamt_add_pos2_onto_pos1 ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x32 strh r1, [r0, 0x2E] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000ffd8 strh r1, [r0, 0x32] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb 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, =sub_805CC00 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, =0x0000d6f9 bl gpu_pal_alloc_new lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @0818CB54 ldr r4, =0x020229e8 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 .pool @0818CB54: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] @0818CB5A: ldr r1, =gTrainerBackPicPaletteTable 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, =0x02020630 ldr r1, =0x020241e4 ldr r5, =0x02024064 ldrb r0, [r5] adds r0, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r4 strb r0, [r1, 0x5] ldr r0, =sub_818CC24 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r4, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r4 ldrb r0, [r5] strh r0, [r1, 0x8] ldr r3, =0x020244d0 ldr r0, [r3] ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0818CBD4 ldr r0, =0x020244b4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r4 ldr r1, =sub_8073C30 str r1, [r0] @0818CBD4: ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r0, [r2, 0x9] movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_120 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, 2 add r0, r8 lsls r0, 3 adds r1, r0, r1 ldrh r2, [r1, 0xA] movs r3, 0xA ldrsh r0, [r1, r3] cmp r0, 0x17 bgt @0818CC50 adds r0, r2, 0x1 strh r0, [r1, 0xA] b @0818CD0C .align 2, 0 .pool @0818CC50: ldr r7, =0x02024064 ldrb r0, [r7] mov r9, r0 ldrh r0, [r1, 0x8] strb r0, [r7] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @0818CC70 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @0818CCA0 @0818CC70: ldr r0, =0x02023064 ldrb r1, [r7] lsls r2, r1, 9 adds r0, 0x1 adds r2, r0 ldr r0, =0x0202406e lsls r1, 1 adds r1, r0 ldrh r0, [r1] strb r0, [r2] ldrb r0, [r7] movs r1, 0 bl sub_818BA6C b @0818CCF4 .align 2, 0 .pool @0818CCA0: ldr r4, =0x02023064 ldrb r0, [r7] lsls r1, r0, 9 adds r4, 0x1 adds r1, r4 ldr r5, =0x0202406e lsls r0, 1 adds r0, r5 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r7] movs r1, 0 bl sub_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, =0x020244ec 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, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_8189D40 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 .pool thumb_func_end sub_818CC24 thumb_func_start sub_818CD30 sub_818CD30: ; 818CD30 push {r4-r6,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @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 .pool @0818CD60: ldr r6, =0x020244d0 ldr r0, [r6] ldr r5, =0x02024064 ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] ldrb r0, [r5] lsls r3, r0, 9 ldr r4, =0x02023068 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] subs r4, 0x2 adds r3, r4 ldrb r3, [r3] bl sub_80735DC ldr r2, =0x020244b4 ldrb r1, [r5] adds r1, r2 movs r3, 0 strb r0, [r1] ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x5] ldrb r2, [r5] lsls r0, r2, 9 adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @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, =0x03005d60 ldrb r1, [r5] lsls r1, 2 adds r1, r0 ldr r0, =bx_increment_dp11b_field_5_till_x60_then_resume str r0, [r1] @0818CDD4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x5] adds r2, r1, 0x1 strb r2, [r0, 0x5] lsls r1, 24 lsrs r1, 24 cmp r1, 0x5C bls @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 .pool thumb_func_end bx_increment_dp11b_field_5_till_x60_then_resume thumb_func_start sub_818CE3C sub_818CE3C: ; 818CE3C push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0818CE6E ldr r2, =0x03005e00 ldr r0, =0x020244b4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, =sub_8073C30 str r1, [r0] @0818CE6E: bl sub_818A514 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024064 ldrb r0, [r4] bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @0818CEDE ldr r3, =0x02020630 ldr r0, =0x020241e4 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 ldr r0, =0x02023064 lsls r1, 9 adds r0, 0x1 adds r1, r0 adds r2, 0x3E movs r0, 0x1 ldrb r1, [r1] ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] ldrb r0, [r4] bl sub_805E408 @0818CEDE: bl sub_818A514 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818CE98 thumb_func_start sub_818CEF8 sub_818CEF8: ; 818CEF8 push {r4-r6,lr} sub sp, 0x4 ldr r6, =0x02024064 ldrb r0, [r6] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @0818CF50 ldr r5, =0x02023064 ldrb r2, [r6] lsls r1, r2, 9 adds r0, r5, 0x1 adds r0, r1, r0 ldrb r3, [r0] adds r0, r5, 0x2 adds r0, r1, r0 ldrb r4, [r0] adds r5, 0x3 adds r1, r5 ldrb r0, [r1] lsls r0, 8 orrs r4, r0 str r4, [sp] adds r0, r2, 0 adds r1, r2, 0 bl move_anim_start_t3 lsls r0, 24 cmp r0, 0 beq @0818CF44 bl sub_818A514 b @0818CF50 .align 2, 0 .pool @0818CF44: ldr r0, =0x03005d60 ldrb r1, [r6] lsls r1, 2 adds r1, r0 ldr r0, =sub_818A5BC str r0, [r1] @0818CF50: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0202433a ldr r1, =0x02023064 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] strb r0, [r2] movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 bl sub_80A2390 bl sub_818A514 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_80587B0 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0860B058 ldr r3, =0x0203cd04 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 .pool thumb_func_end dp13_810BB8C thumb_func_start load_pokemon_image_TODO ; int load_pokemon_image_TODO(int species_num, unsigned int a2, u8 a3, void *a4, int a5, u8 a6) 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, =gMonFrontPicTable b @0818D03C .align 2, 0 .pool @0818D028: lsls r0, r4, 3 ldr r1, =gMonFrontPicTable b @0818D054 .align 2, 0 .pool @0818D034: cmp r0, 0 bne @0818D050 lsls r0, r4, 3 ldr r1, =gMonBackPicTable @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 .pool @0818D050: lsls r0, r4, 3 ldr r1, =gMonBackPicTable @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 .pool @0818D068: cmp r2, 0 beq @0818D080 lsls r0, r4, 3 ldr r1, =gTrainerPicTable adds r0, r1 adds r1, r5, 0 adds r2, r4, 0 bl sub_80345F0 b @0818D08E .align 2, 0 .pool @0818D080: lsls r0, r7, 3 ldr r1, =gTrainerBackPicTable 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 .pool 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, =0x0000ffff cmp r3, r0 bne @0818D110 ldr r2, =0x0203ccec 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 .pool @0818D110: ldr r0, =0x0203ccec 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 .pool @0818D128: ldr r0, =0x0000ffff cmp r3, r0 bne @0818D160 ldr r2, =0x0203ccec ldrh r1, [r2, 0x2] adds r0, r3, 0 orrs r0, r1 strh r0, [r2, 0x2] ldr r1, =gTrainerPaletteTable 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 .pool @0818D160: ldr r0, =0x0203ccec strh r1, [r0, 0x2] lsls r0, r6, 3 ldr r1, =gTrainerPaletteTable 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 .pool 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, =gTrainerPaletteTable 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 .pool 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, =0x0203ccec ldr r0, =gUnknown_082FF70C str r0, [r1, 0x8] b @0818D1E0 .align 2, 0 .pool @0818D1D8: ldr r0, =0x0203ccec ldr r1, =gUnknown_0830536C ldr r1, [r1] str r1, [r0, 0x8] @0818D1E0: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cd04 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, =0x0000ffff b @0818D356 .align 2, 0 .pool @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, =0x0203ccec ldr r0, =gUnknown_0860B064 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, =0x0000ffff 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, =gUnknown_082EC6A8 str r0, [r5, 0x10] ldr r0, =nullsub_122 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, =0x0000ffff cmp r10, r0 bne @0818D336 ldr r0, =0x02020630 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, =0x0203cd04 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 .pool 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, =0x0203cd04 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 .pool @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, =0x0000ffff b @0818D588 .align 2, 0 .pool @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, =0x0203ccec 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, =0x0000ffff strh r0, [r4] ldr r0, =gUnknown_08309AAC 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, =gUnknown_082FF694 b @0818D500 .align 2, 0 .pool @0818D4F8: mov r1, r9 cmp r1, 0 bne @0818D510 ldr r0, =gUnknown_082FF618 @0818D500: str r0, [r4, 0x10] ldr r0, =gUnknown_0860B06C str r0, [r4, 0x4] b @0818D518 .align 2, 0 .pool @0818D510: ldr r0, =gUnknown_0860B064 str r0, [r4, 0x4] ldr r0, =gUnknown_082EC6A8 str r0, [r4, 0x10] @0818D518: ldr r2, =nullsub_122 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, =0x0000ffff ldr r1, [sp, 0x1C] cmp r1, r0 bne @0818D566 ldr r0, =0x02020630 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, =0x0203cd04 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 .pool 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, =0x0203cd04 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, =0x0000ffff b @0818D646 .align 2, 0 .pool @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, =0x0000ffff lsls r6, r4, 4 cmp r1, r0 beq @0818D624 ldr r1, =0x02020630 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, =0x02020630 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, =gUnknown_0860B058 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 .pool 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, =0x0000ffff @0818D6BA: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0000ffff @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 .pool 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, =gUnknown_0831F578 adds r0, 0x3F ldrb r0, [r0] b @0818D9A2 .align 2, 0 .pool @0818D99C: ldr r0, =gUnknown_0831F578 adds r0, 0x3C ldrb r0, [r0] @0818D9A2: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_818D97C thumb_func_start sub_818D9AC sub_818D9AC: ; 818D9AC ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_818D9AC thumb_func_start sub_818D9C0 sub_818D9C0: ; 818D9C0 push {r4,r5,lr} ldr r5, =0x00004010 ldr r4, =gUnknown_0860B07E 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, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003b58 adds r1, r0 ldr r0, =0x00004011 ldr r2, =gUnknown_0860B074 ldrb r1, [r1, 0xD] lsls r1, 1 adds r1, r2 ldrh r1, [r1] bl var_set ldr r1, =0x020375f0 movs r0, 0x1 b @0818DA24 .align 2, 0 .pool @0818DA20: ldr r1, =0x020375f0 movs r0, 0 @0818DA24: strh r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818D9C0 thumb_func_start sub_818DA30 sub_818DA30: ; 818DA30 push {lr} ldr r0, =0x03005d90 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 .pool @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, =0x020375f0 bl sub_818D9AC lsls r0, 24 lsrs r0, 24 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cd64 ldr r4, [r5] lsls r0, 16 lsrs r0, 16 movs r1, 0x6 bl __umodsi3 strb r0, [r4, 0xC] ldr r6, =gUnknown_0860B2EC 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 .pool thumb_func_end sub_818DB20 thumb_func_start sub_818DB7C sub_818DB7C: ; 818DB7C push {lr} ldr r2, =0x0203cd64 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r1, 0x12] bl sub_818DB20 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818DB7C thumb_func_start sub_818DBC4 sub_818DBC4: ; 818DBC4 ldr r3, =0x0203cd64 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 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 .pool thumb_func_end sub_818DBC4 thumb_func_start sub_818DBE8 sub_818DBE8: ; 818DBE8 push {lr} ldr r1, =0x0203cd64 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldrb r0, [r0, 0x1] cmp r0, 0x2 bne @0818DC0C movs r0, 0x2 b @0818DC16 .align 2, 0 .pool @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, =gUnknown_0860B224 lsrs r0, 22 adds r0, r1 ldr r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_818DC1C thumb_func_start sub_818DC2C sub_818DC2C: ; 818DC2C push {r4,lr} ldr r1, =0x0203cd64 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldr r4, =0x02021cc4 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 .pool thumb_func_end sub_818DC2C thumb_func_start sub_818DC60 sub_818DC60: ; 818DC60 push {r4,r5,lr} ldr r5, =0x0203cd64 ldr r0, =0x03005d8c ldr r1, [r0] ldr r2, =0x00003b58 adds r0, r1, r2 str r0, [r5] ldrb r0, [r0, 0x4] cmp r0, 0xFF bne @0818DC84 movs r0, 0 b @0818DC9C .align 2, 0 .pool @0818DC84: ldr r4, =0x02021ec4 ldr r0, =0x00003b5c 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 .pool 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, =0x0203cd64 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003b58 adds r1, r0 str r1, [r2] ldr r0, =0x02021dc4 ldrh r1, [r1, 0xE] bl sub_818DCAC pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cd64 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r1, r0, r2 str r1, [r5] ldr r1, =0x00003b5c adds r0, r1 ldr r4, =0x02021ec4 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 .pool thumb_func_end sub_818DD14 thumb_func_start sub_818DD54 sub_818DD54: ; 818DD54 ldr r1, =0x0203cd64 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldrb r1, [r0, 0x2] negs r0, r1 orrs r0, r1 lsrs r0, 31 bx lr .align 2, 0 .pool 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, =0x0203cd64 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 str r0, [r4] ldr r1, =gUnknown_0860B2EC 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, =0x02021dc4 adds r1, r5, 0 bl sub_818DCAC ldr r1, [r4] strh r5, [r1, 0xE] ldr r0, =0x03005d90 ldr r0, [r0] adds r1, 0x4 bl sub_818DCF4 ldr r1, [r4] ldr r0, =gUnknown_82E9531 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 .pool @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, =0x0203ce7c ldrh r0, [r0] bl sub_818DD84 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_818DE44 thumb_func_start sub_818DE5C sub_818DE5C: ; 818DE5C push {lr} ldr r1, =0x0203cd64 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 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 .pool 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, =0x02021dc4 bl sub_818DCAC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818DE88 thumb_func_start sub_818DEA0 sub_818DEA0: ; 818DEA0 push {r4,r5,lr} ldr r5, =0x0203cd64 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 str r0, [r5] ldr r1, =gUnknown_0860B304 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 .pool thumb_func_end sub_818DEA0 thumb_func_start sub_818DEDC sub_818DEDC: ; 818DEDC push {lr} bl sub_818DB7C ldr r0, =0x0203cd64 ldr r1, [r0] movs r0, 0x1 strb r0, [r1, 0x1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cd68 ldr r1, =gUnknown_0860B1A4 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, =gUnknown_0860B1E4 lsls r1, r4, 1 adds r0, r1, r0 ldrh r0, [r0] strh r0, [r2, 0x14] ldr r0, =gUnknown_0860B204 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 .pool thumb_func_end sub_818DF00 thumb_func_start sub_818DF68 sub_818DF68: ; 818DF68 push {r4-r6,lr} ldr r2, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 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, =gUnknown_82E9531 adds r5, r4, 0 ldr r0, =0x0000ffff 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, =0x0000ffff 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 .pool thumb_func_end sub_818DF68 thumb_func_start sub_818E004 sub_818E004: ; 818E004 ldr r2, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 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, =0x0000ffff strh r0, [r1, 0x16] bx lr .align 2, 0 .pool thumb_func_end sub_818E004 thumb_func_start sub_818E038 sub_818E038: ; 818E038 push {lr} ldr r1, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldrb r0, [r0, 0x1] cmp r0, 0x2 bne @0818E05C movs r0, 0x2 b @0818E066 .align 2, 0 .pool @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, =0x03005d8c ldr r4, [r0] ldr r0, =0x00003b58 adds r7, r4, r0 ldrh r0, [r7, 0x14] bl sub_811F8D8 cmp r0, 0 bne @0818E0EC ldr r1, =0x00003b83 adds r0, r4, r1 ldrb r5, [r0] ldr r0, =0x00003b5a adds r0, r4 mov r8, r0 adds r1, r4 mov r10, r1 ldr r6, =gUnknown_0860B1E4 @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, =gUnknown_0860B1E4 mov r12, r0 lsls r1, r5, 2 ldr r0, =gUnknown_0860B204 mov r9, r0 ldr r0, =gUnknown_0860B1A4 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 .pool @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, =0x0203cd68 ldr r0, =0x03005d8c ldr r1, [r0] ldr r2, =0x00003b58 adds r0, r1, r2 str r0, [r5] ldrb r0, [r0, 0x18] cmp r0, 0xFF bne @0818E174 ldr r0, =0x02021cc4 ldr r1, =gUnknown_085EEB7E bl strcpy_limit_7_chars movs r7, 0 b @0818E1DC .align 2, 0 .pool @0818E174: ldr r4, =0x02021cc4 ldr r0, =0x00003b70 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, =0x03005d90 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, =0x0203cd68 ldr r1, [r0] adds r1, 0x18 adds r1, r2 ldr r0, =0x03005d90 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 .pool thumb_func_end sub_818E13C thumb_func_start sub_818E1F4 sub_818E1F4: ; 818E1F4 push {r4-r6,lr} ldr r3, =0x0203cd68 ldr r0, =0x03005d8c ldr r1, [r0] ldr r2, =0x00003b58 adds r0, r1, r2 str r0, [r3] movs r5, 0 movs r4, 0 ldr r0, =0x00003b78 adds r1, r0 ldr r0, =0x03005d90 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 .pool 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, =0x02021cc4 ldr r0, =0x0203cd68 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 .pool thumb_func_end sub_818E274 thumb_func_start sub_818E298 sub_818E298: ; 818E298 push {r4,lr} ldr r4, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 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 .pool @0818E2C0: ldr r0, [r4] ldr r1, =gUnknown_82E9531 ldrb r1, [r1] adds r0, 0x2D strb r1, [r0] movs r0, 0x1 @0818E2CC: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_818E298 thumb_func_start sub_818E2D8 sub_818E2D8: ; 818E2D8 ldr r2, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00003b58 adds r1, r0, r3 str r1, [r2] ldr r1, =0x00003b82 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 str r0, [r5] ldr r6, =0x02021cc4 ldrh r1, [r0, 0x14] adds r0, r6, 0 bl sub_811EBBC ldr r4, =0x02021dc4 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 .pool thumb_func_end sub_818E308 thumb_func_start sub_818E358 sub_818E358: ; 818E358 ldr r1, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldr r1, =0x020375e2 ldrh r0, [r0, 0x28] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_818E358 thumb_func_start sub_818E37C sub_818E37C: ; 818E37C ldr r1, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] movs r1, 0x1 strb r1, [r0, 0x1] bx lr .align 2, 0 .pool thumb_func_end sub_818E37C thumb_func_start sub_818E39C sub_818E39C: ; 818E39C ldr r1, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] movs r1, 0x2 strb r1, [r0, 0x1] bx lr .align 2, 0 .pool thumb_func_end sub_818E39C thumb_func_start sub_818E3BC sub_818E3BC: ; 818E3BC ldr r1, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldr r1, =0x0000ffff strh r1, [r0, 0x16] bx lr .align 2, 0 .pool 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, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 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 .pool @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, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] movs r2, 0 adds r5, r1, 0 adds r4, r5, 0 ldr r0, =0x0000ffff 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, =0x0000ffff strh r0, [r1, 0x14] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E430 thumb_func_start sub_818E47C sub_818E47C: ; 818E47C push {lr} ldr r1, =0x020375e0 movs r0, 0x11 strh r0, [r1] bl sub_811A4F0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E47C thumb_func_start sub_818E490 sub_818E490: ; 818E490 push {lr} ldr r0, =0x0203ce7c ldrh r0, [r0] movs r1, 0x1 bl sub_80D6AA4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E490 thumb_func_start sub_818E4A4 sub_818E4A4: ; 818E4A4 push {r4-r6,lr} ldr r2, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 adds r0, r1 str r0, [r2] ldr r1, =0x0203ce7c ldrh r1, [r1] strh r1, [r0, 0x28] movs r3, 0 adds r4, r2, 0 ldr r6, =0x03005d90 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, =gUnknown_82E9531 ldrb r1, [r1] adds r0, 0x2D strb r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E4A4 thumb_func_start sub_818E510 sub_818E510: ; 818E510 ldr r2, =0x0203cd68 ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00003b58 adds r1, r0, r3 str r1, [r2] ldr r1, =0x00003b82 adds r0, r1 movs r1, 0x1 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_818E510 thumb_func_start sub_818E538 sub_818E538: ; 818E538 push {lr} ldr r2, =0x0203cd68 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003b58 adds r1, r0 str r1, [r2] ldr r0, =0x02021ec4 ldrh r1, [r1, 0x14] bl sub_811EBBC pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cd68 ldr r1, =0x03005d8c ldr r1, [r1] ldr r4, =0x00003b58 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, =0x00003b83 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, =0x0203cd68 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 .pool thumb_func_end sub_818E570 thumb_func_start sub_818E604 sub_818E604: ; 818E604 push {r4,lr} ldr r4, =0x0203cd6c 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 .pool thumb_func_end sub_818E604 thumb_func_start sub_818E638 sub_818E638: ; 818E638 push {r4,lr} ldr r4, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 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, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r1, 0xE] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E638 thumb_func_start sub_818E674 sub_818E674: ; 818E674 push {lr} ldr r2, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003b58 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 .pool 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, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r3, =0x00003b58 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, =0x03005d90 adds r1, 0x4 ldr r0, [r0] ldm r0!, {r2,r3} stm r1!, {r2,r3} ldr r1, [r4] ldr r0, =gUnknown_82E9531 ldrb r0, [r0] strb r0, [r1, 0xE] @0818E6EA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r5, =0x00003b58 adds r0, r5 str r0, [r1] ldrb r0, [r0, 0xD] adds r5, r1, 0 cmp r0, 0x4 bhi @0818E76A lsls r0, 2 ldr r1, =@0818E73C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203cd6c ldr r1, [r0] ldrb r0, [r1, 0x2] adds r0, 0x1 strb r0, [r1, 0x2] b @0818E78C .align 2, 0 .pool @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, =0x0203cd6c ldr r1, =0x03005d8c ldr r1, [r1] ldr r2, =0x00003b58 adds r1, r2 str r1, [r4] ldr r2, =gUnknown_0860B324 ldrb r1, [r1, 0xD] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r1, =gUnknown_0860B310 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 .pool thumb_func_end sub_818E794 thumb_func_start sub_818E7E0 sub_818E7E0: ; 818E7E0 push {r4,lr} adds r3, r1, 0 ldr r2, =0x0203cd6c ldr r1, =0x03005d8c ldr r1, [r1] ldr r4, =0x00003b58 adds r1, r4 str r1, [r2] ldrb r2, [r1, 0xD] strb r2, [r0] ldr r2, =gUnknown_0860B310 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 .pool thumb_func_end sub_818E7E0 thumb_func_start sub_818E81C sub_818E81C: ; 818E81C push {r4,lr} ldr r3, =0x0203cd6c ldr r1, =0x03005d8c ldr r1, [r1] ldr r4, =0x00003b58 adds r2, r1, r4 str r2, [r3] ldr r2, =0x00003b5c adds r1, r2 bl gf_strcpy pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E81C thumb_func_start sub_818E848 sub_818E848: ; 818E848 ldr r2, =0x0203cd6c ldr r1, =0x03005d8c ldr r1, [r1] ldr r3, =0x00003b58 adds r1, r3 str r1, [r2] ldrb r1, [r1, 0xE] strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_818E848 thumb_func_start sub_818E868 sub_818E868: ; 818E868 push {lr} lsls r1, 24 ldr r2, =gUnknown_0860B338 lsrs r1, 22 adds r1, r2 ldr r1, [r1] bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E868 thumb_func_start sub_818E880 sub_818E880: ; 818E880 push {lr} ldr r1, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldrb r0, [r0, 0x2] cmp r0, 0x4 bls @0818E8A4 movs r0, 0x1 b @0818E8AE .align 2, 0 .pool @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, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldrb r0, [r0, 0x1] cmp r0, 0x1 beq @0818E8D8 movs r0, 0 b @0818E8DA .align 2, 0 .pool @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, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r4, =0x00003b58 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 .pool thumb_func_end sub_818E8E0 thumb_func_start sub_818E914 sub_818E914: ; 818E914 push {lr} ldr r0, =0x02021dc4 ldr r1, =0x02021cc4 bl sub_818E794 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E914 thumb_func_start sub_818E92C sub_818E92C: ; 818E92C push {lr} ldr r1, =c2_exit_to_overworld_2_switch movs r0, 0x3 bl sub_81357FC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E92C thumb_func_start sub_818E940 sub_818E940: ; 818E940 ldr r1, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] movs r1, 0x1 strb r1, [r0, 0x1] bx lr .align 2, 0 .pool thumb_func_end sub_818E940 thumb_func_start sub_818E960 sub_818E960: ; 818E960 ldr r1, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldr r2, =0x020375e2 ldr r1, =gUnknown_0860B34C ldrb r0, [r0, 0xD] lsls r0, 1 adds r0, r1 ldrh r0, [r0] strh r0, [r2] bx lr .align 2, 0 .pool thumb_func_end sub_818E960 thumb_func_start sub_818E990 sub_818E990: ; 818E990 ldr r1, =0x0203cd6c ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003b58 adds r0, r2 str r0, [r1] ldrb r0, [r0, 0xD] bx lr .align 2, 0 .pool thumb_func_end sub_818E990 thumb_func_start sub_818E9AC sub_818E9AC: ; 818E9AC push {lr} ldr r1, =gUnknown_0860D090 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E9AC thumb_func_start sub_818E9CC sub_818E9CC: ; 818E9CC push {r4-r7,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r7, r0, 16 ldr r0, [r4] ldr r2, =0x00000ca8 adds r0, r2 movs r6, 0 strb r6, [r0] ldr r1, [r4] adds r2, 0xA adds r0, r1, r2 strh r6, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, [r4] ldr r2, =0x00000ca9 adds r1, r2 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r4, [r4] ldr r0, =0x00000cdc adds r3, r4, r0 ldr r2, =gUnknown_0860D0EC 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, =0x00000d0c adds r1, r4, r2 adds r1, r0 strh r6, [r1] @0818EA3E: ldr r0, =0x03005d8c 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, =0x02038bca strh r6, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818E9CC thumb_func_start sub_818EA84 sub_818EA84: ; 818EA84 push {r4-r6,lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r6, r0, 16 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x9 bls @0818EAA8 b @0818ED10 @0818EAA8: lsls r0, 2 ldr r1, =@0818EAC8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r5, 1 lsls r2, r6, 2 adds r1, r2 ldr r2, =0x00000d0c adds r0, r2 adds r0, r1 ldrh r0, [r0] strh r0, [r3] b @0818ED10 .align 2, 0 .pool @0818EB14: ldr r4, =0x020375f0 ldr r0, =0x03005d90 ldr r2, [r0] ldr r3, =0x00000cdc adds r2, r3 ldr r3, =gUnknown_0860D0EC 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 .pool @0818EB48: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 ldrb r0, [r0] lsls r0, 31 b @0818ECBE .align 2, 0 .pool @0818EB64: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 ldrb r0, [r0] lsls r0, 30 b @0818ECBE .align 2, 0 .pool @0818EB80: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 b @0818ECBA .align 2, 0 .pool @0818EB98: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 ldrb r0, [r0] lsls r0, 28 b @0818ECBE .align 2, 0 .pool @0818EBB4: ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bne @0818EC04 cmp r5, 0 beq @0818EBE8 ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 ldrb r0, [r0] lsls r0, 26 b @0818ECBE .align 2, 0 .pool @0818EBE8: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 ldrb r0, [r0] lsls r0, 27 b @0818ECBE .align 2, 0 .pool @0818EC04: cmp r5, 0 beq @0818EC24 ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 ldrb r0, [r0] lsls r0, 30 b @0818ECBE .align 2, 0 .pool @0818EC24: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 ldrb r0, [r0] lsls r0, 31 b @0818ECBE .align 2, 0 .pool @0818EC40: ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bne @0818EC90 cmp r5, 0 beq @0818EC74 ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 ldrb r0, [r0] lsrs r0, 7 strh r0, [r1] b @0818ED10 .align 2, 0 .pool @0818EC74: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 ldrb r0, [r0] lsls r0, 25 b @0818ECBE .align 2, 0 .pool @0818EC90: cmp r5, 0 beq @0818ECB0 ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000d08 adds r0, r2 ldrb r0, [r0] lsls r0, 28 b @0818ECBE .align 2, 0 .pool @0818ECB0: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r3, =0x00000d08 adds r0, r3 @0818ECBA: ldrb r0, [r0] lsls r0, 29 @0818ECBE: lsrs r0, 31 strh r0, [r1] b @0818ED10 .align 2, 0 .pool @0818ECD0: bl sub_81B8558 ldr r2, =0x0203cef8 ldr r0, =0x03005d90 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 .pool @0818ECF4: ldr r2, =0x020375f0 ldr r0, =0x03005d90 ldr r1, [r0] ldr r3, =0x00000d0a adds r0, r1, r3 ldrb r0, [r0] lsls r0, 1 adds r3, 0x1 adds r1, r3 ldr r3, =0x0000fffd adds r0, r3 ldrb r1, [r1] adds r0, r1 strh r0, [r2] @0818ED10: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818EA84 thumb_func_start sub_818ED28 sub_818ED28: ; 818ED28 push {r4,r5,lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r4, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x8 bls @0818ED4C b @0818F01E @0818ED4C: lsls r0, 2 ldr r1, =@0818ED6C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d90 ldr r2, [r0] lsls r0, r4, 1 lsls r1, r5, 2 adds r0, r1 ldr r1, =0x00000d0c adds r2, r1 adds r2, r0 ldr r0, =0x020375e4 ldrh r0, [r0] strh r0, [r2] b @0818F01E .align 2, 0 .pool @0818EDB4: ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @0818EDE8 ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0x00000cdc adds r2, r0 ldr r3, =gUnknown_0860D0EC 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 .pool @0818EDE8: ldr r0, =0x03005d90 ldr r2, [r0] ldr r1, =0x00000cdc adds r2, r1 ldr r3, =gUnknown_0860D0FC 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 .pool @0818EE10: ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r1, =0x00000d08 adds r2, r1 movs r1, 0x1 ands r1, r0 ldrb r3, [r2] movs r0, 0x2 negs r0, r0 b @0818EF74 .align 2, 0 .pool @0818EE34: ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r2, =0x00000d08 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 .pool @0818EE5C: ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r1, =0x00000d08 adds r3, r1 b @0818EFE8 .align 2, 0 .pool @0818EE78: ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r2, =0x00000d08 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 .pool @0818EEA0: ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0x1 bne @0818EF00 cmp r4, 0 beq @0818EEDC ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r2, =0x00000d08 adds r3, r2 ands r1, r0 lsls r1, 5 ldrb r2, [r3] movs r0, 0x21 negs r0, r0 b @0818EFF4 .align 2, 0 .pool @0818EEDC: ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r2, =0x00000d08 adds r3, r2 ands r1, r0 lsls r1, 4 ldrb r2, [r3] movs r0, 0x11 negs r0, r0 b @0818EFF4 .align 2, 0 .pool @0818EF00: cmp r4, 0 beq @0818EF2C ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r1, =0x00000d08 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 .pool @0818EF2C: ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r1, =0x00000d08 adds r2, r1 movs r1, 0x1 ands r1, r0 ldrb r3, [r2] movs r0, 0x2 negs r0, r0 b @0818EF74 .align 2, 0 .pool @0818EF50: ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0x1 bne @0818EFB0 cmp r4, 0 beq @0818EF8C ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0x020375e4 ldrb r1, [r0] ldr r0, =0x00000d08 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 .pool @0818EF8C: ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r2, =0x00000d08 adds r3, r2 ands r1, r0 lsls r1, 6 ldrb r2, [r3] movs r0, 0x41 negs r0, r0 b @0818EFF4 .align 2, 0 .pool @0818EFB0: cmp r4, 0 beq @0818EFDC ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r1, =0x00000d08 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 .pool @0818EFDC: ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r2, =0x00000d08 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 .pool @0818F008: ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0x0203cef8 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 .pool 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, =0x03005d90 ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 adds r0, 0x1 ldr r3, =0x00000d0a adds r1, r3 strb r0, [r1] ldr r0, =0x000040ce bl var_get ldr r1, [r4] adds r0, 0x1 ldr r5, =0x00000d0b adds r1, r5 strb r0, [r1] ldr r2, [r4] ldr r7, =0x00000d24 adds r3, r2, r7 ldrh r0, [r3] ldr r5, =0x000003ff adds r1, r5, 0 orrs r0, r1 strh r0, [r3] ldr r3, =0x00000d25 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, =0x02024488 mov r9, r0 movs r4, 0 @0818F0BA: mov r1, r8 ldr r0, [r1] ldr r2, =0x00000caa 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, =0x00000d64 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, =0x00000caa 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, =0x00000efc 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, =0x03005d90 @0818F11C: ldr r0, [r6] ldr r1, =0x00000caa 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, =0x00000f04 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, =0x00000caa adds r0, r1 adds r0, r4 ldrh r0, [r0] movs r2, 0x64 muls r0, r2 add r0, r9 bl GetNature ldr r1, [r5] adds r1, r7 ldr r3, =0x00000f0a 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, =0x03005d90 ldr r0, [r3] ldr r7, =0x00000d28 adds r0, r7 ldrh r0, [r0] lsls r0, 22 lsrs r0, 22 adds r2, r3, 0 cmp r0, r4 beq @0818F1CA ldr r3, =0x00000d24 @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, =0x03005d90 ldr r3, [r0] ldr r1, [sp, 0x34] adds r3, r1 ldr r2, =0x00000d24 adds r3, r2 ldr r5, =0x000003ff adds r0, r5, 0 adds r2, r4, 0 ands r2, r0 ldrh r0, [r3] ldr r7, =0xfffffc00 adds r1, r7, 0 b @0818F292 .align 2, 0 .pool @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, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000d28 adds r0, r2 ldrh r0, [r0] lsls r0, 22 lsrs r0, 22 adds r2, r1, 0 cmp r0, r4 beq @0818F274 ldr r3, =0x00000d24 @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, =0x03005d90 ldr r3, [r5] ldr r7, [sp, 0x34] adds r3, r7 ldr r0, =0x00000d24 adds r3, r0 ldr r1, =0x000003ff adds r0, r1, 0 adds r2, r4, 0 ands r2, r0 ldrh r0, [r3] ldr r5, =0xfffffc00 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, =0x03005d90 ldr r0, [r0] ldr r1, [sp, 0x8] mov r8, r1 ldr r2, [sp, 0xC] mov r12, r2 ldr r3, =0x00000d64 adds r0, r3 ldr r1, [sp, 0x20] adds r4, r1, r0 @0818F2D4: ldrh r3, [r4] cmp r3, r6 beq @0818F300 ldr r2, =0x0203bc8c 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, =0x03005d90 ldr r0, [r3] ldr r1, [sp, 0x38] add r1, r9 ldr r5, =0x00000d64 adds r0, r5 adds r0, r1 strh r6, [r0] ldr r2, [sp, 0x28] add r2, sp adds r2, 0x8 ldr r0, =0x0203bc8c 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, =0x00000d25 adds r2, r0 ldrb r0, [r2] movs r3, 0x5 negs r3, r3 adds r1, r3, 0 ands r0, r1 strb r0, [r2] ldr r5, =0x03005d90 ldr r2, [r5] adds r2, r7 ldr r7, =0x00000d25 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, =gUnknown_0832A328 ldr r5, =gBaseStats @0818F38A: ldr r0, =0x03005d90 ldr r0, [r0] mov r2, r10 lsls r1, r2, 1 ldr r3, =0x00000caa adds r0, r3 adds r0, r1 ldrh r0, [r0] subs r4, r0, 0x1 movs r0, 0x64 muls r4, r0 ldr r0, =0x020244ec 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, =0x03005d90 ldr r0, [r1] mov r2, r10 lsls r1, r2, 2 adds r0, r1 ldr r3, =0x00000d24 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, =0x03005d90 ldr r0, [r1] mov r4, r9 add r4, r10 adds r4, r5 lsls r4, 1 ldr r2, =0x00000d64 adds r0, r2 adds r0, r4 ldrh r1, [r0] ldr r3, =0x0203bc8c 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, =0x03005d90 ldr r0, [r3] ldr r1, =0x00000d64 adds r0, r1 adds r0, r4 ldrh r0, [r0] ldr r2, =0x0203bc8c ldr r1, [r2] lsls r0, 4 adds r0, r1 ldrh r0, [r0] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r3, =gBaseStats adds r1, r3 ldrb r0, [r1, 0x6] lsls r0, 2 ldr r2, =gUnknown_0832A328 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, =0x000003ff 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, =0x03005d90 ldr r1, [r0] lsls r0, r5, 2 adds r0, r1, r0 ldr r2, =0x00000d24 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 .pool @0818F600: b @0818F61E @0818F602: mov r3, r10 lsls r0, r3, 2 adds r0, r1, r0 ldr r1, =0x00000d24 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, =0x03005d90 ldr r1, [r0] ldr r4, =0x00000d24 adds r1, r4 ldrh r1, [r1] lsls r1, 22 lsrs r1, 22 ldr r3, =0x000003ff adds r2, r0, 0 ldr r6, =gUnknown_0860D3F1 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, =0x00000d24 adds r2, r3 ldrh r1, [r2] ldr r0, =0xfffffc00 ands r0, r1 ldr r7, =0x000003fe adds r1, r7, 0 b @0818F6BE .align 2, 0 .pool @0818F6AC: movs r5, 0x1 ldr r2, [r2] ldr r0, =0x00000d28 adds r2, r0 ldrh r1, [r2] ldr r0, =0xfffffc00 ands r0, r1 ldr r3, =0x000003fe 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, =0x03005d90 ldr r1, [r1] ldr r2, =0x00000d64 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 .pool 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, =0x0000012f cmp r6, r0 bne @0818F7A0 movs r0, 0x1 b @0818F7CA .align 2, 0 .pool @0818F7A0: mov r2, r10 subs r0, r2, r6 lsls r0, 2 ldr r1, =gBaseStats 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, =gBaseStats 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 .pool 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, =0x03005d90 ldr r5, [r2] lsls r6, r0, 2 adds r6, r5, r6 ldr r3, =0x00000d24 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, =0xfffffc00 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, =0x03005d90 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, =0x00000d64 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 .pool thumb_func_end sub_818F904 thumb_func_start sub_818F9B0 sub_818F9B0: ; 818F9B0 push {lr} ldr r0, =0x02021cc4 ldr r2, =gUnknown_085CCD20 ldr r1, =0x03005d90 ldr r1, [r1] ldr r3, =0x00000cb2 adds r1, r3 ldrh r1, [r1] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818F9B0 thumb_func_start sub_818F9E0 sub_818F9E0: ; 818F9E0 push {lr} ldr r0, =0x02021cc4 ldr r2, =gUnknown_085CCD20 ldr r1, =0x03005d90 ldr r1, [r1] ldr r3, =0x00000cb2 adds r1, r3 ldrh r1, [r1] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r0, =0x02021dc4 ldr r1, =0x02038bca ldrh r1, [r1] bl sub_8195898 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_818F9E0 thumb_func_start sub_818FA20 sub_818FA20: ; 818FA20 push {r4,r5,lr} ldr r1, =0x0203cd70 movs r0, 0 str r0, [r1] ldr r4, =0x020244ec adds r0, r4, 0 movs r1, 0x3A movs r2, 0 bl pokemon_getattr ldr r5, =0x0203cd74 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, =0x02038bca 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 .pool 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, =0x02024744 adds r0, r3, r6 ldr r7, =0x03005d90 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, =0x00000d64 adds r4, r6 adds r4, r1 ldrh r3, [r4] ldr r7, =0x0203bc8c 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, =0x00000d64 mov r9, r3 ldr r3, =0x0203bc8c mov r4, r10 str r4, [sp, 0x20] @0818FB18: ldr r7, =0x03005d90 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, =0x02024744 adds r0, r7, r2 mov r2, r12 str r3, [sp, 0x24] bl sub_80691F4 ldr r7, =0x03005d90 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, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x20 add r2, sp, 0xC bl pokemon_setattr ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, [sp, 0x20] add r1, r8 ldr r2, =0x00000d64 adds r0, r2 adds r0, r1 ldrh r0, [r0] ldr r1, =0x0203bc8c ldr r1, [r1] lsls r0, 4 adds r0, r1 ldrb r2, [r0, 0xA] lsls r2, 1 ldr r0, =gBattleFrontierHeldItems 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 .pool 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, =0x03005d90 ldr r1, [r0] ldr r2, [sp, 0x18] adds r0, r1, r2 ldr r2, =0x00000d24 adds r0, r2 ldrh r0, [r0] lsls r0, 22 lsrs r0, 22 ldr r2, =0x000003fe 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 .pool @0818FD3C: mov r2, r8 lsls r0, r2, 1 add r0, r8 lsls r0, 1 ldr r2, [sp, 0x10] adds r0, r2, r0 ldr r2, =0x00000d64 adds r1, r2 adds r1, r0 ldrh r0, [r1] ldr r1, =0x0203bc8c 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, =0x020244ec 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 .pool 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, =0x03005d90 ldr r1, [r0] ldr r2, [sp, 0x18] adds r0, r1, r2 ldr r2, =0x00000d24 adds r0, r2 ldrh r0, [r0] lsls r0, 22 lsrs r0, 22 ldr r2, =0x000003fe 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 .pool @0818FE38: mov r2, r8 lsls r0, r2, 1 add r0, r8 lsls r0, 1 ldr r2, [sp, 0x10] adds r0, r2, r0 ldr r2, =0x00000d64 adds r1, r2 adds r1, r0 ldrh r0, [r1] ldr r1, =0x0203bc8c 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, =0x020244ec 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 .pool 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, =gUnknown_0832A328 @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 .pool @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, =gUnknown_0832A328 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 .pool 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, =0x0000ffff cmp r3, r0 beq @0818FFF0 ldr r0, =gBattleMoves 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 .pool @0818FFFC: ldr r1, =gBaseStats 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 .pool @0819002C: ldr r0, =gUnknown_0831ACE8 adds r1, r6, r0 ldrb r0, [r1] ldr r7, =gUnknown_0831ACE8 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, =gUnknown_0831ACE8 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 .pool @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, =0x03005d90 ldr r1, [r0] ldr r4, =0x00000d24 adds r1, r4 ldrh r1, [r1] lsls r1, 22 lsrs r1, 22 mov r12, r0 ldr r6, =gUnknown_0860D10C 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 .pool @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, =gUnknown_0860D14C 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, =0x00000d25 adds r0, r3 b @0819024E .align 2, 0 .pool @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, =0x00000d25 adds r0, r1 @0819024E: ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @08190234 @08190256: cmp r2, r4 beq @08190286 ldr r0, =gUnknown_0860D14C adds r0, r2, r0 ldrb r0, [r0] b @08190292 .align 2, 0 .pool @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, =0x00000d25 adds r1, r0 ldrb r0, [r1] lsls r0, 29 cmp r0, 0 bge @08190290 @08190286: movs r0, 0xFF b @08190292 .align 2, 0 .pool @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, =0x02038bca strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8190298 thumb_func_start sub_81902AC sub_81902AC: ; 81902AC push {r4,lr} ldr r0, =0x03005d90 ldr r4, [r0] ldr r1, =0x00000cb2 adds r0, r4, r1 ldrh r0, [r0] ldr r1, =0x000003ff bl sub_81901A0 lsls r0, 2 adds r4, r0 ldr r0, =0x00000d24 adds r4, r0 ldrh r0, [r4] lsls r0, 22 lsrs r0, 22 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81902AC thumb_func_start sub_81902E4 sub_81902E4: ; 81902E4 push {lr} ldr r0, =0x02038bca ldrh r0, [r0] movs r1, 0 bl sub_8162614 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81902E4 thumb_func_start sub_81902F8 sub_81902F8: ; 81902F8 push {r4,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool thumb_func_end sub_81902F8 thumb_func_start sub_819033C sub_819033C: ; 819033C push {r4,r5,lr} ldr r5, =0x03005d90 ldr r0, [r5] ldr r1, =0x00000ca9 adds r0, r1 ldrb r4, [r0] lsls r4, 30 lsrs r4, 30 ldr r0, =0x000040ce bl var_get lsls r0, 24 ldr r1, [r5] lsls r4, 1 lsrs r0, 22 adds r4, r0 ldr r3, =0x00000d0c adds r1, r3 adds r1, r4 ldrh r0, [r1] ldr r2, =0x000003e6 cmp r0, r2 bhi @0819036E adds r0, 0x1 strh r0, [r1] @0819036E: ldr r0, [r5] ldr r1, =0x00000d1c 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, =0x00000d14 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 .pool thumb_func_end sub_819033C thumb_func_start sub_81903B8 sub_81903B8: ; 81903B8 push {r4,r5,lr} ldr r0, =sub_8190400 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 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, =sub_8194B54 bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @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, =0x05006000 add r0, sp, 0x4 bl CpuSet movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_0860CE84 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r0, =gUnknown_0860CEB4 bl Window_InitFromTemplates bl TextBox_ResetSomeField ldr r0, =0x02022e14 strh r4, [r0] ldr r0, =0x02022e16 strh r4, [r0] ldr r0, =0x02022e18 strh r4, [r0] ldr r0, =0x02022e1a strh r4, [r0] ldr r0, =0x02022e20 strh r4, [r0] ldr r0, =0x02022e22 strh r4, [r0] mov r2, r9 cmp r2, 0x2 bne @081904DC ldr r0, =0x02022e1c strh r4, [r0] ldr r0, =0x02022e1e strh r4, [r0] b @081904E6 .align 2, 0 .pool @081904DC: ldr r0, =0x02022e1c strh r4, [r0] ldr r1, =0x02022e1e movs r0, 0xA0 strh r0, [r1] @081904E6: ldr r0, =0x03005e00 mov r2, r10 lsls r1, r2, 2 add r1, r10 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @08190772 .align 2, 0 .pool @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, =0x0300301c movs r0, 0x4 strb r0, [r1] b @08190602 .align 2, 0 .pool @08190570: ldr r1, =gUnknown_08D83D50 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, =gUnknown_08D84970 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, =gUnknown_08D84F00 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, =gUnknown_0860CF50 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08D85358 movs r4, 0x80 lsls r4, 2 movs r1, 0 adds r2, r4, 0 bl decompress_palette ldr r0, =gUnknown_08D85444 movs r1, 0x80 lsls r1, 1 adds r2, r4, 0 bl decompress_palette ldr r0, =gUnknown_08D85600 movs r1, 0xF0 movs r2, 0x20 bl decompress_palette mov r0, r9 cmp r0, 0x2 bne @081905DE ldr r0, =gUnknown_08D854C8 movs r1, 0x50 movs r2, 0x20 bl decompress_palette @081905DE: str r7, [sp, 0x8] add r0, sp, 0x8 ldr r1, =0x02037b14 ldr r2, =0x05000100 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 .pool @08190634: ldr r0, =sub_8194B70 bl SetVBlankCallback ldr r4, =0x0203cd78 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, =sub_8190CD4 movs r1, 0 bl AddTask lsls r0, 24 lsrs r6, r0, 24 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 movs r1, 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, =0x0203cd78 ldr r1, [r0] movs r0, 0x1 strb r0, [r1, 0x10] b @081906B0 .align 2, 0 .pool @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, =gUnknown_0860D068 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, =0x02020630 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, =gUnknown_0860D050 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 .pool 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, =nullsub_12 str r0, [r2, 0x1C] b @081907F0 .align 2, 0 .pool @081907D4: lsls r0, r1, 16 asrs r0, 16 cmp r0, 0xBF ble @081907F0 ldr r0, =0x0203cd78 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 .pool 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, =nullsub_12 str r0, [r2, 0x1C] b @08190858 .align 2, 0 .pool @08190838: lsls r0, r1, 16 asrs r0, 16 movs r1, 0x20 negs r1, r1 cmp r0, r1 bgt @08190858 ldr r0, =0x0203cd78 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 .pool 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, =nullsub_12 str r0, [r2, 0x1C] b @081908C0 .align 2, 0 .pool @081908A4: lsls r1, 16 ldr r0, =0x010f0000 cmp r1, r0 ble @081908C0 ldr r0, =0x0203cd78 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 .pool 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, =nullsub_12 str r0, [r2, 0x1C] b @08190930 .align 2, 0 .pool @08190910: lsls r0, r1, 16 asrs r0, 16 movs r1, 0x20 negs r1, r1 cmp r0, r1 bgt @08190930 ldr r0, =0x0203cd78 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 .pool 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, =sub_8190938 str r0, [r4, 0x1C] b @081909C0 .align 2, 0 .pool @081909A4: lsls r0, r1, 16 asrs r0, 16 cmp r0, 0xAF ble @081909C0 ldr r0, =0x0203cd78 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 .pool 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, =sub_8190938 str r0, [r4, 0x1C] b @08190A3C .align 2, 0 .pool @08190A1C: lsls r0, r1, 16 asrs r0, 16 movs r1, 0x10 negs r1, r1 cmp r0, r1 bgt @08190A3C ldr r0, =0x0203cd78 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 .pool 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, =sub_8190938 str r0, [r4, 0x1C] b @08190AB8 .align 2, 0 .pool @08190A9C: lsls r0, r1, 16 asrs r0, 16 cmp r0, 0xFF ble @08190AB8 ldr r0, =0x0203cd78 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 .pool 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, =sub_8190938 str r0, [r4, 0x1C] b @08190B34 .align 2, 0 .pool @08190B14: lsls r0, r1, 16 asrs r0, 16 movs r1, 0x10 negs r1, r1 cmp r0, r1 bgt @08190B34 ldr r0, =0x0203cd78 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 .pool 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, =0x03005e00 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, =gUnknown_0860D080 adds r0, r1 ldrb r0, [r0] mov r10, r0 ldr r1, =0x03005d90 ldr r5, [r1] ldr r7, =0x00000cb2 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, =0x00000d25 adds r1, r7 ldrb r2, [r1] lsls r1, r2, 29 adds r4, r0, 0 cmp r1, 0 bge @08190BB6 ldr r0, =0x0203cd78 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, =0x00000d25 adds r0, r2 ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @08190BD4 ldr r0, =0x0203cd78 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 .pool @08190BFC: ldr r0, =0x0203cd78 ldr r0, [r0] ldrb r0, [r0, 0x10] cmp r0, 0 bne @08190C32 b @08190C48 .align 2, 0 .pool @08190C0C: movs r2, 0x30 ldrsh r0, [r3, r2] cmp r0, 0 beq @08190C28 ldr r0, =0x0203cd78 ldr r0, [r0] ldrb r0, [r0, 0x10] cmp r0, 0x1 bls @08190C32 movs r7, 0x8 ldrsh r0, [r4, r7] b @08190C4C .align 2, 0 .pool @08190C28: ldr r0, =0x0203cd78 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 .pool @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, =0x03005e00 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, =0x0203cd78 ldr r0, [r0] ldrb r0, [r0, 0x10] cmp r0, 0 bne @08190CA6 b @08190CC0 .align 2, 0 .pool @08190C9C: ldr r0, =0x0203cd78 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 .pool @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, =0x03005e00 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, =@08190D18 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02037fd4 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, =0x03005e00 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 .pool @08190D7C: ldr r0, =0x02037fd4 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, =0x03005e00 adds r0, r2 movs r1, 0x2 strh r1, [r0, 0x8] bl @08192202 .align 2, 0 .pool @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, =0x03005e00 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 .pool @08190DF0: ldr r1, =0x03005e00 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, =0x03005e00 mov r1, r9 add r1, r8 lsls r1, 3 adds r1, r0 movs r0, 0x3 strh r0, [r1, 0x8] bl @08192202 .align 2, 0 .pool @08190E48: mov r6, r8 lsls r1, r6, 2 adds r0, r1, r6 lsls r0, 3 ldr r2, =0x03005e00 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, =@08190E78 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 adds r0, r4 movs r5, 0xC ldrsh r2, [r0, r5] cmp r2, 0 beq @08190ED4 ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r0, =0x02022e18 strh r1, [r0] ldr r1, =0x02022e1a movs r0, 0xA0 strh r0, [r1] b @08190EE6 .align 2, 0 .pool @08190ED4: ldr r0, =0x02022e14 strh r2, [r0] ldr r1, =0x02022e16 movs r0, 0xA0 strh r0, [r1] ldr r0, =0x02022e18 strh r2, [r0] ldr r0, =0x02022e1a strh r2, [r0] @08190EE6: cmp r6, 0x1 bne @08190F9C ldr r5, =0x0203cd78 ldr r0, [r5] ldrb r1, [r0, 0x10] cmp r1, 0 bne @08190F50 ldr r0, =0x02022e1c strh r1, [r0] ldr r1, =0x02022e1e movs r6, 0xA0 lsls r6, 1 adds r0, r6, 0 strh r0, [r1] ldr r3, =gUnknown_0860D080 ldr r2, =0x03005e00 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 .pool @08190F50: ldr r1, =0x02022e1c movs r6, 0x80 lsls r6, 1 adds r0, r6, 0 strh r0, [r1] ldr r0, =0x02022e1e movs r4, 0 strh r4, [r0] ldr r3, =gUnknown_0860D080 ldr r2, =0x03005e00 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 .pool @08190F9C: ldr r6, =0x0203cd78 ldr r1, [r6] ldrb r5, [r1, 0x10] cmp r5, 0 bne @08190FF8 ldr r4, =0x03005e00 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, =0x02022e1c strh r5, [r0] ldr r1, =0x02022e1e 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 .pool @08190FF8: cmp r5, 0x2 bne @0819104C ldr r4, =0x03005e00 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, =0x02022e1c movs r0, 0 strh r0, [r1] ldr r1, =0x02022e1e 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 .pool @0819104C: ldr r1, =0x02022e1c movs r3, 0x80 lsls r3, 1 adds r0, r3, 0 strh r0, [r1] ldr r1, =0x02022e1e movs r0, 0xA0 strh r0, [r1] ldr r1, =0x03005e00 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, =0x0203cd78 mov r10, r5 ldr r3, =0x02020630 mov r0, r9 add r0, r8 lsls r0, 3 ldr r1, =0x03005e00 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, =sub_8190790 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 .pool @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, =sub_8190950 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, =0x0203cd78 mov r12, r2 ldr r3, =0x02020630 ldr r1, =0x03005e00 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, =sub_8190790 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 .pool @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, =sub_8190950 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, =0x03005e00 adds r0, r3 movs r2, 0 movs r1, 0x4 bl @08191FE8 .align 2, 0 .pool @08191234: mov r0, r9 add r0, r8 lsls r0, 3 ldr r4, =0x03005e00 adds r0, r4 movs r5, 0xC ldrsh r2, [r0, r5] cmp r2, 0 beq @08191278 ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r0, =0x02022e18 strh r1, [r0] ldr r1, =0x02022e1a ldr r2, =0x0000ff60 adds r0, r2, 0 strh r0, [r1] b @0819128C .align 2, 0 .pool @08191278: ldr r0, =0x02022e14 strh r2, [r0] ldr r1, =0x02022e16 ldr r3, =0x0000ff60 adds r0, r3, 0 strh r0, [r1] ldr r0, =0x02022e18 strh r2, [r0] ldr r0, =0x02022e1a strh r2, [r0] @0819128C: cmp r6, 0x2 bne @0819133C ldr r5, =0x0203cd78 ldr r0, [r5] ldrb r1, [r0, 0x10] cmp r1, 0 bne @081912F4 ldr r0, =0x02022e1c strh r1, [r0] ldr r1, =0x02022e1e movs r0, 0xA0 strh r0, [r1] ldr r3, =gUnknown_0860D080 ldr r2, =0x03005e00 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 .pool @081912F4: ldr r0, =0x02022e1c movs r4, 0 strh r4, [r0] ldr r0, =0x02022e1e strh r4, [r0] ldr r3, =gUnknown_0860D080 ldr r2, =0x03005e00 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 .pool @0819133C: ldr r6, =0x0203cd78 ldr r1, [r6] ldrb r5, [r1, 0x10] cmp r5, 0 bne @08191394 ldr r4, =0x03005e00 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, =0x02022e1c strh r5, [r0] ldr r1, =0x02022e1e 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 .pool @08191394: cmp r5, 0x2 bne @081913E4 ldr r4, =0x03005e00 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, =0x02022e1c movs r0, 0 strh r0, [r1] ldr r1, =0x02022e1e 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 .pool @081913E4: ldr r1, =0x02022e1c movs r4, 0x80 lsls r4, 1 adds r0, r4, 0 strh r0, [r1] ldr r1, =0x02022e1e movs r0, 0 strh r0, [r1] ldr r1, =0x03005e00 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, =0x0203cd78 mov r10, r0 ldr r3, =0x02020630 mov r0, r9 add r0, r8 lsls r0, 3 ldr r1, =0x03005e00 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, =sub_81907F8 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 .pool @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, =sub_81909CC 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, =0x0203cd78 mov r12, r2 ldr r3, =0x02020630 ldr r1, =0x03005e00 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, =sub_81907F8 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 .pool @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, =sub_81909CC 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, =0x03005e00 adds r0, r3 movs r2, 0 movs r1, 0x5 bl @08191FE8 .align 2, 0 .pool @081915CC: mov r0, r9 add r0, r8 lsls r0, 3 ldr r4, =0x03005e00 adds r0, r4 movs r5, 0xC ldrsh r2, [r0, r5] cmp r2, 0 beq @0819160C ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r2, =0x02022e18 movs r6, 0x80 lsls r6, 1 adds r0, r6, 0 strh r0, [r2] ldr r0, =0x02022e1a strh r1, [r0] b @08191622 .align 2, 0 .pool @0819160C: ldr r1, =0x02022e14 movs r3, 0x80 lsls r3, 1 adds r0, r3, 0 strh r0, [r1] ldr r0, =0x02022e16 strh r2, [r0] ldr r0, =0x02022e18 strh r2, [r0] ldr r0, =0x02022e1a strh r2, [r0] @08191622: ldr r0, =0x0203cd78 ldr r4, [r0] ldrb r0, [r4, 0x10] cmp r0, 0 bne @08191688 ldr r1, =0x02022e1c movs r4, 0x80 lsls r4, 1 adds r0, r4, 0 strh r0, [r1] ldr r1, =0x02022e1e movs r0, 0xA0 strh r0, [r1] ldr r3, =gUnknown_0860D080 ldr r2, =0x03005e00 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 .pool @08191688: ldr r1, =0x02022e1c movs r6, 0x80 lsls r6, 1 adds r0, r6, 0 strh r0, [r1] ldr r1, =0x02022e1e movs r0, 0 strh r0, [r1] ldr r3, =gUnknown_0860D15C ldr r2, =0x03005e00 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, =0x0203cd78 mov r10, r0 ldr r3, =0x02020630 mov r0, r9 add r0, r8 lsls r0, 3 ldr r1, =0x03005e00 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, =sub_8190860 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 .pool @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, =sub_8190A48 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, =0x0203cd78 mov r12, r2 ldr r3, =0x02020630 ldr r1, =0x03005e00 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, =sub_8190860 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 .pool @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, =sub_8190A48 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, =0x03005e00 adds r0, r3 movs r2, 0 movs r1, 0x6 b @08191FE8 .align 2, 0 .pool @0819187C: mov r0, r9 add r0, r8 lsls r0, 3 ldr r4, =0x03005e00 adds r0, r4 movs r5, 0xC ldrsh r2, [r0, r5] cmp r2, 0 beq @081918BC ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r2, =0x02022e18 movs r6, 0x80 lsls r6, 1 adds r0, r6, 0 strh r0, [r2] ldr r0, =0x02022e1a strh r1, [r0] b @081918D2 .align 2, 0 .pool @081918BC: ldr r1, =0x02022e14 movs r3, 0x80 lsls r3, 1 adds r0, r3, 0 strh r0, [r1] ldr r0, =0x02022e16 strh r2, [r0] ldr r0, =0x02022e18 strh r2, [r0] ldr r0, =0x02022e1a strh r2, [r0] @081918D2: ldr r0, =0x0203cd78 ldr r2, [r0] ldrb r0, [r2, 0x10] cmp r0, 0 bne @08191924 ldr r1, =0x02022e1c movs r4, 0x80 lsls r4, 1 adds r0, r4, 0 strh r0, [r1] ldr r1, =0x02022e1e movs r0, 0xA0 strh r0, [r1] ldr r1, =0x03005e00 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 .pool @08191924: ldr r1, =0x02022e1c movs r0, 0 strh r0, [r1] ldr r1, =0x02022e1e movs r0, 0xA0 strh r0, [r1] ldr r1, =0x03005e00 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, =0x0203cd78 mov r10, r0 ldr r3, =0x02020630 mov r0, r9 add r0, r8 lsls r0, 3 ldr r1, =0x03005e00 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, =sub_8190860 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 .pool @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, =sub_8190A48 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, =0x0203cd78 mov r12, r2 ldr r3, =0x02020630 ldr r1, =0x03005e00 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, =sub_8190860 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 .pool @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, =sub_8190A48 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, =0x03005e00 adds r0, r3 movs r2, 0 movs r1, 0x6 b @08191FE8 .align 2, 0 .pool @08191B08: mov r0, r9 add r0, r8 lsls r0, 3 ldr r4, =0x03005e00 adds r0, r4 movs r5, 0xC ldrsh r2, [r0, r5] cmp r2, 0 beq @08191B48 ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r2, =0x02022e18 movs r6, 0xFF lsls r6, 8 adds r0, r6, 0 strh r0, [r2] ldr r0, =0x02022e1a strh r1, [r0] b @08191B5E .align 2, 0 .pool @08191B48: ldr r1, =0x02022e14 movs r3, 0xFF lsls r3, 8 adds r0, r3, 0 strh r0, [r1] ldr r0, =0x02022e16 strh r2, [r0] ldr r0, =0x02022e18 strh r2, [r0] ldr r0, =0x02022e1a strh r2, [r0] @08191B5E: ldr r0, =0x0203cd78 ldr r0, [r0] ldrb r0, [r0, 0x10] cmp r0, 0x1 bne @08191B94 ldr r1, =0x02022e1c movs r0, 0 strh r0, [r1] ldr r1, =0x02022e1e movs r0, 0xA0 strh r0, [r1] b @08191B9E .align 2, 0 .pool @08191B94: ldr r0, =0x02022e1c movs r1, 0 strh r1, [r0] ldr r0, =0x02022e1e strh r1, [r0] @08191B9E: ldr r4, =gUnknown_0860D15C ldr r5, =0x0203cd78 ldr r3, [r5] ldr r2, =0x03005e00 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, =0x02020630 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, =sub_81908CC 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 .pool @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, =sub_8190AC4 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, =0x0203cd78 mov r12, r2 ldr r3, =0x02020630 ldr r1, =0x03005e00 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, =sub_81908CC 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 .pool @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, =sub_8190AC4 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 .pool @08191D68: mov r0, r9 add r0, r8 lsls r0, 3 ldr r4, =0x03005e00 adds r0, r4 movs r5, 0xC ldrsh r2, [r0, r5] cmp r2, 0 beq @08191DA8 ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r2, =0x02022e18 movs r6, 0xFF lsls r6, 8 adds r0, r6, 0 strh r0, [r2] ldr r0, =0x02022e1a strh r1, [r0] b @08191DBE .align 2, 0 .pool @08191DA8: ldr r1, =0x02022e14 movs r3, 0xFF lsls r3, 8 adds r0, r3, 0 strh r0, [r1] ldr r0, =0x02022e16 strh r2, [r0] ldr r0, =0x02022e18 strh r2, [r0] ldr r0, =0x02022e1a strh r2, [r0] @08191DBE: ldr r0, =0x0203cd78 ldr r2, [r0] ldrb r0, [r2, 0x10] cmp r0, 0x2 bne @08191E10 ldr r1, =0x02022e1c movs r4, 0x80 lsls r4, 1 adds r0, r4, 0 strh r0, [r1] ldr r1, =0x02022e1e movs r0, 0xA0 strh r0, [r1] ldr r1, =0x03005e00 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 .pool @08191E10: ldr r1, =0x02022e1c movs r0, 0 strh r0, [r1] ldr r1, =0x02022e1e movs r0, 0xA0 strh r0, [r1] ldr r1, =0x03005e00 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, =0x0203cd78 mov r10, r0 ldr r3, =0x02020630 mov r0, r9 add r0, r8 lsls r0, 3 ldr r1, =0x03005e00 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, =sub_81908CC 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 .pool @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, =sub_8190AC4 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, =0x0203cd78 mov r12, r2 ldr r3, =0x02020630 ldr r1, =0x03005e00 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, =sub_81908CC 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 .pool @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, =sub_8190AC4 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, =0x03005e00 adds r0, r3 movs r2, 0 movs r1, 0x7 @08191FE8: strh r1, [r0, 0x8] strh r2, [r0, 0x12] b @08192202 .align 2, 0 .pool @08191FF8: mov r4, r8 lsls r0, r4, 2 add r0, r8 lsls r0, 3 ldr r5, =0x03005e00 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, =0x02022e16 ldrh r0, [r1] subs r0, 0x4 strh r0, [r1] ldr r1, =0x02022e1a ldrh r0, [r1] subs r0, 0x4 strh r0, [r1] ldr r1, =0x02022e1e b @081920A4 .align 2, 0 .pool @08192038: mov r6, r8 lsls r0, r6, 2 add r0, r8 lsls r0, 3 ldr r2, =0x03005e00 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, =0x02022e16 ldrh r0, [r1] adds r0, 0x4 strh r0, [r1] ldr r1, =0x02022e1a ldrh r0, [r1] adds r0, 0x4 strh r0, [r1] ldr r1, =0x02022e1e b @081920E8 .align 2, 0 .pool @08192078: mov r3, r8 lsls r0, r3, 2 add r0, r8 lsls r0, 3 ldr r4, =0x03005e00 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, =0x02022e14 ldrh r0, [r1] subs r0, 0x4 strh r0, [r1] ldr r1, =0x02022e18 ldrh r0, [r1] subs r0, 0x4 strh r0, [r1] ldr r1, =0x02022e1c @081920A4: ldrh r0, [r1] subs r0, 0x4 strh r0, [r1] b @08192202 .align 2, 0 .pool @081920BC: mov r5, r8 lsls r0, r5, 2 add r0, r8 lsls r0, 3 ldr r6, =0x03005e00 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, =0x02022e14 ldrh r0, [r1] adds r0, 0x4 strh r0, [r1] ldr r1, =0x02022e18 ldrh r0, [r1] adds r0, 0x4 strh r0, [r1] ldr r1, =0x02022e1c @081920E8: ldrh r0, [r1] adds r0, 0x4 strh r0, [r1] b @08192202 .align 2, 0 .pool @08192100: movs r0, 0x2 strh r0, [r1, 0x8] b @08192202 @08192106: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08192202 movs r6, 0 ldr r4, =0x0203cd78 @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 .pool @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, =0x02020630 adds r0, r1 bl sub_80D2EF8 @0819214E: adds r6, 0x1 cmp r6, 0x7 ble @08192116 movs r6, 0x8 ldr r4, =0x0203cd78 @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 .pool @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, =0x02020630 adds r0, r1 bl sub_80D2EF8 @0819218E: adds r6, 0x1 cmp r6, 0xF ble @08192158 bl sub_80D2F9C ldr r4, =0x0203cd78 ldr r0, [r4] bl free movs r5, 0 str r5, [r4] bl Window_FreeMemory mov r0, r9 cmp r0, 0 bne @081921C4 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 b @081921FC .align 2, 0 .pool @081921C4: ldr r0, =sub_8194220 movs r1, 0 bl AddTask lsls r0, 24 lsrs r6, r0, 24 ldr r2, =0x03005e00 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 .pool 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, =0x03005e00 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, =gUnknown_0860D080 adds r0, r5, r0 ldrb r0, [r0] mov r10, r0 ldr r3, =0x03005d90 ldr r0, [r3] ldr r1, =0x00000cb2 adds r0, r1 ldrh r0, [r0] mov r8, r0 ldr r1, =0x030022c0 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, =0x0203cd78 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 .pool @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, =0x0203cd78 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 .pool @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, =0x0203cd78 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 .pool @08192304: ldrh r1, [r2, 0x2E] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08192360 ldr r2, =0x03005d90 ldr r0, [r2] mov r3, r10 lsls r1, r3, 2 adds r0, r1 ldr r2, =0x00000d25 adds r0, r2 ldrb r3, [r0] lsls r0, r3, 29 mov r12, r1 cmp r0, 0 bge @0819233C ldr r0, =0x0203cd78 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, =0x03005d90 ldr r0, [r3] add r0, r12 ldr r1, =0x00000d25 adds r0, r1 ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @08192360 ldr r0, =0x0203cd78 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, =0x0203cd78 ldr r3, [r0] ldrb r0, [r3, 0x10] cmp r0, 0 beq @081923A0 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 ldr r2, =0x03005e00 adds r1, r2 ldr r2, =gUnknown_0860D1A0 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 .pool @081923A0: lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r3, =0x03005e00 adds r0, r3 b @0819249E .align 2, 0 .pool @081923B0: movs r0, 0x40 ands r0, r4 cmp r0, 0 beq @081923DE ldr r0, =0x0203cd78 ldr r0, [r0] ldrb r0, [r0, 0x10] cmp r0, 0x1 bne @081923DE cmp r5, 0x10 bne @081923D8 ldr r0, =gUnknown_0860D19C add r0, r8 ldrb r5, [r0] b @081923DA .align 2, 0 .pool @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, =0x0203cd78 ldr r0, [r0] ldrb r0, [r0, 0x10] cmp r0, 0x1 bne @0819240E ldr r0, =gUnknown_0860D19C add r0, r8 ldrb r0, [r0] cmp r5, r0 bne @08192408 movs r5, 0x10 b @0819240A .align 2, 0 .pool @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, =0x0203cd78 ldr r1, [r0] ldrb r0, [r1, 0x10] cmp r0, 0 beq @0819242C movs r7, 0x7 subs r0, 0x1 b @08192444 .align 2, 0 .pool @0819242C: ldrh r1, [r2, 0x2E] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @08192446 ldr r0, =0x0203cd78 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, =0x0203cd78 ldr r0, [r0] ldrb r1, [r0, 0x10] cmp r1, 0 bne @08192470 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 ldr r2, =0x03005e00 adds r1, r2 ldr r2, =gUnknown_0860D1C0 ldrb r0, [r0, 0x11] b @08192482 .align 2, 0 .pool @08192470: cmp r1, 0x2 bne @08192494 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 ldr r3, =0x03005e00 adds r1, r3 ldr r2, =gUnknown_0860D1C0 ldrb r0, [r0, 0x12] @08192482: adds r0, r2 ldrb r0, [r0] strh r0, [r1, 0xA] b @081924A0 .align 2, 0 .pool @08192494: lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e00 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, =0x03005e00 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 .pool 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, =0x03005d90 ldr r1, [r0] ldr r3, [sp, 0x20] lsls r0, r3, 2 adds r0, r1, r0 ldr r2, =0x00000d24 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, =0xffffff00 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, =0x000003ff 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 .pool @08192598: ldr r0, =0x000003fe ldr r3, [sp, 0x24] cmp r3, r0 bne @081925AC bl sub_8195910 b @081925B2 .align 2, 0 .pool @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, =0x0000ffff str r1, [sp, 0x4] movs r1, 0x1 bl sub_818D8AC ldr r1, =0x0203cd78 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, =0x02020630 ldr r0, =0x0203cd78 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, =0x0203cd78 ldr r2, =0x02020630 mov r10, r2 adds r4, r1, 0 lsls r5, r0, 1 movs r3, 0 mov r9, r3 @08192624: ldr r0, =0x000003ff ldr r1, [sp, 0x24] cmp r1, r0 bne @08192660 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000d64 adds r0, r2 adds r0, r5 ldrh r0, [r0] ldr r1, =gUnknown_0860D340 adds r1, r7, r1 ldrb r2, [r1] ldr r3, [sp, 0x2C] orrs r2, r3 b @081926B0 .align 2, 0 .pool @08192660: ldr r0, =0x000003fe ldr r3, [sp, 0x24] cmp r3, r0 bne @08192690 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000d64 adds r0, r1 adds r0, r5 ldrh r0, [r0] ldr r1, =gUnknown_0860D340 adds r1, r7, r1 ldrb r2, [r1] ldr r3, [sp, 0x2C] orrs r2, r3 b @081926B0 .align 2, 0 .pool @08192690: ldr r0, =0x03005d90 ldr r0, [r0] ldr r3, =0x00000d64 adds r0, r3 adds r0, r5 ldrh r1, [r0] ldr r0, =0x0203bc8c ldr r0, [r0] lsls r1, 4 adds r1, r0 ldrh r0, [r1] ldr r1, =gUnknown_0860D340 adds r1, r7, r1 ldrb r2, [r1] ldr r1, [sp, 0x2C] orrs r2, r1 @081926B0: ldr r1, =gUnknown_0860D343 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, =sub_8190938 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, =0x000003ff ldr r4, [sp, 0x24] cmp r4, r0 bne @08192784 ldr r0, =gTrainerClassNameIndices adds r0, 0x3C ldrb r5, [r0] b @081927A2 .align 2, 0 .pool @08192784: ldr r0, =0x000003fe ldr r1, [sp, 0x24] cmp r1, r0 bne @08192798 bl sub_8195924 b @0819279E .align 2, 0 .pool @08192798: ldr r0, [sp, 0x24] bl sub_8162BD8 @0819279E: lsls r0, 24 lsrs r5, r0, 24 @081927A2: ldr r2, =gTrainerClassNames 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, =0x02021cc4 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, =0x02021cc4 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, =0x000003ff ldr r2, [sp, 0x24] cmp r2, r0 bne @08192800 ldr r0, =0x03005d90 ldr r1, [r0] adds r0, r5, 0 bl gf_strcat b @08192836 .align 2, 0 .pool @08192800: ldr r0, =0x000003fe ldr r3, [sp, 0x24] cmp r3, r0 bne @08192824 ldr r4, =0x02021dc4 adds r0, r4, 0 bl sub_8195938 adds r0, r5, 0 adds r1, r4, 0 bl gf_strcat b @08192836 .align 2, 0 .pool @08192824: ldr r4, =0x02021dc4 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, =0x02021cc4 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, =gUnknown_0860D346 adds r0, r7, r0 ldrb r0, [r0] strb r0, [r6, 0x9] ldr r0, =0x000003ff ldr r4, [sp, 0x24] cmp r4, r0 bne @081928C0 ldr r0, =0x03005d90 ldr r1, [r0] lsls r0, r7, 1 add r0, r9 ldr r2, =0x00000d64 adds r1, r2 b @081928FA .align 2, 0 .pool @081928C0: ldr r0, =0x000003fe ldr r4, [sp, 0x24] cmp r4, r0 bne @081928E4 ldr r0, =0x03005d90 ldr r1, [r0] lsls r0, r7, 1 add r0, r9 ldr r2, =0x00000d64 adds r1, r2 b @081928FA .align 2, 0 .pool @081928E4: ldr r4, =0x03005d90 ldr r1, [r4] lsls r0, r7, 1 add r0, r9 ldr r2, =0x00000d64 adds r1, r2 adds r1, r0 ldrh r1, [r1] ldr r0, =0x0203bc8c 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, =gSpeciesNames 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 .pool @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, =0x000003fe ldr r1, [sp, 0x24] cmp r1, r0 bne @08192980 ldr r0, =gUnknown_0860D1D0 ldr r0, [r0, 0x40] b @0819298A .align 2, 0 .pool @08192980: ldr r0, =gUnknown_0860D1D0 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, =gUnknown_0860B358 @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, =0x000003fe 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 .pool @08192A00: ldr r0, =0x000003ff ldr r1, [sp, 0x24] cmp r1, r0 bne @08192A20 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000efc adds r0, r1 add r0, r9 b @08192A48 .align 2, 0 .pool @08192A20: ldr r0, =0x03005d90 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, =0x00000d64 add r1, r12 adds r1, r0 ldrh r0, [r1] ldr r1, =0x0203bc8c 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, =gUnknown_0860D214 mov r9, r2 ldr r3, =gUnknown_0860C988 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, =0xfffffc02 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, =0x000003fe 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 .pool @08192B24: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r7, 4 adds r1, r5, r1 ldr r2, =0x00000f04 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, =0x000003fe 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 .pool @08192B70: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r7, 4 adds r0, r1 ldr r3, =0x00000f0a adds r0, r3 ldrb r2, [r0] @08192B7E: ldr r1, =gNatureStatTable 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 .pool @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, =0x0203bc8c 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, =0x03005d90 ldr r0, [r3] ldr r4, =0x00000d64 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, =0x03005d90 ldr r0, [r3] ldr r4, =0x00000d64 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, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000d64 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, =gNatureStatTable 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 .pool @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, =gUnknown_0860D349 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 .pool @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, =gUnknown_0860D349 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 .pool @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, =gUnknown_0860D294 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 .pool 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, =gUnknown_0860D3C4 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, =0x03005d90 ldr r1, =0x000003ff mov r10, r1 ldr r2, =0x000003fe mov r9, r2 @08192F42: ldr r0, =gUnknown_0860D3B4 adds r0, r6, r0 ldrb r4, [r0] ldr r0, [r5] lsls r1, r4, 2 adds r0, r1 ldr r2, =0x00000d25 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, =0x00000d24 adds r0, r1 ldrh r0, [r0] lsls r1, r0, 22 lsrs r0, r1, 22 cmp r0, r10 bne @08192F9C ldr r0, =0x02021cc4 adds r1, r2, 0 bl gf_strcpy b @08192FB8 .align 2, 0 .pool @08192F9C: lsrs r0, r1, 22 cmp r0, r9 bne @08192FB0 ldr r0, =0x02021cc4 bl sub_8195938 b @08192FB8 .align 2, 0 .pool @08192FB0: lsrs r1, 22 ldr r0, =0x02021cc4 bl sub_8195898 @08192FB8: movs r2, 0x1 add r8, r2 ldr r3, =gUnknown_0860D3C4 @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 .pool @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, =0x03005d90 mov r10, r5 ldr r0, =0x00000d25 mov r9, r0 @0819300E: ldr r0, =gUnknown_0860D3B4 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, =gMoveNames adds r1, r0 ldr r0, =0x02021dc4 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 .pool @081930BC: ldr r5, =0x00000d24 adds r0, r2, r5 ldrh r0, [r0] lsls r1, r0, 22 ldr r0, =0xffc00000 cmp r1, r0 bne @081930E0 ldr r0, =0x02021cc4 adds r1, r3, 0 bl gf_strcpy b @08193100 .align 2, 0 .pool @081930E0: ldr r0, =0xff800000 cmp r1, r0 bne @081930F8 ldr r0, =0x02021cc4 bl sub_8195938 b @08193100 .align 2, 0 .pool @081930F8: lsrs r1, 22 ldr r0, =0x02021cc4 bl sub_8195898 @08193100: mov r0, r8 cmp r0, 0x2 beq @08193126 adds r6, 0x1 ldr r1, =gUnknown_0860D3C4 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 .pool @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, =0xffffff00 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, =0x0203cd78 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, =0x03005d90 ldr r4, [r0] ldr r0, =gUnknown_0860D3C6 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, =0x00000d24 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, =0x00000d25 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 .pool @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, =0x000003ff cmp r1, r0 bne @081932D4 ldr r0, =0x03005d90 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 .pool @081932D4: ldr r0, =0x000003fe cmp r1, r0 bne @081932E4 bl sub_8195910 b @081932EC .align 2, 0 .pool @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, =0x0000ffff str r1, [sp, 0x4] movs r1, 0x1 bl sub_818D8AC ldr r1, =0x0203cd78 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, =0x02020630 ldr r0, =0x0203cd78 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, =0x02020630 ldr r0, =0x0203cd78 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, =0x000003ff cmp r1, r0 bne @08193388 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] bl sub_806F000 lsls r0, 16 lsrs r0, 16 b @081933B0 .align 2, 0 .pool @08193388: ldr r0, =0x000003fe 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 .pool @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, =0x0000ffff str r1, [sp, 0x4] movs r1, 0x1 bl sub_818D8AC ldr r1, =0x0203cd78 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, =0x02020630 ldr r0, =0x0203cd78 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, =0x02020630 ldr r0, =0x0203cd78 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, =0x0203cd78 ldr r7, =0x02020630 ldr r4, [sp, 0x54] mov r9, r5 movs r0, 0x1 mov r10, r0 @0819342C: ldr r1, [sp, 0x24] ldr r0, =0x000003ff cmp r1, r0 bne @08193464 ldr r0, =0x03005d90 ldr r2, [r0] ldr r1, [sp, 0x1C] lsls r0, r1, 1 adds r0, r1 lsls r0, 1 add r0, r9 ldr r1, =0x00000d64 adds r2, r1 adds r2, r0 ldrh r0, [r2] b @081934B0 .align 2, 0 .pool @08193464: ldr r0, =0x000003fe cmp r1, r0 bne @08193490 ldr r0, =0x03005d90 ldr r2, [r0] ldr r1, [sp, 0x1C] lsls r0, r1, 1 adds r0, r1 lsls r0, 1 add r0, r9 ldr r1, =0x00000d64 adds r2, r1 adds r2, r0 ldrh r0, [r2] b @081934B0 .align 2, 0 .pool @08193490: ldr r0, =0x03005d90 ldr r2, [r0] ldr r1, [sp, 0x1C] lsls r0, r1, 1 adds r0, r1 lsls r0, 1 add r0, r9 ldr r1, =0x00000d64 adds r2, r1 adds r2, r0 ldrh r1, [r2] ldr r0, =0x0203bc8c ldr r0, [r0] lsls r1, 4 adds r1, r0 ldrh r0, [r1] @081934B0: ldr r1, =gUnknown_0860D3A8 adds r1, r5, r1 ldrb r2, [r1] ldr r3, [sp, 0x40] orrs r2, r3 ldr r1, =gUnknown_0860D3AB 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, =sub_8190938 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, =0x0203cd78 ldr r7, =0x02020630 mov r8, r7 ldr r4, [sp, 0x5C] mov r9, r5 movs r7, 0 @08193564: ldr r0, [sp, 0x4C] ldr r1, [r0, 0x4] ldr r0, =0x000003ff cmp r1, r0 bne @081935AC ldr r0, =0x03005d90 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, =0x00000d64 adds r2, r1 adds r2, r0 ldrh r0, [r2] b @081935FA .align 2, 0 .pool @081935AC: ldr r0, =0x000003fe cmp r1, r0 bne @081935D8 ldr r0, =0x03005d90 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, =0x00000d64 adds r2, r1 adds r2, r0 ldrh r0, [r2] b @081935FA .align 2, 0 .pool @081935D8: ldr r0, =0x03005d90 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, =0x00000d64 adds r2, r1 adds r2, r0 ldrh r1, [r2] ldr r0, =0x0203bc8c ldr r0, [r0] lsls r1, 4 adds r1, r0 ldrh r0, [r1] @081935FA: ldr r1, =gUnknown_0860D3AE adds r1, r5, r1 ldrb r2, [r1] ldr r3, [sp, 0x40] orrs r2, r3 ldr r1, =gUnknown_0860D3B1 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, =sub_8190938 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, =0x02021fc4 ldr r0, =gUnknown_0860D38C 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, =0x000003ff cmp r1, r0 bne @0819375C ldr r0, =0x02021cc4 ldr r1, =0x03005d90 ldr r1, [r1] bl gf_strcpy b @0819377E .align 2, 0 .pool @0819375C: ldr r0, =0x000003fe cmp r1, r0 bne @08193774 ldr r0, =0x02021cc4 bl sub_8195938 b @0819377E .align 2, 0 .pool @08193774: ldr r0, =0x02021cc4 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, =0x02021cc4 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, =0x000003ff cmp r1, r0 bne @081937E4 ldr r0, =0x03005d90 ldr r1, [r0] adds r0, r5, 0 bl gf_strcpy b @08193802 .align 2, 0 .pool @081937E4: ldr r0, =0x000003fe cmp r1, r0 bne @081937F8 adds r0, r5, 0 bl sub_8195938 b @08193802 .align 2, 0 .pool @081937F8: lsls r1, 16 lsrs r1, 16 adds r0, r5, 0 bl sub_8195898 @08193802: ldr r0, =0x02021cc4 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, =gUnknown_0860D350 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 .pool thumb_func_end sub_819314C thumb_func_start sub_81938A4 sub_81938A4: ; 81938A4 push {lr} ldr r0, =sub_8194220 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0 strh r2, [r1, 0x8] strh r2, [r1, 0xA] movs r0, 0x2 strh r0, [r1, 0xC] strh r2, [r1, 0x10] ldr r0, =sub_8194B54 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81938A4 thumb_func_start sub_81938E0 sub_81938E0: ; 81938E0 push {r4,lr} bl sub_8194D48 ldr r4, =0x03005d90 ldr r2, [r4] ldr r1, =0x00000d0a adds r0, r2, r1 ldrb r1, [r0] subs r1, 0x1 ldr r0, =0x00000ca9 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, =0x00000cb2 adds r0, r1 movs r4, 0 movs r1, 0x3 strh r1, [r0] ldr r0, =sub_8194220 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] strh r4, [r1, 0xA] movs r0, 0x2 strh r0, [r1, 0xC] movs r0, 0x1 strh r0, [r1, 0x10] ldr r0, =sub_8194B54 bl set_callback2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =@08193990 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08193990: .4byte @081939B0 .4byte @08193A00 .4byte @08193A20 .4byte @08193AA8 .4byte @08193BC2 .4byte @08193B20 .4byte @08193BC2 .4byte @08193B84 @081939B0: ldr r0, =0x02037fd4 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, =0x03005e00 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, =0x02020630 adds r0, r1 movs r1, 0x1 bl obj_anim_image_start b @08193BC2 .align 2, 0 .pool @08193A00: ldr r0, =0x02037fd4 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 .pool @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, =0x03005e00 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 .pool @08193A60: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 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 .pool @08193A84: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 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 .pool @08193AA8: ldr r0, =0x02037fd4 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, =0x0203cd7c ldr r0, [r4] bl free str r6, [r4] ldr r0, =sub_8190400 movs r1, 0 bl AddTask lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x03005e00 lsls r1, r3, 2 adds r1, r3 lsls r1, 3 adds r1, r2 movs r3, 0 strh r6, [r1, 0x8] ldr r0, =gUnknown_0860D080 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, =0x0203cd78 ldr r0, [r0] strb r3, [r0, 0x10] b @08193BC2 .align 2, 0 .pool @08193B20: ldr r0, =0x02037fd4 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, =0x0203cd7c ldr r0, [r4] bl free str r6, [r4] ldr r0, =sub_8190400 movs r1, 0 bl AddTask lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x03005e00 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 .pool @08193B84: ldr r0, =0x02037fd4 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, =0x0203cd7c ldr r0, [r4] bl free str r6, [r4] ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 ldr r1, =0x03005e00 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 .pool 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 movs r1, 0xA ldrsh r5, [r0, r1] ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 ldrh r6, [r0] ldr r0, =0x030022c0 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 .pool @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, =gUnknown_0860CBF1 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 .pool @08193C78: ldrh r0, [r3, 0x2E] cmp r0, 0x80 bne @08193C9C ldr r0, =gUnknown_0860CBF1 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 .pool @08193C9C: ldrh r0, [r3, 0x2E] cmp r0, 0x20 bne @08193CC0 ldr r0, =gUnknown_0860CBF1 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 .pool @08193CC0: ldrh r0, [r3, 0x2E] cmp r0, 0x10 bne @08193CDE ldr r0, =gUnknown_0860CBF1 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, =0x02020630 adds r0, r4 movs r1, 0 bl obj_anim_image_start ldr r2, =gUnknown_0860CBF1 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, =0x03005e00 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 .pool thumb_func_end sub_8193BDC thumb_func_start sub_8193D40 sub_8193D40: ; 8193D40 push {lr} ldr r0, =sub_8194220 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r2, 0 strh r2, [r1, 0x8] movs r0, 0x1 strh r0, [r1, 0xA] movs r0, 0x2 strh r0, [r1, 0xC] strh r2, [r1, 0x10] ldr r0, =sub_8194B54 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8193D40 thumb_func_start sub_8193D7C sub_8193D7C: ; 8193D7C push {r4-r7,lr} mov r7, r8 push {r7} ldr r7, =0x020375e2 ldrh r0, [r7] cmp r0, 0x1 bne @08193E10 ldr r5, =0x02038bca ldrh r0, [r5] bl sub_8195358 ldr r4, =0x03005d90 ldr r2, [r4] lsls r0, 2 adds r2, r0 ldr r6, =0x00000d25 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, =0x00000cb2 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, =0x03005d10 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 .pool @08193E10: ldr r5, =0x000003ff adds r0, r5, 0 bl sub_8195358 ldr r4, =0x03005d90 ldr r2, [r4] lsls r0, 2 adds r2, r0 ldr r6, =0x00000d25 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, =0x00000cb2 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, =0x03005d10 ldrh r0, [r0, 0x24] strh r0, [r1] ldr r0, =0x0202433a 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb2 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 .pool 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, =0x03005d90 ldr r3, [r0] ldr r1, [sp, 0x6C] adds r0, r3, r1 ldr r2, =0x00000d24 adds r0, r2 ldrh r0, [r0] lsls r0, 22 ldr r1, =0xff800000 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 .pool @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, =0x00000d64 adds r1, r3, r5 adds r1, r0 ldrh r0, [r1] ldr r1, =0x0203bc8c 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, =gBattleMoves 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 .pool @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, =0x03005d90 ldr r0, [r2] ldr r4, =0x00000d64 adds r0, r4 add r0, r8 ldrh r4, [r0] ldr r3, =0x0203bc8c ldr r0, [r3] lsls r4, 4 adds r4, r0 adds r0, r5, 0 str r2, [sp, 0x7C] str r3, [sp, 0x80] bl GetNatureFromPersonality 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, =0x00000d64 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, =gBaseStats adds r0, r5 ldrb r2, [r0, 0x17] b @08194074 .align 2, 0 .pool @08194068: lsls r0, r1, 3 subs r0, r1 lsls r0, 2 ldr r2, =gBaseStats 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 .pool @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, =0x03005d90 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 .pool 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, =0x03005e00 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, =@08194264 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x05006000 bl CpuSet movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_0860CE74 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r0, =gUnknown_0860CE94 bl Window_InitFromTemplates bl TextBox_ResetSomeField ldr r0, =0x02022e14 strh r4, [r0] ldr r0, =0x02022e16 strh r4, [r0] ldr r0, =0x02022e18 strh r4, [r0] ldr r0, =0x02022e1a 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, =0x03005e00 mov r2, r8 lsls r0, r2, 2 b @0819443C .align 2, 0 .pool @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, =0x00005860 movs r0, 0x40 bl lcd_io_set movs r0, 0x44 movs r1, 0x9F bl lcd_io_set ldr r1, =0x00009098 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, =0x03005e00 mov r3, r8 lsls r0, r3, 2 b @0819443C .align 2, 0 .pool @0819438C: ldr r4, =0x0203cd7c movs r0, 0x80 lsls r0, 4 bl malloc_and_clear adds r1, r0, 0 str r1, [r4] ldr r0, =gUnknown_08D83900 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, =gUnknown_08D82F10 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, =gUnknown_08D834FC str r6, [sp] movs r0, 0x2 adds r2, r5, 0 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree ldr r1, =gUnknown_08D83B2C 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, =gUnknown_08D83C3C str r4, [sp] movs r0, 0x3 adds r2, r5, 0 movs r3, 0 bl copy_decompressed_tile_data_to_vram_autofree ldr r0, =gUnknown_08D85358 movs r4, 0x80 lsls r4, 2 movs r1, 0 adds r2, r4, 0 bl decompress_palette ldr r0, =gUnknown_08D85444 movs r1, 0x80 lsls r1, 1 adds r2, r4, 0 bl decompress_palette ldr r0, =gUnknown_08D85600 movs r1, 0xF0 movs r2, 0x20 bl decompress_palette str r6, [sp, 0x18] add r0, sp, 0x18 ldr r1, =0x02037b14 ldr r2, =0x05000100 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, =0x03005e00 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 .pool @0819447C: ldr r0, =gUnknown_0860CF50 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, =gUnknown_0860D411 @08194492: ldrb r1, [r4] ldrb r2, [r4, 0x1] ldr r0, =gUnknown_0860CFA8 movs r3, 0 bl obj_add_from_template_forward_search adds r4, 0x2 adds r5, 0x1 cmp r5, 0x1E bls @08194492 ldr r0, =0x03005e00 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, =gUnknown_0860D008 movs r1, 0xDA movs r2, 0xC movs r3, 0 bl obj_add_from_template_forward_search b @081944E8 .align 2, 0 .pool @081944DC: ldr r0, =gUnknown_0860CFD8 movs r1, 0xDA movs r2, 0xC movs r3, 0 bl obj_add_from_template_forward_search @081944E8: ldr r1, =0x00007f40 movs r0, 0 bl lcd_io_set b @081947A6 .align 2, 0 .pool @081944FC: add r0, sp, 0x4 movs r2, 0 movs r1, 0x2 strb r1, [r0, 0x5] ldr r0, =gUnknown_085CCCEE 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, =0x03005d90 ldr r0, [r3] adds r0, r7 ldr r1, =0x00000d24 adds r0, r1 ldrh r1, [r0] lsls r1, 22 lsrs r1, 22 ldr r0, =0x02022e2c bl sub_8195898 mov r2, r10 cmp r2, 0x1 bne @081945C4 ldr r3, =0x03005d90 ldr r2, [r3] adds r0, r2, r7 ldr r1, =0x00000d25 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 29 cmp r0, 0 blt @081945DC ldr r3, =0x00000cb2 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 .pool @081945C4: mov r3, r10 cmp r3, 0 bne @08194634 ldr r0, =0x03005d90 ldr r2, [r0] adds r0, r2, r7 ldr r1, =0x00000d25 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 .pool @081945FC: ldr r3, =0x00000cb2 adds r1, r2, r3 ldrh r0, [r1] cmp r0, 0 beq @08194634 ldr r0, [sp, 0x1C] add r0, r8 lsls r0, 3 ldr r2, =0x03005e00 adds r0, r2 movs r3, 0x10 ldrsh r0, [r0, r3] cmp r0, 0 beq @08194624 ldrh r1, [r1] b @08194628 .align 2, 0 .pool @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, =0x03005e00 adds r0, r3 movs r1, 0x10 ldrsh r0, [r0, r1] cmp r0, 0 beq @08194660 ldr r2, =0x03005d90 ldr r0, [r2] ldr r3, =0x00000cb2 adds r0, r3 ldrh r3, [r0] adds r6, r2, 0 b @0819466E .align 2, 0 .pool @08194660: ldr r1, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000cb2 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, =0x00000d25 adds r0, r1 ldrb r1, [r0] lsls r1, 27 lsrs r1, 30 ldr r0, =0x00000cb2 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, =0x00000d25 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, =0x00000d25 adds r0, r1, r3 ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @081946FA ldr r2, =0x00000d24 adds r0, r1, r2 ldrh r0, [r0] lsls r0, 22 lsrs r0, 22 ldr r3, =0x000003ff 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 .pool @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, =0x00000d24 adds r0, r1 ldrh r0, [r0] lsls r0, 22 lsrs r0, 22 ldr r2, =0x000003ff 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 .pool @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, =gUnknown_0860D3F1 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, =0x02022e2c movs r2, 0x3D bl sub_81DB384 b @0819476A .align 2, 0 .pool @08194768: movs r0, 0x3 @0819476A: strb r0, [r4, 0x8] ldr r0, =0x02022e2c str r0, [sp, 0x4] ldr r0, =gUnknown_0860D3F1 ldr r1, [sp, 0x20] adds r0, r1, r0 ldrb r0, [r0] strb r0, [r4, 0x4] ldr r2, =gUnknown_0860D3F2 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, =0x03005e00 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 .pool @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, =sub_8194BEC bl SetHBlankCallback ldr r0, =sub_8194CE4 bl SetVBlankCallback cmp r4, 0x2 bne @0819485C mov r2, r10 cmp r2, 0 bne @08194844 ldr r0, =sub_819395C movs r1, 0 bl AddTask lsls r0, 24 lsrs r5, r0, 24 ldr r2, =0x03005e00 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 .pool @08194844: ldr r0, =sub_8194950 movs r1, 0 bl AddTask lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 b @0819486C .align 2, 0 .pool @0819485C: ldr r1, =0x03005e00 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, =0x02038c28 ldr r2, =0x00001f0a 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, =gUnknown_0860CF44 ldr r0, =0x02038c28 ldr r2, =0x00001f09 ldr r4, =0x00000836 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 .pool 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, =gUnknown_0860DD10 lsls r2, r1, 2 lsls r3, r0, 4 adds r2, r3 adds r2, r4 ldr r3, [r2] ldr r2, =gUnknown_0860DE10 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 .pool 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, =0x03005e00 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, =@08194988 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e00 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 .pool @081949C0: ldr r0, =0x02037fd4 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, =0x02022e2c mov r9, r0 ldr r1, =0x03005d90 mov r8, r1 adds r4, r2, 0 ldr r6, =gUnknown_0860D3F1 movs r5, 0 @08194A1C: mov r2, r8 ldr r0, [r2] adds r0, r5 ldr r1, =0x00000d24 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, =0x00000d25 adds r0, r1 ldrb r3, [r0] lsls r1, r3, 27 lsrs r1, 30 ldr r0, =0x00000cb2 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 .pool @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, =0x00000d25 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 .pool @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, =0x030022c0 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, =0x03005e00 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 .pool @08194B24: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @08194B3C ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music 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 .pool 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, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 bl lcd_io_set ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 bl lcd_io_set ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 bl lcd_io_set ldr r0, =0x02022e1a ldrh r1, [r0] movs r0, 0x16 bl lcd_io_set ldr r0, =0x02022e1c ldrh r1, [r0] movs r0, 0x18 bl lcd_io_set ldr r0, =0x02022e1e 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 .pool thumb_func_end sub_8194B70 thumb_func_start sub_8194BEC sub_8194BEC: ; 8194BEC push {lr} ldr r0, =0x04000006 ldrh r0, [r0] adds r1, r0, 0 cmp r0, 0x29 bls @08194CC8 cmp r0, 0x31 bhi @08194C1C ldr r1, =0x04000048 ldr r2, =0x00003b3b adds r0, r2, 0 strh r0, [r1] subs r1, 0x8 ldr r0, =0x989b5558 b @08194CD4 .align 2, 0 .pool @08194C1C: cmp r0, 0x39 bls @08194CC8 cmp r0, 0x4A bhi @08194C40 ldr r1, =0x04000048 ldr r2, =0x00003b3b adds r0, r2, 0 strh r0, [r1] subs r1, 0x8 ldr r0, =0x90985860 b @08194CD4 .align 2, 0 .pool @08194C40: cmp r0, 0x51 bhi @08194C60 ldr r1, =0x04000048 ldr r2, =0x00003b3b adds r0, r2, 0 strh r0, [r1] subs r1, 0x8 ldr r0, =0x989b5558 b @08194CD4 .align 2, 0 .pool @08194C60: cmp r0, 0x5E bls @08194CC8 cmp r0, 0x66 bhi @08194C84 ldr r1, =0x04000048 ldr r2, =0x00003737 adds r0, r2, 0 strh r0, [r1] subs r1, 0x8 ldr r0, =0x989b5558 b @08194CD4 .align 2, 0 .pool @08194C84: cmp r0, 0x76 bhi @08194CA4 ldr r1, =0x04000048 ldr r2, =0x00003737 adds r0, r2, 0 strh r0, [r1] subs r1, 0x8 ldr r0, =0x90985860 b @08194CD4 .align 2, 0 .pool @08194CA4: cmp r0, 0x7E bls @08194CC8 cmp r1, 0x86 bhi @08194CC8 ldr r1, =0x04000048 ldr r2, =0x00003737 adds r0, r2, 0 strh r0, [r1] subs r1, 0x8 ldr r0, =0x989b5558 b @08194CD4 .align 2, 0 .pool @08194CC8: ldr r1, =0x04000048 ldr r2, =0x00003f3f adds r0, r2, 0 strh r0, [r1] subs r1, 0x8 movs r0, 0 @08194CD4: str r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8194BEC thumb_func_start sub_8194CE4 sub_8194CE4: ; 8194CE4 push {lr} ldr r0, =0x02022e14 ldrh r1, [r0] movs r0, 0x10 bl lcd_io_set ldr r0, =0x02022e16 ldrh r1, [r0] movs r0, 0x12 bl lcd_io_set ldr r0, =0x02022e18 ldrh r1, [r0] movs r0, 0x14 bl lcd_io_set ldr r0, =0x02022e1a 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 .pool thumb_func_end sub_8194CE4 thumb_func_start sub_8194D48 sub_8194D48: ; 8194D48 ldr r1, =0x0203bc8c ldr r0, =gBattleFrontierMons str r0, [r1] ldr r1, =0x0203bc88 ldr r0, =gBattleFrontierTrainers str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005d90 ldr r1, [r0] ldr r0, =0x0203cef8 adds r0, r3, r0 ldrb r0, [r0] subs r0, 0x1 lsls r0, 1 ldr r2, =0x00000caa 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 .pool @08194DBC: adds r5, 0x1 @08194DBE: cmp r5, 0x3 bgt @08194DEA ldr r1, =0x03005d8c 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, =0x020244ec 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, =0x020244ec 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, =0x03005d8c 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, =0x020244ec 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 .pool 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, =0x03005d8c movs r6, 0x64 movs r5, 0 @08194E50: ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x0203cef8 adds r0, r4, r0 ldrb r0, [r0] subs r0, 0x1 lsls r0, 1 ldr r2, =0x00000caa 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, =0x020244ec 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 .pool 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, =0x02038bca ldrh r0, [r0] bl sub_8195358 adds r4, r0, 0 ldr r0, =0x000003ff bl sub_8195358 cmp r4, r0 ble @08194EE8 ldr r1, =0x020375f0 movs r0, 0x1 b @08194EEC .align 2, 0 .pool @08194EE8: ldr r1, =0x020375f0 movs r0, 0x2 @08194EEC: strh r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8194EC0 thumb_func_start sub_8194EF8 sub_8194EF8: ; 8194EF8 push {r4,lr} bl sub_8194D48 movs r2, 0 ldr r3, =0x03005d90 ldr r0, [r3] ldr r1, =0x00000d25 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, =0x02021cc4 ldr r1, =0x03005d90 ldr r1, [r1] lsls r2, 2 adds r1, r2 ldr r2, =0x00000d24 adds r1, r2 ldrh r1, [r1] lsls r1, 22 lsrs r1, 22 bl sub_8195898 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r2, [r4] ldr r5, =0x00000d0a adds r0, r2, r5 ldrb r1, [r0] ldr r6, =0x00000d0b adds r0, r2, r6 ldrb r0, [r0] cmn r1, r0 beq @08194F8C ldr r1, =0x00000ca8 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, =0x00000ca9 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 .pool @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, =0x03005d90 ldr r0, [r2] ldr r3, =0x00000d24 adds r0, r3 ldrh r0, [r0] lsls r0, 22 lsrs r0, 22 cmp r0, r4 beq @08195064 adds r3, r2, 0 ldr r2, =0x00000d24 @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, =0x03005d90 ldr r3, [r5] ldr r0, [sp, 0x38] adds r3, r0 ldr r1, =0x00000d24 adds r3, r1 ldr r2, =0x000003ff adds r0, r2, 0 adds r2, r4, 0 ands r2, r0 ldrh r0, [r3] ldr r5, =0xfffffc00 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x0203bc8c mov r9, r1 ldr r2, [sp, 0x8] mov r8, r2 ldr r3, [sp, 0xC] mov r12, r3 ldr r4, =0x00000d64 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, =0x03005d90 ldr r0, [r3] ldr r4, [sp, 0x28] ldr r2, [sp, 0x3C] adds r1, r4, r2 ldr r3, =0x00000d64 adds r0, r3 adds r0, r1 strh r5, [r0] ldr r2, [sp, 0x2C] add r2, sp adds r2, 0x8 ldr r3, =0x0203bc8c 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, =0x03005d90 ldr r2, [r4] ldr r5, [sp, 0x38] adds r2, r5 ldr r0, =0x00000d25 adds r2, r0 ldrb r0, [r2] movs r4, 0x5 negs r4, r4 adds r1, r4, 0 ands r0, r1 strb r0, [r2] ldr r5, =0x03005d90 ldr r2, [r5] ldr r0, [sp, 0x38] adds r2, r0 ldr r1, =0x00000d25 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, =0x00000d25 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, =0x03005d90 ldr r0, [r1] mov r2, r10 lsls r1, r2, 2 adds r0, r1 ldr r3, =0x00000d24 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, =0x03005d90 ldr r0, [r1] mov r4, r9 add r4, r10 adds r4, r6 lsls r4, 1 ldr r2, =0x00000d64 adds r0, r2 adds r0, r4 ldrh r1, [r0] ldr r3, =0x0203bc8c 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, =0x03005d90 ldr r0, [r3] ldr r1, =0x00000d64 adds r0, r1 adds r0, r4 ldrh r0, [r0] ldr r2, =0x0203bc8c ldr r1, [r2] lsls r0, 4 adds r0, r1 ldrh r0, [r0] lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r3, =gBaseStats adds r1, r3 ldrb r0, [r1, 0x6] lsls r0, 2 ldr r4, =gUnknown_0832A328 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, =0x00000d24 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 .pool @081952C4: cmp r1, r0 bne @081952F0 ldr r0, =0x03005d90 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, =0x03005d90 ldr r1, [r0] ldr r4, =0x00000ca9 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 .pool 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, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000d24 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 .pool 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, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000d24 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 .pool 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, =gUnknown_0860D1A0 ldr r0, =gUnknown_0860D1C0 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 .pool @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, =0x03005d90 ldr r0, [r2] lsls r4, r5, 2 adds r1, r0, r4 ldr r3, =0x00000d25 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, =0xffc00000 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, =0x03005d90 ldr r3, [r0] adds r0, r3, r4 ldr r1, =0x00000d24 adds r0, r1 ldrh r0, [r0] lsls r0, 22 ldr r1, =0xff800000 cmp r0, r1 bne @08195504 ldr r2, [sp, 0x8] cmp r2, 0xFF beq @08195504 lsls r2, 2 adds r1, r3, r2 ldr r3, =0x00000d25 adds r1, r3 ldrb r0, [r1] movs r3, 0x4 orrs r0, r3 strb r0, [r1] ldr r0, =0x03005d90 ldr r1, [r0] adds r1, r2 ldr r2, =0x00000d25 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, =0x03005d90 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 .pool @08195504: ldr r4, =0x03005d90 ldr r3, [r4] ldr r0, [sp, 0x8] lsls r2, r0, 2 adds r0, r3, r2 ldr r1, =0x00000d24 adds r0, r1 ldrh r0, [r0] lsls r0, 22 ldr r1, =0xff800000 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, =0x00000d25 adds r1, r3 ldrb r0, [r1] movs r3, 0x4 orrs r0, r3 strb r0, [r1] ldr r1, [r4] adds r1, r2 ldr r0, =0x00000d25 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 .pool @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, =0x03005d90 ldr r1, [r2] ldr r3, =0x00000d64 adds r1, r3 ldr r2, [sp, 0x38] adds r0, r1, r2 ldrh r0, [r0] ldr r3, =0x0203bc8c 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, =0x03005d90 ldr r0, [r2] ldr r3, =0x00000d64 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, =gBaseStats 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, =0x03005d90 ldr r1, [r5] ldr r0, =0x00000d64 adds r1, r0 mov r2, r8 adds r0, r1, r2 ldrh r0, [r0] ldr r5, =0x0203bc8c 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, =0x03005d90 ldr r0, [r2] ldr r5, [sp, 0x1C] adds r1, r3, r5 ldr r2, =0x00000d64 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, =gBaseStats 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, =0x03005d90 ldr r1, [r3] ldr r5, [sp, 0x30] adds r1, r5 ldr r0, =0x00000d25 adds r1, r0 ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] ldr r1, [r3] adds r1, r5 ldr r3, =0x00000d25 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, =0x03005d90 ldr r1, [r3] movs r5, 0xEC lsls r5, 4 adds r1, r5 ldr r2, [sp, 0x2C] adds r1, r2 b @08195874 .align 2, 0 .pool @08195784: ldr r3, [sp, 0xC] ldr r5, [sp, 0x10] cmp r3, r5 bge @081957DC ldr r0, =0x03005d90 ldr r1, [r0] ldr r3, [sp, 0x4] lsls r2, r3, 2 adds r1, r2 ldr r5, =0x00000d25 adds r1, r5 ldrb r0, [r1] movs r3, 0x4 orrs r0, r3 strb r0, [r1] ldr r5, =0x03005d90 ldr r1, [r5] adds r1, r2 ldr r0, =0x00000d25 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 .pool @081957DC: ldr r3, [sp, 0x4] ldr r5, [sp, 0x8] cmp r3, r5 ble @08195830 ldr r0, =0x03005d90 ldr r1, [r0] ldr r2, [sp, 0x30] adds r1, r2 ldr r3, =0x00000d25 adds r1, r3 ldrb r0, [r1] movs r5, 0x4 orrs r0, r5 strb r0, [r1] ldr r0, =0x03005d90 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, =0x03005d90 ldr r1, [r5] movs r2, 0xEC lsls r2, 4 adds r1, r2 ldr r3, [sp, 0x2C] b @08195872 .align 2, 0 .pool @08195830: ldr r5, =0x03005d90 ldr r1, [r5] ldr r0, [sp, 0x4] lsls r2, r0, 2 adds r1, r2 ldr r3, =0x00000d25 adds r1, r3 ldrb r0, [r1] movs r5, 0x4 orrs r0, r5 strb r0, [r1] ldr r0, =0x03005d90 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, =0x03005d90 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 .pool 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, =0x000003fe cmp r5, r0 bne @081958B8 adds r0, r6, 0 bl sub_8195938 b @08195902 .align 2, 0 .pool @081958B8: ldr r0, =0x000003ff cmp r5, r0 bne @081958DC ldr r0, =0x03005d90 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 .pool @081958DC: ldr r0, =0x0000012b cmp r5, r0 bhi @081958FC ldr r0, =0x0203bc88 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 .pool thumb_func_end sub_8195898 thumb_func_start sub_8195910 sub_8195910: ; 8195910 ldr r0, =gTrainers ldr r1, =0x00007df3 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8195910 thumb_func_start sub_8195924 sub_8195924: ; 8195924 ldr r0, =gTrainers ldr r1, =0x00007df1 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =gTrainers + TRAINER_TUCKER * 0x28 + 0x4 ; Tucker's name @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 .pool thumb_func_end sub_8195938 thumb_func_start sub_8195960 sub_8195960: ; 8195960 push {lr} ldr r1, =gUnknown_0860DE50 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8195960 thumb_func_start sub_8195980 sub_8195980: ; 8195980 push {r4-r7,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r7, r0, 16 ldr r0, [r4] ldr r2, =0x00000ca8 adds r0, r2 movs r6, 0 strb r6, [r0] ldr r1, [r4] adds r2, 0xA adds r0, r1, r2 strh r6, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, [r4] ldr r2, =0x00000ca9 adds r1, r2 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r4, [r4] ldr r0, =0x00000cdc adds r3, r4, r0 ldr r2, =gUnknown_0860DE98 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, =0x00000dc8 adds r1, r4, r2 adds r1, r0 strh r6, [r1] @081959F2: ldr r0, =0x03005d8c 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, =0x02038bca strh r6, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8195980 thumb_func_start sub_8195A38 sub_8195A38: ; 8195A38 push {r4-r7,lr} ldr r5, =0x03005d90 ldr r0, [r5] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r7, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r6, r0, 16 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x1 beq @08195A90 cmp r0, 0x1 bgt @08195A74 cmp r0, 0 beq @08195A7A b @08195AD0 .align 2, 0 .pool @08195A74: cmp r0, 0x2 beq @08195AB0 b @08195AD0 @08195A7A: ldr r0, =0x020375f0 ldr r1, [r5] ldr r2, =0x00000dc6 adds r1, r2 ldrh r1, [r1] strh r1, [r0] b @08195AD0 .align 2, 0 .pool @08195A90: ldr r3, =0x020375f0 ldr r0, [r5] lsls r1, r7, 1 lsls r2, r6, 2 adds r1, r2 ldr r2, =0x00000dc8 adds r0, r2 adds r0, r1 ldrh r0, [r0] strh r0, [r3] b @08195AD0 .align 2, 0 .pool @08195AB0: ldr r4, =0x020375f0 ldr r2, [r5] ldr r0, =0x00000cdc adds r2, r0 ldr r3, =gUnknown_0860DE98 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 .pool thumb_func_end sub_8195A38 thumb_func_start sub_8195AE4 sub_8195AE4: ; 8195AE4 push {r4-r6,lr} ldr r6, =0x03005d90 ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x1 beq @08195B3C cmp r0, 0x1 bgt @08195B20 cmp r0, 0 beq @08195B26 b @08195BA0 .align 2, 0 .pool @08195B20: cmp r0, 0x2 beq @08195B5C b @08195BA0 @08195B26: ldr r0, [r6] ldr r1, =0x020375e4 ldrh r1, [r1] ldr r2, =0x00000dc6 adds r0, r2 strh r1, [r0] b @08195BA0 .align 2, 0 .pool @08195B3C: ldr r2, [r6] lsls r0, r5, 1 lsls r1, r4, 2 adds r0, r1 ldr r1, =0x00000dc8 adds r2, r1 adds r2, r0 ldr r0, =0x020375e4 ldrh r0, [r0] strh r0, [r2] b @08195BA0 .align 2, 0 .pool @08195B5C: ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @08195B88 ldr r2, [r6] ldr r0, =0x00000cdc adds r2, r0 ldr r3, =gUnknown_0860DE98 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 .pool @08195B88: ldr r2, [r6] ldr r1, =0x00000cdc adds r2, r1 ldr r3, =gUnknown_0860DEA8 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 .pool thumb_func_end sub_8195AE4 thumb_func_start sub_8195BB0 sub_8195BB0: ; 8195BB0 push {r4,lr} ldr r0, =0x000040ce bl var_get lsls r0, 16 ldr r1, =0x03005d90 ldr r2, [r1] ldr r3, =0x00000ca9 adds r1, r2, r3 ldrb r1, [r1] lsls r1, 30 lsrs r1, 29 lsrs r0, 14 adds r1, r0 ldr r0, =0x00000dc8 adds r2, r0 adds r2, r1 ldrh r0, [r2] cmp r0, 0x31 bhi @08195C00 ldr r4, =0x020375f0 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x3 bl __umodsi3 strh r0, [r4] b @08195C16 .align 2, 0 .pool @08195C00: cmp r0, 0x62 bhi @08195C10 ldr r1, =0x020375f0 movs r0, 0x3 b @08195C14 .align 2, 0 .pool @08195C10: ldr r1, =0x020375f0 movs r0, 0x4 @08195C14: strh r0, [r1] @08195C16: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8195BB0 thumb_func_start sub_8195C20 sub_8195C20: ; 8195C20 push {r4,lr} ldr r4, =0x02038bca 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 .pool thumb_func_end sub_8195C20 thumb_func_start sub_8195C50 sub_8195C50: ; 8195C50 push {lr} ldr r3, =0x02038bca ldrh r1, [r3] ldr r0, =0x0000012b cmp r1, r0 bhi @08195C6C ldr r2, =0x0203bc88 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 .pool thumb_func_end sub_8195C50 thumb_func_start sub_8195C7C sub_8195C7C: ; 8195C7C push {r4-r7,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r7, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 24 ldr r4, [r4] lsls r1, r7, 1 lsrs r5, r0, 22 adds r1, r5 ldr r3, =0x00000dc8 adds r6, r4, r3 adds r3, r6, r1 ldrh r2, [r3] ldr r0, =0x0000270e 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 .pool thumb_func_end sub_8195C7C thumb_func_start sub_8195CE4 sub_8195CE4: ; 8195CE4 push {r4,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool thumb_func_end sub_8195CE4 thumb_func_start sub_8195D28 sub_8195D28: ; 8195D28 push {r4,r5,lr} ldr r0, =0x000040ce bl var_get lsls r0, 16 ldr r4, =0x03005d90 ldr r2, [r4] ldr r3, =0x00000ca9 adds r1, r2, r3 ldrb r1, [r1] lsls r1, 30 lsrs r1, 29 lsrs r0, 14 adds r1, r0 ldr r0, =0x00000dc8 adds r2, r0 adds r2, r1 ldrh r0, [r2] cmp r0, 0x29 bls @08195D88 bl GenerateRandomNumber ldr r4, [r4] ldr r5, =gUnknown_0860DE84 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, =0x00000dc6 adds r4, r1 b @08195DA6 .align 2, 0 .pool @08195D88: bl GenerateRandomNumber ldr r4, [r4] ldr r5, =gUnknown_0860DE78 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, =0x00000dc6 adds r4, r3 @08195DA6: strh r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8195D28 thumb_func_start sub_8195DB8 sub_8195DB8: ; 8195DB8 push {r4,r5,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000dc6 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, =0x00000dc6 adds r0, r1 ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000dc6 adds r0, r1 movs r1, 0 strh r1, [r0] ldr r0, =0x020375f0 strh r5, [r0] b @08195E06 .align 2, 0 .pool @08195E00: ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] @08195E06: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8195DB8 thumb_func_start sub_8195E10 sub_8195E10: ; 8195E10 push {lr} bl sub_802F588 ldr r0, =0x03005cf8 bl sub_8195E34 ldr r1, =0x0203cd80 adds r0, 0xA str r0, [r1] movs r0, 0 strb r0, [r1, 0x6] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005cf8 bl sub_8195E34 adds r1, r0, 0 ldr r2, =0x0203cd80 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 .pool @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, =0x020244ec 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 .pool @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, =0x02037318 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, =0x02037318 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 .pool @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, =0x0203cd80 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 .pool @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, =0x0203cd80 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, =0x02037318 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 .pool @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, =gUnknown_085500A4 @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 .pool @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, =0x0000012f 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 .pool @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, =0x0203cd80 movs r0, 0x1 strb r0, [r1, 0x7] bl task_prev_quest pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8196080 thumb_func_start sub_8196094 sub_8196094: ; 8196094 push {lr} ldr r0, =sub_81960E0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8196094 thumb_func_start task_prev_quest task_prev_quest: ; 81960A8 push {lr} ldr r0, =0x0203cd80 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, =0x00000107 bl audio_play ldr r0, =sub_81960E0 movs r1, 0x1 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r1, =gUnknown_0860EF78 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 .pool 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, =0x03005e08 adds r5, r0, r1 ldr r0, =gUnknown_0860EF98 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 .pool @0819615C: ldr r1, =gUnknown_0860EA6C 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, =0xffff0000 cmp r0, r1 bne @08196188 ldrb r0, [r5, 0x4] bl Window_Remove adds r0, r4, 0 b @081961E0 .align 2, 0 .pool @08196188: ldr r1, =gUnknown_0860EB8C ldr r3, =0x00000279 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, =gUnknown_0860EA4C movs r1, 0xE0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_0860EB6C movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r1, =0xffffe000 movs r0, 0 movs r2, 0 bl bg_change_y_offset movs r0, 0x1 b @081961E6 .align 2, 0 .pool @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, =0x03005e08 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, =0x0000f279 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, =sub_8196694 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 .pool @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, =0x03005e08 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 .pool @08196298: movs r1, 0x4 ldrsh r0, [r4, r1] ldr r1, =gUnknown_0860EF70 bl sub_81965D8 movs r0, 0x1 @081962A4: pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e08 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, =0x0203cd80 ldrb r0, [r1, 0x7] cmp r0, 0 bne @0819630C ldrh r0, [r1, 0x4] ldr r1, =0x02021fc4 bl sub_81967AC @0819630C: movs r1, 0x4 ldrsh r0, [r4, r1] ldr r1, =0x02021fc4 bl sub_81965D8 movs r0, 0x1 b @0819632A .align 2, 0 .pool @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, =0x03005e08 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, =0x030022c0 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 .pool @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, =0x03005e08 adds r4, r1, r0 movs r1, 0xC0 lsls r1, 3 movs r0, 0 movs r2, 0x2 bl bg_change_y_offset ldr r1, =0xffffe000 cmp r0, r1 ble @081963C0 movs r0, 0 b @081963E8 .align 2, 0 .pool @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, =0x0203cd80 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, =0x02037350 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 .pool @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, =0x03003014 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 .pool thumb_func_end sub_81965D8 thumb_func_start sub_8196648 sub_8196648: ; 8196648 push {r4,lr} adds r4, r0, 0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2C] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @0819666C ldr r0, =0x03003014 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @08196678 .align 2, 0 .pool @0819666C: ldr r2, =0x03003014 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 .pool 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, =0x03005e08 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, =0x00000279 adds r1, r0 strh r1, [r2, 0x4] ldr r2, =0xfffff000 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 .pool thumb_func_end sub_8196694 thumb_func_start sub_8196710 sub_8196710: ; 8196710 ldr r1, =0x03005d8c ldr r1, [r1] ldr r2, =0x000009ca adds r1, r2 adds r1, r0 ldrb r1, [r1] negs r0, r1 orrs r0, r1 lsrs r0, 31 bx lr .align 2, 0 .pool thumb_func_end sub_8196710 thumb_func_start sub_819672C sub_819672C: ; 819672C push {lr} ldr r1, =gUnknown_085500A4 lsls r0, 4 adds r0, r1 ldrh r2, [r0, 0xA] ldrh r1, [r0, 0xC] adds r0, r2, 0 bl get_mapheader_by_bank_and_number ldrb r0, [r0, 0x14] pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085500A4 @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 .pool 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, =gUnknown_085500A4 @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 .pool @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, =0x0203cd88 strh r7, [r0] adds r0, r5, 0 bl sub_8196710 cmp r0, 0 beq @081967EC adds r0, r5, 0 bl sub_819672C ldr r1, =0x02037318 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 .pool @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, =gUnknown_0860DEB8 @0819684C: ldrh r0, [r1] cmp r0, r3 beq @0819685C adds r1, 0x14 adds r2, 0x1 b @0819684C .align 2, 0 .pool @0819685C: adds r0, r2, 0 pop {r1} bx r1 thumb_func_end sub_8196844 thumb_func_start sub_8196864 sub_8196864: ; 8196864 ldr r2, =gUnknown_0860DEB8 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, =gUnknown_0860EA2C lsls r0, 2 adds r0, r2 lsls r1, 3 ldr r0, [r0] adds r0, r1 bx lr .align 2, 0 .pool thumb_func_end sub_8196864 thumb_func_start sub_8196890 sub_8196890: ; 8196890 ldr r2, =gUnknown_0860DEB8 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, =gUnknown_0860EA2C lsls r0, 2 adds r0, r2 lsls r1, 3 ldr r0, [r0] adds r0, r1 bx lr .align 2, 0 .pool 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, =gUnknown_0860DEB8 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, =gUnknown_0860EA20 lsls r0, 2 adds r0, r2 lsls r1, 3 ldr r0, [r0] adds r0, r1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203cd88 strh r0, [r1, 0x2] lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bls @08196960 cmp r5, 0 bne @0819695E @08196980: ldr r0, =0x0203cd88 strh r4, [r0] ldr r1, =gUnknown_0860DEB8 adds r0, r7, r6 lsls r0, 2 adds r0, r1 ldrb r0, [r0, 0xC] subs r2, r0, 0x1 ldr r1, =gUnknown_0860EA34 ldr r0, [sp] lsls r0, 2 adds r0, r1 lsls r1, r2, 3 ldr r0, [r0] adds r0, r1 b @081969D0 .align 2, 0 .pool @081969AC: ldr r1, =gUnknown_0860DEB8 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, =gUnknown_0860EA34 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 .pool 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, =gUnknown_0860EFA0 @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 .pool thumb_func_end sub_81969FC thumb_func_start sub_8196A2C sub_8196A2C: ; 8196A2C push {lr} ldr r3, =gUnknown_0860EFAC lsls r1, 2 adds r1, r3 ldr r3, [r1] adds r1, r2, 0 bl _call_via_r3 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8196A2C thumb_func_start sub_8196A44 sub_8196A44: ; 8196A44 push {r4-r6,lr} adds r5, r1, 0 ldr r2, =gUnknown_0860DEB8 lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r2 ldrh r4, [r1] movs r2, 0 ldr r3, =gUnknown_0860EFC4 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 .pool @08196A78: adds r3, 0x8 adds r2, 0x1 cmp r2, 0x5 bls @08196A5A lsls r1, r4, 2 adds r1, r4 lsls r1, 3 ldr r0, =gTrainers + 0x4 ; name offset adds r1, r0 adds r0, r5, 0 bl gf_strcpy @08196A90: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gWildMonHeaders ldrb r1, [r0] adds r7, r0, 0 cmp r1, 0xFF beq @08196C5C ldr r1, =gUnknown_085500A4 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, =gSpeciesNames adds r1, r0 mov r0, r8 bl gf_strcpy b @08196C62 .align 2, 0 .pool @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, =gUnknown_0860DEB8 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, =gTrainers 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 .pool @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, =gSpeciesNames adds r1, r0 adds r0, r7, 0 bl gf_strcpy pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8196C70 thumb_func_start sub_8196CF4 sub_8196CF4: ; 8196CF4 push {lr} adds r0, r1, 0 ldr r2, =gUnknown_0860EFF4 ldr r1, =0x0203cd88 ldrh r1, [r1] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cd88 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 .pool thumb_func_end sub_8196D14 thumb_func_start sub_8196D4C sub_8196D4C: ; 8196D4C push {r4,r5,lr} movs r4, 0 ldr r5, =gUnknown_0860F010 b @08196D5C .align 2, 0 .pool @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, =0x03005d90 ldr r0, [r0] adds r0, 0xA bl sub_80842DC adds r6, r0, 0 ldr r0, =0x0000ffff ands r6, r0 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00002e6a 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 .pool @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, =@08196E24 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @08196E24: .4byte @08196E9C .4byte @08196E40 .4byte @08196ED0 .4byte @08196F38 .4byte @08196E74 .4byte @08196F04 .4byte @08196F60 @08196E40: movs r3, 0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000d14 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 .pool @08196E74: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e08 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 .pool @08196E9C: movs r3, 0 ldr r0, =0x03005d90 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 .pool @08196ED0: movs r3, 0 ldr r0, =0x03005d90 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 .pool @08196F04: movs r3, 0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000dea 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 .pool @08196F38: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000dde 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 .pool @08196F60: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e1e 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 .pool 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 SpeciesToNationalPokedexNum 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, =0x00000199 bl SpeciesToNationalPokedexNum 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 .pool @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, =0x02021cc4 mov r10, r0 adds r1, r4, 0 movs r2, 0 movs r3, 0x3 bl decimal_int_to_string ldr r1, =0x02021dc4 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, =gUnknown_082A5C9C adds r0, r7, 0 bl gf_strcpy adds r5, r0, 0 movs r6, 0xFB strb r6, [r5] adds r5, 0x1 ldr r1, =gUnknown_082A5D2C adds r0, r5, 0 bl gf_strcpy adds r5, r0, 0 strb r6, [r5] adds r5, 0x1 ldr r0, =gUnknown_0860F020 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, =gUnknown_082A633D 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 .pool 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, =gUnknown_0860EA6C 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, =gUnknown_0860EA4C 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 .pool 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, =gUnknown_0860F098 bl Window_InitFromTemplates ldr r0, =0x0203cd8c movs r1, 0xFF strb r1, [r0] ldr r0, =0x0203cd8d strb r1, [r0] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03003014 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 .pool 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, =0x03003014 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, =0x02021fc4 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 .pool 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, =0x03003014 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, =0x02021fc4 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 .pool 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, =0x03003014 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, =0x02021fc4 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 .pool 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, =sub_81975F4 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 .pool 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, =sub_81974A4 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 .pool 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, =sub_8197804 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 .pool 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, =sub_81977BC 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 .pool 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, =0x00000215 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, =0x00000216 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, =0x00000217 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, =0x00000219 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, =0x0000021a 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, =0x0000021b 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 .pool 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, =0x00000201 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, =0x00000203 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, =0x00000205 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, =0x00000206 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, =0x00000207 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, =0x00000209 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, =0x0000020a 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, =0x00000a01 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, =0x00000a03 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, =0x00000a04 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, =0x00000a05 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, =0x00000a06 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 .pool 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 ; void SetStandardWindowBorderStyle(u8 windowId, bool copyToVram) 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, =gUnknown_0860F074 movs r1, 0xE0 movs r2, 0x14 bl gpu_pal_apply pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0860F074 movs r2, 0x14 bl gpu_pal_apply pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81978B0 thumb_func_start sub_81978C8 sub_81978C8: ; 81978C8 ldr r0, =gUnknown_0860F074 bx lr .align 2, 0 .pool 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, =gUnknown_0860F074 lsls r1, 1 adds r1, r0 ldrh r0, [r1] pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_0860F0A8 movs r1, 0x85 lsls r1, 2 movs r2, 0xE movs r3, 0 bl sub_81996C0 pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0860F0A8 movs r1, 0x85 lsls r1, 2 movs r2, 0xE bl sub_81996C0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_8197948 thumb_func_start sub_8197964 sub_8197964: ; 8197964 push {lr} ldr r0, =0x03003014 ldrb r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 bne @08197988 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x14] lsls r0, 29 lsrs r0, 29 b @0819798A .align 2, 0 .pool @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, =0x03005d90 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, =gUnknown_0860F094 adds r0, r1 ldrb r0, [r0] pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203cd8c 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, =0x00000139 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 .pool thumb_func_end sub_81979C4 thumb_func_start sub_8197A08 sub_8197A08: ; 8197A08 ldr r0, =0x0203cd8c ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_8197A08 thumb_func_start sub_8197A14 sub_8197A14: ; 8197A14 push {r4,lr} ldr r4, =0x0203cd8c 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 .pool 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, =0x0203cd8d 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 .pool thumb_func_end sub_8197A40 thumb_func_start rboxid_upload_textbox_1_no_pal rboxid_upload_textbox_1_no_pal: ; 8197A74 ldr r0, =0x0203cd8d ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end rboxid_upload_textbox_1_no_pal thumb_func_start sub_8197A80 sub_8197A80: ; 8197A80 push {r4,lr} ldr r4, =0x0203cd8d 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 .pool 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, =0x03003014 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, =0x02021fc4 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 .pool 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, =0x0203cd9c strh r2, [r0] ldr r0, =0x0203cd9e strb r3, [r0] ldr r1, =sub_8197BB4 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 .pool 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, =0x0203cd9c strh r2, [r0] ldr r5, =0x0203cd9e adds r0, r6, 0 movs r1, 0x5 bl Window_GetField strb r0, [r5] ldr r1, =sub_8197BB4 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 .pool 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, =0x0203cd9c 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, =0x0203cd9e 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x00000801 adds r1, r3, 0 ldr r0, =0x0203cd9c 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, =0x00000803 adds r1, r3, 0 ldr r0, =0x0203cd9c 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, =0x00000804 adds r1, r3, 0 ldr r0, =0x0203cd9c 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, =0x00000805 adds r1, r0, 0 ldr r2, =0x0203cd9c 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, =0x00000806 adds r1, r0, 0 ldr r2, =0x0203cd9c 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 .pool 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, =sub_8197E30 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 .pool 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 ; void SetWindowBorderStyle(u8 windowId, bool copyToVram, s16 tileStart, s8 palette) 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, =0x0203cd9c strh r2, [r0] ldr r0, =0x0203cd9e strb r3, [r0] ldr r1, =DrawWindowBorder 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 .pool 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, =0x0203cd9c strh r2, [r0] ldr r5, =0x0203cd9e adds r0, r6, 0 movs r1, 0x5 bl Window_GetField strb r0, [r5] ldr r1, =DrawWindowBorder 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 .pool 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, =0x0203cd9c 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, =0x0203cd9e ldrb r0, [r7] str r0, [sp, 0x8] mov r0, r9 adds r2, r6, 0 adds r3, r4, 0 bl Bg_FillWramTileMapRectWithTileAndPalette ldr r2, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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, =0x0203cd9c 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 .pool 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, =sub_81980A8 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 .pool 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, =0x0203cda0 mov r0, sp bl Window_AddFromTemplate strb r0, [r4] cmp r5, 0xF bls @08198158 movs r5, 0xF0 b @0819815C .align 2, 0 .pool @08198158: lsls r0, r5, 28 lsrs r5, r0, 24 @0819815C: ldr r0, =gUnknown_0860F0B0 adds r1, r5, 0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =0x0203cda0 ldrb r0, [r0] add sp, 0x8 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203cda0 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, =gUnknown_0860F0D0 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 .pool 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, =0x0203cda0 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 .pool @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, =0x0203cda0 ldrb r0, [r1] cmp r0, 0xFF beq @081982E8 movs r1, 0x3 bl Window_CopyToVram @081982E8: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81982D8 thumb_func_start sub_81982F0 sub_81982F0: ; 81982F0 push {r4,lr} ldr r4, =0x0203cda0 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 .pool thumb_func_end sub_81982F0 thumb_func_start sub_8198314 sub_8198314: ; 8198314 push {r4,lr} ldr r4, =0x0203cda0 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 .pool 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, =0x0203cd90 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 .pool @08198390: strb r7, [r5, 0x2] @08198392: movs r0, 0 bl MoveMenuCursor ldr r0, =0x0203cd90 ldrb r0, [r0, 0x2] pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool 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 GetMenuCursorDimensionByFont 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 ; void RedrawMenuCursor(s8 oldPos, s8 newPos) 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, =0x0203cd90 ldrb r0, [r5, 0x6] movs r1, 0 bl GetMenuCursorDimensionByFont adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r5, 0x6] movs r1, 0x1 bl GetMenuCursorDimensionByFont 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, =gUnknown_085EE498 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 .pool thumb_func_end RedrawMenuCursor thumb_func_start MoveMenuCursor ; s8 MoveMenuCursor(s8 cursorDelta) MoveMenuCursor: ; 81984D8 push {r4,r5,lr} ldr r1, =0x0203cd90 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 .pool @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 ; s8 MoveMenuCursorNoWrapAround(s8 cursorDelta) MoveMenuCursorNoWrapAround: ; 819851C push {r4,r5,lr} ldr r1, =0x0203cd90 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 .pool @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, =0x0203cd90 ldrb r0, [r0, 0x2] bx lr .align 2, 0 .pool thumb_func_end GetMenuCursorPos thumb_func_start ProcessMenuInput ProcessMenuInput: ; 819856C push {r4,lr} ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08198598 ldr r4, =0x0203cd90 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 .pool @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 ; int ProcessMenuInputNoWrapAround() ProcessMenuInputNoWrapAround: ; 81985D8 push {r4-r6,lr} ldr r4, =0x0203cd90 ldrb r5, [r4, 0x2] adds r6, r5, 0 ldr r0, =0x030022c0 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 .pool @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, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08198684 ldr r4, =0x0203cd90 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 .pool @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, =0x0203cd90 ldrb r5, [r4, 0x2] adds r6, r5, 0 ldr r2, =0x030022c0 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 .pool @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 ; void rbox_template_set(rbox_template *template, char bg_id, char x, char y, char w, char h, char a7, s16 a8) 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, =0x0203cd9f bl Window_AddFromTemplate strb r0, [r7] ldrb r0, [r7] movs r1, 0x1 adds r2, r4, 0 adds r3, r5, 0 bl SetWindowBorderStyle ldr r0, =gUnknown_085EE491 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 .pool 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, =0x0203cd9f ldrb r0, [r4] movs r1, 0x1 bl sub_8198070 ldrb r0, [r4] bl Window_Remove pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cd90 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 .pool @08198FB4: strb r7, [r5, 0x2] @08198FB6: movs r0, 0 movs r1, 0 bl sub_8199134 ldr r0, =0x0203cd90 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 .pool 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 GetMenuCursorDimensionByFont 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, =0x0203cd90 ldrb r0, [r5, 0x6] movs r1, 0 bl GetMenuCursorDimensionByFont mov r9, r0 mov r1, r9 lsls r1, 24 lsrs r1, 24 mov r9, r1 ldrb r0, [r5, 0x6] movs r1, 0x1 bl GetMenuCursorDimensionByFont 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, =gUnknown_085EE498 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 .pool 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, =0x0203cd90 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 .pool @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, =0x0203cd90 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 .pool @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, =0x030022c0 ldrh r1, [r4, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081992AC movs r0, 0x5 bl audio_play ldr r0, =0x0203cd90 ldrb r0, [r0, 0x2] lsls r0, 24 asrs r0, 24 b @0819932C .align 2, 0 .pool @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, =0x0203cd90 ldrb r4, [r5, 0x2] ldr r6, =0x030022c0 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 .pool @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, =0x030022c0 ldrh r1, [r4, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @08199400 movs r0, 0x5 bl audio_play ldr r0, =0x0203cd90 ldrb r0, [r0, 0x2] lsls r0, 24 asrs r0, 24 b @0819947C .align 2, 0 .pool @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, =0x0203cd90 ldrb r4, [r6, 0x2] ldr r5, =0x030022c0 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 .pool @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 ; int InitMenuInUpperLeftCorner(s8 windowId, s8 numItems, u8 initialCursorPos, bool doNotPlaySoundWhenAPressed) InitMenuInUpperLeftCorner: ; 8199524 push {r4-r6,lr} lsls r1, 24 lsrs r1, 24 lsls r2, 24 lsrs r5, r2, 24 ldr r4, =0x0203cd90 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 .pool @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, =0x0203cd9f 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, =gUnknown_085EE491 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 .pool 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, =0x0203cd90 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 .pool @08199990: strb r7, [r6, 0x2] @08199992: movs r0, 0 movs r1, 0 bl sub_8199134 ldr r0, =0x0203cd90 ldrb r0, [r0, 0x2] pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_8199944 thumb_func_start clear_scheduled_bg_copies_to_vram ; void clear_scheduled_bg_copies_to_vram() clear_scheduled_bg_copies_to_vram: ; 81999A8 push {lr} ldr r0, =0x0203cda4 movs r1, 0 movs r2, 0x4 bl memset pop {r0} bx r0 .align 2, 0 .pool thumb_func_end clear_scheduled_bg_copies_to_vram thumb_func_start schedule_bg_copy_tilemap_to_vram ; void schedule_bg_copy_tilemap_to_vram(u8 bg_id) schedule_bg_copy_tilemap_to_vram: ; 81999BC lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203cda4 adds r0, r1 movs r1, 0x1 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end schedule_bg_copy_tilemap_to_vram thumb_func_start do_scheduled_bg_tilemap_copies_to_vram ; void do_scheduled_bg_tilemap_copies_to_vram() do_scheduled_bg_tilemap_copies_to_vram: ; 81999D0 push {r4,lr} ldr r4, =0x0203cda4 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 .pool thumb_func_end do_scheduled_bg_tilemap_copies_to_vram thumb_func_start reset_temp_tile_data_buffers ; void reset_temp_tile_data_buffers() reset_temp_tile_data_buffers: ; 8199A20 push {lr} ldr r3, =0x0203cda8 ldr r1, =0x0203cdac 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 .pool 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, =0x0203cda8 ldrh r0, [r1] cmp r0, 0 beq @08199A7C movs r4, 0 ldrh r1, [r1] cmp r4, r1 bge @08199A76 ldr r5, =0x0203cdac movs r6, 0 @08199A64: ldr r0, [r5] bl free stm r5!, {r6} adds r4, 0x1 ldr r0, =0x0203cda8 ldrh r0, [r0] cmp r4, r0 blt @08199A64 @08199A76: ldr r1, =0x0203cda8 movs r0, 0 strh r0, [r1] @08199A7C: movs r0, 0 b @08199A8A .align 2, 0 .pool @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 ; int decompress_and_copy_tile_data_to_vram(u8 bg_id, int src, int size, u16 offset, u8 mode) 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, =0x0203cda8 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, =0x0203cdac 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 .pool @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 ; void copy_decompressed_tile_data_to_vram_autofree(u8 bg_id, int src, u16 size, u16 offset, u8 mode) 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, =task_free_buf_after_copying_tile_data_to_vram 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, =0x03005e00 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 .pool thumb_func_end copy_decompressed_tile_data_to_vram_autofree thumb_func_start task_free_buf_after_copying_tile_data_to_vram ; void task_free_buf_after_copying_tile_data_to_vram(int task_id) task_free_buf_after_copying_tile_data_to_vram: ; 8199B84 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0x8 ldrsh r0, [r0, r1] bl CheckForSpaceForDma3Request 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 .pool thumb_func_end task_free_buf_after_copying_tile_data_to_vram thumb_func_start malloc_and_decompress ; void *malloc_and_decompress(void *src, int *size) 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 ; s16 copy_decompressed_tile_data_to_vram(u8 bg_id, int src, u16 size, u16 offset, u8 mode) 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, =0x0000ffff b @08199C2A .align 2, 0 .pool @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, =0x00000fff 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 .pool 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, =0x000003ff 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 .pool 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 RequestDma3Fill 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, =0x03005d90 ldr r3, [r0] ldrb r0, [r3] ldr r6, =0x02021fc4 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 .pool 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, =0x00000fff 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 .pool @0819A1A8: ldrb r1, [r3] mov r0, r9 ands r0, r1 lsls r0, 12 b @0819A22A @0819A1B2: ldrh r0, [r4] ldr r2, =0x0000f0ff 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 .pool @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, =0x0000ff0f 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 .pool @0819A1FC: ldrb r1, [r3] mov r0, r9 ands r0, r1 lsls r0, 4 b @0819A22A @0819A206: ldrh r0, [r4] ldr r2, =0x0000fff0 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 .pool @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, =gUnknown_08DC4318 b @0819A2E6 .align 2, 0 .pool @0819A2DC: ldr r0, =gUnknown_08DC4338 b @0819A2E6 .align 2, 0 .pool @0819A2E4: ldr r0, =gUnknown_08DC4358 @0819A2E6: adds r1, r2, 0 movs r2, 0x20 bl gpu_pal_apply pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0860F0D4 lsrs r1, 22 adds r1, r4 ldrh r5, [r1, 0x2] lsls r5, 5 ldr r4, =gUnknown_08DC4378 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 .pool 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, =@0819A384 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0819A384: .4byte @0819A398 .4byte @0819A3A8 .4byte @0819A3D6 .4byte @0819A404 .4byte @0819A414 @0819A398: ldr r0, =0x03005d90 ldr r1, [r0] adds r0, r5, 0 bl gf_strcpy b @0819A43C .align 2, 0 .pool @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, =0x03005d90 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 .pool @0819A404: ldr r0, =0x02037318 ldrb r1, [r0, 0x14] adds r0, r5, 0 bl sub_81245DC b @0819A43C .align 2, 0 .pool @0819A414: ldr r4, =0x00000867 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, =0x0000086e 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 .pool 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, =0x0300127c movs r1, 0 str r1, [r0] ldr r0, =sub_819A514 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_819A4F8 thumb_func_start sub_819A514 sub_819A514: ; 819A514 push {r4,r5,lr} sub sp, 0xC ldr r0, =0x030022c0 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, =@0819A53C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203ce3c 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, =0x05006000 add r0, sp, 0x8 bl CpuSet movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_08610428 movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r0, =gUnknown_08610434 bl Window_InitFromTemplates bl TextBox_ResetSomeField b @0819A8E6 .align 2, 0 .pool @0819A5C0: ldr r5, =0x0203ce2c movs r4, 0x88 lsls r4, 3 adds r0, r4, 0 bl malloc str r0, [r5] ldr r5, =0x0203ce30 adds r0, r4, 0 bl malloc_and_clear str r0, [r5] ldr r5, =0x0203ce34 movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 bl malloc str r0, [r5] ldr r5, =0x0203ce38 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, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @0819A8EE .align 2, 0 .pool @0819A69C: bl sub_80A1A74 bl reset_all_obj_data bl clear_tasks bl gpu_pal_allocator_reset ldr r0, =gUnknown_08DC0754 ldr r5, =0x0203ce2c ldr r1, [r5] movs r2, 0x88 lsls r2, 2 bl CpuSet ldr r0, =gUnknown_0861033C ldr r4, =0x0203ce30 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, =gUnknown_08DC0B94 ldr r4, =0x0203ce34 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, =gUnknown_08DC0714 movs r1, 0 movs r2, 0x40 bl gpu_pal_apply ldr r4, =gUnknown_0861046C 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, =0x0300127c ldr r1, [r0] ldrb r0, [r1, 0x6] cmp r0, 0x1 bne @0819A738 ldr r0, =0x02037714 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, =gUnknown_0861039C movs r1, 0x20 movs r2, 0x4 bl gpu_pal_apply ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0819A8EE .align 2, 0 .pool @0819A77C: ldr r0, =0x0203ce38 ldr r1, [r0] movs r0, 0x3 bl bg_set_tilemap ldr r5, =gUnknown_0861023C 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 .pool @0819A7CC: ldr r0, =gUnknown_086103F4 bl gpu_pal_obj_alloc_and_load_multiple ldr r0, =gUnknown_086103BC bl gpu_tile_obj_alloc_and_load_multiple ldr r0, =gUnknown_086103E4 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, =sub_819A4E4 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, =0x0300127c 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, =0x00001248 movs r0, 0x50 bl lcd_io_set ldr r1, =0x0000040b movs r0, 0x52 bl lcd_io_set b @0819A85A .align 2, 0 .pool @0819A854: movs r0, 0x3 bl gpu_sync_bg_hide @0819A85A: ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @0819A8EE .align 2, 0 .pool @0819A868: ldr r4, =0x0300127c ldr r1, [r4] ldrb r0, [r1, 0x6] cmp r0, 0x1 bne @0819A878 ldr r0, =0x0203cf20 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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0819A8EE .align 2, 0 .pool @0819A8A4: bl sub_819BA64 movs r0, 0x2 b @0819A8E2 @0819A8AC: bl sub_819BCF8 movs r0, 0x5 bl Window_WriteStandardTileMap ldr r1, =0x030022c0 movs r3, 0x87 lsls r3, 3 adds r1, r3 b @0819A8EE .align 2, 0 .pool @0819A8C4: bl sub_819B9E8 movs r0, 0x1 bl Window_WriteStandardTileMap ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0819A8EE .align 2, 0 .pool @0819A8DC: bl sub_819B9B4 movs r0, 0 @0819A8E2: bl Window_WriteStandardTileMap @0819A8E6: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @0819A8EE: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0819A98E .align 2, 0 .pool @0819A8FC: ldr r0, =sub_819C69C movs r1, 0 bl AddTask ldr r2, =0x0300127c ldr r1, [r2] ldr r3, =0x000002a1 adds r1, r3 strb r0, [r1] ldr r3, [r2] ldrb r5, [r3, 0x6] cmp r5, 0 bne @0819A954 ldr r4, =0x03005e00 ldr r1, =0x000002a1 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, =sub_819B378 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 .pool @0819A954: ldr r4, =0x03005e00 ldr r2, =0x000002a1 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, =0x000002a2 adds r0, r3, r1 strb r2, [r0] ldr r0, =sub_819B124 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, =sub_819A4C8 bl set_callback2 @0819A98E: add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_819A514 thumb_func_start sub_819A9AC sub_819A9AC: ; 819A9AC push {r4,r5,lr} ldr r5, =0x0300127c 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 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 .pool @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, =0x02020630 @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, =gUnknown_086105D8 movs r2, 0x40 movs r3, 0x1 bl obj_add_from_template_forward_search ldr r6, =0x0300127c 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, =0x02020630 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, =gUnknown_086105F0 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, =gUnknown_08610608 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, =gUnknown_08610620 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 .pool thumb_func_end sub_819AA18 thumb_func_start sub_819AB40 sub_819AB40: ; 819AB40 push {r4-r6,lr} movs r4, 0 @0819AB44: ldr r6, =0x0300127c 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, =0x02020630 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 .pool 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, =0x0300127c 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 .pool @0819ABC4: movs r0, 0 b @0819ABDE @0819ABC8: ldr r0, =0x0300127c 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 .pool @0819ABDC: movs r0, 0x5 @0819ABDE: strb r0, [r1, 0x3] ldr r2, [r2] ldrb r3, [r2, 0x3] ldr r4, =0x02020630 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 .pool 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, =0x0300127c ldr r1, [r0] ldrb r3, [r1] adds r2, r0, 0 cmp r3, 0x2 beq @0819AC2C adds r0, r3, 0x1 b @0819AC46 .align 2, 0 .pool @0819AC2C: movs r0, 0 b @0819AC46 @0819AC30: ldr r0, =0x0300127c ldr r1, [r0] ldrb r3, [r1] adds r2, r0, 0 cmp r3, 0 beq @0819AC44 subs r0, r3, 0x1 b @0819AC46 .align 2, 0 .pool @0819AC44: movs r0, 0x2 @0819AC46: strb r0, [r1] ldr r3, =0x02020630 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 .pool 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, =0x0300127c 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 .pool @0819AC94: movs r0, 0 b @0819ACAE @0819AC98: ldr r0, =0x0300127c 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 .pool @0819ACAC: movs r0, 0x1 @0819ACAE: strb r0, [r1, 0x7] ldr r3, =0x02020630 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 .pool thumb_func_end sub_819AC78 thumb_func_start sub_819ACE0 sub_819ACE0: ; 819ACE0 push {r4-r6,lr} ldr r5, =0x0300127c 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, =0x0300127c ldr r1, [r0] movs r0, 0x6C muls r0, r2 adds r1, r0 movs r0, 0x1 strb r0, [r1, 0x10] @0819AD44: ldr r2, =0x0300127c 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 .pool @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, =0x02020630 ldr r0, =0x0300127c 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 .pool 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, =0x0300127c 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 .pool @0819ADCC: movs r0, 0x64 @0819ADCE: bl gpu_pal_tags_index_of lsls r0, 24 lsrs r3, r0, 24 ldr r2, =0x02020630 ldr r0, =0x0300127c 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 .pool 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, =0x03005e00 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 .pool @0819AE30: cmp r0, 0x8 beq @0819AEE8 b @0819AF50 @0819AE36: ldr r1, =0x02037714 ldr r0, =0x02037b14 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 .pool @0819AE64: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @0819AF50 ldr r4, =0x0300127c ldr r0, [r4] ldr r2, =0x000002a1 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, =0x0203ce2c ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce30 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce34 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce38 ldr r0, [r4] bl free str r5, [r4] bl Window_FreeMemory movs r0, 0x8 strh r0, [r6, 0x8] b @0819AF50 .align 2, 0 .pool @0819AEE8: ldr r4, =0x0300127c ldr r1, [r4] ldr r0, =0x02037714 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, =0x0203ce3c movs r0, 0x96 lsls r0, 2 bl malloc_and_clear str r0, [r4] movs r4, 0 @0819AF1A: ldr r5, =0x0203ce3c ldr r1, [r5] movs r0, 0x64 muls r0, r4 adds r0, r1 ldr r1, =0x0300127c 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, =sub_819A514 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 .pool 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, =0x0300127c ldr r0, [r7] movs r1, 0xA8 lsls r1, 2 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @0819B00E ldr r1, =0x03005e00 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 .pool @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, =0x000002a1 adds r0, r1 ldrb r0, [r0] bl remove_task bl sub_819AB40 ldr r4, =0x0203ce2c ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce34 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce38 ldr r0, [r4] bl free str r5, [r4] ldr r0, [r7] bl free str r5, [r7] bl Window_FreeMemory ldr r0, =sub_80861B0 bl set_callback2 adds r0, r6, 0 bl remove_task @0819B00E: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0300127c ldr r0, [r7] movs r1, 0xA8 lsls r1, 2 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @0819B11A ldr r1, =0x03005e00 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 .pool @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, =0x030022c0 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, =bc_exit_to_overworld str r0, [r5] b @0819B11A .align 2, 0 .pool @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, =0x000002a2 adds r0, r1 mov r1, r8 strb r1, [r0] strh r6, [r5, 0x8] ldr r0, =sub_819B378 str r0, [r5] b @0819B11A .align 2, 0 .pool @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, =0x03005e00 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, =@0819B158 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0300127c ldr r1, [r0] ldrb r0, [r1, 0x6] cmp r0, 0 bne @0819B1A2 ldr r2, =0x00000299 adds r0, r1, r2 movs r7, 0xA8 lsls r7, 2 adds r1, r7 movs r2, 0 bl sub_819F2B4 @0819B1A2: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 movs r0, 0x9 b @0819B36C .align 2, 0 .pool @0819B1BC: ldr r4, =0x0300127c 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 b @0819B344 .align 2, 0 .pool @0819B1EC: ldr r2, =0x030022c0 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, =0x0300127c ldr r0, [r0] ldr r2, =0x000002a2 adds r0, r2 b @0819B2AC .align 2, 0 .pool @0819B228: cmp r0, 0x2 bne @0819B248 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0xA strh r1, [r0, 0x8] ldr r1, =sub_819B02C str r1, [r0] b @0819B36E .align 2, 0 .pool @0819B248: cmp r1, 0x3 bne @0819B260 ldr r1, =0x03005e00 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 .pool @0819B260: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0x6 strh r1, [r0, 0x8] ldr r1, =sub_819AE08 str r1, [r0] b @0819B36E .align 2, 0 .pool @0819B27C: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0819B2D0 movs r0, 0x5 bl audio_play ldr r4, =0x0300127c 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, =0x000002a2 adds r0, r1 @0819B2AC: strb r7, [r0] ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 strh r6, [r0, 0x8] @0819B2BA: ldr r1, =sub_819B378 str r1, [r0] b @0819B36E .align 2, 0 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 bne @0819B36E ldr r4, =0x0300127c ldr r2, [r4] ldrb r0, [r2, 0x6] cmp r0, 0x1 bne @0819B338 ldr r1, =0x02037b14 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, =0x02037714 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 .pool @0819B35C: bl sub_819B844 ldr r0, =0x03005e00 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 .pool 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, =0x0300127c ldr r3, [r5] movs r7, 0xA8 lsls r7, 2 adds r0, r3, r7 ldrb r0, [r0] cmp r0, 0x1 beq @0819B476 ldr r1, =0x03005e00 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 .pool @0819B3B4: cmp r1, 0xB beq @0819B440 b @0819B476 @0819B3BA: ldr r0, =0x02037fd4 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, =0x000002a2 adds r1, r3, r2 strb r0, [r1] b @0819B476 .align 2, 0 .pool @0819B3DC: ldr r2, =0x030022c0 ldrh r0, [r2, 0x2E] ands r1, r0 cmp r1, 0 beq @0819B40C movs r0, 0x5 bl audio_play ldr r0, [r5] ldr r1, =0x000002a2 adds r0, r1 movs r1, 0 strb r1, [r0] movs r0, 0x2 strh r0, [r4, 0x8] ldr r0, =sub_819B124 str r0, [r4] b @0819B476 .align 2, 0 .pool @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, =0x030022c0 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, =0x000002a2 adds r0, r1 movs r1, 0x1 strb r1, [r0] strh r6, [r4, 0x8] @0819B476: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x000040ce bl var_get lsls r0, 24 lsrs r0, 24 adds r6, r0, 0 ldr r7, =0x03005d90 ldr r2, [r7] ldr r0, =0x00000ca9 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, =0x00000de2 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, =0x0203bc8c ldr r0, =gBattleFrontierMons 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, =0x03005d90 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, =0x0300127c 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 .pool @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, =0x0300127c ldr r0, [r2] adds r0, r4 adds r0, 0x8 ldr r1, =0x0203bc8c 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, =0x0300127c @0819B5B8: ldr r0, [r3] adds r0, r4 adds r0, 0x8 ldr r5, =0x0203bc8c 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, =0x0300127c ldr r0, [r1] adds r0, r4 adds r0, 0x8 movs r1, 0x20 add r2, sp, 0xC bl pokemon_setattr ldr r2, =0x0300127c 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, =gBattleFrontierHeldItems 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 .pool 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, =0x0203bc8c ldr r0, =gSlateportBattleTentMons str r0, [r2] ldr r0, =0x03005d90 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, =0x03005d90 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, =0x0300127c 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, =0x0203bc8c 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, =0x0300127c ldr r0, [r1] adds r0, r4 adds r0, 0x8 ldr r3, =0x0203bc8c 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, =0x0300127c ldr r0, [r1] adds r0, r4 adds r0, 0x8 movs r1, 0x20 add r2, sp, 0xC bl pokemon_setattr ldr r2, =0x0300127c ldr r0, [r2] adds r0, r4 adds r0, 0x8 ldr r3, =0x0203bc8c ldr r1, [r3] adds r1, r5, r1 ldrb r2, [r1, 0xA] lsls r2, 1 ldr r1, =gBattleFrontierHeldItems 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 .pool 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, =0x0300127c mov r10, r0 ldr r1, =0x03005d90 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, =0x020244ec 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, =0x00000e74 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, =0x00000e79 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, =0x00000e78 adds r1, r2 strb r0, [r1] b @0819B826 .align 2, 0 .pool @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, =0x0300127c ldr r1, [r5] ldrb r0, [r1, 0x6] cmp r0, 0 bne @0819B852 strb r0, [r1] @0819B852: ldr r4, =0x02020630 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 .pool thumb_func_end sub_819B844 thumb_func_start sub_819B8D4 sub_819B8D4: ; 819B8D4 push {r4,r5,lr} ldr r5, =0x0300127c ldr r1, [r5] movs r0, 0 strb r0, [r1, 0x7] ldr r4, =0x02020630 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 .pool 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, =0x02020630 ldr r3, =0x0300127c 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 .pool 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, =gUnknown_085EEBB2 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 .pool thumb_func_end sub_819B9B4 thumb_func_start sub_819B9E8 sub_819B9E8: ; 819B9E8 push {r4,r5,lr} sub sp, 0xC ldr r5, =0x0300127c 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, =0x02021fc4 movs r1, 0xB muls r1, r0 ldr r0, =gSpeciesNames 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, =gUnknown_08610479 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 .pool 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, =0x0300127c ldr r0, [r0] ldrb r0, [r0, 0x5] cmp r0, 0x1 bne @0819BA88 ldr r2, =gUnknown_085EEBC1 b @0819BA9C .align 2, 0 .pool @0819BA88: cmp r0, 0x2 bne @0819BA94 ldr r2, =gUnknown_085EEBDB b @0819BA9C .align 2, 0 .pool @0819BA94: ldr r2, =gUnknown_085EEC2D cmp r0, 0x3 bne @0819BA9C ldr r2, =gUnknown_085EEBF6 @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 .pool 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, =gUnknown_085EEC50 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 .pool thumb_func_end sub_819BAC8 thumb_func_start sub_819BAFC sub_819BAFC: ; 819BAFC push {r4-r6,lr} sub sp, 0xC ldr r0, =0x0300127c 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, =gUnknown_08610476 str r4, [sp] movs r6, 0 str r6, [sp, 0x4] ldr r0, =gUnknown_085EEC15 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, =gUnknown_085EEC24 str r0, [sp, 0x8] movs r0, 0x3 movs r1, 0x1 movs r2, 0x7 movs r3, 0x11 bl box_print b @0819BB74 .align 2, 0 .pool @0819BB60: str r4, [sp] str r5, [sp, 0x4] ldr r0, =gUnknown_085EEC10 str r0, [sp, 0x8] movs r0, 0x3 movs r1, 0x1 movs r2, 0x7 movs r3, 0x11 bl box_print @0819BB74: ldr r0, =gUnknown_08610476 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] ldr r0, =gUnknown_085EEC1D 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 .pool 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, =gUnknown_08610476 str r5, [sp] movs r4, 0 str r4, [sp, 0x4] ldr r0, =gUnknown_085EEC49 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, =gUnknown_085EEC4D 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 .pool thumb_func_end sub_819BBA8 thumb_func_start sub_819BC04 sub_819BC04: ; 819BC04 push {lr} ldr r2, =0x030062e8 ldr r1, =gUnknown_0861041C ldr r0, =0x0300127c 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 .pool thumb_func_end sub_819BC04 thumb_func_start sub_819BC30 sub_819BC30: ; 819BC30 push {r4,lr} ldr r0, =0x0300127c 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 .pool @0819BC60: ldr r4, =0x0300127c 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 .pool @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, =0x0300127c ldr r0, [r0] ldrb r0, [r0, 0x5] cmp r0, 0x3 bhi @0819BCC4 movs r0, 0x1 b @0819BCC6 .align 2, 0 .pool @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, =0x0300127c 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 .pool thumb_func_end sub_819BCD0 thumb_func_start sub_819BCF8 sub_819BCF8: ; 819BCF8 push {r4,r5,lr} sub sp, 0x2C ldr r5, =0x0300127c 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 SpeciesToNationalPokedexNum 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 .pool 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, =0x0300127c 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, =0x0000ffff 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, =0x02020630 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 .pool thumb_func_end sub_819BD70 thumb_func_start sub_819BE20 sub_819BE20: ; 819BE20 ldr r1, =0x0300127c ldr r1, [r1] movs r2, 0xA8 lsls r2, 2 adds r1, r2 strb r0, [r1] bx lr .align 2, 0 .pool 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, =gUnknown_08610638 movs r1, 0x78 movs r2, 0x40 movs r3, 0x1 bl obj_add_from_template_forward_search ldr r6, =0x0300127c ldr r1, [r6] ldr r2, =0x00000299 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, =0x02020630 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, =0x0000ffff 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 .pool 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, =0x0300127c 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, =0x0000ffff 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, =0x02020630 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, =0x02020630 adds r0, r2 adds r0, 0x29 movs r1, 0 strb r1, [r0] b @0819C012 .align 2, 0 .pool @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, =0x0300127c 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 .pool 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, =0x02020630 ldr r6, =0x0300127c ldr r2, [r6] ldr r0, =0x00000295 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, =0x0000029d 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, =0x0000029d 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, =sub_819C1D0 movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r1, [r1] bl _call_via_r1 ldr r0, =nullsub_12 str r0, [r4, 0x1C] @0819C0DC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 ldr r4, =0x0300127c ldr r2, [r4] ldr r7, =0x00000295 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, =0x0000029d 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, =0x0000029d 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, =0x0000029d 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 .pool 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, =0x03005e00 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 .pool @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, =0x00001248 movs r0, 0x50 bl lcd_io_set ldr r1, =0x0000040b movs r0, 0x52 bl lcd_io_set b @0819C2C6 .align 2, 0 .pool @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, =0x03005e00 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, =0x02020630 ldr r0, =0x0300127c mov r8, r0 ldr r0, [r0] ldr r1, =0x00000299 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, =sub_819C100 str r1, [r0] ldr r0, =0x00000295 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, =nullsub_12 mov r10, r1 str r1, [r0] ldr r5, =0x0000029d 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 .pool @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, =gUnknown_08610638 adds r0, r4, 0 movs r1, 0x78 movs r2, 0x40 movs r3, 0x1 bl obj_add_from_template_forward_search ldr r6, =0x0300127c ldr r1, [r6] ldr r2, =0x00000299 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, =0x00000295 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, =0x0000029d adds r1, r4 strb r0, [r1] ldr r3, =0x02020630 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, =sub_819C040 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, =nullsub_12 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 .pool thumb_func_end sub_819C4B4 thumb_func_start sub_819C568 sub_819C568: ; 819C568 push {r4,lr} ldr r4, =0x0300127c 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, =sub_819C2D4 movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 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 .pool 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, =0x0203bc8c ldr r1, [r2] lsrs r0, 12 adds r0, r1 ldrh r6, [r0] ldr r0, =0x0300127c 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 .pool @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, =0x03005e00 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 .pool @0819C6C4: cmp r2, 0x2 beq @0819C7B4 b @0819C7D8 @0819C6CA: ldr r1, =0x0300127c ldr r0, [r1] ldr r3, =0x000002a7 adds r0, r3 strb r2, [r0] ldr r0, [r1] adds r3, 0x1 adds r0, r3 strb r2, [r0] ldr r0, [r1] ldr r1, =0x000002a6 adds r0, r1 movs r1, 0x1 strb r1, [r0] strh r1, [r5, 0x8] b @0819C7D8 .align 2, 0 .pool @0819C6F8: ldr r0, =0x0300127c ldr r3, [r0] ldr r2, =0x000002a2 adds r1, r3, r2 ldrb r1, [r1] adds r7, r0, 0 cmp r1, 0 beq @0819C7D8 ldr r1, =0x000002a9 adds r0, r3, r1 ldrb r4, [r0] cmp r4, 0 beq @0819C724 movs r0, 0x2 strh r0, [r5, 0x8] b @0819C7D8 .align 2, 0 .pool @0819C724: ldr r2, =0x000002a7 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 .pool @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, =0x000002a6 adds r1, r2, r3 movs r0, 0 b @0819C7D6 .align 2, 0 .pool @0819C790: cmp r0, 0 bne @0819C7D8 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 movs r1, 0x2 strh r1, [r0, 0x8] ldr r0, =0x000002a6 adds r1, r2, r0 movs r0, 0x1 b @0819C7D6 .align 2, 0 .pool @0819C7B4: ldr r0, =0x0300127c ldr r0, [r0] ldr r2, =0x000002a9 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 .pool @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, =0x020244ec ldr r5, =0x03001284 ldr r1, [r5] ldrb r0, [r1, 0x12] movs r6, 0x64 muls r0, r6 adds r0, r4 ldr r2, =0x02024744 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, =0x03005d90 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, =0x00000e78 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, =0x00000e74 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, =0x00000e79 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 .pool 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, =0x03005e00 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 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @0819C9F0 ldr r4, =0x03001284 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, =0x0203ce40 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce44 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce48 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce4c ldr r0, [r4] bl free str r5, [r4] bl Window_FreeMemory movs r0, 0x8 strh r0, [r6, 0x8] b @0819C9F0 .align 2, 0 .pool @0819C9C4: adds r0, r2, 0 bl remove_task ldr r2, =0x03001284 ldr r1, [r2] movs r0, 0x1 strb r0, [r1, 0x15] ldr r2, [r2] ldr r0, =0x02037714 movs r1, 0xF4 lsls r1, 1 adds r0, r1 ldrh r0, [r0] strh r0, [r2, 0x24] ldr r1, =0x020244ec ldrb r2, [r2, 0x3] ldr r0, =sub_819DC1C 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 .pool 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, =0x03001284 ldr r2, [r7] adds r0, r2, 0 adds r0, 0x30 ldrb r0, [r0] cmp r0, 0x1 beq @0819CAFE ldr r1, =0x03005e00 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 .pool @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, =0x020375f0 strh r1, [r0] b @0819CAFE .align 2, 0 .pool @0819CA68: movs r0, 0x2 strh r0, [r4, 0x8] ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] b @0819CAFE .align 2, 0 .pool @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, =0x0203ce40 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce44 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce48 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203ce4c ldr r0, [r4] bl free str r5, [r4] ldr r0, [r7] bl free str r5, [r7] bl Window_FreeMemory ldr r0, =sub_80861B0 bl set_callback2 adds r0, r6, 0 bl remove_task @0819CAFE: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001284 ldr r0, [r7] adds r0, 0x30 ldrb r0, [r0] cmp r0, 0x1 beq @0819CBD6 ldr r1, =0x03005e00 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 .pool @0819CB50: bl sub_819E9E0 movs r0, 0x5 strh r0, [r4, 0x8] b @0819CBD6 @0819CB5A: ldr r2, =0x030022c0 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 .pool @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, =0x03005e00 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, =sub_819CA08 b @0819CC16 .align 2, 0 .pool @0819CC04: movs r0, 0 strh r0, [r2, 0x8] ldr r1, =sub_819CE40 lsrs r0, r1, 16 strh r0, [r2, 0x14] strh r1, [r2, 0x16] movs r0, 0x1 strh r0, [r2, 0x12] ldr r0, =sub_819D770 @0819CC16: str r0, [r2] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =gUnknown_085EECBB bl sub_819EBEC ldr r0, =0x03001284 ldr r0, [r0] adds r0, 0x20 strb r5, [r0] movs r0, 0x4 strh r0, [r4, 0x8] ldr r1, =sub_819CBDC lsrs r0, r1, 16 strh r0, [r4, 0x14] strh r1, [r4, 0x16] ldr r0, =sub_819CB1C str r0, [r4] @0819CC5A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001284 ldr r1, [r0] ldr r0, [r1, 0x2C] adds r1, 0x30 movs r2, 0x1 bl sub_819F3F8 ldr r1, =0x03005e00 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, =sub_819CA08 b @0819CCC2 .align 2, 0 .pool @0819CCB0: movs r0, 0 strh r0, [r2, 0x8] ldr r1, =sub_819CE40 lsrs r0, r1, 16 strh r0, [r2, 0x14] strh r1, [r2, 0x16] movs r0, 0x1 strh r0, [r2, 0x12] ldr r0, =sub_819D770 @0819CCC2: str r0, [r2] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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, =0x03001284 ldr r1, [r4] adds r0, r1, 0 adds r0, 0x2D adds r1, 0x30 movs r2, 0x1 bl sub_819F2B4 ldr r0, =gUnknown_085EECF0 bl sub_819EBEC ldr r0, [r4] adds r0, 0x20 movs r1, 0x1 strb r1, [r0] movs r0, 0x4 strh r0, [r5, 0x8] ldr r1, =sub_819CC74 lsrs r0, r1, 16 strh r0, [r5, 0x14] strh r1, [r5, 0x16] ldr r0, =sub_819CB1C str r0, [r5] @0819CD1A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 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 .pool @0819CD60: cmp r0, 0x9 beq @0819CD88 b @0819CE36 @0819CD66: ldr r0, =0x03001284 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 .pool @0819CD88: ldr r0, =0x03001284 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 .pool @0819CDA4: ldr r7, =0x03001284 ldr r0, [r7] adds r0, 0x30 ldrb r0, [r0] cmp r0, 0x1 beq @0819CE36 ldr r2, =0x030022c0 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 .pool @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, =sub_819CE40 lsrs r0, r1, 16 strh r0, [r5, 0x14] strh r1, [r5, 0x16] mov r1, r8 strh r1, [r5, 0x12] ldr r0, =sub_819D770 str r0, [r5] b @0819CE36 .align 2, 0 .pool @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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r4, r0, r1 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @0819CE64 cmp r0, 0x1 beq @0819CE88 b @0819CF4C .align 2, 0 .pool @0819CE64: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @0819CF4C ldr r0, =0x03001284 ldr r0, [r0] adds r0, 0x22 movs r1, 0x1 strb r1, [r0] strh r1, [r4, 0x8] b @0819CF4C .align 2, 0 .pool @0819CE88: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] adds r5, r1, 0 ands r5, r0 cmp r5, 0 beq @0819CEBC movs r0, 0x5 bl audio_play ldr r0, =0x03001284 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 .pool @0819CEBC: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @0819CEF8 movs r0, 0x5 bl audio_play ldr r0, =0x03001284 ldr r0, [r0] adds r0, 0x22 strb r5, [r0] bl sub_819EE08 bl sub_819EAC0 ldr r1, =sub_819CC24 lsrs r0, r1, 16 strh r0, [r4, 0x14] strh r1, [r4, 0x16] strh r5, [r4, 0x8] strh r5, [r4, 0x12] ldr r0, =sub_819D588 str r0, [r4] b @0819CF4C .align 2, 0 .pool @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, =0x03005e00 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 .pool @0819CF7C: cmp r2, 0x2 beq @0819D03C b @0819D05C @0819CF82: ldr r1, =0x03001284 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 .pool @0819CFA0: ldr r1, =0x03001284 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 .pool @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, =0x03005e00 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 .pool @0819D03C: ldr r0, =0x03001284 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 .pool @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, =0x03005e00 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 .pool @0819D08C: cmp r1, 0x2 beq @0819D0BC b @0819D118 @0819D092: ldr r0, =0x03001284 ldr r0, [r0] adds r0, 0x27 strb r1, [r0] strh r1, [r4, 0x10] b @0819D0AE .align 2, 0 .pool @0819D0A4: ldr r0, =0x020378f4 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 .pool @0819D0BC: ldr r2, =0x03001284 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, =0x02037714 ldr r0, =0x02037b14 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 .pool 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, =0x03005e00 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 .pool @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, =0x03005e00 str r0, [sp, 0xC] @0819D174: lsls r0, r1, 24 asrs r4, r0, 24 mov r9, r0 cmp r4, 0x2 beq @0819D1F2 ldr r2, =0x02020630 ldr r3, =0x03001284 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, =0x03005e00 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 .pool @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, =0x02020630 ldr r4, =0x03001284 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, =0x03005e00 adds r1, 0x8 adds r0, r1 movs r3, 0 ldrsh r0, [r0, r3] cmp r0, 0x1 bne @0819D26A ldr r1, =0x03001284 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 .pool @0819D260: movs r7, 0 cmp r3, r0 bne @0819D26C movs r7, 0x1 b @0819D26C @0819D26A: movs r7, 0 @0819D26C: mov r6, r10 ldr r5, =0x03001284 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, =0x0000fff0 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 .pool @0819D2C0: movs r0, 0x64 bl gpu_pal_tags_index_of ldr r2, =0x03001284 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 .pool 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, =0x03005e00 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 .pool @0819D368: ldr r3, =0x02020630 ldr r2, =0x03001284 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 .pool @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, =0x02020630 ldr r6, =0x03001284 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 .pool @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, =0x02020630 @0819D40E: ldr r1, =0x03001284 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 .pool @0819D480: ldr r2, =0x02020630 ldr r0, =0x03001284 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 .pool @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, =0x02020630 ldr r6, =0x03001284 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 .pool @0819D510: movs r4, 0 lsls r1, r7, 2 mov r12, r1 mov r6, r8 adds r6, 0x10 ldr r5, =0x02020630 ldr r0, =0x03001284 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 .pool 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, =0x03005e00 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, =@0819D5BC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0819D5BC: .4byte @0819D5D4 .4byte @0819D5F0 .4byte @0819D60C .4byte @0819D63C .4byte @0819D6F0 .4byte @0819D73A @0819D5D4: ldr r0, =gUnknown_08610918 movs r1, 0xE0 movs r2, 0xA bl gpu_pal_apply bl sub_819ED34 movs r0, 0x5 bl Window_WriteStandardTileMap b @0819D622 .align 2, 0 .pool @0819D5F0: movs r0, 0x3 bl sub_819EA64 ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @0819D762 .align 2, 0 .pool @0819D60C: movs r0, 0x80 lsls r0, 7 ldr r1, =gUnknown_0860F13C adds r1, 0x4A ldrh r1, [r1] str r1, [sp] movs r1, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 @0819D622: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldrh r1, [r0, 0x8] adds r1, 0x1 strh r1, [r0, 0x8] b @0819D762 .align 2, 0 .pool @0819D63C: ldr r0, =0x02037fd4 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, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x14] cmp r0, 0x1 bne @0819D6B0 ldr r0, =sub_819D324 movs r1, 0 bl AddTask lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x03005e00 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 .pool @0819D6B0: ldr r0, =sub_819D324 movs r1, 0 bl AddTask lsls r0, 24 lsrs r4, r0, 24 ldr r3, =0x03005e00 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 .pool @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, =sub_819D324 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 .pool @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, =0x03001284 ldr r0, [r1] adds r0, 0x30 ldrb r0, [r0] adds r3, r1, 0 cmp r0, 0x1 bne @0819D78C b @0819D9D8 @0819D78C: ldr r0, =0x03005e00 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, =@0819D7BC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_819D324 movs r1, 0 bl AddTask lsls r0, 24 lsrs r4, r0, 24 ldr r3, =0x03005e00 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 .pool @0819D828: ldr r0, =sub_819D324 movs r1, 0 bl AddTask lsls r0, 24 lsrs r4, r0, 24 ldr r3, =0x03005e00 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 .pool @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, =sub_819D324 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 .pool @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, =0x02037b14 ldr r0, =gUnknown_0860F13C 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 .pool @0819D8F4: movs r0, 0x80 lsls r0, 7 ldr r1, =gUnknown_0860F13C 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 .pool @0819D910: ldr r0, =0x02037fd4 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 .pool @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, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x14] cmp r0, 0 bne @0819D964 ldr r0, =gUnknown_085EEC73 bl sub_819EBEC b @0819D96A .align 2, 0 .pool @0819D964: ldr r0, =gUnknown_085EEC8B bl sub_819EBEC @0819D96A: ldr r0, =0x03001284 ldr r1, [r0] ldrb r0, [r1, 0x3] cmp r0, 0x2 bhi @0819D98C ldr r2, =0x02020630 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, =0x03005e00 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 .pool @0819D9B0: bl sub_819EEF0 bl sub_819EADC ldr r0, =0x03001284 ldr r0, [r0] adds r0, 0x22 movs r1, 0x1 strb r1, [r0] ldr r1, =0x03005e00 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 .pool 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, =0x03001284 ldr r0, [r0] adds r0, 0x30 ldrb r0, [r0] cmp r0, 0x1 bne @0819DA00 b @0819DBCA @0819DA00: ldr r0, =0x03005e00 lsls r2, r6, 2 adds r1, r2, r6 lsls r1, 3 adds r1, r0 movs r3, 0x8 ldrsh r1, [r1, r3] adds r3, r0, 0 adds r7, r2, 0 cmp r1, 0x4 bls @0819DA18 b @0819DBCA @0819DA18: lsls r0, r1, 2 ldr r1, =@0819DA30 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0819DA30: .4byte @0819DA44 .4byte @0819DA58 .4byte @0819DA8C .4byte @0819DABC .4byte @0819DBB0 @0819DA44: bl sub_819EEF0 ldr r0, =0x03005e00 adds r1, r7, r6 lsls r1, 3 adds r1, r0 b @0819DB96 .align 2, 0 .pool @0819DA58: bl sub_819EADC ldr r2, =0x02020630 ldr r0, =0x03001284 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, =0x03005e00 adds r1, r7, r6 lsls r1, 3 adds r1, r0 b @0819DB96 .align 2, 0 .pool @0819DA8C: ldr r0, =sub_819D12C movs r1, 0 bl AddTask ldr r2, =0x03005e00 ldr r0, =0x03001284 ldr r0, [r0] adds r0, 0x21 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, =sub_819D064 str r1, [r0] b @0819DB90 .align 2, 0 .pool @0819DABC: ldr r0, =sub_819D12C bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @0819DACA b @0819DBCA @0819DACA: ldr r2, =0x03005e00 ldr r4, =0x03001284 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 .pool @0819DB04: movs r0, 0 bl sub_819F048 movs r2, 0 ldr r5, =0x02020630 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, =0x02020630 ldr r4, =0x03001284 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, =0x03005e00 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, =sub_819CF54 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 .pool @0819DBB0: adds r0, r7, r6 lsls r0, 3 adds r0, r3 movs r1, 0 strh r1, [r0, 0x8] ldr r2, =sub_819CE40 lsrs r1, r2, 16 strh r1, [r0, 0x14] strh r2, [r0, 0x16] movs r1, 0x1 strh r1, [r0, 0x12] ldr r1, =sub_819D770 str r1, [r0] @0819DBCA: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_819D9EC thumb_func_start sub_819DBD8 sub_819DBD8: ; 819DBD8 push {r4,r5,lr} ldr r5, =0x03001284 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 .pool thumb_func_end sub_819DBD8 thumb_func_start sub_819DC00 sub_819DC00: ; 819DC00 push {lr} ldr r0, =0x03001284 movs r1, 0 str r1, [r0] ldr r0, =sub_819DC1C bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_819DC00 thumb_func_start sub_819DC1C sub_819DC1C: ; 819DC1C push {r4-r6,lr} sub sp, 0xC ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r0, r1, r2 ldrb r0, [r0] adds r2, r1, 0 cmp r0, 0xF bls @0819DC32 b @0819E0AA @0819DC32: lsls r0, 2 ldr r1, =@0819DC44 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x05006000 add r0, sp, 0x8 bl CpuSet movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_086108B8 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r0, =gUnknown_086108C8 bl Window_InitFromTemplates bl TextBox_ResetSomeField ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0819E00E .align 2, 0 .pool @0819DCD4: ldr r5, =0x0203ce40 movs r4, 0x88 lsls r4, 3 adds r0, r4, 0 bl malloc str r0, [r5] ldr r5, =0x0203ce44 adds r0, r4, 0 bl malloc_and_clear str r0, [r5] ldr r5, =0x0203ce48 movs r4, 0x80 lsls r4, 4 adds r0, r4, 0 bl malloc str r0, [r5] ldr r5, =0x0203ce4c 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 .pool @0819DDA8: bl sub_80A1A74 bl reset_all_obj_data bl clear_tasks bl gpu_pal_allocator_reset bl dp13_810BB8C ldr r0, =gUnknown_08DC0754 ldr r5, =0x0203ce40 ldr r1, [r5] movs r2, 0x88 lsls r2, 2 bl CpuSet ldr r0, =gUnknown_0861033C ldr r4, =0x0203ce44 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, =gUnknown_08DC0B94 ldr r4, =0x0203ce48 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, =gUnknown_08DC0714 movs r1, 0 movs r2, 0x40 bl gpu_pal_apply ldr r4, =gUnknown_08610918 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, =gUnknown_0861039C movs r1, 0x20 movs r2, 0x4 bl gpu_pal_apply ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0819E00E .align 2, 0 .pool @0819DE68: ldr r0, =0x0203ce4c ldr r1, [r0] movs r0, 0x3 bl bg_set_tilemap ldr r1, =gUnknown_0861023C 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 .pool @0819DE94: ldr r0, =gUnknown_086106B0 bl gpu_pal_obj_alloc_and_load_multiple ldr r0, =gUnknown_08610650 bl gpu_tile_obj_alloc_and_load_multiple ldr r0, =gUnknown_086106A0 bl gpu_tile_obj_decompress_and_load ldr r0, =sub_819C7FC bl SetVBlankCallback ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0819E00E .align 2, 0 .pool @0819DECC: ldr r0, =0x03001284 ldr r1, [r0] ldrb r0, [r1, 0x15] cmp r0, 0x1 bne @0819DEDC ldr r0, =0x0203cf20 ldrb r0, [r0] strb r0, [r1, 0x3] @0819DEDC: movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 b @0819E00E .align 2, 0 .pool @0819DEEC: bl sub_819DBD8 bl sub_819E0C0 ldr r0, =0x03001284 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 .pool @0819DF10: ldr r0, =gUnknown_085EEC73 bl sub_819EBEC movs r0, 0x2 bl Window_WriteStandardTileMap ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0819E00E .align 2, 0 .pool @0819DF30: bl sub_819EFA8 movs r0, 0x8 bl Window_WriteStandardTileMap b @0819E006 @0819DF3C: ldr r0, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x15] cmp r0, 0 bne @0819DF4A bl sub_819EB4C @0819DF4A: movs r0, 0x1 bl Window_WriteStandardTileMap ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0819E00E .align 2, 0 .pool @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, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x15] cmp r0, 0 beq @0819E006 bl sub_819EE08 b @0819E006 .align 2, 0 .pool @0819DF8C: bl sub_819ED78 movs r0, 0x3 bl Window_WriteStandardTileMap ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @0819E00E .align 2, 0 .pool @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, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x15] cmp r0, 0x1 bne @0819E000 movs r0, 0x3 bl gpu_sync_bg_show ldr r1, =0x00001248 movs r0, 0x50 bl lcd_io_set ldr r1, =0x0000040b movs r0, 0x52 bl lcd_io_set b @0819E006 .align 2, 0 .pool @0819E000: movs r0, 0x3 bl gpu_sync_bg_hide @0819E006: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @0819E00E: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @0819E0AA .align 2, 0 .pool @0819E01C: ldr r0, =sub_819CF54 movs r1, 0 bl AddTask ldr r6, =0x03001284 ldr r1, [r6] adds r1, 0x21 strb r0, [r1] ldr r0, [r6] ldrb r5, [r0, 0x15] cmp r5, 0 bne @0819E06C ldr r4, =0x03005e00 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, =sub_819CE40 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 .pool @0819E06C: bl sub_819EAF8 ldr r4, =0x03005e00 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, =sub_819CD34 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, =sub_819C7E0 bl set_callback2 @0819E0AA: add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08610834 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, =0x03001284 movs r7, 0 ldr r5, =0x02020630 @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, =0x03001284 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, =0x02020630 adds r0, r4 movs r5, 0x20 ldrsh r1, [r0, r5] ldr r0, =gUnknown_0861084C 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, =gUnknown_08610864 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, =gUnknown_0861087C 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, =0x02020630 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, =gUnknown_0861084C 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, =gUnknown_08610864 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, =gUnknown_0861084C 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, =gUnknown_08610864 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, =gUnknown_0861084C 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, =gUnknown_08610864 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, =gUnknown_0861084C 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, =gUnknown_08610864 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, =0x02020630 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, =0x03001284 mov r8, r3 ldr r0, =0x02020630 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 .pool @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, =0x03001284 ldr r0, [r6] adds r0, 0x5 adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 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, =0x03001284 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, =0x02020630 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, =0x03001284 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, =0x02020630 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 .pool 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, =0x02020630 ldr r5, =0x03001284 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 .pool @0819E65C: ldr r2, =0x02020630 ldr r3, =0x03001284 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 .pool 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, =0x03001284 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 .pool @0819E6C0: ldr r0, =0x03001284 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 .pool @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, =0x03001284 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 .pool @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, =0x03001284 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 .pool @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, =0x03001284 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 .pool @0819E774: movs r0, 0 b @0819E78E @0819E778: ldr r0, =0x03001284 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 .pool @0819E78C: movs r0, 0x1 @0819E78E: strb r0, [r1, 0x16] ldr r3, =0x02020630 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 .pool 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, =0x03001284 ldr r1, [r0] ldrb r3, [r1] adds r2, r0, 0 cmp r3, 0x2 beq @0819E7E8 adds r0, r3, 0x1 b @0819E802 .align 2, 0 .pool @0819E7E8: movs r0, 0 b @0819E802 @0819E7EC: ldr r0, =0x03001284 ldr r1, [r0] ldrb r3, [r1] adds r2, r0, 0 cmp r3, 0 beq @0819E800 subs r0, r3, 0x1 b @0819E802 .align 2, 0 .pool @0819E800: movs r0, 0x2 @0819E802: strb r0, [r1] ldr r3, =0x02020630 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 .pool 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, =0x02020630 mov r12, r0 ldr r7, =0x03001284 @0819E856: cmp r6, 0x2 bne @0819E898 ldr r5, =0x02020630 ldr r3, =0x03001284 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 .pool @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, =0x02020630 ldr r4, =0x03001284 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 .pool thumb_func_end sub_819E8EC thumb_func_start sub_819E944 sub_819E944: ; 819E944 push {r4,r5,lr} ldr r0, =0x03001284 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 .pool @0819E95C: movs r0, 0 strb r0, [r3] @0819E960: ldr r4, =0x02020630 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 .pool thumb_func_end sub_819E944 thumb_func_start sub_819E9E0 sub_819E9E0: ; 819E9E0 push {r4,r5,lr} ldr r5, =0x03001284 ldr r1, [r5] movs r0, 0 strb r0, [r1, 0x16] ldr r4, =0x02020630 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 .pool 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, =0x02020630 ldr r3, =0x03001284 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 .pool 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, =gUnknown_085EEC66 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 .pool 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, =0x03001284 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 .pool @0819EB70: ldrb r2, [r1, 0x3] ldrb r0, [r1, 0x14] cmp r0, 0 bne @0819EB84 movs r0, 0x64 muls r0, r2 ldr r1, =0x020244ec b @0819EB8A .align 2, 0 .pool @0819EB84: movs r0, 0x64 muls r0, r2 ldr r1, =0x02024744 @0819EB8A: adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r1, r0, 16 ldr r4, =0x02021fc4 movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames 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, =gUnknown_08610925 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 .pool 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, =gUnknown_08610922 str r5, [sp] movs r4, 0 str r4, [sp, 0x4] ldr r0, =gUnknown_085EECAA 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, =gUnknown_085EECA5 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, =gUnknown_085EECB2 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 .pool 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, =gUnknown_08610922 str r5, [sp] movs r4, 0 str r4, [sp, 0x4] ldr r0, =gUnknown_085EECCA 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, =gUnknown_085EECCE 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 .pool 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, =gUnknown_08610922 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 .pool 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, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x14] cmp r0, 0 beq @0819ED56 cmp r0, 0x1 bne @0819ED60 ldr r0, =gUnknown_085EECD1 movs r1, 0 movs r2, 0x5 bl sub_819ECF0 @0819ED56: ldr r0, =gUnknown_085EECDD 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 .pool 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, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x14] cmp r0, 0 beq @0819ED9A cmp r0, 0x1 bne @0819EDA4 ldr r0, =gUnknown_085EECD1 movs r1, 0x8 movs r2, 0x3 bl sub_819ECF0 @0819ED9A: ldr r0, =gUnknown_085EECDD 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 .pool 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, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x14] cmp r0, 0x1 bne @0819EDF6 ldr r0, =gUnknown_085EECD1 movs r1, 0x8 movs r2, 0x3 bl sub_819ECF0 b @0819EDF6 .align 2, 0 .pool @0819EDEC: ldr r0, =gUnknown_085EECDD 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 .pool thumb_func_end sub_819EDBC thumb_func_start sub_819EE08 sub_819EE08: ; 819EE08 push {r4,lr} sub sp, 0x18 ldr r0, =gUnknown_08610918 add r1, sp, 0xC movs r2, 0x4 bl CpuSet ldr r0, =0x03001284 ldr r2, [r0] ldrb r0, [r2, 0x15] cmp r0, 0 bne @0819EE3C add r0, sp, 0xC ldr r1, =0x02037b14 movs r2, 0xE4 lsls r2, 1 adds r1, r2 ldrh r1, [r1] strh r1, [r0, 0x8] b @0819EE42 .align 2, 0 .pool @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, =0x03001284 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 .pool @0819EE74: ldrb r2, [r1, 0x3] ldrb r0, [r1, 0x14] cmp r0, 0 bne @0819EE88 movs r0, 0x64 muls r0, r2 ldr r1, =0x020244ec b @0819EE8E .align 2, 0 .pool @0819EE88: movs r0, 0x64 muls r0, r2 ldr r1, =0x02024744 @0819EE8E: adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r1, r0, 16 ldr r4, =0x02021fc4 movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames 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, =gUnknown_08610925 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 .pool thumb_func_end sub_819EE08 thumb_func_start sub_819EEF0 sub_819EEF0: ; 819EEF0 push {r4,lr} sub sp, 0xC ldr r0, =gUnknown_08610918 movs r1, 0xE0 movs r2, 0xA bl gpu_pal_apply ldr r0, =0x020378f4 ldr r1, =0x02037cd4 movs r2, 0x5 bl CpuSet ldr r0, =0x03001284 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 .pool @0819EF2C: ldrb r2, [r1, 0x3] ldrb r0, [r1, 0x14] cmp r0, 0 bne @0819EF40 movs r0, 0x64 muls r0, r2 ldr r1, =0x020244ec b @0819EF46 .align 2, 0 .pool @0819EF40: movs r0, 0x64 muls r0, r2 ldr r1, =0x02024744 @0819EF46: adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r1, r0, 16 ldr r4, =0x02021fc4 movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames 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, =gUnknown_08610925 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 .pool thumb_func_end sub_819EEF0 thumb_func_start sub_819EFA8 sub_819EFA8: ; 819EFA8 push {r4-r6,lr} sub sp, 0x2C ldr r6, =0x03001284 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 .pool @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, =0x020244ec b @0819EFF2 .align 2, 0 .pool @0819EFEC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 @0819EFF2: adds r0, r1 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 bl SpeciesToNationalPokedexNum 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 .pool 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, =0x03001284 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 .pool @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, =gUnknown_08610928 b @0819F092 .align 2, 0 .pool @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, =gUnknown_08610948 @0819F092: str r0, [r1, 0x18] @0819F094: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_819F048 thumb_func_start sub_819F0A0 sub_819F0A0: ; 819F0A0 push {lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x03001280 ldr r2, =gUnknown_086108AC ldr r1, =0x03001284 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 .pool 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, =0x03001284 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 strh r5, [r0, 0x8] ldr r1, =sub_819D9EC str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_819F0CC thumb_func_start sub_819F114 sub_819F114: ; 819F114 lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0x6 strh r0, [r1, 0x8] ldr r0, =sub_819C90C str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03001284 ldr r1, [r0] ldr r0, [r1, 0x2C] adds r1, 0x30 movs r2, 0x1 bl sub_819F3F8 movs r0, 0x3 bl sub_819EA64 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0 strh r1, [r0, 0x8] ldr r2, =sub_819CE40 lsrs r1, r2, 16 strh r1, [r0, 0x14] strh r2, [r0, 0x16] movs r1, 0x1 strh r1, [r0, 0x12] ldr r1, =sub_819D770 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_819F134 thumb_func_start sub_819F184 sub_819F184: ; 819F184 push {lr} lsls r0, 24 lsrs r0, 24 ldr r3, =0x03001280 ldr r1, =0x03001284 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 .pool thumb_func_end sub_819F184 thumb_func_start sub_819F1AC sub_819F1AC: ; 819F1AC lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_819CC24 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, =sub_819D588 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_819F1AC thumb_func_start sub_819F1DC sub_819F1DC: ; 819F1DC lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r2, =sub_819D9EC 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, =sub_819D588 str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03001284 ldr r1, [r5] ldrb r0, [r1, 0x14] cmp r0, 0 bne @0819F240 ldr r3, =0x03005e00 lsls r4, r6, 2 adds r0, r4, r6 lsls r0, 3 adds r0, r3 ldr r2, =sub_819CD34 lsrs r1, r2, 16 strh r1, [r0, 0x14] strh r2, [r0, 0x16] movs r1, 0x2 strh r1, [r0, 0x12] b @0819F292 .align 2, 0 .pool @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, =0x03005e00 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, =sub_819F488 b @0819F29E .align 2, 0 .pool @0819F278: ldr r4, =0x03005e00 lsls r5, r6, 2 adds r0, r5, r6 lsls r0, 3 adds r0, r4 ldr r2, =sub_819CCD4 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, =sub_819D588 @0819F29E: str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08610894 movs r1, 0x78 movs r2, 0x40 movs r3, 0x1 bl obj_add_from_template_forward_search strb r0, [r4] ldr r2, =0x02020630 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, =sub_819F600 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 .pool 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, =gUnknown_08610894 movs r1, 0x78 movs r2, 0x40 movs r3, 0x1 bl obj_add_from_template_forward_search ldr r6, =0x03001284 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, =0x02020630 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, =0x020244ec 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, =0x0000ffff 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 .pool 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, =sub_819F7B4 movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r5, [r1, 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 .pool 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, =0x02020630 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 .pool 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, =0x03001284 ldr r0, [r1] adds r0, 0x30 ldrb r0, [r0] adds r3, r1, 0 cmp r0, 0x1 beq @0819F58A ldr r2, =0x03005e00 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, =@0819F4C8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @0819F4C8: .4byte @0819F4DC .4byte @0819F4F8 .4byte @0819F52C .4byte @0819F548 .4byte @0819F568 @0819F4DC: ldr r0, =gUnknown_085EED0A bl sub_819EBEC ldr r0, =0x03001284 ldr r0, [r0] adds r0, 0x20 movs r1, 0 strb r1, [r0] b @0819F54E .align 2, 0 .pool @0819F4F8: ldr r0, =0x030022c0 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, =0x03001284 ldr r1, [r0] ldr r0, [r1, 0x2C] adds r1, 0x30 movs r2, 0x1 bl sub_819F3F8 b @0819F54E .align 2, 0 .pool @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, =gUnknown_085EEC8B bl sub_819EBEC @0819F54E: ldr r0, =0x03005e00 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 .pool @0819F568: bl sub_819EEF0 bl sub_819EADC ldr r0, =0x03001284 ldr r0, [r0] adds r0, 0x22 movs r1, 0x1 strb r1, [r0] ldr r1, =0x03005e00 adds r0, r5, r4 lsls r0, 3 adds r0, r1 ldrh r1, [r0, 0x12] strh r1, [r0, 0x8] ldr r1, =sub_819CE40 str r1, [r0] @0819F58A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02024744 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, =0x03001284 ldr r0, [r0] ldrb r0, [r0, 0x12] cmp r4, r0 beq @0819F5EC movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec 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 .pool @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, =sub_819F69C movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldrh r2, [r4, 0x3C] strh r2, [r1, 0x16] ldr r1, [r1] bl _call_via_r1 ldr r0, =nullsub_12 str r0, [r4, 0x1C] @0819F640: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03001284 ldr r0, [r0] adds r0, 0x30 movs r1, 0 strb r1, [r0] b @0819F68E .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =0x00001248 movs r0, 0x50 bl lcd_io_set ldr r1, =0x0000040b movs r0, 0x52 bl lcd_io_set b @0819F7A6 .align 2, 0 .pool @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, =0x03005e00 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 .pool @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, =0x03005e00 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, =0x02020630 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, =sub_819F654 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 .pool @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, =0x03001284 ldr r1, [r0] ldrb r0, [r1, 0x14] cmp r0, 0 bne @0819F900 ldrb r1, [r1, 0x3] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec b @0819F908 .align 2, 0 .pool @0819F900: ldrb r1, [r1, 0x3] movs r0, 0x64 muls r1, r0 ldr r0, =0x02024744 @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, =0x0000ffff str r0, [sp, 0xC] adds r0, r4, 0 adds r2, r5, 0 movs r3, 0x1 bl sub_818D7D8 ldr r2, =0x03001284 ldr r1, [r2] adds r1, 0x2C movs r3, 0 strb r0, [r1] ldr r4, =0x02020630 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 .pool 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, =0x03005d90 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, =0x02021cc4 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, =0x0000011b adds r0, r1 ldrb r1, [r0] mov r0, r8 bl sub_8009308 ldr r0, =0x02021dc4 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, =gUnknown_08611330 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, =0x02021fc4 bl ExpandTextCodes pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000ffff 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 .pool 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, =0x03005d90 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, =0x0000ffff 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, =0x03005d90 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, =gUnknown_82E9531 ldrb r1, [r4] ldr r3, =0x0000011b 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 .pool thumb_func_end sub_819FAA0 thumb_func_start sub_819FBB0 sub_819FBB0: ; 819FBB0 ldr r0, =0x03005d90 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 .pool thumb_func_end sub_819FBB0 thumb_func_start sub_819FBC8 sub_819FBC8: ; 819FBC8 push {r4,r5,lr} ldr r2, =0x03005d90 ldr r0, [r2] adds r0, 0xDE ldrb r0, [r0] cmp r0, 0 bne @0819FC10 adds r4, r2, 0 ldr r5, =gUnknown_08611548 @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 .pool @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, =0x03005d90 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 .pool 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, =0x03005d90 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 .pool 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, =0x030062ec @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 .pool @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, =gUnknown_086114D3 @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, =0x030062ec 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, =0x03005d90 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, =0x03005d90 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, =0x03005d90 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, =0x030062ec 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, =0x030062ec 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, =0x03005d90 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, =0x030062ec 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 .pool 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, =0x03005d90 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 .pool @0819FFE0: movs r4, 0 ldr r2, =0x03005d90 @0819FFE4: ldr r3, =gUnknown_08610970 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, =gLevelUpLearnsetPointers 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, =0x0000ffff 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, =0x000001ff 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, =0x00000121 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 .pool @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, =0x000001ff 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 .pool @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, =gUnknown_08611370 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, =0x030062ec 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 .pool 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, =0x030062ec 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 .pool @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, =0x03005d90 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, =gLevelUpLearnsetPointers lsls r0, r2, 2 adds r0, r1 ldr r6, [r0] movs r5, 0 ldrh r1, [r6] ldr r3, =0x0000ffff 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, =0x000001ff @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 .pool 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, =0x03005d90 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 .pool @081A02B8: movs r4, 0 movs r3, 0 adds r0, r2, 0 adds r0, 0xB8 ldrb r0, [r0] lsls r0, 30 ldr r1, =gUnknown_08610970 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 .pool 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, =0x03005d90 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, =0x03005d90 ldr r6, =gUnknown_086109A4 @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, =0x03005d90 @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 .pool @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, =@081A050C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_085EAEB1 str r0, [sp, 0xC] ldr r0, =gUnknown_085EAEB8 str r0, [sp, 0x10] b @081A0652 .align 2, 0 .pool @081A0540: movs r7, 0x3 movs r1, 0x12 mov r10, r1 movs r6, 0x6 movs r4, 0 ldr r0, =gSpeciesNames mov r9, r0 ldr r0, =0x03005d90 ldr r3, [r0] movs r1, 0xB2 adds r1, r3 mov r12, r1 adds r5, r3, 0 adds r5, 0xB0 ldr r0, =gUnknown_086109A4 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 .pool @081A05B4: movs r0, 0x12 mov r10, r0 movs r6, 0x8 ldr r0, =0x03005d90 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, =0x030062f0 ldr r3, [r0] ldrh r0, [r3, 0x2] movs r2, 0xB muls r0, r2 ldr r1, =gSpeciesNames 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 .pool @081A05F4: movs r1, 0x11 mov r10, r1 movs r6, 0x8 ldr r0, =0x030062f0 ldr r3, [r0] ldrh r0, [r3, 0x4] movs r2, 0xD muls r0, r2 ldr r1, =gMoveNames 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 .pool @081A061C: movs r0, 0x12 mov r10, r0 movs r6, 0x8 ldr r0, =gUnknown_085ED193 str r0, [sp, 0xC] ldr r0, =gUnknown_085ED198 str r0, [sp, 0x10] b @081A0652 .align 2, 0 .pool @081A0634: movs r1, 0x14 mov r10, r1 movs r6, 0x8 ldr r0, =gUnknown_085EAE62 str r0, [sp, 0xC] ldr r0, =gUnknown_085EAE66 str r0, [sp, 0x10] b @081A0652 .align 2, 0 .pool @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, =0x03005e08 adds r4, r0, r1 movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0 bne @081A0730 bl ProcessMenuInputNoWrapAround b @081A0734 .align 2, 0 .pool @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, =0x020375f0 movs r0, 0x7F strh r0, [r1] b @081A0768 .align 2, 0 .pool @081A0764: ldr r0, =0x020375f0 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 .pool 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, =sub_81A070C movs r1, 0x50 bl AddTask lsls r0, 24 lsrs r2, r0, 24 ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r1, r0, r1 strh r4, [r1, 0x10] cmp r5, 0x3 bls @081A0840 movs r0, 0x1 b @081A0842 .align 2, 0 .pool @081A0840: movs r0, 0 @081A0842: strh r0, [r1, 0x12] ldr r1, =0x03005e00 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 .pool thumb_func_end sub_81A0804 thumb_func_start sub_81A085C sub_81A085C: ; 81A085C push {lr} ldr r1, =gUnknown_086114E0 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A085C thumb_func_start sub_81A087C sub_81A087C: ; 81A087C push {r4-r7,lr} bl sub_819FBC8 ldr r3, =0x03005d90 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, =0x03005d90 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 .pool 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, =0x020375f0 strh r1, [r0] b @081A095A .align 2, 0 .pool @081A0954: ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] @081A095A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A093C thumb_func_start sub_81A0964 sub_81A0964: ; 81A0964 push {lr} ldr r0, =0x020375e2 ldrb r0, [r0] bl sub_819FC40 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 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 .pool thumb_func_end sub_81A0990 thumb_func_start sub_81A09B4 sub_81A09B4: ; 81A09B4 ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB1 ldrb r0, [r0] lsls r0, 26 lsrs r0, 28 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81A09B4 thumb_func_start sub_81A09D0 sub_81A09D0: ; 81A09D0 push {lr} ldr r3, =0x03005d90 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, =0x020375f0 movs r0, 0 strh r0, [r1] b @081A0A1C .align 2, 0 .pool @081A09F4: ldr r2, =0x020375f0 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 .pool @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, =0x020375e2 ldrb r0, [r0] bl sub_81A04E4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375e2 ldrh r0, [r0] cmp r0, 0 beq @081A0A64 ldr r0, =script_env_2_enable_and_set_ctx_running bl sub_81A172C b @081A0A68 .align 2, 0 .pool @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, =0x020375e4 ldrh r0, [r1] cmp r0, 0x6 bne @081A0A94 ldr r1, =gUnknown_08610FF0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 3 b @081A0C66 .align 2, 0 .pool @081A0A94: cmp r0, 0x7 bne @081A0AB0 ldr r1, =gUnknown_08610FF0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 3 adds r1, 0x4 b @081A0C66 .align 2, 0 .pool @081A0AB0: cmp r0, 0x8 bne @081A0ACC ldr r1, =gUnknown_086111B0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 3 b @081A0C66 .align 2, 0 .pool @081A0ACC: cmp r0, 0x9 bne @081A0AE8 ldr r1, =gUnknown_086111B0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 3 adds r1, 0x4 b @081A0C66 .align 2, 0 .pool @081A0AE8: cmp r0, 0x4 bne @081A0B04 ldr r1, =gUnknown_08611230 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 3 b @081A0C66 .align 2, 0 .pool @081A0B04: cmp r0, 0x5 bne @081A0B20 ldr r1, =gUnknown_08611230 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 3 adds r1, 0x4 b @081A0C66 .align 2, 0 .pool @081A0B20: cmp r0, 0xA bne @081A0B40 ldr r2, =gUnknown_08611070 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 b @081A0BD6 .align 2, 0 .pool @081A0B40: cmp r0, 0xB bne @081A0B5C ldr r1, =gUnknown_086112B0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 3 b @081A0C66 .align 2, 0 .pool @081A0B5C: cmp r0, 0xC bne @081A0B7C ldr r2, =gUnknown_08611070 ldr r0, =0x03005d90 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 .pool @081A0B7C: cmp r0, 0xD bne @081A0B9C ldr r2, =gUnknown_08611070 ldr r0, =0x03005d90 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 .pool @081A0B9C: ldrh r0, [r1] cmp r0, 0x10 bne @081A0BC0 ldr r2, =gUnknown_08611070 ldr r0, =0x03005d90 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 .pool @081A0BC0: cmp r0, 0xE bne @081A0BE4 ldr r2, =gUnknown_08611070 ldr r0, =0x03005d90 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 .pool @081A0BE4: cmp r0, 0xF bne @081A0C00 ldr r1, =gUnknown_086112B0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 3 adds r1, 0x4 b @081A0C66 .align 2, 0 .pool @081A0C00: cmp r0, 0 bne @081A0C1C ldr r1, =gUnknown_08610EF0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 4 b @081A0C66 .align 2, 0 .pool @081A0C1C: cmp r0, 0x1 bne @081A0C38 ldr r1, =gUnknown_08610EF0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 4 adds r1, 0x4 b @081A0C66 .align 2, 0 .pool @081A0C38: cmp r0, 0x2 bne @081A0C54 ldr r1, =gUnknown_08610EF0 ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB0 ldrb r0, [r0] lsls r0, 4 adds r1, 0x8 b @081A0C66 .align 2, 0 .pool @081A0C54: cmp r0, 0x3 bne @081A0C74 ldr r1, =gUnknown_08610EF0 ldr r0, =0x03005d90 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 .pool @081A0C74: bl script_env_2_enable_and_set_ctx_running b @081A0C8E @081A0C7A: ldr r0, =0x02021fc4 bl ExpandTextCodes movs r0, 0x1 bl get_map_name ldr r0, =sub_81A0A34 movs r1, 0x1 bl AddTask @081A0C8E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 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, =0x020375f0 movs r0, 0x2 b @081A0D34 .align 2, 0 .pool @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, =0x020375f0 movs r0, 0x4 b @081A0D34 .align 2, 0 .pool @081A0D18: ldr r1, =0x020375f0 movs r0, 0x3 b @081A0D34 .align 2, 0 .pool @081A0D24: ldr r1, =0x020375f0 movs r0, 0x1 b @081A0D34 .align 2, 0 .pool @081A0D30: ldr r1, =0x020375f0 movs r0, 0x5 @081A0D34: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A0CC0 thumb_func_start sub_81A0D40 sub_81A0D40: ; 81A0D40 push {r4,lr} ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0 beq @081A0D6E ldr r4, =0x020375e4 ldr r0, =0x03005d90 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 .pool thumb_func_end sub_81A0D40 thumb_func_start sub_81A0D80 sub_81A0D80: ; 81A0D80 push {lr} ldr r0, =0x03005d90 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, =0x020375e2 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 .pool @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, =0x03005d90 ldr r0, [r1] adds r0, 0xB8 ldrb r0, [r0] lsls r0, 30 ldr r3, =0x030062f0 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, =0x020375e2 ldrh r0, [r0] cmp r0, 0x2 bne @081A0E88 ldr r0, =0x03005d90 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, =gUnknown_08610970 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 .pool @081A0E88: cmp r0, 0x3 bne @081A0F54 ldr r0, =0x03005d90 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, =gUnknown_08610970 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 .pool @081A0F54: cmp r0, 0x4 bne @081A0FCE ldr r0, =0x03005d90 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, =gUnknown_08610970 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 .pool thumb_func_end sub_81A0DD4 thumb_func_start sub_81A0FE4 sub_81A0FE4: ; 81A0FE4 push {r4,lr} ldr r4, =0x030062f0 ldr r0, [r4] bl free movs r0, 0 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A0FE4 thumb_func_start sub_81A0FFC sub_81A0FFC: ; 81A0FFC push {r4-r6,lr} sub sp, 0x10 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x1 beq @081A1028 cmp r0, 0x1 bgt @081A1018 cmp r0, 0 beq @081A101E b @081A11E6 .align 2, 0 .pool @081A1018: cmp r0, 0x2 beq @081A1030 b @081A11E6 @081A101E: ldr r5, =0x02021cc4 b @081A1032 .align 2, 0 .pool @081A1028: ldr r5, =0x02021dc4 b @081A1032 .align 2, 0 .pool @081A1030: ldr r5, =0x02021ec4 @081A1032: ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0x9 bls @081A103C b @081A11E6 @081A103C: lsls r0, 2 ldr r1, =@081A1054 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030062f0 ldr r0, [r0] ldrh r1, [r0] movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 b @081A1174 .align 2, 0 .pool @081A1094: ldr r0, =0x030062f0 ldr r0, [r0] ldrh r1, [r0, 0x2] movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 b @081A1174 .align 2, 0 .pool @081A10AC: ldr r0, =0x030062f0 ldr r0, [r0] ldrh r1, [r0] movs r0, 0xB muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 b @081A1174 .align 2, 0 .pool @081A10C4: ldr r0, =0x030062f0 ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 b @081A1174 .align 2, 0 .pool @081A10DC: ldr r0, =0x030062f0 ldr r0, [r0] ldrh r1, [r0, 0x6] movs r0, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 b @081A1174 .align 2, 0 .pool @081A10F4: ldr r0, =0x03005d90 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 .pool @081A1118: ldr r0, =0x03005d90 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 .pool @081A1140: ldr r0, =0x03005d90 ldr r0, [r0] adds r0, 0xB1 ldrb r1, [r0] movs r0, 0x3 ands r0, r1 cmp r0, 0x1 bne @081A115C ldr r1, =gUnknown_085EAEB1 b @081A1174 .align 2, 0 .pool @081A115C: ldr r1, =gUnknown_085EAEB8 b @081A1174 .align 2, 0 .pool @081A1164: ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0x82 lsls r1, 1 adds r0, r1 bl sub_81638AC ldr r1, =0x02021fc4 @081A1174: adds r0, r5, 0 bl gf_strcpy b @081A11E6 .align 2, 0 .pool @081A1184: ldr r0, =0x03005d90 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 .pool @081A11C0: movs r2, 0 @081A11C2: ldr r3, =gUnknown_08610970 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, =gSpeciesNames adds r1, r0 adds r0, r5, 0 bl gf_strcpy @081A11E6: add sp, 0x10 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A0FFC thumb_func_start sub_81A11F8 sub_81A11F8: ; 81A11F8 ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0x020375e2 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 .pool 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, =0x03005d90 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, =0x020375e2 mov r12, r1 ldr r1, =0x020375f0 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 .pool @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, =0x03005d90 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 .pool @081A13B8: adds r5, r2, 0 cmp r5, 0x2 ble @081A138E ldr r0, =0x0000ffff mov r10, r0 movs r2, 0x1 negs r2, r2 mov r9, r2 movs r5, 0x1 ldr r7, =0x03005d90 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, =0x03005d90 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 .pool thumb_func_end sub_81A1370 thumb_func_start sub_81A1438 sub_81A1438: ; 81A1438 push {r4,r5,lr} ldr r4, =0x03005d90 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 .pool @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, =0x03005d90 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, =gUnknown_82E9531 ldrb r0, [r0] ldr r2, =0x0000011b 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 .pool thumb_func_end sub_81A1438 thumb_func_start sub_81A150C sub_81A150C: ; 81A150C push {lr} ldr r2, =gUnknown_08610970 ldr r0, =0x03005d90 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, =gUnknown_085DCEDC 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, =gUnknown_085DCF0E adds r0, r1, r0 ldrb r1, [r0] ldr r0, =0x00004010 bl var_set b @081A1594 .align 2, 0 .pool @081A1568: movs r1, 0 ldr r3, =gUnknown_085DCEFA 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, =gUnknown_085DCF2C adds r0, r1, r0 ldrb r1, [r0] ldr r0, =0x00004010 bl var_set @081A1594: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A150C thumb_func_start sub_81A15A4 sub_81A15A4: ; 81A15A4 push {lr} ldr r2, =gUnknown_08610970 ldr r0, =0x03005d90 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, =gUnknown_085DCEDC 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, =gUnknown_085DCF0E adds r0, r1, r0 ldrb r1, [r0] ldr r0, =0x00004010 bl var_set b @081A1628 .align 2, 0 .pool @081A15FC: movs r1, 0 ldr r3, =gUnknown_085DCEFA 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, =gUnknown_085DCF2C adds r0, r1, r0 ldrb r1, [r0] ldr r0, =0x00004010 bl var_set @081A1628: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A15A4 thumb_func_start sub_81A1638 sub_81A1638: ; 81A1638 ldr r1, =0x020375e0 movs r0, 0x1 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81A1638 thumb_func_start sub_81A1644 sub_81A1644: ; 81A1644 ldr r1, =0x020375e0 movs r0, 0x1 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81A1644 thumb_func_start sub_81A1650 sub_81A1650: ; 81A1650 push {lr} movs r2, 0x58 muls r2, r0 ldr r0, =gUnknown_08610970 adds r2, r0 subs r0, r1, 0x1 cmp r0, 0x6 bhi @081A16AC lsls r0, 2 ldr r1, =@081A1674 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 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 .pool 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, =0x030022c0 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, =0x030062f4 ldr r1, =0x03005e00 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 .pool thumb_func_end sub_81A16DC thumb_func_start sub_81A172C sub_81A172C: ; 81A172C push {r4,lr} adds r4, r0, 0 ldr r0, =sub_81A16DC movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] lsrs r4, 16 strh r4, [r1, 0xA] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A172C thumb_func_start sub_81A175C sub_81A175C: ; 81A175C push {r4,r5,lr} adds r5, r0, 0 ldr r4, =sub_81A16B4 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 .pool thumb_func_end sub_81A175C thumb_func_start sub_81A1780 sub_81A1780: ; 81A1780 push {lr} ldr r1, =gUnknown_08611C18 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca8 adds r0, r1 ldrb r0, [r0] cmp r0, 0x4 bhi @081A1822 lsls r0, 2 ldr r1, =@081A17D0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d90 ldr r1, [r1] ldr r2, =0x00000ca8 adds r1, r2 ldrb r1, [r1] bl var_set b @081A1822 .align 2, 0 .pool @081A1810: movs r0, 0x80 lsls r0, 7 ldr r1, =0x03005d90 ldr r1, [r1] ldr r2, =0x00000ca8 adds r1, r2 ldrb r1, [r1] bl var_set @081A1822: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A17A0 thumb_func_start sub_81A1830 sub_81A1830: ; 81A1830 push {r4-r6,lr} ldr r0, =0x000040cf 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, =0x020375e2 ldrh r0, [r0] cmp r0, 0x7 bls @081A1856 b @081A1956 @081A1856: lsls r0, 2 ldr r1, =@081A186C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081A186C: .4byte @081A188C .4byte @081A18A8 .4byte @081A18C8 .4byte @081A18E4 .4byte @081A1956 .4byte @081A1900 .4byte @081A1918 .4byte @081A1938 @081A188C: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000ca8 adds r0, r2 ldrb r0, [r0] strh r0, [r1] b @081A1956 .align 2, 0 .pool @081A18A8: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000ca9 adds r0, r2 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 strh r0, [r1] b @081A1956 .align 2, 0 .pool @081A18C8: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000cb2 adds r0, r2 ldrh r0, [r0] strh r0, [r1] b @081A1956 .align 2, 0 .pool @081A18E4: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000ca9 adds r0, r2 ldrb r0, [r0] lsls r0, 29 b @081A1926 .align 2, 0 .pool @081A1900: ldr r2, =0x020375f0 ldr r1, =0x0202433a ldrb r0, [r1] strh r0, [r2] movs r0, 0 strb r0, [r1] b @081A1956 .align 2, 0 .pool @081A1918: ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000ca9 adds r0, r2 ldrb r0, [r0] lsls r0, 28 @081A1926: lsrs r0, 31 strh r0, [r1] b @081A1956 .align 2, 0 .pool @081A1938: ldr r4, =0x020375f0 ldr r0, =0x03005d90 ldr r2, [r0] movs r0, 0xD0 lsls r0, 4 adds r2, r0 ldr r3, =gUnknown_08611BFC 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 .pool thumb_func_end sub_81A1830 thumb_func_start sub_81A1968 sub_81A1968: ; 81A1968 push {r4,r5,lr} ldr r0, =0x000040cf 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, =0x020375e2 ldrh r0, [r0] cmp r0, 0x7 bls @081A198E b @081A1AC4 @081A198E: lsls r0, 2 ldr r1, =@081A19A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081A19A4: .4byte @081A19C4 .4byte @081A19E0 .4byte @081A1A0C .4byte @081A1A28 .4byte @081A1A50 .4byte @081A1AC4 .4byte @081A1A7C .4byte @081A1AA8 @081A19C4: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x020375e4 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] b @081A1AC4 .align 2, 0 .pool @081A19E0: ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r1, =0x00000ca9 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 .pool @081A1A0C: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x020375e4 ldrh r1, [r1] ldr r2, =0x00000cb2 adds r0, r2 strh r1, [r0] b @081A1AC4 .align 2, 0 .pool @081A1A28: ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r1, =0x00000ca9 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 .pool @081A1A50: movs r2, 0 ldr r5, =0x03005d90 ldr r4, =0x00000caa ldr r3, =0x0203cef8 @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 .pool @081A1A7C: ldr r0, =0x03005d90 ldr r3, [r0] ldr r0, =0x020375e4 ldrb r0, [r0] ldr r2, =0x00000ca9 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 .pool @081A1AA8: ldr r0, =0x03005d90 ldr r2, [r0] movs r0, 0xD0 lsls r0, 4 adds r2, r0 ldr r3, =gUnknown_08611BFC 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 .pool 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, =0x020375e2 ldrh r0, [r4] cmp r3, r0 bge @081A1B00 ldr r7, =0x0203cef8 ldr r6, =0x03005d90 ldr r5, =0x00000caa @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 .pool 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, =0x0203bc88 ldr r0, =gBattleFrontierTrainers str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000caa 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, =0x03005d8c 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, =0x020244ec 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 .pool thumb_func_end sub_81A1B38 thumb_func_start sub_81A1B98 sub_81A1B98: ; 81A1B98 push {lr} ldr r0, =0x020375e4 ldrh r1, [r0] adds r2, r0, 0 cmp r1, 0x3 bls @081A1BA8 movs r0, 0 strh r0, [r2] @081A1BA8: ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x7 bhi @081A1C1E lsls r0, 2 ldr r1, =@081A1BC8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d90 ldr r1, [r1] ldr r2, =0x00000cdc adds r1, r2 ldr r1, [r1] ands r1, r0 cmp r1, 0 bne @081A1C44 movs r0, 0 b @081A1C46 .align 2, 0 .pool @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, =0x0203ab74 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 .pool 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, =0x0203ab74 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 .pool 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, =0x0203ab74 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, =0x0000270f cmp r6, r0 bls @081A1D24 adds r6, r0, 0 @081A1D24: ldr r0, =0x02021cc4 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE302 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 .pool 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, =0x03005d90 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, =gUnknown_085EE319 str r5, [sp] bl sub_81A1CD8 add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A1D78 thumb_func_start sub_81A1DBC sub_81A1DBC: ; 81A1DBC push {lr} lsls r0, 24 lsls r1, 24 ldr r2, =0x03005d90 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, =0x0000270f cmp r0, r1 bls @081A1DDE adds r0, r1, 0 @081A1DDE: pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE311 str r7, [sp] adds r1, r4, 0 mov r2, r8 mov r3, r9 bl sub_81A1CD8 b @081A1E96 .align 2, 0 .pool @081A1E88: ldr r0, =gUnknown_085EE320 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 .pool 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, =0x0203ab74 ldr r0, =gUnknown_08611C74 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, =0x02021fc4 ldr r1, =gUnknown_085EE158 bl ExpandTextCodes b @081A1F28 .align 2, 0 .pool @081A1EF0: cmp r7, 0x1 bne @081A1F08 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EE178 bl ExpandTextCodes b @081A1F28 .align 2, 0 .pool @081A1F08: cmp r7, 0x2 bne @081A1F20 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EE198 bl ExpandTextCodes b @081A1F28 .align 2, 0 .pool @081A1F20: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EE1B7 bl ExpandTextCodes @081A1F28: ldr r0, =0x02021fc4 movs r1, 0x2 bl sub_81A1C4C ldr r6, =0x0203ab74 ldrb r0, [r6] ldr r2, =gUnknown_085EE2F2 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, =gUnknown_085EE2F9 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 .pool thumb_func_end sub_81A1EA8 thumb_func_start sub_81A1FD8 sub_81A1FD8: ; 81A1FD8 push {lr} lsls r0, 24 lsls r1, 24 ldr r2, =0x03005d90 ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 adds r1, r0 ldr r0, =0x00000d0c adds r2, r0 adds r2, r1 ldrh r0, [r2] ldr r1, =0x0000270f cmp r0, r1 bls @081A1FF8 adds r0, r1, 0 @081A1FF8: pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab74 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, =0x02021cc4 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r4, =0x02021fc4 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 .pool 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, =gUnknown_085EE311 ldr r1, =gUnknown_085EE338 str r7, [sp] str r4, [sp, 0x4] mov r2, r8 mov r3, r9 bl sub_81A2008 b @081A211C .align 2, 0 .pool @081A210C: ldr r0, =gUnknown_085EE320 ldr r1, =gUnknown_085EE338 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 .pool 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, =0x0203ab74 ldr r0, =gUnknown_08611C74 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, =0x02021fc4 ldr r1, =gUnknown_085EE1DB bl ExpandTextCodes b @081A2184 .align 2, 0 .pool @081A217C: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EE1FE bl ExpandTextCodes @081A2184: ldr r0, =0x02021fc4 movs r1, 0 bl sub_81A1C4C ldr r1, =0x0203ab74 ldrb r0, [r1] ldr r2, =gUnknown_085EE2F2 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, =0x0203ab74 ldrb r0, [r1] ldr r2, =gUnknown_085EE2F9 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, =0x03005d90 ldr r0, [r4] lsls r5, r7, 2 ldr r1, =0x00000d14 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, =gUnknown_085EE319 ldr r1, =gUnknown_085EE338 movs r3, 0x40 bl sub_81A2008 ldr r1, =gUnknown_085EE332 mov r10, r1 ldr r0, =gUnknown_085EE349 mov r8, r0 ldr r0, [r4] ldr r1, =0x00000d1c 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, =0x00000d16 adds r0, r1 adds r0, r5 ldrh r2, [r0] mov r0, r9 str r0, [sp] movs r0, 0x71 str r0, [sp, 0x4] ldr r0, =gUnknown_085EE319 ldr r1, =gUnknown_085EE338 movs r3, 0x40 bl sub_81A2008 ldr r0, [r4] ldr r1, =0x00000d1e 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, =0x0203ab74 ldrb r0, [r1] bl Window_WriteStandardTileMap ldr r1, =0x0203ab74 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 .pool 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, =0x0203ab74 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, =0x0000270f cmp r6, r0 bls @081A2304 adds r6, r0, 0 @081A2304: ldr r0, =0x02021cc4 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE302 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 .pool 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, =0x03005d90 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, =gUnknown_085EE319 str r5, [sp] bl sub_81A22B8 add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A2358 thumb_func_start sub_81A239C sub_81A239C: ; 81A239C push {lr} lsls r0, 24 lsls r1, 24 ldr r2, =0x03005d90 ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 adds r1, r0 ldr r0, =0x00000dc8 adds r2, r0 adds r2, r1 ldrh r0, [r2] ldr r1, =0x0000270f cmp r0, r1 bls @081A23BC adds r0, r1, 0 @081A23BC: pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE311 str r7, [sp] adds r1, r4, 0 mov r2, r8 mov r3, r9 bl sub_81A22B8 b @081A244E .align 2, 0 .pool @081A2440: ldr r0, =gUnknown_085EE320 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 .pool 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, =0x0203ab74 ldr r0, =gUnknown_08611C74 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, =0x02021fc4 ldr r1, =gUnknown_085EE221 bl ExpandTextCodes b @081A24B0 .align 2, 0 .pool @081A24A8: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EE241 bl ExpandTextCodes @081A24B0: ldr r0, =0x02021fc4 movs r1, 0x2 bl sub_81A1C4C ldr r6, =0x0203ab74 ldrb r0, [r6] ldr r2, =gUnknown_085EE2F2 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, =gUnknown_085EE2F9 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 .pool thumb_func_end sub_81A2460 thumb_func_start sub_81A2560 sub_81A2560: ; 81A2560 push {lr} lsls r0, 24 ldr r1, =0x03005d90 ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000e04 adds r1, r2 adds r1, r0 ldrh r0, [r1] ldr r1, =0x0000270f cmp r0, r1 bls @081A257A adds r0, r1, 0 @081A257A: pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ab74 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, =0x02021cc4 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r4, =0x02021fc4 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 .pool 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, =gUnknown_085EE311 ldr r1, =gUnknown_085EE35B str r5, [sp] str r6, [sp, 0x4] adds r2, r7, 0 mov r3, r8 bl sub_81A2008 b @081A2684 .align 2, 0 .pool @081A2674: ldr r0, =gUnknown_085EE320 ldr r1, =gUnknown_085EE35B 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 .pool 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, =0x0203ab74 ldr r0, =gUnknown_08611C74 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, =0x02021fc4 ldr r1, =gUnknown_085EE261 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0 bl sub_81A1C4C ldrb r0, [r6] ldr r2, =gUnknown_085EE2F2 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, =gUnknown_085EE2F9 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, =gUnknown_085EE319 mov r10, r0 ldr r7, =gUnknown_085EE35B ldr r5, =0x03005d90 ldr r0, [r5] ldr r1, =0x00000e08 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, =gUnknown_085EE332 mov r8, r0 ldr r1, =gUnknown_085EE36D mov r9, r1 ldr r0, [r5] ldr r1, =0x00000e0c 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, =0x00000e0a 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, =0x00000e0e 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 .pool 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, =0x0203ab74 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, =0x0000270f cmp r6, r0 bls @081A2834 adds r6, r0, 0 @081A2834: ldr r0, =0x02021cc4 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE381 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 .pool 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, =0x03005d90 ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000dde adds r1, r2 adds r1, r0 ldrh r1, [r1] ldr r0, =gUnknown_085EE319 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 .pool thumb_func_end sub_81A2888 thumb_func_start sub_81A28CC sub_81A28CC: ; 81A28CC push {lr} lsls r0, 24 ldr r1, =0x03005d90 ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000dda adds r1, r2 adds r1, r0 ldrh r0, [r1] ldr r1, =0x0000270f cmp r0, r1 bls @081A28E6 adds r0, r1, 0 @081A28E6: pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE311 str r6, [sp] adds r1, r5, 0 adds r2, r7, 0 mov r3, r8 bl sub_81A27E8 b @081A2956 .align 2, 0 .pool @081A2948: ldr r0, =gUnknown_085EE320 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 .pool thumb_func_end sub_81A28F8 thumb_func_start sub_81A2968 sub_81A2968: ; 81A2968 push {r4-r6,lr} sub sp, 0xC ldr r5, =0x0203ab74 ldr r0, =gUnknown_08611C74 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, =0x02021fc4 ldr r1, =gUnknown_085EE27C adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x2 bl sub_81A1C4C ldrb r0, [r5] ldr r2, =gUnknown_085EE2F2 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, =gUnknown_085EE2F9 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 .pool 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, =0x0203ab74 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, =0x0000270f cmp r7, r0 bls @081A2A80 adds r7, r0, 0 @081A2A80: ldr r5, =0x02021cc4 adds r0, r5, 0 adds r1, r7, 0 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE302 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, =gUnknown_085EE392 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 .pool 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, =0x03005d90 ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 adds r1, r0 ldr r7, =0x00000dea adds r0, r2, r7 adds r0, r1 ldrh r0, [r0] mov r8, r0 ldr r0, =0x00000dfa adds r2, r0 adds r2, r1 ldrh r2, [r2] ldr r0, =gUnknown_085EE319 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 .pool thumb_func_end sub_81A2B04 thumb_func_start sub_81A2B70 sub_81A2B70: ; 81A2B70 push {lr} lsls r0, 24 lsls r1, 24 ldr r2, =0x03005d90 ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 adds r1, r0 ldr r0, =0x00000de2 adds r2, r0 adds r2, r1 ldrh r0, [r2] ldr r1, =0x0000270f cmp r0, r1 bls @081A2B90 adds r0, r1, 0 @081A2B90: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81A2B70 thumb_func_start sub_81A2BA0 sub_81A2BA0: ; 81A2BA0 push {lr} lsls r0, 24 lsls r1, 24 ldr r2, =0x03005d90 ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 adds r1, r0 ldr r0, =0x00000df2 adds r2, r0 adds r2, r1 ldrh r0, [r2] ldr r1, =0x0000270f cmp r0, r1 bls @081A2BC0 adds r0, r1, 0 @081A2BC0: pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE311 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 .pool @081A2C68: ldr r0, =gUnknown_085EE320 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 .pool 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, =0x0203ab74 ldr r0, =gUnknown_08611C74 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, =0x02021fc4 ldr r1, =gUnknown_085EE298 bl ExpandTextCodes b @081A2CE0 .align 2, 0 .pool @081A2CD8: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EE2B8 bl ExpandTextCodes @081A2CE0: ldr r0, =0x02021fc4 movs r1, 0 bl sub_81A1C4C ldr r0, =0x0203ab74 mov r8, r0 ldrb r0, [r0] ldr r2, =gUnknown_085EE2F2 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, =gUnknown_085EE326 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, =gUnknown_085EE2F9 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 .pool 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, =0x0203ab74 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, =0x0000270f cmp r6, r0 bls @081A2E00 adds r6, r0, 0 @081A2E00: ldr r0, =0x02021cc4 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EE39C 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 .pool 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, =0x03005d90 ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000e1e adds r1, r2 adds r1, r0 ldrh r1, [r1] ldr r0, =gUnknown_085EE319 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 .pool thumb_func_end sub_81A2E54 thumb_func_start sub_81A2E98 sub_81A2E98: ; 81A2E98 push {lr} lsls r0, 24 ldr r1, =0x03005d90 ldr r1, [r1] lsrs r0, 23 ldr r2, =0x00000e1a adds r1, r2 adds r1, r0 ldrh r0, [r1] ldr r1, =0x0000270f cmp r0, r1 bls @081A2EB2 adds r0, r1, 0 @081A2EB2: pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_085EE311 str r6, [sp] adds r1, r5, 0 adds r2, r7, 0 mov r3, r8 bl sub_81A2DB4 b @081A2F26 .align 2, 0 .pool @081A2F18: ldr r0, =gUnknown_085EE320 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 .pool thumb_func_end sub_81A2EC4 thumb_func_start sub_81A2F38 sub_81A2F38: ; 81A2F38 push {r4-r6,lr} sub sp, 0xC ldr r5, =0x0203ab74 ldr r0, =gUnknown_08611C74 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, =0x02021fc4 ldr r1, =gUnknown_085EE2D8 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x2 bl sub_81A1C4C ldrb r0, [r5] ldr r2, =gUnknown_085EE2F2 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, =gUnknown_085EE2F9 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 .pool 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, =0x0203ab74 ldr r0, =gUnknown_08611C7C 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, =0x02021fc4 mov r9, r0 ldr r1, =gUnknown_085EDF86 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, =gUnknown_085EDFA0 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, =gUnknown_085EDFA4 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, =gUnknown_085EDFA8 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, =gUnknown_085EDFAC 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, =gUnknown_085EB0E8 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, =gUnknown_085EB0ED 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, =gUnknown_085EB0F4 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, =gUnknown_085EB0F9 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, =gUnknown_085EB0FF 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000624 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, =0x0203ab74 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r7, r0, 30 ldr r0, =0x000040cf bl var_get lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x000040ce 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, =@081A3250 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081A3250: .4byte @081A326C .4byte @081A33A8 .4byte @081A3414 .4byte @081A347C .4byte @081A34CC .4byte @081A354C .4byte @081A3594 @081A326C: ldr r2, =0x03005d90 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, =0x02024474 adds r6, 0x25 ldrb r0, [r6] movs r4, 0x1 eors r0, r4 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 ldr r5, =0x020229f0 adds r1, r5 mov r0, sp bl gf_strcpy mov r0, sp bl sub_8009370 lsls r1, r7, 3 ldr r0, =0x00000ee1 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, =0x00000ef1 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 .pool @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, =0x03005d90 ldr r0, [r6] lsls r7, 1 mov r2, r8 lsls r1, r2, 2 adds r4, r7, r1 ldr r5, =0x00000d0c adds r1, r0, r5 adds r1, r4 ldr r3, =0x00000d14 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 .pool @081A3404: ldr r0, [r6] adds r0, r5 adds r0, r4 ldrh r0, [r0] movs r1, 0x6 bl sub_80EE8C8 b @081A35CE @081A3414: ldr r6, =0x03005d90 ldr r0, [r6] lsls r7, 1 mov r2, r8 lsls r1, r2, 2 adds r4, r7, r1 ldr r5, =0x00000dc8 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 .pool @081A346C: ldr r0, [r6] adds r0, r5 adds r0, r4 ldrh r0, [r0] movs r1, 0xC bl sub_80EE8C8 b @081A35CE @081A347C: ldr r6, =0x03005d90 ldr r1, [r6] lsls r4, r7, 1 ldr r5, =0x00000dda adds r0, r1, r5 adds r0, r4 ldr r2, =0x00000dde 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 .pool @081A34CC: ldr r6, =0x03005d90 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, =0x00000de2 adds r0, r2, r5 adds r3, r0, r4 ldr r7, =0x00000dea adds r0, r2, r7 adds r0, r4 ldrh r1, [r3] ldrh r7, [r0] cmp r1, r7 bls @081A35CE strh r1, [r0] ldr r0, =0x00000dfa adds r1, r2, r0 adds r1, r4 ldr r7, =0x00000df2 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 .pool @081A353C: ldr r0, [r6] adds r0, r5 adds r0, r4 ldrh r0, [r0] movs r1, 0x8 bl sub_80EE8C8 b @081A35CE @081A354C: ldr r6, =0x03005d90 ldr r1, [r6] lsls r4, r7, 1 ldr r5, =0x00000e04 adds r0, r1, r5 adds r0, r4 ldr r2, =0x00000e08 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 .pool @081A3594: ldr r6, =0x03005d90 ldr r1, [r6] lsls r4, r7, 1 ldr r5, =0x00000e1a adds r0, r1, r5 adds r0, r4 ldr r7, =0x00000e1e 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 .pool thumb_func_end sub_81A31FC thumb_func_start sub_81A35EC sub_81A35EC: ; 81A35EC push {r4,lr} ldr r0, =0x000040cf bl var_get ldr r4, =0x020375f0 bl sub_81A3610 lsls r0, 24 lsrs r0, 24 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x000040cf bl var_get lsls r0, 16 lsrs r6, r0, 16 ldr r0, =0x000040ce bl var_get adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl sub_81A39C4 lsls r0, 16 ldr r1, =gUnknown_08611550 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 .pool @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, =gUnknown_08611550 lsls r2, r6, 2 adds r0, r2, r1 ldrb r0, [r0] cmp r5, r0 bne @081A3694 movs r0, 0x3 b @081A36BA .align 2, 0 .pool @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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000bfc b @081A38C4 .align 2, 0 .pool @081A370C: ldr r0, =0x000003fe cmp r3, r0 beq @081A3786 ldr r0, =0x0000012b cmp r3, r0 bhi @081A3738 ldr r2, =0x0203bc88 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 .pool @081A3738: ldr r0, =0x0000018f cmp r3, r0 bhi @081A3758 ldr r1, =0x03005d90 movs r0, 0xEC muls r0, r3 ldr r1, [r1] adds r0, r1 ldr r1, =0xfffef2b8 b @081A38C4 .align 2, 0 .pool @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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000c08 b @081A38C4 .align 2, 0 .pool @081A3780: ldr r0, =0x000003fe cmp r3, r0 bne @081A3794 @081A3786: movs r0, 0 bl sub_81A51A8 b @081A38F8 .align 2, 0 .pool @081A3794: ldr r0, =0x0000012b cmp r3, r0 bhi @081A37B8 ldr r2, =0x0203bc88 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 .pool @081A37B8: ldr r0, =0x0000018f cmp r3, r0 bhi @081A37EC ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne @081A387C ldr r1, =0x03005d90 movs r0, 0xEC muls r0, r3 ldr r1, [r1] adds r0, r1 ldr r1, =0xfffef2c4 b @081A38C4 .align 2, 0 .pool @081A37EC: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 17 ands r0, r1 cmp r0, 0 bne @081A387C ldr r1, =0x03005d90 lsls r0, r3, 4 adds r0, r3 lsls r0, 2 ldr r1, [r1] adds r0, r1 ldr r1, =0xffff96c4 b @081A38C4 .align 2, 0 .pool @081A3818: movs r0, 0xFA lsls r0, 1 cmp r3, r0 bne @081A3830 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000c14 b @081A38C4 .align 2, 0 .pool @081A3830: ldr r0, =0x000003fe cmp r3, r0 bne @081A3844 movs r0, 0x1 bl sub_81A51A8 b @081A38F8 .align 2, 0 .pool @081A3844: ldr r0, =0x0000012b cmp r3, r0 bhi @081A3868 ldr r2, =0x0203bc88 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 .pool @081A3868: ldr r0, =0x0000018f cmp r3, r0 bhi @081A38A8 ldr r0, =0x02022fec 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 .pool @081A3890: ldr r1, =0x03005d90 movs r0, 0xEC muls r0, r3 ldr r1, [r1] adds r0, r1 ldr r1, =0xfffef2d0 b @081A38C4 .align 2, 0 .pool @081A38A8: ldr r0, =0x02022fec 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, =gUnknown_086109BA @081A38C4: adds r0, r1 bl sub_81638AC b @081A38F8 .align 2, 0 .pool @081A38D4: ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0xfffffe70 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, =gUnknown_086109BA adds r0, r1 bl sub_81638AC @081A38F8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r1, [r0] ldr r2, =0x00000cdc 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, =0x00000dda adds r1, r0, r2 adds r1, r3 strh r4, [r1] ldr r7, =0x00000e04 adds r1, r0, r7 adds r1, r3 strh r4, [r1] ldr r1, =0x00000e1a 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, =0x00000ca8 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 .pool thumb_func_end sub_81A3908 thumb_func_start sub_81A39C4 sub_81A39C4: ; 81A39C4 push {r4,r5,lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r4, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x000040cf bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x6 bhi @081A3AC4 lsls r0, 2 ldr r1, =@081A3A0C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081A3A0C: .4byte @081A3A28 .4byte @081A3A3C .4byte @081A3A54 .4byte @081A3A6C .4byte @081A3A80 .4byte @081A3A98 .4byte @081A3AAC @081A3A28: ldr r0, =0x03005d90 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 .pool @081A3A3C: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 lsls r2, r5, 2 adds r1, r2 ldr r2, =0x00000d0c b @081A3AB4 .align 2, 0 .pool @081A3A54: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 lsls r2, r5, 2 adds r1, r2 ldr r2, =0x00000dc8 b @081A3AB4 .align 2, 0 .pool @081A3A6C: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000dda b @081A3AB4 .align 2, 0 .pool @081A3A80: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 lsls r2, r5, 2 adds r1, r2 ldr r2, =0x00000de2 b @081A3AB4 .align 2, 0 .pool @081A3A98: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e04 b @081A3AB4 .align 2, 0 .pool @081A3AAC: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e1a @081A3AB4: adds r0, r2 adds r0, r1 ldrh r0, [r0] b @081A3AC6 .align 2, 0 .pool @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, =0x03005d90 ldr r4, =0x00000cb4 ldr r0, =0x0000ffff 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 .pool thumb_func_end sub_81A3ACC thumb_func_start sub_81A3B00 sub_81A3B00: ; 81A3B00 push {lr} ldr r0, =0x02038bca ldrh r1, [r0] ldr r0, =0x000003fe cmp r1, r0 bne @081A3B20 ldr r1, =0x020375f0 movs r0, 0x1 b @081A3B24 .align 2, 0 .pool @081A3B20: ldr r1, =0x020375f0 movs r0, 0 @081A3B24: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x000008c4 adds r0, r4, r1 bl flag_check adds r5, r0, 0 ldr r0, =0x000008c5 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r4, r0, 30 ldr r0, =0x000040cf bl var_get lsls r0, 16 lsrs r7, r0, 16 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r6, r0, 16 cmp r7, 0x6 bhi @081A3C78 lsls r0, r7, 2 ldr r1, =@081A3BB4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081A3BB4: .4byte @081A3BD0 .4byte @081A3BE4 .4byte @081A3C00 .4byte @081A3C18 .4byte @081A3C2C .4byte @081A3C44 .4byte @081A3C60 @081A3BD0: ldr r0, =0x03005d90 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 .pool @081A3BE4: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 lsls r2, r6, 2 adds r1, r2 ldr r2, =0x00000d0c adds r0, r2 adds r0, r1 ldrh r5, [r0] b @081A3C78 .align 2, 0 .pool @081A3C00: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 lsls r2, r6, 2 adds r1, r2 ldr r2, =0x00000dc8 b @081A3C68 .align 2, 0 .pool @081A3C18: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000dda b @081A3C68 .align 2, 0 .pool @081A3C2C: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 lsls r2, r6, 2 adds r1, r2 ldr r2, =0x00000de2 b @081A3C68 .align 2, 0 .pool @081A3C44: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e04 adds r0, r2 adds r0, r1 ldrh r0, [r0] movs r1, 0xE b @081A3C70 .align 2, 0 .pool @081A3C60: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e1a @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, =gUnknown_086118B4 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, =0x02038bca mov r9, r0 ldrh r0, [r0] ldr r1, =0x000003fe mov r8, r1 cmp r0, r8 bne @081A3CA6 adds r5, 0xA @081A3CA6: ldr r6, =0x03005d90 ldr r1, [r6] ldr r4, =0x00000eb8 adds r1, r4 ldrh r0, [r1] adds r0, r5 strh r0, [r1] ldr r0, =0x02021cc4 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, =0x0000270f cmp r0, r1 bls @081A3CCE strh r1, [r2] @081A3CCE: ldr r0, [r6] ldr r4, =0x00000eba 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, =0x0000ffff 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 .pool thumb_func_end sub_81A3B64 thumb_func_start sub_81A3D30 sub_81A3D30: ; 81A3D30 push {r4,lr} ldr r0, =0x000040cf bl var_get ldr r4, =0x020375f0 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 .pool thumb_func_end sub_81A3D30 thumb_func_start sub_81A3D58 sub_81A3D58: ; 81A3D58 push {r4,lr} ldr r0, =0x000040cf 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, =0x8C4 << 16 adds r0, r1 lsrs r0, 16 bl flag_set b @081A3D94 .align 2, 0 .pool @081A3D88: lsls r0, r4, 17 ldr r1, =0x8C5 << 16 adds r0, r1 lsrs r0, 16 bl flag_set @081A3D94: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A3D58 thumb_func_start sub_81A3DA0 sub_81A3DA0: ; 81A3DA0 push {lr} ldr r0, =0x02022fec ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, [r0] ands r2, r1 cmp r2, 0 beq @081A3DC4 ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] b @081A3DC8 .align 2, 0 .pool @081A3DC4: ldr r0, =0x020375f0 strh r2, [r0] @081A3DC8: pop {r0} bx r0 .align 2, 0 .pool 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 SpeciesToNationalPokedexNum 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, =@081A3E0C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021cc4 ldr r1, =gUnknown_085CCB79 bl gf_strcat b @081A3EC8 .align 2, 0 .pool @081A3E50: cmp r5, r4 ble @081A3EC8 ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB7F bl gf_strcat b @081A3EC8 .align 2, 0 .pool @081A3E68: cmp r4, r5 bne @081A3E80 ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB79 bl gf_strcat b @081A3E88 .align 2, 0 .pool @081A3E80: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB7F bl gf_strcat @081A3E88: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB86 bl gf_strcat b @081A3EC8 .align 2, 0 .pool @081A3EA0: cmp r4, r5 bne @081A3EB8 ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB79 bl gf_strcat b @081A3EC0 .align 2, 0 .pool @081A3EB8: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB7F bl gf_strcat @081A3EC0: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB84 bl gf_strcat @081A3EC8: ldr r0, =0x02021cc4 movs r1, 0xB muls r1, r6 ldr r2, =gSpeciesNames adds r1, r2 bl gf_strcat @081A3ED6: adds r0, r4, 0 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool 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, =gUnknown_08611C9A ldrh r1, [r0] ldr r5, =0x0000ffff 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, =0x0000ffff 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 .pool 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, =0x000040ce 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 .pool @081A4008: cmp r0, 0x3 bgt @081A402A movs r0, 0x2 b @081A4028 @081A4010: movs r1, 0x3 str r1, [sp, 0x2C] b @081A402A @081A4016: ldr r0, =0x000040cf 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 .pool @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, =0x020244ec 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, =0x000040cf bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x6 bne @081A40C8 cmp r7, 0 bne @081A40E4 ldr r0, =0x020375f0 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 .pool @081A40C8: ldr r0, =0x020375f0 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, =gUnknown_08611C9A ldrh r2, [r0] ldr r1, =0x0000ffff mov r8, r0 cmp r2, r1 beq @081A4134 mov r4, r8 @081A4112: adds r0, r2, 0 bl SpeciesToNationalPokedexNum 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, =0x0000ffff cmp r2, r0 bne @081A4112 @081A4134: ldr r1, =0x02021cc4 movs r0, 0xFF strb r0, [r1] ldr r1, =0x020375e0 movs r0, 0x1 strh r0, [r1] movs r0, 0 mov r1, r10 strb r0, [r1] mov r1, r8 ldrh r0, [r1] ldr r1, =0x0000ffff 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, =0x02021cc4 ldr r1, =gUnknown_085CCB82 adds r0, r4, 0 bl gf_strcat ldr r1, =gUnknown_085CCB88 adds r0, r4, 0 bl gf_strcat b @081A4202 .align 2, 0 .pool @081A41A4: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @081A41C0 ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB84 bl gf_strcat b @081A41C8 .align 2, 0 .pool @081A41C0: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB82 bl gf_strcat @081A41C8: ldr r0, =0x02021cc4 ldr r1, =gUnknown_085CCB8C bl gf_strcat b @081A4202 .align 2, 0 .pool @081A41E0: ldr r1, =0x020375e0 movs r0, 0 strh r0, [r1] ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0x020375f0 ldrb r0, [r0] ldr r1, =0x00000ca9 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r4, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x000040cf bl var_get lsls r0, 16 lsrs r0, 16 cmp r0, 0x6 bls @081A425A b @081A4394 @081A425A: lsls r0, 2 ldr r1, =@081A4278 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081A4278: .4byte @081A4294 .4byte @081A42DC .4byte @081A431C .4byte @081A4338 .4byte @081A434C .4byte @081A4368 .4byte @081A437C @081A4294: ldr r7, =0x03005d90 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, =0x0000270e 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, =0x00000d02 adds r1, r2 b @081A4392 .align 2, 0 .pool @081A42DC: ldr r6, =0x03005d90 ldr r0, [r6] lsls r2, r4, 1 lsls r1, r5, 2 adds r1, r2, r1 ldr r3, =0x00000d0c adds r0, r3 adds r3, r0, r1 ldrh r0, [r3] ldr r2, =0x0000270e cmp r0, r2 bhi @081A42F8 adds r0, 0x1 strh r0, [r3] @081A42F8: ldr r0, [r6] ldr r3, =0x00000d1c adds r0, r3 adds r1, r0, r1 ldrh r0, [r1] cmp r0, r2 bhi @081A4394 adds r0, 0x1 b @081A4392 .align 2, 0 .pool @081A431C: ldr r0, =0x03005d90 ldr r2, [r0] lsls r0, r4, 1 lsls r1, r5, 2 adds r0, r1 ldr r1, =0x00000dc8 adds r2, r1 adds r1, r2, r0 b @081A4388 .align 2, 0 .pool @081A4338: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000dda adds r0, r2 b @081A4386 .align 2, 0 .pool @081A434C: ldr r0, =0x03005d90 ldr r2, [r0] lsls r0, r4, 1 lsls r1, r5, 2 adds r0, r1 ldr r3, =0x00000de2 adds r2, r3 adds r1, r2, r0 b @081A4388 .align 2, 0 .pool @081A4368: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000e04 adds r0, r2 b @081A4386 .align 2, 0 .pool @081A437C: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r3, =0x00000e1a adds r0, r3 @081A4386: adds r1, r0, r1 @081A4388: ldrh r3, [r1] ldr r0, =0x0000270e cmp r3, r0 bhi @081A4394 adds r0, r3, 0x1 @081A4392: strh r0, [r1] @081A4394: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c movs r5, 0x64 @081A43B2: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000caa 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, =0x020244ec 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 .pool thumb_func_end sub_81A43A8 thumb_func_start sub_81A4410 sub_81A4410: ; 81A4410 push {r4,lr} ldr r4, =0x020375f0 bl sub_8185338 strh r0, [r4] ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r0, [r1] movs r2, 0x8 orrs r0, r2 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A4410 thumb_func_start sub_81A443C sub_81A443C: ; 81A443C push {lr} ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0 beq @081A4450 cmp r0, 0x1 beq @081A4464 b @081A446E .align 2, 0 .pool @081A4450: ldr r0, =0x02021cc4 ldr r1, =0x02038bca ldrh r1, [r1] bl sub_8162E20 b @081A446E .align 2, 0 .pool @081A4464: ldr r0, =0x02021dc4 ldr r1, =0x02038bca ldrh r1, [r1] bl sub_8162E20 @081A446E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r1] ldr r2, [sp] lsls r1, r2, 1 ldr r4, =0x00000caa 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, =0x020244ec 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, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000caa 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, =0x03005d8c 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, =0x03005d8c ldr r0, [r0] ldr r2, =0x03005d90 ldr r1, [r2] ldr r4, =0x00000caa 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, =0x020244ec 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 .pool thumb_func_end sub_81A447C thumb_func_start sub_81A457C sub_81A457C: ; 81A457C push {lr} ldr r0, =0x000040cf bl var_get lsls r0, 24 lsrs r0, 24 bl sub_81A5030 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ab74 ldrb r5, [r1] lsls r4, r0, 1 adds r4, r0 ldr r1, =gUnknown_085EE424 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, =0x0203ab74 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, =0x0000270f cmp r1, r0 bls @081A4618 adds r1, r0, 0 @081A4618: ldr r0, =0x02021dc4 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r5, =0x02021fc4 ldr r1, =gUnknown_08611D08 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, =0x0203ab74 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 .pool 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, =0x0203ab74 ldrb r0, [r1] lsls r2, r6, 1 adds r2, r6 ldr r1, =gUnknown_085EE424 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, =0x0203ab74 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 .pool @081A4734: add r0, sp, 0xC adds r1, r4, 0 bl gf_strcpy @081A473C: ldr r2, =0x0203ab74 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, =0x0000270f cmp r1, r0 bls @081A4778 adds r1, r0, 0 @081A4778: ldr r0, =0x02021dc4 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r5, =0x02021fc4 ldr r0, =gUnknown_08611D08 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 .pool 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, =0x03005d90 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 .pool 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, =0x03005d90 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, =0x0000057c 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 .pool 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, =0x02021cc4 ldr r4, =gUnknown_08611CB0 lsls r5, r7, 3 adds r1, r5, r4 ldr r1, [r1] bl gf_strcpy ldr r6, =0x02021fc4 adds r4, 0x4 adds r5, r4 ldr r1, [r5] adds r0, r6, 0 bl ExpandTextCodes ldr r0, =0x0203ab74 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, =gUnknown_08611D00 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, =0x03005d90 ldr r0, [r2] ldr r1, =0x00000ee8 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 .pool @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, =0x0203ab74 ldr r0, =gUnknown_08611C84 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, =0x020375e2 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 .pool thumb_func_end sub_81A4AA0 thumb_func_start sub_81A4AE8 sub_81A4AE8: ; 81A4AE8 push {r4,lr} ldr r4, =0x0203ab74 ldrb r0, [r4] movs r1, 0x11 bl Window_FastFillPixels ldr r0, =0x020375e2 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 .pool 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, =0x03005d90 @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, =0x00000222 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, =0x03005d90 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, =0x0000057c 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, =0x00000586 adds r1, r0 ldrb r0, [r1] mov r3, r9 orrs r0, r3 strb r0, [r1] ldr r1, [r7] adds r1, r4 ldr r0, =0x0000058e adds r1, r0 ldrb r0, [r1] orrs r0, r3 strb r0, [r1] ldr r0, [r7] adds r0, r4 ldr r1, =0x00000584 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 .pool 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, =0x020244ec 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, =0x020244e9 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, =0x020244ec 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 .pool thumb_func_end sub_81A4C30 thumb_func_start sub_81A4CB0 sub_81A4CB0: ; 81A4CB0 push {lr} ldr r0, =0x02022fec 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 .pool @081A4CD0: ldr r0, =0x000040cf bl var_get lsls r0, 16 lsrs r0, 16 @081A4CDA: ldr r2, =gTrainers ldr r1, =gUnknown_08611D30 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 .pool thumb_func_end sub_81A4CB0 thumb_func_start sub_81A4D00 sub_81A4D00: ; 81A4D00 push {lr} ldr r0, =0x02022fec 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 .pool @081A4D20: ldr r0, =0x000040cf bl var_get lsls r0, 16 lsrs r0, 16 @081A4D2A: ldr r2, =gTrainers ldr r1, =gUnknown_08611D30 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 .pool thumb_func_end sub_81A4D00 thumb_func_start sub_81A4D50 sub_81A4D50: ; 81A4D50 push {r4,lr} adds r4, r0, 0 ldr r0, =0x02022fec 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 .pool @081A4D70: ldr r0, =0x000040cf bl var_get lsls r0, 16 lsrs r0, 16 @081A4D7A: movs r3, 0 lsls r0, 1 ldr r2, =gTrainers ldr r1, =gUnknown_08611D30 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 .pool thumb_func_end sub_81A4D50 thumb_func_start sub_81A4DB8 sub_81A4DB8: ; 81A4DB8 push {lr} ldr r0, =0x000040cf bl var_get lsls r0, 16 ldr r1, =gUnknown_08611C8C lsrs r0, 15 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81A4DB8 thumb_func_start sub_81A4DD8 sub_81A4DD8: ; 81A4DD8 push {lr} ldr r0, =0x000040cf bl var_get lsls r0, 16 ldr r2, =0x00004010 ldr r1, =gUnknown_08611C8C lsrs r0, 15 adds r0, r1 ldrb r1, [r0] adds r0, r2, 0 bl var_set pop {r0} bx r0 .align 2, 0 .pool 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, =0x000040cf 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, =0x000003fe bl sub_81953A0 lsls r0, 16 lsrs r0, 16 bl sub_818FC78 adds r4, r0, 0 b @081A4E46 .align 2, 0 .pool @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, =0x0000ef2a 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, =gUnknown_0861156C adds r4, r2 adds r0, r7, 0 bl GetNatureFromPersonality 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, =0x02024744 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, =gUnknown_0861156C 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, =0x0000ef2a str r0, [sp, 0xC] mov r0, r10 bl create_pokemon_set_level ldr r0, =gUnknown_0861156C 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, =0x02024744 @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, =gUnknown_08611578 mov r8, r3 ldr r3, =0x02024744 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, =0x02024744 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 .pool 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, =0x000040cf bl var_get adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 bl sub_81A513C ldr r3, =gUnknown_0861156C 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 .pool thumb_func_end sub_81A4FF0 thumb_func_start sub_81A5030 sub_81A5030: ; 81A5030 push {lr} lsls r0, 24 ldr r2, =0x02038bca ldr r3, =0x000003fe adds r1, r3, 0 strh r1, [r2] ldr r2, =0x00004010 ldr r1, =gUnknown_08611C8C lsrs r0, 23 adds r0, r1 ldrb r1, [r0] adds r0, r2, 0 bl var_set pop {r0} bx r0 .align 2, 0 .pool 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, =0x000040cf bl var_get adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 bl sub_81A513C ldr r2, =gUnknown_0861156C 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 .pool 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, =0x000040cf bl var_get adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 bl sub_81A513C ldr r3, =gUnknown_0861156C 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 .pool 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, =0x000040cf bl var_get adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 bl sub_81A513C ldr r2, =gUnknown_0861156C 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 .pool thumb_func_end sub_81A50F0 thumb_func_start sub_81A513C sub_81A513C: ; 81A513C push {r4,r5,lr} ldr r0, =0x000040cf 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, =gUnknown_08611550 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 .pool @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, =0x02022fec 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 .pool @081A51D4: ldr r0, =0x000040cf 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 .pool @081A51F4: ldr r0, =0x02021fc4 ldr r2, =gUnknown_08611DB0 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 .pool @081A5214: ldr r0, =0x02021fc4 ldr r2, =gUnknown_08611DB8 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 .pool thumb_func_end sub_81A51A8 thumb_func_start sub_81A5238 sub_81A5238: ; 81A5238 push {lr} ldr r1, =gUnknown_08611F84 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool 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, =@081A5278 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x7fffff1c movs r1, 0 str r1, [sp] movs r1, 0x4 movs r2, 0 movs r3, 0x8 bl sub_80A1AD4 ldr r1, =0x00003f3e movs r0, 0x48 bl lcd_io_set ldr r0, =gUnknown_08611F74 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08D855E8 movs r1, 0xF8 lsls r1, 1 movs r2, 0x20 bl decompress_palette ldr r1, =0x02022e24 movs r0, 0xFF strh r0, [r1] ldr r1, =0x02022e26 movs r0, 0x70 strh r0, [r1] b @081A553E .align 2, 0 .pool @081A52F4: ldr r0, =0x02037fd4 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 .pool @081A531C: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 beq @081A5328 b @081A5544 @081A5328: ldr r1, =0x02022f58 movs r2, 0xA1 strb r2, [r1] movs r0, 0xFF strb r0, [r1, 0x1] ldr r1, =0x02022f68 strb r2, [r1] movs r0, 0x1 negs r0, r0 strb r0, [r1, 0x1] ldr r0, =gUnknown_085CCDB2 bl sub_814E6F0 ldr r4, =0x02022e2c adds r0, r4, 0 movs r1, 0xF bl battle_show_message_maybe ldr r0, =gUnknown_085CCDB5 movs r1, 0x10 bl battle_show_message_maybe ldr r0, =gUnknown_085CCDB8 bl sub_814E6F0 adds r0, r4, 0 movs r1, 0x11 bl battle_show_message_maybe ldr r0, =gUnknown_085CCDBB movs r1, 0x12 bl battle_show_message_maybe ldr r0, =gUnknown_085CCDC0 movs r1, 0x13 bl battle_show_message_maybe ldr r0, =gUnknown_085CCDC6 movs r1, 0x14 bl battle_show_message_maybe ldr r0, =gUnknown_085CCDCB bl sub_814E6F0 adds r0, r4, 0 movs r1, 0x15 bl battle_show_message_maybe b @081A553E .align 2, 0 .pool @081A53B4: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 beq @081A53C0 b @081A5544 @081A53C0: ldr r1, =0x00003f3f movs r0, 0x48 bl lcd_io_set movs r6, 0x80 lsls r6, 15 movs r4, 0x7 @081A53CE: asrs r1, r6, 16 ldr r0, =gUnknown_08611F5C 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, =0x02020630 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 .pool @081A540C: ldr r0, =0x00000109 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 .pool @081A542C: ldr r0, =0x00000109 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 .pool @081A544C: ldr r0, =0x00000109 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, =gUnknown_085CCDCB bl sub_814E6F0 ldr r0, =0x02022e2c 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 .pool @081A5490: movs r0, 0x85 lsls r0, 1 bl audio_play ldr r0, =0x02022f58 ldr r1, =0x02022f68 ldrb r2, [r0] ldrb r0, [r1] cmp r2, r0 bls @081A54BC movs r6, 0x2 ldr r1, =0x02024474 movs r0, 0 strb r0, [r1, 0x17] b @081A553E .align 2, 0 .pool @081A54BC: cmp r2, r0 bcs @081A54D0 movs r6, 0x3 ldr r1, =0x02024474 movs r0, 0x1 strb r0, [r1, 0x17] b @081A553E .align 2, 0 .pool @081A54D0: movs r6, 0x4 b @081A553E @081A54D4: ldr r1, =0x00003f3e 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, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl ldr r0, =0x7fffff1c movs r1, 0 str r1, [sp] movs r1, 0x4 movs r2, 0x8 movs r3, 0 bl sub_80A1AD4 b @081A553E .align 2, 0 .pool @081A5520: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081A5544 ldr r1, =0x00003f3f 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 .pool 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, =0x0202449c ldr r0, [r0] movs r3, 0xA6 lsls r3, 2 adds r4, r0, r3 ldr r5, =0x0000029a 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 .pool @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, =0x02024084 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, =0x02022f68 b @081A562A .align 2, 0 .pool @081A5628: ldr r1, =0x02022f58 @081A562A: ldrb r0, [r1] adds r0, 0x2 strb r0, [r1] b @081A565E .align 2, 0 .pool @081A5638: cmp r6, r1 bne @081A565C movs r4, 0x1 cmp r7, 0 beq @081A564C ldr r1, =0x02022f68 b @081A564E .align 2, 0 .pool @081A564C: ldr r1, =0x02022f58 @081A564E: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @081A565E .align 2, 0 .pool @081A565C: movs r4, 0 @081A565E: ldr r0, =gUnknown_08611F5C 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, =0x02020630 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 .pool thumb_func_end sub_81A5558 thumb_func_start sub_81A5698 sub_81A5698: ; 81A5698 push {lr} adds r1, r0, 0 ldr r0, =0x02024332 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 .pool thumb_func_end sub_81A5698 thumb_func_start sub_81A56B4 sub_81A56B4: ; 81A56B4 ldr r0, =0x0202449c 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, =0x02024084 ldrh r1, [r0, 0x28] strh r1, [r2] adds r0, 0x80 ldrh r0, [r0] strh r0, [r2, 0x2] bx lr .align 2, 0 .pool thumb_func_end sub_81A56B4 thumb_func_start sub_81A56E8 sub_81A56E8: ; 81A56E8 lsls r0, 24 lsrs r0, 24 ldr r1, =0x0202449c ldr r1, [r1] movs r2, 0xA6 lsls r2, 2 adds r1, r2 adds r1, r0 ldr r2, =gBattleArenaMoveMindRatings ldr r0, =0x020241ea ldrh r0, [r0] adds r0, r2 ldrb r0, [r0] ldrb r2, [r1] adds r0, r2 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x0202449c ldr r2, [r0] ldr r0, =0x0000029a adds r5, r2, r0 ldr r0, =0x02024280 ldr r0, [r0] movs r1, 0x80 lsls r1, 18 ands r0, r1 cmp r0, 0 beq @081A57DA ldr r0, =0x000002a2 adds r4, r2, r0 ldrb r2, [r4] ldr r0, =gUnknown_0832A328 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 .pool @081A576C: ldr r0, =0x0202427c 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, =0x02024332 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 .pool @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, =0x0202433c 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 .pool 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, =0x0202449c ldr r0, [r0] ldr r5, =0x0000029a 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 .pool @081A581C: cmp r1, 0xC7 blt @081A5864 cmp r1, 0xCC ble @081A585C cmp r1, 0xCE beq @081A585C b @081A5864 @081A582A: ldr r0, =0x00000147 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 .pool @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, =0x0202449c ldr r3, [r1] movs r1, 0xA7 lsls r1, 2 adds r3, r1 lsls r2, r0, 1 adds r2, r3 ldr r5, =0x02024084 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 .pool thumb_func_end sub_81A586C thumb_func_start sub_81A58B4 sub_81A58B4: ; 81A58B4 push {r4-r6,lr} ldr r4, =0x03005d90 ldr r1, [r4] ldr r3, =0x00000ca9 adds r0, r1, r3 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x00000ca8 adds r1, r0 movs r2, 0 strb r2, [r1] ldr r1, [r4] ldr r6, =0x00000cb2 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, =0x00000cdc adds r0, r1 ldr r2, [r0] movs r0, 0x80 b @081A591E .align 2, 0 .pool @081A5914: ldr r0, [r4] ldr r3, =0x00000cdc 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, =0x00000dda adds r0, r6 adds r0, r1 strh r2, [r0] @081A5930: ldr r0, =0x03005d8c 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, =0x02038bca movs r0, 0 strh r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A58B4 thumb_func_start sub_81A5964 sub_81A5964: ; 81A5964 push {r4,lr} ldr r0, =0x03005d90 ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 ldrb r0, [r0] lsls r0, 30 lsrs r1, r0, 30 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x1 beq @081A59B0 cmp r0, 0x1 bgt @081A5994 cmp r0, 0 beq @081A599A b @081A59EE .align 2, 0 .pool @081A5994: cmp r0, 0x2 beq @081A59C8 b @081A59EE @081A599A: ldr r0, =0x020375f0 ldr r2, =0x00000dd8 adds r1, r3, r2 ldrh r1, [r1] strh r1, [r0] b @081A59EE .align 2, 0 .pool @081A59B0: ldr r2, =0x020375f0 lsls r1, 1 ldr r4, =0x00000dda adds r0, r3, r4 adds r0, r1 ldrh r0, [r0] b @081A59EC .align 2, 0 .pool @081A59C8: cmp r1, 0 beq @081A59E0 ldr r2, =0x020375f0 ldr r1, =0x00000cdc adds r0, r3, r1 ldr r0, [r0] movs r1, 0x80 b @081A59EA .align 2, 0 .pool @081A59E0: ldr r2, =0x020375f0 ldr r4, =0x00000cdc 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 .pool thumb_func_end sub_81A5964 thumb_func_start sub_81A59FC sub_81A59FC: ; 81A59FC push {lr} ldr r0, =0x03005d90 ldr r2, [r0] ldr r1, =0x00000ca9 adds r0, r2, r1 ldrb r0, [r0] lsls r0, 30 lsrs r1, r0, 30 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x1 beq @081A5A48 cmp r0, 0x1 bgt @081A5A2C cmp r0, 0 beq @081A5A32 b @081A5ABA .align 2, 0 .pool @081A5A2C: cmp r0, 0x2 beq @081A5A60 b @081A5ABA @081A5A32: ldr r0, =0x020375e4 ldrh r1, [r0] ldr r3, =0x00000dd8 adds r0, r2, r3 strh r1, [r0] b @081A5ABA .align 2, 0 .pool @081A5A48: lsls r1, 1 ldr r3, =0x00000dda adds r0, r2, r3 adds r0, r1 ldr r1, =0x020375e4 ldrh r1, [r1] strh r1, [r0] b @081A5ABA .align 2, 0 .pool @081A5A60: cmp r1, 0 beq @081A5A90 ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @081A5A80 ldr r1, =0x00000cdc adds r0, r2, r1 ldr r1, [r0] movs r2, 0x80 orrs r1, r2 b @081A5AB8 .align 2, 0 .pool @081A5A80: ldr r3, =0x00000cdc adds r0, r2, r3 ldr r1, [r0] movs r2, 0x81 negs r2, r2 b @081A5AB6 .align 2, 0 .pool @081A5A90: ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @081A5AAC ldr r1, =0x00000cdc adds r0, r2, r1 ldr r1, [r0] movs r2, 0x40 orrs r1, r2 b @081A5AB8 .align 2, 0 .pool @081A5AAC: ldr r3, =0x00000cdc 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 .pool thumb_func_end sub_81A59FC thumb_func_start sub_81A5AC4 sub_81A5AC4: ; 81A5AC4 push {r4,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool thumb_func_end sub_81A5AC4 thumb_func_start sub_81A5B08 sub_81A5B08: ; 81A5B08 push {r4,r5,lr} ldr r4, =0x03005d90 ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r0, 29 ldr r2, =0x00000dda adds r1, r2 adds r1, r0 ldrh r0, [r1] cmp r0, 0x29 bls @081A5B58 bl GenerateRandomNumber ldr r4, [r4] ldr r5, =gUnknown_08611FAC 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, =0x00000dd8 adds r4, r1 b @081A5B76 .align 2, 0 .pool @081A5B58: bl GenerateRandomNumber ldr r4, [r4] ldr r5, =gUnknown_08611FA0 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, =0x00000dd8 adds r4, r2 @081A5B76: strh r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A5B08 thumb_func_start sub_81A5B88 sub_81A5B88: ; 81A5B88 push {r4,r5,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000dd8 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, =0x00000dd8 adds r0, r1 ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000dd8 adds r0, r1 movs r1, 0 strh r1, [r0] ldr r0, =0x020375f0 strh r5, [r0] b @081A5BD6 .align 2, 0 .pool @081A5BD0: ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] @081A5BD6: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A5B88 thumb_func_start sub_81A5BE0 sub_81A5BE0: ; 81A5BE0 push {lr} ldr r0, =0x02021cc4 ldr r1, =0x02038bca ldrh r1, [r1] bl sub_8162E20 pop {r0} bx r0 .align 2, 0 .pool 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, =0x00000831 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, =0x00000833 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, =0x00000834 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, =0x00000835 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, =0x00000836 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 .pool 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, =gUnknown_08612120 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A5E74 thumb_func_start sub_81A5E94 sub_81A5E94: ; 81A5E94 push {r4-r7,lr} ldr r5, =0x03005d90 ldr r0, [r5] ldr r4, =0x00000ca9 adds r0, r4 ldrb r0, [r0] lsls r0, 30 lsrs r7, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r6, r0, 16 ldr r0, [r5] ldr r1, =0x00000ca8 adds r0, r1 movs r2, 0 strb r2, [r0] ldr r1, [r5] ldr r3, =0x00000cb2 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, =0x00000cdc adds r3, r4, r0 ldr r2, =gUnknown_08612164 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, =0x00000de2 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, =0x03001288 movs r0, 0 strb r0, [r1] movs r2, 0 ldr r6, =0x03005d8c movs r4, 0xE7 lsls r4, 4 ldr r0, =0x0000ffff 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, =0x03006298 ldr r1, =0x0000ffff 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, =0x02038bca movs r0, 0 strh r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A5E94 thumb_func_start sub_81A5FA8 sub_81A5FA8: ; 81A5FA8 push {r4-r7,lr} ldr r7, =0x03005d90 ldr r0, [r7] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r6, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x2 beq @081A6000 cmp r0, 0x2 bgt @081A5FE4 cmp r0, 0x1 beq @081A5FEA b @081A6044 .align 2, 0 .pool @081A5FE4: cmp r0, 0x3 beq @081A6030 b @081A6044 @081A5FEA: ldr r3, =0x020375f0 ldr r0, [r7] lsls r1, r6, 1 lsls r2, r5, 2 adds r1, r2 ldr r2, =0x00000de2 b @081A603C .align 2, 0 .pool @081A6000: ldr r4, =0x020375f0 ldr r2, [r7] ldr r0, =0x00000cdc adds r2, r0 ldr r3, =gUnknown_08612164 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 .pool @081A6030: ldr r3, =0x020375f0 ldr r0, [r7] lsls r1, r6, 1 lsls r2, r5, 2 adds r1, r2 ldr r2, =0x00000df2 @081A603C: adds r0, r2 adds r0, r1 ldrh r0, [r0] strh r0, [r3] @081A6044: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A5FA8 thumb_func_start sub_81A6054 sub_81A6054: ; 81A6054 push {r4-r6,lr} ldr r6, =0x03005d90 ldr r0, [r6] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x000040ce bl var_get lsls r0, 16 lsrs r4, r0, 16 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x2 beq @081A60B4 cmp r0, 0x2 bgt @081A6090 cmp r0, 0x1 beq @081A6096 b @081A6128 .align 2, 0 .pool @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, =0x00000de2 adds r2, r1 adds r2, r0 ldr r0, =0x020375e4 ldrh r0, [r0] strh r0, [r2] b @081A6128 .align 2, 0 .pool @081A60B4: ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @081A60E4 ldr r2, [r6] ldr r0, =0x00000cdc adds r2, r0 ldr r3, =gUnknown_08612164 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 .pool @081A60E4: ldr r2, [r6] ldr r1, =0x00000cdc adds r2, r1 ldr r3, =gUnknown_08612174 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 .pool @081A6108: ldr r3, =0x03001288 ldrb r0, [r3] cmp r0, 0x1 bne @081A6128 ldr r2, [r6] lsls r0, r5, 1 lsls r1, r4, 2 adds r0, r1 ldr r1, =0x00000df2 adds r2, r1 adds r2, r0 ldr r0, =0x020375e4 ldrh r0, [r0] movs r1, 0 strh r0, [r2] strb r1, [r3] @081A6128: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A6054 thumb_func_start sub_81A613C sub_81A613C: ; 81A613C push {r4,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool 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, =0x03001288 movs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 str r0, [sp, 0x10] ldr r0, =0x000040ce 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, =0x00000de2 adds r1, r6 adds r1, r2 ldrh r0, [r1] movs r1, 0x7 bl __udivsi3 ldr r2, =0x0203bc88 ldr r1, =gBattleFrontierTrainers str r1, [r2] ldr r5, =0x00000cb2 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, =0x00000cb4 adds r0, r1, r2 ldrh r0, [r0] ldr r6, =0x03005d90 cmp r0, r3 beq @081A6244 ldr r1, [r6] ldr r6, =0x00000cb2 adds r0, r1, r6 ldrh r2, [r0] ldr r0, =0x00000cb4 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, =0x00000cb2 adds r0, r1 ldr r6, =0x03005d90 ldrh r0, [r0] cmp r7, r0 bne @081A61FA ldr r0, =0x02038bca 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, =0x00000cb4 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, =0x0203bc8c ldr r2, [r4] lsls r1, r0, 4 adds r0, r1, r2 ldrh r0, [r0] cmp r0, 0xC9 beq @081A636E movs r3, 0 ldr r6, =0x03005d90 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, =0x00000351 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, =0x0203bc8c 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, =gBattleFrontierHeldItems 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, =0x0203bc8c 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, =0x0203bc8c ldr r1, [r0] add r1, r8 ldrh r0, [r1] mov r2, r10 strh r0, [r2] add r2, sp, 0x8 adds r2, r4 ldr r3, =gBattleFrontierHeldItems ldrb r0, [r1, 0xA] lsls r0, 1 adds r0, r3 ldrh r0, [r0] strh r0, [r2] ldr r0, =0x03006298 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 .pool thumb_func_end sub_81A61B0 thumb_func_start sub_81A63B8 sub_81A63B8: ; 81A63B8 push {lr} ldr r0, =0x02038bca ldrh r0, [r0] movs r1, 0 bl sub_8162614 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A63B8 thumb_func_start sub_81A63CC sub_81A63CC: ; 81A63CC push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r1, [r0] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 beq @081A63FC ldr r1, =0x0203bc8c ldr r0, =gBattleFrontierMons b @081A6400 .align 2, 0 .pool @081A63FC: ldr r1, =0x0203bc8c ldr r0, =gSlateportBattleTentMons @081A6400: str r0, [r1] movs r7, 0 ldr r2, =0x03005d90 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, =0x03006298 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, =0x02024744 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, =0x00000e78 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, =0x00000e74 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, =0x00000e79 adds r1, r2 strb r0, [r1] ldrh r1, [r6] ldr r0, =0x0203bc8c ldr r0, [r0] lsls r1, 4 adds r1, r0 ldrb r2, [r1, 0xA] lsls r2, 1 ldr r0, =gBattleFrontierHeldItems 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r2, r0, r1 ldrb r1, [r2] movs r3, 0x3 adds r0, r3, 0 ands r0, r1 cmp r0, 0x2 bne @081A6500 ldr r1, =0x0203bc8c ldr r0, =gSlateportBattleTentMons str r0, [r1] movs r2, 0x1E str r2, [sp, 0x14] b @081A6518 .align 2, 0 .pool @081A6500: ldr r1, =0x0203bc8c ldr r0, =gBattleFrontierMons 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, =0x020375e2 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, =0x0203bc8c mov r9, r2 @081A6534: ldr r4, =0x03005d90 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, =0x00000e78 adds r1, r5 ldrb r6, [r1] movs r1, 0x64 mov r0, r8 muls r0, r1 ldr r1, =0x020244ec 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, =0x00000e74 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, =0x020244ec @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, =0x020244ec 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, =0x020244ec 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, =gBattleFrontierHeldItems adds r2, r0 adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr mov r2, r10 add r2, r8 lsls r2, 2 ldr r5, =0x03005d90 ldr r0, [r5] adds r2, r0 ldr r0, =0x00000e79 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, =0x020375e2 ldrh r0, [r0] cmp r0, 0 beq @081A667A cmp r0, 0x2 beq @081A667A b @081A67AE @081A667A: movs r2, 0 mov r8, r2 ldr r4, =0x0203bc8c mov r9, r4 @081A6682: ldr r5, =0x03005d90 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, =0x00000e78 adds r1, r5 ldrb r6, [r1] movs r1, 0x64 mov r0, r8 muls r0, r1 ldr r1, =0x02024744 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, =0x00000e74 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, =0x02024744 @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, =0x02024744 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, =0x02024744 adds r4, r0 mov r5, r9 ldr r0, [r5] adds r0, r7, r0 ldrb r2, [r0, 0xA] lsls r2, 1 ldr r0, =gBattleFrontierHeldItems adds r2, r0 adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr mov r2, r10 add r2, r8 lsls r2, 2 ldr r1, =0x03005d90 ldr r0, [r1] adds r2, r0 ldr r5, =0x00000e9d 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 .pool 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, =0x0203bc88 ldr r0, =gBattleFrontierTrainers 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, =0x03005d90 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, =0x00000ca9 adds r0, r7 ldrb r4, [r0] lsls r4, 30 lsrs r4, 30 ldr r6, =0x000040ce adds r0, r6, 0 bl var_get lsls r0, 24 ldr r1, [r5] lsls r4, 1 lsrs r0, 22 adds r4, r0 ldr r5, =0x00000de2 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, =0x0203bc8c ldr r0, =gBattleFrontierMons 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 .pool @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, =0x0203bc8c 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, =gBattleFrontierHeldItems 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, =0x0203bc8c 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 .pool @081A6994: adds r5, 0x2 adds r3, 0x1 cmp r3, r6 blt @081A6964 @081A699C: cmp r3, r6 bne @081A69E2 ldr r0, =0x03005d90 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, =0x0203bc8c ldr r1, [r2] add r1, r9 ldrh r0, [r1] ldr r4, [sp, 0x44] strh r0, [r4] ldr r2, =gBattleFrontierHeldItems 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 .pool 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, =0x0203bc8c ldr r0, =gBattleFrontierMons str r0, [r1] movs r4, 0 add r5, sp, 0x14 ldr r7, =0x020375f0 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, =0x03006298 mov r8, r0 ldr r0, =0x0203bc8c ldr r6, [r0] ldr r1, =gBaseStats 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 .pool @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, =0x0203bc8c ldr r0, =gBattleFrontierMons 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, =0x03006298 lsls r0, r4, 1 adds r0, r1 ldrh r6, [r0] movs r5, 0 @081A6B18: ldr r0, =0x0203bc8c 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, =0x020375f0 movs r0, 0 strh r0, [r1] movs r4, 0x1 adds r5, r1, 0 ldr r3, =gBattleFactoryStyleRequiredMoveCounts 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 .pool 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, =gBattleFactoryStyleMoveListPointers @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 .pool @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, =0x02037318 ldr r3, =0xfffffea5 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 .pool thumb_func_end sub_81A6BF4 thumb_func_start sub_81A6C1C sub_81A6C1C: ; 81A6C1C push {r4,lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r1, [r0] movs r0, 0x3 ands r0, r1 cmp r0, 0x2 beq @081A6C48 ldr r1, =0x0203bc8c ldr r0, =gBattleFrontierMons b @081A6C4C .align 2, 0 .pool @081A6C48: ldr r1, =0x0203bc8c ldr r0, =gSlateportBattleTentMons @081A6C4C: str r0, [r1] movs r4, 0 @081A6C50: movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x03005d90 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, =0x0203bc8c ldr r1, [r1] lsls r2, 4 adds r2, r1 ldrb r2, [r2, 0xA] lsls r2, 1 ldr r1, =gBattleFrontierHeldItems 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 .pool 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, =gUnknown_08612184 lsls r1, 1 adds r1, r2, r1 adds r1, r0 ldrb r0, [r1] pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 str r0, [sp, 0x2C] ldr r0, =0x000040ce 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, =0x00000de2 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, =0x0203bc8c 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, =0x00000351 cmp r5, r0 bls @081A6D78 b @081A6EB8 @081A6D78: movs r2, 0 ldr r1, =0x03005d90 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, =0x0203bc8c 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, =0x0203bc8c 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, =gBattleFrontierHeldItems ldr r6, =0x0203bc8c 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, =0x0203bc8c 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, =gBattleFrontierHeldItems 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, =0x02024744 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, =0x0203bc8c 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, =0x02024744 adds r4, r0 adds r0, r4, 0 movs r1, 0x20 mov r2, r10 bl pokemon_setattr ldr r2, =0x0203bc8c ldr r0, [r2] adds r0, r7, r0 ldrb r2, [r0, 0xA] lsls r2, 1 ldr r0, =gBattleFrontierHeldItems 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 .pool 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, =gUnknown_08612194 adds r1, r3 adds r1, 0x1 b @081A6F38 .align 2, 0 .pool @081A6F20: ldr r2, =gUnknown_08612194 adds r1, r3 b @081A6F38 .align 2, 0 .pool @081A6F2C: adds r1, r3, 0 cmp r1, 0x7 beq @081A6F34 movs r1, 0x7 @081A6F34: ldr r2, =gUnknown_08612194 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 .pool thumb_func_end sub_81A6EF0 thumb_func_start sub_81A6F70 sub_81A6F70: ; 81A6F70 push {lr} lsls r0, 24 lsls r1, 24 ldr r2, =0x03005d90 ldr r2, [r2] lsrs r1, 23 lsrs r0, 22 adds r1, r0 ldr r0, =0x00000df2 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 .pool thumb_func_end sub_81A6F70 thumb_func_start sub_81A6FB4 sub_81A6FB4: ; 81A6FB4 push {r4,r5,lr} ldr r5, =0x03005d90 ldr r0, [r5] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r4, r0, 30 cmp r4, 0x2 beq @081A6FF8 ldr r0, =0x000040ce bl var_get lsls r0, 16 ldr r1, [r5] lsls r2, r4, 1 lsrs r0, 14 adds r2, r0 ldr r0, =0x00000de2 adds r1, r0 adds r1, r2 ldrh r0, [r1] movs r1, 0x7 bl __udivsi3 lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x02038bca ldrh r1, [r0] ldr r0, =0x000003fe cmp r1, r0 beq @081A7018 cmp r2, 0x1 bgt @081A7014 @081A6FF8: movs r0, 0 b @081A701E .align 2, 0 .pool @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, =gUnknown_086125F8 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A703C thumb_func_start sub_81A705C sub_81A705C: ; 81A705C push {lr} bl sub_81A79EC ldr r1, =0x0300128c strb r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A705C thumb_func_start sub_81A7070 sub_81A7070: ; 81A7070 push {r4-r7,lr} ldr r0, =0x00004010 movs r1, 0x1C bl var_set ldr r0, =0x00004011 movs r1, 0xE2 bl var_set movs r4, 0x1 movs r6, 0 movs r5, 0 movs r7, 0 ldr r0, =0x0300128c ldrb r0, [r0] cmp r0, 0x8 bhi @081A7132 lsls r0, 2 ldr r1, =@081A70AC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0300128d ldrb r0, [r0] movs r7, 0xE1 cmp r0, 0x1 bne @081A7118 movs r7, 0xE2 b @081A7118 .align 2, 0 .pool @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, =0x00004010 adds r1, r5, 0 bl var_set @081A7126: cmp r6, 0x1 bne @081A7132 ldr r0, =0x00004011 adds r1, r7, 0 bl var_set @081A7132: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A7070 thumb_func_start sub_81A7140 sub_81A7140: ; 81A7140 push {lr} ldr r1, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000ca9 adds r0, r2 ldrb r0, [r0] lsls r0, 30 lsrs r2, r0, 30 ldr r0, =0x020375e2 ldrh r0, [r0] adds r3, r1, 0 cmp r0, 0x4 bhi @081A723A lsls r0, 2 ldr r1, =@081A7174 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081A7174: .4byte @081A7188 .4byte @081A71A0 .4byte @081A71C4 .4byte @081A71E8 .4byte @081A720C @081A7188: ldr r0, =0x020375f0 ldr r1, [r3] ldr r3, =0x00000e02 adds r1, r3 ldrh r1, [r1] strh r1, [r0] b @081A723A .align 2, 0 .pool @081A71A0: ldr r2, =0x020375f0 ldr r1, [r3] ldr r3, =0x00000ca9 adds r0, r1, r3 ldrb r0, [r0] lsls r0, 30 lsrs r0, 29 ldr r3, =0x00000e04 adds r1, r3 adds r1, r0 ldrh r0, [r1] b @081A7238 .align 2, 0 .pool @081A71C4: ldr r2, =0x020375f0 ldr r1, [r3] ldr r3, =0x00000ca9 adds r0, r1, r3 ldrb r0, [r0] lsls r0, 30 lsrs r0, 29 ldr r3, =0x00000e08 adds r1, r3 adds r1, r0 ldrh r0, [r1] b @081A7238 .align 2, 0 .pool @081A71E8: ldr r2, =0x020375f0 ldr r1, [r3] ldr r3, =0x00000ca9 adds r0, r1, r3 ldrb r0, [r0] lsls r0, 30 lsrs r0, 29 ldr r3, =0x00000e0c adds r1, r3 adds r1, r0 ldrh r0, [r1] b @081A7238 .align 2, 0 .pool @081A720C: cmp r2, 0 beq @081A7228 ldr r2, =0x020375f0 ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 4 b @081A7236 .align 2, 0 .pool @081A7228: ldr r2, =0x020375f0 ldr r0, [r3] ldr r3, =0x00000cdc 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 .pool thumb_func_end sub_81A7140 thumb_func_start sub_81A7248 sub_81A7248: ; 81A7248 push {r4,r5,lr} ldr r1, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000ca9 adds r0, r2 ldrb r0, [r0] lsls r0, 30 lsrs r3, r0, 30 ldr r0, =0x020375e2 ldrh r0, [r0] adds r2, r1, 0 cmp r0, 0x4 bls @081A7264 b @081A73AA @081A7264: lsls r0, 2 ldr r1, =@081A7280 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081A7280: .4byte @081A7294 .4byte @081A72AC .4byte @081A72D8 .4byte @081A7314 .4byte @081A7344 @081A7294: ldr r0, [r2] ldr r1, =0x020375e4 ldrh r1, [r1] ldr r5, =0x00000e02 adds r0, r5 strh r1, [r0] b @081A73AA .align 2, 0 .pool @081A72AC: ldr r0, =0x020375e4 ldrh r3, [r0] ldr r0, =0x0000270f cmp r3, r0 bls @081A72B8 b @081A73AA @081A72B8: ldr r0, [r2] ldr r2, =0x00000ca9 adds r1, r0, r2 ldrb r1, [r1] lsls r1, 30 lsrs r1, 29 ldr r5, =0x00000e04 b @081A732C .align 2, 0 .pool @081A72D8: ldr r0, =0x020375e4 ldrh r4, [r0] adds r3, r4, 0 ldr r0, =0x0000270f cmp r3, r0 bhi @081A73AA ldr r1, [r2] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r2, r0, 30 lsrs r0, r2, 29 ldr r5, =0x00000e08 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 .pool @081A7314: ldr r0, =0x020375e4 ldrh r3, [r0] ldr r0, =0x0000270f cmp r3, r0 bhi @081A73AA ldr r0, [r2] ldr r2, =0x00000ca9 adds r1, r0, r2 ldrb r1, [r1] lsls r1, 30 lsrs r1, 29 ldr r5, =0x00000e0c @081A732C: adds r0, r5 adds r0, r1 strh r3, [r0] b @081A73AA .align 2, 0 .pool @081A7344: cmp r3, 0 beq @081A737C ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @081A7368 ldr r0, [r2] ldr r1, =0x00000cdc adds r0, r1 ldr r1, [r0] movs r2, 0x80 lsls r2, 4 orrs r1, r2 b @081A73A8 .align 2, 0 .pool @081A7368: ldr r0, [r2] ldr r2, =0x00000cdc adds r0, r2 ldr r1, [r0] ldr r2, =0xfffff7ff b @081A73A6 .align 2, 0 .pool @081A737C: ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @081A739C ldr r0, [r2] ldr r5, =0x00000cdc adds r0, r5 ldr r1, [r0] movs r2, 0x80 lsls r2, 3 orrs r1, r2 b @081A73A8 .align 2, 0 .pool @081A739C: ldr r0, [r2] ldr r1, =0x00000cdc adds r0, r1 ldr r1, [r0] ldr r2, =0xfffffbff @081A73A6: ands r1, r2 @081A73A8: str r1, [r0] @081A73AA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A7248 thumb_func_start sub_81A73B8 sub_81A73B8: ; 81A73B8 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 ldrh r0, [r0] cmp r0, 0xE bls @081A73DC ldr r1, =0x020375f0 movs r0, 0x1 b @081A73E0 .align 2, 0 .pool @081A73DC: ldr r1, =0x020375f0 movs r0, 0 @081A73E0: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A73B8 thumb_func_start sub_81A73EC sub_81A73EC: ; 81A73EC ldr r0, =0x020375f0 ldr r1, =0x0300128c ldrb r1, [r1] strh r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81A73EC thumb_func_start sub_81A7400 sub_81A7400: ; 81A7400 ldr r1, =0x0300128e movs r0, 0x1 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81A7400 thumb_func_start sub_81A740C sub_81A740C: ; 81A740C ldr r1, =0x0300128e movs r0, 0 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81A740C thumb_func_start sub_81A7418 sub_81A7418: ; 81A7418 push {r4,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool 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, =0x03001290 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 .pool @081A7484: cmp r0, 0x40 beq @081A74B0 cmp r0, 0x80 beq @081A74A4 b @081A74C2 @081A748E: ldr r1, =0x020375f0 movs r0, 0 b @081A74C0 .align 2, 0 .pool @081A7498: ldr r1, =0x020375f0 movs r0, 0x1 b @081A74C0 .align 2, 0 .pool @081A74A4: ldr r1, =0x020375f0 movs r0, 0x2 b @081A74C0 .align 2, 0 .pool @081A74B0: ldr r1, =0x020375f0 movs r0, 0x3 b @081A74C0 .align 2, 0 .pool @081A74BC: ldr r1, =0x020375f0 movs r0, 0x4 @081A74C0: strh r0, [r1] @081A74C2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A7468 thumb_func_start sub_81A74CC sub_81A74CC: ; 81A74CC ldr r0, =0x020375f0 ldr r1, =0x0300128d ldrb r1, [r1] strh r1, [r0] bx lr .align 2, 0 .pool 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, =0x020375f0 strh r4, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A74E0 thumb_func_start sub_81A7508 sub_81A7508: ; 81A7508 push {lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 ldrh r0, [r0] cmp r0, 0x4 bhi @081A7538 ldr r1, =gUnknown_0861231C ldr r0, =0x03001294 ldrb r0, [r0] lsls r0, 3 adds r0, r1 ldrb r1, [r0, 0x2] b @081A7560 .align 2, 0 .pool @081A7538: cmp r0, 0xA bhi @081A7554 ldr r1, =gUnknown_0861231C ldr r0, =0x03001294 ldrb r0, [r0] lsls r0, 3 adds r0, r1 ldrb r1, [r0, 0x3] b @081A7560 .align 2, 0 .pool @081A7554: ldr r1, =gUnknown_0861231C ldr r0, =0x03001294 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, =gUnknown_086123E4 adds r0, r1 bl sub_81638AC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A7508 thumb_func_start sub_81A7580 sub_81A7580: ; 81A7580 push {lr} ldr r0, =sub_81A7EE4 movs r1, 0x2 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =gBaseStats 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 .pool @081A76C4: ldr r0, =gBaseStats 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 .pool @081A76E0: ldr r1, =gBaseStats 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 .pool @081A7704: ldr r0, =gBaseStats 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r4, =0x00000cb2 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, =0x03001290 @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 .pool @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, =0x03001290 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, =0x020244ec 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, =0x03001290 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 .pool @081A7898: ldr r1, =0x0300128d movs r0, 0x1 b @081A78D4 .align 2, 0 .pool @081A78A4: bl GenerateRandomNumber lsls r0, 16 lsrs r1, r0, 16 movs r2, 0x1 ands r1, r2 cmp r1, 0 beq @081A78C0 ldr r0, =0x0300128d strb r2, [r0] b @081A78D6 .align 2, 0 .pool @081A78C0: ldr r0, =0x0300128d strb r1, [r0] b @081A78D6 .align 2, 0 .pool @081A78CC: movs r0, 0 b @081A7956 @081A78D0: ldr r1, =0x0300128d 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, =0x020244ec 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, =0x03001290 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 .pool thumb_func_end sub_81A7728 thumb_func_start sub_81A7974 sub_81A7974: ; 81A7974 push {r4-r7,lr} ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb2 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 .pool @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, =0x020244ec 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 .pool @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, =0x03005d90 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 .pool @081A7A10: ldr r0, =0x020375e6 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 .pool @081A7A34: movs r2, 0 ldr r3, =gUnknown_0861266C 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, =0x03005d90 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 .pool thumb_func_end sub_81A79EC thumb_func_start sub_81A7B58 sub_81A7B58: ; 81A7B58 push {r4,lr} ldr r4, =0x03001294 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x19 bl __umodsi3 strb r0, [r4] ldr r1, =gUnknown_0861231C ldrb r0, [r4] lsls r0, 3 adds r0, r1 ldrh r0, [r0] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81A7B58 thumb_func_start sub_81A7B84 sub_81A7B84: ; 81A7B84 ldr r0, =0x0300128e ldrb r0, [r0] bx lr .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r7] ldr r4, =0x00000ca9 adds r0, r4 ldrb r0, [r0] lsls r0, 30 ldr r1, =gUnknown_08612314 lsrs r0, 28 adds r0, r1 ldr r0, [r0] str r0, [sp, 0x4] ldr r0, =0x02024744 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 .pool @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, =0x02024744 ldr r1, =gBaseStats 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, =gExperienceTables 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, =0x02024744 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, =0x02024744 bl sub_80691F4 adds r4, 0x1 cmp r4, 0x3 ble @081A7CBA ldr r0, =0x02024744 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 .pool thumb_func_end sub_81A7B90 thumb_func_start sub_81A7D00 sub_81A7D00: ; 81A7D00 push {lr} ldr r0, =0x03005d90 ldr r1, [r0] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r0, 29 ldr r2, =0x00000e04 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 .pool @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, =gUnknown_08612688 ldr r2, =0x03005e00 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 .pool 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, =0x00002d6b 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 .pool 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, =0x00002d6b 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, =sub_81A7D54 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task b @081A7E56 .align 2, 0 .pool @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, =sub_81A7D54 movs r1, 0x3 str r3, [sp] bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 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 .pool thumb_func_end sub_81A7E60 thumb_func_start sub_81A7EC4 sub_81A7EC4: ; 81A7EC4 push {lr} ldr r0, =sub_81A7D54 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 .pool @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, =0x03005e00 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 .pool @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, =0x020244ec 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 .pool @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, =0x020244ec 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 .pool thumb_func_end sub_81A7F38 thumb_func_start sub_81A8090 sub_81A8090: ; 81A8090 push {r4,lr} ldr r4, =0x020375f0 bl sub_81A80A8 lsls r0, 24 lsrs r0, 24 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A8090 thumb_func_start sub_81A80A8 sub_81A80A8: ; 81A80A8 push {lr} movs r2, 0 ldr r0, =0x02037318 ldrh r1, [r0, 0x12] ldr r3, =0xfffffea1 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 .pool thumb_func_end sub_81A80A8 thumb_func_start sub_81A80DC sub_81A80DC: ; 81A80DC push {r4-r7,lr} mov r7, r8 push {r7} ldr r4, =0x020375f0 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, =0x03005d90 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 .pool @081A8138: bl GenerateRandomNumber ldr r7, =0x03005d90 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 .pool @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, =0x03005d90 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, =0x03005d90 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 .pool thumb_func_end sub_81A80DC thumb_func_start sub_81A825C sub_81A825C: ; 81A825C ldr r1, =0x020375f0 ldr r0, =0x03005d90 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 .pool thumb_func_end sub_81A825C thumb_func_start sub_81A827C sub_81A827C: ; 81A827C ldr r2, =0x020375f0 ldr r1, =gUnknown_0861266C ldr r0, =0x03005d90 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 .pool 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, =0x03005d90 ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r0, 29 ldr r2, =0x00000e04 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, =0x00000cb2 adds r0, r1, r2 ldrh r0, [r0] subs r2, r0, 0x1 cmp r3, r2 bge @081A831A ldr r0, =0x00000cb4 adds r1, r0 b @081A8314 .align 2, 0 .pool @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, =0x00000cb2 adds r0, r1 ldrh r0, [r0] subs r0, 0x1 cmp r3, r0 bne @081A82D2 ldr r5, =0x02038bca strh r4, [r5] ldr r1, =0x0203bc88 ldr r0, =gBattleFrontierTrainers str r0, [r1] ldrh r0, [r5] movs r1, 0 bl sub_8162614 ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000cb2 adds r2, r1, r0 ldrh r0, [r2] cmp r0, 0xD bhi @081A8356 subs r0, 0x1 lsls r0, 1 ldr r2, =0x00000cb4 adds r1, r2 adds r1, r0 ldrh r0, [r5] strh r0, [r1] @081A8356: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A82A4 thumb_func_start sub_81A8374 sub_81A8374: ; 81A8374 push {r4-r7,lr} ldr r4, =0x03005d90 ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r0, 29 ldr r2, =0x00000e04 adds r1, r2 adds r1, r0 ldrh r0, [r1] movs r1, 0xE bl __udivsi3 lsls r0, 16 lsrs r5, r0, 16 ldr r1, =0x0203bc88 ldr r0, =gBattleFrontierTrainers 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, =0x00000cb2 adds r0, r1, r2 ldrh r0, [r0] subs r2, r0, 0x1 cmp r3, r2 bge @081A83EE ldr r0, =0x00000cb4 adds r1, r0 b @081A83E8 .align 2, 0 .pool @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, =0x00000cb2 adds r0, r1 ldrh r0, [r0] subs r0, 0x1 cmp r3, r0 bne @081A83A0 ldr r5, =0x02038bca strh r4, [r5] ldrh r0, [r5] movs r1, 0 bl sub_8162614 ldr r3, =0x03005d90 ldr r1, [r3] ldr r0, =0x00000cb2 adds r2, r1, r0 ldrh r0, [r2] cmp r0, 0xE bhi @081A8424 subs r0, 0x1 lsls r0, 1 ldr r2, =0x00000cb4 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, =0x00000cb2 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, =0x03005d90 ldr r1, [r0] subs r2, 0x2 adds r0, r1, r2 ldrh r2, [r0] ldr r0, =0x00000cb4 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, =0x00000cb2 adds r0, r1 ldrh r0, [r0] cmp r3, r0 bne @081A8426 ldr r5, =0x02038bcc strh r4, [r5] ldrh r0, [r5] movs r1, 0x1 bl sub_8162614 ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000cb2 adds r2, r1, r0 ldrh r0, [r2] cmp r0, 0xD bhi @081A849A subs r0, 0x2 lsls r0, 1 ldr r2, =0x00000cb4 adds r1, r2 adds r1, r0 ldrh r0, [r5] strh r0, [r1] @081A849A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A8374 thumb_func_start sub_81A84B4 sub_81A84B4: ; 81A84B4 push {r4,r5,lr} movs r2, 0 ldr r5, =0x03005d90 ldr r4, =0x00000cb4 ldr r0, =0x0000ffff 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 .pool thumb_func_end sub_81A84B4 thumb_func_start sub_81A84EC sub_81A84EC: ; 81A84EC push {lr} ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0 bne @081A8524 ldr r3, =0x02038bca ldrh r1, [r3] ldr r0, =0x0000012b cmp r1, r0 bhi @081A8542 ldr r2, =0x0203bc88 movs r0, 0x34 muls r1, r0 ldr r0, [r2] adds r0, r1 adds r0, 0xC bl sub_81638AC b @081A8542 .align 2, 0 .pool @081A8524: cmp r0, 0x1 bne @081A8542 ldr r3, =0x02038bcc ldrh r1, [r3] ldr r0, =0x0000012b cmp r1, r0 bhi @081A8542 ldr r2, =0x0203bc88 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 .pool thumb_func_end sub_81A84EC thumb_func_start sub_81A8554 sub_81A8554: ; 81A8554 push {r4-r6,lr} ldr r5, =0x020244ec 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 .pool @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, =0x03005d90 ldr r2, [r1] ldr r3, =0x00000ca9 adds r1, r2, r3 ldrb r1, [r1] lsls r1, 30 lsrs r1, 29 ldr r3, =0x00000e04 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, =gUnknown_086125DC 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 .pool @081A85F0: ldr r5, =gUnknown_086125DC 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 .pool @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, =0x020375f0 movs r0, 0 bl sub_81A8590 lsls r0, 24 lsrs r0, 24 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A863C thumb_func_start sub_81A8658 sub_81A8658: ; 81A8658 push {r4,lr} ldr r3, =gUnknown_08612675 ldr r2, =0x020375e6 ldr r0, =0x03005d90 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, =0x020375f0 strh r4, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A8658 thumb_func_start sub_81A869C sub_81A869C: ; 81A869C ldr r0, =0x03005d90 ldr r2, [r0] ldr r0, =0x020375e2 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 .pool 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, =0x020375f0 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, =0x020244ec 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 .pool @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, =0x020375f0 movs r0, 0 strh r0, [r1] b @081A8786 .align 2, 0 .pool @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, =0x03005d8c ldr r6, =0x03005d90 @081A879C: ldr r0, [r6] lsls r4, r5, 1 ldr r1, =0x00000caa 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, =0x00000e12 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 .pool thumb_func_end sub_81A8794 thumb_func_start sub_81A87E8 sub_81A87E8: ; 81A87E8 push {r4,lr} movs r4, 0 @081A87EC: ldr r0, =0x03005d90 ldr r2, [r0] lsls r3, r4, 1 ldr r1, =0x00000caa adds r0, r2, r1 adds r0, r3 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x02024488 adds r0, r1 ldr r1, =0x00000e12 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 .pool thumb_func_end sub_81A87E8 thumb_func_start sub_81A8830 sub_81A8830: ; 81A8830 push {r4-r6,lr} ldr r3, =0x03005d90 ldr r1, [r3] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x00000ca8 adds r1, r0 movs r4, 0 strb r4, [r1] ldr r1, [r3] ldr r6, =0x00000cb2 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, =0x00000cdc adds r2, r3, r0 ldr r1, =gUnknown_08612690 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, =0x00000e04 adds r0, r3, r2 adds r0, r1 strh r4, [r0] @081A887C: ldr r0, =0x02038bca strh r4, [r0] ldr r1, =0x0202433a movs r0, 0 strb r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec 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 .pool @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, =0x0000017b cmp r2, r0 bne @081A8920 movs r1, 0 b @081A892A .align 2, 0 .pool @081A8920: ldr r0, =0x00000149 movs r1, 0x2 cmp r2, r0 bne @081A892A movs r1, 0x1 @081A892A: adds r0, r1, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203ce50 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 .pool thumb_func_end sub_81A8934 thumb_func_start sub_81A895C sub_81A895C: ; 81A895C push {r4,lr} ldr r4, =0x0203ce50 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, =0x02037350 adds r0, r1 bl sub_8093284 bl sub_80D338C pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c 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, =0x0203ce50 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, =0x0000024f 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 .pool @081A8A44: cmp r5, 0x2 beq @081A8A64 cmp r5, 0x3 beq @081A8A70 b @081A8AD4 @081A8A4E: ldr r7, =gUnknown_08612698 movs r1, 0x1 b @081A8A74 .align 2, 0 .pool @081A8A58: ldr r7, =gUnknown_0861269C movs r2, 0x1 b @081A8A74 .align 2, 0 .pool @081A8A64: ldr r7, =gUnknown_086126A0 movs r1, 0xFF b @081A8A74 .align 2, 0 .pool @081A8A70: ldr r7, =gUnknown_086126A4 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, =0x03005d8c 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 .pool @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, =0x0203ce50 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, =0x03005d8c 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 .pool @081A8BAC: movs r6, 0x2 cmp r1, 0 ble @081A8BB4 @081A8BB2: movs r6, 0x1 @081A8BB4: ldr r5, =0x0203ce50 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, =0x03005d8c 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, =0x02037350 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 .pool @081A8C0C: cmp r0, 0x3 beq @081A8C48 cmp r0, 0x4 beq @081A8C16 b @081A8D32 @081A8C16: ldr r3, =gUnknown_086126AE 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 .pool @081A8C30: ldr r3, =gUnknown_086126A8 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 .pool @081A8C48: ldr r3, =gUnknown_086126AA 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 .pool @081A8C60: ldr r3, =gUnknown_086126AC 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, =0x03005d8c ldr r2, [r1] ldrb r1, [r2, 0x5] ldrb r2, [r2, 0x4] bl exec_movement b @081A8D32 .align 2, 0 .pool @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, =gUnknown_086126AA 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 .pool @081A8CD0: ldr r3, =gUnknown_086126AC 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 .pool @081A8CE8: ldr r3, =gUnknown_086126AE 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 .pool @081A8D00: ldr r3, =gUnknown_086126A8 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, =0x03005d8c 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 .pool thumb_func_end sub_81A8AF8 thumb_func_start sub_81A8D60 sub_81A8D60: ; 81A8D60 push {r4,lr} ldr r4, =0x0203ce50 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 .pool 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, =0x03005d8c 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, =0x0203ce50 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 .pool @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, =gUnknown_08613EE0 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A8E7C thumb_func_start sub_81A8E9C sub_81A8E9C: ; 81A8E9C push {r4-r6,lr} ldr r3, =0x03005d90 ldr r1, [r3] ldr r4, =0x00000ca9 adds r0, r1, r4 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 ldr r0, =0x00000ca8 adds r1, r0 movs r2, 0 strb r2, [r1] ldr r1, [r3] ldr r6, =0x00000cb2 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, =0x00000cdc adds r0, r1 ldr r2, [r0] movs r0, 0x80 lsls r0, 6 b @081A8EFC .align 2, 0 .pool @081A8EF0: ldr r0, [r3] ldr r6, =0x00000cdc 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, =0x00000e1a adds r0, r3 adds r0, r1 strh r2, [r0] adds r0, r5, 0 bl sub_81AAA7C @081A8F14: bl sub_81C4EEC ldr r0, =0x02038bca movs r1, 0 strh r1, [r0] ldr r0, =0x0202433a strb r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A8E9C thumb_func_start sub_81A8F38 sub_81A8F38: ; 81A8F38 push {r4,lr} ldr r1, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000ca9 adds r0, r2 ldrb r0, [r0] lsls r0, 30 lsrs r4, r0, 30 ldr r0, =0x020375e2 ldrh r0, [r0] adds r3, r1, 0 cmp r0, 0x6 bls @081A8F54 b @081A903A @081A8F54: lsls r0, 2 ldr r1, =@081A8F70 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081A8F70: .4byte @081A8F8C .4byte @081A8F9C .4byte @081A8FB4 .4byte @081A8FE4 .4byte @081A8FF8 .4byte @081A9010 .4byte @081A9028 @081A8F8C: ldr r0, =0x020375f0 ldr r1, [r3] ldr r3, =0x00000e18 b @081A8FFE .align 2, 0 .pool @081A8F9C: ldr r2, =0x020375f0 ldr r0, [r3] lsls r1, r4, 1 ldr r3, =0x00000e1a adds r0, r3 adds r0, r1 ldrh r0, [r0] b @081A9038 .align 2, 0 .pool @081A8FB4: cmp r4, 0 beq @081A8FCC ldr r2, =0x020375f0 ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 b @081A9030 .align 2, 0 .pool @081A8FCC: ldr r2, =0x020375f0 ldr r0, [r3] ldr r3, =0x00000cdc adds r0, r3 ldr r0, [r0] movs r1, 0x80 lsls r1, 5 b @081A9036 .align 2, 0 .pool @081A8FE4: ldr r0, =0x020375f0 ldr r1, [r3] ldr r2, =0x00000e1a adds r1, r2 b @081A9000 .align 2, 0 .pool @081A8FF8: ldr r0, =0x020375f0 ldr r1, [r3] ldr r3, =0x00000e1c @081A8FFE: adds r1, r3 @081A9000: ldrh r1, [r1] strh r1, [r0] b @081A903A .align 2, 0 .pool @081A9010: ldr r2, =0x020375f0 ldr r0, [r3] ldr r1, =0x00000cdc adds r0, r1 ldr r0, [r0] movs r1, 0x80 lsls r1, 5 b @081A9036 .align 2, 0 .pool @081A9028: ldr r2, =0x020375f0 ldr r0, [r3] ldr r3, =0x00000cdc 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 .pool thumb_func_end sub_81A8F38 thumb_func_start sub_81A9048 sub_81A9048: ; 81A9048 push {lr} ldr r0, =0x03005d90 ldr r2, [r0] ldr r1, =0x00000ca9 adds r0, r2, r1 ldrb r0, [r0] lsls r0, 30 lsrs r1, r0, 30 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x1 beq @081A9098 cmp r0, 0x1 bgt @081A9078 cmp r0, 0 beq @081A9082 b @081A9126 .align 2, 0 .pool @081A9078: cmp r0, 0x2 beq @081A90B0 cmp r0, 0x7 beq @081A911C b @081A9126 @081A9082: ldr r0, =0x020375e4 ldrh r1, [r0] ldr r3, =0x00000e18 adds r0, r2, r3 strh r1, [r0] b @081A9126 .align 2, 0 .pool @081A9098: lsls r1, 1 ldr r3, =0x00000e1a adds r0, r2, r3 adds r0, r1 ldr r1, =0x020375e4 ldrh r1, [r1] strh r1, [r0] b @081A9126 .align 2, 0 .pool @081A90B0: cmp r1, 0 beq @081A90E4 ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @081A90D0 ldr r1, =0x00000cdc adds r0, r2, r1 ldr r1, [r0] movs r2, 0x80 lsls r2, 6 b @081A90F6 .align 2, 0 .pool @081A90D0: ldr r3, =0x00000cdc adds r0, r2, r3 ldr r1, [r0] ldr r2, =0xffffdfff b @081A910C .align 2, 0 .pool @081A90E4: ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @081A9104 ldr r1, =0x00000cdc 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 .pool @081A9104: ldr r3, =0x00000cdc adds r0, r2, r3 ldr r1, [r0] ldr r2, =0xffffefff @081A910C: ands r1, r2 str r1, [r0] b @081A9126 .align 2, 0 .pool @081A911C: ldr r0, =0x020375e4 ldrh r1, [r0] ldr r3, =0x00000e2a adds r0, r2, r3 strb r1, [r0] @081A9126: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A9048 thumb_func_start sub_81A9134 sub_81A9134: ; 81A9134 push {r4,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool thumb_func_end sub_81A9134 thumb_func_start sub_81A917C sub_81A917C: ; 81A917C push {r4,r5,lr} ldr r4, =0x03005d90 ldr r1, [r4] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r0, 29 ldr r2, =0x00000e1a adds r1, r2 adds r1, r0 ldrh r0, [r1] cmp r0, 0x29 bls @081A91CC bl GenerateRandomNumber ldr r4, [r4] ldr r5, =gUnknown_08613F34 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, =0x00000e18 adds r4, r1 b @081A91EA .align 2, 0 .pool @081A91CC: bl GenerateRandomNumber ldr r4, [r4] ldr r5, =gUnknown_08613F28 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, =0x00000e18 adds r4, r2 @081A91EA: strh r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A917C thumb_func_start sub_81A91FC sub_81A91FC: ; 81A91FC push {r4,r5,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000e18 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, =0x00000e18 adds r0, r1 ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000e18 adds r0, r1 movs r1, 0 strh r1, [r0] ldr r0, =0x020375f0 strh r5, [r0] b @081A924A .align 2, 0 .pool @081A9244: ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] @081A924A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A91FC thumb_func_start sub_81A9254 sub_81A9254: ; 81A9254 push {r4,r5,lr} movs r4, 0 ldr r5, =0x03005d90 @081A925A: bl GenerateRandomNumber ldr r1, [r5] lsls r2, r4, 1 ldr r3, =0x00000e22 adds r1, r3 adds r1, r2 strh r0, [r1] adds r4, 0x1 cmp r4, 0x3 ble @081A925A ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e2a adds r0, r1 movs r1, 0 strb r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r1, [r5] ldr r2, =0x00000ca9 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, =0x00000e1a 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, =0x020375f2 ldrh r4, [r1] ldr r1, =gUnknown_08613650 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, =0x00000e22 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, =gUnknown_08613B3A ldr r1, [sp] adds r0, r1, r0 ldrb r5, [r0] ldr r1, =gUnknown_08613ABC ldr r3, =0x020375d8 ldr r4, =0x020375da 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, =gUnknown_0861392C b @081A9396 .align 2, 0 .pool @081A9394: ldr r2, =gUnknown_0861379C @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 .pool thumb_func_end sub_81A9290 thumb_func_start sub_81A93C8 sub_81A93C8: ; 81A93C8 push {r4,r5,lr} ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 adds r3, r0, r1 movs r2, 0 ldr r4, =0x020375f2 b @081A93F4 .align 2, 0 .pool @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, =0x00007fff strh r0, [r1, 0x4] strh r0, [r1, 0x6] @081A940A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A93C8 thumb_func_start sub_81A9414 sub_81A9414: ; 81A9414 ldr r1, =0x0203bc88 ldr r0, =gBattleFrontierTrainers str r0, [r1] bx lr .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 adds r1, r0 mov r8, r1 ldr r2, =0x02037350 ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x8] bl sub_81A9AA8 lsls r0, 16 lsrs r5, r0, 16 movs r6, 0 ldr r2, =gUnknown_08613C1C ldr r0, =0x0203bc88 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 .pool @081A9488: adds r6, 0x1 cmp r6, 0x31 bhi @081A94AE ldr r4, =gUnknown_08613C1C lsls r3, r6, 1 adds r2, r3, r4 ldr r0, =0x0203bc88 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, =gUnknown_08613ED8 ldr r2, =0x02037350 ldr r0, =0x03005df0 ldrb r1, [r0] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 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, =@081A94FC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x7fff0000 mov r4, r8 adds r4, 0x4 mov r5, r8 b @081A9560 .align 2, 0 .pool @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, =gUnknown_08613650 lsrs r0, 20 adds r0, r1 ldrb r7, [r0, 0x1] ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e2a adds r0, r1 ldrb r2, [r0] ldr r1, =gUnknown_0832A328 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 .pool @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, =gUnknown_08613EC0 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 .pool thumb_func_end sub_81A9424 thumb_func_start sub_81A9618 sub_81A9618: ; 81A9618 push {r4,r5,lr} ldr r5, =0x03005d90 ldr r1, [r5] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r2, r0, 29 ldr r4, =0x00000e1a adds r1, r4 adds r1, r2 ldrh r3, [r1] ldr r0, =0x000003e6 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, =0x00000e1e 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 .pool thumb_func_end sub_81A9618 thumb_func_start sub_81A966C sub_81A966C: ; 81A966C push {r4,lr} ldr r4, =0x020375f0 bl sub_81A9E40 lsls r0, 24 lsrs r0, 24 strh r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A966C thumb_func_start sub_81A9684 sub_81A9684: ; 81A9684 push {r4,lr} ldr r0, =0x020375e4 ldrh r0, [r0] cmp r0, 0 beq @081A9698 cmp r0, 0x1 beq @081A96B4 b @081A9754 .align 2, 0 .pool @081A9698: ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000e68 adds r0, r2 strb r1, [r0] b @081A9754 .align 2, 0 .pool @081A96B4: ldr r4, =0x020375f0 ldrh r0, [r4] cmp r0, 0x1 beq @081A9710 cmp r0, 0x1 bgt @081A9754 cmp r0, 0 bne @081A9754 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081A9754 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000e68 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0x77 bls @081A96F4 movs r0, 0x78 strb r0, [r1] b @081A96FC .align 2, 0 .pool @081A96F4: ldr r0, =0x020375e6 ldrh r0, [r0] bl audio_play @081A96FC: ldr r1, =0x020375f0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @081A9754 .align 2, 0 .pool @081A9710: ldr r1, =0x020375e2 ldrh r0, [r1] cmp r0, 0 beq @081A9750 subs r0, 0x1 strh r0, [r1] ldr r3, =0x03005d90 ldr r1, [r3] ldr r2, =0x00000e68 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 .pool @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, =0x020244ec mov r8, r1 @081A9776: movs r4, 0 adds r7, r5, 0x1 mov r6, r9 muls r6, r5 @081A977E: ldr r0, =0x03005d90 ldr r0, [r0] lsls r1, r4, 1 ldr r2, =0x00000caa 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 .pool thumb_func_end sub_81A975C thumb_func_start sub_81A97C8 sub_81A97C8: ; 81A97C8 push {lr} ldr r0, =sub_81A97DC movs r1, 0 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081A980C ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb2 adds r0, r1 ldrh r0, [r0] lsls r0, 5 ldr r1, =gUnknown_08D856C8 adds r0, r1 ldr r1, =0x020377d4 movs r2, 0x10 bl CpuSet adds r0, r4, 0 bl remove_task @081A980C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r0, [r0] ldr r2, [sp] lsls r1, r2, 1 ldr r5, =0x00000caa 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, =0x03005d8c ldr r0, [r2] adds r0, r6 movs r1, 0xB movs r2, 0 bl pokemon_getattr adds r4, r0, 0 ldr r3, =0x020244ec 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 .pool @081A98C4: adds r5, 0x1 @081A98C6: cmp r5, 0x3 bgt @081A98EE ldr r1, =0x03005d8c 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, =0x03005d8c ldr r0, [r1] ldr r2, [sp, 0x8] adds r0, r2 movs r5, 0x8E lsls r5, 2 adds r0, r5 ldr r1, =0x020244ec ldr r2, [sp, 0x10] adds r1, r2, r1 movs r2, 0x64 bl memcpy ldr r0, =0x0203cef8 ldr r5, [sp, 0x4] adds r0, r5, r0 mov r1, sp ldrb r1, [r1, 0xC] strb r1, [r0] b @081A994C .align 2, 0 .pool @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, =0x03005d90 ldr r3, =0x00000caa ldr r2, =0x0203cef8 @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 .pool 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, =0x03005dc0 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, =0x000003ff mov r8, r0 ldr r1, =0x0000028e mov r12, r1 ldr r0, =0x02037350 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, =0x03005df0 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 .pool @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, =0x03005d90 ldr r1, [r1] lsrs r0, 23 adds r1, r0 ldr r0, =0x00000cb2 adds r1, r0 ldrh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81A9AA8 thumb_func_start sub_81A9AC4 sub_81A9AC4: ; 81A9AC4 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005d90 ldr r2, [r1] ldr r1, =0x00000e2a adds r2, r1 ldr r4, =gUnknown_0832A328 ldr r3, =0x02037350 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 .pool thumb_func_end sub_81A9AC4 thumb_func_start sub_81A9B04 sub_81A9B04: ; 81A9B04 push {lr} ldr r0, =0x02038bca ldrh r0, [r0] bl sub_81A9B44 ldr r0, =0x02022fec 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, =0x03005df0 strb r0, [r1] ldr r0, =0x02038bcc ldrh r0, [r0] bl sub_81A9B44 @081A9B2E: pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037350 mov r12, r0 ldr r6, =0x03005df0 ldr r1, =0x03005d8c mov r10, r1 ldr r7, =0x03005d90 mov r9, r7 ldr r0, =0x00000cb4 mov r8, r0 ldr r4, =gUnknown_0832A328 @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, =0x00000e2a 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, =0x020375f2 ldrh r1, [r0] subs r1, 0x1 lsls r0, r1, 1 adds r0, r1 lsls r0, 3 adds r2, r0 ldr r1, =0x00000c79 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 .pool thumb_func_end sub_81A9B44 thumb_func_start sub_81A9C04 sub_81A9C04: ; 81A9C04 push {r4-r6,lr} sub sp, 0x14 ldr r0, =0x03005d90 ldr r1, [r0] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r5, r0, 30 lsls r0, r5, 1 ldr r2, =0x00000e1a 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, =gBattlePyramidOpenLevelWildMonPointers b @081A9C56 .align 2, 0 .pool @081A9C54: ldr r1, =gBattlePyramidLevel50WildMonPointers @081A9C56: lsls r0, 2 adds r0, r1 ldr r6, [r0] ldr r4, =0x02024744 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 .pool @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, =0x02024744 ldr r2, =gBaseStats 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, =gExperienceTables 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 .pool @081A9D4C: ldr r2, =gBaseStats 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, =0x02024744 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 .pool @081A9D90: str r0, [sp, 0xC] ldr r0, =0x02024744 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, =0x02024744 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e1a 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, =0x02024744 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, =0x02024744 bl pokemon_calc_effective_stats add sp, 0x14 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81A9C04 thumb_func_start sub_81A9E28 sub_81A9E28: ; 81A9E28 push {lr} bl sub_81AA9E4 lsls r0, 24 ldr r1, =gUnknown_08613650 lsrs r0, 20 adds r0, r1 ldrb r0, [r0, 0x4] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81A9E28 thumb_func_start sub_81A9E40 sub_81A9E40: ; 81A9E40 push {lr} ldr r0, =0x02037318 ldrh r1, [r0, 0x12] ldr r0, =0x00000169 cmp r1, r0 bne @081A9E58 movs r0, 0x1 b @081A9E66 .align 2, 0 .pool @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, =0x02037318 ldrh r1, [r0, 0x12] ldr r0, =0x00000169 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca8 adds r0, r1 movs r1, 0x2 strb r1, [r0] ldr r0, =0x0000400e movs r1, 0 bl var_set bl copy_player_party_from_sav1 @081A9EB8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203bc88 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 .pool thumb_func_end sub_81A9EDC thumb_func_start sub_81A9EFC sub_81A9EFC: ; 81A9EFC push {lr} lsls r0, 16 lsrs r0, 16 ldr r2, =0x0203bc88 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 .pool thumb_func_end sub_81A9EFC thumb_func_start sub_81A9F1C sub_81A9F1C: ; 81A9F1C push {lr} lsls r0, 16 lsrs r0, 16 ldr r2, =0x0203bc88 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 .pool 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, =gTrainerClassNameIndices ldr r1, =0x0203bc88 ldr r2, [r1] movs r1, 0x34 muls r0, r1 adds r0, r2 ldrb r0, [r0] adds r0, r3 ldrb r2, [r0] ldr r1, =gUnknown_08613B44 @081A9F58: ldrb r0, [r1] cmp r0, r2 bne @081A9F70 ldrb r0, [r1, 0x1] b @081A9F7A .align 2, 0 .pool @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, =gUnknown_08252C88 bl script_env_1_execute_new_script pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d90 ldr r4, [r0] ldr r1, =0x00000ca9 adds r0, r4, r1 ldrb r1, [r0] lsls r1, 30 lsrs r1, 29 ldr r2, =0x00000e1a adds r0, r4, r2 adds r0, r1 ldrh r0, [r0] movs r1, 0x7 bl __udivsi3 lsls r0, 16 lsrs r0, 16 ldr r1, =0x00000cb2 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, =0x03005d90 ldr r0, [r1] ldr r4, =0x00000cb4 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 .pool @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, =0x03005d90 ldr r0, [r1] ldr r4, =0x00000cb4 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 .pool 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, =0x00000169 adds r0, r2 lsls r0, 2 ldr r1, =gUnknown_08481DD4 adds r0, r1 ldr r6, [r0] ldr r2, [r6, 0xC] mov r10, r2 ldr r0, [sp, 0x4] ldr r1, =0x03005dc0 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, =0x03005d8c str r2, [sp, 0x18] mov r4, r9 mov r5, r10 @081AA120: ldrh r1, [r5] ldr r0, =0x000003ff ands r0, r1 ldr r2, =0x0000028e 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, =0x0000028d adds r0, r2, 0 orrs r1, r0 strh r1, [r4] ldr r3, [r6] b @081AA196 .align 2, 0 .pool @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, =0x03005d90 ldr r3, =0x00000cb4 ldr r0, =0x0000ffff 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, =0x03005d8c ldr r1, [r0] movs r0, 0xC7 lsls r0, 4 adds r1, r0 ldr r2, =0x05000180 mov r0, r8 bl CpuSet movs r5, 0 @081AA22E: cmp r5, 0 bne @081AA254 ldr r1, =gUnknown_08613650 lsls r0, r7, 4 adds r0, r1 ldrb r0, [r0, 0x3] b @081AA25C .align 2, 0 .pool @081AA254: ldr r1, =gUnknown_08613650 lsls r0, r7, 4 adds r0, r1 ldrb r0, [r0, 0x2] @081AA25C: cmp r0, 0x4 bhi @081AA2E4 lsls r0, 2 ldr r1, =@081AA274 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c ldr r0, [r0] ldr r5, =gUnknown_08252C4F ldr r4, =gUnknown_08252C6A 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 .pool @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, =0x03005d90 ldr r1, [r5] ldr r2, =0x00000e28 adds r0, r1, r2 ldrh r2, [r0] movs r3, 0xF ands r2, r3 strb r2, [r4] ldr r7, =0x00000e22 adds r1, r7 ldrh r0, [r1] ands r0, r3 strb r0, [r6] cmp r2, r0 bne @081AA386 ldr r1, [r5] ldr r2, =0x00000e28 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 .pool 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e26 adds r0, r1 ldrh r4, [r0] movs r0, 0xF ands r4, r0 ldr r0, [sp] cmp r0, 0 bne @081AA3F0 ldr r1, =gUnknown_08613650 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 .pool @081AA3F0: ldr r1, =gUnknown_08613650 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 .pool @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, =gUnknown_0832A328 mov r12, r0 ldr r6, =0x03005d90 ldr r7, =0x00000e28 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 .pool @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, =0x00000e26 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 .pool @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, =gUnknown_08613650 lsls r0, r4, 4 adds r0, r1 ldrb r0, [r0, 0x1] str r0, [sp, 0x10] movs r0, 0 b @081AA530 .align 2, 0 .pool @081AA524: ldr r1, =gUnknown_08613650 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 .pool @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, =gUnknown_08613F46 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 .pool @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, =gUnknown_08613F46 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 .pool @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, =gUnknown_08613650 lsls r0, r5, 4 adds r0, r1 ldrb r0, [r0, 0x1] mov r10, r0 movs r0, 0 b @081AA6A0 .align 2, 0 .pool @081AA694: ldr r1, =gUnknown_08613650 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, =gUnknown_08613F46 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 .pool @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, =gUnknown_08613F46 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 .pool @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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000e22 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 .pool @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, =0x03005d8c 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, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000cb4 adds r0, r1 add r0, r8 strh r4, [r0] @081AA940: movs r0, 0 b @081AA95C .align 2, 0 .pool @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, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000e22 adds r1, r0, r2 ldrh r4, [r1] ldr r1, =0x00000e24 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, =gUnknown_08613655 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, =0x03005d90 ldr r1, [r0] ldr r2, =0x00000e26 adds r0, r1, r2 ldrh r4, [r0] ldr r0, =0x00000e28 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 .pool thumb_func_end sub_81AA96C thumb_func_start sub_81AA9E4 sub_81AA9E4: ; 81AA9E4 push {r4,lr} ldr r0, =0x03005d90 ldr r4, [r0] ldr r1, =0x00000e28 adds r0, r4, r1 ldrh r0, [r0] movs r1, 0x64 bl __umodsi3 lsls r0, 16 lsrs r3, r0, 16 ldr r0, =0x00000cb2 adds r4, r0 ldrh r0, [r4] ldr r1, =gUnknown_08613794 adds r0, r1 ldrb r2, [r0] cmp r2, 0x21 bhi @081AAA38 ldr r1, =gUnknown_08613750 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 .pool @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, =0x03005d8c 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 .pool @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, =0x03005d90 mov r8, r1 lsls r1, r0, 2 adds r1, r0 movs r0, 0 mov r12, r0 lsls r4, r1, 1 ldr r7, =0x00000e2c movs r6, 0 ldr r5, =0x00000e54 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 .pool thumb_func_end sub_81AAA7C thumb_func_start sub_81AAAE0 sub_81AAAE0: ; 81AAAE0 push {r4-r6,lr} ldr r0, =0x03005d90 ldr r1, [r0] ldr r2, =0x00000ca9 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 30 lsrs r6, r0, 30 lsls r0, r6, 1 ldr r2, =0x00000e1a 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, =gUnknown_08613F86 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, =gUnknown_0861379C b @081AAB5A .align 2, 0 .pool @081AAB58: ldr r2, =gUnknown_0861392C @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 .pool thumb_func_end sub_81AAAE0 thumb_func_start sub_81AAB70 sub_81AAB70: ; 81AAB70 push {r4,lr} ldr r4, =0x0203ce58 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 .pool thumb_func_end sub_81AAB70 thumb_func_start c2_bag ; void c2_bag() c2_bag: ; 81AAB9C push {lr} ldr r2, =sub_8086194 movs r0, 0 movs r1, 0x5 bl sub_81AAC90 pop {r0} bx r0 .align 2, 0 .pool 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, =sub_8059D50 movs r0, 0x1 movs r1, 0x5 bl sub_81AAC90 b @081AABD4 .align 2, 0 .pool @081AABCC: ldr r1, =sub_8059D50 movs r0, 0x1 bl sub_81C4F98 @081AABD4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AABB0 thumb_func_start c2_810A554 c2_810A554: ; 81AABDC push {lr} ldr r2, =sub_80861B0 movs r0, 0x4 movs r1, 0x3 bl sub_81AAC90 pop {r0} bx r0 .align 2, 0 .pool 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, =sub_80DFC48 movs r0, 0x3 movs r1, 0x5 bl sub_81AAC90 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AAC00 thumb_func_start sub_81AAC14 sub_81AAC14: ; 81AAC14 push {lr} ldr r2, =sub_816B31C movs r0, 0x6 movs r1, 0x5 bl sub_81AAC90 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AAC14 thumb_func_start sub_81AAC28 sub_81AAC28: ; 81AAC28 push {lr} ldr r2, =sub_81ADE6C movs r0, 0x9 movs r1, 0x5 bl sub_81AAC90 ldr r0, =0x020375e2 movs r1, 0 strh r1, [r0] ldr r0, =0x020375f0 strh r1, [r0] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AAC28 thumb_func_start sub_81AAC50 sub_81AAC50: ; 81AAC50 push {lr} ldr r2, =sub_81ADEBC movs r0, 0x7 movs r1, 0x5 bl sub_81AAC90 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AAC50 thumb_func_start sub_81AAC70 sub_81AAC70: ; 81AAC70 push {lr} ldr r2, =sub_81ADF00 movs r0, 0x8 movs r1, 0x5 bl sub_81AAC90 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce54 ldr r0, =0x00000c48 bl malloc_and_clear str r0, [r6] cmp r0, 0 bne @081AACBC adds r0, r4, 0 bl set_callback2 b @081AAD3A .align 2, 0 .pool @081AACBC: ldr r0, =0x0203ce58 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, =0x0000081b 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, =0x0000081a adds r0, r1 movs r1, 0xFF strb r1, [r0] ldr r0, [r6] ldr r1, =0x0000081e adds r0, r1 movs r1, 0x1 negs r1, r1 strb r1, [r0] ldr r0, [r6] ldr r1, =0x0000081f adds r0, r1 movs r1, 0x1 negs r1, r1 strb r1, [r0] ldr r0, [r6] ldr r1, =0x00000804 adds r0, r1 movs r1, 0xFF movs r2, 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, =c2_bag_2 bl set_callback2 @081AAD3A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =@081AADE0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @081AAE50: bl gpu_pal_allocator_reset b @081AB012 @081AAE56: bl sub_80A1A74 ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @081AAEA4: bl bag_menu_init_bgs ldr r0, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000834 adds r0, r1 movs r1, 0 strh r1, [r0] ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @081AAEEC: bl sub_81ABA6C bl sub_81ABAC4 bl sub_81ABAE0 b @081AB012 @081AAEFA: bl allocate_bag_item_list_buffers ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @081AAF0C: ldr r0, =0x0203ce58 ldrb r0, [r0, 0x5] bl load_bag_item_list_buffers b @081AB012 .align 2, 0 .pool @081AAF1C: ldr r1, =gUnknown_085E91FC ldr r4, =0x0203ce58 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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @081AAF54: ldr r4, =0x0203ce58 ldrb r0, [r4, 0x4] bl sub_81AB1F0 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r0, =0x03006310 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, =0x03005e00 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 .pool @081AAFA0: ldr r0, =0x0203ce58 ldrb r0, [r0, 0x5] bl sub_80D4D00 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @081AAFBC: bl sub_80D4FAC b @081AB012 @081AAFC2: bl sub_81AB7BC bl sub_81AB854 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @081AAFD8: bl sub_81AE2B4 b @081AB012 @081AAFDE: movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 b @081AB01A .align 2, 0 .pool @081AAFF8: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] @081AB012: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 @081AB01A: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @081AB044 .align 2, 0 .pool @081AB02C: ldr r0, =vblank_cb_bag_menu bl SetVBlankCallback ldr r0, =c2_bag_3 bl set_callback2 movs r0, 0x1 b @081AB046 .align 2, 0 .pool @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, =0x0203ce54 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, =gUnknown_08613F90 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 .pool 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, =0x0203ce54 ldr r0, [r4] ldr r1, =0x00000834 adds r0, r1 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x4 bls @081AB0D2 b @081AB1CC @081AB0D2: lsls r0, 2 ldr r1, =@081AB0E8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081AB0E8: .4byte @081AB0FC .4byte @081AB118 .4byte @081AB13C .4byte @081AB174 .4byte @081AB1A8 @081AB0FC: bl reset_temp_tile_data_buffers ldr r1, =gUnknown_08D9A620 movs r0, 0 str r0, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram b @081AB1AE .align 2, 0 .pool @081AB118: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081AB1E4 ldr r0, =gUnknown_08D9A88C ldr r4, =0x0203ce54 ldr r1, [r4] adds r1, 0x4 bl call_LZZUnCompWram ldr r1, [r4] b @081AB1B2 .align 2, 0 .pool @081AB13C: bl sub_81ADC54 lsls r0, 24 cmp r0, 0 bne @081AB164 ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 beq @081AB164 ldr r0, =gUnknown_08D9A5D4 movs r1, 0 movs r2, 0x40 bl decompress_palette b @081AB1AE .align 2, 0 .pool @081AB164: ldr r0, =gUnknown_08D9A588 movs r1, 0 movs r2, 0x40 bl decompress_palette b @081AB1AE .align 2, 0 .pool @081AB174: bl sub_81ADC54 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081AB18A ldr r0, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x8] cmp r0, 0 bne @081AB19C @081AB18A: ldr r0, =gUnknown_0857FB34 bl gpu_tile_obj_decompress_and_load b @081AB1AE .align 2, 0 .pool @081AB19C: ldr r0, =gUnknown_0857FB3C bl gpu_tile_obj_decompress_and_load b @081AB1AE .align 2, 0 .pool @081AB1A8: ldr r0, =gUnknown_0857FB44 bl gpu_pal_obj_decompress_and_apply @081AB1AE: ldr r0, =0x0203ce54 ldr r1, [r0] @081AB1B2: ldr r0, =0x00000834 adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @081AB1E4 .align 2, 0 .pool @081AB1CC: bl sub_8122328 ldr r0, [r4] ldr r1, =0x00000834 adds r0, r1 movs r1, 0 strh r1, [r0] movs r0, 0x1 b @081AB1E6 .align 2, 0 .pool @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, =sub_81ADD98 b @081AB206 .align 2, 0 .pool @081AB204: ldr r0, =sub_81ABD28 @081AB206: movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81AB1F0 thumb_func_start allocate_bag_item_list_buffers allocate_bag_item_list_buffers: ; 81AB218 push {r4,lr} ldr r4, =0x0203ce74 movs r0, 0x82 lsls r0, 2 bl malloc str r0, [r4] ldr r4, =0x0203ce78 movs r0, 0xC3 lsls r0, 3 bl malloc str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end allocate_bag_item_list_buffers thumb_func_start load_bag_item_list_buffers ; void load_bag_item_list_buffers(int pocket_id) 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, =0x02039dd8 adds r1, r0 mov r8, r1 ldr r0, =0x0203ce54 ldr r2, [r0] ldr r1, =0x0000081b adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081AB2FC movs r6, 0 ldr r3, =0x00000829 adds r0, r2, r3 adds r0, r7 ldrb r0, [r0] subs r0, 0x1 cmp r6, r0 bge @081AB2B6 ldr r5, =0x0203ce78 @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, =0x0203ce74 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, =0x0203ce54 ldr r0, [r0] ldr r3, =0x00000829 adds r0, r3 adds r0, r7 ldrb r0, [r0] subs r0, 0x1 cmp r6, r0 blt @081AB276 @081AB2B6: ldr r5, =0x0203ce78 lsls r4, r6, 1 adds r4, r6 lsls r4, 3 ldr r0, [r5] adds r0, r4 ldr r1, =gUnknown_085E8DB4 bl gf_strcpy ldr r0, =0x0203ce74 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 .pool @081AB2FC: movs r6, 0 ldr r4, =0x00000829 adds r0, r2, r4 adds r0, r7 ldrb r0, [r0] cmp r6, r0 bcs @081AB34A ldr r5, =0x0203ce78 @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, =0x0203ce74 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, =0x0203ce54 ldr r0, [r0] ldr r3, =0x00000829 adds r0, r3 adds r0, r7 ldrb r0, [r0] cmp r6, r0 bcc @081AB30C @081AB34A: ldr r2, =0x03006310 adds r1, r2, 0 ldr r0, =gUnknown_08613F9C ldm r0!, {r3-r5} stm r1!, {r3-r5} ldm r0!, {r3-r5} stm r1!, {r3-r5} ldr r0, =0x0203ce54 ldr r1, [r0] ldr r4, =0x00000829 adds r0, r1, r4 adds r0, r7 ldrb r0, [r0] strh r0, [r2, 0xC] ldr r0, =0x0203ce74 ldr r0, [r0] str r0, [r2] ldr r5, =0x0000082e 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 .pool thumb_func_end load_bag_item_list_buffers thumb_func_start get_name ; void get_name(char *dest, int name_id) get_name: ; 81AB39C push {r4-r6,lr} adds r6, r0, 0 lsls r1, 16 lsrs r5, r1, 16 ldr r0, =0x0203ce58 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 .pool @081AB3C0: ldr r4, =0x02021dc4 adds r0, r5, 0 bl sub_81B6CFC lsls r0, 16 lsrs r0, 16 movs r1, 0xD muls r1, r0 ldr r0, =gMoveNames adds r1, r0 adds r0, r4, 0 bl gf_strcpy movs r0, 0xA9 lsls r0, 1 cmp r5, r0 bls @081AB408 ldr r0, =0x02021cc4 ldr r2, =0xfffffeae adds r1, r5, r2 movs r2, 0x2 movs r3, 0x1 bl decimal_int_to_string ldr r1, =gUnknown_085E921A b @081AB438 .align 2, 0 .pool @081AB408: ldr r0, =0x02021cc4 ldr r2, =0xfffffee0 adds r1, r5, r2 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string b @081AB436 .align 2, 0 .pool @081AB420: ldr r0, =0x02021cc4 adds r1, r5, 0 subs r1, 0x84 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r1, =0x02021dc4 adds r0, r5, 0 bl itemid_get_name @081AB436: ldr r1, =gUnknown_085E9210 @081AB438: adds r0, r6, 0 bl ExpandTextCodes @081AB43E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce54 ldr r1, [r4] ldr r2, =0x0000081a 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, =0x0203ce58 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, =0x0000081b adds r1, r2 ldrb r1, [r1] lsls r1, 26 lsrs r1, 30 bl sub_80D4F38 b @081AB4DA .align 2, 0 .pool @081AB4C8: ldr r0, =0x0000ffff ldr r1, [r4] ldr r2, =0x0000081b adds r1, r2 ldrb r1, [r1] lsls r1, 26 lsrs r1, 30 bl sub_80D4F38 @081AB4DA: ldr r5, =0x0203ce54 ldr r2, [r5] ldr r4, =0x0000081b 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 .pool thumb_func_end sub_81AB450 thumb_func_start sub_81AB520 ; void sub_81AB520(u8 rbox_id, int item_index_in_pocket, int a3) 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x0000081a 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 .pool @081AB568: adds r0, r7, 0 movs r1, 0xFF bl sub_81AB75C @081AB570: ldr r5, =0x0203ce58 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, =0xfffffead adds r0, r6, r1 lsls r0, 16 lsrs r0, 16 cmp r0, 0x7 bhi @081AB5BE ldr r1, =gUnknown_08DC6378 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, =0x02021cc4 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool @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, =0x02021cc4 mov r1, r9 movs r2, 0x1 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool @081AB66C: ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00000496 adds r0, r1 ldrh r0, [r0] cmp r0, 0 beq @081AB696 cmp r0, r6 bne @081AB696 ldr r1, =gUnknown_086140A4 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 .pool thumb_func_end sub_81AB520 thumb_func_start bag_menu_print_description_box_text ; void bag_menu_print_description_box_text(int a1) 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, =0x0203ce58 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 .pool @081AB6E0: ldr r0, =0x02021cc4 ldr r2, =gUnknown_085E9180 ldr r1, =0x0203ce58 ldrb r1, [r1, 0x4] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E91C0 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 .pool 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 GetMenuCursorDimensionByFont adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 movs r1, 0x1 bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 str r4, [sp] str r0, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 adds r3, r5, 0 bl Window_FillPixelRect b @081AB7AE @081AB798: ldr r2, =gUnknown_085E8D60 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 .pool thumb_func_end sub_81AB75C thumb_func_start sub_81AB7BC sub_81AB7BC: ; 81AB7BC push {r4-r6,lr} sub sp, 0x10 ldr r5, =0x0203ce54 ldr r4, [r5] ldr r1, =0x0000081e adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0xFF bne @081AB80A ldr r2, =0x0203ce58 ldrb r3, [r2, 0x5] ldr r6, =0x00000829 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, =0x0000081e adds r1, r2 strb r0, [r1] @081AB80A: add sp, 0x10 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AB7BC thumb_func_start sub_81AB824 sub_81AB824: ; 81AB824 push {r4,lr} ldr r4, =0x0203ce54 ldr r0, [r4] ldr r2, =0x0000081e adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @081AB842 bl sub_81AF620 ldr r0, [r4] ldr r1, =0x0000081e adds r0, r1 movs r1, 0xFF strb r1, [r0] @081AB842: bl sub_81AB89C pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AB824 thumb_func_start sub_81AB854 sub_81AB854: ; 81AB854 push {r4,lr} ldr r4, =0x0203ce54 ldr r2, [r4] ldr r1, =0x0000081b adds r0, r2, r1 ldrb r1, [r0] movs r0, 0xF ands r0, r1 cmp r0, 0x1 beq @081AB882 ldr r1, =0x0000081f adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0xFF bne @081AB882 ldr r0, =gUnknown_08614094 ldr r1, =0x0203ce5e bl sub_81AF380 ldr r1, [r4] ldr r2, =0x0000081f adds r1, r2 strb r0, [r1] @081AB882: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AB854 thumb_func_start sub_81AB89C sub_81AB89C: ; 81AB89C push {r4,lr} ldr r4, =0x0203ce54 ldr r0, [r4] ldr r2, =0x0000081f adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @081AB8BA bl sub_81AF620 ldr r0, [r4] ldr r1, =0x0000081f adds r0, r1 movs r1, 0xFF strb r1, [r0] @081AB8BA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AB89C thumb_func_start free_bag_item_list_buffers free_bag_item_list_buffers: ; 81AB8C8 push {lr} ldr r0, =0x0203ce78 ldr r0, [r0] bl free ldr r0, =0x0203ce74 ldr r0, [r0] bl free bl Window_FreeMemory ldr r0, =0x0203ce54 ldr r0, [r0] bl free pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =task_close_bag_menu_2 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r2, r0, r1 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081AB9A0 ldrb r0, [r2] ldr r4, =0x0203ce58 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, =0x0203ce54 ldr r0, [r0] ldr r0, [r0] cmp r0, 0 beq @081AB984 bl set_callback2 b @081AB98A .align 2, 0 .pool @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, =0x02039dd8 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 .pool @081AB9C8: adds r0, r4, 0 bl sub_80D6F64 @081AB9CE: ldr r0, =0x0203ce54 ldr r1, [r0] ldr r6, =0x00000829 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, =0x0000081b adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081ABA2E ldr r0, =0x00000829 adds r1, r2, r0 adds r1, r5 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @081ABA2E: ldr r1, [r3] ldr r2, =0x00000829 adds r0, r1, r2 adds r0, r5 ldrb r2, [r0] cmp r2, 0x8 bls @081ABA58 ldr r3, =0x0000082e adds r0, r1, r3 adds r0, r5 movs r1, 0x8 strb r1, [r0] b @081ABA60 .align 2, 0 .pool @081ABA58: ldr r3, =0x0000082e adds r0, r1, r3 adds r0, r5 strb r2, [r0] @081ABA60: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce6a adds r4, r1, r2 subs r2, 0xA adds r1, r2 ldr r2, =0x0203ce54 ldr r3, [r2] ldr r5, =0x0000082e 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 .pool 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, =0x0203ce6a adds r7, r6, 0 subs r7, 0xA @081ABAEC: lsls r1, r5, 1 adds r0, r1, r6 adds r1, r7 ldr r2, =0x0203ce54 ldr r3, [r2] ldr r4, =0x0000082e 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 .pool thumb_func_end sub_81ABAE0 thumb_func_start sub_81ABB2C sub_81ABB2C: ; 81ABB2C lsls r0, 24 ldr r1, =0x0203ce58 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 .pool 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, =0x03005e08 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 .pool 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, =0x03005e08 adds r5, r0 ldr r7, =0x0203ce58 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, =0x03006310 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 .pool 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, =0x0203ce58 ldrb r0, [r0, 0x5] movs r3, 0x2 cmp r0, 0x3 bne @081ABC6C movs r3, 0x3 @081ABC6C: ldr r0, =0x02021cc4 lsls r1, 16 asrs r1, 16 movs r2, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool 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, =0x0203ce58 ldrb r0, [r0, 0x5] movs r3, 0x2 cmp r0, 0x3 bne @081ABCD4 movs r3, 0x3 @081ABCD4: ldr r0, =0x02021cc4 movs r2, 0x2 bl decimal_int_to_string ldr r6, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool 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, =0x03005e08 adds r6, r0, r1 ldr r5, =0x0203ce58 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, =0x02037fd4 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, =0x030022c0 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 .pool @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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x0203ce58 ldr r3, =0x00000829 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 .pool @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, =0x0203ce7c mov r1, r10 strh r1, [r0] ldr r0, =0x03005e08 subs r0, 0x8 ldr r3, [sp] adds r0, r3, r0 ldr r1, =task_close_bag_menu_1 str r1, [r0] b @081ABEB2 .align 2, 0 .pool @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, =0x0203ce7c strh r0, [r1] ldr r1, =gUnknown_08614054 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81ABD28 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end set_callback3_to_bag thumb_func_start sub_81ABF10 sub_81ABF10: ; 81ABF10 push {lr} ldr r0, =0x0203ce54 ldr r0, [r0] ldr r1, =0x0000081b 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, =0x030022c0 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 .pool @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, =0x03005e08 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, =0x0203ce58 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, =0x02020630 ldr r0, =0x0203ce54 ldr r2, [r0] ldr r1, =0x0000081b adds r0, r2, r1 ldrb r1, [r0] lsls r1, 26 lsrs r1, 30 movs r0, 0x1 eors r0, r1 adds r2, r0 ldr r0, =0x00000806 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, =0x0203ce58 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, =gUnknown_085E91FC 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 .pool @081AC07C: ldr r2, =gUnknown_085E91FC 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, =0x0203ce58 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, =sub_81AC10C ldr r2, =0x03005e00 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 .pool 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, =0x03005e08 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 .pool @081AC148: ldr r0, =0x0203ce5d 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 .pool @081AC164: ldr r0, =0x0203ce5d 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 .pool @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, =0x0203ce5d 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, =0x03006310 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 .pool 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 ; void bag_menu_draw_pocket_indicator_square(char x, int is_current_bag) 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, =0x00001017 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 .pool @081AC298: ldr r1, =0x0000102b 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 .pool thumb_func_end bag_menu_draw_pocket_indicator_square thumb_func_start sub_81AC2C0 sub_81AC2C0: ; 81AC2C0 push {lr} ldr r1, =0x0203ce58 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 .pool @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, =0x03005e08 mov r9, r0 adds r6, r4, r0 ldrb r0, [r6] movs r1, 0x10 movs r2, 0x1 bl sub_81AF15C ldr r3, =0x0203ce58 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, =0x0203ce54 ldr r0, [r0] ldr r2, =0x0000081a 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, =0x02021cc4 bl itemid_get_name ldr r0, =0x02021fc4 mov r8, r0 ldr r1, =gUnknown_085E8DFE 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, =sub_81AC3C0 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 .pool 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, =0x03005e08 adds r4, r0, r1 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081AC48E ldr r0, =0x030022c0 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, =0x0203ce58 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 .pool @081AC418: ldrb r0, [r4] bl sub_81AE604 adds r7, r0, 0 ldrb r0, [r4] ldr r5, =0x0203ce58 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 .pool @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, =0x03005e08 add r0, r10 mov r9, r0 ldr r5, =0x0203ce58 ldrb r6, [r5, 0x5] lsls r1, r6, 1 adds r0, r5, 0 adds r0, 0x12 adds r0, r1 mov r8, r0 ldr r2, =0x0203ce60 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 .pool @081AC4F8: ldr r1, =0x02039dd8 lsls r0, r6, 3 adds r0, r1 ldr r0, [r0] adds r1, r2, 0 adds r2, r4, 0 bl sub_80D702C ldr r0, =0x0203ce54 ldr r0, [r0] ldr r2, =0x0000081a 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, =0x0203ce60 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, =0x03006310 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, =0x03005e08 subs r0, 0x8 add r0, r10 ldr r1, =sub_81ABD28 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 .pool 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, =0x03005e08 mov r10, r0 mov r7, r9 add r7, r10 ldr r4, =0x0203ce58 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x0000081a 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, =0x03006310 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, =sub_81ABD28 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 .pool thumb_func_end sub_81AC590 thumb_func_start sub_81AC644 sub_81AC644: ; 81AC644 push {r4,r5,lr} sub sp, 0x14 ldr r0, =0x0203ce58 ldrb r0, [r0, 0x4] subs r0, 0x1 cmp r0, 0x9 bls @081AC654 b @081AC82C @081AC654: lsls r0, 2 ldr r1, =@081AC668 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203ce7c ldrh r0, [r0] bl itemid_get_usage lsls r0, 24 cmp r0, 0 beq @081AC6C4 ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614042 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x2 b @081ACA10 .align 2, 0 .pool @081AC6C4: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614046 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x1 b @081ACA10 .align 2, 0 .pool @081AC6E8: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614047 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x4 b @081ACA10 .align 2, 0 .pool @081AC70C: ldr r4, =0x0203ce7c 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, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_0861404B str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x2 b @081ACA10 .align 2, 0 .pool @081AC748: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614046 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x1 b @081ACA10 .align 2, 0 .pool @081AC76C: ldr r4, =0x0203ce7c 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, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_0861404D str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x2 b @081ACA10 .align 2, 0 .pool @081AC7A8: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614046 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x1 b @081ACA10 .align 2, 0 .pool @081AC7CC: ldr r4, =0x0203ce7c 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, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_0861404F str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x2 b @081ACA10 .align 2, 0 .pool @081AC808: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614046 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x1 b @081ACA10 .align 2, 0 .pool @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, =0x0203ce58 ldrb r0, [r0, 0x5] cmp r0, 0x4 beq @081AC856 ldr r0, =0x0203ce7c ldrh r0, [r0] bl sub_8122148 lsls r0, 24 cmp r0, 0 bne @081AC880 @081AC856: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614046 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x1 b @081ACA10 .align 2, 0 .pool @081AC880: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614044 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x2 b @081ACA10 .align 2, 0 .pool @081AC8A4: ldr r0, =0x0203ce58 ldrb r0, [r0, 0x5] cmp r0, 0x4 bls @081AC8AE b @081ACA12 @081AC8AE: lsls r0, 2 ldr r1, =@081AC8C0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081AC8C0: .4byte @081AC8D4 .4byte @081AC9B4 .4byte @081AC9D8 .4byte @081AC9FC .4byte @081AC92C @081AC8D4: ldr r4, =0x0203ce54 ldr r1, [r4] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r3, =0x00000824 adds r0, r1, r3 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x4 strb r0, [r1] ldr r0, [r4] adds r0, r3 ldr r1, =gUnknown_0861402C movs r2, 0x4 bl memcpy ldr r0, =0x0203ce7c 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, =0x00000824 adds r0, r1 movs r1, 0x6 strb r1, [r0] b @081ACA12 .align 2, 0 .pool @081AC92C: ldr r4, =0x0203ce54 ldr r1, [r4] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r5, =0x00000824 adds r0, r1, r5 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x4 strb r0, [r1] ldr r0, [r4] adds r0, r5 ldr r1, =gUnknown_08614030 movs r2, 0x4 bl memcpy ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00000496 adds r0, r1 ldr r2, =0x0203ce7c ldrh r0, [r0] ldrh r1, [r2] cmp r0, r1 bne @081AC96C ldr r0, [r4] ldr r1, =0x00000825 adds r0, r1 movs r1, 0x8 strb r1, [r0] @081AC96C: ldrh r1, [r2] ldr r0, =0x00000103 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 .pool @081AC9B4: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614034 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x4 b @081ACA10 .align 2, 0 .pool @081AC9D8: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_08614038 str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x4 b @081ACA10 .align 2, 0 .pool @081AC9FC: ldr r0, =0x0203ce54 ldr r1, [r0] movs r0, 0x82 lsls r0, 4 adds r2, r1, r0 ldr r0, =gUnknown_0861403C str r0, [r2] ldr r0, =0x00000828 adds r1, r0 movs r0, 0x6 @081ACA10: strb r0, [r1] @081ACA12: ldr r0, =0x0203ce58 ldrb r0, [r0, 0x5] cmp r0, 0x2 bne @081ACA50 movs r0, 0x1 bl Window_FillTileMap ldr r0, =0x0203ce7c 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 .pool @081ACA50: ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DBE adds r0, r4, 0 bl 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000828 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @081ACAB0 movs r0, 0 b @081ACAB6 .align 2, 0 .pool @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, =0x0203ce54 ldr r1, [r6] ldr r5, =0x00000828 adds r0, r1, r5 ldrb r0, [r0] str r0, [sp, 0x8] ldr r0, =gUnknown_08613FB4 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 .pool 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, =gUnknown_08613FB4 str r0, [sp, 0xC] ldr r0, =0x0203ce54 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 .pool 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000828 adds r0, r1 ldrb r0, [r0] cmp r0, 0x2 bhi @081ACBE8 ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81ACC04 b @081ACBF4 .align 2, 0 .pool @081ACBE8: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81ACC78 @081ACBF4: str r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08613FB4 ldr r1, [r0, 0x24] adds r0, r5, 0 bl _call_via_r1 b @081ACC6A .align 2, 0 .pool @081ACC44: movs r0, 0x5 bl audio_play ldr r1, =gUnknown_08613FB4 ldr r0, =0x0203ce54 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 .pool 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, =0x030022c0 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 .pool @081ACCD4: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081ACD1C lsls r0, r4, 24 asrs r1, r0, 24 ldr r0, =0x0203ce54 ldr r0, [r0] ldr r2, =0x00000828 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 .pool @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, =gUnknown_08613FB4 ldr r0, =0x0203ce54 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 .pool @081ACDD8: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081ACDF0 movs r0, 0x5 bl audio_play ldr r0, =gUnknown_08613FB4 ldr r1, [r0, 0x24] adds r0, r6, 0 bl _call_via_r1 @081ACDF0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce54 ldr r2, [r0] ldr r3, =0x00000828 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 .pool @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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000828 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @081ACE58 movs r0, 0 bl sub_81AE184 b @081ACE76 .align 2, 0 .pool @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, =0x0203ce7c 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 .pool @081ACEB8: movs r0, 0x1 movs r1, 0 bl Window_FastFillPixels movs r0, 0 bl schedule_bg_copy_tilemap_to_vram ldr r0, =0x0203ce58 ldrb r0, [r0, 0x5] cmp r0, 0x3 beq @081ACEE8 ldr r0, =0x0203ce7c 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 .pool @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, =0x03005e08 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 .pool @081ACF24: ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8EE0 adds r0, r4, 0 bl 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, =sub_81AD044 str r1, [r0] @081ACF6A: add sp, 0x14 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r0 ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, =0x02021dc4 movs r2, 0x10 ldrsh r1, [r4, r2] movs r2, 0 movs r3, 0x3 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8F0E 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, =gUnknown_08614084 adds r0, r5, 0 movs r1, 0x5 bl sub_81AE238 add sp, 0x14 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool 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, =0x03005e08 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000817 adds r0, r1 ldrb r0, [r0] movs r2, 0x10 ldrsh r1, [r4, r2] bl sub_81ABC54 b @081AD0C6 .align 2, 0 .pool @081AD088: ldr r0, =0x030022c0 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 .pool @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, =0x03005e08 adds r6, r4, r5 ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, =0x02021dc4 movs r2, 0x10 ldrsh r1, [r6, r2] movs r2, 0 movs r3, 0x3 bl decimal_int_to_string ldr r6, =0x02021fc4 ldr r1, =gUnknown_085E8EF9 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, =sub_81AD150 str r0, [r4] add sp, 0x14 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r5, r0, r1 ldr r4, =0x0203ce58 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, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @081AD1CE movs r0, 0x5 bl audio_play ldr r0, =0x0203ce7c 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, =0x03006310 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 .pool 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, =0x03005e08 adds r7, r0, r1 ldr r0, =0x0203ce58 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, =0x03005d8c ldr r0, [r0] ldr r2, =0x00000496 adds r1, r0, r2 ldr r0, =0x0203ce7c ldrh r2, [r0] ldrh r0, [r1] cmp r0, r2 bne @081AD238 movs r0, 0 strh r0, [r1] b @081AD23A .align 2, 0 .pool @081AD238: strh r2, [r1] @081AD23A: ldrb r0, [r7] adds r1, r6, 0 adds r2, r5, 0 bl sub_81AE6C8 ldr r0, =0x0203ce58 ldrb r0, [r0, 0x5] bl load_bag_item_list_buffers ldr r0, =0x03006310 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 .pool 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, =0x0203ce7c ldrh r0, [r5] bl itemid_80BF6D8_mail_related lsls r0, 24 cmp r0, 0 bne @081AD2AC ldr r2, =gUnknown_085E8DCE ldr r3, =sub_81AD350 adds r0, r4, 0 movs r1, 0x1 bl sub_81ABB4C b @081AD2EA .align 2, 0 .pool @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, =0x0203ce54 ldr r1, [r0] ldr r0, =sub_81B7F60 str r0, [r1] adds r0, r4, 0 bl task_close_bag_menu_1 b @081AD2EA .align 2, 0 .pool @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, =gUnknown_085E8DE9 ldr r3, =sub_81AD350 movs r1, 0x1 bl sub_81ABB4C pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r5, =0x02021fc4 ldr r1, =gUnknown_085E8E11 adds r0, r5, 0 bl ExpandTextCodes ldr r3, =sub_81AD350 adds r0, r4, 0 movs r1, 0x1 adds r2, r5, 0 bl sub_81ABB4C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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 .pool thumb_func_end sub_81AD350 thumb_func_start sub_81AD378 sub_81AD378: ; 81AD378 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203ce54 ldr r2, [r1] ldr r1, =sub_8177C14 str r1, [r2] bl task_close_bag_menu_1 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool 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, =0x0203ce7c 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 .pool 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, =0x0203ce7c ldrh r0, [r4] bl itemid_80BF6D8_mail_related lsls r0, 24 cmp r0, 0 bne @081AD44C ldr r2, =gUnknown_085E8DCE ldr r3, =sub_81AD350 adds r0, r5, 0 movs r1, 0x1 bl sub_81ABB4C b @081AD4AE .align 2, 0 .pool @081AD44C: ldrh r0, [r4] bl sub_8122148 lsls r0, 24 cmp r0, 0 bne @081AD488 ldrh r0, [r4] ldr r1, =0x02021cc4 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8E27 adds r0, r4, 0 bl ExpandTextCodes ldr r3, =sub_81AD350 adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 bl sub_81ABB4C b @081AD4AE .align 2, 0 .pool @081AD488: ldr r0, =0x0203ce58 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 .pool @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, =0x0203ce7c ldrh r0, [r5] bl itemid_is_mail lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081AD4E4 ldr r2, =gUnknown_085E8DCE ldr r3, =sub_81AD350 adds r0, r4, 0 movs r1, 0x1 bl sub_81ABB4C b @081AD51A .align 2, 0 .pool @081AD4E4: ldr r0, =0x0203ce58 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =task_close_bag_menu_1 str r0, [r1] b @081AD51A .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r4] ldr r5, =0x00000496 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, =0x0203ce7c 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, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r6, [r1, 0xE] b @081AD5D0 .align 2, 0 .pool @081AD5C4: ldr r0, [r4] adds r0, r5 strh r7, [r0] @081AD5CA: ldr r0, =gUnknown_082736B3 bl script_env_1_execute_new_script @081AD5D0: movs r0, 0x1 @081AD5D2: pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81AD520 thumb_func_start display_sell_item_ask_str ; void display_sell_item_ask_str(int a1) 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, =0x03005e08 adds r4, r0, r1 ldr r6, =0x0203ce7c ldrh r0, [r6] bl itemid_get_market_price lsls r0, 16 cmp r0, 0 bne @081AD634 ldrh r0, [r6] ldr r1, =0x02021dc4 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E960F adds r0, r4, 0 bl ExpandTextCodes ldr r3, =sub_81ABBBC adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 bl sub_81ABB4C b @081AD66A .align 2, 0 .pool @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, =0x02021dc4 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E962F adds r0, r4, 0 bl ExpandTextCodes ldr r3, =sub_81AD730 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 .pool 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, =0x03005e08 adds r4, r0 ldr r6, =0x02021cc4 ldr r0, =0x0203ce7c 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, =0x02021fc4 ldr r1, =gUnknown_085E9654 adds r0, r4, 0 bl ExpandTextCodes ldr r3, =sub_81AD6E4 adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 bl sub_81ABB4C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81AD680 thumb_func_start sub_81AD6E4 sub_81AD6E4: ; 81AD6E4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =gUnknown_0861408C movs r1, 0x6 bl sub_81AE238 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool 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, =0x03005e08 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, =0x0203ce7c 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, =sub_81AD794 str r0, [r4] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000818 adds r0, r1 ldrb r4, [r0] movs r2, 0x10 ldrsh r5, [r6, r2] ldr r0, =0x0203ce7c 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 .pool @081AD7F4: ldr r0, =0x030022c0 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 .pool @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, =0x03005e08 adds r4, r0 ldr r6, =0x0203ce7c ldrh r0, [r6] ldr r1, =0x02021dc4 bl itemid_get_name ldr r0, =0x02021cc4 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, =0x02021fc4 ldr r1, =gUnknown_085E9677 adds r0, r4, 0 bl ExpandTextCodes ldr r3, =sub_81AD8C8 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 .pool 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, =0x03005e08 adds r0, r6 mov r10, r0 ldr r7, =0x0203ce58 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, =0x0203ce7c mov r8, r2 ldrh r0, [r2] mov r3, r10 ldrh r1, [r3, 0x10] bl sub_80D6AA4 ldr r0, =0x03005d8c 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, =0x03006310 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000819 adds r0, r1 ldrb r4, [r0] ldr r2, =0x03005d8c 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, =0x03005e08 subs r0, 0x8 adds r6, r0 ldr r0, =sub_81AD9C0 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 .pool 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, =0x030022c0 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 .pool 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, =0x03005e08 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 .pool @081ADA18: ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8E42 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, =sub_81ADA7C str r1, [r0] @081ADA5E: add sp, 0x14 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x0203ce54 ldr r0, [r0] ldr r1, =0x00000817 adds r0, r1 ldrb r0, [r0] movs r2, 0x10 ldrsh r1, [r5, r2] bl sub_81ABC54 b @081ADB0E .align 2, 0 .pool @081ADAC0: ldr r0, =0x030022c0 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 .pool @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, =0x03005e08 mov r9, r0 adds r2, r7, 0 add r2, r9 mov r8, r2 movs r0, 0x1 movs r1, 0 bl Window_FastFillPixels ldr r4, =0x0203ce7c ldrh r0, [r4] bl itemid_is_unique lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 beq @081ADB6C ldr r2, =gUnknown_085E8E8E 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 .pool @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, =0x02021cc4 bl itemid_get_name ldr r0, =0x02021dc4 mov r2, r8 movs r3, 0x10 ldrsh r1, [r2, r3] movs r2, 0 movs r3, 0x3 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8E5A 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, =sub_81AD150 b @081ADBF2 .align 2, 0 .pool @081ADBD4: ldr r2, =gUnknown_085E8E6E 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, =sub_81ADC0C @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 .pool 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, =0x03005e08 adds r5, r0, r1 ldr r0, =0x030022c0 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 .pool thumb_func_end sub_81ADC0C thumb_func_start sub_81ADC54 sub_81ADC54: ; 81ADC54 push {lr} ldr r0, =0x0203ce58 ldrb r0, [r0, 0x4] cmp r0, 0xA beq @081ADC68 movs r0, 0 b @081ADC6A .align 2, 0 .pool @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, =0x0203ce80 movs r0, 0xD0 bl malloc_and_clear str r0, [r4] ldr r5, =0x03005d8c 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, =0x0203ce58 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, =0x03005d8c 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 .pool thumb_func_end sub_81ADC70 thumb_func_start sub_81ADD00 sub_81ADD00: ; 81ADD00 push {r4-r6,lr} ldr r5, =0x03005d8c ldr r0, [r5] movs r1, 0xAC lsls r1, 3 adds r0, r1 ldr r4, =0x0203ce80 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, =0x0203ce58 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 .pool 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, =sub_8059D50 movs r0, 0xA movs r1, 0 bl sub_81AAC90 pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r0, =0x02037fd4 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 .pool @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, =0x0203ce7c movs r0, 0x4 strh r0, [r1] adds r0, r5, 0 bl sub_81AC644 b @081ADE2C .align 2, 0 .pool @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, =0x020375e2 ldr r0, =0x0203ce7c ldrh r0, [r0] strh r0, [r1] ldr r1, =0x020375f0 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 .pool thumb_func_end sub_81ADE38 thumb_func_start sub_81ADE6C sub_81ADE6C: ; 81ADE6C push {lr} ldr r0, =0x03005dac ldr r1, =sub_819FA50 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce7c ldrh r0, [r0] movs r1, 0x1 bl sub_80D6AA4 ldr r1, =0x020375f0 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 .pool thumb_func_end sub_81ADE8C thumb_func_start sub_81ADEBC sub_81ADEBC: ; 81ADEBC push {lr} ldr r0, =0x03005dac ldr r1, =sub_818DEF4 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375f0 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 .pool thumb_func_end sub_81ADEDC thumb_func_start sub_81ADF00 sub_81ADF00: ; 81ADF00 push {lr} ldr r0, =0x03005dac ldr r1, =sub_818E564 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x00ffffff ldr r0, [sp, 0x14] ands r0, r1 movs r1, 0x80 lsls r1, 21 orrs r0, r1 str r0, [sp, 0x14] ldr r1, =0xffffff00 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, =0x0203ce54 ldr r1, [r1] ldr r2, =0x00000844 adds r1, r2 ldr r2, =0x04000100 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 .pool 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, =0x0203ce54 ldr r4, [r0] ldr r0, =0x00000844 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, =0x04000040 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 .pool thumb_func_end sub_81ADFF8 thumb_func_start setup_bag_menu_textboxes setup_bag_menu_textboxes: ; 81AE054 push {r4,lr} ldr r0, =gUnknown_08614174 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, =gUnknown_0860F074 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 .pool 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, =gUnknown_08614164 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 .pool thumb_func_end sub_81AE0BC thumb_func_start sub_81AE124 sub_81AE124: ; 81AE124 lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203ce54 ldr r1, [r1] movs r2, 0x81 lsls r2, 4 adds r1, r2 adds r1, r0 ldrb r0, [r1] bx lr .align 2, 0 .pool 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, =0x0203ce54 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, =gUnknown_086141AC 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 .pool thumb_func_end sub_81AE13C thumb_func_start sub_81AE184 sub_81AE184: ; 81AE184 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203ce54 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 .pool 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, =0x0203ce54 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, =gUnknown_086141AC adds r0, r1 bl Window_AddFromTemplate strb r0, [r4] @081AE1E8: ldrb r0, [r4] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81AE1C4 thumb_func_start sub_81AE1F8 sub_81AE1F8: ; 81AE1F8 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203ce54 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 .pool 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, =gUnknown_086141AC 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 .pool 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, =0x03005d8c 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 .pool 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, =gUnknown_085E8D45 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 .pool @081AE354: adds r0, r4, 0 bl sub_81B6CFC lsls r0, 16 lsrs r7, r0, 16 ldr r1, =gBattleMoves 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, =gUnknown_085E8D45 b @081AE39C .align 2, 0 .pool @081AE38C: ldr r4, =0x02021cc4 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, =gBattleMoves 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, =gUnknown_085E8D45 b @081AE3E8 .align 2, 0 .pool @081AE3D8: ldr r4, =0x02021cc4 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, =0x02021cc4 ldr r1, =gBattleMoves 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 .pool 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, =0x0203ce84 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, =0x03006310 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, =0x0203ce84 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 .pool @081AE4F4: ldrb r0, [r5, 0x6] bl sub_81AE604 str r0, [r5] ldr r1, =0x030022c0 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 .pool @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, =0x0203ce84 ldrb r0, [r0, 0x5] movs r1, 0x1 bl Window_CopyToVram b @081AE570 .align 2, 0 .pool @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, =0x03005e08 adds r3, r1, r0 ldr r2, =0x030022c0 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 .pool @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, =0x03005e08 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 .pool 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, =0x03005e08 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 .pool 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, =0x03005e08 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 .pool 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, =0x03005e08 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 .pool 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, =0x03005e08 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 .pool 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, =0x03005e08 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 .pool 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, =0x03005e08 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 .pool 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, =nullsub_125 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, =0x03005e08 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, =0x03006300 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, =0xfffc0fff 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 .pool 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, =0x03006300 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 .pool @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, =gUnknown_085E8D60 adds r0, r6, 0 mov r2, r8 adds r3, r7, 0 bl sub_81AE9B4 b @081AEC0C .align 2, 0 .pool @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, =0xffff0000 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 .pool @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, =0x0000ffff 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 .pool 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 GetMenuCursorDimensionByFont adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldrb r0, [r7, 0x17] lsls r0, 26 lsrs r0, 26 movs r1, 0x1 bl GetMenuCursorDimensionByFont 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, =0x03006300 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 .pool 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, =0x03005e08 adds r2, r1, r0 cmp r3, 0x10 bhi @081AF154 lsls r0, r3, 2 ldr r1, =@081AF0B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005e08 adds r3, r1, r0 cmp r4, 0x10 bhi @081AF25C lsls r0, r4, 2 ldr r1, =@081AF188 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08329F40 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 .pool @081AF2C0: movs r0, 0x34 ldrsh r3, [r4, r0] ldr r1, =gUnknown_08329F40 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 .pool 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, =gUnknown_08614244 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, =0x02020630 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, =gUnknown_086141FC 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 .pool 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, =gUnknown_086142C8 str r0, [sp, 0x4] ldr r5, =0xffff0000 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, =0x0000ffff 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, =gUnknown_086142A8 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 .pool @081AF3DC: ldr r0, =gUnknown_086142A8 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, =sub_81AF504 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, =0x03005e08 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, =0x0000ffff cmp r1, r0 bne @081AF47C ldr r5, =0x02020630 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 .pool 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, =0x0203ce8c 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 .pool @081AF4C4: ldr r0, =0x0203ce8c 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 .pool 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, =0x03005e08 adds r4, r1, r0 ldr r0, [r4, 0x4] ldrh r5, [r0] ldrh r0, [r4, 0x8] cmp r5, r0 bne @081AF548 ldr r0, =0x0000ffff cmp r5, r0 beq @081AF548 ldr r3, =0x02020630 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 .pool @081AF548: ldr r3, =0x02020630 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 .pool @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, =0x03005e08 adds r4, r1, r0 movs r1, 0x1E ldrsh r0, [r4, r1] cmp r0, 0 beq @081AF5E8 ldr r3, =0x02020630 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 .pool @081AF5E8: ldr r3, =0x02020630 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 .pool 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, =0x03005e08 adds r5, r0, r1 ldrh r0, [r5, 0xE] ldr r4, =0x0000ffff 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, =0x02020630 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 .pool 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, =gUnknown_0861425C ldr r0, [r0] str r0, [r3] movs r1, 0x88 strb r1, [r3] strb r1, [r3, 0x1] ldr r0, =gUnknown_08614260 ldr r0, [r0] str r0, [r3, 0x4] mov r2, r8 adds r2, 0x80 strb r2, [r3, 0x4] strb r1, [r3, 0x5] ldr r0, =gUnknown_08614274 ldr r0, [r0] str r0, [r3, 0x8] strb r1, [r3, 0x8] mov r4, r9 adds r4, 0x80 strb r4, [r3, 0x9] ldr r0, =gUnknown_08614278 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, =gUnknown_08614264 ldr r0, [r0] str r0, [sp] ldr r0, =gUnknown_08614270 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, =gUnknown_08614268 ldr r6, [r0] ldr r0, =gUnknown_0861426C 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 .pool 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, =gUnknown_08614338 str r0, [sp, 0x18] ldr r5, =0xffff0000 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, =0x0000ffff ands r1, r3 orrs r1, r2 str r1, [r0, 0x4] bl gpu_tile_obj_decompress_and_load ldrh r2, [r6, 0x8] ldr r7, =0x0000ffff cmp r2, r7 bne @081AF884 ldr r0, =gUnknown_086142A8 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 .pool @081AF884: ldr r0, =gUnknown_086142A8 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, =nullsub_126 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, =0x03005e08 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, =gUnknown_082EC6AC 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, =0x02020630 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, =0x0000ffff 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 .pool 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, =0x03005e08 adds r3, r0 ldr r5, =0x02020630 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 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r0, [r4, 0x8] bl free ldrh r0, [r4, 0xE] ldr r6, =0x0000ffff 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, =0x02020630 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 .pool thumb_func_end sub_81AF9D8 thumb_func_start sub_81AFA30 sub_81AFA30: ; 81AFA30 push {lr} adds r2, r0, 0 ldr r1, =gUnknown_08329F40 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 .pool 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, =gUnknown_08614378 str r0, [sp, 0x18] ldr r6, =0xffff0000 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, =0x0000ffff 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, =gUnknown_086142A8 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 .pool @081AFAB4: ldr r0, =gUnknown_086142A8 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, =nullsub_127 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, =0x03005e08 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, =gUnknown_08614290 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, =0x02020630 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, =0x0000ffff 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 .pool 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, =0x03005e08 adds r3, r0 ldr r5, =0x02020630 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 .pool 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, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4, 0x2] ldr r6, =0x0000ffff 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, =0x02020630 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 .pool thumb_func_end sub_81AFBA0 thumb_func_start sub_81AFBF0 sub_81AFBF0: ; 81AFBF0 push {lr} ldr r1, =0x0203ce9c 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 .pool 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, =0x0203ce9c lsls r0, 2 adds r0, r1 str r2, [r0] @081AFC20: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce9c @081AFC38: cmp r1, 0xF7 beq @081AFC48 strb r1, [r2] adds r4, 0x1 adds r2, 0x1 b @081AFC60 .align 2, 0 .pool @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, =0x0203ce9c lsrs r0, 22 adds r0, r1 ldr r0, [r0] bx lr .align 2, 0 .pool 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, =0x03005d8c 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, =0x0000ffff 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 .pool @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, =gUnknown_086143BC bl sav1_are_mapnumbers_in_given_list pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sav1_is_in_pokecenter thumb_func_start sub_81AFCDC sub_81AFCDC: ; 81AFCDC push {lr} ldr r0, =gUnknown_0861440A bl sav1_are_mapnumbers_in_given_list pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81AFCDC thumb_func_start sub_81AFCEC sub_81AFCEC: ; 81AFCEC push {lr} ldr r0, =gUnknown_0861440E bl sav1_are_mapnumbers_in_given_list pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005d90 ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xFD ands r0, r1 b @081AFD22 .align 2, 0 .pool @081AFD18: ldr r0, =0x03005d90 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 .pool 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, =0x03005d90 ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xFB ands r0, r1 b @081AFD52 .align 2, 0 .pool @081AFD48: ldr r0, =0x03005d90 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 .pool 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, =0x03005d90 ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0xF7 ands r0, r1 b @081AFD82 .align 2, 0 .pool @081AFD78: ldr r0, =0x03005d90 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 .pool 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, =0x03005d90 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 .pool thumb_func_end sub_81AFDA0 thumb_func_start sub_81AFDD0 sub_81AFDD0: ; 81AFDD0 ldr r0, =0x03005d90 ldr r2, [r0] ldrb r1, [r2, 0x9] movs r0, 0x80 orrs r0, r1 strb r0, [r2, 0x9] bx lr .align 2, 0 .pool thumb_func_end sub_81AFDD0 thumb_func_start sub_81AFDE4 sub_81AFDE4: ; 81AFDE4 push {r4,r5,lr} ldr r5, =0x0203cebc movs r0, 0x90 lsls r0, 1 bl malloc str r0, [r5] cmp r0, 0 beq @081AFE1A ldr r4, =0x0203cec0 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 .pool @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, =0x0203cebc ldr r0, [r0] bl free ldr r0, =0x0203cec0 ldr r0, [r0] bl free pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cebc ldr r1, [r4] bl call_LZZUnCompWram ldr r0, [r4] ldr r4, =0x0203cec0 ldr r1, [r4] bl sub_81AFE44 ldr r0, [r4] str r0, [sp] ldr r4, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r4 movs r1, 0x80 lsls r1, 2 orrs r0, r1 lsls r2, r7, 16 ldr r1, =0x0000ffff 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, =gUnknown_08614FF4 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 .pool @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, =0x0203cebc ldr r1, [r4] bl call_LZZUnCompWram ldr r0, [r4] ldr r4, =0x0203cec0 ldr r1, [r4] bl sub_81AFE44 ldr r0, [r4] str r0, [sp] ldr r4, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r4 movs r1, 0x80 lsls r1, 2 orrs r0, r1 lsls r2, r7, 16 ldr r1, =0x0000ffff 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 .pool @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, =0x0000ffff cmp r3, r0 bne @081B0018 ldr r3, =0x00000179 b @081B0022 .align 2, 0 .pool @081B0018: movs r0, 0xBC lsls r0, 1 cmp r3, r0 bls @081B0022 movs r3, 0 @081B0022: ldr r2, =gItemIconTable lsls r0, r1, 2 lsls r1, r3, 3 adds r0, r1 adds r0, r2 ldr r0, [r0] pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203cec4 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 .pool @081B0088: ldr r3, =0x0203cec8 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 .pool @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, =0x0203cec4 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, =0x0203cec4 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 .pool @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, =0x020244ec 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, =0x03003014 ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] bl calc_player_party_count ldr r0, =c2_811EBD0 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 .pool 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, =0x030022c0 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, =@081B0234 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081B048C .align 2, 0 .pool @081B02AC: bl remove_some_task b @081B0484 @081B02B2: bl sub_80A1A74 ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081B048C .align 2, 0 .pool @081B02D4: bl reset_all_obj_data b @081B0484 @081B02DA: bl gpu_pal_allocator_reset ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081B048C .align 2, 0 .pool @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, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081B048C .align 2, 0 .pool @081B0310: bl sub_81B0550 lsls r0, 24 cmp r0, 0 bne @081B0322 bl sub_81B04BC movs r0, 0x1 b @081B04B2 @081B0322: ldr r0, =0x0203cec4 ldr r0, [r0] movs r1, 0x86 lsls r1, 2 adds r0, r1 movs r1, 0 strh r1, [r0] b @081B0484 .align 2, 0 .pool @081B0338: bl sub_81B05C8 lsls r0, 24 cmp r0, 0 bne @081B0344 b @081B04B0 @081B0344: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081B048C .align 2, 0 .pool @081B0354: ldr r0, =0x0203cec8 ldrb r0, [r0, 0x8] lsls r0, 26 lsrs r0, 30 bl sub_81B239C b @081B0484 .align 2, 0 .pool @081B0368: ldr r0, =0x0203cec8 ldrb r0, [r0, 0x8] lsls r0, 26 lsrs r0, 30 bl sub_81B0740 ldr r0, =0x0203cec4 ldr r0, [r0] movs r1, 0x86 lsls r1, 2 adds r0, r1 movs r1, 0 strh r1, [r0] b @081B0484 .align 2, 0 .pool @081B038C: bl sub_81B5D30 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081B048C .align 2, 0 .pool @081B03A0: bl sub_81B6040 b @081B0484 @081B03A6: bl sub_81B6160 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081B048C .align 2, 0 .pool @081B03B8: bl sub_80D2F04 b @081B0484 @081B03BE: bl sub_81B0EF4 lsls r0, 24 cmp r0, 0 bne @081B03CA b @081B04B0 @081B03CA: ldr r0, =0x0203cec4 ldr r0, [r0] movs r1, 0x86 lsls r1, 2 adds r0, r1 movs r1, 0 strh r1, [r0] b @081B0484 .align 2, 0 .pool @081B03E0: bl sub_81B0DA0 lsls r0, 24 cmp r0, 0 beq @081B04B0 ldr r0, =0x0203cec4 ldr r0, [r0] movs r1, 0x86 lsls r1, 2 adds r0, r1 movs r1, 0 strh r1, [r0] b @081B0484 .align 2, 0 .pool @081B0400: bl sub_81B0F28 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081B048C .align 2, 0 .pool @081B0414: ldr r0, =0x0203cec4 ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 31 lsrs r0, 31 bl sub_81B2428 b @081B0484 .align 2, 0 .pool @081B0428: movs r0, 0x87 lsls r0, 3 adds r1, r2, r0 b @081B048C @081B0430: ldr r4, =0x0203cec4 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 .pool @081B044C: movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 strb r0, [r2, 0x8] ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081B048C .align 2, 0 .pool @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, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @081B048C: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @081B04B0 .align 2, 0 .pool @081B0498: ldr r0, =sub_81B01CC bl SetVBlankCallback ldr r0, =sub_81B01B0 bl set_callback2 movs r0, 0x1 b @081B04B2 .align 2, 0 .pool @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, =sub_81B04F8 movs r1, 0 bl AddTask ldr r0, =sub_81B01CC bl SetVBlankCallback ldr r0, =sub_81B01B0 bl set_callback2 add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081B051C ldr r0, =0x0203cec8 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 .pool thumb_func_end sub_81B04F8 thumb_func_start reset_brm reset_brm: ; 81B052C ldr r0, =0x0203cec4 movs r1, 0 str r1, [r0] ldr r0, =0x0203cee4 str r1, [r0] ldr r0, =0x0203cedc str r1, [r0] ldr r0, =0x0203cee0 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end reset_brm thumb_func_start sub_81B0550 sub_81B0550: ; 81B0550 push {r4,r5,lr} ldr r5, =0x0203cee4 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, =gUnknown_086156B8 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 .pool @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, =0x0203cec4 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, =@081B05F0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081B05F0: .4byte @081B0610 .4byte @081B0638 .4byte @081B0658 .4byte @081B0684 .4byte @081B0688 .4byte @081B068C .4byte @081B0690 .4byte @081B0694 @081B0610: ldr r4, =0x0203cee0 ldr r0, =gUnknown_08D967EC 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 .pool @081B0638: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @081B06B4 ldr r0, =gUnknown_08D96BA0 ldr r1, =0x0203cee4 ldr r1, [r1] bl call_LZZUnCompWram b @081B069A .align 2, 0 .pool @081B0658: ldr r0, =gUnknown_08D96AB4 movs r2, 0xB0 lsls r2, 1 movs r1, 0 bl decompress_palette ldr r0, =0x02037714 ldr r4, =0x0203cec4 ldr r1, [r4] adds r1, 0x18 movs r2, 0xB0 bl CpuSet ldr r1, [r4] b @081B069E .align 2, 0 .pool @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, =0x0203cec4 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 .pool @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, =0x02037774 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, =0x02037b14 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 .pool thumb_func_end sub_81B06C0 thumb_func_start sub_81B06F4 sub_81B06F4: ; 81B06F4 push {lr} ldr r0, =0x0203cec4 ldr r0, [r0] cmp r0, 0 beq @081B0702 bl free @081B0702: ldr r0, =0x0203cee4 ldr r0, [r0] cmp r0, 0 beq @081B070E bl free @081B070E: ldr r0, =0x0203cee0 ldr r0, [r0] cmp r0, 0 beq @081B071A bl free @081B071A: ldr r0, =0x0203cedc ldr r0, [r0] cmp r0, 0 beq @081B0726 bl free @081B0726: bl Window_FreeMemory pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cedc 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, =gUnknown_086156E4 mov r12, r0 str r0, [r2] lsls r0, r5, 3 ldr r1, =gUnknown_08615704 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 .pool @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, =0x0203cec8 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, =0x02022ff8 subs r1, r5, 0x3 lsls r1, 5 adds r1, r0 ldrh r0, [r1] cmp r0, 0 bne @081B0828 ldr r0, =0x0203cedc lsls r4, r5, 4 ldr r0, [r0] adds r0, r4 movs r1, 0x40 bl sub_81B2748 b @081B0836 .align 2, 0 .pool @081B0828: ldr r0, =0x0203cedc lsls r4, r5, 4 ldr r0, [r0] adds r0, r4 movs r1, 0x8 bl sub_81B2748 @081B0836: adds r5, r4, 0 ldr r4, =0x0203cedc 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 .pool @081B085C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr cmp r0, 0 bne @081B089C ldr r4, =0x0203cedc 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 .pool @081B089C: ldr r0, =0x0203cec8 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 .pool @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, =0x0203cec8 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 .pool @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, =0x0203cedc 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 .pool 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, =0x020244ec 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, =0x0203cedc 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 .pool @081B09A0: ldr r5, =0x0203cedc 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 .pool 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, =0x020244ec adds r6, r2, r1 ldr r7, =0x0203cedc 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 .pool 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, =0x020244ec adds r0, r1 ldr r6, =0x0203cef8 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 .pool @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, =0x020244ec adds r0, r1 bl sub_80DAE0C lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bhi @081B0B5A lsls r0, 2 ldr r1, =@081B0B34 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x020244ec 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 .pool @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, =0x020244ec 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 .pool @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, =0x020244ec adds r6, r1, r0 ldr r0, =0x0203ce7c ldrh r4, [r0] ldr r0, =0x0203cec8 ldrb r0, [r0, 0xB] cmp r0, 0xC bne @081B0C40 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x020375e2 ldrb r2, [r0] adds r0, r5, 0 movs r1, 0 bl sub_81B0C94 b @081B0C8A .align 2, 0 .pool @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 GetEvolutionTargetSpecies 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, =0x020244ec 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 .pool @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, =0x0203cedc lsls r2, r0, 4 ldr r1, [r1] adds r6, r1, r2 subs r0, 0x3 lsls r0, 24 ldr r5, =0x02022ff8 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 .pool @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, =0x02021cc4 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 .pool thumb_func_end sub_81B0CEC thumb_func_start sub_81B0DA0 sub_81B0DA0: ; 81B0DA0 push {r4,r5,lr} ldr r5, =0x0203cec4 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 .pool @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, =0x0203cee0 lsrs r0, 11 ldr r1, [r1] adds r1, r0 adds r0, r1, 0 bx lr .align 2, 0 .pool 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, =0x0203cec8 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, =0x02022ff8 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, =0x0203cedc 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 .pool @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, =0x02022ff8 mov r2, r10 lsls r0, r2, 5 adds r0, r1 ldrh r0, [r0] ldr r1, =0x0203cedc ldr r2, [r1] adds r2, r5 adds r1, r3, 0 bl sub_81B6098 b @081B0EDC .align 2, 0 .pool @081B0E98: movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec adds r6, r1, r0 adds r0, r6, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @081B0EDC ldr r4, =0x0203cedc 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 .pool thumb_func_end sub_81B0DE8 thumb_func_start sub_81B0EF4 sub_81B0EF4: ; 81B0EF4 push {r4,r5,lr} ldr r5, =0x0203cec4 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 .pool @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, =0x0203cec8 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 .pool @081B0F54: ldr r4, =0x0203cec4 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, =0xfffff80f 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 .pool @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, =0xfffc07ff ands r1, r2 orrs r1, r0 str r1, [r3, 0x8] ldr r0, =0x0203cec8 ldrb r0, [r0, 0x9] movs r1, 0x1 bl sub_81B0FCC @081B0FBC: add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @081B10E8 ldr r6, =0x0203cedc 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 .pool @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, =0x0203cec4 ldr r0, [r0] ldrh r0, [r0, 0x8] lsls r0, 21 b @081B10DA .align 2, 0 .pool @081B1074: ldr r0, =0x0203cec4 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 .pool @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, =0x0203cec4 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 .pool 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, =0x020244ec 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, =0x0203cec8 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 .pool thumb_func_end sub_81B10F8 thumb_func_start sub_81B118C sub_81B118C: ; 81B118C push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x0203cec8 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 .pool @081B11B4: cmp r2, 0x2 bhi @081B11F6 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 11 ands r0, r1 cmp r0, 0 beq @081B11F6 ldr r0, =0x030022c0 ldr r1, =0x00000439 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, =0x0202449c 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 .pool thumb_func_end sub_81B118C thumb_func_start sub_81B120C sub_81B120C: ; 81B120C push {r4-r6,lr} sub sp, 0xC ldr r1, =gUnknown_086157C4 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, =gUnknown_086157E0 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 .pool thumb_func_end sub_81B120C thumb_func_start sub_81B1250 sub_81B1250: ; 81B1250 push {lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x49 ands r0, r1 cmp r0, 0x49 bne @081B1280 ldr r0, =0x030022c0 ldr r1, =0x00000439 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 .pool @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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =c3_0811FAB4 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081B134C ldr r4, =0x0203cec8 ldrb r1, [r4, 0x8] movs r0, 0xF ands r0, r1 cmp r0, 0x1 bne @081B131A bl sub_81B9080 @081B131A: ldr r0, =0x0203cec4 ldr r0, [r0] ldr r0, [r0, 0x4] cmp r0, 0 beq @081B1338 bl set_callback2 b @081B133E .align 2, 0 .pool @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, =0x0203cec8 ldrb r0, [r0, 0x9] bx lr .align 2, 0 .pool thumb_func_end brm_get_pokemon_selection thumb_func_start sub_81B1360 sub_81B1360: ; 81B1360 ldr r0, =0x0203cec8 ldrb r0, [r0, 0x8] lsls r0, 28 lsrs r0, 28 bx lr .align 2, 0 .pool 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, =0x02037fd4 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 .pool @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, =0x0203cec4 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 .pool thumb_func_end sub_81B1370 thumb_func_start sub_81B13EC sub_81B13EC: ; 81B13EC push {lr} ldr r0, =0x0203cec8 ldrb r1, [r0, 0xB] cmp r1, 0x8 beq @081B13FA cmp r1, 0xA bne @081B1404 @081B13FA: adds r0, 0xA b @081B1406 .align 2, 0 .pool @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, =0x0203cec8 ldr r1, [r0, 0x4] adds r0, r5, 0 bl _call_via_r1 b @081B159E .align 2, 0 .pool @081B142C: ldr r0, =0x0203cec8 ldrb r0, [r0, 0xB] subs r0, 0x3 cmp r0, 0xA bls @081B1438 b @081B1592 @081B1438: lsls r0, 2 ldr r1, =@081B144C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203cec4 ldr r0, [r0] adds r0, 0xD bl sub_81B302C adds r0, r5, 0 bl sub_81615A8 b @081B159E .align 2, 0 .pool @081B149C: adds r0, r4, 0 bl sub_81B15A4 lsls r0, 24 cmp r0, 0 bne @081B14AA b @081B159E @081B14AA: ldr r0, =0x0203cec8 ldrb r1, [r0, 0x8] movs r0, 0xF ands r0, r1 ldr r2, =0x0203cec4 cmp r0, 0x1 bne @081B14BE ldr r1, [r2] ldr r0, =sub_81B9140 str r0, [r1, 0x4] @081B14BE: ldr r0, [r2] adds r0, 0xD bl sub_81B302C ldr r0, =0x03006328 ldr r1, =sub_81B6794 ldr r2, [r0] adds r0, r5, 0 bl _call_via_r2 b @081B159E .align 2, 0 .pool @081B14E8: adds r0, r4, 0 bl sub_81B15A4 lsls r0, 24 cmp r0, 0 beq @081B159E movs r0, 0x5 bl audio_play ldr r0, =0x0203cec4 ldr r0, [r0] adds r0, 0xD bl sub_81B302C adds r0, r5, 0 bl sub_81B7E4C b @081B159E .align 2, 0 .pool @081B1510: adds r0, r4, 0 bl sub_81B15A4 lsls r0, 24 cmp r0, 0 beq @081B159E movs r0, 0x5 bl audio_play ldr r0, =0x0203cec4 ldr r0, [r0] adds r0, 0xD bl sub_81B302C adds r0, r5, 0 bl sub_81B8474 b @081B159E .align 2, 0 .pool @081B1538: adds r0, r4, 0 bl sub_81B15A4 lsls r0, 24 cmp r0, 0 beq @081B159E movs r0, 0x5 bl audio_play ldr r0, =0x0203cec4 ldr r0, [r0] adds r0, 0xD bl sub_81B302C adds r0, r5, 0 bl sub_81B7FAC b @081B159E .align 2, 0 .pool @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, =0x020244ec adds r0, r1 movs r1, 0x2D bl pokemon_getattr cmp r0, 0x1 beq @081B15C4 movs r0, 0x1 b @081B15CC .align 2, 0 .pool @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, =0x0203cec8 ldrb r0, [r0, 0xB] cmp r0, 0x8 beq @081B1602 cmp r0, 0x8 bgt @081B15F0 cmp r0, 0x1 beq @081B15FA b @081B161E .align 2, 0 .pool @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, =0x020375e0 movs r0, 0x7 strh r0, [r1] @081B1642: ldr r0, =0x0203cee8 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 .pool 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, =0x0203cec8 ldrb r0, [r0, 0x8] movs r1, 0xF ands r1, r0 cmp r1, 0x2 bne @081B1680 ldr r5, =gUnknown_085EA110 b @081B168A .align 2, 0 .pool @081B1680: cmp r1, 0x4 bne @081B168A bl sub_81B88BC adds r5, r0, 0 @081B168A: cmp r5, 0 beq @081B16CC ldr r0, =0x0203cec4 ldr r0, [r0] adds r0, 0xD bl sub_81B302C ldr r4, =0x02021fc4 adds r0, r4, 0 adds r1, r5, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B16D4 str r1, [r0] movs r0, 0x1 b @081B16CE .align 2, 0 .pool @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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1708 str r0, [r1] @081B16F8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cee8 strb r1, [r0] ldr r1, =0x0203cec8 movs r0, 0x7 strb r0, [r1, 0x9] bl sub_81B8558 adds r0, r4, 0 bl sub_81B12C0 b @081B1758 .align 2, 0 .pool @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, =0x030022c0 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 .pool @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, =0x030022c0 @081B17B2: ldrh r2, [r3, 0x2E] movs r0, 0x8 ands r0, r2 cmp r0, 0 beq @081B17C4 movs r0, 0x8 b @081B17F0 .align 2, 0 .pool @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, =0x0203cec8 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 .pool @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, =0x020244e9 ldrb r0, [r0] subs r0, 0x1 b @081B1950 .align 2, 0 .pool @081B1898: cmp r1, 0x7 bne @081B18BC ldr r0, =0x0203cec4 ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 31 cmp r0, 0 beq @081B18B0 movs r0, 0x6 b @081B1950 .align 2, 0 .pool @081B18B0: ldr r0, =0x020244e9 ldrb r0, [r0] subs r0, 0x1 b @081B1950 .align 2, 0 .pool @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, =0x020244e9 ldrb r0, [r0] subs r0, 0x1 cmp r1, r0 bne @081B18F4 ldr r0, =0x0203cec4 ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 31 cmp r0, 0 beq @081B18F0 movs r0, 0x6 b @081B1950 .align 2, 0 .pool @081B18F0: movs r0, 0x7 b @081B1950 @081B18F4: adds r0, r2, 0x1 b @081B1950 @081B18F8: ldr r0, =0x020244e9 ldrb r0, [r0] cmp r0, 0x1 beq @081B1952 movs r0, 0 ldrsb r0, [r4, r0] cmp r0, 0 bne @081B1952 ldr r0, =0x0203cec4 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 .pool @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, =0x0203cec4 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 .pool 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, =0x020244e9 ldrb r0, [r0] subs r0, 0x1 b @081B1AF2 .align 2, 0 .pool @081B19A8: cmp r0, 0x7 bne @081B19C4 ldr r0, =0x0203cec4 ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 31 cmp r0, 0 beq @081B19C0 movs r0, 0x6 b @081B1AF2 .align 2, 0 .pool @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, =0x0203cec4 ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 31 cmp r0, 0 beq @081B1A20 movs r0, 0x6 b @081B1AF2 .align 2, 0 .pool @081B1A20: movs r0, 0x7 b @081B1AF2 @081B1A24: movs r0, 0 ldrsb r0, [r4, r0] cmp r0, 0 bne @081B1A5C ldr r0, =0x0203cec4 ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 28 lsrs r6, r0, 29 cmp r6, 0x3 bne @081B1A54 ldr r0, =0x02024618 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @081B1AF4 strb r6, [r4] b @081B1AF4 .align 2, 0 .pool @081B1A54: ldr r0, =0x020245b4 b @081B1A70 .align 2, 0 .pool @081B1A5C: cmp r0, 0x1 bne @081B1AF4 ldr r0, =0x0203cec4 ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 28 lsrs r5, r0, 29 cmp r5, 0x5 bne @081B1A88 ldr r0, =0x020246e0 @081B1A70: movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @081B1AF4 strb r5, [r4] b @081B1AF4 .align 2, 0 .pool @081B1A88: ldr r0, =0x0202467c movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @081B1AF4 movs r0, 0x4 b @081B1AF2 .align 2, 0 .pool @081B1A9C: ldrb r1, [r4] subs r0, r1, 0x2 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @081B1ACC ldr r0, =0x0203cec4 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 .pool @081B1ACC: subs r0, r1, 0x4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bhi @081B1AF4 ldr r0, =0x0203cec4 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 .pool 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, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @081B1B0A adds r0, r4, 0 b @081B1B3C .align 2, 0 .pool @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, =sub_81B1B8C movs r1, 0x1 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 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 .pool thumb_func_end sub_81B1B8C thumb_func_start sub_81B1BD4 sub_81B1BD4: ; 81B1BD4 push {lr} ldr r0, =sub_81B1B8C bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1370 str r0, [r1] @081B1C0E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1BE8 b @081B1C72 .align 2, 0 .pool @081B1C60: movs r0, 0 bl sub_81B3054 ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1370 @081B1C72: str r0, [r1] @081B1C74: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021cc4 bl sub_81B1B44 ldr r1, =0x02021dc4 adds r0, r4, 0 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E991B 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 .pool 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, =0x02021cc4 bl sub_81B1B44 ldr r1, =0x02021dc4 adds r0, r4, 0 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E999D 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 .pool 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, =0x02021cc4 bl sub_81B1B44 ldr r1, =0x02021dc4 adds r0, r4, 0 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E993A 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 .pool 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, =0x02021cc4 bl itemid_get_name ldr r1, =0x02021dc4 adds r0, r4, 0 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E99DB 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 .pool 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, =0x02021fc4 ldr r1, =gUnknown_085E9A69 bl ExpandTextCodes pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x020244ec 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, =0x0203cedc 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, =0x02021dc4 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 .pool 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, =0x020244ec adds r6, r0 mov r0, r8 lsls r4, r0, 2 add r4, r8 lsls r4, 3 ldr r0, =0x03005e08 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, =sub_81B1E60 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 .pool 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, =0x03005e08 adds r3, r0, r1 cmp r5, 0x5 bhi @081B200A lsls r0, r5, 2 ldr r1, =@081B1FD4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =sub_81B1E60 adds r0, r4, 0 bl set_task_function_and_args_14_15 @081B200A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 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, =0x020375e2 ldrh r0, [r0] cmp r0, 0 bne @081B20FC movs r4, 0 ldr r0, =0x020244e9 ldrb r0, [r0] cmp r4, r0 bcs @081B2126 @081B20C4: movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec 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, =0x020244e9 ldrb r0, [r0] cmp r4, r0 bcc @081B20C4 b @081B2126 .align 2, 0 .pool @081B20FC: movs r4, 0 b @081B211E @081B2100: movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec 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, =0x020244e9 ldrb r0, [r0] cmp r4, r0 bcc @081B2100 @081B2126: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 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 .pool 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, =0x020375e0 strh r5, [r0] adds r0, r4, 0 bl sub_81B12C0 b @081B21FE .align 2, 0 .pool @081B21DC: movs r0, 0x20 bl audio_play ldr r0, =gUnknown_085EA0EE movs r1, 0 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C str r1, [r0] @081B21FE: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085EA110 movs r1, 0x1 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B2248 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B227C str r0, [r1] @081B226C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020375e0 movs r0, 0x7 strh r0, [r1] adds r0, r4, 0 bl sub_81B12C0 b @081B22C8 .align 2, 0 .pool @081B22B4: movs r0, 0x5 bl audio_play @081B22BA: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1C1C str r0, [r1] @081B22C8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0861500C lsrs r0, 23 adds r0, r1 ldrh r0, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_08615048 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 .pool @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, =gUnknown_08615810 bl Window_InitFromTemplates b @081B23E2 .align 2, 0 .pool @081B23C4: ldr r0, =gUnknown_08615850 bl Window_InitFromTemplates b @081B23E2 .align 2, 0 .pool @081B23D0: ldr r0, =gUnknown_08615890 bl Window_InitFromTemplates b @081B23E2 .align 2, 0 .pool @081B23DC: ldr r0, =gUnknown_086158D0 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, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 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, =gUnknown_08615918 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, =gUnknown_085E8CE3 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, =gUnknown_086157FC 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, =gUnknown_08615910 bl Window_AddFromTemplate lsls r0, 24 lsrs r5, r0, 24 movs r6, 0 b @081B24C0 .align 2, 0 .pool @081B24B4: ldr r0, =gUnknown_08615908 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, =0x0203cec8 ldrb r1, [r0, 0x8] movs r0, 0xF ands r0, r1 cmp r0, 0xA beq @081B2514 ldr r4, =gUnknown_085E8CF0 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, =gUnknown_086157FC 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 .pool @081B2514: ldr r4, =gUnknown_085E8CF7 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, =gUnknown_086157FC 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 .pool thumb_func_end sub_81B2428 thumb_func_start sub_81B2564 sub_81B2564: ; 81B2564 lsls r0, 24 ldr r1, =0x0203cec4 lsrs r0, 23 adds r0, 0x18 ldr r1, [r1] adds r1, r0 adds r0, r1, 0 bx lr .align 2, 0 .pool 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, =gUnknown_08615988 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 .pool @081B26A0: ldr r1, =gUnknown_086159CE 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 .pool 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, =gUnknown_08615A14 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 .pool @081B2704: ldr r1, =gUnknown_08615A4A 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 .pool 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, =gUnknown_08615A80 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 .pool 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, =gUnknown_08615AF1 ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615AC0 b @081B297E .align 2, 0 .pool @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, =gUnknown_08615ADF b @081B2942 .align 2, 0 .pool @081B2794: ldr r5, =gUnknown_08615ADF ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615ABA 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, =gUnknown_08615AEE b @081B2976 .align 2, 0 .pool @081B27D8: movs r0, 0x10 ands r0, r4 cmp r0, 0 beq @081B2824 ldr r5, =gUnknown_08615ADF ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615ABA 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, =gUnknown_08615AEE b @081B2976 .align 2, 0 .pool @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, =gUnknown_08615ADF b @081B2942 .align 2, 0 .pool @081B283C: ldr r5, =gUnknown_08615ADF ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615ABA 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, =gUnknown_08615AEE b @081B2976 .align 2, 0 .pool @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, =gUnknown_08615ADC b @081B2942 .align 2, 0 .pool @081B2898: ldr r5, =gUnknown_08615AD3 ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615ABA 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, =gUnknown_08615AE8 b @081B2976 .align 2, 0 .pool @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, =gUnknown_08615AD9 b @081B2942 .align 2, 0 .pool @081B28F4: ldr r5, =gUnknown_08615AD0 ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615ABA 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, =gUnknown_08615AE5 b @081B2976 .align 2, 0 .pool @081B2938: movs r0, 0x1 ands r5, r0 cmp r5, 0 beq @081B29BC ldr r5, =gUnknown_08615AD6 @081B2942: ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615ABA 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, =gUnknown_08615AEB @081B2976: ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615ABD @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 .pool @081B29BC: ldr r5, =gUnknown_08615ACD ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615ABA 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, =gUnknown_08615AE2 ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615ABD 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 .pool 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, =gUnknown_086157FC 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 .pool 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, =0x02021dc4 adds r0, r5, 0 adds r1, r2, 0 movs r2, 0 movs r3, 0x3 bl decimal_int_to_string ldr r4, =0x02021cc4 ldr r1, =gUnknown_085E8D4D 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 .pool 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, =gSpeciesNames 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 .pool @081B2C48: ldr r5, =gUnknown_08615AC3 ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615AB6 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, =gUnknown_085E8D49 ldr r3, [r7] adds r3, 0xC movs r2, 0x2 bl sub_81B2A3C b @081B2CBA .align 2, 0 .pool @081B2C88: ldr r5, =gUnknown_08615AC5 ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615AB6 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, =gUnknown_085E8D4B 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 .pool 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, =0x02021cc4 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 .pool 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, =0x02021dc4 adds r0, r5, 0 adds r1, r2, 0 movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r4, =0x02021cc4 ldr r1, =gUnknown_085E8D3E 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 .pool 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, =gUnknown_08615AC7 b @081B2EB2 .align 2, 0 .pool @081B2EB0: ldr r5, =gUnknown_08615AC9 @081B2EB2: ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615AB8 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 .pool @081B2EE0: ldr r5, =gUnknown_08615ACB ldrb r0, [r5] bl sub_81B2564 ldr r4, =gUnknown_08615AB8 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, =gUnknown_08615AB8 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 .pool 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, =gUnknown_086157FC str r1, [sp] movs r1, 0 str r1, [sp, 0x4] ldr r4, =gUnknown_08615B60 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 .pool 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, =0x0203cec4 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, =@081B308C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081B308C: .4byte @081B30A4 .4byte @081B30BC .4byte @081B30BC .4byte @081B30AC .4byte @081B30B4 .4byte @081B30C4 @081B30A4: ldr r0, =gUnknown_08615928 b @081B30C6 .align 2, 0 .pool @081B30AC: ldr r0, =gUnknown_08615930 b @081B30C6 .align 2, 0 .pool @081B30B4: ldr r0, =gUnknown_08615938 b @081B30C6 .align 2, 0 .pool @081B30BC: ldr r0, =gUnknown_08615940 b @081B30C6 .align 2, 0 .pool @081B30C4: ldr r0, =gUnknown_08615948 @081B30C6: bl Window_AddFromTemplate strb r0, [r5] b @081B30DC .align 2, 0 .pool @081B30D4: ldr r0, =gUnknown_08615920 bl Window_AddFromTemplate strb r0, [r4, 0xD] @081B30DC: cmp r6, 0 bne @081B3104 ldr r0, =0x0203cec4 ldr r0, [r0] ldrb r0, [r0, 0x8] lsls r0, 31 cmp r0, 0 beq @081B30F8 movs r6, 0x2 b @081B3104 .align 2, 0 .pool @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, =0x02021fc4 ldr r1, =gUnknown_08615AF4 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 .pool thumb_func_end sub_81B3054 thumb_func_start sub_81B314C sub_81B314C: ; 81B314C push {r4-r7,lr} ldr r7, =0x020244ec movs r6, 0 ldr r0, =0x0203cec8 ldrb r0, [r0, 0xB] cmp r0, 0x1 bne @081B3168 @081B315A: movs r0, 0x1 b @081B31AA .align 2, 0 .pool @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, =0x0203cec4 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, =0x000002e9 str r0, [sp, 0xC] add r0, sp, 0x14 movs r1, 0x2 movs r2, 0x13 bl rbox_template_set b @081B3226 .align 2, 0 .pool @081B320C: ldr r0, =gUnknown_08615950 b @081B321E .align 2, 0 .pool @081B3214: ldr r0, =gUnknown_08615958 b @081B321E .align 2, 0 .pool @081B321C: ldr r0, =gUnknown_08615960 @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, =0x0203cec4 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 .pool @081B3250: movs r0, 0x1 movs r1, 0 bl GetMenuCursorDimensionByFont 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, =gUnknown_086157FC adds r1, r2 str r1, [sp, 0x8] str r6, [sp, 0xC] ldr r2, =gUnknown_08615C08 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, =0x0203cec4 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 .pool 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, =0x03003014 ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] bl sav2_get_text_speed adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 movs r0, 0 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs 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 .pool thumb_func_end sub_81B3300 thumb_func_start sub_81B334C sub_81B334C: ; 81B334C push {lr} ldr r0, =gUnknown_08615968 movs r1, 0x4F movs r2, 0xD movs r3, 0 bl sub_81996C0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B334C thumb_func_start sub_81B3364 sub_81B3364: ; 81B3364 push {r4,lr} ldr r0, =gUnknown_08615970 bl Window_AddFromTemplate ldr r4, =0x0203cec4 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 .pool thumb_func_end sub_81B3364 thumb_func_start sub_81B3394 sub_81B3394: ; 81B3394 push {r4,lr} ldr r4, =0x0203cec4 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 .pool 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, =0x0203cec4 ldr r1, [r4] ldr r0, =gUnknown_08615D70 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, =gUnknown_08615D38 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 .pool 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, =0x0203cec4 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, =gUnknown_08615D7E 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, =gUnknown_08615D7E @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, =0x0203cec4 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 .pool @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, =0x0203cec4 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, =0x0203cec4 ldr r1, [r0] adds r0, r1, 0 adds r0, 0xF adds r1, 0x17 movs r2, 0x6 bl append_byte b @081B3518 .align 2, 0 .pool @081B3508: ldr r0, =0x0203cec4 ldr r1, [r0] adds r0, r1, 0 adds r0, 0xF adds r1, 0x17 movs r2, 0x3 bl append_byte @081B3518: ldr r0, =0x0203cec4 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 .pool thumb_func_end sub_81B3414 thumb_func_start sub_81B353C sub_81B353C: ; 81B353C push {r4,lr} adds r4, r0, 0 ldr r1, =0x0203cec8 ldrb r0, [r1, 0x8] lsls r0, 28 lsrs r0, 28 adds r2, r1, 0 cmp r0, 0xC bhi @081B35FE lsls r0, 2 ldr r1, =@081B3560 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r4, r1] movs r0, 0x64 muls r0, r1 ldr r7, =0x020244ec adds r5, r0, r7 ldr r1, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 ldr r0, =0x0203cec4 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 .pool @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, =0x02021fc4 ldr r1, =gUnknown_085E9980 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, =0x03005e00 mov r2, r8 lsls r0, r2, 2 add r0, r8 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B469C str r1, [r0] movs r0, 0 b @081B36EC .align 2, 0 .pool @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, =0x02021dc4 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0xFF strh r1, [r0, 0x8] ldr r1, =sub_81B3730 str r1, [r0] @081B3720: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x03005e08 adds r5, r0, r1 ldr r0, =0x0203cec4 ldr r0, [r0] ldrb r0, [r0, 0x17] cmp r0, 0x3 bhi @081B3774 bl ProcessMenuInputNoWrapAround_other b @081B3778 .align 2, 0 .pool @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, =0x0203cec4 ldr r0, [r4] adds r0, 0xE bl sub_81B302C ldr r2, =gUnknown_08615C08 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 .pool @081B37CC: ldr r4, =0x0203cec4 ldr r0, [r4] adds r0, 0xE bl sub_81B302C ldr r1, =gUnknown_08615C08 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 .pool 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, =0x0203cec4 ldr r1, [r0] ldr r0, =sub_81B3828 str r0, [r1, 0x4] adds r0, r4, 0 bl sub_81B12C0 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B37FC thumb_func_start sub_81B3828 sub_81B3828: ; 81B3828 push {r4,lr} sub sp, 0x4 ldr r4, =0x0203cec8 ldrb r1, [r4, 0x8] movs r0, 0xF ands r0, r1 cmp r0, 0x1 bne @081B3868 bl pokemon_change_order ldr r1, =0x020244ec ldrb r2, [r4, 0x9] ldr r0, =0x020244e9 ldrb r3, [r0] subs r3, 0x1 lsls r3, 24 lsrs r3, 24 ldr r0, =sub_81B3894 str r0, [sp] movs r0, 0x1 bl sub_81BF8EC b @081B3880 .align 2, 0 .pool @081B3868: ldr r1, =0x020244ec ldrb r2, [r4, 0x9] ldr r0, =0x020244e9 ldrb r3, [r0] subs r3, 0x1 lsls r3, 24 lsrs r3, 24 ldr r0, =sub_81B3894 str r0, [sp] movs r0, 0 bl sub_81BF8EC @081B3880: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B3828 thumb_func_start sub_81B3894 sub_81B3894: ; 81B3894 push {lr} sub sp, 0xC ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] ldr r3, =0x0203cec8 ldr r0, =0x0203cf20 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, =sub_81B36FC 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 .pool 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, =0x0203cec8 movs r0, 0x8 strb r0, [r5, 0xB] ldr r4, =0x0203cec4 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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1370 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r6, r0, r1 ldr r3, =0x0203cec8 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 .pool @081B3968: add r2, sp, 0x8 movs r0, 0x9 ldrsb r0, [r3, r0] ldr r1, =0x0203cedc 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 .pool @081B39C4: movs r0, 0x1 @081B39C6: strh r0, [r6, 0x14] add r2, sp, 0x8 ldr r0, =0x0203cec8 ldrb r0, [r0, 0xA] lsls r0, 24 asrs r0, 24 ldr r1, =0x0203cedc 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 .pool @081B3A2C: movs r0, 0x1 @081B3A2E: strh r0, [r6, 0x16] ldr r4, =0x0203cef0 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, =0x0203cef4 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, =0x0203cec8 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B3D48 str r1, [r0] @081B3ABA: add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool 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, =0x03005e08 adds r4, r1, r0 movs r1, 0x14 ldrsh r0, [r4, r1] cmp r0, 0 beq @081B3C8E ldr r2, =0x0203cedc ldr r0, =0x0203cec8 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, =0x0203cedc ldr r0, =0x0203cec8 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 .pool 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, =0x03005e08 adds r5, r1, r0 movs r1, 0x14 ldrsh r0, [r5, r1] cmp r0, 0 beq @081B3D00 ldr r0, =0x0203cef0 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, =0x0203cef4 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 .pool 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, =0x03005e08 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, =0x0203cec8 ldrb r0, [r4, 0x9] bl sub_81B0948 ldrb r0, [r4, 0xA] bl sub_81B0948 movs r0, 0x9 ldrsb r0, [r4, r0] ldr r5, =0x0203cedc 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, =0x0203cef0 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, =0x0203cef4 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, =sub_81B3E60 str r1, [r0] @081B3E3A: add sp, 0xC pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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, =0x0203cec8 movs r0, 0x9 ldrsb r0, [r5, r0] ldr r4, =0x0203cedc 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, =0x0203cef0 ldr r0, [r0] bl free ldr r0, =0x0203cef4 ldr r0, [r0] bl free adds r0, r6, 0 bl sub_81B407C b @081B3F08 .align 2, 0 .pool @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, =0x02020630 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 .pool 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, =0x0203cedc ldr r2, =0x0203cec8 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, =0x020244ec 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 .pool 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, =0x0203cec4 ldr r0, [r0] adds r0, 0xD bl sub_81B302C ldr r4, =0x0203cec8 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1370 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 ldr r0, [r4] adds r0, 0xC bl sub_81B302C ldr r0, [r4] adds r0, 0xD bl sub_81B302C ldr r0, =0x0203cec8 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 .pool @081B4110: movs r0, 0 bl sub_81B3054 @081B4116: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1370 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 ldr r0, [r4] adds r0, 0xC bl sub_81B302C ldr r0, [r4] adds r0, 0xD bl sub_81B302C ldr r0, =0x020244ec ldr r1, =0x0203cec8 ldrb r1, [r1, 0x9] movs r2, 0x8 bl sub_81B33B4 movs r0, 0x1 bl sub_81B31B0 movs r0, 0x18 bl sub_81B3054 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0xFF strh r1, [r0, 0x8] ldr r1, =sub_81B3730 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 ldr r1, [r0] ldr r0, =sub_81B41C4 str r0, [r1, 0x4] adds r0, r4, 0 bl sub_81B12C0 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =c2_8123744 movs r0, 0x2 movs r1, 0x5 bl sub_81AAC90 b @081B41E8 .align 2, 0 .pool @081B41E0: ldr r1, =c2_8123744 movs r0, 0x2 bl sub_81C4F98 @081B41E8: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce7c ldrh r0, [r6] cmp r0, 0 bne @081B4224 ldr r3, =0x0203cec8 ldrb r0, [r3, 0x8] lsls r0, 28 lsrs r0, 28 ldrb r2, [r3, 0xB] movs r1, 0x7F str r1, [sp] ldr r1, =sub_81B36FC str r1, [sp, 0x4] ldr r1, [r3] b @081B425A .align 2, 0 .pool @081B4224: ldr r4, =0x0203cefc ldr r5, =0x0203cec8 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, =0x020244ec 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, =sub_81B4350 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 .pool @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, =sub_81B42D0 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081B432C ldr r0, =0x0203ce7c ldrh r4, [r0] ldr r0, =0x0203cec8 mov r8, r0 ldrb r0, [r0, 0x9] lsls r0, 24 asrs r0, 24 movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B469C str r1, [r0] @081B432C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081B4388 ldr r0, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x0203cefc ldrh r1, [r1] movs r2, 0x1 bl sub_81B1D1C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B43A8 str r1, [r0] @081B4388: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B43DC str r0, [r1] @081B43CC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203ce7c ldrh r0, [r5] movs r1, 0x1 bl sub_80D6AA4 ldr r6, =0x0203cefc 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, =0x02021fc4 movs r1, 0 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C str r1, [r0] b @081B44EC .align 2, 0 .pool @081B4458: ldrh r0, [r5] bl itemid_is_mail lsls r0, 24 cmp r0, 0 beq @081B4498 ldr r0, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldrh r1, [r5] bl sub_81B1DB8 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B44FC str r1, [r0] b @081B44EC .align 2, 0 .pool @081B4498: ldr r0, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldrh r1, [r5] bl sub_81B1DB8 ldrh r0, [r5] ldrh r1, [r6] movs r2, 0x1 bl sub_81B1D68 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B469C str r1, [r0] b @081B44EC .align 2, 0 .pool @081B44D8: movs r0, 0x5 bl audio_play @081B44DE: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1C1C str r0, [r1] @081B44EC: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 ldr r1, [r0] ldr r0, =sub_81B452C str r0, [r1, 0x4] adds r0, r4, 0 bl sub_81B12C0 @081B451C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B44FC thumb_func_start sub_81B452C sub_81B452C: ; 81B452C push {lr} ldr r0, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x40 bl pokemon_getattr lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005d8c lsls r2, r0, 3 adds r2, r0 lsls r2, 2 ldr r0, =0x00002be0 adds r2, r0 ldr r1, [r1] adds r1, r2 ldr r2, =sub_81B4578 movs r0, 0x4 movs r3, 0x3 bl sub_811A20C pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec 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, =0x020375f0 ldrh r7, [r0] cmp r7, 0 bne @081B45F8 adds r0, r5, 0 bl sub_80D4680 ldr r4, =0x0203cefc 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, =sub_81B36FC 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 .pool @081B45F8: ldrb r0, [r6, 0x8] lsls r0, 28 lsrs r0, 28 ldrb r2, [r6, 0xB] movs r1, 0x7F str r1, [sp] ldr r1, =sub_81B4624 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081B468A ldr r1, =0x0203cefc ldrh r0, [r1] cmp r0, 0 bne @081B4670 ldr r0, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x0203ce7c ldrh r1, [r1] movs r2, 0 movs r3, 0 bl sub_81B1C84 b @081B467C .align 2, 0 .pool @081B4670: ldr r0, =0x0203ce7c ldrh r0, [r0] ldrh r1, [r1] movs r2, 0 bl sub_81B1D68 @081B467C: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B469C str r0, [r1] @081B468A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r4, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r6, r1, r0 bl sub_81B1BD4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081B471C ldr r5, =0x0203cedc 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 .pool @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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec 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, =0x0203cec4 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 .pool @081B4788: ldr r1, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9980 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 b @081B47B4 .align 2, 0 .pool @081B47AC: adds r0, r6, 0 bl pokemon_item_not_removed ldr r0, =0x02021fc4 @081B47B4: movs r1, 0x1 bl sub_81B1B5C @081B47BA: movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r0, =0x03005e00 lsls r1, r7, 2 adds r1, r7 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B469C str r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec 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, =0x0203cec4 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, =0x02021cc4 adds r0, r7, 0 bl sub_81B1B44 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9980 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B469C b @081B488A .align 2, 0 .pool @081B4864: ldr r1, =0x02021cc4 adds r0, r5, 0 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9E00 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B48A8 @081B488A: str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B48DC str r0, [r1] @081B48CC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec 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 .pool @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, =0x02021cc4 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9E14 adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B4988 str r1, [r0] b @081B4978 .align 2, 0 .pool @081B4964: movs r0, 0x5 bl audio_play @081B496A: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1C1C str r0, [r1] @081B4978: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec 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, =0x0203cedc 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C str r1, [r0] @081B49EC: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 ldr r0, [r4] adds r0, 0xC bl sub_81B302C ldr r0, [r4] adds r0, 0xD bl sub_81B302C ldr r0, =0x020244ec ldr r1, =0x0203cec8 ldrb r1, [r1, 0x9] movs r2, 0x9 bl sub_81B33B4 movs r0, 0x2 bl sub_81B31B0 movs r0, 0x19 bl sub_81B3054 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0xFF strh r1, [r0, 0x8] ldr r1, =sub_81B3730 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 ldr r1, [r0] ldr r0, =sub_81B4A98 str r0, [r1, 0x4] adds r0, r4, 0 bl sub_81B12C0 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B4A6C thumb_func_start sub_81B4A98 sub_81B4A98: ; 81B4A98 push {lr} ldr r0, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x40 bl pokemon_getattr ldr r2, =0x03005d8c lsls r1, r0, 3 adds r1, r0 lsls r1, 2 ldr r0, =0x00002be0 adds r1, r0 ldr r0, [r2] adds r0, r1 ldr r1, =sub_81B4AE0 movs r2, 0x1 bl sub_8121478 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B4A98 thumb_func_start sub_81B4AE0 sub_81B4AE0: ; 81B4AE0 push {lr} sub sp, 0xC ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 strb r0, [r2, 0x8] ldr r3, =0x0203cec8 ldrb r0, [r3, 0x8] lsls r0, 28 lsrs r0, 28 ldrb r2, [r3, 0xB] movs r1, 0x15 str r1, [sp] ldr r1, =sub_81B36FC 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 .pool 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, =0x0203cec4 ldr r0, [r5] adds r0, 0xD bl sub_81B302C ldr r0, [r5] adds r0, 0xC bl sub_81B302C ldr r0, =gUnknown_085E9855 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B4B6C str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B4BA0 str r0, [r1] @081B4B90: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 bl sub_80D4700 lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @081B4C0C ldr r0, =gUnknown_085E9877 movs r1, 0 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B469C b @081B4C4A .align 2, 0 .pool @081B4C0C: ldr r0, =gUnknown_085E9897 movs r1, 0 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C b @081B4C4A .align 2, 0 .pool @081B4C30: movs r0, 0x5 bl audio_play @081B4C36: ldr r0, =gUnknown_085E98B4 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B4C60 @081B4C4A: str r1, [r0] @081B4C4C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B4C94 str r0, [r1] @081B4C84: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 mov r8, r0 ldrb r0, [r0, 0x9] lsls r0, 24 asrs r0, 24 movs r7, 0x64 muls r0, r7 ldr r6, =0x020244ec 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, =gUnknown_085E99B8 movs r1, 0 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B469C str r1, [r0] b @081B4D64 .align 2, 0 .pool @081B4D24: adds r0, r4, 0 bl pokemon_item_not_removed ldr r0, =0x02021fc4 movs r1, 0 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C str r1, [r0] b @081B4D64 .align 2, 0 .pool @081B4D50: movs r0, 0x5 bl audio_play @081B4D56: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1C1C str r0, [r1] @081B4D64: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r5, r1] movs r0, 0x64 muls r0, r1 ldr r6, =0x020244ec adds r7, r0, r6 movs r0, 0x5 bl audio_play ldr r4, =0x0203cec4 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 .pool @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, =0x02021dc4 bl itemid_get_name movs r0, 0x1A bl sub_81B3054 @081B4E02: ldr r1, =0x03005e00 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, =sub_81B3730 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 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 .pool @081B4E5C: ldr r0, [r5] adds r0, 0xD bl sub_81B302C ldr r0, =0x02021fc4 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C str r1, [r0] @081B4E7A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 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, =0x0203cec8 ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 mov r8, r0 @081B4EC6: ldr r0, =0x0203cef8 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, =0x0203cedc 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, =sub_81B1370 mov r1, r8 str r0, [r1] b @081B4F68 .align 2, 0 .pool @081B4F2C: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, r6 bcc @081B4EC6 @081B4F36: ldr r0, =0x02021cc4 adds r1, r6, 0 movs r2, 0 movs r3, 0x1 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9830 adds r0, r4, 0 bl ExpandTextCodes movs r0, 0x20 bl audio_play adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C str r1, [r0] @081B4F68: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B4E8C thumb_func_start sub_81B4F88 sub_81B4F88: ; 81B4F88 push {r4,lr} ldr r4, =0x0203cec8 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 .pool 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, =0x0203cec4 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, =0x0203cef8 subs r2, r5, 0x1 adds r7, r6, 0 ldr r3, =0x0203cec8 @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 .pool @081B5020: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, r5 bcc @081B4FE2 @081B502A: ldr r6, =0x0203cedc ldr r0, =0x0203cec8 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, =0x0203cef8 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, =0x03005e00 mov r2, r8 adds r1, r7, r2 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1370 str r0, [r1] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 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, =0x020244ec 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 .pool @081B515C: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EA210 bl ExpandTextCodes b @081B5178 .align 2, 0 .pool @081B5170: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EA234 bl ExpandTextCodes @081B5178: movs r0, 0x20 bl audio_play ldr r4, =0x0203cec4 ldr r0, [r4] adds r0, 0xC bl sub_81B302C ldr r0, [r4] adds r0, 0xD bl sub_81B302C ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA1CA adds r0, r4, 0 bl gf_strcat adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C str r1, [r0] @081B51B0: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 mov r8, r0 ldrb r0, [r0, 0x9] lsls r0, 24 asrs r0, 24 movs r6, 0x64 muls r0, r6 ldr r4, =0x020244ec 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, =0x02022c38 ldr r1, [r1] ldr r2, =0x02022c3c ldrh r3, [r2] ldr r2, =0x02022c3e 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, =0x02021fc4 ldr r1, =gUnknown_08615E0C 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, =0x0203cec4 ldr r0, [r4] adds r0, 0xC bl sub_81B302C ldr r0, [r4] adds r0, 0xD bl sub_81B302C ldr r1, =gUnknown_085EA1CA adds r0, r5, 0 bl gf_strcat adds r0, r5, 0 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C str r1, [r0] b @081B52D4 .align 2, 0 .pool @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, =0x0203cec4 ldr r0, [r4] adds r0, 0xC bl sub_81B302C ldr r0, [r4] adds r0, 0xD bl sub_81B302C ldr r0, =0x020244ec ldr r1, =0x0203cec8 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 .pool @081B5328: cmp r0, 0x3 beq @081B5354 b @081B5368 @081B532E: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EA1E8 bl ExpandTextCodes b @081B53C0 .align 2, 0 .pool @081B5340: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EA210 bl ExpandTextCodes b @081B53C0 .align 2, 0 .pool @081B5354: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EA234 bl ExpandTextCodes b @081B53C0 .align 2, 0 .pool @081B5368: movs r0, 0x5 bl audio_play ldr r0, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl sub_81B1B44 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA1CD adds r0, r4, 0 bl ExpandTextCodes adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B53FC b @081B53E4 .align 2, 0 .pool @081B53C0: movs r0, 0x20 bl audio_play ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA1CA adds r0, r4, 0 bl gf_strcat adds r0, r4, 0 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C @081B53E4: str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B5430 str r0, [r1] @081B5420: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 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, =gUnknown_08615D9C 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 .pool @081B54E4: ldrb r0, [r7, 0x4] b @081B5652 @081B54E8: cmp r4, 0x7 bhi @081B5524 ldr r1, =0x00000867 adds r0, r4, r1 bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081B5524 ldr r0, =gUnknown_085E97FC movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B1C1C str r1, [r0] b @081B5664 .align 2, 0 .pool @081B5524: ldr r1, =gUnknown_08615D9C 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, =@081B5554 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03005d8c 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, =0x02021cc4 ldrb r1, [r1, 0x14] bl sub_81245DC ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EA196 b @081B55E8 .align 2, 0 .pool @081B55B8: ldr r0, =0x03005d8c 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, =0x02021cc4 ldrb r1, [r1, 0x14] bl sub_81245DC ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EA16B @081B55E8: bl ExpandTextCodes adds r0, r6, 0 bl sub_81B5674 ldr r0, =0x0203cec4 ldr r0, [r0] movs r1, 0x86 lsls r1, 2 adds r0, r1 strh r4, [r0] b @081B5664 .align 2, 0 .pool @081B5614: ldr r1, =0x0203cec8 ldr r0, =sub_8124690 b @081B5628 .align 2, 0 .pool @081B5624: ldr r1, =0x0203cec8 ldr r0, =c2_exit_to_overworld_2_switch @081B5628: str r0, [r1] adds r0, r6, 0 bl sub_81B12C0 b @081B5664 .align 2, 0 .pool @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, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =task_brm_cancel_1_on_keypad_a_or_b str r0, [r1] @081B5664: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02021fc4 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B56A4 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B56D8 str r0, [r1] @081B56C8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 ldr r0, =c2_exit_to_overworld_2_switch str r0, [r1] adds r0, r4, 0 bl sub_81B12C0 b @081B572A .align 2, 0 .pool @081B5714: movs r0, 0x5 bl audio_play @081B571A: ldr r0, =0x03005db0 movs r1, 0 str r1, [r0] ldr r0, =0x0203ceec str r1, [r0] adds r0, r4, 0 bl sub_81B1C1C @081B572A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =task_launch_hm_phase_2 movs r1, 0x8 bl AddTask movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038c08 lsls r0, 16 lsrs r0, 16 str r0, [r1] ldr r0, =0x0203ceec ldr r0, [r0] bl _call_via_r0 adds r0, r4, 0 bl remove_task @081B577C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_launch_hm_phase_2 thumb_func_start brm_get_selected_species brm_get_selected_species: ; 81B578C push {lr} ldr r0, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 pop {r1} bx r1 .align 2, 0 .pool 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, =0x030022c0 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 .pool thumb_func_end task_brm_cancel_1_on_keypad_a_or_b thumb_func_start sub_81B57DC sub_81B57DC: ; 81B57DC push {lr} ldr r0, =0x00000888 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 .pool @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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] movs r0, 0x9 bl oe_exec pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =hm_surf_run_dp02scr str r0, [r1] movs r0, 0x1 b @081B585E .align 2, 0 .pool @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, =0x02037318 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 .pool @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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =sub_8086194 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 .pool thumb_func_end sub_81B58A8 thumb_func_start hm2_waterfall hm2_waterfall: ; 81B58D4 push {lr} bl brm_get_pokemon_selection ldr r1, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] movs r0, 0x2B bl oe_exec pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =hm2_waterfall str r0, [r1] movs r0, 0x1 b @081B594E .align 2, 0 .pool @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, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1] movs r0, 0x2C bl oe_exec pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B5958 thumb_func_start sub_81B5974 sub_81B5974: ; 81B5974 push {lr} bl sub_809D1E8 ldr r1, =0x02038c08 lsls r0, 24 lsrs r0, 24 str r0, [r1, 0x4] cmp r0, 0 bne @081B5990 movs r0, 0 b @081B599E .align 2, 0 .pool @081B5990: ldr r1, =0x03005db0 ldr r0, =hm_add_c3_launch_phase_2 str r0, [r1] ldr r1, =0x0203ceec ldr r0, =sub_81B5958 str r0, [r1] movs r0, 0x1 @081B599E: pop {r1} bx r1 .align 2, 0 .pool 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, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081B59EA ldr r0, =gUnknown_08616020 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 .pool 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, =sub_80D3014 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, =0x02020630 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 .pool 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, =0x02020630 adds r0, r1 movs r1, 0 bl sub_80D32C8 b @081B5B2C .align 2, 0 .pool @081B5AD4: lsls r0, r4, 4 adds r0, r4 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x1 bl sub_80D32C8 b @081B5B2C .align 2, 0 .pool @081B5AEC: lsls r0, r4, 4 adds r0, r4 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x2 bl sub_80D32C8 b @081B5B2C .align 2, 0 .pool @081B5B04: lsls r0, r4, 4 adds r0, r4 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x3 bl sub_80D32C8 b @081B5B2C .align 2, 0 .pool @081B5B1C: lsls r0, r4, 4 adds r0, r4 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0x4 bl sub_80D32C8 @081B5B2C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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, =0x0000fffc strh r0, [r2, 0x26] b @081B5BAA .align 2, 0 .pool @081B5BA4: ldr r0, =0x0000fffc 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, =sub_81B5C08 b @081B5BD0 .align 2, 0 .pool @081B5BC4: strh r3, [r2, 0x24] strh r3, [r2, 0x26] adds r0, r5, 0 adds r0, 0x1C adds r0, r6, r0 ldr r1, =sub_81B5BDC @081B5BD0: str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000fffd strh r0, [r4, 0x26] b @081B5C02 .align 2, 0 .pool @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, =gUnknown_08615EC0 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 .pool 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, =gUnknown_08615EC0 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, =0x02020630 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 .pool 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, =0x02020630 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 .pool @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, =0x02020630 adds r0, r1 movs r1, 0x1 bl obj_anim_image_start b @081B5D0E .align 2, 0 .pool @081B5CFC: ldrb r1, [r4, 0xA] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 bl obj_anim_image_start @081B5D0E: ldr r2, =0x02020630 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 .pool thumb_func_end sub_81B5CB0 thumb_func_start sub_81B5D30 sub_81B5D30: ; 81B5D30 push {lr} ldr r0, =gUnknown_08615EB0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r0, =gUnknown_08615EB8 bl gpu_pal_obj_alloc_tag_and_apply pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec 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 .pool @081B5DA8: movs r5, 0 b @081B5DDE @081B5DAC: movs r0, 0x64 muls r0, r5 ldr r1, =0x02024744 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 .pool 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, =0x02020630 mov r8, r0 lsls r0, r6, 4 adds r0, r6 lsls r0, 2 add r0, r8 adds r0, 0x43 ldrb r3, [r0] ldr r0, =gUnknown_08615EC0 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, =sub_81B5E74 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 .pool 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, =0x02020630 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 .pool @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, =gUnknown_08615F08 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 .pool 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, =gUnknown_08615F08 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, =0x02020630 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 .pool 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, =gUnknown_08615F08 adds r1, r3, 0 movs r3, 0x8 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r2, =0x02020630 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 .pool 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, =gUnknown_08615F78 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 .pool 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, =0x02020630 adds r0, r2 bl obj_anim_image_start pop {r0} bx r0 .align 2, 0 .pool 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, =0x02020630 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 .pool @081B6000: lsls r5, r0, 4 adds r5, r0 lsls r5, 2 ldr r0, =0x02020630 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, =0x0000fffc 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 .pool thumb_func_end sub_81B5FBC thumb_func_start sub_81B6040 sub_81B6040: ; 81B6040 push {lr} ldr r0, =gUnknown_08615EF8 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08615F70 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08615F00 bl gpu_pal_obj_decompress_and_apply pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08616008 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 .pool 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, =gUnknown_08616008 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, =0x02020630 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 .pool 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, =0x02020630 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 .pool @081B6128: ldrb r1, [r5, 0xC] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 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 .pool thumb_func_end sub_81B60FC thumb_func_start sub_81B6160 sub_81B6160: ; 81B6160 push {lr} ldr r0, =gUnknown_08615FF8 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08616000 bl gpu_pal_obj_decompress_and_apply pop {r0} bx r0 .align 2, 0 .pool 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, =c2_815ABFC mov r8, r0 ldr r0, =0x030022c0 ldr r1, =0x00000439 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 .pool @081B61B0: ldr r0, =0x0203cec8 strb r5, [r0, 0x9] b @081B6204 .align 2, 0 .pool @081B61BC: movs r7, 0 movs r6, 0 @081B61C0: ldr r4, =0x0203ce7c ldrh r0, [r4] bl sub_81B7CEC lsls r0, 24 lsrs r0, 24 cmp r0, 0xA bne @081B621C ldr r1, =0x0203cec8 movs r0, 0 strb r0, [r1, 0x9] movs r5, 0 @081B61D8: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @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, =sub_81B6280 movs r1, 0x7F b @081B6230 .align 2, 0 .pool @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, =sub_81B1370 @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 .pool 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, =0x0203cf30 ldr r1, [r0] movs r0, 0x4 bl sub_81C4F98 @081B6276: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end c2_815ABFC thumb_func_start sub_81B6280 sub_81B6280: ; 81B6280 push {lr} lsls r0, 24 lsrs r3, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081B62B2 ldr r0, =0x0203cec8 ldrb r1, [r0, 0x8] movs r0, 0xF ands r0, r1 cmp r0, 0x1 bne @081B62A6 ldr r0, =0x0203cec4 ldr r1, [r0] ldr r0, =sub_81B9140 str r0, [r1, 0x4] @081B62A6: ldr r0, =0x03006328 ldr r1, =sub_81B6794 ldr r2, [r0] adds r0, r3, 0 bl _call_via_r2 @081B62B2: pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003214 adds r0, r1 b @081B62F6 .align 2, 0 .pool @081B62EC: ldr r1, =gItemEffectInfoPointers 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 .pool @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, =@081B6334 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x02021fc4 ldr r1, =gUnknown_085E9C3E bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B6394: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9C7C bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B63A8: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9C8A bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B63BC: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9CA2 bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B63D0: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9C5F bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B63E4: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9DBE bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B63F8: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9DE1 bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B640C: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9CE0 bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B6420: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085E96E3 b @081B6474 .align 2, 0 .pool @081B6430: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085EA33C b @081B6474 .align 2, 0 .pool @081B6440: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085EA343 b @081B6474 .align 2, 0 .pool @081B6450: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085EA35B b @081B6474 .align 2, 0 .pool @081B6460: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085E96E6 b @081B6474 .align 2, 0 .pool @081B6470: ldr r0, =0x02021dc4 ldr r1, =gUnknown_085E96EE @081B6474: bl gf_strcpy ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9D25 bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B6494: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9CF5 bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B64A8: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9CB7 bl ExpandTextCodes b @081B64C4 .align 2, 0 .pool @081B64BC: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E96F6 bl ExpandTextCodes @081B64C4: pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000012f cmp r0, r1 bne @081B64FC movs r0, 0 b @081B64FE .align 2, 0 .pool @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, =0x030022c0 ldr r1, =0x00000439 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, =0x020244ec adds r0, r1 adds r1, r5, 0 adds r2, r3, 0 b @081B6572 .align 2, 0 .pool @081B6558: movs r0, 0x64 adds r4, r3, 0 muls r4, r0 ldr r0, =0x020244ec 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 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 ldr r0, =0x0203ce7c 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, =0x0203cec8 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, =0x0203cee8 movs r0, 0 strb r0, [r1] movs r0, 0x5 bl audio_play ldr r0, =gUnknown_085E96F6 b @081B66F4 .align 2, 0 .pool @081B6624: ldr r1, =0x0203cee8 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 .pool @081B6650: movs r0, 0x75 bl audio_play @081B6656: ldr r4, =0x0203cedc ldr r7, =0x0203cec8 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, =0x02020630 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, =sub_81B672C 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 .pool @081B66E4: ldr r1, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 adds r0, r6, 0 bl sub_81B6310 ldr r0, =0x02021fc4 @081B66F4: movs r1, 0x1 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 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 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl sub_81B1B44 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9C17 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6794 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cee8 ldrb r1, [r0] cmp r1, 0 bne @081B67B4 ldr r0, =0x0203cec4 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 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r4, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 ldr r0, =0x0203ce7c 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, =0x0203cee8 movs r0, 0 strb r0, [r1] movs r0, 0x5 bl audio_play ldr r0, =gUnknown_085E96F6 b @081B68E2 .align 2, 0 .pool @081B6874: ldr r1, =0x0203cee8 movs r0, 0x1 strb r0, [r1] movs r0, 0x1 bl audio_play adds r0, r6, 0 movs r1, 0x1 bl sub_80D6AA4 ldr r1, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 ldr r1, =0x02021dc4 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, =0x02021fc4 ldr r1, =gUnknown_085E9D45 bl ExpandTextCodes b @081B68E0 .align 2, 0 .pool @081B68C4: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9D90 bl ExpandTextCodes b @081B68E0 .align 2, 0 .pool @081B68D8: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9D6D bl ExpandTextCodes @081B68E0: ldr r0, =0x02021fc4 @081B68E2: movs r1, 0x1 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 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 .pool 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, =@081B693C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0000012f cmp r0, r1 beq @081B6992 adds r0, r4, 0 movs r1, 0x1A b @081B6988 .align 2, 0 .pool @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, =@081B69B8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081B69B8: .4byte @081B69D8 .4byte @081B69D0 .4byte @081B69F0 .4byte @081B6A00 .4byte @081B69E8 .4byte @081B69E0 @081B69D0: ldr r1, =gUnknown_085E96E3 b @081B69F2 .align 2, 0 .pool @081B69D8: ldr r1, =gUnknown_085EA33C b @081B69F2 .align 2, 0 .pool @081B69E0: ldr r1, =gUnknown_085EA343 b @081B69F2 .align 2, 0 .pool @081B69E8: ldr r1, =gUnknown_085EA35B b @081B69F2 .align 2, 0 .pool @081B69F0: ldr r1, =gUnknown_085E96E6 @081B69F2: adds r0, r2, 0 bl gf_strcpy b @081B6A08 .align 2, 0 .pool @081B6A00: ldr r1, =gUnknown_085E96EE adds r0, r2, 0 bl gf_strcpy @081B6A08: pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec 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, =gMoveNames 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 .pool 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, =0x0203cec4 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 .pool 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, =0x0203ce7c ldrh r0, [r0] cmp r0, 0xAF bne @081B6B20 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003214 adds r0, r1 b @081B6B2A .align 2, 0 .pool @081B6B20: ldr r1, =gItemEffectInfoPointers 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, =0x0203cec8 strh r1, [r0, 0xE] adds r0, r4, 0 bl sub_81B6BEC b @081B6B6E .align 2, 0 .pool @081B6B4C: movs r0, 0x5 bl audio_play movs r0, 0x16 bl sub_81B3054 ldr r0, =0x0203cec8 ldrb r0, [r0, 0x9] bl sub_81B6A10 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6AB4 str r1, [r0] @081B6B6E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 ldr r0, [r0] adds r0, 0xC bl sub_81B302C bl GetMenuCursorPos ldr r1, =0x0203cec8 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 .pool thumb_func_end sub_81B6B80 thumb_func_start sub_81B6BB4 sub_81B6BB4: ; 81B6BB4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 ldr r0, =sub_81B1370 str r0, [r1] ldr r0, =0x0203cec4 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 .pool 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, =0x0203ced6 ldr r0, =0x0203ce7c 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, =0x0203cee8 strb r4, [r0] movs r0, 0x5 bl audio_play ldr r0, =gUnknown_085E96F6 b @081B6C7E .align 2, 0 .pool @081B6C34: ldr r1, =0x0203cee8 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, =0x020244ec 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, =0x02021cc4 movs r1, 0xD muls r1, r4 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy adds r0, r5, 0 bl sub_81B6310 ldr r0, =0x02021fc4 @081B6C7E: movs r1, 0x1 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6794 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 ldrb r0, [r0, 0x9] bl sub_81B6A10 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6AB4 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp05_pp_up thumb_func_start sub_81B6CFC sub_81B6CFC: ; 81B6CFC lsls r0, 16 ldr r1, =0xfedf0000 adds r0, r1 ldr r1, =gUnknown_08616040 lsrs r0, 15 adds r0, r1 ldrh r0, [r0] bx lr .align 2, 0 .pool 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, =gUnknown_08616040 @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 .pool @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, =0x02021fc4 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 .pool 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6794 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r7, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 movs r0, 0xE adds r0, r7 mov r8, r0 ldr r0, =0x0203ce7c ldrh r4, [r0] ldr r1, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 adds r0, r4, 0 bl sub_81B6CFC strh r0, [r7, 0xE] ldr r0, =0x02021dc4 movs r1, 0xE ldrsh r2, [r7, r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames 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, =0xffff0000 cmp r0, r1 beq @081B6E88 ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B6EB4 str r0, [r1] b @081B6E9C .align 2, 0 .pool @081B6E70: ldr r1, =gUnknown_085E9AB4 b @081B6E7A .align 2, 0 .pool @081B6E78: ldr r1, =gUnknown_085E9C00 @081B6E7A: adds r0, r6, 0 bl sub_81B6D98 b @081B6E9C .align 2, 0 .pool @081B6E88: ldr r0, =gUnknown_085E9AE9 bl sub_81B6D74 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6FF4 str r1, [r0] @081B6E9C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r2, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 adds r6, r2, 0 adds r6, 0xE ldr r0, =0x0203ce7c 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, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 ldr r0, =0x02021dc4 movs r1, 0 ldrsh r2, [r6, r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9AA5 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6F60 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0000016f bl fanfare_play ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6F98 str r1, [r0] @081B6F86: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x0203cec8 movs r1, 0x10 ldrsh r0, [r0, r1] cmp r0, 0x1 bne @081B6FDC adds r0, r4, 0 bl sub_81B77AC b @081B6FEA .align 2, 0 .pool @081B6FDC: cmp r0, 0x2 bne @081B6FE4 ldr r0, =0x020375f0 strh r2, [r0] @081B6FE4: adds r0, r5, 0 bl sub_81B12C0 @081B6FEA: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B7028 str r0, [r1] @081B7018: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E9B96 movs r1, 0x1 bl sub_81B1B5C ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B7088 str r1, [r0] b @081B7080 .align 2, 0 .pool @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, =0x0203cec4 ldr r1, [r0] ldr r0, =sub_81B70B8 str r0, [r1, 0x4] adds r0, r4, 0 bl sub_81B12C0 @081B70A8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B7088 thumb_func_start sub_81B70B8 sub_81B70B8: ; 81B70B8 push {r4,lr} sub sp, 0x4 ldr r0, =0x020244ec ldr r4, =0x0203cec8 ldrb r1, [r4, 0x9] ldr r2, =0x020244e9 ldrb r2, [r2] subs r2, 0x1 lsls r2, 24 lsrs r2, 24 ldr r3, =sub_81B70F0 ldrh r4, [r4, 0xE] str r4, [sp] bl sub_81BFA38 add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81B711C str r0, [sp, 0x4] ldr r0, =0x0203cec8 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 .pool 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, =0x02037fd4 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 .pool @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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 adds r5, r1, 0 muls r5, r0 ldr r0, =0x020244ec 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, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 ldr r0, =0x02021dc4 movs r1, 0xD muls r1, r4 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r0, =gUnknown_085E9BB8 bl sub_81B6D74 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B71D4 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r5, r1] movs r0, 0x64 adds r4, r1, 0 muls r4, r0 ldr r0, =0x020244ec 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 .pool 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, =0x02021dc4 ldr r1, =0x0203cec8 movs r3, 0xE ldrsh r2, [r1, r3] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9B5D 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B7294 str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B72C8 str r0, [r1] @081B72B8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r7, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec 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 .pool @081B7300: cmp r5, 0x1 beq @081B7392 b @081B73C2 @081B7306: ldr r1, =0x02021cc4 adds r0, r4, 0 bl sub_81B1B44 ldr r0, =0x02021dc4 movs r1, 0xE ldrsh r2, [r7, r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9B76 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, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B73E4 str r0, [r1] b @081B73C2 .align 2, 0 .pool @081B7368: cmp r0, 0x2 bne @081B7370 ldr r0, =0x020375f0 strh r5, [r0] @081B7370: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B6794 str r0, [r1] b @081B73C2 .align 2, 0 .pool @081B738C: movs r0, 0x5 bl audio_play @081B7392: ldr r1, =0x02021cc4 adds r0, r4, 0 bl sub_81B1B44 ldr r0, =0x02021dc4 ldr r1, =0x0203cec8 movs r3, 0xE ldrsh r2, [r1, r3] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r0, =gUnknown_085E9AE9 bl sub_81B6D74 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6FF4 str r1, [r0] @081B73C2: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 mov r9, r0 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 ldr r0, =0x0203cec4 ldr r6, [r0] movs r1, 0x86 lsls r1, 2 adds r4, r6, r1 ldr r2, =0x0203ce7c 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 .pool @081B7478: movs r4, 0x1 @081B747A: movs r0, 0x5 bl audio_play cmp r4, 0 beq @081B74B4 ldr r1, =0x0203cee8 movs r0, 0 strb r0, [r1] ldr r0, =gUnknown_085E96F6 movs r1, 0x1 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 mov r1, r10 b @081B7516 .align 2, 0 .pool @081B74B4: ldr r1, =0x0203cee8 movs r0, 0x1 strb r0, [r1] movs r0, 0 bl pause_music_for_sound_maybe ldr r0, =0x0203cec8 ldrb r0, [r0, 0x9] adds r1, r5, 0 bl sub_81B754C ldr r0, =0x0203ce7c ldrh r0, [r0] movs r1, 0x1 bl sub_80D6AA4 ldr r1, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 ldr r4, =0x02021dc4 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, =0x02021fc4 ldr r1, =gUnknown_085E9D0A 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B75D4 @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 .pool 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, =0x0203cedc lsls r4, r7, 4 ldr r1, [r6] adds r1, r4 adds r0, r5, 0 bl sub_81B60E4 ldr r2, =0x02020630 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 .pool 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, =0x030022c0 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B7634 str r0, [r1] @081B7620: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B7704 str r0, [r1] @081B7668: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B7634 thumb_func_start sub_81B767C sub_81B767C: ; 81B767C push {r4,r5,lr} sub sp, 0x8 ldr r0, =0x0203cec4 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 .pool thumb_func_end sub_81B767C thumb_func_start sub_81B76C8 sub_81B76C8: ; 81B76C8 push {r4,lr} sub sp, 0x4 ldr r0, =0x0203cec4 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 .pool 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, =0x030022c0 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r4, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1 bl sub_8069318 lsls r0, 16 lsrs r1, r0, 16 strh r6, [r4, 0x10] ldr r0, =0x0000fffe cmp r1, r0 beq @081B7788 cmp r1, r0 bgt @081B776C cmp r1, 0 beq @081B7778 b @081B77A0 .align 2, 0 .pool @081B776C: ldr r0, =0x0000ffff cmp r1, r0 beq @081B7780 b @081B77A0 .align 2, 0 .pool @081B7778: adds r0, r5, 0 bl sub_81B7810 b @081B77A6 @081B7780: adds r0, r5, 0 bl sub_81B787C b @081B77A6 @081B7788: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B77AC str r0, [r1] b @081B77A6 .align 2, 0 .pool @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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0 bl sub_8069318 lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x0000fffe cmp r1, r0 beq @081B780A cmp r1, r0 bgt @081B77E8 cmp r1, 0 beq @081B77F4 b @081B7804 .align 2, 0 .pool @081B77E8: ldr r0, =0x0000ffff cmp r1, r0 beq @081B77FC b @081B7804 .align 2, 0 .pool @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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r7, r1, r0 adds r0, r7, 0 movs r1, 0 movs r2, 0 bl GetEvolutionTargetSpecies lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 beq @081B7860 bl sub_81B06F4 ldr r0, =0x030061e8 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 .pool @081B7860: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B6794 str r0, [r1] @081B786E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 mov r8, r0 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl sub_81B1B44 ldr r0, =0x02021dc4 ldr r6, =0x020244e2 ldrh r2, [r6] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9AE9 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6FF4 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 mov r8, r0 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl sub_81B1B44 ldr r0, =0x02021dc4 movs r1, 0xD muls r1, r5 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9AA5 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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6F60 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec4 ldr r2, [r1] movs r3, 0x86 lsls r3, 2 adds r1, r2, r3 movs r3, 0 strh r3, [r1] ldr r4, =0x0000021a adds r1, r2, r4 strh r3, [r1] ldr r1, =0x0203cec8 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 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec 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, =0x0203ce7c ldrh r1, [r1] movs r2, 0 bl sub_81B6520 lsls r0, 24 cmp r0, 0 beq @081B7A94 @081B7A6E: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =task_intro_gamefreak str r0, [r1] b @081B7B2A .align 2, 0 .pool @081B7A94: movs r0, 0x1 bl audio_play ldr r4, =0x0203cedc 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, =0x02020630 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, =0x0203cec4 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, =sub_81B7C10 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, =0x0000021a 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 .pool 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, =0x0203cec4 ldr r2, [r5] movs r0, 0x86 lsls r0, 2 adds r1, r2, r0 movs r3, 0 ldrsh r0, [r1, r3] ldr r3, =0x0203cec8 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, =0x0000021a adds r0, r1 movs r2, 0 ldrsh r1, [r0, r2] cmp r1, 0 bne @081B7BC8 ldr r0, =0x0203cee8 strb r1, [r0] ldr r0, =gUnknown_085E96F6 movs r1, 0x1 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram b @081B7BD8 .align 2, 0 .pool @081B7BC8: ldr r1, =0x0203cee8 movs r0, 0x1 strb r0, [r1] ldr r0, =0x0203ce7c ldrh r0, [r0] movs r1, 0x1 bl sub_80D6AA4 @081B7BD8: ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6794 str r1, [r0] ldr r1, =0x0203cec8 movs r0, 0 strb r0, [r1, 0x9] b @081B7C0A .align 2, 0 .pool @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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl sub_81B1B44 ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E9C17 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =task_intro_gamefreak str r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030061e8 ldr r1, =0x0203cec8 ldr r0, [r1] str r0, [r2] ldrb r0, [r1, 0x9] ldr r4, =0x0203ce7c ldrh r1, [r4] movs r2, 0 bl sub_81B6520 lsls r0, 24 cmp r0, 0 beq @081B7CD8 ldr r1, =0x0203cee8 movs r0, 0 strb r0, [r1] ldr r0, =gUnknown_085E96F6 movs r1, 0x1 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 str r6, [r0] b @081B7CE4 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003214 adds r4, r0, r1 b @081B7D20 .align 2, 0 .pool @081B7D18: ldr r1, =gItemEffectInfoPointers 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 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081B7F1C ldr r7, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r7, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 movs r0, 0xE adds r0, r7 mov r8, r0 ldr r1, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 ldr r4, =0x020375e2 ldrb r0, [r4] bl sub_81B2360 strh r0, [r7, 0xE] ldr r0, =0x02021dc4 movs r1, 0xE ldrsh r2, [r7, r1] movs r1, 0xD muls r1, r2 ldr r2, =gMoveNames 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, =0xffff0000 cmp r0, r1 beq @081B7F08 adds r0, r6, 0 bl sub_81B6EB4 b @081B7F1C .align 2, 0 .pool @081B7EF0: ldr r1, =gUnknown_085E9AB4 b @081B7EFA .align 2, 0 .pool @081B7EF8: ldr r1, =gUnknown_085E9C00 @081B7EFA: adds r0, r6, 0 bl sub_81B6D98 b @081B7F1C .align 2, 0 .pool @081B7F08: ldr r0, =gUnknown_085E9AE9 bl sub_81B6D74 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B6FF4 str r1, [r0] @081B7F1C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =sub_8086194 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 .pool 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, =sub_81C4F84 cmp r0, 0 bne @081B7F72 ldr r1, =c2_815ABFC @081B7F72: movs r0, 0x6 str r0, [sp] ldr r0, =sub_81B1370 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, =0x0203cec8 ldr r0, =0x0203ce7c ldrh r0, [r0] strh r0, [r1, 0xC] add sp, 0xC pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cefc ldr r0, =0x0203cec8 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, =0x020244ec 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 .pool @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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B82A0 str r1, [r0] @081B8030: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 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, =0x0203cec4 ldr r1, [r0] ldr r0, =sub_81B814C str r0, [r1, 0x4] adds r0, r4, 0 bl sub_81B12C0 b @081B8082 .align 2, 0 .pool @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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081B80E4 ldr r4, =0x0203cec8 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, =0x020244ec 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, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B8104 str r1, [r0] @081B80E4: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 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, =0x020244ec adds r0, r1 ldr r1, =0x0203cedc 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 .pool thumb_func_end sub_81B8104 thumb_func_start sub_81B814C sub_81B814C: ; 81B814C push {r4-r6,lr} ldr r4, =0x0203cec8 movs r0, 0x9 ldrsb r0, [r4, r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec 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, =0x03005d8c lsls r2, r0, 3 adds r2, r0 lsls r2, 2 ldr r0, =0x00002be0 adds r2, r0 ldr r1, [r1] adds r1, r2 ldr r2, =sub_81B81A8 movs r0, 0x4 movs r3, 0x3 bl sub_811A20C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B814C thumb_func_start sub_81B81A8 sub_81B81A8: ; 81B81A8 push {r4-r7,lr} sub sp, 0xC ldr r6, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r6, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 adds r0, r5, 0 movs r1, 0xC bl pokemon_getattr lsls r0, 16 lsrs r7, r0, 16 ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0 bne @081B8208 adds r0, r5, 0 bl sub_80D4680 ldr r4, =0x0203cefc 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 .pool @081B8208: ldrb r0, [r6, 0x8] lsls r0, 28 lsrs r0, 28 ldrb r2, [r6, 0xB] movs r1, 0x7F str r1, [sp] ldr r1, =sub_81B8230 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 .pool 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081B828A ldr r1, =0x0203cefc ldrh r0, [r1] cmp r0, 0 beq @081B8264 ldr r0, =0x0203cec8 ldrh r0, [r0, 0xC] ldrh r1, [r1] movs r2, 0 bl sub_81B1D68 b @081B827C .align 2, 0 .pool @081B8264: ldr r2, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r2, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldrh r1, [r2, 0xC] movs r2, 0 movs r3, 0x1 bl sub_81B1C84 @081B827C: ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B8104 str r0, [r1] @081B828A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B82D4 str r0, [r1] @081B82C4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cec8 ldrh r4, [r7, 0xC] adds r0, r4, 0 bl sub_81B83F0 ldr r6, =0x0203cefc 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, =0x02021fc4 movs r1, 0 bl sub_81B1B5C b @081B8378 .align 2, 0 .pool @081B8338: adds r0, r4, 0 bl itemid_is_mail lsls r0, 24 cmp r0, 0 beq @081B835C ldr r0, =0x0203cec4 ldr r1, [r0] ldr r0, =sub_81B814C str r0, [r1, 0x4] adds r0, r5, 0 bl sub_81B12C0 b @081B83A8 .align 2, 0 .pool @081B835C: movs r1, 0x9 ldrsb r1, [r7, r1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B8104 str r1, [r0] b @081B83A8 .align 2, 0 .pool @081B8394: movs r0, 0x5 bl audio_play @081B839A: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B8104 str r0, [r1] @081B83A8: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085E98EC movs r1, 0x1 bl sub_81B1B5C movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81B8104 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B83B8 thumb_func_start sub_81B83F0 sub_81B83F0: ; 81B83F0 push {lr} lsls r0, 16 lsrs r1, r0, 16 ldr r0, =0x0203cec8 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 .pool @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, =0x0203cec8 ldrb r0, [r0, 0xB] cmp r0, 0x5 beq @081B8438 adds r0, r1, 0 movs r1, 0x1 bl sub_80D6D70 b @081B8440 .align 2, 0 .pool @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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =sub_816BB28 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 .pool 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, =0x0203cec8 movs r1, 0x9 ldrsb r1, [r0, r1] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 ldr r1, =0x0203cee8 movs r0, 0 strb r0, [r1] ldr r2, =0x03005d8c ldr r0, =0x0203bcb8 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, =0x00002be0 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, =gUnknown_085E9A08 movs r1, 0x1 bl sub_81B1B5C b @081B84F2 .align 2, 0 .pool @081B84DC: adds r0, r5, 0 adds r1, r4, 0 bl sub_80D460C adds r0, r4, 0 bl sub_80D439C ldr r0, =gUnknown_085E9A40 movs r1, 0x1 bl sub_81B1B5C @081B84F2: movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B8104 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =0x030022c0 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, =0x0203cec8 ldr r0, =sub_81B879C str r0, [r1, 0x4] add sp, 0xC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B8518 thumb_func_start sub_81B8558 sub_81B8558: ; 81B8558 push {lr} ldr r0, =0x0203cef8 movs r1, 0 movs r2, 0x4 bl memset pop {r0} bx r0 .align 2, 0 .pool 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, =0x020244ec adds r0, r1 bl sub_81B85AC lsls r0, 24 cmp r0, 0 bne @081B858C movs r0, 0x2 b @081B85A4 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000191a cmp r1, r0 bne @081B85EA adds r0, r5, 0 movs r1, 0xC bl pokemon_getattr cmp r0, 0 bne @081B8608 @081B85EA: ldr r0, =0x000040cf 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 .pool @081B8618: adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r4, r0, 16 ldr r3, =gUnknown_08611C9A lsls r1, r6, 1 adds r0, r1, r3 ldrh r0, [r0] ldr r2, =0x0000ffff 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 .pool 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, =0x0203cef8 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 .pool @081B8688: ldr r0, =0x02021cc4 movs r2, 0 movs r3, 0x1 bl decimal_int_to_string movs r0, 0x11 b @081B8758 .align 2, 0 .pool @081B869C: ldr r0, =0x000040cf 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 .pool @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, =0x0203cef8 adds r4, r3, r5 ldrb r0, [r4] movs r1, 0x64 muls r0, r1 subs r0, 0x64 ldr r3, =0x020244ec 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, =0x020244ec 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, =0x0203cef8 adds r5, r0, r4 ldrb r0, [r5] muls r0, r7 subs r0, 0x64 ldr r1, =0x020244ec 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, =0x020244ec 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 .pool 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, =0x0203cef8 @081B877A: adds r0, r1, r3 ldrb r0, [r0] cmp r0, r2 bne @081B878C movs r0, 0x1 b @081B8798 .align 2, 0 .pool @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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B87E8 str r0, [r1] b @081B87E0 .align 2, 0 .pool @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, =0x030022c0 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B1370 str r0, [r1] @081B881C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B87E8 thumb_func_start sub_81B8830 sub_81B8830: ; 81B8830 push {lr} ldr r0, =0x000040cf 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 .pool @081B884C: movs r0, 0x2 b @081B8854 @081B8850: ldr r0, =0x020375e2 ldrb r0, [r0] @081B8854: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81B8830 thumb_func_start sub_81B885C sub_81B885C: ; 81B885C push {lr} ldr r0, =0x000040cf 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 .pool @081B8878: movs r0, 0x2 b @081B8880 @081B887C: ldr r0, =0x020375e2 ldrb r0, [r0] @081B8880: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81B885C thumb_func_start sub_81B8888 sub_81B8888: ; 81B8888 push {lr} ldr r0, =0x000040cf 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 .pool @081B88A4: movs r0, 0x1E b @081B88B2 @081B88A8: ldr r0, =0x020375e0 ldrh r0, [r0] cmp r0, 0 bne @081B889C movs r0, 0x32 @081B88B2: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81B8888 thumb_func_start sub_81B88BC sub_81B88BC: ; 81B88BC push {lr} ldr r0, =0x000040cf 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, =gUnknown_085EA126 b @081B88FA .align 2, 0 .pool @081B88E0: cmp r1, 0x1 bne @081B88F8 ldr r0, =0x020375e2 ldrh r0, [r0] cmp r0, 0x2 bne @081B88F8 ldr r0, =gUnknown_085EA139 b @081B88FA .align 2, 0 .pool @081B88F8: ldr r0, =gUnknown_085EA155 @081B88FA: pop {r1} bx r1 .align 2, 0 .pool 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, =sub_81B1370 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 .pool 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music 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 .pool 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music 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 .pool 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =sub_8059D40 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 .pool 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =c2_815ABFC 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 .pool thumb_func_end sub_81B89F0 thumb_func_start sub_81B8A2C sub_81B8A2C: ; 81B8A2C push {r4,lr} adds r4, r0, 0 ldr r0, =0x02024550 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, =0x0203cec8 ldrb r0, [r0, 0xB] cmp r0, 0x1 bne @081B8A5C movs r0, 0x3 b @081B8A76 .align 2, 0 .pool @081B8A5C: ldr r0, =0x02022fec 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 .pool @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, =0x02021cc4 bl sub_806EBF8 adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E97B2 b @081B8C42 .align 2, 0 .pool @081B8AC4: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 bne @081B8AF8 ldr r1, =0x02021cc4 adds r0, r4, 0 bl sub_81B1B44 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E978F b @081B8C42 .align 2, 0 .pool @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, =0x0202406e 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, =0x0202406c ldrb r0, [r0] cmp r4, r0 bcc @081B8AFC movs r7, 0x64 adds r0, r5, 0 muls r0, r7 ldr r1, =0x020244ec mov r8, r1 adds r6, r0, r1 adds r0, r6, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 beq @081B8B60 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E97E5 b @081B8C42 .align 2, 0 .pool @081B8B60: adds r0, r5, 0 bl sub_81B8F38 ldr r1, =0x0202449c ldr r1, [r1] adds r1, 0x8B lsls r0, 24 lsrs r0, 24 ldrb r1, [r1] cmp r0, r1 bne @081B8B94 ldr r1, =0x02021cc4 adds r0, r6, 0 bl sub_81B1B44 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E976F b @081B8C42 .align 2, 0 .pool @081B8B94: ldr r0, =0x0203cec8 ldrb r0, [r0, 0xB] cmp r0, 0x4 bne @081B8BA8 bl sub_806E994 b @081B8C46 .align 2, 0 .pool @081B8BA8: cmp r0, 0x2 beq @081B8C20 adds r0, r5, 0 bl sub_81B8F38 ldr r1, =0x0203cee9 strb r0, [r1] ldr r1, =0x0203cee8 movs r0, 0x1 strb r0, [r1] ldr r1, =0x0202406e ldr r0, =0x020244b8 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 .pool @081B8BFC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02021cc4 bl sub_81B1B44 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9754 b @081B8C42 .align 2, 0 .pool @081B8C20: ldr r0, =0x020244b8 ldrb r0, [r0] ldr r1, =0x0202406e 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, =0x02021cc4 bl sub_81B1B44 ldr r0, =0x02021fc4 ldr r1, =gUnknown_085E9738 @081B8C42: bl ExpandTextCodes @081B8C46: movs r0, 0 @081B8C48: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81B8A7C thumb_func_start sub_81B8C68 sub_81B8C68: ; 81B8C68 push {r4,lr} ldr r4, =0x0203cf00 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 .pool 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, =0x0202406e 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 .pool @081B8CFC: movs r5, 0x2 movs r0, 0 bl battle_get_side_with_given_state mov r1, sp ldr r4, =0x0202406e 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 .pool 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, =0x0202449c 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 .pool 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, =0x0202406e 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 .pool @081B8E28: movs r3, 0x2 mov r1, sp ldr r2, =0x0202406e 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 .pool 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, =0x0202449c 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 .pool @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, =0x0203cf00 adds r0, r2, r0 ldrb r0, [r0] movs r1, 0xF ands r1, r0 b @081B8F60 .align 2, 0 .pool @081B8F58: ldr r0, =0x0203cf00 adds r0, r2, r0 ldrb r0, [r0] lsrs r1, r0, 4 @081B8F60: adds r0, r1, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =0x0203cf00 adds r0, r3, r0 ldrb r2, [r0] movs r1, 0xF0 ands r1, r2 orrs r1, r4 strb r1, [r0] b @081B8FA4 .align 2, 0 .pool @081B8F94: ldr r2, =0x0203cf00 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 .pool 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, =0x0203cf00 @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 .pool @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, =0x020244ec 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, =0x020244ec 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 .pool 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, =0x020244ec 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, =0x020244ec 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 .pool 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, =0x020244ec 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 .pool @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, =sub_8059D40 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81B917C str r0, [sp, 0x4] ldr r0, =0x030022c0 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 .pool thumb_func_end sub_81B9150 thumb_func_start sub_81B917C sub_81B917C: ; 81B917C push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 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, =sub_81B91B4 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r4, r0, r1 ldr r0, =0x02037fd4 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, =0x02022ff8 @081B91E8: subs r0, r4, 0x3 lsls r0, 5 adds r0, r7 ldrh r0, [r0] cmp r0, 0 beq @081B9204 ldr r0, =0x0203cedc 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, =0x03005e00 adds r1, r6, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81B9240 str r0, [r1] @081B9220: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 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 .pool 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, =0x02020630 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 .pool 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, =0x03005e08 adds r5, r1, r0 movs r6, 0x3 ldr r7, =0x0203cedc @081B92A8: ldr r0, =0x02022ff8 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 .pool 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =sub_81B9390 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 .pool 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, =0x03005db0 ldr r1, =hm_add_c3_without_phase_2 str r1, [r2] movs r1, 0 str r1, [sp] ldr r1, =sub_81B1370 str r1, [sp, 0x4] ldr r1, =c2_exit_to_overworld_2_switch 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 .pool thumb_func_end sub_81B9354 thumb_func_start sub_81B9390 sub_81B9390: ; 81B9390 push {r4,lr} ldr r4, =0x020375e0 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, =0x03005db0 ldr r1, =hm_add_c3_without_phase_2 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =task_hm_without_phase_2 movs r1, 0xA bl AddTask movs r0, 0x1 pop {r1} bx r1 .align 2, 0 .pool 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, =sub_81B9424 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =sub_81B9470 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 .pool thumb_func_end sub_81B9424 thumb_func_start sub_81B9470 sub_81B9470: ; 81B9470 push {lr} bl brm_get_pokemon_selection ldr r2, =0x02039f24 strb r0, [r2] lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 bls @081B9486 movs r0, 0xFF strb r0, [r2] @081B9486: ldr r1, =0x020375e0 ldrb r0, [r2] strh r0, [r1] ldr r1, =0x03005db0 ldr r0, =hm_add_c3_without_phase_2 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81B94D0 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =sub_81B9390 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 .pool 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, =sub_81B953C movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =sub_81B9588 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 .pool thumb_func_end sub_81B953C thumb_func_start sub_81B9588 sub_81B9588: ; 81B9588 push {r4,r5,lr} ldr r5, =0x020375e0 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 .pool @081B95A4: ldr r4, =0x020375e2 ldrh r1, [r5] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 bl sub_806E25C lsls r0, 24 lsrs r0, 24 strh r0, [r4] @081B95BA: ldr r0, =0x03005db0 ldr r1, =hm_add_c3_without_phase_2 str r1, [r0] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9588 thumb_func_start sub_81B95E0 sub_81B95E0: ; 81B95E0 push {r4,r5,lr} ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] movs r4, 0 adds r5, r1, 0 b @081B95FA .align 2, 0 .pool @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, =0x020244ec 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 .pool 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, =sub_81B9640 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =sub_81B1370 str r0, [sp, 0x4] ldr r0, =sub_81B9390 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 .pool thumb_func_end sub_81B9640 thumb_func_start sub_81B968C sub_81B968C: ; 81B968C push {lr} sub sp, 0x4 ldr r1, =0x020244ec ldr r0, =0x020375e0 ldrb r2, [r0] ldr r0, =0x020244e9 ldrb r3, [r0] subs r3, 0x1 lsls r3, 24 lsrs r3, 24 ldr r0, =c2_exit_to_overworld_2_switch str r0, [sp] movs r0, 0x3 bl sub_81BF8EC ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B968C thumb_func_start sub_81B96D0 sub_81B96D0: ; 81B96D0 push {r4,r5,lr} ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] movs r4, 0 adds r5, r1, 0 @081B96DC: ldr r0, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool thumb_func_end sub_81B96D0 thumb_func_start sub_81B9718 sub_81B9718: ; 81B9718 push {r4,r5,lr} ldr r0, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 adds r5, r1, 0 muls r5, r0 ldr r0, =0x020244ec adds r5, r0 ldr r0, =0x020375e2 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, =0x02021cc4 adds r0, r5, 0 bl sub_81B1B44 ldr r0, =0x02021dc4 movs r1, 0xD muls r1, r4 ldr r2, =gMoveNames adds r1, r2 bl gf_strcpy pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9718 thumb_func_start sub_81B9770 sub_81B9770: ; 81B9770 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =0x020375e0 mov r8, r0 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 ldr r4, =0x020375e2 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, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec 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 .pool 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, =gUnknown_08329D22 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 .pool thumb_func_end sub_81B97DC thumb_func_start sub_81B98DC sub_81B98DC: ; 81B98DC push {lr} ldr r0, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2D bl pokemon_getattr adds r1, r0, 0 cmp r1, 0 beq @081B990C ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] b @081B9910 .align 2, 0 .pool @081B990C: ldr r0, =0x020375f0 strh r1, [r0] @081B9910: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B98DC thumb_func_start sub_81B9918 sub_81B9918: ; 81B9918 push {r4-r7,lr} mov r7, r8 push {r7} ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] ldr r0, =0x020375e0 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x020375e2 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 .pool @081B9958: ldr r0, =0x020375e0 ldrh r0, [r0] cmp r6, r0 beq @081B997E movs r4, 0 movs r0, 0x64 adds r5, r6, 0 muls r5, r0 ldr r7, =0x020244ec @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, =0x020375f0 movs r0, 0x1 strh r0, [r1] @081B999C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9918 thumb_func_start sub_81B99B4 sub_81B99B4: ; 81B99B4 push {lr} ldr r1, =gUnknown_086160B4 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B99B4 thumb_func_start sub_81B99D4 sub_81B99D4: ; 81B99D4 push {lr} ldr r1, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000ca8 adds r0, r2 movs r2, 0 strb r2, [r0] ldr r1, [r1] ldr r3, =0x00000cb2 adds r0, r1, r3 strh r2, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r0, =0x03005d8c 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 .pool thumb_func_end sub_81B99D4 thumb_func_start sub_81B9A28 sub_81B9A28: ; 81B9A28 ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000e6a adds r0, r2 ldrh r0, [r0] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81B9A28 thumb_func_start sub_81B9A44 sub_81B9A44: ; 81B9A44 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x020375e4 ldrh r1, [r1] ldr r2, =0x00000e6a adds r0, r2 strh r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81B9A44 thumb_func_start sub_81B9A60 sub_81B9A60: ; 81B9A60 push {r4,lr} ldr r4, =0x02038bca 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 .pool thumb_func_end sub_81B9A60 thumb_func_start sub_81B9A90 sub_81B9A90: ; 81B9A90 push {lr} ldr r3, =0x02038bca ldrh r1, [r3] ldr r0, =0x0000012b cmp r1, r0 bhi @081B9AAC ldr r2, =0x0203bc88 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 .pool thumb_func_end sub_81B9A90 thumb_func_start sub_81B9ABC sub_81B9ABC: ; 81B9ABC push {r4,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool thumb_func_end sub_81B9ABC thumb_func_start sub_81B9B00 sub_81B9B00: ; 81B9B00 push {r4,r5,lr} ldr r0, =0x03005d90 ldr r4, [r0] ldr r5, =gUnknown_086160D4 bl GenerateRandomNumber ldrh r0, [r5] ldr r1, =0x00000e6a adds r4, r1 strh r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9B00 thumb_func_start sub_81B9B28 sub_81B9B28: ; 81B9B28 push {r4,r5,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000e6a 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, =0x00000e6a adds r0, r1 ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000e6a adds r0, r1 movs r1, 0 strh r1, [r0] ldr r0, =0x020375f0 strh r5, [r0] b @081B9B76 .align 2, 0 .pool @081B9B70: ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] @081B9B76: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9B28 thumb_func_start sub_81B9B80 sub_81B9B80: ; 81B9B80 push {lr} ldr r1, =gUnknown_086160D8 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9B80 thumb_func_start sub_81B9BA0 sub_81B9BA0: ; 81B9BA0 push {lr} ldr r1, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000ca8 adds r0, r2 movs r2, 0 strb r2, [r0] ldr r1, [r1] ldr r3, =0x00000cb2 adds r0, r1, r3 strh r2, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r0, =0x03005d8c 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 .pool thumb_func_end sub_81B9BA0 thumb_func_start sub_81B9BF4 sub_81B9BF4: ; 81B9BF4 ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000e6c adds r0, r2 ldrh r0, [r0] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81B9BF4 thumb_func_start sub_81B9C10 sub_81B9C10: ; 81B9C10 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x020375e4 ldrh r1, [r1] ldr r2, =0x00000e6c adds r0, r2 strh r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81B9C10 thumb_func_start sub_81B9C2C sub_81B9C2C: ; 81B9C2C push {r4,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool thumb_func_end sub_81B9C2C thumb_func_start sub_81B9C70 sub_81B9C70: ; 81B9C70 push {r4,r5,lr} ldr r0, =0x03005d90 ldr r4, [r0] ldr r5, =gUnknown_086160F4 bl GenerateRandomNumber ldrh r0, [r5] ldr r1, =0x00000e6c adds r4, r1 strh r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9C70 thumb_func_start sub_81B9C98 sub_81B9C98: ; 81B9C98 push {r4,r5,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000e6c 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, =0x00000e6c adds r0, r1 ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000e6c adds r0, r1 movs r1, 0 strh r1, [r0] ldr r0, =0x020375f0 strh r5, [r0] b @081B9CE6 .align 2, 0 .pool @081B9CE0: ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] @081B9CE6: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9C98 thumb_func_start sub_81B9CF0 sub_81B9CF0: ; 81B9CF0 push {lr} ldr r0, =0x02021cc4 ldr r1, =0x02038bca ldrh r1, [r1] bl sub_8162E20 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9CF0 thumb_func_start sub_81B9D08 sub_81B9D08: ; 81B9D08 push {lr} ldr r1, =gUnknown_086160F8 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9D08 thumb_func_start sub_81B9D28 sub_81B9D28: ; 81B9D28 push {lr} ldr r1, =0x03005d90 ldr r0, [r1] ldr r2, =0x00000ca8 adds r0, r2 movs r2, 0 strb r2, [r0] ldr r1, [r1] ldr r3, =0x00000cb2 adds r0, r1, r3 strh r2, [r0] ldr r0, =0x00000ca9 adds r1, r0 ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r0, =0x03005d8c 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 .pool thumb_func_end sub_81B9D28 thumb_func_start sub_81B9D7C sub_81B9D7C: ; 81B9D7C ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000e6e adds r0, r2 ldrh r0, [r0] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81B9D7C thumb_func_start sub_81B9D98 sub_81B9D98: ; 81B9D98 ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x020375e4 ldrh r1, [r1] ldr r2, =0x00000e6e adds r0, r2 strh r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81B9D98 thumb_func_start sub_81B9DB4 sub_81B9DB4: ; 81B9DB4 push {r4,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x020375e2 ldrh r1, [r1] ldr r2, =0x00000ca8 adds r0, r2 strb r1, [r0] movs r0, 0x80 lsls r0, 7 movs r1, 0 bl var_set ldr r1, [r4] ldr r0, =0x00000ca9 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 .pool thumb_func_end sub_81B9DB4 thumb_func_start sub_81B9DF8 sub_81B9DF8: ; 81B9DF8 push {r4,r5,lr} ldr r0, =0x03005d90 ldr r4, [r0] ldr r5, =gUnknown_08616120 bl GenerateRandomNumber ldrh r0, [r5] ldr r1, =0x00000e6e adds r4, r1 strh r0, [r4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81B9DF8 thumb_func_start sub_81B9E20 sub_81B9E20: ; 81B9E20 push {r4,r5,lr} ldr r4, =0x03005d90 ldr r0, [r4] ldr r1, =0x00000e6e 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, =0x00000e6e adds r0, r1 ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, [r4] ldr r1, =0x00000e6e adds r0, r1 movs r1, 0 strh r1, [r0] ldr r0, =0x020375f0 strh r5, [r0] b @081B9E6E .align 2, 0 .pool @081B9E68: ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] @081B9E6E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037318 ldrb r0, [r1, 0x14] cmp r0, 0x8 bne @081B9EB2 ldr r3, =0xfffffe7f 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 .pool 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, =0x0203bc88 ldr r0, =gSlateportBattleTentTrainers str r0, [r1] add r0, sp, 0xC mov r9, r0 mov r1, sp adds r1, 0x18 str r1, [sp, 0x2C] ldr r5, =0x0203bc8c ldr r4, =gSlateportBattleTentMons 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, =0x0203bc8c 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, =gBattleFrontierHeldItems mov r12, r0 ldr r7, =0x0203bc8c 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 .pool @081B9FCC: adds r4, 0x2 adds r2, 0x1 cmp r2, r6 blt @081B9F92 @081B9FD4: cmp r2, r6 bne @081BA01C ldr r0, =0x03005d90 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, =0x0203bc8c ldr r0, [r0] lsls r1, r5, 4 adds r1, r0 ldrh r0, [r1] ldr r7, [sp, 0x34] strh r0, [r7] ldr r2, =gBattleFrontierHeldItems 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 .pool 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, =0x0203bc88 ldr r0, =gSlateportBattleTentTrainers str r0, [r1] ldr r1, =0x0203bc8c ldr r0, =gSlateportBattleTentMons str r0, [r1] ldr r7, =0x03005d90 ldr r1, =0x0000ffff 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, =0x00000cb2 adds r0, r1, r4 ldrh r0, [r0] cmp r5, r0 bge @081BA0AA ldr r2, =0x00000cb4 adds r0, r1, r2 ldrh r0, [r0] cmp r0, r3 beq @081BA0AA ldr r0, =0x03005d90 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, =0x00000cb2 adds r0, r1 ldrh r0, [r0] cmp r5, r0 bne @081BA066 ldr r2, =0x02038bca strh r3, [r2] ldrh r3, [r2] ldr r4, =0x0203bc88 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, =0x0000ffff @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 .pool @081BA110: ldr r0, =0x03005d90 ldr r1, [r0] ldr r6, =0x00000cb2 adds r3, r1, r6 ldrh r0, [r3] cmp r0, 0x1 bhi @081BA12A lsls r0, 1 ldr r3, =0x00000cb4 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, =0x03001298 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, =0x0203bc8c ldr r3, [r4] lsls r0, 4 adds r0, r3 ldr r1, =0x03005d90 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, =0x03001298 ldr r3, =0x0203bc8c 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, =gBattleFrontierHeldItems mov r12, r6 add r3, sp, 0x8 @081BA1C0: ldrh r2, [r3] cmp r2, 0 beq @081BA1DE ldr r1, =0x03001298 ldrh r0, [r1] ldr r6, =0x0203bc8c 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, =0x0203bc8c 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, =gBattleFrontierHeldItems 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, =0x03006298 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 .pool thumb_func_end sub_81BA040 thumb_func_start Font6Func ; int Font6Func(struct TextBox *x) Font6Func: ; 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, =@081BA270 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081BA270: .4byte @081BA28C .4byte @081BA554 .4byte @081BA566 .4byte @081BA590 .4byte @081BA5C8 .4byte @081BA63C .4byte @081BA64E @081BA28C: ldr r2, =0x030022c0 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, =0x03003014 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 .pool @081BA2E8: ldr r2, =0x03003014 ldrb r1, [r2] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @081BA2FC movs r0, 0x3 b @081BA2FE .align 2, 0 .pool @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, =@081BA320 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x03002f80 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 .pool @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, =@081BA38C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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 DecompressGlyphFont6 adds r0, r6, 0 bl CopyGlyphToWindow ldr r0, =0x03002f90 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 .pool @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, =0x03002f80 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 .pool @081BA5C8: ldrb r2, [r6, 0x1F] cmp r2, 0 beq @081BA638 ldr r4, =gUnknown_08616124 ldr r5, =0x03005d90 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 .pool @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 Font6Func thumb_func_start DecompressGlyphFont6 DecompressGlyphFont6: ; 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, =gFont6BrailleGlyphs adds r1, r0 adds r5, r2, r1 ldr r4, =0x03002f90 adds r0, r5, 0 adds r1, r4, 0 bl DecompressGlyphTile adds r0, r5, 0 adds r0, 0x10 adds r1, r4, 0 adds r1, 0x20 bl DecompressGlyphTile movs r1, 0x80 lsls r1, 1 adds r0, r5, r1 adds r1, r4, 0 adds r1, 0x40 bl DecompressGlyphTile movs r1, 0x88 lsls r1, 1 adds r0, r5, r1 adds r1, r4, 0 adds r1, 0x60 bl DecompressGlyphTile 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 .pool thumb_func_end DecompressGlyphFont6 thumb_func_start GetGlyphWidthFont6 GetGlyphWidthFont6: ; 81BA6CC movs r0, 0x10 bx lr thumb_func_end GetGlyphWidthFont6 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, =0x04000134 strh r1, [r0] ldr r2, =0x04000128 ldr r3, =0x00002003 adds r0, r3, 0 strh r0, [r2] ldr r0, =0x0400012a strh r1, [r0] bx lr .align 2, 0 .pool 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, =0x04000128 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 .pool @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, =0x04000120 ldrh r0, [r0, 0x6] adds r1, r0, 0 ldr r0, =0x0000ffff ldrb r2, [r7, 0x1E] adds r6, r2, 0 cmp r1, r0 bne @081BA7FE adds r4, r1, 0 ldr r1, =0x04000126 @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, =0x04000120 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, =0x00007208 b @081BA852 .align 2, 0 .pool @081BA82C: subs r5, 0x1 cmp r5, 0 beq @081BA858 lsls r0, r5, 1 ldr r1, =0x04000120 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 .pool @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, =0x0300129c @081BA8A0: lsls r0, r5, 1 ldr r2, =0x04000120 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 .pool @081BA8F0: movs r5, 0x3 movs r0, 0x49 adds r0, r7 mov r12, r0 mov r4, r12 movs r6, 0x1 ldr r1, =0x0300129c mov r9, r1 ldr r2, =0x04000120 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 .pool @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, =0x0300129c mov r8, r1 @081BA94E: lsls r0, r5, 1 ldr r2, =0x04000120 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 .pool @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, =0x04000126 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 .pool @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, =0x04000120 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 .pool @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, =0x04000128 ldrh r0, [r3] movs r4, 0x8C ands r4, r0 cmp r4, 0x8 bne @081BAB34 ldr r0, =0x0400012a strh r1, [r0] ldr r1, =0x00002083 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 .pool @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, =0x0003ff00 cmp r1, r0 bls @081BABB4 @081BABA8: adds r0, r4, 0 bl sub_81BA6D0 b @081BAC28 .align 2, 0 .pool @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, =@081BABD8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x04000126 @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 .pool @081BACD0: lsls r0, r4, 1 ldr r1, =0x04000120 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 .pool @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, =0x04000128 ldrh r1, [r3] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081BAD6C ldr r5, =0x0000795c 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 .pool 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, =0x04000010 strh r2, [r1] adds r1, 0x2 strh r2, [r1] adds r1, 0x3E strh r2, [r1] ldr r5, =gUnknown_08617128 lsls r4, r0, 1 adds r4, r0 lsls r4, 2 adds r0, r4, r5 ldr r0, [r0] movs r1, 0xC0 lsls r1, 19 bl LZ77UnCompVram adds r0, r5, 0x4 adds r0, r4, r0 ldr r0, [r0] ldr r1, =0x0600f800 bl LZ77UnCompVram adds r5, 0x8 adds r4, r5 ldr r0, [r4] movs r1, 0xA0 lsls r1, 19 movs r4, 0x80 lsls r4, 1 adds r2, r4, 0 bl CpuSet ldr r1, =0x04000008 movs r2, 0xF8 lsls r2, 5 adds r0, r2, 0 strh r0, [r1] strh r4, [r6] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BAD84 thumb_func_start nullsub_77 nullsub_77: ; 81BADF0 bx lr thumb_func_end nullsub_77 thumb_func_start sub_81BADF4 sub_81BADF4: ; 81BADF4 ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl3 str r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81BADF4 thumb_func_start bx_exec_buffer_A_ch0_tbl3 bx_exec_buffer_A_ch0_tbl3: ; 81BAE10 push {lr} ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldr r0, =0x02024064 ldrb r3, [r0] lsls r0, r3, 2 adds r0, r1 ldr r1, [r2] ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @081BAE5C ldr r0, =0x02023064 lsls r1, r3, 9 adds r1, r0 ldrb r0, [r1] cmp r0, 0x38 bhi @081BAE58 ldr r0, =gUnknown_08617170 ldrb r1, [r1] lsls r1, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 b @081BAE5C .align 2, 0 .pool @081BAE58: bl dp01_tbl3_exec_completed @081BAE5C: pop {r0} bx r0 thumb_func_end bx_exec_buffer_A_ch0_tbl3 thumb_func_start sub_81BAE60 sub_81BAE60: ; 81BAE60 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @081BAE84 bl dp01_tbl3_exec_completed @081BAE84: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BAE60 thumb_func_start sub_81BAE98 sub_81BAE98: ; 81BAE98 push {r4-r6,lr} ldr r6, =0x02020630 ldr r5, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r6, 0 adds r1, 0x1C adds r0, r1 ldr r1, [r0] ldr r0, =nullsub_12 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 .pool thumb_func_end sub_81BAE98 thumb_func_start sub_81BAF00 sub_81BAF00: ; 81BAF00 push {r4,lr} ldr r4, =0x020244d0 ldr r1, [r4] ldr r3, =0x02024064 ldrb r0, [r3] ldr r2, [r1, 0x4] lsls r1, r0, 1 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r0, [r1, 0x9] subs r0, 0x1 strb r0, [r1, 0x9] lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF bne @081BAF38 ldr r0, [r4] ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x9] bl dp01_tbl3_exec_completed @081BAF38: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BAF00 thumb_func_start sub_81BAF48 sub_81BAF48: ; 81BAF48 push {r4-r6,lr} movs r6, 0 bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @081BAF6C bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @081BAFA0 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @081BAFA0 @081BAF6C: ldr r2, =0x02020630 ldr r1, =0x03005d70 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @081BAFD8 b @081BAFD6 .align 2, 0 .pool @081BAFA0: ldr r2, =0x02020630 ldr r5, =0x03005d70 ldr r0, =0x02024064 ldrb r3, [r0] adds r0, r3, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r2, 0 adds r4, 0x1C adds r0, r4 ldr r2, [r0] ldr r0, =nullsub_12 cmp r2, r0 bne @081BAFD8 movs r0, 0x2 eors r3, r0 adds r0, r3, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r0, [r0] cmp r0, r2 bne @081BAFD8 @081BAFD6: movs r6, 0x1 @081BAFD8: bl sub_80A36C8 lsls r0, 24 cmp r0, 0 beq @081BAFE4 movs r6, 0 @081BAFE4: cmp r6, 0 beq @081BB00A ldr r0, =0x020244d0 ldr r0, [r0] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x9] ldr r1, =0x03005d60 ldrb r0, [r3] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BAF00 str r1, [r0] @081BB00A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BAF48 thumb_func_start sub_81BB02C sub_81BB02C: ; 81BB02C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x020244d0 mov r12, r0 ldr r0, [r0] ldr r7, =0x02024064 ldrb r2, [r7] ldr r3, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r4, r0, r3 ldrb r1, [r4] movs r5, 0x8 adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @081BB058 b @081BB196 @081BB058: movs r1, 0x2 mov r8, r1 adds r1, r2, 0 mov r0, r8 eors r1, r0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0] adds r0, r5, 0 ands r0, r1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 beq @081BB07A b @081BB196 @081BB07A: ldr r1, =0x02020630 mov r10, r1 ldr r0, =0x03005d7c mov r9, r0 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 mov r5, r10 adds r5, 0x1C adds r0, r5 ldr r3, [r0] ldr r0, =nullsub_12 cmp r3, r0 bne @081BB196 ldr r0, =0x020241e4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r0, [r0] cmp r0, r3 bne @081BB196 ldrb r0, [r4, 0x9] adds r0, 0x1 strb r0, [r4, 0x9] lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081BB196 mov r1, r12 ldr r0, [r1] ldrb r1, [r7] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r6, [r0, 0x9] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @081BB134 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 bne @081BB134 ldrb r0, [r7] mov r1, r8 eors r0, r1 add r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r10 bl obj_delete_and_free_tiles ldr r4, =0x03005d70 ldrb r0, [r7] mov r1, r8 eors r1, r0 adds r0, r1, r4 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r7] mov r1, r8 eors r0, r1 bl sub_8076918 ldrb r0, [r7] mov r1, r8 eors r0, r1 adds r0, r4 ldrb r0, [r0] bl sub_80729D0 @081BB134: ldr r1, =0x03005d7c ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldr r5, =0x03005d70 ldrb r1, [r4] adds r0, r1, r5 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r4] bl sub_8076918 ldrb r0, [r4] adds r0, r5 ldrb r0, [r0] bl sub_80729D0 ldr r0, =0x020244d0 ldr r0, [r0] ldr r2, [r0, 0x8] ldrb r1, [r2, 0x9] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BAF48 str r1, [r0] @081BB196: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB02C thumb_func_start sub_81BB1D4 sub_81BB1D4: ; 81BB1D4 push {lr} ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r0, r2 adds r0, r1, 0 adds r0, 0x3F ldrb r0, [r0] lsls r0, 27 cmp r0, 0 bge @081BB202 movs r2, 0x24 ldrsh r0, [r1, r2] cmp r0, 0 bne @081BB202 bl dp01_tbl3_exec_completed @081BB202: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB1D4 thumb_func_start bx_t3_healthbar_update bx_t3_healthbar_update: ; 81BB214 push {r4-r6,lr} ldr r5, =0x02024064 ldrb r0, [r5] ldr r6, =0x03005d70 adds r1, r0, r6 ldrb r1, [r1] movs r2, 0 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] bl sub_80729D0 lsls r4, 16 asrs r1, r4, 16 movs r0, 0x1 negs r0, r0 cmp r1, r0 beq @081BB25C ldrb r0, [r5] adds r0, r6 ldrb r0, [r0] movs r2, 0 bl heathbar_draw_hp b @081BB276 .align 2, 0 .pool @081BB25C: ldr r2, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 bl dp01_tbl3_exec_completed @081BB276: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e00 lsls r0, 2 add r0, r9 lsls r0, 3 adds r0, r1 mov r8, r0 ldrb r0, [r0, 0x8] mov r10, r0 mov r1, r8 ldrb r7, [r1, 0xC] str r7, [sp, 0x8] ldrh r2, [r1, 0xA] str r2, [sp, 0xC] bl battle_type_is_double lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081BB2E2 ldr r1, =0x0202406e lsls r0, r7, 1 adds r0, r1 ldrh r0, [r0] cmp r10, r0 bne @081BB2E2 b @081BB3F8 @081BB2E2: movs r0, 0x64 mov r1, r10 muls r1, r0 ldr r0, =0x020244ec adds r6, r1, r0 adds r0, r6, 0 movs r1, 0xB bl pokemon_getattr adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 movs r1, 0x38 bl pokemon_getattr adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x4] ldr r3, =gExperienceTables adds r4, 0x1 lsls r4, 2 ldr r2, =gBaseStats lsls r1, r5, 3 subs r1, r5 lsls r1, 2 adds r1, r2 ldrb r2, [r1, 0x13] movs r1, 0xCA lsls r1, 1 muls r1, r2 adds r4, r1 adds r4, r3 ldr r2, [r4] str r2, [sp] ldr r3, [sp, 0xC] lsls r1, r3, 16 asrs r1, 16 adds r0, r1 cmp r0, r2 bcc @081BB3D0 adds r0, r6, 0 movs r1, 0x19 mov r2, sp bl pokemon_setattr adds r0, r6, 0 bl pokemon_calc_effective_stats ldr r2, [sp] add r0, sp, 0x4 ldrh r0, [r0] subs r2, r0 ldr r0, [sp, 0xC] subs r2, r0, r2 ldr r4, =0x02024064 ldrb r5, [r4] strb r7, [r4] lsls r2, 16 lsrs r2, 16 movs r0, 0x1 movs r1, 0xB bl dp01_build_cmdbuf_x21_a_bb strb r5, [r4] bl battle_type_is_double lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081BB3B8 ldr r2, =0x0202406e lsls r0, r7, 1 adds r0, r2 mov r1, r10 ldrh r0, [r0] cmp r1, r0 beq @081BB396 movs r0, 0x2 eors r7, r0 lsls r0, r7, 1 adds r0, r2 ldrh r0, [r0] cmp r1, r0 bne @081BB3B8 @081BB396: ldr r0, =sub_81BB628 b @081BB3FA .align 2, 0 .pool @081BB3B8: ldr r0, =0x03005e00 mov r2, r9 lsls r1, r2, 2 add r1, r9 lsls r1, 3 adds r1, r0 ldr r0, =sub_81BB740 b @081BB3FC .align 2, 0 .pool @081BB3D0: str r0, [sp, 0x4] add r2, sp, 0x4 adds r0, r6, 0 movs r1, 0x19 bl pokemon_setattr ldr r1, =0x03005d60 ldr r3, [sp, 0x8] lsls r0, r3, 2 adds r0, r1 ldr r1, =sub_81BB284 str r1, [r0] mov r0, r9 bl remove_task b @081BB3FE .align 2, 0 .pool @081BB3F8: ldr r0, =sub_81BB414 @081BB3FA: mov r1, r8 @081BB3FC: str r0, [r1] @081BB3FE: add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB29C thumb_func_start sub_81BB414 sub_81BB414: ; 81BB414 push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} sub sp, 0x4 lsls r0, 24 lsrs r0, 24 ldr r1, =0x03005e00 lsls r2, r0, 2 mov r8, r2 add r8, r0 mov r0, r8 lsls r0, 3 mov r8, r0 add r8, r1 mov r2, r8 ldrb r1, [r2, 0x8] movs r0, 0xA ldrsh r2, [r2, r0] mov r9, r2 mov r2, r8 ldrb r2, [r2, 0xC] mov r10, r2 movs r0, 0x64 adds r6, r1, 0 muls r6, r0 ldr r0, =0x020244ec adds r6, r0 adds r0, r6, 0 movs r1, 0x38 bl pokemon_getattr adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 movs r1, 0xB bl pokemon_getattr adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 adds r0, r6, 0 movs r1, 0x19 bl pokemon_getattr adds r3, r0, 0 ldr r6, =gExperienceTables lsls r1, r4, 2 ldr r2, =gBaseStats lsls r0, r5, 3 subs r0, r5 lsls r0, 2 adds r0, r2 ldrb r2, [r0, 0x13] movs r0, 0xCA lsls r0, 1 muls r0, r2 adds r1, r0 adds r1, r6 ldr r1, [r1] subs r3, r1 adds r4, 0x1 lsls r4, 2 adds r4, r0 adds r4, r6 ldr r2, [r4] subs r2, r1 ldr r0, =0x03005d70 add r0, r10 ldrb r1, [r0] mov r0, r9 negs r0, r0 str r0, [sp] mov r0, r10 bl sub_807294C movs r0, 0x21 bl audio_play ldr r0, =sub_81BB4E4 mov r1, r8 str r0, [r1] add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB414 thumb_func_start sub_81BB4E4 sub_81BB4E4: ; 81BB4E4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r1, =0x03005e00 lsls r0, 2 add r0, r8 lsls r0, 3 adds r6, r0, r1 ldrh r1, [r6, 0x1C] movs r2, 0x1C ldrsh r0, [r6, r2] cmp r0, 0xC bgt @081BB514 adds r0, r1, 0x1 strh r0, [r6, 0x1C] b @081BB610 .align 2, 0 .pool @081BB514: ldrb r0, [r6, 0x8] mov r9, r0 ldrh r2, [r6, 0xA] mov r10, r2 ldrb r7, [r6, 0xC] ldr r5, =0x03005d70 adds r5, r7, r5 ldrb r1, [r5] adds r0, r7, 0 movs r2, 0x1 movs r3, 0 bl sub_8074AA0 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r5] bl sub_80729D0 lsls r4, 16 asrs r4, 16 movs r0, 0x1 negs r0, r0 cmp r4, r0 bne @081BB610 movs r0, 0x21 bl m4aSongNumStop movs r0, 0x64 mov r1, r9 muls r1, r0 ldr r0, =0x020244ec adds r5, r1, r0 adds r0, r5, 0 movs r1, 0x38 bl pokemon_getattr adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x4] adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 ldr r3, =gExperienceTables adds r4, 0x1 lsls r4, 2 ldr r2, =gBaseStats lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r2 ldrb r1, [r1, 0x13] movs r0, 0xCA lsls r0, 1 muls r0, r1 adds r4, r0 adds r4, r3 ldr r1, [r4] str r1, [sp] mov r2, r10 lsls r0, r2, 16 asrs r4, r0, 16 ldr r0, [sp, 0x4] adds r0, r4 cmp r0, r1 blt @081BB5F4 adds r0, r5, 0 movs r1, 0x19 mov r2, sp bl pokemon_setattr adds r0, r5, 0 bl pokemon_calc_effective_stats ldr r2, [sp] add r0, sp, 0x4 ldrh r0, [r0] subs r2, r0 subs r2, r4, r2 ldr r4, =0x02024064 ldrb r5, [r4] strb r7, [r4] lsls r2, 16 lsrs r2, 16 movs r0, 0x1 movs r1, 0xB bl dp01_build_cmdbuf_x21_a_bb strb r5, [r4] ldr r0, =sub_81BB628 str r0, [r6] b @081BB610 .align 2, 0 .pool @081BB5F4: str r0, [sp, 0x4] add r2, sp, 0x4 adds r0, r5, 0 movs r1, 0x19 bl pokemon_setattr ldr r1, =0x03005d60 lsls r0, r7, 2 adds r0, r1 ldr r1, =sub_81BB284 str r1, [r0] mov r0, r8 bl remove_task @081BB610: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB4E4 thumb_func_start sub_81BB628 sub_81BB628: ; 81BB628 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldrb r4, [r0, 0xC] ldrb r6, [r0, 0x8] bl battle_type_is_double lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081BB65C ldr r1, =0x0202406e movs r0, 0x2 adds r2, r4, 0 eors r2, r0 lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r6, r0 bne @081BB65C adds r4, r2, 0 @081BB65C: adds r0, r4, 0 adds r1, r4, 0 adds r2, r4, 0 movs r3, 0 bl move_anim_start_t4 ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81BB688 str r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB628 thumb_func_start sub_81BB688 sub_81BB688: ; 81BB688 push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r2, r0, r1 ldrb r5, [r2, 0xC] ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @081BB72A ldrb r4, [r2, 0x8] movs r0, 0x64 adds r1, r4, 0 muls r1, r0 ldr r0, =0x020244ec adds r7, r1, r0 adds r0, r7, 0 movs r1, 0x38 bl pokemon_getattr bl battle_type_is_double lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081BB708 ldr r1, =0x0202406e movs r0, 0x2 adds r2, r5, 0 eors r2, r0 lsls r0, r2, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 bne @081BB708 ldr r0, =0x03005d70 adds r0, r2, r0 ldrb r0, [r0] adds r1, r7, 0 movs r2, 0 bl healthbar_draw_field_maybe b @081BB71C .align 2, 0 .pool @081BB708: ldr r0, =0x03005d70 adds r0, r5, r0 ldrb r0, [r0] movs r1, 0x64 muls r1, r4 ldr r2, =0x020244ec adds r1, r2 movs r2, 0 bl healthbar_draw_field_maybe @081BB71C: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_81BB740 str r0, [r1] @081BB72A: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB688 thumb_func_start sub_81BB740 sub_81BB740: ; 81BB740 push {r4,r5,lr} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r0, =0x03005e00 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 adds r4, r0 ldrb r1, [r4, 0x8] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 bl pokemon_getattr ldrb r0, [r4, 0xC] ldr r1, =0x03005d60 lsls r0, 2 adds r0, r1 ldr r1, =sub_81BB284 str r1, [r0] adds r0, r5, 0 bl remove_task pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB740 thumb_func_start sub_81BB78C sub_81BB78C: ; 81BB78C push {r4-r6,lr} ldr r6, =0x02020630 ldr r5, =0x020241e4 ldr r4, =0x02024064 ldrb r2, [r4] adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 movs r3, 0x22 ldrsh r1, [r0, r3] movs r3, 0x26 ldrsh r0, [r0, r3] adds r1, r0 cmp r1, 0xA0 ble @081BB808 ldr r1, =0x0202406e lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 bl nullsub_24 ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x3] lsls r0, 26 lsrs r0, 27 bl rotscale_free_entry ldrb r0, [r4] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 ldrb r0, [r4] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl dp01_tbl3_exec_completed @081BB808: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB78C thumb_func_start sub_81BB828 sub_81BB828: ; 81BB828 push {r4-r6,lr} ldr r0, =0x020244d0 ldr r0, [r0] ldr r6, =0x02024064 ldrb r2, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @081BB87C ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl dp01_tbl3_exec_completed @081BB87C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x020241e4 ldr r0, =0x02024064 ldrb r0, [r0] adds r0, r1 ldrb r1, [r0] ldr r2, =0x02020630 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, r0, r2 movs r1, 0x30 ldrsh r0, [r4, r1] cmp r0, 0x20 bne @081BB8FC movs r3, 0 movs r0, 0 strh r0, [r4, 0x30] adds r2, r4, 0 adds r2, 0x3E ldrb r1, [r2] subs r0, 0x5 ands r0, r1 strb r0, [r2] ldr r0, =0x020244b9 strb r3, [r0] bl dp01_tbl3_exec_completed b @081BB926 .align 2, 0 .pool @081BB8FC: ldrh r0, [r4, 0x30] movs r1, 0x3 ands r0, r1 cmp r0, 0 bne @081BB920 adds r3, r4, 0 adds r3, 0x3E ldrb r2, [r3] lsls r0, r2, 29 lsrs r0, 31 movs r1, 0x1 eors r1, r0 lsls r1, 2 movs r0, 0x5 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] @081BB920: ldrh r0, [r4, 0x30] adds r0, 0x1 strh r0, [r4, 0x30] @081BB926: pop {r4} pop {r0} bx r0 thumb_func_end bx_blink_t3 thumb_func_start sub_81BB92C sub_81BB92C: ; 81BB92C push {r4,lr} ldr r2, =0x02020630 ldr r0, =0x03005d70 ldr r4, =0x02024064 ldrb r3, [r4] adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @081BB97E adds r0, r3, 0 bl sub_805E408 ldr r0, =0x020244d0 ldr r0, [r0] ldrb r2, [r4] ldr r1, [r0] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @081BB972 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x6 bl move_anim_start_t4 @081BB972: ldr r0, =0x03005d60 ldrb r1, [r4] lsls r1, 2 adds r1, r0 ldr r0, =dp01t_35_3_free_vram str r0, [r1] @081BB97E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB92C thumb_func_start dp01t_35_3_free_vram dp01t_35_3_free_vram: ; 81BB9A0 push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @081BB9DC ldr r2, =0x02020630 ldr r0, =0x020241e4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 bne @081BB9DC bl dp01_tbl3_exec_completed @081BB9DC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_35_3_free_vram thumb_func_start sub_81BB9F4 sub_81BB9F4: ; 81BB9F4 push {r4-r7,lr} mov r7, r8 push {r7} ldr r3, =0x020244d0 ldr r0, [r3] ldr r7, =0x02024064 ldrb r1, [r7] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r2, r0, r2 ldrb r1, [r2, 0x1] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081BBAB0 ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] ldr r0, [r3] ldrb r2, [r7] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldr r4, =0x000027f9 adds r0, r4, 0 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl gpu_pal_free_tag ldr r0, =c3_0802FDF4 movs r1, 0xA bl AddTask ldr r0, =0x0202406e mov r8, r0 ldrb r1, [r7] lsls r0, r1, 1 add r0, r8 ldrh r0, [r0] movs r6, 0x64 muls r0, r6 ldr r5, =0x020244ec adds r0, r5 bl sub_805E990 ldr r1, =0x020241e4 ldrb r0, [r7] adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r1, 0 bl obj_anim_image_start ldr r4, =0x03005d70 ldrb r1, [r7] adds r0, r1, r4 ldrb r0, [r0] lsls r1, 1 add r1, r8 ldrh r1, [r1] muls r1, r6 adds r1, r5 movs r2, 0 bl healthbar_draw_field_maybe ldrb r0, [r7] bl sub_8076918 ldrb r0, [r7] adds r0, r4 ldrb r0, [r0] bl sub_80729D0 ldr r1, =0x03005d60 ldrb r0, [r7] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BB92C str r1, [r0] @081BBAB0: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BB9F4 thumb_func_start sub_81BBAE8 sub_81BBAE8: ; 81BBAE8 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r0, [r6] ldr r4, =0x02024064 ldrb r2, [r4] ldr r1, [r0, 0x4] lsls r3, r2, 1 adds r0, r3, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x88 ands r0, r1 cmp r0, 0 bne @081BBB1A ldr r0, =0x0202406e adds r0, r3, r0 ldrh r1, [r0] movs r0, 0x64 muls r1, r0 ldr r0, =0x020244ec adds r1, r0 adds r0, r2, 0 bl sub_8172EF0 @081BBB1A: ldr r5, =0x02020630 ldr r0, =0x03005d7c ldrb r2, [r4] adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r3, r0, 2 adds r0, r5, 0 adds r0, 0x1C adds r0, r3, r0 ldr r1, [r0] ldr r0, =nullsub_12 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, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BB9F4 str r1, [r0] @081BBB60: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BBAE8 thumb_func_start dp01_tbl3_exec_completed dp01_tbl3_exec_completed: ; 81BBB8C push {r4,lr} sub sp, 0x4 ldr r1, =0x03005d60 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_exec_buffer_A_ch0_tbl3 str r1, [r0] ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x2 ands r0, r1 cmp r0, 0 beq @081BBBE0 bl link_get_multiplayer_id mov r1, sp strb r0, [r1] movs r0, 0x2 movs r1, 0x4 mov r2, sp bl dp01_prepare_buffer_wireless_probably ldr r1, =0x02023064 ldrb r0, [r4] lsls r0, 9 adds r0, r1 movs r1, 0x38 strb r1, [r0] b @081BBBF2 .align 2, 0 .pool @081BBBE0: ldr r2, =0x02024068 ldr r1, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, [r0] ldr r0, [r2] bics r0, r1 str r0, [r2] @081BBBF2: add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01_tbl3_exec_completed thumb_func_start sub_81BBC04 sub_81BBC04: ; 81BBC04 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 bne @081BBC26 bl dp01_tbl3_exec_completed @081BBC26: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BBC04 thumb_func_start bx_80E8A6C bx_80E8A6C: ; 81BBC34 push {lr} ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @081BBC56 bl dp01_tbl3_exec_completed @081BBC56: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end bx_80E8A6C thumb_func_start dp01t_00_3_getattr dp01t_00_3_getattr: ; 81BBC64 push {r4-r6,lr} sub sp, 0x100 movs r6, 0 ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @081BBC9C ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] mov r1, sp bl dp01_getattr_by_ch1_for_player_pokemon adds r6, r0, 0 b @081BBCBE .align 2, 0 .pool @081BBC9C: ldrb r4, [r1] movs r5, 0 @081BBCA0: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @081BBCB6 lsls r0, r5, 24 lsrs r0, 24 mov r2, sp adds r1, r2, r6 bl dp01_getattr_by_ch1_for_player_pokemon adds r6, r0 @081BBCB6: lsrs r4, 1 adds r5, 0x1 cmp r5, 0x5 ble @081BBCA0 @081BBCBE: lsls r1, r6, 16 lsrs r1, 16 movs r0, 0x1 mov r2, sp bl dp01_build_cmdbuf_x1D_1D_numargs_varargs bl dp01_tbl3_exec_completed add sp, 0x100 pop {r4-r6} pop {r0} bx r0 thumb_func_end dp01t_00_3_getattr thumb_func_start dp01_getattr_by_ch1_for_player_pokemon dp01_getattr_by_ch1_for_player_pokemon: ; 81BBCD8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x90 adds r7, r1, 0 lsls r0, 24 lsrs r5, r0, 24 movs r6, 0 ldr r2, =0x02023064 ldr r3, =0x02024064 ldrb r0, [r3] lsls r0, 9 adds r1, r2, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0x3B bls @081BBD02 bl @081BC46E @081BBD02: lsls r0, 2 ldr r1, =@081BBD18 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081BBD18: .4byte @081BBE08 .4byte @081BC02C .4byte @081BC03C .4byte @081BC04C .4byte @081BC0B4 .4byte @081BC0B4 .4byte @081BC0B4 .4byte @081BC0B4 .4byte @081BC0D0 .4byte @081BC10C .4byte @081BC10C .4byte @081BC10C .4byte @081BC10C .4byte @081BC46E .4byte @081BC46E .4byte @081BC46E .4byte @081BC46E .4byte @081BC128 .4byte @081BC138 .4byte @081BC168 .4byte @081BC178 .4byte @081BC188 .4byte @081BC198 .4byte @081BC1A8 .4byte @081BC1B8 .4byte @081BC1C8 .4byte @081BC1D8 .4byte @081BC1E8 .4byte @081BC1F8 .4byte @081BC208 .4byte @081BC218 .4byte @081BC228 .4byte @081BC278 .4byte @081BC288 .4byte @081BC298 .4byte @081BC2A8 .4byte @081BC2B8 .4byte @081BC2C8 .4byte @081BC2D8 .4byte @081BC2E8 .4byte @081BC2F8 .4byte @081BC32C .4byte @081BC33C .4byte @081BC34C .4byte @081BC35C .4byte @081BC36C .4byte @081BC37C .4byte @081BC38C .4byte @081BC39C .4byte @081BC3BC .4byte @081BC3CC .4byte @081BC3DC .4byte @081BC3EC .4byte @081BC3FC .4byte @081BC40C .4byte @081BC41C .4byte @081BC42C .4byte @081BC43C .4byte @081BC44C .4byte @081BC45C @081BBE08: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr mov r1, sp strh r0, [r1] adds r0, r4, 0 movs r1, 0xC bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2E] movs r6, 0 add r0, sp, 0x24 mov r9, r0 movs r1, 0x3B add r1, sp mov r10, r1 mov r2, sp adds r2, 0x2B str r2, [sp, 0x80] mov r0, sp adds r0, 0x2A str r0, [sp, 0x7C] mov r1, sp adds r1, 0x68 str r1, [sp, 0x8C] adds r2, 0x5 str r2, [sp, 0x84] adds r0, 0x12 str r0, [sp, 0x88] mov r8, r4 add r4, sp, 0xC @081BBE54: adds r1, r6, 0 adds r1, 0xD mov r0, r8 bl pokemon_getattr strh r0, [r4] adds r1, r6, 0 adds r1, 0x11 mov r0, r8 bl pokemon_getattr mov r2, r9 adds r1, r2, r6 strb r0, [r1] adds r4, 0x2 adds r6, 0x1 cmp r6, 0x3 ble @081BBE54 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_getattr mov r1, r10 strb r0, [r1] adds r0, r4, 0 movs r1, 0x20 bl pokemon_getattr ldr r2, [sp, 0x80] strb r0, [r2] adds r0, r4, 0 movs r1, 0x19 bl pokemon_getattr str r0, [sp, 0x44] adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr mov r3, sp movs r5, 0x1F ands r0, r5 ldrb r2, [r3, 0x14] movs r1, 0x20 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr mov r3, sp movs r6, 0x1F ands r0, r6 lsls r0, 5 ldrh r2, [r3, 0x14] ldr r1, =0xfffffc1f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x14] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 2 ldrb r2, [r3, 0x15] movs r1, 0x7D negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x15] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr movs r1, 0x1F ands r1, r0 lsls r1, 15 ldr r0, [sp, 0x14] ldr r2, =0xfff07fff ands r0, r2 orrs r0, r1 str r0, [sp, 0x14] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr mov r3, sp ands r0, r6 lsls r0, 4 ldrh r2, [r3, 0x16] ldr r1, =0xfffffe0f ands r1, r2 orrs r1, r0 strh r1, [r3, 0x16] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr mov r3, sp ands r0, r5 lsls r0, 1 ldrb r2, [r3, 0x17] movs r1, 0x3F negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [sp, 0x48] adds r0, r4, 0 movs r1, 0x37 bl pokemon_getattr str r0, [sp, 0x4C] adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr ldr r1, [sp, 0x7C] strb r0, [r1] adds r0, r4, 0 movs r1, 0x39 bl pokemon_getattr mov r1, sp strh r0, [r1, 0x28] adds r0, r4, 0 movs r1, 0x3A bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2C] adds r0, r4, 0 movs r1, 0x3B bl pokemon_getattr mov r1, sp strh r0, [r1, 0x2] adds r0, r4, 0 movs r1, 0x3C bl pokemon_getattr mov r1, sp strh r0, [r1, 0x4] adds r0, r4, 0 movs r1, 0x3D bl pokemon_getattr mov r1, sp strh r0, [r1, 0x6] adds r0, r4, 0 movs r1, 0x3E bl pokemon_getattr mov r1, sp strh r0, [r1, 0x8] adds r0, r4, 0 movs r1, 0x3F bl pokemon_getattr mov r1, sp strh r0, [r1, 0xA] adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr mov r3, sp movs r1, 0x1 ands r0, r1 lsls r0, 6 ldrb r2, [r3, 0x17] movs r1, 0x41 negs r1, r1 ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x2E bl pokemon_getattr mov r3, sp lsls r0, 7 ldrb r2, [r3, 0x17] movs r1, 0x7F ands r1, r2 orrs r1, r0 strb r1, [r3, 0x17] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr str r0, [sp, 0x54] adds r0, r4, 0 movs r1, 0x2 ldr r2, [sp, 0x8C] bl pokemon_getattr ldr r0, [sp, 0x84] ldr r1, [sp, 0x8C] bl 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 .pool @081BC02C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB b @081BC3A6 .align 2, 0 .pool @081BC03C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xC b @081BC3A6 .align 2, 0 .pool @081BC04C: movs r6, 0 add r2, sp, 0x58 mov r9, r2 add r0, sp, 0x60 mov r10, r0 movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 mov r8, r9 @081BC062: adds r1, r6, 0 adds r1, 0xD adds r0, r4, 0 bl pokemon_getattr mov r1, r8 strh r0, [r1] adds r1, r6, 0 adds r1, 0x11 adds r0, r4, 0 bl pokemon_getattr mov r2, r10 adds r1, r2, r6 strb r0, [r1] movs r0, 0x2 add r8, r0 adds r6, 0x1 cmp r6, 0x3 ble @081BC062 movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x15 bl pokemon_getattr mov r1, r9 strb r0, [r1, 0xC] mov r2, r9 movs r6, 0 @081BC0A0: adds r0, r7, r6 adds r1, r2, r6 ldrb r1, [r1] strb r1, [r0] adds r6, 0x1 cmp r6, 0xF bls @081BC0A0 b @081BC46E .align 2, 0 .pool @081BC0B4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x9 b @081BC3A6 .align 2, 0 .pool @081BC0D0: movs r6, 0 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r2, =0x020244ec mov r8, r2 @081BC0DC: adds r1, r6, 0 adds r1, 0x11 mov r2, r8 adds r0, r4, r2 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 cmp r6, 0x3 ble @081BC0DC movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x15 bl pokemon_getattr adds r1, r7, r6 strb r0, [r1] adds r6, 0x1 b @081BC46E .align 2, 0 .pool @081BC10C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldrb r1, [r3] lsls r1, 9 adds r2, 0x1 adds r1, r2 ldrb r1, [r1] adds r1, 0x8 b @081BC466 .align 2, 0 .pool @081BC128: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1 b @081BC142 .align 2, 0 .pool @081BC138: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x19 @081BC142: bl pokemon_getattr adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF lsls r0, 8 ands r0, r1 lsrs r0, 8 strb r0, [r7, 0x1] movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r0, 16 strb r0, [r7, 0x2] movs r6, 0x3 b @081BC46E .align 2, 0 .pool @081BC168: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1A b @081BC466 .align 2, 0 .pool @081BC178: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1B b @081BC466 .align 2, 0 .pool @081BC188: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1C b @081BC466 .align 2, 0 .pool @081BC198: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1D b @081BC466 .align 2, 0 .pool @081BC1A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1E b @081BC466 .align 2, 0 .pool @081BC1B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x1F b @081BC466 .align 2, 0 .pool @081BC1C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x20 b @081BC466 .align 2, 0 .pool @081BC1D8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x22 b @081BC466 .align 2, 0 .pool @081BC1E8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x23 b @081BC466 .align 2, 0 .pool @081BC1F8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x24 b @081BC466 .align 2, 0 .pool @081BC208: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x25 b @081BC466 .align 2, 0 .pool @081BC218: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x26 b @081BC466 .align 2, 0 .pool @081BC228: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x27 bl pokemon_getattr strb r0, [r7] adds r0, r4, 0 movs r1, 0x28 bl pokemon_getattr strb r0, [r7, 0x1] adds r0, r4, 0 movs r1, 0x29 bl pokemon_getattr strb r0, [r7, 0x2] adds r0, r4, 0 movs r1, 0x2A bl pokemon_getattr strb r0, [r7, 0x3] adds r0, r4, 0 movs r1, 0x2B bl pokemon_getattr strb r0, [r7, 0x4] adds r0, r4, 0 movs r1, 0x2C bl pokemon_getattr strb r0, [r7, 0x5] movs r6, 0x6 b @081BC46E .align 2, 0 .pool @081BC278: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x27 b @081BC466 .align 2, 0 .pool @081BC288: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x28 b @081BC466 .align 2, 0 .pool @081BC298: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x29 b @081BC466 .align 2, 0 .pool @081BC2A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2A b @081BC466 .align 2, 0 .pool @081BC2B8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2B b @081BC466 .align 2, 0 .pool @081BC2C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2C b @081BC466 .align 2, 0 .pool @081BC2D8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0 b @081BC302 .align 2, 0 .pool @081BC2E8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x9 b @081BC3A6 .align 2, 0 .pool @081BC2F8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x37 @081BC302: bl pokemon_getattr adds r1, r0, 0 strb r1, [r7] movs r0, 0xFF lsls r0, 8 ands r0, r1 lsrs r0, 8 strb r0, [r7, 0x1] movs r0, 0xFF lsls r0, 16 ands r0, r1 lsrs r0, 16 strb r0, [r7, 0x2] lsrs r0, r1, 24 strb r0, [r7, 0x3] movs r6, 0x4 b @081BC46E .align 2, 0 .pool @081BC32C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x38 b @081BC466 .align 2, 0 .pool @081BC33C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x39 b @081BC3A6 .align 2, 0 .pool @081BC34C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A b @081BC3A6 .align 2, 0 .pool @081BC35C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3B b @081BC3A6 .align 2, 0 .pool @081BC36C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3C b @081BC3A6 .align 2, 0 .pool @081BC37C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3D b @081BC3A6 .align 2, 0 .pool @081BC38C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3E b @081BC3A6 .align 2, 0 .pool @081BC39C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3F @081BC3A6: bl pokemon_getattr lsls r0, 16 lsrs r0, 16 strb r0, [r7] lsrs r0, 8 strb r0, [r7, 0x1] movs r6, 0x2 b @081BC46E .align 2, 0 .pool @081BC3BC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x16 b @081BC466 .align 2, 0 .pool @081BC3CC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x17 b @081BC466 .align 2, 0 .pool @081BC3DC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x18 b @081BC466 .align 2, 0 .pool @081BC3EC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x21 b @081BC466 .align 2, 0 .pool @081BC3FC: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2F b @081BC466 .align 2, 0 .pool @081BC40C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x30 b @081BC466 .align 2, 0 .pool @081BC41C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x32 b @081BC466 .align 2, 0 .pool @081BC42C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x33 b @081BC466 .align 2, 0 .pool @081BC43C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x34 b @081BC466 .align 2, 0 .pool @081BC44C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x35 b @081BC466 .align 2, 0 .pool @081BC45C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x36 @081BC466: bl pokemon_getattr strb r0, [r7] movs r6, 0x1 @081BC46E: adds r0, r6, 0 add sp, 0x90 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end dp01_getattr_by_ch1_for_player_pokemon thumb_func_start sub_81BC484 sub_81BC484: ; 81BC484 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BC484 thumb_func_start sub_81BC490 sub_81BC490: ; 81BC490 push {r4,r5,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x2 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0 bne @081BC4C0 ldr r0, =0x0202406e lsls r1, r2, 1 adds r1, r0 ldrb r0, [r1] bl sub_81BC4E8 b @081BC4DE .align 2, 0 .pool @081BC4C0: ldrb r4, [r1] movs r5, 0 @081BC4C4: movs r0, 0x1 ands r0, r4 cmp r0, 0 beq @081BC4D2 adds r0, r5, 0 bl sub_81BC4E8 @081BC4D2: lsrs r4, 1 adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x5 bls @081BC4C4 @081BC4DE: bl dp01_tbl3_exec_completed pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81BC490 thumb_func_start sub_81BC4E8 sub_81BC4E8: ; 81BC4E8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x34 lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 ldr r2, =0x02023067 adds r3, r0, r2 adds r6, r3, 0 subs r1, r2, 0x2 adds r0, r1 ldrb r0, [r0] adds r7, r2, 0 cmp r0, 0x3B bls @081BC514 bl @081BCEAE @081BC514: lsls r0, 2 ldr r1, =@081BC52C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081BC52C: .4byte @081BC61C .4byte @081BC7B4 .4byte @081BC7D4 .4byte @081BC7F4 .4byte @081BC84C .4byte @081BC84C .4byte @081BC84C .4byte @081BC84C .4byte @081BC874 .4byte @081BC8D8 .4byte @081BC8D8 .4byte @081BC8D8 .4byte @081BC8D8 .4byte @081BCEAE .4byte @081BCEAE .4byte @081BCEAE .4byte @081BCEAE .4byte @081BC908 .4byte @081BC928 .4byte @081BC948 .4byte @081BC968 .4byte @081BC988 .4byte @081BC9A8 .4byte @081BC9C8 .4byte @081BC9E8 .4byte @081BCA08 .4byte @081BCA28 .4byte @081BCA48 .4byte @081BCA68 .4byte @081BCA88 .4byte @081BCAA8 .4byte @081BCAC8 .4byte @081BCB38 .4byte @081BCB58 .4byte @081BCB78 .4byte @081BCB98 .4byte @081BCBB8 .4byte @081BCBD8 .4byte @081BCBF8 .4byte @081BCC18 .4byte @081BCC38 .4byte @081BCC58 .4byte @081BCC78 .4byte @081BCC98 .4byte @081BCCB8 .4byte @081BCCD8 .4byte @081BCCF8 .4byte @081BCD18 .4byte @081BCD38 .4byte @081BCD58 .4byte @081BCD78 .4byte @081BCD98 .4byte @081BCDB8 .4byte @081BCDD8 .4byte @081BCDF8 .4byte @081BCE18 .4byte @081BCE38 .4byte @081BCE58 .4byte @081BCE78 .4byte @081BCE98 @081BC61C: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB adds r2, r6, 0 bl pokemon_setattr adds r2, r6, 0 adds r2, 0x2E adds r0, r4, 0 movs r1, 0xC bl pokemon_setattr movs r0, 0 mov r8, r0 movs r0, 0x3B adds r0, r6 mov r10, r0 adds r0, r6, 0 adds r0, 0x2B str r0, [sp, 0x20] adds r0, 0x19 str r0, [sp, 0x28] adds r0, 0x4 str r0, [sp, 0x2C] adds r0, 0x4 str r0, [sp, 0x30] subs r0, 0x22 str r0, [sp, 0x1C] subs r0, 0x2 str r0, [sp, 0x18] adds r0, 0x4 str r0, [sp, 0x24] adds r0, r6, 0x2 str r0, [sp, 0x4] adds r0, r6, 0x4 str r0, [sp, 0x8] adds r0, r6, 0x6 str r0, [sp, 0xC] adds r0, 0x2 str r0, [sp, 0x10] adds r0, 0x2 str r0, [sp, 0x14] mov r9, r4 adds r7, r6, 0 adds r7, 0x24 adds r4, r6, 0 adds r4, 0xC @081BC682: mov r1, r8 adds r1, 0xD mov r0, r9 adds r2, r4, 0 bl pokemon_setattr mov r1, r8 adds r1, 0x11 mov r0, r9 adds r2, r7, 0 bl pokemon_setattr adds r7, 0x1 adds r4, 0x2 movs r0, 0x1 add r8, r0 mov r0, r8 cmp r0, 0x3 ble @081BC682 movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x15 mov r2, r10 bl pokemon_setattr adds r0, r4, 0 movs r1, 0x20 ldr r2, [sp, 0x20] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x19 ldr r2, [sp, 0x28] bl pokemon_setattr ldrb r0, [r6, 0x14] lsls r0, 27 lsrs r0, 27 mov r1, sp strb r0, [r1] adds r0, r4, 0 movs r1, 0x27 mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x14] lsls r0, 22 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x28 mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x15] lsls r0, 25 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x29 mov r2, sp bl pokemon_setattr mov r1, sp ldr r0, [r6, 0x14] lsls r0, 12 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2A mov r2, sp bl pokemon_setattr mov r1, sp ldrh r0, [r6, 0x16] lsls r0, 23 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2B mov r2, sp bl pokemon_setattr mov r1, sp ldrb r0, [r6, 0x17] lsls r0, 26 lsrs r0, 27 strb r0, [r1] adds r0, r4, 0 movs r1, 0x2C mov r2, sp bl pokemon_setattr adds r0, r4, 0 movs r1, 0 ldr r2, [sp, 0x2C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x37 ldr r2, [sp, 0x30] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 ldr r2, [sp, 0x1C] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x39 ldr r2, [sp, 0x18] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3A ldr r2, [sp, 0x24] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3B ldr r2, [sp, 0x4] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3C ldr r2, [sp, 0x8] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3D ldr r2, [sp, 0xC] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3E ldr r2, [sp, 0x10] bl pokemon_setattr adds r0, r4, 0 movs r1, 0x3F ldr r2, [sp, 0x14] bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC7B4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xB bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC7D4: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0xC bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC7F4: movs r0, 0 mov r8, r0 movs r0, 0xC adds r0, r3 mov r9, r0 movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r7, r1, r0 adds r6, r3, 0 adds r6, 0x8 adds r4, r3, 0 @081BC80E: mov r1, r8 adds r1, 0xD adds r0, r7, 0 adds r2, r4, 0 bl pokemon_setattr mov r1, r8 adds r1, 0x11 adds r0, r7, 0 adds r2, r6, 0 bl pokemon_setattr adds r6, 0x1 adds r4, 0x2 movs r0, 0x1 add r8, r0 mov r0, r8 cmp r0, 0x3 ble @081BC80E movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x15 mov r2, r9 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC84C: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x9 b @081BC8F0 .align 2, 0 .pool @081BC874: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x11 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x12 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x13 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x14 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x15 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC8D8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r3, =0x02023064 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r1, r3, 0x1 adds r1, r2, r1 ldrb r1, [r1] adds r1, 0x8 @081BC8F0: adds r3, 0x3 adds r2, r3 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC908: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC928: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x19 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC948: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1A bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC968: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1B bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC988: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1C bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC9A8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1D bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC9C8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1E bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BC9E8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x1F bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCA08: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x20 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCA28: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x22 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCA48: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x23 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCA68: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x24 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCA88: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x25 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCAA8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x26 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCAC8: movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 ldr r5, =0x02024064 ldrb r2, [r5] lsls r2, 9 adds r2, r7 adds r0, r4, 0 movs r1, 0x27 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x1 adds r2, r0 adds r0, r4, 0 movs r1, 0x28 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x2 adds r2, r0 adds r0, r4, 0 movs r1, 0x29 bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x3 adds r2, r0 adds r0, r4, 0 movs r1, 0x2A bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x4 adds r2, r0 adds r0, r4, 0 movs r1, 0x2B bl pokemon_setattr ldrb r2, [r5] lsls r2, 9 adds r0, r7, 0x5 adds r2, r0 adds r0, r4, 0 b @081BCBE8 .align 2, 0 .pool @081BCB38: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x27 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCB58: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x28 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCB78: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x29 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCB98: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2A bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCBB8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2B bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCBD8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 @081BCBE8: movs r1, 0x2C bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCBF8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCC18: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x9 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCC38: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x37 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCC58: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x38 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCC78: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x39 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCC98: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3A bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCCB8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3B bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCCD8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3C bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCCF8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3D bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCD18: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3E bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCD38: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x3F bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCD58: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x16 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCD78: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x17 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCD98: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x18 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCDB8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x21 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCDD8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x2F bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCDF8: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x30 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCE18: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x32 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCE38: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x33 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCE58: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x34 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCE78: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x35 bl pokemon_setattr b @081BCEAE .align 2, 0 .pool @081BCE98: movs r0, 0x64 muls r0, r5 ldr r1, =0x020244ec adds r0, r1 ldr r1, =0x02024064 ldrb r2, [r1] lsls r2, 9 adds r2, r7 movs r1, 0x36 bl pokemon_setattr @081BCEAE: ldr r2, =0x0202406e ldr r0, =0x02024064 ldrb r1, [r0] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 add sp, 0x34 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BC4E8 thumb_func_start sub_81BCEE4 sub_81BCEE4: ; 81BCEE4 push {r4-r7,lr} ldr r1, =0x0202406e ldr r7, =0x02024064 ldrb r2, [r7] lsls r0, r2, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 adds r3, r1, 0 muls r3, r0 ldr r4, =0x02023064 lsls r2, 9 adds r0, r4, 0x1 adds r0, r2, r0 ldrb r0, [r0] ldr r1, =0x020244ec adds r0, r1 adds r5, r3, r0 movs r3, 0 adds r0, r4, 0x2 adds r2, r0 ldrb r2, [r2] cmp r3, r2 bcs @081BCF3C adds r6, r4, 0 adds r2, r7, 0 adds r4, r0, 0 @081BCF1A: adds r1, r5, r3 ldrb r0, [r2] lsls r0, 9 adds r0, 0x3 adds r0, r3, r0 adds r0, r6 ldrb r0, [r0] strb r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 ldrb r0, [r2] lsls r0, 9 adds r0, r4 ldrb r0, [r0] cmp r3, r0 bcc @081BCF1A @081BCF3C: bl dp01_tbl3_exec_completed pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BCEE4 thumb_func_start sub_81BCF58 sub_81BCF58: ; 81BCF58 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =0x0202406e mov r8, r0 ldr r6, =0x02024064 ldrb r1, [r6] lsls r0, r1, 1 add r0, r8 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 bl sub_805DD7C ldrb r0, [r6] lsls r0, 1 add r0, r8 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0xB bl pokemon_getattr adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl sub_806A068 ldr r0, =0x0202499c mov r8, r0 ldrb r0, [r6] movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldrb r0, [r6] bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldrb r0, [r6] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r8 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 ldrb r1, [r6] adds r1, r4 strb r0, [r1] ldr r5, =0x02020630 ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ff10 strh r1, [r0, 0x24] ldrb r2, [r6] adds r0, r2, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x2E] ldrb r3, [r6] adds r0, r3, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r2, [r6] adds r4, r2, r4 ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r2, r1 ldrb r1, [r2] bl obj_anim_image_start ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BB1D4 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BCF58 thumb_func_start sub_81BD074 sub_81BD074: ; 81BD074 push {r4-r6,lr} ldr r5, =0x02024064 ldrb r0, [r5] ldr r4, =0x02023064 lsls r1, r0, 9 adds r6, r4, 0x2 adds r1, r6 ldrb r1, [r1] bl sub_805EF84 ldr r2, =0x0202406e ldrb r0, [r5] lsls r1, r0, 1 adds r1, r2 lsls r0, 9 adds r4, 0x1 adds r0, r4 ldrb r0, [r0] strh r0, [r1] ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805DD7C ldrb r0, [r5] lsls r1, r0, 9 adds r1, r6 ldrb r1, [r1] bl sub_81BD0E4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BBAE8 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BD074 thumb_func_start sub_81BD0E4 sub_81BD0E4: ; 81BD0E4 push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} adds r6, r0, 0 lsls r6, 24 lsrs r6, 24 lsls r1, 24 lsrs r1, 24 adds r0, r6, 0 bl sub_805EF84 ldr r0, =0x0202406e lsls r2, r6, 1 adds r2, r0 ldr r0, =0x02023064 lsls r1, r6, 9 adds r0, 0x1 adds r1, r0 ldrb r0, [r1] strh r0, [r2] ldrh r1, [r2] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr mov r8, r0 lsls r0, 16 lsrs r0, 16 mov r8, r0 ldr r0, =sub_805D714 bl object_new_hidden_with_callback ldr r1, =0x03005d7c mov r9, r1 add r9, r6 mov r1, r9 strb r0, [r1] adds r0, r6, 0 bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 mov r0, r8 bl sub_806A068 ldr r0, =0x0202499c mov r10, r0 adds r0, r6, 0 movs r1, 0x2 bl sub_80A5C6C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 adds r0, r6, 0 bl sub_80A6138 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r6, 0 bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r10 adds r1, r5, 0 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 adds r4, r6, r4 strb r0, [r4] ldr r5, =0x02020630 mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrb r1, [r4] strh r1, [r0, 0x30] mov r0, r9 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x32] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r6, [r0, 0x2E] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 mov r1, r8 strh r1, [r0, 0x32] ldrb r0, [r4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 lsls r3, r6, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x020244e4 adds r6, r1 ldrb r1, [r6] bl 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, =nullsub_12 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 .pool thumb_func_end sub_81BD0E4 thumb_func_start sub_81BD260 sub_81BD260: ; 81BD260 push {r4-r6,lr} ldr r1, =0x02023064 ldr r6, =0x02024064 ldrb r2, [r6] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r3, [r0] cmp r3, 0 bne @081BD2A8 ldr r0, =0x020244d0 ldr r0, [r0] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BD2F0 str r1, [r0] b @081BD2DE .align 2, 0 .pool @081BD2A8: ldr r5, =0x020241e4 adds r0, r2, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r0, [r6] adds r0, r5 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles ldr r1, =0x03005d70 ldrb r0, [r6] adds r0, r1 ldrb r0, [r0] bl sub_8072984 bl dp01_tbl3_exec_completed @081BD2DE: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BD260 thumb_func_start sub_81BD2F0 sub_81BD2F0: ; 81BD2F0 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r1, [r4, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r3, r0, r1 ldrb r0, [r3, 0x4] cmp r0, 0 beq @081BD318 cmp r0, 0x1 beq @081BD346 b @081BD36E .align 2, 0 .pool @081BD318: ldr r1, [r4] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @081BD332 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @081BD332: ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strb r1, [r0, 0x4] b @081BD36E @081BD346: ldrb r1, [r3] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @081BD36E strb r0, [r3, 0x4] ldrb r2, [r5] adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x1 bl move_anim_start_t4 ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BB828 str r1, [r0] @081BD36E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BD2F0 thumb_func_start sub_81BD37C sub_81BD37C: ; 81BD37C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r2, =0x02038bce ldrh r1, [r2] ldr r0, =0x00000c03 cmp r1, r0 bne @081BD3A8 movs r4, 0x7 movs r0, 0x5A mov r9, r0 ldr r0, =gUnknown_08305D2C ldrb r1, [r0, 0x1C] b @081BD3BE .align 2, 0 .pool @081BD3A8: ldrh r0, [r2] bl sub_8162AA0 lsls r0, 24 lsrs r4, r0, 24 movs r0, 0x20 mov r9, r0 ldr r1, =gUnknown_083054E0 lsls r0, r4, 2 adds r0, r1 ldrb r1, [r0] @081BD3BE: movs r0, 0x8 subs r0, r1 lsls r0, 18 movs r1, 0xA0 lsls r1, 15 adds r0, r1 lsrs r7, r0, 16 ldr r0, =0x02038bce ldrh r1, [r0] ldr r0, =0x00000c03 cmp r1, r0 bne @081BD494 ldr r5, =0x02024064 ldrb r1, [r5] adds r0, r4, 0 bl sub_805DF84 ldrb r0, [r5] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl template_build_for_pokemon_or_trainer ldr r6, =0x0202499c mov r8, r9 lsls r4, r7, 16 asrs r4, 16 ldrb r0, [r5] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 adds r0, r6, 0 mov r1, r8 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r6, =0x020241e4 ldrb r1, [r5] adds r1, r6 strb r0, [r1] ldr r4, =0x02020630 ldrb r3, [r5] adds r0, r3, r6 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 lsls r3, 4 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r3 strb r0, [r1, 0x5] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0xF0 strh r1, [r0, 0x24] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r4, 0x1C adds r0, r4 ldr r1, =sub_805D7AC str r1, [r0] b @081BD57C .align 2, 0 .pool @081BD494: adds r5, r4, 0 ldr r6, =0x02024064 ldrb r1, [r6] adds r0, r5, 0 bl sub_805DF38 ldrb r0, [r6] bl battle_get_per_side_status adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r5, 0 bl sub_806A1C0 ldr r0, =0x0202499c mov r8, r0 lsls r4, r7, 16 asrs r4, 16 ldrb r0, [r6] bl sub_80A82E4 adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 mov r0, r8 mov r1, r9 adds r2, r4, 0 bl obj_add_from_template_forward_search ldr r4, =0x020241e4 ldrb r1, [r6] adds r1, r4 strb r0, [r1] ldr r0, =gTrainerPaletteTable lsls r5, 3 adds r5, r0 ldrh r0, [r5, 0x4] bl gpu_pal_tags_index_of ldr r5, =0x02020630 ldrb r1, [r6] adds r1, r4 ldrb r1, [r1] lsls r2, r1, 4 adds r2, r1 lsls r2, 2 adds r2, r5 lsls r0, 4 ldrb r3, [r2, 0x5] movs r1, 0xF ands r1, r3 orrs r1, r0 strb r1, [r2, 0x5] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0xF0 strh r1, [r0, 0x24] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x30 strh r1, [r0, 0x26] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000fffe strh r1, [r0, 0x2E] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_805D7AC str r1, [r0] ldrb r0, [r6] adds r0, r4 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 ldrb r2, [r1, 0x1] movs r0, 0x4 negs r0, r0 ands r0, r2 strb r0, [r1, 0x1] ldrb r0, [r6] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 adds r0, 0x3F ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] @081BD57C: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BAE60 str r1, [r0] pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BD37C thumb_func_start sub_81BD5BC sub_81BD5BC: ; 81BD5BC push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BD5BC thumb_func_start sub_81BD5C8 sub_81BD5C8: ; 81BD5C8 push {r4-r6,lr} ldr r6, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r0, r5 bl oamt_add_pos2_onto_pos1 ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x23 strh r1, [r0, 0x2E] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =0x0000ffd8 strh r1, [r0, 0x32] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r5, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r0, [r4] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldr r1, =nullsub_12 bl oamt_set_x3A_32 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BAE98 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BD5C8 thumb_func_start sub_81BD674 sub_81BD674: ; 81BD674 push {r4-r6,lr} ldr r6, =0x020244d0 ldr r4, [r6] ldr r5, =0x02024064 ldrb r2, [r5] ldr r0, [r4, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r3, r1, r0 ldrb r0, [r3, 0x4] cmp r0, 0 bne @081BD6C8 ldr r1, [r4] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @081BD6A8 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @081BD6A8: ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x4] adds r1, 0x1 strb r1, [r0, 0x4] b @081BD73E .align 2, 0 .pool @081BD6C8: ldrb r1, [r3] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @081BD73E strb r4, [r3, 0x4] ldr r2, =0x0202406e ldrb r1, [r5] lsls r0, r1, 1 adds r0, r2 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805E990 movs r1, 0x40 negs r1, r1 movs r0, 0x10 bl audio_play_and_stuff ldr r2, =0x02020630 ldr r3, =0x020241e4 ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r4, [r0, 0x30] ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x5 strh r1, [r0, 0x32] ldrb r0, [r5] adds r0, r3 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_8039C00 str r1, [r0] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BB78C str r1, [r0] @081BD73E: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BD674 thumb_func_start sub_81BD760 sub_81BD760: ; 81BD760 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BD760 thumb_func_start sub_81BD76C sub_81BD76C: ; 81BD76C push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BD76C thumb_func_start sub_81BD778 sub_81BD778: ; 81BD778 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BD778 thumb_func_start sub_81BD784 sub_81BD784: ; 81BD784 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BD784 thumb_func_start sub_81BD790 sub_81BD790: ; 81BD790 push {r4-r6,lr} ldr r6, =0x02024064 ldrb r0, [r6] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 beq @081BD7A2 b @081BD8B6 @081BD7A2: ldr r0, =0x02023064 mov r12, r0 ldrb r2, [r6] lsls r2, 9 adds r0, 0x1 adds r0, r2, r0 ldrb r0, [r0] mov r1, r12 adds r1, 0x2 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 ldr r5, =0x02038432 mov r1, r12 adds r1, 0x3 adds r2, r1 ldrb r1, [r2] strb r1, [r5] ldr r4, =0x02038408 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x4 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x5 adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r4, =0x02038404 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x6 adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0x7 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 8 orrs r3, r1 mov r1, r12 adds r1, 0x8 adds r1, r2, r1 ldrb r1, [r1] lsls r1, 16 orrs r3, r1 mov r1, r12 adds r1, 0x9 adds r2, r1 ldrb r1, [r2] lsls r1, 24 orrs r3, r1 str r3, [r4] ldr r3, =0x0203841a ldrb r1, [r6] lsls r1, 9 mov r2, r12 adds r2, 0xA adds r1, r2 ldrb r1, [r1] strb r1, [r3] ldr r4, =0x0203841c ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0xC adds r1, r2, r1 ldrb r3, [r1] mov r1, r12 adds r1, 0xD adds r2, r1 ldrb r1, [r2] lsls r1, 8 orrs r3, r1 strh r3, [r4] ldr r3, =0x02038400 ldrb r2, [r6] lsls r2, 9 mov r1, r12 adds r1, 0x10 adds r2, r1 str r2, [r3] ldr r3, =0x020244bc ldrb r1, [r6] lsls r1, 2 adds r1, r3 ldr r2, [r2] str r2, [r1] ldrb r1, [r5] bl sub_805DB8C lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0 beq @081BD898 bl dp01_tbl3_exec_completed b @081BD8B6 .align 2, 0 .pool @081BD898: ldr r0, =0x020244d0 ldr r0, [r0] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x4] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =bx_move_anim_3 str r1, [r0] @081BD8B6: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BD790 thumb_func_start bx_move_anim_3 bx_move_anim_3: ; 81BD8C8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r2, =0x02023064 ldr r6, =0x02024064 ldrb r3, [r6] lsls r1, r3, 9 adds r0, r2, 0x1 mov r10, r0 adds r0, r1, r0 ldrb r4, [r0] adds r5, r2, 0x2 mov r9, r5 adds r0, r1, r5 ldrb r0, [r0] lsls r0, 8 orrs r4, r0 adds r2, 0xB adds r1, r2 ldrb r1, [r1] mov r8, r1 ldr r7, =0x020244d0 ldr r5, [r7] ldr r1, [r5, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r2, [r0, 0x4] cmp r2, 0x1 beq @081BD960 cmp r2, 0x1 bgt @081BD920 cmp r2, 0 beq @081BD92A b @081BDA3C .align 2, 0 .pool @081BD920: cmp r2, 0x2 beq @081BD98A cmp r2, 0x3 beq @081BDA00 b @081BDA3C @081BD92A: ldr r1, [r5] lsls r0, r3, 2 adds r1, r0, r1 ldrb r2, [r1] movs r0, 0xC ands r0, r2 cmp r0, 0x4 bne @081BD94C movs r0, 0x8 orrs r0, r2 strb r0, [r1] ldrb r2, [r6] adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x5 bl move_anim_start_t4 @081BD94C: ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strb r1, [r0, 0x4] b @081BDA3C @081BD960: ldrb r1, [r0] movs r0, 0x40 ands r0, r1 cmp r0, 0 bne @081BDA3C movs r0, 0 bl sub_805EB9C adds r0, r4, 0 bl move_anim_start_t1 ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x2 strb r1, [r0, 0x4] b @081BDA3C @081BD98A: ldr r0, =0x020383f8 ldr r0, [r0] bl _call_via_r0 ldr r0, =0x020383fd ldrb r0, [r0] cmp r0, 0 bne @081BDA3C movs r0, 0x1 bl sub_805EB9C ldr r0, [r7] ldrb r2, [r6] ldr r1, [r0] lsls r0, r2, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @081BD9D8 mov r0, r8 cmp r0, 0x1 bhi @081BD9D8 adds r0, r2, 0 adds r1, r2, 0 movs r3, 0x6 bl move_anim_start_t4 ldr r0, [r7] ldrb r1, [r6] ldr r0, [r0] lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x9 negs r0, r0 ands r0, r2 strb r0, [r1] @081BD9D8: ldr r0, =0x020244d0 ldr r2, [r0] ldr r0, =0x02024064 ldrb r1, [r0] ldr r2, [r2, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strb r1, [r0, 0x4] b @081BDA3C .align 2, 0 .pool @081BDA00: ldrb r1, [r0] movs r0, 0x40 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @081BDA3C bl sub_805E394 ldrb r0, [r6] lsls r2, r0, 9 mov r3, r10 adds r1, r2, r3 ldrb r1, [r1] add r2, r9 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 bl sub_805E94C ldr r0, [r7] ldrb r1, [r6] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r4, [r0, 0x4] bl dp01_tbl3_exec_completed @081BDA3C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end bx_move_anim_3 thumb_func_start sub_81BDA4C sub_81BDA4C: ; 81BDA4C push {r4,lr} ldr r0, =0x02022e14 movs r1, 0 strh r1, [r0] ldr r0, =0x02022e16 strh r1, [r0] ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 ldr r1, =0x02023066 adds r0, r1 ldrh r0, [r0] bl battle_pick_message ldr r0, =0x02022e2c movs r1, 0 bl battle_show_message_maybe ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BB898 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDA4C thumb_func_start sub_81BDAA0 sub_81BDAA0: ; 81BDAA0 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDAA0 thumb_func_start sub_81BDAAC sub_81BDAAC: ; 81BDAAC push {lr} bl sub_8063880 bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDAAC thumb_func_start sub_81BDABC sub_81BDABC: ; 81BDABC push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDABC thumb_func_start sub_81BDAC8 sub_81BDAC8: ; 81BDAC8 push {r4-r6,lr} ldr r6, =0x02024064 ldrb r4, [r6] lsls r4, 9 ldr r0, =0x02023068 adds r4, r0 movs r0, 0xF bl sub_8130950 bl sub_8130BA4 lsls r0, 24 lsrs r5, r0, 24 ldr r2, =gBattleMoves lsls r0, r5, 1 adds r4, r0 ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x6] movs r0, 0x12 ands r0, r1 cmp r0, 0 beq @081BDB02 ldr r1, =0x0202420c ldrb r0, [r6] strb r0, [r1] @081BDB02: ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x6] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @081BDB3C movs r0, 0x1 bl battle_get_side_with_given_state ldr r4, =0x0202420c strb r0, [r4] ldr r0, =0x02024210 ldrb r1, [r0] ldr r2, =gUnknown_0832A328 ldrb r0, [r4] lsls r0, 2 adds r0, r2 ldr r0, [r0] ands r1, r0 cmp r1, 0 beq @081BDB3C movs r0, 0x3 bl battle_get_side_with_given_state strb r0, [r4] @081BDB3C: ldr r0, =0x0202420c ldrb r2, [r0] lsls r2, 8 orrs r2, r5 movs r0, 0x1 movs r1, 0xA bl dp01_build_cmdbuf_x21_a_bb bl dp01_tbl3_exec_completed pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDAC8 thumb_func_start sub_81BDB70 sub_81BDB70: ; 81BDB70 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDB70 thumb_func_start sub_81BDB7C sub_81BDB7C: ; 81BDB7C push {r4-r6,lr} bl sub_8063A90 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x6 bne @081BDBD0 movs r0, 0 bl battle_get_side_with_given_state lsls r0, 24 lsrs r6, r0, 24 movs r0, 0x2 bl battle_get_side_with_given_state lsls r0, 24 lsrs r5, r0, 24 movs r4, 0x3 b @081BDBA4 @081BDBA2: adds r4, 0x1 @081BDBA4: cmp r4, 0x5 bgt @081BDBD0 movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x39 bl pokemon_getattr cmp r0, 0 beq @081BDBA2 ldr r1, =0x0202406e lsls r0, r6, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 beq @081BDBA2 lsls r0, r5, 1 adds r0, r1 ldrh r0, [r0] cmp r4, r0 beq @081BDBA2 @081BDBD0: ldr r0, =0x02024064 ldrb r0, [r0] ldr r1, =0x0202449c ldr r1, [r1] adds r0, r1 adds r0, 0x5C strb r4, [r0] lsls r1, r4, 24 lsrs r1, 24 movs r0, 0x1 movs r2, 0 bl dp01_build_cmdbuf_x22_a_three_bytes bl dp01_tbl3_exec_completed pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDB7C thumb_func_start sub_81BDC04 sub_81BDC04: ; 81BDC04 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDC04 thumb_func_start sub_81BDC10 sub_81BDC10: ; 81BDC10 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 movs r0, 0 bl load_gfxc_health_bar ldr r3, =0x02023064 ldr r0, =0x02024064 mov r9, r0 ldrb r4, [r0] lsls r2, r4, 9 adds r0, r3, 0x2 adds r0, r2, r0 ldrb r1, [r0] adds r3, 0x3 adds r2, r3 ldrb r0, [r2] lsls r0, 8 orrs r1, r0 lsls r1, 16 asrs r7, r1, 16 ldr r0, =0x00007fff cmp r7, r0 beq @081BDCA0 ldr r6, =0x0202406e lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] movs r5, 0x64 muls r0, r5 ldr r4, =0x020244ec adds r0, r4 movs r1, 0x3A bl pokemon_getattr mov r8, r0 mov r1, r9 ldrb r0, [r1] lsls r0, 1 adds r0, r6 ldrh r0, [r0] muls r0, r5 adds r0, r4 movs r1, 0x39 bl pokemon_getattr adds r3, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] mov r2, r8 bl sub_807294C b @081BDCCA .align 2, 0 .pool @081BDCA0: ldr r1, =0x0202406e lsls r0, r4, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x3A bl pokemon_getattr adds r2, r0, 0 mov r1, r9 ldrb r0, [r1] ldr r1, =0x03005d70 adds r1, r0, r1 ldrb r1, [r1] str r7, [sp] movs r3, 0 bl sub_807294C @081BDCCA: ldr r1, =0x03005d60 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, =bx_t3_healthbar_update str r1, [r0] add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDC10 thumb_func_start sub_81BDD00 sub_81BDD00: ; 81BDD00 push {r4-r7,lr} ldr r5, =0x02023064 ldr r6, =0x02024064 ldrb r0, [r6] lsls r0, 9 adds r1, r5, 0x1 adds r0, r1 ldrb r7, [r0] movs r0, 0x64 adds r1, r7, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr cmp r0, 0x63 bls @081BDD38 bl dp01_tbl3_exec_completed b @081BDD84 .align 2, 0 .pool @081BDD38: movs r0, 0x1 bl load_gfxc_health_bar adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr ldrb r1, [r6] lsls r1, 9 adds r0, r5, 0x2 adds r0, r1, r0 ldrb r4, [r0] adds r0, r5, 0x3 adds r1, r0 ldrb r0, [r1] lsls r0, 8 orrs r4, r0 ldr r0, =sub_81BB29C movs r1, 0xA bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r7, [r1, 0x8] strh r4, [r1, 0xA] ldrb r0, [r6] strh r0, [r1, 0xC] ldr r1, =0x03005d60 ldrb r0, [r6] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_21 str r1, [r0] @081BDD84: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDD00 thumb_func_start sub_81BDD9C sub_81BDD9C: ; 81BDD9C push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @081BDDF0 ldr r0, =0x03005d70 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] ldr r2, =0x0202406e lsls r1, 1 adds r1, r2 ldrh r2, [r1] movs r1, 0x64 muls r1, r2 ldr r2, =0x020244ec adds r1, r2 movs r2, 0x9 bl healthbar_draw_field_maybe ldrb r2, [r4] ldr r0, =0x020244d0 ldr r0, [r0] ldr r0, [r0, 0x4] lsls r1, r2, 1 adds r1, r2 lsls r1, 2 adds r1, r0 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BBC04 str r1, [r0] @081BDDF0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDD9C thumb_func_start sub_81BDE14 sub_81BDE14: ; 81BDE14 push {r4,r5,lr} ldr r5, =0x02024064 ldrb r0, [r5] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @081BDE64 ldr r4, =0x02023064 ldrb r3, [r5] lsls r3, 9 adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] adds r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 8 orrs r1, r2 adds r2, r4, 0x4 adds r2, r3, r2 ldrb r2, [r2] lsls r2, 16 orrs r1, r2 adds r4, 0x5 adds r3, r4 ldrb r2, [r3] lsls r2, 24 orrs r1, r2 bl move_anim_start_t2_for_situation ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BBC04 str r1, [r0] @081BDE64: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDE14 thumb_func_start sub_81BDE7C sub_81BDE7C: ; 81BDE7C push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDE7C thumb_func_start sub_81BDE88 sub_81BDE88: ; 81BDE88 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDE88 thumb_func_start sub_81BDE94 sub_81BDE94: ; 81BDE94 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDE94 thumb_func_start sub_81BDEA0 sub_81BDEA0: ; 81BDEA0 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDEA0 thumb_func_start sub_81BDEAC sub_81BDEAC: ; 81BDEAC push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDEAC thumb_func_start sub_81BDEB8 sub_81BDEB8: ; 81BDEB8 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDEB8 thumb_func_start sub_81BDEC4 sub_81BDEC4: ; 81BDEC4 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDEC4 thumb_func_start sub_81BDED0 sub_81BDED0: ; 81BDED0 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDED0 thumb_func_start sub_81BDEDC sub_81BDEDC: ; 81BDEDC push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDEDC thumb_func_start sub_81BDEE8 sub_81BDEE8: ; 81BDEE8 push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x80 negs r0, r0 ands r0, r1 strb r0, [r2] bl dp01_tbl3_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDEE8 thumb_func_start sub_81BDF04 sub_81BDF04: ; 81BDF04 push {lr} ldr r3, =0x02022d0c ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] movs r1, 0x7F ands r1, r0 ldrb r2, [r3] movs r0, 0x80 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3] bl dp01_tbl3_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDF04 thumb_func_start sub_81BDF3C sub_81BDF3C: ; 81BDF3C push {lr} ldr r2, =0x02022d0c ldrb r1, [r2] movs r0, 0x7F ands r0, r1 strb r0, [r2] bl dp01_tbl3_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDF3C thumb_func_start sub_81BDF54 sub_81BDF54: ; 81BDF54 push {lr} ldr r3, =0x02022d0c ldr r1, [r3] lsls r1, 24 lsrs r1, 31 movs r0, 0x1 eors r1, r0 lsls r1, 7 ldrb r2, [r3] movs r0, 0x7F ands r0, r2 orrs r0, r1 strb r0, [r3] bl dp01_tbl3_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDF54 thumb_func_start dp01t_29_3_blink dp01t_29_3_blink: ; 81BDF7C push {r4,lr} ldr r3, =0x02020630 ldr r2, =0x020241e4 ldr r4, =0x02024064 ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 bge @081BDFB0 bl dp01_tbl3_exec_completed b @081BDFDA .align 2, 0 .pool @081BDFB0: ldr r1, =0x020244b9 movs r0, 0x1 strb r0, [r1] ldrb r0, [r4] adds r0, r2 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0 strh r1, [r0, 0x30] ldrb r0, [r4] bl sub_80769F4 ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =bx_blink_t3 str r1, [r0] @081BDFDA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_29_3_blink thumb_func_start sub_81BDFEC sub_81BDFEC: ; 81BDFEC push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BDFEC thumb_func_start sub_81BDFF8 sub_81BDFF8: ; 81BDFF8 push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl battle_side_get_owner lsls r0, 24 movs r3, 0x3F cmp r0, 0 bne @081BE00C movs r3, 0xC0 @081BE00C: ldr r2, =0x02023064 ldrb r1, [r4] lsls r1, 9 adds r0, r2, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 lsls r1, r3, 24 asrs r1, 24 bl audio_play_and_stuff bl dp01_tbl3_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BDFF8 thumb_func_start sub_81BE03C sub_81BE03C: ; 81BE03C push {r4,r5,lr} ldr r4, =0x02023064 ldr r5, =0x02024064 ldrb r0, [r5] lsls r3, r0, 9 adds r0, r4, 0x3 adds r0, r3, r0 ldrb r0, [r0] cmp r0, 0 beq @081BE078 bl sub_805EA60 ldrb r1, [r5] lsls r1, 9 adds r0, r4, 0x1 adds r0, r1, r0 ldrb r0, [r0] adds r2, r4, 0x2 adds r1, r2 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl song_play_for_text b @081BE08C .align 2, 0 .pool @081BE078: adds r0, r4, 0x1 adds r0, r3, r0 ldrb r0, [r0] adds r1, r4, 0x2 adds r1, r3, r1 ldrb r1, [r1] lsls r1, 8 orrs r0, r1 bl fanfare_play @081BE08C: bl dp01_tbl3_exec_completed pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81BE03C thumb_func_start sub_81BE098 sub_81BE098: ; 81BE098 push {lr} ldr r1, =0x0202406e ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 1 adds r0, r1 ldrh r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0xB bl pokemon_getattr lsls r0, 16 lsrs r0, 16 movs r1, 0x19 negs r1, r1 movs r2, 0x5 bl sub_80A32E4 bl dp01_tbl3_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE098 thumb_func_start dp01t_2E_3_battle_intro dp01t_2E_3_battle_intro: ; 81BE0D8 push {lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r0, [r0] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] bl battle_intro_launch ldr r2, =0x020243fc ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] bl dp01_tbl3_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_2E_3_battle_intro thumb_func_start sub_81BE10C sub_81BE10C: ; 81BE10C push {r4-r6,lr} ldr r6, =0x020241e4 ldr r5, =0x02024064 ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl oamt_add_pos2_onto_pos1 ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x32 strh r1, [r0, 0x2E] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =0x0000ffd8 strh r1, [r0, 0x32] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldrh r1, [r0, 0x22] strh r1, [r0, 0x36] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_80A6EEC str r1, [r0] ldrb r2, [r5] adds r0, r2, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r2, [r0, 0x38] ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 ldr r1, =sub_805CC00 bl oamt_set_x3A_32 ldrb r0, [r5] adds r0, r6 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 movs r1, 0x1 bl obj_anim_image_start ldr r0, =0x0000d6f9 bl gpu_pal_alloc_new lsls r0, 24 lsrs r4, r0, 24 ldr r2, =0x02038bce ldrh r1, [r2] ldr r0, =0x00000c03 cmp r1, r0 bne @081BE1FC ldr r0, =gTrainerBackPicPaletteTable ldr r0, [r0, 0x38] lsls r4, 4 movs r2, 0x80 lsls r2, 1 adds r1, r4, r2 movs r2, 0x20 bl decompress_palette b @081BE21A .align 2, 0 .pool @081BE1FC: ldrh r0, [r2] bl sub_8162AA0 lsls r0, 24 ldr r1, =gTrainerPaletteTable lsrs r0, 21 adds r0, r1 ldr r0, [r0] lsls r4, 4 movs r2, 0x80 lsls r2, 1 adds r1, r4, r2 movs r2, 0x20 bl decompress_palette @081BE21A: ldr r2, =0x02020630 ldr r1, =0x020241e4 ldr r5, =0x02024064 ldrb r0, [r5] adds r0, r1 ldrb r0, [r0] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 ldrb r2, [r1, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r4 strb r0, [r1, 0x5] ldr r0, =sub_81BE2C8 movs r1, 0x5 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r4, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r4 ldrb r0, [r5] strh r0, [r1, 0x8] ldr r3, =0x020244d0 ldr r0, [r3] ldrb r2, [r5] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081BE27E ldr r0, =0x020244b4 adds r0, r2, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r4 ldr r1, =sub_8073C30 str r1, [r0] @081BE27E: ldr r0, [r3] ldr r2, [r0, 0x8] ldrb r0, [r2, 0x9] movs r1, 0x1 orrs r0, r1 strb r0, [r2, 0x9] ldr r1, =0x03005d60 ldrb r0, [r5] lsls r0, 2 adds r0, r1 ldr r1, =nullsub_77 str r1, [r0] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE10C thumb_func_start sub_81BE2C8 sub_81BE2C8: ; 81BE2C8 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r1, =0x03005e00 lsls r0, 2 add r0, r8 lsls r0, 3 adds r1, r0, r1 ldrh r2, [r1, 0xA] movs r3, 0xA ldrsh r0, [r1, r3] cmp r0, 0x17 bgt @081BE2F4 adds r0, r2, 0x1 strh r0, [r1, 0xA] b @081BE3B0 .align 2, 0 .pool @081BE2F4: ldr r7, =0x02024064 ldrb r0, [r7] mov r9, r0 ldrh r0, [r1, 0x8] strb r0, [r7] bl battle_type_is_double lsls r0, 24 cmp r0, 0 beq @081BE314 ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x40 ands r0, r1 cmp r0, 0 beq @081BE344 @081BE314: ldr r0, =0x02023064 ldrb r1, [r7] lsls r2, r1, 9 adds r0, 0x1 adds r2, r0 ldr r0, =0x0202406e lsls r1, 1 adds r1, r0 ldrh r0, [r1] strb r0, [r2] ldrb r0, [r7] movs r1, 0 bl sub_81BD0E4 b @081BE398 .align 2, 0 .pool @081BE344: ldr r4, =0x02023064 ldrb r0, [r7] lsls r1, r0, 9 adds r4, 0x1 adds r1, r4 ldr r5, =0x0202406e lsls r0, 1 adds r0, r5 ldrh r0, [r0] strb r0, [r1] ldrb r0, [r7] movs r1, 0 bl sub_81BD0E4 ldrb r0, [r7] movs r6, 0x2 eors r0, r6 strb r0, [r7] ldrb r0, [r7] lsls r1, r0, 9 adds r1, r4 lsls r0, 1 adds r0, r5 ldrh r0, [r0] strb r0, [r1] ldrb r1, [r7] lsls r0, r1, 1 adds r0, r5 ldrh r2, [r0] movs r0, 0x64 muls r0, r2 ldr r2, =0x020244ec adds r0, r2 bl sub_805DD7C ldrb r0, [r7] movs r1, 0 bl sub_81BD0E4 ldrb r0, [r7] eors r0, r6 strb r0, [r7] @081BE398: ldr r1, =0x03005d60 ldr r2, =0x02024064 ldrb r0, [r2] lsls r0, 2 adds r0, r1 ldr r1, =sub_81BB02C str r1, [r0] mov r3, r9 strb r3, [r2] mov r0, r8 bl remove_task @081BE3B0: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE2C8 thumb_func_start dp01t_30_3_80EB11C dp01t_30_3_80EB11C: ; 81BE3D4 push {r4-r6,lr} ldr r1, =0x02023064 ldr r0, =0x02024064 ldrb r2, [r0] lsls r0, r2, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @081BE404 adds r0, r2, 0 bl battle_side_get_owner lsls r0, 24 cmp r0, 0 bne @081BE404 bl dp01_tbl3_exec_completed b @081BE478 .align 2, 0 .pool @081BE404: ldr r6, =0x020244d0 ldr r0, [r6] ldr r5, =0x02024064 ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] ldrb r0, [r5] lsls r3, r0, 9 ldr r4, =0x02023068 adds r1, r3, r4 subs r2, r4, 0x3 adds r2, r3, r2 ldrb r2, [r2] subs r4, 0x2 adds r3, r4 ldrb r3, [r3] bl sub_80735DC ldr r2, =0x020244b4 ldrb r1, [r5] adds r1, r2 movs r3, 0 strb r0, [r1] ldr r0, [r6] ldrb r1, [r5] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 strb r3, [r0, 0x5] ldrb r2, [r5] lsls r0, r2, 9 adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @081BE46C ldr r0, [r6] ldr r1, [r0, 0x4] lsls r0, r2, 1 adds r0, r2 lsls r0, 2 adds r0, r1 movs r1, 0x5D strb r1, [r0, 0x5] @081BE46C: ldr r0, =0x03005d60 ldrb r1, [r5] lsls r1, 2 adds r1, r0 ldr r0, =sub_81BE498 str r0, [r1] @081BE478: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end dp01t_30_3_80EB11C thumb_func_start sub_81BE498 sub_81BE498: ; 81BE498 push {r4,lr} ldr r4, =0x020244d0 ldr r0, [r4] ldr r3, =0x02024064 ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r1, [r0, 0x5] adds r2, r1, 0x1 strb r2, [r0, 0x5] lsls r1, 24 lsrs r1, 24 cmp r1, 0x5C bls @081BE4D0 ldr r0, [r4] ldrb r1, [r3] ldr r2, [r0, 0x4] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strb r1, [r0, 0x5] bl dp01_tbl3_exec_completed @081BE4D0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE498 thumb_func_start sub_81BE4E0 sub_81BE4E0: ; 81BE4E0 push {lr} ldr r0, =0x020244d0 ldr r1, [r0] ldr r0, =0x02024064 ldrb r3, [r0] ldr r1, [r1, 0x4] lsls r0, r3, 1 adds r0, r3 lsls r0, 2 adds r0, r1 ldrb r1, [r0] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081BE512 ldr r2, =0x03005e00 ldr r0, =0x020244b4 adds r0, r3, r0 ldrb r1, [r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, =sub_8073C30 str r1, [r0] @081BE512: bl dp01_tbl3_exec_completed pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE4E0 thumb_func_start sub_81BE530 sub_81BE530: ; 81BE530 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BE530 thumb_func_start sub_81BE53C sub_81BE53C: ; 81BE53C push {r4,lr} ldr r4, =0x02024064 ldrb r0, [r4] bl sub_80A6A90 lsls r0, 24 cmp r0, 0 beq @081BE582 ldr r3, =0x02020630 ldr r0, =0x020241e4 ldrb r1, [r4] adds r0, r1, r0 ldrb r0, [r0] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 ldr r0, =0x02023064 lsls r1, 9 adds r0, 0x1 adds r1, r0 adds r2, 0x3E movs r0, 0x1 ldrb r1, [r1] ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] ldrb r0, [r4] bl sub_805E408 @081BE582: bl dp01_tbl3_exec_completed pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE53C thumb_func_start sub_81BE59C sub_81BE59C: ; 81BE59C push {r4-r6,lr} sub sp, 0x4 ldr r6, =0x02024064 ldrb r0, [r6] bl mplay_80342A4 lsls r0, 24 cmp r0, 0 bne @081BE5F4 ldr r5, =0x02023064 ldrb r2, [r6] lsls r1, r2, 9 adds r0, r5, 0x1 adds r0, r1, r0 ldrb r3, [r0] adds r0, r5, 0x2 adds r0, r1, r0 ldrb r4, [r0] adds r5, 0x3 adds r1, r5 ldrb r0, [r1] lsls r0, 8 orrs r4, r0 str r4, [sp] adds r0, r2, 0 adds r1, r2, 0 bl move_anim_start_t3 lsls r0, 24 cmp r0, 0 beq @081BE5E8 bl dp01_tbl3_exec_completed b @081BE5F4 .align 2, 0 .pool @081BE5E8: ldr r0, =0x03005d60 ldrb r1, [r6] lsls r1, 2 adds r1, r0 ldr r0, =bx_80E8A6C str r0, [r1] @081BE5F4: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE59C thumb_func_start sub_81BE604 sub_81BE604: ; 81BE604 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BE604 thumb_func_start sub_81BE610 sub_81BE610: ; 81BE610 push {lr} bl dp01_tbl3_exec_completed pop {r0} bx r0 thumb_func_end sub_81BE610 thumb_func_start sub_81BE61C sub_81BE61C: ; 81BE61C push {r4,lr} ldr r2, =0x0202433a ldr r1, =0x02023064 ldr r4, =0x02024064 ldrb r0, [r4] lsls r0, 9 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] strb r0, [r2] movs r0, 0x5 bl sub_80A2F50 movs r0, 0x3 bl sub_80A2390 bl dp01_tbl3_exec_completed ldr r1, =0x03005d60 ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r1, =sub_80587B0 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE61C thumb_func_start nullsub_128 nullsub_128: ; 81BE668 bx lr thumb_func_end nullsub_128 thumb_func_start sub_81BE66C sub_81BE66C: ; 81BE66C push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xD0 lsls r0, 5 cmp r1, r0 bne @081BE690 movs r0, 0xA7 lsls r0, 1 bl flag_check lsls r0, 24 lsrs r0, 24 b @081BE692 .align 2, 0 .pool @081BE690: movs r0, 0 @081BE692: pop {r1} bx r1 thumb_func_end sub_81BE66C thumb_func_start sub_81BE698 sub_81BE698: ; 81BE698 push {lr} ldr r0, =0x0203cf18 ldr r0, [r0] adds r0, 0x4 bl sub_8151E50 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE698 thumb_func_start sub_81BE6AC sub_81BE6AC: ; 81BE6AC ldr r1, =0x0203cf18 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81BE6AC thumb_func_start sub_81BE6B8 sub_81BE6B8: ; 81BE6B8 push {r4,lr} ldr r4, =0x0203cf18 ldr r0, [r4] cmp r0, 0 beq @081BE6CC movs r0, 0 str r0, [r4] b @081BE718 .align 2, 0 .pool @081BE6CC: ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xD0 lsls r0, 5 cmp r1, r0 bne @081BE718 movs r0, 0xA7 lsls r0, 1 bl 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, =gUnknown_08617E18 bl sub_8151B68 ldr r0, [r4] adds r0, 0x4 movs r1, 0x1 movs r2, 0x1 bl sub_8151CA8 ldr r0, =sub_81BE698 movs r1, 0xFF bl AddTask ldr r1, [r4] strb r0, [r1] @081BE718: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE6B8 thumb_func_start sub_81BE72C sub_81BE72C: ; 81BE72C push {r4,lr} ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] movs r0, 0xD0 lsls r0, 5 cmp r1, r0 bne @081BE788 movs r0, 0xA7 lsls r0, 1 bl flag_check lsls r0, 24 cmp r0, 0 beq @081BE788 ldr r4, =0x0203cf18 ldr r0, [r4] cmp r0, 0 beq @081BE788 ldr r0, =sub_81BE698 bl is_function_an_active_task lsls r0, 24 cmp r0, 0 beq @081BE766 ldr r0, [r4] ldrb r0, [r0] bl remove_task @081BE766: ldr r0, [r4] adds r0, 0x4 movs r1, 0x1 movs r2, 0x1 bl sub_8151D28 ldr r0, [r4] adds r0, 0x4 movs r1, 0x1 movs r2, 0x1 bl sub_8151C50 ldr r0, [r4] bl free movs r0, 0 str r0, [r4] @081BE788: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE72C thumb_func_start sub_81BE79C sub_81BE79C: ; 81BE79C push {r4,lr} ldr r0, =0x000040cb 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 .pool @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, =sub_81BE808 movs r1, 0x8 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE7F4 thumb_func_start sub_81BE808 sub_81BE808: ; 81BE808 push {r4,r5,lr} sub sp, 0x4 lsls r0, 24 lsrs r5, r0, 24 ldr r0, =0x03005d8c ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] movs r0, 0x2D mov r3, sp bl 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, =0x02037350 adds r2, r4 ldr r3, =0x02020630 ldrb r1, [r2, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x26] adds r1, 0x4 strh r1, [r0, 0x26] ldr r0, =0x02037590 ldrb r0, [r0, 0x5] lsls r1, r0, 3 adds r1, r0 lsls r1, 2 adds r1, r4 ldrb r2, [r2, 0x4] lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r3 movs r4, 0x22 ldrsh r2, [r0, r4] movs r4, 0x26 ldrsh r0, [r0, r4] adds r2, r0 ldrb r1, [r1, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r3, 0x22 ldrsh r1, [r0, r3] movs r4, 0x26 ldrsh r0, [r0, r4] adds r1, r0 cmp r2, r1 blt @081BE882 adds r0, r5, 0 bl remove_task bl script_env_2_enable_and_set_ctx_running @081BE882: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE808 thumb_func_start sp136_strengh_sound sp136_strengh_sound: ; 81BE89C push {r4-r6,lr} mov r6, r8 push {r6} mov r8, r0 adds r4, r1, 0 adds r5, r2, 0 adds r6, r3, 0 lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 lsls r6, 24 lsrs r6, 24 ldr r0, =sub_81BE900 movs r1, 0x9 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 movs r0, 0 strh r4, [r1, 0x8] strh r0, [r1, 0xA] strh r5, [r1, 0xC] strh r6, [r1, 0xE] mov r0, r8 strh r0, [r1, 0x10] movs r0, 0 bl sub_808A2C0 movs r0, 0xD6 bl audio_play pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sp136_strengh_sound thumb_func_start sub_81BE900 sub_81BE900: ; 81BE900 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] movs r1, 0x2 ldrsh r0, [r4, r1] movs r2, 0x6 ldrsh r1, [r4, r2] bl __modsi3 cmp r0, 0 bne @081BE95C strh r0, [r4, 0x2] ldrh r0, [r4, 0x4] subs r0, 0x1 strh r0, [r4, 0x4] ldrh r0, [r4] negs r0, r0 strh r0, [r4] ldrh r0, [r4, 0x8] negs r0, r0 strh r0, [r4, 0x8] movs r1, 0 ldrsh r0, [r4, r1] movs r2, 0x8 ldrsh r1, [r4, r2] bl 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 .pool thumb_func_end sub_81BE900 thumb_func_start sub_81BE968 sub_81BE968: ; 81BE968 push {lr} ldr r0, =sub_81BE9C0 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @081BE988 ldr r0, =0x03005e00 lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @081BE988: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE968 thumb_func_start sub_81BE994 sub_81BE994: ; 81BE994 push {lr} ldr r0, =gUnknown_08617D94 bl gpu_tile_obj_alloc_and_load_multiple bl sub_81BEA20 ldr r0, =sub_81BE9C0 movs r1, 0x8 bl AddTask movs r0, 0x2 movs r1, 0x1 movs r2, 0x10 movs r3, 0x3 bl sp136_strengh_sound pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE994 thumb_func_start sub_81BE9C0 sub_81BE9C0: ; 81BE9C0 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r3, r1, 3 ldr r4, =0x03005e08 adds r2, r3, r4 ldrh r0, [r2, 0x2] adds r0, 0x1 strh r0, [r2, 0x2] lsls r0, 16 movs r1, 0xFA lsls r1, 18 cmp r0, r1 beq @081BE9E6 ldrh r0, [r2] cmp r0, 0x11 bne @081BE9F0 @081BE9E6: adds r0, r4, 0 subs r0, 0x8 adds r0, r3, r0 ldr r1, =sub_81BEA00 str r1, [r0] @081BE9F0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BE9C0 thumb_func_start sub_81BEA00 sub_81BEA00: ; 81BEA00 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0xFA lsls r0, 4 bl 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, =gUnknown_08617D64 adds r7, r5, 0x2 ldr r6, =0x02020630 @081BEA2A: lsls r0, r4, 1 adds r0, r4 lsls r0, 1 adds r1, r0, r5 ldrh r1, [r1] adds r1, 0x78 lsls r1, 16 asrs r1, 16 adds r0, r7 movs r3, 0 ldrsh r2, [r0, r3] ldr r0, =gUnknown_08617E60 movs r3, 0x8 bl 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, =gUnknown_08617D64 adds r7, r5, 0x2 ldr r6, =0x02020630 @081BEA78: lsls r0, r4, 1 adds r0, r4 lsls r0, 1 adds r1, r0, r5 ldrh r1, [r1] adds r1, 0x73 lsls r1, 16 asrs r1, 16 adds r0, r7 ldrh r2, [r0] subs r2, 0x3 lsls r2, 16 asrs r2, 16 ldr r0, =gUnknown_08617E34 movs r3, 0x8 bl 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 .pool thumb_func_end sub_81BEA20 thumb_func_start sub_81BEAD8 sub_81BEAD8: ; 81BEAD8 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x30] adds r0, 0x2 strh r0, [r4, 0x30] movs r1, 0x30 ldrsh r0, [r4, r1] lsrs r1, r0, 31 adds r0, r1 asrs r0, 1 strh r0, [r4, 0x26] movs r0, 0x22 ldrsh r3, [r4, r0] movs r1, 0x26 ldrsh r0, [r4, r1] adds r3, r0 ldr r2, =gUnknown_08617D64 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 1 adds r0, r1 lsls r0, 1 adds r2, 0x4 adds r0, r2 movs r1, 0 ldrsh r0, [r0, r1] cmp r3, r0 ble @081BEB1A adds r0, r4, 0 bl obj_delete_and_free_tiles bl sub_81BE968 @081BEB1A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BEAD8 thumb_func_start sub_81BEB24 sub_81BEB24: ; 81BEB24 push {r4,r5,lr} movs r4, 0 ldr r5, =gUnknown_08617DA4 @081BEB2A: lsls r2, r4, 2 adds r2, r5 ldrb r0, [r2] adds r0, 0x7 ldrb r1, [r2, 0x1] adds r1, 0x7 ldrh r2, [r2, 0x2] bl 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 .pool thumb_func_end sub_81BEB24 thumb_func_start sub_81BEB54 sub_81BEB54: ; 81BEB54 push {lr} ldr r0, =sub_81BED50 movs r1, 0x9 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BEB54 thumb_func_start sub_81BEB68 sub_81BEB68: ; 81BEB68 push {lr} ldr r0, =sub_81BEBF4 movs r1, 0x9 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BEB68 thumb_func_start sub_81BEB7C sub_81BEB7C: ; 81BEB7C push {lr} ldr r0, =sub_81BF028 movs r1, 0x9 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BEB7C thumb_func_start sub_81BEB90 sub_81BEB90: ; 81BEB90 push {r4,lr} ldr r4, =0x0203cf14 ldr r0, [r4] ldrh r1, [r0] movs r0, 0x10 bl 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 .pool thumb_func_end sub_81BEB90 thumb_func_start sub_81BEBB4 sub_81BEBB4: ; 81BEBB4 push {lr} lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r2, r1, r2 ldrh r1, [r2, 0x8] movs r3, 0x8 ldrsh r0, [r2, r3] cmp r0, 0 bne @081BEBEC ldr r0, =0x0203cf14 ldr r1, [r0] ldrh r0, [r1] negs r0, r0 strh r0, [r1] movs r0, 0x2 strh r0, [r2, 0x8] bl sub_81BEB90 b @081BEBF0 .align 2, 0 .pool @081BEBEC: subs r0, r1, 0x1 strh r0, [r2, 0x8] @081BEBF0: pop {r0} bx r0 thumb_func_end sub_81BEBB4 thumb_func_start sub_81BEBF4 sub_81BEBF4: ; 81BEBF4 push {r4,r5,lr} sub sp, 0xC lsls r0, 24 lsrs r5, r0, 24 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 movs r1, 0x8 ldrsh r0, [r0, r1] cmp r0, 0x6 bls @081BEC10 b @081BED40 @081BEC10: lsls r0, 2 ldr r1, =@081BEC24 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x0203cf04 movs r0, 0x92 lsls r0, 4 bl malloc_and_clear str r0, [r4] ldr r4, =0x0203cf08 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 .pool @081BEC88: ldr r0, =gUnknown_08617274 ldr r4, =0x0203cf04 ldr r1, [r4] movs r2, 0x92 lsls r2, 3 bl CpuSet ldr r1, [r4] movs r2, 0x92 lsls r2, 4 movs r0, 0 movs r3, 0 bl gpu_copy_bg_tile_pattern_data_to_vram b @081BECD8 .align 2, 0 .pool @081BECB0: ldr r0, =0x0203cf08 ldr r1, [r0] movs r0, 0 bl bg_set_tilemap ldr r1, =gUnknown_08617B94 movs r0, 0x6 str r0, [sp] movs r0, 0xC str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0 movs r2, 0xC movs r3, 0x1D bl bg_copy_tilemap_rect_simple movs r0, 0 bl gpu_copy_wram_bg_tilemap_to_vram @081BECD8: ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldrh r1, [r0, 0x8] adds r1, 0x1 strh r1, [r0, 0x8] b @081BED40 .align 2, 0 .pool @081BECF8: movs r0, 0 bl gpu_sync_bg_show b @081BED04 @081BED00: bl sub_81BEB24 @081BED04: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] b @081BED40 .align 2, 0 .pool @081BED1C: ldr r4, =0x0203cf14 movs r0, 0x4 bl malloc str r0, [r4] movs r2, 0 movs r1, 0x2 strh r1, [r0] strh r2, [r0, 0x2] ldr r0, =sub_81BEBB4 movs r1, 0xA bl AddTask adds r0, r5, 0 bl remove_task bl script_env_2_enable_and_set_ctx_running @081BED40: add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BEBF4 thumb_func_start sub_81BED50 sub_81BED50: ; 81BED50 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r1, =0x03005e00 lsls r0, 2 add r0, r10 lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x8] subs r0, 0x1 lsls r0, 16 asrs r0, 16 adds r6, r1, 0 cmp r0, 0x7 bls @081BED7C b @081BF002 @081BED7C: lsls r0, 2 ldr r1, =@081BED90 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081BED90: .4byte @081BEDB0 .4byte @081BF002 .4byte @081BEDC4 .4byte @081BEF64 .4byte @081BEF94 .4byte @081BEFD0 .4byte @081BEFF0 .4byte @081BEFF8 @081BEDB0: ldr r4, =0x0203cf10 movs r0, 0xC0 lsls r0, 2 bl malloc_and_clear str r0, [r4] b @081BF002 .align 2, 0 .pool @081BEDC4: mov r1, r10 lsls r0, r1, 2 adds r1, r0, r1 lsls r1, 3 adds r2, r1, r6 ldrh r3, [r2, 0xE] movs r4, 0xE ldrsh r1, [r2, r4] str r0, [sp, 0x8] cmp r1, 0x5F bgt @081BEE8A movs r1, 0xA ldrsh r0, [r2, r1] cmp r0, 0x1 ble @081BEE7C lsls r0, r3, 24 lsrs r4, r0, 24 movs r0, 0x30 bl malloc ldr r3, =0x0203cf10 ldr r1, [r3] lsls r2, r4, 3 adds r1, r2, r1 str r0, [r1] movs r5, 0 adds r4, r2, 0 @081BEDFA: ldr r0, [r3] adds r0, r4, r0 ldr r0, [r0] adds r0, r5 strb r5, [r0] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x2F bls @081BEDFA movs r5, 0 ldr r7, =0x0203cf10 adds r6, r2, 0 @081BEE14: bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x30 bl __umodsi3 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 movs r1, 0x30 bl __umodsi3 lsls r0, 16 lsrs r0, 16 ldr r1, [r7] adds r1, r6, r1 ldr r1, [r1] adds r0, r1, r0 ldrb r2, [r0] adds r1, r4 ldrb r1, [r1] strb r1, [r0] ldr r0, [r7] adds r0, r6, r0 ldr r0, [r0] adds r0, r4 strb r2, [r0] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x2F bls @081BEE14 ldr r0, =0x03005e00 ldr r1, [sp, 0x8] add r1, r10 lsls r1, 3 adds r2, r1, r0 ldrh r3, [r2, 0xE] movs r4, 0xE ldrsh r1, [r2, r4] adds r6, r0, 0 cmp r1, 0x5F bgt @081BEE78 adds r0, r3, 0x1 strh r0, [r2, 0xE] @081BEE78: movs r0, 0 strh r0, [r2, 0xA] @081BEE7C: ldr r1, [sp, 0x8] add r1, r10 lsls r1, 3 adds r1, r6 ldrh r0, [r1, 0xA] adds r0, 0x1 strh r0, [r1, 0xA] @081BEE8A: ldr r0, [sp, 0x8] add r0, r10 lsls r0, 3 adds r0, r6 ldrb r4, [r0, 0xE] ldrb r5, [r0, 0xC] lsls r0, r4, 16 cmp r5, r4 bcs @081BEF32 str r0, [sp, 0xC] @081BEE9E: movs r6, 0 adds r0, r5, 0x1 str r0, [sp, 0x4] lsls r4, r5, 3 movs r2, 0x5F subs r1, r2, r5 lsls r0, r1, 1 adds r0, r1 lsls r0, 4 mov r9, r0 @081BEEB2: ldr r0, =0x0203cf04 ldr r0, [r0] ldr r7, =0x0203cf10 ldr r3, [r7] adds r3, r4, r3 ldrb r2, [r3, 0x4] adds r1, r2, 0x1 strb r1, [r3, 0x4] lsls r2, 24 lsrs r2, 24 ldr r1, [r3] adds r1, r2 ldrb r1, [r1] add r1, r9 lsls r1, 16 lsrs r1, 16 movs r2, 0x1 mov r8, r2 str r2, [sp] movs r2, 0 movs r3, 0x30 bl sub_81BF2B8 adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 beq @081BEEB2 ldr r0, [r7] adds r1, r4, r0 ldrb r0, [r1, 0x4] cmp r0, 0x2F bls @081BEF24 ldr r0, [r1] bl free ldr r0, [r7] adds r0, r4, r0 movs r1, 0 str r1, [r0] ldr r1, [sp, 0x8] add r1, r10 lsls r1, 3 ldr r4, =0x03005e00 adds r1, r4 ldrh r0, [r1, 0xC] adds r0, 0x1 strh r0, [r1, 0xC] mov r0, r8 ands r5, r0 cmp r5, 0x1 bne @081BEF24 ldr r0, =0x0203cf14 ldr r1, [r0] ldrh r0, [r1, 0x2] subs r0, 0x1 strh r0, [r1, 0x2] @081BEF24: ldr r1, [sp, 0x4] lsls r0, r1, 16 lsrs r5, r0, 16 ldr r2, [sp, 0xC] lsrs r0, r2, 16 cmp r5, r0 bcc @081BEE9E @081BEF32: ldr r0, =0x0203cf04 ldr r1, [r0] movs r2, 0x92 lsls r2, 4 movs r0, 0 movs r3, 0 bl gpu_copy_bg_tile_pattern_data_to_vram ldr r0, =0x0203cf10 ldr r0, [r0] movs r4, 0xBE lsls r4, 2 adds r0, r4 ldrb r0, [r0, 0x4] cmp r0, 0x2F bhi @081BF002 b @081BF014 .align 2, 0 .pool @081BEF64: movs r0, 0 bl bg_unset_tilemap ldr r0, =sub_81BEBB4 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 cmp r0, 0xFF beq @081BEF7C bl remove_task @081BEF7C: ldr r0, =0x0203cf14 ldr r1, [r0] movs r0, 0 strh r0, [r1] strh r0, [r1, 0x2] bl sub_81BEB90 b @081BF002 .align 2, 0 .pool @081BEF94: ldr r4, =0x0203cf14 ldr r0, [r4] bl free movs r5, 0 str r5, [r4] ldr r4, =0x0203cf10 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203cf04 ldr r0, [r4] bl free str r5, [r4] ldr r4, =0x0203cf08 ldr r0, [r4] bl free str r5, [r4] b @081BF002 .align 2, 0 .pool @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, =0x03005e00 mov r2, r10 lsls r1, r2, 2 add r1, r10 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @081BF014: add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BED50 thumb_func_start sub_81BF028 sub_81BF028: ; 81BF028 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x18 lsls r0, 24 lsrs r7, r0, 24 ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldrh r0, [r0, 0x8] subs r0, 0x1 lsls r0, 16 asrs r0, 16 cmp r0, 0x7 bls @081BF04C b @081BF228 @081BF04C: lsls r0, 2 ldr r1, =@081BF060 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081BF060: .4byte @081BF080 .4byte @081BF0B4 .4byte @081BF0DC .4byte @081BF0F0 .4byte @081BF148 .4byte @081BF170 .4byte @081BF1CC .4byte @081BF224 @081BF080: ldr r4, =0x0203cf0c movs r0, 0x14 bl 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 .pool @081BF0B4: ldr r0, =0x0203cf0c ldr r0, [r0] ldr r1, [r0] movs r5, 0 ldr r2, =gUnknown_08617C44 @081BF0BE: adds r0, r5, r2 ldrb r0, [r0] strb r0, [r1] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 adds r1, 0x1 cmp r5, 0x7F bls @081BF0BE b @081BF228 .align 2, 0 .pool @081BF0DC: ldr r0, =0x0203cf0c ldr r0, [r0] ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [r1] movs r0, 0x80 strh r0, [r1, 0x4] b @081BF228 .align 2, 0 .pool @081BF0F0: mov r1, sp ldr r0, =gUnknown_08617E00 ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2-r4} stm r1!, {r2-r4} ldr r4, =0x0203cf0c ldr r0, [r4] ldr r0, [r0, 0x4] str r0, [sp, 0xC] movs r2, 0x10 negs r2, r2 mov r0, sp movs r1, 0x80 movs r3, 0x1 bl obj_add_from_template_forward_search ldr r1, [r4] movs r3, 0 strb r0, [r1, 0x8] ldr r2, =0x02020630 ldr r0, [r4] ldrb r1, [r0, 0x8] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x28 strb r3, [r0] ldr r3, [r4] ldrb r1, [r3, 0x8] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x20] strh r1, [r0, 0x2E] ldrb r1, [r3, 0x8] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strh r1, [r0, 0x30] @081BF148: movs r5, 0 ldr r2, =0x0203cf0c @081BF14C: ldr r0, [r2] ldr r1, [r0, 0xC] lsls r0, r5, 1 adds r0, r1 strh r5, [r0] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0xFF bls @081BF14C b @081BF228 .align 2, 0 .pool @081BF170: movs r5, 0 movs r6, 0xFF ldr r0, =0x000001ff mov r8, r0 @081BF178: bl GenerateRandomNumber adds r4, r6, 0 ands r4, r0 bl GenerateRandomNumber adds r1, r6, 0 ands r1, r0 ldr r0, =0x0203cf0c ldr r3, [r0] ldr r0, [r3, 0xC] lsls r1, 1 adds r1, r0 ldrh r2, [r1] lsls r4, 1 adds r4, r0 ldrh r0, [r4] strh r0, [r1] strh r2, [r4] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, r8 bls @081BF178 ldr r2, =0x02020630 ldrb r1, [r3, 0x8] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_81BF248 str r1, [r0] b @081BF228 .align 2, 0 .pool @081BF1CC: ldr r3, =0x02020630 ldr r5, =0x0203cf0c ldr r0, [r5] ldrb r1, [r0, 0x8] lsls r0, r1, 4 adds r0, r1 lsls r2, r0, 2 adds r0, r3, 0 adds r0, 0x1C adds r0, r2, r0 ldr r1, [r0] ldr r0, =nullsub_12 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 .pool @081BF224: bl script_env_2_enable_and_set_ctx_running @081BF228: ldr r0, =0x03005e00 lsls r1, r7, 2 adds r1, r7 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @081BF238: add sp, 0x18 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BF028 thumb_func_start sub_81BF248 sub_81BF248: ; 81BF248 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 ldr r0, =0x0203cf0c ldr r0, [r0] ldrh r0, [r0, 0x10] cmp r0, 0xFF bls @081BF268 ldr r0, =nullsub_12 str r0, [r5, 0x1C] b @081BF2B0 .align 2, 0 .pool @081BF268: ldrh r1, [r5, 0x22] movs r2, 0x22 ldrsh r0, [r5, r2] cmp r0, 0x5F ble @081BF2AC movs r4, 0 @081BF274: ldr r0, =0x0203cf0c ldr r3, [r0] ldr r0, [r3] ldrh r1, [r3, 0x10] adds r2, r1, 0x1 strh r2, [r3, 0x10] lsls r1, 16 ldr r2, [r3, 0xC] lsrs r1, 15 adds r1, r2 ldrh r1, [r1] movs r2, 0 str r2, [sp] movs r3, 0x10 bl sub_81BF2B8 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x1 bls @081BF274 adds r0, r5, 0 movs r1, 0 bl obj_anim_image_start b @081BF2B0 .align 2, 0 .pool @081BF2AC: adds r0, r1, 0x1 strh r0, [r5, 0x22] @081BF2B0: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81BF248 thumb_func_start sub_81BF2B8 sub_81BF2B8: ; 81BF2B8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 str r0, [sp] mov r10, r1 adds r6, r2, 0 mov r8, r3 ldr r0, [sp, 0x28] mov r9, r0 lsls r1, 16 lsrs r1, 16 mov r10, r1 lsls r6, 24 lsrs r6, 24 mov r0, r8 lsls r0, 24 mov r8, r0 lsrs r7, r0, 24 mov r1, r9 lsls r1, 24 lsrs r1, 24 mov r9, r1 mov r0, r10 adds r1, r7, 0 bl __divsi3 adds r5, r0, 0 lsls r5, 24 lsrs r4, r5, 24 ldr r3, =0x030012a8 strh r4, [r3] mov r0, r10 adds r1, r7, 0 str r3, [sp, 0x4] bl __modsi3 lsls r0, 24 lsrs r2, r0, 24 ldr r3, [sp, 0x4] strh r2, [r3, 0x2] movs r1, 0x7 ands r4, r1 ands r2, r1 strh r4, [r3, 0x4] strh r2, [r3, 0x6] lsrs r0, 27 lsrs r5, 27 strh r0, [r3, 0x8] strh r5, [r3, 0xA] mov r1, r8 lsrs r1, 27 lsls r1, 6 mov r8, r1 mov r1, r8 muls r1, r5 lsls r0, 6 adds r1, r0 lsls r1, 16 lsrs r1, 16 strh r1, [r3, 0xC] lsls r4, 3 adds r4, r2 adds r1, r4 lsls r4, r1, 16 lsrs r4, 17 strh r1, [r3, 0xE] movs r1, 0x1 mov r0, r10 ands r1, r0 movs r2, 0x1 eors r1, r2 lsls r0, r1, 2 lsls r6, r0 eors r1, r2 lsls r1, 2 movs r0, 0xF lsls r0, r1 orrs r6, r0 lsls r6, 24 lsrs r6, 24 mov r1, r9 lsls r1, 5 mov r9, r1 add r9, r4 ldr r1, [sp] add r1, r9 ldrb r0, [r1] ands r6, r0 strb r6, [r1] add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BF2B8 thumb_func_start sub_81BF384 sub_81BF384: ; 81BF384 push {r4,lr} ldr r0, =0x0000ffff 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, =0x030012b8 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, =sub_81BF3DC bl set_callback2 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BF384 thumb_func_start sub_81BF3DC sub_81BF3DC: ; 81BF3DC push {r4,r5,lr} sub sp, 0x4 ldr r1, =0x030012b8 ldr r0, [r1] ldrb r0, [r0] adds r5, r1, 0 cmp r0, 0x7 bls @081BF3EE b @081BF592 @081BF3EE: lsls r0, 2 ldr r1, =@081BF400 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081BF400: .4byte @081BF420 .4byte @081BF430 .4byte @081BF45C .4byte @081BF488 .4byte @081BF4BC .4byte @081BF514 .4byte @081BF552 .4byte @081BF574 @081BF420: bl sub_81BF5A4 ldr r0, =0x030012b8 ldr r1, [r0] movs r0, 0x1 b @081BF590 .align 2, 0 .pool @081BF430: movs r0, 0x5 bl sub_81BF7A4 cmp r0, 0x5 beq @081BF43C b @081BF592 @081BF43C: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @081BF44A b @081BF592 @081BF44A: ldr r0, =0x030012b8 ldr r1, [r0] movs r0, 0x2 b @081BF590 .align 2, 0 .pool @081BF45C: movs r0, 0 bl sub_81BF7A4 cmp r0, 0 beq @081BF468 b @081BF592 @081BF468: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 bne @081BF476 b @081BF592 @081BF476: ldr r0, =0x030012b8 ldr r1, [r0] movs r0, 0x3 b @081BF590 .align 2, 0 .pool @081BF488: movs r0, 0x1 bl sub_81BF7A4 cmp r0, 0x1 beq @081BF494 b @081BF592 @081BF494: ldr r4, =0x030012b8 ldr r0, [r4] ldr r1, =gUnknown_089A6550 str r1, [r0, 0x2C] adds r0, 0x4F movs r5, 0 strb r5, [r0] ldr r0, [r4] adds r0, 0x4 bl sub_81BA6D0 ldr r1, [r4] strh r5, [r1, 0x2] movs r0, 0x4 b @081BF590 .align 2, 0 .pool @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, =0x00020200 ands r0, r1 cmp r0, r1 beq @081BF4E4 @081BF4D8: movs r0, 0 strh r0, [r4, 0x2] b @081BF592 .align 2, 0 .pool @081BF4E4: ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] lsls r0, 16 lsrs r0, 16 cmp r0, 0xB4 bls @081BF592 adds r0, r4, 0x4 ldr r1, =gUnknown_089A6610 ldr r2, =gUnknown_089AA144 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 .pool @081BF514: movs r0, 0x2 bl sub_81BF7A4 adds r4, r0, 0 cmp r4, 0x2 bne @081BF592 ldr r5, =0x030012b8 ldr r0, [r5] adds r0, 0x4 bl 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 .pool @081BF540: ldr r1, [r5] adds r0, r1, 0 adds r0, 0x22 ldrb r0, [r0] ands r4, r0 cmp r4, 0 bne @081BF592 movs r0, 0x7 b @081BF590 @081BF552: movs r0, 0x3 bl sub_81BF7A4 cmp r0, 0x3 bne @081BF592 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081BF592 bl do_reset b @081BF592 .align 2, 0 .pool @081BF574: movs r0, 0x4 bl sub_81BF7A4 cmp r0, 0x4 bne @081BF592 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081BF592 ldr r0, =0x030012b8 ldr r1, [r0] movs r0, 0x1 @081BF590: strb r0, [r1] @081BF592: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BF3DC thumb_func_start sub_81BF5A4 sub_81BF5A4: ; 81BF5A4 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x10 movs r0, 0x8 movs r1, 0 bl 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, =0x040000d4 add r0, sp, 0xC str r0, [r4] movs r0, 0xC0 lsls r0, 19 str r0, [r4, 0x4] ldr r0, =0x85006000 str r0, [r4, 0x8] ldr r0, [r4, 0x8] str r1, [sp, 0xC] add r0, sp, 0xC str r0, [r4] movs r0, 0xE0 lsls r0, 19 str r0, [r4, 0x4] ldr r2, =0x85000100 str r2, [r4, 0x8] ldr r0, [r4, 0x8] str r1, [sp, 0xC] add r0, sp, 0xC str r0, [r4] movs r0, 0xA0 lsls r0, 19 str r0, [r4, 0x4] str r2, [r4, 0x8] ldr r0, [r4, 0x8] movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_08618108 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, =gUnknown_08618110 bl Window_InitFromTemplates bl TextBox_ResetSomeField ldr r0, =gUnknown_08618138 str r0, [r4] ldr r0, =0x050001e0 str r0, [r4, 0x4] ldr r0, =0x84000008 str r0, [r4, 0x8] ldr r0, [r4, 0x8] movs r0, 0 movs r1, 0x40 bl 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, =gUnknown_08617E9B 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, =gUnknown_0861815B str r6, [sp] movs r0, 0x1 negs r0, r0 mov r8, r0 str r0, [sp, 0x4] str r5, [sp, 0x8] movs r0, 0x2 movs r1, 0 movs r3, 0x3 bl box_print ldr r5, =gUnknown_08617E8D movs r0, 0 adds r1, r5, 0 movs r2, 0 bl 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, =gUnknown_08617E78 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, =gUnknown_08618158 str r0, [sp] mov r0, r8 str r0, [sp, 0x4] str r4, [sp, 0x8] movs r0, 0 movs r1, 0x1 movs r3, 0x2 bl box_print movs r0, 0x2 movs r1, 0x2 bl 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 .pool thumb_func_end sub_81BF5A4 thumb_func_start sub_81BF7A4 sub_81BF7A4: ; 81BF7A4 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =0x030012b8 ldr r0, [r5] ldrb r0, [r0, 0x1] cmp r0, r4 bne @081BF7BC adds r0, r4, 0 b @081BF7DC .align 2, 0 .pool @081BF7BC: cmp r0, 0x6 bne @081BF7CC adds r0, r4, 0 bl sub_81BF7E8 ldr r0, [r5] strb r4, [r0, 0x1] b @081BF7D6 @081BF7CC: bl sub_81BF8D8 ldr r1, [r5] movs r0, 0x6 strb r0, [r1, 0x1] @081BF7D6: ldr r0, =0x030012b8 ldr r0, [r0] ldrb r0, [r0, 0x1] @081BF7DC: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81BF7A4 thumb_func_start sub_81BF7E8 sub_81BF7E8: ; 81BF7E8 push {r4-r6,lr} sub sp, 0xC adds r6, r0, 0 movs r0, 0x20 str r0, [sp] str r0, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 movs r3, 0 bl bg_fill_tilemap_rect movs r0, 0x1 movs r1, 0xAA bl Window_FastFillPixels ldr r0, =gUnknown_08618158 str r0, [sp] movs r0, 0x1 negs r0, r0 str r0, [sp, 0x4] ldr r0, =gUnknown_08618160 lsls r4, r6, 2 adds r0, r4, r0 ldr r0, [r0] str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 movs r2, 0 movs r3, 0 bl box_print movs r0, 0x1 bl Window_WriteStandardTileMap movs r0, 0x1 movs r1, 0x2 bl Window_CopyToVram cmp r6, 0x5 bhi @081BF87E ldr r0, =@081BF850 adds r0, r4, r0 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =gUnknown_08618178 lsls r4, r6, 1 adds r4, r6 lsls r4, 2 adds r0, r4, r5 ldr r0, [r0] ldr r1, =0x06004000 bl LZ77UnCompVram adds r0, r5, 0x4 adds r0, r4, r0 ldr r0, [r0] ldr r1, =0x0600f800 bl LZ77UnCompVram adds r5, 0x8 adds r4, r5 ldr r0, [r4] movs r1, 0xA0 lsls r1, 19 ldr r2, =0x04000040 bl CpuSet movs r0, 0 bl 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 .pool 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, =0x0203cf1c ldr r0, =0x000040f8 bl malloc_and_clear str r0, [r4] ldr r1, =0x000040bc adds r0, r1 strb r7, [r0] ldr r0, [r4] mov r2, r8 str r2, [r0] adds r1, 0x2 adds r0, r1 strb r5, [r0] ldr r0, [r4] ldr r2, =0x000040bf adds r0, r2 strb r6, [r0] ldr r1, [r4] ldr r0, [sp, 0x18] str r0, [r1, 0x4] cmp r7, 0x2 bne @081BF94C subs r2, 0x2 adds r1, r2 movs r0, 0x1 b @081BF952 .align 2, 0 .pool @081BF94C: ldr r0, =0x000040bd adds r1, r0 movs r0, 0 @081BF952: strb r0, [r1] cmp r7, 0x1 beq @081BF9A0 cmp r7, 0x1 bgt @081BF96C cmp r7, 0 beq @081BF97C ldr r2, =0x0203cf1c b @081BF9EE .align 2, 0 .pool @081BF96C: cmp r7, 0x2 beq @081BF97C cmp r7, 0x3 beq @081BF9D0 ldr r2, =0x0203cf1c b @081BF9EE .align 2, 0 .pool @081BF97C: ldr r2, =0x0203cf1c ldr r0, [r2] ldr r1, =0x000040c1 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r2] ldr r1, =0x000040c2 adds r0, r1 movs r1, 0x3 b @081BF9EC .align 2, 0 .pool @081BF9A0: ldr r2, =0x0203cf1c ldr r0, [r2] ldr r1, =0x000040c1 adds r0, r1 movs r1, 0 strb r1, [r0] ldr r0, [r2] ldr r1, =0x000040c2 adds r0, r1 movs r1, 0x3 strb r1, [r0] ldr r0, [r2] ldr r1, =0x000040c8 adds r0, r1 strb r7, [r0] b @081BF9EE .align 2, 0 .pool @081BF9D0: ldr r2, =0x0203cf1c ldr r0, [r2] ldr r1, =0x000040c1 adds r0, r1 movs r1, 0x2 strb r1, [r0] ldr r0, [r2] ldr r1, =0x000040c2 adds r0, r1 strb r7, [r0] ldr r0, [r2] adds r1, 0x1 adds r0, r1 movs r1, 0x1 @081BF9EC: strb r1, [r0] @081BF9EE: ldr r0, [r2] ldr r2, =0x000040c1 adds r1, r0, r2 ldrb r1, [r1] subs r2, 0x1 adds r0, r2 strb r1, [r0] movs r0, 0xFF bl sub_81C488C ldr r0, =0x020244d4 ldr r0, [r0] cmp r0, 0 bne @081BFA12 movs r0, 0 movs r1, 0 bl sub_806F2AC @081BFA12: ldr r0, =sub_81BFAE4 bl set_callback2 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BF8EC thumb_func_start sub_81BFA38 sub_81BFA38: ; 81BFA38 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x4 mov r8, r0 adds r4, r1, 0 adds r5, r2, 0 ldr r6, [sp, 0x18] lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 lsls r6, 16 lsrs r6, 16 str r3, [sp] movs r0, 0x3 mov r1, r8 adds r2, r4, 0 adds r3, r5, 0 bl sub_81BF8EC ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c4 adds r0, r1 strh r6, [r0] add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81BFA38 thumb_func_start sub_81BFA80 sub_81BFA80: ; 81BFA80 push {r4,lr} sub sp, 0x4 ldr r4, [sp, 0xC] lsls r0, 24 lsrs r0, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 str r4, [sp] bl sub_81BF8EC ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040ef adds r0, r1 movs r1, 0x1 strb r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x18 bls @081BFB24 b @081BFE00 @081BFB24: lsls r0, 2 ldr r1, =@081BFB38 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081BFB38: .4byte @081BFB9C .4byte @081BFBAA .4byte @081BFBBC .4byte @081BFBD0 .4byte @081BFBE4 .4byte @081BFBEA .4byte @081BFC04 .4byte @081BFC20 .4byte @081BFC26 .4byte @081BFC38 .4byte @081BFC58 .4byte @081BFC7C .4byte @081BFC82 .4byte @081BFC94 .4byte @081BFCAC .4byte @081BFCC0 .4byte @081BFCD8 .4byte @081BFCF8 .4byte @081BFD34 .4byte @081BFD50 .4byte @081BFD60 .4byte @081BFD74 .4byte @081BFD7A .4byte @081BFDB0 .4byte @081BFDCC @081BFB9C: bl vblank_hblank_handler_set_zero bl sub_8121DA0 bl clear_scheduled_bg_copies_to_vram b @081BFDE6 @081BFBAA: bl remove_some_task ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFBBC: bl sub_80A1A74 ldr r2, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 b @081BFDE4 .align 2, 0 .pool @081BFBD0: bl reset_all_obj_data ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFBE4: bl gpu_pal_allocator_reset b @081BFDE6 @081BFBEA: bl sub_81BFE24 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040f0 adds r0, r1 movs r1, 0 strh r1, [r0] b @081BFDE6 .align 2, 0 .pool @081BFC04: bl sub_81BFEB0 lsls r0, 24 cmp r0, 0 bne @081BFC10 b @081BFE18 @081BFC10: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFC20: bl sub_81C2554 b @081BFDE6 @081BFC26: bl sub_81C1BA0 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFC38: ldr r4, =0x0203cf1c ldr r0, [r4] adds r0, 0xC bl sub_81C0098 ldr r0, [r4] ldr r1, =0x000040f0 adds r0, r1 movs r1, 0 strh r1, [r0] b @081BFDE6 .align 2, 0 .pool @081BFC58: ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0xC bl sub_81C00F0 lsls r0, 24 cmp r0, 0 bne @081BFC6A b @081BFE18 @081BFC6A: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFC7C: bl sub_81C25E8 b @081BFDE6 @081BFC82: bl sub_81C286C ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFC94: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] bl sub_81C2D9C b @081BFDE6 .align 2, 0 .pool @081BFCAC: bl sub_81C0348 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFCC0: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] bl sub_81C2AFC b @081BFDE6 .align 2, 0 .pool @081BFCD8: bl sub_81C4190 bl sub_81C42C8 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040f0 adds r0, r1 movs r1, 0 strh r1, [r0] b @081BFDE6 .align 2, 0 .pool @081BFCF8: ldr r4, =0x0203cf1c ldr r1, [r4] adds r0, r1, 0 adds r0, 0xC ldr r2, =0x000040f0 adds r1, r2 bl sub_81C45F4 ldr r1, [r4] ldr r2, =0x000040d3 adds r1, r2 strb r0, [r1] ldr r1, [r4] adds r2, r1, r2 ldrb r0, [r2] cmp r0, 0xFF bne @081BFD1C b @081BFE18 @081BFD1C: ldr r0, =0x000040f0 adds r1, r0 movs r0, 0 strh r0, [r1] b @081BFDE6 .align 2, 0 .pool @081BFD34: ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0xC bl sub_81C4984 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFD50: ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0xC bl sub_81C4A08 b @081BFDE6 .align 2, 0 .pool @081BFD60: bl sub_81C4A88 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFD74: bl sub_81C4280 b @081BFDE6 @081BFD7A: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040bc adds r0, r1 ldrb r0, [r0] cmp r0, 0x3 beq @081BFDA0 ldr r0, =sub_81C0510 movs r1, 0 bl AddTask b @081BFDE6 .align 2, 0 .pool @081BFDA0: ldr r0, =sub_81C171C movs r1, 0 bl AddTask b @081BFDE6 .align 2, 0 .pool @081BFDB0: movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 b @081BFDEE .align 2, 0 .pool @081BFDCC: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @081BFDE4: strb r0, [r2, 0x8] @081BFDE6: ldr r1, =0x030022c0 movs r2, 0x87 lsls r2, 3 adds r1, r2 @081BFDEE: ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @081BFE18 .align 2, 0 .pool @081BFE00: ldr r0, =sub_81BFAD0 bl SetVBlankCallback ldr r0, =sub_81BFAB4 bl set_callback2 movs r0, 0x1 b @081BFE1A .align 2, 0 .pool @081BFE18: movs r0, 0 @081BFE1A: add sp, 0x4 pop {r4} pop {r1} bx r1 thumb_func_end sub_81BFB10 thumb_func_start sub_81BFE24 sub_81BFE24: ; 81BFE24 push {r4,lr} movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_0861CBB4 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r4, =0x0203cf1c ldr r1, [r4] ldr r0, =0x000020bc adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x000010bc 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 .pool thumb_func_end sub_81BFE24 thumb_func_start sub_81BFEB0 sub_81BFEB0: ; 81BFEB0 push {r4,lr} sub sp, 0x4 ldr r1, =0x0203cf1c ldr r0, [r1] ldr r2, =0x000040f0 adds r0, r2 movs r2, 0 ldrsh r0, [r0, r2] adds r4, r1, 0 cmp r0, 0xC bls @081BFEC8 b @081C008C @081BFEC8: lsls r0, 2 ldr r1, =@081BFEE0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081BFEE0: .4byte @081BFF14 .4byte @081BFF30 .4byte @081BFF60 .4byte @081BFF78 .4byte @081BFF90 .4byte @081BFFA8 .4byte @081BFFC0 .4byte @081BFFF0 .4byte @081BFFFC .4byte @081C0018 .4byte @081C0024 .4byte @081C0040 .4byte @081C0064 @081BFF14: bl reset_temp_tile_data_buffers ldr r1, =gUnknown_08D97D0C movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram b @081C0046 .align 2, 0 .pool @081BFF30: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081BFF3E b @081C008C @081BFF3E: ldr r0, =gUnknown_08D9862C ldr r4, =0x0203cf1c ldr r1, [r4] adds r1, 0xBC bl call_LZZUnCompWram ldr r1, [r4] ldr r2, =0x000040f0 adds r1, r2 b @081C004E .align 2, 0 .pool @081BFF60: ldr r0, =gUnknown_08D98CC8 ldr r1, [r4] ldr r2, =0x000008bc adds r1, r2 bl call_LZZUnCompWram ldr r1, [r4] b @081C004A .align 2, 0 .pool @081BFF78: ldr r0, =gUnknown_08D987FC ldr r1, [r4] ldr r2, =0x000018bc adds r1, r2 bl call_LZZUnCompWram ldr r1, [r4] b @081C004A .align 2, 0 .pool @081BFF90: ldr r0, =gUnknown_08D9898C ldr r1, [r4] ldr r2, =0x000028bc adds r1, r2 bl call_LZZUnCompWram ldr r1, [r4] b @081C004A .align 2, 0 .pool @081BFFA8: ldr r0, =gUnknown_08D98B28 ldr r1, [r4] ldr r2, =0x000038bc adds r1, r2 bl call_LZZUnCompWram ldr r1, [r4] b @081C004A .align 2, 0 .pool @081BFFC0: ldr r0, =gUnknown_08D9853C movs r2, 0x80 lsls r2, 1 movs r1, 0 bl decompress_palette ldr r0, =gUnknown_08D85620 movs r1, 0x81 movs r2, 0x1E bl gpu_pal_apply ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040f0 adds r1, r2 b @081C004E .align 2, 0 .pool @081BFFF0: ldr r0, =gUnknown_0861CFBC bl gpu_tile_obj_decompress_and_load b @081C0046 .align 2, 0 .pool @081BFFFC: ldr r0, =gUnknown_0861D074 bl gpu_tile_obj_decompress_and_load ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040f0 adds r1, r2 b @081C004E .align 2, 0 .pool @081C0018: ldr r0, =gUnknown_0861D0F8 bl gpu_tile_obj_decompress_and_load b @081C0046 .align 2, 0 .pool @081C0024: ldr r0, =gUnknown_0861D100 bl gpu_pal_obj_decompress_and_apply ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040f0 adds r1, r2 b @081C004E .align 2, 0 .pool @081C0040: ldr r0, =gUnknown_0861D07C bl gpu_pal_obj_decompress_and_apply @081C0046: ldr r0, =0x0203cf1c ldr r1, [r0] @081C004A: ldr r0, =0x000040f0 adds r1, r0 @081C004E: ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @081C008C .align 2, 0 .pool @081C0064: ldr r0, =gUnknown_08D97B84 movs r1, 0xE8 lsls r1, 1 movs r2, 0x60 bl decompress_palette ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040f0 adds r0, r1 movs r1, 0 strh r1, [r0] movs r0, 0x1 b @081C008E .align 2, 0 .pool @081C008C: movs r0, 0 @081C008E: add sp, 0x4 pop {r4} pop {r1} bx r1 thumb_func_end sub_81BFEB0 thumb_func_start sub_81C0098 sub_81C0098: ; 81C0098 push {r4,lr} adds r3, r0, 0 ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040bd adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0 bne @081C00D0 ldr r2, [r1] ldr r4, =0x000040be adds r0, r1, r4 ldrb r1, [r0] movs r0, 0x64 muls r1, r0 adds r1, r2 adds r0, r3, 0 movs r2, 0x64 bl memcpy b @081C00E6 .align 2, 0 .pool @081C00D0: ldr r0, [r1] ldr r2, =0x000040be adds r1, r2 ldrb r2, [r1] lsls r1, r2, 2 adds r1, r2 lsls r1, 4 adds r0, r1 adds r1, r3, 0 bl sub_8069004 @081C00E6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0098 thumb_func_start sub_81C00F0 sub_81C00F0: ; 81C00F0 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r5, r0, 0 ldr r0, =0x0203cf1c ldr r7, [r0] adds r6, r7, 0 adds r6, 0x70 ldr r1, =0x000040f0 adds r0, r7, r1 movs r2, 0 ldrsh r0, [r0, r2] cmp r0, 0x1 beq @081C0198 cmp r0, 0x1 bgt @081C0120 cmp r0, 0 beq @081C012C b @081C0314 .align 2, 0 .pool @081C0120: cmp r0, 0x2 beq @081C01DC cmp r0, 0x3 bne @081C012A b @081C02A8 @081C012A: b @081C0314 @081C012C: adds r0, r5, 0 movs r1, 0xB bl pokemon_getattr strh r0, [r6] adds r0, r5, 0 movs r1, 0x41 bl pokemon_getattr strh r0, [r6, 0x2] adds r0, r5, 0 movs r1, 0x19 bl pokemon_getattr str r0, [r6, 0x10] adds r0, r5, 0 movs r1, 0x38 bl pokemon_getattr strb r0, [r6, 0x5] adds r0, r5, 0 movs r1, 0x2E bl pokemon_getattr strb r0, [r6, 0x8] adds r0, r5, 0 movs r1, 0xC bl pokemon_getattr strh r0, [r6, 0x2E] adds r0, r5, 0 movs r1, 0 bl pokemon_getattr str r0, [r6, 0xC] adds r0, r5, 0 movs r1, 0x4 bl pokemon_getattr adds r1, r7, 0 adds r1, 0xA5 strb r0, [r1] lsls r0, 24 cmp r0, 0 beq @081C018C movs r0, 0x1 strb r0, [r6, 0x4] b @081C0322 @081C018C: adds r0, r5, 0 movs r1, 0x2D bl pokemon_getattr strb r0, [r6, 0x4] b @081C0322 @081C0198: movs r4, 0 movs r0, 0x8C adds r0, r7 mov r8, r0 movs r1, 0xA4 adds r1, r7 mov r9, r1 adds r6, r7, 0 adds r6, 0x84 @081C01AA: adds r1, r4, 0 adds r1, 0xD adds r0, r5, 0 bl pokemon_getattr strh r0, [r6] adds r1, r4, 0 adds r1, 0x11 adds r0, r5, 0 bl pokemon_getattr mov r2, r8 adds r1, r2, r4 strb r0, [r1] adds r6, 0x2 adds r4, 0x1 cmp r4, 0x3 bls @081C01AA adds r0, r5, 0 movs r1, 0x15 bl pokemon_getattr mov r1, r9 strb r0, [r1] b @081C0322 @081C01DC: ldr r1, [r7] ldr r0, =0x020244ec cmp r1, r0 beq @081C01F8 ldr r2, =0x000040bc adds r0, r7, r2 ldrb r0, [r0] cmp r0, 0x2 beq @081C01F8 ldr r1, =0x000040ef adds r0, r7, r1 ldrb r0, [r0] cmp r0, 0x1 bne @081C0254 @081C01F8: adds r0, r5, 0 bl GetNature adds r1, r6, 0 adds r1, 0x33 strb r0, [r1] adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr strh r0, [r6, 0x20] adds r0, r5, 0 movs r1, 0x3A bl pokemon_getattr strh r0, [r6, 0x22] adds r0, r5, 0 movs r1, 0x3B bl pokemon_getattr strh r0, [r6, 0x24] adds r0, r5, 0 movs r1, 0x3C bl pokemon_getattr strh r0, [r6, 0x26] adds r0, r5, 0 movs r1, 0x3E bl pokemon_getattr strh r0, [r6, 0x28] adds r0, r5, 0 movs r1, 0x3F bl pokemon_getattr strh r0, [r6, 0x2A] adds r0, r5, 0 movs r1, 0x3D b @081C02A0 .align 2, 0 .pool @081C0254: adds r0, r5, 0 bl GetNature adds r1, r7, 0 adds r1, 0xA3 strb r0, [r1] adds r0, r5, 0 movs r1, 0x39 bl pokemon_getattr strh r0, [r6, 0x20] adds r0, r5, 0 movs r1, 0x3A bl pokemon_getattr strh r0, [r6, 0x22] adds r0, r5, 0 movs r1, 0x54 bl pokemon_getattr strh r0, [r6, 0x24] adds r0, r5, 0 movs r1, 0x55 bl pokemon_getattr strh r0, [r6, 0x26] adds r0, r5, 0 movs r1, 0x57 bl pokemon_getattr strh r0, [r6, 0x28] adds r0, r5, 0 movs r1, 0x58 bl pokemon_getattr strh r0, [r6, 0x2A] adds r0, r5, 0 movs r1, 0x56 @081C02A0: bl pokemon_getattr strh r0, [r6, 0x2C] b @081C0322 @081C02A8: adds r4, r7, 0 adds r4, 0xA6 adds r0, r5, 0 movs r1, 0x7 adds r2, r4, 0 bl pokemon_getattr adds r0, r5, 0 movs r1, 0x3 bl pokemon_getattr adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl 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, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040f0 adds r1, r2 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] movs r0, 0 @081C0332: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C00F0 thumb_func_start sub_81C0348 sub_81C0348: ; 81C0348 push {r4-r6,lr} ldr r6, =0x0203cf1c ldr r2, [r6] ldr r1, =0x000040c0 adds r0, r2, r1 ldrb r0, [r0] subs r0, 0x2 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @081C037C movs r0, 0 movs r1, 0xFF bl sub_81C1DA4 movs r0, 0 movs r1, 0xFF movs r2, 0 bl sub_81C1EFC b @081C03D8 .align 2, 0 .pool @081C037C: ldr r1, =0x000040c6 adds r0, r2, r1 ldrb r1, [r0] lsls r1, 1 adds r0, r2, 0 adds r0, 0x84 adds r0, r1 ldrh r0, [r0] bl sub_81C240C ldr r0, [r6] ldr r5, =0x000020bc adds r0, r5 movs r1, 0x3 movs r2, 0 bl sub_81C2194 ldr r0, [r6] ldr r4, =0x000030bc adds r0, r4 movs r1, 0x1 movs r2, 0 bl sub_81C2194 ldr r1, [r6] adds r1, r4 movs r0, 0x1 bl 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, =0x0203cf1c ldr r1, [r0] adds r0, r1, 0 adds r0, 0x77 ldrb r0, [r0] cmp r0, 0 bne @081C0400 movs r0, 0 movs r1, 0xFF bl sub_81C2074 b @081C0416 .align 2, 0 .pool @081C0400: ldr r2, =0x000040c0 adds r0, r1, r2 ldrb r0, [r0] subs r0, 0x2 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @081C0416 movs r0, 0xD bl Window_WriteStandardTileMap @081C0416: bl sub_81C2524 ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0xC bl sub_81C2228 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0348 thumb_func_start sub_81C0434 sub_81C0434: ; 81C0434 push {lr} bl Window_FreeMemory ldr r0, =0x0203cf1c ldr r0, [r0] bl free pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0434 thumb_func_start sub_81C044C sub_81C044C: ; 81C044C push {r4,lr} sub sp, 0x4 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81C0484 str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C044C thumb_func_start sub_81C0484 sub_81C0484: ; 81C0484 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C04EC ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081C04EC ldr r4, =0x0203cf1c ldr r0, [r4] ldr r0, [r0, 0x4] bl set_callback2 ldr r1, =0x0203cf20 ldr r0, [r4] ldr r2, =0x000040be 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, =0x03007420 ldr r1, =0x0000ffff movs r2, 0x80 lsls r2, 1 bl MPlayVolumeControl ldr r0, =0x020244d4 ldr r0, [r0] cmp r0, 0 bne @081C04E2 movs r0, 0 bl sub_806F47C @081C04E2: bl sub_81C0434 adds r0, r5, 0 bl remove_task @081C04EC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0484 thumb_func_start sub_81C0510 sub_81C0510: ; 81C0510 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C05FE ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r2, 0x80 adds r0, r2, 0 ands r0, r1 cmp r0, 0 bne @081C05FE ldr r5, =0x030022c0 ldrh r1, [r5, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081C0550 movs r1, 0x1 negs r1, r1 adds r0, r4, 0 bl sub_81C0604 b @081C05FE .align 2, 0 .pool @081C0550: adds r0, r2, 0 ands r0, r1 cmp r0, 0 beq @081C0562 adds r0, r4, 0 movs r1, 0x1 bl sub_81C0604 b @081C05FE @081C0562: movs r0, 0x20 ands r0, r1 cmp r0, 0 bne @081C0576 bl 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, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @081C05FE cmp r0, 0 bne @081C05D8 bl sub_81C48F0 movs r0, 0x5 bl audio_play adds r0, r4, 0 bl sub_81C044C b @081C05FE .align 2, 0 .pool @081C05D8: movs r0, 0x5 bl audio_play adds r0, r4, 0 bl sub_81C0E48 b @081C05FE @081C05E6: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C05FE bl sub_81C48F0 movs r0, 0x5 bl audio_play adds r0, r4, 0 bl sub_81C044C @081C05FE: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C0510 thumb_func_start sub_81C0604 sub_81C0604: ; 81C0604 push {r4-r7,lr} lsls r0, 24 lsrs r7, r0, 24 lsls r1, 24 lsrs r5, r1, 24 adds r4, r5, 0 ldr r1, =0x0203cf1c ldr r3, [r1] ldr r2, =0x000040c3 adds r0, r3, r2 ldrb r0, [r0] adds r6, r1, 0 cmp r0, 0 bne @081C06EE ldr r1, =0x000040bd adds r0, r3, r1 ldrb r2, [r0] cmp r2, 0x1 bne @081C0678 adds r1, 0x3 adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0 beq @081C0654 lsls r1, r5, 24 asrs r1, 24 movs r4, 0x2 eors r1, r2 negs r0, r1 orrs r0, r1 asrs r0, 31 ands r4, r0 b @081C065C .align 2, 0 .pool @081C0654: movs r4, 0x3 cmp r5, 0x1 bne @081C065C movs r4, 0x1 @081C065C: ldr r2, [r6] ldr r0, [r2] ldr r3, =0x000040be adds r1, r2, r3 ldrb r1, [r1] adds r3, 0x1 adds r2, r3 ldrb r2, [r2] adds r3, r4, 0 bl sub_80D214C b @081C0696 .align 2, 0 .pool @081C0678: bl sub_81B1250 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C068E lsls r0, r5, 24 asrs r0, 24 bl sub_81C09B4 b @081C0696 @081C068E: lsls r0, r4, 24 asrs r0, 24 bl sub_81C08F8 @081C0696: lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 24 asrs r0, 24 movs r1, 0x1 negs r1, r1 cmp r0, r1 beq @081C06EE movs r0, 0x5 bl audio_play ldr r5, =0x0203cf1c ldr r0, [r5] adds r0, 0x77 ldrb r0, [r0] cmp r0, 0 beq @081C06D4 movs r0, 0x2 movs r1, 0x1 bl sub_81C4204 movs r0, 0xD bl 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, =0x000040be adds r0, r1 movs r2, 0 strb r4, [r0] ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 strh r2, [r0, 0x8] ldr r1, =sub_81C0704 str r1, [r0] @081C06EE: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0604 thumb_func_start sub_81C0704 sub_81C0704: ; 81C0704 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r4, r1, 3 ldr r6, =0x03005e08 adds r5, r4, r6 movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0xC bls @081C071E b @081C08BC @081C071E: lsls r0, 2 ldr r1, =@081C0730 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C0730: .4byte @081C0764 .4byte @081C076A .4byte @081C0780 .4byte @081C07A8 .4byte @081C07C8 .4byte @081C07E0 .4byte @081C07F0 .4byte @081C0800 .4byte @081C0828 .4byte @081C086C .4byte @081C0872 .4byte @081C0878 .4byte @081C0894 @081C0764: bl sub_80A369C b @081C08EC @081C076A: bl sub_81C4898 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040d3 b @081C0786 .align 2, 0 .pool @081C0780: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040d4 @081C0786: adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_resources b @081C08EC .align 2, 0 .pool @081C07A8: ldr r4, =0x0203cf1c ldr r0, [r4] adds r0, 0xC bl sub_81C0098 ldr r0, [r4] ldr r1, =0x000040f0 adds r0, r1 movs r1, 0 strh r1, [r0] b @081C08EC .align 2, 0 .pool @081C07C8: ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0xC bl sub_81C00F0 lsls r0, 24 cmp r0, 0 bne @081C07DA b @081C08F2 @081C07DA: b @081C08EC .align 2, 0 .pool @081C07E0: ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0xC bl sub_81C49E0 b @081C08EC .align 2, 0 .pool @081C07F0: ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0xC bl sub_81C4A08 b @081C08EC .align 2, 0 .pool @081C0800: ldr r4, =0x0203cf1c ldr r0, [r4] adds r0, 0x77 ldrb r0, [r0] cmp r0, 0 beq @081C0816 movs r1, 0x2 negs r1, r1 movs r0, 0xA bl sub_81C2074 @081C0816: ldr r0, [r4] adds r0, 0xC bl sub_81C2228 movs r0, 0 strh r0, [r5, 0x2] b @081C08EC .align 2, 0 .pool @081C0828: ldr r4, =0x0203cf1c ldr r0, [r4] adds r0, 0xC adds r1, r5, 0x2 bl sub_81C45F4 ldr r1, [r4] ldr r2, =0x000040d3 adds r1, r2 strb r0, [r1] ldr r0, [r4] adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @081C08F2 ldr r2, =0x02020630 adds r1, r0, 0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 strh r1, [r0, 0x32] bl sub_81C0E24 movs r0, 0 strh r0, [r5, 0x2] b @081C08EC .align 2, 0 .pool @081C086C: bl sub_81C4280 b @081C08EC @081C0872: bl sub_81C25E8 b @081C08EC @081C0878: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] bl sub_81C2D9C bl sub_81C2524 b @081C08EC .align 2, 0 .pool @081C0894: ldr r2, =0x02020630 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040d3 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0 strh r1, [r0, 0x32] b @081C08EC .align 2, 0 .pool @081C08BC: bl sub_81221EC lsls r0, 24 cmp r0, 0 bne @081C08F2 ldr r0, =sub_81C20F0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0 bne @081C08F2 strh r0, [r5] adds r0, r6, 0 subs r0, 0x8 adds r0, r4, r0 ldr r1, =sub_81C0510 str r1, [r0] b @081C08F2 .align 2, 0 .pool @081C08EC: ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] @081C08F2: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81C0704 thumb_func_start sub_81C08F8 sub_81C08F8: ; 81C08F8 push {r4-r7,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r1, =0x0203cf1c ldr r2, [r1] ldr r7, [r2] ldr r3, =0x000040c0 adds r0, r2, r3 ldrb r0, [r0] adds r5, r1, 0 cmp r0, 0 bne @081C0960 lsls r0, r4, 24 asrs r3, r0, 24 movs r1, 0x1 negs r1, r1 adds r6, r0, 0 cmp r3, r1 bne @081C0928 ldr r1, =0x000040be adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0 beq @081C0988 @081C0928: asrs r0, r6, 24 cmp r0, 0x1 bne @081C0940 ldr r0, [r5] ldr r2, =0x000040be adds r1, r0, r2 ldr r3, =0x000040bf adds r0, r3 ldrb r1, [r1] ldrb r0, [r0] cmp r1, r0 bcs @081C0988 @081C0940: ldr r0, [r5] ldr r1, =0x000040be adds r0, r1 ldrb r0, [r0] adds r0, r4 lsls r0, 24 asrs r0, 24 b @081C09AE .align 2, 0 .pool @081C0960: ldr r3, =0x000040be adds r0, r2, r3 ldrb r5, [r0] lsls r6, r4, 24 @081C0968: lsls r0, r5, 24 asrs r0, 24 asrs r1, r6, 24 adds r0, r1 lsls r0, 24 lsrs r5, r0, 24 asrs r4, r0, 24 cmp r4, 0 blt @081C0988 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040bf adds r0, r1 ldrb r0, [r0] cmp r4, r0 ble @081C099C @081C0988: movs r0, 0x1 negs r0, r0 b @081C09AE .align 2, 0 .pool @081C099C: movs r0, 0x64 muls r0, r4 adds r0, r7, r0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @081C0968 adds r0, r4, 0 @081C09AE: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81C08F8 thumb_func_start sub_81C09B4 sub_81C09B4: ; 81C09B4 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r0, 24 mov r12, r0 ldr r6, =0x0203cf1c ldr r0, [r6] ldr r1, [r0] mov r8, r1 movs r5, 0 movs r2, 0 ldr r3, =gUnknown_0861CC1C movs r1, 0 ldrsb r1, [r3, r1] ldr r4, =0x000040be adds r0, r4 ldrb r0, [r0] cmp r1, r0 beq @081C09FC adds r7, r3, 0 adds r3, r4, 0 @081C09E0: adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x5 bhi @081C09FC adds r0, r2, r7 movs r1, 0 ldrsb r1, [r0, r1] ldr r0, [r6] adds r0, r3 ldrb r0, [r0] cmp r1, r0 bne @081C09E0 adds r5, r2, 0 @081C09FC: mov r0, r12 lsls r6, r0, 24 ldr r7, =gUnknown_0861CC1C @081C0A02: lsls r0, r5, 24 asrs r0, 24 asrs r1, r6, 24 adds r0, r1 lsls r0, 24 lsrs r5, r0, 24 lsls r1, r5, 24 lsrs r0, r1, 24 cmp r0, 0x5 bhi @081C0A40 asrs r0, r1, 24 adds r0, r7 movs r4, 0 ldrsb r4, [r0, r4] movs r0, 0x64 muls r0, r4 add r0, r8 bl sub_81C0A50 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C0A02 adds r0, r4, 0 b @081C0A44 .align 2, 0 .pool @081C0A40: movs r0, 0x1 negs r0, r0 @081C0A44: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81C09B4 thumb_func_start sub_81C0A50 sub_81C0A50: ; 81C0A50 push {r4,lr} adds r4, r0, 0 movs r1, 0xB bl pokemon_getattr cmp r0, 0 beq @081C0A84 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040be adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @081C0A78 adds r0, r4, 0 movs r1, 0x2D bl pokemon_getattr cmp r0, 0 bne @081C0A84 @081C0A78: movs r0, 0x1 b @081C0A86 .align 2, 0 .pool @081C0A84: movs r0, 0 @081C0A86: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C0A50 thumb_func_start sub_81C0A8C sub_81C0A8C: ; 81C0A8C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC lsls r0, 24 lsrs r6, r0, 24 str r6, [sp] lsls r1, 24 lsrs r3, r1, 24 str r3, [sp, 0x4] ldr r0, =0x0203cf1c mov r8, r0 ldr r2, [r0] adds r1, r2, 0 adds r1, 0x70 lsls r0, r6, 2 adds r0, r6 lsls r7, r0, 3 ldr r0, =0x03005e08 mov r9, r0 adds r0, r7, r0 str r0, [sp, 0x8] ldrb r1, [r1, 0x4] mov r10, r1 cmp r1, 0 bne @081C0B6E lsls r0, r3, 24 asrs r5, r0, 24 movs r0, 0x1 negs r0, r0 cmp r5, r0 bne @081C0AE0 ldr r1, =0x000040c0 adds r0, r2, r1 ldr r3, =0x000040c1 adds r1, r2, r3 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 beq @081C0B6E @081C0AE0: cmp r5, 0x1 bne @081C0AF4 ldr r1, =0x000040c0 adds r0, r2, r1 ldr r3, =0x000040c2 adds r1, r2, r3 ldrb r0, [r0] ldrb r1, [r1] cmp r0, r1 beq @081C0B6E @081C0AF4: movs r0, 0x5 bl audio_play mov r1, r8 ldr r0, [r1] ldr r4, =0x000040c0 adds r0, r4 ldrb r0, [r0] bl sub_81C2C38 mov r2, r8 ldr r1, [r2] adds r1, r4 ldrb r0, [r1] ldr r3, [sp, 0x4] adds r0, r3 strb r0, [r1] mov r1, r10 ldr r0, [sp, 0x8] strh r1, [r0] cmp r5, 0x1 bne @081C0B4C ldr r1, =sub_81C0B8C mov r0, r9 subs r0, 0x8 adds r0, r7, r0 ldr r2, [r0] adds r0, r6, 0 bl set_task_function_and_args_14_15 b @081C0B5C .align 2, 0 .pool @081C0B4C: ldr r1, =sub_81C0CC4 mov r0, r9 subs r0, 0x8 adds r0, r7, r0 ldr r2, [r0] ldr r0, [sp] bl set_task_function_and_args_14_15 @081C0B5C: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r2, =0x000040c0 adds r0, r2 ldrb r0, [r0] bl sub_81C2DE4 bl sub_81C424C @081C0B6E: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0A8C thumb_func_start sub_81C0B8C sub_81C0B8C: ; 81C0B8C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0 bne @081C0C2A ldr r0, =0x0203cf1c ldr r0, [r0] ldr r3, =0x000040c9 adds r0, r3 ldrb r0, [r0] cmp r0, 0 bne @081C0BE0 movs r0, 0x1 strh r0, [r4, 0x2] movs r0, 0x1 movs r1, 0x7 movs r2, 0x1 bl 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 .pool @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, =0x0203cf1c ldr r1, [r1] ldr r3, =0x000040c0 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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81C0C68 str r0, [r1] @081C0C52: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0B8C thumb_func_start sub_81C0C68 sub_81C0C68: ; 81C0C68 push {r4,r5,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 lsls r2, r4, 2 adds r2, r4 lsls r2, 3 ldr r0, =0x03005e08 adds r2, r0 ldr r5, =0x0203cf1c ldr r3, [r5] ldr r0, =0x000040c9 adds r3, r0 ldrb r0, [r3] movs r1, 0x1 eors r0, r1 movs r1, 0 strb r0, [r3] strh r1, [r2, 0x2] strh r1, [r2] bl sub_81C1BA0 ldr r0, [r5] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] bl sub_81C2AFC bl sub_81C4280 bl sub_81C0E24 adds r0, r4, 0 bl set_task_function_to_args_14_15 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0C68 thumb_func_start sub_81C0CC4 sub_81C0CC4: ; 81C0CC4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0 bne @081C0D0C ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c9 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @081C0CFC movs r0, 0x2 b @081C0CFE .align 2, 0 .pool @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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81C0D44 str r0, [r1] @081C0D34: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0CC4 thumb_func_start sub_81C0D44 sub_81C0D44: ; 81C0D44 push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c9 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @081C0D8C movs r0, 0x1 movs r1, 0x7 movs r2, 0x1 bl 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 .pool @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, =0x0203cf1c ldr r2, [r6] ldr r7, =0x000040c0 adds r1, r2, r7 ldrb r0, [r1] cmp r0, 0x1 bls @081C0DD0 ldrb r0, [r4, 0x2] ldrb r1, [r1] lsls r1, 12 ldr r3, =0xfffff0bc adds r1, r3 adds r1, r2, r1 bl 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, =0x000040c9 adds r2, r0 ldrb r0, [r2] movs r1, 0x1 eors r0, r1 movs r1, 0 strb r0, [r2] strh r1, [r4, 0x2] strh r1, [r4] bl sub_81C1BA0 ldr r0, [r6] adds r0, r7 ldrb r0, [r0] bl sub_81C2AFC bl sub_81C4280 bl sub_81C0E24 adds r0, r5, 0 bl set_task_function_to_args_14_15 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0D44 thumb_func_start sub_81C0E24 sub_81C0E24: ; 81C0E24 push {lr} ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040c0 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x1 bne @081C0E3C adds r0, r1, 0 adds r0, 0xC bl sub_81C22CC @081C0E3C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0E24 thumb_func_start sub_81C0E48 sub_81C0E48: ; 81C0E48 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r7, r0, 24 ldr r5, =0x0203cf1c ldr r0, [r5] ldr r2, =0x000040c6 adds r0, r2 movs r1, 0 strb r1, [r0] ldr r1, [r5] adds r2, r1, r2 ldrb r0, [r2] lsls r0, 1 adds r1, 0x84 adds r1, r0 ldrh r6, [r1] mov r8, r6 movs r0, 0x13 bl Window_FillTileMap ldr r2, =0x02020630 ldr r0, [r5] ldr r1, =0x000040d5 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @081C0E96 movs r0, 0xD bl 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, =0x000040c8 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, =0x000020bc adds r0, r1 movs r1, 0x3 movs r2, 0 bl sub_81C2194 ldr r0, [r5] ldr r1, =0x000030bc adds r0, r1 movs r1, 0x1 movs r2, 0 bl sub_81C2194 mov r0, r8 bl sub_81C3E9C bl sub_81C3F44 bl sub_81C44F0 movs r0, 0 bl schedule_bg_copy_tilemap_to_vram movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram movs r0, 0x8 bl sub_81C4AF8 ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81C0F44 str r1, [r0] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C0E48 thumb_func_start sub_81C0F44 sub_81C0F44: ; 81C0F44 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C103A ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081C0F98 movs r0, 0x4 strh r0, [r4] movs r1, 0x1 negs r1, r1 ldr r0, =0x0203cf1c ldr r2, [r0] ldr r0, =0x000040c6 adds r2, r0 adds r0, r4, 0 bl sub_81C1070 b @081C103A .align 2, 0 .pool @081C0F98: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081C0FC0 movs r0, 0x4 strh r0, [r4] ldr r0, =0x0203cf1c ldr r2, [r0] ldr r0, =0x000040c6 adds r2, r0 adds r0, r4, 0 movs r1, 0x1 bl sub_81C1070 b @081C103A .align 2, 0 .pool @081C0FC0: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081C1026 ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040c8 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x1 beq @081C0FE8 subs r2, 0x4 adds r0, r1, r2 ldr r0, [r0] ldr r1, =0x00ffffff ands r0, r1 movs r1, 0x80 lsls r1, 11 cmp r0, r1 bne @081C1004 @081C0FE8: movs r0, 0x5 bl audio_play adds r0, r5, 0 bl sub_81C11F4 b @081C103A .align 2, 0 .pool @081C1004: bl sub_81C1040 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C101E movs r0, 0x5 bl audio_play adds r0, r5, 0 bl sub_81C129C b @081C103A @081C101E: movs r0, 0x20 bl audio_play b @081C103A @081C1026: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C103A movs r0, 0x5 bl audio_play adds r0, r6, 0 bl sub_81C11F4 @081C103A: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81C0F44 thumb_func_start sub_81C1040 sub_81C1040: ; 81C1040 push {lr} movs r1, 0x1 ldr r0, =0x0203cf1c ldr r0, [r0] adds r2, r0, 0 adds r2, 0x84 @081C104C: lsls r0, r1, 1 adds r0, r2, r0 ldrh r0, [r0] cmp r0, 0 beq @081C1060 movs r0, 0x1 b @081C106C .align 2, 0 .pool @081C1060: adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x3 bls @081C104C movs r0, 0 @081C106C: pop {r1} bx r1 thumb_func_end sub_81C1040 thumb_func_start sub_81C1070 sub_81C1070: ; 81C1070 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r7, r0, 0 adds r4, r1, 0 mov r8, r2 lsls r4, 24 lsrs r4, 24 movs r0, 0x5 bl audio_play mov r0, r8 ldrb r6, [r0] movs r2, 0 lsls r4, 24 asrs r4, 24 mov r12, r4 movs r1, 0 ldrsh r4, [r7, r1] ldrb r0, [r7] lsls r3, r0, 24 @081C109C: lsls r0, r6, 24 asrs r0, 24 add r0, r12 lsls r0, 24 lsrs r6, r0, 24 asrs r0, 24 cmp r0, r4 ble @081C10B0 movs r6, 0 b @081C10B6 @081C10B0: cmp r0, 0 bge @081C10B6 lsrs r6, r3, 24 @081C10B6: lsls r0, r6, 24 asrs r1, r0, 24 mov r9, r0 cmp r1, 0x4 bne @081C10C2 b @081C11CC @081C10C2: ldr r0, =0x0203cf1c ldr r0, [r0] lsls r1, 1 adds r0, 0x84 adds r0, r1 ldrh r5, [r0] cmp r5, 0 bne @081C10E2 lsls r0, r2, 24 movs r1, 0x80 lsls r1, 17 adds r0, r1 lsrs r2, r0, 24 asrs r0, 24 cmp r0, 0x3 ble @081C109C @081C10E2: adds r0, r5, 0 bl sub_81C240C movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram adds r0, r5, 0 bl sub_81C3E9C mov r1, r8 ldrb r0, [r1] cmp r0, 0x4 bne @081C1110 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c4 adds r0, r1 ldrh r0, [r0] cmp r0, 0 beq @081C1118 @081C1110: movs r1, 0x2 ldrsh r0, [r7, r1] cmp r0, 0x1 bne @081C115E @081C1118: movs r0, 0x13 bl Window_FillTileMap ldr r2, =0x02020630 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040d5 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @081C1142 movs r0, 0xD bl 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, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c4 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, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c6 adds r0, r1 cmp r8, r0 bne @081C11E0 movs r0, 0x8 bl sub_81C4D18 b @081C11E6 .align 2, 0 .pool @081C11CC: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c4 adds r0, r1 ldrh r5, [r0] b @081C10E2 .align 2, 0 .pool @081C11E0: movs r0, 0x12 bl sub_81C4D18 @081C11E6: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C1070 thumb_func_start sub_81C11F4 sub_81C11F4: ; 81C11F4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 movs r0, 0x8 bl sub_81C4C60 movs r0, 0x6 bl Window_FillTileMap movs r0, 0x5 bl Window_WriteStandardTileMap movs r0, 0 bl sub_81C3E9C ldr r4, =0x0203cf1c ldr r0, [r4] ldr r1, =0x000020bc adds r0, r1 movs r1, 0x3 movs r2, 0x1 bl sub_81C2194 ldr r0, [r4] ldr r1, =0x000030bc adds r0, r1 movs r1, 0x1 movs r2, 0x1 bl sub_81C2194 bl sub_81C4064 ldr r0, [r4] ldr r1, =0x000040c6 adds r0, r1 ldrb r0, [r0] cmp r0, 0x4 beq @081C125E movs r0, 0xE bl 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, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81C0510 str r0, [r1] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C11F4 thumb_func_start sub_81C129C sub_81C129C: ; 81C129C push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r2, =0x000040c6 adds r1, r0, r2 ldrb r1, [r1] adds r2, 0x1 adds r0, r2 strb r1, [r0] movs r0, 0x1 bl sub_81C4C84 movs r0, 0x12 bl sub_81C4AF8 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81C12E4 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C129C thumb_func_start sub_81C12E4 sub_81C12E4: ; 81C12E4 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C13AA ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081C1338 movs r0, 0x3 strh r0, [r4] movs r1, 0x1 negs r1, r1 ldr r0, =0x0203cf1c ldr r2, [r0] ldr r0, =0x000040c7 adds r2, r0 adds r0, r4, 0 bl sub_81C1070 b @081C13AA .align 2, 0 .pool @081C1338: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081C1360 movs r0, 0x3 strh r0, [r4] ldr r0, =0x0203cf1c ldr r2, [r0] ldr r0, =0x000040c7 adds r2, r0 adds r0, r4, 0 movs r1, 0x1 bl sub_81C1070 b @081C13AA .align 2, 0 .pool @081C1360: movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081C139A ldr r0, =0x0203cf1c ldr r0, [r0] ldr r2, =0x000040c6 adds r1, r0, r2 adds r2, 0x1 adds r0, r2 ldrb r1, [r1] ldrb r0, [r0] cmp r1, r0 bne @081C1390 adds r0, r5, 0 movs r1, 0 bl sub_81C13B0 b @081C13AA .align 2, 0 .pool @081C1390: adds r0, r5, 0 movs r1, 0x1 bl sub_81C13B0 b @081C13AA @081C139A: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C13AA adds r0, r6, 0 movs r1, 0 bl sub_81C13B0 @081C13AA: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81C12E4 thumb_func_start sub_81C13B0 sub_81C13B0: ; 81C13B0 push {r4-r7,lr} adds r4, r1, 0 lsls r0, 24 lsrs r7, r0, 24 lsls r4, 24 lsrs r4, 24 movs r0, 0x5 bl audio_play movs r0, 0 bl sub_81C4C84 movs r0, 0x12 bl sub_81C4C60 cmp r4, 0x1 bne @081C1464 ldr r0, =0x0203cf1c ldr r3, [r0] ldr r1, =0x000040bd adds r0, r3, r1 ldrb r0, [r0] cmp r0, 0 bne @081C1410 ldr r0, [r3] ldr r2, =0x000040be adds r1, r3, r2 ldrb r2, [r1] movs r1, 0x64 muls r1, r2 adds r0, r1 ldr r4, =0x000040c6 adds r1, r3, r4 ldrb r1, [r1] adds r4, 0x1 adds r2, r3, r4 ldrb r2, [r2] bl sub_81C14BC b @081C1430 .align 2, 0 .pool @081C1410: ldr r0, [r3] ldr r2, =0x000040be adds r1, r3, r2 ldrb r2, [r1] lsls r1, r2, 2 adds r1, r2 lsls r1, 4 adds r0, r1 ldr r4, =0x000040c6 adds r1, r3, r4 ldrb r1, [r1] adds r4, 0x1 adds r2, r3, r4 ldrb r2, [r2] bl sub_81C15EC @081C1430: ldr r5, =0x0203cf1c ldr r0, [r5] adds r0, 0xC bl sub_81C0098 ldr r1, [r5] ldr r6, =0x000040c6 adds r0, r1, r6 ldrb r0, [r0] ldr r4, =0x000040c7 adds r1, r4 ldrb r1, [r1] bl sub_81C40A0 ldr r1, [r5] adds r0, r1, r6 ldrb r0, [r0] adds r1, r4 ldrb r1, [r1] bl sub_81C4568 ldr r0, [r5] adds r4, r0, r4 ldrb r1, [r4] adds r0, r6 strb r1, [r0] @081C1464: ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040c6 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 1 adds r1, 0x84 adds r1, r0 ldrh r4, [r1] adds r0, r4, 0 bl sub_81C3E9C adds r0, r4, 0 bl sub_81C240C movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram ldr r1, =0x03005e00 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r1 ldr r1, =sub_81C0F44 str r1, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C13B0 thumb_func_start sub_81C14BC sub_81C14BC: ; 81C14BC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x28 adds r7, r0, 0 adds r4, r1, 0 adds r6, r2, 0 lsls r4, 24 lsrs r4, 24 lsls r6, 24 lsrs r6, 24 ldr r0, =0x0203cf1c ldr r2, [r0] lsls r0, r4, 1 mov r10, r0 adds r1, r2, 0 adds r1, 0x84 adds r0, r1, r0 str r0, [sp, 0x8] ldrh r0, [r0] mov r3, sp adds r3, 0x2 str r3, [sp, 0x1C] strh r0, [r3] lsls r0, r6, 1 mov r9, r0 add r1, r9 str r1, [sp, 0xC] ldrh r1, [r1] mov r0, sp strh r1, [r0] adds r1, r2, 0 adds r1, 0x8C adds r3, r1, r4 str r3, [sp, 0x10] ldrb r0, [r3] mov r3, sp adds r3, 0x5 str r3, [sp, 0x24] strb r0, [r3] adds r1, r6 str r1, [sp, 0x14] ldrb r0, [r1] mov r1, sp adds r1, 0x4 str r1, [sp, 0x20] strb r0, [r1] adds r2, 0xA4 str r2, [sp, 0x18] ldrb r0, [r2] mov r5, sp adds r5, 0x6 strb r0, [r5] ldr r1, =gUnknown_08329D22 adds r0, r4, r1 ldrb r0, [r0] mov r8, r0 ldrb r0, [r5] adds r2, r0, 0 mov r3, r8 ands r2, r3 mov r3, r10 asrs r2, r3 lsls r2, 24 lsrs r2, 24 adds r1, r6, r1 ldrb r1, [r1] mov r12, r1 adds r1, r0, 0 mov r3, r12 ands r1, r3 mov r3, r9 asrs r1, r3 lsls r1, 24 lsrs r1, 24 mov r3, r8 bics r0, r3 strb r0, [r5] ldrb r0, [r5] mov r3, r12 bics r0, r3 strb r0, [r5] mov r0, r9 lsls r2, r0 mov r3, r10 lsls r1, r3 adds r2, r1 ldrb r0, [r5] orrs r0, r2 strb r0, [r5] adds r1, r4, 0 adds r1, 0xD adds r0, r7, 0 mov r2, sp bl pokemon_setattr adds r1, r6, 0 adds r1, 0xD adds r0, r7, 0 ldr r2, [sp, 0x1C] bl pokemon_setattr adds r4, 0x11 adds r0, r7, 0 adds r1, r4, 0 ldr r2, [sp, 0x20] bl pokemon_setattr adds r6, 0x11 adds r0, r7, 0 adds r1, r6, 0 ldr r2, [sp, 0x24] bl pokemon_setattr adds r0, r7, 0 movs r1, 0x15 adds r2, r5, 0 bl pokemon_setattr mov r0, sp ldrh r0, [r0] ldr r1, [sp, 0x8] strh r0, [r1] ldr r3, [sp, 0x1C] ldrh r0, [r3] ldr r1, [sp, 0xC] strh r0, [r1] ldr r3, [sp, 0x20] ldrb r0, [r3] ldr r1, [sp, 0x10] strb r0, [r1] ldr r3, [sp, 0x24] ldrb r0, [r3] ldr r1, [sp, 0x14] strb r0, [r1] ldrb r0, [r5] ldr r3, [sp, 0x18] strb r0, [r3] add sp, 0x28 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C14BC thumb_func_start sub_81C15EC sub_81C15EC: ; 81C15EC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x28 adds r7, r0, 0 adds r4, r1, 0 adds r6, r2, 0 lsls r4, 24 lsrs r4, 24 lsls r6, 24 lsrs r6, 24 ldr r0, =0x0203cf1c ldr r2, [r0] lsls r0, r4, 1 mov r10, r0 adds r1, r2, 0 adds r1, 0x84 adds r0, r1, r0 str r0, [sp, 0x8] ldrh r0, [r0] mov r3, sp adds r3, 0x2 str r3, [sp, 0x1C] strh r0, [r3] lsls r0, r6, 1 mov r9, r0 add r1, r9 str r1, [sp, 0xC] ldrh r1, [r1] mov r0, sp strh r1, [r0] adds r1, r2, 0 adds r1, 0x8C adds r3, r1, r4 str r3, [sp, 0x10] ldrb r0, [r3] mov r3, sp adds r3, 0x5 str r3, [sp, 0x24] strb r0, [r3] adds r1, r6 str r1, [sp, 0x14] ldrb r0, [r1] mov r1, sp adds r1, 0x4 str r1, [sp, 0x20] strb r0, [r1] adds r2, 0xA4 str r2, [sp, 0x18] ldrb r0, [r2] mov r5, sp adds r5, 0x6 strb r0, [r5] ldr r1, =gUnknown_08329D22 adds r0, r4, r1 ldrb r0, [r0] mov r8, r0 ldrb r0, [r5] adds r2, r0, 0 mov r3, r8 ands r2, r3 mov r3, r10 asrs r2, r3 lsls r2, 24 lsrs r2, 24 adds r1, r6, r1 ldrb r1, [r1] mov r12, r1 adds r1, r0, 0 mov r3, r12 ands r1, r3 mov r3, r9 asrs r1, r3 lsls r1, 24 lsrs r1, 24 mov r3, r8 bics r0, r3 strb r0, [r5] ldrb r0, [r5] mov r3, r12 bics r0, r3 strb r0, [r5] mov r0, r9 lsls r2, r0 mov r3, r10 lsls r1, r3 adds r2, r1 ldrb r0, [r5] orrs r0, r2 strb r0, [r5] adds r1, r4, 0 adds r1, 0xD adds r0, r7, 0 mov r2, sp bl pokemon_setattr_encrypted adds r1, r6, 0 adds r1, 0xD adds r0, r7, 0 ldr r2, [sp, 0x1C] bl pokemon_setattr_encrypted adds r4, 0x11 adds r0, r7, 0 adds r1, r4, 0 ldr r2, [sp, 0x20] bl pokemon_setattr_encrypted adds r6, 0x11 adds r0, r7, 0 adds r1, r6, 0 ldr r2, [sp, 0x24] bl pokemon_setattr_encrypted adds r0, r7, 0 movs r1, 0x15 adds r2, r5, 0 bl pokemon_setattr_encrypted mov r0, sp ldrh r0, [r0] ldr r1, [sp, 0x8] strh r0, [r1] ldr r3, [sp, 0x1C] ldrh r0, [r3] ldr r1, [sp, 0xC] strh r0, [r1] ldr r3, [sp, 0x20] ldrb r0, [r3] ldr r1, [sp, 0x10] strb r0, [r1] ldr r3, [sp, 0x24] ldrb r0, [r3] ldr r1, [sp, 0x14] strb r0, [r1] ldrb r0, [r5] ldr r3, [sp, 0x18] strb r0, [r3] add sp, 0x28 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C15EC thumb_func_start sub_81C171C sub_81C171C: ; 81C171C push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 bl sub_81C44F0 movs r0, 0x8 bl sub_81C4AF8 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81C174C str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C171C thumb_func_start sub_81C174C sub_81C174C: ; 81C174C push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C176A b @081C189A @081C176A: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r2, 0x80 adds r0, r2, 0 ands r0, r1 cmp r0, 0 beq @081C177A b @081C189A @081C177A: ldr r6, =0x030022c0 ldrh r1, [r6, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081C17B4 movs r0, 0x4 strh r0, [r4] movs r1, 0x1 negs r1, r1 ldr r0, =0x0203cf1c ldr r2, [r0] ldr r0, =0x000040c6 adds r2, r0 adds r0, r4, 0 bl sub_81C1070 b @081C189A .align 2, 0 .pool @081C17B4: adds r0, r2, 0 ands r0, r1 cmp r0, 0 beq @081C17DC movs r0, 0x4 strh r0, [r4] ldr r0, =0x0203cf1c ldr r2, [r0] ldr r1, =0x000040c6 adds r2, r1 adds r0, r4, 0 movs r1, 0x1 bl sub_81C1070 b @081C189A .align 2, 0 .pool @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, =0x0203cf21 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c6 adds r0, r1 ldrb r0, [r0] strb r0, [r2] ldr r1, =0x020375e2 ldrb r0, [r2] strh r0, [r1] adds r0, r5, 0 bl sub_81C044C b @081C189A .align 2, 0 .pool @081C1868: movs r0, 0x20 bl audio_play adds r0, r5, 0 bl sub_81C18F4 b @081C189A @081C1876: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C189A bl sub_81C48F0 movs r0, 0x5 bl audio_play ldr r1, =0x0203cf21 movs r0, 0x4 strb r0, [r1] ldr r1, =0x020375e2 movs r0, 0x4 strh r0, [r1] adds r0, r5, 0 bl sub_81C044C @081C189A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C174C thumb_func_start sub_81C18A8 sub_81C18A8: ; 81C18A8 push {lr} ldr r0, =0x0203cf1c ldr r2, [r0] ldr r0, =0x000040c6 adds r1, r2, r0 ldrb r0, [r1] cmp r0, 0x4 beq @081C18DA ldr r3, =0x000040c4 adds r0, r2, r3 ldrh r0, [r0] cmp r0, 0 beq @081C18DA ldrb r1, [r1] lsls r1, 1 adds r0, r2, 0 adds r0, 0x84 adds r0, r1 ldrh r0, [r0] bl sub_81B6D14 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C18EC @081C18DA: movs r0, 0x1 b @081C18EE .align 2, 0 .pool @081C18EC: movs r0, 0 @081C18EE: pop {r1} bx r1 thumb_func_end sub_81C18A8 thumb_func_start sub_81C18F4 sub_81C18F4: ; 81C18F4 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0xE bl 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, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81C1940 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C18F4 thumb_func_start sub_81C1940 sub_81C1940: ; 81C1940 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r7, r0, 24 lsls r0, r7, 2 adds r0, r7 lsls r0, 3 mov r8, r0 ldr r0, =0x03005e08 mov r9, r0 mov r4, r8 add r4, r9 ldr r0, =sub_81C1E20 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C196C b @081C1B74 @081C196C: ldr r6, =0x030022c0 ldrh r1, [r6, 0x2E] movs r0, 0x40 ands r0, r1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0 beq @081C19B0 movs r0, 0x1 strh r0, [r4, 0x2] movs r0, 0x4 strh r0, [r4] movs r1, 0x1 negs r1, r1 ldr r0, =0x0203cf1c ldr r2, [r0] ldr r0, =0x000040c6 adds r2, r0 adds r0, r4, 0 bl sub_81C1070 movs r0, 0 strh r0, [r4, 0x2] b @081C1B6A .align 2, 0 .pool @081C19B0: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081C19DC movs r0, 0x1 strh r0, [r4, 0x2] movs r0, 0x4 strh r0, [r4] ldr r0, =0x0203cf1c ldr r2, [r0] ldr r1, =0x000040c6 adds r2, r1 adds r0, r4, 0 movs r1, 0x1 bl sub_81C1070 strh r5, [r4, 0x2] b @081C1B6A .align 2, 0 .pool @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, =0x0203cf1c ldr r0, [r4] ldr r2, =0x000040c0 adds r0, r2 ldrb r0, [r0] cmp r0, 0x2 bne @081C1A00 b @081C1B74 @081C1A00: movs r0, 0x13 bl Window_FillTileMap ldr r2, =0x02020630 ldr r0, [r4] ldr r1, =0x000040d5 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @081C1A28 movs r0, 0xD bl Window_FillTileMap @081C1A28: ldr r1, [r4] ldr r2, =0x000040c6 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 1 adds r1, 0x84 adds r1, r0 ldrh r5, [r1] mov r0, r9 subs r0, 0x8 add r0, r8 ldr r1, =sub_81C174C str r1, [r0] movs r1, 0x1 negs r1, r1 adds r0, r7, 0 b @081C1ACE .align 2, 0 .pool @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, =0x0203cf1c ldr r0, [r4] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] cmp r0, 0x3 beq @081C1B74 movs r0, 0x13 bl Window_FillTileMap ldr r2, =0x02020630 ldr r0, [r4] ldr r1, =0x000040d5 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @081C1AB0 movs r0, 0xD bl Window_FillTileMap @081C1AB0: ldr r1, [r4] ldr r2, =0x000040c6 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 1 adds r1, 0x84 adds r1, r0 ldrh r5, [r1] mov r0, r9 subs r0, 0x8 add r0, r8 ldr r1, =sub_81C174C str r1, [r0] adds r0, r7, 0 movs r1, 0x1 @081C1ACE: bl sub_81C0A8C movs r4, 0x2 negs r4, r4 movs r0, 0x9 adds r1, r4, 0 bl sub_81C1DA4 movs r0, 0x9 adds r1, r4, 0 adds r2, r5, 0 bl sub_81C1EFC b @081C1B74 .align 2, 0 .pool @081C1B04: ldrh r1, [r6, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @081C1B74 movs r0, 0x13 bl Window_FillTileMap ldr r2, =0x02020630 ldr r4, =0x0203cf1c ldr r0, [r4] ldr r1, =0x000040d5 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @081C1B38 movs r0, 0xD bl Window_FillTileMap @081C1B38: ldr r1, [r4] ldr r2, =0x000040c6 adds r0, r1, r2 ldrb r0, [r0] lsls r0, 1 adds r1, 0x84 adds r1, r0 ldrh r5, [r1] adds r0, r5, 0 bl sub_81C3E9C movs r0, 0 bl schedule_bg_copy_tilemap_to_vram movs r4, 0x3 negs r4, r4 movs r0, 0x9 adds r1, r4, 0 bl sub_81C1DA4 movs r0, 0x9 adds r1, r4, 0 adds r2, r5, 0 bl sub_81C1EFC @081C1B6A: mov r0, r9 subs r0, 0x8 add r0, r8 ldr r1, =sub_81C174C str r1, [r0] @081C1B74: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C1940 thumb_func_start sub_81C1B94 sub_81C1B94: ; 81C1B94 ldr r0, =0x0203cf21 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81C1B94 thumb_func_start sub_81C1BA0 sub_81C1BA0: ; 81C1BA0 push {r4-r7,lr} sub sp, 0xC movs r0, 0x20 bl malloc adds r4, r0, 0 movs r5, 0 @081C1BAE: lsls r0, r5, 25 lsrs r1, r0, 24 adds r6, r1, 0 ldr r0, =0x0203cf1c ldr r3, [r0] ldr r2, =0x000040c1 adds r0, r3, r2 ldrb r0, [r0] cmp r5, r0 bcs @081C1BD8 lsls r0, r1, 1 adds r0, r4 movs r1, 0x40 strh r1, [r0] strh r1, [r0, 0x2] movs r1, 0x50 b @081C1BEE .align 2, 0 .pool @081C1BD8: ldr r7, =0x000040c2 adds r0, r3, r7 ldrb r2, [r0] cmp r5, r2 bls @081C1BF8 lsls r0, r1, 1 adds r0, r4 movs r1, 0x4A strh r1, [r0] strh r1, [r0, 0x2] movs r1, 0x5A @081C1BEE: strh r1, [r0, 0x10] strh r1, [r0, 0x12] b @081C1C78 .align 2, 0 .pool @081C1BF8: ldr r7, =0x000040c0 adds r0, r3, r7 ldrb r0, [r0] cmp r5, r0 bcs @081C1C1C lsls r1, 1 adds r1, r4 movs r0, 0x46 strh r0, [r1] movs r0, 0x47 strh r0, [r1, 0x2] movs r0, 0x56 strh r0, [r1, 0x10] movs r0, 0x57 b @081C1C76 .align 2, 0 .pool @081C1C1C: cmp r5, r0 bne @081C1C4C cmp r5, r2 beq @081C1C38 lsls r1, 1 adds r1, r4 movs r0, 0x41 strh r0, [r1] movs r0, 0x42 strh r0, [r1, 0x2] movs r0, 0x51 strh r0, [r1, 0x10] movs r0, 0x52 b @081C1C76 @081C1C38: lsls r1, 1 adds r1, r4 movs r0, 0x4B strh r0, [r1] movs r0, 0x4C strh r0, [r1, 0x2] movs r0, 0x5B strh r0, [r1, 0x10] movs r0, 0x5C b @081C1C76 @081C1C4C: cmp r5, r2 beq @081C1C64 lsls r1, 1 adds r1, r4 movs r0, 0x43 strh r0, [r1] movs r0, 0x44 strh r0, [r1, 0x2] movs r0, 0x53 strh r0, [r1, 0x10] movs r0, 0x54 b @081C1C76 @081C1C64: lsls r1, r6, 1 adds r1, r4 movs r0, 0x48 strh r0, [r1] movs r0, 0x49 strh r0, [r1, 0x2] movs r0, 0x58 strh r0, [r1, 0x10] movs r0, 0x59 @081C1C76: strh r0, [r1, 0x12] @081C1C78: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x3 bls @081C1BAE movs r0, 0x8 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x10 str r0, [sp, 0x8] movs r0, 0x3 adds r1, r4, 0 movs r2, 0xB movs r3, 0 bl 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, =0x001fffff ands r2, r3 bl CpuSet adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 ldrb r3, [r4, 0x7] cmp r5, r3 bcc @081C1D00 b @081C1D60 .align 2, 0 .pool @081C1D30: movs r5, 0 ldrb r0, [r4, 0x7] cmp r5, r0 bcs @081C1D60 @081C1D38: ldrb r2, [r4, 0x6] adds r1, r2, 0 muls r1, r5 lsls r3, r1, 1 ldr r0, [r4] adds r0, r3 adds r1, r6, r1 lsls r1, 1 adds r1, r7, r1 subs r2, r6 ldr r3, =0x001fffff ands r2, r3 bl CpuSet adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 ldrb r3, [r4, 0x7] cmp r5, r3 bcc @081C1D38 @081C1D60: movs r5, 0 b @081C1D8A .align 2, 0 .pool @081C1D68: ldrb r2, [r4, 0x6] adds r0, r2, 0 muls r0, r5 lsls r0, 1 adds r0, r7, r0 ldrb r1, [r4, 0x9] adds r1, r5 lsls r1, 5 ldrb r3, [r4, 0x8] adds r1, r3 lsls r1, 1 add r1, r8 bl CpuSet adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 @081C1D8A: ldrb r0, [r4, 0x7] cmp r5, r0 bcc @081C1D68 adds r0, r7, 0 bl free add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C1CB0 thumb_func_start sub_81C1DA4 sub_81C1DA4: ; 81C1DA4 push {r4-r6,lr} lsls r0, 16 lsrs r6, r0, 16 lsls r1, 16 lsrs r4, r1, 16 asrs r1, 16 ldr r3, =gUnknown_0861CC04 ldrb r2, [r3, 0x6] cmp r1, r2 ble @081C1DBA adds r4, r2, 0 @081C1DBA: lsls r0, r4, 16 asrs r0, 16 cmp r0, 0 beq @081C1DC6 cmp r0, r2 bne @081C1DE8 @081C1DC6: ldr r0, =0x0203cf1c ldr r1, [r0] ldr r0, =0x000020bc adds r1, r0 lsls r2, r4, 24 lsrs r2, 24 adds r0, r3, 0 movs r3, 0x1 bl sub_81C1CB0 b @081C1E12 .align 2, 0 .pool @081C1DE8: ldr r5, =sub_81C1E20 adds r0, r5, 0 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF bne @081C1E04 adds r0, r5, 0 movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r2, r0, 24 @081C1E04: ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 strh r4, [r0, 0x8] strh r6, [r0, 0xA] @081C1E12: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C1DA4 thumb_func_start sub_81C1E20 sub_81C1E20: ; 81C1E20 push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4] ldrh r1, [r4, 0x2] adds r0, r1 strh r0, [r4, 0x2] lsls r0, 16 cmp r0, 0 bge @081C1E50 movs r0, 0 strh r0, [r4, 0x2] ldr r7, =gUnknown_0861CC04 b @081C1E60 .align 2, 0 .pool @081C1E50: movs r0, 0x2 ldrsh r1, [r4, r0] ldr r0, =gUnknown_0861CC04 ldrb r2, [r0, 0x6] adds r7, r0, 0 cmp r1, r2 ble @081C1E60 strh r2, [r4, 0x2] @081C1E60: ldr r5, =0x0203cf1c ldr r1, [r5] ldr r0, =0x000020bc adds r1, r0 ldrb r2, [r4, 0x2] adds r0, r7, 0 movs r3, 0x1 bl sub_81C1CB0 movs r1, 0x2 ldrsh r0, [r4, r1] cmp r0, 0 ble @081C1E80 ldrb r7, [r7, 0x6] cmp r0, r7 blt @081C1EE0 @081C1E80: movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0 bge @081C1EAC ldr r0, [r5] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] cmp r0, 0x2 bne @081C1ED4 movs r0, 0xE bl Window_WriteStandardTileMap b @081C1ED4 .align 2, 0 .pool @081C1EAC: ldr r2, =0x02020630 ldr r0, [r5] ldr r1, =0x000040d5 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @081C1ECE movs r0, 0xD bl 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 .pool thumb_func_end sub_81C1E20 thumb_func_start sub_81C1EFC sub_81C1EFC: ; 81C1EFC push {r4-r7,lr} lsls r0, 16 lsrs r7, r0, 16 lsls r1, 16 lsls r2, 16 lsrs r6, r2, 16 lsrs r4, r1, 16 asrs r1, 16 ldr r3, =gUnknown_0861CC10 ldrb r2, [r3, 0x6] cmp r1, r2 ble @081C1F16 adds r4, r2, 0 @081C1F16: lsls r0, r4, 16 asrs r0, 16 cmp r0, 0 beq @081C1F22 cmp r0, r2 bne @081C1F44 @081C1F22: ldr r0, =0x0203cf1c ldr r1, [r0] ldr r0, =0x000030bc adds r1, r0 lsls r2, r4, 24 lsrs r2, 24 adds r0, r3, 0 movs r3, 0x1 bl sub_81C1CB0 b @081C1F70 .align 2, 0 .pool @081C1F44: ldr r5, =sub_81C1F80 adds r0, r5, 0 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF bne @081C1F60 adds r0, r5, 0 movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r2, r0, 24 @081C1F60: ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 strh r4, [r0, 0x8] strh r7, [r0, 0xA] strh r6, [r0, 0xC] @081C1F70: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C1EFC thumb_func_start sub_81C1F80 sub_81C1F80: ; 81C1F80 push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4] ldrh r1, [r4, 0x2] adds r0, r1 strh r0, [r4, 0x2] lsls r0, 16 cmp r0, 0 bge @081C1FB0 movs r0, 0 strh r0, [r4, 0x2] ldr r7, =gUnknown_0861CC10 b @081C1FC0 .align 2, 0 .pool @081C1FB0: movs r0, 0x2 ldrsh r1, [r4, r0] ldr r0, =gUnknown_0861CC10 ldrb r2, [r0, 0x6] adds r7, r0, 0 cmp r1, r2 ble @081C1FC0 strh r2, [r4, 0x2] @081C1FC0: ldr r5, =0x0203cf1c ldr r1, [r5] ldr r0, =0x000030bc adds r1, r0 ldrb r2, [r4, 0x2] adds r0, r7, 0 movs r3, 0x1 bl sub_81C1CB0 movs r1, 0x2 ldrsh r0, [r4, r1] cmp r0, 0 ble @081C1FE0 ldrb r7, [r7, 0x6] cmp r0, r7 blt @081C2058 @081C1FE0: movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0 bge @081C2024 ldr r0, [r5] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] cmp r0, 0x3 bne @081C2006 ldr r0, =sub_81C0B8C bl is_function_an_active_task lsls r0, 24 cmp r0, 0 bne @081C2006 movs r0, 0xF bl Window_WriteStandardTileMap @081C2006: ldrh r0, [r4, 0x4] bl sub_81C240C b @081C204C .align 2, 0 .pool @081C2024: ldr r2, =0x02020630 ldr r0, [r5] ldr r1, =0x000040d5 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 adds r0, 0x3E ldrb r0, [r0] lsls r0, 29 cmp r0, 0 blt @081C2046 movs r0, 0xD bl 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 .pool thumb_func_end sub_81C1F80 thumb_func_start sub_81C2074 sub_81C2074: ; 81C2074 push {r4,r5,lr} lsls r0, 16 lsrs r5, r0, 16 lsls r1, 16 lsrs r4, r1, 16 asrs r1, 16 ldr r3, =gUnknown_0861CBEC ldrb r2, [r3, 0x6] cmp r1, r2 ble @081C208A adds r4, r2, 0 @081C208A: lsls r0, r4, 16 asrs r0, 16 cmp r0, 0 beq @081C2096 cmp r0, r2 bne @081C20C8 @081C2096: ldr r5, =0x0203cf1c ldr r1, [r5] adds r1, 0xBC lsls r4, 24 lsrs r4, 24 adds r0, r3, 0 adds r2, r4, 0 movs r3, 0 bl sub_81C1CB0 ldr r0, =gUnknown_0861CBF8 ldr r1, [r5] adds r1, 0xBC adds r2, r4, 0 movs r3, 0 bl sub_81C1CB0 b @081C20E2 .align 2, 0 .pool @081C20C8: ldr r0, =sub_81C20F0 movs r1, 0x8 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] strh r5, [r1, 0xA] @081C20E2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2074 thumb_func_start sub_81C20F0 sub_81C20F0: ; 81C20F0 push {r4-r7,lr} lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 ldrh r0, [r5] ldrh r1, [r5, 0x2] adds r0, r1 strh r0, [r5, 0x2] lsls r0, 16 cmp r0, 0 bge @081C2120 movs r0, 0 strh r0, [r5, 0x2] ldr r7, =gUnknown_0861CBEC b @081C2130 .align 2, 0 .pool @081C2120: movs r0, 0x2 ldrsh r1, [r5, r0] ldr r0, =gUnknown_0861CBEC ldrb r2, [r0, 0x6] adds r7, r0, 0 cmp r1, r2 ble @081C2130 strh r2, [r5, 0x2] @081C2130: ldr r4, =0x0203cf1c ldr r1, [r4] adds r1, 0xBC ldrb r2, [r5, 0x2] adds r0, r7, 0 movs r3, 0 bl sub_81C1CB0 ldr r0, =gUnknown_0861CBF8 ldr r1, [r4] adds r1, 0xBC ldrb r2, [r5, 0x2] movs r3, 0 bl sub_81C1CB0 movs r0, 0x3 bl schedule_bg_copy_tilemap_to_vram movs r1, 0x2 ldrsh r0, [r5, r1] cmp r0, 0 ble @081C2162 ldrb r7, [r7, 0x6] cmp r0, r7 blt @081C2180 @081C2162: movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0 bge @081C217A bl sub_81C4A88 movs r0, 0xD bl 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 .pool thumb_func_end sub_81C20F0 thumb_func_start sub_81C2194 sub_81C2194: ; 81C2194 push {r4-r7,lr} adds r6, r0, 0 lsls r2, 24 lsls r1, 28 lsrs r4, r1, 16 ldr r7, =0x0000056a cmp r2, 0 bne @081C21E4 movs r3, 0 ldr r5, =gUnknown_08DC3CD4 @081C21A8: adds r2, r7, r3 lsls r2, 1 adds r2, r6 lsls r0, r3, 1 adds r0, r5 ldrh r1, [r0] adds r1, r4, r1 strh r1, [r2] adds r0, r2, 0 adds r0, 0x40 strh r1, [r0] adds r2, 0x80 adds r0, r3, 0 adds r0, 0x14 lsls r0, 1 adds r0, r5 ldrh r0, [r0] adds r0, r4, r0 strh r0, [r2] adds r0, r3, 0x1 lsls r0, 16 lsrs r3, r0, 16 cmp r3, 0x13 bls @081C21A8 b @081C221C .align 2, 0 .pool @081C21E4: movs r3, 0 ldr r5, =gUnknown_08DC3CD4 @081C21E8: adds r1, r7, r3 lsls r1, 1 adds r1, r6 adds r0, r3, 0 adds r0, 0x14 lsls r0, 1 adds r0, r5 ldrh r0, [r0] adds r0, r4, r0 strh r0, [r1] adds r2, r1, 0 adds r2, 0x40 adds r0, r3, 0 adds r0, 0x28 lsls r0, 1 adds r0, r5 ldrh r0, [r0] adds r0, r4, r0 strh r0, [r2] adds r1, 0x80 strh r0, [r1] adds r0, r3, 0x1 lsls r0, 16 lsrs r3, r0, 16 cmp r3, 0x13 bls @081C21E8 @081C221C: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2194 thumb_func_start sub_81C2228 sub_81C2228: ; 81C2228 push {r4,lr} adds r4, r0, 0 movs r1, 0 bl sub_806DD7C lsls r0, 24 cmp r0, 0 bne @081C225C adds r0, r4, 0 movs r1, 0 bl sub_806DDE4 lsls r0, 24 cmp r0, 0 beq @081C225C ldr r0, =0x0203cf1c ldr r0, [r0] ldr r2, =0x00000502 adds r1, r0, r2 movs r2, 0x2C b @081C2266 .align 2, 0 .pool @081C225C: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r2, =0x00000502 adds r1, r0, r2 ldr r2, =0x0000081a @081C2266: strh r2, [r1] ldr r1, =0x00000d02 adds r0, r1 strh r2, [r0] movs r0, 0x3 bl schedule_bg_copy_tilemap_to_vram pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2228 thumb_func_start sub_81C228C sub_81C228C: ; 81C228C push {lr} sub sp, 0x8 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @081C22AC movs r0, 0x8 str r0, [sp] str r1, [sp, 0x4] movs r0, 0x3 movs r1, 0x1 movs r2, 0x4 movs r3, 0x8 bl sub_8199C30 b @081C22C0 @081C22AC: movs r0, 0x8 str r0, [sp] movs r0, 0x5 str r0, [sp, 0x4] movs r0, 0x3 movs r1, 0x1 movs r2, 0x4 movs r3, 0x8 bl sub_8199C30 @081C22C0: movs r0, 0x3 bl schedule_bg_copy_tilemap_to_vram add sp, 0x8 pop {r0} bx r0 thumb_func_end sub_81C228C thumb_func_start sub_81C22CC sub_81C22CC: ; 81C22CC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} ldr r0, =0x0203cf1c ldr r1, [r0] adds r6, r1, 0 adds r6, 0x70 ldrb r1, [r6, 0x5] mov r8, r0 cmp r1, 0x63 bhi @081C2340 ldr r5, =gExperienceTables adds r2, r1, 0 adds r1, r2, 0x1 lsls r1, 2 ldr r4, =gBaseStats ldrh r3, [r6] lsls r0, r3, 3 subs r0, r3 lsls r0, 2 adds r0, r4 ldrb r3, [r0, 0x13] movs r0, 0xCA lsls r0, 1 muls r0, r3 adds r1, r0 adds r1, r5 lsls r2, 2 adds r2, r0 adds r2, r5 ldr r1, [r1] ldr r2, [r2] subs r1, r2 ldr r0, [r6, 0x10] subs r4, r0, r2 lsls r0, r4, 6 bl __udivsi3 adds r6, r0, 0 movs r7, 0 adds r0, r7, 0 orrs r0, r6 cmp r0, 0 bne @081C2344 cmp r4, 0 beq @081C2344 movs r6, 0x1 movs r7, 0 b @081C2344 .align 2, 0 .pool @081C2340: movs r6, 0 movs r7, 0 @081C2344: mov r1, r8 ldr r0, [r1] ldr r2, =0x00001d66 adds r2, r0 mov r9, r2 movs r0, 0 mov r12, r0 ldr r1, =0x00002062 mov r10, r1 @081C2356: cmp r7, 0 bgt @081C2362 cmp r7, 0 bne @081C237C cmp r6, 0x7 bls @081C237C @081C2362: mov r2, r12 lsls r0, r2, 1 add r0, r9 ldr r2, =0x0000206a adds r1, r2, 0 strh r1, [r0] b @081C23B6 .align 2, 0 .pool @081C237C: mov r1, r12 lsls r0, r1, 1 add r0, r9 mov r8, r0 adds r5, r7, 0 adds r4, r6, 0 cmp r7, 0 bge @081C2394 movs r4, 0x7 movs r5, 0 adds r4, r6 adcs r5, r7 @081C2394: lsls r3, r5, 29 lsrs r2, r4, 3 adds r0, r3, 0 orrs r0, r2 asrs r1, r5, 3 lsrs r5, r0, 29 lsls r4, r1, 3 adds r3, r5, 0 orrs r3, r4 lsls r2, r0, 3 adds r1, r7, 0 adds r0, r6, 0 subs r0, r2 sbcs r1, r3 add r0, r10 mov r2, r8 strh r0, [r2] @081C23B6: movs r0, 0x8 negs r0, r0 asrs r1, r0, 31 adds r6, r0 adcs r7, r1 cmp r7, 0 bge @081C23C8 movs r6, 0 movs r7, 0 @081C23C8: mov r0, r12 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r12, r0 cmp r0, 0x7 bls @081C2356 movs r0, 0x1 bl bg_get_tilemap ldr r1, =0x0203cf1c ldr r1, [r1] ldr r2, =0x000010bc adds r1, r2 cmp r0, r1 bne @081C23F8 movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram b @081C23FE .align 2, 0 .pool @081C23F8: movs r0, 0x2 bl schedule_bg_copy_tilemap_to_vram @081C23FE: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C22CC thumb_func_start sub_81C240C sub_81C240C: ; 81C240C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 16 lsrs r3, r0, 16 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000038bc adds r5, r0, r1 cmp r3, 0 beq @081C2510 ldr r1, =gContestEffects ldr r2, =gContestMoves lsls r3, 3 adds r0, r3, r2 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldrb r4, [r0, 0x1] mov r9, r1 mov r8, r2 mov r10, r3 cmp r4, 0xFF beq @081C244C adds r0, r4, 0 movs r1, 0xA bl __udivsi3 lsls r0, 24 lsrs r4, r0, 24 @081C244C: movs r2, 0 movs r6, 0x3 movs r3, 0xF3 lsls r3, 2 @081C2454: cmp r4, 0xFF beq @081C2484 cmp r2, r4 bcs @081C2484 lsrs r0, r2, 2 adds r1, r2, 0 ands r1, r6 lsls r0, 5 adds r0, r1 lsls r0, 1 adds r0, r5 adds r0, r3 ldr r7, =0x0000103a b @081C2496 .align 2, 0 .pool @081C2484: lsrs r0, r2, 2 adds r1, r2, 0 ands r1, r6 lsls r0, 5 adds r0, r1 lsls r0, 1 adds r0, r5 adds r0, r3 ldr r7, =0x00001039 @081C2496: adds r1, r7, 0 strh r1, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x7 bls @081C2454 mov r0, r10 add r0, r8 ldrb r0, [r0] lsls r0, 2 add r0, r9 ldrb r4, [r0, 0x2] cmp r4, 0xFF beq @081C24C0 adds r0, r4, 0 movs r1, 0xA bl __udivsi3 lsls r0, 24 lsrs r4, r0, 24 @081C24C0: movs r2, 0 movs r6, 0x3 ldr r3, =0x0000044c @081C24C6: cmp r4, 0xFF beq @081C24F0 cmp r2, r4 bcs @081C24F0 lsrs r0, r2, 2 adds r1, r2, 0 ands r1, r6 lsls r0, 5 adds r0, r1 lsls r0, 1 adds r0, r5 adds r0, r3 ldr r7, =0x0000103c b @081C2502 .align 2, 0 .pool @081C24F0: lsrs r0, r2, 2 adds r1, r2, 0 ands r1, r6 lsls r0, 5 adds r0, r1 lsls r0, 1 adds r0, r5 adds r0, r3 ldr r7, =0x0000103d @081C2502: adds r1, r7, 0 strh r1, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x7 bls @081C24C6 @081C2510: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C240C thumb_func_start sub_81C2524 sub_81C2524: ; 81C2524 push {lr} ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0x74 ldrb r0, [r0] cmp r0, 0 beq @081C2544 movs r1, 0x80 lsls r1, 9 movs r0, 0x3 movs r2, 0 bl bg_change_x_offset b @081C254E .align 2, 0 .pool @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, =gUnknown_0861CC24 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, =0x0203cf1c ldr r3, =0x000040cb movs r2, 0xFF @081C257C: ldr r0, [r5] adds r0, r3 adds r0, r4 ldrb r1, [r0] orrs r1, r2 strb r1, [r0] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x7 bls @081C257C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2554 thumb_func_start sub_81C25A4 sub_81C25A4: ; 81C25A4 push {r4-r6,lr} sub sp, 0x14 ldr r4, [sp, 0x24] ldr r5, [sp, 0x28] lsls r0, 24 lsrs r0, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 movs r6, 0 str r6, [sp] str r4, [sp, 0x4] lsls r4, r5, 1 adds r4, r5 ldr r5, =gUnknown_0861CD2C adds r4, r5 str r4, [sp, 0x8] str r6, [sp, 0xC] str r1, [sp, 0x10] movs r1, 0x1 bl sub_8199EEC add sp, 0x14 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cf1c ldr r0, [r0] adds r0, 0x74 ldrb r0, [r0] cmp r0, 0 bne @081C2618 bl sub_81C2628 b @081C261C .align 2, 0 .pool @081C2618: bl sub_81C2794 @081C261C: movs r0, 0 bl schedule_bg_copy_tilemap_to_vram pop {r0} bx r0 thumb_func_end sub_81C25E8 thumb_func_start sub_81C2628 sub_81C2628: ; 81C2628 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x18 ldr r0, =0x0203cf1c ldr r0, [r0] movs r1, 0xC adds r1, r0 mov r8, r1 adds r7, r0, 0 adds r7, 0x70 ldrh r0, [r7] bl sub_806E3C0 lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x0000ffff cmp r5, r0 beq @081C26CE ldr r6, =0x02021cc4 ldr r1, =gUnknown_085E8D4F adds r0, r6, 0 bl gf_strcpy ldr r4, =0x02021dc4 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 .pool @081C26AC: movs r0, 0 str r0, [sp] movs r0, 0x7 str r0, [sp, 0x4] movs r0, 0x11 adds r1, r6, 0 movs r2, 0 movs r3, 0x1 bl sub_81C25A4 movs r0, 0x1 bl sub_81C228C @081C26C6: movs r0, 0x11 bl 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, =0x02021cc4 ldr r1, =gUnknown_085E8D4D adds r0, r4, 0 bl gf_strcpy ldr r5, =0x02021dc4 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, =gSpeciesNames 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 .pool thumb_func_end sub_81C2628 thumb_func_start sub_81C2794 sub_81C2794: ; 81C2794 push {r4,lr} sub sp, 0x8 ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0xC ldr r4, =0x02021cc4 adds r1, r4, 0 bl 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 .pool thumb_func_end sub_81C2794 thumb_func_start sub_81C27DC sub_81C27DC: ; 81C27DC push {lr} sub sp, 0x8 lsls r1, 16 lsrs r1, 16 cmp r1, 0x20 beq @081C282C cmp r1, 0x1D beq @081C282C bl pokemon_get_gender lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @081C27FE cmp r0, 0xFE beq @081C2818 b @081C282C @081C27FE: ldr r1, =gUnknown_085E8D49 str r0, [sp] movs r0, 0x3 str r0, [sp, 0x4] movs r0, 0x13 movs r2, 0x39 movs r3, 0x11 bl sub_81C25A4 b @081C282C .align 2, 0 .pool @081C2818: ldr r1, =gUnknown_085E8D4B movs r0, 0 str r0, [sp] movs r0, 0x4 str r0, [sp, 0x4] movs r0, 0x13 movs r2, 0x39 movs r3, 0x11 bl sub_81C25A4 @081C282C: add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C27DC thumb_func_start sub_81C2838 sub_81C2838: ; 81C2838 push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 lsls r1, 24 ldr r3, =gUnknown_0861CDD3 cmp r1, 0 bne @081C284A subs r3, 0x80 @081C284A: lsls r2, 16 lsrs r2, 16 movs r0, 0x10 str r0, [sp] str r0, [sp, 0x4] adds r0, r4, 0 adds r1, r3, 0 movs r3, 0 bl Window_CopyWholePixelBlockToWindow add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2838 thumb_func_start sub_81C286C sub_81C286C: ; 81C286C push {r4-r7,lr} sub sp, 0x8 ldr r1, =gUnknown_085EA3CF movs r5, 0 str r5, [sp] movs r6, 0x1 str r6, [sp, 0x4] movs r0, 0 movs r2, 0x2 movs r3, 0x1 bl sub_81C25A4 ldr r1, =gUnknown_085EA3DC str r5, [sp] str r6, [sp, 0x4] movs r0, 0x1 movs r2, 0x2 movs r3, 0x1 bl sub_81C25A4 ldr r1, =gUnknown_085EA3EB str r5, [sp] str r6, [sp, 0x4] movs r0, 0x2 movs r2, 0x2 movs r3, 0x1 bl sub_81C25A4 ldr r1, =gUnknown_085EA3F8 str r5, [sp] str r6, [sp, 0x4] movs r0, 0x3 movs r2, 0x2 movs r3, 0x1 bl sub_81C25A4 ldr r7, =gUnknown_085E8CF7 movs r0, 0x1 adds r1, r7, 0 movs r2, 0x3E bl 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, =gUnknown_085EA406 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, =gUnknown_085EA3C8 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, =gUnknown_085EA369 str r5, [sp] str r6, [sp, 0x4] movs r0, 0x8 movs r2, 0 movs r3, 0x1 bl sub_81C25A4 ldr r1, =gUnknown_085EA378 str r5, [sp] str r5, [sp, 0x4] movs r0, 0x9 movs r2, 0 movs r3, 0x1 bl sub_81C25A4 ldr r4, =gUnknown_085EA361 movs r0, 0x1 adds r1, r4, 0 movs r2, 0x2A bl 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, =gUnknown_085EA33C 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, =gUnknown_085EA343 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, =gUnknown_085EA34B 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, =gUnknown_085EA353 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, =gUnknown_085EA35B 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, =gUnknown_085EA39F str r5, [sp] str r6, [sp, 0x4] movs r0, 0xC movs r2, 0x6 movs r3, 0x1 bl sub_81C25A4 ldr r1, =gUnknown_085EA3AB str r5, [sp] str r6, [sp, 0x4] movs r0, 0xC movs r2, 0x6 movs r3, 0x11 bl sub_81C25A4 ldr r1, =gUnknown_085EA398 str r5, [sp] str r6, [sp, 0x4] movs r0, 0xD movs r2, 0x2 movs r3, 0x1 bl sub_81C25A4 ldr r1, =gUnknown_085EA37E str r5, [sp] str r6, [sp, 0x4] movs r0, 0xE movs r2, 0 movs r3, 0x1 bl sub_81C25A4 ldr r1, =gUnknown_085EA384 str r5, [sp] str r6, [sp, 0x4] movs r0, 0xE movs r2, 0 movs r3, 0x11 bl sub_81C25A4 ldr r1, =gUnknown_085EA38D str r5, [sp] str r6, [sp, 0x4] movs r0, 0xF movs r2, 0 movs r3, 0x1 bl sub_81C25A4 ldr r1, =gUnknown_085EA394 str r5, [sp] str r6, [sp, 0x4] movs r0, 0xF movs r2, 0 movs r3, 0x11 bl sub_81C25A4 add sp, 0x8 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C286C thumb_func_start sub_81C2AFC sub_81C2AFC: ; 81C2AFC push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 movs r0, 0 bl 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, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040bc adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x3 bne @081C2BBC adds r2, 0x8 adds r0, r1, r2 ldr r0, [r0] ldr r1, =0x00ffffff ands r0, r1 movs r1, 0x80 lsls r1, 11 cmp r0, r1 beq @081C2C06 movs r0, 0xE bl Window_WriteStandardTileMap b @081C2C06 .align 2, 0 .pool @081C2BBC: movs r0, 0x5 bl Window_WriteStandardTileMap b @081C2C06 @081C2BC4: movs r0, 0x3 bl Window_WriteStandardTileMap ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040bc adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x3 bne @081C2C00 adds r2, 0x8 adds r0, r1, r2 ldr r0, [r0] ldr r1, =0x00ffffff ands r0, r1 movs r1, 0x80 lsls r1, 11 cmp r0, r1 beq @081C2C06 movs r0, 0xF bl Window_WriteStandardTileMap b @081C2C06 .align 2, 0 .pool @081C2C00: movs r0, 0x5 bl Window_WriteStandardTileMap @081C2C06: movs r4, 0 ldr r5, =0x0203cf1c @081C2C0A: ldr r0, [r5] ldr r1, =0x000040cb 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 .pool thumb_func_end sub_81C2AFC thumb_func_start sub_81C2C38 sub_81C2C38: ; 81C2C38 push {r4,lr} lsls r0, 24 lsrs r0, 24 adds r1, r0, 0 cmp r0, 0x1 beq @081C2C84 cmp r0, 0x1 bgt @081C2C4E cmp r0, 0 beq @081C2C58 b @081C2D0E @081C2C4E: cmp r1, 0x2 beq @081C2C98 cmp r1, 0x3 beq @081C2CD4 b @081C2D0E @081C2C58: movs r0, 0x4 bl 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, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040bc adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x3 bne @081C2CCC adds r2, 0x8 adds r0, r1, r2 ldr r0, [r0] ldr r1, =0x00ffffff ands r0, r1 movs r1, 0x80 lsls r1, 11 cmp r0, r1 beq @081C2D0E movs r0, 0xE bl Window_FillTileMap b @081C2D0E .align 2, 0 .pool @081C2CCC: movs r0, 0x5 bl Window_FillTileMap b @081C2D0E @081C2CD4: ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040bc adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x3 bne @081C2D08 adds r2, 0x8 adds r0, r1, r2 ldr r0, [r0] ldr r1, =0x00ffffff ands r0, r1 movs r1, 0x80 lsls r1, 11 cmp r0, r1 beq @081C2D0E movs r0, 0xF bl Window_FillTileMap b @081C2D0E .align 2, 0 .pool @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, =0x0203cf1c ldr r4, =0x000040cb adds r1, r2, r4 ldr r0, [r0] adds r4, r0, r1 ldrb r0, [r4] cmp r0, 0xFF bne @081C2D56 lsls r0, r2, 3 adds r0, r3, r0 bl 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 .pool thumb_func_end sub_81C2D2C thumb_func_start sub_81C2D68 sub_81C2D68: ; 81C2D68 push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203cf1c ldr r2, =0x000040cb adds r0, r2 ldr r1, [r1] adds r4, r1, r0 ldrb r0, [r4] cmp r0, 0xFF beq @081C2D8C bl Window_FillTileMap ldrb r0, [r4] bl Window_Remove movs r0, 0xFF strb r0, [r4] @081C2D8C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2D68 thumb_func_start sub_81C2D9C sub_81C2D9C: ; 81C2D9C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 @081C2DA4: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040cb adds r0, r1 adds r1, r0, r4 ldrb r0, [r1] cmp r0, 0xFF beq @081C2DBA movs r1, 0 bl Window_FastFillPixels @081C2DBA: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x7 bls @081C2DA4 ldr r0, =gUnknown_0861CE54 lsls r1, r5, 2 adds r1, r0 ldr r0, [r1] bl _call_via_r0 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2D9C thumb_func_start sub_81C2DE4 sub_81C2DE4: ; 81C2DE4 push {lr} lsls r0, 24 ldr r1, =gUnknown_0861CE64 lsrs r0, 22 adds r0, r1 ldr r0, [r0] movs r1, 0x10 bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2DE4 thumb_func_start sub_81C2E00 sub_81C2E00: ; 81C2E00 push {lr} ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0x74 ldrb r0, [r0] cmp r0, 0 beq @081C2E24 bl sub_81C335C bl sub_81C33CC bl sub_81C3428 bl sub_81C349C b @081C2E3C .align 2, 0 .pool @081C2E24: bl sub_81C2EC4 bl sub_81C2F5C bl sub_81C2FD8 bl sub_81C302C bl sub_81C307C bl sub_81C3194 @081C2E3C: pop {r0} bx r0 thumb_func_end sub_81C2E00 thumb_func_start sub_81C2E40 sub_81C2E40: ; 81C2E40 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4] subs r0, 0x1 lsls r0, 16 asrs r0, 16 cmp r0, 0x6 bhi @081C2EB8 lsls r0, 2 ldr r1, =@081C2E70 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C2E70: .4byte @081C2E8C .4byte @081C2E92 .4byte @081C2E98 .4byte @081C2E9E .4byte @081C2EA4 .4byte @081C2EAA .4byte @081C2EB0 @081C2E8C: bl sub_81C2EC4 b @081C2EB8 @081C2E92: bl sub_81C2F5C b @081C2EB8 @081C2E98: bl sub_81C2FD8 b @081C2EB8 @081C2E9E: bl sub_81C302C b @081C2EB8 @081C2EA4: bl sub_81C307C b @081C2EB8 @081C2EAA: bl sub_81C3194 b @081C2EB8 @081C2EB0: adds r0, r2, 0 bl remove_task b @081C2EBE @081C2EB8: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @081C2EBE: pop {r4} pop {r0} bx r0 thumb_func_end sub_81C2E40 thumb_func_start sub_81C2EC4 sub_81C2EC4: ; 81C2EC4 push {r4-r6,lr} sub sp, 0x8 bl sub_81A6BF4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C2F54 bl sub_81B9E94 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C2F54 ldr r0, =gUnknown_0861CCCC movs r1, 0 bl sub_81C2D2C lsls r0, 24 lsrs r5, r0, 24 ldr r4, =gUnknown_085EA365 movs r6, 0 str r6, [sp] movs r0, 0x1 str r0, [sp, 0x4] adds r0, r5, 0 adds r1, r4, 0 movs r2, 0 movs r3, 0x1 bl sub_81C25A4 movs r0, 0x1 adds r1, r4, 0 movs r2, 0 bl font_get_width_of_string adds r2, r0, 0 ldr r0, =0x0203cf1c ldr r1, [r0] adds r0, r1, 0 adds r0, 0xA2 ldrb r0, [r0] cmp r0, 0 bne @081C2F40 adds r1, 0xA6 lsls r2, 24 lsrs r2, 24 str r6, [sp] movs r0, 0x5 str r0, [sp, 0x4] adds r0, r5, 0 movs r3, 0x1 bl sub_81C25A4 b @081C2F54 .align 2, 0 .pool @081C2F40: adds r1, 0xA6 lsls r2, 24 lsrs r2, 24 str r6, [sp] movs r0, 0x6 str r0, [sp, 0x4] adds r0, r5, 0 movs r3, 0x1 bl sub_81C25A4 @081C2F54: add sp, 0x8 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81C2EC4 thumb_func_start sub_81C2F5C sub_81C2F5C: ; 81C2F5C push {r4,r5,lr} sub sp, 0x8 bl sub_81A6BF4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C2FC0 bl sub_81B9E94 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C2FC0 ldr r5, =0x02021cc4 ldr r1, =gUnknown_085E8D59 adds r0, r5, 0 bl gf_strcpy ldr r1, =0x0203cf1c 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, =gUnknown_0861CCCC movs r1, 0x1 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 lsls r4, 24 lsrs r4, 24 movs r1, 0 str r1, [sp] movs r1, 0x1 str r1, [sp, 0x4] adds r1, r5, 0 adds r2, r4, 0 movs r3, 0x1 bl sub_81C25A4 @081C2FC0: add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2F5C thumb_func_start sub_81C2FD8 sub_81C2FD8: ; 81C2FD8 push {r4,lr} sub sp, 0x8 ldr r0, =0x0203cf1c ldr r1, [r0] adds r0, r1, 0 adds r0, 0x70 ldrh r0, [r0] adds r1, 0x78 ldrb r1, [r1] bl sub_806B694 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =gUnknown_0861CCCC movs r1, 0x2 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 movs r1, 0xD muls r1, r4 ldr r2, =gAbilityNames adds r1, r2 movs r2, 0 str r2, [sp] movs r2, 0x1 str r2, [sp, 0x4] movs r2, 0 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C2FD8 thumb_func_start sub_81C302C sub_81C302C: ; 81C302C push {r4,lr} sub sp, 0x8 ldr r0, =0x0203cf1c ldr r1, [r0] adds r0, r1, 0 adds r0, 0x70 ldrh r0, [r0] adds r1, 0x78 ldrb r1, [r1] bl sub_806B694 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =gUnknown_0861CCCC movs r1, 0x2 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 ldr r1, =gAbilityDescriptionPointers lsls r4, 2 adds r4, r1 ldr r1, [r4] movs r2, 0 str r2, [sp] str r2, [sp, 0x4] movs r3, 0x11 bl sub_81C25A4 add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C302C thumb_func_start sub_81C307C sub_81C307C: ; 81C307C push {r4-r6,lr} ldr r0, =0x0203cf1c ldr r0, [r0] adds r4, r0, 0 adds r4, 0x70 bl sub_81AFBF0 ldr r1, =gUnknown_0861CE74 movs r0, 0 bl sub_81AFC0C ldr r1, =gUnknown_0861CE7B movs r0, 0x1 bl sub_81AFC0C bl sub_81C31C0 bl sub_81A6BF4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C30C2 bl sub_81B9E94 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C30C2 bl sub_81C3304 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C30E0 @081C30C2: ldr r0, =0x02021fc4 ldr r1, =gUnknown_085EA5DB bl sub_81AFC28 b @081C3182 .align 2, 0 .pool @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, =gUnknown_085EA516 cmp r0, 0xD4 bls @081C3170 ldr r1, =gUnknown_085EA617 b @081C3170 .align 2, 0 .pool @081C3134: ldrb r0, [r4, 0x9] ldr r1, =gUnknown_085EA4EC cmp r0, 0xD4 bls @081C3170 ldr r1, =gUnknown_085EA5EB b @081C3170 .align 2, 0 .pool @081C3148: ldrb r0, [r4, 0x9] cmp r0, 0xFF bne @081C3158 ldr r1, =gUnknown_085EA56A b @081C3170 .align 2, 0 .pool @081C3158: cmp r0, 0xFE beq @081C316E bl sub_81C32BC lsls r0, 24 cmp r0, 0 beq @081C316E ldrb r0, [r4, 0x9] ldr r1, =gUnknown_085EA5A8 cmp r0, 0xD4 bls @081C3170 @081C316E: ldr r1, =gUnknown_085EA544 @081C3170: ldr r0, =0x02021fc4 bl sub_81AFC28 adds r0, r6, 0 bl free adds r0, r5, 0 bl free @081C3182: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C307C thumb_func_start sub_81C3194 sub_81C3194: ; 81C3194 push {lr} sub sp, 0x8 ldr r0, =gUnknown_0861CCCC movs r1, 0x3 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 ldr r1, =0x02021fc4 movs r2, 0 str r2, [sp] str r2, [sp, 0x4] movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C3194 thumb_func_start sub_81C31C0 sub_81C31C0: ; 81C31C0 push {lr} ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =gNatureNamePointers adds r0, 0xA3 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r1, [r0] movs r0, 0x2 bl sub_81AFC0C ldr r1, =gUnknown_085EA3C0 movs r0, 0x5 bl sub_81AFC0C pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C31C0 thumb_func_start sub_81C31F0 sub_81C31F0: ; 81C31F0 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0x7A ldrb r1, [r0] cmp r1, 0 bne @081C3202 movs r1, 0x5 @081C3202: adds r0, r4, 0 movs r2, 0 movs r3, 0x3 bl decimal_int_to_string movs r0, 0x3 adds r1, r4, 0 bl sub_81AFC0C pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C31F0 thumb_func_start sub_81C3220 sub_81C3220: ; 81C3220 push {r4-r6,lr} ldr r0, =0x0203cf1c ldr r0, [r0] adds r6, r0, 0 adds r6, 0x70 ldr r1, [r0] ldr r0, =0x02024744 cmp r1, r0 bne @081C326C bl link_get_multiplayer_id movs r1, 0x1 eors r0, r1 lsls r0, 24 lsrs r0, 24 ldr r2, =0x020229e8 lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r0, r2, 0x4 adds r0, r1, r0 ldrh r4, [r0] adds r0, r1, r2 ldrb r5, [r0, 0x13] ldr r0, =0x02021cc4 adds r2, 0x8 adds r1, r2 bl gf_strcpy b @081C3282 .align 2, 0 .pool @081C326C: bl sub_80F0020 adds r4, r0, 0 ldr r0, =0x0000ffff ands r4, r0 ldr r0, =0x03005d90 ldr r1, [r0] ldrb r5, [r1, 0x8] ldr r0, =0x02021cc4 bl gf_strcpy @081C3282: adds r0, r6, 0 adds r0, 0x32 ldrb r0, [r0] cmp r5, r0 bne @081C32A4 ldr r0, [r6, 0x48] ldr r1, =0x0000ffff ands r0, r1 cmp r4, r0 bne @081C32A4 ldr r0, =0x02021cc4 adds r1, r6, 0 adds r1, 0x36 bl sub_80092BC cmp r0, 0 beq @081C32B4 @081C32A4: movs r0, 0 b @081C32B6 .align 2, 0 .pool @081C32B4: movs r0, 0x1 @081C32B6: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81C3220 thumb_func_start sub_81C32BC sub_81C32BC: ; 81C32BC push {lr} ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0x70 ldrb r0, [r0, 0xB] subs r0, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bls @081C32D8 movs r0, 0 b @081C32DA .align 2, 0 .pool @081C32D8: movs r0, 0x1 @081C32DA: pop {r1} bx r1 thumb_func_end sub_81C32BC thumb_func_start sub_81C32E0 sub_81C32E0: ; 81C32E0 push {lr} ldr r0, =0x0203cf1c ldr r0, [r0] adds r0, 0x70 ldrb r0, [r0, 0xB] subs r0, 0x1 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bls @081C32FC movs r0, 0 b @081C32FE .align 2, 0 .pool @081C32FC: movs r0, 0x1 @081C32FE: pop {r1} bx r1 thumb_func_end sub_81C32E0 thumb_func_start sub_81C3304 sub_81C3304: ; 81C3304 push {lr} ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 15 ands r0, r1 cmp r0, 0 beq @081C3354 ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C3354 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040be adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @081C333A cmp r0, 0x4 beq @081C333A cmp r0, 0x5 bne @081C3354 @081C333A: movs r0, 0x1 b @081C3356 .align 2, 0 .pool @081C3354: movs r0, 0 @081C3356: pop {r1} bx r1 thumb_func_end sub_81C3304 thumb_func_start sub_81C335C sub_81C335C: ; 81C335C push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x8 ldr r0, =gUnknown_0861CCCC movs r1, 0 bl sub_81C2D2C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =gUnknown_085EA365 mov r8, r0 movs r0, 0x1 mov r1, r8 movs r2, 0 bl 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, =gUnknown_085E8D38 lsls r5, 24 lsrs r5, 24 mov r0, r9 str r0, [sp] str r6, [sp, 0x4] adds r0, r4, 0 adds r2, r5, 0 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C335C thumb_func_start sub_81C33CC sub_81C33CC: ; 81C33CC push {r4,r5,lr} sub sp, 0x8 ldr r5, =0x02021cc4 ldr r1, =gUnknown_085E8D59 adds r0, r5, 0 bl gf_strcpy ldr r1, =gUnknown_085E8D38 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, =gUnknown_0861CCCC movs r1, 0x1 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 lsls r4, 24 lsrs r4, 24 movs r1, 0 str r1, [sp] movs r1, 0x1 str r1, [sp, 0x4] adds r1, r5, 0 adds r2, r4, 0 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C33CC thumb_func_start sub_81C3428 sub_81C3428: ; 81C3428 push {r4,lr} sub sp, 0x8 ldr r0, =0x0203cf1c ldr r0, [r0] adds r1, r0, 0 adds r1, 0x70 adds r0, 0xA5 ldrb r0, [r0] cmp r0, 0x1 bne @081C3448 ldr r4, =gUnknown_085EA40B b @081C346C .align 2, 0 .pool @081C3448: ldrh r0, [r1, 0x30] cmp r0, 0x5 bhi @081C3458 ldr r4, =gUnknown_085EA4A2 b @081C346C .align 2, 0 .pool @081C3458: cmp r0, 0xA bhi @081C3464 ldr r4, =gUnknown_085EA475 b @081C346C .align 2, 0 .pool @081C3464: ldr r4, =gUnknown_085EA40B cmp r0, 0x28 bhi @081C346C ldr r4, =gUnknown_085EA442 @081C346C: ldr r0, =gUnknown_0861CCCC movs r1, 0x2 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 movs r1, 0 str r1, [sp] str r1, [sp, 0x4] adds r1, r4, 0 movs r2, 0 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C3428 thumb_func_start sub_81C349C sub_81C349C: ; 81C349C push {r4,lr} sub sp, 0x8 ldr r0, =0x0203cf1c ldr r0, [r0] adds r4, r0, 0 adds r4, 0x70 adds r0, 0xA5 ldrb r0, [r0] cmp r0, 0x1 beq @081C3500 ldrb r0, [r4, 0x9] cmp r0, 0xFF bne @081C34C4 ldr r4, =gUnknown_085EA678 b @081C3502 .align 2, 0 .pool @081C34C4: bl sub_81C32BC lsls r0, 24 cmp r0, 0 beq @081C34D8 bl sub_81C3220 lsls r0, 24 cmp r0, 0 bne @081C34E0 @081C34D8: ldr r4, =gUnknown_085EA6AB b @081C3502 .align 2, 0 .pool @081C34E0: ldrb r0, [r4, 0x9] cmp r0, 0xFD bne @081C3500 bl sub_81C32E0 lsls r0, 24 lsrs r0, 24 ldr r4, =gUnknown_085EA702 cmp r0, 0x1 bne @081C3502 ldr r4, =gUnknown_085EA6D7 b @081C3502 .align 2, 0 .pool @081C3500: ldr r4, =gUnknown_085EA647 @081C3502: ldr r0, =gUnknown_0861CCCC movs r1, 0x3 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 movs r1, 0 str r1, [sp] str r1, [sp, 0x4] adds r1, r4, 0 movs r2, 0 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C349C thumb_func_start sub_81C3530 sub_81C3530: ; 81C3530 push {lr} bl sub_81C35E4 bl sub_81C3690 bl sub_81C3710 bl sub_81C37D8 bl sub_81C3808 bl sub_81C3890 bl sub_81C38C0 pop {r0} bx r0 thumb_func_end sub_81C3530 thumb_func_start sub_81C3554 sub_81C3554: ; 81C3554 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4] subs r0, 0x1 lsls r0, 16 asrs r0, 16 cmp r0, 0x7 bhi @081C35D6 lsls r0, 2 ldr r1, =@081C3584 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C3584: .4byte @081C35A4 .4byte @081C35AA .4byte @081C35B0 .4byte @081C35B6 .4byte @081C35BC .4byte @081C35C2 .4byte @081C35C8 .4byte @081C35CE @081C35A4: bl sub_81C35E4 b @081C35D6 @081C35AA: bl sub_81C3690 b @081C35D6 @081C35B0: bl sub_81C3710 b @081C35D6 @081C35B6: bl sub_81C37D8 b @081C35D6 @081C35BC: bl sub_81C3808 b @081C35D6 @081C35C2: bl sub_81C3890 b @081C35D6 @081C35C8: bl sub_81C38C0 b @081C35D6 @081C35CE: adds r0, r2, 0 bl remove_task b @081C35DC @081C35D6: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @081C35DC: pop {r4} pop {r0} bx r0 thumb_func_end sub_81C3554 thumb_func_start sub_81C35E4 sub_81C35E4: ; 81C35E4 push {r4,r5,lr} sub sp, 0x8 ldr r4, =0x0203cf1c ldr r0, [r4] adds r0, 0x9E ldrh r0, [r0] cmp r0, 0xAF bne @081C3628 bl sub_81B1250 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C3628 ldr r0, [r4] ldr r1, =0x000040be adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @081C3614 cmp r0, 0x4 beq @081C3614 cmp r0, 0x5 bne @081C3628 @081C3614: movs r0, 0xAF bl itemid_get_item adds r5, r0, 0 b @081C3650 .align 2, 0 .pool @081C3628: ldr r0, =0x0203cf1c ldr r0, [r0] adds r1, r0, 0 adds r1, 0x9E ldrh r0, [r1] cmp r0, 0 bne @081C3644 ldr r5, =gUnknown_085E8D26 b @081C3650 .align 2, 0 .pool @081C3644: ldrh r0, [r1] ldr r4, =0x02021cc4 adds r1, r4, 0 bl itemid_get_name adds r5, r4, 0 @081C3650: movs r0, 0x1 adds r1, r5, 0 movs r2, 0x48 bl sub_81DB35C adds r4, r0, 0 adds r4, 0x6 ldr r0, =gUnknown_0861CCEC movs r1, 0 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 lsls r4, 24 lsrs r4, 24 movs r1, 0 str r1, [sp] str r1, [sp, 0x4] adds r1, r5, 0 adds r2, r4, 0 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C35E4 thumb_func_start sub_81C3690 sub_81C3690: ; 81C3690 push {r4,r5,lr} sub sp, 0x8 ldr r0, =0x0203cf1c ldr r0, [r0] adds r1, r0, 0 adds r1, 0x76 ldrb r0, [r1] cmp r0, 0 bne @081C36B0 ldr r5, =gUnknown_085E8D26 b @081C36C8 .align 2, 0 .pool @081C36B0: ldr r0, =0x02021cc4 ldrb r1, [r1] movs r2, 0x1 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EA3B4 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, =gUnknown_0861CCEC movs r1, 0x1 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 lsls r4, 24 lsrs r4, 24 movs r1, 0 str r1, [sp] str r1, [sp, 0x4] adds r1, r5, 0 adds r2, r4, 0 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C3690 thumb_func_start sub_81C3710 sub_81C3710: ; 81C3710 push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} movs r0, 0x8 bl 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, =0x0203cf1c 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, =0x02021fc4 ldr r1, =gUnknown_0861CE82 bl sub_81AFC28 mov r0, r9 bl free mov r0, r8 bl free adds r0, r6, 0 bl free adds r0, r5, 0 bl free pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C3710 thumb_func_start sub_81C37D8 sub_81C37D8: ; 81C37D8 push {lr} sub sp, 0x8 ldr r0, =gUnknown_0861CCEC movs r1, 0x2 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 ldr r1, =0x02021fc4 movs r2, 0 str r2, [sp] str r2, [sp, 0x4] movs r2, 0x4 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C37D8 thumb_func_start sub_81C3808 sub_81C3808: ; 81C3808 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =0x02021cc4 mov r8, r0 ldr r4, =0x0203cf1c ldr r0, [r4] adds r0, 0x98 ldrh r1, [r0] mov r0, r8 movs r2, 0x1 movs r3, 0x3 bl decimal_int_to_string ldr r6, =0x02021dc4 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, =0x02021ec4 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, =0x02021fc4 ldr r1, =gUnknown_0861CE8E bl sub_81AFC28 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C3808 thumb_func_start sub_81C3890 sub_81C3890: ; 81C3890 push {lr} sub sp, 0x8 ldr r0, =gUnknown_0861CCEC movs r1, 0x3 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 ldr r1, =0x02021fc4 movs r2, 0 str r2, [sp] str r2, [sp, 0x4] movs r2, 0x2 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C3890 thumb_func_start sub_81C38C0 sub_81C38C0: ; 81C38C0 push {r4-r6,lr} sub sp, 0x8 ldr r0, =0x0203cf1c ldr r0, [r0] adds r5, r0, 0 adds r5, 0x70 ldr r0, =gUnknown_0861CCEC movs r1, 0x4 bl sub_81C2D2C lsls r0, 24 lsrs r6, r0, 24 ldr r4, =0x02021cc4 ldr r1, [r5, 0x10] adds r0, r4, 0 movs r2, 0x1 movs r3, 0x7 bl 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, =gExperienceTables adds r1, r0, 0 adds r1, 0x1 lsls r1, 2 ldr r3, =gBaseStats ldrh r2, [r5] lsls r0, r2, 3 subs r0, r2 lsls r0, 2 adds r0, r3 ldrb r2, [r0, 0x13] movs r0, 0xCA lsls r0, 1 muls r0, r2 adds r1, r0 adds r1, r4 ldr r1, [r1] ldr r0, [r5, 0x10] subs r1, r0 b @081C394A .align 2, 0 .pool @081C3948: movs r1, 0 @081C394A: ldr r4, =0x02021cc4 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 .pool thumb_func_end sub_81C38C0 thumb_func_start sub_81C3984 sub_81C3984: ; 81C3984 push {r4,lr} movs r0, 0 bl sub_81C3B08 movs r0, 0x1 bl sub_81C3B08 movs r0, 0x2 bl sub_81C3B08 movs r0, 0x3 bl sub_81C3B08 ldr r4, =0x0203cf1c ldr r0, [r4] ldr r1, =0x000040bc adds r0, r1 ldrb r0, [r0] cmp r0, 0x3 bne @081C39EA bl sub_81C3F44 ldr r1, [r4] ldr r0, =0x000040c6 adds r2, r1, r0 ldrb r0, [r2] cmp r0, 0x4 bne @081C39DC ldr r0, =0x000040c4 adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @081C39EA bl sub_81C3E9C b @081C39EA .align 2, 0 .pool @081C39DC: ldrb r0, [r2] lsls r0, 1 adds r1, 0x84 adds r1, r0 ldrh r0, [r1] bl sub_81C3E9C @081C39EA: pop {r4} pop {r0} bx r0 thumb_func_end sub_81C3984 thumb_func_start sub_81C39F0 sub_81C39F0: ; 81C39F0 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4] subs r0, 0x1 lsls r0, 16 asrs r0, 16 cmp r0, 0x7 bhi @081C3AFC lsls r0, 2 ldr r1, =@081C3A20 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C3A20: .4byte @081C3A40 .4byte @081C3A48 .4byte @081C3A50 .4byte @081C3A58 .4byte @081C3A60 .4byte @081C3A7C .4byte @081C3ABE .4byte @081C3AF4 @081C3A40: movs r0, 0 bl sub_81C3B08 b @081C3AFC @081C3A48: movs r0, 0x1 bl sub_81C3B08 b @081C3AFC @081C3A50: movs r0, 0x2 bl sub_81C3B08 b @081C3AFC @081C3A58: movs r0, 0x3 bl sub_81C3B08 b @081C3AFC @081C3A60: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040bc adds r0, r1 ldrb r0, [r0] cmp r0, 0x3 bne @081C3AFC bl sub_81C3F44 b @081C3AFC .align 2, 0 .pool @081C3A7C: ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040bc adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x3 bne @081C3AFC ldr r0, =0x000040c6 adds r2, r1, r0 ldrb r0, [r2] cmp r0, 0x4 bne @081C3AB0 ldr r2, =0x000040c4 adds r0, r1, r2 ldrh r0, [r0] strh r0, [r4, 0x2] b @081C3AFC .align 2, 0 .pool @081C3AB0: ldrb r0, [r2] lsls r0, 1 adds r1, 0x84 adds r1, r0 ldrh r0, [r1] strh r0, [r4, 0x2] b @081C3AFC @081C3ABE: ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040bc adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x3 bne @081C3AFC adds r2, 0x8 adds r0, r1, r2 ldr r0, [r0] ldr r1, =0x00ffffff ands r0, r1 movs r1, 0x80 lsls r1, 11 cmp r0, r1 beq @081C3AFC ldrh r0, [r4, 0x2] bl sub_81C3E9C b @081C3AFC .align 2, 0 .pool @081C3AF4: adds r0, r2, 0 bl remove_task b @081C3B02 @081C3AFC: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @081C3B02: pop {r4} pop {r0} bx r0 thumb_func_end sub_81C39F0 thumb_func_start sub_81C3B08 sub_81C3B08: ; 81C3B08 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC lsls r0, 24 lsrs r7, r0, 24 ldr r0, =0x0203cf1c ldr r0, [r0] mov r10, r0 ldr r4, =gUnknown_0861CD14 adds r0, r4, 0 movs r1, 0 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 mov r8, r0 adds r0, r4, 0 movs r1, 0x1 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 str r0, [sp, 0x8] lsls r1, r7, 1 mov r0, r10 adds r0, 0x84 adds r0, r1 ldrh r5, [r0] cmp r5, 0 beq @081C3C00 mov r0, r10 adds r0, 0xA4 ldrb r1, [r0] adds r0, r5, 0 adds r2, r7, 0 bl 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, =gMoveNames adds r1, r0 lsls r0, r7, 4 mov r9, r0 mov r3, r9 adds r3, 0x1 lsls r3, 24 lsrs r3, 24 movs r0, 0 str r0, [sp] movs r0, 0x1 str r0, [sp, 0x4] mov r0, r8 movs r2, 0 bl sub_81C25A4 ldr r0, =0x02021cc4 mov r8, r0 mov r5, r10 adds r5, 0x8C adds r5, r7 ldrb r1, [r5] movs r2, 0x1 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021dc4 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, =0x02021fc4 ldr r1, =gUnknown_0861CE97 adds r0, r4, 0 bl sub_81AFC28 adds r7, r4, 0 ldrb r0, [r5] adds r1, r6, 0 bl sub_814FC20 lsls r0, 24 lsrs r0, 24 adds r5, r0, 0 adds r5, 0x9 movs r0, 0x1 adds r1, r7, 0 movs r2, 0x2C bl sub_81DB368 mov r4, r9 b @081C3C26 .align 2, 0 .pool @081C3C00: ldr r1, =gUnknown_085E8D40 lsls r4, r7, 4 adds r3, r4, 0x1 lsls r3, 24 lsrs r3, 24 str r5, [sp] movs r0, 0x1 str r0, [sp, 0x4] mov r0, r8 movs r2, 0 bl sub_81C25A4 ldr r7, =gUnknown_085E8D42 movs r5, 0xC movs r0, 0x1 adds r1, r7, 0 movs r2, 0x2C bl 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 .pool thumb_func_end sub_81C3B08 thumb_func_start sub_81C3C5C sub_81C3C5C: ; 81C3C5C push {r4-r6,lr} sub sp, 0x8 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0 beq @081C3CFC movs r0, 0x13 str r0, [sp] movs r0, 0x20 str r0, [sp, 0x4] movs r0, 0xE movs r1, 0 movs r2, 0x35 movs r3, 0 bl Window_FillPixelRect ldr r2, =gBattleMoves lsls r1, r5, 1 adds r0, r1, r5 lsls r0, 2 adds r2, r0, r2 ldrb r0, [r2, 0x1] adds r6, r1, 0 cmp r0, 0x1 bhi @081C3C9C ldr r1, =gUnknown_085E8D45 b @081C3CAC .align 2, 0 .pool @081C3C9C: ldr r4, =0x02021cc4 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, =gBattleMoves adds r0, r6, r5 lsls r0, 2 adds r1, r0, r1 ldrb r0, [r1, 0x3] cmp r0, 0 bne @081C3CDC ldr r1, =gUnknown_085E8D45 b @081C3CEC .align 2, 0 .pool @081C3CDC: ldr r4, =0x02021cc4 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 .pool thumb_func_end sub_81C3C5C thumb_func_start sub_81C3D08 sub_81C3D08: ; 81C3D08 push {r4,lr} movs r0, 0 bl sub_81C3B08 movs r0, 0x1 bl sub_81C3B08 movs r0, 0x2 bl sub_81C3B08 movs r0, 0x3 bl sub_81C3B08 ldr r4, =0x0203cf1c ldr r0, [r4] ldr r1, =0x000040bc adds r0, r1 ldrb r0, [r0] cmp r0, 0x3 bne @081C3D40 bl sub_81C3F44 ldr r0, [r4] ldr r1, =0x000040c6 adds r0, r1 ldrb r0, [r0] bl sub_81C3E2C @081C3D40: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C3D08 thumb_func_start sub_81C3D54 sub_81C3D54: ; 81C3D54 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4] subs r0, 0x1 lsls r0, 16 asrs r0, 16 cmp r0, 0x6 bhi @081C3E20 lsls r0, 2 ldr r1, =@081C3D84 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C3D84: .4byte @081C3DA0 .4byte @081C3DA8 .4byte @081C3DB0 .4byte @081C3DB8 .4byte @081C3DC0 .4byte @081C3DDC .4byte @081C3E18 @081C3DA0: movs r0, 0 bl sub_81C3B08 b @081C3E20 @081C3DA8: movs r0, 0x1 bl sub_81C3B08 b @081C3E20 @081C3DB0: movs r0, 0x2 bl sub_81C3B08 b @081C3E20 @081C3DB8: movs r0, 0x3 bl sub_81C3B08 b @081C3E20 @081C3DC0: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040bc adds r0, r1 ldrb r0, [r0] cmp r0, 0x3 bne @081C3E20 bl sub_81C3F44 b @081C3E20 .align 2, 0 .pool @081C3DDC: ldr r0, =0x0203cf1c ldr r2, [r0] ldr r1, =0x000040bc adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x3 bne @081C3E20 adds r1, 0x8 adds r0, r2, r1 ldr r0, [r0] ldr r1, =0x00ffffff ands r0, r1 movs r1, 0x80 lsls r1, 11 cmp r0, r1 beq @081C3E20 ldr r1, =0x000040c6 adds r0, r2, r1 ldrb r0, [r0] bl sub_81C3E2C b @081C3E20 .align 2, 0 .pool @081C3E18: adds r0, r2, 0 bl remove_task b @081C3E26 @081C3E20: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @081C3E26: pop {r4} pop {r0} bx r0 thumb_func_end sub_81C3D54 thumb_func_start sub_81C3E2C sub_81C3E2C: ; 81C3E2C push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x4 bne @081C3E48 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c4 b @081C3E50 .align 2, 0 .pool @081C3E48: ldr r0, =0x0203cf1c ldr r0, [r0] lsls r1, 1 adds r0, 0x84 @081C3E50: adds r0, r1 ldrh r4, [r0] cmp r4, 0 beq @081C3E82 ldr r0, =gUnknown_0861CD14 movs r1, 0x2 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 ldr r3, =gContestEffectDescriptionPointers ldr r2, =gContestMoves lsls r1, r4, 3 adds r1, r2 ldrb r1, [r1] lsls r1, 2 adds r1, r3 ldr r1, [r1] movs r2, 0 str r2, [sp] str r2, [sp, 0x4] movs r2, 0x6 movs r3, 0x1 bl sub_81C25A4 @081C3E82: add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C3E2C thumb_func_start sub_81C3E9C sub_81C3E9C: ; 81C3E9C push {r4-r6,lr} sub sp, 0x8 lsls r0, 16 lsrs r4, r0, 16 adds r6, r4, 0 ldr r0, =gUnknown_0861CD14 movs r1, 0x2 bl sub_81C2D2C lsls r0, 24 lsrs r5, r0, 24 adds r0, r5, 0 movs r1, 0 bl Window_FastFillPixels cmp r4, 0 beq @081C3F30 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] cmp r0, 0x2 bne @081C3F00 adds r0, r4, 0 bl sub_81C3C5C ldr r1, =gMoveDescriptionPointers subs r0, r4, 0x1 lsls r0, 2 adds r0, r1 ldr r1, [r0] movs r0, 0 str r0, [sp] str r0, [sp, 0x4] adds r0, r5, 0 movs r2, 0x6 movs r3, 0x1 bl sub_81C25A4 b @081C3F20 .align 2, 0 .pool @081C3F00: ldr r2, =gContestEffectDescriptionPointers ldr r1, =gContestMoves lsls r0, r6, 3 adds r0, r1 ldrb r0, [r0] lsls r0, 2 adds r0, r2 ldr r1, [r0] movs r0, 0 str r0, [sp] str r0, [sp, 0x4] adds r0, r5, 0 movs r2, 0x6 movs r3, 0x1 bl sub_81C25A4 @081C3F20: adds r0, r5, 0 bl Window_WriteStandardTileMap b @081C3F36 .align 2, 0 .pool @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, =gUnknown_0861CD14 adds r0, r4, 0 movs r1, 0 bl sub_81C2D2C lsls r0, 24 lsrs r6, r0, 24 adds r7, r6, 0 adds r0, r4, 0 movs r1, 0x1 bl sub_81C2D2C lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r0, =0x0203cf1c ldr r1, [r0] ldr r2, =0x000040c4 adds r0, r1, r2 ldrh r2, [r0] cmp r2, 0 bne @081C3F9C ldr r1, =gUnknown_085E8CF0 str r2, [sp] movs r0, 0x1 str r0, [sp, 0x4] adds r0, r6, 0 movs r2, 0 movs r3, 0x41 bl sub_81C25A4 b @081C4044 .align 2, 0 .pool @081C3F9C: ldrh r5, [r0] ldr r2, =0x000040c0 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x2 bne @081C3FD0 movs r0, 0xD adds r1, r5, 0 muls r1, r0 ldr r0, =gMoveNames adds r1, r0 movs r0, 0 str r0, [sp] movs r0, 0x6 str r0, [sp, 0x4] adds r0, r6, 0 movs r2, 0 movs r3, 0x41 bl sub_81C25A4 b @081C3FEC .align 2, 0 .pool @081C3FD0: movs r0, 0xD adds r1, r5, 0 muls r1, r0 ldr r0, =gMoveNames adds r1, r0 movs r0, 0 str r0, [sp] movs r0, 0x5 str r0, [sp, 0x4] adds r0, r7, 0 movs r2, 0 movs r3, 0x41 bl sub_81C25A4 @081C3FEC: ldr r4, =0x02021cc4 ldr r1, =gBattleMoves lsls r0, r5, 1 adds r0, r5 lsls r0, 2 adds r0, r1 ldrb r1, [r0, 0x4] adds r0, r4, 0 movs r2, 0x1 movs r3, 0x2 bl 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, =0x02021fc4 ldr r1, =gUnknown_0861CE97 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 .pool thumb_func_end sub_81C3F44 thumb_func_start sub_81C4064 sub_81C4064: ; 81C4064 push {r4,lr} sub sp, 0x8 ldr r0, =gUnknown_0861CD14 movs r1, 0 bl sub_81C2D2C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x48 str r0, [sp] movs r0, 0x10 str r0, [sp, 0x4] adds r0, r4, 0 movs r1, 0 movs r2, 0 movs r3, 0x42 bl Window_FillPixelRect adds r0, r4, 0 movs r1, 0x2 bl Window_CopyToVram add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4064 thumb_func_start sub_81C40A0 sub_81C40A0: ; 81C40A0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 mov r9, r0 mov r10, r1 lsls r0, 24 lsrs r0, 24 mov r9, r0 mov r0, r10 lsls r0, 24 lsrs r0, 24 mov r10, r0 ldr r5, =gUnknown_0861CD14 adds r0, r5, 0 movs r1, 0 bl sub_81C2D2C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 movs r1, 0x1 bl sub_81C2D2C adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 mov r0, r9 lsls r6, r0, 4 movs r0, 0x48 mov r8, r0 str r0, [sp] movs r0, 0x10 str r0, [sp, 0x4] adds r0, r4, 0 movs r1, 0 movs r2, 0 adds r3, r6, 0 bl 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 .pool thumb_func_end sub_81C40A0 thumb_func_start sub_81C4154 sub_81C4154: ; 81C4154 push {r4,lr} sub sp, 0x8 ldr r0, =gUnknown_0861CD14 movs r1, 0x2 bl sub_81C2D2C adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 movs r1, 0 bl Window_FastFillPixels ldr r1, =gUnknown_085EA4CB movs r0, 0 str r0, [sp] str r0, [sp, 0x4] adds r0, r4, 0 movs r2, 0x6 movs r3, 0x1 bl sub_81C25A4 add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4154 thumb_func_start sub_81C4190 sub_81C4190: ; 81C4190 push {r4,r5,lr} movs r2, 0 ldr r5, =0x0203cf1c ldr r4, =0x000040d3 movs r3, 0xFF @081C419A: ldr r0, [r5] adds r0, r4 adds r0, r2 ldrb r1, [r0] orrs r1, r3 strb r1, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x1B bls @081C419A pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4190 thumb_func_start sub_81C41C0 sub_81C41C0: ; 81C41C0 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r5, =0x0203cf1c ldr r0, [r5] ldr r1, =0x000040d3 adds r0, r1 adds r1, r0, r4 ldrb r0, [r1] cmp r0, 0xFF beq @081C41F2 adds r1, r0, 0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles ldr r0, [r5] ldr r1, =0x000040d3 adds r0, r1 adds r0, r4 movs r1, 0xFF strb r1, [r0] @081C41F2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C41C0 thumb_func_start sub_81C4204 sub_81C4204: ; 81C4204 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 ldr r3, =0x02020630 ldr r2, =0x0203cf1c ldr r2, [r2] ldr r4, =0x000040d3 adds r2, r4 adds r2, r0 ldrb r0, [r2] lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r3 adds r2, 0x3E movs r0, 0x1 ands r1, r0 lsls r1, 2 ldrb r3, [r2] movs r0, 0x5 negs r0, r0 ands r0, r3 orrs r0, r1 strb r0, [r2] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4204 thumb_func_start sub_81C424C sub_81C424C: ; 81C424C push {r4,lr} movs r4, 0x3 @081C4250: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040d3 adds r0, r1 adds r0, r4 ldrb r0, [r0] cmp r0, 0xFF beq @081C4268 adds r0, r4, 0 movs r1, 0x1 bl sub_81C4204 @081C4268: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x1B bls @081C4250 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C424C thumb_func_start sub_81C4280 sub_81C4280: ; 81C4280 push {lr} ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] cmp r0, 0x2 beq @081C42B0 cmp r0, 0x2 bgt @081C42A4 cmp r0, 0 beq @081C42AA b @081C42C2 .align 2, 0 .pool @081C42A4: cmp r0, 0x3 beq @081C42BA b @081C42C2 @081C42AA: bl sub_81C43A0 b @081C42C2 @081C42B0: bl sub_81C4420 bl sub_81C44F0 b @081C42C2 @081C42BA: bl sub_81C4484 bl sub_81C44F0 @081C42C2: pop {r0} bx r0 thumb_func_end sub_81C4280 thumb_func_start sub_81C42C8 sub_81C42C8: ; 81C42C8 push {r4,r5,lr} movs r4, 0x3 ldr r5, =0x0203cf1c @081C42CE: ldr r0, [r5] ldr r1, =0x000040d3 adds r0, r1 adds r0, r4 ldrb r0, [r0] cmp r0, 0xFF bne @081C42F2 ldr r0, =gUnknown_0861CFC4 movs r1, 0 movs r2, 0 movs r3, 0x2 bl obj_add_from_template_forward_search ldr r1, [r5] ldr r2, =0x000040d3 adds r1, r2 adds r1, r4 strb r0, [r1] @081C42F2: adds r0, r4, 0 movs r1, 0x1 bl sub_81C4204 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x7 bls @081C42CE pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C42C8 thumb_func_start sub_81C4318 sub_81C4318: ; 81C4318 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x4 adds r5, r0, 0 adds r6, r1, 0 mov r8, r2 lsls r5, 24 lsrs r5, 24 lsls r6, 24 lsrs r6, 24 mov r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r3, 24 lsrs r3, 24 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040d3 adds r0, r1 adds r0, r3 ldrb r0, [r0] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 adds r0, r4, 0 adds r1, r5, 0 str r3, [sp] bl obj_anim_image_start ldr r0, =gUnknown_0861CFDC adds r5, r0 ldrb r1, [r5] lsls r1, 4 ldrb r2, [r4, 0x5] movs r0, 0xF ands r0, r2 orrs r0, r1 strb r0, [r4, 0x5] adds r6, 0x10 strh r6, [r4, 0x20] movs r0, 0x8 add r8, r0 mov r1, r8 strh r1, [r4, 0x22] ldr r3, [sp] adds r0, r3, 0 movs r1, 0 bl sub_81C4204 add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4318 thumb_func_start sub_81C43A0 sub_81C43A0: ; 81C43A0 push {r4,r5,lr} ldr r0, =0x0203cf1c ldr r0, [r0] adds r5, r0, 0 adds r5, 0x70 ldrb r0, [r5, 0x4] cmp r0, 0 beq @081C43CC movs r0, 0x9 movs r1, 0x78 movs r2, 0x30 movs r3, 0x3 bl sub_81C4318 movs r0, 0x4 movs r1, 0x1 bl sub_81C4204 b @081C4418 .align 2, 0 .pool @081C43CC: ldr r4, =gBaseStats ldrh r1, [r5] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r0, r4 ldrb r0, [r0, 0x6] movs r1, 0x78 movs r2, 0x30 movs r3, 0x3 bl sub_81C4318 ldrh r1, [r5] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r1, r0, r4 ldrb r0, [r1, 0x6] ldrb r2, [r1, 0x7] cmp r0, r2 beq @081C4410 ldrb r0, [r1, 0x7] movs r1, 0xA0 movs r2, 0x30 movs r3, 0x4 bl sub_81C4318 movs r0, 0x4 movs r1, 0 bl sub_81C4204 b @081C4418 .align 2, 0 .pool @081C4410: movs r0, 0x4 movs r1, 0x1 bl sub_81C4204 @081C4418: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C43A0 thumb_func_start sub_81C4420 sub_81C4420: ; 81C4420 push {r4-r6,lr} ldr r0, =0x0203cf1c ldr r0, [r0] adds r5, r0, 0 adds r5, 0x70 movs r4, 0 ldr r6, =gBattleMoves @081C442E: lsls r0, r4, 1 adds r1, r5, 0 adds r1, 0x14 adds r1, r0 ldrh r0, [r1] cmp r0, 0 beq @081C4468 adds r1, r0, 0 lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x2] lsls r2, r4, 28 movs r1, 0x80 lsls r1, 22 adds r2, r1 lsrs r2, 24 adds r3, r4, 0x3 lsls r3, 24 lsrs r3, 24 movs r1, 0x55 bl sub_81C4318 b @081C4474 .align 2, 0 .pool @081C4468: adds r0, r4, 0x3 lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl sub_81C4204 @081C4474: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @081C442E pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81C4420 thumb_func_start sub_81C4484 sub_81C4484: ; 81C4484 push {r4,r5,lr} ldr r0, =0x0203cf1c ldr r0, [r0] adds r5, r0, 0 adds r5, 0x70 movs r4, 0 @081C4490: lsls r0, r4, 1 adds r1, r5, 0 adds r1, 0x14 adds r2, r1, r0 ldrh r0, [r2] cmp r0, 0 beq @081C44D4 ldr r1, =gContestMoves lsls r0, 3 adds r0, r1 ldrb r0, [r0, 0x1] lsls r0, 29 lsrs r0, 5 movs r1, 0x90 lsls r1, 21 adds r0, r1 lsrs r0, 24 lsls r2, r4, 28 movs r1, 0x80 lsls r1, 22 adds r2, r1 lsrs r2, 24 adds r3, r4, 0x3 lsls r3, 24 lsrs r3, 24 movs r1, 0x55 bl sub_81C4318 b @081C44E0 .align 2, 0 .pool @081C44D4: adds r0, r4, 0x3 lsls r0, 24 lsrs r0, 24 movs r1, 0x1 bl sub_81C4204 @081C44E0: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @081C4490 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C4484 thumb_func_start sub_81C44F0 sub_81C44F0: ; 81C44F0 push {lr} ldr r0, =0x0203cf1c ldr r1, [r0] ldr r0, =0x000040c4 adds r3, r1, r0 ldrh r0, [r3] cmp r0, 0 bne @081C4514 movs r0, 0x7 movs r1, 0x1 bl sub_81C4204 b @081C4560 .align 2, 0 .pool @081C4514: ldr r2, =0x000040c0 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0x2 bne @081C4540 ldr r2, =gBattleMoves ldrh r1, [r3] lsls r0, r1, 1 adds r0, r1 lsls r0, 2 adds r0, r2 ldrb r0, [r0, 0x2] movs r1, 0x55 movs r2, 0x60 movs r3, 0x7 bl sub_81C4318 b @081C4560 .align 2, 0 .pool @081C4540: ldr r1, =gContestMoves ldrh r0, [r3] lsls r0, 3 adds r0, r1 ldrb r0, [r0, 0x1] lsls r0, 29 lsrs r0, 5 movs r1, 0x90 lsls r1, 21 adds r0, r1 lsrs r0, 24 movs r1, 0x55 movs r2, 0x60 movs r3, 0x7 bl sub_81C4318 @081C4560: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C44F0 thumb_func_start sub_81C4568 sub_81C4568: ; 81C4568 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 ldr r2, =0x0203cf1c ldr r2, [r2] adds r0, 0x3 ldr r3, =0x000040d3 adds r2, r3 adds r0, r2, r0 ldrb r0, [r0] lsls r4, r0, 4 adds r4, r0 lsls r4, 2 ldr r5, =0x02020630 adds r4, r5 adds r1, 0x3 adds r2, r1 ldrb r0, [r2] lsls r3, r0, 4 adds r3, r0 lsls r3, 2 adds r3, r5 adds r5, r4, 0 adds r5, 0x2A ldrb r1, [r5] adds r2, r3, 0 adds r2, 0x2A ldrb r0, [r2] strb r0, [r5] strb r1, [r2] ldrb r6, [r4, 0x5] lsrs r5, r6, 4 ldrb r2, [r3, 0x5] lsrs r2, 4 lsls r2, 4 movs r1, 0xF adds r0, r1, 0 ands r0, r6 orrs r0, r2 strb r0, [r4, 0x5] lsls r5, 4 ldrb r0, [r3, 0x5] ands r1, r0 orrs r1, r5 strb r1, [r3, 0x5] adds r4, 0x3F ldrb r0, [r4] movs r2, 0x4 orrs r0, r2 movs r1, 0x11 negs r1, r1 ands r0, r1 strb r0, [r4] adds r3, 0x3F ldrb r0, [r3] orrs r0, r2 ands r0, r1 strb r0, [r3] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4568 thumb_func_start sub_81C45F4 sub_81C45F4: ; 81C45F4 push {r4-r6,lr} adds r3, r0, 0 adds r6, r1, 0 ldr r0, =0x0203cf1c ldr r2, [r0] adds r5, r2, 0 adds r5, 0x70 movs r1, 0 ldrsh r0, [r6, r1] cmp r0, 0 beq @081C4620 cmp r0, 0x1 bne @081C4610 b @081C4750 @081C4610: adds r0, r3, 0 bl sub_81C47B4 lsls r0, 24 lsrs r0, 24 b @081C4770 .align 2, 0 .pool @081C4620: ldr r0, =0x030022c0 ldr r1, =0x00000439 adds r0, r1 ldrb r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C4680 ldr r1, =0x000040be adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x3 bl sub_80688F8 lsls r0, 24 cmp r0, 0 beq @081C4668 ldrh r2, [r5, 0x2] lsls r0, r2, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] ldr r1, [r1, 0x8] b @081C46D6 .align 2, 0 .pool @081C4668: ldrh r2, [r5, 0x2] lsls r0, r2, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, =0x020244d4 ldr r1, [r1] b @081C46B0 .align 2, 0 .pool @081C4680: ldr r0, =0x020244d4 ldr r3, [r0] adds r4, r0, 0 cmp r3, 0 beq @081C46E4 ldr r1, [r2] ldr r0, =0x020244ec cmp r1, r0 beq @081C46A6 ldr r1, =0x000040bc adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x2 beq @081C46A6 adds r1, 0x33 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x1 bne @081C46CC @081C46A6: ldrh r2, [r5, 0x2] lsls r0, r2, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, [r4] @081C46B0: ldr r1, [r1, 0x8] ldr r3, [r5, 0xC] bl help_system_enable_unless_flashback__sp199 b @081C4768 .align 2, 0 .pool @081C46CC: ldrh r2, [r5, 0x2] lsls r0, r2, 3 ldr r1, =gMonFrontPicTable adds r0, r1 ldr r1, [r3, 0x8] @081C46D6: ldr r3, [r5, 0xC] bl sub_8034B50 b @081C4768 .align 2, 0 .pool @081C46E4: ldr r1, [r2] ldr r0, =0x020244ec cmp r1, r0 beq @081C4700 ldr r1, =0x000040bc adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x2 beq @081C4700 adds r1, 0x33 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x1 bne @081C472C @081C4700: ldrh r4, [r5, 0x2] lsls r4, 3 ldr r0, =gMonFrontPicTable adds r4, r0 movs r0, 0 movs r1, 0x1 bl sub_806F4F8 adds r1, r0, 0 ldrh r2, [r5, 0x2] ldr r3, [r5, 0xC] adds r0, r4, 0 bl help_system_enable_unless_flashback__sp199 b @081C4768 .align 2, 0 .pool @081C472C: ldrh r4, [r5, 0x2] lsls r4, 3 ldr r0, =gMonFrontPicTable adds r4, r0 movs r0, 0 movs r1, 0x1 bl sub_806F4F8 adds r1, r0, 0 ldrh r2, [r5, 0x2] ldr r3, [r5, 0xC] adds r0, r4, 0 bl sub_8034B50 b @081C4768 .align 2, 0 .pool @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, =0x0203cf1c ldr r1, [r0] adds r4, r1, 0 adds r4, 0x70 ldrb r0, [r4, 0x4] cmp r0, 0 bne @081C47AE adds r0, r1, 0 adds r0, 0xC bl sub_805F110 cmp r0, 0x1 bne @081C47A4 ldrh r0, [r4, 0x2] movs r1, 0 movs r2, 0 bl sub_80A32E4 b @081C47AE .align 2, 0 .pool @081C47A4: ldrh r0, [r4, 0x2] movs r1, 0 movs r2, 0xB bl sub_80A32E4 @081C47AE: pop {r4} pop {r0} bx r0 thumb_func_end sub_81C4778 thumb_func_start sub_81C47B4 sub_81C47B4: ; 81C47B4 push {r4-r7,lr} mov r7, r8 push {r7} ldr r0, =0x0203cf1c ldr r6, [r0] adds r6, 0x70 ldr r0, =0x0202499c movs r1, 0x28 movs r2, 0x40 movs r3, 0x5 bl 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, =0x02020630 adds r7, r4, r5 adds r0, r7, 0 bl obj_free_rotscale_entry ldrh r0, [r6, 0x2] movs r1, 0 strh r0, [r7, 0x2E] strh r1, [r7, 0x32] adds r5, 0x1C adds r4, r5 ldr r0, =sub_81C4844 str r0, [r4] ldrb r1, [r7, 0x5] movs r0, 0xD negs r0, r0 ands r0, r1 strb r0, [r7, 0x5] ldrh r0, [r6, 0x2] bl sub_806E840 lsls r0, 24 cmp r0, 0 bne @081C4828 adds r0, r7, 0 adds r0, 0x3F ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @081C4836 .align 2, 0 .pool @081C4828: adds r2, r7, 0 adds r2, 0x3F ldrb r1, [r2] movs r0, 0x2 negs r0, r0 ands r0, r1 strb r0, [r2] @081C4836: mov r0, r8 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81C47B4 thumb_func_start sub_81C4844 sub_81C4844: ; 81C4844 push {r4,r5,lr} adds r4, r0, 0 ldr r0, =0x0203cf1c ldr r0, [r0] adds r5, r0, 0 adds r5, 0x70 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081C487E movs r1, 0x32 ldrsh r0, [r4, r1] cmp r0, 0x1 beq @081C487E ldrh r0, [r4, 0x2E] bl sub_806E840 lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x30] bl sub_81C4778 ldrh r1, [r4, 0x2E] ldrb r2, [r5, 0x4] adds r0, r4, 0 bl sub_806EE0C @081C487E: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4844 thumb_func_start sub_81C488C sub_81C488C: ; 81C488C ldr r1, =0x0203cf24 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81C488C thumb_func_start sub_81C4898 sub_81C4898: ; 81C4898 push {r4,lr} ldr r4, =0x0203cf24 ldrb r0, [r4] cmp r0, 0xFF beq @081C48AA bl remove_task movs r0, 0xFF strb r0, [r4] @081C48AA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4898 thumb_func_start sub_81C48B4 sub_81C48B4: ; 81C48B4 push {lr} ldr r2, =0x02020630 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040d3 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 cmp r1, r0 beq @081C48E8 movs r0, 0x1 b @081C48EA .align 2, 0 .pool @081C48E8: movs r0, 0 @081C48EA: pop {r1} bx r1 thumb_func_end sub_81C48B4 thumb_func_start sub_81C48F0 sub_81C48F0: ; 81C48F0 push {r4-r6,lr} ldr r6, =0x02020630 ldr r5, =0x0203cf1c ldr r0, [r5] ldr r4, =0x000040d3 adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 adds r0, 0x2C ldrb r1, [r0] movs r2, 0x40 orrs r1, r2 strb r1, [r0] ldr r0, [r5] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r6, 0 adds r1, 0x1C adds r0, r1 ldr r1, =nullsub_12 str r1, [r0] bl sub_806EE98 ldr r0, [r5] adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 ldrb r0, [r0, 0x5] lsrs r0, 4 lsls r3, r0, 4 movs r1, 0x80 lsls r1, 1 adds r0, r1, 0 orrs r3, r0 movs r2, 0 ldr r5, =0x02037714 ldr r4, =0x02037b14 @081C494C: adds r0, r2, r3 lsls r0, 16 lsrs r0, 15 adds r1, r0, r5 adds r0, r4 ldrh r0, [r0] strh r0, [r1] adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0xF bls @081C494C pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C48F0 thumb_func_start sub_81C4984 sub_81C4984: ; 81C4984 push {r4-r6,lr} adds r5, r0, 0 ldr r1, =0x00007533 ldr r2, =gUnknown_0861D120 adds r0, r1, 0 bl sub_811FF94 adds r4, r0, 0 ldr r6, =0x0203cf1c ldr r0, [r6] str r4, [r0, 0x8] cmp r4, 0 beq @081C49CE adds r0, r5, 0 movs r1, 0x8 bl pokemon_getattr adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 adds r0, r4, 0 bl 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 .pool thumb_func_end sub_81C4984 thumb_func_start sub_81C49E0 sub_81C49E0: ; 81C49E0 push {r4,lr} adds r4, r0, 0 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r0, [r0, 0x8] bl obj_delete_and_free_tiles ldr r0, =0x00007533 bl gpu_tile_obj_free_by_tag adds r0, r4, 0 bl sub_81C4984 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C49E0 thumb_func_start sub_81C4A08 sub_81C4A08: ; 81C4A08 push {r4,lr} movs r1, 0x26 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 bl ball_number_to_ball_processing_index adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r4, 0 bl sub_8076A78 lsls r0, r4, 1 adds r0, r4 lsls r0, 3 ldr r1, =gUnknown_0832C588 adds r0, r1 movs r1, 0x10 movs r2, 0x88 movs r3, 0 bl obj_add_from_template_forward_search ldr r2, =0x0203cf1c ldr r1, [r2] ldr r3, =0x000040d4 adds r1, r3 strb r0, [r1] ldr r4, =0x02020630 ldr r2, [r2] adds r2, r3 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x1C adds r0, r1 ldr r1, =nullsub_12 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 .pool thumb_func_end sub_81C4A08 thumb_func_start sub_81C4A88 sub_81C4A88: ; 81C4A88 push {r4,r5,lr} ldr r5, =0x0203cf1c ldr r0, [r5] ldr r1, =0x000040d5 adds r4, r0, r1 ldrb r0, [r4] cmp r0, 0xFF bne @081C4AA6 ldr r0, =gUnknown_0861D108 movs r1, 0x40 movs r2, 0x98 movs r3, 0 bl 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, =0x02020630 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 .pool @081C4AE8: movs r0, 0x2 movs r1, 0x1 bl sub_81C4204 @081C4AF0: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C4A88 thumb_func_start sub_81C4AF8 sub_81C4AF8: ; 81C4AF8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r0, =0x0203cf1c ldr r1, =0x000040d3 add r1, r8 ldr r0, [r0] adds r7, r0, r1 ldr r1, =0x000040c0 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bls @081C4BD2 movs r0, 0 mov r9, r0 mov r1, r8 cmp r1, 0x8 bne @081C4B2A movs r0, 0x1 mov r9, r0 @081C4B2A: movs r5, 0 ldr r6, =0x02020630 mov r10, r5 @081C4B30: lsls r1, r5, 20 movs r0, 0xB2 lsls r0, 15 adds r1, r0 asrs r1, 16 ldr r0, =gUnknown_0861D084 movs r2, 0x28 mov r3, r9 bl 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 .pool @081C4B74: cmp r5, 0x9 bne @081C4B8A ldrb r1, [r7, 0x9] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 movs r1, 0x5 bl 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, =sub_81C4BE4 str r1, [r0] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 mov r1, r8 strh r1, [r0, 0x2E] ldrb r1, [r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 mov r1, r10 strh r1, [r0, 0x30] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x9 bls @081C4B30 @081C4BD2: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4AF8 thumb_func_start sub_81C4BE4 sub_81C4BE4: ; 81C4BE4 push {lr} adds r3, r0, 0 adds r0, 0x2A ldrb r0, [r0] subs r0, 0x4 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bhi @081C4C1C ldrh r0, [r3, 0x30] adds r0, 0x1 movs r1, 0x1F ands r0, r1 strh r0, [r3, 0x30] cmp r0, 0x18 ble @081C4C10 adds r2, r3, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 b @081C4C2A @081C4C10: adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 b @081C4C28 @081C4C1C: movs r0, 0 strh r0, [r3, 0x30] adds r2, r3, 0 adds r2, 0x3E ldrb r1, [r2] subs r0, 0x5 @081C4C28: ands r0, r1 @081C4C2A: strb r0, [r2] movs r1, 0x2E ldrsh r0, [r3, r1] cmp r0, 0x8 bne @081C4C44 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c6 b @081C4C4A .align 2, 0 .pool @081C4C44: ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040c7 @081C4C4A: adds r0, r1 ldrb r0, [r0] lsls r0, 4 strh r0, [r3, 0x26] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4BE4 thumb_func_start sub_81C4C60 sub_81C4C60: ; 81C4C60 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 movs r4, 0 @081C4C68: adds r0, r5, r4 lsls r0, 24 lsrs r0, 24 bl sub_81C41C0 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x9 bls @081C4C68 pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C4C60 thumb_func_start sub_81C4C84 sub_81C4C84: ; 81C4C84 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 24 lsrs r6, r0, 24 ldr r0, =0x0203cf1c ldr r0, [r0] ldr r1, =0x000040db adds r5, r0, r1 lsls r0, r6, 1 adds r0, r6 lsls r0, 24 movs r4, 0 ldr r7, =0x02020630 movs r2, 0x80 lsls r2, 19 adds r2, r0 mov r9, r2 lsrs r6, r0, 24 movs r1, 0xA0 lsls r1, 19 adds r1, r0 mov r8, r1 @081C4CB4: cmp r4, 0 bne @081C4CD4 ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 mov r2, r9 b @081C4CE4 .align 2, 0 .pool @081C4CD4: cmp r4, 0x9 bne @081C4CEC ldrb r1, [r5, 0x9] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 mov r2, r8 @081C4CE4: lsrs r1, r2, 24 bl 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, =0x0203cf1c ldr r2, =0x000040d3 adds r0, r2 ldr r1, [r1] adds r5, r1, r0 movs r3, 0 ldr r4, =0x02020630 movs r7, 0x5 negs r7, r7 movs r6, 0 @081C4D32: adds r2, r5, r3 ldrb r1, [r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 strh r6, [r0, 0x30] ldrb r0, [r2] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r4 adds r1, 0x3E ldrb r2, [r1] adds r0, r7, 0 ands r0, r2 strb r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x9 bls @081C4D32 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4D18 thumb_func_start sub_81C4D70 sub_81C4D70: ; 81C4D70 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 ldr r4, =0x0203cf28 movs r0, 0x4 bl 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, =gUnknown_0861D1A0 lsls r3, 22 lsrs r3, 24 str r4, [sp] movs r2, 0 bl decompress_and_copy_tile_data_to_vram ldr r0, [r5] lsls r0, 30 lsrs r0, 30 ldr r1, =gUnknown_0861DEF4 movs r2, 0x1 str r2, [sp] movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, [r5] lsls r1, 22 lsrs r1, 24 str r4, [sp] movs r2, 0x20 movs r3, 0x20 bl sub_8199D3C b @081C4E2E .align 2, 0 .pool @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, =gUnknown_0861E208 lsls r3, 22 lsrs r3, 24 movs r2, 0 str r2, [sp] bl decompress_and_copy_tile_data_to_vram ldr r0, [r5] lsls r0, 30 lsrs r0, 30 ldr r1, =gUnknown_0861EF64 movs r4, 0x1 str r4, [sp] movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, [r5] lsls r1, 22 lsrs r1, 24 str r4, [sp] movs r2, 0x40 movs r3, 0x40 bl sub_8199D3C @081C4E2E: ldr r0, [r5] lsls r0, 30 lsrs r0, 30 movs r1, 0 movs r2, 0 bl 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, =gUnknown_0861D140 ldr r1, =0x020377f4 ldr r2, =0x04000018 bl CpuSet ldr r0, =0x0203cf28 ldr r1, [r0] ldr r0, [r5] lsls r0, 30 lsrs r0, 30 strb r0, [r1] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4D70 thumb_func_start sub_81C4E90 sub_81C4E90: ; 81C4E90 push {lr} bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 beq @081C4EA0 movs r0, 0x1 b @081C4EAC @081C4EA0: ldr r0, =0x0203cf28 ldr r0, [r0] ldrb r0, [r0] bl gpu_sync_bg_show movs r0, 0 @081C4EAC: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C4E90 thumb_func_start sub_81C4EB4 sub_81C4EB4: ; 81C4EB4 push {r4,lr} ldr r4, =0x0203cf28 ldr r0, [r4] cmp r0, 0 beq @081C4EC6 bl free movs r0, 0 str r0, [r4] @081C4EC6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4EB4 thumb_func_start sub_81C4ED0 sub_81C4ED0: ; 81C4ED0 push {lr} adds r1, r0, 0 ldr r0, =0x0203cf28 ldr r0, [r0] ldrb r0, [r0] lsls r1, 8 movs r2, 0 bl bg_change_y_offset pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4ED0 thumb_func_start sub_81C4EEC sub_81C4EEC: ; 81C4EEC ldr r1, =0x0203cf30 movs r0, 0 strh r0, [r1, 0x6] strh r0, [r1, 0x8] bx lr .align 2, 0 .pool thumb_func_end sub_81C4EEC thumb_func_start sub_81C4EFC sub_81C4EFC: ; 81C4EFC push {lr} ldr r1, =sub_8086194 movs r0, 0 bl sub_81C4F98 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4EFC thumb_func_start sub_81C4F10 sub_81C4F10: ; 81C4F10 push {lr} ldr r1, =sub_8059D50 movs r0, 0x1 bl sub_81C4F98 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4F10 thumb_func_start sub_81C4F24 sub_81C4F24: ; 81C4F24 push {lr} bl script_env_2_enable movs r0, 0x1 movs r1, 0 bl fade_screen ldr r0, =sub_81C4F44 movs r1, 0xA bl AddTask pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4F24 thumb_func_start sub_81C4F44 sub_81C4F44: ; 81C4F44 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081C4F6E bl overworld_free_bg_tilemaps ldr r0, =0x03005db0 ldr r1, =hm_add_c3_without_phase_2 str r1, [r0] ldr r1, =c2_exit_to_overworld_2_switch movs r0, 0x3 bl sub_81C4F98 adds r0, r4, 0 bl remove_task @081C4F6E: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4F44 thumb_func_start sub_81C4F84 sub_81C4F84: ; 81C4F84 push {lr} ldr r0, =0x0203cf30 ldr r1, [r0] movs r0, 0x4 bl sub_81C4F98 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C4F84 thumb_func_start sub_81C4F98 sub_81C4F98: ; 81C4F98 push {r4-r6,lr} adds r5, r1, 0 lsls r0, 24 lsrs r4, r0, 24 ldr r6, =0x0203cf2c ldr r0, =0x0000098c bl malloc_and_clear str r0, [r6] cmp r4, 0x4 beq @081C4FB2 ldr r0, =0x0203cf30 strb r4, [r0, 0x4] @081C4FB2: cmp r5, 0 beq @081C4FBA ldr r0, =0x0203cf30 str r5, [r0] @081C4FBA: ldr r0, [r6] movs r1, 0 str r1, [r0] ldr r1, =0x00000814 adds r0, r1 movs r1, 0xFF strb r1, [r0] ldr r0, [r6] ldr r1, =0x00000816 adds r0, r1 movs r1, 0x1 negs r1, r1 strb r1, [r0] ldr r0, [r6] ldr r1, =0x00000804 adds r0, r1 movs r1, 0xFF movs r2, 0xB bl memset ldr r0, [r6] ldr r1, =0x0000080f adds r0, r1 movs r1, 0xFF movs r2, 0x5 bl memset ldr r0, =sub_81C504C bl set_callback2 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 movs r1, 0x87 lsls r1, 3 adds r0, r1 ldrb r0, [r0] cmp r0, 0x10 bls @081C508C b @081C51BC @081C508C: lsls r0, 2 ldr r1, =@081C50A0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C50A0: .4byte @081C50E4 .4byte @081C50EE .4byte @081C50F4 .4byte @081C50FA .4byte @081C510C .4byte @081C5112 .4byte @081C5122 .4byte @081C513C .4byte @081C5148 .4byte @081C514E .4byte @081C515C .4byte @081C5162 .4byte @081C5168 .4byte @081C516E .4byte @081C5174 .4byte @081C517A .4byte @081C5188 @081C50E4: bl 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, =0x02037fd4 ldrb r0, [r2, 0x8] movs r1, 0x80 orrs r0, r1 b @081C51A0 .align 2, 0 .pool @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, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000984 adds r0, r1 movs r1, 0 strh r1, [r0] b @081C51A2 .align 2, 0 .pool @081C513C: bl sub_81C5238 lsls r0, 24 cmp r0, 0 beq @081C51D4 b @081C51A2 @081C5148: bl sub_81C6BD8 b @081C51A2 @081C514E: bl sub_81C5924 bl sub_81C59BC bl sub_81C5A20 b @081C51A2 @081C515C: bl sub_81C5314 b @081C51A2 @081C5162: bl sub_81C56F8 b @081C51A2 @081C5168: bl sub_81C6EF4 b @081C51A2 @081C516E: bl sub_81C5674 b @081C51A2 @081C5174: bl sub_81C700C b @081C51A2 @081C517A: movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 b @081C51A2 @081C5188: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r2, =0x02037fd4 ldrb r1, [r2, 0x8] movs r0, 0x7F ands r0, r1 @081C51A0: strb r0, [r2, 0x8] @081C51A2: ldr r1, =0x030022c0 movs r0, 0x87 lsls r0, 3 adds r1, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @081C51D4 .align 2, 0 .pool @081C51BC: ldr r0, =sub_81C5038 bl SetVBlankCallback ldr r0, =sub_81C501C bl set_callback2 movs r0, 0x1 b @081C51D6 .align 2, 0 .pool @081C51D4: movs r0, 0 @081C51D6: add sp, 0x4 pop {r1} bx r1 thumb_func_end sub_81C5078 thumb_func_start sub_81C51DC sub_81C51DC: ; 81C51DC push {lr} bl sub_8121DA0 movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_0861F2B4 movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r0, =0x0203cf2c 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 .pool thumb_func_end sub_81C51DC thumb_func_start sub_81C5238 sub_81C5238: ; 81C5238 push {r4,lr} sub sp, 0x4 ldr r4, =0x0203cf2c ldr r0, [r4] ldr r1, =0x00000984 adds r0, r1 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0x4 bhi @081C52F0 lsls r0, 2 ldr r1, =@081C5264 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C5264: .4byte @081C5278 .4byte @081C5294 .4byte @081C52B8 .4byte @081C52C8 .4byte @081C52D4 @081C5278: bl reset_temp_tile_data_buffers ldr r1, =gUnknown_08D9A620 movs r0, 0 str r0, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram b @081C52D8 .align 2, 0 .pool @081C5294: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C5308 ldr r0, =gUnknown_08D9AE04 ldr r4, =0x0203cf2c ldr r1, [r4] adds r1, 0x4 bl call_LZZUnCompWram ldr r1, [r4] b @081C52DC .align 2, 0 .pool @081C52B8: ldr r0, =gUnknown_08D9AF44 movs r1, 0 movs r2, 0x20 bl decompress_palette b @081C52D8 .align 2, 0 .pool @081C52C8: ldr r0, =gUnknown_0861F3CC bl gpu_tile_obj_decompress_and_load b @081C52D8 .align 2, 0 .pool @081C52D4: bl sub_81C6E98 @081C52D8: ldr r0, =0x0203cf2c ldr r1, [r0] @081C52DC: ldr r0, =0x00000984 adds r1, r0 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] b @081C5308 .align 2, 0 .pool @081C52F0: bl sub_8122328 ldr r0, [r4] ldr r1, =0x00000984 adds r0, r1 movs r1, 0 strh r1, [r0] movs r0, 0x1 b @081C530A .align 2, 0 .pool @081C5308: movs r0, 0 @081C530A: add sp, 0x4 pop {r4} pop {r1} bx r1 thumb_func_end sub_81C5238 thumb_func_start sub_81C5314 sub_81C5314: ; 81C5314 push {r4-r7,lr} ldr r0, =0x03005d90 ldr r2, [r0] ldr r1, =0x00000ca9 adds r0, r2, r1 ldrb r1, [r0] lsls r1, 30 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 2 ldr r3, =0x00000e2c adds r0, r3 adds r7, r2, r0 movs r6, 0 ldr r1, =0x0203cf2c ldr r0, [r1] ldr r4, =0x00000821 adds r0, r4 ldrb r0, [r0] subs r0, 0x1 cmp r6, r0 bge @081C5382 adds r5, r1, 0 @081C5344: lsls r1, r6, 1 adds r4, r1, r6 lsls r4, 3 ldr r0, =0x0000087c adds r4, r0 ldr r0, [r5] adds r0, r4 adds r1, r7 ldrh r1, [r1] bl sub_81C540C ldr r1, [r5] lsls r2, r6, 3 ldr r3, =0x00000824 adds r0, r1, r3 adds r0, r2 adds r4, r1, r4 str r4, [r0] ldr r4, =0x00000828 adds r0, r1, r4 adds r0, r2 str r6, [r0] adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 ldr r0, =0x00000821 adds r1, r0 ldrb r0, [r1] subs r0, 0x1 cmp r6, r0 blt @081C5344 @081C5382: ldr r5, =0x0203cf2c lsls r4, r6, 1 adds r4, r6 lsls r4, 3 ldr r1, =0x0000087c adds r4, r1 ldr r0, [r5] adds r0, r4 ldr r1, =gUnknown_085E8DB4 bl gf_strcpy ldr r1, [r5] lsls r2, r6, 3 ldr r3, =0x00000824 adds r0, r1, r3 adds r0, r2 adds r4, r1, r4 str r4, [r0] ldr r4, =0x00000828 adds r1, r4 adds r1, r2 movs r0, 0x2 negs r0, r0 str r0, [r1] ldr r2, =0x03006310 adds r1, r2, 0 ldr r0, =gUnknown_0861F2C0 ldm r0!, {r4,r6,r7} stm r1!, {r4,r6,r7} ldm r0!, {r4,r6,r7} stm r1!, {r4,r6,r7} ldr r1, [r5] ldr r6, =0x00000821 adds r0, r1, r6 ldrb r0, [r0] strh r0, [r2, 0xC] adds r3, r1, r3 str r3, [r2] ldr r7, =0x00000822 adds r1, r7 ldrb r0, [r1] strh r0, [r2, 0xE] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5314 thumb_func_start sub_81C540C sub_81C540C: ; 81C540C push {r4,r5,lr} adds r5, r0, 0 lsls r1, 16 lsrs r4, r1, 16 adds r0, r4, 0 bl itemid_get_pocket_number lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 bne @081C5450 ldr r0, =0x02021cc4 adds r1, r4, 0 subs r1, 0x84 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r1, =0x02021dc4 adds r0, r4, 0 bl itemid_get_name ldr r1, =gUnknown_085E9210 adds r0, r5, 0 bl ExpandTextCodes b @081C5458 .align 2, 0 .pool @081C5450: adds r0, r4, 0 adds r1, r5, 0 bl itemid_get_name @081C5458: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C540C thumb_func_start sub_81C5460 sub_81C5460: ; 81C5460 push {r4,r5,lr} adds r4, r0, 0 lsls r1, 24 lsrs r1, 24 cmp r1, 0x1 beq @081C5476 movs r0, 0x5 bl audio_play bl sub_81C6F20 @081C5476: ldr r5, =0x0203cf2c ldr r1, [r5] ldr r2, =0x00000814 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0xFF bne @081C5504 adds r2, 0x1 adds r0, r1, r2 ldrb r1, [r0] movs r0, 0x1 eors r0, r1 bl sub_81C6FF8 movs r0, 0x2 negs r0, r0 cmp r4, r0 beq @081C54E0 ldr r0, =0x03005d90 ldr r2, [r0] lsls r3, r4, 1 ldr r1, =0x00000ca9 adds r0, r2, r1 ldrb r1, [r0] lsls r1, 30 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r3, r0 ldr r0, =0x00000e2c adds r2, r0 adds r2, r3 ldrh r0, [r2] ldr r1, [r5] ldr r2, =0x00000815 adds r1, r2 ldrb r1, [r1] bl sub_81C6F90 b @081C54EE .align 2, 0 .pool @081C54E0: ldr r0, =0x0000ffff ldr r1, [r5] ldr r2, =0x00000815 adds r1, r2 ldrb r1, [r1] bl sub_81C6F90 @081C54EE: ldr r0, =0x0203cf2c ldr r1, [r0] ldr r0, =0x00000815 adds r1, r0 ldrb r0, [r1] movs r2, 0x1 eors r0, r2 strb r0, [r1] adds r0, r4, 0 bl sub_81C55D8 @081C5504: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5460 thumb_func_start sub_81C5518 sub_81C5518: ; 81C5518 push {r4-r6,lr} sub sp, 0x10 adds r4, r1, 0 lsls r0, 24 lsrs r6, r0, 24 lsls r2, 24 lsrs r5, r2, 24 movs r0, 0x2 negs r0, r0 cmp r4, r0 beq @081C55B8 ldr r0, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000814 adds r0, r1 ldrb r1, [r0] cmp r1, 0xFF beq @081C5560 lsls r0, r4, 24 lsrs r0, 24 cmp r1, r0 bne @081C5558 adds r0, r5, 0 movs r1, 0x1 bl sub_81C5AB8 b @081C5560 .align 2, 0 .pool @081C5558: adds r0, r5, 0 movs r1, 0xFF bl sub_81C5AB8 @081C5560: ldr r0, =0x02021cc4 ldr r1, =0x03005d90 ldr r3, [r1] ldr r2, =0x00000ca9 adds r1, r3, r2 ldrb r2, [r1] lsls r2, 30 lsrs r2, 30 lsls r1, r2, 2 adds r1, r2 lsls r1, 1 adds r1, r4, r1 ldr r2, =0x00000e54 adds r3, r2 adds r3, r1 ldrb r1, [r3] movs r2, 0x1 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool thumb_func_end sub_81C5518 thumb_func_start sub_81C55D8 sub_81C55D8: ; 81C55D8 push {r4,lr} sub sp, 0x10 adds r3, r0, 0 movs r0, 0x2 negs r0, r0 cmp r3, r0 beq @081C561C ldr r0, =0x03005d90 ldr r2, [r0] lsls r3, 1 ldr r1, =0x00000ca9 adds r0, r2, r1 ldrb r1, [r0] lsls r1, 30 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r3, r0 ldr r0, =0x00000e2c adds r2, r0 adds r2, r3 ldrh r0, [r2] bl itemid_get_description adds r4, r0, 0 b @081C5638 .align 2, 0 .pool @081C561C: ldr r0, =0x02021cc4 ldr r2, =gUnknown_085E91B0 ldr r1, =0x0203cf30 ldrb r1, [r1, 0x4] lsls r1, 2 adds r1, r2 ldr r1, [r1] bl gf_strcpy ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E91C0 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 .pool thumb_func_end sub_81C55D8 thumb_func_start sub_81C5674 sub_81C5674: ; 81C5674 push {r4,lr} sub sp, 0x10 ldr r4, =0x0203cf2c ldr r1, [r4] ldr r2, =0x00000816 adds r0, r1, r2 ldrb r0, [r0] cmp r0, 0xFF bne @081C56B4 adds r2, 0xB adds r0, r1, r2 ldrb r0, [r0] adds r2, 0x1 adds r1, r2 ldrb r1, [r1] subs r0, r1 str r0, [sp] ldr r0, =0x00000b5e str r0, [sp, 0x4] str r0, [sp, 0x8] ldr r0, =0x0203cf38 str r0, [sp, 0xC] movs r0, 0x2 movs r1, 0xAC movs r2, 0xC movs r3, 0x94 bl sub_81AF4A0 ldr r1, [r4] ldr r2, =0x00000816 adds r1, r2 strb r0, [r1] @081C56B4: add sp, 0x10 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5674 thumb_func_start sub_81C56CC sub_81C56CC: ; 81C56CC push {r4,lr} ldr r4, =0x0203cf2c ldr r0, [r4] ldr r2, =0x00000816 adds r1, r0, r2 ldrb r0, [r1] cmp r0, 0xFF beq @081C56EA bl sub_81AF620 ldr r0, [r4] ldr r1, =0x00000816 adds r0, r1 movs r1, 0xFF strb r1, [r0] @081C56EA: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C56CC thumb_func_start sub_81C56F8 sub_81C56F8: ; 81C56F8 push {r4,lr} ldr r0, =sub_81C5BC8 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 ldr r0, =0x03006310 ldr r2, =0x0203cf30 ldrh r1, [r2, 0x8] ldrh r2, [r2, 0x6] bl 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 .pool thumb_func_end sub_81C56F8 thumb_func_start sub_81C5738 sub_81C5738: ; 81C5738 push {r4-r6,lr} mov r6, r8 push {r6} lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 ldr r2, =0x03005d90 ldr r6, [r2] ldr r3, =0x00000ca9 adds r2, r6, r3 ldrb r3, [r2] lsls r3, 30 lsrs r2, r3, 30 lsls r4, r2, 2 adds r4, r2 lsls r4, 2 ldr r2, =0x00000e2c adds r4, r2 adds r4, r6, r4 lsrs r3, 30 lsls r2, r3, 2 adds r2, r3 lsls r2, 1 ldr r3, =0x00000e54 adds r2, r3 adds r6, r2 lsls r5, r0, 1 adds r5, r4 ldrh r2, [r5] mov r8, r2 lsls r2, r1, 1 adds r2, r4 ldrh r3, [r2] strh r3, [r5] mov r3, r8 strh r3, [r2] adds r0, r6, r0 ldrb r2, [r0] adds r6, r1 ldrb r1, [r6] strb r1, [r0] strb r2, [r6] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5738 thumb_func_start sub_81C57A8 sub_81C57A8: ; 81C57A8 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r4, r0, 24 adds r7, r4, 0 lsls r1, 24 lsrs r5, r1, 24 ldr r0, =0x03005d90 ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 ldrb r1, [r0] lsls r1, 30 lsrs r2, r1, 30 lsls r0, r2, 2 adds r0, r2 lsls r0, 2 ldr r2, =0x00000e2c adds r0, r2 adds r6, r3, r0 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 1 ldr r1, =0x00000e54 adds r0, r1 adds r3, r0 cmp r4, r5 beq @081C5862 lsls r0, r4, 1 adds r0, r6 ldrh r0, [r0] mov r12, r0 adds r0, r3, r4 ldrb r0, [r0] mov r8, r0 cmp r5, r4 bls @081C5830 subs r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 lsls r2, r4, 16 cmp r4, r5 bge @081C5854 @081C5802: asrs r2, 16 lsls r0, r2, 1 adds r0, r6 ldrh r1, [r0, 0x2] strh r1, [r0] adds r1, r3, r2 ldrb r0, [r1, 0x1] strb r0, [r1] adds r2, 0x1 lsls r2, 16 asrs r0, r2, 16 cmp r0, r5 blt @081C5802 b @081C5854 .align 2, 0 .pool @081C5830: lsls r2, r7, 16 cmp r7, r5 ble @081C5854 @081C5836: asrs r2, 16 lsls r1, r2, 1 adds r1, r6 subs r0, r1, 0x2 ldrh r0, [r0] strh r0, [r1] adds r1, r3, r2 subs r0, r1, 0x1 ldrb r0, [r0] strb r0, [r1] subs r2, 0x1 lsls r2, 16 asrs r0, r2, 16 cmp r0, r5 bgt @081C5836 @081C5854: lsls r0, r5, 1 adds r0, r6 mov r2, r12 strh r2, [r0] adds r0, r3, r5 mov r1, r8 strb r1, [r0] @081C5862: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C57A8 thumb_func_start sub_81C586C sub_81C586C: ; 81C586C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} ldr r0, =0x03005d90 ldr r3, [r0] ldr r1, =0x00000ca9 adds r0, r3, r1 ldrb r1, [r0] lsls r1, 30 lsrs r2, r1, 30 lsls r0, r2, 2 adds r0, r2 lsls r0, 2 ldr r2, =0x00000e2c adds r0, r2 adds r0, r3 mov r9, r0 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 1 ldr r4, =0x00000e54 adds r0, r4 adds r3, r0 mov r8, r3 movs r5, 0 movs r3, 0 @081C58A4: lsls r0, r5, 1 mov r1, r9 adds r2, r0, r1 ldrh r0, [r2] mov r4, r8 adds r1, r4, r5 cmp r0, 0 beq @081C58BA ldrb r0, [r1] cmp r0, 0 bne @081C58BE @081C58BA: strh r3, [r2] strb r3, [r1] @081C58BE: adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0x9 bls @081C58A4 movs r5, 0 @081C58CA: adds r1, r5, 0x1 lsls r0, r1, 24 lsrs r4, r0, 24 adds r7, r1, 0 cmp r4, 0x9 bhi @081C58FE lsls r0, r5, 1 mov r1, r9 adds r6, r0, r1 @081C58DC: ldrh r0, [r6] cmp r0, 0 beq @081C58EC mov r2, r8 adds r0, r2, r5 ldrb r0, [r0] cmp r0, 0 bne @081C58F4 @081C58EC: adds r0, r5, 0 adds r1, r4, 0 bl sub_81C5738 @081C58F4: adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x9 bls @081C58DC @081C58FE: lsls r0, r7, 24 lsrs r5, r0, 24 cmp r5, 0x8 bls @081C58CA pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C586C thumb_func_start sub_81C5924 sub_81C5924: ; 81C5924 push {r4-r6,lr} ldr r0, =0x03005d90 ldr r2, [r0] ldr r1, =0x00000ca9 adds r0, r2, r1 ldrb r1, [r0] lsls r1, 30 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 2 ldr r1, =0x00000e2c adds r0, r1 adds r5, r2, r0 bl sub_81C586C ldr r3, =0x0203cf2c ldr r0, [r3] ldr r2, =0x00000821 adds r0, r2 movs r1, 0 strb r1, [r0] movs r4, 0 adds r6, r3, 0 @081C5954: lsls r0, r4, 1 adds r0, r5 ldrh r0, [r0] ldr r3, =0x0203cf2c cmp r0, 0 beq @081C596A ldr r1, [r6] adds r1, r2 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] @081C596A: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x9 bls @081C5954 ldr r0, [r3] ldr r2, =0x00000821 adds r0, r2 ldrb r1, [r0] adds r1, 0x1 strb r1, [r0] ldr r0, [r3] adds r2, r0, r2 ldrb r2, [r2] cmp r2, 0x8 bls @081C59AC ldr r2, =0x00000822 adds r1, r0, r2 movs r0, 0x8 strb r0, [r1] b @081C59B2 .align 2, 0 .pool @081C59AC: ldr r1, =0x00000822 adds r0, r1 strb r2, [r0] @081C59B2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5924 thumb_func_start sub_81C59BC sub_81C59BC: ; 81C59BC push {r4,r5,lr} ldr r0, =0x0203cf30 ldrh r1, [r0, 0x8] adds r3, r0, 0 ldr r4, =0x0203cf2c cmp r1, 0 beq @081C59E4 ldrh r0, [r3, 0x8] ldr r1, [r4] ldr r5, =0x00000822 adds r2, r1, r5 ldrb r2, [r2] adds r0, r2 subs r5, 0x1 adds r1, r5 ldrb r1, [r1] cmp r0, r1 ble @081C59E4 subs r0, r1, r2 strh r0, [r3, 0x8] @081C59E4: adds r2, r3, 0 ldrh r1, [r2, 0x8] ldrh r0, [r2, 0x6] adds r1, r0 ldr r0, [r4] ldr r4, =0x00000821 adds r0, r4 ldrb r0, [r0] cmp r1, r0 blt @081C5A18 adds r1, r0, 0 cmp r1, 0 bne @081C5A14 strh r1, [r2, 0x6] b @081C5A18 .align 2, 0 .pool @081C5A14: subs r0, 0x1 strh r0, [r3, 0x6] @081C5A18: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C59BC thumb_func_start sub_81C5A20 sub_81C5A20: ; 81C5A20 push {r4-r7,lr} ldr r0, =0x0203cf30 ldrh r1, [r0, 0x6] adds r5, r0, 0 cmp r1, 0x4 bls @081C5A80 movs r4, 0 ldrh r0, [r5, 0x6] subs r0, 0x4 cmp r4, r0 bgt @081C5A80 ldrh r2, [r5, 0x8] ldr r6, =0x0203cf2c ldr r0, [r6] ldr r3, =0x00000822 adds r1, r0, r3 ldrb r1, [r1] adds r2, r1 ldr r7, =0x00000821 adds r0, r7 ldrb r0, [r0] cmp r2, r0 beq @081C5A80 adds r3, r5, 0 @081C5A50: ldrh r0, [r3, 0x6] subs r0, 0x1 strh r0, [r3, 0x6] ldrh r0, [r3, 0x8] adds r0, 0x1 strh r0, [r3, 0x8] adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 ldrh r0, [r3, 0x6] subs r0, 0x4 cmp r4, r0 bgt @081C5A80 ldrh r2, [r5, 0x8] ldr r1, [r6] ldr r7, =0x00000822 adds r0, r1, r7 ldrb r0, [r0] adds r2, r0 ldr r0, =0x00000821 adds r1, r0 ldrb r1, [r1] cmp r2, r1 bne @081C5A50 @081C5A80: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5A20 thumb_func_start sub_81C5A98 sub_81C5A98: ; 81C5A98 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 lsls r4, 24 lsrs r4, 24 bl 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 GetMenuCursorDimensionByFont adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 movs r1, 0x1 bl GetMenuCursorDimensionByFont lsls r0, 24 lsrs r0, 24 str r4, [sp] str r0, [sp, 0x4] movs r0, 0 movs r1, 0 movs r2, 0 adds r3, r5, 0 bl Window_FillPixelRect b @081C5B08 @081C5AF4: ldr r1, =gUnknown_085E8D60 movs r0, 0 str r0, [sp] str r0, [sp, 0x4] str r0, [sp, 0x8] str r2, [sp, 0xC] movs r2, 0 adds r3, r5, 0 bl sub_81C6C3C @081C5B08: add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5AB8 thumb_func_start sub_81C5B14 sub_81C5B14: ; 81C5B14 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81C5B4C str r1, [r0] add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5B14 thumb_func_start sub_81C5B4C sub_81C5B4C: ; 81C5B4C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r2, r0, r1 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081C5BBC ldrb r0, [r2] ldr r4, =0x0203cf38 subs r2, r4, 0x2 adds r1, r4, 0 bl sub_81AE6C8 ldr r0, =0x0203cf2c ldr r0, [r0] ldr r0, [r0] cmp r0, 0 beq @081C5B94 bl set_callback2 b @081C5B9E .align 2, 0 .pool @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, =0x0203cf2c ldr r0, [r0] bl free adds r0, r5, 0 bl remove_task @081C5BBC: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5B4C thumb_func_start sub_81C5BC8 sub_81C5BC8: ; 81C5BC8 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r7, r0, r1 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C5BEA b @081C5D16 @081C5BEA: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081C5BF8 b @081C5D16 @081C5BF8: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x4 ands r0, r1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0 beq @081C5C5C ldr r4, =0x0203cf30 ldrb r0, [r4, 0x4] cmp r0, 0x2 bne @081C5C12 b @081C5D16 @081C5C12: ldrb r0, [r7] adds r1, r4, 0 adds r1, 0x8 adds r2, r4, 0x6 bl get_coro_args_x18_x1A ldrh r1, [r4, 0x8] ldrh r0, [r4, 0x6] adds r1, r0 ldr r0, =0x0203cf2c ldr r0, [r0] ldr r2, =0x00000821 adds r0, r2 ldrb r0, [r0] subs r0, 0x1 cmp r1, r0 beq @081C5D16 movs r0, 0x5 bl audio_play adds r0, r5, 0 bl sub_81C67CC b @081C5D16 .align 2, 0 .pool @081C5C5C: ldrb r0, [r7] bl sub_81AE604 adds r6, r0, 0 ldrb r0, [r7] ldr r1, =0x0203cf38 mov r8, r1 mov r2, r8 subs r2, 0x2 bl get_coro_args_x18_x1A movs r0, 0x2 negs r0, r0 cmp r6, r0 beq @081C5C88 adds r0, 0x1 cmp r6, r0 bne @081C5CA0 b @081C5D16 .align 2, 0 .pool @081C5C88: movs r0, 0x5 bl audio_play ldr r0, =0x0203ce7c strh r4, [r0] adds r0, r5, 0 bl sub_81C5B14 b @081C5D16 .align 2, 0 .pool @081C5CA0: movs r0, 0x5 bl audio_play ldr r2, =0x0203ce7c mov r12, r2 ldr r0, =0x03005d90 ldr r2, [r0] lsls r3, r6, 1 ldr r0, =0x00000ca9 adds r4, r2, r0 ldrb r1, [r4] lsls r1, 30 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r3, r0 ldr r1, =0x00000e2c adds r0, r2, r1 adds r0, r3 ldrh r0, [r0] mov r1, r12 strh r0, [r1] strh r6, [r7, 0x2] ldrb r1, [r4] lsls r1, 30 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 1 adds r0, r6, r0 ldr r1, =0x00000e54 adds r2, r1 adds r2, r0 ldrb r0, [r2] strh r0, [r7, 0x4] mov r0, r8 subs r0, 0x8 ldrb r0, [r0, 0x4] cmp r0, 0x2 bne @081C5D10 adds r0, r5, 0 bl sub_81C674C b @081C5D16 .align 2, 0 .pool @081C5D10: adds r0, r5, 0 bl sub_81C5D20 @081C5D16: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C5BC8 thumb_func_start sub_81C5D20 sub_81C5D20: ; 81C5D20 push {r4,r5,lr} sub sp, 0x10 lsls r0, 24 lsrs r5, r0, 24 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 bl sub_81C56CC ldrb r0, [r4] movs r1, 0x1 bl sub_81C5A98 ldr r0, =0x0203cf30 ldrb r4, [r0, 0x4] cmp r4, 0x1 beq @081C5D74 cmp r4, 0x3 beq @081C5DC4 ldr r0, =0x0203cf2c ldr r1, [r0] ldr r0, =0x00000818 adds r2, r1, r0 ldr r0, =gUnknown_0861F308 str r0, [r2] movs r0, 0x82 lsls r0, 4 adds r1, r0 movs r0, 0x4 b @081C5DD8 .align 2, 0 .pool @081C5D74: ldr r0, =0x0203ce7c ldrh r0, [r0] bl itemid_get_usage lsls r0, 24 cmp r0, 0 beq @081C5DA0 ldr r0, =0x0203cf2c ldr r1, [r0] ldr r0, =0x00000818 adds r2, r1, r0 ldr r0, =gUnknown_0861F30E b @081C5DCE .align 2, 0 .pool @081C5DA0: ldr r0, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000818 adds r2, r0, r1 ldr r1, =gUnknown_0861F310 str r1, [r2] movs r1, 0x82 lsls r1, 4 adds r0, r1 strb r4, [r0] b @081C5DDA .align 2, 0 .pool @081C5DC4: ldr r0, =0x0203cf2c ldr r1, [r0] ldr r0, =0x00000818 adds r2, r1, r0 ldr r0, =gUnknown_0861F30C @081C5DCE: str r0, [r2] movs r0, 0x82 lsls r0, 4 adds r1, r0 movs r0, 0x2 @081C5DD8: strb r0, [r1] @081C5DDA: ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DBE adds r0, r4, 0 bl 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, =0x0203cf2c ldr r0, [r0] movs r1, 0x82 lsls r1, 4 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @081C5E3C movs r0, 0 b @081C5E42 .align 2, 0 .pool @081C5E3C: cmp r0, 0x2 bne @081C5E50 movs r0, 0x1 @081C5E42: bl sub_81C6D24 lsls r0, 24 lsrs r0, 24 bl sub_81C5EAC b @081C5E62 @081C5E50: movs r0, 0x2 bl sub_81C6D24 lsls r0, 24 lsrs r0, 24 movs r1, 0x2 movs r2, 0x2 bl sub_81C5F08 @081C5E62: ldr r0, =0x0203cf2c ldr r0, [r0] movs r1, 0x82 lsls r1, 4 adds r0, r1 ldrb r0, [r0] cmp r0, 0x4 bne @081C5E8C ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81C5FE4 b @081C5E98 .align 2, 0 .pool @081C5E8C: ldr r0, =0x03005e00 lsls r1, r5, 2 adds r1, r5 lsls r1, 3 adds r1, r0 ldr r0, =sub_81C5F68 @081C5E98: str r0, [r1] add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5D20 thumb_func_start sub_81C5EAC sub_81C5EAC: ; 81C5EAC push {r4-r6,lr} sub sp, 0x14 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0 str r0, [sp] movs r0, 0x10 str r0, [sp, 0x4] ldr r6, =0x0203cf2c ldr r1, [r6] movs r5, 0x82 lsls r5, 4 adds r0, r1, r5 ldrb r0, [r0] str r0, [sp, 0x8] ldr r0, =gUnknown_0861F2D8 str r0, [sp, 0xC] ldr r0, =0x00000818 adds r1, r0 ldr r0, [r1] str r0, [sp, 0x10] adds r0, r4, 0 movs r1, 0x7 movs r2, 0x8 movs r3, 0x1 bl 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 .pool thumb_func_end sub_81C5EAC thumb_func_start sub_81C5F08 sub_81C5F08: ; 81C5F08 push {r4-r6,lr} sub sp, 0x14 adds r4, r0, 0 adds r5, r1, 0 adds r6, r2, 0 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 lsls r6, 24 lsrs r6, 24 movs r0, 0x38 str r0, [sp] str r5, [sp, 0x4] str r6, [sp, 0x8] ldr r0, =gUnknown_0861F2D8 str r0, [sp, 0xC] ldr r0, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000818 adds r0, r1 ldr r0, [r0] str r0, [sp, 0x10] adds r0, r4, 0 movs r1, 0x7 movs r2, 0x8 movs r3, 0x1 bl sub_8198DBC movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0x38 adds r2, r5, 0 adds r3, r6, 0 bl sub_8199944 add sp, 0x14 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5F08 thumb_func_start sub_81C5F68 sub_81C5F68: ; 81C5F68 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C5FD0 bl ProcessMenuInputNoWrapAround lsls r0, 24 asrs r4, r0, 24 movs r0, 0x2 negs r0, r0 cmp r4, r0 beq @081C5FD0 adds r0, 0x1 cmp r4, r0 bne @081C5FA8 movs r0, 0x5 bl audio_play ldr r0, =gUnknown_0861F2D8 ldr r1, [r0, 0x1C] adds r0, r5, 0 bl _call_via_r1 b @081C5FD0 .align 2, 0 .pool @081C5FA8: movs r0, 0x5 bl audio_play ldr r1, =gUnknown_0861F2D8 ldr r0, =0x0203cf2c ldr r0, [r0] ldr r2, =0x00000818 adds r0, r2 ldr r0, [r0] adds r0, r4 ldrb r0, [r0] lsls r0, 3 adds r1, 0x4 adds r0, r1 ldr r1, [r0] cmp r1, 0 beq @081C5FD0 adds r0, r6, 0 bl _call_via_r1 @081C5FD0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5F68 thumb_func_start sub_81C5FE4 sub_81C5FE4: ; 81C5FE4 push {r4-r6,lr} lsls r0, 24 lsrs r6, r0, 24 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C5FF8 b @081C6160 @081C5FF8: bl GetMenuCursorPos lsls r0, 24 lsrs r4, r0, 24 ldr r5, =0x030022c0 ldrh r1, [r5, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081C6040 lsls r0, r4, 24 asrs r0, 24 cmp r0, 0 bgt @081C6016 b @081C6160 @081C6016: subs r0, 0x2 lsls r0, 24 asrs r0, 24 bl sub_81C616C lsls r0, 24 cmp r0, 0 bne @081C6028 b @081C6160 @081C6028: movs r0, 0x5 bl audio_play movs r1, 0x1 negs r1, r1 movs r0, 0 bl sub_8199134 b @081C6160 .align 2, 0 .pool @081C6040: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081C6084 lsls r0, r4, 24 asrs r1, r0, 24 ldr r0, =0x0203cf2c ldr r0, [r0] movs r2, 0x82 lsls r2, 4 adds r0, r2 ldrb r0, [r0] subs r0, 0x2 cmp r1, r0 blt @081C6060 b @081C6160 @081C6060: adds r0, r1, 0x2 lsls r0, 24 asrs r0, 24 bl sub_81C616C lsls r0, 24 cmp r0, 0 beq @081C6160 movs r0, 0x5 bl audio_play movs r0, 0 movs r1, 0x1 bl sub_8199134 b @081C6160 .align 2, 0 .pool @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, =gUnknown_0861F2D8 ldr r0, =0x0203cf2c ldr r0, [r0] lsls r1, r4, 24 asrs r1, 24 ldr r3, =0x00000818 adds r0, r3 ldr r0, [r0] adds r0, r1 ldrb r0, [r0] lsls r0, 3 adds r2, 0x4 adds r0, r2 ldr r1, [r0] cmp r1, 0 beq @081C6160 adds r0, r6, 0 bl _call_via_r1 b @081C6160 .align 2, 0 .pool @081C6148: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C6160 movs r0, 0x5 bl audio_play ldr r0, =gUnknown_0861F2D8 ldr r1, [r0, 0x1C] adds r0, r6, 0 bl _call_via_r1 @081C6160: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C5FE4 thumb_func_start sub_81C616C sub_81C616C: ; 81C616C push {lr} lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 blt @081C61A0 ldr r0, =0x0203cf2c ldr r2, [r0] movs r3, 0x82 lsls r3, 4 adds r0, r2, r3 ldrb r0, [r0] cmp r1, r0 bgt @081C61A0 ldr r3, =0x00000818 adds r0, r2, r3 ldr r0, [r0] adds r0, r1 ldrb r0, [r0] cmp r0, 0x5 beq @081C61A0 movs r0, 0x1 b @081C61A2 .align 2, 0 .pool @081C61A0: movs r0, 0 @081C61A2: pop {r1} bx r1 thumb_func_end sub_81C616C thumb_func_start sub_81C61A8 sub_81C61A8: ; 81C61A8 push {lr} ldr r0, =0x0203cf2c ldr r0, [r0] movs r1, 0x82 lsls r1, 4 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 bne @081C61C8 movs r0, 0 bl sub_81C6D6C b @081C61DA .align 2, 0 .pool @081C61C8: cmp r0, 0x2 bne @081C61D4 movs r0, 0x1 bl sub_81C6D6C b @081C61DA @081C61D4: movs r0, 0x2 bl sub_81C6D6C @081C61DA: pop {r0} bx r0 thumb_func_end sub_81C61A8 thumb_func_start sub_81C61E0 sub_81C61E0: ; 81C61E0 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r4, =0x0203ce7c ldrh r0, [r4] bl itemid_get_pocket_number lsls r0, 24 lsrs r0, 24 cmp r0, 0x5 beq @081C620C cmp r0, 0x2 beq @081C620C cmp r0, 0x3 beq @081C620C ldrh r0, [r4] bl itemid_is_mail lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C6228 @081C620C: bl sub_81C61A8 ldr r1, =gUnknown_085E8F31 ldr r2, =sub_81C6714 adds r0, r5, 0 bl sub_81C6DD8 b @081C6252 .align 2, 0 .pool @081C6228: ldrh r0, [r4] bl itemid_get_overworld_function cmp r0, 0 beq @081C6252 bl sub_81C61A8 movs r0, 0x1 movs r1, 0 bl 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, =0x03005e08 adds r4, r0 bl sub_81C61A8 movs r1, 0x2 ldrsh r0, [r4, r1] bl sub_81C55D8 movs r0, 0 bl schedule_bg_copy_tilemap_to_vram movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram ldrb r0, [r4] movs r1, 0 bl sub_81C5A98 adds r0, r5, 0 bl sub_81C629C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6258 thumb_func_start sub_81C629C sub_81C629C: ; 81C629C push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 bl sub_81C5674 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81C5BC8 str r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C629C thumb_func_start sub_81C62C4 sub_81C62C4: ; 81C62C4 push {r4-r7,lr} sub sp, 0x10 lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r6, r0, 3 ldr r7, =0x03005e08 adds r4, r6, r7 bl sub_81C61A8 movs r0, 0x1 strh r0, [r4, 0x10] movs r1, 0x4 ldrsh r0, [r4, r1] cmp r0, 0x1 bne @081C62F4 adds r0, r5, 0 bl sub_81C6350 b @081C6334 .align 2, 0 .pool @081C62F4: ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8EE0 adds r0, r4, 0 bl 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, =sub_81C64B4 str r1, [r0] @081C6334: add sp, 0x10 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C62C4 thumb_func_start sub_81C6350 sub_81C6350: ; 81C6350 push {r4,r5,lr} sub sp, 0x10 adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, =0x02021dc4 movs r2, 0x10 ldrsh r1, [r4, r2] movs r2, 0 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8F0E 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, =gUnknown_0861F314 adds r0, r5, 0 bl sub_81C6DAC add sp, 0x10 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6350 thumb_func_start sub_81C63D0 sub_81C63D0: ; 81C63D0 push {r4,r5,lr} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 movs r1, 0x2 ldrsh r0, [r4, r1] bl sub_81C55D8 ldrb r0, [r4] movs r1, 0 bl sub_81C5A98 adds r0, r5, 0 bl sub_81C629C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C63D0 thumb_func_start sub_81C6404 sub_81C6404: ; 81C6404 push {r4,lr} sub sp, 0xC ldr r0, =0x02021cc4 movs r1, 0x1 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool thumb_func_end sub_81C6404 thumb_func_start sub_81C645C sub_81C645C: ; 81C645C push {r4,lr} sub sp, 0xC adds r1, r0, 0 ldr r0, =0x02021cc4 lsls r1, 16 asrs r1, 16 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string ldr r4, =0x02021fc4 ldr r1, =gUnknown_085E8DA0 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 .pool thumb_func_end sub_81C645C thumb_func_start sub_81C64B4 sub_81C64B4: ; 81C64B4 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 adds r0, r4, 0 adds r0, 0x10 ldrh r1, [r4, 0x4] bl 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 .pool @081C64E8: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081C651C movs r0, 0x5 bl audio_play movs r0, 0x3 movs r1, 0 bl sub_8198070 movs r0, 0x3 bl Window_FillTileMap movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram adds r0, r5, 0 bl sub_81C6350 b @081C6544 .align 2, 0 .pool @081C651C: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C6544 movs r0, 0x5 bl audio_play movs r0, 0x3 movs r1, 0 bl sub_8198070 movs r0, 0x3 bl 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, =0x03005e08 adds r6, r4, r5 ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r0, =0x02021dc4 movs r2, 0x10 ldrsh r1, [r6, r2] movs r2, 0 movs r3, 0x2 bl decimal_int_to_string ldr r6, =0x02021fc4 ldr r1, =gUnknown_085E8EF9 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, =sub_81C65CC str r0, [r4] add sp, 0x10 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C654C thumb_func_start sub_81C65CC sub_81C65CC: ; 81C65CC push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldr r6, =0x0203cf38 subs r7, r6, 0x2 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 beq @081C662E movs r0, 0x5 bl audio_play ldr r0, =0x0203ce7c ldrh r0, [r0] ldrh r1, [r4, 0x10] bl sub_80D7334 ldrb r0, [r4] adds r1, r6, 0 adds r2, r7, 0 bl sub_81AE6C8 bl sub_81C5924 bl sub_81C59BC bl sub_81C5314 ldr r0, =0x03006310 ldrh r1, [r6] ldrh r2, [r7] bl 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 .pool thumb_func_end sub_81C65CC thumb_func_start sub_81C6648 sub_81C6648: ; 81C6648 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 bl sub_81C61A8 ldr r5, =0x0203ce7c ldrh r0, [r5] bl itemid_is_mail lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081C667C ldr r1, =gUnknown_085E8DCE ldr r2, =sub_81C66EC adds r0, r4, 0 bl sub_81C6DD8 b @081C66A6 .align 2, 0 .pool @081C667C: ldrh r0, [r5] bl itemid_is_unique lsls r0, 24 cmp r0, 0 bne @081C66A0 ldr r0, =0x0203cf2c ldr r1, [r0] ldr r0, =sub_81B7F60 str r0, [r1] adds r0, r4, 0 bl sub_81C5B14 b @081C66A6 .align 2, 0 .pool @081C66A0: adds r0, r6, 0 bl sub_81C66AC @081C66A6: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81C6648 thumb_func_start sub_81C66AC sub_81C66AC: ; 81C66AC push {r4,r5,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x0203ce7c ldrh r0, [r0] ldr r1, =0x02021cc4 bl itemid_get_name ldr r5, =0x02021fc4 ldr r1, =gUnknown_085E8E11 adds r0, r5, 0 bl ExpandTextCodes ldr r2, =sub_81C66EC adds r0, r4, 0 adds r1, r5, 0 bl sub_81C6DD8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C66AC thumb_func_start sub_81C66EC sub_81C66EC: ; 81C66EC push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081C670A movs r0, 0x5 bl audio_play adds r0, r4, 0 bl sub_81C6714 @081C670A: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C66EC thumb_func_start sub_81C6714 sub_81C6714: ; 81C6714 push {r4,r5,lr} adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 lsls r4, r5, 2 adds r4, r5 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 bl sub_81C6E1C movs r1, 0x2 ldrsh r0, [r4, r1] bl sub_81C55D8 ldrb r0, [r4] movs r1, 0 bl sub_81C5A98 adds r0, r5, 0 bl sub_81C629C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6714 thumb_func_start sub_81C674C sub_81C674C: ; 81C674C push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 adds r6, r4, 0 ldr r5, =0x0203ce7c ldrh r0, [r5] bl itemid_80BF6D8_mail_related lsls r0, 24 cmp r0, 0 bne @081C677C ldr r1, =gUnknown_085E8DCE ldr r2, =sub_81C66EC adds r0, r4, 0 bl sub_81C6DD8 b @081C6796 .align 2, 0 .pool @081C677C: ldrh r0, [r5] bl itemid_is_unique lsls r0, 24 cmp r0, 0 bne @081C6790 adds r0, r4, 0 bl sub_81C5B14 b @081C6796 @081C6790: adds r0, r6, 0 bl sub_81C66AC @081C6796: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81C674C thumb_func_start sub_81C679C sub_81C679C: ; 81C679C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r4, =0x0203ce7c ldrh r0, [r4] bl itemid_get_battle_function cmp r0, 0 beq @081C67C0 bl sub_81C61A8 ldrh r0, [r4] bl itemid_get_battle_function adds r1, r0, 0 adds r0, r5, 0 bl _call_via_r1 @081C67C0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C679C thumb_func_start sub_81C67CC sub_81C67CC: ; 81C67CC push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x10 lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e08 mov r9, r0 adds r5, r4, r0 ldr r0, =0x0203cf30 ldrh r1, [r0, 0x6] ldrh r0, [r0, 0x8] adds r1, r0 strh r1, [r5, 0x2] ldr r0, =0x0203cf2c ldr r0, [r0] ldr r2, =0x00000814 adds r0, r2 movs r2, 0 mov r8, r2 strb r1, [r0] ldrb r0, [r5] movs r1, 0x10 movs r2, 0x1 bl sub_81AF15C ldr r0, =0x03005d90 ldr r3, [r0] movs r0, 0x2 ldrsh r2, [r5, r0] lsls r2, 1 ldr r1, =0x00000ca9 adds r0, r3, r1 ldrb r1, [r0] lsls r1, 30 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r2, r0 ldr r0, =0x00000e2c adds r3, r0 adds r3, r2 ldrh r0, [r3] ldr r1, =0x02021cc4 bl itemid_get_name ldr r6, =0x02021fc4 ldr r1, =gUnknown_085E8DFE adds r0, r6, 0 bl 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, =sub_81C68B0 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 .pool thumb_func_end sub_81C67CC thumb_func_start sub_81C68B0 sub_81C68B0: ; 81C68B0 push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 bl sub_81221EC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081C695C ldr r7, =0x030022c0 ldrh r1, [r7, 0x2E] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @081C68F8 movs r0, 0x5 bl audio_play ldrb r0, [r4] ldr r1, =0x0203cf38 subs r2, r1, 0x2 bl get_coro_args_x18_x1A b @081C6940 .align 2, 0 .pool @081C68F8: ldrb r0, [r4] bl sub_81AE604 adds r6, r0, 0 ldrb r0, [r4] ldr r4, =0x0203cf38 subs r2, r4, 0x2 adds r1, r4, 0 bl get_coro_args_x18_x1A movs r0, 0 bl sub_81C7028 subs r4, 0x8 ldrb r0, [r4, 0x6] bl sub_81C704C movs r0, 0x2 negs r0, r0 cmp r6, r0 beq @081C6930 adds r0, 0x1 cmp r6, r0 bne @081C6950 b @081C695C .align 2, 0 .pool @081C6930: movs r0, 0x5 bl audio_play ldrh r1, [r7, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081C6948 @081C6940: adds r0, r5, 0 bl sub_81C6964 b @081C695C @081C6948: adds r0, r5, 0 bl sub_81C6A14 b @081C695C @081C6950: movs r0, 0x5 bl audio_play adds r0, r5, 0 bl sub_81C6964 @081C695C: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C68B0 thumb_func_start sub_81C6964 sub_81C6964: ; 81C6964 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 ldr r7, =0x0203cf38 subs r0, r7, 0x2 mov r8, r0 ldrh r0, [r0] ldrh r1, [r7] adds r0, r1 lsls r0, 16 lsrs r4, r0, 16 movs r3, 0x2 ldrsh r1, [r5, r3] cmp r1, r4 beq @081C6996 subs r0, r4, 0x1 cmp r1, r0 bne @081C69A8 @081C6996: adds r0, r6, 0 bl sub_81C6A14 b @081C69FC .align 2, 0 .pool @081C69A8: ldrb r0, [r5, 0x2] lsls r1, r4, 24 lsrs r1, 24 bl sub_81C57A8 ldr r0, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000814 adds r0, r1 movs r1, 0xFF strb r1, [r0] movs r0, 0x1 bl sub_81C7028 ldrb r0, [r5] adds r1, r7, 0 mov r2, r8 bl sub_81AE6C8 movs r3, 0x2 ldrsh r0, [r5, r3] cmp r0, r4 bge @081C69E0 adds r1, r7, 0 subs r1, 0x8 ldrh r0, [r1, 0x6] subs r0, 0x1 strh r0, [r1, 0x6] @081C69E0: bl sub_81C5314 ldr r0, =0x03006310 ldrh r1, [r7] mov r3, r8 ldrh r2, [r3] bl 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 .pool thumb_func_end sub_81C6964 thumb_func_start sub_81C6A14 sub_81C6A14: ; 81C6A14 push {r4-r7,lr} lsls r0, 24 lsrs r0, 24 adds r6, r0, 0 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldr r5, =0x0203cf38 subs r7, r5, 0x2 ldr r0, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000814 adds r0, r1 movs r1, 0xFF strb r1, [r0] movs r0, 0x1 bl sub_81C7028 ldrb r0, [r4] adds r1, r5, 0 adds r2, r7, 0 bl sub_81AE6C8 movs r0, 0x2 ldrsh r2, [r4, r0] ldrh r0, [r5] ldrh r1, [r7] adds r0, r1 cmp r2, r0 bge @081C6A5E adds r1, r5, 0 subs r1, 0x8 ldrh r0, [r1, 0x6] subs r0, 0x1 strh r0, [r1, 0x6] @081C6A5E: bl sub_81C5314 ldr r0, =0x03006310 ldrh r1, [r5] ldrh r2, [r7] bl 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 .pool thumb_func_end sub_81C6A14 thumb_func_start sub_81C6A94 sub_81C6A94: ; 81C6A94 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 ldr r0, =0x020244ec mov r9, r0 movs r0, 0x14 bl malloc adds r7, r0, 0 movs r0, 0xA bl malloc adds r5, r0, 0 ldr r1, =0x03005d90 mov r8, r1 ldr r2, [r1] ldr r4, =0x00000ca9 adds r0, r2, r4 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, r2 ldr r0, =0x00000e2c adds r1, r0 adds r0, r7, 0 movs r2, 0x14 bl memcpy mov r1, r8 ldr r2, [r1] adds r0, r2, r4 ldrb r0, [r0] lsls r0, 30 lsrs r0, 30 lsls r1, r0, 2 adds r1, r0 lsls r1, 1 adds r1, r2 ldr r0, =0x00000e54 adds r1, r0 adds r0, r5, 0 movs r2, 0xA bl memcpy movs r6, 0 @081C6AF8: movs r0, 0x64 muls r0, r6 add r0, r9 movs r1, 0xC bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r1, sp strh r0, [r1] cmp r0, 0 beq @081C6B88 movs r1, 0x1 bl bag_add_item lsls r0, 24 cmp r0, 0 bne @081C6B88 mov r1, r8 ldr r2, [r1] adds r0, r2, r4 ldrb r1, [r0] lsls r1, 30 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x00000e2c adds r0, r1 adds r1, r7, 0 movs r2, 0x14 bl memcpy mov r0, r8 ldr r2, [r0] adds r0, r2, r4 ldrb r1, [r0] lsls r1, 30 lsrs r1, 30 lsls r0, r1, 2 adds r0, r1 lsls r0, 1 adds r0, r2 ldr r1, =0x00000e54 adds r0, r1 adds r1, r5, 0 movs r2, 0xA bl memcpy adds r0, r7, 0 bl free adds r0, r5, 0 bl free ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] b @081C6BC6 .align 2, 0 .pool @081C6B88: adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x2 bls @081C6AF8 movs r1, 0 mov r0, sp strh r1, [r0] movs r6, 0 movs r4, 0x64 @081C6B9C: adds r0, r6, 0 muls r0, r4 add r0, r9 movs r1, 0xC mov r2, sp bl pokemon_setattr adds r0, r6, 0x1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0x2 bls @081C6B9C ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] adds r0, r7, 0 bl free adds r0, r5, 0 bl free @081C6BC6: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6A94 thumb_func_start sub_81C6BD8 sub_81C6BD8: ; 81C6BD8 push {r4,lr} ldr r0, =gUnknown_0861F328 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, =gUnknown_0860F074 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 .pool thumb_func_end sub_81C6BD8 thumb_func_start sub_81C6C3C sub_81C6C3C: ; 81C6C3C push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x14 ldr r4, [sp, 0x28] ldr r6, [sp, 0x2C] ldr r5, [sp, 0x30] mov r8, r5 ldr r5, [sp, 0x34] lsls r0, 24 lsrs r0, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 lsls r4, 24 lsrs r4, 24 lsls r6, 24 lsrs r6, 24 lsls r5, 24 lsrs r5, 24 str r4, [sp] str r6, [sp, 0x4] lsls r4, r5, 1 adds r4, r5 ldr r5, =gUnknown_0861F31C adds r4, r5 str r4, [sp, 0x8] mov r4, r8 lsls r4, 24 asrs r4, 24 str r4, [sp, 0xC] str r1, [sp, 0x10] movs r1, 0x1 bl sub_8199EEC add sp, 0x14 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6C3C thumb_func_start sub_81C6C94 sub_81C6C94: ; 81C6C94 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x14 ldr r4, [sp, 0x28] ldr r6, [sp, 0x2C] ldr r5, [sp, 0x30] mov r8, r5 ldr r5, [sp, 0x34] lsls r0, 24 lsrs r0, 24 lsls r2, 24 lsrs r2, 24 lsls r3, 24 lsrs r3, 24 lsls r4, 24 lsrs r4, 24 lsls r6, 24 lsrs r6, 24 lsls r5, 24 lsrs r5, 24 str r4, [sp] str r6, [sp, 0x4] lsls r4, r5, 1 adds r4, r5 ldr r5, =gUnknown_0861F31C adds r4, r5 str r4, [sp, 0x8] mov r4, r8 lsls r4, 24 asrs r4, 24 str r4, [sp, 0xC] str r1, [sp, 0x10] movs r1, 0x7 bl sub_8199EEC add sp, 0x14 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6C94 thumb_func_start sub_81C6CEC sub_81C6CEC: ; 81C6CEC push {lr} lsls r0, 24 lsrs r0, 24 movs r1, 0 movs r2, 0x1 movs r3, 0xE bl SetWindowBorderStyle movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram pop {r0} bx r0 thumb_func_end sub_81C6CEC thumb_func_start sub_81C6D08 sub_81C6D08: ; 81C6D08 lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203cf2c ldr r1, [r1] ldr r2, =0x0000080f adds r1, r2 adds r1, r0 ldrb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81C6D08 thumb_func_start sub_81C6D24 sub_81C6D24: ; 81C6D24 push {r4,lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x0203cf2c ldr r3, =0x0000080f adds r1, r2, r3 ldr r0, [r0] adds r4, r0, r1 ldrb r0, [r4] cmp r0, 0xFF bne @081C6D58 lsls r0, r2, 3 ldr r1, =gUnknown_0861F350 adds r0, r1 bl 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 .pool thumb_func_end sub_81C6D24 thumb_func_start sub_81C6D6C sub_81C6D6C: ; 81C6D6C push {r4,lr} lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203cf2c ldr r2, =0x0000080f adds r0, r2 ldr r1, [r1] adds r4, r1, r0 ldrb r0, [r4] cmp r0, 0xFF beq @081C6D9E movs r1, 0 bl sub_8198070 ldrb r0, [r4] bl 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 .pool thumb_func_end sub_81C6D6C thumb_func_start sub_81C6DAC sub_81C6DAC: ; 81C6DAC push {lr} sub sp, 0x10 adds r3, r1, 0 lsls r0, 24 lsrs r0, 24 ldr r1, =gUnknown_0861F370 movs r2, 0x2 str r2, [sp] movs r2, 0x1 str r2, [sp, 0x4] movs r2, 0xE str r2, [sp, 0x8] str r3, [sp, 0xC] movs r2, 0x1 movs r3, 0 bl sub_8121F94 add sp, 0x10 pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cf2c ldr r2, =0x00000804 adds r1, r4, r2 ldr r0, [r0] adds r5, r0, r1 ldrb r0, [r5] cmp r0, 0xFF beq @081C6E80 ldr r0, =0x00001024 adds r4, r0 adds r0, r4, 0 bl 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, =0x02020630 adds r0, r4 bl obj_free_rotscale_entry ldrb r1, [r5] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl obj_delete_and_free_tiles movs r0, 0xFF strb r0, [r5] @081C6E80: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08D9ADD0 adds r1, r4, 0 bl call_LZZUnCompWram ldr r0, =0x03005d90 ldr r0, [r0] ldr r1, =0x00000ca9 adds r0, r1 ldrb r0, [r0] lsls r0, 30 lsrs r0, 25 adds r0, r4, r0 str r0, [sp] ldr r1, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r1 ldr r1, =0x00001024 orrs r0, r1 str r0, [sp, 0x4] mov r0, sp bl 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 .pool thumb_func_end sub_81C6E98 thumb_func_start sub_81C6EF4 sub_81C6EF4: ; 81C6EF4 push {r4,lr} ldr r0, =0x0203cf2c ldr r4, [r0] ldr r0, =0x00000804 adds r4, r0 ldr r0, =gUnknown_0861F3D4 movs r1, 0x44 movs r2, 0x38 movs r3, 0 bl obj_add_from_template_forward_search strb r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6EF4 thumb_func_start sub_81C6F20 sub_81C6F20: ; 81C6F20 push {r4,lr} ldr r0, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000804 adds r0, r1 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r4, r0, r1 adds r0, r4, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @081C6F50 adds r0, r4, 0 movs r1, 0x1 bl sub_8008258 ldr r0, =sub_81C6F68 str r0, [r4, 0x1C] @081C6F50: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6F20 thumb_func_start sub_81C6F68 sub_81C6F68: ; 81C6F68 push {r4,lr} adds r4, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @081C6F84 adds r0, r4, 0 movs r1, 0 bl sub_8008258 ldr r0, =nullsub_12 str r0, [r4, 0x1C] @081C6F84: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6F68 thumb_func_start sub_81C6F90 sub_81C6F90: ; 81C6F90 push {r4-r6,lr} lsls r0, 16 lsrs r6, r0, 16 lsls r1, 24 lsrs r4, r1, 24 ldr r0, =0x0203cf2c ldr r2, =0x00000805 adds r1, r4, r2 ldr r0, [r0] adds r5, r0, r1 ldrb r0, [r5] cmp r0, 0xFF bne @081C6FE0 ldr r0, =0x00001025 adds r4, r0 adds r0, r4, 0 bl 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, =0x02020630 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r1 movs r1, 0x18 strh r1, [r0, 0x24] movs r1, 0x58 strh r1, [r0, 0x26] @081C6FE0: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C6F90 thumb_func_start sub_81C6FF8 sub_81C6FF8: ; 81C6FF8 push {lr} lsls r0, 24 movs r1, 0x80 lsls r1, 17 adds r0, r1 lsrs r0, 24 bl sub_81C6E38 pop {r0} bx r0 thumb_func_end sub_81C6FF8 thumb_func_start sub_81C700C sub_81C700C: ; 81C700C push {lr} ldr r0, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000807 adds r0, r1 movs r1, 0x8 bl sub_8122344 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C700C thumb_func_start sub_81C7028 sub_81C7028: ; 81C7028 push {lr} adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 ldr r0, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000807 adds r0, r1 movs r1, 0x8 bl sub_81223FC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7028 thumb_func_start sub_81C704C sub_81C704C: ; 81C704C push {lr} adds r3, r0, 0 lsls r3, 24 ldr r0, =0x0203cf2c ldr r0, [r0] ldr r1, =0x00000807 adds r0, r1 lsrs r3, 4 movs r1, 0x80 lsls r1, 13 adds r3, r1 lsrs r3, 16 movs r1, 0x88 movs r2, 0x78 bl sub_8122448 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C704C thumb_func_start sub_81C7078 sub_81C7078: ; 81C7078 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 bl is_c1_link_related_active cmp r0, 0 bne @081C7090 ldr r0, =sub_81C7170 b @081C7092 .align 2, 0 .pool @081C7090: ldr r0, =sub_81C71E4 @081C7092: lsls r1, r4, 24 lsrs r1, 24 bl AddTask lsls r0, 24 lsrs r4, r0, 24 adds r0, r4, 0 movs r1, 0x1 adds r2, r5, 0 bl set_word_task_arg ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r2, =0x0203cf3c ldrb r1, [r2] strh r1, [r0, 0xE] ldrb r0, [r2] adds r1, r0, 0x1 strb r1, [r2] lsls r0, 24 lsrs r0, 8 orrs r0, r4 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C7078 thumb_func_start sub_81C70D8 sub_81C70D8: ; 81C70D8 push {lr} ldr r1, =0x0000ffff ands r1, r0 lsrs r3, r0, 16 ldr r2, =0x03005e00 lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r1, r0, r2 ldrb r0, [r1, 0x4] cmp r0, 0 beq @081C711C ldr r2, [r1] ldr r0, =sub_81C7170 cmp r2, r0 beq @081C70FE ldr r0, =sub_81C71E4 cmp r2, r0 bne @081C711C @081C70FE: movs r2, 0xE ldrsh r0, [r1, r2] cmp r0, r3 bne @081C711C movs r0, 0x1 b @081C711E .align 2, 0 .pool @081C711C: movs r0, 0 @081C711E: pop {r1} bx r1 thumb_func_end sub_81C70D8 thumb_func_start sub_81C7124 sub_81C7124: ; 81C7124 push {r4-r6,lr} adds r6, r0, 0 movs r5, 0 ldr r4, =0x03005e00 @081C712C: ldrb r0, [r4, 0x4] cmp r0, 0 beq @081C7160 ldr r1, [r4] ldr r0, =sub_81C7170 cmp r1, r0 beq @081C7140 ldr r0, =sub_81C71E4 cmp r1, r0 bne @081C7160 @081C7140: lsls r0, r5, 24 lsrs r0, 24 movs r1, 0x1 bl get_word_task_arg cmp r0, r6 bne @081C7160 movs r0, 0x1 b @081C716A .align 2, 0 .pool @081C7160: adds r4, 0x28 adds r5, 0x1 cmp r5, 0xF ble @081C712C movs r0, 0 @081C716A: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81C7124 thumb_func_start sub_81C7170 sub_81C7170: ; 81C7170 push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 adds r0, r5, 0 movs r1, 0x1 bl get_word_task_arg adds r6, r0, 0 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 movs r7, 0 @081C718C: movs r1, 0 ldrsh r0, [r4, r1] bl _call_via_r6 cmp r0, 0x4 bhi @081C71D6 lsls r0, 2 ldr r1, =@081C71AC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C71AC: .4byte @081C71C6 .4byte @081C71C0 .4byte @081C71DE .4byte @081C71DA .4byte @081C71CE @081C71C0: ldrh r0, [r4] adds r0, 0x1 b @081C71D8 @081C71C6: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] b @081C71DE @081C71CE: adds r0, r5, 0 bl remove_task b @081C71DE @081C71D6: subs r0, 0x5 @081C71D8: strh r0, [r4] @081C71DA: cmp r7, 0 beq @081C718C @081C71DE: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C7170 thumb_func_start sub_81C71E4 sub_81C71E4: ; 81C71E4 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 bl sub_8087598 cmp r0, 0 bne @081C724A adds r0, r5, 0 movs r1, 0x1 bl get_word_task_arg adds r2, r0, 0 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 movs r1, 0 ldrsh r0, [r4, r1] bl _call_via_r2 cmp r0, 0x4 bhi @081C7246 lsls r0, 2 ldr r1, =@081C7224 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C7224: .4byte @081C7238 .4byte @081C7238 .4byte @081C724A .4byte @081C724A .4byte @081C723E @081C7238: ldrh r0, [r4] adds r0, 0x1 b @081C7248 @081C723E: adds r0, r5, 0 bl remove_task b @081C724A @081C7246: subs r0, 0x5 @081C7248: strh r0, [r4] @081C724A: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C71E4 thumb_func_start sub_81C7250 sub_81C7250: ; 81C7250 push {r4,lr} ldr r4, =0x0203cf40 movs r0, 0x5C bl malloc str r0, [r4] cmp r0, 0 bne @081C7270 ldr r0, =sub_8086194 bl set_callback2 b @081C7292 .align 2, 0 .pool @081C7270: bl sub_81C7360 bl clear_tasks movs r0, 0 bl SetVBlankCallback ldr r0, =sub_81C742C movs r1, 0 bl AddTask ldr r0, =sub_81C7400 bl set_callback2 ldr r0, =sub_81C7418 bl SetVBlankCallback @081C7292: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7250 thumb_func_start sub_81C72A4 sub_81C72A4: ; 81C72A4 push {lr} ldr r0, =sub_81C72BC bl set_callback2 movs r0, 0x1 movs r1, 0 bl fade_screen pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C72A4 thumb_func_start sub_81C72BC sub_81C72BC: ; 81C72BC push {r4,lr} bl fade_and_return_progress_probably ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081C7320 ldr r4, =0x0203cf40 movs r0, 0x5C bl malloc str r0, [r4] cmp r0, 0 bne @081C72F0 ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 b @081C7320 .align 2, 0 .pool @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, =sub_81C742C movs r1, 0 bl AddTask ldr r0, =sub_81C7400 bl set_callback2 ldr r0, =sub_81C7418 bl SetVBlankCallback @081C7320: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C72BC thumb_func_start sub_81C7334 sub_81C7334: ; 81C7334 push {r4,lr} movs r4, 0 @081C7338: adds r0, r4, 0 bl sub_81C7650 adds r4, 0x1 cmp r4, 0x12 ble @081C7338 ldr r4, =0x0203cf40 ldr r0, [r4] bl free movs r0, 0 str r0, [r4] bl init_keypad_data pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7334 thumb_func_start sub_81C7360 sub_81C7360: ; 81C7360 push {r4,r5,lr} adds r5, r0, 0 movs r2, 0 movs r1, 0x12 adds r0, 0x58 @081C736A: str r2, [r0] subs r0, 0x4 subs r1, 0x1 cmp r1, 0 bge @081C736A movs r4, 0 strh r4, [r5, 0x8] str r4, [r5, 0x4] bl sub_81C7388 str r0, [r5, 0xC] str r4, [r5] pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C7360 thumb_func_start sub_81C7388 sub_81C7388: ; 81C7388 push {r4-r6,lr} movs r5, 0 @081C738C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 bl pokemon_getattr cmp r0, 0 beq @081C73BA adds r0, r4, 0 movs r1, 0x6 bl pokemon_getattr cmp r0, 0 bne @081C73BA adds r0, r4, 0 movs r1, 0x52 bl pokemon_getattr cmp r0, 0 bne @081C73E2 @081C73BA: adds r5, 0x1 cmp r5, 0x5 ble @081C738C movs r4, 0 @081C73C2: movs r5, 0 lsls r6, r4, 24 @081C73C6: adds r0, r4, 0 adds r1, r5, 0 bl sub_80D2270 cmp r0, 0 beq @081C73EC lsls r1, r5, 24 lsrs r1, 24 lsrs r0, r6, 24 movs r2, 0x52 bl get_pokemon_data_from_any_box cmp r0, 0 beq @081C73EC @081C73E2: movs r0, 0x1 b @081C73FA .align 2, 0 .pool @081C73EC: adds r5, 0x1 cmp r5, 0x1D ble @081C73C6 adds r4, 0x1 cmp r4, 0xD ble @081C73C2 movs r0, 0 @081C73FA: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81C7388 thumb_func_start sub_81C7400 sub_81C7400: ; 81C7400 push {lr} bl 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, =0x03005e08 adds r7, r1, r0 movs r1, 0 ldrsh r0, [r7, r1] cmp r0, 0x5 bls @081C7446 b @081C7562 @081C7446: lsls r0, 2 ldr r1, =@081C7458 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C7458: .4byte @081C7470 .4byte @081C747A .4byte @081C7490 .4byte @081C749C .4byte @081C751E .4byte @081C752C @081C7470: bl sub_81C76C4 movs r0, 0x1 strh r0, [r7] b @081C7562 @081C747A: bl sub_81C76FC cmp r0, 0 bne @081C7562 ldr r0, =0x000186a0 bl sub_81C756C b @081C74E8 .align 2, 0 .pool @081C7490: bl sub_81C786C cmp r0, 0 bne @081C7562 movs r0, 0x3 strh r0, [r7] @081C749C: bl sub_81C75E0 adds r6, r0, 0 movs r0, 0x1 negs r0, r0 cmp r6, r0 beq @081C74FC ldr r0, =0x0001869f cmp r6, r0 bls @081C7506 ldr r4, =gUnknown_0861F3EC ldr r5, =0x0203cf40 ldr r0, [r5] ldr r1, [r0, 0x4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r1, r4, 0 adds r1, 0x18 adds r0, r1 ldr r0, [r0] bl _call_via_r0 ldr r0, [r5] ldr r1, [r0, 0x4] lsls r0, r1, 3 subs r0, r1 lsls r0, 2 adds r4, 0x14 adds r0, r4 ldr r0, [r0] bl _call_via_r0 adds r0, r6, 0 bl sub_81C756C cmp r0, 0 beq @081C74FC @081C74E8: movs r0, 0x4 strh r0, [r7] b @081C7562 .align 2, 0 .pool @081C74FC: bl sub_81C7710 movs r0, 0x5 strh r0, [r7] b @081C7562 @081C7506: cmp r6, 0 beq @081C7562 adds r0, r6, 0 bl sub_81C7850 bl sub_81C786C cmp r0, 0 beq @081C7562 movs r0, 0x2 strh r0, [r7] b @081C7562 @081C751E: bl sub_81C75D4 cmp r0, 0 bne @081C7562 movs r0, 0x3 strh r0, [r7] b @081C7562 @081C752C: bl sub_81C7738 cmp r0, 0 bne @081C7562 ldr r0, =0x0203cf40 ldr r0, [r0] ldrh r0, [r0, 0x8] negs r4, r0 orrs r4, r0 lsrs r4, 31 bl sub_81C9430 bl sub_81C7334 cmp r4, 0 beq @081C755C ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music bl set_callback2 b @081C7562 .align 2, 0 .pool @081C755C: ldr r0, =sub_8086194 bl set_callback2 @081C7562: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C742C thumb_func_start sub_81C756C sub_81C756C: ; 81C756C push {r4-r6,lr} ldr r1, =0xfffe7960 adds r6, r0, r1 bl sub_81C75F4 ldr r5, =gUnknown_0861F3EC lsls r0, r6, 3 subs r0, r6 lsls r4, r0, 2 adds r0, r4, r5 ldr r0, [r0] bl _call_via_r0 cmp r0, 0 beq @081C75CC adds r0, r5, 0 adds r0, 0x8 adds r0, r4, r0 ldr r0, [r0] bl _call_via_r0 cmp r0, 0 beq @081C75CC adds r0, r5, 0 adds r0, 0xC adds r0, r4, r0 ldr r0, [r0] adds r1, r5, 0 adds r1, 0x10 adds r1, r4, r1 ldr r1, [r1] bl sub_81C7834 ldr r0, =0x0203cf40 ldr r1, [r0] adds r0, r5, 0x4 adds r0, r4, r0 ldr r0, [r0] str r0, [r1] str r6, [r1, 0x4] movs r0, 0x1 b @081C75CE .align 2, 0 .pool @081C75CC: movs r0, 0 @081C75CE: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81C756C thumb_func_start sub_81C75D4 sub_81C75D4: ; 81C75D4 push {lr} bl sub_81C786C pop {r1} bx r1 thumb_func_end sub_81C75D4 thumb_func_start sub_81C75E0 sub_81C75E0: ; 81C75E0 push {lr} ldr r0, =0x0203cf40 ldr r0, [r0] ldr r0, [r0] bl _call_via_r0 pop {r1} bx r1 .align 2, 0 .pool 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, =sub_81C7418 bl SetVBlankCallback pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C760C thumb_func_start sub_81C761C sub_81C761C: ; 81C761C push {r4,lr} adds r4, r0, 0 adds r0, r1, 0 bl malloc ldr r1, =0x0203cf40 ldr r1, [r1] lsls r4, 2 adds r1, 0x10 adds r1, r4 str r0, [r1] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C761C thumb_func_start sub_81C763C sub_81C763C: ; 81C763C ldr r1, =0x0203cf40 ldr r1, [r1] lsls r0, 2 adds r1, 0x10 adds r1, r0 ldr r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81C763C thumb_func_start sub_81C7650 sub_81C7650: ; 81C7650 push {r4,r5,lr} ldr r5, =0x0203cf40 ldr r1, [r5] lsls r4, r0, 2 adds r1, 0x10 adds r1, r4 ldr r0, [r1] cmp r0, 0 beq @081C7670 bl free ldr r0, [r5] adds r0, 0x10 adds r0, r4 movs r1, 0 str r1, [r0] @081C7670: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7650 thumb_func_start sub_81C767C sub_81C767C: ; 81C767C ldr r0, =0x0203cf40 ldr r0, [r0] ldrh r0, [r0, 0x8] bx lr .align 2, 0 .pool thumb_func_end sub_81C767C thumb_func_start sub_81C7688 sub_81C7688: ; 81C7688 ldr r1, =0x0203cf40 ldr r1, [r1] strh r0, [r1, 0x8] bx lr .align 2, 0 .pool thumb_func_end sub_81C7688 thumb_func_start sub_81C7694 sub_81C7694: ; 81C7694 push {lr} adds r1, r0, 0 cmp r1, 0x4 bls @081C769E movs r1, 0 @081C769E: ldr r0, =0x0203cf40 ldr r0, [r0] strh r1, [r0, 0xA] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7694 thumb_func_start sub_81C76AC sub_81C76AC: ; 81C76AC ldr r0, =0x0203cf40 ldr r0, [r0] ldrh r0, [r0, 0xA] bx lr .align 2, 0 .pool thumb_func_end sub_81C76AC thumb_func_start sub_81C76B8 sub_81C76B8: ; 81C76B8 ldr r0, =0x0203cf40 ldr r0, [r0] ldr r0, [r0, 0xC] bx lr .align 2, 0 .pool thumb_func_end sub_81C76B8 thumb_func_start sub_81C76C4 sub_81C76C4: ; 81C76C4 push {r4,lr} ldr r1, =0x0000082c movs r0, 0 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081C76F4 bl reset_all_obj_data bl gpu_pal_allocator_reset ldr r0, =sub_81C7764 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0xC] movs r0, 0x1 b @081C76F6 .align 2, 0 .pool @081C76F4: movs r0, 0 @081C76F6: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C76C4 thumb_func_start sub_81C76FC sub_81C76FC: ; 81C76FC push {lr} movs r0, 0 bl sub_81C763C ldr r0, [r0, 0xC] bl sub_81C70D8 pop {r1} bx r1 thumb_func_end sub_81C76FC thumb_func_start sub_81C7710 sub_81C7710: ; 81C7710 push {lr} sub sp, 0x4 movs r0, 0x6F bl audio_play bl sub_81CAADC movs r1, 0x1 negs r1, r1 movs r0, 0 str r0, [sp] adds r0, r1, 0 movs r2, 0 movs r3, 0x10 bl 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, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081C7750 movs r0, 0x1 b @081C775E .align 2, 0 .pool @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, =gUnknown_0861FA04 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 .pool @081C77B0: movs r0, 0 bl sub_81C763C adds r4, r0, 0 ldr r1, =gUnknown_08DC7B80 movs r0, 0 str r0, [sp] movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram adds r4, 0x2C movs r0, 0 adds r1, r4, 0 bl bg_set_tilemap ldr r1, =gUnknown_08DC7D84 movs r0, 0 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r0, =gUnknown_08DC7B60 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 .pool @081C77FC: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081C7818 bl sub_81C7B74 movs r0, 0 b @081C782C @081C780E: bl 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, =atk47_cmd47 movs r1, 0x4 bl sub_81C7078 str r0, [r4, 0xC] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7880 thumb_func_start sub_81C78A0 sub_81C78A0: ; 81C78A0 push {r4,lr} movs r0, 0 bl sub_81C763C adds r4, r0, 0 ldr r0, =sub_81C791C movs r1, 0x4 bl sub_81C7078 str r0, [r4, 0xC] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C78A0 thumb_func_start sub_81C78C0 sub_81C78C0: ; 81C78C0 push {lr} movs r0, 0 bl sub_81C763C ldr r0, [r0, 0xC] bl sub_81C70D8 pop {r1} bx r1 thumb_func_end sub_81C78C0 thumb_func_start atk47_cmd47 atk47_cmd47: ; 81C78D4 push {lr} cmp r0, 0x1 beq @081C78EA cmp r0, 0x1 bgt @081C78E4 cmp r0, 0 beq @081C78EA b @081C7914 @081C78E4: cmp r0, 0x2 beq @081C78EE b @081C7914 @081C78EA: movs r0, 0 b @081C7916 @081C78EE: movs r1, 0xC0 lsls r1, 1 movs r0, 0 movs r2, 0x1 bl bg_change_y_offset ldr r1, =0x00001fff cmp r0, r1 bhi @081C7908 movs r0, 0x2 b @081C7916 .align 2, 0 .pool @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, =0x02037714 adds r1, r3 lsls r2, 10 lsrs r2, 11 bl CpuSet pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7944 thumb_func_start sub_81C795C sub_81C795C: ; 81C795C push {r4,lr} adds r4, r0, 0 b @081C7974 @081C7962: lsls r0, r1, 4 movs r2, 0x80 lsls r2, 1 adds r1, r0, r2 ldr r0, [r4] movs r2, 0x20 bl sub_81C7944 adds r4, 0x8 @081C7974: ldr r0, [r4] cmp r0, 0 beq @081C7988 ldrh r0, [r4, 0x4] bl 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, =0x02037d14 adds r3, r0 ldr r2, =0x01000010 mov r0, sp adds r1, r3, 0 bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7990 thumb_func_start sub_81C79BC sub_81C79BC: ; 81C79BC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC str r0, [sp] str r1, [sp, 0x4] mov r10, r2 str r3, [sp, 0x8] ldr r0, [sp, 0x2C] cmp r0, 0 bne @081C79E4 ldr r2, =0x001fffff mov r1, r10 ands r2, r1 ldr r0, [sp] b @081C79F4 .align 2, 0 .pool @081C79E4: ldr r2, [sp, 0x2C] ldr r0, [sp, 0x8] cmp r2, r0 blt @081C7A00 ldr r2, =0x001fffff mov r1, r10 ands r2, r1 ldr r0, [sp, 0x4] @081C79F4: ldr r1, [sp, 0x30] bl CpuSet b @081C7AAE .align 2, 0 .pool @081C7A00: movs r2, 0x1 negs r2, r2 add r10, r2 b @081C7AA6 @081C7A08: ldr r1, [sp] ldrh r0, [r1] movs r2, 0x1F mov r9, r2 mov r1, r9 ands r1, r0 mov r9, r1 lsls r0, 16 lsrs r2, r0, 21 movs r1, 0x1F ands r1, r2 mov r8, r1 lsrs r7, r0, 26 movs r2, 0x1F ands r7, r2 ldr r0, [sp, 0x4] ldrh r4, [r0] movs r0, 0x1F ands r0, r4 mov r1, r9 subs r0, r1 lsls r0, 8 ldr r1, [sp, 0x8] bl __divsi3 ldr r2, [sp, 0x2C] adds r6, r0, 0 muls r6, r2 asrs r6, 8 lsls r4, 16 lsrs r0, r4, 21 movs r1, 0x1F ands r0, r1 mov r2, r8 subs r0, r2 lsls r0, 8 ldr r1, [sp, 0x8] bl __divsi3 ldr r1, [sp, 0x2C] adds r5, r0, 0 muls r5, r1 asrs r5, 8 lsrs r4, 26 movs r2, 0x1F ands r4, r2 subs r4, r7 lsls r4, 8 adds r0, r4, 0 ldr r1, [sp, 0x8] bl __divsi3 ldr r1, [sp, 0x2C] muls r0, r1 asrs r0, 8 add r6, r9 movs r2, 0x1F ands r6, r2 add r5, r8 ands r5, r2 adds r0, r7, r0 ands r0, r2 lsls r0, 10 lsls r5, 5 orrs r0, r5 orrs r0, r6 ldr r1, [sp, 0x30] strh r0, [r1] ldr r2, [sp] adds r2, 0x2 str r2, [sp] ldr r0, [sp, 0x4] adds r0, 0x2 str r0, [sp, 0x4] adds r1, 0x2 str r1, [sp, 0x30] movs r1, 0x1 negs r1, r1 add r10, r1 @081C7AA6: movs r0, 0x1 negs r0, r0 cmp r10, r0 bne @081C7A08 @081C7AAE: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C79BC thumb_func_start sub_81C7AC0 sub_81C7AC0: ; 81C7AC0 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 movs r0, 0 bl sub_81C763C cmp r4, 0x1 beq @081C7AF0 cmp r4, 0x1 bgt @081C7ADA cmp r4, 0 beq @081C7AE4 b @081C7B2C @081C7ADA: cmp r4, 0x2 beq @081C7B04 cmp r4, 0x3 beq @081C7B18 b @081C7B2C @081C7AE4: ldr r0, [r0, 0x14] movs r1, 0x2 negs r1, r1 str r4, [sp] movs r2, 0 b @081C7B10 @081C7AF0: ldr r0, [r0, 0x14] movs r1, 0x2 negs r1, r1 movs r2, 0 str r2, [sp] movs r2, 0x10 movs r3, 0 bl 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, =0x02037fd4 ldrb r0, [r0, 0x7] lsrs r0, 7 bx lr .align 2, 0 .pool thumb_func_end sub_81C7B34 thumb_func_start sub_81C7B40 sub_81C7B40: ; 81C7B40 push {lr} ldr r0, =0xfffefffe movs r1, 0x10 movs r2, 0 bl sub_80A2A20 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7B40 thumb_func_start sub_81C7B54 sub_81C7B54: ; 81C7B54 push {r4,r5,lr} adds r5, r0, 0 cmp r1, 0 ble @081C7B6C adds r4, r1, 0 @081C7B5E: adds r0, r5, 0 adds r5, 0x4 bl 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, =gUnknown_0861FA08 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 .pool thumb_func_end sub_81C7B74 thumb_func_start sub_81C7BA4 sub_81C7BA4: ; 81C7BA4 push {r4,r5,lr} sub sp, 0xC adds r4, r0, 0 movs r0, 0 bl sub_81C763C adds r5, r0, 0 ldr r0, [r5, 0x10] bl sub_81C7BF8 ldrb r0, [r5, 0x10] ldr r1, =gUnknown_0861FA48 str r1, [sp] movs r1, 0 str r1, [sp, 0x4] ldr r1, =gUnknown_0861FA18 lsls r4, 2 adds r4, r1 ldr r1, [r4] str r1, [sp, 0x8] movs r1, 0x1 movs r2, 0 movs r3, 0x1 bl box_print add sp, 0xC pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0861FA4C @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, =gUnknown_0861FA54 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, =gUnknown_0861FB04 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, =0x02020630 adds r1, r0 str r1, [r6, 0x18] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7C28 thumb_func_start sub_81C7C94 sub_81C7C94: ; 81C7C94 push {lr} movs r0, 0 bl sub_81C763C ldr r0, [r0, 0x18] bl 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, =nullsub_12 str r1, [r0, 0x1C] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C7CCC thumb_func_start sub_81C7CE4 sub_81C7CE4: ; 81C7CE4 push {r4,lr} movs r0, 0 bl sub_81C763C ldr r2, [r0, 0x18] movs r4, 0 movs r1, 0xDC strh r1, [r2, 0x20] ldr r2, [r0, 0x18] movs r1, 0xC strh r1, [r2, 0x22] ldr r2, [r0, 0x18] ldr r1, =sub_81C7CB4 str r1, [r2, 0x1C] adds r2, 0x3E ldrb r3, [r2] movs r1, 0x5 negs r1, r1 ands r1, r3 strb r1, [r2] ldr r3, [r0, 0x18] ldrb r2, [r3, 0x5] movs r1, 0xD negs r1, r1 ands r1, r2 strb r1, [r3, 0x5] ldr r0, [r0, 0x18] adds r0, 0x43 strb r4, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7CE4 thumb_func_start sub_81C7D28 sub_81C7D28: ; 81C7D28 push {r4-r7,lr} mov r7, r8 push {r7} movs r0, 0 bl sub_81C763C adds r6, r0, 0 ldr r0, =gUnknown_0861FA64 bl 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, =0x02020630 mov r8, r0 movs r7, 0x4 @081C7D50: ldr r0, =gUnknown_0861FB2C 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, =gUnknown_0861FB44 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, =0x000003ff adds r0, r4, 0 ands r1, r0 ldr r4, =0xfffffc00 adds r0, r4, 0 ands r2, r0 orrs r2, r1 strh r2, [r3, 0x4] adds r5, 0x1 cmp r5, 0x1 ble @081C7D50 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7D28 thumb_func_start sub_81C7DFC sub_81C7DFC: ; 81C7DFC push {lr} cmp r0, 0x5 bhi @081C7E08 bl sub_81C7E58 b @081C7E0E @081C7E08: subs r0, 0x6 bl sub_81C7F24 @081C7E0E: pop {r0} bx r0 thumb_func_end sub_81C7DFC thumb_func_start sub_81C7E14 sub_81C7E14: ; 81C7E14 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0 bl sub_81C763C adds r5, r0, 0 cmp r4, 0x4 bne @081C7E30 movs r0, 0x2 bl 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, =0x000003ff adds r1, r2, 0 ands r0, r1 ldrh r2, [r3, 0x4] ldr r1, =0xfffffc00 ands r1, r2 orrs r1, r0 strh r1, [r3, 0x4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7E14 thumb_func_start sub_81C7E58 sub_81C7E58: ; 81C7E58 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} mov r9, r0 cmp r0, 0x5 bhi @081C7F16 movs r0, 0 bl sub_81C763C adds r7, r0, 0 ldr r0, =gUnknown_0861FA6C mov r1, r9 lsls r6, r1, 3 adds r6, r0 ldrh r4, [r6, 0x6] ldr r2, [r6] mov r8, r2 mov r0, r8 bl sub_8034974 adds r5, r0, 0 lsls r4, 5 ldr r0, =gUnknown_08DC7F00 adds r4, r0 movs r0, 0x1 bl 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, =0x0201c000 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, =0x06010000 adds r1, r2 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 adds r2, r5, 0 movs r3, 0x1 bl RequestDma3Copy movs r0, 0x2 bl gpu_tile_obj_tag_get_range_start ldr r3, [r7, 0x20] ldrh r1, [r6, 0x4] adds r0, r1 ldr r2, =0x000003ff adds r1, r2, 0 ands r0, r1 ldrh r2, [r3, 0x4] ldr r1, =0xfffffc00 ands r1, r2 orrs r1, r0 strh r1, [r3, 0x4] mov r0, r9 subs r0, 0x4 cmp r0, 0x1 bhi @081C7F10 ldr r1, [r7, 0x20] movs r0, 0x38 b @081C7F14 .align 2, 0 .pool @081C7F10: ldr r1, [r7, 0x20] movs r0, 0x40 @081C7F14: strh r0, [r1, 0x24] @081C7F16: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C7E58 thumb_func_start sub_81C7F24 sub_81C7F24: ; 81C7F24 push {r4-r6,lr} cmp r0, 0x6 bhi @081C7F8A ldr r2, =gUnknown_0861FA9C lsls r1, r0, 3 adds r0, r2, 0x4 adds r0, r1, r0 ldr r4, [r0] adds r1, r2 ldr r6, [r1] adds r0, r6, 0 bl sub_8034974 adds r5, r0, 0 lsls r4, 5 ldr r0, =gUnknown_08DC7F00 adds r4, r0 movs r0, 0x2 bl 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, =0x0201d000 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, =0x06010800 adds r1, r0 lsls r5, 16 lsrs r5, 16 adds r0, r4, 0 adds r2, r5, 0 movs r3, 0x1 bl RequestDma3Copy @081C7F8A: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C7F24 thumb_func_start sub_81C7FA0 sub_81C7FA0: ; 81C7FA0 push {lr} adds r3, r0, 0 movs r0, 0x10 cmp r1, 0 bne @081C7FAC movs r0, 0x30 @081C7FAC: cmp r3, 0x5 bhi @081C7FB8 adds r1, r2, 0 bl sub_81C803C b @081C7FBE @081C7FB8: adds r1, r2, 0 bl sub_81C8088 @081C7FBE: pop {r0} bx r0 thumb_func_end sub_81C7FA0 thumb_func_start sub_81C7FC4 sub_81C7FC4: ; 81C7FC4 push {lr} cmp r0, 0x5 bhi @081C7FD2 adds r0, r1, 0 bl sub_81C80D4 b @081C7FD8 @081C7FD2: adds r0, r1, 0 bl sub_81C8110 @081C7FD8: pop {r0} bx r0 thumb_func_end sub_81C7FC4 thumb_func_start sub_81C7FDC sub_81C7FDC: ; 81C7FDC push {r4,lr} movs r0, 0 bl sub_81C763C movs r4, 0x4 adds r2, r0, 0 adds r2, 0x1C movs r3, 0x1 @081C7FEC: ldr r1, [r2] adds r1, 0x3E ldrb r0, [r1] orrs r0, r4 strb r0, [r1] ldr r1, [r2, 0x8] adds r1, 0x3E ldrb r0, [r1] orrs r0, r4 strb r0, [r1] adds r2, 0x4 subs r3, 0x1 cmp r3, 0 bge @081C7FEC pop {r4} pop {r0} bx r0 thumb_func_end sub_81C7FDC thumb_func_start sub_81C8010 sub_81C8010: ; 81C8010 push {lr} movs r0, 0 bl sub_81C763C adds r1, r0, 0 ldr r0, [r1, 0x1C] ldr r2, [r0, 0x1C] ldr r0, =nullsub_12 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 .pool @081C8034: movs r0, 0x1 @081C8036: pop {r1} bx r1 thumb_func_end sub_81C8010 thumb_func_start sub_81C803C sub_81C803C: ; 81C803C push {r4-r7,lr} mov r7, r8 push {r7} mov r8, r0 adds r4, r1, 0 movs r0, 0 bl sub_81C763C cmp r4, 0 bne @081C8058 movs r7, 0x60 negs r7, r7 movs r6, 0x20 b @081C805E @081C8058: movs r7, 0x80 lsls r7, 1 movs r6, 0xA0 @081C805E: adds r4, r0, 0 adds r4, 0x1C movs r5, 0x1 @081C8064: ldr r0, [r4] mov r1, r8 strh r1, [r0, 0x22] ldm r4!, {r0} adds r1, r7, 0 adds r2, r6, 0 movs r3, 0xC bl sub_81C814C subs r5, 0x1 cmp r5, 0 bge @081C8064 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C803C thumb_func_start sub_81C8088 sub_81C8088: ; 81C8088 push {r4-r7,lr} mov r7, r8 push {r7} mov r8, r0 adds r4, r1, 0 movs r0, 0 bl sub_81C763C cmp r4, 0 bne @081C80A4 movs r7, 0x60 negs r7, r7 movs r6, 0x10 b @081C80AA @081C80A4: movs r7, 0x80 lsls r7, 1 movs r6, 0xC0 @081C80AA: adds r4, r0, 0 adds r4, 0x24 movs r5, 0x1 @081C80B0: ldr r0, [r4] mov r1, r8 strh r1, [r0, 0x22] ldm r4!, {r0} adds r1, r7, 0 adds r2, r6, 0 movs r3, 0xC bl sub_81C814C subs r5, 0x1 cmp r5, 0 bge @081C80B0 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C8088 thumb_func_start sub_81C80D4 sub_81C80D4: ; 81C80D4 push {r4-r7,lr} adds r4, r0, 0 movs r0, 0 bl sub_81C763C cmp r4, 0 bne @081C80EA movs r6, 0x20 movs r5, 0x60 negs r5, r5 b @081C80F0 @081C80EA: movs r6, 0xC0 movs r5, 0x80 lsls r5, 1 @081C80F0: adds r7, r0, 0 adds r7, 0x1C movs r4, 0x1 @081C80F6: ldm r7!, {r0} adds r1, r6, 0 adds r2, r5, 0 movs r3, 0xC bl sub_81C814C subs r4, 0x1 cmp r4, 0 bge @081C80F6 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C80D4 thumb_func_start sub_81C8110 sub_81C8110: ; 81C8110 push {r4-r7,lr} adds r4, r0, 0 movs r0, 0 bl sub_81C763C cmp r4, 0 bne @081C8126 movs r6, 0x10 movs r5, 0x60 negs r5, r5 b @081C812C @081C8126: movs r6, 0xC0 movs r5, 0x80 lsls r5, 1 @081C812C: adds r7, r0, 0 adds r7, 0x24 movs r4, 0x1 @081C8132: ldm r7!, {r0} adds r1, r6, 0 adds r2, r5, 0 movs r3, 0xC bl sub_81C814C subs r4, 0x1 cmp r4, 0 bge @081C8132 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81C8110 thumb_func_start sub_81C814C sub_81C814C: ; 81C814C push {r4-r6,lr} adds r4, r0, 0 adds r0, r1, 0 adds r6, r2, 0 adds r5, r3, 0 strh r0, [r4, 0x20] lsls r1, r0, 4 strh r1, [r4, 0x2E] subs r0, r6, r0 lsls r0, 4 adds r1, r5, 0 bl __divsi3 strh r0, [r4, 0x30] strh r5, [r4, 0x32] strh r6, [r4, 0x3C] ldr r0, =sub_81C817C str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C814C thumb_func_start sub_81C817C sub_81C817C: ; 81C817C push {lr} adds r2, r0, 0 ldrh r1, [r2, 0x32] movs r3, 0x32 ldrsh r0, [r2, r3] cmp r0, 0 beq @081C81C4 subs r0, r1, 0x1 strh r0, [r2, 0x32] ldrh r0, [r2, 0x30] ldrh r1, [r2, 0x2E] adds r0, r1 strh r0, [r2, 0x2E] lsls r0, 16 asrs r0, 20 strh r0, [r2, 0x20] adds r0, 0x10 lsls r0, 16 movs r1, 0x88 lsls r1, 17 cmp r0, r1 bls @081C81B6 adds r0, r2, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] b @081C81CC @081C81B6: adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] b @081C81CC @081C81C4: ldrh r0, [r2, 0x3C] strh r0, [r2, 0x20] ldr r0, =nullsub_12 str r0, [r2, 0x1C] @081C81CC: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C817C thumb_func_start sub_81C81D4 sub_81C81D4: ; 81C81D4 push {r4-r7,lr} adds r6, r0, 0 adds r5, r1, 0 adds r7, r2, 0 ldr r1, =0x000008a4 movs r0, 0x11 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081C821C ldr r1, =0x00000888 adds r0, r4, r1 adds r1, r5, 0 bl sub_81C9160 adds r0, r4, 0 adds r1, r6, 0 adds r2, r5, 0 adds r3, r7, 0 bl sub_81C91AC cmp r0, 0 beq @081C821C ldr r0, =sub_81C8254 movs r1, 0x6 bl sub_81C7078 movs r0, 0x1 b @081C821E .align 2, 0 .pool @081C821C: movs r0, 0 @081C821E: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81C81D4 thumb_func_start sub_81C8224 sub_81C8224: ; 81C8224 push {lr} ldr r0, =sub_81C8254 bl sub_81C7124 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C8224 thumb_func_start sub_81C8234 sub_81C8234: ; 81C8234 push {r4,lr} movs r0, 0x11 bl sub_81C763C adds r4, r0, 0 bl sub_81C8FE0 ldrb r0, [r4, 0x8] bl 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, =@081C827C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C827C: .4byte @081C8290 .4byte @081C829A .4byte @081C82A4 .4byte @081C82B8 .4byte @081C82CC @081C8290: adds r0, r2, 0 bl sub_81C82E4 movs r0, 0 b @081C82D8 @081C829A: adds r0, r2, 0 bl sub_81C835C movs r0, 0 b @081C82D8 @081C82A4: ldr r1, =0x00000888 adds r0, r2, r1 adds r1, r2, 0 bl sub_81C837C movs r0, 0 b @081C82D8 .align 2, 0 .pool @081C82B8: bl sub_81C83E0 cmp r0, 0 beq @081C82C4 @081C82C0: movs r0, 0x2 b @081C82D8 @081C82C4: bl sub_81C8ED0 movs r0, 0x1 b @081C82D8 @081C82CC: ldr r1, =0x00000888 adds r0, r2, r1 adds r1, r2, 0 bl sub_81C8EF8 @081C82D6: movs r0, 0x4 @081C82D8: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C8254 thumb_func_start sub_81C82E4 sub_81C82E4: ; 81C82E4 push {r4,r5,lr} sub sp, 0x8 adds r5, r0, 0 ldrb r4, [r5, 0x1] lsls r4, 12 ldrh r0, [r5, 0x6] orrs r4, r0 lsls r4, 16 lsrs r4, 16 ldrb r0, [r5] ldrh r2, [r5, 0x6] movs r1, 0x11 movs r3, 0x1 bl sub_8199DF0 ldrb r0, [r5] ldrh r2, [r5, 0x6] adds r2, 0x1 movs r1, 0x44 movs r3, 0x1 bl sub_8199DF0 ldrb r0, [r5] adds r1, r5, 0 adds r1, 0x88 bl 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, =sub_81C83F0 movs r1, 0x5 bl sub_81C7078 @081C83D6: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C83AC thumb_func_start sub_81C83E0 sub_81C83E0: ; 81C83E0 push {lr} ldr r0, =sub_81C83F0 bl sub_81C7124 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C83E0 thumb_func_start sub_81C83F0 sub_81C83F0: ; 81C83F0 push {r4-r7,lr} sub sp, 0xC adds r6, r0, 0 movs r0, 0x11 bl sub_81C763C adds r4, r0, 0 cmp r6, 0 beq @081C8408 cmp r6, 0x1 beq @081C848C b @081C849A @081C8408: ldrh r0, [r4, 0xA] ldrh r1, [r4, 0xC] adds r0, r1 ldr r1, [r4, 0x10] adds r5, r0, r1 movs r0, 0xF ands r5, r0 ldr r0, [r4, 0x1C] adds r7, r4, 0 adds r7, 0x48 ldr r2, [r4, 0x34] adds r1, r7, 0 bl _call_via_r2 ldr r3, [r4, 0x38] cmp r3, 0 beq @081C8434 ldrh r0, [r4, 0x8] ldr r1, [r4, 0x14] adds r2, r5, 0 bl _call_via_r3 @081C8434: ldrb r0, [r4, 0x8] ldrb r1, [r4, 0x5] lsls r2, r5, 4 movs r3, 0x1 orrs r2, r3 str r2, [sp] movs r2, 0xFF str r2, [sp, 0x4] str r6, [sp, 0x8] adds r2, r7, 0 movs r3, 0x8 bl Print ldrh r0, [r4, 0xC] adds r0, 0x1 strh r0, [r4, 0xC] lsls r0, 16 lsrs r0, 16 ldrh r1, [r4, 0xE] cmp r0, r1 bcc @081C847A ldr r0, [r4, 0x38] cmp r0, 0 beq @081C846E ldrb r0, [r4, 0x8] movs r1, 0x3 bl 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, =0x00000888 adds r0, r1 ldrh r1, [r0] negs r0, r1 orrs r0, r1 lsrs r0, 31 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C84A4 thumb_func_start sub_81C84C0 sub_81C84C0: ; 81C84C0 push {lr} movs r0, 0x11 bl sub_81C763C ldr r1, =0x00000888 adds r0, r1 movs r3, 0 ldrh r1, [r0] ldrh r2, [r0, 0x8] adds r1, r2 ldrh r0, [r0, 0x2] cmp r1, r0 bge @081C84DC movs r3, 0x1 @081C84DC: adds r0, r3, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C84C0 thumb_func_start sub_81C84E8 sub_81C84E8: ; 81C84E8 push {r4-r7,lr} sub sp, 0x8 adds r6, r0, 0 adds r4, r1, 0 movs r0, 0x11 bl sub_81C763C adds r7, r0, 0 ldr r0, =0x00000888 adds r5, r7, r0 cmp r6, 0 bge @081C8524 ldrh r1, [r5] adds r0, r1, r6 cmp r0, 0 bge @081C850A negs r6, r1 @081C850A: cmp r4, 0 beq @081C854E ldr r0, [r5, 0x10] adds r1, r6 negs r2, r6 ldr r3, [r5, 0xC] str r6, [sp] str r7, [sp, 0x4] bl sub_81C83AC b @081C854E .align 2, 0 .pool @081C8524: cmp r4, 0 beq @081C854E ldr r2, =0x0203cf44 ldrh r1, [r5] ldrh r0, [r5, 0x8] adds r4, r1, r0 str r4, [r2] adds r0, r4, r6 ldrh r1, [r5, 0x2] cmp r0, r1 blt @081C853C subs r6, r1, r4 @081C853C: ldr r0, [r5, 0x10] ldr r3, [r5, 0xC] ldrh r1, [r5, 0x8] str r1, [sp] str r7, [sp, 0x4] adds r1, r4, 0 adds r2, r6, 0 bl sub_81C83AC @081C854E: adds r0, r6, 0 adds r1, r7, 0 bl sub_81C8568 ldrh r0, [r5] adds r0, r6 strh r0, [r5] add sp, 0x8 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C84E8 thumb_func_start sub_81C8568 sub_81C8568: ; 81C8568 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 ldrb r0, [r4] bl 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, =sub_81C85A0 movs r1, 0x6 bl sub_81C7078 str r0, [r4, 0x28] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C8568 thumb_func_start sub_81C85A0 sub_81C85A0: ; 81C85A0 push {r4-r6,lr} adds r5, r0, 0 movs r0, 0x11 bl sub_81C763C adds r4, r0, 0 cmp r5, 0 beq @081C85B8 cmp r5, 0x1 beq @081C85C4 movs r0, 0x4 b @081C862A @081C85B8: bl sub_81C83E0 cmp r0, 0 bne @081C8628 movs r0, 0x1 b @081C862A @081C85C4: movs r6, 0 ldrb r0, [r4] bl 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, =0x00000888 adds r0, r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C8644 thumb_func_start sub_81C8658 sub_81C8658: ; 81C8658 push {lr} bl sub_81C8644 adds r1, r0, 0 ldrh r0, [r1, 0x6] cmp r0, 0 beq @081C866E subs r0, 0x1 strh r0, [r1, 0x6] movs r0, 0x1 b @081C8686 @081C866E: bl sub_81C84A4 cmp r0, 0 bne @081C867A movs r0, 0 b @081C8686 @081C867A: movs r0, 0x1 negs r0, r0 movs r1, 0x1 bl sub_81C84E8 movs r0, 0x2 @081C8686: pop {r1} bx r1 thumb_func_end sub_81C8658 thumb_func_start sub_81C868C sub_81C868C: ; 81C868C push {lr} bl sub_81C8644 adds r2, r0, 0 ldrh r1, [r2] ldrh r3, [r2, 0x6] adds r1, r3 ldrh r0, [r2, 0x2] subs r0, 0x1 cmp r1, r0 bge @081C86BA ldrh r0, [r2, 0x8] subs r0, 0x1 cmp r3, r0 bge @081C86B2 adds r0, r3, 0x1 strh r0, [r2, 0x6] movs r0, 0x1 b @081C86C8 @081C86B2: bl sub_81C84C0 cmp r0, 0 bne @081C86BE @081C86BA: movs r0, 0 b @081C86C8 @081C86BE: movs r0, 0x1 movs r1, 0x1 bl sub_81C84E8 movs r0, 0x2 @081C86C8: pop {r1} bx r1 thumb_func_end sub_81C868C thumb_func_start sub_81C86CC sub_81C86CC: ; 81C86CC push {r4,lr} bl sub_81C8644 adds r4, r0, 0 bl sub_81C84A4 adds r1, r0, 0 cmp r1, 0 beq @081C86F8 ldrh r0, [r4] ldrh r1, [r4, 0x8] cmp r0, r1 bcc @081C86EA ldrh r0, [r4, 0x8] b @081C86EC @081C86EA: ldrh r0, [r4] @081C86EC: negs r0, r0 movs r1, 0x1 bl sub_81C84E8 movs r0, 0x2 b @081C8706 @081C86F8: ldrh r0, [r4, 0x6] cmp r0, 0 bne @081C8702 movs r0, 0 b @081C8706 @081C8702: strh r1, [r4, 0x6] movs r0, 0x1 @081C8706: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C86CC thumb_func_start sub_81C870C sub_81C870C: ; 81C870C push {r4,lr} bl sub_81C8644 adds r4, r0, 0 bl sub_81C84C0 cmp r0, 0 beq @081C8736 ldrh r0, [r4] ldrh r3, [r4, 0x8] adds r2, r0, r3 ldrh r1, [r4, 0x4] subs r0, r1, r0 cmp r2, r1 bgt @081C872C adds r0, r3, 0 @081C872C: movs r1, 0x1 bl sub_81C84E8 movs r0, 0x2 b @081C8756 @081C8736: ldrh r0, [r4, 0x2] ldrh r1, [r4, 0x8] cmp r0, r1 bcc @081C8744 ldrh r1, [r4, 0x6] ldrh r0, [r4, 0x8] b @081C8748 @081C8744: ldrh r1, [r4, 0x6] ldrh r0, [r4, 0x2] @081C8748: subs r0, 0x1 cmp r1, r0 bge @081C8754 strh r0, [r4, 0x6] movs r0, 0x1 b @081C8756 @081C8754: movs r0, 0 @081C8756: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C870C thumb_func_start sub_81C875C sub_81C875C: ; 81C875C push {lr} bl sub_81C8644 adds r1, r0, 0 ldrh r0, [r1] ldrh r1, [r1, 0x6] adds r0, r1 pop {r1} bx r1 thumb_func_end sub_81C875C thumb_func_start sub_81C8770 sub_81C8770: ; 81C8770 push {lr} bl sub_81C8644 ldrh r0, [r0] pop {r1} bx r1 thumb_func_end sub_81C8770 thumb_func_start sub_81C877C sub_81C877C: ; 81C877C push {r4,lr} movs r0, 0x11 bl sub_81C763C adds r4, r0, 0 ldr r0, =0x0000089c adds r1, r4, r0 movs r0, 0 str r0, [r1] ldr r0, =sub_81C8870 movs r1, 0x6 bl sub_81C7078 movs r1, 0x8A lsls r1, 4 adds r4, r1 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C877C thumb_func_start sub_81C87AC sub_81C87AC: ; 81C87AC push {r4,r5,lr} adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 movs r0, 0x11 bl sub_81C763C adds r5, r0, 0 ldr r0, =0x00000888 adds r1, r5, r0 ldrh r0, [r1] adds r0, r4 movs r2, 0 strh r0, [r1] ldr r1, =0x0000089c adds r0, r5, r1 str r2, [r0] ldr r0, =sub_81C8958 movs r1, 0x6 bl sub_81C7078 movs r1, 0x8A lsls r1, 4 adds r5, r1 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C87AC thumb_func_start sub_81C87F0 sub_81C87F0: ; 81C87F0 push {r4,lr} movs r0, 0x11 bl sub_81C763C adds r4, r0, 0 ldr r0, =0x0000089c adds r1, r4, r0 movs r0, 0 str r0, [r1] ldr r0, =sub_81C8A28 movs r1, 0x6 bl sub_81C7078 movs r1, 0x8A lsls r1, 4 adds r4, r1 str r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C87F0 thumb_func_start sub_81C8820 sub_81C8820: ; 81C8820 push {lr} movs r0, 0x11 bl sub_81C763C movs r1, 0x8A lsls r1, 4 adds r0, r1 ldr r0, [r0] bl sub_81C70D8 pop {r1} bx r1 thumb_func_end sub_81C8820 thumb_func_start sub_81C8838 sub_81C8838: ; 81C8838 push {r4,lr} movs r0, 0x11 bl sub_81C763C adds r4, r0, 0 ldr r0, =0x00000888 adds r2, r4, r0 ldrh r0, [r4, 0x8] ldrh r1, [r2] ldrh r3, [r2, 0x6] adds r1, r3 ldrh r2, [r4, 0xA] adds r2, r3 movs r3, 0xF ands r2, r3 ldr r3, [r4, 0x38] bl _call_via_r3 ldrb r0, [r4, 0x8] movs r1, 0x1 bl Window_CopyToVram pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C8838 thumb_func_start sub_81C8870 sub_81C8870: ; 81C8870 push {r4,r5,lr} adds r5, r0, 0 movs r0, 0x11 bl sub_81C763C adds r4, r0, 0 cmp r5, 0x4 bhi @081C894C lsls r0, r5, 2 ldr r1, =@081C8890 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C8890: .4byte @081C88A4 .4byte @081C88AC .4byte @081C88D8 .4byte @081C8918 .4byte @081C8938 @081C88A4: adds r0, r4, 0 movs r1, 0x1 bl sub_81C9008 @081C88AC: ldr r0, =0x0000089c adds r5, r4, r0 ldr r1, =0x0000088e adds r0, r4, r1 ldr r1, [r5] ldrh r0, [r0] cmp r1, r0 beq @081C88C4 adds r0, r4, 0 movs r2, 0x1 bl sub_81C8B70 @081C88C4: ldr r0, [r5] adds r0, 0x1 str r0, [r5] @081C88CA: movs r0, 0 b @081C894E .align 2, 0 .pool @081C88D8: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @081C8942 ldr r2, =0x0000089c adds r0, r4, r2 subs r2, 0xC adds r1, r4, r2 ldr r3, [r0] ldrh r1, [r1] cmp r3, r1 beq @081C88FC movs r0, 0x6 b @081C894E .align 2, 0 .pool @081C88FC: ldr r0, =0x0000088e adds r1, r4, r0 ldrh r0, [r1] cmp r0, 0 beq @081C88CA adds r2, r0, 0 adds r0, r4, 0 adds r1, r3, 0 bl sub_81C8B70 b @081C88CA .align 2, 0 .pool @081C8918: bl is_dma3_queue_busy_with_gpu_copy lsls r0, 24 cmp r0, 0 bne @081C8942 ldr r2, =0x0000088e adds r1, r4, r2 ldrh r0, [r1] cmp r0, 0 beq @081C894C movs r1, 0 bl sub_81C84E8 b @081C88CA .align 2, 0 .pool @081C8938: bl sub_81C8630 adds r1, r0, 0 cmp r1, 0 beq @081C8946 @081C8942: movs r0, 0x2 b @081C894E @081C8946: ldr r2, =0x0000088e adds r0, r4, r2 strh r1, [r0] @081C894C: movs r0, 0x4 @081C894E: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C8870 thumb_func_start sub_81C8958 sub_81C8958: ; 81C8958 push {r4,r5,lr} adds r5, r0, 0 movs r0, 0x11 bl sub_81C763C adds r4, r0, 0 bl 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, =@081C8984 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C8984: .4byte @081C89A4 .4byte @081C89B4 .4byte @081C89BE .4byte @081C89D0 .4byte @081C89DA .4byte @081C89EC .4byte @081C89F6 .4byte @081C8A08 @081C89A4: ldr r1, =0x00000888 adds r0, r4, r1 adds r1, r4, 0 bl sub_81C8CB4 b @081C8A20 .align 2, 0 .pool @081C89B4: adds r0, r4, 0 movs r1, 0 bl sub_81C8DBC b @081C8A20 @081C89BE: ldr r1, =0x00000888 adds r0, r4, r1 adds r1, r4, 0 movs r2, 0 bl sub_81C8E54 b @081C8A20 .align 2, 0 .pool @081C89D0: adds r0, r4, 0 movs r1, 0x1 bl sub_81C8DBC b @081C8A20 @081C89DA: ldr r1, =0x00000888 adds r0, r4, r1 adds r1, r4, 0 movs r2, 0x1 bl sub_81C8E54 b @081C8A20 .align 2, 0 .pool @081C89EC: adds r0, r4, 0 movs r1, 0x2 bl sub_81C8DBC b @081C8A20 @081C89F6: ldr r1, =0x00000888 adds r0, r4, r1 adds r1, r4, 0 movs r2, 0x2 bl sub_81C8E54 b @081C8A20 .align 2, 0 .pool @081C8A08: ldr r1, =0x00000888 adds r0, r4, r1 adds r1, r4, 0 movs r2, 0x3 bl sub_81C8E54 b @081C8A20 .align 2, 0 .pool @081C8A1C: movs r0, 0x4 b @081C8A22 @081C8A20: movs r0, 0 @081C8A22: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81C8958 thumb_func_start sub_81C8A28 sub_81C8A28: ; 81C8A28 push {r4-r7,lr} sub sp, 0x8 adds r5, r0, 0 bl 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, =0x00000888 adds r6, r4, r0 adds r2, r4, 0 cmp r5, 0x6 bls @081C8A4C b @081C8B64 @081C8A4C: lsls r0, r5, 2 ldr r1, =@081C8A60 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C8A60: .4byte @081C8A7C .4byte @081C8A88 .4byte @081C8AE8 .4byte @081C8AFC .4byte @081C8B14 .4byte @081C8B34 .4byte @081C8B5C @081C8A7C: adds r0, r6, 0 adds r1, r2, 0 bl sub_81C8D4C movs r0, 0 b @081C8B66 @081C8A88: ldr r1, =0x0000089c adds r7, r4, r1 ldr r0, [r7] adds r1, r0, 0x1 str r1, [r7] movs r3, 0x89 lsls r3, 4 adds r0, r4, r3 ldrh r0, [r0] cmp r1, r0 bge @081C8AB0 adds r0, r2, 0 movs r2, 0x1 bl sub_81C8B70 @081C8AA6: movs r0, 0x2 b @081C8B66 .align 2, 0 .pool @081C8AB0: movs r0, 0 str r0, [r7] ldrh r0, [r6, 0x2] ldrh r1, [r6, 0x8] cmp r0, r1 bhi @081C8AC6 ldrh r0, [r6] cmp r0, 0 beq @081C8B52 adds r4, r0, 0 b @081C8AD4 @081C8AC6: ldrh r1, [r6] ldrh r0, [r6, 0x8] adds r4, r1, r0 ldrh r1, [r6, 0x2] cmp r4, r1 ble @081C8B52 subs r4, r1 @081C8AD4: negs r5, r4 adds r0, r2, 0 adds r1, r5, 0 adds r2, r4, 0 bl sub_81C8B70 strh r4, [r6, 0x6] str r5, [r7] movs r0, 0 b @081C8B66 @081C8AE8: ldr r2, =0x0000089c adds r0, r4, r2 ldr r0, [r0] movs r1, 0 bl sub_81C84E8 movs r0, 0 b @081C8B66 .align 2, 0 .pool @081C8AFC: bl sub_81C8630 adds r1, r0, 0 cmp r1, 0 bne @081C8AA6 ldr r3, =0x0000089c adds r0, r4, r3 str r1, [r0] @081C8B0C: movs r0, 0x1 b @081C8B66 .align 2, 0 .pool @081C8B14: ldr r0, [r6, 0x10] ldrh r1, [r6] ldr r3, =0x0000089c adds r2, r4, r3 ldr r2, [r2] adds r1, r2 ldr r3, [r6, 0xC] str r2, [sp] str r4, [sp, 0x4] movs r2, 0x1 bl sub_81C83AC movs r0, 0 b @081C8B66 .align 2, 0 .pool @081C8B34: bl sub_81C83E0 cmp r0, 0 bne @081C8AA6 ldr r0, =0x0000089c adds r1, r4, r0 ldr r0, [r1] adds r0, 0x1 str r0, [r1] ldrh r1, [r6, 0x2] cmp r0, r1 bge @081C8B0C ldrh r6, [r6, 0x8] cmp r0, r6 bge @081C8B0C @081C8B52: movs r0, 0x9 b @081C8B66 .align 2, 0 .pool @081C8B5C: adds r0, r2, 0 movs r1, 0 bl sub_81C9008 @081C8B64: movs r0, 0x4 @081C8B66: add sp, 0x8 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81C8A28 thumb_func_start sub_81C8B70 sub_81C8B70: ; 81C8B70 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 mov r9, r0 adds r7, r1, 0 adds r6, r2, 0 ldrb r0, [r0, 0x8] movs r1, 0x7 bl 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, =0x11111111 str r0, [sp] adds r1, r7, 0 muls r1, r3 add r1, r10 adds r2, r6, 0 muls r2, r3 lsrs r2, 2 ldr r0, =0x001fffff ands r2, r0 movs r0, 0x80 lsls r0, 17 orrs r2, r0 mov r0, sp bl CpuFastSet mov r1, r9 ldrb r0, [r1, 0x8] movs r1, 0x2 bl Window_CopyToVram b @081C8C1E .align 2, 0 .pool @081C8BD4: movs r2, 0x10 subs r2, r7 subs r0, r6, r2 mov r8, r0 ldr r1, =0x11111111 str r1, [sp, 0x4] add r0, sp, 0x4 adds r1, r7, 0 muls r1, r3 add r1, r10 muls r2, r3 lsrs r2, 2 ldr r5, =0x001fffff ands r2, r5 movs r4, 0x80 lsls r4, 17 orrs r2, r4 str r3, [sp, 0xC] bl CpuFastSet ldr r0, =0x11111111 str r0, [sp, 0x8] add r0, sp, 0x8 ldr r3, [sp, 0xC] mov r2, r8 muls r2, r3 lsrs r2, 2 ands r2, r5 orrs r2, r4 mov r1, r10 bl CpuFastSet mov r1, r9 ldrb r0, [r1, 0x8] movs r1, 0x2 bl 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 .pool thumb_func_end sub_81C8B70 thumb_func_start sub_81C8C64 sub_81C8C64: ; 81C8C64 push {r4,r5,lr} adds r5, r0, 0 adds r4, r1, 0 ldrb r0, [r5, 0x8] movs r1, 0 bl 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, =gUnknown_0861FBE4 add r0, sp, 0xC movs r2, 0x3 bl memcpy ldrh r1, [r5] ldr r0, [r5, 0xC] muls r1, r0 ldr r0, [r5, 0x10] adds r0, r1 adds r6, r4, 0 adds r6, 0x48 ldr r2, [r4, 0x34] adds r1, r6, 0 bl _call_via_r2 ldrh r0, [r4, 0x8] ldrh r1, [r5] ldrh r2, [r4, 0xA] ldr r3, [r4, 0x38] bl _call_via_r3 ldrb r0, [r4, 0x8] ldrh r3, [r4, 0xA] lsls r3, 20 lsrs r3, 16 ldrb r1, [r4, 0x4] lsls r1, 3 str r1, [sp] movs r1, 0x10 str r1, [sp, 0x4] movs r1, 0x44 movs r2, 0 bl 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 .pool thumb_func_end sub_81C8CB4 thumb_func_start sub_81C8D4C sub_81C8D4C: ; 81C8D4C push {r4,r5,lr} sub sp, 0xC adds r4, r1, 0 ldrh r2, [r0] ldr r1, [r0, 0xC] muls r1, r2 ldr r0, [r0, 0x10] adds r0, r1 adds r5, r4, 0 adds r5, 0x48 ldr r2, [r4, 0x34] adds r1, r5, 0 bl _call_via_r2 ldrb r0, [r4, 0x8] ldrh r3, [r4, 0xA] lsls r3, 20 lsrs r3, 16 ldrb r1, [r4, 0x4] lsls r1, 3 str r1, [sp] movs r1, 0x10 str r1, [sp, 0x4] movs r1, 0x11 movs r2, 0 bl 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, =gUnknown_0861FBE8 ldm r0!, {r2-r4} stm r1!, {r2-r4} add r0, sp, 0x18 mov r9, r0 ldr r1, =gUnknown_0861FBF4 movs r2, 0x3 bl memcpy ldrh r4, [r6, 0xA] mov r1, r8 lsls r0, r1, 1 adds r0, 0x1 adds r4, r0 movs r0, 0xF ands r4, r0 ldrb r0, [r6, 0x8] lsls r5, r4, 4 adds r3, r5, 0 ldrb r1, [r6, 0x4] str r1, [sp] movs r1, 0x10 str r1, [sp, 0x4] movs r1, 0x11 movs r2, 0 bl 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 .pool thumb_func_end sub_81C8DBC thumb_func_start sub_81C8E54 sub_81C8E54: ; 81C8E54 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0xC adds r7, r1, 0 adds r1, r2, 0 ldrh r3, [r7, 0xA] ldr r2, =gUnknown_0861FBF7 adds r2, r1, r2 ldrb r2, [r2] adds r6, r3, r2 movs r2, 0xF ands r6, r2 ldrh r0, [r0] bl sub_81CAFD8 adds r5, r0, 0 cmp r5, 0 beq @081C8EC0 ldrh r0, [r7, 0x8] lsls r4, r6, 1 ldrb r3, [r7, 0x4] subs r3, 0x1 movs r1, 0x2 mov r8, r1 str r1, [sp] movs r1, 0x1 adds r2, r4, 0 bl sub_81DB620 ldrb r0, [r7, 0x8] lsls r1, r6, 4 movs r2, 0x1 orrs r1, r2 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x7 adds r2, r5, 0 movs r3, 0x2 bl Print ldrh r0, [r7, 0x8] ldrb r1, [r7, 0x4] str r1, [sp] mov r1, r8 str r1, [sp, 0x4] movs r1, 0x2 movs r2, 0 adds r3, r4, 0 bl Window_CopyRectToVram @081C8EC0: add sp, 0xC pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C8E54 thumb_func_start sub_81C8ED0 sub_81C8ED0: ; 81C8ED0 push {r4,r5,lr} movs r5, 0 ldr r4, =gUnknown_0861FBFC @081C8ED6: adds r0, r4, 0 bl gpu_tile_obj_decompress_and_load adds r4, 0x8 adds r5, 0x1 cmp r5, 0 beq @081C8ED6 ldr r0, =gUnknown_0861FC04 bl sub_81C795C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C8ED0 thumb_func_start sub_81C8EF8 sub_81C8EF8: ; 81C8EF8 push {r4-r6,lr} mov r6, r10 mov r5, r9 mov r4, r8 push {r4-r6} adds r4, r0, 0 adds r5, r1, 0 ldr r0, =gUnknown_0861FC1C ldrb r1, [r5, 0x2] lsls r1, 3 adds r1, 0x3 ldrb r2, [r5, 0x3] adds r2, 0x1 lsls r2, 3 movs r3, 0x7 bl 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, =0x02020630 mov r8, r1 add r0, r8 str r0, [r5, 0x3C] ldrb r6, [r5, 0x2] lsls r6, 3 ldrb r0, [r5, 0x4] subs r0, 0x1 lsls r0, 2 ldr r3, =gUnknown_0861FC3C mov r10, r3 adds r6, r0 ldrb r2, [r5, 0x3] lsls r2, 3 ldrh r0, [r4, 0x8] lsls r0, 4 adds r2, r0 lsls r2, 16 asrs r2, 16 mov r0, r10 adds r1, r6, 0 movs r3, 0x7 bl 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, =0x000003ff mov r9, r0 mov r0, r9 ands r1, r0 ldr r4, =0xfffffc00 adds r0, r4, 0 ands r0, r3 orrs r0, r1 strh r0, [r2, 0x4] ldr r1, [r5, 0x44] ldr r0, =sub_81C90A0 str r0, [r1, 0x1C] ldrb r2, [r5, 0x3] lsls r2, 3 mov r0, r10 adds r1, r6, 0 movs r3, 0x7 bl 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, =sub_81C90F4 str r0, [r1, 0x1C] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C8EF8 thumb_func_start sub_81C8FE0 sub_81C8FE0: ; 81C8FE0 push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0x3C] bl 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, =nullsub_12 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 .pool @081C9028: ldr r2, [r5, 0x3C] ldr r0, =sub_81C9080 str r0, [r2, 0x1C] ldr r1, [r5, 0x40] ldr r0, =sub_81C90F4 str r0, [r1, 0x1C] ldr r1, [r5, 0x44] ldr r0, =sub_81C90A0 str r0, [r1, 0x1C] @081C903A: adds r3, r2, 0 adds r3, 0x3E movs r0, 0x1 ands r4, r0 lsls r4, 2 ldrb r2, [r3] movs r1, 0x5 negs r1, r1 adds r0, r1, 0 ands r0, r2 orrs r0, r4 strb r0, [r3] ldr r2, [r5, 0x40] adds r2, 0x3E ldrb r3, [r2] adds r0, r1, 0 ands r0, r3 orrs r0, r4 strb r0, [r2] ldr r0, [r5, 0x44] adds r0, 0x3E ldrb r2, [r0] ands r1, r2 orrs r1, r4 strb r1, [r0] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C9008 thumb_func_start sub_81C9080 sub_81C9080: ; 81C9080 push {r4,lr} adds r4, r0, 0 movs r0, 0x11 bl sub_81C763C ldr r1, =0x0000088e adds r0, r1 ldrh r0, [r0] lsls r0, 4 strh r0, [r4, 0x26] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C9080 thumb_func_start sub_81C90A0 sub_81C90A0: ; 81C90A0 push {r4,lr} adds r4, r0, 0 movs r1, 0x3C ldrsh r0, [r4, r1] cmp r0, 0 bne @081C90C2 bl sub_81C84C0 cmp r0, 0 beq @081C90C2 adds r2, r4, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 b @081C90CC @081C90C2: adds r2, r4, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 @081C90CC: strb r0, [r2] ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0x3 ble @081C90EC movs r0, 0 strh r0, [r4, 0x2E] ldrh r0, [r4, 0x30] adds r0, 0x1 movs r1, 0x7 ands r0, r1 strh r0, [r4, 0x30] strh r0, [r4, 0x26] @081C90EC: pop {r4} pop {r0} bx r0 thumb_func_end sub_81C90A0 thumb_func_start sub_81C90F4 sub_81C90F4: ; 81C90F4 push {r4,lr} adds r4, r0, 0 movs r1, 0x3C ldrsh r0, [r4, r1] cmp r0, 0 bne @081C9116 bl sub_81C84A4 cmp r0, 0 beq @081C9116 adds r2, r4, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 b @081C9120 @081C9116: adds r2, r4, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 @081C9120: strb r0, [r2] ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0x3 ble @081C9142 movs r0, 0 strh r0, [r4, 0x2E] ldrh r0, [r4, 0x30] adds r0, 0x1 movs r1, 0x7 ands r0, r1 strh r0, [r4, 0x30] negs r0, r0 strh r0, [r4, 0x26] @081C9142: pop {r4} pop {r0} bx r0 thumb_func_end sub_81C90F4 thumb_func_start sub_81C9148 sub_81C9148: ; 81C9148 push {r4,lr} adds r4, r0, 0 movs r0, 0x11 bl sub_81C763C ldr r1, [r0, 0x40] strh r4, [r1, 0x3C] ldr r0, [r0, 0x44] strh r4, [r0, 0x3C] pop {r4} pop {r0} bx r0 thumb_func_end sub_81C9148 thumb_func_start sub_81C9160 sub_81C9160: ; 81C9160 push {r4,r5,lr} adds r2, r0, 0 ldr r0, [r1] str r0, [r2, 0x10] ldrh r4, [r1, 0x6] movs r5, 0 strh r4, [r2] ldrh r3, [r1, 0x4] strh r3, [r2, 0x2] ldrb r0, [r1, 0x8] str r0, [r2, 0xC] ldrb r1, [r1, 0xC] strh r1, [r2, 0x8] lsls r0, r3, 16 lsrs r0, 16 cmp r1, r0 bcc @081C918A strh r5, [r2] strh r5, [r2, 0x4] strh r4, [r2, 0x6] b @081C91A6 @081C918A: subs r0, r3, r1 strh r0, [r2, 0x4] ldrh r1, [r2] ldrh r0, [r2, 0x8] adds r1, r0 ldrh r0, [r2, 0x2] cmp r1, r0 ble @081C91A4 subs r0, r1, r0 strh r0, [r2, 0x6] subs r0, r4, r0 strh r0, [r2] b @081C91A6 @081C91A4: strh r5, [r2, 0x6] @081C91A6: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81C9160 thumb_func_start sub_81C91AC sub_81C91AC: ; 81C91AC push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x8 adds r7, r0, 0 ldr r4, [r1] lsls r4, 30 lsrs r0, r4, 30 movs r1, 0 mov r9, r1 strb r0, [r7] strh r3, [r7, 0x6] ldr r0, [r2, 0x10] str r0, [r7, 0x34] ldr r0, [r2, 0x14] str r0, [r7, 0x38] ldrb r6, [r2, 0xD] strb r6, [r7, 0x1] ldrb r1, [r2, 0x9] strb r1, [r7, 0x2] ldrb r0, [r2, 0xB] strb r0, [r7, 0x3] ldrb r5, [r2, 0xA] strb r5, [r7, 0x4] ldrb r0, [r2, 0xE] strb r0, [r7, 0x5] lsrs r4, 30 ldr r2, =0xffffff00 mov r8, r2 ldr r0, [sp] ands r0, r2 orrs r0, r4 lsls r1, 24 lsrs r1, 16 ldr r2, =0xffff00ff ands r0, r2 orrs r0, r1 ldr r1, =0xff00ffff ands r0, r1 lsls r5, 24 ldr r1, =0x00ffffff ands r0, r1 orrs r0, r5 str r0, [sp] ldr r0, [sp, 0x4] mov r1, r8 ands r0, r1 movs r1, 0x20 orrs r0, r1 lsls r6, 24 lsrs r6, 16 ands r0, r2 orrs r0, r6 adds r3, 0x2 lsls r3, 16 ldr r1, =0x0000ffff ands r0, r1 orrs r0, r3 str r0, [sp, 0x4] mov r0, sp bl 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 .pool @081C9258: movs r0, 0 @081C925A: add sp, 0x8 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81C91AC thumb_func_start sub_81C9268 sub_81C9268: ; 81C9268 push {r4,lr} movs r4, 0 movs r0, 0x98 lsls r0, 1 bl flag_check lsls r0, 24 cmp r0, 0 beq @081C928A movs r4, 0x1 ldr r0, =0x0000089b 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 .pool thumb_func_end sub_81C9268 thumb_func_start sub_81C9298 sub_81C9298: ; 81C9298 push {r4,lr} movs r0, 0x1 movs r1, 0x10 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081C92C4 bl sub_81C9268 lsls r0, 24 lsrs r0, 24 movs r1, 0 strh r0, [r4] strh r1, [r4, 0x2] strh r1, [r4, 0x4] strh r1, [r4, 0x6] adds r0, r4, 0 bl sub_81C939C movs r0, 0x1 b @081C92C6 @081C92C4: movs r0, 0 @081C92C6: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C9298 thumb_func_start sub_81C92CC sub_81C92CC: ; 81C92CC push {r4,lr} movs r0, 0x1 movs r1, 0x10 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081C92FA bl sub_81C9268 lsls r0, 24 lsrs r0, 24 movs r1, 0 strh r0, [r4] movs r0, 0x2 strh r0, [r4, 0x2] strh r0, [r4, 0x4] strh r1, [r4, 0x6] adds r0, r4, 0 bl sub_81C939C movs r0, 0x1 b @081C92FC @081C92FA: movs r0, 0 @081C92FC: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C92CC thumb_func_start sub_81C9304 sub_81C9304: ; 81C9304 push {r4,lr} movs r0, 0x1 movs r1, 0x10 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081C932E bl sub_81C9268 lsls r0, 24 lsrs r0, 24 strh r0, [r4] movs r0, 0x3 strh r0, [r4, 0x2] strh r0, [r4, 0x4] adds r0, r4, 0 bl sub_81C939C movs r0, 0x1 b @081C9330 @081C932E: movs r0, 0 @081C9330: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C9304 thumb_func_start sub_81C9338 sub_81C9338: ; 81C9338 push {lr} movs r0, 0x1 movs r1, 0x10 bl sub_81C761C adds r2, r0, 0 cmp r2, 0 beq @081C9360 movs r0, 0 movs r1, 0x3 strh r1, [r2] strh r0, [r2, 0x2] movs r1, 0x5 strh r1, [r2, 0x4] strh r0, [r2, 0x6] adds r0, r2, 0 bl sub_81C939C movs r0, 0x1 b @081C9362 @081C9360: movs r0, 0 @081C9362: pop {r1} bx r1 thumb_func_end sub_81C9338 thumb_func_start sub_81C9368 sub_81C9368: ; 81C9368 push {r4,r5,lr} movs r0, 0x1 movs r1, 0x10 bl sub_81C761C adds r5, r0, 0 cmp r5, 0 beq @081C9394 movs r4, 0 movs r0, 0x4 strh r0, [r5] bl sub_81C76AC strh r0, [r5, 0x2] adds r0, 0x8 strh r0, [r5, 0x4] strh r4, [r5, 0x6] adds r0, r5, 0 bl sub_81C939C movs r0, 0x1 b @081C9396 @081C9394: movs r0, 0 @081C9396: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81C9368 thumb_func_start sub_81C939C sub_81C939C: ; 81C939C push {r4,lr} adds r4, r0, 0 ldrh r0, [r4] cmp r0, 0x4 bhi @081C93E0 lsls r0, 2 ldr r1, =@081C93B4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C93B4: .4byte @081C93C8 .4byte @081C93CE .4byte @081C93CE .4byte @081C93D4 .4byte @081C93DC @081C93C8: movs r0, 0 bl sub_81C7688 @081C93CE: bl sub_81C93EC b @081C93DE @081C93D4: ldr r0, =sub_81C963C b @081C93DE .align 2, 0 .pool @081C93DC: ldr r0, =sub_81C96FC @081C93DE: str r0, [r4, 0xC] @081C93E0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C939C thumb_func_start sub_81C93EC sub_81C93EC: ; 81C93EC push {lr} bl sub_81C767C cmp r0, 0x1 beq @081C9408 cmp r0, 0x1 bcc @081C93FE cmp r0, 0x2 beq @081C9410 @081C93FE: ldr r0, =sub_81C943C b @081C9412 .align 2, 0 .pool @081C9408: ldr r0, =sub_81C9520 b @081C9412 .align 2, 0 .pool @081C9410: ldr r0, =c2_pre_battle_1 @081C9412: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C93EC thumb_func_start sub_81C941C sub_81C941C: ; 81C941C push {lr} movs r0, 0x1 bl sub_81C763C ldr r1, [r0, 0xC] bl _call_via_r1 pop {r1} bx r1 thumb_func_end sub_81C941C thumb_func_start sub_81C9430 sub_81C9430: ; 81C9430 push {lr} movs r0, 0x1 bl sub_81C7650 pop {r0} bx r0 thumb_func_end sub_81C9430 thumb_func_start sub_81C943C sub_81C943C: ; 81C943C push {r4,r5,lr} adds r4, r0, 0 bl sub_81C9814 cmp r0, 0 beq @081C944C movs r0, 0x1 b @081C951A @081C944C: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 adds r5, r2, 0 cmp r0, 0 beq @081C9508 ldr r3, =gUnknown_0861FC59 movs r0, 0x2 ldrsh r1, [r4, r0] ldrh r2, [r4] lsls r0, r2, 1 adds r0, r2 lsls r0, 1 adds r1, r0 adds r1, r3 ldrb r0, [r1] cmp r0, 0x4 bhi @081C9508 lsls r0, 2 ldr r1, =@081C9488 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C9488: .4byte @081C949C .4byte @081C94BC .4byte @081C94D4 .4byte @081C94E0 .4byte @081C9516 @081C949C: ldr r0, =0x03005d90 ldr r0, [r0] ldrb r1, [r0, 0x15] movs r0, 0x8 ands r0, r1 movs r1, 0x1 cmp r0, 0 beq @081C94AE movs r1, 0x2 @081C94AE: strh r1, [r4, 0x6] ldr r1, =0x000186a6 b @081C94EE .align 2, 0 .pool @081C94BC: movs r1, 0 movs r0, 0x3 strh r0, [r4] strh r1, [r4, 0x2] ldrb r0, [r3, 0x12] strh r0, [r4, 0x4] ldr r0, =sub_81C963C str r0, [r4, 0xC] movs r0, 0x2 b @081C951A .align 2, 0 .pool @081C94D4: movs r0, 0x6 strh r0, [r4, 0x6] ldr r1, =0x000186ab b @081C94EE .align 2, 0 .pool @081C94E0: bl sub_81C76B8 cmp r0, 0 beq @081C94FC movs r0, 0x9 strh r0, [r4, 0x6] ldr r1, =0x000186ac @081C94EE: adds r0, r4, 0 bl sub_81C97B0 movs r0, 0x8 b @081C951A .align 2, 0 .pool @081C94FC: ldr r0, =sub_81C9600 str r0, [r4, 0xC] movs r0, 0x6 b @081C951A .align 2, 0 .pool @081C9508: ldrh r1, [r5, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081C9516 movs r0, 0 b @081C951A @081C9516: movs r0, 0x1 negs r0, r0 @081C951A: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81C943C thumb_func_start sub_81C9520 sub_81C9520: ; 81C9520 push {r4,lr} adds r4, r0, 0 bl sub_81C9814 cmp r0, 0 beq @081C9530 movs r0, 0x1 b @081C9580 @081C9530: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081C9570 ldr r3, =gUnknown_0861FC59 movs r0, 0x2 ldrsh r1, [r4, r0] ldrh r2, [r4] lsls r0, r2, 1 adds r0, r2 lsls r0, 1 adds r1, r0 adds r1, r3 ldrb r0, [r1] cmp r0, 0x2 bne @081C9578 movs r0, 0x6 strh r0, [r4, 0x6] ldr r1, =0x000186ab adds r0, r4, 0 bl sub_81C97B0 movs r0, 0x8 b @081C9580 .align 2, 0 .pool @081C9570: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C957E @081C9578: movs r0, 0x20 bl audio_play @081C957E: movs r0, 0 @081C9580: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C9520 thumb_func_start c2_pre_battle_1 c2_pre_battle_1: ; 81C9588 push {r4,lr} adds r4, r0, 0 bl sub_81C9814 cmp r0, 0 beq @081C9598 movs r0, 0x1 b @081C95F8 @081C9598: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081C95E8 ldr r3, =gUnknown_0861FC59 movs r0, 0x2 ldrsh r1, [r4, r0] ldrh r2, [r4] lsls r0, r2, 1 adds r0, r2 lsls r0, 1 adds r1, r0 adds r1, r3 ldrb r0, [r1] cmp r0, 0x2 beq @081C95D4 cmp r0, 0x4 beq @081C95F4 movs r0, 0x20 bl audio_play movs r0, 0 b @081C95F8 .align 2, 0 .pool @081C95D4: movs r0, 0x6 strh r0, [r4, 0x6] ldr r1, =0x000186ab adds r0, r4, 0 bl sub_81C97B0 movs r0, 0x8 b @081C95F8 .align 2, 0 .pool @081C95E8: movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081C95F4 movs r0, 0 b @081C95F8 @081C95F4: movs r0, 0x1 negs r0, r0 @081C95F8: pop {r4} pop {r1} bx r1 thumb_func_end c2_pre_battle_1 thumb_func_start sub_81C9600 sub_81C9600: ; 81C9600 push {r4,lr} adds r4, r0, 0 bl sub_81C9814 cmp r0, 0 beq @081C9616 bl sub_81C93EC str r0, [r4, 0xC] movs r0, 0x1 b @081C9634 @081C9616: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @081C962C movs r0, 0 b @081C9634 .align 2, 0 .pool @081C962C: bl sub_81C93EC str r0, [r4, 0xC] movs r0, 0x7 @081C9634: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C9600 thumb_func_start sub_81C963C sub_81C963C: ; 81C963C push {r4-r6,lr} adds r4, r0, 0 bl sub_81C9814 adds r3, r0, 0 cmp r3, 0 beq @081C964E movs r0, 0x1 b @081C96F6 @081C964E: ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 adds r6, r2, 0 cmp r0, 0 beq @081C96B8 ldr r5, =gUnknown_0861FC59 movs r1, 0x2 ldrsh r0, [r4, r1] ldrh r2, [r4] lsls r1, r2, 1 adds r1, r2 lsls r1, 1 adds r0, r1 adds r0, r5 ldrb r0, [r0] cmp r0, 0x6 beq @081C968E cmp r0, 0x6 bgt @081C9688 cmp r0, 0x5 beq @081C96A4 b @081C96B8 .align 2, 0 .pool @081C9688: cmp r0, 0x7 beq @081C96E4 b @081C96B8 @081C968E: movs r0, 0x4 strh r0, [r4] strh r3, [r4, 0x2] ldrb r0, [r5, 0x18] strh r0, [r4, 0x4] ldr r0, =sub_81C96FC str r0, [r4, 0xC] movs r0, 0x4 b @081C96F6 .align 2, 0 .pool @081C96A4: strh r3, [r4, 0x6] ldr r1, =0x000186a7 adds r0, r4, 0 bl sub_81C97B0 movs r0, 0x8 b @081C96F6 .align 2, 0 .pool @081C96B8: ldrh r1, [r6, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C96F4 movs r0, 0x2 ldrsh r2, [r4, r0] ldr r1, =gUnknown_0861FC54 ldrh r0, [r4] adds r0, r1 ldrb r0, [r0] cmp r2, r0 beq @081C96E4 strh r0, [r4, 0x2] ldr r0, =sub_81C9798 str r0, [r4, 0xC] movs r0, 0x1 b @081C96F6 .align 2, 0 .pool @081C96E4: movs r0, 0x5 bl audio_play adds r0, r4, 0 bl sub_81C97C0 movs r0, 0x3 b @081C96F6 @081C96F4: movs r0, 0 @081C96F6: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81C963C thumb_func_start sub_81C96FC sub_81C96FC: ; 81C96FC push {r4,lr} adds r4, r0, 0 bl sub_81C9814 cmp r0, 0 beq @081C970C movs r0, 0x1 b @081C9792 @081C970C: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081C9754 ldr r3, =gUnknown_0861FC59 movs r0, 0x2 ldrsh r1, [r4, r0] ldrh r2, [r4] lsls r0, r2, 1 adds r0, r2 lsls r0, 1 adds r1, r0 adds r1, r3 ldrb r0, [r1] cmp r0, 0xD beq @081C9780 subs r0, 0x8 bl sub_81C7694 ldr r1, =0x000186a8 adds r0, r4, 0 bl sub_81C97B0 movs r0, 0x3 strh r0, [r4, 0x6] movs r0, 0x8 b @081C9792 .align 2, 0 .pool @081C9754: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081C9790 movs r0, 0x2 ldrsh r2, [r4, r0] ldr r1, =gUnknown_0861FC54 ldrh r0, [r4] adds r0, r1 ldrb r0, [r0] cmp r2, r0 beq @081C9780 strh r0, [r4, 0x2] ldr r0, =sub_81C97A4 str r0, [r4, 0xC] movs r0, 0x1 b @081C9792 .align 2, 0 .pool @081C9780: movs r0, 0x5 bl audio_play adds r0, r4, 0 bl sub_81C97F8 movs r0, 0x5 b @081C9792 @081C9790: movs r0, 0 @081C9792: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C96FC thumb_func_start sub_81C9798 sub_81C9798: ; 81C9798 push {lr} bl sub_81C97C0 movs r0, 0x3 pop {r1} bx r1 thumb_func_end sub_81C9798 thumb_func_start sub_81C97A4 sub_81C97A4: ; 81C97A4 push {lr} bl sub_81C97F8 movs r0, 0x5 pop {r1} bx r1 thumb_func_end sub_81C97A4 thumb_func_start sub_81C97B0 sub_81C97B0: ; 81C97B0 str r1, [r0, 0x8] ldr r1, =sub_81C97BC str r1, [r0, 0xC] bx lr .align 2, 0 .pool thumb_func_end sub_81C97B0 thumb_func_start sub_81C97BC sub_81C97BC: ; 81C97BC ldr r0, [r0, 0x8] bx lr thumb_func_end sub_81C97BC thumb_func_start sub_81C97C0 sub_81C97C0: ; 81C97C0 push {r4,lr} adds r4, r0, 0 bl sub_81C9268 lsls r0, 24 lsrs r0, 24 strh r0, [r4] movs r0, 0x1 strh r0, [r4, 0x2] ldr r2, =gUnknown_0861FC59 ldrh r1, [r4] lsls r0, r1, 1 adds r0, r1 lsls r0, 1 adds r0, 0x1 adds r0, r2 ldrb r0, [r0] strh r0, [r4, 0x4] ldr r0, =sub_81C943C str r0, [r4, 0xC] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C97C0 thumb_func_start sub_81C97F8 sub_81C97F8: ; 81C97F8 movs r1, 0x3 strh r1, [r0] movs r1, 0x1 strh r1, [r0, 0x2] ldr r1, =gUnknown_0861FC59 ldrb r1, [r1, 0x13] strh r1, [r0, 0x4] ldr r1, =sub_81C963C str r1, [r0, 0xC] bx lr .align 2, 0 .pool thumb_func_end sub_81C97F8 thumb_func_start sub_81C9814 sub_81C9814: ; 81C9814 push {r4,r5,lr} adds r4, r0, 0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x40 ands r0, r1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0 beq @081C9848 ldrh r0, [r4, 0x2] subs r0, 0x1 strh r0, [r4, 0x2] lsls r0, 16 ldrh r3, [r4] cmp r0, 0 bge @081C986A ldr r0, =gUnknown_0861FC54 adds r0, r3, r0 ldrb r0, [r0] strh r0, [r4, 0x2] b @081C986A .align 2, 0 .pool @081C9848: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081C988C ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] movs r0, 0x2 ldrsh r2, [r4, r0] ldr r0, =gUnknown_0861FC54 ldrh r1, [r4] adds r0, r1, r0 adds r3, r1, 0 ldrb r0, [r0] cmp r2, r0 ble @081C986A strh r5, [r4, 0x2] @081C986A: ldr r2, =gUnknown_0861FC59 movs r0, 0x2 ldrsh r1, [r4, r0] lsls r0, r3, 1 adds r0, r3 lsls r0, 1 adds r1, r0 adds r1, r2 ldrb r0, [r1] strh r0, [r4, 0x4] movs r0, 0x1 b @081C988E .align 2, 0 .pool @081C988C: movs r0, 0 @081C988E: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81C9814 thumb_func_start sub_81C9894 sub_81C9894: ; 81C9894 push {lr} movs r0, 0x1 bl sub_81C763C ldrh r0, [r0] pop {r1} bx r1 thumb_func_end sub_81C9894 thumb_func_start sub_81C98A4 sub_81C98A4: ; 81C98A4 push {lr} movs r0, 0x1 bl sub_81C763C movs r1, 0x2 ldrsh r0, [r0, r1] pop {r1} bx r1 thumb_func_end sub_81C98A4 thumb_func_start sub_81C98B4 sub_81C98B4: ; 81C98B4 push {lr} movs r0, 0x1 bl sub_81C763C ldrh r0, [r0, 0x4] pop {r1} bx r1 thumb_func_end sub_81C98B4 thumb_func_start sub_81C98C4 sub_81C98C4: ; 81C98C4 push {lr} movs r0, 0x1 bl sub_81C763C ldrh r0, [r0, 0x6] pop {r1} bx r1 thumb_func_end sub_81C98C4 thumb_func_start sub_81C98D4 sub_81C98D4: ; 81C98D4 push {r4,lr} movs r4, 0 @081C98D8: adds r0, r4, 0 bl sub_81CB0C8 ldr r1, =0x02037318 lsls r0, 24 lsrs r0, 24 ldrb r1, [r1, 0x14] cmp r0, r1 bne @081C9914 adds r0, r4, 0 bl sub_81CAE08 cmp r0, 0 beq @081C9914 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 adds r0, r4 ldrb r0, [r0] cmp r0, 0 beq @081C9914 movs r0, 0x1 b @081C991C .align 2, 0 .pool @081C9914: adds r4, 0x1 cmp r4, 0x4D ble @081C98D8 movs r0, 0 @081C991C: pop {r4} pop {r1} bx r1 thumb_func_end sub_81C98D4 thumb_func_start sub_81C9924 sub_81C9924: ; 81C9924 push {lr} bl sub_81C9958 adds r1, r0, 0 cmp r1, 0 beq @081C9938 movs r0, 0 strb r0, [r1, 0xD] movs r0, 0x1 b @081C993A @081C9938: movs r0, 0 @081C993A: pop {r1} bx r1 thumb_func_end sub_81C9924 thumb_func_start sub_81C9940 sub_81C9940: ; 81C9940 push {lr} bl sub_81C9958 adds r1, r0, 0 cmp r1, 0 beq @081C9952 movs r0, 0x1 strb r0, [r1, 0xD] b @081C9954 @081C9952: movs r0, 0 @081C9954: pop {r1} bx r1 thumb_func_end sub_81C9940 thumb_func_start sub_81C9958 sub_81C9958: ; 81C9958 push {r4,lr} ldr r1, =0x0000088c movs r0, 0x2 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081C997A movs r0, 0 strb r0, [r4, 0xC] ldr r0, =sub_81C9A10 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] ldr r0, =sub_81C99FC str r0, [r4] @081C997A: adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81C9958 thumb_func_start sub_81C9990 sub_81C9990: ; 81C9990 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x2 bl sub_81C763C adds r5, r0, 0 ldr r0, =gUnknown_086201A0 lsls r4, 2 adds r4, r0 ldr r0, [r4] movs r1, 0x1 bl sub_81C7078 str r0, [r5, 0x4] ldr r0, =sub_81C99FC str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81C9990 thumb_func_start sub_81C99C0 sub_81C99C0: ; 81C99C0 push {lr} movs r0, 0x2 bl sub_81C763C ldr r0, [r0] bl _call_via_r0 pop {r1} bx r1 thumb_func_end sub_81C99C0 thumb_func_start sub_81C99D4 sub_81C99D4: ; 81C99D4 push {r4,lr} movs r0, 0x2 bl sub_81C763C adds r4, r0, 0 bl sub_81CA7F4 ldrb r0, [r4, 0x8] bl 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, =@081C9A34 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081C9A34: .4byte @081C9A5C .4byte @081C9AEC .4byte @081C9B30 .4byte @081C9B88 .4byte @081C9B9E .4byte @081C9BA4 .4byte @081C9BB6 .4byte @081C9BC0 .4byte @081C9C0E .4byte @081C9C4C @081C9A5C: ldr r0, =gUnknown_08620194 movs r1, 0x3 bl sub_81C7B54 ldr r1, =gUnknown_08DC90E0 movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram adds r1, r5, 0 adds r1, 0x8C movs r0, 0x1 bl bg_set_tilemap ldr r1, =gUnknown_08DC9130 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, =gUnknown_08DC90C0 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 .pool @081C9AEC: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @081C9AFA b @081C9C5C @081C9AFA: ldr r1, =gUnknown_0861FD6C str r0, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_0861FFF4 movs r0, 0x1 str r0, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r0, =gUnknown_0861FD4C movs r1, 0x20 movs r2, 0x20 bl sub_81C7944 b @081C9AD6 .align 2, 0 .pool @081C9B30: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @081C9B3E b @081C9C5C @081C9B3E: ldr r1, =gUnknown_0861FC98 str r0, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_0861FCAC movs r0, 0x1 str r0, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r0, =gUnknown_0861FC78 movs r1, 0x30 movs r2, 0x20 bl sub_81C7944 bl sub_81C9894 cmp r0, 0x3 beq @081C9B76 bl sub_81C9894 cmp r0, 0x4 bne @081C9AD6 @081C9B76: bl sub_81CA850 b @081C9AD6 .align 2, 0 .pool @081C9B88: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081C9C5C bl sub_81CA6E0 bl sub_81CA7D4 @081C9B9A: movs r0, 0x1 b @081C9C62 @081C9B9E: bl sub_81C9FC4 b @081C9B9A @081C9BA4: bl sub_81CA714 bl sub_81CA02C bl sub_81CA640 bl sub_81CA0C8 b @081C9AD6 @081C9BB6: bl sub_81CA7C4 cmp r0, 0 bne @081C9C5C b @081C9B9A @081C9BC0: movs r0, 0x1 bl 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, =gUnknown_086201C4 @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, =gUnknown_086201D4 bl sub_81C795C pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0862034C 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, =0x02020630 adds r1, r0 stm r6!, {r1} lsls r0, r4, 5 strh r0, [r1, 0x24] adds r4, 0x1 cmp r4, 0x3 ble @081CA054 adds r2, r7, 0 cmp r2, 0x5 ble @081CA03E pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA02C thumb_func_start sub_81CA094 sub_81CA094: ; 81CA094 push {r4-r7,lr} movs r0, 0x2 bl sub_81C763C movs r1, 0 adds r7, r0, 0 adds r7, 0x2C @081CA0A2: lsls r0, r1, 4 adds r6, r1, 0x1 adds r4, r0, r7 movs r5, 0x3 @081CA0AA: ldr r0, [r4] bl obj_free_rotscale_entry ldm r4!, {r0} bl 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, =gUnknown_08620244 adds r0, r2, r1 subs r1, 0x4 adds r2, r1 ldrh r1, [r2] ldrh r2, [r2, 0x2] bl sub_81CA0EC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA0C8 thumb_func_start sub_81CA0EC sub_81CA0EC: ; 81CA0EC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 adds r6, r0, 0 str r1, [sp, 0x14] str r2, [sp] movs r0, 0x2 bl sub_81C763C mov r10, r0 movs r0, 0x3 bl 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, =0x000003ff adds r0, r1, 0 ands r2, r0 ldrh r0, [r3, 0x4] ldr r7, =0xfffffc00 adds r1, r7, 0 ands r0, r1 orrs r0, r2 strh r0, [r3, 0x4] ldr r0, [r6] ldrh r0, [r0, 0x2] adds r0, 0x4 lsls r0, 16 lsrs r0, 16 bl 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 .pool @081CA1B0: lsls r2, r1, 4 mov r0, r10 adds r0, 0x2C lsls r3, r1, 2 mov r9, r3 movs r4, 0x10 add r4, r10 mov r8, r4 adds r6, 0x4 str r6, [sp, 0xC] ldr r7, [sp, 0x14] ldr r3, [sp] adds r7, r3 str r7, [sp, 0x8] adds r1, 0x1 str r1, [sp, 0x10] movs r3, 0x4 adds r2, r0 movs r5, 0x3 @081CA1D6: ldm r2!, {r1} adds r1, 0x3E ldrb r0, [r1] orrs r0, r3 strb r0, [r1] subs r5, 0x1 cmp r5, 0 bge @081CA1D6 mov r1, r8 add r1, r9 movs r0, 0 @081CA1EC: str r0, [r1] ldr r6, [sp, 0xC] ldr r4, [sp, 0x8] str r4, [sp, 0x14] ldr r1, [sp, 0x10] cmp r1, 0x5 ble @081CA114 add sp, 0x18 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81CA0EC thumb_func_start sub_81CA20C sub_81CA20C: ; 81CA20C push {r4-r7,lr} mov r7, r8 push {r7} movs r0, 0x2 bl sub_81C763C adds r6, r0, 0 bl sub_81C98A4 mov r8, r0 movs r7, 0 movs r5, 0 adds r4, r6, 0 adds r4, 0x2C @081CA228: lsls r0, r5, 2 adds r1, r6, 0 adds r1, 0x10 adds r1, r0 ldr r0, [r1] cmp r0, 0 beq @081CA25C adds r0, r7, 0 adds r7, 0x1 cmp r0, r8 bne @081CA244 movs r2, 0x82 strb r5, [r6, 0xB] b @081CA246 @081CA244: movs r2, 0x8C @081CA246: adds r0, r4, 0 movs r1, 0x80 lsls r1, 1 movs r3, 0xC bl sub_81CA35C adds r0, r4, 0 movs r1, 0 bl sub_81CA448 b @081CA264 @081CA25C: adds r0, r4, 0 movs r1, 0x1 bl sub_81CA448 @081CA264: adds r4, 0x10 adds r5, 0x1 cmp r5, 0x5 ble @081CA228 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81CA20C thumb_func_start sub_81CA278 sub_81CA278: ; 81CA278 push {r4,r5,lr} movs r0, 0x2 bl sub_81C763C adds r4, r0, 0 bl sub_81C98A4 adds r3, r0, 0 movs r2, 0 movs r5, 0 ldr r0, [r4, 0x10] cmp r0, 0 beq @081CA298 cmp r5, r3 beq @081CA2B2 @081CA296: adds r5, 0x1 @081CA298: adds r2, 0x1 cmp r2, 0x5 bgt @081CA2B2 lsls r0, r2, 2 adds r1, r4, 0 adds r1, 0x10 adds r1, r0 ldr r0, [r1] cmp r0, 0 beq @081CA298 cmp r5, r3 bne @081CA296 adds r5, r2, 0 @081CA2B2: ldrb r0, [r4, 0xB] lsls r0, 4 adds r0, 0x2C adds r0, r4, r0 movs r1, 0x82 movs r2, 0x8C movs r3, 0x4 bl sub_81CA35C lsls r0, r5, 4 adds r0, 0x2C adds r0, r4, r0 movs r1, 0x8C movs r2, 0x82 movs r3, 0x4 bl sub_81CA35C strb r5, [r4, 0xB] pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81CA278 thumb_func_start sub_81CA2DC sub_81CA2DC: ; 81CA2DC push {r4-r6,lr} movs r0, 0x2 bl sub_81C763C adds r6, r0, 0 movs r5, 0 adds r4, r6, 0 adds r4, 0x2C @081CA2EC: lsls r0, r5, 2 adds r1, r6, 0 adds r1, 0x10 adds r1, r0 ldr r0, [r1] cmp r0, 0 beq @081CA316 ldrb r0, [r6, 0xB] cmp r0, r5 beq @081CA310 adds r0, r4, 0 movs r1, 0x8C movs r2, 0x80 lsls r2, 1 movs r3, 0x8 bl sub_81CA35C b @081CA316 @081CA310: adds r0, r4, 0 bl sub_81CA3B4 @081CA316: adds r4, 0x10 adds r5, 0x1 cmp r5, 0x5 ble @081CA2EC pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81CA2DC thumb_func_start sub_81CA324 sub_81CA324: ; 81CA324 push {r4,lr} movs r0, 0x2 bl sub_81C763C adds r3, r0, 0 movs r2, 0 ldr r4, =nullsub_12 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 .pool @081CA354: movs r0, 0x1 @081CA356: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CA324 thumb_func_start sub_81CA35C sub_81CA35C: ; 81CA35C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r4, r0, 0 adds r5, r1, 0 mov r9, r2 adds r6, r3, 0 ldr r0, =sub_81CA474 mov r8, r0 subs r0, r2, r5 lsls r0, 4 adds r1, r6, 0 bl __divsi3 adds r3, r0, 0 movs r1, 0x3 lsls r2, r5, 4 @081CA380: ldr r0, [r4] strh r5, [r0, 0x20] ldr r0, [r4] strh r6, [r0, 0x2E] ldr r0, [r4] strh r3, [r0, 0x30] ldr r0, [r4] strh r2, [r0, 0x32] ldr r0, [r4] mov r7, r9 strh r7, [r0, 0x3C] ldm r4!, {r0} mov r7, r8 str r7, [r0, 0x1C] subs r1, 0x1 cmp r1, 0 bge @081CA380 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA35C thumb_func_start sub_81CA3B4 sub_81CA3B4: ; 81CA3B4 push {r4-r7,lr} mov r7, r8 push {r7} adds r4, r0, 0 movs r0, 0x2 bl sub_81C763C adds r7, r0, 0 movs r5, 0 mov r8, r5 @081CA3C8: ldr r2, [r4] ldrb r1, [r2, 0x1] movs r3, 0xD negs r3, r3 adds r0, r3, 0 ands r1, r0 movs r0, 0x4 orrs r1, r0 strb r1, [r2, 0x1] ldr r2, [r4] ldrb r0, [r2, 0x1] movs r1, 0x3 orrs r0, r1 strb r0, [r2, 0x1] ldr r1, [r4] ldr r0, =sub_81CA4AC str r0, [r1, 0x1C] movs r6, 0x8 strh r6, [r1, 0x2E] ldr r0, [r4] mov r1, r8 strh r1, [r0, 0x30] ldr r0, [r4] strh r5, [r0, 0x3C] ldr r0, [r4] bl obj_alloc_rotscale_entry ldm r4!, {r0} movs r1, 0 bl sub_8008258 adds r5, 0x1 cmp r5, 0x3 ble @081CA3C8 movs r0, 0x52 movs r1, 0x10 bl lcd_io_set ldr r0, =sub_81CA580 movs r1, 0x3 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r6, [r1, 0x8] ldrb r0, [r7, 0xC] adds r0, 0x1 strb r0, [r7, 0xC] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA3B4 thumb_func_start sub_81CA448 sub_81CA448: ; 81CA448 push {r4-r6,lr} adds r5, r0, 0 movs r0, 0x1 ands r1, r0 lsls r4, r1, 2 movs r6, 0x5 negs r6, r6 movs r3, 0x3 @081CA458: ldm r5!, {r0} adds r0, 0x3E ldrb r2, [r0] adds r1, r6, 0 ands r1, r2 orrs r1, r4 strb r1, [r0] subs r3, 0x1 cmp r3, 0 bge @081CA458 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81CA448 thumb_func_start sub_81CA474 sub_81CA474: ; 81CA474 push {lr} adds r2, r0, 0 ldrh r0, [r2, 0x2E] subs r0, 0x1 strh r0, [r2, 0x2E] lsls r0, 16 asrs r0, 16 movs r1, 0x1 negs r1, r1 cmp r0, r1 beq @081CA49A ldrh r0, [r2, 0x30] ldrh r1, [r2, 0x32] adds r0, r1 strh r0, [r2, 0x32] lsls r0, 16 asrs r0, 20 strh r0, [r2, 0x20] b @081CA4A2 @081CA49A: ldrh r0, [r2, 0x3C] strh r0, [r2, 0x20] ldr r0, =nullsub_12 str r0, [r2, 0x1C] @081CA4A2: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA474 thumb_func_start sub_81CA4AC sub_81CA4AC: ; 81CA4AC push {r4,r5,lr} adds r4, r0, 0 ldrh r1, [r4, 0x2E] movs r2, 0x2E ldrsh r0, [r4, r2] cmp r0, 0 bne @081CA574 movs r0, 0x30 ldrsh r5, [r4, r0] cmp r5, 0 bne @081CA4E2 adds r0, r4, 0 movs r1, 0x1 bl 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, =nullsub_12 str r0, [r4, 0x1C] b @081CA578 .align 2, 0 .pool @081CA574: subs r0, r1, 0x1 strh r0, [r4, 0x2E] @081CA578: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81CA4AC thumb_func_start sub_81CA580 sub_81CA580: ; 81CA580 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrh r0, [r4] movs r1, 0 ldrsh r2, [r4, r1] cmp r2, 0 bne @081CA634 movs r0, 0x2 ldrsh r1, [r4, r0] cmp r1, 0 beq @081CA5AC cmp r1, 0x1 beq @081CA5CC b @081CA638 .align 2, 0 .pool @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, =gUnknown_0862036C 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, =0x02020630 adds r1, r0 str r1, [r4, 0x28] bl sub_81C98D4 cmp r0, 0 beq @081CA684 ldr r1, [r4, 0x28] ldr r0, =sub_81CA6AC str r0, [r1, 0x1C] b @081CA690 .align 2, 0 .pool @081CA684: ldr r0, [r4, 0x28] adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] @081CA690: pop {r4} pop {r0} bx r0 thumb_func_end sub_81CA640 thumb_func_start sub_81CA698 sub_81CA698: ; 81CA698 push {lr} movs r0, 0x2 bl sub_81C763C ldr r0, [r0, 0x28] bl 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, =gUnknown_086202CC 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 .pool thumb_func_end sub_81CA6E0 thumb_func_start sub_81CA714 sub_81CA714: ; 81CA714 push {r4-r6,lr} sub sp, 0xC movs r0, 0x2 bl sub_81C763C adds r5, r0, 0 bl sub_81C98B4 ldr r1, =gUnknown_086202D4 lsls r0, 2 adds r0, r1 ldr r6, [r0] movs r2, 0x1 negs r2, r2 movs r0, 0x1 adds r1, r6, 0 bl 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, =gUnknown_0862030C str r1, [sp] movs r1, 0 str r1, [sp, 0x4] str r6, [sp, 0x8] movs r1, 0x1 movs r3, 0x1 bl box_print add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA714 thumb_func_start sub_81CA770 sub_81CA770: ; 81CA770 push {r4-r6,lr} sub sp, 0xC movs r0, 0x2 bl sub_81C763C adds r5, r0, 0 ldr r6, =gUnknown_085EBD4A movs r2, 0x1 negs r2, r2 movs r0, 0x1 adds r1, r6, 0 bl 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, =gUnknown_0862030F str r1, [sp] movs r1, 0 str r1, [sp, 0x4] str r6, [sp, 0x8] movs r1, 0x1 movs r3, 0x1 bl box_print add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81CA808 movs r1, 0x2 bl AddTask strb r0, [r4, 0xA] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA7D4 thumb_func_start sub_81CA7F4 sub_81CA7F4: ; 81CA7F4 push {lr} movs r0, 0x2 bl sub_81C763C ldrb r0, [r0, 0xA] bl remove_task pop {r0} bx r0 thumb_func_end sub_81CA7F4 thumb_func_start sub_81CA808 sub_81CA808: ; 81CA808 push {lr} movs r0, 0x3 movs r1, 0x80 movs r2, 0x1 bl 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, =sub_81CA8B0 movs r1, 0x3 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r5, =gUnknown_0861FC7A adds r0, r4, 0 movs r1, 0x1 adds r2, r5, 0 bl set_word_task_arg adds r5, 0xC adds r0, r4, 0 movs r1, 0x3 adds r2, r5, 0 bl set_word_task_arg pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA818 thumb_func_start sub_81CA850 sub_81CA850: ; 81CA850 push {lr} ldr r0, =gUnknown_0861FC86 movs r1, 0x31 movs r2, 0x4 bl sub_81C7944 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA850 thumb_func_start sub_81CA864 sub_81CA864: ; 81CA864 push {r4,r5,lr} ldr r0, =sub_81CA8B0 movs r1, 0x3 bl AddTask adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r5, =gUnknown_0861FC86 adds r0, r4, 0 movs r1, 0x1 adds r2, r5, 0 bl set_word_task_arg subs r5, 0xC adds r0, r4, 0 movs r1, 0x3 adds r2, r5, 0 bl set_word_task_arg pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA864 thumb_func_start sub_81CA89C sub_81CA89C: ; 81CA89C push {lr} ldr r0, =sub_81CA8B0 bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CA89C thumb_func_start sub_81CA8B0 sub_81CA8B0: ; 81CA8B0 push {r4-r6,lr} sub sp, 0xC lsls r0, 24 lsrs r6, r0, 24 lsls r4, r6, 2 adds r4, r6 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 adds r0, r6, 0 movs r1, 0x1 bl get_word_task_arg adds r5, r0, 0 adds r0, r6, 0 movs r1, 0x3 bl get_word_task_arg adds r1, r0, 0 ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] lsls r0, 16 asrs r0, 16 str r0, [sp] add r0, sp, 0x8 str r0, [sp, 0x4] adds r0, r5, 0 movs r2, 0x2 movs r3, 0xC bl sub_81C79BC add r0, sp, 0x8 movs r1, 0x31 movs r2, 0x4 bl gpu_pal_apply movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0xC bne @081CA908 adds r0, r6, 0 bl remove_task @081CA908: add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA8B0 thumb_func_start sub_81CA914 sub_81CA914: ; 81CA914 push {lr} bl copy_pal_bg_faded_to_pal_ram bl 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, =gUnknown_08620384 ldr r0, [r2] ldr r1, [r2, 0x4] ldr r2, [r2, 0x8] bl sub_80BA038 ldr r0, =sub_81CA914 bl c3args_set_0toR1_1to0 ldr r0, =sub_81CA9EC movs r1, 0x3 bl AddTask pop {r0} bx r0 .align 2, 0 .pool 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, =sub_81CA9EC 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 .pool 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, =0x03005e08 adds r2, r1, r0 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] lsls r0, 16 cmp r0, 0 ble @081CAA30 movs r0, 0 strh r0, [r2] ldrh r0, [r2, 0x2] adds r0, 0x3 movs r1, 0x7F ands r0, r1 strh r0, [r2, 0x2] ldr r1, =gUnknown_08329F40 movs r3, 0x2 ldrsh r0, [r2, r3] lsls r0, 1 adds r0, r1 ldrh r1, [r0] lsls r1, 16 asrs r1, 21 lsls r1, 16 lsrs r1, 16 movs r0, 0x54 bl lcd_io_set @081CAA30: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CA9EC thumb_func_start sub_81CAA3C sub_81CAA3C: ; 81CAA3C push {r4-r6,lr} mov r6, r9 mov r5, r8 push {r5,r6} sub sp, 0x8 bl sub_81C9894 adds r4, r0, 0 bl sub_81C98A4 ldr r2, =gUnknown_08620240 lsls r1, r4, 3 subs r1, r4 lsls r1, 2 adds r1, r2 ldrh r2, [r1, 0x2] adds r4, r2, 0 muls r4, r0 ldrh r1, [r1] adds r4, r1 subs r4, 0x8 mov r0, sp movs r6, 0 strh r6, [r0] ldr r5, =0x02038c28 ldr r0, =0x010000a0 mov r8, r0 mov r0, sp adds r1, r5, 0 mov r2, r8 bl CpuSet mov r0, sp adds r0, 0x2 strh r6, [r0] movs r1, 0xF0 lsls r1, 3 adds r1, r5 mov r9, r1 mov r2, r8 bl CpuSet add r0, sp, 0x4 ldr r1, =0x000072f0 adds r6, r1, 0 strh r6, [r0] lsls r4, 1 adds r5, r4, r5 ldr r1, =0x01000010 mov r8, r1 adds r1, r5, 0 mov r2, r8 bl CpuSet mov r0, sp adds r0, 0x6 strh r6, [r0] add r4, r9 adds r1, r4, 0 mov r2, r8 bl CpuSet add sp, 0x8 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CAA3C thumb_func_start sub_81CAADC sub_81CAADC: ; 81CAADC push {lr} bl sub_81CA9C8 pop {r0} bx r0 thumb_func_end sub_81CAADC thumb_func_start sub_81CAAE8 sub_81CAAE8: ; 81CAAE8 push {r4,lr} movs r1, 0xD4 lsls r1, 1 movs r0, 0x5 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CAB1C ldr r0, =sub_81CAB44 str r0, [r4, 0x18] movs r0, 0 strh r0, [r4, 0x8] str r0, [r4, 0x10] ldr r0, =sub_81CAD20 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x14] movs r0, 0x1 b @081CAB1E .align 2, 0 .pool @081CAB1C: movs r0, 0 @081CAB1E: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CAAE8 thumb_func_start sub_81CAB24 sub_81CAB24: ; 81CAB24 push {lr} movs r0, 0x5 bl sub_81C763C ldr r1, [r0, 0x18] bl _call_via_r1 pop {r1} bx r1 thumb_func_end sub_81CAB24 thumb_func_start sub_81CAB38 sub_81CAB38: ; 81CAB38 push {lr} movs r0, 0x5 bl sub_81C7650 pop {r0} bx r0 thumb_func_end sub_81CAB38 thumb_func_start sub_81CAB44 sub_81CAB44: ; 81CAB44 push {r4,r5,lr} adds r4, r0, 0 ldr r3, =0x030022c0 ldrh r1, [r3, 0x30] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081CAB5C movs r0, 0x2 b @081CABF4 .align 2, 0 .pool @081CAB5C: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081CAB68 movs r0, 0x1 b @081CABF4 @081CAB68: movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @081CAB74 movs r0, 0x4 b @081CABF4 @081CAB74: movs r0, 0x10 ands r0, r1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0 beq @081CAB84 movs r0, 0x3 b @081CABF4 @081CAB84: ldrh r1, [r3, 0x2E] movs r5, 0x1 adds r0, r5, 0 ands r0, r1 cmp r0, 0 beq @081CABD0 ldr r0, =sub_81CAC04 str r0, [r4, 0x18] strh r2, [r4] bl sub_81C875C lsls r0, 2 adds r1, r4, r0 ldrb r0, [r1, 0x1C] cmp r0, 0 beq @081CABAE ldrh r0, [r1, 0x1E] bl sub_81D17E8 cmp r0, 0 beq @081CABC0 @081CABAE: ldr r0, =gUnknown_0862250A str r0, [r4, 0x4] movs r0, 0x2 strh r0, [r4, 0x2] b @081CABC6 .align 2, 0 .pool @081CABC0: ldr r0, =gUnknown_08622508 str r0, [r4, 0x4] strh r5, [r4, 0x2] @081CABC6: movs r0, 0x5 b @081CABF4 .align 2, 0 .pool @081CABD0: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081CABF2 bl sub_81C767C cmp r0, 0x1 beq @081CABEC ldr r0, =sub_81CABFC str r0, [r4, 0x18] movs r0, 0xF b @081CABF4 .align 2, 0 .pool @081CABEC: movs r0, 0x20 bl audio_play @081CABF2: movs r0, 0 @081CABF4: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CAB44 thumb_func_start sub_81CABFC sub_81CABFC: ; 81CABFC ldr r0, =0x000186a4 bx lr .align 2, 0 .pool thumb_func_end sub_81CABFC thumb_func_start sub_81CAC04 sub_81CAC04: ; 81CAC04 push {r4,lr} adds r4, r0, 0 ldr r2, =0x030022c0 ldrh r1, [r2, 0x2E] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081CAC24 ldrh r0, [r4] cmp r0, 0 beq @081CAC24 subs r0, 0x1 b @081CAC38 .align 2, 0 .pool @081CAC24: ldrh r1, [r2, 0x2E] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081CAC3E ldrh r0, [r4] ldrh r1, [r4, 0x2] cmp r0, r1 bcs @081CAC3E adds r0, 0x1 @081CAC38: strh r0, [r4] movs r0, 0x6 b @081CACAC @081CAC3E: ldrh r1, [r2, 0x2E] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081CAC98 ldrh r1, [r4] ldr r0, [r4, 0x4] adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @081CAC8C cmp r0, 0x1 bgt @081CAC5E cmp r0, 0 beq @081CAC64 b @081CAC98 @081CAC5E: cmp r0, 0x2 bne @081CAC98 b @081CACA6 @081CAC64: bl sub_81C767C cmp r0, 0x1 bne @081CAC72 movs r0, 0x2 bl sub_81C7688 @081CAC72: ldr r0, =sub_81CACF8 str r0, [r4, 0x18] bl sub_81CB1D0 cmp r0, 0 beq @081CAC88 movs r0, 0x9 b @081CACAC .align 2, 0 .pool @081CAC88: movs r0, 0x8 b @081CACAC @081CAC8C: ldr r0, =sub_81CACB8 str r0, [r4, 0x18] movs r0, 0xB b @081CACAC .align 2, 0 .pool @081CAC98: ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081CACA6 movs r0, 0 b @081CACAC @081CACA6: ldr r0, =sub_81CAB44 str r0, [r4, 0x18] movs r0, 0x7 @081CACAC: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CAC04 thumb_func_start sub_81CACB8 sub_81CACB8: ; 81CACB8 push {lr} adds r3, r0, 0 ldr r2, =0x030022c0 ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081CACD0 movs r0, 0xC b @081CACF0 .align 2, 0 .pool @081CACD0: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081CACDC movs r0, 0xD b @081CACF0 @081CACDC: ldrh r1, [r2, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081CACEA movs r0, 0 b @081CACF0 @081CACEA: ldr r0, =sub_81CAB44 str r0, [r3, 0x18] movs r0, 0xE @081CACF0: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CACB8 thumb_func_start sub_81CACF8 sub_81CACF8: ; 81CACF8 push {lr} adds r2, r0, 0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @081CAD10 movs r0, 0 b @081CAD16 .align 2, 0 .pool @081CAD10: ldr r0, =sub_81CAB44 str r0, [r2, 0x18] movs r0, 0xA @081CAD16: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CACF8 thumb_func_start sub_81CAD20 sub_81CAD20: ; 81CAD20 push {r4-r7,lr} adds r5, r0, 0 movs r0, 0x5 bl sub_81C763C adds r4, r0, 0 cmp r5, 0x1 beq @081CAD4C cmp r5, 0x1 bgt @081CAD3A cmp r5, 0 beq @081CAD44 b @081CAE00 @081CAD3A: cmp r5, 0x2 beq @081CAD9C cmp r5, 0x3 beq @081CADFC b @081CAE00 @081CAD44: strh r5, [r4, 0x8] strh r5, [r4, 0xA] @081CAD48: movs r0, 0x1 b @081CAE02 @081CAD4C: movs r6, 0 ldrh r5, [r4, 0x8] @081CAD50: adds r0, r5, 0 bl sub_81D15F4 cmp r0, 0 beq @081CAD80 ldrh r0, [r4, 0xA] lsls r0, 2 adds r0, r4, r0 strh r5, [r0, 0x1E] ldrh r0, [r4, 0xA] lsls r0, 2 adds r0, r4, r0 movs r1, 0x1 strb r1, [r0, 0x1C] adds r0, r5, 0 bl sub_81D16DC ldrh r1, [r4, 0xA] lsls r1, 2 adds r1, r4, r1 strb r0, [r1, 0x1D] ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] @081CAD80: ldrh r0, [r4, 0x8] adds r1, r0, 0x1 movs r2, 0 strh r1, [r4, 0x8] lsls r0, r1, 16 lsrs r0, 16 cmp r0, 0x14 bhi @081CADF6 adds r6, 0x1 adds r5, 0x1 cmp r6, 0x1D ble @081CAD50 movs r0, 0x3 b @081CAE02 @081CAD9C: movs r6, 0 ldrh r5, [r4, 0x8] movs r7, 0 @081CADA2: ldrh r0, [r4, 0x8] bl sub_81D1BF8 cmp r0, 0 bne @081CADDC ldrh r0, [r4, 0x8] bl sub_81CAE08 cmp r0, 0 beq @081CADDC ldrh r0, [r4, 0xA] lsls r0, 2 adds r0, r4, r0 ldrh r1, [r4, 0x8] strh r1, [r0, 0x1E] ldrh r0, [r4, 0xA] lsls r0, 2 adds r0, r4, r0 strb r7, [r0, 0x1C] adds r0, r5, 0 bl sub_81CB0C8 ldrh r1, [r4, 0xA] lsls r1, 2 adds r1, r4, r1 strb r0, [r1, 0x1D] ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] @081CADDC: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] lsls r0, 16 lsrs r0, 16 cmp r0, 0x4D bhi @081CAD48 adds r6, 0x1 adds r5, 0x1 cmp r6, 0x1D ble @081CADA2 movs r0, 0x3 b @081CAE02 @081CADF6: strh r1, [r4, 0xC] strh r2, [r4, 0x8] b @081CAD48 @081CADFC: movs r0, 0x1 str r0, [r4, 0x10] @081CAE00: movs r0, 0x4 @081CAE02: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81CAD20 thumb_func_start sub_81CAE08 sub_81CAE08: ; 81CAE08 push {lr} cmp r0, 0x4D ble @081CAE12 movs r0, 0 b @081CAE24 @081CAE12: movs r1, 0xAE lsls r1, 1 adds r0, r1 lsls r0, 16 lsrs r0, 16 bl 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, =0x03005d8c ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 adds r0, r4 ldrb r1, [r0] negs r0, r1 orrs r0, r1 lsrs r0, 31 b @081CAEFE .align 2, 0 .pool @081CAEFC: movs r0, 0 @081CAEFE: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CAEBC thumb_func_start sub_81CAF04 sub_81CAF04: ; 81CAF04 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x5 bl sub_81C763C lsls r1, r4, 2 adds r1, r0, r1 ldrb r0, [r1, 0x1C] cmp r0, 0 bne @081CAF34 ldrh r0, [r1, 0x1E] bl sub_81D15BC adds r4, r0, 0 ldr r1, =gTrainers lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldrb r0, [r0, 0x3] b @081CAF6C .align 2, 0 .pool @081CAF34: ldrh r5, [r1, 0x1E] adds r0, r5, 0 bl sub_81D1854 adds r4, r0, 0 cmp r4, 0x4E bne @081CAF58 adds r0, r5, 0 bl sub_81D1BD0 adds r4, r0, 0 ldr r0, =gUnknown_0831F578 adds r0, r4, r0 ldrb r0, [r0] b @081CAF6C .align 2, 0 .pool @081CAF58: adds r0, r4, 0 bl sub_81D15BC adds r4, r0, 0 ldr r0, =gTrainers lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldrb r0, [r1, 0x3] @081CAF6C: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CAF04 thumb_func_start sub_81CAF78 sub_81CAF78: ; 81CAF78 push {r4-r6,lr} adds r5, r0, 0 adds r6, r1, 0 movs r0, 0x5 bl sub_81C763C adds r4, r0, 0 movs r0, 0 strb r0, [r6] ldr r0, =0x02037318 ldrb r0, [r0, 0x17] bl is_light_level_1_2_3_or_6 lsls r0, 24 cmp r0, 0 bne @081CAFA4 ldr r0, =gUnknown_085EEB0B b @081CAFCE .align 2, 0 .pool @081CAFA4: lsls r0, r5, 2 adds r1, r4, r0 ldrb r0, [r1, 0x1C] cmp r0, 0 bne @081CAFC4 ldrh r0, [r1, 0x1E] bl sub_81D15BC ldr r1, =0x02021fc4 bl sub_81967AC strb r0, [r6] b @081CAFCC .align 2, 0 .pool @081CAFC4: ldrh r0, [r1, 0x1E] ldr r1, =0x02021fc4 bl sub_81D189C @081CAFCC: ldr r0, =0x02021fc4 @081CAFCE: pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CAF78 thumb_func_start sub_81CAFD8 sub_81CAFD8: ; 81CAFD8 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 movs r0, 0x5 bl sub_81C763C lsls r4, 2 adds r4, r0, r4 ldrb r0, [r4, 0x1C] cmp r0, 0 beq @081CB004 ldrh r0, [r4, 0x1E] bl sub_81D1854 adds r1, r0, 0 cmp r1, 0x4E bne @081CB006 ldrh r0, [r4, 0x1E] adds r1, r5, 0 bl sub_81D1B40 b @081CB012 @081CB004: ldrh r1, [r4, 0x1E] @081CB006: ldr r2, =gUnknown_08622028 lsls r0, r5, 2 lsls r1, 4 adds r0, r1 adds r0, r2 ldr r0, [r0] @081CB012: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CAFD8 thumb_func_start sub_81CB01C sub_81CB01C: ; 81CB01C push {lr} movs r0, 0x5 bl sub_81C763C ldrh r0, [r0] pop {r1} bx r1 thumb_func_end sub_81CB01C thumb_func_start sub_81CB02C sub_81CB02C: ; 81CB02C push {r4,lr} adds r4, r0, 0 movs r0, 0x5 bl sub_81C763C adds r1, r0, 0 ldrh r0, [r1, 0x2] cmp r0, r4 blt @081CB046 ldr r0, [r1, 0x4] adds r0, r4 ldrb r0, [r0] b @081CB048 @081CB046: movs r0, 0x3 @081CB048: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CB02C thumb_func_start sub_81CB050 sub_81CB050: ; 81CB050 push {r4,lr} sub sp, 0x8 adds r2, r0, 0 adds r4, r1, 0 ldrb r0, [r2] cmp r0, 0 bne @081CB088 ldrh r0, [r2, 0x2] bl sub_81D15BC lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =gTrainers adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0xD muls r0, r2 ldr r2, =gTrainerClassNames adds r0, r2 str r0, [sp] adds r1, 0x4 str r1, [sp, 0x4] b @081CB092 .align 2, 0 .pool @081CB088: ldrh r0, [r2, 0x2] add r2, sp, 0x4 mov r1, sp bl sub_81D1A78 @081CB092: ldr r2, [sp] cmp r2, 0 beq @081CB0B4 ldr r0, [sp, 0x4] cmp r0, 0 beq @081CB0B4 adds r0, r4, 0 movs r1, 0x7 movs r3, 0x45 bl sub_81DB494 ldr r2, [sp, 0x4] movs r1, 0x7 movs r3, 0x33 bl sub_81DB494 b @081CB0C0 @081CB0B4: adds r0, r4, 0 movs r1, 0x7 movs r2, 0 movs r3, 0x78 bl sub_81DB494 @081CB0C0: add sp, 0x8 pop {r4} pop {r0} bx r0 thumb_func_end sub_81CB050 thumb_func_start sub_81CB0C8 sub_81CB0C8: ; 81CB0C8 push {lr} ldr r1, =gUnknown_085500A4 lsls r0, 4 adds r0, r1 ldrh r2, [r0, 0xA] ldrh r1, [r0, 0xC] adds r0, r2, 0 bl get_mapheader_by_bank_and_number ldrb r0, [r0, 0x14] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CB0C8 thumb_func_start sub_81CB0E4 sub_81CB0E4: ; 81CB0E4 push {r4-r7,lr} adds r5, r0, 0 movs r0, 0x5 bl sub_81C763C adds r7, r0, 0 movs r6, 0x1 adds r5, 0x1 ldrh r0, [r7, 0xA] cmp r5, r0 bge @081CB120 lsls r0, r5, 2 adds r0, 0x1C adds r4, r0, r7 @081CB100: ldrb r0, [r4] cmp r0, 0 beq @081CB110 ldrh r0, [r4, 0x2] bl sub_81D17E8 cmp r0, 0 beq @081CB114 @081CB110: adds r0, r6, 0 b @081CB122 @081CB114: adds r6, 0x1 adds r4, 0x4 adds r5, 0x1 ldrh r0, [r7, 0xA] cmp r5, r0 blt @081CB100 @081CB120: movs r0, 0 @081CB122: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81CB0E4 thumb_func_start sub_81CB128 sub_81CB128: ; 81CB128 push {r4-r6,lr} adds r5, r0, 0 movs r0, 0x5 bl sub_81C763C adds r1, r0, 0 movs r6, 0x1 negs r6, r6 subs r5, 0x1 cmp r5, 0 blt @081CB162 lsls r0, r5, 2 adds r0, 0x1C adds r4, r0, r1 @081CB144: ldrb r0, [r4] cmp r0, 0 beq @081CB154 ldrh r0, [r4, 0x2] bl sub_81D17E8 cmp r0, 0 beq @081CB158 @081CB154: adds r0, r6, 0 b @081CB164 @081CB158: subs r6, 0x1 subs r4, 0x4 subs r5, 0x1 cmp r5, 0 bge @081CB144 @081CB162: movs r0, 0 @081CB164: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81CB128 thumb_func_start sub_81CB16C sub_81CB16C: ; 81CB16C push {r4,lr} movs r4, 0 @081CB170: adds r0, r4, 0 bl sub_81CAE08 cmp r0, 0 beq @081CB18A ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 adds r0, r4 ldrb r0, [r0] cmp r0, 0 bne @081CB1B2 @081CB18A: adds r4, 0x1 cmp r4, 0x4D ble @081CB170 movs r4, 0 @081CB192: adds r0, r4, 0 bl sub_81D15F4 cmp r0, 0 beq @081CB1C0 adds r0, r4, 0 bl sub_81D1854 ldr r1, =0x03005d8c ldr r1, [r1] ldr r2, =0x000009ca adds r1, r2 adds r1, r0 ldrb r0, [r1] cmp r0, 0 beq @081CB1C0 @081CB1B2: movs r0, 0x1 b @081CB1C8 .align 2, 0 .pool @081CB1C0: adds r4, 0x1 cmp r4, 0x14 ble @081CB192 movs r0, 0 @081CB1C8: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CB16C thumb_func_start sub_81CB1D0 sub_81CB1D0: ; 81CB1D0 push {r4,lr} movs r0, 0x5 bl sub_81C763C adds r4, r0, 0 bl sub_81C875C adds r1, r0, 0 lsls r0, r1, 2 adds r4, r0 ldrb r0, [r4, 0x1C] cmp r0, 0 bne @081CB218 adds r0, r1, 0 bl sub_81CAEA4 ldr r1, =0x02037318 lsls r0, 16 lsrs r0, 16 ldrb r1, [r1, 0x14] cmp r0, r1 bne @081CB258 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 ldrh r4, [r4, 0x1E] adds r0, r4 ldrb r0, [r0] b @081CB246 .align 2, 0 .pool @081CB218: ldrh r0, [r4, 0x1E] cmp r0, 0xB bne @081CB258 adds r0, r1, 0 bl sub_81CAEA4 ldr r1, =0x02037318 lsls r0, 16 lsrs r0, 16 ldrb r1, [r1, 0x14] cmp r0, r1 bne @081CB258 ldr r0, =0x0000086b bl 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 .pool @081CB258: movs r0, 0 @081CB25A: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CB1D0 thumb_func_start sub_81CB260 sub_81CB260: ; 81CB260 push {r4,lr} ldr r1, =0x00002048 movs r0, 0x6 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CB294 movs r0, 0 strb r0, [r4, 0x19] ldr r0, =sub_81CB324 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] ldr r0, =sub_81CB310 str r0, [r4] movs r0, 0x1 b @081CB296 .align 2, 0 .pool @081CB294: movs r0, 0 @081CB296: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CB260 thumb_func_start sub_81CB29C sub_81CB29C: ; 81CB29C push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x6 bl sub_81C763C adds r5, r0, 0 ldr r0, =gUnknown_08622798 lsls r4, 2 adds r4, r0 ldr r0, [r4] movs r1, 0x1 bl sub_81C7078 str r0, [r5, 0x4] ldr r0, =sub_81CB310 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CB29C thumb_func_start sub_81CB2CC sub_81CB2CC: ; 81CB2CC push {lr} movs r0, 0x6 bl sub_81C763C ldr r0, [r0] bl _call_via_r0 pop {r1} bx r1 thumb_func_end sub_81CB2CC thumb_func_start sub_81CB2E0 sub_81CB2E0: ; 81CB2E0 push {r4,lr} movs r0, 0x6 bl sub_81C763C adds r4, r0, 0 bl sub_81CC2B4 bl sub_81CBC1C ldrb r0, [r4, 0x12] bl 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, =@081CB348 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CB348: .4byte @081CB368 .4byte @081CB3D4 .4byte @081CB424 .4byte @081CB468 .4byte @081CB482 .4byte @081CB494 .4byte @081CB4A6 .4byte @081CB4EA @081CB368: ldr r0, =gUnknown_0862278C movs r1, 0x3 bl sub_81C7B54 movs r0, 0x2 movs r1, 0 movs r2, 0 bl bg_change_x_offset movs r0, 0x2 movs r1, 0 movs r2, 0 bl bg_change_y_offset ldr r1, =gUnknown_08622530 movs r0, 0 str r0, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r0, =0x00001024 adds r1, r5, r0 movs r0, 0x2 bl bg_set_tilemap ldr r1, =gUnknown_086225D4 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, =gUnknown_08622510 movs r1, 0x20 movs r2, 0x20 bl sub_81C7944 movs r0, 0x2 b @081CB418 .align 2, 0 .pool @081CB3D4: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 beq @081CB3E0 b @081CB4FA @081CB3E0: movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0x1 bl sub_8199DF0 adds r1, r5, 0 adds r1, 0x24 movs r0, 0x1 bl 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, =gUnknown_086226E0 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 .pool @081CB424: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @081CB4FA adds r0, r5, 0 bl sub_81CC034 ldr r1, =gUnknown_08622760 str r4, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r0, =gUnknown_08622700 movs r1, 0x30 movs r2, 0x20 bl sub_81C7944 ldr r0, =gUnknown_08622720 movs r1, 0x50 movs r2, 0x20 bl sub_81C7944 movs r0, 0 b @081CB506 .align 2, 0 .pool @081CB468: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081CB4FA bl sub_81CAE28 cmp r0, 0 beq @081CB4FA bl sub_81CBBB8 movs r0, 0 b @081CB506 @081CB482: bl sub_81C8224 cmp r0, 0 bne @081CB4FA adds r0, r5, 0 bl sub_81CBD78 movs r0, 0 b @081CB506 @081CB494: adds r0, r5, 0 bl sub_81CBDC0 adds r0, r5, 0 movs r1, 0 bl sub_81CBEF8 movs r0, 0 b @081CB506 @081CB4A6: movs r0, 0x1 movs r1, 0 movs r2, 0 bl 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, =0x00000107 bl audio_play strb r4, [r5, 0xE] movs r0, 0 b @081CB81C .align 2, 0 .pool @081CB7F8: adds r0, r5, 0 bl sub_81CC104 cmp r0, 0 bne @081CB816 adds r0, r5, 0 bl sub_81CC158 movs r0, 0 b @081CB81C @081CB80C: adds r0, r5, 0 bl sub_81CC194 cmp r0, 0 beq @081CB81A @081CB816: movs r0, 0x2 b @081CB81C @081CB81A: movs r0, 0x4 @081CB81C: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CB7A0 thumb_func_start sub_81CB824 sub_81CB824: ; 81CB824 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x6 bl sub_81C763C adds r5, r0, 0 cmp r4, 0x1 beq @081CB85E cmp r4, 0x1 bgt @081CB83E cmp r4, 0 beq @081CB844 b @081CB880 @081CB83E: cmp r4, 0x2 beq @081CB872 b @081CB880 @081CB844: movs r0, 0x5 bl audio_play adds r0, r5, 0 bl sub_81CC09C movs r0, 0x1 bl sub_81C9148 movs r0, 0x1 strb r0, [r5, 0xE] movs r0, 0 b @081CB882 @081CB85E: adds r0, r5, 0 bl sub_81CC0D0 cmp r0, 0 bne @081CB87C adds r0, r5, 0 bl sub_81CC11C movs r0, 0 b @081CB882 @081CB872: adds r0, r5, 0 bl sub_81CC140 cmp r0, 0 beq @081CB880 @081CB87C: movs r0, 0x2 b @081CB882 @081CB880: movs r0, 0x4 @081CB882: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CB824 thumb_func_start sub_81CB888 sub_81CB888: ; 81CB888 push {r4-r6,lr} adds r5, r0, 0 movs r0, 0x6 bl sub_81C763C adds r4, r0, 0 movs r6, 0 cmp r5, 0x6 bhi @081CB934 lsls r0, r5, 2 ldr r1, =@081CB8A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CB8A8: .4byte @081CB8C4 .4byte @081CB8DA .4byte @081CB8E2 .4byte @081CB8F0 .4byte @081CB8F8 .4byte @081CB90C .4byte @081CB922 @081CB8C4: ldrb r0, [r4, 0xE] cmp r0, 0 bne @081CB8D2 movs r0, 0x84 lsls r0, 1 bl audio_play @081CB8D2: movs r0, 0x5 bl audio_play b @081CB934 @081CB8DA: adds r0, r4, 0 bl sub_81CC1DC b @081CB934 @081CB8E2: adds r0, r4, 0 bl sub_81CC204 cmp r0, 0 beq @081CB934 @081CB8EC: movs r6, 0x2 b @081CB934 @081CB8F0: adds r0, r4, 0 bl sub_81CBFF0 b @081CB934 @081CB8F8: adds r0, r4, 0 bl sub_81CC004 cmp r0, 0 beq @081CB904 movs r6, 0x2 @081CB904: movs r0, 0x6 bl sub_81C7BA4 b @081CB934 @081CB90C: bl sub_81C7BE8 cmp r0, 0 bne @081CB8EC ldrb r0, [r4, 0xF] cmp r0, 0 beq @081CB92C bl sub_81C8838 movs r6, 0x1 b @081CB934 @081CB922: bl 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, =@081CB9E8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CB9E8: .4byte @081CB9FC .4byte @081CBA1C .4byte @081CBA34 .4byte @081CBA40 .4byte @081CBA4A @081CB9FC: bl sub_81C8770 bl sub_81CB0E4 adds r5, r0, 0 cmp r5, 0 beq @081CBA60 movs r0, 0x5 bl audio_play strh r5, [r4, 0x16] adds r0, r4, 0 bl sub_81CC420 movs r0, 0 b @081CBA62 @081CBA1C: adds r0, r4, 0 bl sub_81CC42C cmp r0, 0 bne @081CBA5C movs r0, 0x16 ldrsh r1, [r4, r0] adds r0, r4, 0 bl sub_81CBEF8 movs r0, 0 b @081CBA62 @081CBA34: movs r1, 0x16 ldrsh r0, [r4, r1] bl sub_81C87AC movs r0, 0 b @081CBA62 @081CBA40: adds r0, r4, 0 bl sub_81CC39C movs r0, 0 b @081CBA62 @081CBA4A: bl sub_81C8820 cmp r0, 0 bne @081CBA5C adds r0, r4, 0 bl sub_81CC42C cmp r0, 0 beq @081CBA60 @081CBA5C: movs r0, 0x2 b @081CBA62 @081CBA60: movs r0, 0x4 @081CBA62: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CB9C8 thumb_func_start sub_81CBA68 sub_81CBA68: ; 81CBA68 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x6 bl sub_81C763C adds r5, r0, 0 cmp r4, 0x1 beq @081CBA9C cmp r4, 0x1 bgt @081CBA82 cmp r4, 0 beq @081CBA88 b @081CBACC @081CBA82: cmp r4, 0x2 beq @081CBABE b @081CBACC @081CBA88: movs r0, 0x5 bl audio_play adds r0, r5, 0 bl sub_81CC420 bl sub_81C87F0 movs r0, 0 b @081CBACE @081CBA9C: bl sub_81C8820 cmp r0, 0 bne @081CBAC8 adds r0, r5, 0 bl sub_81CC42C cmp r0, 0 bne @081CBAC8 movs r0, 0x6 bl sub_81C7BA4 adds r0, r5, 0 bl sub_81CBDC0 movs r0, 0 b @081CBACE @081CBABE: bl 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, =@081CBAF4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CBAF4: .4byte @081CBB08 .4byte @081CBB28 .4byte @081CBB40 .4byte @081CBB4C .4byte @081CBB56 @081CBB08: bl sub_81C8770 bl sub_81CB128 adds r5, r0, 0 cmp r5, 0 beq @081CBB6C movs r0, 0x5 bl audio_play strh r5, [r4, 0x16] adds r0, r4, 0 bl sub_81CC420 movs r0, 0 b @081CBB6E @081CBB28: adds r0, r4, 0 bl sub_81CC42C cmp r0, 0 bne @081CBB68 movs r0, 0x16 ldrsh r1, [r4, r0] adds r0, r4, 0 bl sub_81CBEF8 movs r0, 0 b @081CBB6E @081CBB40: movs r1, 0x16 ldrsh r0, [r4, r1] bl sub_81C87AC movs r0, 0 b @081CBB6E @081CBB4C: adds r0, r4, 0 bl sub_81CC39C movs r0, 0 b @081CBB6E @081CBB56: bl sub_81C8820 cmp r0, 0 bne @081CBB68 adds r0, r4, 0 bl sub_81CC42C cmp r0, 0 beq @081CBB6C @081CBB68: movs r0, 0x2 b @081CBB6E @081CBB6C: movs r0, 0x4 @081CBB6E: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CBAD4 thumb_func_start sub_81CBB74 sub_81CBB74: ; 81CBB74 push {lr} cmp r0, 0 beq @081CBB80 cmp r0, 0x1 beq @081CBB9A b @081CBBB2 @081CBB80: movs r0, 0x5 bl audio_play movs r0, 0 bl sub_81CBC38 movs r0, 0 bl sub_81C7AC0 bl sub_81C78A0 movs r0, 0 b @081CBBB4 @081CBB9A: bl sub_81C7B34 cmp r0, 0 bne @081CBBAA bl sub_81C78C0 cmp r0, 0 beq @081CBBAE @081CBBAA: movs r0, 0x2 b @081CBBB4 @081CBBAE: bl sub_81C7FDC @081CBBB2: movs r0, 0x4 @081CBBB4: pop {r1} bx r1 thumb_func_end sub_81CBB74 thumb_func_start sub_81CBBB8 sub_81CBBB8: ; 81CBBB8 push {lr} sub sp, 0x18 bl sub_81CAE94 str r0, [sp] bl sub_81CAE38 mov r1, sp movs r2, 0 strh r0, [r1, 0x4] movs r0, 0x4 strb r0, [r1, 0x8] mov r0, sp strh r2, [r0, 0x6] movs r0, 0xD strb r0, [r1, 0x9] movs r0, 0x10 strb r0, [r1, 0xA] movs r0, 0x1 strb r0, [r1, 0xB] movs r0, 0x8 strb r0, [r1, 0xC] movs r0, 0x3 strb r0, [r1, 0xD] movs r0, 0x7 strb r0, [r1, 0xE] ldr r0, =sub_81CB050 str r0, [sp, 0x10] ldr r0, =sub_81CBCEC str r0, [sp, 0x14] ldr r0, =gUnknown_08622794 movs r2, 0x2 bl sub_81C81D4 ldr r0, =sub_81CBC64 movs r1, 0x7 bl AddTask add sp, 0x18 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CBBB8 thumb_func_start sub_81CBC1C sub_81CBC1C: ; 81CBC1C push {lr} bl sub_81C8234 ldr r0, =sub_81CBC64 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CBC1C thumb_func_start sub_81CBC38 sub_81CBC38: ; 81CBC38 push {r4,lr} adds r4, r0, 0 ldr r0, =sub_81CBC64 bl get_task_id_by_function lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0xFF beq @081CBC56 ldr r1, =0x03005e00 lsls r0, r2, 2 adds r0, r2 lsls r0, 3 adds r0, r1 strh r4, [r0, 0x26] @081CBC56: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CBC38 thumb_func_start sub_81CBC64 sub_81CBC64: ; 81CBC64 push {r4,lr} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r2, r1, r0 movs r1, 0x1E ldrsh r0, [r2, r1] cmp r0, 0 beq @081CBCC8 ldrh r0, [r2] adds r0, 0x4 movs r1, 0x7F ands r0, r1 strh r0, [r2] ldr r1, =gUnknown_08329F40 movs r3, 0 ldrsh r0, [r2, r3] lsls r0, 1 adds r0, r1 ldrh r0, [r0] lsls r0, 16 asrs r0, 20 strh r0, [r2, 0x2] ldr r0, =gUnknown_08622720 adds r1, r0, 0 adds r1, 0x20 movs r3, 0x2 ldrsh r2, [r2, r3] str r2, [sp] ldr r4, =0x020377b4 str r4, [sp, 0x4] movs r2, 0x10 movs r3, 0x10 bl sub_81C79BC ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081CBCC8 ldr r1, =0x02037bb4 ldr r2, =0x04000008 adds r0, r4, 0 bl CpuSet @081CBCC8: add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CBC64 thumb_func_start sub_81CBCEC sub_81CBCEC: ; 81CBCEC push {r4-r6,lr} adds r5, r1, 0 adds r4, r2, 0 lsls r0, 24 lsrs r0, 24 movs r1, 0 bl 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, =0x00005001 adds r0, r2, 0 strh r0, [r1] b @081CBD3C .align 2, 0 .pool @081CBD30: ldr r0, =0x00005002 adds r1, r0, 0 strh r1, [r6] adds r0, r6, 0 adds r0, 0x40 strh r1, [r0] @081CBD3C: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CBCEC thumb_func_start sub_81CBD48 sub_81CBD48: ; 81CBD48 push {r4,lr} adds r4, r1, 0 lsls r0, 24 lsrs r0, 24 movs r1, 0 bl Window_GetField lsls r0, 24 lsrs r0, 24 bl bg_get_tilemap lsls r4, 7 adds r4, 0x3A adds r0, r4 ldr r2, =0x00005002 adds r1, r2, 0 strh r1, [r0] adds r0, 0x40 strh r1, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CBD48 thumb_func_start sub_81CBD78 sub_81CBD78: ; 81CBD78 push {r4,lr} adds r4, r0, 0 ldr r0, =gUnknown_086227D8 bl Window_AddFromTemplate strh r0, [r4, 0x10] ldr r0, =gUnknown_086227E0 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 .pool thumb_func_end sub_81CBD78 thumb_func_start sub_81CBDC0 sub_81CBDC0: ; 81CBDC0 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4, 0x12] movs r1, 0x11 bl 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, =gUnknown_085EBE5F movs r2, 0 bl sub_81CBE88 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CBDF4 thumb_func_start sub_81CBE0C sub_81CBE0C: ; 81CBE0C push {r4,lr} sub sp, 0x4 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl sub_81CAE38 adds r1, r0, 0 mov r0, sp movs r2, 0 movs r3, 0x3 bl 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, =gUnknown_085EBE6E movs r2, 0x2 bl sub_81CBE88 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CBE38 thumb_func_start sub_81CBE50 sub_81CBE50: ; 81CBE50 push {r4,lr} sub sp, 0x8 lsls r0, 16 lsrs r4, r0, 16 movs r0, 0x9 bl sub_80847F8 adds r1, r0, 0 ldr r0, =0x0001869f cmp r1, r0 ble @081CBE68 adds r1, r0, 0 @081CBE68: mov r0, sp movs r2, 0 movs r3, 0x5 bl 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 .pool thumb_func_end sub_81CBE50 thumb_func_start sub_81CBE88 sub_81CBE88: ; 81CBE88 push {lr} sub sp, 0xC adds r3, r1, 0 lsls r2, 4 adds r2, 0x1 lsls r0, 24 lsrs r0, 24 lsls r2, 24 lsrs r2, 24 str r2, [sp] movs r1, 0xFF str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x7 adds r2, r3, 0 movs r3, 0x2 bl Print add sp, 0xC pop {r0} bx r0 thumb_func_end sub_81CBE88 thumb_func_start sub_81CBEB4 sub_81CBEB4: ; 81CBEB4 push {r4-r6,lr} sub sp, 0xC adds r5, r0, 0 adds r6, r1, 0 adds r4, r2, 0 lsls r5, 16 lsrs r5, 16 movs r0, 0x7 movs r2, 0x56 bl 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, =gUnknown_085EC00F 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 .pool thumb_func_end sub_81CBEF8 thumb_func_start sub_81CBF60 sub_81CBF60: ; 81CBF60 push {r4-r6,lr} sub sp, 0xC adds r5, r0, 0 ldrb r0, [r5, 0x12] movs r1, 0x11 bl Window_FastFillPixels movs r4, 0 movs r6, 0x80 lsls r6, 17 b @081CBF9C @081CBF76: ldrb r0, [r5, 0x12] ldr r2, =gUnknown_086227E8 lsls r1, 2 adds r1, r2 ldr r2, [r1] lsrs r1, r6, 24 str r1, [sp] movs r1, 0xFF str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x7 movs r3, 0x10 bl Print movs r0, 0x80 lsls r0, 21 adds r6, r0 adds r4, 0x1 @081CBF9C: cmp r4, 0x2 bhi @081CBFAE adds r0, r4, 0 bl sub_81CB02C lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0x3 bne @081CBF76 @081CBFAE: ldrb r0, [r5, 0x12] movs r1, 0x2 bl Window_CopyToVram add sp, 0xC pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08622808 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 .pool thumb_func_end sub_81CC034 thumb_func_start sub_81CC058 sub_81CC058: ; 81CC058 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x14] movs r1, 0x1 movs r2, 0x4 bl sub_8197184 ldrh r0, [r4, 0x14] movs r1, 0x1 movs r2, 0x4 bl sub_81971C4 ldrb r0, [r4, 0x14] movs r1, 0x11 bl 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, =gUnknown_086227F4 movs r1, 0x1 str r1, [sp] str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0x20 bl Print add sp, 0xC pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_085EBF95 movs r1, 0x1 str r1, [sp] str r1, [sp, 0x4] movs r1, 0 str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print add sp, 0xC pop {r0} bx r0 .align 2, 0 .pool 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, =0x030022c0 ldrh r1, [r0, 0x2C] movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081CC1B8 ldr r0, =0x03003014 ldrb r1, [r0] movs r2, 0x1 orrs r1, r2 strb r1, [r0] b @081CC1C4 .align 2, 0 .pool @081CC1B8: ldr r2, =0x03003014 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 .pool thumb_func_end sub_81CC194 thumb_func_start sub_81CC1DC sub_81CC1DC: ; 81CC1DC push {lr} sub sp, 0x8 bl sub_81C7CE4 movs r0, 0x20 str r0, [sp] movs r0, 0x14 str r0, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =gUnknown_08622810 @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, =gUnknown_08622818 bl sub_81C795C movs r0, 0 str r0, [r6, 0x1C] ldr r1, =0x00001828 adds r0, r6, r1 str r0, [sp] ldr r1, =0xffff0000 ldr r0, [sp, 0x4] ands r0, r1 movs r1, 0x80 lsls r1, 4 orrs r0, r1 ldr r1, =0x0000ffff ands r0, r1 movs r1, 0x80 lsls r1, 12 orrs r0, r1 str r0, [sp, 0x4] mov r0, sp bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r2, =0x00001824 adds r1, r6, r2 lsls r0, 16 lsrs r0, 11 ldr r2, =0x06010000 adds r0, r2 str r0, [r1] movs r0, 0xD bl 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 .pool thumb_func_end sub_81CC214 thumb_func_start sub_81CC2B4 sub_81CC2B4: ; 81CC2B4 push {r4,lr} movs r0, 0x6 bl sub_81C763C adds r4, r0, 0 ldr r0, [r4, 0x1C] cmp r0, 0 beq @081CC2C8 bl 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, =gUnknown_08622830 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, =0x02020630 adds r1, r0 str r1, [r4, 0x1C] adds r0, r4, 0 adds r1, r5, 0 bl sub_81CC344 @081CC320: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CC2F0 thumb_func_start sub_81CC330 sub_81CC330: ; 81CC330 push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0x1C] bl 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, =gUnknown_08622850 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, =0x02020630 adds r0, r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CC370 thumb_func_start sub_81CC39C sub_81CC39C: ; 81CC39C push {r4-r7,lr} adds r7, r0, 0 bl sub_81C875C bl sub_81CAF04 cmp r0, 0 blt @081CC400 lsls r4, r0, 3 ldr r0, =gTrainerPicTable adds r0, r4, r0 ldr r1, =0x00001828 adds r5, r7, r1 adds r1, r5, 0 movs r2, 0 bl sub_80345F0 ldr r0, =gTrainerPaletteTable adds r4, r0 ldr r0, [r4] ldr r1, =0x00002028 adds r6, r7, r1 adds r1, r6, 0 bl LZ77UnCompWram ldr r1, =0x00001824 adds r0, r7, r1 ldr r1, [r0] movs r2, 0x80 lsls r2, 4 adds r0, r5, 0 movs r3, 0x1 bl RequestDma3Copy adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldrh r1, [r7, 0x1A] adds r0, r6, 0 movs r2, 0x20 bl gpu_pal_apply ldr r1, [r7, 0x20] movs r0, 0 strh r0, [r1, 0x2E] ldr r0, [r7, 0x20] strh r4, [r0, 0x3C] ldr r1, [r7, 0x20] ldr r0, =sub_81CC440 str r0, [r1, 0x1C] @081CC400: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CC39C thumb_func_start sub_81CC420 sub_81CC420: ; 81CC420 ldr r1, [r0, 0x20] ldr r0, =sub_81CC4A4 str r0, [r1, 0x1C] bx lr .align 2, 0 .pool thumb_func_end sub_81CC420 thumb_func_start sub_81CC42C sub_81CC42C: ; 81CC42C ldr r0, [r0, 0x20] ldr r1, [r0, 0x1C] ldr r0, =nullsub_12 eors r1, r0 negs r0, r1 orrs r0, r1 lsrs r0, 31 bx lr .align 2, 0 .pool thumb_func_end sub_81CC42C thumb_func_start sub_81CC440 sub_81CC440: ; 81CC440 push {r4,lr} adds r4, r0, 0 movs r1, 0x2E ldrsh r0, [r4, r1] cmp r0, 0 beq @081CC452 cmp r0, 0x1 beq @081CC484 b @081CC498 @081CC452: movs r1, 0x3C ldrsh r0, [r4, r1] bl CheckForSpaceForDma3Request lsls r0, 16 asrs r0, 16 movs r1, 0x1 negs r1, r1 cmp r0, r1 beq @081CC498 ldr r0, =0x0000ffb0 strh r0, [r4, 0x24] adds r2, r4, 0 adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] ldrh r0, [r4, 0x2E] adds r0, 0x1 strh r0, [r4, 0x2E] b @081CC498 .align 2, 0 .pool @081CC484: ldrh r0, [r4, 0x24] adds r0, 0x8 strh r0, [r4, 0x24] lsls r0, 16 cmp r0, 0 blt @081CC498 movs r0, 0 strh r0, [r4, 0x24] ldr r0, =nullsub_12 str r0, [r4, 0x1C] @081CC498: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CC440 thumb_func_start sub_81CC4A4 sub_81CC4A4: ; 81CC4A4 push {lr} adds r3, r0, 0 ldrh r0, [r3, 0x24] subs r0, 0x8 strh r0, [r3, 0x24] lsls r0, 16 asrs r0, 16 movs r1, 0x50 negs r1, r1 cmp r0, r1 bgt @081CC4CA adds r2, r3, 0 adds r2, 0x3E ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] ldr r0, =nullsub_12 str r0, [r3, 0x1C] @081CC4CA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CC4A4 thumb_func_start sub_81CC4D4 sub_81CC4D4: ; 81CC4D4 push {r4,lr} movs r0, 0x3 movs r1, 0x14 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CC4F0 ldr r1, =0x00000884 movs r0, 0x10 bl sub_81C761C cmp r0, 0 bne @081CC4F8 @081CC4F0: movs r0, 0 b @081CC51A .align 2, 0 .pool @081CC4F8: ldr r0, =0x02037318 ldrb r0, [r0, 0x14] bl sub_8124668 str r0, [r4, 0xC] cmp r0, 0 bne @081CC514 ldr r0, =sub_81CC568 b @081CC516 .align 2, 0 .pool @081CC514: ldr r0, =sub_81CC5B4 @081CC516: str r0, [r4, 0x10] movs r0, 0x1 @081CC51A: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CC4D4 thumb_func_start sub_81CC524 sub_81CC524: ; 81CC524 push {lr} bl sub_8124658 ldr r1, =0x03005d90 ldr r3, [r1] movs r1, 0x1 ands r1, r0 lsls r1, 3 ldrb r2, [r3, 0x15] movs r0, 0x9 negs r0, r0 ands r0, r2 orrs r0, r1 strb r0, [r3, 0x15] movs r0, 0x10 bl sub_81C7650 movs r0, 0x3 bl sub_81C7650 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CC524 thumb_func_start sub_81CC554 sub_81CC554: ; 81CC554 push {lr} movs r0, 0x3 bl sub_81C763C ldr r1, [r0, 0x10] bl _call_via_r1 pop {r1} bx r1 thumb_func_end sub_81CC554 thumb_func_start sub_81CC568 sub_81CC568: ; 81CC568 push {r4,lr} adds r4, r0, 0 bl sub_81230AC lsls r0, 24 lsrs r0, 24 cmp r0, 0x4 beq @081CC58C cmp r0, 0x4 bgt @081CC582 cmp r0, 0x3 beq @081CC588 b @081CC5AC @081CC582: cmp r0, 0x5 beq @081CC59E b @081CC5AC @081CC588: movs r0, 0x1 b @081CC5AE @081CC58C: bl sub_8124658 lsls r0, 24 cmp r0, 0 bne @081CC59A movs r0, 0x3 b @081CC5AE @081CC59A: movs r0, 0x2 b @081CC5AE @081CC59E: ldr r0, =sub_81CC5DC str r0, [r4, 0x10] movs r0, 0x4 b @081CC5AE .align 2, 0 .pool @081CC5AC: movs r0, 0 @081CC5AE: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CC568 thumb_func_start sub_81CC5B4 sub_81CC5B4: ; 81CC5B4 push {lr} adds r2, r0, 0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081CC5CC movs r0, 0 b @081CC5D2 .align 2, 0 .pool @081CC5CC: ldr r0, =sub_81CC5DC str r0, [r2, 0x10] movs r0, 0x4 @081CC5D2: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CC5B4 thumb_func_start sub_81CC5DC sub_81CC5DC: ; 81CC5DC ldr r0, =0x000186a1 bx lr .align 2, 0 .pool thumb_func_end sub_81CC5DC thumb_func_start sub_81CC5E4 sub_81CC5E4: ; 81CC5E4 push {lr} movs r0, 0x3 bl sub_81C763C ldr r0, [r0, 0xC] pop {r1} bx r1 thumb_func_end sub_81CC5E4 thumb_func_start sub_81CC5F4 sub_81CC5F4: ; 81CC5F4 push {r4,lr} ldr r1, =0x00001948 movs r0, 0x4 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CC624 ldr r0, =sub_81CC6F4 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] ldr r0, =sub_81CC6BC str r0, [r4] movs r0, 0x1 b @081CC626 .align 2, 0 .pool @081CC624: movs r0, 0 @081CC626: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CC5F4 thumb_func_start sub_81CC62C sub_81CC62C: ; 81CC62C push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x4 bl sub_81C763C adds r5, r0, 0 ldr r0, =gUnknown_086230E4 lsls r4, 2 adds r4, r0 ldr r0, [r4] movs r1, 0x1 bl sub_81C7078 str r0, [r5, 0x4] ldr r0, =sub_81CC6BC str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CC62C thumb_func_start sub_81CC65C sub_81CC65C: ; 81CC65C push {lr} movs r0, 0x4 bl sub_81C763C ldr r0, [r0] bl _call_via_r0 pop {r1} bx r1 thumb_func_end sub_81CC65C thumb_func_start sub_81CC670 sub_81CC670: ; 81CC670 push {r4,lr} movs r0, 0x4 bl sub_81C763C adds r4, r0, 0 bl sub_812305C bl sub_81CC9EC ldrb r0, [r4, 0x8] bl 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, =0x03005d90 ldr r0, [r0] ldrb r0, [r0, 0x15] lsrs r0, 3 movs r1, 0x1 ands r0, r1 b @081CC6EE .align 2, 0 .pool @081CC6EC: movs r0, 0 @081CC6EE: pop {r1} bx r1 thumb_func_end sub_81CC6D0 thumb_func_start sub_81CC6F4 sub_81CC6F4: ; 81CC6F4 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x4 bl sub_81C763C adds r5, r0, 0 cmp r4, 0x7 bls @081CC706 b @081CC83E @081CC706: lsls r0, r4, 2 ldr r1, =@081CC714 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CC714: .4byte @081CC734 .4byte @081CC784 .4byte @081CC7B6 .4byte @081CC7BE .4byte @081CC7CE .4byte @081CC7E2 .4byte @081CC804 .4byte @081CC82A @081CC734: movs r0, 0 bl c3args_set_0toR1_1to0 movs r0, 0x1 bl 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, =gUnknown_086230D8 adds r0, r4, 0 movs r1, 0x2 bl sub_81C7B54 movs r0, 0x10 bl sub_81C763C adds r5, r0, 0 adds r4, 0x4 bl sub_81CC6D0 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r5, 0 adds r1, r4, 0 bl sub_8122CF8 bl sub_81CC9C0 @081CC77C: movs r0, 0 b @081CC840 .align 2, 0 .pool @081CC784: bl sub_8122DB0 lsls r0, 24 cmp r0, 0 bne @081CC83A bl sub_81CC5E4 cmp r0, 0 bne @081CC7AC movs r0, 0x4 movs r1, 0x9 bl sub_8124288 movs r0, 0x5 movs r1, 0xA bl sub_81240D4 bl sub_812454C b @081CC77C @081CC7AC: movs r0, 0 movs r1, 0x6 bl sub_8123030 b @081CC77C @081CC7B6: bl sub_81CCD10 @081CC7BA: movs r0, 0x1 b @081CC840 @081CC7BE: bl sub_81CCD24 cmp r0, 0 bne @081CC83A adds r0, r5, 0 bl sub_81CCA1C b @081CC7BA @081CC7CE: bl sub_81CCAFC cmp r0, 0 bne @081CC83A adds r0, r5, 0 bl sub_81CCB0C bl sub_81C7B40 b @081CC77C @081CC7E2: adds r0, r5, 0 bl sub_81CCC4C cmp r0, 0 bne @081CC83A movs r0, 0x1 bl gpu_sync_bg_show movs r0, 0x2 bl gpu_sync_bg_show ldr r0, =sub_81CC6A4 bl c3args_set_0toR1_1to0 b @081CC77C .align 2, 0 .pool @081CC804: bl sub_81CC6D0 lsls r0, 24 movs r4, 0x5 cmp r0, 0 bne @081CC812 movs r4, 0x4 @081CC812: adds r0, r4, 0 bl sub_81C7DFC adds r0, r4, 0 movs r1, 0x1 movs r2, 0x1 bl sub_81C7FA0 movs r0, 0x1 bl sub_81C7AC0 b @081CC77C @081CC82A: bl sub_81C7B34 cmp r0, 0 bne @081CC83A bl sub_81C8010 cmp r0, 0 beq @081CC7BA @081CC83A: movs r0, 0x2 b @081CC840 @081CC83E: movs r0, 0x4 @081CC840: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CC6F4 thumb_func_start sub_81CC848 sub_81CC848: ; 81CC848 push {r4,lr} adds r4, r0, 0 movs r0, 0x4 bl sub_81C763C cmp r4, 0 beq @081CC85C cmp r4, 0x1 beq @081CC864 b @081CC870 @081CC85C: bl sub_81CCB0C movs r0, 0 b @081CC872 @081CC864: bl sub_81CCC4C cmp r0, 0 beq @081CC870 movs r0, 0x2 b @081CC872 @081CC870: movs r0, 0x4 @081CC872: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CC848 thumb_func_start sub_81CC878 sub_81CC878: ; 81CC878 push {lr} cmp r0, 0x1 beq @081CC8A2 cmp r0, 0x1 bgt @081CC888 cmp r0, 0 beq @081CC88E b @081CC8D0 @081CC888: cmp r0, 0x2 beq @081CC8BE b @081CC8D0 @081CC88E: movs r0, 0x5 bl audio_play movs r0, 0 bl sub_81CCC5C bl sub_8123418 movs r0, 0 b @081CC8D2 @081CC8A2: bl sub_8123514 lsls r0, 24 cmp r0, 0 bne @081CC8C6 bl sub_81CCC88 cmp r0, 0 bne @081CC8C6 movs r0, 0x1 bl sub_81C7BA4 movs r0, 0 b @081CC8D2 @081CC8BE: bl sub_81C7BE8 cmp r0, 0 beq @081CC8CA @081CC8C6: movs r0, 0x2 b @081CC8D2 @081CC8CA: movs r0, 0x4 bl sub_81C7E14 @081CC8D0: movs r0, 0x4 @081CC8D2: pop {r1} bx r1 thumb_func_end sub_81CC878 thumb_func_start sub_81CC8D8 sub_81CC8D8: ; 81CC8D8 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x4 bl sub_81C763C adds r5, r0, 0 cmp r4, 0x1 beq @081CC90C cmp r4, 0x1 bgt @081CC8F2 cmp r4, 0 beq @081CC8FC b @081CC952 @081CC8F2: cmp r4, 0x2 beq @081CC924 cmp r4, 0x3 beq @081CC940 b @081CC952 @081CC8FC: movs r0, 0x5 bl audio_play adds r0, r5, 0 bl sub_81CCB0C movs r0, 0 b @081CC954 @081CC90C: adds r0, r5, 0 bl sub_81CCC4C cmp r0, 0 bne @081CC948 movs r0, 0x1 bl sub_81CCC5C bl sub_8123418 movs r0, 0 b @081CC954 @081CC924: bl sub_8123514 lsls r0, 24 cmp r0, 0 bne @081CC948 bl sub_81CCC88 cmp r0, 0 bne @081CC948 movs r0, 0x2 bl sub_81C7BA4 movs r0, 0 b @081CC954 @081CC940: bl sub_81C7BE8 cmp r0, 0 beq @081CC94C @081CC948: movs r0, 0x2 b @081CC954 @081CC94C: movs r0, 0x5 bl sub_81C7E14 @081CC952: movs r0, 0x4 @081CC954: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CC8D8 thumb_func_start sub_81CC95C sub_81CC95C: ; 81CC95C push {lr} cmp r0, 0x1 beq @081CC982 cmp r0, 0x1 bgt @081CC96C cmp r0, 0 beq @081CC972 b @081CC9B8 @081CC96C: cmp r0, 0x2 beq @081CC996 b @081CC9B8 @081CC972: movs r0, 0x5 bl audio_play movs r0, 0 bl sub_81C7AC0 movs r0, 0 b @081CC9BA @081CC982: bl sub_81C7B34 cmp r0, 0 bne @081CC99E bl sub_81C7FDC bl sub_81C78A0 movs r0, 0 b @081CC9BA @081CC996: bl sub_81C78C0 cmp r0, 0 beq @081CC9A2 @081CC99E: movs r0, 0x2 b @081CC9BA @081CC9A2: movs r0, 0x1 bl 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, =gUnknown_086230F8 @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, =gUnknown_08623100 bl sub_81C795C bl sub_81CCE58 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CC9C0 thumb_func_start sub_81CC9EC sub_81CC9EC: ; 81CC9EC push {r4,r5,lr} movs r0, 0x4 bl sub_81C763C adds r4, r0, 0 movs r0, 0x6 bl 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, =0x01000400 adds r0, r1, 0 adds r1, r4, 0 bl CpuSet movs r0, 0x1 adds r1, r4, 0 bl bg_set_tilemap ldr r0, =gUnknown_08623110 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, =gUnknown_08622888 str r4, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldrb r0, [r5, 0x8] movs r1, 0x11 bl Window_FastFillPixels ldrb r0, [r5, 0x8] bl Window_WriteStandardTileMap ldrb r0, [r5, 0x8] movs r1, 0x3 bl Window_CopyToVram ldr r0, =gUnknown_08622868 movs r1, 0x10 movs r2, 0x20 bl sub_81C7944 ldr r0, =gUnknown_08DC91E8 movs r1, 0x30 movs r2, 0x20 bl sub_81C7944 bl sub_8124658 lsls r0, 24 cmp r0, 0 bne @081CCAE0 ldr r1, =0xffffa000 movs r0, 0x1 movs r2, 0 bl bg_change_y_offset b @081CCAEA .align 2, 0 .pool @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, =@081CCB30 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .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, =0x00001041 movs r0, 0xC str r0, [sp] movs r0, 0xB str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0x1 movs r2, 0x11 movs r3, 0x6 bl Bg_FillWramTileMapRectWithTileAndPalette b @081CCC0C .align 2, 0 .pool @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, =0x00001041 movs r0, 0xC str r0, [sp] movs r0, 0xD str r0, [sp, 0x4] movs r0, 0x11 str r0, [sp, 0x8] movs r0, 0x1 movs r2, 0x11 movs r3, 0x4 bl 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 .pool 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, =sub_81CCC9C movs r1, 0x3 bl AddTask lsls r0, 24 lsrs r0, 24 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r1, r2 strh r4, [r1, 0x8] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CCC5C thumb_func_start sub_81CCC88 sub_81CCC88: ; 81CCC88 push {lr} ldr r0, =sub_81CCC9C bl is_function_an_active_task lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CCC88 thumb_func_start sub_81CCC9C sub_81CCC9C: ; 81CCC9C push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 movs r1, 0x8 ldrsh r0, [r0, r1] cmp r0, 0 beq @081CCCE0 movs r1, 0x90 lsls r1, 3 movs r0, 0x1 movs r2, 0x1 bl 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 .pool @081CCCE0: movs r1, 0x90 lsls r1, 3 movs r0, 0x1 movs r2, 0x2 bl bg_change_y_offset ldr r1, =0xffffa000 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 .pool thumb_func_end sub_81CCC9C thumb_func_start sub_81CCD10 sub_81CCD10: ; 81CCD10 push {lr} ldr r0, =sub_81CCD34 movs r1, 0x1 bl sub_81C7078 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CCD10 thumb_func_start sub_81CCD24 sub_81CCD24: ; 81CCD24 push {lr} ldr r0, =sub_81CCD34 bl sub_81C7124 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CCD24 thumb_func_start sub_81CCD34 sub_81CCD34: ; 81CCD34 push {r4,lr} adds r4, r0, 0 movs r0, 0x4 bl sub_81C763C adds r2, r0, 0 cmp r4, 0x15 ble @081CCD48 movs r0, 0x4 b @081CCD62 @081CCD48: ldr r0, =gUnknown_08623118 lsls r1, r4, 3 adds r0, 0x4 adds r1, r0 ldr r0, [r1] movs r1, 0xC8 muls r1, r4 ldr r3, =0x00000818 adds r1, r3 adds r1, r2, r1 bl LZ77UnCompWram movs r0, 0x1 @081CCD62: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CCD34 thumb_func_start sub_81CCD70 sub_81CCD70: ; 81CCD70 push {r4-r6,lr} sub sp, 0x8 adds r6, r0, 0 adds r3, r1, 0 movs r4, 0 ldr r0, =gUnknown_08623118 ldrh r1, [r0] adds r5, r0, 0 cmp r1, r3 bne @081CCD8A ldrh r0, [r5, 0x2] cmp r0, r2 beq @081CCDA0 @081CCD8A: adds r4, 0x1 cmp r4, 0x15 bgt @081CCDA0 lsls r0, r4, 3 adds r1, r0, r5 ldrh r0, [r1] cmp r0, r3 bne @081CCD8A ldrh r0, [r1, 0x2] cmp r0, r2 bne @081CCD8A @081CCDA0: cmp r4, 0x16 beq @081CCDD4 ldr r1, =0x00001041 movs r0, 0xC str r0, [sp] movs r0, 0xB str r0, [sp, 0x4] movs r0, 0x1 movs r2, 0x11 movs r3, 0x6 bl bg_fill_tilemap_rect movs r0, 0xC8 adds r1, r4, 0 muls r1, r0 ldr r0, =0x00000818 adds r1, r0 adds r1, r6, r1 movs r0, 0xA str r0, [sp] str r0, [sp, 0x4] movs r0, 0x1 movs r2, 0x12 movs r3, 0x6 bl gpu_copy_to_iwram_tile_map_rect @081CCDD4: add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CCD70 thumb_func_start sub_81CCDE8 sub_81CCDE8: ; 81CCDE8 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0xC mov r9, r0 movs r5, 0 ldr r6, =0x02021cc4 movs r4, 0x88 lsls r4, 21 lsls r1, 24 mov r8, r1 lsls r7, r2, 24 b @081CCE34 .align 2, 0 .pool @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, =gUnknown_086231D0 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, =0x02020630 adds r2, r0 movs r0, 0 strh r0, [r2, 0x2E] lsls r4, r5, 2 strh r4, [r2, 0x30] ldrh r3, [r2, 0x4] lsls r1, r3, 22 lsrs r0, r1, 22 adds r1, r0, 0 strh r0, [r2, 0x32] movs r0, 0x96 strh r0, [r2, 0x34] strh r4, [r2, 0x36] adds r1, r4 ldr r4, =0x000003ff adds r0, r4, 0 ands r1, r0 ldr r4, =0xfffffc00 adds r0, r4, 0 ands r3, r0 orrs r3, r1 strh r3, [r2, 0x4] mov r0, r8 adds r0, 0x4 mov r8, r0 subs r0, 0x4 stm r0!, {r2} movs r4, 0x80 lsls r4, 14 adds r6, r4 adds r5, 0x1 cmp r5, 0x2 ble @081CCE80 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CCE58 thumb_func_start sub_81CCEF4 sub_81CCEF4: ; 81CCEF4 push {r4,r5,lr} adds r3, r0, 0 ldrh r0, [r3, 0x34] movs r1, 0x34 ldrsh r4, [r3, r1] cmp r4, 0 beq @081CCF06 subs r0, 0x1 b @081CCF6E @081CCF06: ldrh r0, [r3, 0x2E] adds r0, 0x1 strh r0, [r3, 0x2E] lsls r0, 16 asrs r0, 16 cmp r0, 0xB ble @081CCF16 strh r4, [r3, 0x2E] @081CCF16: ldrh r0, [r3, 0x30] adds r0, 0x1 strh r0, [r3, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x3C ble @081CCF26 strh r4, [r3, 0x30] @081CCF26: ldrh r5, [r3, 0x30] ldrh r2, [r3, 0x32] adds r1, r5, r2 ldr r2, =0x000003ff adds r0, r2, 0 ands r1, r0 ldrh r2, [r3, 0x4] ldr r0, =0xfffffc00 ands r0, r2 orrs r0, r1 strh r0, [r3, 0x4] ldrh r1, [r3, 0x38] movs r2, 0x38 ldrsh r0, [r3, r2] cmp r0, 0x3 bgt @081CCF5C movs r2, 0x2E ldrsh r0, [r3, r2] cmp r0, 0 bne @081CCF70 adds r0, r1, 0x1 strh r0, [r3, 0x38] b @081CCF6C .align 2, 0 .pool @081CCF5C: lsls r0, r5, 16 asrs r0, 16 movs r2, 0x36 ldrsh r1, [r3, r2] cmp r0, r1 bne @081CCF70 strh r4, [r3, 0x38] strh r4, [r3, 0x2E] @081CCF6C: movs r0, 0x78 @081CCF6E: strh r0, [r3, 0x34] @081CCF70: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81CCEF4 thumb_func_start sub_81CCF78 sub_81CCF78: ; 81CCF78 push {r4,lr} movs r0, 0x4 bl sub_81C763C adds r4, r0, 0 movs r0, 0x1 bl 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, =0x0000678c movs r0, 0xB bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CD01C ldr r1, =0x00006428 adds r0, r4, r1 bl sub_81D1ED4 bl sub_81CD970 ldr r1, =0x030022b0 movs r0, 0x14 strh r0, [r1] ldr r0, =0x00006304 adds r1, r4, r0 ldr r0, =sub_81CD08C str r0, [r1] movs r0, 0x1 b @081CD01E .align 2, 0 .pool @081CD01C: movs r0, 0 @081CD01E: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CCFD8 thumb_func_start sub_81CD024 sub_81CD024: ; 81CD024 push {r4,lr} ldr r1, =0x0000678c movs r0, 0xB bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CD068 ldr r1, =0x00006428 adds r0, r4, r1 bl sub_81D1ED4 bl sub_81CD9F8 ldr r1, =0x030022b0 movs r0, 0x14 strh r0, [r1] ldr r0, =0x00006304 adds r1, r4, r0 ldr r0, =sub_81CD08C str r0, [r1] movs r0, 0x1 b @081CD06A .align 2, 0 .pool @081CD068: movs r0, 0 @081CD06A: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CD024 thumb_func_start sub_81CD070 sub_81CD070: ; 81CD070 push {lr} movs r0, 0xB bl sub_81C763C ldr r2, =0x00006304 adds r1, r0, r2 ldr r1, [r1] bl _call_via_r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CD070 thumb_func_start sub_81CD08C sub_81CD08C: ; 81CD08C push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x12 bl sub_81C763C adds r5, r0, 0 adds r0, r4, 0 bl sub_81CD1E4 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0 bne @081CD100 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081CD0D0 movs r0, 0x1 ands r0, r1 cmp r0, 0 beq @081CD100 movs r1, 0xC6 lsls r1, 7 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 bne @081CD0F0 ldrh r1, [r5, 0x2] ldrh r0, [r5] subs r0, 0x1 cmp r1, r0 bne @081CD100 @081CD0D0: movs r0, 0x5 bl audio_play ldr r0, =0x00006304 adds r1, r4, r0 ldr r0, =sub_81CD19C str r0, [r1] movs r2, 0x2 b @081CD100 .align 2, 0 .pool @081CD0F0: movs r0, 0x5 bl audio_play movs r2, 0x5 ldr r0, =0x00006304 adds r1, r4, r0 ldr r0, =sub_81CD110 str r0, [r1] @081CD100: adds r0, r2, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CD08C thumb_func_start sub_81CD110 sub_81CD110: ; 81CD110 push {r4-r6,lr} sub sp, 0x4 adds r6, r0, 0 movs r4, 0 bl sub_811FBA4 lsls r0, 24 cmp r0, 0 bne @081CD18A bl sub_81CEF14 ldr r1, =0x00006786 adds r5, r6, r1 movs r1, 0 ldrsb r1, [r5, r1] ldr r2, =0x00006783 adds r4, r6, r2 adds r1, r4, r1 strb r0, [r1] movs r0, 0x12 bl sub_81C763C ldrh r1, [r0, 0x2] lsls r1, 2 adds r0, r1 ldrb r2, [r0, 0x4] ldrb r3, [r0, 0x5] movs r0, 0 ldrsb r0, [r5, r0] adds r4, r0 ldrb r1, [r4] mov r0, sp strb r1, [r0] cmp r2, 0xE bne @081CD174 movs r0, 0x64 muls r0, r3 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x8 mov r2, sp bl pokemon_setattr b @081CD180 .align 2, 0 .pool @081CD174: adds r0, r2, 0 adds r1, r3, 0 movs r2, 0x8 mov r3, sp bl set_pokemon_data_from_any_box @081CD180: ldr r0, =0x00006304 adds r1, r6, r0 ldr r0, =sub_81CD08C str r0, [r1] movs r4, 0x6 @081CD18A: adds r0, r4, 0 add sp, 0x4 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CD110 thumb_func_start sub_81CD19C sub_81CD19C: ; 81CD19C push {lr} movs r1, 0xC6 lsls r1, 7 adds r0, r1 ldrb r0, [r0] cmp r0, 0 beq @081CD1B4 ldr r0, =0x000186aa b @081CD1B6 .align 2, 0 .pool @081CD1B4: ldr r0, =0x000186a2 @081CD1B6: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CD19C thumb_func_start sub_81CD1C0 sub_81CD1C0: ; 81CD1C0 push {lr} movs r0, 0xB bl sub_81C763C movs r1, 0xC6 lsls r1, 7 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @081CD1DA movs r0, 0x12 bl sub_81C7650 @081CD1DA: movs r0, 0xB bl sub_81C7650 pop {r0} bx r0 thumb_func_end sub_81CD1C0 thumb_func_start sub_81CD1E4 sub_81CD1E4: ; 81CD1E4 push {r4,lr} adds r4, r0, 0 movs r0, 0x12 bl sub_81C763C adds r2, r0, 0 movs r3, 0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x2C] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081CD220 movs r1, 0xC6 lsls r1, 7 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 beq @081CD210 ldrh r0, [r2, 0x2] cmp r0, 0 beq @081CD24E @081CD210: movs r0, 0x5 bl audio_play movs r0, 0x1 b @081CD246 .align 2, 0 .pool @081CD220: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081CD24E movs r1, 0xC6 lsls r1, 7 adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0 beq @081CD23E ldrh r1, [r2, 0x2] ldrh r0, [r2] subs r0, 0x1 cmp r1, r0 bge @081CD24E @081CD23E: movs r0, 0x5 bl audio_play movs r0, 0 @081CD246: bl sub_81CD258 lsls r0, 24 lsrs r3, r0, 24 @081CD24E: adds r0, r3, 0 pop {r4} pop {r1} bx r1 thumb_func_end sub_81CD1E4 thumb_func_start sub_81CD258 sub_81CD258: ; 81CD258 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r0, 24 mov r8, r0 movs r0, 0xB bl sub_81C763C adds r4, r0, 0 movs r0, 0x12 bl sub_81C763C adds r5, r0, 0 mov r0, r8 cmp r0, 0 beq @081CD284 ldr r1, =0x00006788 adds r0, r4, r1 b @081CD288 .align 2, 0 .pool @081CD284: ldr r2, =0x00006787 adds r0, r4, r2 @081CD288: ldrb r0, [r0] lsls r0, 24 asrs r0, 24 lsls r0, 16 lsrs r0, 16 adds r7, r0, 0 ldr r1, =0x00006428 adds r0, r4, r1 ldr r2, =0x00006786 adds r1, r4, r2 movs r2, 0 ldrsb r2, [r1, r2] lsls r1, r2, 2 adds r1, r2 lsls r1, 2 ldr r3, =0x0000643c adds r1, r3 adds r1, r4, r1 lsls r2, r7, 2 adds r2, r7 lsls r2, 2 adds r2, r3 adds r2, r4, r2 bl sub_81D1F84 ldrh r6, [r5, 0x2] bl sub_81CDD5C cmp r0, 0 beq @081CD2D8 ldrh r1, [r5] b @081CD2DC .align 2, 0 .pool @081CD2D8: ldrh r1, [r5] subs r1, 0x1 @081CD2DC: eors r1, r6 negs r0, r1 orrs r0, r1 lsrs r0, 31 adds r6, r0, 0 mov r0, r8 cmp r0, 0 beq @081CD332 ldr r1, =0x00006787 adds r2, r4, r1 ldrb r0, [r2] adds r1, 0x1 adds r3, r4, r1 strb r0, [r3] ldr r0, =0x00006786 adds r1, r4, r0 ldrb r0, [r1] strb r0, [r2] strb r7, [r1] ldrb r1, [r3] ldr r2, =0x00006789 adds r0, r4, r2 strb r1, [r0] ldrh r0, [r5, 0x2] cmp r0, 0 bne @081CD312 ldrh r0, [r5] @081CD312: subs r1, r0, 0x1 strh r1, [r5, 0x2] lsls r0, r1, 16 cmp r0, 0 beq @081CD32C subs r1, 0x1 b @081CD384 .align 2, 0 .pool @081CD32C: ldrh r0, [r5] subs r1, r0, 0x1 b @081CD384 @081CD332: ldr r0, =0x00006788 adds r2, r4, r0 ldrb r0, [r2] ldr r1, =0x00006787 adds r3, r4, r1 strb r0, [r3] ldr r0, =0x00006786 adds r1, r4, r0 ldrb r0, [r1] strb r0, [r2] strb r7, [r1] ldrb r1, [r3] ldr r2, =0x00006789 adds r0, r4, r2 strb r1, [r0] ldrh r1, [r5, 0x2] ldrh r0, [r5] subs r0, 0x1 cmp r1, r0 bge @081CD370 adds r0, r1, 0x1 b @081CD372 .align 2, 0 .pool @081CD370: movs r0, 0 @081CD372: strh r0, [r5, 0x2] ldrh r1, [r5, 0x2] ldrh r0, [r5] subs r0, 0x1 cmp r1, r0 bge @081CD382 adds r1, 0x1 b @081CD384 @081CD382: movs r1, 0 @081CD384: ldr r2, =0x00006302 adds r0, r4, r2 strh r1, [r0] ldrh r4, [r5, 0x2] bl sub_81CDD5C cmp r0, 0 beq @081CD39C ldrh r1, [r5] b @081CD3A0 .align 2, 0 .pool @081CD39C: ldrh r1, [r5] subs r1, 0x1 @081CD3A0: eors r1, r4 negs r0, r1 orrs r0, r1 lsrs r0, 31 cmp r6, 0 bne @081CD3B0 movs r0, 0x3 b @081CD3BA @081CD3B0: cmp r0, 0 beq @081CD3B8 movs r0, 0x1 b @081CD3BA @081CD3B8: movs r0, 0x4 @081CD3BA: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81CD258 thumb_func_start sub_81CD3C4 sub_81CD3C4: ; 81CD3C4 push {r4,lr} movs r0, 0xB bl sub_81C763C adds r4, r0, 0 movs r0, 0x12 bl sub_81C763C adds r2, r0, 0 ldr r1, =0x0000678a adds r0, r4, r1 ldrb r0, [r0] cmp r0, 0x9 bls @081CD3E2 b @081CD530 @081CD3E2: lsls r0, 2 ldr r1, =@081CD3F4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CD3F4: .4byte @081CD41C .4byte @081CD428 .4byte @081CD434 .4byte @081CD440 .4byte @081CD490 .4byte @081CD4A8 .4byte @081CD4C0 .4byte @081CD4D8 .4byte @081CD4F0 .4byte @081CD508 @081CD41C: movs r1, 0x2 ldrsh r0, [r2, r1] movs r1, 0 bl sub_81CD824 b @081CD530 @081CD428: movs r1, 0x2 ldrsh r0, [r2, r1] movs r1, 0 bl sub_81CDA1C b @081CD530 @081CD434: movs r1, 0x2 ldrsh r0, [r2, r1] movs r1, 0 bl sub_81CDB98 b @081CD530 @081CD440: ldrh r0, [r2] cmp r0, 0x1 bne @081CD468 ldr r2, =0x00006786 adds r0, r4, r2 movs r1, 0 strb r1, [r0] adds r2, 0x1 adds r0, r4, r2 strb r1, [r0] adds r2, 0x1 adds r0, r4, r2 strb r1, [r0] adds r2, 0x2 adds r0, r4, r2 strb r1, [r0] movs r0, 0x1 b @081CD53C .align 2, 0 .pool @081CD468: ldr r0, =0x00006786 adds r1, r4, r0 movs r0, 0 strb r0, [r1] ldr r2, =0x00006787 adds r1, r4, r2 movs r0, 0x1 strb r0, [r1] ldr r0, =0x00006788 adds r1, r4, r0 movs r0, 0x2 strb r0, [r1] b @081CD530 .align 2, 0 .pool @081CD490: ldrh r0, [r2, 0x2] adds r0, 0x1 ldrh r2, [r2] cmp r0, r2 blt @081CD49C movs r0, 0 @081CD49C: lsls r0, 16 asrs r0, 16 movs r1, 0x1 bl sub_81CD824 b @081CD530 @081CD4A8: ldrh r0, [r2, 0x2] adds r0, 0x1 ldrh r2, [r2] cmp r0, r2 blt @081CD4B4 movs r0, 0 @081CD4B4: lsls r0, 16 asrs r0, 16 movs r1, 0x1 bl sub_81CDA1C b @081CD530 @081CD4C0: ldrh r0, [r2, 0x2] adds r0, 0x1 ldrh r2, [r2] cmp r0, r2 blt @081CD4CC movs r0, 0 @081CD4CC: lsls r0, 16 asrs r0, 16 movs r1, 0x1 bl sub_81CDB98 b @081CD530 @081CD4D8: ldrh r0, [r2, 0x2] subs r0, 0x1 cmp r0, 0 bge @081CD4E4 ldrh r0, [r2] subs r0, 0x1 @081CD4E4: lsls r0, 16 asrs r0, 16 movs r1, 0x2 bl sub_81CD824 b @081CD530 @081CD4F0: ldrh r0, [r2, 0x2] subs r0, 0x1 cmp r0, 0 bge @081CD4FC ldrh r0, [r2] subs r0, 0x1 @081CD4FC: lsls r0, 16 asrs r0, 16 movs r1, 0x2 bl sub_81CDA1C b @081CD530 @081CD508: ldrh r0, [r2, 0x2] subs r0, 0x1 cmp r0, 0 bge @081CD514 ldrh r0, [r2] subs r0, 0x1 @081CD514: lsls r0, 16 asrs r0, 16 movs r1, 0x2 bl sub_81CDB98 ldr r2, =0x0000678a adds r1, r4, r2 movs r0, 0 strb r0, [r1] movs r0, 0x1 b @081CD53C .align 2, 0 .pool @081CD530: ldr r0, =0x0000678a adds r1, r4, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] movs r0, 0 @081CD53C: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CD3C4 thumb_func_start sub_81CD548 sub_81CD548: ; 81CD548 push {r4,r5,lr} lsls r0, 24 lsrs r4, r0, 24 adds r5, r4, 0 movs r0, 0xB bl sub_81C763C adds r1, r0, 0 cmp r4, 0x1 beq @081CD588 cmp r4, 0x1 bgt @081CD566 cmp r4, 0 beq @081CD56C b @081CD5C4 @081CD566: cmp r5, 0x2 beq @081CD5A4 b @081CD5C4 @081CD56C: ldr r2, =0x00006302 adds r0, r1, r2 movs r2, 0 ldrsh r0, [r0, r2] ldr r2, =0x00006789 adds r1, r2 ldrb r1, [r1] bl sub_81CD824 b @081CD5C4 .align 2, 0 .pool @081CD588: ldr r2, =0x00006302 adds r0, r1, r2 movs r2, 0 ldrsh r0, [r0, r2] ldr r2, =0x00006789 adds r1, r2 ldrb r1, [r1] bl sub_81CDA1C b @081CD5C4 .align 2, 0 .pool @081CD5A4: ldr r2, =0x00006302 adds r0, r1, r2 movs r2, 0 ldrsh r0, [r0, r2] ldr r2, =0x00006789 adds r1, r2 ldrb r1, [r1] bl sub_81CDB98 movs r0, 0x1 b @081CD5C6 .align 2, 0 .pool @081CD5C4: movs r0, 0 @081CD5C6: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CD548 thumb_func_start sub_81CD5CC sub_81CD5CC: ; 81CD5CC push {r4,lr} adds r4, r0, 0 lsls r2, 16 lsrs r2, 16 b @081CD5E4 @081CD5D6: strb r3, [r4] adds r1, 0x1 adds r4, 0x1 lsls r0, r2, 16 ldr r2, =0xffff0000 adds r0, r2 lsrs r2, r0, 16 @081CD5E4: ldrb r3, [r1] adds r0, r3, 0 cmp r0, 0xFF bne @081CD5D6 adds r1, r2, 0 lsls r0, r1, 16 ldr r2, =0xffff0000 adds r0, r2 lsrs r2, r0, 16 lsls r1, 16 cmp r1, 0 ble @081CD612 movs r3, 0 @081CD5FE: strb r3, [r4] adds r4, 0x1 adds r1, r2, 0 lsls r0, r1, 16 ldr r2, =0xffff0000 adds r0, r2 lsrs r2, r0, 16 lsls r1, 16 cmp r1, 0 bgt @081CD5FE @081CD612: movs r0, 0xFF strb r0, [r4] adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CD5CC thumb_func_start sub_81CD624 sub_81CD624: ; 81CD624 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r5, r0, 0 adds r4, r1, 0 lsls r4, 16 lsrs r4, 16 lsls r2, 24 lsrs r2, 24 mov r10, r2 movs r0, 0x12 bl sub_81C763C lsls r4, 2 adds r0, r4 ldrb r4, [r0, 0x4] mov r8, r4 ldrb r6, [r0, 0x5] mov r9, r6 movs r0, 0xFC strb r0, [r5] adds r5, 0x1 movs r0, 0x4 strb r0, [r5] adds r5, 0x1 movs r0, 0x8 strb r0, [r5] adds r5, 0x1 movs r0, 0 strb r0, [r5] adds r5, 0x1 movs r0, 0x9 strb r0, [r5] adds r5, 0x1 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x2D movs r3, 0 bl sub_81D2C68 cmp r0, 0 beq @081CD690 ldr r1, =gUnknown_085E8264 adds r0, r5, 0 movs r2, 0 movs r3, 0xC bl sub_8009128 b @081CD80E .align 2, 0 .pool @081CD690: adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x2 adds r3, r5, 0 bl sub_81D2C68 adds r0, r5, 0 bl 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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r8, r0 adds r0, r4, 0 bl pokemon_get_gender lsls r0, 24 lsrs r6, r0, 24 b @081CD6FE .align 2, 0 .pool @081CD6E0: mov r0, r8 mov r1, r9 bl get_pokemon_by_box_and_pos adds r4, r0, 0 bl pokemon_roll_gender lsls r0, 24 lsrs r6, r0, 24 adds r0, r4, 0 bl sub_80690C0 lsls r0, 24 lsrs r0, 24 mov r8, r0 @081CD6FE: cmp r7, 0x1D beq @081CD706 cmp r7, 0x20 bne @081CD71C @081CD706: movs r0, 0xB adds r1, r7, 0 muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r5, 0 bl sub_8008C44 cmp r0, 0 bne @081CD71C movs r6, 0xFF @081CD71C: adds r3, r5, 0 b @081CD726 .align 2, 0 .pool @081CD724: adds r3, 0x1 @081CD726: ldrb r0, [r3] cmp r0, 0xFF bne @081CD724 movs r1, 0xFC strb r1, [r3] adds r3, 0x1 movs r0, 0x12 strb r0, [r3] adds r3, 0x1 movs r0, 0x3C strb r0, [r3] adds r3, 0x1 cmp r6, 0 beq @081CD74A cmp r6, 0xFE beq @081CD76E movs r0, 0x77 b @081CD790 @081CD74A: strb r1, [r3] adds r3, 0x1 movs r0, 0x1 strb r0, [r3] adds r3, 0x1 movs r0, 0x4 strb r0, [r3] adds r3, 0x1 strb r1, [r3] adds r3, 0x1 movs r0, 0x3 strb r0, [r3] adds r3, 0x1 movs r0, 0x5 strb r0, [r3] adds r3, 0x1 movs r0, 0xB5 b @081CD790 @081CD76E: strb r1, [r3] adds r3, 0x1 movs r0, 0x1 strb r0, [r3] adds r3, 0x1 movs r0, 0x6 strb r0, [r3] adds r3, 0x1 strb r1, [r3] adds r3, 0x1 movs r0, 0x3 strb r0, [r3] adds r3, 0x1 movs r0, 0x7 strb r0, [r3] adds r3, 0x1 movs r0, 0xB6 @081CD790: strb r0, [r3] adds r3, 0x1 movs r0, 0xFC strb r0, [r3] adds r3, 0x1 movs r0, 0x4 strb r0, [r3] adds r3, 0x1 movs r0, 0x8 strb r0, [r3] adds r3, 0x1 movs r5, 0 strb r5, [r3] adds r3, 0x1 movs r0, 0x9 strb r0, [r3] adds r3, 0x1 movs r0, 0xBA strb r0, [r3] adds r3, 0x1 movs r0, 0xF9 strb r0, [r3] adds r3, 0x1 movs r0, 0x5 strb r0, [r3] adds r3, 0x1 adds r4, r3, 0 adds r0, r4, 0 mov r1, r8 movs r2, 0 movs r3, 0x3 bl 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, =0xffff0000 adds r0, r1 lsrs r4, r0, 16 ldr r0, =0x0000ffff cmp r4, r0 beq @081CD808 movs r2, 0 adds r1, r0, 0 @081CD7FA: strb r2, [r3] adds r3, 0x1 subs r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, r1 bne @081CD7FA @081CD808: movs r0, 0xFF strb r0, [r3] adds r0, r3, 0 @081CD80E: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CD624 thumb_func_start sub_81CD824 sub_81CD824: ; 81CD824 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 16 lsrs r0, 16 mov r8, r0 lsls r1, 24 lsrs r6, r1, 24 movs r0, 0xB bl sub_81C763C adds r5, r0, 0 movs r0, 0x12 bl sub_81C763C adds r7, r0, 0 mov r1, r8 lsls r0, r1, 16 asrs r4, r0, 16 bl sub_81CDD5C cmp r0, 0 beq @081CD85A ldrh r2, [r7] cmp r4, r2 bne @081CD862 b @081CD900 @081CD85A: ldrh r0, [r7] subs r0, 0x1 cmp r4, r0 beq @081CD900 @081CD862: lsls r0, r6, 6 ldr r1, =0x00006368 adds r0, r1 adds r0, r5, r0 mov r2, r8 lsls r4, r2, 16 lsrs r1, r4, 16 movs r2, 0 bl sub_81CD624 asrs r4, 14 adds r4, r7, r4 ldrb r3, [r4, 0x4] lsls r0, r6, 1 adds r0, r6 lsls r4, r0, 3 ldr r1, =0x00006320 adds r0, r5, r1 adds r0, r4 movs r2, 0 movs r1, 0xFC strb r1, [r0] ldr r1, =0x00006321 adds r0, r5, r1 adds r0, r4 movs r1, 0x4 strb r1, [r0] ldr r1, =0x00006322 adds r0, r5, r1 adds r0, r4 movs r1, 0x8 strb r1, [r0] ldr r1, =0x00006323 adds r0, r5, r1 adds r0, r4 strb r2, [r0] ldr r2, =0x00006324 adds r0, r5, r2 adds r0, r4 movs r1, 0x9 strb r1, [r0] cmp r3, 0xE bne @081CD8E4 adds r0, r4, r5 ldr r1, =0x00006325 adds r0, r1 ldr r1, =gUnknown_085EBFCE b @081CD8F4 .align 2, 0 .pool @081CD8E4: adds r4, r5 ldr r2, =0x00006325 adds r4, r2 adds r0, r3, 0 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 @081CD8F4: movs r2, 0x8 bl sub_81CD5CC b @081CD95C .align 2, 0 .pool @081CD900: movs r1, 0 lsls r4, r6, 6 lsls r0, r6, 1 mov r8, r0 adds r3, r4, 0 ldr r0, =0x00006368 adds r2, r5, r0 movs r7, 0 @081CD910: adds r0, r1, r3 adds r0, r2, r0 strb r7, [r0] adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0xB bls @081CD910 adds r1, r4 ldr r2, =0x00006368 adds r0, r5, r2 adds r0, r1 movs r1, 0xFF strb r1, [r0] movs r1, 0 mov r2, r8 adds r0, r2, r6 lsls r3, r0, 3 ldr r0, =0x00006320 adds r2, r5, r0 movs r4, 0 @081CD93A: adds r0, r1, r3 adds r0, r2, r0 strb r4, [r0] adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0x7 bls @081CD93A mov r2, r8 adds r0, r2, r6 lsls r0, 3 adds r0, r1, r0 ldr r2, =0x00006320 adds r1, r5, r2 adds r1, r0 movs r0, 0xFF strb r0, [r1] @081CD95C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CD824 thumb_func_start sub_81CD970 sub_81CD970: ; 81CD970 push {r4-r7,lr} movs r0, 0xB bl sub_81C763C adds r7, r0, 0 ldr r1, =0x000006ac movs r0, 0x12 bl sub_81C761C adds r6, r0, 0 movs r0, 0xC6 lsls r0, 7 adds r1, r7, r0 movs r0, 0 strb r0, [r1] movs r4, 0 movs r5, 0 b @081CD9C4 .align 2, 0 .pool @081CD998: movs r0, 0x64 muls r0, r4 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x2D bl pokemon_getattr adds r2, r0, 0 cmp r2, 0 bne @081CD9BE lsls r1, r5, 2 adds r1, r6, r1 movs r0, 0xE strb r0, [r1, 0x4] strb r4, [r1, 0x5] strh r2, [r1, 0x6] adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 @081CD9BE: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 @081CD9C4: bl calc_player_party_count lsls r0, 24 lsrs r0, 24 cmp r4, r0 bcc @081CD998 lsls r0, r5, 2 adds r0, r6, r0 movs r1, 0 strb r1, [r0, 0x4] strb r1, [r0, 0x5] movs r2, 0 strh r1, [r0, 0x6] strh r1, [r6, 0x2] adds r0, r5, 0x1 strh r0, [r6] ldr r1, =0x0000678a adds r0, r7, r1 strb r2, [r0] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CD970 thumb_func_start sub_81CD9F8 sub_81CD9F8: ; 81CD9F8 push {lr} movs r0, 0xB bl sub_81C763C movs r1, 0xC6 lsls r1, 7 adds r2, r0, r1 movs r3, 0 movs r1, 0x1 strb r1, [r2] ldr r1, =0x0000678a adds r0, r1 strb r3, [r0] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CD9F8 thumb_func_start sub_81CDA1C sub_81CDA1C: ; 81CDA1C push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} lsls r0, 16 lsrs r6, r0, 16 lsls r1, 24 lsrs r1, 24 mov r9, r1 movs r0, 0xB bl sub_81C763C mov r8, r0 movs r0, 0x12 bl sub_81C763C adds r4, r0, 0 lsls r0, r6, 16 asrs r5, r0, 16 bl sub_81CDD5C cmp r0, 0 beq @081CDA52 ldrh r0, [r4] cmp r5, r0 bne @081CDA5A b @081CDB48 @081CDA52: ldrh r0, [r4] subs r0, 0x1 cmp r5, r0 beq @081CDB48 @081CDA5A: lsls r0, r6, 16 asrs r0, 14 adds r0, r4, r0 ldrb r6, [r0, 0x4] ldrb r7, [r0, 0x5] adds r0, r6, 0 adds r1, r7, 0 movs r2, 0x16 movs r3, 0 bl sub_81D2C68 mov r1, r9 lsls r5, r1, 2 adds r4, r5, r1 ldr r1, =0x00006428 add r1, r8 adds r1, r4 strb r0, [r1] adds r0, r6, 0 adds r1, r7, 0 movs r2, 0x2F movs r3, 0 bl sub_81D2C68 ldr r1, =0x00006429 add r1, r8 adds r1, r4 strb r0, [r1] adds r0, r6, 0 adds r1, r7, 0 movs r2, 0x21 movs r3, 0 bl sub_81D2C68 ldr r1, =0x0000642a add r1, r8 adds r1, r4 strb r0, [r1] adds r0, r6, 0 adds r1, r7, 0 movs r2, 0x18 movs r3, 0 bl sub_81D2C68 ldr r1, =0x0000642b add r1, r8 adds r1, r4 strb r0, [r1] adds r0, r6, 0 adds r1, r7, 0 movs r2, 0x17 movs r3, 0 bl sub_81D2C68 ldr r1, =0x0000642c add r1, r8 adds r1, r4 strb r0, [r1] movs r0, 0xCF lsls r0, 7 add r0, r8 mov r2, r9 adds r4, r0, r2 adds r0, r6, 0 adds r1, r7, 0 movs r2, 0x30 movs r3, 0 bl sub_81D2C68 cmp r0, 0xFF beq @081CDB10 adds r0, r6, 0 adds r1, r7, 0 movs r2, 0x30 movs r3, 0 bl sub_81D2C68 movs r1, 0x1D bl __udivsi3 b @081CDB12 .align 2, 0 .pool @081CDB10: movs r0, 0x9 @081CDB12: strb r0, [r4] adds r0, r6, 0 adds r1, r7, 0 movs r2, 0x8 movs r3, 0 bl sub_81D2C68 ldr r1, =0x00006783 add r1, r8 add r1, r9 strb r0, [r1] mov r0, r9 adds r1, r5, r0 ldr r2, =0x00006428 adds r0, r1, r2 add r0, r8 lsls r1, 2 adds r2, 0x14 adds r1, r2 add r1, r8 bl sub_81D2754 b @081CDB80 .align 2, 0 .pool @081CDB48: movs r2, 0 mov r0, r9 lsls r5, r0, 2 add r5, r9 ldr r4, =0x00006428 add r4, r8 lsls r3, r5, 2 mov r9, r2 ldr r7, =0x0000643c movs r6, 0x9B @081CDB5C: adds r0, r2, r5 adds r0, r4, r0 mov r1, r9 strb r1, [r0] lsls r0, r2, 2 adds r0, r3 add r0, r8 adds r1, r0, r7 strh r6, [r1] ldr r1, =0x0000643e adds r0, r1 movs r1, 0x5B strh r1, [r0] adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0x4 bls @081CDB5C @081CDB80: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CDA1C thumb_func_start sub_81CDB98 sub_81CDB98: ; 81CDB98 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 lsls r0, 16 lsrs r6, r0, 16 lsls r1, 24 lsrs r1, 24 mov r9, r1 movs r0, 0xB bl sub_81C763C adds r7, r0, 0 movs r0, 0x12 bl sub_81C763C adds r4, r0, 0 lsls r0, r6, 16 asrs r5, r0, 16 bl sub_81CDD5C cmp r0, 0 beq @081CDBCC ldrh r0, [r4] b @081CDBD0 @081CDBCC: ldrh r0, [r4] subs r0, 0x1 @081CDBD0: cmp r5, r0 beq @081CDC3E lsls r0, r6, 16 asrs r0, 14 adds r0, r4, r0 ldrb r5, [r0, 0x4] ldrb r6, [r0, 0x5] adds r0, r5, 0 adds r1, r6, 0 movs r2, 0x41 movs r3, 0 bl sub_81D2C68 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r5, 0 adds r1, r6, 0 movs r2, 0x1 movs r3, 0 bl sub_81D2C68 mov r8, r0 adds r0, r5, 0 adds r1, r6, 0 movs r2, 0 movs r3, 0 bl sub_81D2C68 adds r5, r0, 0 lsls r0, r4, 3 ldr r1, =gMonFrontPicTable adds r0, r1 mov r2, r9 lsls r1, r2, 13 movs r2, 0xC0 lsls r2, 2 adds r1, r2 adds r1, r7, r1 movs r2, 0x1 str r2, [sp] adds r2, r4, 0 adds r3, r5, 0 bl 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 .pool thumb_func_end sub_81CDB98 thumb_func_start sub_81CDC50 sub_81CDC50: ; 81CDC50 push {lr} movs r0, 0x12 bl sub_81C763C ldrh r0, [r0] pop {r1} bx r1 thumb_func_end sub_81CDC50 thumb_func_start sub_81CDC60 sub_81CDC60: ; 81CDC60 push {lr} movs r0, 0x12 bl sub_81C763C ldrh r0, [r0, 0x2] pop {r1} bx r1 thumb_func_end sub_81CDC60 thumb_func_start sub_81CDC70 sub_81CDC70: ; 81CDC70 push {lr} movs r0, 0xB bl sub_81C763C ldr r1, =0x00006428 adds r0, r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CDC70 thumb_func_start sub_81CDC84 sub_81CDC84: ; 81CDC84 push {lr} movs r0, 0xB bl sub_81C763C ldr r1, =0x00006786 adds r0, r1 ldrb r0, [r0] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CDC84 thumb_func_start sub_81CDC9C sub_81CDC9C: ; 81CDC9C push {lr} movs r0, 0xB bl sub_81C763C ldr r1, =0x00006302 adds r0, r1 ldrb r0, [r0] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CDC9C thumb_func_start sub_81CDCB4 sub_81CDCB4: ; 81CDCB4 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0xB bl sub_81C763C lsls r4, 13 movs r1, 0xC0 lsls r1, 2 adds r4, r1 adds r0, r4 pop {r4} pop {r1} bx r1 thumb_func_end sub_81CDCB4 thumb_func_start sub_81CDCD4 sub_81CDCD4: ; 81CDCD4 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0xB bl sub_81C763C lsls r4, 7 adds r0, r4 pop {r4} pop {r1} bx r1 thumb_func_end sub_81CDCD4 thumb_func_start sub_81CDCEC sub_81CDCEC: ; 81CDCEC push {lr} movs r0, 0xB bl sub_81C763C ldr r1, =0x00006789 adds r0, r1 ldrb r0, [r0] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CDCEC thumb_func_start sub_81CDD04 sub_81CDD04: ; 81CDD04 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0xB bl sub_81C763C lsls r4, 6 ldr r1, =0x00006368 adds r4, r1 adds r0, r4 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CDD04 thumb_func_start sub_81CDD24 sub_81CDD24: ; 81CDD24 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0xB bl sub_81C763C lsls r1, r4, 1 adds r1, r4 lsls r1, 3 ldr r2, =0x00006320 adds r1, r2 adds r0, r1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CDD24 thumb_func_start sub_81CDD48 sub_81CDD48: ; 81CDD48 push {lr} movs r0, 0x12 bl sub_81C763C ldrh r1, [r0, 0x2] lsls r1, 2 adds r0, r1 ldrh r0, [r0, 0x6] pop {r1} bx r1 thumb_func_end sub_81CDD48 thumb_func_start sub_81CDD5C sub_81CDD5C: ; 81CDD5C push {lr} movs r0, 0xB bl sub_81C763C movs r1, 0xC6 lsls r1, 7 adds r0, r1 ldrb r0, [r0] cmp r0, 0x1 beq @081CDD74 movs r0, 0 b @081CDD76 @081CDD74: movs r0, 0x1 @081CDD76: pop {r1} bx r1 thumb_func_end sub_81CDD5C thumb_func_start sub_81CDD7C sub_81CDD7C: ; 81CDD7C push {lr} movs r0, 0xB bl sub_81C763C adds r2, r0, 0 movs r1, 0xC6 lsls r1, 7 adds r0, r2, r1 ldrb r0, [r0] cmp r0, 0x1 beq @081CDD96 movs r0, 0 b @081CDDA6 @081CDD96: ldr r3, =0x00006786 adds r0, r2, r3 movs r1, 0 ldrsb r1, [r0, r1] subs r3, 0x3 adds r0, r2, r3 adds r0, r1 ldrb r0, [r0] @081CDDA6: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CDD7C thumb_func_start sub_81CDDB0 sub_81CDDB0: ; 81CDDB0 push {lr} movs r0, 0xB bl sub_81C763C ldr r2, =0x00006786 adds r1, r0, r2 ldrb r1, [r1] lsls r1, 24 asrs r1, 24 subs r2, 0x6 adds r0, r2 adds r0, r1 ldrb r0, [r0] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CDDB0 thumb_func_start sub_81CDDD4 sub_81CDDD4: ; 81CDDD4 push {r4,lr} ldr r1, =0x000038ac movs r0, 0xC bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CDE24 ldr r0, =0x00001816 adds r1, r4, r0 movs r0, 0xFF strb r0, [r1] ldr r0, =sub_81CDE94 movs r1, 0x1 bl sub_81C7078 str r0, [r4] ldr r0, =0x00001810 adds r1, r4, r0 ldr r0, =sub_81CDE80 str r0, [r1] ldr r0, =0x00002908 adds r1, r4, r0 movs r0, 0 strb r0, [r1] movs r0, 0x1 b @081CDE26 .align 2, 0 .pool @081CDE24: movs r0, 0 @081CDE26: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CDDD4 thumb_func_start sub_81CDE2C sub_81CDE2C: ; 81CDE2C push {r4,r5,lr} adds r4, r0, 0 movs r0, 0xC bl sub_81C763C adds r5, r0, 0 ldr r0, =gUnknown_08623384 lsls r4, 2 adds r4, r0 ldr r0, [r4] movs r1, 0x1 bl sub_81C7078 str r0, [r5] ldr r0, =0x00001810 adds r5, r0 ldr r0, =sub_81CDE80 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CDE2C thumb_func_start sub_81CDE64 sub_81CDE64: ; 81CDE64 push {lr} movs r0, 0xC bl sub_81C763C ldr r1, =0x00001810 adds r0, r1 ldr r0, [r0] bl _call_via_r0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CDE64 thumb_func_start sub_81CDE80 sub_81CDE80: ; 81CDE80 push {lr} movs r0, 0xC bl sub_81C763C ldr r0, [r0] bl sub_81C70D8 pop {r1} bx r1 thumb_func_end sub_81CDE80 thumb_func_start sub_81CDE94 sub_81CDE94: ; 81CDE94 push {r4-r6,lr} sub sp, 0xC adds r4, r0, 0 movs r0, 0xC bl sub_81C763C adds r5, r0, 0 cmp r4, 0x14 bls @081CDEA8 b @081CE2C4 @081CDEA8: lsls r0, r4, 2 ldr r1, =@081CDEB8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CDEB8: .4byte @081CDF0C .4byte @081CDF18 .4byte @081CDF94 .4byte @081CDFB8 .4byte @081CE030 .4byte @081CE074 .4byte @081CE0B0 .4byte @081CE118 .4byte @081CE120 .4byte @081CE126 .4byte @081CE136 .4byte @081CE146 .4byte @081CE156 .4byte @081CE16C .4byte @081CE1C8 .4byte @081CE1EC .4byte @081CE218 .4byte @081CE23C .4byte @081CE24A .4byte @081CE25A .4byte @081CE262 @081CDF0C: bl sub_81CD3C4 cmp r0, 0x1 beq @081CDF16 b @081CE2C0 @081CDF16: b @081CDFB0 @081CDF18: ldr r0, =gUnknown_08623358 movs r1, 0x3 bl sub_81C7B54 movs r0, 0x1 movs r1, 0 movs r2, 0 bl 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, =0x00007940 movs r0, 0 bl lcd_io_set ldr r1, =0x00000844 movs r0, 0x50 bl lcd_io_set ldr r1, =0x0000040b movs r0, 0x52 bl lcd_io_set ldr r1, =gUnknown_08DC6548 movs r0, 0 str r0, [sp] movs r0, 0x3 b @081CDFA8 .align 2, 0 .pool @081CDF94: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r0, 24 cmp r0, 0 beq @081CDFA2 b @081CE2C0 @081CDFA2: ldr r1, =gUnknown_08623228 str r0, [sp] movs r0, 0x2 @081CDFA8: movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram @081CDFB0: movs r0, 0 b @081CE2C6 .align 2, 0 .pool @081CDFB8: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 beq @081CDFC4 b @081CE2C0 @081CDFC4: ldr r0, =gUnknown_08DC6DFC adds r4, r5, 0x4 adds r1, r4, 0 bl LZ77UnCompVram movs r0, 0x3 adds r1, r4, 0 bl bg_set_tilemap bl sub_81CDD5C cmp r0, 0x1 bne @081CDFF2 ldr r1, =gUnknown_08DC7070 movs r0, 0x9 str r0, [sp] movs r0, 0x4 str r0, [sp, 0x4] movs r0, 0x3 movs r2, 0 movs r3, 0x5 bl gpu_copy_to_iwram_tile_map_rect @081CDFF2: movs r0, 0x3 bl gpu_copy_wram_bg_tilemap_to_vram ldr r0, =gUnknown_08DC6528 movs r1, 0x10 movs r2, 0x20 bl sub_81C7944 ldr r0, =gUnknown_08623208 movs r1, 0xF0 movs r2, 0x20 bl sub_81C7944 ldr r0, =0x00001814 adds r1, r5, r0 ldr r0, =0x0000ffb0 strh r0, [r1] b @081CDFB0 .align 2, 0 .pool @081CE030: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 beq @081CE03C b @081CE2C0 @081CE03C: ldr r0, =gUnknown_0862323C ldr r1, =0x00001004 adds r4, r5, r1 adds r1, r4, 0 bl LZ77UnCompVram movs r0, 0x2 adds r1, r4, 0 bl bg_set_tilemap movs r0, 0x2 bl gpu_copy_wram_bg_tilemap_to_vram ldr r0, =gUnknown_086231E8 movs r1, 0x30 movs r2, 0x20 bl sub_81C7944 movs r0, 0x2 bl sub_81D21DC b @081CDFB0 .align 2, 0 .pool @081CE074: movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0x1 bl sub_8199DF0 movs r0, 0x1 movs r1, 0x11 movs r2, 0x1 movs r3, 0x1 bl sub_8199DF0 movs r0, 0 str r0, [sp, 0x8] ldr r2, =0x00000804 adds r4, r5, r2 ldr r2, =0x05000200 add r0, sp, 0x8 adds r1, r4, 0 bl CpuSet movs r0, 0x1 adds r1, r4, 0 bl bg_set_tilemap b @081CDFB0 .align 2, 0 .pool @081CE0B0: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 beq @081CE0BC b @081CE2C0 @081CE0BC: ldr r0, =gUnknown_08623364 bl 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, =gUnknown_0862336C bl Window_AddFromTemplate ldr r2, =0x00001821 adds r1, r5, r2 strb r0, [r1] ldr r0, =gUnknown_08623374 bl Window_AddFromTemplate ldr r2, =0x00001822 adds r1, r5, r2 strb r0, [r1] ldr r0, =gUnknown_0862337C bl Window_AddFromTemplate ldr r2, =0x00001823 adds r1, r5, r2 strb r0, [r1] @081CE0F6: bl TextBox_ResetSomeField b @081CDFB0 .align 2, 0 .pool @081CE118: movs r0, 0 bl sub_81CED30 b @081CDFB0 @081CE120: bl sub_81CE9E4 b @081CDFB0 @081CE126: bl sub_81CDD5C cmp r0, 0x1 beq @081CE130 b @081CDFB0 @081CE130: bl sub_81CE934 b @081CDFB0 @081CE136: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0 b @081CE164 @081CE146: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x1 b @081CE164 @081CE156: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x2 @081CE164: movs r2, 0x1 bl sub_81CE754 b @081CDFB0 @081CE16C: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x3 movs r2, 0x1 bl sub_81CE754 cmp r0, 0x1 beq @081CE186 b @081CE2C0 @081CE186: movs r1, 0xC1 lsls r1, 5 adds r0, r5, r1 ldrb r0, [r0] bl Window_WriteStandardTileMap bl sub_81CDD5C cmp r0, 0x1 beq @081CE19C b @081CDFB0 @081CE19C: ldr r2, =0x00001821 adds r0, r5, r2 ldrb r0, [r0] bl Window_WriteStandardTileMap ldr r1, =0x00001822 adds r0, r5, r1 ldrb r0, [r0] bl Window_WriteStandardTileMap ldr r2, =0x00001823 adds r0, r5, r2 ldrb r0, [r0] bl Window_WriteStandardTileMap b @081CDFB0 .align 2, 0 .pool @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, =sub_81CEE44 bl c3args_set_0toR1_1to0 b @081CDFB0 .align 2, 0 .pool @081CE23C: bl sub_81CEE90 bl sub_81CDC70 bl sub_81D20AC b @081CDFB0 @081CE24A: bl sub_81CDC70 bl sub_81D20BC lsls r0, 24 cmp r0, 0 bne @081CE2C0 b @081CDFB0 @081CE25A: movs r0, 0x1 bl sub_81CEE74 b @081CDFB0 @081CE262: bl sub_81CDC70 ldr r2, =0x00001814 adds r1, r5, r2 bl sub_81D3178 lsls r0, 24 cmp r0, 0 bne @081CE2C0 ldr r0, =0x000028e0 adds r6, r5, r0 adds r0, r6, 0 bl sub_81D3464 bl sub_81CDD5C cmp r0, 0x1 beq @081CE298 bl sub_81CDC60 adds r4, r0, 0 bl sub_81CDC50 lsls r4, 16 lsls r0, 16 cmp r4, r0 beq @081CE2C4 @081CE298: ldr r1, =0x00001816 adds r0, r5, r1 ldrb r4, [r0] bl sub_81CDDB0 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r6, 0 adds r1, r4, 0 bl sub_81D3480 b @081CE2C4 .align 2, 0 .pool @081CE2C0: movs r0, 0x2 b @081CE2C6 @081CE2C4: movs r0, 0x4 @081CE2C6: add sp, 0xC pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81CDE94 thumb_func_start sub_81CE2D0 sub_81CE2D0: ; 81CE2D0 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0xC bl sub_81C763C adds r5, r0, 0 cmp r4, 0x1 beq @081CE308 cmp r4, 0x1 bgt @081CE2EA cmp r4, 0 beq @081CE2F4 b @081CE374 @081CE2EA: cmp r4, 0x2 beq @081CE328 cmp r4, 0x3 beq @081CE33E b @081CE374 @081CE2F4: bl sub_81CEEC8 ldr r1, =0x000028e0 adds r0, r5, r1 bl sub_81D3520 movs r0, 0x1 b @081CE376 .align 2, 0 .pool @081CE308: bl sub_81CDC70 ldr r2, =0x00001814 adds r1, r5, r2 bl sub_81D31A4 lsls r0, 24 cmp r0, 0 bne @081CE34E movs r0, 0 bl sub_81CEE74 movs r0, 0x1 b @081CE376 .align 2, 0 .pool @081CE328: movs r0, 0 bl sub_81C7AC0 bl sub_81CDD5C cmp r0, 0 bne @081CE33A bl sub_81C78A0 @081CE33A: movs r0, 0 b @081CE376 @081CE33E: bl sub_81C7B34 cmp r0, 0 bne @081CE34E bl sub_81C78C0 cmp r0, 0 beq @081CE352 @081CE34E: movs r0, 0x2 b @081CE376 @081CE352: ldr r1, =0x000028e0 adds r0, r5, r1 bl sub_81D354C movs r0, 0x1 bl 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 .pool @081CE374: movs r0, 0x4 @081CE376: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CE2D0 thumb_func_start sub_81CE37C sub_81CE37C: ; 81CE37C push {r4-r6,lr} adds r4, r0, 0 movs r0, 0xC bl sub_81C763C adds r6, r0, 0 bl sub_81CDC70 adds r2, r0, 0 cmp r4, 0x9 bls @081CE394 b @081CE4D0 @081CE394: lsls r0, r4, 2 ldr r1, =@081CE3A4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CE3A4: .4byte @081CE3CC .4byte @081CE3D0 .4byte @081CE3DA .4byte @081CE3F0 .4byte @081CE3F8 .4byte @081CE418 .4byte @081CE428 .4byte @081CE438 .4byte @081CE44E .4byte @081CE468 @081CE3CC: movs r0, 0 b @081CE3D2 @081CE3D0: movs r0, 0x1 @081CE3D2: bl sub_81CD548 @081CE3D6: movs r0, 0x1 b @081CE4D2 @081CE3DA: movs r0, 0x2 bl sub_81CD548 ldr r1, =0x000028e0 adds r0, r6, r1 bl sub_81D3520 b @081CE3D6 .align 2, 0 .pool @081CE3F0: adds r0, r2, 0 bl sub_81D2074 b @081CE3D6 @081CE3F8: ldr r1, =0x00001814 adds r0, r6, r1 bl sub_81D3150 lsls r0, 24 cmp r0, 0 bne @081CE4CC bl sub_81CDC84 lsls r0, 24 lsrs r0, 24 bl sub_81CED30 b @081CE3D6 .align 2, 0 .pool @081CE418: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0 b @081CE446 @081CE428: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x1 b @081CE446 @081CE438: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x2 @081CE446: movs r2, 0 bl sub_81CE754 b @081CE3D6 @081CE44E: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x3 movs r2, 0 bl sub_81CE754 cmp r0, 0x1 beq @081CE3D6 b @081CE4CC @081CE468: bl sub_81CDC70 adds r2, r0, 0 ldr r0, =0x00001814 adds r1, r6, r0 adds r0, r2, 0 bl sub_81D3178 lsls r0, 24 cmp r0, 0 bne @081CE4CC ldr r1, =0x000028e0 adds r0, r6, r1 bl sub_81D3464 bl sub_81CDD5C cmp r0, 0x1 beq @081CE4A0 bl sub_81CDC60 adds r4, r0, 0 bl sub_81CDC50 lsls r4, 16 lsls r0, 16 cmp r4, r0 beq @081CE3D6 @081CE4A0: ldr r0, =0x000028e0 adds r5, r6, r0 ldr r1, =0x00001816 adds r0, r6, r1 ldrb r4, [r0] bl sub_81CDDB0 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r5, 0 adds r1, r4, 0 bl sub_81D3480 b @081CE3D6 .align 2, 0 .pool @081CE4CC: movs r0, 0x2 b @081CE4D2 @081CE4D0: movs r0, 0x4 @081CE4D2: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81CE37C thumb_func_start sub_81CE4D8 sub_81CE4D8: ; 81CE4D8 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0xC bl sub_81C763C adds r5, r0, 0 cmp r4, 0x8 bhi @081CE5DC lsls r0, r4, 2 ldr r1, =@081CE4F8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CE4F8: .4byte @081CE51C .4byte @081CE520 .4byte @081CE524 .4byte @081CE52E .4byte @081CE53E .4byte @081CE54E .4byte @081CE55E .4byte @081CE576 .4byte @081CE592 @081CE51C: movs r0, 0 b @081CE526 @081CE520: movs r0, 0x1 b @081CE526 @081CE524: movs r0, 0x2 @081CE526: bl sub_81CD548 movs r0, 0x1 b @081CE5DE @081CE52E: bl sub_81CDC84 lsls r0, 24 lsrs r0, 24 bl sub_81CED30 movs r0, 0x1 b @081CE5DE @081CE53E: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0 b @081CE56C @081CE54E: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x1 b @081CE56C @081CE55E: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x2 @081CE56C: movs r2, 0 bl sub_81CE754 movs r0, 0x1 b @081CE5DE @081CE576: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x3 movs r2, 0 bl sub_81CE754 cmp r0, 0x1 bne @081CE5D8 movs r0, 0x1 b @081CE5DE @081CE592: bl sub_81CDC70 ldr r2, =0x00001814 adds r1, r5, r2 bl sub_81D3178 lsls r0, 24 cmp r0, 0 bne @081CE5D8 ldr r0, =0x000028e0 adds r4, r5, r0 adds r0, r4, 0 bl sub_81D3464 ldr r1, =0x00001816 adds r0, r5, r1 ldrb r5, [r0] bl sub_81CDDB0 adds r2, r0, 0 lsls r2, 24 lsrs r2, 24 adds r0, r4, 0 adds r1, r5, 0 bl sub_81D3480 movs r0, 0x1 b @081CE5DE .align 2, 0 .pool @081CE5D8: movs r0, 0x2 b @081CE5DE @081CE5DC: movs r0, 0x4 @081CE5DE: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CE4D8 thumb_func_start sub_81CE5E4 sub_81CE5E4: ; 81CE5E4 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0xC bl sub_81C763C adds r5, r0, 0 cmp r4, 0x7 bhi @081CE6B2 lsls r0, r4, 2 ldr r1, =@081CE604 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CE604: .4byte @081CE624 .4byte @081CE628 .4byte @081CE632 .4byte @081CE648 .4byte @081CE660 .4byte @081CE670 .4byte @081CE680 .4byte @081CE696 @081CE624: movs r0, 0 b @081CE62A @081CE628: movs r0, 0x1 @081CE62A: bl sub_81CD548 @081CE62E: movs r0, 0x1 b @081CE6B4 @081CE632: movs r0, 0x2 bl sub_81CD548 ldr r1, =0x000028e0 adds r0, r5, r1 bl sub_81D3520 b @081CE62E .align 2, 0 .pool @081CE648: bl sub_81CDC70 ldr r2, =0x00001814 adds r1, r5, r2 bl sub_81D31A4 lsls r0, 24 cmp r0, 0 beq @081CE62E b @081CE6AE .align 2, 0 .pool @081CE660: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0 b @081CE68E @081CE670: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x1 b @081CE68E @081CE680: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x2 @081CE68E: movs r2, 0 bl sub_81CE754 b @081CE62E @081CE696: bl sub_81CDC84 adds r1, r0, 0 lsls r1, 24 asrs r1, 8 lsrs r1, 16 movs r0, 0x3 movs r2, 0 bl sub_81CE754 cmp r0, 0x1 beq @081CE62E @081CE6AE: movs r0, 0x2 b @081CE6B4 @081CE6B2: movs r0, 0x4 @081CE6B4: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81CE5E4 thumb_func_start sub_81CE6BC sub_81CE6BC: ; 81CE6BC push {lr} cmp r0, 0x1 beq @081CE6E6 cmp r0, 0x1 bgt @081CE6CC cmp r0, 0 beq @081CE6D2 b @081CE6FA @081CE6CC: cmp r0, 0x2 beq @081CE6EE b @081CE6FA @081CE6D2: bl sub_81CDD7C lsls r0, 24 lsrs r0, 24 movs r1, 0xB0 movs r2, 0x20 bl sub_811FAA4 @081CE6E2: movs r0, 0x1 b @081CE6FC @081CE6E6: movs r0, 0x5 bl sub_81C7BA4 b @081CE6E2 @081CE6EE: bl sub_81C7BE8 cmp r0, 0x1 bne @081CE6E2 movs r0, 0x2 b @081CE6FC @081CE6FA: movs r0, 0x4 @081CE6FC: pop {r1} bx r1 thumb_func_end sub_81CE6BC thumb_func_start sub_81CE700 sub_81CE700: ; 81CE700 push {lr} cmp r0, 0x1 beq @081CE71E cmp r0, 0x1 bgt @081CE710 cmp r0, 0 beq @081CE716 b @081CE732 @081CE710: cmp r0, 0x2 beq @081CE726 b @081CE732 @081CE716: bl sub_811FAF8 @081CE71A: movs r0, 0x1 b @081CE734 @081CE71E: movs r0, 0x4 bl sub_81C7BA4 b @081CE71A @081CE726: bl sub_81C7BE8 cmp r0, 0x1 bne @081CE71A movs r0, 0x2 b @081CE734 @081CE732: movs r0, 0x4 @081CE734: pop {r1} bx r1 thumb_func_end sub_81CE700 thumb_func_start sub_81CE738 sub_81CE738: ; 81CE738 push {lr} lsls r1, 16 lsrs r1, 16 movs r2, 0x1 movs r3, 0x4 bl decimal_int_to_string ldr r1, =gUnknown_085EBFD7 bl gf_strcpy pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CE738 thumb_func_start sub_81CE754 sub_81CE754: ; 81CE754 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x2C lsls r0, 24 lsrs r4, r0, 24 adds r7, r4, 0 lsls r1, 16 lsrs r1, 16 mov r8, r1 lsls r2, 24 lsrs r5, r2, 24 movs r0, 0xC bl sub_81C763C adds r6, r0, 0 cmp r4, 0x1 beq @081CE7B8 cmp r4, 0x1 bgt @081CE782 cmp r4, 0 beq @081CE78E b @081CE924 @081CE782: cmp r4, 0x2 beq @081CE800 cmp r4, 0x3 bne @081CE78C b @081CE89C @081CE78C: b @081CE924 @081CE78E: movs r1, 0xC1 lsls r1, 5 adds r0, r6, r1 ldrb r0, [r0] movs r1, 0 bl Window_FastFillPixels bl sub_81CDD5C cmp r0, 0x1 beq @081CE7A6 b @081CE924 @081CE7A6: ldr r1, =0x00001821 adds r0, r6, r1 ldrb r0, [r0] movs r1, 0 bl Window_FastFillPixels b @081CE924 .align 2, 0 .pool @081CE7B8: bl sub_81CDC60 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl sub_81CDC50 lsls r0, 16 lsrs r0, 16 subs r0, 0x1 cmp r4, r0 bne @081CE7DA bl sub_81CDD5C cmp r0, 0x1 beq @081CE7DA b @081CE924 @081CE7DA: mov r1, r8 lsls r0, r1, 24 lsrs r0, 24 bl sub_81CDD04 adds r2, r0, 0 movs r1, 0xC1 lsls r1, 5 adds r0, r6, r1 ldrb r0, [r0] str r7, [sp] movs r1, 0 str r1, [sp, 0x4] str r1, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print b @081CE924 @081CE800: bl sub_81CDD5C adds r7, r0, 0 cmp r7, 0x1 beq @081CE80C b @081CE924 @081CE80C: mov r1, r8 lsls r0, r1, 24 lsrs r0, 24 bl sub_81CDD24 adds r2, r0, 0 movs r1, 0xC1 lsls r1, 5 adds r0, r6, r1 ldrb r0, [r0] movs r1, 0x11 str r1, [sp] movs r4, 0 str r4, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0 bl Print add r1, sp, 0xC movs r0, 0xFC strb r0, [r1] movs r0, 0x4 strb r0, [r1, 0x1] movs r0, 0x8 strb r0, [r1, 0x2] adds r0, r1, 0 strb r4, [r0, 0x3] movs r0, 0x9 strb r0, [r1, 0x4] mov r5, sp adds r5, 0x11 ldr r1, =gUnknown_085EBFD7 adds r0, r5, 0 bl gf_strcpy ldr r0, =0x00001821 adds r6, r0 ldrb r0, [r6] str r7, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x1 add r2, sp, 0xC movs r3, 0x4 bl Print bl sub_81CDD48 adds r1, r0, 0 lsls r1, 16 lsrs r1, 16 adds r0, r5, 0 movs r2, 0x1 movs r3, 0x4 bl 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 .pool @081CE89C: ldr r1, =0x00002908 adds r0, r6, r1 ldrb r0, [r0] cmp r0, 0 beq @081CE8B0 cmp r0, 0x1 beq @081CE8EC b @081CE924 .align 2, 0 .pool @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, =0x00002908 adds r1, r6, r0 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] b @081CE924 .align 2, 0 .pool @081CE8EC: cmp r5, 0 beq @081CE904 ldr r1, =0x00001821 adds r0, r6, r1 ldrb r0, [r0] movs r1, 0x3 bl Window_CopyToVram b @081CE910 .align 2, 0 .pool @081CE904: ldr r1, =0x00001821 adds r0, r6, r1 ldrb r0, [r0] movs r1, 0x2 bl Window_CopyToVram @081CE910: ldr r0, =0x00002908 adds r1, r6, r0 movs r0, 0 strb r0, [r1] movs r0, 0x1 b @081CE926 .align 2, 0 .pool @081CE924: movs r0, 0 @081CE926: add sp, 0x2C pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81CE754 thumb_func_start sub_81CE934 sub_81CE934: ; 81CE934 push {r4,lr} movs r0, 0xC bl sub_81C763C adds r4, r0, 0 ldr r1, =0x00001822 adds r0, r4, r1 ldrb r0, [r0] movs r1, 0x3 bl Window_CopyToVram ldr r0, =0x00001823 adds r4, r0 ldrb r0, [r4] movs r1, 0x3 bl Window_CopyToVram pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CE934 thumb_func_start sub_81CE964 sub_81CE964: ; 81CE964 push {r4,r5,lr} adds r5, r0, 0 movs r0, 0x2E ldrsh r4, [r5, r0] bl sub_81CDC60 lsls r0, 16 lsrs r0, 16 cmp r4, r0 bne @081CE982 adds r0, r5, 0 movs r1, 0 bl 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, =0x00001824 adds r0, r6, r1 movs r2, 0x6A strh r2, [r0] ldr r3, =0x00001826 adds r1, r6, r3 strh r2, [r1] bl sub_811F90C bl sub_811FA90 ldr r2, =gUnknown_08623338 movs r0, 0x69 movs r1, 0x69 bl sub_811FF94 ldrb r1, [r0, 0x5] movs r2, 0xC orrs r1, r2 strb r1, [r0, 0x5] movs r1, 0xC0 strh r1, [r0, 0x20] movs r1, 0x20 strh r1, [r0, 0x22] ldr r1, =sub_81CE9C8 str r1, [r0, 0x1C] ldr r2, =0x000028dc adds r1, r6, r2 str r0, [r1] movs r0, 0x69 bl 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 .pool @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, =0x00001806 adds r0, r6, r2 adds r0, r4 strb r3, [r0] ldr r2, =0x02020630 lsls r0, r3, 4 adds r0, r3 lsls r0, 2 adds r1, r0, r2 strh r4, [r1, 0x2E] adds r2, 0x1C adds r0, r2 ldr r1, =sub_81CE964 str r1, [r0] b @081CEAE2 .align 2, 0 .pool @081CEAD8: ldr r3, =0x00001806 adds r0, r6, r3 adds r0, r4 movs r1, 0xFF strb r1, [r0] @081CEAE2: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 @081CEAE8: bl sub_81CDC50 lsls r0, 16 lsrs r0, 16 subs r0, 0x1 cmp r4, r0 blt @081CEA8C movs r0, 0x67 strh r0, [r7] ldr r0, =nullsub_12 str r0, [r7, 0x14] cmp r4, 0x5 bhi @081CEB5C ldr r0, =0x00001806 adds r5, r6, r0 ldr r1, =0x02020630 mov r9, r1 @081CEB0A: lsls r2, r4, 2 adds r2, r4 lsls r2, 18 movs r3, 0x80 lsls r3, 12 adds r2, r3 asrs r2, 16 adds r0, r7, 0 movs r1, 0xE6 movs r3, 0 bl 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 .pool @081CEB4C: adds r1, r5, r4 movs r0, 0xFF strb r0, [r1] @081CEB52: adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x5 bls @081CEB0A @081CEB5C: movs r0, 0x66 strh r0, [r7] ldr r0, =sub_81CE990 str r0, [r7, 0x14] lsls r2, r4, 2 adds r2, r4 lsls r2, 18 movs r0, 0x80 lsls r0, 12 adds r2, r0 asrs r2, 16 adds r0, r7, 0 movs r1, 0xDE movs r3, 0 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x40 beq @081CEBBC ldr r1, =0x00001806 adds r0, r6, r1 adds r0, r4 strb r3, [r0] ldr r0, =0x02020630 lsls r2, r3, 4 adds r2, r3 lsls r2, 2 adds r2, r0 ldrb r3, [r2, 0x1] movs r1, 0x3F adds r0, r1, 0 ands r0, r3 movs r3, 0x40 orrs r0, r3 strb r0, [r2, 0x1] ldrb r0, [r2, 0x3] ands r1, r0 movs r0, 0x80 orrs r1, r0 strb r1, [r2, 0x3] b @081CEBC6 .align 2, 0 .pool @081CEBBC: ldr r2, =0x00001806 adds r0, r6, r2 adds r0, r4 movs r1, 0xFF strb r1, [r0] @081CEBC6: mov r0, r8 mov r1, r10 bl sub_81D32B0 mov r0, r8 bl 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 .pool thumb_func_end sub_81CE9E4 thumb_func_start sub_81CEBF4 sub_81CEBF4: ; 81CEBF4 push {r4,r5,lr} adds r5, r0, 0 bl sub_81CDD5C cmp r0, 0x1 bne @081CEC28 ldr r1, =0x000028dc adds r0, r5, r1 ldr r0, [r0] bl 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 .pool @081CEC28: movs r4, 0 @081CEC2A: ldr r1, =0x00001806 adds r0, r5, r1 adds r0, r4 ldrb r1, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl 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, =0x00001816 adds r1, r5, r0 ldrb r0, [r1] cmp r0, 0xFF beq @081CEC8E adds r1, r0, 0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl 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 .pool thumb_func_end sub_81CEBF4 thumb_func_start sub_81CECA0 sub_81CECA0: ; 81CECA0 push {r4,lr} movs r0, 0xC bl sub_81C763C adds r4, r0, 0 movs r1, 0xC1 lsls r1, 5 adds r0, r4, r1 ldrb r0, [r0] bl Window_Remove bl sub_81CDD5C cmp r0, 0x1 bne @081CECEC ldr r1, =0x00001821 adds r0, r4, r1 ldrb r0, [r0] bl Window_Remove ldr r1, =0x00001822 adds r0, r4, r1 ldrb r0, [r0] bl Window_Remove ldr r1, =0x00001823 adds r0, r4, r1 ldrb r0, [r0] bl Window_Remove b @081CECF0 .align 2, 0 .pool @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, =0x00001814 adds r0, r1 ldrh r0, [r0] adds r0, 0x26 strh r0, [r4, 0x20] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CED10 thumb_func_start sub_81CED30 sub_81CED30: ; 81CED30 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x28 lsls r0, 24 lsrs r6, r0, 24 movs r0, 0xC bl sub_81C763C mov r8, r0 ldr r7, =0x00001816 add r7, r8 ldrb r0, [r7] cmp r0, 0xFF bne @081CEDFC add r5, sp, 0x18 add r4, sp, 0x20 adds r0, r5, 0 mov r1, sp adds r2, r4, 0 bl sub_81D31D0 adds r0, r6, 0 bl sub_81CDCB4 str r0, [sp, 0x18] adds r0, r6, 0 bl sub_81CDCD4 str r0, [sp, 0x20] adds r0, r4, 0 bl gpu_pal_obj_alloc_tag_and_apply lsls r0, 24 lsrs r0, 24 ldr r4, =0x00001818 add r4, r8 strh r0, [r4] adds r0, r5, 0 bl gpu_tile_obj_alloc_tag_and_copy_to_vram ldr r5, =0x0000181a 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 .pool @081CEDBC: strb r0, [r7] ldr r2, =0x02020630 ldrb r1, [r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, =sub_81CED10 str r1, [r0] ldr r1, =0x0000181c add r1, r8 ldrh r0, [r5] lsls r0, 5 ldr r2, =0x06010000 adds r0, r2 str r0, [r1] ldrh r0, [r4] lsls r0, 4 movs r1, 0x80 lsls r1, 1 adds r0, r1 strh r0, [r4] b @081CEE26 .align 2, 0 .pool @081CEDFC: adds r0, r6, 0 bl sub_81CDCB4 ldr r1, =0x0000181c add r1, r8 ldr r2, [r1] ldr r1, =0x040000d4 str r0, [r1] str r2, [r1, 0x4] ldr r0, =0x80000400 str r0, [r1, 0x8] ldr r0, [r1, 0x8] adds r0, r6, 0 bl sub_81CDCD4 ldr r1, =0x00001818 add r1, r8 ldrh r1, [r1] movs r2, 0x20 bl gpu_pal_apply @081CEE26: add sp, 0x28 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CED30 thumb_func_start sub_81CEE44 sub_81CEE44: ; 81CEE44 push {r4,lr} bl sub_81CDC70 adds r4, r0, 0 bl 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, =0x030012bc strb r0, [r1] adds r1, r4, 0 adds r1, 0x50 lsls r2, r0, 2 adds r2, r0 lsls r2, 2 adds r2, 0x14 adds r2, r4, r2 adds r0, r4, 0 bl sub_81D1F84 adds r0, r4, 0 bl sub_81D2074 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CEE90 thumb_func_start sub_81CEEC8 sub_81CEEC8: ; 81CEEC8 push {r4,r5,lr} bl sub_81CDC70 adds r5, r0, 0 bl sub_81CDD5C cmp r0, 0 bne @081CEEF0 bl sub_81CDC60 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl sub_81CDC50 lsls r0, 16 lsrs r0, 16 subs r0, 0x1 cmp r4, r0 beq @081CEF0C @081CEEF0: bl sub_81CDC84 lsls r0, 24 asrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 2 adds r1, 0x14 adds r1, r5, r1 adds r2, r5, 0 adds r2, 0x50 adds r0, r5, 0 bl sub_81D1F84 @081CEF0C: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81CEEC8 thumb_func_start sub_81CEF14 sub_81CEF14: ; 81CEF14 push {r4,lr} movs r0, 0xC bl sub_81C763C adds r4, r0, 0 bl sub_81CDD5C cmp r0, 0x1 beq @081CEF2A movs r0, 0 b @081CEF30 @081CEF2A: ldr r1, =0x00001828 adds r0, r4, r1 ldrb r0, [r0] @081CEF30: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CEF14 thumb_func_start sub_81CEF3C sub_81CEF3C: ; 81CEF3C push {r4,lr} movs r0, 0x7 movs r1, 0x24 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CEF90 ldr r1, =0x000006ac movs r0, 0x12 bl sub_81C761C str r0, [r4, 0x20] cmp r0, 0 beq @081CEF90 ldr r0, =sub_81CF010 str r0, [r4] ldr r0, =sub_81CF11C movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] movs r0, 0 str r0, [r4, 0x18] bl sub_81C76AC ldr r1, =gUnknown_086233A0 lsls r0, 2 adds r0, r1 ldr r0, [r0] str r0, [r4, 0x14] movs r0, 0x1 b @081CEF92 .align 2, 0 .pool @081CEF90: movs r0, 0 @081CEF92: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CEF3C thumb_func_start sub_81CEF98 sub_81CEF98: ; 81CEF98 push {r4,lr} movs r0, 0x7 movs r1, 0x24 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CEFD4 movs r0, 0x12 bl sub_81C763C str r0, [r4, 0x20] ldr r0, =sub_81CF030 str r0, [r4] movs r0, 0x1 str r0, [r4, 0x18] bl sub_81C76AC ldr r1, =gUnknown_086233A0 lsls r0, 2 adds r0, r1 ldr r0, [r0] str r0, [r4, 0x14] movs r0, 0x1 b @081CEFD6 .align 2, 0 .pool @081CEFD4: movs r0, 0 @081CEFD6: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CEF98 thumb_func_start sub_81CEFDC sub_81CEFDC: ; 81CEFDC push {lr} movs r0, 0x7 bl sub_81C763C ldr r1, [r0] bl _call_via_r1 pop {r1} bx r1 thumb_func_end sub_81CEFDC thumb_func_start sub_81CEFF0 sub_81CEFF0: ; 81CEFF0 push {lr} movs r0, 0x7 bl sub_81C763C ldr r0, [r0, 0x1C] cmp r0, 0 bne @081CF004 movs r0, 0x12 bl sub_81C7650 @081CF004: movs r0, 0x7 bl sub_81C7650 pop {r0} bx r0 thumb_func_end sub_81CEFF0 thumb_func_start sub_81CF010 sub_81CF010: ; 81CF010 push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0x4] bl sub_81C70D8 cmp r0, 0 bne @081CF022 ldr r0, =sub_81CF030 str r0, [r4] @081CF022: movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CF010 thumb_func_start sub_81CF030 sub_81CF030: ; 81CF030 push {r4,r5,lr} adds r4, r0, 0 ldr r2, =0x030022c0 ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081CF048 movs r0, 0x1 b @081CF0A6 .align 2, 0 .pool @081CF048: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081CF054 movs r0, 0x2 b @081CF0A6 @081CF054: ldrh r1, [r2, 0x2E] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @081CF062 movs r0, 0x3 b @081CF0A6 @081CF062: movs r0, 0x10 ands r0, r1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0 beq @081CF072 movs r0, 0x4 b @081CF0A6 @081CF072: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081CF088 str r2, [r4, 0x1C] ldr r0, =sub_81CF0B0 str r0, [r4] movs r0, 0x5 b @081CF0A6 .align 2, 0 .pool @081CF088: movs r5, 0x1 adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @081CF096 movs r0, 0 b @081CF0A6 @081CF096: bl sub_81C875C ldr r1, [r4, 0x20] strh r0, [r1, 0x2] str r5, [r4, 0x1C] ldr r0, =sub_81CF0B8 str r0, [r4] movs r0, 0x6 @081CF0A6: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CF030 thumb_func_start sub_81CF0B0 sub_81CF0B0: ; 81CF0B0 ldr r0, =0x000186a3 bx lr .align 2, 0 .pool thumb_func_end sub_81CF0B0 thumb_func_start sub_81CF0B8 sub_81CF0B8: ; 81CF0B8 ldr r0, =0x000186a9 bx lr .align 2, 0 .pool thumb_func_end sub_81CF0B8 thumb_func_start sub_81CF0C0 sub_81CF0C0: ; 81CF0C0 push {lr} movs r0, 0x7 bl sub_81C763C ldr r0, [r0, 0x18] pop {r1} bx r1 thumb_func_end sub_81CF0C0 thumb_func_start sub_81CF0D0 sub_81CF0D0: ; 81CF0D0 push {lr} movs r0, 0x7 bl sub_81C763C ldr r0, [r0, 0x20] adds r0, 0x4 pop {r1} bx r1 thumb_func_end sub_81CF0D0 thumb_func_start sub_81CF0E0 sub_81CF0E0: ; 81CF0E0 push {lr} movs r0, 0x7 bl sub_81C763C ldr r0, [r0, 0x20] ldrh r0, [r0] pop {r1} bx r1 thumb_func_end sub_81CF0E0 thumb_func_start sub_81CF0F0 sub_81CF0F0: ; 81CF0F0 push {r4,lr} movs r0, 0x7 bl sub_81C763C adds r4, r0, 0 bl sub_81C875C ldr r1, [r4, 0x20] lsls r0, 2 adds r1, r0 ldrh r0, [r1, 0x6] pop {r4} pop {r1} bx r1 thumb_func_end sub_81CF0F0 thumb_func_start sub_81CF10C sub_81CF10C: ; 81CF10C push {lr} movs r0, 0x7 bl sub_81C763C ldr r0, [r0, 0x20] ldrh r0, [r0, 0x2] pop {r1} bx r1 thumb_func_end sub_81CF10C thumb_func_start sub_81CF11C sub_81CF11C: ; 81CF11C push {lr} ldr r2, =gUnknown_086233B4 lsls r1, r0, 2 adds r1, r2 ldr r1, [r1] bl _call_via_r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CF11C thumb_func_start sub_81CF134 sub_81CF134: ; 81CF134 push {r4-r6,lr} sub sp, 0x4 movs r0, 0x7 bl sub_81C763C adds r6, r0, 0 ldr r0, [r6, 0x20] movs r1, 0 strh r1, [r0] ldr r0, [r6, 0x20] strh r1, [r0, 0x2] ldr r1, =0xffffff00 ldr r0, [sp] ands r0, r1 movs r1, 0xE orrs r0, r1 str r0, [sp] movs r5, 0 @081CF158: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 bl pokemon_getattr cmp r0, 0 beq @081CF1AA adds r0, r4, 0 movs r1, 0x6 bl pokemon_getattr cmp r0, 0 bne @081CF1A4 lsls r1, r5, 24 lsrs r1, 16 ldr r2, =0xffff00ff ldr r0, [sp] ands r0, r2 orrs r0, r1 str r0, [sp] ldr r1, [r6, 0x14] adds r0, r4, 0 bl pokemon_getattr lsls r0, 16 ldr r2, =0x0000ffff ldr r1, [sp] ands r1, r2 orrs r1, r0 str r1, [sp] adds r0, r6, 0 mov r1, sp bl sub_81CF2C4 @081CF1A4: adds r5, 0x1 cmp r5, 0x5 ble @081CF158 @081CF1AA: movs r0, 0x1 add sp, 0x4 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CF134 thumb_func_start sub_81CF1C4 sub_81CF1C4: ; 81CF1C4 push {lr} movs r0, 0x7 bl sub_81C763C movs r1, 0 str r1, [r0, 0x10] str r1, [r0, 0xC] movs r0, 0x1 pop {r1} bx r1 thumb_func_end sub_81CF1C4 thumb_func_start sub_81CF1D8 sub_81CF1D8: ; 81CF1D8 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x4 movs r0, 0x7 bl sub_81C763C adds r6, r0, 0 ldr r5, [r6, 0xC] ldr r4, [r6, 0x10] movs r0, 0 mov r8, r0 cmp r5, 0xD bgt @081CF268 @081CF1F4: cmp r4, 0x1D bgt @081CF260 lsls r0, r5, 24 lsrs r7, r0, 24 @081CF1FC: adds r0, r5, 0 adds r1, r4, 0 bl sub_80D2270 cmp r0, 0 beq @081CF23A ldr r1, =0xffffff00 ldr r0, [sp] ands r0, r1 orrs r0, r7 lsls r1, r4, 24 lsrs r1, 24 lsls r3, r1, 8 ldr r2, =0xffff00ff ands r0, r2 orrs r0, r3 str r0, [sp] ldr r2, [r6, 0x14] adds r0, r7, 0 bl get_pokemon_data_from_any_box lsls r0, 16 ldr r2, =0x0000ffff ldr r1, [sp] ands r1, r2 orrs r1, r0 str r1, [sp] adds r0, r6, 0 mov r1, sp bl sub_81CF2C4 @081CF23A: movs r0, 0x1 add r8, r0 adds r4, 0x1 mov r0, r8 cmp r0, 0xE ble @081CF25C str r5, [r6, 0xC] str r4, [r6, 0x10] movs r0, 0x3 b @081CF26A .align 2, 0 .pool @081CF25C: cmp r4, 0x1D ble @081CF1FC @081CF260: movs r4, 0 adds r5, 0x1 cmp r5, 0xD ble @081CF1F4 @081CF268: movs r0, 0x1 @081CF26A: add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81CF1D8 thumb_func_start sub_81CF278 sub_81CF278: ; 81CF278 push {r4-r6,lr} movs r0, 0x7 bl sub_81C763C adds r5, r0, 0 ldr r0, [r5, 0x20] ldrh r6, [r0] ldrh r4, [r0, 0x6] movs r1, 0x1 strh r1, [r0, 0x6] movs r3, 0x1 cmp r3, r6 bge @081CF2B8 @081CF292: ldr r2, [r5, 0x20] lsls r0, r3, 2 adds r1, r2, r0 ldrh r0, [r1, 0x6] cmp r0, r4 bne @081CF2AC subs r0, r3, 0x1 lsls r0, 2 adds r0, r2, r0 ldrh r0, [r0, 0x6] strh r0, [r1, 0x6] adds r0, r3, 0x1 b @081CF2B2 @081CF2AC: adds r4, r0, 0 adds r0, r3, 0x1 strh r0, [r1, 0x6] @081CF2B2: adds r3, r0, 0 cmp r3, r6 blt @081CF292 @081CF2B8: movs r0, 0x1 str r0, [r5, 0x18] movs r0, 0x4 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81CF278 thumb_func_start sub_81CF2C4 sub_81CF2C4: ; 81CF2C4 push {r4-r7,lr} adds r5, r0, 0 adds r7, r1, 0 movs r1, 0 ldr r0, [r5, 0x20] ldrh r2, [r0] lsrs r3, r2, 1 cmp r2, r3 beq @081CF2F4 adds r6, r0, 0 ldrh r4, [r7, 0x2] @081CF2DA: lsls r0, r3, 2 adds r0, r6, r0 ldrh r0, [r0, 0x6] cmp r4, r0 bls @081CF2E8 adds r2, r3, 0 b @081CF2EA @081CF2E8: adds r1, r3, 0x1 @081CF2EA: subs r0, r2, r1 lsrs r0, 1 adds r3, r1, r0 cmp r2, r3 bne @081CF2DA @081CF2F4: ldr r0, [r5, 0x20] ldrh r2, [r0] lsls r6, r3, 2 cmp r2, r3 bls @081CF318 lsls r0, r2, 2 subs r4, r0, 0x4 @081CF302: ldr r0, [r5, 0x20] lsls r1, r2, 2 adds r0, 0x4 adds r1, r0, r1 adds r0, r4 ldr r0, [r0] str r0, [r1] subs r4, 0x4 subs r2, 0x1 cmp r2, r3 bhi @081CF302 @081CF318: ldr r0, [r5, 0x20] adds r0, 0x4 adds r0, r6 ldr r1, [r7] str r1, [r0] ldr r1, [r5, 0x20] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81CF2C4 thumb_func_start sub_81CF330 sub_81CF330: ; 81CF330 push {r4,lr} movs r1, 0x81 lsls r1, 4 movs r0, 0x8 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CF360 ldr r0, =sub_81CF418 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] ldr r0, =sub_81CF3E4 str r0, [r4] movs r0, 0 str r0, [r4, 0xC] movs r0, 0x1 b @081CF362 .align 2, 0 .pool @081CF360: movs r0, 0 @081CF362: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CF330 thumb_func_start sub_81CF368 sub_81CF368: ; 81CF368 push {r4,lr} movs r1, 0x81 lsls r1, 4 movs r0, 0x8 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CF398 ldr r0, =sub_81CF418 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] ldr r0, =sub_81CF3E4 str r0, [r4] movs r0, 0x1 str r0, [r4, 0xC] b @081CF39A .align 2, 0 .pool @081CF398: movs r0, 0 @081CF39A: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CF368 thumb_func_start sub_81CF3A0 sub_81CF3A0: ; 81CF3A0 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x8 bl sub_81C763C adds r5, r0, 0 ldr r0, =gUnknown_08623598 lsls r4, 2 adds r4, r0 ldr r0, [r4] movs r1, 0x1 bl sub_81C7078 str r0, [r5, 0x4] ldr r0, =sub_81CF3E4 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CF3A0 thumb_func_start sub_81CF3D0 sub_81CF3D0: ; 81CF3D0 push {lr} movs r0, 0x8 bl sub_81C763C ldr r0, [r0] bl _call_via_r0 pop {r1} bx r1 thumb_func_end sub_81CF3D0 thumb_func_start sub_81CF3E4 sub_81CF3E4: ; 81CF3E4 push {lr} movs r0, 0x8 bl sub_81C763C ldr r0, [r0, 0x4] bl sub_81C70D8 pop {r1} bx r1 thumb_func_end sub_81CF3E4 thumb_func_start sub_81CF3F8 sub_81CF3F8: ; 81CF3F8 push {r4,lr} movs r0, 0x8 bl sub_81C763C adds r4, r0, 0 bl sub_81C8234 ldrb r0, [r4, 0x8] bl 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, =@081CF43C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CF43C: .4byte @081CF454 .4byte @081CF4AC .4byte @081CF4C0 .4byte @081CF4E0 .4byte @081CF4F6 .4byte @081CF55A @081CF454: ldr r0, =gUnknown_08623590 movs r1, 0x2 bl sub_81C7B54 ldr r1, =gUnknown_086233E4 movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram adds r1, r5, 0 adds r1, 0x10 movs r0, 0x1 bl bg_set_tilemap ldr r1, =gUnknown_086234AC 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, =gUnknown_086233C4 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 .pool @081CF4AC: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081CF56A bl sub_81CF0C0 cmp r0, 0 beq @081CF56A b @081CF498 @081CF4C0: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081CF56A ldr r0, =gUnknown_08623570 movs r1, 0x20 movs r2, 0x20 bl sub_81C7944 bl sub_81CF88C b @081CF498 .align 2, 0 .pool @081CF4E0: bl sub_81C8224 cmp r0, 0 bne @081CF56A adds r0, r5, 0 bl sub_81CF7C8 movs r0, 0x3 bl sub_81C7BA4 b @081CF498 @081CF4F6: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081CF56A movs r0, 0x1 movs r1, 0 movs r2, 0 bl 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, =gUnknown_086235B4 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 .pool thumb_func_end sub_81CF7C8 thumb_func_start sub_81CF7F4 sub_81CF7F4: ; 81CF7F4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC mov r8, r0 bl sub_81CF0F0 adds r7, r0, 0 bl sub_81AFBF0 ldr r4, =0x02021cc4 movs r0, 0 adds r1, r4, 0 bl sub_81AFC0C movs r0, 0xFF strb r0, [r4] ldr r5, =0x02021dc4 ldr r1, =gUnknown_085EC029 adds r0, r5, 0 bl sub_81AFC28 mov r1, r8 ldrb r0, [r1, 0x8] movs r1, 0x1 mov r10, r1 str r1, [sp] movs r1, 0xFF mov r9, r1 str r1, [sp, 0x4] movs r6, 0 str r6, [sp, 0x8] movs r1, 0x1 adds r2, r5, 0 movs r3, 0x4 bl Print adds r0, r4, 0 adds r1, r7, 0 movs r2, 0x1 movs r3, 0x3 bl 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 .pool thumb_func_end sub_81CF7F4 thumb_func_start sub_81CF88C sub_81CF88C: ; 81CF88C push {r4,lr} sub sp, 0x18 bl sub_81CF0D0 str r0, [sp] bl sub_81CF0E0 mov r1, sp movs r4, 0 strh r0, [r1, 0x4] movs r0, 0x4 strb r0, [r1, 0x8] bl sub_81CF10C mov r1, sp strh r0, [r1, 0x6] movs r0, 0xD strb r0, [r1, 0x9] movs r0, 0x11 strb r0, [r1, 0xA] mov r0, sp movs r2, 0x1 strb r2, [r0, 0xB] movs r0, 0x8 strb r0, [r1, 0xC] movs r0, 0x2 strb r0, [r1, 0xD] mov r0, sp strb r2, [r0, 0xE] ldr r0, =sub_81CF8E4 str r0, [sp, 0x10] str r4, [sp, 0x14] ldr r0, =gUnknown_08623594 movs r2, 0 bl sub_81C81D4 add sp, 0x18 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CF88C thumb_func_start sub_81CF8E4 sub_81CF8E4: ; 81CF8E4 push {r4-r7,lr} adds r2, r0, 0 adds r6, r1, 0 ldrb r0, [r2] cmp r0, 0xE bne @081CF924 ldrb r1, [r2, 0x1] movs r0, 0x64 adds r4, r1, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 bl pokemon_get_gender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 bl level_by_exp lsls r0, 24 lsrs r7, r0, 24 ldr r2, =0x02021ec4 adds r0, r4, 0 movs r1, 0x2 bl pokemon_getattr b @081CF94A .align 2, 0 .pool @081CF924: ldrb r0, [r2] ldrb r1, [r2, 0x1] bl get_pokemon_by_box_and_pos adds r4, r0, 0 bl pokemon_roll_gender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 bl sub_80690C0 lsls r0, 24 lsrs r7, r0, 24 ldr r2, =0x02021ec4 adds r0, r4, 0 movs r1, 0x2 bl pokemon_getattr_encrypted @081CF94A: ldr r4, =0x02021ec4 adds r0, r4, 0 bl 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, =gUnknown_086235D4 b @081CF97E .align 2, 0 .pool @081CF974: ldr r1, =gUnknown_086235BC b @081CF97E .align 2, 0 .pool @081CF97C: ldr r1, =gUnknown_086235C8 @081CF97E: ldr r4, =0x02021cc4 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 .pool thumb_func_end sub_81CF8E4 thumb_func_start sub_81CF9BC sub_81CF9BC: ; 81CF9BC push {r4,lr} movs r0, 0x9 movs r1, 0x20 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CF9FC ldr r1, =0x000006ac movs r0, 0x12 bl sub_81C761C str r0, [r4, 0x1C] cmp r0, 0 beq @081CF9FC ldr r0, =sub_81CFA68 str r0, [r4] ldr r0, =sub_81CFB74 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] movs r0, 0 str r0, [r4, 0x14] movs r0, 0x1 b @081CF9FE .align 2, 0 .pool @081CF9FC: movs r0, 0 @081CF9FE: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CF9BC thumb_func_start sub_81CFA04 sub_81CFA04: ; 81CFA04 push {r4,lr} movs r0, 0x9 movs r1, 0x20 bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CFA2C movs r0, 0x12 bl sub_81C763C str r0, [r4, 0x1C] ldr r0, =sub_81CFA88 str r0, [r4] movs r0, 0x1 str r0, [r4, 0x14] b @081CFA2E .align 2, 0 .pool @081CFA2C: movs r0, 0 @081CFA2E: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CFA04 thumb_func_start sub_81CFA34 sub_81CFA34: ; 81CFA34 push {lr} movs r0, 0x9 bl sub_81C763C ldr r1, [r0] bl _call_via_r1 pop {r1} bx r1 thumb_func_end sub_81CFA34 thumb_func_start sub_81CFA48 sub_81CFA48: ; 81CFA48 push {lr} movs r0, 0x9 bl sub_81C763C ldr r0, [r0, 0x18] cmp r0, 0 bne @081CFA5C movs r0, 0x12 bl sub_81C7650 @081CFA5C: movs r0, 0x9 bl sub_81C7650 pop {r0} bx r0 thumb_func_end sub_81CFA48 thumb_func_start sub_81CFA68 sub_81CFA68: ; 81CFA68 push {r4,lr} adds r4, r0, 0 ldr r0, [r4, 0x4] bl sub_81C70D8 cmp r0, 0 bne @081CFA7A ldr r0, =sub_81CFA88 str r0, [r4] @081CFA7A: movs r0, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CFA68 thumb_func_start sub_81CFA88 sub_81CFA88: ; 81CFA88 push {r4,r5,lr} adds r4, r0, 0 ldr r2, =0x030022c0 ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081CFAA0 movs r0, 0x1 b @081CFAFE .align 2, 0 .pool @081CFAA0: movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081CFAAC movs r0, 0x2 b @081CFAFE @081CFAAC: ldrh r1, [r2, 0x2E] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @081CFABA movs r0, 0x3 b @081CFAFE @081CFABA: movs r0, 0x10 ands r0, r1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0 beq @081CFACA movs r0, 0x4 b @081CFAFE @081CFACA: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081CFAE0 str r2, [r4, 0x18] ldr r0, =sub_81CFB08 str r0, [r4] movs r0, 0x5 b @081CFAFE .align 2, 0 .pool @081CFAE0: movs r5, 0x1 adds r0, r5, 0 ands r0, r1 cmp r0, 0 bne @081CFAEE movs r0, 0 b @081CFAFE @081CFAEE: bl sub_81C875C ldr r1, [r4, 0x1C] strh r0, [r1, 0x2] str r5, [r4, 0x18] ldr r0, =sub_81CFB10 str r0, [r4] movs r0, 0x6 @081CFAFE: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CFA88 thumb_func_start sub_81CFB08 sub_81CFB08: ; 81CFB08 ldr r0, =0x000186a5 bx lr .align 2, 0 .pool thumb_func_end sub_81CFB08 thumb_func_start sub_81CFB10 sub_81CFB10: ; 81CFB10 ldr r0, =0x000186ad bx lr .align 2, 0 .pool thumb_func_end sub_81CFB10 thumb_func_start sub_81CFB18 sub_81CFB18: ; 81CFB18 push {lr} movs r0, 0x9 bl sub_81C763C ldr r0, [r0, 0x14] pop {r1} bx r1 thumb_func_end sub_81CFB18 thumb_func_start sub_81CFB28 sub_81CFB28: ; 81CFB28 push {lr} movs r0, 0x9 bl sub_81C763C ldr r0, [r0, 0x1C] adds r0, 0x4 pop {r1} bx r1 thumb_func_end sub_81CFB28 thumb_func_start sub_81CFB38 sub_81CFB38: ; 81CFB38 push {lr} movs r0, 0x9 bl sub_81C763C ldr r0, [r0, 0x1C] ldrh r0, [r0] pop {r1} bx r1 thumb_func_end sub_81CFB38 thumb_func_start sub_81CFB48 sub_81CFB48: ; 81CFB48 push {r4,lr} movs r0, 0x9 bl sub_81C763C adds r4, r0, 0 bl sub_81C875C ldr r1, [r4, 0x1C] lsls r0, 2 adds r1, r0 ldrh r0, [r1, 0x6] pop {r4} pop {r1} bx r1 thumb_func_end sub_81CFB48 thumb_func_start sub_81CFB64 sub_81CFB64: ; 81CFB64 push {lr} movs r0, 0x9 bl sub_81C763C ldr r0, [r0, 0x1C] ldrh r0, [r0, 0x2] pop {r1} bx r1 thumb_func_end sub_81CFB64 thumb_func_start sub_81CFB74 sub_81CFB74: ; 81CFB74 push {lr} ldr r2, =gUnknown_086235D8 lsls r1, r0, 2 adds r1, r2 ldr r1, [r1] bl _call_via_r1 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CFB74 thumb_func_start sub_81CFB8C sub_81CFB8C: ; 81CFB8C push {r4-r6,lr} sub sp, 0x4 movs r0, 0x9 bl sub_81C763C adds r6, r0, 0 ldr r0, [r6, 0x1C] movs r1, 0 strh r1, [r0] ldr r0, [r6, 0x1C] strh r1, [r0, 0x2] ldr r1, =0xffffff00 ldr r0, [sp] ands r0, r1 movs r1, 0xE orrs r0, r1 str r0, [sp] movs r5, 0 @081CFBB0: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 bl pokemon_getattr cmp r0, 0 beq @081CFC10 adds r0, r4, 0 movs r1, 0x6 bl pokemon_getattr cmp r0, 0 bne @081CFC0A adds r0, r4, 0 movs r1, 0x4 bl pokemon_getattr cmp r0, 0 bne @081CFC0A adds r0, r4, 0 movs r1, 0x52 bl pokemon_getattr adds r3, r0, 0 cmp r3, 0 beq @081CFC0A lsls r1, r5, 24 lsrs r1, 16 ldr r2, =0xffff00ff ldr r0, [sp] ands r0, r2 orrs r0, r1 lsls r2, r3, 16 ldr r1, =0x0000ffff ands r0, r1 orrs r0, r2 str r0, [sp] adds r0, r6, 0 mov r1, sp bl sub_81CFCEC @081CFC0A: adds r5, 0x1 cmp r5, 0x5 ble @081CFBB0 @081CFC10: movs r0, 0x1 add sp, 0x4 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81CFB8C thumb_func_start sub_81CFC2C sub_81CFC2C: ; 81CFC2C push {lr} movs r0, 0x9 bl sub_81C763C movs r1, 0 str r1, [r0, 0x10] str r1, [r0, 0xC] movs r0, 0x1 pop {r1} bx r1 thumb_func_end sub_81CFC2C thumb_func_start sub_81CFC40 sub_81CFC40: ; 81CFC40 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 movs r0, 0x9 bl sub_81C763C mov r8, r0 ldr r7, [r0, 0xC] ldr r6, [r0, 0x10] movs r0, 0 mov r9, r0 cmp r7, 0xD bgt @081CFCD4 b @081CFCC8 @081CFC60: adds r0, r7, 0 adds r1, r6, 0 bl sub_80D2270 cmp r0, 0 beq @081CFCA6 lsls r0, r7, 24 lsrs r5, r0, 24 lsls r0, r6, 24 lsrs r4, r0, 24 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x52 bl get_pokemon_data_from_any_box adds r3, r0, 0 cmp r3, 0 beq @081CFCA6 ldr r1, =0xffffff00 ldr r0, [sp] ands r0, r1 orrs r0, r5 lsls r2, r4, 8 ldr r1, =0xffff00ff ands r0, r1 orrs r0, r2 lsls r2, r3, 16 ldr r1, =0x0000ffff ands r0, r1 orrs r0, r2 str r0, [sp] mov r0, r8 mov r1, sp bl sub_81CFCEC @081CFCA6: movs r1, 0x1 add r9, r1 adds r6, 0x1 mov r0, r9 cmp r0, 0xE ble @081CFCC8 mov r1, r8 str r7, [r1, 0xC] str r6, [r1, 0x10] movs r0, 0x3 b @081CFCDC .align 2, 0 .pool @081CFCC8: cmp r6, 0x1D ble @081CFC60 movs r6, 0 adds r7, 0x1 cmp r7, 0xD ble @081CFCC8 @081CFCD4: movs r0, 0x1 mov r1, r8 str r0, [r1, 0x14] movs r0, 0x4 @081CFCDC: add sp, 0x4 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81CFC40 thumb_func_start sub_81CFCEC sub_81CFCEC: ; 81CFCEC push {r4-r7,lr} adds r5, r0, 0 adds r7, r1, 0 movs r1, 0 ldr r0, [r5, 0x1C] ldrh r2, [r0] lsrs r3, r2, 1 cmp r2, r3 beq @081CFD1C adds r6, r0, 0 ldrh r4, [r7, 0x2] @081CFD02: lsls r0, r3, 2 adds r0, r6, r0 ldrh r0, [r0, 0x6] cmp r4, r0 bls @081CFD10 adds r2, r3, 0 b @081CFD12 @081CFD10: adds r1, r3, 0x1 @081CFD12: subs r0, r2, r1 lsrs r0, 1 adds r3, r1, r0 cmp r2, r3 bne @081CFD02 @081CFD1C: ldr r0, [r5, 0x1C] ldrh r2, [r0] lsls r6, r3, 2 cmp r2, r3 bls @081CFD40 lsls r0, r2, 2 subs r4, r0, 0x4 @081CFD2A: ldr r0, [r5, 0x1C] lsls r1, r2, 2 adds r0, 0x4 adds r1, r0, r1 adds r0, r4 ldr r0, [r0] str r0, [r1] subs r4, 0x4 subs r2, 0x1 cmp r2, r3 bhi @081CFD2A @081CFD40: ldr r0, [r5, 0x1C] adds r0, 0x4 adds r0, r6 ldr r1, [r7] str r1, [r0] ldr r1, [r5, 0x1C] ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81CFCEC thumb_func_start sub_81CFD58 sub_81CFD58: ; 81CFD58 push {r4-r6,lr} movs r5, 0 @081CFD5C: movs r0, 0x64 adds r1, r5, 0 muls r1, r0 ldr r0, =0x020244ec adds r4, r1, r0 adds r0, r4, 0 movs r1, 0x5 bl pokemon_getattr cmp r0, 0 beq @081CFD8A adds r0, r4, 0 movs r1, 0x6 bl pokemon_getattr cmp r0, 0 bne @081CFD8A adds r0, r4, 0 movs r1, 0x53 bl pokemon_getattr cmp r0, 0 bne @081CFDB2 @081CFD8A: adds r5, 0x1 cmp r5, 0x5 ble @081CFD5C movs r5, 0 @081CFD92: movs r4, 0 lsls r6, r5, 24 @081CFD96: adds r0, r5, 0 adds r1, r4, 0 bl sub_80D2270 cmp r0, 0 beq @081CFDBC lsls r1, r4, 24 lsrs r1, 24 lsrs r0, r6, 24 movs r2, 0x53 bl get_pokemon_data_from_any_box cmp r0, 0 beq @081CFDBC @081CFDB2: movs r0, 0x1 b @081CFDCA .align 2, 0 .pool @081CFDBC: adds r4, 0x1 cmp r4, 0x1D ble @081CFD96 adds r5, 0x1 cmp r5, 0xD ble @081CFD92 movs r0, 0 @081CFDCA: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81CFD58 thumb_func_start sub_81CFDD0 sub_81CFDD0: ; 81CFDD0 push {r4,lr} movs r1, 0x81 lsls r1, 4 movs r0, 0xA bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CFE00 ldr r0, =sub_81CFEB8 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] ldr r0, =sub_81CFE84 str r0, [r4] movs r0, 0 str r0, [r4, 0xC] movs r0, 0x1 b @081CFE02 .align 2, 0 .pool @081CFE00: movs r0, 0 @081CFE02: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CFDD0 thumb_func_start sub_81CFE08 sub_81CFE08: ; 81CFE08 push {r4,lr} movs r1, 0x81 lsls r1, 4 movs r0, 0xA bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081CFE38 ldr r0, =sub_81CFEB8 movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] ldr r0, =sub_81CFE84 str r0, [r4] movs r0, 0x1 str r0, [r4, 0xC] b @081CFE3A .align 2, 0 .pool @081CFE38: movs r0, 0 @081CFE3A: pop {r4} pop {r1} bx r1 thumb_func_end sub_81CFE08 thumb_func_start sub_81CFE40 sub_81CFE40: ; 81CFE40 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0xA bl sub_81C763C adds r5, r0, 0 ldr r0, =gUnknown_086237B8 lsls r4, 2 adds r4, r0 ldr r0, [r4] movs r1, 0x1 bl sub_81C7078 str r0, [r5, 0x4] ldr r0, =sub_81CFE84 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81CFE40 thumb_func_start sub_81CFE70 sub_81CFE70: ; 81CFE70 push {lr} movs r0, 0xA bl sub_81C763C ldr r0, [r0] bl _call_via_r0 pop {r1} bx r1 thumb_func_end sub_81CFE70 thumb_func_start sub_81CFE84 sub_81CFE84: ; 81CFE84 push {lr} movs r0, 0xA bl sub_81C763C ldr r0, [r0, 0x4] bl sub_81C70D8 pop {r1} bx r1 thumb_func_end sub_81CFE84 thumb_func_start sub_81CFE98 sub_81CFE98: ; 81CFE98 push {r4,lr} movs r0, 0xA bl sub_81C763C adds r4, r0, 0 bl sub_81C8234 ldrb r0, [r4, 0x8] bl 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, =@081CFEDC adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081CFEDC: .4byte @081CFEF4 .4byte @081CFF48 .4byte @081CFF76 .4byte @081CFF94 .4byte @081CFFA4 .4byte @081CFFDE @081CFEF4: ldr r0, =gUnknown_086237B0 movs r1, 0x2 bl sub_81C7B54 ldr r1, =gUnknown_08623604 movs r0, 0 str r0, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram adds r1, r5, 0 adds r1, 0x10 movs r0, 0x1 bl bg_set_tilemap ldr r1, =gUnknown_086236CC movs r0, 0x1 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r0, =gUnknown_086235E4 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 .pool @081CFF48: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081CFFEE bl sub_81CFB18 cmp r0, 0 beq @081CFFEE movs r0, 0x1 movs r1, 0 movs r2, 0 bl 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, =gUnknown_08623790 movs r1, 0x20 movs r2, 0x20 bl sub_81C7944 bl sub_81D0304 b @081CFF32 .align 2, 0 .pool @081CFF94: bl sub_81C8224 cmp r0, 0 bne @081CFFEE adds r0, r5, 0 bl sub_81D024C b @081CFF32 @081CFFA4: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081CFFEE movs r0, 0x2 bl 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, =gUnknown_086237D4 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 .pool thumb_func_end sub_81D024C thumb_func_start sub_81D0288 sub_81D0288: ; 81D0288 push {r4,r5,lr} adds r5, r0, 0 bl sub_81C875C adds r4, r0, 0 bl sub_81CFB38 adds r2, r0, 0 ldrh r0, [r5, 0x8] adds r4, 0x1 adds r1, r4, 0 bl sub_81D02B0 ldrb r0, [r5, 0x8] movs r1, 0x2 bl 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, =sub_81D035C str r0, [sp, 0x10] str r4, [sp, 0x14] ldr r0, =gUnknown_086237B4 movs r2, 0 bl sub_81C81D4 add sp, 0x18 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D0304 thumb_func_start sub_81D035C sub_81D035C: ; 81D035C push {r4-r7,lr} mov r7, r8 push {r7} adds r6, r1, 0 adds r7, r0, 0 ldrb r0, [r7] cmp r0, 0xE bne @081D03A4 ldrb r1, [r7, 0x1] movs r0, 0x64 adds r4, r1, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 bl pokemon_get_gender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 bl level_by_exp lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r2, =0x02021ec4 adds r0, r4, 0 movs r1, 0x2 bl pokemon_getattr b @081D03CC .align 2, 0 .pool @081D03A4: ldrb r0, [r7] ldrb r1, [r7, 0x1] bl get_pokemon_by_box_and_pos adds r4, r0, 0 bl pokemon_roll_gender lsls r0, 24 lsrs r5, r0, 24 adds r0, r4, 0 bl sub_80690C0 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r2, =0x02021ec4 adds r0, r4, 0 movs r1, 0x2 bl pokemon_getattr_encrypted @081D03CC: ldr r4, =0x02021ec4 adds r0, r4, 0 bl 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, =gUnknown_086237F4 b @081D0402 .align 2, 0 .pool @081D03F8: ldr r1, =gUnknown_086237DC b @081D0402 .align 2, 0 .pool @081D0400: ldr r1, =gUnknown_086237E8 @081D0402: ldr r4, =0x02021cc4 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 .pool thumb_func_end sub_81D035C thumb_func_start sub_81D0450 sub_81D0450: ; 81D0450 push {r4,lr} movs r0, 0xD movs r1, 0x9C bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081D0498 movs r0, 0x12 bl sub_81C763C str r0, [r4, 0x8] cmp r0, 0 beq @081D0498 adds r0, r4, 0 bl sub_81D0814 adds r1, r4, 0 adds r1, 0x98 ldr r0, =sub_81D04C4 str r0, [r1] ldr r1, =0x030026fc movs r0, 0x3 strh r0, [r1] ldr r1, =0x030022b0 movs r0, 0xA strh r0, [r1] movs r0, 0x1 b @081D049A .align 2, 0 .pool @081D0498: movs r0, 0 @081D049A: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D0450 thumb_func_start sub_81D04A0 sub_81D04A0: ; 81D04A0 push {lr} movs r0, 0xD bl sub_81C763C adds r1, r0, 0 adds r1, 0x98 ldr r1, [r1] bl _call_via_r1 pop {r1} bx r1 thumb_func_end sub_81D04A0 thumb_func_start sub_81D04B8 sub_81D04B8: ; 81D04B8 push {lr} movs r0, 0xD bl sub_81C7650 pop {r0} bx r0 thumb_func_end sub_81D04B8 thumb_func_start sub_81D04C4 sub_81D04C4: ; 81D04C4 push {r4,lr} adds r4, r0, 0 ldr r2, =0x030022c0 ldrh r1, [r2, 0x30] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081D04E4 ldr r3, [r4, 0x8] ldrh r0, [r3, 0x2] cmp r0, 0 beq @081D04E4 subs r0, 0x1 b @081D04FC .align 2, 0 .pool @081D04E4: ldrh r1, [r2, 0x30] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081D050C ldr r3, [r4, 0x8] ldrh r1, [r3, 0x2] ldrh r0, [r3] subs r0, 0x1 cmp r1, r0 bge @081D050C adds r0, r1, 0x1 @081D04FC: movs r1, 0 strh r0, [r3, 0x2] strh r1, [r4, 0xC] adds r0, r4, 0 bl sub_81D0814 movs r0, 0x1 b @081D053E @081D050C: ldrh r2, [r2, 0x2E] movs r0, 0x1 ands r0, r2 cmp r0, 0 beq @081D0528 adds r1, r4, 0 adds r1, 0x98 ldr r0, =sub_81D0548 str r0, [r1] movs r0, 0x2 b @081D053E .align 2, 0 .pool @081D0528: movs r0, 0x2 ands r0, r2 cmp r0, 0 bne @081D0534 movs r0, 0 b @081D053E @081D0534: adds r1, r4, 0 adds r1, 0x98 ldr r0, =sub_81D05D4 str r0, [r1] movs r0, 0x5 @081D053E: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D04C4 thumb_func_start sub_81D0548 sub_81D0548: ; 81D0548 push {r4,lr} adds r4, r0, 0 ldr r0, =0x030022c0 ldrh r1, [r0, 0x30] movs r0, 0x40 ands r0, r1 cmp r0, 0 beq @081D0562 adds r0, r4, 0 bl sub_81D05DC cmp r0, 0 bne @081D05A4 @081D0562: ldr r0, =0x030022c0 ldrh r1, [r0, 0x30] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq @081D0578 adds r0, r4, 0 bl sub_81D061C cmp r0, 0 bne @081D05A4 @081D0578: ldr r0, =0x030022c0 ldrh r1, [r0, 0x30] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @081D058E adds r0, r4, 0 bl sub_81D0664 cmp r0, 0 bne @081D05A4 @081D058E: ldr r0, =0x030022c0 ldrh r1, [r0, 0x30] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @081D05AC adds r0, r4, 0 bl sub_81D0688 cmp r0, 0 beq @081D05AC @081D05A4: movs r0, 0x3 b @081D05CA .align 2, 0 .pool @081D05AC: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081D05C0 movs r0, 0 b @081D05CA .align 2, 0 .pool @081D05C0: adds r1, r4, 0 adds r1, 0x98 ldr r0, =sub_81D04C4 str r0, [r1] movs r0, 0x4 @081D05CA: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D0548 thumb_func_start sub_81D05D4 sub_81D05D4: ; 81D05D4 ldr r0, =0x000186ae bx lr .align 2, 0 .pool thumb_func_end sub_81D05D4 thumb_func_start sub_81D05DC sub_81D05DC: ; 81D05DC push {r4,lr} adds r1, r0, 0 ldrh r0, [r1, 0xC] adds r2, r0, 0 cmp r2, 0x18 bhi @081D05F0 cmp r2, 0x8 bls @081D0612 subs r0, 0x9 b @081D060C @081D05F0: ldrh r3, [r1, 0x10] adds r2, r3, 0 cmp r2, 0 beq @081D0612 ldrh r0, [r1, 0xC] subs r0, 0x1B ldrh r4, [r1, 0xE] adds r0, r4 strh r0, [r1, 0xC] lsls r0, 16 lsrs r0, 16 cmp r0, r2 bcc @081D060E subs r0, r3, 0x1 @081D060C: strh r0, [r1, 0xC] @081D060E: movs r0, 0x1 b @081D0614 @081D0612: movs r0, 0 @081D0614: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D05DC thumb_func_start sub_81D061C sub_81D061C: ; 81D061C push {lr} adds r2, r0, 0 ldrh r0, [r2, 0xC] adds r1, r0, 0 cmp r1, 0x18 bhi @081D065C ldrh r3, [r2, 0xE] cmp r1, r3 bcs @081D0640 adds r0, 0x9 strh r0, [r2, 0xC] ldrh r1, [r2, 0x10] lsls r0, 16 lsrs r0, 16 cmp r0, r1 bcc @081D0658 subs r0, r1, 0x1 b @081D0656 @081D0640: ldrh r0, [r2, 0x12] cmp r0, 0 beq @081D065C ldrh r1, [r2, 0xC] ldrh r0, [r2, 0xE] subs r0, r1, r0 ldrh r1, [r2, 0x12] cmp r0, r1 blt @081D0654 subs r0, r1, 0x1 @081D0654: adds r0, 0x1B @081D0656: strh r0, [r2, 0xC] @081D0658: movs r0, 0x1 b @081D065E @081D065C: movs r0, 0 @081D065E: pop {r1} bx r1 thumb_func_end sub_81D061C thumb_func_start sub_81D0664 sub_81D0664: ; 81D0664 push {r4,r5,lr} adds r5, r0, 0 ldrh r4, [r5, 0xC] adds r0, r4, 0 movs r1, 0x9 bl __umodsi3 lsls r0, 16 cmp r0, 0 bne @081D067C movs r0, 0 b @081D0682 @081D067C: subs r0, r4, 0x1 strh r0, [r5, 0xC] movs r0, 0x1 @081D0682: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81D0664 thumb_func_start sub_81D0688 sub_81D0688: ; 81D0688 push {r4,r5,lr} adds r5, r0, 0 ldrh r4, [r5, 0xC] adds r0, r4, 0 movs r1, 0x9 bl __umodsi3 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0x7 bgt @081D06BC cmp r4, 0x1A bhi @081D06AC ldrh r0, [r5, 0x10] subs r0, 0x1 cmp r4, r0 bge @081D06BC b @081D06B4 @081D06AC: ldrh r0, [r5, 0x12] subs r0, 0x1 cmp r1, r0 bge @081D06BC @081D06B4: adds r0, r4, 0x1 strh r0, [r5, 0xC] movs r0, 0x1 b @081D06BE @081D06BC: movs r0, 0 @081D06BE: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81D0688 thumb_func_start sub_81D06C4 sub_81D06C4: ; 81D06C4 push {lr} movs r0, 0xD bl sub_81C763C ldr r0, [r0, 0x8] ldrh r0, [r0, 0x2] pop {r1} bx r1 thumb_func_end sub_81D06C4 thumb_func_start sub_81D06D4 sub_81D06D4: ; 81D06D4 push {lr} movs r0, 0xD bl sub_81C763C ldr r0, [r0, 0x8] ldrh r0, [r0] pop {r1} bx r1 thumb_func_end sub_81D06D4 thumb_func_start sub_81D06E4 sub_81D06E4: ; 81D06E4 push {r4-r7,lr} adds r5, r0, 0 adds r7, r1, 0 adds r6, r2, 0 movs r0, 0xD bl sub_81C763C ldr r1, [r0, 0x8] ldrh r0, [r1, 0x2] lsls r0, 2 adds r0, 0x4 adds r1, r0 ldrb r0, [r1] cmp r0, 0xE bne @081D0730 ldrb r1, [r1, 0x1] movs r0, 0x64 adds r4, r1, 0 muls r4, r0 ldr r0, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x2 adds r2, r5, 0 bl pokemon_getattr adds r0, r4, 0 bl level_by_exp strb r0, [r7] adds r0, r4, 0 bl pokemon_get_gender strb r0, [r6] b @081D0752 .align 2, 0 .pool @081D0730: ldrb r0, [r1] ldrb r1, [r1, 0x1] bl get_pokemon_by_box_and_pos adds r4, r0, 0 bl pokemon_roll_gender strb r0, [r6] adds r0, r4, 0 bl sub_80690C0 strb r0, [r7] adds r0, r4, 0 movs r1, 0x2 adds r2, r5, 0 bl pokemon_getattr_encrypted @081D0752: adds r0, r5, 0 bl 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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0xB bl pokemon_getattr strh r0, [r5] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr str r0, [r6] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr b @081D07D0 .align 2, 0 .pool @081D07AC: ldrb r0, [r1] ldrb r1, [r1, 0x1] bl get_pokemon_by_box_and_pos adds r4, r0, 0 movs r1, 0xB bl pokemon_getattr_encrypted strh r0, [r5] adds r0, r4, 0 movs r1, 0 bl pokemon_getattr_encrypted str r0, [r6] adds r0, r4, 0 movs r1, 0x1 bl pokemon_getattr_encrypted @081D07D0: str r0, [r7] pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D0760 thumb_func_start sub_81D07D8 sub_81D07D8: ; 81D07D8 push {lr} movs r0, 0xD bl sub_81C763C ldr r1, [r0, 0x8] ldrh r0, [r1, 0x2] lsls r0, 2 adds r0, 0x4 adds r1, r0 ldrb r0, [r1] cmp r0, 0xE beq @081D07FA ldrb r1, [r1, 0x1] movs r2, 0x52 bl get_pokemon_data_from_any_box b @081D080A @081D07FA: ldrb r1, [r1, 0x1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x52 bl pokemon_getattr @081D080A: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D07D8 thumb_func_start sub_81D0814 sub_81D0814: ; 81D0814 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r5, r0, 0 ldr r0, [r5, 0x8] ldrh r1, [r0, 0x2] lsls r1, 2 adds r1, 0x4 adds r1, r0, r1 ldrb r0, [r1] cmp r0, 0xE bne @081D0848 ldrb r1, [r1, 0x1] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x53 bl pokemon_getattr b @081D0852 .align 2, 0 .pool @081D0848: ldrb r0, [r1] ldrb r1, [r1, 0x1] movs r2, 0x53 bl get_pokemon_data_from_any_box @081D0852: mov r12, r0 movs r0, 0 strh r0, [r5, 0x10] strh r0, [r5, 0x12] movs r6, 0 ldr r0, =gUnknown_086237F8 mov r9, r0 mov r10, r9 @081D0862: lsls r2, r6, 2 mov r3, r9 adds r1, r2, r3 movs r0, 0x1 ldrb r3, [r1] lsls r0, r3 subs r4, r0, 0x1 mov r0, r12 ands r4, r0 ldrb r0, [r1, 0x3] adds r7, r2, 0 cmp r0, 0 bne @081D08AC movs r3, 0 adds r6, 0x1 mov r8, r6 cmp r3, r4 bge @081D08D6 adds r6, r5, 0 adds r6, 0x14 mov r1, r10 adds r0, r7, r1 ldrb r2, [r0, 0x2] @081D0890: ldrh r0, [r5, 0x10] adds r1, r0, 0x1 strh r1, [r5, 0x10] lsls r0, 16 lsrs r0, 14 adds r0, r6, r0 adds r1, r2, r3 str r1, [r0] adds r3, 0x1 cmp r3, r4 blt @081D0890 b @081D08D6 .align 2, 0 .pool @081D08AC: movs r3, 0 adds r6, 0x1 mov r8, r6 cmp r3, r4 bge @081D08D6 adds r6, r5, 0 adds r6, 0x78 mov r1, r10 adds r0, r7, r1 ldrb r2, [r0, 0x2] @081D08C0: ldrh r0, [r5, 0x12] adds r1, r0, 0x1 strh r1, [r5, 0x12] lsls r0, 16 lsrs r0, 14 adds r0, r6, r0 adds r1, r2, r3 str r1, [r0] adds r3, 0x1 cmp r3, r4 blt @081D08C0 @081D08D6: mov r3, r9 adds r0, r7, r3 mov r1, r12 ldrb r0, [r0] lsrs r1, r0 mov r12, r1 mov r6, r8 cmp r6, 0x10 bls @081D0862 ldrh r0, [r5, 0x10] cmp r0, 0 beq @081D0900 subs r0, 0x1 movs r1, 0x9 bl __divsi3 lsls r1, r0, 3 adds r1, r0 movs r0, 0 strh r1, [r5, 0xE] b @081D0904 @081D0900: strh r0, [r5, 0xE] movs r0, 0x1B @081D0904: strh r0, [r5, 0xC] pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D0814 thumb_func_start sub_81D0914 sub_81D0914: ; 81D0914 push {r4,lr} adds r4, r0, 0 movs r0, 0xD bl sub_81C763C ldrh r1, [r0, 0x10] str r1, [r4] adds r0, 0x14 pop {r4} pop {r1} bx r1 thumb_func_end sub_81D0914 thumb_func_start sub_81D092C sub_81D092C: ; 81D092C push {r4,lr} adds r4, r0, 0 movs r0, 0xD bl sub_81C763C ldrh r1, [r0, 0x12] str r1, [r4] adds r0, 0x78 pop {r4} pop {r1} bx r1 thumb_func_end sub_81D092C thumb_func_start sub_81D0944 sub_81D0944: ; 81D0944 push {lr} movs r0, 0xD bl sub_81C763C ldrh r0, [r0, 0xC] pop {r1} bx r1 thumb_func_end sub_81D0944 thumb_func_start sub_81D0954 sub_81D0954: ; 81D0954 push {lr} movs r0, 0xD bl sub_81C763C adds r1, r0, 0 ldrh r0, [r1, 0xC] cmp r0, 0x18 ble @081D096C subs r0, 0x1B lsls r0, 2 adds r1, 0x78 b @081D0970 @081D096C: lsls r0, 2 adds r1, 0x14 @081D0970: adds r1, r0 ldr r0, [r1] pop {r1} bx r1 thumb_func_end sub_81D0954 thumb_func_start sub_81D0978 sub_81D0978: ; 81D0978 push {r4,lr} ldr r1, =0x0000101c movs r0, 0xE bl sub_81C761C adds r4, r0, 0 cmp r4, 0 beq @081D09A8 ldr r0, =sub_81D0A6C movs r1, 0x1 bl sub_81C7078 str r0, [r4, 0x4] ldr r0, =sub_81D0A58 str r0, [r4] movs r0, 0x1 b @081D09AA .align 2, 0 .pool @081D09A8: movs r0, 0 @081D09AA: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D0978 thumb_func_start sub_81D09B0 sub_81D09B0: ; 81D09B0 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0xE bl sub_81C763C adds r5, r0, 0 ldr r0, =gUnknown_08624BA0 lsls r4, 2 adds r4, r0 ldr r0, [r4] movs r1, 0x1 bl sub_81C7078 str r0, [r5, 0x4] ldr r0, =sub_81D0A58 str r0, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D09B0 thumb_func_start sub_81D09E0 sub_81D09E0: ; 81D09E0 push {lr} movs r0, 0xE bl sub_81C763C ldr r0, [r0] bl _call_via_r0 pop {r1} bx r1 thumb_func_end sub_81D09E0 thumb_func_start sub_81D09F4 sub_81D09F4: ; 81D09F4 push {r4,lr} movs r0, 0xE bl sub_81C763C adds r4, r0, 0 ldrb r0, [r4, 0xA] bl 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, =@081D0A90 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081D0A90: .4byte @081D0AB8 .4byte @081D0B04 .4byte @081D0B74 .4byte @081D0B88 .4byte @081D0B9C .4byte @081D0BB0 .4byte @081D0BC4 .4byte @081D0BD8 .4byte @081D0BE8 .4byte @081D0C3C @081D0AB8: ldr r0, =gUnknown_08624B98 movs r1, 0x2 bl sub_81C7B54 ldr r1, =gUnknown_08DDE030 movs r0, 0 str r0, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram adds r1, r5, 0 adds r1, 0x1C movs r0, 0x2 bl bg_set_tilemap ldr r1, =gUnknown_08DDE12C movs r0, 0x2 movs r2, 0 movs r3, 0 bl gpu_copy_to_wram_bg_tile_map ldr r0, =gUnknown_08DDE010 movs r1, 0x10 movs r2, 0x20 bl sub_81C7944 b @081D0BBA .align 2, 0 .pool @081D0B04: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 beq @081D0B12 b @081D0C44 @081D0B12: movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0x1 bl sub_8199DF0 ldr r1, =gUnknown_086240B8 str r4, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0x1 bl decompress_and_copy_tile_data_to_vram ldr r0, =0x0000081c adds r1, r5, r0 movs r0, 0x1 bl 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, =gUnknown_08623FF8 movs r1, 0x20 movs r2, 0xA0 bl sub_81C7944 ldr r0, =gUnknown_08624098 movs r1, 0xA0 movs r2, 0x20 bl sub_81C7944 movs r0, 0x1 b @081D0BBC .align 2, 0 .pool @081D0B74: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081D0C44 adds r0, r5, 0 bl sub_81D0E60 movs r0, 0 b @081D0C4A @081D0B88: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081D0C44 adds r0, r5, 0 bl sub_81D0FCC movs r0, 0 b @081D0C4A @081D0B9C: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081D0C44 adds r0, r5, 0 bl sub_81D10A4 movs r0, 0 b @081D0C4A @081D0BB0: bl 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, =@081D0CA4 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081D0CA4: .4byte @081D0CC0 .4byte @081D0CD0 .4byte @081D0CE4 .4byte @081D0CEE .4byte @081D0CF8 .4byte @081D0D02 .4byte @081D0D16 @081D0CC0: movs r0, 0x5 bl audio_play adds r0, r4, 0 bl sub_81D11D8 movs r0, 0 b @081D0D26 @081D0CD0: adds r0, r4, 0 bl sub_81D1234 cmp r0, 0 bne @081D0D20 adds r0, r4, 0 bl sub_81D0FF0 movs r0, 0x1 b @081D0D26 @081D0CE4: adds r0, r4, 0 bl sub_81D12D8 movs r0, 0x1 b @081D0D26 @081D0CEE: adds r0, r4, 0 bl sub_81D10D0 movs r0, 0x1 b @081D0D26 @081D0CF8: adds r0, r4, 0 bl sub_81D0E84 movs r0, 0x1 b @081D0D26 @081D0D02: bl 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, =gUnknown_08624BB8 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 .pool thumb_func_end sub_81D0E60 thumb_func_start sub_81D0E84 sub_81D0E84: ; 81D0E84 push {r4,r5,lr} sub sp, 0x10 adds r5, r0, 0 ldr r1, =gUnknown_08624BC0 add r0, sp, 0xC movs r2, 0x3 bl memcpy ldr r4, =0x02021cc4 bl sub_81D07D8 adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 movs r3, 0x2 bl decimal_int_to_string bl sub_81AFBF0 movs r0, 0 adds r1, r4, 0 bl sub_81AFC0C ldr r4, =0x02021fc4 ldr r1, =gUnknown_085EC030 adds r0, r4, 0 bl sub_81AFC28 ldrb r0, [r5, 0xA] movs r1, 0x44 bl 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 .pool thumb_func_end sub_81D0E84 thumb_func_start sub_81D0EFC sub_81D0EFC: ; 81D0EFC push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x10 adds r7, r0, 0 bl sub_81D0954 adds r5, r0, 0 ldr r1, =gUnknown_08624BC0 add r0, sp, 0xC movs r2, 0x3 bl memcpy ldrb r0, [r7, 0xA] movs r1, 0x44 bl Window_FastFillPixels cmp r5, 0x18 bhi @081D0F60 lsls r1, r5, 3 ldr r0, =gRibbonDescriptionPointers adds r6, r1, r0 movs r5, 0x80 lsls r5, 17 movs r4, 0x1 @081D0F2E: ldrb r0, [r7, 0xA] lsrs r3, r5, 24 add r1, sp, 0xC str r1, [sp] movs r1, 0x1 negs r1, r1 str r1, [sp, 0x4] ldm r6!, {r1} str r1, [sp, 0x8] movs r1, 0x1 movs r2, 0 bl box_print movs r0, 0x80 lsls r0, 21 adds r5, r0 subs r4, 0x1 cmp r4, 0 bge @081D0F2E b @081D0FAA .align 2, 0 .pool @081D0F60: ldr r0, =0x03005d8c ldr r0, [r0] adds r0, r5 ldr r1, =0x0000318f adds r0, r1 ldrb r5, [r0] cmp r5, 0 beq @081D0FB2 subs r5, 0x1 movs r4, 0 ldr r0, =gGiftRibbonDescriptionPointers mov r8, r0 movs r6, 0x80 lsls r6, 17 @081D0F7C: ldrb r0, [r7, 0xA] lsrs r3, r6, 24 add r1, sp, 0xC str r1, [sp] movs r1, 0x1 negs r1, r1 str r1, [sp, 0x4] lsls r1, r4, 2 lsls r2, r5, 3 adds r1, r2 add r1, r8 ldr r1, [r1] str r1, [sp, 0x8] movs r1, 0x1 movs r2, 0 bl box_print movs r0, 0x80 lsls r0, 21 adds r6, r0 adds r4, 0x1 cmp r4, 0x1 ble @081D0F7C @081D0FAA: ldrb r0, [r7, 0xA] movs r1, 0x2 bl Window_CopyToVram @081D0FB2: add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D0EFC thumb_func_start sub_81D0FCC sub_81D0FCC: ; 81D0FCC push {r4,lr} adds r4, r0, 0 ldr r0, =gUnknown_08624BC4 bl 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 .pool thumb_func_end sub_81D0FCC thumb_func_start sub_81D0FF0 sub_81D0FF0: ; 81D0FF0 push {r4-r7,lr} sub sp, 0x10 ldrh r7, [r0, 0x8] ldrb r5, [r0, 0x8] adds r0, r5, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r4, =0x02021ec4 mov r6, sp adds r6, 0xD adds r0, r4, 0 add r1, sp, 0xC adds r2, r6, 0 bl sub_81D06E4 movs r0, 0x1 str r0, [sp] movs r0, 0xFF str r0, [sp, 0x4] movs r0, 0 str r0, [sp, 0x8] adds r0, r5, 0 movs r1, 0x1 adds r2, r4, 0 movs r3, 0 bl Print ldrb r0, [r6] cmp r0, 0 beq @081D1040 cmp r0, 0xFE beq @081D1048 ldr r1, =gUnknown_08624BE4 b @081D104A .align 2, 0 .pool @081D1040: ldr r1, =gUnknown_08624BCC b @081D104A .align 2, 0 .pool @081D1048: ldr r1, =gUnknown_08624BD8 @081D104A: ldr r5, =0x02021cc4 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 .pool thumb_func_end sub_81D0FF0 thumb_func_start sub_81D10A4 sub_81D10A4: ; 81D10A4 push {r4,lr} adds r4, r0, 0 ldr r0, =gUnknown_08624BE8 bl 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 .pool thumb_func_end sub_81D10A4 thumb_func_start sub_81D10D0 sub_81D10D0: ; 81D10D0 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0xC mov r8, r0 bl sub_81D06C4 adds r4, r0, 0 adds r4, 0x1 bl sub_81D06D4 adds r6, r0, 0 ldr r5, =0x02021cc4 adds r0, r5, 0 adds r1, r4, 0 movs r2, 0x1 movs r3, 0x3 bl 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 .pool thumb_func_end sub_81D10D0 thumb_func_start sub_81D1148 sub_81D1148: ; 81D1148 push {r4,lr} sub sp, 0xC adds r4, r0, 0 add r1, sp, 0x4 add r2, sp, 0x8 mov r0, sp bl sub_81D0760 bl dp13_810BB8C movs r0, 0x28 movs r1, 0x68 bl sub_81D1184 strh r0, [r4, 0x10] movs r0, 0xF movs r1, 0 bl sub_81C7990 add sp, 0xC pop {r4} pop {r0} bx r0 thumb_func_end sub_81D1148 thumb_func_start sub_81D1178 sub_81D1178: ; 81D1178 push {lr} ldrh r0, [r0, 0x10] bl sub_818D820 pop {r0} bx r0 thumb_func_end sub_81D1178 thumb_func_start sub_81D1184 sub_81D1184: ; 81D1184 push {lr} sub sp, 0x1C add r1, sp, 0x14 add r2, sp, 0x18 add r0, sp, 0x10 bl sub_81D0760 add r0, sp, 0x10 ldrh r0, [r0] ldr r1, [sp, 0x18] ldr r2, [sp, 0x14] movs r3, 0x28 str r3, [sp] movs r3, 0x68 str r3, [sp, 0x4] movs r3, 0xF str r3, [sp, 0x8] ldr r3, =0x0000ffff str r3, [sp, 0xC] movs r3, 0x1 bl sub_818D7D8 lsls r0, 16 lsrs r0, 16 ldr r1, =0x02020630 lsls r2, r0, 4 adds r2, r0 lsls r2, 2 adds r2, r1 ldrb r3, [r2, 0x5] movs r1, 0xD negs r1, r1 ands r1, r3 strb r1, [r2, 0x5] add sp, 0x1C pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D1184 thumb_func_start sub_81D11D8 sub_81D11D8: ; 81D11D8 push {lr} ldrh r1, [r0, 0x10] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 movs r2, 0x20 negs r2, r2 movs r1, 0x28 movs r3, 0x6 bl sub_81D1258 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D11D8 thumb_func_start sub_81D11FC sub_81D11FC: ; 81D11FC push {r4,r5,lr} adds r4, r0, 0 ldrh r0, [r4, 0x10] bl sub_818D820 movs r5, 0x20 negs r5, r5 adds r0, r5, 0 movs r1, 0x68 bl sub_81D1184 strh r0, [r4, 0x10] ldrh r1, [r4, 0x10] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 adds r1, r5, 0 movs r2, 0x28 movs r3, 0x6 bl sub_81D1258 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D11FC thumb_func_start sub_81D1234 sub_81D1234: ; 81D1234 ldr r2, =0x02020630 ldrh r1, [r0, 0x10] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =nullsub_12 eors r1, r0 negs r0, r1 orrs r0, r1 lsrs r0, 31 bx lr .align 2, 0 .pool thumb_func_end sub_81D1234 thumb_func_start sub_81D1258 sub_81D1258: ; 81D1258 push {r4-r6,lr} adds r4, r0, 0 adds r6, r2, 0 adds r5, r3, 0 subs r0, r6, r1 strh r1, [r4, 0x20] lsls r1, 4 strh r1, [r4, 0x2E] lsls r0, 4 adds r1, r5, 0 bl __udivsi3 strh r0, [r4, 0x30] strh r5, [r4, 0x32] strh r6, [r4, 0x34] ldr r0, =sub_81D1284 str r0, [r4, 0x1C] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1258 thumb_func_start sub_81D1284 sub_81D1284: ; 81D1284 push {lr} adds r2, r0, 0 ldrh r1, [r2, 0x32] movs r3, 0x32 ldrsh r0, [r2, r3] cmp r0, 0 beq @081D12C8 subs r0, r1, 0x1 strh r0, [r2, 0x32] ldrh r0, [r2, 0x30] ldrh r1, [r2, 0x2E] adds r0, r1 strh r0, [r2, 0x2E] lsls r0, 16 asrs r0, 20 strh r0, [r2, 0x20] movs r1, 0x20 negs r1, r1 cmp r0, r1 bgt @081D12BA adds r0, r2, 0 adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] b @081D12D0 @081D12BA: adds r2, 0x3E ldrb r1, [r2] movs r0, 0x5 negs r0, r0 ands r0, r1 strb r0, [r2] b @081D12D0 @081D12C8: ldrh r0, [r2, 0x34] strh r0, [r2, 0x20] ldr r0, =nullsub_12 str r0, [r2, 0x1C] @081D12D0: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1284 thumb_func_start sub_81D12D8 sub_81D12D8: ; 81D12D8 push {r4-r6,lr} bl sub_81D1350 ldr r5, =0x030012c0 adds r0, r5, 0 bl sub_81D0914 adds r6, r0, 0 ldr r2, =0x030012c4 movs r1, 0 str r1, [r2] ldr r0, [r5] cmp r1, r0 bcs @081D130A adds r4, r2, 0 @081D12F6: ldr r0, [r4] ldm r6!, {r1} bl sub_81D1370 ldr r1, [r4] adds r1, 0x1 str r1, [r4] ldr r0, [r5] cmp r1, r0 bcc @081D12F6 @081D130A: ldr r4, =0x030012c0 adds r0, r4, 0 bl sub_81D092C adds r6, r0, 0 ldr r2, =0x030012c4 movs r1, 0 str r1, [r2] ldr r0, [r4] cmp r1, r0 bcs @081D133A adds r4, r2, 0 @081D1322: ldr r0, [r4] adds r0, 0x1B ldm r6!, {r1} bl sub_81D1370 ldr r1, [r4] adds r1, 0x1 str r1, [r4] ldr r0, =0x030012c0 ldr r0, [r0] cmp r1, r0 bcc @081D1322 @081D133A: movs r0, 0x1 bl gpu_copy_wram_bg_tilemap_to_vram pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D12D8 thumb_func_start sub_81D1350 sub_81D1350: ; 81D1350 push {lr} sub sp, 0x8 movs r0, 0x20 str r0, [sp] movs r0, 0x14 str r0, [sp, 0x4] movs r0, 0x1 movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =gUnknown_08624BF8 lsls r1, 2 adds r1, r2 ldrh r3, [r1, 0x2] adds r3, 0x2 lsls r3, 16 ldrh r1, [r1] lsls r1, 1 adds r1, 0x1 lsls r1, 16 lsrs r1, 16 lsrs r3, 4 adds r2, r1, 0 orrs r2, r3 strh r2, [r0] movs r5, 0x80 lsls r5, 3 adds r4, r5, 0 orrs r2, r4 strh r2, [r0, 0x2] adds r1, 0x1 orrs r1, r3 strh r1, [r0, 0x4] orrs r1, r4 strh r1, [r0, 0x6] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D13BC thumb_func_start sub_81D13FC sub_81D13FC: ; 81D13FC push {r4,lr} adds r4, r0, 0 ldr r0, =gUnknown_08624C78 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_08624C80 bl sub_81C795C ldr r0, =gUnknown_08624D04 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, =0x02020630 adds r1, r0 str r1, [r4, 0x14] adds r1, 0x3E ldrb r0, [r1] movs r2, 0x4 orrs r0, r2 strb r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D13FC thumb_func_start sub_81D1448 sub_81D1448: ; 81D1448 push {r4-r6,lr} mov r6, r8 push {r6} adds r6, r0, 0 bl sub_81D0944 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r4, 0 movs r1, 0x9 bl __modsi3 adds r5, r0, 0 lsls r5, 4 adds r5, 0x60 adds r0, r4, 0 movs r1, 0x9 bl __divsi3 lsls r0, 4 adds r0, 0x28 ldr r1, [r6, 0x14] movs r2, 0 mov r8, r2 strh r5, [r1, 0x20] ldr r1, [r6, 0x14] strh r0, [r1, 0x22] bl sub_81D0954 adds r4, r0, 0 movs r0, 0x9 bl gpu_tile_obj_tag_get_range_start ldr r3, [r6, 0x14] ldr r1, =gUnknown_08624BF8 lsls r4, 2 adds r4, r1 ldrh r1, [r4] lsls r1, 4 adds r0, r1 ldr r2, =0x000003ff adds r1, r2, 0 ands r0, r1 ldrh r2, [r3, 0x4] ldr r1, =0xfffffc00 ands r1, r2 orrs r1, r0 strh r1, [r3, 0x4] ldrh r0, [r4, 0x2] adds r0, 0xF lsls r0, 16 lsrs r0, 16 bl 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, =sub_81D1538 str r0, [r1, 0x1C] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1448 thumb_func_start sub_81D1500 sub_81D1500: ; 81D1500 push {r4,lr} adds r4, r0, 0 ldr r1, [r4, 0x14] movs r0, 0x1 strh r0, [r1, 0x2E] ldr r0, [r4, 0x14] movs r1, 0x2 bl sub_8008258 ldr r1, [r4, 0x14] ldr r0, =sub_81D1538 str r0, [r1, 0x1C] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1500 thumb_func_start sub_81D1524 sub_81D1524: ; 81D1524 ldr r0, [r0, 0x14] ldr r1, [r0, 0x1C] ldr r0, =nullsub_12 eors r1, r0 negs r0, r1 orrs r0, r1 lsrs r0, 31 bx lr .align 2, 0 .pool thumb_func_end sub_81D1524 thumb_func_start sub_81D1538 sub_81D1538: ; 81D1538 push {lr} adds r3, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x20 ands r0, r1 cmp r0, 0 beq @081D156A movs r0, 0x3E adds r0, r3 mov r12, r0 movs r0, 0x1 ldrh r1, [r3, 0x2E] ands r1, r0 lsls r1, 2 mov r0, r12 ldrb r2, [r0] movs r0, 0x5 negs r0, r0 ands r0, r2 orrs r0, r1 mov r1, r12 strb r0, [r1] ldr r0, =nullsub_12 str r0, [r3, 0x1C] @081D156A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1538 thumb_func_start sub_81D1574 sub_81D1574: ; 81D1574 push {lr} ldrb r0, [r0] cmp r0, 0x5 bhi @081D15A4 lsls r0, 2 ldr r1, =@081D158C adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081D158C: .4byte @081D15A4 .4byte @081D15A8 .4byte @081D15AC .4byte @081D15B4 .4byte @081D15B0 .4byte @081D15A8 @081D15A4: movs r0, 0 b @081D15B6 @081D15A8: movs r0, 0x1 b @081D15B6 @081D15AC: movs r0, 0x2 b @081D15B6 @081D15B0: movs r0, 0x3 b @081D15B6 @081D15B4: movs r0, 0x4 @081D15B6: pop {r1} bx r1 thumb_func_end sub_81D1574 thumb_func_start sub_81D15BC sub_81D15BC: ; 81D15BC ldr r1, =gUnknown_085500A4 lsls r0, 4 adds r0, r1 ldrh r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81D15BC thumb_func_start sub_81D15CC sub_81D15CC: ; 81D15CC push {lr} adds r3, r0, 0 movs r1, 0 ldr r2, =gUnknown_085500A4 @081D15D4: ldrh r0, [r2] cmp r0, r3 bne @081D15E4 adds r0, r1, 0 b @081D15F0 .align 2, 0 .pool @081D15E4: adds r2, 0x10 adds r1, 0x1 cmp r1, 0x4D ble @081D15D4 movs r0, 0x1 negs r0, r0 @081D15F0: pop {r1} bx r1 thumb_func_end sub_81D15CC thumb_func_start sub_81D15F4 sub_81D15F4: ; 81D15F4 push {r4,lr} cmp r0, 0x14 bhi @081D1620 ldr r1, =gUnknown_086252A8 lsls r0, 2 adds r0, r1 ldr r4, [r0] adds r0, r4, 0 bl sub_81D1574 ldr r1, =gUnknown_086252FC lsls r0, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 b @081D1622 .align 2, 0 .pool @081D1620: movs r0, 0 @081D1622: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D15F4 thumb_func_start sub_81D1628 sub_81D1628: ; 81D1628 push {lr} adds r2, r0, 0 ldrh r1, [r2, 0x2] ldr r0, =0x0000ffff cmp r1, r0 beq @081D1644 adds r0, r1, 0 bl flag_check lsls r0, 24 lsrs r0, 24 b @081D1646 .align 2, 0 .pool @081D1644: movs r0, 0x1 @081D1646: pop {r1} bx r1 thumb_func_end sub_81D1628 thumb_func_start sub_81D164C sub_81D164C: ; 81D164C push {lr} adds r2, r0, 0 ldrh r1, [r2, 0x2] ldr r0, =0x0000ffff cmp r1, r0 beq @081D1668 adds r0, r1, 0 bl flag_check lsls r0, 24 lsrs r0, 24 b @081D166A .align 2, 0 .pool @081D1668: movs r0, 0x1 @081D166A: pop {r1} bx r1 thumb_func_end sub_81D164C thumb_func_start sub_81D1670 sub_81D1670: ; 81D1670 push {lr} adds r2, r0, 0 ldrh r1, [r2, 0x2] ldr r0, =0x0000ffff cmp r1, r0 beq @081D168C adds r0, r1, 0 bl flag_check lsls r0, 24 lsrs r0, 24 b @081D168E .align 2, 0 .pool @081D168C: movs r0, 0x1 @081D168E: pop {r1} bx r1 thumb_func_end sub_81D1670 thumb_func_start sub_81D1694 sub_81D1694: ; 81D1694 push {lr} adds r2, r0, 0 ldr r0, =0x03005d90 ldr r1, [r0] ldrb r0, [r2, 0x1] ldrb r1, [r1, 0x8] cmp r0, r1 beq @081D16AC movs r0, 0 b @081D16C6 .align 2, 0 .pool @081D16AC: ldrh r1, [r2, 0x2] ldr r0, =0x0000ffff cmp r1, r0 beq @081D16C4 adds r0, r1, 0 bl flag_check lsls r0, 24 lsrs r0, 24 b @081D16C6 .align 2, 0 .pool @081D16C4: movs r0, 0x1 @081D16C6: pop {r1} bx r1 thumb_func_end sub_81D1694 thumb_func_start sub_81D16CC sub_81D16CC: ; 81D16CC push {lr} ldrh r0, [r0, 0x2] bl 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, =gUnknown_086252A8 lsls r0, 2 adds r0, r1 ldr r4, [r0] adds r0, r4, 0 bl sub_81D1574 ldr r1, =gUnknown_08625310 lsls r0, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 lsrs r0, 24 b @081D170E .align 2, 0 .pool @081D170C: movs r0, 0 @081D170E: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D16DC thumb_func_start sub_81D1714 sub_81D1714: ; 81D1714 ldrb r0, [r0, 0x1] bx lr thumb_func_end sub_81D1714 thumb_func_start sub_81D1718 sub_81D1718: ; 81D1718 ldrb r0, [r0, 0x1] bx lr thumb_func_end sub_81D1718 thumb_func_start sub_81D171C sub_81D171C: ; 81D171C push {r4-r7,lr} adds r5, r0, 0 movs r6, 0 ldr r7, =0x0000ffff b @081D172E .align 2, 0 .pool @081D172C: adds r6, 0x1 @081D172E: ldr r0, [r5, 0x10] lsls r4, r6, 2 adds r1, r4, r0 ldrh r0, [r1] cmp r0, r7 beq @081D1744 bl 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, =gUnknown_086252A8 lsls r0, 2 adds r0, r1 ldr r4, [r0] adds r0, r4, 0 bl sub_81D1574 ldr r1, =gUnknown_08625324 lsls r0, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 b @081D1786 .align 2, 0 .pool @081D1784: movs r0, 0 @081D1786: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D1758 thumb_func_start sub_81D178C sub_81D178C: ; 81D178C movs r0, 0 bx lr thumb_func_end sub_81D178C thumb_func_start sub_81D1790 sub_81D1790: ; 81D1790 push {lr} adds r1, r0, 0 ldrh r0, [r1, 0x4] cmp r0, 0x48 bhi @081D17B8 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x000009ca adds r0, r2 ldrh r1, [r1, 0x4] adds r0, r1 ldrb r1, [r0] negs r0, r1 orrs r0, r1 lsrs r0, 31 b @081D17BA .align 2, 0 .pool @081D17B8: movs r0, 0 @081D17BA: pop {r1} bx r1 thumb_func_end sub_81D1790 thumb_func_start sub_81D17C0 sub_81D17C0: ; 81D17C0 ldr r1, =0x03005d8c ldr r1, [r1] ldr r2, =0x000009ca adds r1, r2 ldrh r0, [r0, 0x4] adds r1, r0 ldrb r1, [r1] negs r0, r1 orrs r0, r1 lsrs r0, 31 bx lr .align 2, 0 .pool thumb_func_end sub_81D17C0 thumb_func_start sub_81D17E0 sub_81D17E0: ; 81D17E0 movs r0, 0 bx lr thumb_func_end sub_81D17E0 thumb_func_start sub_81D17E4 sub_81D17E4: ; 81D17E4 movs r0, 0 bx lr thumb_func_end sub_81D17E4 thumb_func_start sub_81D17E8 sub_81D17E8: ; 81D17E8 push {r4,r5,lr} adds r5, r0, 0 cmp r5, 0x14 bhi @081D1832 ldr r1, =gUnknown_086252A8 lsls r0, r5, 2 adds r0, r1 ldr r4, [r0] adds r0, r4, 0 bl sub_81D1574 adds r2, r0, 0 ldr r1, =gUnknown_08625338 lsls r0, r2, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 cmp r0, 0 beq @081D1820 @081D1812: movs r0, 0x1 b @081D1834 .align 2, 0 .pool @081D1820: movs r2, 0 ldr r1, =gUnknown_08625388 @081D1824: ldrh r0, [r1] cmp r0, r5 beq @081D1812 adds r1, 0x18 adds r2, 0x1 cmp r2, 0x3 bls @081D1824 @081D1832: movs r0, 0 @081D1834: pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D17E8 thumb_func_start sub_81D1840 sub_81D1840: ; 81D1840 movs r0, 0 bx lr thumb_func_end sub_81D1840 thumb_func_start sub_81D1844 sub_81D1844: ; 81D1844 movs r0, 0x1 bx lr thumb_func_end sub_81D1844 thumb_func_start sub_81D1848 sub_81D1848: ; 81D1848 movs r0, 0x1 bx lr thumb_func_end sub_81D1848 thumb_func_start sub_81D184C sub_81D184C: ; 81D184C movs r0, 0 bx lr thumb_func_end sub_81D184C thumb_func_start sub_81D1850 sub_81D1850: ; 81D1850 movs r0, 0 bx lr thumb_func_end sub_81D1850 thumb_func_start sub_81D1854 sub_81D1854: ; 81D1854 push {r4,lr} cmp r0, 0x14 bhi @081D1880 ldr r1, =gUnknown_086252A8 lsls r0, 2 adds r0, r1 ldr r4, [r0] adds r0, r4, 0 bl sub_81D1574 ldr r1, =gUnknown_0862534C lsls r0, 2 adds r0, r1 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 b @081D1882 .align 2, 0 .pool @081D1880: movs r0, 0x4E @081D1882: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D1854 thumb_func_start sub_81D1888 sub_81D1888: ; 81D1888 movs r0, 0x4E bx lr thumb_func_end sub_81D1888 thumb_func_start sub_81D188C sub_81D188C: ; 81D188C ldrh r0, [r0, 0x4] bx lr thumb_func_end sub_81D188C thumb_func_start sub_81D1890 sub_81D1890: ; 81D1890 ldrh r0, [r0, 0x4] bx lr thumb_func_end sub_81D1890 thumb_func_start sub_81D1894 sub_81D1894: ; 81D1894 movs r0, 0x4E bx lr thumb_func_end sub_81D1894 thumb_func_start sub_81D1898 sub_81D1898: ; 81D1898 movs r0, 0x4E bx lr thumb_func_end sub_81D1898 thumb_func_start sub_81D189C sub_81D189C: ; 81D189C push {r4,r5,lr} adds r5, r1, 0 cmp r0, 0x14 bhi @081D18C2 ldr r1, =gUnknown_086252A8 lsls r0, 2 adds r0, r1 ldr r4, [r0] adds r0, r4, 0 bl sub_81D1574 ldr r1, =gUnknown_08625360 lsls r0, 2 adds r0, r1 ldr r2, [r0] adds r0, r4, 0 adds r1, r5, 0 bl _call_via_r2 @081D18C2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D189C thumb_func_start sub_81D18D0 sub_81D18D0: ; 81D18D0 push {lr} ldr r0, [r0, 0xC] bl sub_81D1920 pop {r0} bx r0 thumb_func_end sub_81D18D0 thumb_func_start sub_81D18DC sub_81D18DC: ; 81D18DC push {lr} adds r3, r0, 0 adds r2, r1, 0 ldrb r0, [r3] cmp r0, 0x5 beq @081D18F0 ldr r0, [r3, 0x10] bl sub_81D1920 b @081D18F8 @081D18F0: ldr r0, [r3, 0x10] ldrh r1, [r3, 0x4] bl sub_81D199C @081D18F8: pop {r0} bx r0 thumb_func_end sub_81D18DC thumb_func_start sub_81D18FC sub_81D18FC: ; 81D18FC push {lr} ldr r0, [r0, 0xC] bl sub_81D1920 pop {r0} bx r0 thumb_func_end sub_81D18FC thumb_func_start sub_81D1908 sub_81D1908: ; 81D1908 push {lr} ldr r0, [r0, 0xC] bl sub_81D1920 pop {r0} bx r0 thumb_func_end sub_81D1908 thumb_func_start sub_81D1914 sub_81D1914: ; 81D1914 push {lr} adds r0, r1, 0 bl sub_8197080 pop {r0} bx r0 thumb_func_end sub_81D1914 thumb_func_start sub_81D1920 sub_81D1920: ; 81D1920 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r6, r0, 0 mov r9, r1 movs r5, 0 ldr r0, [r6] cmp r0, 0 beq @081D1940 adds r1, r6, 0 @081D1936: adds r1, 0x8 adds r5, 0x1 ldr r0, [r1] cmp r0, 0 bne @081D1936 @081D1940: cmp r5, 0 beq @081D1946 subs r5, 0x1 @081D1946: ldr r0, =0x0000ffff mov r8, r0 lsls r0, r5, 3 adds r0, 0x4 adds r4, r0, r6 b @081D195C .align 2, 0 .pool @081D1958: subs r4, 0x8 subs r5, 0x1 @081D195C: lsls r7, r5, 3 cmp r5, 0 beq @081D1974 ldrh r0, [r4] cmp r0, r8 beq @081D1958 bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081D1958 @081D1974: adds r4, r7, r6 ldrh r1, [r4, 0x6] ldr r0, =0x0000ffff cmp r1, r0 beq @081D1984 adds r0, r1, 0 bl 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 .pool thumb_func_end sub_81D1920 thumb_func_start sub_81D199C sub_81D199C: ; 81D199C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r6, r0, 0 mov r10, r2 lsls r1, 16 lsrs r7, r1, 16 movs r5, 0 ldr r0, [r6] cmp r0, 0 beq @081D19E6 ldrh r0, [r6, 0x4] ldr r1, =0x0000fffe cmp r0, r1 beq @081D1A24 ldr r0, =0x0000ffff mov r9, r0 mov r8, r1 adds r4, r6, 0 @081D19C6: ldrh r0, [r4, 0x4] cmp r0, r9 beq @081D19D6 bl 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, =0x0000fffe cmp r1, r0 beq @081D1A24 cmp r5, 0 beq @081D19F8 subs r5, 0x1 @081D19F8: lsls r0, r5, 3 adds r4, r0, r6 ldrh r1, [r4, 0x6] ldr r0, =0x0000ffff cmp r1, r0 beq @081D1A0A adds r0, r1, 0 bl flag_set @081D1A0A: ldr r1, [r4] mov r0, r10 bl ExpandTextCodes b @081D1A5C .align 2, 0 .pool @081D1A1C: adds r5, 0x2 b @081D1A50 @081D1A20: adds r5, 0x3 b @081D1A50 @081D1A24: ldr r0, =0x00000864 bl flag_check lsls r0, 24 cmp r0, 0 beq @081D1A50 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x000009ca adds r0, r1 adds r0, r7 ldrb r0, [r0] cmp r0, 0 bne @081D1A1C adds r0, r7, 0 bl sub_80B2318 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @081D1A20 adds r5, 0x1 @081D1A50: lsls r0, r5, 3 adds r0, r6 ldr r1, [r0] mov r0, r10 bl ExpandTextCodes @081D1A5C: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D199C thumb_func_start sub_81D1A78 sub_81D1A78: ; 81D1A78 push {r4-r6,lr} adds r5, r1, 0 adds r6, r2, 0 cmp r0, 0x14 bhi @081D1AA2 ldr r1, =gUnknown_086252A8 lsls r0, 2 adds r0, r1 ldr r4, [r0] adds r0, r4, 0 bl sub_81D1574 ldr r1, =gUnknown_08625374 lsls r0, 2 adds r0, r1 ldr r3, [r0] adds r0, r4, 0 adds r1, r5, 0 adds r2, r6, 0 bl _call_via_r3 @081D1AA2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1A78 thumb_func_start sub_81D1AB0 sub_81D1AB0: ; 81D1AB0 ldr r3, [r0, 0x4] str r3, [r1] ldr r0, [r0, 0x8] str r0, [r2] bx lr thumb_func_end sub_81D1AB0 thumb_func_start sub_81D1ABC sub_81D1ABC: ; 81D1ABC push {r4,r5,lr} adds r5, r1, 0 adds r4, r0, 0 ldr r0, [r4, 0xC] cmp r0, 0 bne @081D1AD0 ldrh r0, [r4, 0x4] bl sub_81D1B0C b @081D1AD2 @081D1AD0: str r0, [r2] @081D1AD2: ldr r0, [r4, 0x8] str r0, [r5] pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81D1ABC thumb_func_start sub_81D1ADC sub_81D1ADC: ; 81D1ADC push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrh r0, [r4, 0x4] bl sub_81D1B0C ldr r0, [r4, 0x8] str r0, [r5] pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81D1ADC thumb_func_start sub_81D1AF4 sub_81D1AF4: ; 81D1AF4 ldr r3, [r0, 0x4] str r3, [r1] ldr r0, [r0, 0x8] str r0, [r2] bx lr thumb_func_end sub_81D1AF4 thumb_func_start sub_81D1B00 sub_81D1B00: ; 81D1B00 ldr r3, [r0, 0x4] str r3, [r1] ldr r0, [r0, 0x8] str r0, [r2] bx lr thumb_func_end sub_81D1B00 thumb_func_start sub_81D1B0C sub_81D1B0C: ; 81D1B0C push {r4,r5,lr} adds r4, r1, 0 adds r5, r2, 0 bl sub_81D15BC lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =gTrainers adds r1, r0 ldrb r2, [r1, 0x1] movs r0, 0xD muls r0, r2 ldr r2, =gTrainerClassNames adds r0, r2 str r0, [r4] adds r1, 0x4 str r1, [r5] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1B0C thumb_func_start sub_81D1B40 sub_81D1B40: ; 81D1B40 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r6, r0, 0 movs r5, 0 ldr r2, =gUnknown_08625388 movs r0, 0x8 adds r0, r2 mov r9, r0 @081D1B54: lsls r0, r5, 1 adds r0, r5 lsls r0, 3 adds r0, r2 ldrh r0, [r0] cmp r0, r6 bne @081D1BBC adds r4, r5, 0x1 lsls r1, 2 mov r8, r1 cmp r4, 0x3 bhi @081D1BA8 lsls r0, r4, 1 adds r0, r4 lsls r0, 3 adds r0, r2 ldrh r0, [r0] cmp r0, r6 bne @081D1BA8 ldr r7, =gUnknown_08625388 @081D1B7C: lsls r0, r4, 1 adds r0, r4 lsls r0, 3 adds r1, r7, 0x4 adds r0, r1 ldrh r0, [r0] bl 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 .pool @081D1BBC: adds r5, 0x1 cmp r5, 0x3 bls @081D1B54 movs r0, 0 @081D1BC4: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81D1B40 thumb_func_start sub_81D1BD0 sub_81D1BD0: ; 81D1BD0 push {lr} adds r3, r0, 0 movs r2, 0 ldr r1, =gUnknown_08625388 @081D1BD8: ldrh r0, [r1] cmp r0, r3 bne @081D1BE8 ldrh r0, [r1, 0x2] b @081D1BF4 .align 2, 0 .pool @081D1BE8: adds r1, 0x18 adds r2, 0x1 cmp r2, 0x3 bls @081D1BD8 movs r0, 0x1 negs r0, r0 @081D1BF4: pop {r1} bx r1 thumb_func_end sub_81D1BD0 thumb_func_start sub_81D1BF8 sub_81D1BF8: ; 81D1BF8 push {r4,r5,lr} adds r5, r0, 0 movs r4, 0 @081D1BFE: adds r0, r4, 0 bl sub_81D1854 cmp r0, 0x4E beq @081D1C10 cmp r0, r5 bne @081D1C10 movs r0, 0x1 b @081D1C18 @081D1C10: adds r4, 0x1 cmp r4, 0x14 ble @081D1BFE movs r0, 0 @081D1C18: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81D1BF8 thumb_func_start sub_81D1C20 sub_81D1C20: ; 81D1C20 push {lr} ldr r0, =0x020375e0 ldrh r0, [r0] bl sub_81D15CC cmp r0, 0 blt @081D1C3C movs r1, 0xAE lsls r1, 1 adds r0, r1 lsls r0, 16 lsrs r0, 16 bl flag_set @081D1C3C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1C20 thumb_func_start sub_81D1C44 sub_81D1C44: ; 81D1C44 push {r4,lr} lsls r0, 24 ldr r4, =0x0203cf4c lsrs r0, 21 adds r0, 0x8 bl malloc str r0, [r4] cmp r0, 0 bne @081D1C60 movs r0, 0 b @081D1C7A .align 2, 0 .pool @081D1C60: movs r2, 0 ldr r4, =0x0203cf48 movs r3, 0xFF @081D1C66: adds r0, r2, r4 ldrb r1, [r0] orrs r1, r3 strb r1, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x2 bls @081D1C66 movs r0, 0x1 @081D1C7A: pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D1C44 thumb_func_start sub_81D1C84 sub_81D1C84: ; 81D1C84 push {r4-r6,lr} sub sp, 0x8 lsls r0, 24 lsrs r4, r0, 24 ldr r6, =0x0203cf48 adds r5, r4, r6 ldrb r0, [r5] cmp r0, 0xFF bne @081D1CEC cmp r4, 0x2 bne @081D1CD4 ldr r0, =gUnknown_086253E8 ldr r1, [r0, 0x14] ldr r0, [r0, 0x10] str r0, [sp] str r1, [sp, 0x4] ldr r0, =gUnknown_085DFF04 movs r1, 0x4 bl GetMaxWidthInMenuTable lsls r0, 24 ldr r2, =0x00ffffff ldr r1, [sp] ands r1, r2 orrs r1, r0 str r1, [sp] mov r0, sp bl Window_AddFromTemplate strb r0, [r6, 0x2] b @081D1CE0 .align 2, 0 .pool @081D1CD4: lsls r0, r4, 3 ldr r1, =gUnknown_086253E8 adds r0, r1 bl Window_AddFromTemplate strb r0, [r5] @081D1CE0: ldr r0, =0x0203cf48 adds r0, r4, r0 ldrb r0, [r0] movs r1, 0 bl SetStandardWindowBorderStyle @081D1CEC: ldr r0, =0x0203cf48 adds r0, r4, r0 ldrb r0, [r0] add sp, 0x8 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D1C84 thumb_func_start sub_81D1D04 sub_81D1D04: ; 81D1D04 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x0203cf48 adds r4, r0 ldrb r0, [r4] movs r1, 0 bl sub_8198070 ldrb r0, [r4] bl Window_FillTileMap ldrb r0, [r4] bl Window_Remove movs r0, 0xFF strb r0, [r4] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1D04 thumb_func_start sub_81D1D34 sub_81D1D34: ; 81D1D34 lsls r0, 24 lsrs r0, 24 ldr r1, =0x0203cf48 adds r0, r1 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81D1D34 thumb_func_start sub_81D1D44 sub_81D1D44: ; 81D1D44 push {r4,r5,lr} sub sp, 0x34 adds r3, r1, 0 lsls r0, 24 lsrs r4, r0, 24 lsls r2, 24 lsrs r5, r2, 24 movs r0, 0x2 negs r0, r0 cmp r3, r0 beq @081D1DAC ldr r0, =0x03005d8c lsls r1, r3, 3 adds r1, r3 lsls r1, 2 ldr r0, [r0] adds r1, r0 ldr r0, =0x00002cca adds r1, r0 add r0, sp, 0x14 bl 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, =gUnknown_08625400 str r0, [sp, 0x8] movs r0, 0x1 negs r0, r0 str r0, [sp, 0xC] add r0, sp, 0x14 str r0, [sp, 0x10] adds r0, r4, 0 movs r1, 0x1 movs r2, 0x8 adds r3, r5, 0 bl sub_8199EEC @081D1DAC: add sp, 0x34 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1D44 thumb_func_start sub_81D1DC0 sub_81D1DC0: ; 81D1DC0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r5, r0, 0 movs r3, 0 ldr r7, =0x0203cf4c ldr r0, =gUnknown_085E8CF7 mov r12, r0 ldr r4, =0x03006310 ldr r1, =0x0203cf48 mov r8, r1 ldr r2, =sub_81D1E7C mov r9, r2 ldr r0, =sub_81D1D44 mov r10, r0 ldrb r1, [r5, 0x5] cmp r3, r1 bcs @081D1E02 adds r6, r7, 0 ldr r2, =gUnknown_08625403 @081D1DEC: ldr r1, [r6] lsls r0, r3, 3 adds r0, r1 str r2, [r0] str r3, [r0, 0x4] adds r0, r3, 0x1 lsls r0, 16 lsrs r3, r0, 16 ldrb r0, [r5, 0x5] cmp r3, r0 bcc @081D1DEC @081D1E02: ldr r2, [r7] lsls r0, r3, 3 adds r0, r2 mov r1, r12 str r1, [r0] movs r1, 0x2 negs r1, r1 str r1, [r0, 0x4] str r2, [r4] ldrb r0, [r5, 0x5] adds r0, 0x1 movs r1, 0 strh r0, [r4, 0xC] mov r2, r8 ldrb r0, [r2, 0x1] strb r0, [r4, 0x10] strb r1, [r4, 0x11] movs r0, 0x8 strb r0, [r4, 0x12] strb r1, [r4, 0x13] strh r0, [r4, 0xE] movs r0, 0x29 strb r0, [r4, 0x14] movs r0, 0x31 strb r0, [r4, 0x15] mov r0, r9 str r0, [r4, 0x4] mov r1, r10 str r1, [r4, 0x8] movs r0, 0x1 strb r0, [r4, 0x17] movs r0, 0 strb r0, [r4, 0x16] ldrh r1, [r5, 0x2] ldrh r2, [r5] adds r0, r4, 0 bl 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 .pool thumb_func_end sub_81D1DC0 thumb_func_start sub_81D1E7C sub_81D1E7C: ; 81D1E7C push {lr} lsls r1, 24 lsrs r1, 24 cmp r1, 0x1 beq @081D1E8C movs r0, 0x5 bl audio_play @081D1E8C: pop {r0} bx r0 thumb_func_end sub_81D1E7C thumb_func_start sub_81D1E90 sub_81D1E90: ; 81D1E90 push {r4,lr} sub sp, 0x10 adds r4, r0, 0 ldrb r0, [r4, 0x5] ldrb r1, [r4, 0x4] subs r0, r1 adds r0, 0x1 str r0, [sp] movs r0, 0x6E str r0, [sp, 0x4] str r0, [sp, 0x8] adds r0, r4, 0x2 str r0, [sp, 0xC] movs r0, 0x2 movs r1, 0xC8 movs r2, 0xC movs r3, 0x94 bl 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, =0x0203cf4c ldr r0, [r0] bl free pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1EC0 thumb_func_start sub_81D1ED4 sub_81D1ED4: ; 81D1ED4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 adds r3, r0, 0 movs r6, 0 movs r7, 0 @081D1EE6: movs r2, 0 lsls r5, r6, 2 adds r0, r6, 0x1 mov r10, r0 adds r4, r5, 0 @081D1EF0: lsls r0, r2, 2 adds r0, r2 lsls r0, 2 adds r0, r4, r0 adds r0, r3, r0 adds r1, r0, 0 adds r1, 0x64 strh r7, [r1] adds r0, 0x66 strh r7, [r0] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x9 bls @081D1EF0 movs r2, 0 mov r9, r2 str r5, [sp] movs r1, 0x9B mov r8, r1 movs r4, 0x5B mov r12, r4 @081D1F1C: lsls r0, r2, 2 adds r0, r2 adds r1, r6, r0 adds r1, r3, r1 mov r4, r9 strb r4, [r1] lsls r0, 2 ldr r1, [sp] adds r0, r1, r0 adds r0, r3, r0 mov r4, r8 strh r4, [r0, 0x14] mov r1, r12 strh r1, [r0, 0x16] adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @081D1F1C adds r1, r3, r5 movs r2, 0x96 lsls r2, 1 adds r0, r1, r2 strh r7, [r0] movs r4, 0x97 lsls r4, 1 adds r0, r1, r4 strh r7, [r0] mov r1, r10 lsls r0, r1, 24 lsrs r6, r0, 24 cmp r6, 0x4 bls @081D1EE6 movs r2, 0xD5 lsls r2, 2 adds r0, r3, r2 movs r1, 0 strb r1, [r0] ldr r4, =0x00000352 adds r0, r3, r4 strh r1, [r0] add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1ED4 thumb_func_start sub_81D1F84 sub_81D1F84: ; 81D1F84 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 mov r8, r0 str r1, [sp] mov r9, r2 movs r7, 0 @081D1F98: lsls r4, r7, 2 ldr r1, [sp] adds r0, r4, r1 ldrh r1, [r0] lsls r5, r1, 8 mov r2, r9 adds r0, r4, r2 ldrh r0, [r0] subs r0, r1 lsls r0, 8 movs r1, 0xA bl __divsi3 adds r6, r0, 0 movs r3, 0 adds r7, 0x1 mov r10, r7 mov r12, r4 @081D1FBC: lsls r0, r3, 2 adds r0, r3 lsls r0, 2 add r0, r12 add r0, r8 asrs r2, r5, 8 asrs r1, r5, 7 movs r7, 0x1 ands r1, r7 adds r2, r1 adds r0, 0x64 strh r2, [r0] adds r5, r6 adds r0, r3, 0x1 lsls r0, 16 lsrs r3, r0, 16 cmp r3, 0x8 bls @081D1FBC lsls r0, r3, 2 adds r0, r3 lsls r0, 2 adds r0, r4, r0 add r0, r8 mov r1, r9 adds r2, r4, r1 ldrh r1, [r2] adds r0, 0x64 strh r1, [r0] ldr r7, [sp] adds r0, r4, r7 ldrh r1, [r0, 0x2] lsls r5, r1, 8 ldrh r0, [r2, 0x2] subs r0, r1 lsls r0, 8 movs r1, 0xA bl __divsi3 adds r6, r0, 0 movs r3, 0 str r4, [sp, 0x4] movs r0, 0x1 mov r12, r0 @081D2012: lsls r0, r3, 2 adds r0, r3 lsls r0, 2 ldr r1, [sp, 0x4] adds r0, r1, r0 add r0, r8 asrs r2, r5, 8 asrs r1, r5, 7 mov r7, r12 ands r1, r7 adds r2, r1 adds r0, 0x66 strh r2, [r0] adds r5, r6 adds r0, r3, 0x1 lsls r0, 16 lsrs r3, r0, 16 cmp r3, 0x8 bls @081D2012 lsls r0, r3, 2 adds r0, r3 lsls r0, 2 adds r0, r4, r0 add r0, r8 mov r2, r9 adds r1, r4, r2 ldrh r1, [r1, 0x2] adds r0, 0x66 strh r1, [r0] mov r7, r10 lsls r0, r7, 16 lsrs r7, r0, 16 cmp r7, 0x4 bls @081D1F98 ldr r1, =0x00000352 add r1, r8 movs r0, 0 strh r0, [r1] add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D1F84 thumb_func_start sub_81D2074 sub_81D2074: ; 81D2074 push {r4,lr} adds r1, r0, 0 ldr r0, =0x00000352 adds r4, r1, r0 ldrh r0, [r4] cmp r0, 0x9 bls @081D208C movs r0, 0 b @081D20A6 .align 2, 0 .pool @081D208C: adds r0, r1, 0 bl sub_81D2230 ldrh r1, [r4] adds r1, 0x1 strh r1, [r4] lsls r1, 16 lsrs r1, 16 movs r0, 0xA eors r1, r0 negs r0, r1 orrs r0, r1 lsrs r0, 31 @081D20A6: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D2074 thumb_func_start sub_81D20AC sub_81D20AC: ; 81D20AC ldr r1, =0x00000355 adds r0, r1 movs r1, 0 strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81D20AC thumb_func_start sub_81D20BC sub_81D20BC: ; 81D20BC push {r4,r5,lr} sub sp, 0xC ldr r1, =0x00000355 adds r4, r0, r1 ldrb r0, [r4] cmp r0, 0 beq @081D20D4 cmp r0, 0x1 beq @081D20E2 b @081D20FA .align 2, 0 .pool @081D20D4: bl dp12_8087EA4 ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] movs r0, 0x1 b @081D20FC @081D20E2: mov r0, sp ldr r1, =gUnknown_08625404 ldm r1!, {r2,r3,r5} stm r0!, {r2,r3,r5} ldr r0, [sp] ldr r1, [sp, 0x4] ldr r2, [sp, 0x8] bl sub_80BA038 ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] @081D20FA: movs r0, 0 @081D20FC: add sp, 0xC pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D20BC thumb_func_start sub_81D2108 sub_81D2108: ; 81D2108 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x10 adds r6, r0, 0 movs r1, 0xD5 lsls r1, 2 adds r0, r6, r1 ldrb r0, [r0] cmp r0, 0 beq @081D21BE adds r0, r6, 0 bl sub_81D24A4 adds r0, r6, 0 bl sub_81D2634 movs r7, 0 ldr r5, =0x02038c28 mov r12, r5 movs r0, 0xF0 lsls r0, 3 add r0, r12 mov r9, r0 movs r1, 0xA0 lsls r1, 1 adds r1, r6, r1 str r1, [sp] ldr r5, =0x0000ffff mov r8, r5 movs r0, 0xA1 lsls r0, 1 adds r0, r6, r0 str r0, [sp, 0x4] movs r1, 0x92 lsls r1, 2 adds r1, r6, r1 str r1, [sp, 0x8] ldr r5, =0x0000024a adds r5, r6 mov r10, r5 @081D215E: adds r2, r7, 0 adds r2, 0x37 lsls r3, r2, 2 mov r0, r9 adds r0, r3, r0 str r0, [sp, 0xC] add r3, r12 lsls r4, r7, 2 ldr r1, [sp] adds r0, r1, r4 ldrh r0, [r0] lsls r0, 8 ldr r5, [sp, 0x4] adds r1, r5, r4 ldrh r1, [r1] orrs r0, r1 strh r0, [r3] mov r1, r8 ands r0, r1 ldr r5, [sp, 0xC] strh r0, [r5] lsls r2, 1 adds r2, 0x1 lsls r2, 1 mov r0, r9 adds r3, r2, r0 add r2, r12 ldr r1, [sp, 0x8] adds r0, r1, r4 ldrh r0, [r0] lsls r0, 8 add r4, r10 ldrh r1, [r4] orrs r0, r1 strh r0, [r2] mov r5, r8 ands r0, r5 strh r0, [r3] adds r0, r7, 0x1 lsls r0, 16 lsrs r7, r0, 16 cmp r7, 0x41 bls @081D215E movs r0, 0xD5 lsls r0, 2 adds r1, r6, r0 movs r0, 0 strb r0, [r1] @081D21BE: add sp, 0x10 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D2108 thumb_func_start sub_81D21DC sub_81D21DC: ; 81D21DC push {r4,r5,lr} lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x3 bls @081D21E8 movs r1, 0 @081D21E8: movs r0, 0x1 lsls r0, r1 movs r5, 0x1F bics r5, r0 movs r0, 0x40 movs r1, 0xF0 bl lcd_io_set movs r0, 0x42 movs r1, 0x9B bl lcd_io_set ldr r4, =0x00003879 movs r0, 0x44 adds r1, r4, 0 bl lcd_io_set movs r0, 0x46 adds r1, r4, 0 bl lcd_io_set ldr r1, =0x00003f3f 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 .pool thumb_func_end sub_81D21DC thumb_func_start sub_81D2230 sub_81D2230: ; 81D2230 push {r4-r7,lr} mov r12, r0 movs r4, 0 movs r7, 0x96 lsls r7, 1 add r7, r12 ldr r6, =0x00000352 add r6, r12 mov r5, r12 adds r5, 0x64 @081D2244: lsls r2, r4, 2 adds r3, r7, r2 ldrh r1, [r6] lsls r0, r1, 2 adds r0, r1 lsls r0, 2 adds r2, r0 adds r2, r5, r2 ldr r0, [r2] str r0, [r3] adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 cmp r4, 0x4 bls @081D2244 movs r1, 0xD5 lsls r1, 2 add r1, r12 movs r0, 0x1 strb r0, [r1] pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D2230 thumb_func_start sub_81D2278 sub_81D2278: ; 81D2278 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x18 str r0, [sp] adds r6, r1, 0 adds r5, r2, 0 str r3, [sp, 0x4] ldr r0, [sp, 0x38] ldr r7, [sp, 0x3C] lsls r0, 24 lsrs r0, 24 mov r9, r0 movs r0, 0 str r0, [sp, 0xC] ldrh r0, [r5, 0x2] ldrh r1, [r3, 0x2] cmp r0, r1 bcs @081D22B2 adds r2, r0, 0 mov r10, r2 ldrh r0, [r3, 0x2] ldrh r1, [r5] lsls r4, r1, 10 ldrh r3, [r3] str r3, [sp, 0x8] b @081D22C6 @081D22B2: ldrh r0, [r5, 0x2] ldr r1, [sp, 0x4] ldrh r1, [r1, 0x2] mov r10, r1 ldr r2, [sp, 0x4] ldrh r1, [r2] lsls r4, r1, 10 ldrh r3, [r5] str r3, [sp, 0x8] mov r2, r10 @081D22C6: subs r0, r2 lsls r0, 16 lsrs r0, 16 mov r8, r0 cmp r0, 0 beq @081D22DE subs r0, r3, r1 lsls r0, 10 mov r1, r8 bl __divsi3 str r0, [sp, 0xC] @081D22DE: mov r0, r8 adds r0, 0x1 lsls r0, 16 lsrs r0, 16 mov r8, r0 cmp r7, 0 bne @081D2328 mov r0, r10 subs r0, 0x38 lsls r0, 2 adds r6, r0 movs r5, 0 mov r3, r9 lsls r3, 1 mov r12, r3 ldr r0, [sp, 0x8] add r0, r9 str r0, [sp, 0x10] cmp r7, r8 bcs @081D23B6 movs r7, 0x1 @081D2308: adds r2, r3, r6 asrs r1, r4, 10 asrs r0, r4, 9 ands r0, r7 adds r1, r0 add r1, r9 strh r1, [r2] ldr r1, [sp, 0xC] adds r4, r1 adds r6, 0x4 adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, r8 bcc @081D2308 b @081D23B6 @081D2328: ldr r2, [sp, 0xC] cmp r2, 0 ble @081D23C0 mov r0, r10 subs r0, 0x38 lsls r0, 2 adds r7, r0 movs r5, 0 mov r3, r9 lsls r3, 1 mov r12, r3 ldr r0, [sp, 0x8] add r0, r9 str r0, [sp, 0x10] cmp r5, r8 bcs @081D237A ldr r0, =0x00026bff cmp r4, r0 bgt @081D237A mov r1, r12 str r1, [sp, 0x14] @081D2352: ldr r3, [sp, 0x14] adds r2, r3, r7 asrs r1, r4, 10 asrs r0, r4, 9 movs r3, 0x1 ands r0, r3 adds r1, r0 add r1, r9 strh r1, [r2] ldr r0, [sp, 0xC] adds r4, r0 adds r7, 0x4 adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, r8 bcs @081D237A ldr r1, =0x00026bff cmp r4, r1 ble @081D2352 @081D237A: mov r2, r10 adds r1, r2, r5 ldr r3, [sp] movs r2, 0xD4 lsls r2, 2 adds r0, r3, r2 strh r1, [r0] ldrh r0, [r0] subs r0, 0x38 lsls r0, 2 adds r6, r0 cmp r5, r8 bcs @081D23B6 mov r3, r12 movs r7, 0x1 @081D2398: adds r2, r3, r6 asrs r1, r4, 10 asrs r0, r4, 9 ands r0, r7 adds r1, r0 add r1, r9 strh r1, [r2] ldr r0, [sp, 0xC] adds r4, r0 adds r6, 0x4 adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, r8 bcc @081D2398 @081D23B6: subs r0, r6, 0x4 b @081D248C .align 2, 0 .pool @081D23C0: ldr r1, [sp, 0xC] cmp r1, 0 bge @081D2464 mov r0, r10 subs r0, 0x38 lsls r0, 2 adds r6, r0 movs r5, 0 mov r2, r9 lsls r2, 1 mov r12, r2 ldr r3, [sp, 0x8] add r3, r9 str r3, [sp, 0x10] cmp r5, r8 bcs @081D241E adds r3, r2, r6 asrs r1, r4, 10 asrs r0, r4, 9 movs r2, 0x1 ands r0, r2 adds r1, r0 add r1, r9 strh r1, [r3] b @081D2414 @081D23F2: ldr r0, [sp, 0xC] adds r4, r0 adds r6, 0x4 adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, r8 bcs @081D241E mov r1, r12 adds r3, r1, r6 asrs r2, r4, 10 asrs r0, r4, 9 movs r1, 0x1 ands r0, r1 adds r2, r0 add r2, r9 strh r2, [r3] @081D2414: ldr r0, =0x00026bff cmp r4, r0 bgt @081D23F2 movs r0, 0x9B strh r0, [r3] @081D241E: mov r2, r10 adds r1, r2, r5 ldr r3, [sp] movs r2, 0xD4 lsls r2, 2 adds r0, r3, r2 strh r1, [r0] ldrh r0, [r0] subs r0, 0x38 lsls r0, 2 adds r7, r0 cmp r5, r8 bcs @081D245A mov r3, r12 movs r6, 0x1 @081D243C: adds r2, r3, r7 asrs r1, r4, 10 asrs r0, r4, 9 ands r0, r6 adds r1, r0 add r1, r9 strh r1, [r2] ldr r0, [sp, 0xC] adds r4, r0 adds r7, 0x4 adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, r8 bcc @081D243C @081D245A: subs r0, r7, 0x4 b @081D248C .align 2, 0 .pool @081D2464: ldr r1, [sp] movs r2, 0xD4 lsls r2, 2 adds r0, r1, r2 mov r3, r10 strh r3, [r0] mov r0, r10 subs r0, 0x38 lsls r0, 2 adds r6, r0 adds r7, r0 ldrh r0, [r5] adds r0, 0x1 strh r0, [r6, 0x2] ldr r1, [sp, 0x4] ldrh r0, [r1] strh r0, [r7] movs r0, 0x9B strh r0, [r7, 0x2] b @081D2494 @081D248C: add r0, r12 mov r2, sp ldrh r2, [r2, 0x10] strh r2, [r0] @081D2494: add sp, 0x18 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D2278 thumb_func_start sub_81D24A4 sub_81D24A4: ; 81D24A4 push {r4-r7,lr} sub sp, 0x8 adds r4, r0, 0 movs r0, 0x97 lsls r0, 1 adds r2, r4, r0 movs r3, 0x99 lsls r3, 1 adds r1, r4, r3 ldrh r0, [r2] ldrh r3, [r1] cmp r0, r3 bcs @081D24E0 adds r7, r0, 0 movs r0, 0xA0 lsls r0, 1 adds r1, r4, r0 movs r3, 0x96 lsls r3, 1 adds r2, r4, r3 subs r0, 0x10 adds r3, r4, r0 movs r0, 0x1 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] adds r0, r4, 0 bl sub_81D2278 b @081D2500 @081D24E0: ldrh r7, [r1] movs r2, 0xA0 lsls r2, 1 adds r1, r4, r2 movs r3, 0x98 lsls r3, 1 adds r2, r4, r3 movs r0, 0x96 lsls r0, 1 adds r3, r4, r0 movs r0, 0 str r0, [sp] str r0, [sp, 0x4] adds r0, r4, 0 bl sub_81D2278 @081D2500: movs r1, 0xA0 lsls r1, 1 adds r5, r4, r1 movs r3, 0x98 lsls r3, 1 adds r2, r4, r3 movs r0, 0x9A lsls r0, 1 adds r6, r4, r0 movs r0, 0x1 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] adds r0, r4, 0 adds r1, r5, 0 adds r3, r6, 0 bl sub_81D2278 movs r2, 0 movs r1, 0x9B lsls r1, 1 adds r0, r4, r1 movs r3, 0x9D lsls r3, 1 adds r1, r4, r3 ldrh r0, [r0] ldrh r1, [r1] cmp r0, r1 bhi @081D253C movs r2, 0x1 @081D253C: movs r0, 0x9C lsls r0, 1 adds r3, r4, r0 str r2, [sp] movs r1, 0x92 lsls r1, 2 adds r0, r4, r1 str r0, [sp, 0x4] adds r0, r4, 0 adds r1, r5, 0 adds r2, r6, 0 bl sub_81D2278 movs r2, 0x38 cmp r2, r7 bcs @081D257E adds r6, r5, 0 movs r3, 0 movs r0, 0xA1 lsls r0, 1 adds r5, r4, r0 @081D2566: adds r0, r2, 0 subs r0, 0x38 lsls r0, 2 adds r1, r6, r0 strh r3, [r1] adds r0, r5, r0 strh r3, [r0] adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, r7 bcc @081D2566 @081D257E: movs r1, 0x97 lsls r1, 1 adds r0, r4, r1 ldrh r2, [r0] movs r3, 0xD4 lsls r3, 2 adds r0, r4, r3 ldrh r1, [r0] cmp r2, r1 bhi @081D25B2 movs r1, 0xA0 lsls r1, 1 adds r3, r4, r1 movs r5, 0x9B adds r1, r0, 0 @081D259C: adds r0, r2, 0 subs r0, 0x38 lsls r0, 2 adds r0, r3, r0 strh r5, [r0] adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 ldrh r0, [r1] cmp r2, r0 bls @081D259C @081D25B2: movs r2, 0x9B lsls r2, 1 adds r1, r4, r2 movs r3, 0xD4 lsls r3, 2 adds r0, r4, r3 ldrh r0, [r0] ldrh r1, [r1] cmp r0, r1 bcs @081D25C8 adds r0, r1, 0 @081D25C8: adds r0, 0x1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0x79 bhi @081D25F8 movs r0, 0xA0 lsls r0, 1 adds r6, r4, r0 movs r3, 0 movs r1, 0xA1 lsls r1, 1 adds r5, r4, r1 @081D25E0: adds r0, r2, 0 subs r0, 0x38 lsls r0, 2 adds r1, r6, r0 strh r3, [r1] adds r0, r5, r0 strh r3, [r0] adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0x79 bls @081D25E0 @081D25F8: movs r2, 0x38 movs r3, 0xA0 lsls r3, 1 adds r5, r4, r3 movs r0, 0xA1 lsls r0, 1 adds r4, r0 movs r6, 0x9B @081D2608: adds r0, r2, 0 subs r0, 0x38 lsls r1, r0, 2 adds r3, r5, r1 ldrh r0, [r3] cmp r0, 0 bne @081D2620 adds r0, r4, r1 ldrh r0, [r0] cmp r0, 0 beq @081D2620 strh r6, [r3] @081D2620: adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0x79 bls @081D2608 add sp, 0x8 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D24A4 thumb_func_start sub_81D2634 sub_81D2634: ; 81D2634 push {r4-r6,lr} sub sp, 0x8 adds r4, r0, 0 movs r0, 0x97 lsls r0, 1 adds r2, r4, r0 movs r3, 0x9F lsls r3, 1 adds r1, r4, r3 ldrh r0, [r2] ldrh r5, [r1] cmp r0, r5 bcs @081D266E adds r6, r0, 0 movs r0, 0x92 lsls r0, 2 adds r1, r4, r0 subs r3, 0x12 adds r2, r4, r3 movs r5, 0x9E lsls r5, 1 adds r3, r4, r5 movs r0, 0 str r0, [sp] str r0, [sp, 0x4] adds r0, r4, 0 bl sub_81D2278 b @081D2690 @081D266E: ldrh r6, [r1] movs r0, 0x92 lsls r0, 2 adds r1, r4, r0 movs r3, 0x9E lsls r3, 1 adds r2, r4, r3 movs r5, 0x96 lsls r5, 1 adds r3, r4, r5 movs r0, 0x1 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] adds r0, r4, 0 bl sub_81D2278 @081D2690: movs r0, 0x92 lsls r0, 2 adds r5, r4, r0 movs r1, 0x9E lsls r1, 1 adds r2, r4, r1 movs r0, 0x9C lsls r0, 1 adds r3, r4, r0 movs r0, 0 str r0, [sp] str r0, [sp, 0x4] adds r0, r4, 0 adds r1, r5, 0 bl sub_81D2278 cmp r6, 0x38 ble @081D26C8 movs r0, 0 adds r1, r5, 0 adds r2, r6, 0 subs r2, 0x38 @081D26BC: strh r0, [r1] strh r0, [r1, 0x2] adds r1, 0x4 subs r2, 0x1 cmp r2, 0 bne @081D26BC @081D26C8: movs r1, 0x97 lsls r1, 1 adds r0, r4, r1 ldrh r2, [r0] movs r3, 0xD4 lsls r3, 2 adds r0, r4, r3 ldrh r5, [r0] cmp r2, r5 bgt @081D26F6 movs r3, 0x9B adds r1, r0, 0 lsls r0, r2, 2 movs r5, 0xB5 lsls r5, 1 adds r0, r5 adds r0, r4 @081D26EA: strh r3, [r0] adds r0, 0x4 adds r2, 0x1 ldrh r5, [r1] cmp r2, r5 ble @081D26EA @081D26F6: movs r1, 0x9D lsls r1, 1 adds r0, r4, r1 ldrh r0, [r0] adds r1, r0, 0x1 movs r2, 0xD4 lsls r2, 2 adds r0, r4, r2 ldrh r0, [r0] cmp r0, r1 bge @081D270E adds r0, r1, 0 @081D270E: adds r2, r0, 0 cmp r2, 0x79 bgt @081D272C movs r1, 0 lsls r0, r2, 2 movs r3, 0xB4 lsls r3, 1 adds r0, r3 adds r0, r4 @081D2720: strh r1, [r0] strh r1, [r0, 0x2] adds r0, 0x4 adds r2, 0x1 cmp r2, 0x79 ble @081D2720 @081D272C: movs r3, 0 movs r5, 0x92 lsls r5, 2 adds r1, r4, r5 movs r2, 0x41 @081D2736: ldrh r0, [r1] ldrh r4, [r1, 0x2] cmp r0, r4 bcc @081D2742 strh r3, [r1, 0x2] strh r3, [r1] @081D2742: adds r1, 0x4 subs r2, 0x1 cmp r2, 0 bge @081D2736 add sp, 0x8 pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81D2634 thumb_func_start sub_81D2754 sub_81D2754: ; 81D2754 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} adds r6, r0, 0 mov r8, r1 ldr r1, =gUnknown_08625410 ldrb r0, [r6] adds r0, r1 ldrb r2, [r0] adds r6, 0x1 movs r0, 0x9B mov r3, r8 strh r0, [r3] movs r0, 0x5B subs r0, r2 strh r0, [r3, 0x2] movs r7, 0x40 movs r0, 0 mov r12, r0 movs r2, 0x1 mov r9, r2 ldr r3, =gUnknown_08329F40 mov r10, r3 @081D2786: adds r0, r7, 0 adds r0, 0x33 lsls r0, 24 lsrs r7, r0, 24 mov r1, r12 lsls r0, r1, 24 movs r2, 0xFF lsls r2, 24 adds r0, r2 lsrs r3, r0, 24 mov r12, r3 cmp r0, 0 bge @081D27A4 movs r0, 0x4 mov r12, r0 @081D27A4: mov r1, r12 lsls r0, r1, 24 asrs r4, r0, 24 cmp r4, 0x2 bne @081D27B4 adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 @081D27B4: ldrb r0, [r6] ldr r2, =gUnknown_08625410 adds r0, r2 ldrb r2, [r0] adds r6, 0x1 lsls r0, r4, 2 mov r1, r8 adds r3, r0, r1 adds r0, r7, 0 adds r0, 0x40 lsls r0, 1 add r0, r10 movs r1, 0 ldrsh r0, [r0, r1] muls r0, r2 asrs r5, r0, 8 adds r0, r5, 0 adds r0, 0x9B strh r0, [r3] lsls r0, r7, 1 add r0, r10 movs r1, 0 ldrsh r0, [r0, r1] adds r1, r2, 0 muls r1, r0 asrs r1, 8 movs r0, 0x5B subs r0, r1 strh r0, [r3, 0x2] cmp r4, 0x2 bgt @081D2800 cmp r2, 0x20 bne @081D27FA cmp r4, 0x2 beq @081D2800 @081D27FA: adds r0, r5, 0 adds r0, 0x9C strh r0, [r3] @081D2800: mov r0, r9 adds r0, 0x1 lsls r0, 16 lsrs r0, 16 mov r9, r0 cmp r0, 0x4 bls @081D2786 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D2754 thumb_func_start sub_81D2824 sub_81D2824: ; 81D2824 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 ldr r0, =gUnknown_08625510 bl Window_InitFromTemplates bl TextBox_ResetSomeField movs r0, 0 movs r1, 0x1 movs r2, 0xE0 bl sub_809882C ldr r0, =gUnknown_0860F074 movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply movs r4, 0 @081D284A: adds r0, r4, 0 movs r1, 0x11 bl 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 .pool @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, =0x03006310 adds r2, r3, 0 ldr r1, =gUnknown_08625548 ldm r1!, {r5-r7} stm r2!, {r5-r7} ldm r1!, {r5-r7} stm r2!, {r5-r7} strh r4, [r3, 0xC] str r0, [r3] cmp r4, 0x5 bhi @081D28F0 strh r4, [r3, 0xE] b @081D28F4 .align 2, 0 .pool @081D28F0: movs r0, 0x6 strh r0, [r3, 0xE] @081D28F4: ldrb r0, [r3, 0xE] pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81D28C8 thumb_func_start sub_81D28FC sub_81D28FC: ; 81D28FC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x2C mov r9, r0 movs r0, 0 movs r1, 0x11 bl Window_FastFillPixels ldr r5, =gUnknown_085EFA31 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, =gUnknown_085EFA52 movs r1, 0x29 mov r10, r1 str r1, [sp] mov r0, r8 str r0, [sp, 0x4] str r7, [sp, 0x8] movs r0, 0 movs r1, 0x1 adds r2, r5, 0 movs r3, 0x4 bl Print ldr r5, =gUnknown_085EFA56 movs r0, 0x1 adds r1, r5, 0 movs r2, 0x6A bl 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, =gUnknown_085EFA5D 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 .pool @081D29C4: mov r1, r9 lsls r0, r1, 1 add r0, r9 lsls r0, 2 ldr r1, =gBattleMoves adds r6, r0, r1 ldrb r1, [r6, 0x2] lsls r0, r1, 3 subs r0, r1 ldr r1, =gTypeNames adds r5, r0, r1 movs r0, 0x19 str r0, [sp] mov r1, r8 str r1, [sp, 0x4] str r7, [sp, 0x8] movs r0, 0 movs r1, 0x1 adds r2, r5, 0 movs r3, 0x4 bl Print ldr r1, =gUnknown_085EFA52 movs r0, 0x1 movs r2, 0 bl 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, =gUnknown_085E8D45 b @081D2A4A .align 2, 0 .pool @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, =gUnknown_085E8D45 b @081D2A7E .align 2, 0 .pool @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, =gMoveDescriptionPointers mov r0, r9 subs r0, 0x1 lsls r0, 2 adds r0, r1 ldr r5, [r0] movs r0, 0x41 str r0, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] movs r0, 0 movs r1, 0x7 adds r2, r5, 0 movs r3, 0 bl Print @081D2AB6: add sp, 0x2C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D28FC thumb_func_start sub_81D2ACC sub_81D2ACC: ; 81D2ACC push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0xC adds r4, r0, 0 bl sub_816137C movs r0, 0x1 movs r1, 0x11 bl Window_FastFillPixels ldr r5, =gUnknown_085EFA3E 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, =gUnknown_085EFA67 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, =gUnknown_085EFA6E 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 .pool @081D2B6C: lsls r4, 3 ldr r0, =gContestMoves adds r4, r0 ldr r1, =gContestMoveTypeTextPointers ldrb r0, [r4, 0x1] lsls r0, 29 lsrs r0, 27 adds r0, r1 ldr r5, [r0] mov r0, r8 str r0, [sp] str r7, [sp, 0x4] str r6, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 adds r2, r5, 0 movs r3, 0x4 bl Print ldr r1, =gContestEffectDescriptionPointers ldrb r0, [r4] lsls r0, 2 adds r0, r1 ldr r5, [r0] movs r0, 0x41 str r0, [sp] str r7, [sp, 0x4] str r6, [sp, 0x8] movs r0, 0x1 movs r1, 0x7 adds r2, r5, 0 movs r3, 0 bl Print movs r0, 0x1 movs r1, 0x2 bl Window_CopyToVram @081D2BB8: add sp, 0xC pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D2ACC thumb_func_start sub_81D2BD0 sub_81D2BD0: ; 81D2BD0 push {r4,lr} adds r4, r0, 0 lsls r1, 24 lsrs r1, 24 cmp r1, 0x1 beq @081D2BE2 movs r0, 0x5 bl audio_play @081D2BE2: adds r0, r4, 0 bl sub_81D28FC adds r0, r4, 0 bl sub_81D2ACC pop {r4} pop {r0} bx r0 thumb_func_end sub_81D2BD0 thumb_func_start sub_81D2BF4 sub_81D2BF4: ; 81D2BF4 push {r4,lr} sub sp, 0x10 adds r4, r0, 0 movs r0, 0x3 movs r1, 0x11 bl Window_FastFillPixels ldr r2, =0x03003014 ldrb r0, [r2] movs r1, 0x1 orrs r0, r1 strb r0, [r2] bl sav2_get_text_speed adds r3, r0, 0 lsls r3, 24 lsrs r3, 24 movs r0, 0 str r0, [sp] movs r0, 0x2 str r0, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0x3 str r0, [sp, 0xC] movs r1, 0x1 adds r2, r4, 0 bl text_box_related_one add sp, 0x10 pop {r4} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_08625540 movs r1, 0x1 movs r2, 0xE movs r3, 0 bl sub_81996C0 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D2C50 thumb_func_start sub_81D2C68 sub_81D2C68: ; 81D2C68 push {lr} lsls r0, 16 lsrs r0, 16 lsls r1, 16 lsrs r1, 16 cmp r0, 0xE bne @081D2CA8 cmp r2, 0x2 beq @081D2C7E cmp r2, 0x7 bne @081D2C94 @081D2C7E: movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 adds r1, r2, 0 adds r2, r3, 0 bl pokemon_getattr b @081D2CCA .align 2, 0 .pool @081D2C94: movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 adds r1, r2, 0 bl pokemon_getattr b @081D2CCA .align 2, 0 .pool @081D2CA8: cmp r2, 0x2 beq @081D2CB0 cmp r2, 0x7 bne @081D2CBE @081D2CB0: lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 bl sub_80D1ED0 b @081D2CCA @081D2CBE: lsls r0, 24 lsrs r0, 24 lsls r1, 24 lsrs r1, 24 bl get_pokemon_data_from_any_box @081D2CCA: pop {r1} bx r1 thumb_func_end sub_81D2C68 thumb_func_start sub_81D2CD0 sub_81D2CD0: ; 81D2CD0 push {r4-r7,lr} mov r7, r8 push {r7} adds r5, r0, 0 lsls r1, 16 lsrs r4, r1, 16 lsls r2, 16 lsrs r6, r2, 16 movs r0, 0xFC strb r0, [r5] adds r5, 0x1 movs r0, 0x4 strb r0, [r5] adds r5, 0x1 movs r0, 0x8 strb r0, [r5] adds r5, 0x1 movs r0, 0 strb r0, [r5] adds r5, 0x1 movs r0, 0x9 strb r0, [r5] adds r5, 0x1 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x2D movs r3, 0 bl sub_81D2C68 cmp r0, 0 beq @081D2D20 ldr r1, =gUnknown_085E8264 adds r0, r5, 0 movs r2, 0 movs r3, 0xC bl sub_8009128 b @081D2E70 .align 2, 0 .pool @081D2D20: adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x2 adds r3, r5, 0 bl sub_81D2C68 adds r0, r5, 0 bl 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, =0x020244ec adds r4, r0 adds r0, r4, 0 movs r1, 0x38 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 mov r8, r0 adds r0, r4, 0 bl pokemon_get_gender lsls r0, 24 lsrs r6, r0, 24 b @081D2D92 .align 2, 0 .pool @081D2D70: lsls r0, r4, 24 lsrs r0, 24 lsls r1, r6, 24 lsrs r1, 24 bl get_pokemon_by_box_and_pos adds r4, r0, 0 bl pokemon_roll_gender lsls r0, 24 lsrs r6, r0, 24 adds r0, r4, 0 bl sub_80690C0 lsls r0, 24 lsrs r0, 24 mov r8, r0 @081D2D92: cmp r7, 0x1D beq @081D2D9A cmp r7, 0x20 bne @081D2DB0 @081D2D9A: movs r0, 0xB adds r1, r7, 0 muls r1, r0 ldr r0, =gSpeciesNames adds r1, r0 adds r0, r5, 0 bl sub_8008C44 cmp r0, 0 bne @081D2DB0 movs r6, 0xFF @081D2DB0: adds r3, r5, 0 b @081D2DBA .align 2, 0 .pool @081D2DB8: adds r3, 0x1 @081D2DBA: ldrb r0, [r3] cmp r0, 0xFF bne @081D2DB8 movs r1, 0xFC strb r1, [r3] adds r3, 0x1 movs r0, 0x12 strb r0, [r3] adds r3, 0x1 movs r0, 0x3C strb r0, [r3] adds r3, 0x1 cmp r6, 0 beq @081D2DDE cmp r6, 0xFE beq @081D2E02 movs r0, 0 b @081D2E24 @081D2DDE: strb r1, [r3] adds r3, 0x1 movs r0, 0x1 strb r0, [r3] adds r3, 0x1 movs r0, 0x4 strb r0, [r3] adds r3, 0x1 strb r1, [r3] adds r3, 0x1 movs r0, 0x3 strb r0, [r3] adds r3, 0x1 movs r0, 0x5 strb r0, [r3] adds r3, 0x1 movs r0, 0xB5 b @081D2E24 @081D2E02: strb r1, [r3] adds r3, 0x1 movs r0, 0x1 strb r0, [r3] adds r3, 0x1 movs r0, 0x6 strb r0, [r3] adds r3, 0x1 strb r1, [r3] adds r3, 0x1 movs r0, 0x3 strb r0, [r3] adds r3, 0x1 movs r0, 0x7 strb r0, [r3] adds r3, 0x1 movs r0, 0xB6 @081D2E24: strb r0, [r3] adds r3, 0x1 movs r0, 0xFC strb r0, [r3] adds r3, 0x1 movs r0, 0x4 strb r0, [r3] adds r3, 0x1 movs r0, 0x8 strb r0, [r3] adds r3, 0x1 movs r4, 0 strb r4, [r3] adds r3, 0x1 movs r0, 0x9 strb r0, [r3] adds r3, 0x1 movs r0, 0xBA strb r0, [r3] adds r3, 0x1 movs r0, 0xF9 strb r0, [r3] adds r3, 0x1 movs r0, 0x5 strb r0, [r3] adds r3, 0x1 adds r0, r3, 0 mov r1, r8 movs r2, 0 movs r3, 0x3 bl 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, =0xffff0000 adds r0, r2 lsrs r2, r0, 16 @081D2E94: ldrb r3, [r1] adds r0, r3, 0 cmp r0, 0xFF bne @081D2E86 adds r1, r2, 0 lsls r0, r1, 16 ldr r2, =0xffff0000 adds r0, r2 lsrs r2, r0, 16 lsls r1, 16 cmp r1, 0 ble @081D2EC2 movs r3, 0 @081D2EAE: strb r3, [r4] adds r4, 0x1 adds r1, r2, 0 lsls r0, r1, 16 ldr r2, =0xffff0000 adds r0, r2 lsrs r2, r0, 16 lsls r1, 16 cmp r1, 0 bgt @081D2EAE @081D2EC2: movs r0, 0xFF strb r0, [r4] adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D2E7C thumb_func_start sub_81D2ED4 sub_81D2ED4: ; 81D2ED4 push {r4-r7,lr} adds r5, r0, 0 adds r6, r1, 0 ldr r0, [sp, 0x14] ldr r1, [sp, 0x18] ldr r4, [sp, 0x1C] lsls r2, 16 lsrs r7, r2, 16 lsls r3, 16 lsrs r3, 16 lsls r0, 16 lsrs r2, r0, 16 lsls r1, 16 lsrs r0, r1, 16 lsls r4, 24 cmp r4, 0 bne @081D2EFC subs r0, 0x1 lsls r0, 16 lsrs r0, 16 @081D2EFC: cmp r2, r0 beq @081D2F42 adds r0, r6, 0 adds r1, r7, 0 adds r2, r3, 0 bl sub_81D2CD0 movs r0, 0xFC strb r0, [r5] movs r0, 0x4 strb r0, [r5, 0x1] movs r0, 0x8 strb r0, [r5, 0x2] movs r0, 0 strb r0, [r5, 0x3] movs r0, 0x9 strb r0, [r5, 0x4] cmp r7, 0xE bne @081D2F2C adds r0, r5, 0x5 ldr r1, =gUnknown_085EBFCE b @081D2F3A .align 2, 0 .pool @081D2F2C: adds r4, r5, 0x5 lsls r0, r7, 24 lsrs r0, 24 bl sav3_get_box_name adds r1, r0, 0 adds r0, r4, 0 @081D2F3A: movs r2, 0x8 bl sub_81D2E7C b @081D2F72 @081D2F42: movs r1, 0 movs r2, 0 @081D2F46: adds r0, r6, r1 strb r2, [r0] adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0xB bls @081D2F46 adds r1, r6, r1 movs r0, 0xFF strb r0, [r1] movs r1, 0 movs r2, 0 @081D2F5E: adds r0, r5, r1 strb r2, [r0] adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0x7 bls @081D2F5E adds r1, r5, r1 movs r0, 0xFF strb r0, [r1] @081D2F72: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D2ED4 thumb_func_start sub_81D2F78 sub_81D2F78: ; 81D2F78 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} mov r8, r0 mov r10, r1 ldr r0, [sp, 0x20] ldr r1, [sp, 0x24] ldr r4, [sp, 0x28] ldr r5, [sp, 0x2C] lsls r2, 16 lsrs r7, r2, 16 lsls r3, 16 lsrs r6, r3, 16 lsls r0, 16 lsrs r2, r0, 16 lsls r1, 16 lsrs r1, 16 mov r9, r1 lsls r4, 16 lsrs r0, r4, 16 lsls r5, 24 cmp r5, 0 bne @081D2FB0 subs r0, 0x1 lsls r0, 16 lsrs r0, 16 @081D2FB0: cmp r2, r0 beq @081D305C adds r0, r7, 0 adds r1, r6, 0 movs r2, 0x16 movs r3, 0 bl sub_81D2C68 mov r1, r9 lsls r5, r1, 2 adds r4, r5, r1 mov r2, r8 adds r1, r2, r4 strb r0, [r1] adds r0, r7, 0 adds r1, r6, 0 movs r2, 0x2F movs r3, 0 bl sub_81D2C68 mov r1, r8 adds r1, 0x1 adds r1, r4 strb r0, [r1] adds r0, r7, 0 adds r1, r6, 0 movs r2, 0x21 movs r3, 0 bl sub_81D2C68 mov r1, r8 adds r1, 0x2 adds r1, r4 strb r0, [r1] adds r0, r7, 0 adds r1, r6, 0 movs r2, 0x18 movs r3, 0 bl sub_81D2C68 mov r1, r8 adds r1, 0x3 adds r1, r4 strb r0, [r1] adds r0, r7, 0 adds r1, r6, 0 movs r2, 0x17 movs r3, 0 bl sub_81D2C68 mov r1, r8 adds r1, 0x4 adds r1, r4 strb r0, [r1] mov r4, r10 add r4, r9 adds r0, r7, 0 adds r1, r6, 0 movs r2, 0x30 movs r3, 0 bl sub_81D2C68 cmp r0, 0xFF beq @081D3044 adds r0, r7, 0 adds r1, r6, 0 movs r2, 0x30 movs r3, 0 bl sub_81D2C68 movs r1, 0x1D bl __udivsi3 b @081D3046 @081D3044: movs r0, 0x9 @081D3046: strb r0, [r4] mov r0, r9 adds r1, r5, r0 mov r2, r8 adds r0, r2, r1 lsls r1, 2 adds r1, 0x14 add r1, r8 bl sub_81D2754 b @081D3086 @081D305C: movs r2, 0 mov r0, r9 lsls r5, r0, 2 adds r1, r5, r0 movs r6, 0 lsls r3, r1, 2 movs r5, 0x9B movs r4, 0x5B @081D306C: adds r0, r2, r1 add r0, r8 strb r6, [r0] lsls r0, r2, 2 adds r0, r3 add r0, r8 strh r5, [r0, 0x14] strh r4, [r0, 0x16] adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 cmp r2, 0x4 bls @081D306C @081D3086: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D2F78 thumb_func_start sub_81D3094 sub_81D3094: ; 81D3094 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x4 mov r8, r0 mov r9, r1 ldr r0, [sp, 0x20] ldr r1, [sp, 0x24] ldr r4, [sp, 0x28] lsls r2, 16 lsrs r7, r2, 16 lsls r3, 16 lsrs r5, r3, 16 lsls r0, 16 lsrs r2, r0, 16 lsls r1, 16 lsrs r0, r1, 16 lsls r4, 24 cmp r4, 0 bne @081D30C4 subs r0, 0x1 lsls r0, 16 lsrs r0, 16 @081D30C4: cmp r2, r0 beq @081D311A adds r0, r7, 0 adds r1, r5, 0 movs r2, 0x41 movs r3, 0 bl sub_81D2C68 adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 adds r0, r7, 0 adds r1, r5, 0 movs r2, 0x1 movs r3, 0 bl sub_81D2C68 adds r6, r0, 0 adds r0, r7, 0 adds r1, r5, 0 movs r2, 0 movs r3, 0 bl sub_81D2C68 adds r5, r0, 0 lsls r0, r4, 3 ldr r1, =gMonFrontPicTable adds r0, r1 movs r1, 0x1 str r1, [sp] mov r1, r8 adds r2, r4, 0 adds r3, r5, 0 bl 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 .pool thumb_func_end sub_81D3094 thumb_func_start sub_81D312C sub_81D312C: ; 81D312C push {lr} adds r1, r0, 0 ldrh r0, [r1] adds r0, 0x18 strh r0, [r1] lsls r0, 16 cmp r0, 0 ble @081D3140 movs r0, 0 strh r0, [r1] @081D3140: movs r0, 0 ldrsh r1, [r1, r0] negs r0, r1 orrs r0, r1 lsrs r0, 31 pop {r1} bx r1 thumb_func_end sub_81D312C thumb_func_start sub_81D3150 sub_81D3150: ; 81D3150 push {lr} adds r1, r0, 0 ldrh r0, [r1] subs r0, 0x18 strh r0, [r1] lsls r0, 16 asrs r0, 16 movs r2, 0x50 negs r2, r2 cmp r0, r2 bge @081D3168 strh r2, [r1] @081D3168: movs r0, 0 ldrsh r1, [r1, r0] eors r1, r2 negs r0, r1 orrs r0, r1 lsrs r0, 31 pop {r1} bx r1 thumb_func_end sub_81D3150 thumb_func_start sub_81D3178 sub_81D3178: ; 81D3178 push {r4,r5,lr} adds r5, r1, 0 bl sub_81D2074 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 bl sub_81D312C lsls r0, 24 lsrs r0, 24 movs r1, 0 cmp r4, 0 bne @081D319A cmp r0, 0 beq @081D319C @081D319A: movs r1, 0x1 @081D319C: adds r0, r1, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81D3178 thumb_func_start sub_81D31A4 sub_81D31A4: ; 81D31A4 push {r4,r5,lr} adds r5, r1, 0 bl sub_81D2074 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 adds r0, r5, 0 bl sub_81D3150 lsls r0, 24 lsrs r0, 24 movs r1, 0 cmp r4, 0 bne @081D31C6 cmp r0, 0 beq @081D31C8 @081D31C6: movs r1, 0x1 @081D31C8: adds r0, r1, 0 pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81D31A4 thumb_func_start sub_81D31D0 sub_81D31D0: ; 81D31D0 push {r4-r7,lr} sub sp, 0x20 ldr r3, =gUnknown_08625A48 ldr r4, [r3] ldr r5, [r3, 0x4] str r4, [sp, 0x18] str r5, [sp, 0x1C] mov r4, sp ldr r3, =gUnknown_08625A50 ldm r3!, {r5-r7} stm r4!, {r5-r7} ldm r3!, {r5-r7} stm r4!, {r5-r7} ldr r3, =gUnknown_08625A68 ldr r4, [r3, 0x4] ldr r3, [r3] ldr r5, [sp, 0x18] ldr r6, [sp, 0x1C] str r5, [r0] str r6, [r0, 0x4] mov r0, sp ldm r0!, {r5-r7} stm r1!, {r5-r7} ldm r0!, {r5-r7} stm r1!, {r5-r7} str r3, [r2] str r4, [r2, 0x4] add sp, 0x20 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D31D0 thumb_func_start sub_81D321C sub_81D321C: ; 81D321C push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0x50 adds r5, r0, 0 mov r12, r1 mov r8, r2 mov r1, sp ldr r0, =gUnknown_08625A70 ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2,r6,r7} stm r1!, {r2,r6,r7} ldm r0!, {r3,r4} stm r1!, {r3,r4} add r3, sp, 0x20 adds r1, r3, 0 ldr r0, =gUnknown_08625A90 ldm r0!, {r2,r6,r7} stm r1!, {r2,r6,r7} ldm r0!, {r4,r6,r7} stm r1!, {r4,r6,r7} add r2, sp, 0x38 adds r1, r2, 0 ldr r0, =gUnknown_08625AA8 ldm r0!, {r4,r6,r7} stm r1!, {r4,r6,r7} ldm r0!, {r4,r6,r7} stm r1!, {r4,r6,r7} movs r4, 0 @081D3258: lsls r0, r4, 3 add r0, sp ldr r1, [r0, 0x4] ldr r0, [r0] stm r5!, {r0,r1} adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @081D3258 mov r1, r12 adds r0, r2, 0 ldm r0!, {r2,r4,r5} stm r1!, {r2,r4,r5} ldm r0!, {r2,r6,r7} stm r1!, {r2,r6,r7} movs r4, 0 @081D327A: lsls r0, r4, 3 adds r0, r3, r0 ldr r1, [r0, 0x4] ldr r0, [r0] mov r5, r8 adds r5, 0x8 mov r8, r5 subs r5, 0x8 stm r5!, {r0,r1} adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x2 bls @081D327A add sp, 0x50 pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D321C thumb_func_start sub_81D32B0 sub_81D32B0: ; 81D32B0 push {r4,r5,lr} ldr r2, =gUnknown_08625AC0 ldr r4, [r2] ldr r5, [r2, 0x4] ldr r2, =gUnknown_08625AC8 ldr r3, [r2, 0x4] ldr r2, [r2] str r4, [r0] str r5, [r0, 0x4] str r2, [r1] str r3, [r1, 0x4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D32B0 thumb_func_start sub_81D32D4 sub_81D32D4: ; 81D32D4 push {lr} adds r1, r0, 0 ldrh r0, [r1, 0x30] adds r0, 0x1 strh r0, [r1, 0x30] lsls r0, 16 asrs r0, 16 cmp r0, 0x3C ble @081D32F0 movs r0, 0 strh r0, [r1, 0x30] adds r0, r1, 0 bl sub_81D3408 @081D32F0: pop {r0} bx r0 thumb_func_end sub_81D32D4 thumb_func_start sub_81D32F4 sub_81D32F4: ; 81D32F4 push {lr} adds r2, r0, 0 adds r0, 0x3F ldrb r1, [r0] movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @081D330C movs r0, 0 strh r0, [r2, 0x30] ldr r0, =sub_81D32D4 str r0, [r2, 0x1C] @081D330C: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D32F4 thumb_func_start sub_81D3314 sub_81D3314: ; 81D3314 push {r4,r5,lr} adds r4, r0, 0 movs r1, 0x36 ldrsh r0, [r4, r1] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 ldr r0, =0x02020630 adds r3, r1, r0 cmp r3, 0 beq @081D3360 ldrh r1, [r3, 0x24] ldrh r2, [r3, 0x20] adds r1, r2 ldr r2, =gUnknown_08625B2C movs r5, 0x2E ldrsh r0, [r4, r5] lsls r0, 2 adds r0, r2 ldrh r0, [r0] adds r0, r1 strh r0, [r4, 0x20] ldrh r1, [r3, 0x26] ldrh r3, [r3, 0x22] adds r1, r3 movs r3, 0x2E ldrsh r0, [r4, r3] lsls r0, 2 adds r2, 0x2 adds r0, r2 ldrh r0, [r0] adds r0, r1 b @081D337E .align 2, 0 .pool @081D3360: ldr r1, =gUnknown_08625B2C movs r5, 0x2E ldrsh r0, [r4, r5] lsls r0, 2 adds r0, r1 ldrh r0, [r0] adds r0, 0x28 strh r0, [r4, 0x20] movs r2, 0x2E ldrsh r0, [r4, r2] lsls r0, 2 adds r1, 0x2 adds r0, r1 ldrh r0, [r0] adds r0, 0x68 @081D337E: strh r0, [r4, 0x22] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D3314 thumb_func_start sub_81D338C sub_81D338C: ; 81D338C push {r4-r7,lr} mov r7, r8 push {r7} mov r8, r2 lsls r0, 24 lsrs r6, r0, 24 lsls r1, 24 lsrs r7, r1, 24 movs r5, 0 @081D339E: lsls r0, r5, 2 mov r1, r8 adds r4, r0, r1 ldr r0, [r4] cmp r0, 0 beq @081D33F0 strh r5, [r0, 0x2E] ldr r1, [r4] lsls r0, r5, 4 adds r0, 0x1 strh r0, [r1, 0x30] ldr r0, [r4] strh r6, [r0, 0x32] ldr r0, [r4] strh r5, [r0, 0x34] cmp r7, 0 beq @081D33C4 cmp r6, 0x9 beq @081D33D0 @081D33C4: ldr r1, [r4] ldr r0, =sub_81D3564 str r0, [r1, 0x1C] b @081D33F0 .align 2, 0 .pool @081D33D0: ldr r0, [r4] bl sub_81D3314 ldr r0, [r4] bl sub_81D35E8 ldr r2, [r4] ldr r0, =sub_81D32F4 str r0, [r2, 0x1C] adds r2, 0x3E ldrb r0, [r2] movs r3, 0x5 negs r3, r3 adds r1, r3, 0 ands r0, r1 strb r0, [r2] @081D33F0: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 cmp r5, 0x9 bls @081D339E pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D338C thumb_func_start sub_81D3408 sub_81D3408: ; 81D3408 push {r4-r7,lr} adds r4, r0, 0 ldrh r0, [r4, 0x38] lsls r0, 24 lsrs r2, r0, 24 movs r3, 0 movs r1, 0x32 ldrsh r0, [r4, r1] adds r0, 0x1 cmp r3, r0 bge @081D3454 ldr r5, =0x02020630 movs r7, 0x1C adds r7, r5 mov r12, r7 ldr r6, =sub_81D3564 @081D3428: lsls r1, r2, 4 adds r1, r2 lsls r1, 2 adds r2, r1, r5 movs r7, 0x2E ldrsh r0, [r2, r7] lsls r0, 4 adds r0, 0x1 strh r0, [r2, 0x30] add r1, r12 str r6, [r1] ldrh r0, [r2, 0x38] lsls r0, 24 lsrs r2, r0, 24 adds r0, r3, 0x1 lsls r0, 16 lsrs r3, r0, 16 movs r1, 0x32 ldrsh r0, [r4, r1] adds r0, 0x1 cmp r3, r0 blt @081D3428 @081D3454: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D3408 thumb_func_start sub_81D3464 sub_81D3464: ; 81D3464 push {lr} adds r2, r0, 0 movs r1, 0 movs r3, 0 @081D346C: lsls r0, r1, 2 adds r0, r2 str r3, [r0] adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x9 bls @081D346C pop {r0} bx r0 thumb_func_end sub_81D3464 thumb_func_start sub_81D3480 sub_81D3480: ; 81D3480 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} mov r8, r0 lsls r1, 24 lsrs r1, 24 mov r10, r1 lsls r2, 24 movs r0, 0 mov r9, r0 lsrs r7, r2, 24 movs r5, 0 adds r0, r7, 0x1 cmp r9, r0 bge @081D34FE @081D34A2: ldr r0, =gUnknown_08625B14 movs r1, 0 movs r2, 0 movs r3, 0 bl 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, =0x02020630 adds r0, r1 str r0, [r4] adds r0, 0x3E ldrb r1, [r0] movs r2, 0x4 orrs r1, r2 strb r1, [r0] ldr r0, [r4] mov r1, r10 strh r1, [r0, 0x36] cmp r5, 0 beq @081D34F0 subs r0, r4, 0x4 ldr r0, [r0] strh r3, [r0, 0x38] b @081D34F2 .align 2, 0 .pool @081D34F0: mov r9, r6 @081D34F2: adds r0, r5, 0x1 lsls r0, 16 lsrs r5, r0, 16 adds r0, r7, 0x1 cmp r5, r0 blt @081D34A2 @081D34FE: lsls r0, r7, 2 add r0, r8 ldr r0, [r0] mov r1, r9 strh r1, [r0, 0x38] adds r0, r7, 0 movs r1, 0x1 mov r2, r8 bl sub_81D338C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D3480 thumb_func_start sub_81D3520 sub_81D3520: ; 81D3520 push {r4-r6,lr} adds r6, r0, 0 movs r5, 0 @081D3526: cmp r5, 0x9 bhi @081D3544 lsls r0, r5, 2 adds r4, r0, r6 ldr r0, [r4] cmp r0, 0 beq @081D3544 bl 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, =sub_81D32F4 b @081D35DA .align 2, 0 .pool @081D35D0: ldr r0, =sub_81D32D4 b @081D35DA .align 2, 0 .pool @081D35D8: ldr r0, =nullsub_12 @081D35DA: str r0, [r4, 0x1C] @081D35DC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D3564 thumb_func_start sub_81D35E8 sub_81D35E8: ; 81D35E8 push {r4-r7,lr} adds r6, r0, 0 ldrh r0, [r6, 0x38] lsls r0, 24 lsrs r1, r0, 24 movs r5, 0 movs r2, 0x32 ldrsh r0, [r6, r2] adds r0, 0x1 cmp r5, r0 bge @081D3636 movs r0, 0x5 negs r0, r0 adds r7, r0, 0 @081D3604: lsls r4, r1, 4 adds r4, r1 lsls r4, 2 ldr r0, =0x02020630 adds r4, r0 adds r0, r4, 0 movs r1, 0 bl 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 .pool thumb_func_end sub_81D35E8 thumb_func_start sub_81D3640 sub_81D3640: ; 81D3640 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x2C mov r8, r0 adds r6, r1, 0 adds r5, r2, 0 adds r4, r3, 0 ldr r3, [sp, 0x4C] ldr r0, [sp, 0x50] mov r9, r0 lsls r4, 24 lsrs r4, 24 lsls r3, 24 lsrs r3, 24 mov r1, r9 lsls r1, 24 lsrs r1, 24 mov r9, r1 mov r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r1, r4, 4 orrs r1, r4 lsls r1, 24 lsrs r1, 24 str r3, [sp, 0x28] bl 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, =gUnknown_08625B54 lsls r0, r7, 2 adds r0, r1 ldr r0, [r0] str r0, [sp, 0x8] mov r0, r8 movs r1, 0x1 movs r2, 0 adds r3, r5, 0 bl box_print lsls r0, r7, 1 mov r4, sp adds r4, r0 adds r4, 0xC movs r1, 0 ldrsh r0, [r4, r1] ldr r1, =gUnknown_085EEA76 cmp r0, 0 blt @081D3704 ldr r1, =gUnknown_085EEA73 @081D3704: adds r0, r6, 0 bl 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 .pool thumb_func_end sub_81D3640 thumb_func_start sub_81D3784 sub_81D3784: ; 81D3784 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x2C mov r8, r0 adds r5, r1, 0 adds r4, r2, 0 adds r6, r3, 0 ldr r2, [sp, 0x4C] lsls r4, 24 lsrs r4, 24 lsls r6, 24 lsrs r6, 24 lsls r2, 24 lsrs r2, 24 lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r1, r4, 4 orrs r1, r4 lsls r1, 24 lsrs r1, 24 str r2, [sp, 0x28] bl 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, =gUnknown_08625B54 lsls r0, r6, 2 adds r0, r1 ldr r0, [r0] str r0, [sp, 0x8] adds r0, r7, 0 movs r1, 0x1 movs r2, 0 adds r3, r5, 0 bl box_print adds r4, 0x38 lsls r4, 24 lsrs r4, 24 mov r2, r10 str r2, [sp] mov r0, r8 str r0, [sp, 0x4] mov r1, r9 str r1, [sp, 0x8] adds r0, r7, 0 movs r1, 0x1 adds r2, r4, 0 adds r3, r5, 0 bl box_print adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 cmp r6, 0x5 bls @081D37EE add sp, 0x2C pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D3784 thumb_func_start sub_81D388C sub_81D388C: ; 81D388C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 movs r1, 0x3A bl pokemon_getattr strh r0, [r5] adds r0, r4, 0 movs r1, 0x3B bl pokemon_getattr strh r0, [r5, 0x2] adds r0, r4, 0 movs r1, 0x3C bl pokemon_getattr strh r0, [r5, 0x4] adds r0, r4, 0 movs r1, 0x3D bl pokemon_getattr strh r0, [r5, 0x6] adds r0, r4, 0 movs r1, 0x3E bl pokemon_getattr strh r0, [r5, 0x8] adds r0, r4, 0 movs r1, 0x3F bl pokemon_getattr strh r0, [r5, 0xA] pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81D388C thumb_func_start sub_81D38D4 sub_81D38D4: ; 81D38D4 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d6d adds r0, r1 ldrb r1, [r0] adds r2, r1, 0x1 adds r0, r2, 0 asrs r0, 8 lsls r0, 8 subs r0, r2, r0 lsls r0, 24 lsrs r0, 24 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D38D4 thumb_func_start sub_81D38FC sub_81D38FC: ; 81D38FC push {r4,r5,lr} adds r4, r0, 0 movs r5, 0x9C lsls r5, 2 adds r1, r5, 0 bl sub_806F96C adds r4, r5 ldr r1, [r4] cmp r0, r1 bne @081D3916 movs r0, 0x1 b @081D3918 @081D3916: movs r0, 0 @081D3918: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81D38FC thumb_func_start sub_81D3920 sub_81D3920: ; 81D3920 push {r4-r7,lr} adds r7, r0, 0 ldrb r6, [r7] subs r0, r6, 0x1 cmp r0, 0x7 bhi @081D3964 movs r5, 0 cmp r5, r6 bcs @081D394C adds r4, r7, 0 adds r4, 0x8 @081D3936: adds r0, r4, 0 bl sub_81D38FC cmp r0, 0 beq @081D3964 movs r0, 0x9D lsls r0, 2 adds r4, r0 adds r5, 0x1 cmp r5, r6 bcc @081D3936 @081D394C: adds r0, r7, 0 adds r0, 0x8 movs r1, 0x9D lsls r1, 2 muls r1, r6 bl sub_806F96C ldr r1, [r7, 0x4] cmp r0, r1 bne @081D3964 movs r0, 0x1 b @081D3966 @081D3964: movs r0, 0 @081D3966: pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81D3920 thumb_func_start sub_81D396C sub_81D396C: ; 81D396C push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] subs r0, 0x1 cmp r0, 0x7 bhi @081D398E adds r0, r4, 0 adds r0, 0x8 movs r1, 0xEE lsls r1, 4 bl sub_806F96C ldr r1, [r4, 0x4] cmp r0, r1 bne @081D398E movs r0, 0x1 b @081D3990 @081D398E: movs r0, 0 @081D3990: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D396C thumb_func_start sub_81D3998 sub_81D3998: ; 81D3998 push {r4-r7,lr} mov r7, r8 push {r7} adds r7, r0, 0 mov r8, r1 movs r2, 0x80 lsls r2, 5 mov r0, r8 movs r1, 0 bl memset ldrb r0, [r7] mov r1, r8 strb r0, [r1] bl sub_81D38D4 mov r2, r8 strb r0, [r2, 0x1] ldrb r0, [r7] adds r0, 0x1 asrs r0, 1 strb r0, [r2, 0x2] movs r6, 0 b @081D3A42 @081D39C8: movs r0, 0x1 ands r0, r6 cmp r0, 0 bne @081D3A14 lsrs r0, r6, 31 adds r0, r6, r0 asrs r0, 1 lsls r4, r0, 4 subs r4, r0 lsls r4, 3 subs r4, r0 lsls r4, 3 add r4, r8 movs r0, 0x9D lsls r0, 2 adds r5, r6, 0 muls r5, r0 adds r5, r7, r5 ldrb r0, [r5, 0x8] strb r0, [r4, 0x8] movs r1, 0xA7 lsls r1, 2 adds r0, r4, r1 movs r2, 0xAA lsls r2, 1 adds r1, r5, r2 subs r2, 0x30 bl memcpy adds r4, 0xC adds r5, 0xC adds r0, r4, 0 adds r1, r5, 0 movs r2, 0xA4 lsls r2, 1 bl memcpy b @081D3A40 @081D3A14: lsrs r1, r6, 31 adds r1, r6, r1 asrs r1, 1 lsls r0, r1, 4 subs r0, r1 lsls r0, 3 subs r0, r1 lsls r0, 3 add r0, r8 movs r1, 0x9D lsls r1, 2 muls r1, r6 adds r1, r7, r1 ldrb r2, [r1, 0x8] strb r2, [r0, 0x9] movs r2, 0xAA lsls r2, 1 adds r0, r2 adds r1, 0xC subs r2, 0xC bl memcpy @081D3A40: adds r6, 0x1 @081D3A42: ldrb r0, [r7] cmp r6, r0 blt @081D39C8 movs r0, 0x1 ands r0, r6 cmp r0, 0 beq @081D3A7E lsrs r2, r6, 31 adds r2, r6, r2 asrs r2, 1 lsls r0, r2, 4 subs r0, r2 lsls r0, 3 subs r0, r2 lsls r0, 3 add r0, r8 movs r1, 0xAA lsls r1, 1 adds r0, r1 ldr r3, =gUnknown_08625B6C lsls r1, r2, 2 adds r1, r2 lsls r1, 3 adds r1, r2 lsls r1, 3 adds r1, r3 movs r2, 0xA4 lsls r2, 1 bl memcpy @081D3A7E: mov r0, r8 adds r0, 0x8 movs r1, 0xEE lsls r1, 4 bl sub_806F96C mov r2, r8 str r0, [r2, 0x4] movs r0, 0x1E mov r1, r8 bl sub_8153634 cmp r0, 0x1 bne @081D3AA4 movs r0, 0x1 b @081D3AA6 .align 2, 0 .pool @081D3AA4: movs r0, 0 @081D3AA6: pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 thumb_func_end sub_81D3998 thumb_func_start sub_81D3AB0 sub_81D3AB0: ; 81D3AB0 push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x80 lsls r0, 5 bl 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, =0x00000ee8 adds r0, r5, 0 adds r1, r4, 0 bl memcpy adds r0, r5, 0 bl sub_81D396C cmp r0, 0 beq @081D3B04 movs r0, 0x1 b @081D3B06 .align 2, 0 .pool @081D3B04: movs r0, 0 @081D3B06: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81D3AD8 thumb_func_start sub_81D3B0C sub_81D3B0C: ; 81D3B0C push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x80 lsls r0, 5 bl 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, =0x03003144 @081D3B64: bl sub_81D4170 ldr r0, =0x030012e2 ldrh r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081D3B76 strb r7, [r4] @081D3B76: movs r0, 0x1 adds r1, r6, 0 adds r2, r5, 0 movs r3, 0 bl sub_81D3D70 adds r1, r0, 0 ldr r0, =0x030012e4 strh r1, [r0] movs r0, 0x13 ands r0, r1 cmp r0, 0x10 bne @081D3BA0 movs r4, 0 b @081D3BC2 .align 2, 0 .pool @081D3BA0: movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @081D3BAC movs r4, 0x1 b @081D3BC2 @081D3BAC: movs r0, 0x4 ands r0, r1 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @081D3BC0 strb r0, [r4] bl VBlankIntrWait b @081D3B64 @081D3BC0: movs r4, 0x2 @081D3BC2: movs r0, 0 str r0, [sp] ldr r1, =0x030012c8 ldr r2, =0x05000006 mov r0, sp bl CpuSet bl sub_81D41F4 adds r0, r4, 0 add sp, 0x4 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D3B54 thumb_func_start sub_81D3BE8 sub_81D3BE8: ; 81D3BE8 push {r4-r6,lr} sub sp, 0x4 adds r5, r0, 0 bl sub_81D41A0 movs r6, 0x2 ldr r4, =0x03003144 @081D3BF6: bl sub_81D4170 ldr r0, =0x030012e2 ldrh r1, [r0] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081D3C08 strb r6, [r4] @081D3C08: movs r0, 0 movs r1, 0 movs r2, 0 adds r3, r5, 0 bl sub_81D3D70 adds r1, r0, 0 ldr r0, =0x030012e4 strh r1, [r0] movs r0, 0x13 ands r0, r1 cmp r0, 0x10 bne @081D3C34 movs r4, 0 b @081D3C56 .align 2, 0 .pool @081D3C34: movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @081D3C40 movs r4, 0x1 b @081D3C56 @081D3C40: movs r0, 0x4 ands r0, r1 lsls r0, 16 lsrs r0, 16 cmp r0, 0 bne @081D3C54 strb r0, [r4] bl VBlankIntrWait b @081D3BF6 @081D3C54: movs r4, 0x2 @081D3C56: movs r0, 0 str r0, [sp] ldr r1, =0x030012c8 ldr r2, =0x05000006 mov r0, sp bl CpuSet bl sub_81D41F4 adds r0, r4, 0 add sp, 0x4 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D3BE8 thumb_func_start sub_81D3C7C sub_81D3C7C: ; 81D3C7C push {r4,lr} ldr r4, =0x04000208 movs r3, 0 strh r3, [r4] ldr r2, =0x04000200 ldrh r1, [r2] ldr r0, =0x0000ff3f ands r0, r1 strh r0, [r2] movs r0, 0x1 strh r0, [r4] ldr r0, =0x04000128 strh r3, [r0] subs r0, 0x1A strh r3, [r0] ldr r1, =0x04000202 movs r0, 0xC0 strh r0, [r1] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D3C7C thumb_func_start sub_81D3CBC sub_81D3CBC: ; 81D3CBC push {r4-r7,lr} sub sp, 0x4 ldr r5, =0x04000208 movs r4, 0 strh r4, [r5] ldr r3, =0x04000200 ldrh r1, [r3] ldr r0, =0x0000ff3f ands r0, r1 strh r0, [r3] movs r6, 0x1 strh r6, [r5] ldr r0, =0x04000134 strh r4, [r0] ldr r2, =0x04000128 movs r1, 0x80 lsls r1, 6 adds r0, r1, 0 strh r0, [r2] ldrh r0, [r2] ldr r7, =0x00004003 adds r1, r7, 0 orrs r0, r1 strh r0, [r2] strh r4, [r5] ldrh r0, [r3] movs r1, 0x80 orrs r0, r1 strh r0, [r3] strh r6, [r5] ldr r1, =0x030012c8 ldrb r0, [r1, 0x1] cmp r0, 0 bne @081D3D0A str r0, [sp] ldr r2, =0x05000006 mov r0, sp bl CpuSet @081D3D0A: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D3CBC thumb_func_start sub_81D3D34 sub_81D3D34: ; 81D3D34 ldr r0, =0x04000134 movs r3, 0 strh r3, [r0] ldr r2, =0x04000128 movs r1, 0xA0 lsls r1, 7 adds r0, r1, 0 strh r0, [r2] ldrh r0, [r2] movs r1, 0x8 orrs r0, r1 strh r0, [r2] ldr r0, =0x03003144 strb r3, [r0] ldr r0, =0x030012e6 strh r3, [r0] ldr r1, =0x030012e8 movs r0, 0 str r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81D3D34 thumb_func_start sub_81D3D70 sub_81D3D70: ; 81D3D70 push {r4-r6,lr} adds r4, r1, 0 adds r5, r2, 0 adds r6, r3, 0 lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x030012c8 ldrb r0, [r0, 0x1] cmp r0, 0x6 bls @081D3D86 b @081D3ECC @081D3D86: lsls r0, 2 ldr r1, =@081D3D98 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081D3D98: .4byte @081D3DB4 .4byte @081D3DC8 .4byte @081D3DE8 .4byte @081D3DFC .4byte @081D3E74 .4byte @081D3E84 .4byte @081D3EBC @081D3DB4: bl sub_81D3CBC ldr r1, =0x030012c8 movs r0, 0x1 strb r0, [r1, 0x2] strb r0, [r1, 0x1] b @081D3ECC .align 2, 0 .pool @081D3DC8: adds r0, r2, 0 bl sub_81D3EE8 lsls r0, 16 cmp r0, 0 beq @081D3DD8 bl sub_81D413C @081D3DD8: ldr r0, =0x03003144 ldrb r0, [r0] cmp r0, 0x2 beq @081D3DE2 b @081D3ECC @081D3DE2: b @081D3E04 .align 2, 0 .pool @081D3DE8: bl sub_81D3D34 adds r0, r4, 0 adds r1, r5, 0 adds r2, r6, 0 bl sub_81D3F1C ldr r1, =0x030012c8 movs r0, 0x3 strb r0, [r1, 0x1] @081D3DFC: ldr r0, =0x03003144 ldrb r0, [r0] cmp r0, 0x2 bne @081D3E18 @081D3E04: ldr r1, =0x030012c8 strb r0, [r1, 0x4] movs r0, 0x6 strb r0, [r1, 0x1] b @081D3ECC .align 2, 0 .pool @081D3E18: ldr r2, =0x030012e6 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] ldr r1, =0x030012e8 ldr r0, [r1] adds r3, r0, 0x1 str r3, [r1] ldr r1, =0x030012c8 ldrb r0, [r1] cmp r0, 0 bne @081D3E3C cmp r3, 0x3C bls @081D3E3C movs r0, 0x1 strb r0, [r1, 0x4] movs r0, 0x6 strb r0, [r1, 0x1] @081D3E3C: ldr r4, =0x030012c8 ldrb r0, [r4, 0x2] cmp r0, 0x2 beq @081D3ECC ldrb r0, [r4] cmp r0, 0 beq @081D3E64 ldrh r0, [r2] cmp r0, 0x2 bls @081D3E64 bl sub_81D413C movs r0, 0x2 b @081D3ECA .align 2, 0 .pool @081D3E64: bl sub_81D413C ldr r1, =0x030012c8 movs r0, 0x2 strb r0, [r1, 0x2] b @081D3ECC .align 2, 0 .pool @081D3E74: bl sub_81D3CBC ldr r1, =0x030012c8 movs r0, 0x5 strb r0, [r1, 0x1] b @081D3ECC .align 2, 0 .pool @081D3E84: ldr r0, =0x030012c8 ldrb r0, [r0] cmp r0, 0x1 bne @081D3E98 ldr r0, =0x030012e6 ldrh r0, [r0] cmp r0, 0x2 bls @081D3E98 bl sub_81D413C @081D3E98: ldr r1, =0x030012e6 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] lsls r0, 16 lsrs r0, 16 cmp r0, 0x3C bls @081D3ECC ldr r0, =0x030012c8 movs r1, 0x1 strb r1, [r0, 0x4] movs r1, 0x6 strb r1, [r0, 0x1] b @081D3ECC .align 2, 0 .pool @081D3EBC: ldr r4, =0x030012c8 ldrb r0, [r4, 0x2] cmp r0, 0 beq @081D3ECC bl sub_81D3C7C movs r0, 0 @081D3ECA: strb r0, [r4, 0x2] @081D3ECC: ldr r2, =0x030012c8 ldrb r0, [r2, 0x2] ldrb r1, [r2, 0x4] lsls r1, 2 orrs r0, r1 ldrb r1, [r2, 0x3] lsls r1, 4 orrs r0, r1 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D3D70 thumb_func_start sub_81D3EE8 sub_81D3EE8: ; 81D3EE8 push {lr} lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x04000128 ldr r0, [r0] movs r1, 0xC ands r0, r1 cmp r0, 0x8 bne @081D3F0C cmp r2, 0 beq @081D3F0C ldr r1, =0x030012c8 movs r0, 0x1 b @081D3F10 .align 2, 0 .pool @081D3F0C: ldr r1, =0x030012c8 movs r0, 0 @081D3F10: strb r0, [r1] pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D3EE8 thumb_func_start sub_81D3F1C sub_81D3F1C: ; 81D3F1C push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldr r3, =0x030012c8 ldrb r0, [r3] cmp r0, 0 beq @081D3F54 ldr r2, =0x04000128 ldrh r0, [r2] movs r1, 0x1 orrs r0, r1 strh r0, [r2] str r5, [r3, 0x8] ldr r0, =0x04000120 str r4, [r0] lsrs r0, r4, 2 adds r0, 0x1 str r0, [r3, 0x10] bl sub_81D3F68 b @081D3F5C .align 2, 0 .pool @081D3F54: ldr r1, =0x04000128 ldrh r0, [r1] strh r0, [r1] str r2, [r3, 0x8] @081D3F5C: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D3F1C thumb_func_start sub_81D3F68 sub_81D3F68: ; 81D3F68 ldr r1, =0x0400010c ldr r2, =0x0000fda7 adds r0, r2, 0 strh r0, [r1] ldr r0, =0x0400010e movs r2, 0x40 strh r2, [r0] ldr r3, =0x04000208 movs r0, 0 strh r0, [r3] adds r1, 0xF4 ldrh r0, [r1] orrs r0, r2 strh r0, [r1] movs r0, 0x1 strh r0, [r3] bx lr .align 2, 0 .pool thumb_func_end sub_81D3F68 thumb_func_start sub_81D3F9C sub_81D3F9C: ; 81D3F9C push {lr} bl sub_81D414C bl sub_81D413C pop {r0} bx r0 thumb_func_end sub_81D3F9C thumb_func_start sub_81D3FAC sub_81D3FAC: ; 81D3FAC push {r4-r6,lr} sub sp, 0x8 ldr r2, =0x030012c8 ldrb r0, [r2, 0x1] adds r3, r2, 0 cmp r0, 0x3 beq @081D4034 cmp r0, 0x3 bgt @081D3FC8 cmp r0, 0x1 beq @081D3FD0 b @081D412A .align 2, 0 .pool @081D3FC8: cmp r0, 0x5 bne @081D3FCE b @081D40FC @081D3FCE: b @081D412A @081D3FD0: ldr r1, =0x0400012a ldr r2, =0x0000ccd0 adds r0, r2, 0 strh r0, [r1] ldr r0, =0x04000120 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] movs r1, 0 movs r2, 0 movs r4, 0 ldr r6, =0x0000ccd0 ldr r5, =0x0000ffff @081D3FEC: lsls r0, r1, 1 add r0, sp ldrh r0, [r0] cmp r0, r6 bne @081D4010 adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 b @081D401A .align 2, 0 .pool @081D4010: cmp r0, r5 beq @081D401A adds r0, r4, 0x1 lsls r0, 16 lsrs r4, r0, 16 @081D401A: adds r0, r1, 0x1 lsls r0, 16 lsrs r1, r0, 16 cmp r1, 0x3 bls @081D3FEC cmp r2, 0x2 beq @081D402A b @081D412A @081D402A: cmp r4, 0 beq @081D4030 b @081D412A @081D4030: strb r2, [r3, 0x1] b @081D412A @081D4034: ldr r0, =0x04000120 ldr r4, [r0] ldr r0, [r2, 0xC] cmp r0, 0 bne @081D404A ldrb r0, [r2] cmp r0, 0 bne @081D404A lsrs r0, r4, 2 adds r0, 0x1 str r0, [r2, 0x10] @081D404A: ldrb r0, [r3] cmp r0, 0x1 bne @081D4080 ldr r1, [r3, 0xC] ldr r0, [r3, 0x10] cmp r1, r0 bge @081D4074 ldr r2, =0x04000120 ldr r0, [r3, 0x8] lsls r1, 2 adds r1, r0 ldr r0, [r1] str r0, [r2] ldr r0, [r3, 0x14] ldr r1, [r1] adds r0, r1 str r0, [r3, 0x14] b @081D40BA .align 2, 0 .pool @081D4074: ldr r1, =0x04000120 ldr r0, [r3, 0x14] b @081D40B8 .align 2, 0 .pool @081D4080: ldr r1, [r3, 0xC] cmp r1, 0 ble @081D40A0 ldr r0, [r3, 0x10] adds r0, 0x1 cmp r1, r0 bge @081D40A0 ldr r0, [r3, 0x8] lsls r1, 2 adds r1, r0 subs r1, 0x4 str r4, [r1] ldr r0, [r3, 0x14] adds r0, r4 str r0, [r3, 0x14] b @081D40B4 @081D40A0: ldr r0, [r3, 0xC] cmp r0, 0 beq @081D40B4 ldr r0, [r3, 0x14] cmp r0, r4 bne @081D40B0 movs r0, 0x1 b @081D40B2 @081D40B0: movs r0, 0x2 @081D40B2: strb r0, [r3, 0x3] @081D40B4: ldr r1, =0x030012e8 movs r0, 0 @081D40B8: str r0, [r1] @081D40BA: ldr r1, [r3, 0xC] adds r1, 0x1 str r1, [r3, 0xC] ldr r0, [r3, 0x10] adds r0, 0x2 cmp r1, r0 bge @081D40EA ldrb r0, [r3] cmp r0, 0 beq @081D40E4 ldr r0, =0x0400010e ldrh r1, [r0] movs r2, 0x80 orrs r1, r2 strh r1, [r0] b @081D412A .align 2, 0 .pool @081D40E4: bl sub_81D413C b @081D412A @081D40EA: movs r0, 0 movs r1, 0x4 strb r1, [r3, 0x1] ldr r1, =0x030012e6 strh r0, [r1] b @081D412A .align 2, 0 .pool @081D40FC: ldrb r3, [r2] cmp r3, 0 bne @081D4108 ldr r1, =0x0400012a ldrb r0, [r2, 0x3] strh r0, [r1] @081D4108: ldr r0, =0x04000120 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp] str r1, [sp, 0x4] mov r0, sp ldrh r1, [r0, 0x2] subs r0, r1, 0x1 lsls r0, 16 lsrs r0, 16 cmp r0, 0x1 bhi @081D412A cmp r3, 0x1 bne @081D4126 strb r1, [r2, 0x3] @081D4126: movs r0, 0x6 strb r0, [r2, 0x1] @081D412A: add sp, 0x8 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D3FAC thumb_func_start sub_81D413C sub_81D413C: ; 81D413C ldr r0, =0x04000128 ldrh r1, [r0] movs r2, 0x80 orrs r1, r2 strh r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81D413C thumb_func_start sub_81D414C sub_81D414C: ; 81D414C ldr r2, =0x0400010e ldrh r1, [r2] ldr r0, =0x0000ff7f ands r0, r1 strh r0, [r2] ldr r1, =0x0400010c ldr r2, =0x0000fda7 adds r0, r2, 0 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81D414C thumb_func_start sub_81D4170 sub_81D4170: ; 81D4170 push {r4,lr} ldr r0, =0x04000130 ldrh r0, [r0] ldr r2, =0x000003ff adds r1, r2, 0 eors r1, r0 ldr r4, =0x030012e2 ldr r3, =0x030012e0 ldrh r2, [r3] adds r0, r1, 0 bics r0, r2 strh r0, [r4] strh r1, [r3] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D4170 thumb_func_start sub_81D41A0 sub_81D41A0: ; 81D41A0 ldr r1, =0x030012ec ldr r0, =0x04000208 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x030012ee ldr r0, =0x04000200 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x030012f0 ldr r0, =0x0400010e ldrh r0, [r0] strh r0, [r1] ldr r1, =0x030012f2 ldr r0, =0x04000128 ldrh r0, [r0] strh r0, [r1] ldr r1, =0x030012f4 ldr r0, =0x04000134 ldrh r0, [r0] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81D41A0 thumb_func_start sub_81D41F4 sub_81D41F4: ; 81D41F4 ldr r1, =0x04000208 ldr r0, =0x030012ec ldrh r0, [r0] strh r0, [r1] subs r1, 0x8 ldr r0, =0x030012ee ldrh r0, [r0] strh r0, [r1] subs r1, 0xF2 ldr r0, =0x030012f0 ldrh r0, [r0] strh r0, [r1] adds r1, 0x1A ldr r0, =0x030012f2 ldrh r0, [r0] strh r0, [r1] adds r1, 0xC ldr r0, =0x030012f4 ldrh r0, [r0] strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81D41F4 thumb_func_start sub_81D4238 sub_81D4238: ; 81D4238 push {lr} sub sp, 0x4 movs r0, 0 str r0, [sp] ldr r1, =0x030012c8 ldr r2, =0x05000006 mov r0, sp bl CpuSet add sp, 0x4 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D4238 thumb_func_start sub_81D4258 sub_81D4258: ; 81D4258 push {lr} sub sp, 0x4 ldr r0, =0x03005d8c ldr r0, [r0] ldrb r1, [r0, 0x5] ldrb r2, [r0, 0x4] movs r0, 0x1 mov r3, sp bl 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 .pool thumb_func_end sub_81D4258 thumb_func_start sub_81D427C sub_81D427C: ; 81D427C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} bl sub_81D4258 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 ldr r2, =0x02037350 adds r5, r1, r2 ldr r4, =0x030012f8 ldr r3, =0x02037590 ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r0, [r0, 0x14] ldrh r1, [r5, 0x10] subs r0, r1 strh r0, [r4] ldr r4, =0x030012fa ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r0, [r0, 0x16] ldrh r1, [r5, 0x12] subs r0, r1 strh r0, [r4] movs r0, 0 mov r8, r0 ldr r2, =0x030012fc movs r1, 0 @081D42CA: mov r3, r8 adds r0, r3, r2 strb r1, [r0] mov r0, r8 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r8, r0 cmp r0, 0x3 bls @081D42CA ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r2, r0, r2 movs r4, 0x14 ldrsh r1, [r2, r4] movs r6, 0x10 ldrsh r0, [r2, r6] cmp r1, r0 bne @081D4304 movs r0, 0x16 ldrsh r1, [r2, r0] movs r3, 0x12 ldrsh r0, [r2, r3] cmp r1, r0 beq @081D4356 @081D4304: ldr r0, =0x0000403a bl 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 .pool @081D4338: ldrb r0, [r5, 0x1] movs r1, 0x20 orrs r0, r1 @081D433E: strb r0, [r5, 0x1] ldr r0, =0x0000403a 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 .pool @081D4360: movs r4, 0 mov r8, r4 ldr r6, =0x02037350 mov r10, r6 @081D4368: ldr r3, =0x02037590 ldrb r1, [r3, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 mov r1, r10 adds r4, r0, r1 mov r2, r8 lsls r1, r2, 2 ldr r6, =gUnknown_0862608C adds r0, r1, r6 movs r6, 0x14 ldrsh r2, [r4, r6] movs r6, 0 ldrsh r0, [r0, r6] ldr r6, =0x02037350 mov r9, r6 mov r12, r3 adds r7, r1, 0 cmp r2, r0 beq @081D4394 b @081D449E @081D4394: movs r3, 0 ldr r1, =gUnknown_0862608E adds r0, r7, r1 movs r2, 0x16 ldrsh r1, [r4, r2] movs r4, 0 ldrsh r2, [r0, r4] cmp r1, r2 bge @081D43C0 movs r6, 0x12 ldrsh r0, [r5, r6] cmp r0, r2 bgt @081D43CA b @081D449E .align 2, 0 .pool @081D43C0: movs r1, 0x12 ldrsh r0, [r5, r1] cmp r0, r2 blt @081D43CA movs r3, 0x1 @081D43CA: cmp r3, 0 bne @081D449E ldr r0, =0x030012f8 movs r2, 0 ldrsh r0, [r0, r2] cmp r0, 0 ble @081D4410 movs r3, 0x10 ldrsh r2, [r5, r3] adds r2, 0x1 mov r4, r12 ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 add r0, r9 movs r6, 0x14 ldrsh r0, [r0, r6] cmp r2, r0 bne @081D4446 ldrh r0, [r5, 0x10] adds r0, 0x1 lsls r0, 16 asrs r0, 16 movs r2, 0x12 ldrsh r1, [r5, r2] bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D4446 @081D4408: movs r0, 0x4 b @081D4816 .align 2, 0 .pool @081D4410: cmp r0, 0 bge @081D4446 movs r3, 0x10 ldrsh r2, [r5, r3] subs r2, 0x1 mov r4, r12 ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 add r0, r9 movs r6, 0x14 ldrsh r0, [r0, r6] cmp r2, r0 bne @081D4446 ldrh r0, [r5, 0x10] subs r0, 0x1 lsls r0, 16 asrs r0, 16 movs r2, 0x12 ldrsh r1, [r5, r2] bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D4446 b @081D45AA @081D4446: ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 add r0, r10 movs r3, 0x10 ldrsh r1, [r5, r3] movs r4, 0x14 ldrsh r0, [r0, r4] cmp r1, r0 bne @081D449E ldr r0, =0x030012fa movs r6, 0 ldrsh r0, [r0, r6] cmp r0, 0 ble @081D4488 adds r0, r1, 0 ldrh r1, [r5, 0x12] subs r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D449E @081D447C: movs r0, 0x2 b @081D4816 .align 2, 0 .pool @081D4488: movs r2, 0x10 ldrsh r0, [r5, r2] ldrh r1, [r5, 0x12] adds r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 bne @081D4538 @081D449E: ldr r2, =0x02037590 ldrb r1, [r2, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 mov r3, r10 adds r4, r0, r3 ldr r6, =gUnknown_0862608C ldr r1, =gUnknown_0862608E adds r0, r7, r1 movs r3, 0x16 ldrsh r1, [r4, r3] movs r3, 0 ldrsh r0, [r0, r3] ldr r3, =0x02037350 mov r9, r3 mov r12, r2 cmp r1, r0 beq @081D44C6 b @081D45D0 @081D44C6: movs r3, 0 adds r0, r7, r6 movs r6, 0x14 ldrsh r1, [r4, r6] movs r4, 0 ldrsh r2, [r0, r4] cmp r1, r2 bge @081D44F0 movs r6, 0x10 ldrsh r0, [r5, r6] cmp r0, r2 bgt @081D44FA b @081D45D0 .align 2, 0 .pool @081D44F0: movs r1, 0x10 ldrsh r0, [r5, r1] cmp r0, r2 blt @081D44FA movs r3, 0x1 @081D44FA: cmp r3, 0 bne @081D45D0 ldr r0, =0x030012fa movs r2, 0 ldrsh r0, [r0, r2] cmp r0, 0 ble @081D4540 movs r3, 0x12 ldrsh r2, [r5, r3] adds r2, 0x1 mov r4, r12 ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 add r0, r9 movs r6, 0x16 ldrsh r0, [r0, r6] cmp r2, r0 bne @081D4576 movs r1, 0x10 ldrsh r0, [r5, r1] ldrh r1, [r5, 0x12] adds r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D4576 @081D4538: movs r0, 0x1 b @081D4816 .align 2, 0 .pool @081D4540: cmp r0, 0 bge @081D4576 movs r3, 0x12 ldrsh r2, [r5, r3] subs r2, 0x1 mov r4, r12 ldrb r1, [r4, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 add r0, r9 movs r6, 0x16 ldrsh r0, [r0, r6] cmp r2, r0 bne @081D4576 movs r1, 0x10 ldrsh r0, [r5, r1] ldrh r1, [r5, 0x12] subs r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D4576 b @081D447C @081D4576: ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 add r0, r10 movs r2, 0x12 ldrsh r1, [r5, r2] movs r3, 0x16 ldrsh r0, [r0, r3] cmp r1, r0 bne @081D45D0 ldr r0, =0x030012f8 movs r4, 0 ldrsh r0, [r0, r4] cmp r0, 0 ble @081D45B8 ldrh r0, [r5, 0x10] subs r0, 0x1 lsls r0, 16 asrs r0, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D45D0 @081D45AA: movs r0, 0x3 b @081D4816 .align 2, 0 .pool @081D45B8: ldrh r0, [r5, 0x10] adds r0, 0x1 lsls r0, 16 asrs r0, 16 movs r2, 0x12 ldrsh r1, [r5, r2] bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D45D0 b @081D4408 @081D45D0: mov r0, r8 adds r0, 0x1 lsls r0, 24 lsrs r0, 24 mov r8, r0 cmp r0, 0x3 bhi @081D45E0 b @081D4368 @081D45E0: adds r0, r5, 0 movs r1, 0 bl sub_81D4C14 lsls r0, 24 cmp r0, 0 beq @081D461C adds r0, r5, 0 movs r1, 0x1 bl sub_81D4C58 lsls r0, 24 cmp r0, 0 beq @081D4604 movs r0, 0x2 bl sub_81D4D24 b @081D4812 @081D4604: adds r0, r5, 0 movs r1, 0x1 bl sub_81D4CE0 lsls r0, 24 cmp r0, 0 bne @081D4614 b @081D447C @081D4614: movs r0, 0x2 bl sub_81D4D24 b @081D4812 @081D461C: adds r0, r5, 0 movs r1, 0 bl sub_81D4C9C lsls r0, 24 cmp r0, 0 beq @081D4658 adds r0, r5, 0 movs r1, 0x1 bl sub_81D4C58 lsls r0, 24 cmp r0, 0 beq @081D4640 movs r0, 0x2 bl sub_81D4D24 b @081D4812 @081D4640: adds r0, r5, 0 movs r1, 0x1 bl sub_81D4CE0 lsls r0, 24 cmp r0, 0 bne @081D4650 b @081D4538 @081D4650: movs r0, 0x2 bl sub_81D4D24 b @081D4812 @081D4658: adds r0, r5, 0 movs r1, 0 bl sub_81D4C58 lsls r0, 24 cmp r0, 0 beq @081D4694 adds r0, r5, 0 movs r1, 0x1 bl sub_81D4C14 lsls r0, 24 cmp r0, 0 beq @081D467C movs r0, 0x2 bl sub_81D4D24 b @081D4812 @081D467C: adds r0, r5, 0 movs r1, 0x1 bl sub_81D4C9C lsls r0, 24 cmp r0, 0 bne @081D468C b @081D4408 @081D468C: movs r0, 0x2 bl sub_81D4D24 b @081D4812 @081D4694: adds r0, r5, 0 movs r1, 0 bl sub_81D4CE0 lsls r0, 24 cmp r0, 0 beq @081D46D0 adds r0, r5, 0 movs r1, 0x1 bl sub_81D4C14 lsls r0, 24 cmp r0, 0 beq @081D46B8 movs r0, 0x2 bl sub_81D4D24 b @081D4812 @081D46B8: adds r0, r5, 0 movs r1, 0x1 bl sub_81D4C9C lsls r0, 24 cmp r0, 0 bne @081D46C8 b @081D45AA @081D46C8: movs r0, 0x2 bl sub_81D4D24 b @081D4812 @081D46D0: ldr r0, =0x030012fa movs r3, 0 ldrsh r0, [r0, r3] cmp r0, 0 bne @081D476E ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 movs r4, 0x12 ldrsh r1, [r0, r4] ldrh r2, [r5, 0x12] movs r6, 0x12 ldrsh r0, [r5, r6] cmp r1, r0 ble @081D470C movs r1, 0x10 ldrsh r0, [r5, r1] subs r1, r2, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D470C b @081D447C @081D470C: ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 movs r2, 0x12 ldrsh r1, [r0, r2] ldrh r2, [r5, 0x12] movs r3, 0x12 ldrsh r0, [r5, r3] cmp r1, r0 bge @081D473E movs r4, 0x10 ldrsh r0, [r5, r4] adds r1, r2, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D473E b @081D4538 @081D473E: movs r6, 0x10 ldrsh r0, [r5, r6] ldrh r1, [r5, 0x12] subs r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D4756 b @081D447C @081D4756: movs r1, 0x10 ldrsh r0, [r5, r1] ldrh r1, [r5, 0x12] adds r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D476E b @081D4538 @081D476E: ldr r0, =0x030012f8 movs r2, 0 ldrsh r0, [r0, r2] cmp r0, 0 bne @081D480C ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 movs r3, 0x10 ldrsh r1, [r0, r3] ldrh r2, [r5, 0x10] movs r4, 0x10 ldrsh r0, [r5, r4] cmp r1, r0 ble @081D47AA subs r0, r2, 0x1 lsls r0, 16 asrs r0, 16 movs r6, 0x12 ldrsh r1, [r5, r6] bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D47AA b @081D45AA @081D47AA: ldr r2, =0x02037350 ldr r0, =0x02037590 ldrb r1, [r0, 0x5] lsls r0, r1, 3 adds r0, r1 lsls r0, 2 adds r0, r2 movs r2, 0x10 ldrsh r1, [r0, r2] ldrh r2, [r5, 0x10] movs r3, 0x10 ldrsh r0, [r5, r3] cmp r1, r0 bge @081D47DC adds r0, r2, 0x1 lsls r0, 16 asrs r0, 16 movs r4, 0x12 ldrsh r1, [r5, r4] bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D47DC b @081D4408 @081D47DC: ldrh r0, [r5, 0x10] adds r0, 0x1 lsls r0, 16 asrs r0, 16 movs r6, 0x12 ldrsh r1, [r5, r6] bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D47F4 b @081D4408 @081D47F4: ldrh r0, [r5, 0x10] subs r0, 0x1 lsls r0, 16 asrs r0, 16 movs r2, 0x12 ldrsh r1, [r5, r2] bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D480C b @081D45AA @081D480C: movs r0, 0 bl sub_81D4890 @081D4812: lsls r0, 24 lsrs r0, 24 @081D4816: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D427C thumb_func_start sub_81D4834 sub_81D4834: ; 81D4834 push {r4,lr} lsls r0, 16 lsls r1, 16 lsrs r4, r1, 16 ldr r3, =0x02037350 ldr r1, =0x02037590 ldrb r2, [r1, 0x5] lsls r1, r2, 3 adds r1, r2 lsls r1, 2 adds r2, r1, r3 movs r3, 0x10 ldrsh r1, [r2, r3] lsrs r3, r0, 16 asrs r0, 16 cmp r1, r0 bne @081D4870 movs r0, 0x12 ldrsh r1, [r2, r0] lsls r0, r4, 16 asrs r0, 16 cmp r1, r0 bne @081D4870 movs r0, 0 b @081D4888 .align 2, 0 .pool @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, =0x02037350 adds r4, r1, r0 movs r1, 0 ldr r3, =0x030012fc movs r2, 0 @081D48B0: adds r0, r1, r3 strb r2, [r0] adds r0, r1, 0x1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x3 bls @081D48B0 movs r1, 0x10 ldrsh r0, [r4, r1] ldrh r1, [r4, 0x12] subs r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081D48E8 cmp r6, 0x2 beq @081D48E8 ldr r0, =0x030012fc adds r0, r5, r0 movs r1, 0x2 strb r1, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @081D48E8: ldrh r0, [r4, 0x10] adds r0, 0x1 lsls r0, 16 asrs r0, 16 movs r2, 0x12 ldrsh r1, [r4, r2] bl sub_81D4834 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081D4912 cmp r6, 0x4 beq @081D4912 ldr r0, =0x030012fc adds r0, r5, r0 movs r1, 0x4 strb r1, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @081D4912: movs r1, 0x10 ldrsh r0, [r4, r1] ldrh r1, [r4, 0x12] adds r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0x1 bne @081D493A cmp r6, 0x1 beq @081D493A ldr r0, =0x030012fc adds r0, r5, r0 strb r1, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @081D493A: ldrh r0, [r4, 0x10] subs r0, 0x1 lsls r0, 16 asrs r0, 16 movs r2, 0x12 ldrsh r1, [r4, r2] bl sub_81D4834 lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081D4964 cmp r6, 0x3 beq @081D4964 ldr r0, =0x030012fc adds r0, r5, r0 movs r1, 0x3 strb r1, [r0] adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @081D4964: cmp r5, 0x1 bhi @081D4974 ldr r0, =0x030012fc b @081D4988 .align 2, 0 .pool @081D4974: ldr r4, =0x030012fc ldr r0, =0x0000403a 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 .pool thumb_func_end sub_81D4890 thumb_func_start sub_81D4998 sub_81D4998: ; 81D4998 push {r4,lr} ldr r4, =0x0000403a adds r0, r4, 0 bl var_get lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000391a cmp r1, r0 bne @081D49E0 adds r0, r2, 0x1 lsls r0, 16 lsrs r2, r0, 16 ldr r0, =0x0000270e cmp r2, r0 bls @081D49D8 adds r0, r4, 0 movs r1, 0 bl var_set b @081D49E0 .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000391a cmp r1, r0 bne @081D4A0C ldrb r0, [r2, 0x5] cmp r0, 0xE5 bne @081D4A0C movs r0, 0x1 b @081D4A0E .align 2, 0 .pool @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, =0x03005d8c ldr r0, [r0] ldrh r1, [r0, 0x4] ldr r0, =0x0000391a 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, =0x000002ce bl flag_check lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 beq @081D4A50 movs r0, 0x1 b @081D4A52 .align 2, 0 .pool @081D4A50: movs r0, 0 @081D4A52: pop {r1} bx r1 thumb_func_end unown_chamber_related thumb_func_start sub_81D4A58 sub_81D4A58: ; 81D4A58 push {r4,lr} ldr r4, =0x0000403a adds r0, r4, 0 bl var_get lsls r0, 16 ldr r1, =0xffff0000 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 .pool @081D4A88: movs r0, 0 @081D4A8A: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D4A58 thumb_func_start sub_81D4A90 sub_81D4A90: ; 81D4A90 push {r4-r6,lr} sub sp, 0x4 bl sub_81D4258 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 3 adds r1, r0 lsls r1, 2 ldr r0, =0x02037350 adds r5, r1, r0 ldrb r1, [r5, 0x1] movs r0, 0x21 negs r0, r0 ands r0, r1 strb r0, [r5, 0x1] ldr r0, =0x020375e0 ldrh r4, [r0] cmp r4, 0x1 bne @081D4AF8 ldrb r0, [r5, 0x3] movs r1, 0x4 orrs r0, r1 strb r0, [r5, 0x3] ldr r3, =0x02020630 ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x42 ldrb r2, [r0] movs r1, 0x3F ands r1, r2 movs r2, 0x80 orrs r1, r2 strb r1, [r0] ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 adds r0, 0x43 strb r4, [r0] b @081D4BC4 .align 2, 0 .pool @081D4AF8: ldr r0, =0x0000403a ldr r1, =0x0000ffff bl var_set ldrb r0, [r5, 0x3] movs r1, 0x4 orrs r0, r1 strb r0, [r5, 0x3] ldr r6, =0x02020630 ldrb r1, [r5, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 adds r0, 0x42 ldrb r2, [r0] movs r1, 0x3F ands r1, r2 movs r2, 0x80 orrs r1, r2 strb r1, [r0] ldr r0, =0x020375f4 ldrh r0, [r0] cmp r0, 0x2 beq @081D4B3A ldrb r0, [r5, 0x4] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r6 adds r1, 0x43 movs r0, 0x1 strb r0, [r1] @081D4B3A: ldr r4, =gUnknown_0850C9C8 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, =gUnknown_085059F8 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, =0x0203cf50 strb r0, [r1] lsls r0, 24 lsrs r0, 24 cmp r0, 0x40 beq @081D4BC4 ldrb r0, [r1] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r6 adds r3, r1, 0 adds r3, 0x3E ldrb r0, [r3] movs r2, 0x2 orrs r0, r2 strb r0, [r3] ldrb r2, [r1, 0x5] movs r0, 0xD negs r0, r0 ands r0, r2 movs r2, 0x8 orrs r0, r2 strb r0, [r1, 0x5] ldr r0, =nullsub_12 str r0, [r1, 0x1C] @081D4BC4: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D4A90 thumb_func_start sub_81D4BEC sub_81D4BEC: ; 81D4BEC push {lr} ldr r1, =0x0203cf50 ldrb r0, [r1] cmp r0, 0x40 beq @081D4C06 adds r1, r0, 0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r1, =0x02020630 adds r0, r1 bl obj_delete_and_free_tiles @081D4C06: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D4BEC thumb_func_start sub_81D4C14 sub_81D4C14: ; 81D4C14 push {r4,lr} adds r2, r0, 0 lsls r1, 24 lsrs r4, r1, 24 ldr r0, =0x030012fa movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 ble @081D4C50 movs r1, 0x10 ldrsh r0, [r2, r1] ldrh r1, [r2, 0x12] subs r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D4C50 ldr r0, =0x030012fc adds r0, r4, r0 movs r1, 0x2 strb r1, [r0] movs r0, 0x1 b @081D4C52 .align 2, 0 .pool @081D4C50: movs r0, 0 @081D4C52: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D4C14 thumb_func_start sub_81D4C58 sub_81D4C58: ; 81D4C58 push {r4,lr} adds r2, r0, 0 lsls r1, 24 lsrs r4, r1, 24 ldr r0, =0x030012f8 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bge @081D4C94 ldrh r0, [r2, 0x10] adds r0, 0x1 lsls r0, 16 asrs r0, 16 movs r3, 0x12 ldrsh r1, [r2, r3] bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D4C94 ldr r0, =0x030012fc adds r0, r4, r0 movs r1, 0x4 strb r1, [r0] movs r0, 0x1 b @081D4C96 .align 2, 0 .pool @081D4C94: movs r0, 0 @081D4C96: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D4C58 thumb_func_start sub_81D4C9C sub_81D4C9C: ; 81D4C9C push {r4,lr} adds r2, r0, 0 lsls r1, 24 lsrs r4, r1, 24 ldr r0, =0x030012fa movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 bge @081D4CD8 movs r1, 0x10 ldrsh r0, [r2, r1] ldrh r1, [r2, 0x12] adds r1, 0x1 lsls r1, 16 asrs r1, 16 bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D4CD8 ldr r0, =0x030012fc adds r0, r4, r0 movs r1, 0x1 strb r1, [r0] movs r0, 0x1 b @081D4CDA .align 2, 0 .pool @081D4CD8: movs r0, 0 @081D4CDA: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D4C9C thumb_func_start sub_81D4CE0 sub_81D4CE0: ; 81D4CE0 push {r4,lr} adds r2, r0, 0 lsls r1, 24 lsrs r4, r1, 24 ldr r0, =0x030012f8 movs r1, 0 ldrsh r0, [r0, r1] cmp r0, 0 ble @081D4D1C ldrh r0, [r2, 0x10] subs r0, 0x1 lsls r0, 16 asrs r0, 16 movs r3, 0x12 ldrsh r1, [r2, r3] bl sub_81D4834 lsls r0, 24 cmp r0, 0 beq @081D4D1C ldr r0, =0x030012fc adds r0, r4, r0 movs r1, 0x3 strb r1, [r0] movs r0, 0x1 b @081D4D1E .align 2, 0 .pool @081D4D1C: movs r0, 0 @081D4D1E: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D4CE0 thumb_func_start sub_81D4D24 sub_81D4D24: ; 81D4D24 push {r4,r5,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r5, =0x030012fc ldr r0, =0x0000403a bl 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 .pool thumb_func_end sub_81D4D24 thumb_func_start sub_81D4D50 sub_81D4D50: ; 81D4D50 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x4 adds r5, r0, 0 adds r6, r1, 0 mov r8, r2 mov r1, sp ldr r4, =0x04000208 ldrh r0, [r4] strh r0, [r1] movs r0, 0 strh r0, [r4] ldr r1, =0x03002710 ldr r0, =sub_81D3FAC str r0, [r1, 0x4] ldr r0, =sub_81D3F9C str r0, [r1, 0x8] bl sub_81D41A0 bl sub_81D4238 ldr r2, =0x04000200 ldrh r0, [r2] movs r1, 0x4 orrs r0, r1 strh r0, [r2] mov r0, sp ldrh r0, [r0] strh r0, [r4] movs r0, 0 strh r0, [r5] str r6, [r5, 0x4] mov r0, r8 str r0, [r5, 0x8] add sp, 0x4 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D4D50 thumb_func_start sub_81D4DB8 sub_81D4DB8: ; 81D4DB8 push {r4,lr} sub sp, 0x4 mov r1, sp ldr r4, =0x04000208 ldrh r0, [r4] strh r0, [r1] movs r0, 0 strh r0, [r4] bl sub_81D4238 bl sub_81D41F4 bl 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 .pool thumb_func_end sub_81D4DB8 thumb_func_start sub_81D4DE8 sub_81D4DE8: ; 81D4DE8 push {r4,r5,lr} adds r4, r0, 0 movs r5, 0 ldr r1, [r4, 0x4] ldr r2, [r4, 0x8] movs r0, 0x1 movs r3, 0 bl sub_81D3D70 adds r1, r0, 0 strh r1, [r4] movs r0, 0x13 ands r0, r1 cmp r0, 0x10 bne @081D4E08 movs r5, 0x1 @081D4E08: movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @081D4E12 movs r5, 0x2 @081D4E12: movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @081D4E1C movs r5, 0x3 @081D4E1C: ldr r1, =0x03003144 movs r0, 0 strb r0, [r1] adds r0, r5, 0 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D4DE8 thumb_func_start sub_81D4E30 sub_81D4E30: ; 81D4E30 push {lr} ldr r0, =0x0201c000 movs r2, 0x80 lsls r2, 6 movs r1, 0 bl memset ldr r1, =0x020229c6 ldr r2, =0x00005503 adds r0, r2, 0 strh r0, [r1] bl sub_8009734 movs r0, 0x1 bl sub_800B330 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D4E30 thumb_func_start sub_81D4E60 sub_81D4E60: ; 81D4E60 push {lr} sub sp, 0xC mov r1, sp ldr r2, =0x04000208 ldrh r0, [r2] strh r0, [r1] movs r0, 0 strh r0, [r2] ldr r0, =0x03003174 ldr r1, [r0, 0x4] ldr r0, [r0] str r0, [sp, 0x4] str r1, [sp, 0x8] mov r0, sp ldrh r0, [r0] strh r0, [r2] add r2, sp, 0x4 ldrh r1, [r2] ldr r0, =0x0000b9a0 cmp r1, r0 bne @081D4EB8 ldrh r1, [r2, 0x2] ldr r0, =0x0000ccd0 cmp r1, r0 bne @081D4EB8 ldrh r1, [r2, 0x4] ldr r0, =0x0000ffff cmp r1, r0 bne @081D4EB8 ldrh r0, [r2, 0x6] cmp r0, r1 bne @081D4EB8 movs r0, 0x1 b @081D4EBA .align 2, 0 .pool @081D4EB8: movs r0, 0 @081D4EBA: add sp, 0xC pop {r1} bx r1 thumb_func_end sub_81D4E60 thumb_func_start sub_81D4EC0 sub_81D4EC0: ; 81D4EC0 push {lr} bl sub_800ABBC lsls r0, 24 cmp r0, 0 beq @081D4EDC bl sub_800ABAC lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @081D4EDC movs r0, 0x1 b @081D4EDE @081D4EDC: movs r0, 0 @081D4EDE: pop {r1} bx r1 thumb_func_end sub_81D4EC0 thumb_func_start sub_81D4EE4 sub_81D4EE4: ; 81D4EE4 push {r4,r5,lr} adds r4, r0, 0 adds r5, r1, 0 ldrb r0, [r4] subs r0, 0x3 lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bhi @081D4F08 bl sub_800B33C lsls r0, 24 cmp r0, 0 beq @081D4F08 movs r0, 0 strb r0, [r4] movs r0, 0x3 b @081D500E @081D4F08: ldrb r0, [r4] cmp r0, 0x5 bls @081D4F10 b @081D500C @081D4F10: lsls r0, 2 ldr r1, =@081D4F20 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081D4F20: .4byte @081D4F38 .4byte @081D4F54 .4byte @081D4F6C .4byte @081D4FA0 .4byte @081D4FEC .4byte @081D4FF8 @081D4F38: bl sub_800ABBC lsls r0, 24 cmp r0, 0 beq @081D4F88 bl sub_800ABAC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @081D4F88 movs r0, 0x1 strb r0, [r4] b @081D500C @081D4F54: ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] lsls r0, 16 lsrs r0, 16 cmp r0, 0x5 bls @081D500C movs r0, 0 strh r0, [r5] movs r0, 0x2 strb r0, [r4] b @081D500C @081D4F6C: bl sub_800ABAC lsls r0, 24 lsrs r0, 24 cmp r0, 0x2 bne @081D4F88 movs r0, 0x49 bl audio_play bl sub_800A620 movs r0, 0 strh r0, [r5] b @081D4FE6 @081D4F88: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081D500C movs r0, 0 strb r0, [r4] movs r0, 0x1 b @081D500E .align 2, 0 .pool @081D4FA0: ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] lsls r0, 16 lsrs r0, 16 cmp r0, 0x1E bls @081D4FB6 movs r0, 0 strb r0, [r4] movs r0, 0x5 b @081D500E @081D4FB6: bl sub_800B320 lsls r0, 24 cmp r0, 0 beq @081D500C ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 beq @081D4FE6 bl sub_800A23C lsls r0, 24 cmp r0, 0 beq @081D4FE0 movs r0, 0 strb r0, [r4] movs r0, 0x2 b @081D500E .align 2, 0 .pool @081D4FE0: movs r0, 0x4 strb r0, [r4] b @081D500C @081D4FE6: movs r0, 0x3 strb r0, [r4] b @081D500C @081D4FEC: movs r0, 0 bl sub_800ABF4 movs r0, 0x5 strb r0, [r4] b @081D500C @081D4FF8: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @081D500C strb r0, [r4] movs r0, 0x4 b @081D500E .align 2, 0 .pool @081D500C: movs r0, 0 @081D500E: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81D4EE4 thumb_func_start sub_81D5014 sub_81D5014: ; 81D5014 push {r4,lr} ldr r0, =sub_81D5084 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 movs r0, 0 strb r0, [r4, 0x8] strb r0, [r4, 0x9] strb r0, [r4, 0xA] strb r0, [r4, 0xB] strb r0, [r4, 0xC] strb r0, [r4, 0xD] movs r1, 0 strh r0, [r4] strh r0, [r4, 0x2] strh r0, [r4, 0x4] strh r0, [r4, 0x6] strb r1, [r4, 0xE] movs r0, 0x40 bl malloc_and_clear str r0, [r4, 0x10] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5014 thumb_func_start sub_81D505C sub_81D505C: ; 81D505C movs r1, 0 strh r1, [r0] bx lr thumb_func_end sub_81D505C thumb_func_start sub_81D5064 sub_81D5064: ; 81D5064 push {lr} adds r2, r0, 0 lsls r1, 16 ldrh r0, [r2] adds r0, 0x1 strh r0, [r2] lsls r0, 16 cmp r0, r1 bhi @081D507A movs r0, 0 b @081D5080 @081D507A: movs r0, 0 strh r0, [r2] movs r0, 0x1 @081D5080: pop {r1} bx r1 thumb_func_end sub_81D5064 thumb_func_start sub_81D5084 sub_81D5084: ; 81D5084 push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrb r0, [r4, 0x8] cmp r0, 0x1A bls @081D509C b @081D548A @081D509C: lsls r0, 2 ldr r1, =@081D50B0 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081D50B0: .4byte @081D511C .4byte @081D5138 .4byte @081D5148 .4byte @081D515C .4byte @081D516C .4byte @081D5198 .4byte @081D51D0 .4byte @081D524C .4byte @081D5268 .4byte @081D5290 .4byte @081D52AC .4byte @081D52DC .4byte @081D52F2 .4byte @081D5308 .4byte @081D536A .4byte @081D5390 .4byte @081D53A8 .4byte @081D53C6 .4byte @081D53F2 .4byte @081D5418 .4byte @081D5448 .4byte @081D5454 .4byte @081D5460 .4byte @081D5430 .4byte @081D548A .4byte @081D548A .4byte @081D5478 @081D511C: adds r0, r4, 0 adds r0, 0x9 ldr r1, =gUnknown_085EDFD6 bl mevent_0814257C cmp r0, 0 bne @081D512C b @081D548A @081D512C: movs r0, 0x1 strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D5138: bl sub_81D4E30 adds r0, r4, 0 bl sub_81D505C movs r0, 0x2 strb r0, [r4, 0x8] b @081D548A @081D5148: adds r0, r4, 0 movs r1, 0xA bl sub_81D5064 cmp r0, 0 bne @081D5156 b @081D548A @081D5156: movs r0, 0x3 strb r0, [r4, 0x8] b @081D548A @081D515C: bl sub_81D4EC0 cmp r0, 0 beq @081D5166 b @081D52FC @081D5166: bl sub_80097E8 b @081D525C @081D516C: adds r0, r4, 0 adds r0, 0x9 ldr r1, =gUnknown_085EDFF5 bl mevent_0814257C cmp r0, 0 bne @081D517C b @081D548A @081D517C: ldr r0, =gUnknown_085EE014 bl sub_8018884 adds r0, r4, 0 bl sub_81D505C movs r0, 0x5 strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D5198: adds r0, r4, 0 movs r1, 0x5A bl sub_81D5064 cmp r0, 0 beq @081D51AE bl sub_81D4E30 movs r0, 0x6 strb r0, [r4, 0x8] b @081D548A @081D51AE: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 bne @081D51BC b @081D548A @081D51BC: adds r0, r4, 0 bl sub_81D505C movs r0, 0x5 bl audio_play b @081D535A .align 2, 0 .pool @081D51D0: ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x2 ands r0, r1 cmp r0, 0 beq @081D51F4 movs r0, 0x5 bl audio_play bl sub_80097E8 adds r0, r4, 0 bl sub_81D505C b @081D535A .align 2, 0 .pool @081D51F4: bl sub_800ABAC lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bls @081D5210 adds r0, r4, 0 bl sub_81D505C bl sub_80097E8 movs r0, 0x7 strb r0, [r4, 0x8] b @081D548A @081D5210: bl sub_81D4E60 cmp r0, 0 beq @081D522E movs r0, 0x5 bl audio_play bl sub_80097E8 adds r0, r4, 0 bl sub_81D505C movs r0, 0x8 strb r0, [r4, 0x8] b @081D548A @081D522E: adds r0, r4, 0 movs r1, 0xA bl sub_81D5064 cmp r0, 0 bne @081D523C b @081D548A @081D523C: bl sub_80097E8 bl sub_81D4E30 adds r0, r4, 0 bl sub_81D505C b @081D548A @081D524C: adds r0, r4, 0 adds r0, 0x9 ldr r1, =gUnknown_085EE05C bl mevent_0814257C cmp r0, 0 bne @081D525C b @081D548A @081D525C: movs r0, 0x4 strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D5268: ldr r0, =gUnknown_085EE097 bl sub_8018884 ldr r0, =0x03006370 ldr r1, =gUnknown_089A6550 ldr r2, =gUnknown_089A3470 subs r1, r2 bl sub_81D4D50 movs r0, 0x9 strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D5290: ldr r0, =0x03006370 bl sub_81D4DE8 strb r0, [r4, 0xE] lsls r0, 24 cmp r0, 0 bne @081D52A0 b @081D548A @081D52A0: movs r0, 0xA strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D52AC: ldr r0, =0x03006370 bl sub_81D4DB8 ldrb r0, [r4, 0xE] cmp r0, 0x3 bne @081D52BA b @081D53C0 @081D52BA: cmp r0, 0x1 beq @081D52C0 b @081D546E @081D52C0: adds r0, r4, 0 bl sub_81D505C ldr r0, =gUnknown_085EE120 bl sub_8018884 movs r0, 0xB strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D52DC: movs r1, 0xD2 lsls r1, 2 adds r0, r4, 0 bl sub_81D5064 cmp r0, 0 bne @081D52EC b @081D548A @081D52EC: movs r0, 0xC strb r0, [r4, 0x8] b @081D548A @081D52F2: bl sub_81D4E30 ldr r0, =gUnknown_085EE0DC bl sub_8018884 @081D52FC: movs r0, 0xD strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D5308: adds r0, r4, 0 adds r0, 0x9 adds r1, r4, 0 bl sub_81D4EE4 cmp r0, 0x5 bls @081D5318 b @081D548A @081D5318: lsls r0, 2 ldr r1, =@081D5328 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081D5328: .4byte @081D548A .4byte @081D5350 .4byte @081D5340 .4byte @081D5374 .4byte @081D5374 .4byte @081D5360 @081D5340: ldr r0, =gUnknown_085EE097 bl sub_8018884 movs r0, 0xE strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D5350: movs r0, 0x5 bl audio_play bl sub_80097E8 @081D535A: movs r0, 0x17 strb r0, [r4, 0x8] b @081D548A @081D5360: bl sub_80097E8 movs r0, 0x15 strb r0, [r4, 0x8] b @081D548A @081D536A: bl sub_800B33C lsls r0, 24 cmp r0, 0 beq @081D537A @081D5374: bl sub_80097E8 b @081D53C0 @081D537A: bl sub_800A550 lsls r0, 24 cmp r0, 0 bne @081D5386 b @081D548A @081D5386: bl sub_800A5B4 movs r0, 0xF strb r0, [r4, 0x8] b @081D548A @081D5390: ldr r0, =0x0201c000 bl sub_81D3920 strb r0, [r4, 0xE] ldrb r0, [r4, 0xE] bl sub_800ABF4 movs r0, 0x10 strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D53A8: ldr r0, =0x03003124 ldrb r0, [r0] cmp r0, 0 bne @081D548A ldrb r0, [r4, 0xE] cmp r0, 0x1 bne @081D53C0 movs r0, 0x11 strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D53C0: movs r0, 0x14 strb r0, [r4, 0x8] b @081D548A @081D53C6: ldr r0, =0x0201c000 bl sub_81D3AB0 cmp r0, 0 beq @081D53EC ldr r0, =gUnknown_085EE0FA bl sub_8018884 adds r0, r4, 0 bl sub_81D505C movs r0, 0x12 strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D53EC: movs r0, 0x16 strb r0, [r4, 0x8] b @081D548A @081D53F2: adds r0, r4, 0 movs r1, 0x78 bl sub_81D5064 cmp r0, 0 beq @081D548A ldr r0, =gUnknown_085EE107 bl sub_8018884 movs r0, 0xB9 lsls r0, 1 bl fanfare_play movs r0, 0x13 strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D5418: bl task_is_not_running_overworld_fanfare lsls r0, 24 cmp r0, 0 beq @081D548A ldr r0, =0x030022c0 ldrh r1, [r0, 0x2E] movs r0, 0x3 ands r0, r1 b @081D543A .align 2, 0 .pool @081D5430: adds r0, r4, 0 adds r0, 0x9 ldr r1, =gUnknown_085EE06B bl mevent_0814257C @081D543A: cmp r0, 0 beq @081D548A movs r0, 0x1A strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D5448: adds r0, r4, 0 adds r0, 0x9 ldr r1, =gUnknown_085EE0A3 b @081D5466 .align 2, 0 .pool @081D5454: adds r0, r4, 0 adds r0, 0x9 ldr r1, =gUnknown_085EE0BF b @081D5466 .align 2, 0 .pool @081D5460: adds r0, r4, 0 adds r0, 0x9 ldr r1, =gUnknown_085EE12D @081D5466: bl mevent_0814257C cmp r0, 0 beq @081D548A @081D546E: movs r0, 0 strb r0, [r4, 0x8] b @081D548A .align 2, 0 .pool @081D5478: ldr r0, [r4, 0x10] bl free adds r0, r5, 0 bl remove_task ldr r0, =sub_80186A4 bl set_callback2 @081D548A: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5084 thumb_func_start sp194_trainer_tower sp194_trainer_tower: ; 81D5494 push {lr} bl sub_81D56B0 ldr r1, =gUnknown_0862A618 ldr r0, =0x020375e0 ldrh r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] bl _call_via_r0 bl sub_81D5710 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sp194_trainer_tower thumb_func_start sub_81D54BC sub_81D54BC: ; 81D54BC push {r4-r6,lr} ldr r4, =0x03005d90 ldr r1, [r4] ldr r3, =0x00000ef9 adds r1, r3 ldrb r2, [r1] movs r0, 0x7F ands r0, r2 strb r0, [r1] ldr r1, [r4] adds r1, r3 ldrb r2, [r1] movs r0, 0x80 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r2, =0x03005d8c ldr r0, [r2] ldr r1, =0x00003d68 adds r0, r1 movs r1, 0 str r1, [r0] adds r6, r2, 0 ldr r5, =0x00003718 movs r4, 0x3 @081D54EE: ldr r0, [r6] adds r0, r5 ldr r1, =0x00034bbf bl sub_81D5DF4 adds r5, 0x4 subs r4, 0x1 cmp r4, 0 bge @081D54EE pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D54BC thumb_func_start sub_81D5520 sub_81D5520: ; 81D5520 ldr r0, =0x02037318 ldrb r0, [r0, 0x12] adds r0, 0x61 lsls r0, 24 lsrs r0, 24 bx lr .align 2, 0 .pool thumb_func_end sub_81D5520 thumb_func_start sub_81D5530 sub_81D5530: ; 81D5530 lsls r0, 24 movs r1, 0xFF lsls r1, 24 adds r0, r1 lsrs r0, 24 ldr r2, =gTrainerClassNameIndices ldr r1, =0x0203cf58 ldr r1, [r1] adds r1, 0x16 adds r1, r0 ldrb r0, [r1] adds r0, r2 ldrb r0, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81D5530 thumb_func_start sub_81D5554 sub_81D5554: ; 81D5554 push {r4,lr} adds r4, r0, 0 lsls r1, 24 movs r0, 0xFF lsls r0, 24 adds r1, r0 lsrs r1, 24 movs r3, 0 ldr r0, =0x0203cf58 ldr r2, [r0] movs r0, 0xB muls r0, r1 adds r2, r0, r2 @081D556E: adds r1, r4, r3 ldrb r0, [r2] strb r0, [r1] adds r2, 0x1 adds r3, 0x1 cmp r3, 0xA ble @081D556E pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5554 thumb_func_start sub_81D5588 sub_81D5588: ; 81D5588 push {r4,lr} adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl sub_81D56B0 subs r4, 0x1 lsls r4, 24 lsrs r4, 24 ldr r0, =0x0203cf54 ldr r3, [r0] lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r4 ldrb r2, [r3] lsls r0, r2, 4 subs r0, r2 lsls r0, 3 subs r0, r2 adds r0, r1 lsls r0, 3 adds r3, r0 ldrb r4, [r3, 0x1B] bl sub_81D5710 ldr r0, =gUnknown_0831F578 adds r4, r0 ldrb r0, [r4] pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D5588 thumb_func_start sub_81D55D0 sub_81D55D0: ; 81D55D0 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} bl sub_81D56B0 ldr r4, =0x0203cf58 movs r0, 0x18 bl malloc_and_clear str r0, [r4] movs r6, 0 ldr r0, =0x0203cf54 mov r10, r0 @081D55EE: movs r5, 0 lsls r1, r6, 2 mov r8, r1 adds r0, r6, 0x1 mov r9, r0 movs r0, 0xB adds r1, r6, 0 muls r1, r0 mov r12, r1 mov r1, r8 adds r0, r1, r6 lsls r0, 3 adds r0, r6 lsls r7, r0, 3 @081D560A: ldr r0, =0x0203cf58 ldr r4, [r0] mov r1, r12 adds r0, r5, r1 adds r4, r0 mov r0, r10 ldr r2, [r0] adds r3, r5, r7 ldrb r1, [r2] lsls r0, r1, 4 subs r0, r1 lsls r0, 3 subs r0, r1 lsls r0, 3 adds r3, r0 adds r2, 0x10 adds r2, r3 ldrb r0, [r2] strb r0, [r4] adds r5, 0x1 cmp r5, 0xA ble @081D560A ldr r1, =0x0203cf58 ldr r4, [r1] adds r4, 0x16 adds r4, r6 mov r0, r10 ldr r3, [r0] mov r1, r8 adds r2, r1, r6 lsls r2, 3 adds r2, r6 ldrb r1, [r3] lsls r0, r1, 4 subs r0, r1 lsls r0, 3 subs r0, r1 adds r0, r2 lsls r0, 3 adds r3, r0 ldrb r0, [r3, 0x1B] strb r0, [r4] mov r6, r9 cmp r6, 0x1 ble @081D55EE ldr r1, =0x03005d8c ldr r0, [r1] ldr r1, =0x00003d64 adds r0, r1 bl sub_80008DC bl sub_81D5710 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D55D0 thumb_func_start sub_81D5694 sub_81D5694: ; 81D5694 push {r4,lr} ldr r4, =0x0203cf58 ldr r0, [r4] cmp r0, 0 beq @081D56A6 bl free movs r0, 0 str r0, [r4] @081D56A6: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5694 thumb_func_start sub_81D56B0 sub_81D56B0: ; 81D56B0 push {r4,lr} ldr r4, =0x0203cf54 ldr r0, [r4] cmp r0, 0 bne @081D56EC ldr r0, =0x00000eec bl malloc_and_clear str r0, [r4] ldr r1, =0x02037318 ldrb r1, [r1, 0x12] adds r1, 0x61 strb r1, [r0] ldr r1, =gUnknown_0862A5F8 ldr r0, =0x03005d8c ldr r0, [r0] ldr r2, =0x00003d6e adds r0, r2 ldrb r0, [r0] lsrs r0, 6 lsls r0, 2 adds r0, r1 ldr r0, [r0] ldr r1, [r4] adds r1, 0x4 ldr r2, =0x040003ba bl CpuSet bl nullsub_2 @081D56EC: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D56B0 thumb_func_start sub_81D5710 sub_81D5710: ; 81D5710 push {r4,lr} ldr r4, =0x0203cf54 ldr r0, [r4] cmp r0, 0 beq @081D5722 bl free movs r0, 0 str r0, [r4] @081D5722: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5710 thumb_func_start sub_81D572C sub_81D572C: ; 81D572C push {r4-r6,lr} adds r4, r1, 0 lsls r0, 24 lsrs r5, r0, 24 adds r6, r5, 0 lsls r4, 16 lsrs r4, 16 bl sub_81D56B0 bl sub_81D5520 lsls r0, 24 lsrs r2, r0, 24 subs r4, 0x1 lsls r4, 24 lsrs r4, 24 cmp r5, 0x3 beq @081D5790 cmp r5, 0x3 bgt @081D575A cmp r5, 0x2 beq @081D5764 b @081D580E @081D575A: cmp r6, 0x4 beq @081D57BC cmp r6, 0x5 beq @081D57E8 b @081D580E @081D5764: ldr r0, =0x0203cf54 lsls r1, r2, 4 subs r1, r2 lsls r1, 3 subs r1, r2 lsls r1, 3 adds r1, 0xC ldr r0, [r0] adds r0, r1 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r4 lsls r1, 3 adds r1, 0x4 adds r0, r1 adds r0, 0x10 bl sub_81638AC b @081D580E .align 2, 0 .pool @081D5790: ldr r0, =0x0203cf54 lsls r1, r2, 4 subs r1, r2 lsls r1, 3 subs r1, r2 lsls r1, 3 adds r1, 0xC ldr r0, [r0] adds r0, r1 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r4 lsls r1, 3 adds r1, 0x4 adds r0, r1 adds r0, 0x1C bl sub_81638AC b @081D580E .align 2, 0 .pool @081D57BC: ldr r0, =0x0203cf54 lsls r1, r2, 4 subs r1, r2 lsls r1, 3 subs r1, r2 lsls r1, 3 adds r1, 0xC ldr r0, [r0] adds r0, r1 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r4 lsls r1, 3 adds r1, 0x4 adds r0, r1 adds r0, 0x28 bl sub_81638AC b @081D580E .align 2, 0 .pool @081D57E8: ldr r0, =0x0203cf54 lsls r1, r2, 4 subs r1, r2 lsls r1, 3 subs r1, r2 lsls r1, 3 adds r1, 0xC ldr r0, [r0] adds r0, r1 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r4 lsls r1, 3 adds r1, 0x4 adds r0, r1 adds r0, 0x34 bl sub_81638AC @081D580E: bl sub_81D5710 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D572C thumb_func_start sub_81D581C sub_81D581C: ; 81D581C push {r4-r6,lr} bl nullsub_2 bl sub_81D3B34 cmp r0, 0 bne @081D5844 ldr r3, =0x03005d8c ldr r1, [r3] ldr r0, =0x00003d6e adds r1, r0 ldrb r0, [r1] movs r2, 0x20 orrs r0, r2 b @081D5854 .align 2, 0 .pool @081D5844: ldr r3, =0x03005d8c ldr r1, [r3] ldr r0, =0x00003d6e adds r1, r0 ldrb r2, [r1] movs r0, 0x21 negs r0, r0 ands r0, r2 @081D5854: strb r0, [r1] adds r6, r3, 0 ldr r0, [r6] ldr r1, =0x00003d6c adds r0, r1 movs r5, 0 strb r5, [r0] ldr r0, [r6] ldr r4, =0x00003d64 adds r0, r4 bl sub_80008DC ldr r1, [r6] adds r4, r1, r4 str r5, [r4] ldr r3, =0x00003d6e adds r1, r3 ldrb r2, [r1] movs r0, 0x5 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, [r6] adds r1, r3 ldrb r2, [r1] movs r0, 0x3 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r1, [r6] adds r1, r3 ldrb r2, [r1] movs r0, 0x11 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0xEE lsls r1, 4 adds r0, r1 strb r5, [r0] ldr r0, =0x0202433a strb r5, [r0] ldr r1, [r6] adds r1, r3 ldrb r2, [r1] movs r0, 0x2 negs r0, r0 ands r0, r2 strb r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D581C thumb_func_start sub_81D58D8 sub_81D58D8: ; 81D58D8 push {lr} bl sub_80008E8 ldr r3, =0x020375f0 movs r0, 0 strh r0, [r3] ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d6e adds r2, r0, r1 ldrb r1, [r2] movs r0, 0x4 ands r0, r1 cmp r0, 0 beq @081D58FA movs r0, 0x1 strh r0, [r3] @081D58FA: ldrb r1, [r2] movs r0, 0x3 ands r0, r1 cmp r0, 0x3 bne @081D590A ldrh r0, [r3] adds r0, 0x1 strh r0, [r3] @081D590A: ldrb r0, [r2] movs r1, 0x4 orrs r0, r1 strb r0, [r2] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D58D8 thumb_func_start sub_81D5924 sub_81D5924: ; 81D5924 push {r4-r7,lr} mov r7, r8 push {r7} bl sub_81D6640 lsls r0, 16 lsrs r5, r0, 16 ldr r0, =0x0203cf54 ldr r0, [r0] ldrb r0, [r0, 0x6] cmp r0, 0x4 bne @081D5952 ldr r0, =0x03005d8c mov r8, r0 ldr r0, [r0] ldr r7, =0x00003d6e adds r0, r7 ldrb r0, [r0] movs r6, 0x1 adds r4, r6, 0 ands r4, r0 cmp r4, 0 beq @081D596C @081D5952: ldr r1, =0x020375f0 movs r0, 0x2 strh r0, [r1] b @081D59C0 .align 2, 0 .pool @081D596C: adds r0, r5, 0 movs r1, 0x1 bl bag_add_item lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081D59BC ldr r1, =0x02021dc4 adds r0, r5, 0 bl itemid_get_name mov r0, r8 ldr r1, [r0] adds r1, r7 ldrb r0, [r1] movs r2, 0x1 orrs r0, r2 strb r0, [r1] ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000ef9 adds r1, r0 ldrb r2, [r1] movs r0, 0x80 negs r0, r0 ands r0, r2 strb r0, [r1] ldr r0, =0x020375f0 strh r4, [r0] b @081D59C0 .align 2, 0 .pool @081D59BC: ldr r0, =0x020375f0 strh r6, [r0] @081D59C0: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5924 thumb_func_start sub_81D59D0 sub_81D59D0: ; 81D59D0 push {r4-r6,lr} ldr r4, =0x03005d8c ldr r2, [r4] ldr r6, =0x00003d6e adds r0, r2, r6 ldrb r1, [r0] movs r3, 0x2 adds r0, r3, 0 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 beq @081D59FC ldr r0, =0x020375f0 strh r3, [r0] b @081D5A4E .align 2, 0 .pool @081D59FC: ldr r1, =0x00003d68 adds r0, r2, r1 bl free_203F458 ldr r2, [r4] ldr r3, =0x00003d64 adds r1, r2, r3 ldr r1, [r1] cmp r0, r1 bls @081D5A48 adds r3, 0x4 adds r0, r2, r3 bl sub_81D5DF4 ldr r2, [r4] adds r0, r2, r6 ldrb r0, [r0] lsrs r0, 6 lsls r0, 2 ldr r3, =0x00003718 adds r1, r2, r3 adds r1, r0 ldr r0, =0x00003d68 adds r2, r0 ldr r0, [r2] str r0, [r1] ldr r0, =0x020375f0 strh r5, [r0] b @081D5A4E .align 2, 0 .pool @081D5A48: ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] @081D5A4E: ldr r0, =0x03005d8c ldr r1, [r0] ldr r3, =0x00003d6e adds r1, r3 ldrb r0, [r1] movs r2, 0x2 orrs r0, r2 strb r0, [r1] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D59D0 thumb_func_start sub_81D5A70 sub_81D5A70: ; 81D5A70 push {lr} ldr r0, =0x03005d8c ldr r2, [r0] ldr r1, =0x00003d6e adds r0, r2, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 bne @081D5AAE ldr r0, =0x00003d64 adds r2, r0 ldr r1, [r2] ldr r0, =0x00034bbe cmp r1, r0 bls @081D5AA8 adds r0, 0x1 str r0, [r2] b @081D5AAE .align 2, 0 .pool @081D5AA8: adds r0, r2, 0 bl sub_80008DC @081D5AAE: pop {r0} bx r0 thumb_func_end sub_81D5A70 thumb_func_start sub_81D5AB4 sub_81D5AB4: ; 81D5AB4 ldr r0, =0x03005d8c ldr r1, [r0] ldr r0, =0x00003d6e adds r1, r0 ldrb r0, [r1] movs r2, 0x8 orrs r0, r2 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81D5AB4 thumb_func_start sub_81D5AD0 sub_81D5AD0: ; 81D5AD0 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d6e adds r2, r0, r1 ldrb r1, [r2] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @081D5B00 movs r0, 0x9 negs r0, r0 ands r0, r1 strb r0, [r2] ldr r1, =0x020375f0 movs r0, 0 b @081D5B20 .align 2, 0 .pool @081D5B00: movs r0, 0x10 ands r0, r1 cmp r0, 0 beq @081D5B1C movs r0, 0x11 negs r0, r0 ands r0, r1 strb r0, [r2] ldr r1, =0x020375f0 movs r0, 0x1 b @081D5B20 .align 2, 0 .pool @081D5B1C: ldr r1, =0x020375f0 movs r0, 0x2 @081D5B20: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5AD0 thumb_func_start sub_81D5B2C sub_81D5B2C: ; 81D5B2C push {r4-r7,lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d64 adds r0, r1 ldr r7, [r0] ldr r0, =0x00034bbe cmp r7, r0 ble @081D5B40 ldr r7, =0x00034bbf @081D5B40: movs r4, 0xE1 lsls r4, 4 adds r0, r7, 0 adds r1, r4, 0 bl __divsi3 adds r6, r0, 0 adds r0, r7, 0 adds r1, r4, 0 bl __modsi3 adds r7, r0, 0 movs r1, 0x3C bl __divsi3 adds r5, r0, 0 adds r0, r7, 0 movs r1, 0x3C bl __modsi3 adds r7, r0, 0 movs r0, 0xA8 muls r0, r7 movs r1, 0x64 bl __divsi3 adds r4, r0, 0 ldr r0, =0x02021cc4 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x2 bl decimal_int_to_string ldr r0, =0x02021dc4 adds r1, r5, 0 movs r2, 0x1 movs r3, 0x2 bl decimal_int_to_string ldr r0, =0x02021ec4 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 .pool thumb_func_end sub_81D5B2C thumb_func_start sub_81D5BBC sub_81D5BBC: ; 81D5BBC push {lr} bl sub_81D56B0 ldr r0, =0x0203cf54 ldr r1, [r0] ldrb r0, [r1, 0x6] cmp r0, 0x4 beq @081D5BEC ldr r0, =0x02021cc4 ldrb r1, [r1, 0x6] movs r2, 0 movs r3, 0x1 bl decimal_int_to_string ldr r1, =0x020375f0 movs r0, 0 b @081D5BF0 .align 2, 0 .pool @081D5BEC: ldr r1, =0x020375f0 movs r0, 0x1 @081D5BF0: strh r0, [r1] bl sub_81D5710 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5BBC thumb_func_start sub_81D5C00 sub_81D5C00: ; 81D5C00 push {lr} bl sub_81D56B0 ldr r1, =0x020375f0 movs r0, 0 strh r0, [r1] bl sub_81D5710 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5C00 thumb_func_start sub_81D5C18 sub_81D5C18: ; 81D5C18 push {lr} ldr r0, =0x000040d6 bl var_get lsls r0, 16 cmp r0, 0 beq @081D5C42 ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d6e adds r0, r1 ldrb r1, [r0] movs r0, 0x4 ands r0, r1 cmp r0, 0 bne @081D5C42 bl sub_81D609C lsls r0, 24 cmp r0, 0 bne @081D5C54 @081D5C42: movs r0, 0 b @081D5C56 .align 2, 0 .pool @081D5C54: movs r0, 0x1 @081D5C56: pop {r1} bx r1 thumb_func_end sub_81D5C18 thumb_func_start sub_81D5C5C sub_81D5C5C: ; 81D5C5C push {lr} bl sub_81D5C18 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @081D5C74 ldr r0, =0x020375f0 strh r1, [r0] b @081D5C7A .align 2, 0 .pool @081D5C74: ldr r1, =0x020375f0 movs r0, 0x1 strh r0, [r1] @081D5C7A: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5C5C thumb_func_start nullsub_129 nullsub_129: ; 81D5C84 bx lr thumb_func_end nullsub_129 thumb_func_start nullsub_2 nullsub_2: ; 81D5C88 bx lr thumb_func_end nullsub_2 thumb_func_start sub_81D5C8C sub_81D5C8C: ; 81D5C8C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC bl sub_81D56B0 movs r0, 0 movs r1, 0 bl Window_FastFillPixels ldr r5, =gUnknown_085EF88A movs r0, 0x1 adds r1, r5, 0 movs r2, 0xD0 bl sub_81DB35C lsls r2, r0, 24 lsrs r2, 24 ldr r6, =gUnknown_0862A5F4 str r6, [sp] movs r4, 0x1 negs r4, r4 str r4, [sp, 0x4] str r5, [sp, 0x8] movs r0, 0 movs r1, 0x1 movs r3, 0x2 bl box_print movs r7, 0x12 movs r0, 0 mov r8, r0 mov r10, r4 ldr r1, =0x02021fc4 mov r9, r1 @081D5CD6: lsls r3, r7, 24 lsrs r3, 24 ldr r0, =gUnknown_0862A5F4 str r0, [sp] mov r1, r10 str r1, [sp, 0x4] ldr r0, =gUnknown_0862A660 mov r1, r8 lsls r4, r1, 2 adds r0, r4, r0 ldr r0, [r0] str r0, [sp, 0x8] movs r0, 0 movs r1, 0x1 movs r2, 0 bl box_print adds r7, 0xF ldr r0, =0x03005d8c ldr r1, =0x00003718 adds r4, r1 ldr r0, [r0] adds r0, r4 bl free_203F458 adds r4, r0, 0 movs r5, 0xE1 lsls r5, 4 adds r1, r5, 0 bl __udivsi3 adds r6, r0, 0 adds r0, r4, 0 adds r1, r5, 0 bl __umodsi3 adds r5, r0, 0 ldr r0, =0x02021cc4 adds r1, r6, 0 movs r2, 0x1 movs r3, 0x2 bl 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, =0x02021dc4 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, =0x02021ec4 movs r2, 0x2 movs r3, 0x2 bl decimal_int_to_string mov r0, r9 ldr r1, =gUnknown_085EF895 bl gf_strcpy ldr r1, =gUnknown_085EF8A3 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, =gUnknown_0862A5F4 str r0, [sp] mov r1, r10 str r1, [sp, 0x4] mov r0, r9 str r0, [sp, 0x8] movs r0, 0 movs r1, 0x1 bl box_print adds r7, 0x11 movs r1, 0x1 add r8, r1 mov r0, r8 cmp r0, 0x3 ble @081D5CD6 movs r0, 0 bl 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 .pool thumb_func_end sub_81D5C8C thumb_func_start free_203F458 free_203F458: ; 81D5DF0 ldr r0, [r0] bx lr thumb_func_end free_203F458 thumb_func_start sub_81D5DF4 sub_81D5DF4: ; 81D5DF4 str r1, [r0] bx lr thumb_func_end sub_81D5DF4 thumb_func_start sub_81D5DF8 sub_81D5DF8: ; 81D5DF8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 ldr r0, =0x03005d8c ldr r0, [r0] movs r1, 0xC7 lsls r1, 4 adds r1, r0, r1 str r1, [sp, 0x4] bl sub_81D5F48 cmp r0, 0 beq @081D5F0E bl sub_81D56B0 movs r7, 0 ldr r4, =0x03005d90 ldr r3, =0x00000cb4 ldr r0, =0x0000ffff adds r2, r0, 0 @081D5E26: ldr r1, [r4] lsls r0, r7, 1 adds r1, r3 adds r1, r0 ldrh r0, [r1] orrs r0, r2 strh r0, [r1] adds r0, r7, 0x1 lsls r0, 24 lsrs r7, r0, 24 cmp r7, 0x1 bls @081D5E26 movs r0, 0 str r0, [sp] ldr r0, =0x03005d8c ldr r1, [r0] movs r2, 0xC7 lsls r2, 4 adds r1, r2 ldr r2, =0x05000180 mov r0, sp bl CpuSet bl sub_81D5520 lsls r0, 24 lsrs r0, 24 mov r9, r0 movs r7, 0 ldr r3, =0x0203cf54 mov r10, r3 @081D5E64: lsls r4, r7, 1 mov r8, r4 adds r5, r4, r7 lsls r5, 3 ldr r0, [sp, 0x4] adds r5, r0 adds r1, r5, 0 ldr r0, =gUnknown_0862A670 ldm r0!, {r2-r4} stm r1!, {r2-r4} ldm r0!, {r2-r4} stm r1!, {r2-r4} adds r6, r7, 0x1 strb r6, [r5] mov r0, r10 ldr r1, [r0] lsls r0, r7, 2 adds r0, r7 lsls r0, 3 adds r0, r7 lsls r0, 3 mov r2, r9 lsls r4, r2, 4 subs r4, r2 lsls r4, 3 subs r4, r2 lsls r4, 3 adds r0, r4 adds r1, r0 ldrb r0, [r1, 0x1B] bl sub_81660B8 strb r0, [r5, 0x1] mov r0, r10 ldr r3, [r0] adds r0, r7, r4 movs r2, 0xF0 lsls r2, 2 adds r1, r3, r2 adds r1, r0 ldrb r2, [r1] movs r0, 0xF ands r0, r2 strh r0, [r5, 0x4] ldrb r0, [r1] lsrs r0, 4 movs r1, 0xF ands r0, r1 adds r0, 0x5 strh r0, [r5, 0x6] lsls r1, r7, 26 lsrs r1, 24 adds r3, r4 ldr r2, =0x000003c2 adds r3, r2 ldrb r0, [r3] asrs r0, r1 movs r3, 0xF ands r0, r3 adds r0, 0x7 strb r0, [r5, 0x9] mov r2, r10 ldr r0, [r2] adds r0, r4 ldr r3, =0x000003c3 adds r0, r3 ldrb r0, [r0] asrs r0, r1 movs r1, 0xF ands r0, r1 strh r0, [r5, 0xE] ldr r0, =gUnknown_082C83F0 str r0, [r5, 0x10] ldr r0, =0x03005d90 ldr r0, [r0] ldr r4, =0x00000cb4 adds r0, r4 add r0, r8 strh r6, [r0] lsls r6, 24 lsrs r7, r6, 24 cmp r7, 0x1 bls @081D5E64 bl sub_81D5710 @081D5F0E: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5DF8 thumb_func_start sub_81D5F48 sub_81D5F48: ; 81D5F48 push {lr} bl sub_81D56B0 bl sub_81D5710 movs r0, 0x1 pop {r1} bx r1 thumb_func_end sub_81D5F48 thumb_func_start sub_81D5F58 sub_81D5F58: ; 81D5F58 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r4, =0x0203cf54 ldr r4, [r4] mov r12, r4 lsls r4, r2, 1 lsls r5, r0, 4 subs r5, r0 lsls r5, 3 subs r5, r0 lsls r5, 3 adds r4, r5 movs r0, 0xE8 lsls r0, 2 add r0, r12 adds r0, r4 ldrh r0, [r0] movs r4, 0xF subs r4, r1 asrs r0, r4 movs r4, 0x1 ands r0, r4 muls r2, r3 adds r2, r1 adds r2, r5 movs r1, 0xA8 lsls r1, 2 add r1, r12 adds r1, r2 ldrb r1, [r1] movs r2, 0x80 lsls r2, 2 adds r3, r2, 0 movs r2, 0xC0 lsls r2, 6 lsls r0, 10 orrs r0, r2 orrs r1, r3 orrs r0, r1 pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D5F58 thumb_func_start sub_81D5FB4 sub_81D5FB4: ; 81D5FB4 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} adds r4, r0, 0 bl 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, =0x02037318 ldr r0, [r0] ldr r2, [r0, 0xC] ldr r1, =0x03005dc0 str r4, [r1, 0x8] movs r0, 0x1F str r0, [r1] movs r0, 0x23 str r0, [r1, 0x4] movs r0, 0xE0 lsls r0, 1 adds r3, r4, r0 movs r6, 0x4 @081D600A: adds r4, r2, 0 adds r4, 0x20 adds r1, r3, 0 movs r5, 0xF @081D6012: ldrh r0, [r2] strh r0, [r1] adds r2, 0x2 adds r1, 0x2 subs r5, 0x1 cmp r5, 0 bge @081D6012 adds r3, 0x3E adds r2, r4, 0 subs r6, 0x1 cmp r6, 0 bge @081D600A movs r6, 0 @081D602C: movs r5, 0 adds r7, r3, 0 adds r7, 0x3E adds r0, r6, 0x1 mov r8, r0 adds r4, r3, 0 @081D6038: mov r0, r9 adds r1, r5, 0 adds r2, r6, 0 movs r3, 0x10 bl sub_81D5F58 strh r0, [r4] adds r4, 0x2 adds r5, 0x1 cmp r5, 0xF ble @081D6038 adds r3, r7, 0 mov r6, r8 cmp r6, 0xF ble @081D602C bl mapheader_run_script_with_tag_x1 bl sub_81D5710 @081D605E: pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D5FB4 thumb_func_start sub_81D6074 sub_81D6074: ; 81D6074 push {lr} ldr r1, =0x02037318 ldr r2, =0xfffffe61 adds r0, r2, 0 ldrh r1, [r1, 0x12] adds r0, r1 lsls r0, 16 lsrs r0, 16 movs r1, 0 cmp r0, 0x3 bhi @081D608C movs r1, 0x1 @081D608C: adds r0, r1, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D6074 thumb_func_start sub_81D609C sub_81D609C: ; 81D609C push {lr} ldr r0, =0x02037318 ldrh r2, [r0, 0x12] ldr r0, =0x0000019f cmp r2, r0 bne @081D60B4 movs r1, 0x1 b @081D60F8 .align 2, 0 .pool @081D60B4: movs r0, 0xD0 lsls r0, 1 cmp r2, r0 bne @081D60C0 movs r1, 0x2 b @081D60F8 @081D60C0: ldr r0, =0x000001a1 cmp r2, r0 bne @081D60D0 movs r1, 0x3 b @081D60F8 .align 2, 0 .pool @081D60D0: movs r0, 0xD1 lsls r0, 1 cmp r2, r0 bne @081D60DC movs r1, 0x4 b @081D60F8 @081D60DC: ldr r0, =0x000001a3 cmp r2, r0 bne @081D60EC movs r1, 0x5 b @081D60F8 .align 2, 0 .pool @081D60EC: movs r0, 0xCF lsls r0, 1 movs r1, 0 cmp r2, r0 bne @081D60F8 movs r1, 0x6 @081D60F8: adds r0, r1, 0 pop {r1} bx r1 thumb_func_end sub_81D609C thumb_func_start sub_81D6100 sub_81D6100: ; 81D6100 push {lr} ldr r0, =0x02037318 ldrh r1, [r0, 0x12] ldr r0, =0x000001a3 movs r2, 0 cmp r1, r0 bne @081D6110 movs r2, 0x1 @081D6110: adds r0, r2, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D6100 thumb_func_start sub_81D6120 sub_81D6120: ; 81D6120 push {lr} movs r0, 0x1A movs r1, 0x40 bl get_mapheader_by_bank_and_number ldr r0, [r0, 0x4] ldr r0, [r0, 0x8] adds r0, 0x8 pop {r1} bx r1 thumb_func_end sub_81D6120 thumb_func_start sub_81D6134 sub_81D6134: ; 81D6134 push {lr} lsls r0, 24 lsrs r0, 24 cmp r0, 0x1 bne @081D614C ldr r0, =0x02037318 ldr r0, [r0, 0x4] ldr r0, [r0, 0x8] adds r0, 0x8 b @081D6176 .align 2, 0 .pool @081D614C: bl sub_81D6490 lsls r0, 24 lsrs r2, r0, 24 movs r1, 0xFF lsls r1, 24 adds r0, r1 lsrs r0, 24 cmp r0, 0x3 bls @081D6162 movs r2, 0x4 @081D6162: ldr r1, =gUnknown_0862A688 subs r0, r2, 0x1 lsls r0, 2 adds r0, r1 ldrh r1, [r0] movs r0, 0x1A bl get_mapheader_by_bank_and_number ldr r0, [r0, 0x4] ldr r0, [r0, 0x8] @081D6176: pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D6134 thumb_func_start battle_init battle_init: ; 81D6180 lsls r0, 24 ldr r1, =0x03005d90 ldr r1, [r1] lsrs r0, 23 adds r1, r0 ldr r0, =0x00000cb2 adds r1, r0 ldrh r0, [r1] bx lr .align 2, 0 .pool 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, =0x02037350 lsls r1, r4, 3 adds r1, r4 lsls r1, 2 adds r1, r2 adds r0, 0xFF ldrb r1, [r1, 0x8] adds r0, r1 lsls r0, 24 ldr r1, =0x03005d90 ldr r1, [r1] movs r2, 0xEE lsls r2, 4 adds r1, r2 ldr r2, =gUnknown_0832A328 lsrs r0, 22 adds r0, r2 ldr r0, [r0] ldrb r1, [r1] ands r0, r1 pop {r4} pop {r1} bx r1 .align 2, 0 .pool 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, =0x02038bca mov r8, r0 ldr r6, =0x03005d90 ldr r1, =gUnknown_0832A328 mov r12, r1 adds r5, r6, 0 @081D6204: ldr r2, [r5] lsls r0, r3, 1 ldr r7, =0x00000cb4 adds r1, r2, r7 adds r1, r0 ldrh r0, [r1] mov r1, r8 ldrh r1, [r1] cmp r0, r1 bne @081D6240 movs r7, 0xEE lsls r7, 4 adds r2, r7 adds r0, r4, r3 lsls r0, 2 add r0, r12 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] b @081D624A .align 2, 0 .pool @081D6240: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x1 bls @081D6204 @081D624A: ldr r0, =0x02022fec ldr r0, [r0] movs r1, 0x80 lsls r1, 8 ands r0, r1 cmp r0, 0 beq @081D62A2 movs r3, 0 ldr r5, =0x02038bcc ldr r0, =gUnknown_0832A328 mov r8, r0 @081D6260: ldr r2, [r6] lsls r0, r3, 1 ldr r7, =0x00000cb4 adds r1, r2, r7 adds r1, r0 ldrh r0, [r1] ldrh r1, [r5] cmp r0, r1 bne @081D6298 movs r7, 0xEE lsls r7, 4 adds r2, r7 adds r0, r4, r3 lsls r0, 2 add r0, r8 ldr r0, [r0] ldrb r1, [r2] orrs r0, r1 strb r0, [r2] b @081D62A2 .align 2, 0 .pool @081D6298: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, 0x1 bls @081D6260 @081D62A2: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D61E8 thumb_func_start sub_81D62AC sub_81D62AC: ; 81D62AC ldr r0, =gUnknown_082C83F0 bx lr .align 2, 0 .pool thumb_func_end sub_81D62AC thumb_func_start sub_81D62B4 sub_81D62B4: ; 81D62B4 push {lr} ldr r0, =0x020375f2 ldrh r1, [r0] movs r0, 0x5 bl sub_81D572C bl sub_80982B8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D62B4 thumb_func_start sub_81D62CC sub_81D62CC: ; 81D62CC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 16 lsrs r0, 16 lsls r1, 24 lsrs r1, 24 mov r9, r1 subs r1, r0, 0x1 lsls r0, r1, 16 lsrs r0, 16 cmp r0, 0x1 bhi @081D636A lsls r0, r1, 24 lsrs r6, r0, 24 bl sub_81D56B0 bl sub_8165CB4 lsls r0, 24 lsrs r0, 24 mov r10, r0 bl sub_81D5520 lsls r0, 24 lsrs r0, 24 mov r8, r0 mov r5, r9 adds r0, r5, 0x3 cmp r5, r0 bge @081D6366 ldr r1, =gUnknown_0862A698 lsls r0, r6, 1 adds r0, r6 adds r7, r0, r1 @081D6316: ldrb r2, [r7] movs r0, 0x64 adds r4, r5, 0 muls r4, r0 ldr r0, =0x02024744 adds r4, r0 mov r1, r8 lsls r0, r1, 4 subs r0, r1 lsls r0, 3 subs r0, r1 lsls r0, 3 adds r0, 0xC ldr r3, =0x0203cf54 ldr r1, [r3] adds r1, r0 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r6 lsls r0, 3 adds r0, 0x4 adds r1, r0 movs r0, 0x2C muls r0, r2 adds r0, 0x40 adds r1, r0 adds r0, r4, 0 bl sub_806819C adds r0, r4, 0 mov r1, r10 bl sub_81D642C adds r5, 0x1 adds r7, 0x1 mov r0, r9 adds r0, 0x3 cmp r5, r0 blt @081D6316 @081D6366: bl sub_81D5710 @081D636A: pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D62CC thumb_func_start sub_81D6384 sub_81D6384: ; 81D6384 push {lr} bl zero_enemy_party_data ldr r0, =0x02038bca ldrh r0, [r0] movs r1, 0 bl sub_81D62CC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D6384 thumb_func_start sub_81D639C sub_81D639C: ; 81D639C push {lr} bl zero_enemy_party_data ldr r0, =0x02038bca ldrh r0, [r0] movs r1, 0 bl sub_81D62CC ldr r0, =0x02038bcc ldrh r0, [r0] movs r1, 0x3 bl sub_81D62CC pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D639C thumb_func_start sub_81D63C4 sub_81D63C4: ; 81D63C4 movs r0, 0x7 bx lr thumb_func_end sub_81D63C4 thumb_func_start sub_81D63C8 sub_81D63C8: ; 81D63C8 push {r4,lr} adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 bl sub_81D56B0 subs r4, 0x1 lsls r4, 24 lsrs r4, 24 ldr r0, =0x0203cf54 ldr r3, [r0] lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r4 ldrb r2, [r3] lsls r0, r2, 4 subs r0, r2 lsls r0, 3 subs r0, r2 adds r0, r1 lsls r0, 3 adds r3, r0 ldrb r4, [r3, 0x1B] bl sub_81D5710 movs r2, 0 ldr r0, =gTrainerClassNameIndices adds r4, r0 ldrb r3, [r4] ldr r1, =gUnknown_0862A3B4 @081D6406: ldrb r0, [r1] cmp r0, r3 bne @081D641C ldrb r0, [r1, 0x1] b @081D6426 .align 2, 0 .pool @081D641C: adds r1, 0x4 adds r2, 0x1 cmp r2, 0x35 bls @081D6406 movs r0, 0 @081D6426: pop {r4} pop {r1} bx r1 thumb_func_end sub_81D63C8 thumb_func_start sub_81D642C sub_81D642C: ; 81D642C push {r4,r5,lr} sub sp, 0x8 adds r4, r0, 0 mov r0, sp strb r1, [r0] adds r0, r4, 0 movs r1, 0xB movs r2, 0 bl pokemon_getattr lsls r0, 16 lsrs r0, 16 ldr r5, =gExperienceTables mov r1, sp ldrb r2, [r1] lsls r2, 2 ldr r3, =gBaseStats lsls r1, r0, 3 subs r1, r0 lsls r1, 2 adds r1, r3 ldrb r1, [r1, 0x13] movs r0, 0xCA lsls r0, 1 muls r0, r1 adds r2, r0 adds r2, r5 ldr r0, [r2] str r0, [sp, 0x4] add r2, sp, 0x4 adds r0, r4, 0 movs r1, 0x19 bl pokemon_setattr adds r0, r4, 0 movs r1, 0x38 mov r2, sp bl pokemon_setattr adds r0, r4, 0 bl pokemon_calc_effective_stats add sp, 0x8 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D642C thumb_func_start sub_81D6490 sub_81D6490: ; 81D6490 push {r4,lr} bl sub_81D56B0 ldr r0, =0x0203cf54 ldr r0, [r0] ldrb r4, [r0, 0x6] bl sub_81D5710 adds r0, r4, 0 pop {r4} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D6490 thumb_func_start sub_81D64AC sub_81D64AC: ; 81D64AC ldr r0, =0x03005d90 ldr r0, [r0] movs r1, 0xEE lsls r1, 4 adds r0, r1 movs r1, 0xFF strb r1, [r0] bx lr .align 2, 0 .pool thumb_func_end sub_81D64AC thumb_func_start sub_81D64C0 sub_81D64C0: ; 81D64C0 push {lr} bl sub_81D6534 cmp r0, 0x1 bne @081D64D4 ldr r0, =gUnknown_0862A5D4 movs r1, 0x70 movs r2, 0x20 bl gpu_pal_apply @081D64D4: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D64C0 thumb_func_start sub_81D64DC sub_81D64DC: ; 81D64DC ldr r1, =0x020375f0 ldr r0, =0x03005d90 ldr r0, [r0] ldr r2, =0x00000ef9 adds r0, r2 ldrb r0, [r0] lsrs r0, 7 strh r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81D64DC thumb_func_start sub_81D64FC sub_81D64FC: ; 81D64FC ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000ef9 adds r1, r0 ldrb r0, [r1] movs r2, 0x80 orrs r0, r2 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81D64FC thumb_func_start sub_81D6518 sub_81D6518: ; 81D6518 ldr r0, =0x03005d90 ldr r1, [r0] ldr r0, =0x00000ef9 adds r1, r0 ldrb r2, [r1] movs r0, 0x7F ands r0, r2 strb r0, [r1] bx lr .align 2, 0 .pool thumb_func_end sub_81D6518 thumb_func_start sub_81D6534 sub_81D6534: ; 81D6534 push {lr} bl sub_81D5C18 lsls r0, 24 cmp r0, 0 beq @081D6560 bl sub_81D609C lsls r0, 24 lsrs r0, 24 cmp r0, 0x6 beq @081D6560 bl sub_81D5C00 ldr r0, =0x020375f0 ldrh r0, [r0] cmp r0, 0 beq @081D6560 movs r0, 0x1 b @081D6562 .align 2, 0 .pool @081D6560: movs r0, 0 @081D6562: pop {r1} bx r1 thumb_func_end sub_81D6534 thumb_func_start sub_81D6568 sub_81D6568: ; 81D6568 push {lr} ldr r0, =0x03005d8c ldr r0, [r0] ldr r1, =0x00003d6e adds r0, r1 ldrb r1, [r0] movs r0, 0x8 ands r0, r1 cmp r0, 0 beq @081D6590 ldr r1, =0x020375f0 movs r0, 0 b @081D6594 .align 2, 0 .pool @081D6590: ldr r1, =0x020375f0 movs r0, 0x1 @081D6594: strh r0, [r1] pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D6568 thumb_func_start sub_81D65A0 sub_81D65A0: ; 81D65A0 push {r4,r5,lr} ldr r4, =0x03005d8c ldr r2, [r4] ldr r5, =0x020375e2 ldr r0, =0x00003d6e adds r2, r0 ldrb r1, [r5] lsls r1, 6 ldrb r3, [r2] movs r0, 0x3F ands r0, r3 orrs r0, r1 strb r0, [r2] ldr r1, [r4] ldr r3, =0x00003d68 adds r2, r1, r3 ldrh r0, [r5] lsls r0, 2 ldr r3, =0x00003718 adds r1, r3 adds r1, r0 ldr r0, [r1] str r0, [r2] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D65A0 thumb_func_start sub_81D65E8 sub_81D65E8: ; 81D65E8 push {r4-r7,lr} lsls r0, 24 lsrs r7, r0, 24 movs r3, 0 movs r4, 0 ldr r0, =0x0203cf54 ldr r6, [r0] movs r5, 0x1F @081D65F8: lsls r1, r4, 4 subs r1, r4 lsls r1, 3 subs r1, r4 lsls r1, 3 adds r1, r6, r1 ldrb r2, [r1, 0xC] adds r0, r5, 0 ands r0, r2 eors r3, r0 ldrb r1, [r1, 0xD] adds r0, r5, 0 ands r0, r1 eors r3, r0 lsls r0, r3, 24 lsrs r3, r0, 24 adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0x3 bls @081D65F8 movs r1, 0x5 cmp r7, 0 beq @081D662A movs r1, 0xA @081D662A: adds r0, r3, 0 bl __umodsi3 lsls r0, 24 lsrs r3, r0, 24 adds r0, r3, 0 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D65E8 thumb_func_start sub_81D6640 sub_81D6640: ; 81D6640 push {r4,r5,lr} movs r3, 0 movs r2, 0 ldr r0, =0x0203cf54 ldr r4, [r0] @081D664A: lsls r0, r2, 4 subs r0, r2 lsls r0, 3 subs r0, r2 lsls r0, 3 adds r0, r4, r0 ldrb r1, [r0, 0xC] adds r1, r3, r1 ldrb r0, [r0, 0xD] adds r3, r1, r0 adds r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 cmp r2, 0x3 bls @081D664A adds r0, r3, 0 cmp r0, 0 bge @081D6670 adds r0, 0xFF @081D6670: asrs r4, r0, 8 lsrs r0, 31 adds r0, r4, r0 asrs r0, 1 lsls r0, 1 subs r4, r0 ldr r0, =0x00000864 bl flag_check lsls r0, 24 cmp r0, 0 beq @081D66A0 ldr r0, =0x0203cf54 ldr r0, [r0] ldrb r0, [r0, 0x4] cmp r0, 0x8 bne @081D66A0 movs r0, 0x1 b @081D66A2 .align 2, 0 .pool @081D66A0: movs r0, 0 @081D66A2: bl sub_81D65E8 lsls r0, 24 lsrs r2, r0, 24 ldr r0, =0x03005d8c ldr r5, [r0] ldr r1, =0x00003d6e adds r0, r5, r1 ldrb r1, [r0] movs r0, 0xC0 ands r0, r1 cmp r0, 0xC0 bne @081D66C8 adds r0, r2, 0x1 movs r1, 0xA bl __modsi3 lsls r0, 24 lsrs r2, r0, 24 @081D66C8: ldr r1, =gUnknown_0862A5CC lsls r0, r4, 2 adds r0, r1 ldr r1, [r0] lsls r0, r2, 2 adds r0, r1 ldr r4, [r0] ldr r1, =0x00003d64 adds r0, r5, r1 ldr r0, [r0] movs r1, 0xE1 lsls r1, 4 bl __divsi3 movs r1, 0 cmp r0, 0xB ble @081D6704 movs r1, 0x1 cmp r0, 0xC ble @081D6704 movs r1, 0x2 cmp r0, 0xD ble @081D6704 movs r1, 0x3 cmp r0, 0xF ble @081D6704 movs r1, 0x5 cmp r0, 0x11 bgt @081D6704 movs r1, 0x4 @081D6704: lsls r0, r1, 1 adds r0, r4 ldrh r0, [r0] pop {r4,r5} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D6640 thumb_func_start sub_81D6720 sub_81D6720: ; 81D6720 push {r4-r6,lr} mov r6, r8 push {r6} adds r4, r0, 0 adds r5, r1, 0 mov r8, r2 lsls r4, 24 lsrs r4, 24 lsls r5, 24 lsrs r5, 24 ldr r6, =0x0203cf60 ldr r0, =0x00002018 bl malloc_and_clear str r0, [r6] ldr r1, =0x00002006 adds r0, r1 strb r4, [r0] ldr r0, [r6] mov r1, r8 str r1, [r0] ldr r1, =0x00002007 adds r0, r1 strb r5, [r0] ldr r0, =sub_81D6774 bl set_callback2 pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0862A6A0 ldr r0, =0x0203cf60 ldr r0, [r0] ldr r2, =0x00002006 adds r0, r2 ldrb r0, [r0] lsls r0, 2 adds r0, r1 ldr r0, [r0] movs r1, 0 bl AddTask ldr r0, =sub_81D67D0 bl set_callback2 pop {r0} bx r0 .align 2, 0 .pool 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, =0x02037fd4 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, =0x0203cf60 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 .pool thumb_func_end sub_81D6800 thumb_func_start sub_81D6840 sub_81D6840: ; 81D6840 push {r4-r6,lr} lsls r0, 24 lsrs r3, r0, 24 adds r6, r3, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @081D68B2 ldr r2, =0x0203cf60 ldr r1, [r2] ldr r4, =0x00002007 adds r0, r1, r4 ldrb r0, [r0] cmp r0, 0x1 bne @081D6888 ldr r0, =0x03005e00 lsls r1, r3, 2 adds r1, r3 lsls r1, 3 adds r1, r0 ldr r0, =sub_81D6800 b @081D68B0 .align 2, 0 .pool @081D6888: ldr r4, =0x00002006 adds r1, r4 ldrb r0, [r1] adds r0, 0x1 strb r0, [r1] ldr r2, [r2] ldr r1, =0x00002004 adds r0, r2, r1 strh r5, [r0] ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r3, =gUnknown_0862A6A0 adds r2, r4 ldrb r0, [r2] lsls r0, 2 adds r0, r3 ldr r0, [r0] @081D68B0: str r0, [r1] @081D68B2: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =0x00001888 movs r0, 0x44 bl lcd_io_set ldr r0, =0x02037714 movs r1, 0 strh r1, [r0] ldr r0, =0x02037b14 strh r1, [r0] pop {r0} bx r0 .align 2, 0 .pool 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, =0x03005e08 adds r5, r0, r1 bl sub_81D750C ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081D697E movs r0, 0 ldrsh r1, [r5, r0] cmp r1, 0x40 bne @081D6954 bl sub_81D7438 b @081D6978 .align 2, 0 .pool @081D6954: cmp r1, 0x90 bne @081D695E bl sub_81D7480 b @081D6978 @081D695E: cmp r1, 0x94 beq @081D6974 movs r0, 0xA4 lsls r0, 1 cmp r1, r0 bne @081D6978 adds r0, r4, 0 movs r1, 0 bl sub_81D75B4 b @081D697E @081D6974: bl sub_81D74C8 @081D6978: ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] @081D697E: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81D691C thumb_func_start sub_81D6984 sub_81D6984: ; 81D6984 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =gUnknown_0862A72C mov r8, r0 movs r1, 0x58 movs r2, 0x48 movs r3, 0x3 bl obj_add_from_template_forward_search adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r6, =0x02020630 lsls r4, r5, 4 adds r4, r5 lsls r4, 2 adds r0, r6, 0 adds r0, 0x1C adds r0, r4, r0 ldr r1, =sub_81D6A20 str r1, [r0] adds r0, r6, 0 adds r0, 0x2E adds r4, r0 mov r0, r8 movs r1, 0x38 movs r2, 0x68 movs r3, 0x3 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r0, =gUnknown_0862A750 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, =gUnknown_0862A774 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 .pool thumb_func_end sub_81D6984 thumb_func_start sub_81D6A20 sub_81D6A20: ; 81D6A20 push {r4,lr} adds r3, r0, 0 movs r0, 0x2E adds r0, r3 mov r12, r0 ldrh r0, [r0, 0xA] adds r0, 0x1 movs r1, 0x1F ands r0, r1 mov r1, r12 strh r0, [r1, 0xA] cmp r0, 0 bne @081D6A84 ldrh r1, [r3, 0x20] movs r2, 0x20 ldrsh r0, [r3, r2] cmp r0, 0x48 beq @081D6A84 subs r0, r1, 0x1 strh r0, [r3, 0x20] ldr r2, =0x02020630 movs r4, 0x2E ldrsh r1, [r3, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x20] subs r1, 0x1 strh r1, [r0, 0x20] mov r0, r12 movs r4, 0x2 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x20] subs r1, 0x1 strh r1, [r0, 0x20] mov r0, r12 movs r4, 0x4 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x20] subs r1, 0x1 strh r1, [r0, 0x20] @081D6A84: adds r0, r3, 0 adds r0, 0x2B ldrb r3, [r0] cmp r3, 0x1 beq @081D6AE4 cmp r3, 0x1 bgt @081D6A9C cmp r3, 0 beq @081D6AA6 b @081D6B68 .align 2, 0 .pool @081D6A9C: cmp r3, 0x2 beq @081D6B24 cmp r3, 0x3 beq @081D6AE4 b @081D6B68 @081D6AA6: ldr r2, =0x02020630 mov r0, r12 movs r4, 0x2 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x24] mov r0, r12 movs r4, 0x2 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x26] mov r0, r12 movs r4, 0x4 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x24] mov r0, r12 movs r4, 0x4 ldrsh r1, [r0, r4] b @081D6B5E .align 2, 0 .pool @081D6AE4: ldr r2, =0x02020630 mov r0, r12 movs r3, 0x2 ldrsh r1, [r0, r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000ffff strh r1, [r0, 0x24] mov r4, r12 movs r0, 0x2 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r3, 0 strh r3, [r0, 0x26] movs r0, 0x4 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 negs r1, r1 b @081D6B58 .align 2, 0 .pool @081D6B24: ldr r2, =0x02020630 mov r3, r12 movs r4, 0x2 ldrsh r1, [r3, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000ffff strh r1, [r0, 0x24] movs r0, 0x2 ldrsh r1, [r3, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r3, 0x1 strh r3, [r0, 0x26] mov r4, r12 movs r0, 0x4 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000fffe @081D6B58: strh r1, [r0, 0x24] movs r0, 0x4 ldrsh r1, [r4, r0] @081D6B5E: lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x26] @081D6B68: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D6A20 thumb_func_start sub_81D6B7C sub_81D6B7C: ; 81D6B7C push {r4-r6,lr} mov r6, r8 push {r6} ldr r5, =gUnknown_0862A81C adds r0, r5, 0 movs r1, 0x88 movs r2, 0x60 movs r3, 0x1 bl obj_add_from_template_forward_search mov r8, r0 mov r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r6, =0x02020630 lsls r4, r0, 4 add r4, r8 lsls r4, 2 adds r0, r6, 0 adds r0, 0x1C adds r0, r4, r0 ldr r1, =sub_81D6D20 str r1, [r0] adds r0, r6, 0 adds r0, 0x2E adds r4, r0 adds r0, r5, 0 movs r1, 0xA8 movs r2, 0x60 movs r3, 0x1 bl 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, =gUnknown_0862A84C 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, =gUnknown_0862A864 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 .pool thumb_func_end sub_81D6B7C thumb_func_start sub_81D6D20 sub_81D6D20: ; 81D6D20 push {r4-r7,lr} adds r4, r0, 0 adds r3, r4, 0 adds r3, 0x2E ldrh r0, [r3, 0xA] adds r0, 0x1 movs r1, 0x1F ands r0, r1 strh r0, [r3, 0xA] ldr r7, =0x02020630 cmp r0, 0 bne @081D6E0E ldrh r1, [r4, 0x20] movs r2, 0x20 ldrsh r0, [r4, r2] cmp r0, 0x98 beq @081D6E0E adds r0, r1, 0x1 strh r0, [r4, 0x20] ldrh r1, [r4, 0x2E] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r4, 0x2E] movs r2, 0xFF adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r1, [r3, 0x2] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r3, 0x2] adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r1, [r3, 0x4] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r3, 0x4] adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r1, [r3, 0x6] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r3, 0x6] adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r1, [r3, 0x8] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r3, 0x8] ands r2, r0 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] @081D6E0E: adds r6, r7, 0 movs r5, 0xFF ldrb r1, [r3, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 adds r0, 0x2B ldrb r2, [r0] cmp r2, 0x1 beq @081D6EE0 cmp r2, 0x1 bgt @081D6E34 cmp r2, 0 beq @081D6E40 b @081D6FC8 .align 2, 0 .pool @081D6E34: cmp r2, 0x2 bne @081D6E3A b @081D6F68 @081D6E3A: cmp r2, 0x3 beq @081D6EE0 b @081D6FC8 @081D6E40: strh r2, [r4, 0x26] ldrh r1, [r3] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r0, [r3] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x2] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r0, [r3, 0x2] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x4] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r0, [r3, 0x4] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x6] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r0, [r3, 0x6] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x8] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x8] ands r1, r5 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 b @081D6FC6 @081D6EE0: movs r2, 0x1 strh r2, [r4, 0x26] ldrh r1, [r3] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x2] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3, 0x2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x4] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x6] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3, 0x6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x8] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3, 0x8] b @081D6FBE @081D6F68: strh r2, [r4, 0x26] ldrh r1, [r3] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r0, [r3] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x2] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r0, [r3, 0x2] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x4] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x8] ands r1, r5 @081D6FBE: lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 @081D6FC6: strh r2, [r0, 0x26] @081D6FC8: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D6D20 thumb_func_start sub_81D6FD0 sub_81D6FD0: ; 81D6FD0 push {lr} bl sub_81D67EC bl sub_80BA0A8 pop {r0} bx r0 thumb_func_end sub_81D6FD0 thumb_func_start sub_81D6FE0 sub_81D6FE0: ; 81D6FE0 push {r4,lr} bl sub_8121DA0 movs r0, 0 bl gpu_reset_bgs_and_dma3_busy_flags ldr r1, =gUnknown_0862A888 movs r0, 0 movs r2, 0x3 bl bg_vram_setup ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001004 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 .pool thumb_func_end sub_81D6FE0 thumb_func_start sub_81D706C sub_81D706C: ; 81D706C push {r4,lr} sub sp, 0x4 bl reset_temp_tile_data_buffers ldr r1, =gUnknown_08DA33C0 movs r0, 0 str r0, [sp] movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram @081D7082: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081D7082 ldr r0, =gUnknown_08DA3988 ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA3824 ldr r1, [r4] ldr r2, =0x00000804 adds r1, r2 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA3A88 ldr r1, [r4] ldr r2, =0x00001004 adds r1, r2 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA37E8 movs r1, 0 movs r2, 0x40 bl decompress_palette ldr r0, =gUnknown_0862A8C4 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862A8F8 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862A924 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862A9D4 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AA14 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AA34 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862A8CC bl gpu_pal_obj_decompress_and_apply ldr r0, =gUnknown_0862A9DC bl gpu_pal_obj_decompress_and_apply add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D706C thumb_func_start task_add_00_WIN0V_open_close_above_and_more task_add_00_WIN0V_open_close_above_and_more: ; 81D7134 push {r4-r7,lr} sub sp, 0x8 lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r6, r1, 3 ldr r7, =0x03005e08 adds r5, r6, r7 bl dp12_8087EA4 bl sub_81D6FE0 bl sub_81D706C movs r4, 0 str r4, [sp, 0x4] ldr r1, =0x02038c28 ldr r2, =0x010003c0 add r0, sp, 0x4 bl CpuFastSet ldr r2, =gUnknown_0862A87C ldr r0, [r2] ldr r1, [r2, 0x4] ldr r2, [r2, 0x8] bl sub_80BA038 strh r4, [r5] ldr r0, =sub_81D7228 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x2] ldr r0, =0x0203cf60 ldr r0, [r0] ldr r1, =0x00002006 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @081D71CC bl sub_81D6984 lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x4] bl sub_81D6B7C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x6] adds r0, r7, 0 subs r0, 0x8 adds r0, r6, r0 ldr r1, =sub_81D691C str r1, [r0] b @081D71EE .align 2, 0 .pool @081D71CC: bl sub_81D7664 lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x4] bl sub_81D78BC lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x6] adds r0, r7, 0 subs r0, 0x8 adds r0, r6, r0 ldr r1, =sub_81D736C str r1, [r0] bl sub_80A2F30 @081D71EE: movs r4, 0x1 negs r4, r4 adds r0, r4, 0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 movs r0, 0 str r0, [sp] adds r0, r4, 0 movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 ldr r0, =sub_81D6FD0 bl SetVBlankCallback movs r0, 0x53 bl audio_play add sp, 0x8 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end task_add_00_WIN0V_open_close_above_and_more thumb_func_start sub_81D7228 sub_81D7228: ; 81D7228 push {r4-r7,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r3, r1, r0 movs r1, 0x18 ldr r7, =0x0203cf60 ldr r4, =0x02038c28 movs r0, 0xF0 lsls r0, 3 adds r5, r4, r0 @081D7244: lsls r0, r1, 16 asrs r1, r0, 16 adds r6, r0, 0 cmp r1, 0x2F bgt @081D726C lsls r1, 1 adds r2, r1, r4 ldrh r0, [r3] lsrs r0, 8 strh r0, [r2] adds r1, r5 ldrh r0, [r3] b @081D72CA .align 2, 0 .pool @081D726C: cmp r1, 0x3F bgt @081D7280 lsls r1, 1 adds r2, r1, r4 ldrh r0, [r3, 0x2] lsrs r0, 8 strh r0, [r2] adds r1, r5 ldrh r0, [r3, 0x2] b @081D72CA @081D7280: cmp r1, 0x4B bgt @081D7294 lsls r1, 1 adds r2, r1, r4 ldrh r0, [r3, 0x4] lsrs r0, 8 strh r0, [r2] adds r1, r5 ldrh r0, [r3, 0x4] b @081D72CA @081D7294: cmp r1, 0x53 bgt @081D72A8 lsls r1, 1 adds r2, r1, r4 ldrh r0, [r3, 0x6] lsrs r0, 8 strh r0, [r2] adds r1, r5 ldrh r0, [r3, 0x6] b @081D72CA @081D72A8: cmp r1, 0x57 bgt @081D72BC lsls r1, 1 adds r2, r1, r4 ldrh r0, [r3, 0x8] lsrs r0, 8 strh r0, [r2] adds r1, r5 ldrh r0, [r3, 0x8] b @081D72CA @081D72BC: lsls r1, 1 adds r2, r1, r4 ldrh r0, [r3, 0xA] lsrs r0, 8 strh r0, [r2] adds r1, r5 ldrh r0, [r3, 0xA] @081D72CA: lsrs r0, 8 strh r0, [r1] movs r1, 0x80 lsls r1, 9 adds r0, r6, r1 lsrs r1, r0, 16 asrs r0, 16 cmp r0, 0x5B ble @081D7244 ldr r0, [r7] ldr r1, =0x00002006 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @081D7324 movs r1, 0xE0 lsls r1, 1 adds r0, r1, 0 ldrh r1, [r3] adds r0, r1 strh r0, [r3] movs r1, 0xC0 lsls r1, 1 adds r0, r1, 0 ldrh r1, [r3, 0x2] adds r0, r1 strh r0, [r3, 0x2] movs r1, 0xA0 lsls r1, 1 adds r0, r1, 0 ldrh r1, [r3, 0x4] adds r0, r1 strh r0, [r3, 0x4] movs r1, 0x80 lsls r1, 1 adds r0, r1, 0 ldrh r1, [r3, 0x6] adds r0, r1 strh r0, [r3, 0x6] ldrh r0, [r3, 0x8] adds r0, 0xC0 b @081D735E .align 2, 0 .pool @081D7324: movs r1, 0xC0 lsls r1, 2 adds r0, r1, 0 ldrh r1, [r3] adds r0, r1 strh r0, [r3] movs r1, 0xA0 lsls r1, 2 adds r0, r1, 0 ldrh r1, [r3, 0x2] adds r0, r1 strh r0, [r3, 0x2] movs r1, 0x80 lsls r1, 2 adds r0, r1, 0 ldrh r1, [r3, 0x4] adds r0, r1 strh r0, [r3, 0x4] movs r1, 0xC0 lsls r1, 1 adds r0, r1, 0 ldrh r1, [r3, 0x6] adds r0, r1 strh r0, [r3, 0x6] movs r1, 0x80 lsls r1, 1 adds r0, r1, 0 ldrh r1, [r3, 0x8] adds r0, r1 @081D735E: strh r0, [r3, 0x8] ldrh r0, [r3, 0xA] adds r0, 0x80 strh r0, [r3, 0xA] pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D7228 thumb_func_start sub_81D736C sub_81D736C: ; 81D736C push {r4-r7,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r7, =0x03005e08 adds r4, r0, r7 bl sub_81D750C ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 bne @081D742E movs r0, 0 ldrsh r1, [r4, r0] cmp r1, 0x20 beq @081D739C cmp r1, 0x70 bne @081D73AC @081D739C: bl sub_81D7438 b @081D7428 .align 2, 0 .pool @081D73AC: cmp r1, 0xD8 bne @081D73B6 bl sub_81D7480 b @081D7428 @081D73B6: cmp r1, 0xDC bne @081D73C0 bl sub_81D74C8 b @081D7428 @081D73C0: movs r0, 0xBE lsls r0, 1 cmp r1, r0 beq @081D73D8 adds r0, 0x20 cmp r1, r0 bne @081D7428 adds r0, r5, 0 movs r1, 0x2 bl sub_81D75B4 b @081D742E @081D73D8: movs r1, 0x91 lsls r1, 2 movs r0, 0x50 bl 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, =sub_81D752C str r1, [r0] movs r0, 0x2 ldrsh r1, [r4, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 strh r6, [r0, 0x8] movs r0, 0x2 ldrsh r1, [r4, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrh r1, [r4, 0x4] strh r1, [r0, 0xC] movs r0, 0x2 ldrsh r1, [r4, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldrh r1, [r4, 0x6] strh r1, [r0, 0xE] bl remove_some_task @081D7428: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] @081D742E: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D736C thumb_func_start sub_81D7438 sub_81D7438: ; 81D7438 push {r4,lr} sub sp, 0xC movs r0, 0x57 bl audio_play ldr r0, =0x00007fff ldr r1, =0x0000ffff str r1, [sp] movs r4, 0 str r4, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A2C44 ldr r0, =0xffff0000 str r4, [sp] str r4, [sp, 0x4] movs r1, 0x1 str r1, [sp, 0x8] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A2C44 add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D7438 thumb_func_start sub_81D7480 sub_81D7480: ; 81D7480 push {r4,lr} sub sp, 0xC movs r0, 0x57 bl audio_play ldr r0, =0x00007fff ldr r1, =0x0000ffff str r1, [sp] movs r4, 0 str r4, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0 movs r2, 0x10 movs r3, 0x10 bl sub_80A2C44 ldr r0, =0xffff0000 str r4, [sp] str r4, [sp, 0x4] movs r1, 0x1 str r1, [sp, 0x8] movs r1, 0 movs r2, 0x10 movs r3, 0x10 bl sub_80A2C44 add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D7480 thumb_func_start sub_81D74C8 sub_81D74C8: ; 81D74C8 push {r4,lr} sub sp, 0xC ldr r0, =0x00007fff ldr r1, =0x0000ffff str r1, [sp] movs r4, 0 str r4, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x4 movs r2, 0x10 movs r3, 0 bl sub_80A2C44 ldr r0, =0xffff0000 str r4, [sp] str r4, [sp, 0x4] movs r1, 0x1 str r1, [sp, 0x8] movs r1, 0x4 movs r2, 0x10 movs r3, 0 bl sub_80A2C44 add sp, 0xC pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D74C8 thumb_func_start sub_81D750C sub_81D750C: ; 81D750C push {lr} movs r1, 0x80 lsls r1, 3 movs r0, 0x2 movs r2, 0x1 bl 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, =0x03005e08 adds r5, r1, r0 movs r0, 0x4 ldrsh r1, [r5, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r4, =0x02020630 adds r0, r4 bl sub_81D7860 movs r0, 0x6 ldrsh r1, [r5, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r4 bl sub_81D7D14 movs r0, 0x1 bl 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 .pool thumb_func_end sub_81D752C thumb_func_start sub_81D75B4 sub_81D75B4: ; 81D75B4 push {r4,r5,lr} sub sp, 0x4 adds r5, r0, 0 adds r4, r1, 0 lsls r5, 24 lsrs r5, 24 lsls r4, 24 lsrs r4, 24 movs r0, 0x54 bl audio_play movs r0, 0x1 negs r0, r0 lsls r4, 24 asrs r4, 24 movs r1, 0 str r1, [sp] adds r1, r4, 0 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 adds r0, r1 ldr r1, =sub_81D7600 str r1, [r0] add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D75B4 thumb_func_start sub_81D7600 sub_81D7600: ; 81D7600 push {r4-r7,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r6, r1, 3 ldr r7, =0x03005e08 adds r5, r6, r7 bl sub_81D750C ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r4, r0, 24 cmp r4, 0 bne @081D7652 ldrb r0, [r5, 0x2] bl remove_task movs r0, 0x1 movs r1, 0 movs r2, 0 bl 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, =sub_81D6840 str r1, [r0] @081D7652: pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D7600 thumb_func_start sub_81D7664 sub_81D7664: ; 81D7664 push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =gUnknown_0862A8D4 mov r8, r0 movs r1, 0x62 movs r2, 0x48 movs r3, 0x3 bl obj_add_from_template_forward_search adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 ldr r6, =0x02020630 lsls r4, r5, 4 adds r4, r5 lsls r4, 2 adds r0, r6, 0 adds r0, 0x1C adds r0, r4, r0 ldr r1, =sub_81D7700 str r1, [r0] adds r0, r6, 0 adds r0, 0x2E adds r4, r0 mov r0, r8 movs r1, 0x42 movs r2, 0x68 movs r3, 0x3 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 strh r0, [r4] ldr r0, =gUnknown_0862A900 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, =gUnknown_0862A92C 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 .pool thumb_func_end sub_81D7664 thumb_func_start sub_81D7700 sub_81D7700: ; 81D7700 push {r4,lr} adds r3, r0, 0 movs r0, 0x2E adds r0, r3 mov r12, r0 ldrh r0, [r0, 0xA] adds r0, 0x1 movs r1, 0xF ands r0, r1 mov r1, r12 strh r0, [r1, 0xA] movs r1, 0x7 ands r1, r0 cmp r1, 0 bne @081D7768 ldrh r1, [r3, 0x20] movs r2, 0x20 ldrsh r0, [r3, r2] cmp r0, 0x48 beq @081D7768 subs r0, r1, 0x1 strh r0, [r3, 0x20] ldr r2, =0x02020630 movs r4, 0x2E ldrsh r1, [r3, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x20] subs r1, 0x1 strh r1, [r0, 0x20] mov r0, r12 movs r4, 0x2 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x20] subs r1, 0x1 strh r1, [r0, 0x20] mov r0, r12 movs r4, 0x4 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x20] subs r1, 0x1 strh r1, [r0, 0x20] @081D7768: adds r0, r3, 0 adds r0, 0x2B ldrb r3, [r0] cmp r3, 0x1 beq @081D77C8 cmp r3, 0x1 bgt @081D7780 cmp r3, 0 beq @081D778A b @081D784C .align 2, 0 .pool @081D7780: cmp r3, 0x2 beq @081D7808 cmp r3, 0x3 beq @081D77C8 b @081D784C @081D778A: ldr r2, =0x02020630 mov r0, r12 movs r4, 0x2 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x24] mov r0, r12 movs r4, 0x2 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x26] mov r0, r12 movs r4, 0x4 ldrsh r1, [r0, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x24] mov r0, r12 movs r4, 0x4 ldrsh r1, [r0, r4] b @081D7842 .align 2, 0 .pool @081D77C8: ldr r2, =0x02020630 mov r0, r12 movs r3, 0x2 ldrsh r1, [r0, r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000ffff strh r1, [r0, 0x24] mov r4, r12 movs r0, 0x2 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r3, 0 strh r3, [r0, 0x26] movs r0, 0x4 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x1 negs r1, r1 b @081D783C .align 2, 0 .pool @081D7808: ldr r2, =0x02020630 mov r3, r12 movs r4, 0x2 ldrsh r1, [r3, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000ffff strh r1, [r0, 0x24] movs r0, 0x2 ldrsh r1, [r3, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r3, 0x1 strh r3, [r0, 0x26] mov r4, r12 movs r0, 0x4 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000fffe @081D783C: strh r1, [r0, 0x24] movs r0, 0x4 ldrsh r1, [r4, r0] @081D7842: lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x26] @081D784C: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D7700 thumb_func_start sub_81D7860 sub_81D7860: ; 81D7860 push {r4,lr} adds r1, r0, 0 adds r3, r1, 0 adds r3, 0x2E ldrh r2, [r1, 0x22] movs r4, 0x22 ldrsh r0, [r1, r4] cmp r0, 0xA0 bgt @081D78B0 adds r0, r2, 0 adds r0, 0x8 strh r0, [r1, 0x22] ldr r2, =0x02020630 movs r0, 0x2E ldrsh r1, [r1, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] movs r4, 0x2 ldrsh r1, [r3, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] movs r0, 0x4 ldrsh r1, [r3, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] @081D78B0: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D7860 thumb_func_start sub_81D78BC sub_81D78BC: ; 81D78BC push {r4-r6,lr} mov r6, r8 push {r6} ldr r5, =gUnknown_0862A9E4 adds r0, r5, 0 movs r1, 0x7E movs r2, 0x60 movs r3, 0x1 bl obj_add_from_template_forward_search mov r8, r0 mov r0, r8 lsls r0, 24 lsrs r0, 24 mov r8, r0 ldr r6, =0x02020630 lsls r4, r0, 4 add r4, r8 lsls r4, 2 adds r0, r6, 0 adds r0, 0x1C adds r0, r4, r0 ldr r1, =sub_81D7A60 str r1, [r0] adds r0, r6, 0 adds r0, 0x2E adds r4, r0 adds r0, r5, 0 movs r1, 0x9E movs r2, 0x60 movs r3, 0x1 bl 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, =gUnknown_0862AA1C 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, =gUnknown_0862AA3C 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 .pool thumb_func_end sub_81D78BC thumb_func_start sub_81D7A60 sub_81D7A60: ; 81D7A60 push {r4-r7,lr} adds r4, r0, 0 adds r3, r4, 0 adds r3, 0x2E ldrh r0, [r3, 0xA] adds r0, 0x1 movs r1, 0xF ands r0, r1 strh r0, [r3, 0xA] movs r1, 0x7 ands r1, r0 ldr r7, =0x02020630 cmp r1, 0 bne @081D7B52 ldrh r1, [r4, 0x20] movs r2, 0x20 ldrsh r0, [r4, r2] cmp r0, 0x98 beq @081D7B52 adds r0, r1, 0x1 strh r0, [r4, 0x20] ldrh r1, [r4, 0x2E] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r4, 0x2E] movs r2, 0xFF adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r1, [r3, 0x2] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r3, 0x2] adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r1, [r3, 0x4] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r3, 0x4] adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r1, [r3, 0x6] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r3, 0x6] adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r1, [r3, 0x8] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] ldrh r0, [r3, 0x8] ands r2, r0 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r7 ldrh r1, [r0, 0x20] adds r1, 0x1 strh r1, [r0, 0x20] @081D7B52: adds r6, r7, 0 movs r5, 0xFF ldrb r1, [r3, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 adds r0, 0x2B ldrb r2, [r0] cmp r2, 0x1 beq @081D7C24 cmp r2, 0x1 bgt @081D7B78 cmp r2, 0 beq @081D7B84 b @081D7D0C .align 2, 0 .pool @081D7B78: cmp r2, 0x2 bne @081D7B7E b @081D7CAC @081D7B7E: cmp r2, 0x3 beq @081D7C24 b @081D7D0C @081D7B84: strh r2, [r4, 0x26] ldrh r1, [r3] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r0, [r3] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x2] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r0, [r3, 0x2] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x4] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r0, [r3, 0x4] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x6] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r0, [r3, 0x6] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x8] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 strh r2, [r0, 0x26] ldrh r1, [r3, 0x8] ands r1, r5 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r6 b @081D7D0A @081D7C24: movs r2, 0x1 strh r2, [r4, 0x26] ldrh r1, [r3] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x2] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3, 0x2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x4] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3, 0x4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x6] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3, 0x6] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x8] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrb r1, [r3, 0x8] b @081D7D02 @081D7CAC: strh r2, [r4, 0x26] ldrh r1, [r3] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r0, [r3] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x2] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r0, [r3, 0x2] adds r1, r5, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x4] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 strh r2, [r0, 0x26] ldrh r1, [r3, 0x8] ands r1, r5 @081D7D02: lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r7 @081D7D0A: strh r2, [r0, 0x26] @081D7D0C: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D7A60 thumb_func_start sub_81D7D14 sub_81D7D14: ; 81D7D14 push {lr} adds r2, r0, 0 movs r0, 0x2E adds r0, r2 mov r12, r0 ldrh r1, [r2, 0x22] movs r3, 0x22 ldrsh r0, [r2, r3] cmp r0, 0xA0 bgt @081D7E08 adds r0, r1, 0 adds r0, 0x8 strh r0, [r2, 0x22] ldr r3, =0x02020630 ldrh r1, [r2, 0x2E] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] ldrh r0, [r2, 0x2E] movs r2, 0xFF adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] mov r0, r12 ldrh r1, [r0, 0x2] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] mov r1, r12 ldrh r0, [r1, 0x2] adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] mov r0, r12 ldrh r1, [r0, 0x4] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] mov r1, r12 ldrh r0, [r1, 0x4] adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] mov r0, r12 ldrh r1, [r0, 0x6] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] mov r1, r12 ldrh r0, [r1, 0x6] adds r1, r2, 0 ands r1, r0 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] mov r0, r12 ldrh r1, [r0, 0x8] lsls r1, 16 asrs r1, 24 lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] mov r1, r12 ldrh r0, [r1, 0x8] ands r2, r0 lsls r0, r2, 4 adds r0, r2 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x22] adds r1, 0x8 strh r1, [r0, 0x22] @081D7E08: pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0862AA54 movs r0, 0x1 movs r2, 0x3 bl bg_vram_setup ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001004 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 .pool thumb_func_end sub_81D7E10 thumb_func_start sub_81D7E9C sub_81D7E9C: ; 81D7E9C push {r4,lr} sub sp, 0x4 bl reset_temp_tile_data_buffers ldr r1, =gUnknown_08DA33C0 movs r4, 0 str r4, [sp] movs r0, 0 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_08DA4F70 str r4, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_08DA3C94 str r4, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram @081D7ED0: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081D7ED0 ldr r0, =gUnknown_08DA3988 ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA60B8 ldr r1, [r4] ldr r2, =0x00000804 adds r1, r2 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA4DEC ldr r1, [r4] ldr r2, =0x00001004 adds r1, r2 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA4DA8 movs r1, 0 movs r2, 0x40 bl decompress_palette ldr r0, =gUnknown_0862AA90 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AA98 bl gpu_pal_obj_decompress_and_apply add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D7E9C thumb_func_start sub_81D7F4C sub_81D7F4C: ; 81D7F4C push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r5, =0x03005e08 adds r6, r4, r5 movs r0, 0xE8 lsls r0, 1 bl current_map_music_set bl sub_81D7E10 bl sub_81D7E9C movs r1, 0x94 lsls r1, 2 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000808 movs r0, 0x52 bl lcd_io_set movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r0, =sub_81D67EC bl SetVBlankCallback ldr r0, =sub_81D81A4 movs r1, 0 bl AddTask movs r0, 0 strh r0, [r6] strh r0, [r6, 0x2] subs r5, 0x8 adds r4, r5 ldr r0, =sub_81D7FC0 str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D7F4C thumb_func_start sub_81D7FC0 sub_81D7FC0: ; 81D7FC0 push {r4-r6,lr} sub sp, 0x10 lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 movs r0, 0 ldrsh r5, [r4, r0] cmp r5, 0x1 beq @081D802A cmp r5, 0x1 bgt @081D7FE8 cmp r5, 0 beq @081D7FF4 b @081D815A .align 2, 0 .pool @081D7FE8: cmp r5, 0x2 beq @081D80A4 cmp r5, 0x3 bne @081D7FF2 b @081D8124 @081D7FF2: b @081D815A @081D7FF4: ldrh r1, [r4, 0x2] movs r2, 0x2 ldrsh r0, [r4, r2] cmp r0, 0x8 bne @081D8024 movs r0, 0x1 negs r0, r0 str r5, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl 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, =0x00000127 cmp r1, r0 ble @081D815A ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] movs r0, 0x1 negs r0, r0 str r5, [sp] movs r1, 0x6 movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 b @081D815A .align 2, 0 .pool @081D8124: ldrh r0, [r4, 0x4] adds r0, 0x10 strh r0, [r4, 0x4] movs r1, 0xF0 lsls r1, 7 movs r2, 0xC0 lsls r2, 5 ldrh r0, [r4, 0x8] adds r0, 0x20 lsls r0, 16 asrs r0, 16 str r0, [sp] movs r3, 0x4 ldrsh r0, [r4, r3] str r0, [sp, 0x4] movs r3, 0x4 ldrsh r0, [r4, r3] str r0, [sp, 0x8] movs r0, 0 str r0, [sp, 0xC] movs r0, 0x2 movs r3, 0x78 bl 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, =0x02037fd4 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, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81D6840 str r0, [r1] @081D8192: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D8164 thumb_func_start sub_81D81A4 sub_81D81A4: ; 81D81A4 push {r4-r6,lr} lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 ldrh r1, [r4, 0x2] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @081D8254 ldr r0, =gUnknown_0862AAA0 ldr r3, =gUnknown_0862AAB8 movs r1, 0 ldrsh r2, [r4, r1] lsls r2, 1 adds r1, r2, r3 ldrb r1, [r1] lsls r1, 24 asrs r1, 24 lsls r1, 18 movs r6, 0xF0 lsls r6, 15 adds r1, r6 asrs r1, 16 adds r3, 0x1 adds r2, r3 ldrb r2, [r2] lsls r2, 24 asrs r2, 24 lsls r2, 18 movs r3, 0xA0 lsls r3, 15 adds r2, r3 asrs r2, 16 movs r3, 0 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 ldr r1, =0x02020630 lsls r3, r0, 4 adds r3, r0 lsls r3, 2 adds r3, r1 movs r0, 0 ldrsb r0, [r4, r0] strh r0, [r3, 0x2E] ldrb r2, [r3, 0x1] movs r1, 0xD negs r1, r1 adds r0, r1, 0 ands r0, r2 movs r2, 0x4 orrs r0, r2 movs r2, 0x3 orrs r0, r2 strb r0, [r3, 0x1] ldrb r0, [r3, 0x5] ands r1, r0 movs r0, 0x8 orrs r1, r0 strb r1, [r3, 0x5] adds r0, r3, 0 bl obj_alloc_rotscale_entry ldrh r1, [r4] movs r6, 0 ldrsh r0, [r4, r6] cmp r0, 0x9 bne @081D8250 adds r0, r5, 0 bl remove_task b @081D825A .align 2, 0 .pool @081D8250: adds r0, r1, 0x1 strh r0, [r4] @081D8254: ldrh r0, [r4, 0x2] adds r0, 0x1 strh r0, [r4, 0x2] @081D825A: pop {r4-r6} pop {r0} bx r0 thumb_func_end sub_81D81A4 thumb_func_start sub_81D8260 sub_81D8260: ; 81D8260 push {lr} adds r2, r0, 0 movs r1, 0x30 ldrsh r0, [r2, r1] cmp r0, 0 bne @081D8270 strh r0, [r2, 0x24] b @081D829A @081D8270: ldr r1, =gUnknown_0862AAB8 movs r3, 0x2E ldrsh r0, [r2, r3] lsls r0, 1 adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 ldrh r3, [r2, 0x24] adds r0, r3 strh r0, [r2, 0x24] movs r3, 0x2E ldrsh r0, [r2, r3] lsls r0, 1 adds r1, 0x1 adds r0, r1 ldrb r0, [r0] lsls r0, 24 asrs r0, 24 ldrh r1, [r2, 0x26] adds r0, r1 @081D829A: strh r0, [r2, 0x26] ldrh r0, [r2, 0x30] adds r0, 0x1 movs r1, 0xF ands r0, r1 strh r0, [r2, 0x30] pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0862AACC movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001004 adds r1, r0 movs r0, 0x2 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001804 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 .pool thumb_func_end sub_81D82B0 thumb_func_start sub_81D8358 sub_81D8358: ; 81D8358 push {r4-r7,lr} sub sp, 0xC bl reset_temp_tile_data_buffers ldr r1, =gUnknown_08DA7528 movs r4, 0 str r4, [sp] movs r0, 0 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_08DA69BC str r4, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram add r7, sp, 0x8 @081D8380: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 lsrs r6, r0, 24 cmp r6, 0 bne @081D8380 ldr r0, =gUnknown_08DA7AAC ldr r5, =0x0203cf60 ldr r1, [r5] adds r1, 0x4 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA7784 ldr r1, [r5] ldr r4, =0x00001804 adds r1, r4 bl call_LZZUnCompWram str r6, [sp, 0x4] ldr r1, [r5] ldr r0, =0x00001004 adds r1, r0 ldr r2, =0x01000200 add r0, sp, 0x4 bl CpuFastSet ldr r1, [r5] adds r4, r1, r4 ldr r0, =0x00000804 adds r1, r0 movs r2, 0x80 lsls r2, 2 adds r0, r4, 0 bl CpuFastSet str r6, [sp, 0x8] ldr r1, [r5] ldr r0, =0x00000904 adds r1, r0 ldr r2, =0x010000d0 adds r0, r7, 0 bl CpuFastSet ldr r0, =gUnknown_08DA7744 movs r1, 0 movs r2, 0x40 bl decompress_palette ldr r0, =0x02037714 ldr r1, =0x00007fff strh r1, [r0] ldr r0, =0x02037b14 strh r1, [r0] ldr r0, =gUnknown_0862AAFC bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AB04 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AB0C bl gpu_pal_obj_decompress_and_apply add sp, 0xC pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool 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, =0x0203cf60 ldr r0, [r0] ldr r3, =0x00002008 adds r0, r3 movs r3, 0 ldrsh r0, [r0, r3] cmp r1, r0 bgt @081D848C ldr r1, =0x04000052 ldr r3, =0x00000d08 b @081D8492 .align 2, 0 .pool @081D848C: ldr r1, =0x04000052 movs r3, 0x80 lsls r3, 5 @081D8492: adds r0, r3, 0 strh r0, [r1] cmp r2, 0 bne @081D84E0 ldr r0, =0x0203cf60 ldr r1, [r0] ldr r2, =0x00002008 adds r3, r1, r2 ldrh r4, [r3] movs r1, 0 ldrsh r2, [r3, r1] ldr r1, =0x00001fff adds r5, r0, 0 cmp r2, r1 bgt @081D84D4 cmp r2, 0x27 bgt @081D84C8 adds r0, r4, 0x4 b @081D84D2 .align 2, 0 .pool @081D84C8: cmp r2, 0x4F bgt @081D84D0 adds r0, r4, 0x2 b @081D84D2 @081D84D0: adds r0, r4, 0x1 @081D84D2: strh r0, [r3] @081D84D4: ldr r1, [r5] ldr r2, =0x0000200a adds r1, r2 ldrh r0, [r1] adds r0, 0x1 strh r0, [r1] @081D84E0: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D844C thumb_func_start sub_81D84EC sub_81D84EC: ; 81D84EC push {r4-r6,lr} mov r6, r8 push {r6} lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r6, =0x03005e08 adds r5, r4, r6 bl sub_81D82B0 bl sub_81D8358 ldr r1, =0x00001e41 movs r0, 0x50 bl 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, =sub_81D67EC bl SetVBlankCallback ldr r0, =0x0203cf60 ldr r0, [r0] ldr r1, =0x00002008 adds r2, r0, r1 movs r1, 0 strh r1, [r2] ldr r2, =0x0000200a adds r0, r2 strh r1, [r0] strh r1, [r5] strh r1, [r5, 0x2] strh r1, [r5, 0x4] strh r1, [r5, 0x6] mov r0, r8 strh r0, [r5, 0x8] subs r6, 0x8 adds r4, r6 ldr r0, =sub_81D857C str r0, [r4] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D84EC thumb_func_start sub_81D857C sub_81D857C: ; 81D857C push {r4,r5,lr} sub sp, 0x4 lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 ldr r1, =0x03005e08 adds r5, r0, r1 movs r1, 0 ldrsh r0, [r5, r1] cmp r0, 0x4 bhi @081D8674 lsls r0, 2 ldr r1, =@081D85A8 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081D85A8: .4byte @081D85BC .4byte @081D85DC .4byte @081D861A .4byte @081D863A .4byte @081D8656 @081D85BC: ldrh r1, [r5, 0x2] movs r2, 0x2 ldrsh r0, [r5, r2] cmp r0, 0x8 bne @081D8634 movs r0, 0x1 negs r0, r0 movs r4, 0 str r4, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 strh r4, [r5, 0x2] b @081D864E @081D85DC: ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r1, r0, 24 cmp r1, 0 bne @081D8674 ldrh r2, [r5, 0x2] movs r3, 0x2 ldrsh r0, [r5, r3] cmp r0, 0xA bne @081D8614 strh r1, [r5, 0x2] ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] ldr r0, =sub_81D844C bl SetHBlankCallback movs r0, 0x3 bl enable_irqs b @081D8674 .align 2, 0 .pool @081D8614: adds r0, r2, 0x1 strh r0, [r5, 0x2] b @081D8674 @081D861A: ldrh r1, [r5, 0x2] movs r2, 0x2 ldrsh r0, [r5, r2] cmp r0, 0x50 bne @081D8634 movs r0, 0 strh r0, [r5, 0x2] ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] bl sub_81D86CC b @081D8674 @081D8634: adds r0, r1, 0x1 strh r0, [r5, 0x2] b @081D8674 @081D863A: ldrh r0, [r5, 0x2] adds r0, 0x1 strh r0, [r5, 0x2] lsls r0, 16 movs r1, 0xB8 lsls r1, 17 cmp r0, r1 bne @081D8674 movs r0, 0 strh r0, [r5, 0x2] @081D864E: ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] b @081D8674 @081D8656: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r4, 2 adds r0, r4 lsls r0, 3 adds r0, r1 ldr r1, =sub_81D8684 str r1, [r0] @081D8674: add sp, 0x4 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D857C thumb_func_start sub_81D8684 sub_81D8684: ; 81D8684 push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081D86B8 movs r0, 0 bl SetVBlankCallback movs r0, 0 bl SetHBlankCallback bl reset_all_obj_data bl gpu_pal_allocator_reset ldr r0, =0x03005e00 lsls r1, r4, 2 adds r1, r4 lsls r1, 3 adds r1, r0 ldr r0, =sub_81D6840 str r0, [r1] @081D86B8: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D8684 thumb_func_start sub_81D86CC sub_81D86CC: ; 81D86CC push {r4-r6,lr} mov r6, r8 push {r6} ldr r0, =gUnknown_0862AB14 movs r1, 0xA0 movs r2, 0 movs r3, 0 bl 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, =0x0202065e adds r0, r5, r4 mov r8, r0 ldr r0, =gUnknown_0862AB2C movs r2, 0x30 negs r2, r2 movs r1, 0xB8 movs r3, 0 bl 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, =sub_81D874C str r0, [r4] adds r5, r3 ldrb r0, [r5, 0x5] movs r2, 0xC orrs r0, r2 strb r0, [r5, 0x5] movs r4, 0 ldrsh r1, [r1, r4] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrb r1, [r0, 0x5] orrs r1, r2 strb r1, [r0, 0x5] adds r0, r6, 0 pop {r3} mov r8, r3 pop {r4-r6} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D86CC thumb_func_start sub_81D874C sub_81D874C: ; 81D874C push {r4,r5,lr} adds r5, r0, 0 adds r4, r5, 0 adds r4, 0x2E movs r0, 0x4 ldrsh r1, [r4, r0] cmp r1, 0 bne @081D8764 movs r0, 0xC strh r0, [r4, 0x6] movs r0, 0x8 b @081D87C2 @081D8764: movs r0, 0x80 lsls r0, 1 cmp r1, r0 bne @081D8774 movs r0, 0x9 strh r0, [r4, 0x6] movs r0, 0x7 b @081D87C2 @081D8774: movs r0, 0x86 lsls r0, 1 cmp r1, r0 bne @081D8784 movs r0, 0x8 strh r0, [r4, 0x6] movs r0, 0x6 b @081D87C2 @081D8784: movs r0, 0x8C lsls r0, 1 cmp r1, r0 bne @081D8794 movs r0, 0x7 strh r0, [r4, 0x6] movs r0, 0x5 b @081D87C2 @081D8794: movs r0, 0x92 lsls r0, 1 cmp r1, r0 bne @081D87A4 movs r0, 0x6 strh r0, [r4, 0x6] movs r0, 0x4 b @081D87C2 @081D87A4: movs r0, 0x98 lsls r0, 1 cmp r1, r0 bne @081D87B4 movs r0, 0x5 strh r0, [r4, 0x6] movs r0, 0x3 b @081D87C2 @081D87B4: movs r0, 0xA0 lsls r0, 1 cmp r1, r0 bne @081D87C4 movs r0, 0x4 strh r0, [r4, 0x6] movs r0, 0x2 @081D87C2: strh r0, [r4, 0x8] @081D87C4: movs r1, 0x4 ldrsh r0, [r4, r1] movs r2, 0x6 ldrsh r1, [r4, r2] bl __modsi3 cmp r0, 0 bne @081D87EE ldrh r0, [r5, 0x24] subs r0, 0x1 strh r0, [r5, 0x24] ldr r2, =0x02020630 movs r0, 0 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x24] subs r1, 0x1 strh r1, [r0, 0x24] @081D87EE: movs r1, 0x4 ldrsh r0, [r4, r1] movs r2, 0x8 ldrsh r1, [r4, r2] bl __modsi3 cmp r0, 0 bne @081D8818 ldrh r0, [r5, 0x26] adds r0, 0x1 strh r0, [r5, 0x26] ldr r2, =0x02020630 movs r0, 0 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x26] adds r1, 0x1 strh r1, [r0, 0x26] @081D8818: ldrh r0, [r4, 0x4] adds r0, 0x1 strh r0, [r4, 0x4] pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0862AB44 movs r0, 0 movs r2, 0x4 bl bg_vram_setup ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001004 adds r1, r0 movs r0, 0x2 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001804 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 .pool thumb_func_end sub_81D8828 thumb_func_start sub_81D88D0 sub_81D88D0: ; 81D88D0 push {r4,lr} sub sp, 0x4 bl reset_temp_tile_data_buffers ldr r1, =gUnknown_08DA80BC movs r4, 0 str r4, [sp] movs r0, 0x1 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_08DA7EAC str r4, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_08DA7C30 str r4, [sp] movs r0, 0x3 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram @081D8904: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081D8904 ldr r0, =gUnknown_08DA8D6C ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA8B40 ldr r1, [r4] ldr r2, =0x00000804 adds r1, r2 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA7FB4 ldr r1, [r4] ldr r2, =0x00001004 adds r1, r2 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA7D6C ldr r1, [r4] ldr r2, =0x00001804 adds r1, r2 bl call_LZZUnCompWram ldr r0, =gUnknown_08DA8E84 movs r1, 0 movs r2, 0x80 bl decompress_palette add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D88D0 thumb_func_start sub_81D8980 sub_81D8980: ; 81D8980 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r5, =0x03005e08 adds r6, r4, r5 bl sub_81D8828 bl sub_81D88D0 bl sub_81D68C8 movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r0, =sub_81D67EC bl SetVBlankCallback movs r0, 0 strh r0, [r6] strh r0, [r6, 0x2] ldr r0, =sub_81D8AD8 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x4] subs r5, 0x8 adds r4, r5 ldr r0, =sub_81D89E0 str r0, [r4] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D8980 thumb_func_start sub_81D89E0 sub_81D89E0: ; 81D89E0 push {r4-r6,lr} sub sp, 0x4 lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 bl sub_81D8BB4 ldrh r1, [r4, 0x6] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @081D8A16 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0x1 bgt @081D8A16 movs r2, 0x2 ldrsh r0, [r4, r2] cmp r0, 0x59 bgt @081D8A16 movs r0, 0x67 bl audio_play @081D8A16: ldrh r0, [r4, 0x6] adds r0, 0x1 strh r0, [r4, 0x6] movs r0, 0 ldrsh r5, [r4, r0] cmp r5, 0x1 beq @081D8A5C cmp r5, 0x1 bgt @081D8A34 cmp r5, 0 beq @081D8A3E b @081D8AC6 .align 2, 0 .pool @081D8A34: cmp r5, 0x2 beq @081D8A8C cmp r5, 0x3 beq @081D8AA8 b @081D8AC6 @081D8A3E: ldrh r1, [r4, 0x2] movs r2, 0x2 ldrsh r0, [r4, r2] cmp r0, 0x8 bne @081D8AA2 movs r0, 0x1 negs r0, r0 str r5, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl 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, =0x03005e00 movs r0, 0x4 ldrsh r1, [r4, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r2 ldr r1, =sub_81D8B2C b @081D8AC4 .align 2, 0 .pool @081D8A8C: ldrh r1, [r4, 0x2] movs r2, 0x2 ldrsh r0, [r4, r2] cmp r0, 0xC bne @081D8AA2 movs r0, 0 strh r0, [r4, 0x2] @081D8A9A: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] b @081D8AC6 @081D8AA2: adds r0, r1, 0x1 strh r0, [r4, 0x2] b @081D8AC6 @081D8AA8: movs r0, 0x1 negs r0, r0 movs r1, 0 str r1, [sp] movs r2, 0 movs r3, 0x10 bl sub_80A1AD4 ldr r1, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 ldr r1, =sub_81D8BEC @081D8AC4: str r1, [r0] @081D8AC6: add sp, 0x4 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D89E0 thumb_func_start sub_81D8AD8 sub_81D8AD8: ; 81D8AD8 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r5, r1, r0 ldrh r1, [r5, 0x1E] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @081D8B1C bl GenerateRandomNumber movs r4, 0x7 adds r1, r4, 0 ands r1, r0 subs r1, 0x4 lsls r1, 8 movs r0, 0x1 movs r2, 0 bl 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 .pool thumb_func_end sub_81D8AD8 thumb_func_start sub_81D8B2C sub_81D8B2C: ; 81D8B2C push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r4, r1, r0 movs r1, 0 ldrsh r0, [r4, r1] cmp r0, 0 bne @081D8B70 movs r0, 0x1 movs r1, 0 movs r2, 0 bl 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 .pool @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, =0x03005e08 adds r4, r5, r6 bl sub_81D8BB4 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081D8C26 movs r0, 0 bl SetVBlankCallback bl sub_81D6904 ldrb r0, [r4, 0x4] bl remove_task adds r0, r6, 0 subs r0, 0x8 adds r0, r5, r0 ldr r1, =sub_81D6840 str r1, [r0] @081D8C26: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool 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, =gUnknown_0862AD08 movs r0, 0x1 movs r2, 0x3 bl bg_vram_setup ldr r4, =0x0203cf60 ldr r1, [r4] adds r1, 0x4 movs r0, 0 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00000804 adds r1, r0 movs r0, 0x1 bl bg_set_tilemap ldr r1, [r4] ldr r0, =0x00001004 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 .pool thumb_func_end sub_81D8C38 thumb_func_start sub_81D8CC4 sub_81D8CC4: ; 81D8CC4 push {r4,lr} sub sp, 0x4 bl reset_temp_tile_data_buffers ldr r1, =gUnknown_08DAAB24 movs r4, 0 str r4, [sp] movs r0, 0x2 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram ldr r1, =gUnknown_08DAA8B4 str r4, [sp] movs r0, 0 movs r2, 0 movs r3, 0 bl decompress_and_copy_tile_data_to_vram @081D8CEA: bl free_temp_tile_data_buffers_if_possible lsls r0, 24 cmp r0, 0 bne @081D8CEA ldr r0, =gUnknown_08DAAE54 ldr r4, =0x0203cf60 ldr r1, [r4] ldr r2, =0x00000804 adds r1, r2 bl call_LZZUnCompWram ldr r0, =gUnknown_08DAAC1C ldr r1, [r4] adds r1, 0x4 bl call_LZZUnCompWram ldr r0, =gUnknown_08DAAF98 ldr r1, [r4] ldr r2, =0x00001004 adds r1, r2 bl call_LZZUnCompWram ldr r0, =gUnknown_08DAAFEC movs r1, 0 movs r2, 0x60 bl decompress_palette ldr r0, =gUnknown_0862AC28 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AC30 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AC38 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AC40 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AC48 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AC50 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862AC58 bl gpu_pal_obj_decompress_and_apply ldr r0, =gUnknown_0862AC60 bl gpu_pal_obj_decompress_and_apply ldr r0, =gUnknown_0862AC68 bl gpu_pal_obj_decompress_and_apply ldr r0, =gUnknown_0862AC70 bl gpu_pal_obj_decompress_and_apply add sp, 0x4 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D8CC4 thumb_func_start sub_81D8DB4 sub_81D8DB4: ; 81D8DB4 push {r4-r6,lr} lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r5, =0x03005e08 adds r6, r4, r5 bl sub_81D8C38 bl sub_81D8CC4 bl sub_81D68C8 movs r1, 0x80 lsls r1, 3 movs r0, 0 bl lcd_io_clear_bits ldr r1, =0x00000241 movs r0, 0x50 bl lcd_io_set ldr r1, =0x00000e09 movs r0, 0x52 bl lcd_io_set movs r0, 0x1 negs r0, r0 movs r1, 0x10 movs r2, 0 bl sub_80A2A20 ldr r0, =sub_81D67EC bl SetVBlankCallback movs r0, 0 strh r0, [r6] strh r0, [r6, 0x2] subs r5, 0x8 adds r4, r5 ldr r0, =sub_81D8E80 str r0, [r4] ldr r0, =sub_81D8FB0 movs r1, 0 bl AddTask lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x4] movs r0, 0x4 ldrsh r1, [r6, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r2, 0 strh r2, [r0, 0x8] movs r0, 0x4 ldrsh r1, [r6, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r2, [r0, 0xA] movs r0, 0x4 ldrsh r1, [r6, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r2, [r0, 0xC] movs r0, 0x4 ldrsh r1, [r6, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 movs r2, 0x1 strh r2, [r0, 0xE] movs r0, 0x4 ldrsh r1, [r6, r0] lsls r0, r1, 2 adds r0, r1 lsls r0, 3 adds r0, r5 strh r2, [r0, 0x10] pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D8DB4 thumb_func_start sub_81D8E80 sub_81D8E80: ; 81D8E80 push {r4-r7,lr} mov r7, r8 push {r7} sub sp, 0xC lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 adds r0, r6 lsls r7, r0, 3 ldr r0, =0x03005e08 mov r8, r0 adds r4, r7, r0 movs r1, 0 ldrsh r5, [r4, r1] cmp r5, 0x1 beq @081D8EDE cmp r5, 0x1 bgt @081D8EB0 cmp r5, 0 beq @081D8EBA b @081D8FA0 .align 2, 0 .pool @081D8EB0: cmp r5, 0x2 beq @081D8F1E cmp r5, 0x3 beq @081D8F84 b @081D8FA0 @081D8EBA: ldrh r1, [r4, 0x2] movs r2, 0x2 ldrsh r0, [r4, r2] cmp r0, 0x8 bne @081D8F18 adds r0, r6, 0 bl sub_81D90A8 movs r0, 0x1 negs r0, r0 str r5, [sp] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A1AD4 strh r5, [r4, 0x2] b @081D8F30 @081D8EDE: ldr r2, =0x02020630 movs r0, 0xA ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r2, 0x1C adds r0, r2 ldr r1, [r0] ldr r0, =sub_81D97E0 cmp r1, r0 bne @081D8FA0 ldrh r1, [r4, 0x2] movs r2, 0x2 ldrsh r0, [r4, r2] cmp r0, 0x40 bne @081D8F18 adds r0, r6, 0 bl sub_81D94D4 adds r0, r6, 0 bl sub_81D93D8 b @081D8F2C .align 2, 0 .pool @081D8F18: adds r0, r1, 0x1 strh r0, [r4, 0x2] b @081D8FA0 @081D8F1E: ldrh r2, [r4, 0x2] movs r0, 0x2 ldrsh r1, [r4, r0] movs r0, 0xE0 lsls r0, 1 cmp r1, r0 bne @081D8F38 @081D8F2C: movs r0, 0 strh r0, [r4, 0x2] @081D8F30: ldrh r0, [r4] adds r0, 0x1 strh r0, [r4] b @081D8FA0 @081D8F38: adds r0, r2, 0x1 strh r0, [r4, 0x2] movs r1, 0x2 ldrsh r0, [r4, r1] movs r1, 0x90 bl __modsi3 lsls r0, 16 asrs r4, r0, 16 cmp r4, 0 bne @081D8FA0 ldr r0, =0x0000fffe ldr r1, =0x0000ffff str r1, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A2C44 ldr r0, =0xffff0000 str r4, [sp] str r4, [sp, 0x4] movs r1, 0x1 str r1, [sp, 0x8] movs r1, 0 movs r2, 0x10 movs r3, 0 bl sub_80A2C44 b @081D8FA0 .align 2, 0 .pool @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, =sub_81D9034 str r1, [r0] @081D8FA0: add sp, 0xC pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D8E80 thumb_func_start sub_81D8FB0 sub_81D8FB0: ; 81D8FB0 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r4, r1, r0 ldrh r1, [r4] movs r0, 0xF ands r0, r1 cmp r0, 0 bne @081D9024 ldrh r1, [r4, 0x2] adds r1, 0xE lsls r1, 8 movs r2, 0xF8 lsls r2, 5 adds r0, r2, 0 ands r1, r0 ldrh r0, [r4, 0x4] adds r0, 0x9 movs r2, 0xF ands r0, r2 orrs r1, r0 movs r0, 0x52 bl 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 .pool thumb_func_end sub_81D8FB0 thumb_func_start sub_81D9034 sub_81D9034: ; 81D9034 push {r4-r7,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r6, r1, 3 ldr r7, =0x03005e08 adds r4, r6, r7 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 lsls r0, 24 lsrs r5, r0, 24 cmp r5, 0 bne @081D90A0 bl sub_80A2F30 movs r1, 0x2 ldrsh r0, [r4, r1] cmp r0, 0 bne @081D9078 movs r0, 0 bl SetVBlankCallback bl sub_81D6904 bl 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, =sub_81D6840 str r1, [r0] b @081D90A0 .align 2, 0 .pool @081D909C: adds r0, r1, 0x1 strh r0, [r4, 0x2] @081D90A0: pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D9034 thumb_func_start sub_81D90A8 sub_81D90A8: ; 81D90A8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} lsls r0, 24 lsrs r0, 24 lsls r4, r0, 2 adds r4, r0 lsls r4, 3 ldr r0, =0x03005e08 adds r4, r0 ldr r0, =gUnknown_0862AC78 movs r1, 0x40 movs r2, 0x78 movs r3, 0 bl 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, =0x0202065e mov r10, r1 adds r7, r0, r1 ldr r0, =gUnknown_0862AC90 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, =gUnknown_0862ACA8 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, =gUnknown_0862ACC0 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, =gUnknown_0862ACD8 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 .pool thumb_func_end sub_81D90A8 thumb_func_start sub_81D9274 sub_81D9274: ; 81D9274 push {r4-r6,lr} mov r6, r8 push {r6} lsls r0, 24 lsrs r0, 24 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 ldr r0, =0x03005e08 adds r2, r0 ldr r3, =0x02020630 movs r0, 0x6 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 movs r1, 0x1C adds r1, r3 mov r8, r1 add r0, r8 ldr r6, =pokemon_alive_on_battle_side str r6, [r0] movs r0, 0x6 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r4, 0 strh r4, [r0, 0x36] movs r0, 0x6 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 strh r4, [r0, 0x38] movs r0, 0x6 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r5, 0x4 strh r5, [r0, 0x3A] movs r0, 0x6 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 strh r4, [r0, 0x3C] movs r0, 0x8 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 add r0, r8 str r6, [r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 strh r4, [r0, 0x36] movs r0, 0x8 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 strh r4, [r0, 0x38] movs r0, 0x8 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 strh r5, [r0, 0x3A] movs r0, 0x8 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0x1 strh r1, [r0, 0x3C] pop {r3} mov r8, r3 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D9274 thumb_func_start pokemon_alive_on_battle_side pokemon_alive_on_battle_side: ; 81D9338 push {r4,lr} adds r4, r0, 0 ldrh r1, [r4, 0x36] movs r0, 0x7 ands r0, r1 cmp r0, 0 bne @081D93CC movs r1, 0x3C ldrsh r0, [r4, r1] cmp r0, 0 bne @081D9370 ldrh r0, [r4, 0x20] ldrh r3, [r4, 0x3A] subs r0, r3 strh r0, [r4, 0x20] ldr r2, =0x02020630 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x20] subs r1, r3 b @081D939E .align 2, 0 .pool @081D9370: ldrh r2, [r4, 0x3A] ldrh r1, [r4, 0x20] adds r0, r2, r1 strh r0, [r4, 0x20] ldr r3, =0x02020630 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r0, 0x20] adds r2, r1 strh r2, [r0, 0x20] movs r2, 0x30 ldrsh r1, [r4, r2] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 ldrh r1, [r4, 0x3A] ldrh r2, [r0, 0x20] adds r1, r2 @081D939E: strh r1, [r0, 0x20] ldrh r1, [r4, 0x38] adds r1, 0x1 movs r2, 0 strh r1, [r4, 0x38] ldrh r0, [r4, 0x3A] subs r0, r1 strh r0, [r4, 0x3A] lsls r1, 16 asrs r1, 16 cmp r1, 0x3 bne @081D93CC strh r2, [r4, 0x36] strh r2, [r4, 0x38] strh r2, [r4, 0x3A] ldr r0, =nullsub_12 str r0, [r4, 0x1C] b @081D93D2 .align 2, 0 .pool @081D93CC: ldrh r0, [r4, 0x36] adds r0, 0x1 strh r0, [r4, 0x36] @081D93D2: pop {r4} pop {r0} bx r0 thumb_func_end pokemon_alive_on_battle_side thumb_func_start sub_81D93D8 sub_81D93D8: ; 81D93D8 push {lr} lsls r0, 24 lsrs r0, 24 lsls r2, r0, 2 adds r2, r0 lsls r2, 3 ldr r0, =0x03005e08 adds r2, r0 ldr r3, =0x02020630 movs r0, 0x6 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r1, r3, 0 adds r1, 0x1C adds r0, r1 ldr r1, =sub_81D9420 str r1, [r0] movs r0, 0x6 ldrsh r1, [r2, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 movs r1, 0x1 bl obj_anim_image_start pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D93D8 thumb_func_start sub_81D9420 sub_81D9420: ; 81D9420 push {r4,lr} adds r4, r0, 0 adds r0, 0x2B ldrb r0, [r0] cmp r0, 0x1 beq @081D9488 cmp r0, 0x1 bgt @081D9436 cmp r0, 0 beq @081D9440 b @081D94C4 @081D9436: cmp r0, 0x2 beq @081D9440 cmp r0, 0x3 beq @081D9488 b @081D94C4 @081D9440: adds r0, r4, 0 adds r0, 0x2C ldrb r0, [r0] lsls r0, 26 lsrs r0, 26 movs r1, 0xC bl __umodsi3 lsls r0, 24 ldr r2, =0x02020630 cmp r0, 0 bne @081D9470 ldrh r0, [r4, 0x20] subs r0, 0x2 strh r0, [r4, 0x20] movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x20] subs r1, 0x2 strh r1, [r0, 0x20] @081D9470: movs r1, 0x2E ldrsh r0, [r4, r1] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r2 movs r0, 0 strh r0, [r1, 0x26] b @081D94C4 .align 2, 0 .pool @081D9488: ldr r2, =0x02020630 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldr r1, =0x0000fffe strh r1, [r0, 0x26] adds r0, r4, 0 adds r0, 0x2C ldrb r1, [r0] lsls r1, 26 lsrs r1, 26 movs r0, 0xF ands r0, r1 cmp r0, 0 bne @081D94C4 ldrh r0, [r4, 0x22] adds r0, 0x1 strh r0, [r4, 0x22] movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 ldrh r1, [r0, 0x22] adds r1, 0x1 strh r1, [r0, 0x22] @081D94C4: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D9420 thumb_func_start sub_81D94D4 sub_81D94D4: ; 81D94D4 push {r4,lr} lsls r0, 24 lsrs r0, 24 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 ldr r0, =0x03005e08 adds r1, r0 movs r0, 0x8 ldrsh r1, [r1, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r2, =0x0202065e adds r4, r0, r2 subs r2, 0x12 adds r0, r2 ldr r3, =sub_81D9528 str r3, [r0] movs r0, 0 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 str r3, [r0] movs r0, 0x2 ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 str r3, [r0] pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D94D4 thumb_func_start sub_81D9528 sub_81D9528: ; 81D9528 push {r4-r7,lr} mov r7, r8 push {r7} adds r7, r0, 0 ldrh r1, [r7, 0x36] movs r0, 0x3 ands r0, r1 cmp r0, 0 bne @081D9550 ldrh r1, [r7, 0x24] movs r2, 0x24 ldrsh r0, [r7, r2] cmp r0, 0x1 bne @081D954C ldr r0, =0x0000ffff b @081D954E .align 2, 0 .pool @081D954C: movs r0, 0x1 @081D954E: strh r0, [r7, 0x24] @081D9550: movs r1, 0x38 ldrsh r0, [r7, r1] cmp r0, 0x80 bne @081D95CE ldr r2, =gUnknown_0862ACF0 mov r8, r2 mov r0, r8 movs r1, 0x98 movs r2, 0x84 movs r3, 0 bl obj_add_from_template_forward_search lsls r0, 24 lsrs r0, 24 strh r0, [r7, 0x3C] ldr r5, =0x02020630 movs r1, 0x3C ldrsh r0, [r7, r1] lsls r1, r0, 4 adds r1, r0 lsls r1, 2 adds r1, r5 ldrb r2, [r1, 0x5] movs r4, 0xD negs r4, r4 adds r0, r4, 0 ands r0, r2 movs r6, 0x4 orrs r0, r6 strb r0, [r1, 0x5] mov r0, r8 movs r1, 0xE0 movs r2, 0x84 movs r3, 0 bl 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 .pool @081D95F8: adds r0, r1, 0x1 strh r0, [r7, 0x38] @081D95FC: ldrh r0, [r7, 0x36] movs r1, 0x3F ands r0, r1 cmp r0, 0 bne @081D960C movs r0, 0xA5 bl audio_play @081D960C: ldrh r0, [r7, 0x36] adds r0, 0x1 strh r0, [r7, 0x36] pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D9528 thumb_func_start sub_81D961C sub_81D961C: ; 81D961C push {r4,r5,lr} adds r4, r0, 0 movs r0, 0x3C ldrsh r1, [r4, r0] cmp r1, 0x40 bgt @081D968C ldrh r0, [r4, 0x26] adds r0, 0x2 strh r0, [r4, 0x26] ldr r5, =0x02020630 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x26] adds r1, 0x2 strh r1, [r0, 0x26] movs r1, 0x3C ldrsh r0, [r4, r1] cmp r0, 0x40 beq @081D964C b @081D979E @081D964C: movs r3, 0x30 negs r3, r3 adds r0, r4, 0 movs r1, 0x1 movs r2, 0 bl sub_81D9868 movs r2, 0x5 strh r2, [r4, 0x36] ldr r0, =0x0000ffff strh r0, [r4, 0x38] movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 movs r1, 0x3 strh r1, [r0, 0x36] movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 strh r2, [r0, 0x38] b @081D979E .align 2, 0 .pool @081D968C: cmp r1, 0x6F bgt @081D96BE adds r0, r4, 0 bl sub_81D97E0 movs r1, 0x36 ldrsh r0, [r4, r1] cmp r0, 0 bne @081D96A4 movs r0, 0x68 bl audio_play @081D96A4: movs r0, 0x36 ldrsh r1, [r4, r0] movs r0, 0x3 negs r0, r0 cmp r1, r0 bne @081D979E adds r0, r4, 0 movs r1, 0x2 movs r2, 0x30 movs r3, 0x10 bl sub_81D9868 b @081D979E @081D96BE: cmp r1, 0x70 bne @081D96EC ldr r2, =0x02020630 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x7 strh r1, [r0, 0x36] movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 movs r1, 0x3 strh r1, [r0, 0x38] b @081D96F2 .align 2, 0 .pool @081D96EC: ldr r0, =0x00000147 cmp r1, r0 bgt @081D9700 @081D96F2: adds r0, r4, 0 bl sub_81D97E0 b @081D979E .align 2, 0 .pool @081D9700: movs r0, 0xA4 lsls r0, 1 cmp r1, r0 bne @081D974C adds r0, r4, 0 bl sub_81D97E0 adds r0, r4, 0 movs r1, 0x3 movs r2, 0x30 movs r3, 0x10 bl sub_81D9868 movs r3, 0x1 strh r3, [r4, 0x24] ldr r2, =0x02020630 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x24] movs r0, 0xCB lsls r0, 1 movs r1, 0 bl cry_related ldr r0, =sub_81D98B4 movs r1, 0 bl AddTask b @081D979E .align 2, 0 .pool @081D974C: movs r0, 0xB0 lsls r0, 1 cmp r1, r0 beq @081D9790 adds r0, 0x18 cmp r1, r0 bne @081D979E movs r3, 0 strh r3, [r4, 0x24] ldr r2, =0x02020630 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r2 strh r3, [r0, 0x24] adds r0, r4, 0 bl sub_81D97E0 adds r0, r4, 0 movs r1, 0x2 movs r2, 0x30 movs r3, 0x10 bl sub_81D9868 ldr r0, =sub_81D97E0 str r0, [r4, 0x1C] b @081D97D2 .align 2, 0 .pool @081D9790: ldr r0, =sub_81D8E80 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl sub_81D9274 @081D979E: ldrh r2, [r4, 0x3C] movs r0, 0x3C ldrsh r1, [r4, r0] movs r0, 0xA4 lsls r0, 1 cmp r1, r0 ble @081D97CC movs r0, 0x1 ands r0, r2 cmp r0, 0 bne @081D97CC movs r1, 0x24 ldrsh r2, [r4, r1] negs r2, r2 strh r2, [r4, 0x24] ldr r3, =0x02020630 movs r0, 0x2E ldrsh r1, [r4, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r3 strh r2, [r0, 0x24] @081D97CC: ldrh r0, [r4, 0x3C] adds r0, 0x1 strh r0, [r4, 0x3C] @081D97D2: pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D961C thumb_func_start sub_81D97E0 sub_81D97E0: ; 81D97E0 push {r4-r7,lr} adds r3, r0, 0 movs r0, 0x2E ldrsh r1, [r3, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 ldr r5, =0x02020630 adds r4, r0, r5 ldrh r1, [r3, 0x3A] ldrh r0, [r4, 0x36] ands r0, r1 cmp r0, 0 bne @081D985C ldrh r2, [r3, 0x36] ldrh r1, [r3, 0x26] adds r0, r2, r1 strh r0, [r3, 0x26] movs r7, 0x2E ldrsh r1, [r3, r7] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r0, r5 ldrh r1, [r0, 0x26] adds r2, r1 strh r2, [r0, 0x26] ldrh r0, [r3, 0x38] ldrh r2, [r3, 0x36] adds r0, r2 strh r0, [r3, 0x36] lsls r0, 16 asrs r5, r0, 16 ldrh r6, [r4, 0x38] movs r7, 0x38 ldrsh r2, [r4, r7] cmp r5, r2 bge @081D9836 movs r0, 0x36 ldrsh r1, [r3, r0] adds r0, r2, 0 cmn r1, r0 bgt @081D985C @081D9836: cmp r5, r2 ble @081D9844 strh r6, [r3, 0x36] b @081D9854 .align 2, 0 .pool @081D9844: movs r0, 0x36 ldrsh r1, [r3, r0] movs r2, 0x38 ldrsh r0, [r4, r2] cmn r1, r0 bge @081D9854 negs r0, r6 strh r0, [r3, 0x36] @081D9854: movs r7, 0x38 ldrsh r0, [r3, r7] negs r0, r0 strh r0, [r3, 0x38] @081D985C: ldrh r0, [r3, 0x3A] adds r0, 0x1 strh r0, [r3, 0x3A] pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81D97E0 thumb_func_start sub_81D9868 sub_81D9868: ; 81D9868 push {r4,r5,lr} adds r5, r1, 0 lsls r5, 24 lsrs r5, 24 movs r4, 0x2E ldrsh r1, [r0, r4] lsls r4, r1, 4 adds r4, r1 lsls r4, 2 ldr r1, =0x02020630 adds r4, r1 lsls r2, 16 asrs r2, 16 ldrh r1, [r0, 0x20] adds r2, r1 strh r2, [r4, 0x20] lsls r3, 16 asrs r3, 16 ldrh r1, [r0, 0x22] adds r3, r1 strh r3, [r4, 0x22] ldrh r1, [r0, 0x24] strh r1, [r4, 0x24] ldrh r1, [r0, 0x26] strh r1, [r4, 0x26] adds r1, r5, 0 bl 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 .pool thumb_func_end sub_81D9868 thumb_func_start sub_81D98B4 sub_81D98B4: ; 81D98B4 push {r4,r5,lr} sub sp, 0x10 lsls r0, 24 lsrs r5, r0, 24 lsls r0, r5, 2 adds r0, r5 lsls r0, 3 ldr r1, =0x03005e08 adds r4, r0, r1 movs r0, 0 ldrsh r1, [r4, r0] cmp r1, 0x1 beq @081D990C cmp r1, 0x1 bgt @081D98DC cmp r1, 0 beq @081D98E2 b @081D99B4 .align 2, 0 .pool @081D98DC: cmp r1, 0x2 beq @081D99A4 b @081D99B4 @081D98E2: movs r2, 0x80 lsls r2, 7 movs r0, 0x40 str r0, [sp] adds r0, 0xC0 str r0, [sp, 0x4] str r0, [sp, 0x8] str r1, [sp, 0xC] movs r0, 0x2 adds r1, r2, 0 movs r3, 0x78 bl 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, =0x02021cc4 bl sub_80D2548 adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy movs r0, 0x1 b @081D99DE .align 2, 0 .pool @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, =0x02021dc4 bl sub_80D2548 adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy movs r0, 0 str r0, [sp] ldr r0, =sub_81D9A1C str r0, [sp, 0x4] movs r0, 0x4 adds r1, r4, 0 movs r2, 0 movs r3, 0 bl do_choose_name_or_words_screen add sp, 0x8 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D99E4 thumb_func_start sub_81D9A1C sub_81D9A1C: ; 81D9A1C push {r4,r5,lr} ldr r4, =0x020375e0 ldr r5, =0x02021dc4 adds r0, r5, 0 bl sub_81D9A98 strh r0, [r4] ldrh r0, [r4] cmp r0, 0x1 beq @081D9A68 cmp r0, 0x1 bgt @081D9A44 cmp r0, 0 beq @081D9A62 b @081D9A68 .align 2, 0 .pool @081D9A44: cmp r0, 0x2 bne @081D9A68 bl sub_80D2578 cmp r0, 0 beq @081D9A5C ldr r0, =gUnknown_085EE49A bl sub_80D255C b @081D9A68 .align 2, 0 .pool @081D9A5C: movs r0, 0x1 strh r0, [r4] b @081D9A68 @081D9A62: adds r0, r5, 0 bl sub_80D255C @081D9A68: ldr r4, =0x02021cc4 bl sub_80D2548 adds r1, r0, 0 adds r0, r4, 0 bl gf_strcpy ldr r1, =0x03005dac ldr r0, =sub_80AF168 str r0, [r1] ldr r0, =c2_exit_to_overworld_2_switch bl set_callback2 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D9A1C thumb_func_start sub_81D9A98 sub_81D9A98: ; 81D9A98 push {r4,lr} adds r4, r0, 0 ldrb r0, [r4] cmp r0, 0xFF bne @081D9AA6 movs r0, 0x2 b @081D9ABC @081D9AA6: bl sub_80D2548 adds r1, r0, 0 adds r0, r4, 0 bl 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, =0x03005d90 ldr r0, [r0] adds r0, 0xA bl sub_80842DC adds r4, r0, 0 lsls r4, 16 lsrs r4, 16 ldr r0, =0x020375f0 mov r8, r0 bl sub_80D2548 mov r7, sp adds r7, 0xA add r6, sp, 0xC mov r5, sp adds r5, 0xD str r4, [sp] str r0, [sp, 0x4] add r0, sp, 0x8 adds r1, r7, 0 adds r2, r6, 0 adds r3, r5, 0 bl sub_81D9B68 mov r1, r8 strh r0, [r1] lsls r0, 16 cmp r0, 0 beq @081D9B1E ldrb r0, [r5] bl sub_80D24BC ldrb r0, [r6] bl sub_80D24F0 add r0, sp, 0x8 ldrh r0, [r0] ldrh r1, [r7] bl sub_80D2524 @081D9B1E: mov r1, r8 ldrh r0, [r1] bl sub_80D2480 mov r1, r8 ldrb r0, [r1] add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81D9AC4 thumb_func_start sub_81D9B40 sub_81D9B40: ; 81D9B40 push {lr} lsls r0, 24 lsrs r2, r0, 24 movs r1, 0 ldr r3, =gUnknown_0862AD14 @081D9B4A: adds r0, r1, r3 ldrb r0, [r0] cmp r0, r2 bne @081D9B5C lsls r0, r1, 24 lsrs r0, 24 b @081D9B64 .align 2, 0 .pool @081D9B5C: adds r1, 0x1 cmp r1, 0x1F bls @081D9B4A movs r0, 0x20 @081D9B64: pop {r1} bx r1 thumb_func_end sub_81D9B40 thumb_func_start sub_81D9B68 sub_81D9B68: ; 81D9B68 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x2C mov r10, r0 str r1, [sp, 0x20] str r2, [sp, 0x24] str r3, [sp, 0x28] ldr r0, [sp, 0x4C] ldr r5, [sp, 0x50] lsls r0, 16 lsrs r0, 16 mov r9, r0 adds r0, r5, 0 bl 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, =0x03005e00 lsls r0, r6, 2 adds r0, r6 lsls r0, 3 adds r0, r1 movs r1, 0x1A ldrsh r0, [r0, r1] cmp r0, 0x4 bhi @081D9EA4 lsls r0, 2 ldr r1, =@081D9E10 adds r0, r1 ldr r0, [r0] mov pc, r0 .align 2, 0 .pool .align 2, 0 @081D9E10: .4byte @081D9E24 .4byte @081D9E44 .4byte @081D9E64 .4byte @081D9E84 .4byte @081D9EA4 @081D9E24: ldr r4, =0x02039f31 ldr r0, =0x02039f24 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x32 b @081D9EB4 .align 2, 0 .pool @081D9E44: ldr r4, =0x02039f31 ldr r0, =0x02039f24 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x33 b @081D9EB4 .align 2, 0 .pool @081D9E64: ldr r4, =0x02039f31 ldr r0, =0x02039f24 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x34 b @081D9EB4 .align 2, 0 .pool @081D9E84: ldr r4, =0x02039f31 ldr r0, =0x02039f24 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x35 b @081D9EB4 .align 2, 0 .pool @081D9EA4: ldr r4, =0x02039f31 ldr r0, =0x02039f24 ldrb r1, [r0] movs r0, 0x64 muls r0, r1 ldr r1, =0x020244ec adds r0, r1 movs r1, 0x36 @081D9EB4: bl pokemon_getattr strb r0, [r4] ldr r5, =0x02039e00 ldr r4, =0x02039f25 ldrb r0, [r4] lsls r0, 6 adds r0, r5 ldr r1, =0x02039f31 ldrb r1, [r1] adds r0, 0x2C strb r1, [r0] ldr r0, =0x00000864 bl 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, =sub_81DA160 ldr r2, =sub_81D9F14 adds r0, r6, 0 bl set_task_function_and_args_14_15 pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D9DE4 thumb_func_start sub_81D9F14 sub_81D9F14: ; 81D9F14 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =sub_81DA244 ldr r2, =sub_81D9F30 bl set_task_function_and_args_14_15 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D9F14 thumb_func_start sub_81D9F30 sub_81D9F30: ; 81D9F30 push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =sub_81DA2E8 ldr r2, =sub_81D9F4C bl set_task_function_and_args_14_15 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D9F30 thumb_func_start sub_81D9F4C sub_81D9F4C: ; 81D9F4C push {lr} lsls r0, 24 lsrs r0, 24 ldr r1, =sub_81DA3B8 ldr r2, =sub_81D9F68 bl set_task_function_and_args_14_15 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D9F4C thumb_func_start sub_81D9F68 sub_81D9F68: ; 81D9F68 push {r4-r7,lr} mov r7, r9 mov r6, r8 push {r6,r7} sub sp, 0x8 lsls r0, 24 lsrs r6, r0, 24 movs r0, 0 str r0, [sp] str r0, [sp, 0x4] movs r3, 0 ldr r5, =0x02039f30 mov r8, r5 ldr r0, =0x020375e0 mov r12, r0 add r1, sp, 0x4 mov r9, r1 ldrb r4, [r5] cmp r3, r4 bcs @081D9FB2 lsls r0, r6, 2 adds r0, r6 lsls r4, r0, 3 ldr r7, =0x03005e08 @081D9F98: mov r0, sp adds r2, r0, r3 adds r1, r3, 0x1 lsls r0, r1, 1 adds r0, r4 adds r0, r7 ldrh r0, [r0] strb r0, [r2] lsls r1, 24 lsrs r3, r1, 24 ldrb r1, [r5] cmp r3, r1 bcc @081D9F98 @081D9FB2: movs r3, 0 mov r4, r8 ldrb r0, [r4] cmp r3, r0 bcs @081D9FD6 adds r4, r0, 0 mov r2, sp @081D9FC0: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, r4 bcs @081D9FD6 mov r7, sp adds r1, r7, r3 ldrb r0, [r2] ldrb r1, [r1] cmp r0, r1 beq @081D9FC0 @081D9FD6: mov r0, r8 ldrb r0, [r0] cmp r3, r0 bne @081D9FF4 movs r0, 0 mov r1, r12 strh r0, [r1] b @081D9FFA .align 2, 0 .pool @081D9FF4: movs r0, 0x1 mov r4, r12 strh r0, [r4] @081D9FFA: movs r3, 0 mov r7, r8 mov r0, r8 ldrb r0, [r0] cmp r3, r0 bcs @081DA02A mov r4, r9 lsls r0, r6, 2 adds r0, r6 lsls r2, r0, 3 ldr r5, =0x03005e08 @081DA010: adds r1, r4, r3 adds r0, r3, 0x5 lsls r0, 1 adds r0, r2 adds r0, r5 ldrh r0, [r0] strb r0, [r1] adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 ldrb r1, [r7] cmp r3, r1 bcc @081DA010 @081DA02A: mov r4, r8 ldrb r0, [r4] cmp r0, 0x4 beq @081DA0B8 bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @081DA0B8 ldr r0, =0x02039e00 adds r1, r0, 0 adds r1, 0x2C ldrb r2, [r1] movs r3, 0x1 ldrb r1, [r4] adds r5, r0, 0 cmp r3, r1 bcs @081DA06C adds r4, r5, 0 mov r7, r8 ldrb r1, [r7] @081DA054: lsls r0, r3, 6 adds r0, r4 adds r0, 0x2C ldrb r7, [r0] cmp r2, r7 bcs @081DA062 ldrb r2, [r0] @081DA062: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 cmp r3, r1 bcc @081DA054 @081DA06C: cmp r2, 0 beq @081DA076 subs r0, r2, 0x1 lsls r0, 24 lsrs r2, r0, 24 @081DA076: movs r4, 0x1 movs r3, 0 mov r0, r8 ldrb r0, [r0] cmp r3, r0 bcs @081DA0AC adds r0, r5, 0 b @081DA0A2 .align 2, 0 .pool @081DA090: adds r0, r3, 0x1 lsls r0, 24 lsrs r3, r0, 24 mov r1, r8 ldrb r1, [r1] cmp r3, r1 bcs @081DA0AC lsls r0, r3, 6 adds r0, r5 @081DA0A2: adds r0, 0x2D ldrb r0, [r0] cmp r0, 0 bne @081DA090 movs r4, 0 @081DA0AC: mov r0, sp ldrb r0, [r0] adds r1, r2, 0 adds r2, r4, 0 bl sub_80DACBC @081DA0B8: mov r0, r9 bl sub_80F86E0 ldr r1, =0x02039f2b strb r0, [r1] ldr r0, =0x02039f30 ldrb r0, [r0] cmp r0, 0x3 bhi @081DA0E8 ldr r1, =sub_81DA488 ldr r2, =sub_81DA10C adds r0, r6, 0 bl set_task_function_and_args_14_15 b @081DA0F6 .align 2, 0 .pool @081DA0E8: ldr r0, =0x03005e00 lsls r1, r6, 2 adds r1, r6 lsls r1, 3 adds r1, r0 ldr r0, =sub_81DA10C str r0, [r1] @081DA0F6: add sp, 0x8 pop {r3,r4} mov r8, r3 mov r9, r4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81D9F68 thumb_func_start sub_81DA10C sub_81DA10C: ; 81DA10C push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 ldr r0, =0x02039f2c ldrb r0, [r0] bl sub_80DB09C ldr r1, =sub_80FCF40 ldr r2, =sub_81DA138 adds r0, r4, 0 bl set_task_function_and_args_14_15 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA10C thumb_func_start sub_81DA138 sub_81DA138: ; 81DA138 push {r4,lr} adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 movs r0, 0 bl sub_80DCE58 ldr r1, =sub_80FCFD0 ldr r2, =sub_80F8714 adds r0, r4, 0 bl set_task_function_and_args_14_15 pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA138 thumb_func_start sub_81DA160 sub_81DA160: ; 81DA160 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r7, r0, 24 lsls r6, r7, 2 adds r0, r6, r7 lsls r4, r0, 3 ldr r5, =0x03005e08 adds r0, r4, r5 adds r0, 0x18 bl sub_80FC670 cmp r0, 0 beq @081DA224 adds r0, r5, 0 subs r0, 0x8 adds r4, r0 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @081DA1A4 cmp r0, 0x1 beq @081DA1D4 movs r0, 0 strh r0, [r4, 0x8] strh r0, [r4, 0x20] adds r0, r7, 0 bl set_task_function_to_args_14_15 b @081DA224 .align 2, 0 .pool @081DA1A4: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @081DA224 ldr r0, =0x02039f25 ldrb r0, [r0] lsls r0, 6 ldr r1, =0x02039e00 adds r0, r1 movs r1, 0x40 bl sub_80FC4F4 cmp r0, 0x1 bne @081DA224 ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @081DA224 .align 2, 0 .pool @081DA1D4: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @081DA224 movs r5, 0 ldr r0, =0x02039f30 mov r8, r6 ldrb r0, [r0] cmp r5, r0 bge @081DA214 ldr r6, =0x020229e8 @081DA1EC: lsls r4, r5, 6 ldr r0, =0x02039e00 adds r4, r0 lsls r1, r5, 8 ldr r0, =0x020223c4 adds r1, r0 adds r0, r4, 0 movs r2, 0x40 bl memcpy ldrh r1, [r6, 0x1A] adds r0, r4, 0 bl sub_80DFA08 adds r6, 0x1C adds r5, 0x1 ldr r0, =0x02039f30 ldrb r0, [r0] cmp r5, r0 blt @081DA1EC @081DA214: ldr r0, =0x03005e00 mov r2, r8 adds r1, r2, r7 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @081DA224: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA160 thumb_func_start sub_81DA244 sub_81DA244: ; 81DA244 push {r4-r6,lr} lsls r0, 24 lsrs r4, r0, 24 lsls r0, r4, 2 adds r0, r4 lsls r5, r0, 3 ldr r6, =0x03005e08 adds r0, r5, r6 adds r0, 0x18 bl sub_80FC670 cmp r0, 0 beq @081DA2D4 adds r0, r6, 0 subs r0, 0x8 adds r5, r0 movs r1, 0x8 ldrsh r0, [r5, r1] cmp r0, 0 beq @081DA284 cmp r0, 0x1 beq @081DA2AC movs r0, 0 strh r0, [r5, 0x8] strh r0, [r5, 0x20] adds r0, r4, 0 bl set_task_function_to_args_14_15 b @081DA2D4 .align 2, 0 .pool @081DA284: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @081DA2CE bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @081DA2D4 ldr r0, =0x03005d80 movs r1, 0x4 bl sub_80FC4F4 cmp r0, 0x1 bne @081DA2D4 b @081DA2CE .align 2, 0 .pool @081DA2AC: movs r0, 0 bl sub_80FC530 lsls r0, 24 cmp r0, 0 beq @081DA2D4 ldr r0, =0x03005d80 ldr r4, =0x020223c4 adds r1, r4, 0 movs r2, 0x4 bl memcpy ldr r0, =0x030060b8 adds r1, r4, 0 movs r2, 0x4 bl memcpy @081DA2CE: ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] @081DA2D4: pop {r4-r6} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA244 thumb_func_start sub_81DA2E8 sub_81DA2E8: ; 81DA2E8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 mov r9, r0 adds r0, r6 lsls r5, r0, 3 ldr r1, =0x03005e08 mov r8, r1 adds r0, r5, r1 adds r0, 0x18 bl sub_80FC670 cmp r0, 0 beq @081DA39E movs r0, 0x8 negs r0, r0 add r0, r8 mov r10, r0 adds r4, r5, r0 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @081DA338 cmp r0, 0x1 beq @081DA35A movs r0, 0 strh r0, [r4, 0x8] strh r0, [r4, 0x20] adds r0, r6, 0 bl set_task_function_to_args_14_15 b @081DA39E .align 2, 0 .pool @081DA338: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @081DA39E add r0, sp, 0x8 movs r1, 0x6E strh r1, [r0] movs r1, 0x2 bl sub_80FC4F4 cmp r0, 0x1 bne @081DA39E ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @081DA39E @081DA35A: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @081DA39E movs r1, 0 ldr r7, =0x02039f30 ldrb r0, [r7] cmp r1, r0 bge @081DA390 mov r0, r8 adds r0, 0xA adds r3, r5, r0 ldr r4, =0x020223c4 mov r2, sp movs r5, 0x80 lsls r5, 1 @081DA37C: ldrh r0, [r4] strh r0, [r2] strh r0, [r3] adds r3, 0x2 adds r4, r5 adds r2, 0x2 adds r1, 0x1 ldrb r0, [r7] cmp r1, r0 blt @081DA37C @081DA390: mov r0, r9 adds r1, r0, r6 lsls r1, 3 add r1, r10 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @081DA39E: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA2E8 thumb_func_start sub_81DA3B8 sub_81DA3B8: ; 81DA3B8 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC lsls r0, 24 lsrs r6, r0, 24 lsls r0, r6, 2 mov r9, r0 adds r0, r6 lsls r5, r0, 3 ldr r1, =0x03005e08 mov r8, r1 adds r0, r5, r1 adds r0, 0x18 bl sub_80FC670 cmp r0, 0 beq @081DA46E movs r0, 0x8 negs r0, r0 add r0, r8 mov r10, r0 adds r4, r5, r0 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @081DA408 cmp r0, 0x1 beq @081DA42A movs r0, 0 strh r0, [r4, 0x8] strh r0, [r4, 0x20] adds r0, r6, 0 bl set_task_function_to_args_14_15 b @081DA46E .align 2, 0 .pool @081DA408: bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @081DA46E ldrh r1, [r4, 0x1A] add r0, sp, 0x8 strh r1, [r0] movs r1, 0x2 bl sub_80FC4F4 cmp r0, 0x1 bne @081DA46E ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @081DA46E @081DA42A: bl sub_80FC55C lsls r0, 24 cmp r0, 0 beq @081DA46E movs r1, 0 ldr r7, =0x02039f30 ldrb r0, [r7] cmp r1, r0 bge @081DA460 mov r0, r8 adds r0, 0x2 adds r3, r5, r0 ldr r4, =0x020223c4 mov r2, sp movs r5, 0x80 lsls r5, 1 @081DA44C: ldrh r0, [r4] strh r0, [r2] strh r0, [r3] adds r3, 0x2 adds r4, r5 adds r2, 0x2 adds r1, 0x1 ldrb r0, [r7] cmp r1, r0 blt @081DA44C @081DA460: mov r0, r9 adds r1, r0, r6 lsls r1, 3 add r1, r10 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @081DA46E: add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA3B8 thumb_func_start sub_81DA488 sub_81DA488: ; 81DA488 push {r4-r7,lr} mov r7, r8 push {r7} lsls r0, 24 lsrs r6, r0, 24 lsls r7, r6, 2 adds r0, r7, r6 lsls r4, r0, 3 ldr r5, =0x03005e08 adds r0, r4, r5 adds r0, 0x18 bl sub_80FC670 cmp r0, 0 beq @081DA55C adds r0, r5, 0 subs r0, 0x8 adds r4, r0 movs r1, 0x8 ldrsh r0, [r4, r1] cmp r0, 0 beq @081DA4CC cmp r0, 0x1 beq @081DA50C movs r0, 0 strh r0, [r4, 0x8] strh r0, [r4, 0x20] adds r0, r6, 0 bl set_task_function_to_args_14_15 b @081DA55C .align 2, 0 .pool @081DA4CC: bl link_get_multiplayer_id lsls r0, 24 cmp r0, 0 bne @081DA4FA bl sub_800A520 lsls r0, 24 cmp r0, 0 beq @081DA55C ldr r0, =0x02039f30 ldrb r2, [r0] lsls r0, r2, 6 ldr r1, =0x02039e00 adds r0, r1 movs r1, 0x4 subs r1, r2 lsls r1, 22 lsrs r1, 16 bl sub_80FC4F4 cmp r0, 0x1 bne @081DA55C @081DA4FA: ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] b @081DA55C .align 2, 0 .pool @081DA50C: movs r0, 0 bl sub_80FC530 lsls r0, 24 cmp r0, 0 beq @081DA55C ldr r4, =0x02039f30 ldrb r3, [r4] lsls r0, r3, 6 ldr r5, =0x02039e00 adds r0, r5 ldr r1, =0x020223c4 movs r2, 0x4 subs r2, r3 lsls r2, 6 bl memcpy ldrb r4, [r4] mov r8, r7 cmp r4, 0x3 bgt @081DA54C lsls r0, r4, 6 adds r5, r0, r5 ldr r7, =0x020229e8 @081DA53C: ldrh r1, [r7, 0x1A] adds r0, r5, 0 bl sub_80DFA08 adds r5, 0x40 adds r4, 0x1 cmp r4, 0x3 ble @081DA53C @081DA54C: ldr r0, =0x03005e00 mov r2, r8 adds r1, r2, r6 lsls r1, 3 adds r1, r0 ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] @081DA55C: pop {r3} mov r8, r3 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA488 thumb_func_start sub_81DA57C sub_81DA57C: ; 81DA57C push {lr} ldr r0, =0x00000864 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, =gUnknown_0862AD34 movs r1, 0x8 movs r2, 0x5 bl sub_81DA5D4 b @081DA5CA .align 2, 0 .pool @081DA5C0: ldr r0, =gUnknown_0862AD44 movs r1, 0x7 movs r2, 0x1 bl sub_81DA5D4 @081DA5CA: pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA57C thumb_func_start sub_81DA5D4 sub_81DA5D4: ; 81DA5D4 push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x8 mov r9, r0 adds r7, r1, 0 mov r10, r2 movs r6, 0 movs r0, 0x5 mov r8, r0 movs r5, 0 cmp r5, r7 bcs @081DA61C mov r4, r9 @081DA5F4: ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r4] ldr r2, =0x000009ca adds r0, r2 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @081DA614 adds r0, r1, 0 bl sub_81DA6CC cmp r8, r0 ble @081DA612 mov r8, r0 @081DA612: adds r6, 0x1 @081DA614: adds r4, 0x2 adds r5, 0x1 cmp r5, r7 bcc @081DA5F4 @081DA61C: cmp r6, 0 beq @081DA6BA cmp r8, r10 bhi @081DA6BA movs r6, 0 movs r5, 0 cmp r5, r7 bcs @081DA654 mov r4, r9 @081DA62E: ldr r0, =0x03005d8c ldr r0, [r0] ldrh r1, [r4] ldr r2, =0x000009ca adds r0, r2 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @081DA64C adds r0, r1, 0 bl sub_81DA6CC cmp r0, r8 bne @081DA64C adds r6, 0x1 @081DA64C: adds r4, 0x2 adds r5, 0x1 cmp r5, r7 bcc @081DA62E @081DA654: cmp r6, 0 beq @081DA6BA bl GenerateRandomNumber lsls r0, 16 lsrs r0, 16 adds r1, r6, 0 bl __modsi3 adds r6, r0, 0 movs r5, 0 cmp r5, r7 bcs @081DA6BA ldr r2, =0x03005d8c ldr r3, =0x000009ca mov r4, r9 @081DA674: ldr r0, [r2] ldrh r1, [r4] adds r0, r3 adds r0, r1 ldrb r0, [r0] cmp r0, 0 bne @081DA6B2 adds r0, r1, 0 str r2, [sp] str r3, [sp, 0x4] bl sub_81DA6CC ldr r2, [sp] ldr r3, [sp, 0x4] cmp r0, r8 bne @081DA6B2 cmp r6, 0 bne @081DA6B0 ldr r0, [r2] adds r0, r3 ldrh r4, [r4] adds r0, r4 mov r1, r8 strb r1, [r0] b @081DA6BA .align 2, 0 .pool @081DA6B0: subs r6, 0x1 @081DA6B2: adds r4, 0x2 adds r5, 0x1 cmp r5, r7 bcc @081DA674 @081DA6BA: add sp, 0x8 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r0} bx r0 thumb_func_end sub_81DA5D4 thumb_func_start sub_81DA6CC sub_81DA6CC: ; 81DA6CC push {r4-r6,lr} adds r5, r0, 0 movs r4, 0 ldr r6, =gUnknown_085500A4 @081DA6D4: lsls r0, r4, 1 lsls r1, r5, 4 adds r0, r1 adds r0, r6 ldrh r0, [r0] bl trainer_flag_check lsls r0, 24 cmp r0, 0 bne @081DA6F0 adds r0, r4, 0 b @081DA6F8 .align 2, 0 .pool @081DA6F0: adds r4, 0x1 cmp r4, 0x4 ble @081DA6D4 movs r0, 0x5 @081DA6F8: pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81DA6CC thumb_func_start sub_81DA700 sub_81DA700: ; 81DA700 push {lr} sub sp, 0x8 add r1, sp, 0x4 mov r0, sp bl sub_8149F58 ldr r0, =gUnknown_0862AD54 ldr r1, [sp, 0x4] bl LZ77UnCompVram ldr r0, =gUnknown_0862AF30 ldr r1, [sp] bl LZ77UnCompVram ldr r0, =gUnknown_0862B53C movs r1, 0xF0 movs r2, 0x20 bl gpu_pal_apply ldr r0, =gUnknown_0862B724 bl gpu_tile_obj_decompress_and_load ldr r0, =gUnknown_0862B72C bl gpu_pal_obj_alloc_tag_and_apply add sp, 0x8 pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA700 thumb_func_start sub_81DA74C sub_81DA74C: ; 81DA74C push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0x4 adds r5, r0, 0 adds r6, r1, 0 ldr r0, [sp, 0x24] ldr r1, [sp, 0x28] ldr r4, [sp, 0x2C] lsls r2, 24 lsrs r2, 24 str r2, [sp] lsls r3, 24 lsrs r3, 24 mov r10, r3 lsls r0, 24 lsrs r0, 24 mov r8, r0 lsls r1, 24 lsrs r1, 24 mov r9, r1 lsls r4, 24 lsrs r7, r4, 24 ldr r0, =gUnknown_0862B758 lsls r5, 16 asrs r5, 16 lsls r6, 16 asrs r6, 16 adds r1, r5, 0 adds r2, r6, 0 movs r3, 0 bl 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 .pool @081DA7A8: cmp r7, 0x2 beq @081DA7E4 @081DA7AC: ldr r6, =0x02020630 lsls r3, r5, 4 b @081DA7F8 .align 2, 0 .pool @081DA7B8: ldr r2, =0x02020630 lsls r3, r5, 4 adds r0, r3, r5 lsls r0, 2 adds r0, r2 movs r1, 0x78 strh r1, [r0, 0x2E] movs r1, 0x2D b @081DA7F4 .align 2, 0 .pool @081DA7D0: ldr r2, =0x02020630 lsls r3, r5, 4 adds r0, r3, r5 lsls r0, 2 adds r0, r2 movs r1, 0x59 b @081DA7F0 .align 2, 0 .pool @081DA7E4: ldr r2, =0x02020630 lsls r3, r5, 4 adds r0, r3, r5 lsls r0, 2 adds r0, r2 movs r1, 0x97 @081DA7F0: strh r1, [r0, 0x2E] movs r1, 0x61 @081DA7F4: strh r1, [r0, 0x30] adds r6, r2, 0 @081DA7F8: adds r4, r3, r5 lsls r4, 2 adds r0, r4, r6 mov r2, r8 lsls r1, r2, 24 asrs r1, 24 movs r2, 0 strh r1, [r0, 0x32] mov r3, r9 lsls r1, r3, 24 asrs r1, 24 strh r1, [r0, 0x34] mov r1, sp ldrh r1, [r1] strh r1, [r0, 0x3A] mov r3, r10 strh r3, [r0, 0x3C] strh r2, [r0, 0x36] strh r2, [r0, 0x38] adds r1, r7, 0 bl obj_anim_image_start adds r0, r6, 0 adds r0, 0x1C adds r4, r0 ldr r0, =sub_81DA848 str r0, [r4] adds r0, r5, 0 add sp, 0x4 pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81DA74C thumb_func_start sub_81DA848 sub_81DA848: ; 81DA848 push {r4,r5,lr} adds r3, r0, 0 adds r2, r3, 0 adds r2, 0x2E movs r0, 0x20 ldrsh r1, [r3, r0] movs r4, 0x2E ldrsh r0, [r3, r4] cmp r1, r0 bne @081DA874 movs r5, 0x22 ldrsh r1, [r3, r5] movs r4, 0x2 ldrsh r0, [r2, r4] cmp r1, r0 bne @081DA874 ldr r0, =nullsub_12 str r0, [r3, 0x1C] b @081DA8B4 .align 2, 0 .pool @081DA874: ldrh r4, [r2, 0x8] movs r5, 0x8 ldrsh r1, [r2, r5] movs r5, 0xC ldrsh r0, [r2, r5] cmp r1, r0 bne @081DA890 ldrh r0, [r2, 0x4] ldrh r1, [r3, 0x20] adds r0, r1 movs r1, 0 strh r0, [r3, 0x20] strh r1, [r2, 0x8] b @081DA894 @081DA890: adds r0, r4, 0x1 strh r0, [r2, 0x8] @081DA894: ldrh r4, [r2, 0xA] movs r5, 0xA ldrsh r1, [r2, r5] movs r5, 0xE ldrsh r0, [r2, r5] cmp r1, r0 bne @081DA8B0 ldrh r0, [r2, 0x6] ldrh r1, [r3, 0x22] adds r0, r1 movs r1, 0 strh r0, [r3, 0x22] strh r1, [r2, 0xA] b @081DA8B4 @081DA8B0: adds r0, r4, 0x1 strh r0, [r2, 0xA] @081DA8B4: pop {r4,r5} pop {r0} bx r0 thumb_func_end sub_81DA848 thumb_func_start sub_81DA8BC sub_81DA8BC: ; 81DA8BC push {r4-r7,lr} mov r7, r10 mov r6, r9 mov r5, r8 push {r5-r7} sub sp, 0xC adds r6, r0, 0 mov r8, r1 ldr r0, [sp, 0x2C] ldr r1, [sp, 0x30] ldr r4, [sp, 0x34] ldr r5, [sp, 0x38] lsls r2, 16 lsrs r2, 16 str r2, [sp] lsls r3, 16 lsrs r3, 16 str r3, [sp, 0x4] lsls r0, 16 lsrs r0, 16 mov r10, r0 lsls r1, 16 lsrs r1, 16 mov r9, r1 lsls r4, 16 lsrs r7, r4, 16 lsls r5, 24 lsrs r5, 24 ldr r0, =gUnknown_0862B758 lsls r6, 16 asrs r6, 16 mov r1, r8 lsls r1, 16 asrs r1, 16 mov r8, r1 adds r1, r6, 0 mov r2, r8 movs r3, 0 bl 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 .pool @081DA924: cmp r5, 0x2 beq @081DA960 @081DA928: ldr r2, =0x02020630 lsls r3, r6, 4 b @081DA972 .align 2, 0 .pool @081DA934: ldr r2, =0x02020630 lsls r3, r6, 4 adds r0, r3, r6 lsls r0, 2 adds r0, r2 movs r1, 0x78 strh r1, [r0, 0x2E] movs r1, 0x2D b @081DA970 .align 2, 0 .pool @081DA94C: ldr r2, =0x02020630 lsls r3, r6, 4 adds r0, r3, r6 lsls r0, 2 adds r0, r2 movs r1, 0x59 b @081DA96C .align 2, 0 .pool @081DA960: ldr r2, =0x02020630 lsls r3, r6, 4 adds r0, r3, r6 lsls r0, 2 adds r0, r2 movs r1, 0x97 @081DA96C: strh r1, [r0, 0x2E] movs r1, 0x61 @081DA970: strh r1, [r0, 0x30] @081DA972: adds r4, r3, r6 lsls r4, 2 adds r0, r4, r2 mov r3, sp ldrh r3, [r3] strh r3, [r0, 0x32] mov r1, sp ldrh r1, [r1, 0x4] strh r1, [r0, 0x34] mov r3, r10 strh r3, [r0, 0x36] mov r1, r9 strh r1, [r0, 0x38] strh r7, [r0, 0x3A] adds r1, r5, 0 str r2, [sp, 0x8] bl obj_anim_image_start ldr r2, [sp, 0x8] adds r0, r2, 0 adds r0, 0x1C adds r4, r0 ldr r0, =sub_81DA9BC str r0, [r4] adds r0, r6, 0 add sp, 0xC pop {r3-r5} mov r8, r3 mov r9, r4 mov r10, r5 pop {r4-r7} pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81DA8BC thumb_func_start sub_81DA9BC sub_81DA9BC: ; 81DA9BC push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x32] bl sine2 lsls r0, 16 asrs r0, 16 movs r2, 0x36 ldrsh r1, [r4, r2] muls r0, r1 asrs r0, 12 strh r0, [r4, 0x24] ldrh r0, [r4, 0x32] bl cosine2 lsls r0, 16 asrs r0, 16 movs r3, 0x36 ldrsh r1, [r4, r3] muls r0, r1 asrs r0, 12 strh r0, [r4, 0x26] movs r1, 0x32 ldrsh r0, [r4, r1] movs r2, 0x34 ldrsh r1, [r4, r2] adds r0, r1 movs r1, 0xB4 lsls r1, 1 bl __modsi3 strh r0, [r4, 0x32] ldrh r2, [r4, 0x36] movs r3, 0x36 ldrsh r1, [r4, r3] movs r3, 0x38 ldrsh r0, [r4, r3] cmp r1, r0 beq @081DAA12 ldrh r0, [r4, 0x3A] adds r0, r2, r0 strh r0, [r4, 0x36] b @081DAA16 @081DAA12: ldr r0, =nullsub_12 str r0, [r4, 0x1C] @081DAA16: pop {r4} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DA9BC thumb_func_start sub_81DAA20 sub_81DAA20: ; 81DAA20 push {r4,r5,lr} adds r5, r0, 0 ldr r4, =0x00002e90 adds r0, r4, 0 bl 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, =0x02020630 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 .pool thumb_func_end sub_81DAA20 thumb_func_start sub_81DAA74 sub_81DAA74: ; 81DAA74 push {r4,r5,lr} adds r3, r0, 0 ldr r2, =0x02020630 movs r0, 0x10 ldrsh r1, [r3, r0] lsls r0, r1, 4 adds r0, r1 lsls r0, 2 adds r5, r2, 0 adds r5, 0x1C adds r0, r5 ldr r4, [r0] ldr r0, =nullsub_12 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 .pool @081DAAC4: movs r0, 0 @081DAAC6: pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81DAA74 thumb_func_start sub_81DAACC sub_81DAACC: ; 81DAACC push {r4,lr} adds r4, r0, 0 movs r1, 0xA ldrsh r0, [r4, r1] cmp r0, 0 beq @081DAB20 bl sub_81DA700 ldr r1, =0x00003f41 movs r0, 0x50 bl 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 .pool @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, =gUnknown_0862B770 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @081DABEE: movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @081DABEE pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DABDC thumb_func_start sub_81DAC14 sub_81DAC14: ; 81DAC14 push {r4-r6,lr} sub sp, 0xC adds r6, r0, 0 movs r1, 0x33 negs r1, r1 movs r0, 0 str r0, [sp] movs r5, 0x2 str r5, [sp, 0x4] str r0, [sp, 0x8] movs r0, 0x78 movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x10] movs r0, 0x7 negs r0, r0 str r5, [sp] movs r4, 0x2 negs r4, r4 str r4, [sp, 0x4] movs r1, 0x1 str r1, [sp, 0x8] movs r1, 0xC1 movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x12] str r4, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] movs r0, 0xF7 movs r1, 0xC1 movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r6, 0x14] ldrh r0, [r6, 0x8] adds r0, 0x1 strh r0, [r6, 0x8] movs r0, 0 add sp, 0xC pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81DAC14 thumb_func_start sub_81DAC80 sub_81DAC80: ; 81DAC80 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081DACA4 adds r0, r2, 0 bl sub_81DAA20 ldr r0, =sub_81DABDC bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @081DACA4: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81DAC80 thumb_func_start sub_81DACB4 sub_81DACB4: ; 81DACB4 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_0862B784 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @081DACC6: movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @081DACC6 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DACB4 thumb_func_start sub_81DACEC sub_81DACEC: ; 81DACEC push {r4,r5,lr} sub sp, 0xC adds r5, r0, 0 movs r0, 0 str r0, [sp] movs r4, 0x4 negs r4, r4 str r4, [sp, 0x4] str r0, [sp, 0x8] movs r0, 0x78 movs r1, 0xC5 movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x10] str r4, [sp] movs r4, 0x2 str r4, [sp, 0x4] movs r0, 0x1 str r0, [sp, 0x8] movs r0, 0xF1 movs r1, 0x3B movs r2, 0 movs r3, 0x1 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x12] movs r0, 0x1 negs r0, r0 movs r1, 0x4 str r1, [sp] str r4, [sp, 0x4] str r4, [sp, 0x8] movs r1, 0x3B movs r2, 0 movs r3, 0x1 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r5, 0x14] ldrh r0, [r5, 0x8] adds r0, 0x1 strh r0, [r5, 0x8] movs r0, 0 add sp, 0xC pop {r4,r5} pop {r1} bx r1 thumb_func_end sub_81DACEC thumb_func_start sub_81DAD58 sub_81DAD58: ; 81DAD58 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081DAD7C adds r0, r2, 0 bl sub_81DAA20 ldr r0, =sub_81DACB4 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @081DAD7C: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81DAD58 thumb_func_start sub_81DAD8C sub_81DAD8C: ; 81DAD8C push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_0862B798 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @081DAD9E: movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @081DAD9E pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DAD8C thumb_func_start sub_81DADC4 sub_81DADC4: ; 81DADC4 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x10 mov r8, r0 movs r6, 0x80 str r6, [sp] movs r4, 0 str r4, [sp, 0x4] movs r5, 0x4 negs r5, r5 str r5, [sp, 0x8] str r4, [sp, 0xC] movs r0, 0x78 movs r1, 0x2D movs r2, 0xC movs r3, 0x4 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 mov r1, r8 strh r0, [r1, 0x10] str r6, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] movs r0, 0x1 str r0, [sp, 0xC] movs r0, 0x59 movs r1, 0x61 movs r2, 0xFC movs r3, 0x4 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 mov r1, r8 strh r0, [r1, 0x12] str r6, [sp] str r4, [sp, 0x4] str r5, [sp, 0x8] movs r0, 0x2 str r0, [sp, 0xC] movs r0, 0x97 movs r1, 0x61 movs r2, 0x84 movs r3, 0x4 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 mov r1, r8 strh r0, [r1, 0x14] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] movs r0, 0 add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81DADC4 thumb_func_start sub_81DAE44 sub_81DAE44: ; 81DAE44 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081DAE68 adds r0, r2, 0 bl sub_81DAA20 ldr r0, =sub_81DAD8C bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @081DAE68: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81DAE44 thumb_func_start sub_81DAE78 sub_81DAE78: ; 81DAE78 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_0862B7AC ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @081DAE8A: movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @081DAE8A pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DAE78 thumb_func_start sub_81DAEB0 sub_81DAEB0: ; 81DAEB0 push {r4-r6,lr} mov r6, r8 push {r6} sub sp, 0x10 mov r8, r0 movs r2, 0x8E lsls r2, 1 movs r6, 0x83 str r6, [sp] movs r5, 0x23 str r5, [sp, 0x4] movs r4, 0x3 negs r4, r4 str r4, [sp, 0x8] movs r0, 0 str r0, [sp, 0xC] movs r0, 0x78 movs r1, 0x50 movs r3, 0x8 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 mov r1, r8 strh r0, [r1, 0x10] str r6, [sp] str r5, [sp, 0x4] str r4, [sp, 0x8] movs r0, 0x1 str r0, [sp, 0xC] movs r0, 0x78 movs r1, 0x50 movs r2, 0x2C movs r3, 0x8 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 mov r1, r8 strh r0, [r1, 0x12] str r6, [sp] str r5, [sp, 0x4] str r4, [sp, 0x8] movs r0, 0x2 str r0, [sp, 0xC] movs r0, 0x79 movs r1, 0x50 movs r2, 0xA4 movs r3, 0x8 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 mov r1, r8 strh r0, [r1, 0x14] ldrh r0, [r1, 0x8] adds r0, 0x1 strh r0, [r1, 0x8] movs r0, 0 add sp, 0x10 pop {r3} mov r8, r3 pop {r4-r6} pop {r1} bx r1 thumb_func_end sub_81DAEB0 thumb_func_start sub_81DAF34 sub_81DAF34: ; 81DAF34 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081DAF58 adds r0, r2, 0 bl sub_81DAA20 ldr r0, =sub_81DAE78 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @081DAF58: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81DAF34 thumb_func_start sub_81DAF68 sub_81DAF68: ; 81DAF68 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_0862B7C0 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @081DAF7A: movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @081DAF7A pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DAF68 thumb_func_start sub_81DAFA0 sub_81DAFA0: ; 81DAFA0 push {r4,lr} sub sp, 0xC adds r4, r0, 0 movs r0, 0xA ldrsh r2, [r4, r0] cmp r2, 0 bne @081DAFCC movs r1, 0x33 negs r1, r1 str r2, [sp] movs r0, 0x4 str r0, [sp, 0x4] str r2, [sp, 0x8] movs r0, 0x78 movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x10] b @081DB01A @081DAFCC: cmp r2, 0x10 bne @081DAFF2 movs r0, 0x7 negs r0, r0 movs r1, 0x4 str r1, [sp] subs r1, 0x8 str r1, [sp, 0x4] movs r1, 0x1 str r1, [sp, 0x8] movs r1, 0xC1 movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x12] b @081DB01A @081DAFF2: cmp r2, 0x20 bne @081DB01A movs r0, 0x4 negs r0, r0 str r0, [sp] str r0, [sp, 0x4] movs r0, 0x2 str r0, [sp, 0x8] movs r0, 0xF7 movs r1, 0xC1 movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x14] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @081DB01A: ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] movs r0, 0 add sp, 0xC pop {r4} pop {r1} bx r1 thumb_func_end sub_81DAFA0 thumb_func_start sub_81DB02C sub_81DB02C: ; 81DB02C push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081DB050 adds r0, r2, 0 bl sub_81DAA20 ldr r0, =sub_81DAF68 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @081DB050: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81DB02C thumb_func_start sub_81DB060 sub_81DB060: ; 81DB060 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_0862B7D4 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @081DB072: movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @081DB072 pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DB060 thumb_func_start sub_81DB098 sub_81DB098: ; 81DB098 push {r4,lr} sub sp, 0xC adds r4, r0, 0 movs r0, 0xA ldrsh r1, [r4, r0] cmp r1, 0 bne @081DB0C4 str r1, [sp] movs r0, 0x8 negs r0, r0 str r0, [sp, 0x4] str r1, [sp, 0x8] movs r0, 0x78 movs r1, 0xC5 movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x10] b @081DB112 @081DB0C4: cmp r1, 0x10 bne @081DB0E8 movs r0, 0x8 negs r0, r0 str r0, [sp] movs r0, 0x1 str r0, [sp, 0x4] str r0, [sp, 0x8] movs r0, 0xF1 movs r1, 0x4E movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x12] b @081DB112 @081DB0E8: cmp r1, 0x20 bne @081DB112 movs r0, 0x1 negs r0, r0 movs r1, 0x8 str r1, [sp] movs r1, 0x1 str r1, [sp, 0x4] movs r1, 0x2 str r1, [sp, 0x8] movs r1, 0x4E movs r2, 0 movs r3, 0 bl sub_81DA74C lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x14] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @081DB112: ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] movs r0, 0 add sp, 0xC pop {r4} pop {r1} bx r1 thumb_func_end sub_81DB098 thumb_func_start sub_81DB124 sub_81DB124: ; 81DB124 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081DB148 adds r0, r2, 0 bl sub_81DAA20 ldr r0, =sub_81DB060 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @081DB148: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81DB124 thumb_func_start sub_81DB158 sub_81DB158: ; 81DB158 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_0862B7E8 ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @081DB16A: movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @081DB16A pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DB158 thumb_func_start sub_81DB190 sub_81DB190: ; 81DB190 push {r4,lr} sub sp, 0x10 adds r4, r0, 0 movs r0, 0xA ldrsh r1, [r4, r0] cmp r1, 0 bne @081DB1BE movs r0, 0x80 str r0, [sp] str r1, [sp, 0x4] subs r0, 0x84 str r0, [sp, 0x8] str r1, [sp, 0xC] movs r0, 0x78 movs r1, 0x2D movs r2, 0xC movs r3, 0x4 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x10] b @081DB212 @081DB1BE: cmp r1, 0x10 bne @081DB1E6 movs r0, 0x80 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] subs r0, 0x4 str r0, [sp, 0x8] movs r0, 0x1 str r0, [sp, 0xC] movs r0, 0x59 movs r1, 0x61 movs r2, 0xFC movs r3, 0x4 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x12] b @081DB212 @081DB1E6: cmp r1, 0x20 bne @081DB212 movs r0, 0x80 str r0, [sp] movs r0, 0 str r0, [sp, 0x4] subs r0, 0x4 str r0, [sp, 0x8] movs r0, 0x2 str r0, [sp, 0xC] movs r0, 0x97 movs r1, 0x61 movs r2, 0x84 movs r3, 0x4 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x14] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @081DB212: ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] movs r0, 0 add sp, 0x10 pop {r4} pop {r1} bx r1 thumb_func_end sub_81DB190 thumb_func_start sub_81DB224 sub_81DB224: ; 81DB224 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081DB248 adds r0, r2, 0 bl sub_81DAA20 ldr r0, =sub_81DB158 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @081DB248: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool thumb_func_end sub_81DB224 thumb_func_start sub_81DB258 sub_81DB258: ; 81DB258 push {r4,r5,lr} lsls r0, 24 lsrs r0, 24 ldr r5, =gUnknown_0862B7FC ldr r2, =0x03005e00 lsls r1, r0, 2 adds r1, r0 lsls r1, 3 adds r4, r1, r2 @081DB26A: movs r1, 0x8 ldrsh r0, [r4, r1] lsls r0, 2 adds r0, r5 ldr r1, [r0] adds r0, r4, 0 bl _call_via_r1 lsls r0, 24 cmp r0, 0 bne @081DB26A pop {r4,r5} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DB258 thumb_func_start sub_81DB290 sub_81DB290: ; 81DB290 push {r4,lr} sub sp, 0x10 adds r4, r0, 0 movs r0, 0xA ldrsh r1, [r4, r0] cmp r1, 0 bne @081DB2C2 movs r2, 0x8E lsls r2, 1 movs r0, 0x83 str r0, [sp] movs r0, 0x23 str r0, [sp, 0x4] subs r0, 0x26 str r0, [sp, 0x8] str r1, [sp, 0xC] movs r0, 0x78 movs r1, 0x50 movs r3, 0x8 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x10] b @081DB316 @081DB2C2: cmp r1, 0x10 bne @081DB2EA movs r0, 0x83 str r0, [sp] movs r0, 0x23 str r0, [sp, 0x4] subs r0, 0x26 str r0, [sp, 0x8] movs r0, 0x1 str r0, [sp, 0xC] movs r0, 0x78 movs r1, 0x50 movs r2, 0x2C movs r3, 0x8 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x12] b @081DB316 @081DB2EA: cmp r1, 0x20 bne @081DB316 movs r0, 0x83 str r0, [sp] movs r0, 0x23 str r0, [sp, 0x4] subs r0, 0x26 str r0, [sp, 0x8] movs r0, 0x2 str r0, [sp, 0xC] movs r0, 0x79 movs r1, 0x50 movs r2, 0xA4 movs r3, 0x8 bl sub_81DA8BC lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0x14] ldrh r0, [r4, 0x8] adds r0, 0x1 strh r0, [r4, 0x8] @081DB316: ldrh r0, [r4, 0xA] adds r0, 0x1 strh r0, [r4, 0xA] movs r0, 0 add sp, 0x10 pop {r4} pop {r1} bx r1 thumb_func_end sub_81DB290 thumb_func_start sub_81DB328 sub_81DB328: ; 81DB328 push {lr} adds r2, r0, 0 ldr r0, =0x02037fd4 ldrb r1, [r0, 0x7] movs r0, 0x80 ands r0, r1 cmp r0, 0 bne @081DB34C adds r0, r2, 0 bl sub_81DAA20 ldr r0, =sub_81DB258 bl get_task_id_by_function lsls r0, 24 lsrs r0, 24 bl remove_task @081DB34C: movs r0, 0 pop {r1} bx r1 .align 2, 0 .pool 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, =gPokedexEntries adds r2, r1 adds r1, r2, 0 bl gf_strcpy movs r1, 0 strb r1, [r0] adds r0, 0x1 ldr r1, =gUnknown_085E8268 bl gf_strcpy pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DB468 thumb_func_start sub_81DB494 sub_81DB494: ; 81DB494 push {r4-r7,lr} adds r6, r1, 0 adds r5, r2, 0 adds r7, r3, 0 cmp r5, 0 beq @081DB4B6 adds r1, r5, 0 bl 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, =0x02020004 adds r4, r0 lsls r7, r3, 5 ldrb r0, [r4, 0x3] lsls r6, r0, 5 muls r2, r6 ldr r0, [r4, 0x8] adds r0, r2 lsls r1, 5 adds r5, r0, r1 ldr r0, [sp, 0x18] cmp r0, 0 ble @081DB66C adds r4, r0, 0 @081DB646: ldr r0, =0x11111111 str r0, [sp] adds r2, r7, 0 cmp r2, 0 bge @081DB652 adds r2, 0x3 @081DB652: lsls r2, 9 lsrs r2, 11 movs r0, 0x80 lsls r0, 17 orrs r2, r0 mov r0, sp adds r1, r5, 0 bl CpuFastSet adds r5, r6 subs r4, 0x1 cmp r4, 0 bne @081DB646 @081DB66C: add sp, 0x4 pop {r4-r7} pop {r0} bx r0 .align 2, 0 .pool thumb_func_end sub_81DB620 .include "data/data1.s" .include "asm/unknown_lib_1.s" .include "asm/libmks4agb.s" .include "asm/libagbbackup.s" .include "asm/unknown_lib_2.s" .include "asm/librfu.s" .include "asm/libagbsyscall.s" .include "asm/libgcc.s" .include "data/data2.s"